From a0c9e1494593353ad862cc532d958761e2cdd705 Mon Sep 17 00:00:00 2001 From: ahmed-salah Date: Tue, 4 Aug 2026 15:15:52 +0300 Subject: [PATCH] fix(themes): use checkValidity for live price gating --- public/product.js | 2 +- src/assets/js/product.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/product.js b/public/product.js index 95d3c04e1..c079c46c7 100644 --- a/public/product.js +++ b/public/product.js @@ -1 +1 @@ -(()=>{var e={194(e,t,n){"use strict";class o{constructor(){}onReady(){}registerEvents(){}initiate(e){if(e&&!e.includes(salla.config.get("page.slug")))return app.log(`The Class For (${e.join(",")}) Skipped.`);this.onReady(),this.registerEvents(),app.log(`The Class For (${e?.join(",")||"*"}) Loaded🎉`)}}o.initiateWhenReady=function(e=null){"ready"===window.app?.status?(new this).initiate(e):document.addEventListener("theme::ready",()=>(new this).initiate(e))};const i=o;n.d(t,["A",0,i])},490(e){window,e.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var o,i="fslightbox-",s="".concat(i,"styles"),r="".concat(i,"cursor-grabbing"),a="".concat(i,"full-dimension"),c="".concat(i,"flex-centered"),l="".concat(i,"open"),d="".concat(i,"transform-transition"),u="".concat(i,"absoluted"),p="".concat(i,"slide-btn"),h="".concat(p,"-container"),f="".concat(i,"fade-in"),m="".concat(i,"fade-out"),g=f+"-strong",v=m+"-strong",b="".concat(i,"opacity-"),x="".concat(b,"1"),y="".concat(i,"source");function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(e){var t,n=e.props,o=0,i={};this.getSourceTypeFromLocalStorageByUrl=function(e){return t[e]?t[e]:s(e)},this.handleReceivedSourceTypeForUrl=function(e,n){if(!1===i[n]&&(o--,"invalid"!==e?i[n]=e:delete i[n],0===o)){!function(e,t){for(var n in t)e[n]=t[n]}(t,i);try{localStorage.setItem("fslightbox-types",JSON.stringify(t))}catch(e){}}};var s=function(e){o++,i[e]=!1};if(n.disableLocalStorage)this.getSourceTypeFromLocalStorageByUrl=function(){},this.handleReceivedSourceTypeForUrl=function(){};else{try{t=JSON.parse(localStorage.getItem("fslightbox-types"))}catch(e){}t||(t={},this.getSourceTypeFromLocalStorageByUrl=s)}}function S(e,t,n,o){e.data;var i=e.elements.sources,s=n/o,r=0;this.adjustSize=function(){if((r=e.mw/s)e.mh?e.mh:o,a()};var a=function(){i[t].style.width=r*s+"px",i[t].style.height=r+"px"}}function E(e,t){var n=this,o=e.collections.sourceSizers,i=e.elements,s=i.sourceAnimationWrappers,r=i.sources,a=e.isl,c=e.props.onSourceLoad,l=e.resolve;function d(e,n){o[t]=l(S,[t,e,n]),o[t].adjustSize()}this.b=function(e,o){r[t].classList.add(x),n.a(),d(e,o),n.b=d},this.a=function(){a[t]=!0,s[t].classList.add(g),s[t].removeChild(s[t].firstChild),c&&c(e,r[t],t)}}function A(e,t){var n,o=this,i=e.elements.sources,s=e.props,r=(0,e.resolve)(E,[t]);this.handleImageLoad=function(e){var t=e.target,n=t.naturalWidth,o=t.naturalHeight;r.b(n,o)},this.handleVideoLoad=function(e){var t=e.target,o=t.videoWidth,i=t.videoHeight;n=!0,r.b(o,i)},this.handleNotMetaDatedVideoLoad=function(){n||o.handleYoutubeLoad()},this.handleYoutubeLoad=function(e,t){e||(e=1920,t=1080),s.maxYoutubeDimensions&&(e=s.maxYoutubeDimensions.width,t=s.maxYoutubeDimensions.height),r.b(e,t)},this.handleCustomLoad=function(){var e=i[t],n=e.offsetWidth,s=e.offsetHeight;n&&s?r.b(n,s):setTimeout(o.handleCustomLoad)}}function P(e,t,n){var o=e.elements.sources,i=e.props.customClasses,s=i[t]?i[t]:"";o[t].className=n+" "+s}function C(e,t){var n=e.elements.sources,o=e.props.customAttributes;for(var i in o[t])n[t].setAttribute(i,o[t][i])}function I(e,t){var n=e.collections.sourceLoadHandlers,o=e.elements,i=o.sources,s=o.sourceAnimationWrappers,r=e.props.sources;i[t]=document.createElement("img"),P(e,t,y),i[t].src=r[t],i[t].onload=n[t].handleImageLoad,C(e,t),s[t].appendChild(i[t])}function T(e,t){var n=e.ap,o=e.collections.sourceLoadHandlers,i=e.elements,s=i.sources,r=i.sourceAnimationWrappers,a=e.props,c=a.sources,l=a.videosPosters,d=document.createElement("video"),u=document.createElement("source");s[t]=d,P(e,t,"".concat(y," fslightboxv")),d.src=c[t],d.onloadedmetadata=function(e){return o[t].handleVideoLoad(e)},d.controls=!0,d.autoplay=n.i(t),C(e,t),l[t]&&(s[t].poster=l[t]),u.src=c[t],d.appendChild(u),setTimeout(o[t].handleNotMetaDatedVideoLoad,3e3),r[t].appendChild(s[t])}function F(e,t){var n=e.ap,o=e.collections.sourceLoadHandlers,s=e.elements,r=s.sources,a=s.sourceAnimationWrappers,c=e.props.sources[t],l=c.split("?")[1],d=document.createElement("iframe");r[t]=d,P(e,t,"".concat(y," ").concat(i,"youtube-iframe")),d.src="https://www.youtube.com/embed/".concat(c.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/)[2],"?").concat(l||"").concat(n.i(t)?"&mute=1&autoplay=1":"","&enablejsapi=1"),d.allowFullscreen=!0,C(e,t),a[t].appendChild(d),o[t].handleYoutubeLoad(parseInt(d.width),parseInt(d.height))}function k(e,t){var n=e.collections.sourceLoadHandlers,o=e.elements,i=o.sources,s=o.sourceAnimationWrappers,r=e.props.sources;i[t]=r[t],P(e,t,"".concat(i[t].className," ").concat(y)),s[t].appendChild(i[t]),n[t].handleCustomLoad()}function z(e,t){var n=e.elements,o=n.sources,s=n.sourceAnimationWrappers;e.props.sources,o[t]=document.createElement("div"),o[t].className="".concat(i,"invalid-file-wrapper ").concat(c),o[t].innerHTML="Invalid source",s[t].appendChild(o[t]),new E(e,t).a()}function M(e){var t=e.collections,n=t.sourceLoadHandlers,o=t.sourcesRenderFunctions,i=e.core.sourceDisplayFacade,s=e.resolve;this.runActionsForSourceTypeAndIndex=function(t,r){var a;switch("invalid"!==t&&(n[r]=s(A,[r])),t){case"image":a=I;break;case"video":a=T;break;case"youtube":a=F;break;case"custom":a=k;break;default:a=z}o[r]=function(){return a(e,r)},i.displaySourcesWhichShouldBeDisplayed()}}function R(e,t,n){var o=e.props,i=o.types,s=o.type,r=o.sources;this.getTypeSetByClientForIndex=function(e){var t;return i&&i[e]?t=i[e]:s&&(t=s),t},this.retrieveTypeWithXhrForIndex=function(e){!function(e,t){var n=document.createElement("a");n.href=e;var o=n.hostname;if("www.youtube.com"===o||"youtu.be"===o)return t("youtube");var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4!==i.readyState){if(2===i.readyState){var e,n=i.getResponseHeader("content-type");switch(n.slice(0,n.indexOf("/"))){case"image":e="image";break;case"video":e="video";break;default:e="invalid"}i.onreadystatechange=null,i.abort(),t(e)}}else t("invalid")},i.open("GET",e),i.send()}(r[e],function(o){t.handleReceivedSourceTypeForUrl(o,r[e]),n.runActionsForSourceTypeAndIndex(o,e)})}}function N(e,t){var n=e.core.stageManager,o=e.elements,i=o.smw,s=o.sourceWrappersContainer,r=e.props,l=0,p=document.createElement("div");function h(e){p.style.transform="translateX(".concat(e+l,"px)"),l=0}function f(){return(1+r.slideDistance)*innerWidth}p.className="".concat(u," ").concat(a," ").concat(c),p.s=function(){p.style.display="flex"},p.h=function(){p.style.display="none"},p.a=function(){p.classList.add(d)},p.d=function(){p.classList.remove(d)},p.n=function(){p.style.removeProperty("transform")},p.v=function(e){return l=e,p},p.ne=function(){h(-f())},p.z=function(){h(0)},p.p=function(){h(f())},n.i(t)||p.h(),i[t]=p,s.appendChild(p),function(e,t){var n=e.elements,o=n.smw,i=n.sourceAnimationWrappers,s=document.createElement("div"),r=document.createElement("div");r.className="fslightboxl";for(var a=0;a<3;a++){var c=document.createElement("div");r.appendChild(c)}s.appendChild(r),o[t].appendChild(s),i[t]=s}(e,t)}function H(e,t,n){var o=document.createElementNS("http://www.w3.org/2000/svg","svg"),s="".concat(i,"svg");o.setAttributeNS(null,"class","".concat(s)),o.setAttributeNS(null,"viewBox",t);var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"class","".concat(s,"p")),r.setAttributeNS(null,"d",n),o.appendChild(r),e.appendChild(o),o}function W(e,t){var n=document.createElement("button");return n.className="fslightboxb ".concat(i,"toolbar-button ").concat(c),n.title=t,e.appendChild(n),n}function O(e){var t=e.props.sources,n=e.elements.container,o=document.createElement("div");o.className="".concat(i,"nav"),n.appendChild(o),function(e,t){var n=document.createElement("div");n.className="".concat(i,"toolbar"),t.appendChild(n),function(e,t){if(!e.hfs){var n="M4.5 11H3v4h4v-1.5H4.5V11zM3 7h1.5V4.5H7V3H3v4zm10.5 6.5H11V15h4v-4h-1.5v2.5zM11 3v1.5h2.5V7H15V3h-4z",o=W(t);o.title="Enter fullscreen";var s=H(o,"0 0 18 18",n);e.fso=function(){e.ifs=1,o.title="Exit fullscreen",s.classList.add("".concat(i,"fsx")),s.setAttributeNS(null,"viewBox","0 0 950 1024"),s.firstChild.setAttributeNS(null,"d","M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z")},e.fsx=function(){e.ifs=0,o.title="Enter fullscreen",s.classList.remove("".concat(i,"fsx")),s.setAttributeNS(null,"viewBox","0 0 18 18"),s.firstChild.setAttributeNS(null,"d",n)},o.onclick=e.fs.t}}(e,n),function(e,t){var n=W(t,"Close");n.onclick=e.core.lightboxCloser.closeLightbox,H(n,"0 0 24 24","M 4.7070312 3.2929688 L 3.2929688 4.7070312 L 10.585938 12 L 3.2929688 19.292969 L 4.7070312 20.707031 L 12 13.414062 L 19.292969 20.707031 L 20.707031 19.292969 L 13.414062 12 L 20.707031 4.7070312 L 19.292969 3.2929688 L 12 10.585938 L 4.7070312 3.2929688 z")}(e,n)}(e,o),t.length>1&&function(e,t){var n=e.props.sources,o=(e.stageIndexes,document.createElement("div")),i=document.createElement("span"),s=document.createElement("span"),r=document.createElement("span");o.className="fslightboxsn",e.sn=function(e){return i.innerHTML=e},s.className="fslightboxsl",r.innerHTML=n.length,o.appendChild(i),o.appendChild(s),o.appendChild(r),t.appendChild(o)}(e,o)}function D(e,t,n,o){var i=e.elements.container,s=n.charAt(0).toUpperCase()+n.slice(1),r=document.createElement("div");r.className="".concat(h," ").concat(h,"-").concat(n),r.title="".concat(s," slide"),r.onclick=t,function(e,t){var n=document.createElement("button");n.className="fslightboxb ".concat(p," ").concat(c),H(n,"0 0 20 20",t),e.appendChild(n)}(r,o),i.appendChild(r)}function j(e){var t=e.core,n=t.lightboxCloser,o=t.slideChangeFacade,i=e.fs;this.listener=function(e){switch(e.key){case"Escape":n.closeLightbox();break;case"ArrowLeft":o.changeToPrevious();break;case"ArrowRight":o.changeToNext();break;case"F11":e.preventDefault(),i.t()}}}function _(e){var t=e.elements,n=e.sourcePointerProps,o=e.stageIndexes;function i(e,o){t.smw[e].v(n.swipedX)[o]()}this.runActionsForEvent=function(e){var s,a,c;t.container.contains(t.slideSwipingHoverer)||t.container.appendChild(t.slideSwipingHoverer),s=t.container,a=r,(c=s.classList).contains(a)||c.add(a),n.swipedX=e.screenX-n.downScreenX;var l=o.previous,d=o.next;i(o.current,"z"),void 0!==l&&n.swipedX>0?i(l,"ne"):void 0!==d&&n.swipedX<0&&i(d,"p")}}function q(e){var t=e.dss,n=e.props.sources,o=e.resolve,i=e.sourcePointerProps,s=o(_);1===n.length||t?this.listener=function(){i.swipedX=1}:this.listener=function(e){i.isPointering&&s.runActionsForEvent(e)}}function B(e){var t=e.core.slideIndexChanger,n=e.elements.smw,o=e.stageIndexes,i=e.sws;function s(e){var t=n[o.current];t.a(),t[e]()}function r(e,t){void 0!==e&&(n[e].s(),n[e][t]())}this.runPositiveSwipedXActions=function(){var e=o.previous;if(void 0===e)s("z");else{s("p");var n=o.next;t.changeTo(e);var a=o.previous;i.d(a),i.b(n),s("z"),r(a,"ne")}},this.runNegativeSwipedXActions=function(){var e=o.next;if(void 0===e)s("z");else{s("ne");var n=o.previous;t.changeTo(e);var a=o.next;i.d(a),i.b(n),s("z"),r(a,"p")}}}function X(e,t){e.contains(t)&&e.removeChild(t)}function Y(e){var t=e.core.lightboxCloser,n=e.dss,o=e.elements,i=e.props,s=e.resolve,a=e.sourcePointerProps,c=s(B);this.runNoSwipeActions=function(){X(o.container,o.slideSwipingHoverer),a.isSourceDownEventTarget||i.disableBackgroundClose||t.closeLightbox(),a.isPointering=!1},this.runActions=function(){n||(a.swipedX>0?c.runPositiveSwipedXActions():c.runNegativeSwipedXActions()),X(o.container,o.slideSwipingHoverer),o.container.classList.remove(r),a.isPointering=!1}}function V(e){var t=e.resolve,n=e.sourcePointerProps,o=t(Y);this.listener=function(){n.isPointering&&(n.swipedX?o.runActions():o.runNoSwipeActions())}}function U(e){var t=this,n=e.core,o=n.globalEventsController,i=n.scrollbarRecompensor,s=(e.data,e.e),r=e.elements,a=e.fs,c=e.props,d=e.sourcePointerProps,u=e.ud;this.runActions=function(){t.i=1,r.container.classList.add(v),o.removeListeners(),c.exitFullscreenOnClose&&e.ifs&&a.x(),setTimeout(function(){t.i=0,d.isPointering=!1,r.container.classList.remove(v),document.documentElement.classList.remove(l),i.removeRecompense(),u&&r.container.close(),document.body.removeChild(r.container),s("onClose")},270)}}function $(e,t){var n=e.classList;n.contains(t)&&n.remove(t)}function Z(e){var t,n,o,i,s,r,a,c,l;!function(e){var t=e.ap,n=e.elements.sources,o=e.props,i=o.autoplay,s=o.autoplays;function r(e,o){if("play"!=o||t.i(e)){var i=n[e];if(i){var s=i.tagName;if("VIDEO"==s)i[o]();else if("IFRAME"==s){var r=i.contentWindow;r&&r.postMessage('{"event":"command","func":"'.concat(o,'Video","args":""}'),"*")}}}}t.i=function(e){return s[e]||i&&0!=s[e]},t.p=function(e){r(e,"play")},t.c=function(e,t){r(e,"pause"),r(t,"play")}}(e),function(e){e.data;var t=e.fs,n=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],o=document.documentElement,i=o.requestFullscreen;function s(e){for(var t=0;tinnerHeight&&(document.body.style.marginRight=t.scrollbarWidth+"px")}n.addRecompense=function(){"complete"===document.readyState?o():addEventListener("load",function(){o(),n.addRecompense=o})},n.removeRecompense=function(){document.body.style.removeProperty("margin-right")}}(e),function(e){var t=e.core,n=t.slideChangeFacade,o=t.slideIndexChanger,i=t.stageManager;e.props.sources.length>1?(n.changeToPrevious=function(){o.jumpTo(i.getPreviousSlideIndex())},n.changeToNext=function(){o.jumpTo(i.getNextSlideIndex())}):(n.changeToPrevious=function(){},n.changeToNext=function(){})}(e),function(e){var t=e.ap,n=(e.componentsServices,e.core),o=n.slideIndexChanger,i=n.sourceDisplayFacade,s=n.stageManager,r=e.elements,a=r.smw,c=r.sourceAnimationWrappers,l=e.isl,d=e.stageIndexes,u=e.sws;o.changeTo=function(n){t.c(d.current,n),d.current=n,s.updateStageIndexes(),e.sn(n+1),i.displaySourcesWhichShouldBeDisplayed()},o.jumpTo=function(e){var t=d.previous,n=d.current,i=d.next,r=l[n],p=l[e];o.changeTo(e);for(var h=0;h992?e.mw=r*innerWidth:e.mw=innerWidth,e.mh=r*innerHeight;for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:[];return n.unshift(e),J(t,function(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n))},this.collections={sourceLoadHandlers:[],sourcesRenderFunctions:[],sourceSizers:[]},this.core={globalEventsController:{},lightboxCloser:{},lightboxUpdater:{},scrollbarRecompensor:{},slideChangeFacade:{},slideIndexChanger:{},sourcesPointerDown:{},sourceDisplayFacade:{},stageManager:{},windowResizeActioner:{}},this.ap={},this.fs={},this.sws={},this.e=function(t){e.props[t]&&e.props[t](e)},function(e){var t=e.ap,n=(e.componentsServices,e.core),o=n.globalEventsController,s=n.scrollbarRecompensor,r=n.sourceDisplayFacade,c=n.stageManager,d=n.windowResizeActioner,p=e.data,h=e.e,f=e.elements,m=(e.props,e.stageIndexes),v=e.sws,b=0;function x(){var t,n,o=e.props,s=o.autoplay,r=o.autoplays;b=!0,function(e){var t=e.props,n=t.autoplays;e.c=t.sources.length;for(var o=0;o0)&&(e.loc=1),Z(e),e.fs.i(),f.container=document.createElement(e.ud?"dialog":"div"),f.container.className="".concat(i,"container ").concat(a," ").concat(g),f.container.setAttribute("tabindex","0"),function(e){var t=e.elements;t.slideSwipingHoverer=document.createElement("div"),t.slideSwipingHoverer.className="".concat(i,"slide-swiping-hoverer ").concat(a," ").concat(u)}(e),O(e),function(e){var t=e.core.sourcesPointerDown,n=e.elements,o=e.props.sources,i=document.createElement("div");i.className="".concat(u," ").concat(a),n.container.appendChild(i),i.addEventListener("pointerdown",t.listener),n.sourceWrappersContainer=i;for(var s=0;s1&&(n=(t=e).core.slideChangeFacade,D(t,n.changeToPrevious,"previous","M18.271,9.212H3.615l4.184-4.184c0.306-0.306,0.306-0.801,0-1.107c-0.306-0.306-0.801-0.306-1.107,0L1.21,9.403C1.194,9.417,1.174,9.421,1.158,9.437c-0.181,0.181-0.242,0.425-0.209,0.66c0.005,0.038,0.012,0.071,0.022,0.109c0.028,0.098,0.075,0.188,0.142,0.271c0.021,0.026,0.021,0.061,0.045,0.085c0.015,0.016,0.034,0.02,0.05,0.033l5.484,5.483c0.306,0.307,0.801,0.307,1.107,0c0.306-0.305,0.306-0.801,0-1.105l-4.184-4.185h14.656c0.436,0,0.788-0.353,0.788-0.788S18.707,9.212,18.271,9.212z"),D(t,n.changeToNext,"next","M1.729,9.212h14.656l-4.184-4.184c-0.307-0.306-0.307-0.801,0-1.107c0.305-0.306,0.801-0.306,1.106,0l5.481,5.482c0.018,0.014,0.037,0.019,0.053,0.034c0.181,0.181,0.242,0.425,0.209,0.66c-0.004,0.038-0.012,0.071-0.021,0.109c-0.028,0.098-0.075,0.188-0.143,0.271c-0.021,0.026-0.021,0.061-0.045,0.085c-0.015,0.016-0.034,0.02-0.051,0.033l-5.483,5.483c-0.306,0.307-0.802,0.307-1.106,0c-0.307-0.305-0.307-0.801,0-1.105l4.184-4.185H1.729c-0.436,0-0.788-0.353-0.788-0.788S1.293,9.212,1.729,9.212z")),function(e){for(var t=e.props.sources,n=e.resolve,o=n(L),i=n(M),s=n(R,[o,i]),r=0;r0&&void 0!==arguments[0]?arguments[0]:0,i=m.previous,a=m.current,u=m.next;m.current=n,b||function(e){var t=e.stageIndexes,n=e.core.stageManager,o=e.props.sources.length-1;n.getPreviousSlideIndex=function(){return 0===t.current?o:t.current-1},n.getNextSlideIndex=function(){return t.current===o?0:t.current+1},n.updateStageIndexes=0===o?function(){}:1===o?function(){0===t.current?(t.next=1,delete t.previous):(t.previous=0,delete t.next)}:function(){t.previous=n.getPreviousSlideIndex(),t.next=n.getNextSlideIndex()},n.i=o<=2?function(){return!0}:function(e){var n=t.current;if(0===n&&e===o||n===o&&0===e)return!0;var i=n-e;return-1===i||0===i||1===i}}(e),c.updateStageIndexes(),b?(v.c(),v.a(),v.b(i),v.b(a),v.b(u),h("onShow")):x(),r.displaySourcesWhichShouldBeDisplayed(),e.sn(n+1),document.body.appendChild(f.container),e.ud&&f.container.showModal(),f.container.focus(),document.documentElement.classList.add(l),s.addRecompense(),o.attachListeners(),d.runActions(),f.smw[n].n(),t.p(n),h("onOpen")}}(this),this.close=function(){return e.core.lightboxCloser.closeLightbox()}},window.fsLightboxInstances={},Q(),window.refreshFsLightbox=function(){for(var e in fsLightboxInstances){var t=fsLightboxInstances[e].props;fsLightboxInstances[e]=new FsLightbox,fsLightboxInstances[e].props=t,fsLightboxInstances[e].props.sources=[],fsLightboxInstances[e].elements.a=[]}Q()}}])},675(){class e extends HTMLElement{connectedCallback(){this.videoId=this.getAttribute("videoid");let t=this.querySelector(".lyt-playbtn,.lty-playbtn");if(this.playLabel=t&&t.textContent.trim()||this.getAttribute("playlabel")||"Play",this.dataset.title=this.getAttribute("title")||"",this.style.backgroundImage||(this.style.backgroundImage=`url("https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg")`,this.upgradePosterImage()),t||(t=document.createElement("button"),t.type="button",t.classList.add("lyt-playbtn","lty-playbtn"),this.append(t)),!t.textContent){const e=document.createElement("span");e.className="lyt-visually-hidden",e.textContent=this.playLabel,t.append(e)}this.addNoscriptIframe(),"A"===t.nodeName&&(t.removeAttribute("href"),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),t.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.activate())})),this.addEventListener("pointerover",e.warmConnections,{once:!0}),this.addEventListener("focusin",e.warmConnections,{once:!0}),this.addEventListener("click",this.activate),this.needsYTApi=this.hasAttribute("js-api")||navigator.vendor.includes("Apple")||navigator.userAgent.includes("Mobi")}static addPrefetch(e,t,n){const o=document.createElement("link");o.rel=e,o.href=t,n&&(o.as=n),document.head.append(o)}static warmConnections(){e.preconnected||(e.addPrefetch("preconnect","https://www.youtube-nocookie.com"),e.addPrefetch("preconnect","https://www.google.com"),e.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),e.addPrefetch("preconnect","https://static.doubleclick.net"),e.preconnected=!0)}fetchYTPlayerApi(){window.YT||window.YT&&window.YT.Player||(this.ytApiPromise=new Promise((e,t)=>{var n=document.createElement("script");n.src="https://www.youtube.com/iframe_api",n.async=!0,n.onload=t=>{YT.ready(e)},n.onerror=t,this.append(n)}))}async getYTPlayer(){return this.playerPromise||await this.activate(),this.playerPromise}async addYTPlayerIframe(){this.fetchYTPlayerApi(),await this.ytApiPromise;const e=document.createElement("div");this.append(e);const t=Object.fromEntries(this.getParams().entries());this.playerPromise=new Promise(n=>{let o=new YT.Player(e,{width:"100%",videoId:this.videoId,playerVars:t,events:{onReady:e=>{e.target.playVideo(),n(o)}}})})}addNoscriptIframe(){const e=this.createBasicIframe(),t=document.createElement("noscript");t.innerHTML=e.outerHTML,this.append(t)}getParams(){const e=new URLSearchParams(this.getAttribute("params")||[]);return e.append("autoplay","1"),e.append("playsinline","1"),e}async activate(){if(this.classList.contains("lyt-activated"))return;if(this.classList.add("lyt-activated"),this.needsYTApi)return this.addYTPlayerIframe(this.getParams());const e=this.createBasicIframe();this.append(e),e.focus()}createBasicIframe(){const e=document.createElement("iframe");return e.width=560,e.height=315,e.title=this.playLabel,e.allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",e.allowFullscreen=!0,e.referrerPolicy="strict-origin-when-cross-origin",e.src=`https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.videoId)}?${this.getParams().toString()}`,e}upgradePosterImage(){setTimeout(()=>{const e=`https://i.ytimg.com/vi_webp/${this.videoId}/sddefault.webp`,t=new Image;t.fetchPriority="low",t.referrerpolicy="origin",t.src=e,t.onload=t=>{90==t.target.naturalHeight&&120==t.target.naturalWidth||(this.style.backgroundImage=`url("${e}")`)}},100)}}customElements.define("lite-youtube",e)}};const t={};function n(o){const i=t[o];if(void 0!==i)return i.exports;const s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var o=0;oObject.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(675);var e=n(194),t=n(490),o=n.n(t);function i(e,t){var n,o,i,s;function r(e){var r,a,c;e.preventDefault(),r=function(e){var t,o=0,i=0;return e=e||window.event,t=n.getBoundingClientRect(),o=e.pageX-t.left,i=e.pageY-t.top,{x:o-=window.pageXOffset,y:i-=window.pageYOffset}}(e),a=r.x,c=r.y,a>n.width-i/t&&(a=n.width-i/t),an.height-s/t&&(c=n.height-s/t),cthis.initImagesZooming()))}initProductOptionValidations(){document.querySelector(".product-form")?.addEventListener("change",function(){Array.from(this.elements).every(e=>e.validity.valid)&&salla.product.getPrice(new FormData(this))})}initImagesZooming(){const e=document.querySelector(".image-slider .magnify-wrapper.swiper-slide-active .img-magnifier-glass");window.innerWidth<1024||e||(setTimeout(()=>{const e=document.querySelector(".image-slider .swiper-slide-active img");i(e?.id,2)},250),document.querySelector("salla-slider.details-slider").addEventListener("slideChange",e=>{setTimeout(()=>{const e=document.querySelector(".image-slider .swiper-slide-active .img-magnifier-glass");if(window.innerWidth<1024||e)return;const t=document.querySelector(".image-slider .magnify-wrapper.swiper-slide-active img");i(t?.id,2)},250)}))}registerEvents(){salla.event.on("product::price.updated.failed",()=>{app.element(".price-wrapper").classList.add("hidden");const e=app.element(".out-of-stock");e.classList.remove("hidden"),e.classList.remove("scale-pulse"),e.offsetWidth,e.classList.add("scale-pulse")}),salla.product.event.onPriceUpdated(e=>{app.element(".out-of-stock").classList.add("hidden"),app.element(".price-wrapper").classList.remove("hidden");let t=e.data,n=t.has_sale_price&&t.regular_price>t.price;app.startingPriceTitle?.classList.add("hidden"),app.productWeight.forEach(e=>{e.innerHTML=t.weight||""}),app.totalPrice.forEach(e=>{e.innerHTML=salla.money(t.price)}),app.beforePrice.forEach(e=>{e.innerHTML=salla.money(t.regular_price)}),app.productSku.forEach(e=>{e.innerHTML=t.sku||""}),app.toggleClassIf(".price_is_on_sale","showed","hidden",()=>n),app.toggleClassIf(".starting-or-normal-price","hidden","showed",()=>n),document.querySelectorAll(".total-price, .product-weight").forEach(e=>{e.classList.remove("scale-pulse"),e.offsetWidth,e.classList.add("scale-pulse")})}),app.onClick("#btn-show-more",e=>app.all("#more-content",t=>{e.target.classList.add("is-expanded"),t.style=`max-height:${t.scrollHeight}px`})||e.target.remove())}}s.initiateWhenReady(["product.single"])})(),(()=>{"use strict";var e=n(194);const t=function(){function e(e){var t=this;this.listener=function(e){(e.matches?t.matchFns:t.unmatchFns).forEach(function(e){e()})},this.toggler=window.matchMedia(e),this.toggler.addListener(this.listener),this.matchFns=[],this.unmatchFns=[]}return e.prototype.add=function(e,t){this.matchFns.push(e),this.unmatchFns.push(t),(this.toggler.matches?e:t)()},e}();var o=function(e){return Array.prototype.slice.call(e)},i=function(e,t){return o((t||document).querySelectorAll(e))},s="mm-spn";const r=function(){function e(e,t,n,o,i){this.node=e,this.title=t,this.slidingSubmenus=o,this.selectedClass=n,this.node.classList.add(s),this.node.classList.add(s+"--"+i),this.node.classList.add(s+"--"+(this.slidingSubmenus?"navbar":"vertical")),this._setSelectedl(),this._initAnchors()}return Object.defineProperty(e.prototype,"prefix",{get:function(){return s},enumerable:!1,configurable:!0}),e.prototype.openPanel=function(e){var t=e.parentElement;if(this.slidingSubmenus){var n=e.dataset.mmSpnTitle;t===this.node?this.node.classList.add(s+"--main"):(this.node.classList.remove(s+"--main"),n||o(t.children).forEach(function(e){e.matches("a, span")&&(n=e.textContent)})),n||(n=this.title),this.node.dataset.mmSpnTitle=n,i("."+s+"--open",this.node).forEach(function(e){e.classList.remove(s+"--open"),e.classList.remove(s+"--parent")}),e.classList.add(s+"--open"),e.classList.remove(s+"--parent");for(var r=e.parentElement.closest("ul");r;)r.classList.add(s+"--open"),r.classList.add(s+"--parent"),r=r.parentElement.closest("ul")}else{var a=e.matches("."+s+"--open");i("."+s+"--open",this.node).forEach(function(e){e.classList.remove(s+"--open")}),e.classList[a?"remove":"add"](s+"--open");for(var c=e.parentElement.closest("ul");c;)c.classList.add(s+"--open"),c=c.parentElement.closest("ul")}},e.prototype._setSelectedl=function(){var e=i("."+this.selectedClass,this.node),t=e[e.length-1],n=null;t&&(n=t.closest("ul")),n||(n=this.node.querySelector("ul")),this.openPanel(n)},e.prototype._initAnchors=function(){var e=this;this.node.addEventListener("click",function(t){var n=t.target,r=!1;r=r||function(e){return!!e.matches("a")}(n),r=r||function(t){var n;return!!(n=t.closest("span")?t.parentElement:!!t.closest("li")&&t)&&(o(n.children).forEach(function(t){t.matches("ul")&&e.openPanel(t)}),!0)}(n),r=r||function(t){var n=i("."+s+"--open",t),o=n[n.length-1];if(o){var r=o.parentElement.closest("ul");if(r)return e.openPanel(r),!0}return!1}(n),r&&t.stopImmediatePropagation()})},e}();var a="mm-ocd";const c=function(){function e(e,t){var n=this;void 0===e&&(e=null),this.wrapper=document.createElement("div"),this.wrapper.classList.add(""+a),this.wrapper.classList.add(a+"--"+t),this.content=document.createElement("div"),this.content.classList.add(a+"__content"),this.wrapper.append(this.content),this.backdrop=document.createElement("div"),this.backdrop.classList.add(a+"__backdrop"),this.wrapper.append(this.backdrop),document.body.append(this.wrapper),e&&this.content.append(e);var o=function(e){n.close(),e.stopImmediatePropagation()};this.backdrop.addEventListener("touchstart",o,{passive:!0}),this.backdrop.addEventListener("mousedown",o,{passive:!0})}return Object.defineProperty(e.prototype,"prefix",{get:function(){return a},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.wrapper.classList.add(a+"--open"),document.body.classList.add(a+"-opened")},e.prototype.close=function(){this.wrapper.classList.remove(a+"--open"),document.body.classList.remove(a+"-opened")},e}(),l=function(){function e(e,n){void 0===n&&(n="all"),this.menu=e,this.toggler=new t(n)}return e.prototype.navigation=function(e){var t=this;if(!this.navigator){var n=(e=e||{}).title,o=void 0===n?"Menu":n,i=e.selectedClass,s=void 0===i?"Selected":i,a=e.slidingSubmenus,c=void 0===a||a,l=e.theme,d=void 0===l?"light":l;this.navigator=new r(this.menu,o,s,c,d),this.toggler.add(function(){return t.menu.classList.add(t.navigator.prefix)},function(){return t.menu.classList.remove(t.navigator.prefix)})}return this.navigator},e.prototype.offcanvas=function(e){var t=this;if(!this.drawer){var n=(e=e||{}).position,o=void 0===n?"left":n;this.drawer=new c(null,o);var i=document.createComment("original menu location");this.menu.after(i),this.toggler.add(function(){t.drawer.content.append(t.menu)},function(){t.drawer.close(),i.after(t.menu)})}return this.drawer},e}(),d=l;window.MmenuLight=l;class u extends e.A{onReady(){let e=app.element("salla-products-list"),t=new URLSearchParams(window.location.search);t.has("sort")&&(app.element("#product-filter").value=t.get("sort")),app.on("change","#product-filter",async t=>{window.history.replaceState(null,null,salla.helpers.addParamToUrl("sort",t.currentTarget.value)),e.sortBy=t.currentTarget.value,await e.reload(),e.setAttribute("filters",`{"sort": "${t.currentTarget.value}"}`)}),salla.event.on("salla-products-list::products.fetched",e=>{e.title&&(app.element("#page-main-title").innerHTML=e.title)}),this.initiateMobileMenu()}initiateMobileMenu(){let e=app.element("#filters-menu"),t=app.element("a[href='#filters-menu']"),n=app.element("button.close-filters");if(!e)return;e=new d(e,"(max-width: 1024px)","( slidingSubmenus: false)");const o=e.offcanvas({position:salla.config.get("theme.is_rtl")?"right":"left"});t.addEventListener("click",e=>{document.body.classList.add("filters-opened"),e.preventDefault()||o.close()||o.open()}),n.addEventListener("click",e=>{document.body.classList.remove("filters-opened"),e.preventDefault()||o.close()}),salla.event.on("salla-filters::changed",e=>{Object.entries(e).length&&(document.body.classList.remove("filters-opened"),o.close())})}}u.initiateWhenReady(["product.index","product.index.latest","product.index.offers","product.index.search","product.index.tag"])})()})(); \ No newline at end of file +(()=>{var e={870(e){window,e.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var o,i="fslightbox-",s="".concat(i,"styles"),r="".concat(i,"cursor-grabbing"),a="".concat(i,"full-dimension"),c="".concat(i,"flex-centered"),l="".concat(i,"open"),d="".concat(i,"transform-transition"),u="".concat(i,"absoluted"),p="".concat(i,"slide-btn"),h="".concat(p,"-container"),f="".concat(i,"fade-in"),m="".concat(i,"fade-out"),g=f+"-strong",v=m+"-strong",b="".concat(i,"opacity-"),x="".concat(b,"1"),y="".concat(i,"source");function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(e){var t,n=e.props,o=0,i={};this.getSourceTypeFromLocalStorageByUrl=function(e){return t[e]?t[e]:s(e)},this.handleReceivedSourceTypeForUrl=function(e,n){if(!1===i[n]&&(o--,"invalid"!==e?i[n]=e:delete i[n],0===o)){!function(e,t){for(var n in t)e[n]=t[n]}(t,i);try{localStorage.setItem("fslightbox-types",JSON.stringify(t))}catch(e){}}};var s=function(e){o++,i[e]=!1};if(n.disableLocalStorage)this.getSourceTypeFromLocalStorageByUrl=function(){},this.handleReceivedSourceTypeForUrl=function(){};else{try{t=JSON.parse(localStorage.getItem("fslightbox-types"))}catch(e){}t||(t={},this.getSourceTypeFromLocalStorageByUrl=s)}}function S(e,t,n,o){e.data;var i=e.elements.sources,s=n/o,r=0;this.adjustSize=function(){if((r=e.mw/s)e.mh?e.mh:o,a()};var a=function(){i[t].style.width=r*s+"px",i[t].style.height=r+"px"}}function E(e,t){var n=this,o=e.collections.sourceSizers,i=e.elements,s=i.sourceAnimationWrappers,r=i.sources,a=e.isl,c=e.props.onSourceLoad,l=e.resolve;function d(e,n){o[t]=l(S,[t,e,n]),o[t].adjustSize()}this.b=function(e,o){r[t].classList.add(x),n.a(),d(e,o),n.b=d},this.a=function(){a[t]=!0,s[t].classList.add(g),s[t].removeChild(s[t].firstChild),c&&c(e,r[t],t)}}function A(e,t){var n,o=this,i=e.elements.sources,s=e.props,r=(0,e.resolve)(E,[t]);this.handleImageLoad=function(e){var t=e.target,n=t.naturalWidth,o=t.naturalHeight;r.b(n,o)},this.handleVideoLoad=function(e){var t=e.target,o=t.videoWidth,i=t.videoHeight;n=!0,r.b(o,i)},this.handleNotMetaDatedVideoLoad=function(){n||o.handleYoutubeLoad()},this.handleYoutubeLoad=function(e,t){e||(e=1920,t=1080),s.maxYoutubeDimensions&&(e=s.maxYoutubeDimensions.width,t=s.maxYoutubeDimensions.height),r.b(e,t)},this.handleCustomLoad=function(){var e=i[t],n=e.offsetWidth,s=e.offsetHeight;n&&s?r.b(n,s):setTimeout(o.handleCustomLoad)}}function P(e,t,n){var o=e.elements.sources,i=e.props.customClasses,s=i[t]?i[t]:"";o[t].className=n+" "+s}function C(e,t){var n=e.elements.sources,o=e.props.customAttributes;for(var i in o[t])n[t].setAttribute(i,o[t][i])}function I(e,t){var n=e.collections.sourceLoadHandlers,o=e.elements,i=o.sources,s=o.sourceAnimationWrappers,r=e.props.sources;i[t]=document.createElement("img"),P(e,t,y),i[t].src=r[t],i[t].onload=n[t].handleImageLoad,C(e,t),s[t].appendChild(i[t])}function T(e,t){var n=e.ap,o=e.collections.sourceLoadHandlers,i=e.elements,s=i.sources,r=i.sourceAnimationWrappers,a=e.props,c=a.sources,l=a.videosPosters,d=document.createElement("video"),u=document.createElement("source");s[t]=d,P(e,t,"".concat(y," fslightboxv")),d.src=c[t],d.onloadedmetadata=function(e){return o[t].handleVideoLoad(e)},d.controls=!0,d.autoplay=n.i(t),C(e,t),l[t]&&(s[t].poster=l[t]),u.src=c[t],d.appendChild(u),setTimeout(o[t].handleNotMetaDatedVideoLoad,3e3),r[t].appendChild(s[t])}function F(e,t){var n=e.ap,o=e.collections.sourceLoadHandlers,s=e.elements,r=s.sources,a=s.sourceAnimationWrappers,c=e.props.sources[t],l=c.split("?")[1],d=document.createElement("iframe");r[t]=d,P(e,t,"".concat(y," ").concat(i,"youtube-iframe")),d.src="https://www.youtube.com/embed/".concat(c.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/)[2],"?").concat(l||"").concat(n.i(t)?"&mute=1&autoplay=1":"","&enablejsapi=1"),d.allowFullscreen=!0,C(e,t),a[t].appendChild(d),o[t].handleYoutubeLoad(parseInt(d.width),parseInt(d.height))}function k(e,t){var n=e.collections.sourceLoadHandlers,o=e.elements,i=o.sources,s=o.sourceAnimationWrappers,r=e.props.sources;i[t]=r[t],P(e,t,"".concat(i[t].className," ").concat(y)),s[t].appendChild(i[t]),n[t].handleCustomLoad()}function z(e,t){var n=e.elements,o=n.sources,s=n.sourceAnimationWrappers;e.props.sources,o[t]=document.createElement("div"),o[t].className="".concat(i,"invalid-file-wrapper ").concat(c),o[t].innerHTML="Invalid source",s[t].appendChild(o[t]),new E(e,t).a()}function M(e){var t=e.collections,n=t.sourceLoadHandlers,o=t.sourcesRenderFunctions,i=e.core.sourceDisplayFacade,s=e.resolve;this.runActionsForSourceTypeAndIndex=function(t,r){var a;switch("invalid"!==t&&(n[r]=s(A,[r])),t){case"image":a=I;break;case"video":a=T;break;case"youtube":a=F;break;case"custom":a=k;break;default:a=z}o[r]=function(){return a(e,r)},i.displaySourcesWhichShouldBeDisplayed()}}function R(e,t,n){var o=e.props,i=o.types,s=o.type,r=o.sources;this.getTypeSetByClientForIndex=function(e){var t;return i&&i[e]?t=i[e]:s&&(t=s),t},this.retrieveTypeWithXhrForIndex=function(e){!function(e,t){var n=document.createElement("a");n.href=e;var o=n.hostname;if("www.youtube.com"===o||"youtu.be"===o)return t("youtube");var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4!==i.readyState){if(2===i.readyState){var e,n=i.getResponseHeader("content-type");switch(n.slice(0,n.indexOf("/"))){case"image":e="image";break;case"video":e="video";break;default:e="invalid"}i.onreadystatechange=null,i.abort(),t(e)}}else t("invalid")},i.open("GET",e),i.send()}(r[e],function(o){t.handleReceivedSourceTypeForUrl(o,r[e]),n.runActionsForSourceTypeAndIndex(o,e)})}}function N(e,t){var n=e.core.stageManager,o=e.elements,i=o.smw,s=o.sourceWrappersContainer,r=e.props,l=0,p=document.createElement("div");function h(e){p.style.transform="translateX(".concat(e+l,"px)"),l=0}function f(){return(1+r.slideDistance)*innerWidth}p.className="".concat(u," ").concat(a," ").concat(c),p.s=function(){p.style.display="flex"},p.h=function(){p.style.display="none"},p.a=function(){p.classList.add(d)},p.d=function(){p.classList.remove(d)},p.n=function(){p.style.removeProperty("transform")},p.v=function(e){return l=e,p},p.ne=function(){h(-f())},p.z=function(){h(0)},p.p=function(){h(f())},n.i(t)||p.h(),i[t]=p,s.appendChild(p),function(e,t){var n=e.elements,o=n.smw,i=n.sourceAnimationWrappers,s=document.createElement("div"),r=document.createElement("div");r.className="fslightboxl";for(var a=0;a<3;a++){var c=document.createElement("div");r.appendChild(c)}s.appendChild(r),o[t].appendChild(s),i[t]=s}(e,t)}function H(e,t,n){var o=document.createElementNS("http://www.w3.org/2000/svg","svg"),s="".concat(i,"svg");o.setAttributeNS(null,"class","".concat(s)),o.setAttributeNS(null,"viewBox",t);var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"class","".concat(s,"p")),r.setAttributeNS(null,"d",n),o.appendChild(r),e.appendChild(o),o}function W(e,t){var n=document.createElement("button");return n.className="fslightboxb ".concat(i,"toolbar-button ").concat(c),n.title=t,e.appendChild(n),n}function O(e){var t=e.props.sources,n=e.elements.container,o=document.createElement("div");o.className="".concat(i,"nav"),n.appendChild(o),function(e,t){var n=document.createElement("div");n.className="".concat(i,"toolbar"),t.appendChild(n),function(e,t){if(!e.hfs){var n="M4.5 11H3v4h4v-1.5H4.5V11zM3 7h1.5V4.5H7V3H3v4zm10.5 6.5H11V15h4v-4h-1.5v2.5zM11 3v1.5h2.5V7H15V3h-4z",o=W(t);o.title="Enter fullscreen";var s=H(o,"0 0 18 18",n);e.fso=function(){e.ifs=1,o.title="Exit fullscreen",s.classList.add("".concat(i,"fsx")),s.setAttributeNS(null,"viewBox","0 0 950 1024"),s.firstChild.setAttributeNS(null,"d","M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z")},e.fsx=function(){e.ifs=0,o.title="Enter fullscreen",s.classList.remove("".concat(i,"fsx")),s.setAttributeNS(null,"viewBox","0 0 18 18"),s.firstChild.setAttributeNS(null,"d",n)},o.onclick=e.fs.t}}(e,n),function(e,t){var n=W(t,"Close");n.onclick=e.core.lightboxCloser.closeLightbox,H(n,"0 0 24 24","M 4.7070312 3.2929688 L 3.2929688 4.7070312 L 10.585938 12 L 3.2929688 19.292969 L 4.7070312 20.707031 L 12 13.414062 L 19.292969 20.707031 L 20.707031 19.292969 L 13.414062 12 L 20.707031 4.7070312 L 19.292969 3.2929688 L 12 10.585938 L 4.7070312 3.2929688 z")}(e,n)}(e,o),t.length>1&&function(e,t){var n=e.props.sources,o=(e.stageIndexes,document.createElement("div")),i=document.createElement("span"),s=document.createElement("span"),r=document.createElement("span");o.className="fslightboxsn",e.sn=function(e){return i.innerHTML=e},s.className="fslightboxsl",r.innerHTML=n.length,o.appendChild(i),o.appendChild(s),o.appendChild(r),t.appendChild(o)}(e,o)}function D(e,t,n,o){var i=e.elements.container,s=n.charAt(0).toUpperCase()+n.slice(1),r=document.createElement("div");r.className="".concat(h," ").concat(h,"-").concat(n),r.title="".concat(s," slide"),r.onclick=t,function(e,t){var n=document.createElement("button");n.className="fslightboxb ".concat(p," ").concat(c),H(n,"0 0 20 20",t),e.appendChild(n)}(r,o),i.appendChild(r)}function j(e){var t=e.core,n=t.lightboxCloser,o=t.slideChangeFacade,i=e.fs;this.listener=function(e){switch(e.key){case"Escape":n.closeLightbox();break;case"ArrowLeft":o.changeToPrevious();break;case"ArrowRight":o.changeToNext();break;case"F11":e.preventDefault(),i.t()}}}function _(e){var t=e.elements,n=e.sourcePointerProps,o=e.stageIndexes;function i(e,o){t.smw[e].v(n.swipedX)[o]()}this.runActionsForEvent=function(e){var s,a,c;t.container.contains(t.slideSwipingHoverer)||t.container.appendChild(t.slideSwipingHoverer),s=t.container,a=r,(c=s.classList).contains(a)||c.add(a),n.swipedX=e.screenX-n.downScreenX;var l=o.previous,d=o.next;i(o.current,"z"),void 0!==l&&n.swipedX>0?i(l,"ne"):void 0!==d&&n.swipedX<0&&i(d,"p")}}function q(e){var t=e.dss,n=e.props.sources,o=e.resolve,i=e.sourcePointerProps,s=o(_);1===n.length||t?this.listener=function(){i.swipedX=1}:this.listener=function(e){i.isPointering&&s.runActionsForEvent(e)}}function B(e){var t=e.core.slideIndexChanger,n=e.elements.smw,o=e.stageIndexes,i=e.sws;function s(e){var t=n[o.current];t.a(),t[e]()}function r(e,t){void 0!==e&&(n[e].s(),n[e][t]())}this.runPositiveSwipedXActions=function(){var e=o.previous;if(void 0===e)s("z");else{s("p");var n=o.next;t.changeTo(e);var a=o.previous;i.d(a),i.b(n),s("z"),r(a,"ne")}},this.runNegativeSwipedXActions=function(){var e=o.next;if(void 0===e)s("z");else{s("ne");var n=o.previous;t.changeTo(e);var a=o.next;i.d(a),i.b(n),s("z"),r(a,"p")}}}function X(e,t){e.contains(t)&&e.removeChild(t)}function Y(e){var t=e.core.lightboxCloser,n=e.dss,o=e.elements,i=e.props,s=e.resolve,a=e.sourcePointerProps,c=s(B);this.runNoSwipeActions=function(){X(o.container,o.slideSwipingHoverer),a.isSourceDownEventTarget||i.disableBackgroundClose||t.closeLightbox(),a.isPointering=!1},this.runActions=function(){n||(a.swipedX>0?c.runPositiveSwipedXActions():c.runNegativeSwipedXActions()),X(o.container,o.slideSwipingHoverer),o.container.classList.remove(r),a.isPointering=!1}}function V(e){var t=e.resolve,n=e.sourcePointerProps,o=t(Y);this.listener=function(){n.isPointering&&(n.swipedX?o.runActions():o.runNoSwipeActions())}}function U(e){var t=this,n=e.core,o=n.globalEventsController,i=n.scrollbarRecompensor,s=(e.data,e.e),r=e.elements,a=e.fs,c=e.props,d=e.sourcePointerProps,u=e.ud;this.runActions=function(){t.i=1,r.container.classList.add(v),o.removeListeners(),c.exitFullscreenOnClose&&e.ifs&&a.x(),setTimeout(function(){t.i=0,d.isPointering=!1,r.container.classList.remove(v),document.documentElement.classList.remove(l),i.removeRecompense(),u&&r.container.close(),document.body.removeChild(r.container),s("onClose")},270)}}function $(e,t){var n=e.classList;n.contains(t)&&n.remove(t)}function Z(e){var t,n,o,i,s,r,a,c,l;!function(e){var t=e.ap,n=e.elements.sources,o=e.props,i=o.autoplay,s=o.autoplays;function r(e,o){if("play"!=o||t.i(e)){var i=n[e];if(i){var s=i.tagName;if("VIDEO"==s)i[o]();else if("IFRAME"==s){var r=i.contentWindow;r&&r.postMessage('{"event":"command","func":"'.concat(o,'Video","args":""}'),"*")}}}}t.i=function(e){return s[e]||i&&0!=s[e]},t.p=function(e){r(e,"play")},t.c=function(e,t){r(e,"pause"),r(t,"play")}}(e),function(e){e.data;var t=e.fs,n=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],o=document.documentElement,i=o.requestFullscreen;function s(e){for(var t=0;tinnerHeight&&(document.body.style.marginRight=t.scrollbarWidth+"px")}n.addRecompense=function(){"complete"===document.readyState?o():addEventListener("load",function(){o(),n.addRecompense=o})},n.removeRecompense=function(){document.body.style.removeProperty("margin-right")}}(e),function(e){var t=e.core,n=t.slideChangeFacade,o=t.slideIndexChanger,i=t.stageManager;e.props.sources.length>1?(n.changeToPrevious=function(){o.jumpTo(i.getPreviousSlideIndex())},n.changeToNext=function(){o.jumpTo(i.getNextSlideIndex())}):(n.changeToPrevious=function(){},n.changeToNext=function(){})}(e),function(e){var t=e.ap,n=(e.componentsServices,e.core),o=n.slideIndexChanger,i=n.sourceDisplayFacade,s=n.stageManager,r=e.elements,a=r.smw,c=r.sourceAnimationWrappers,l=e.isl,d=e.stageIndexes,u=e.sws;o.changeTo=function(n){t.c(d.current,n),d.current=n,s.updateStageIndexes(),e.sn(n+1),i.displaySourcesWhichShouldBeDisplayed()},o.jumpTo=function(e){var t=d.previous,n=d.current,i=d.next,r=l[n],p=l[e];o.changeTo(e);for(var h=0;h992?e.mw=r*innerWidth:e.mw=innerWidth,e.mh=r*innerHeight;for(var n=0;ne.length)&&(t=e.length);for(var n=0,o=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:[];return n.unshift(e),J(t,function(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n))},this.collections={sourceLoadHandlers:[],sourcesRenderFunctions:[],sourceSizers:[]},this.core={globalEventsController:{},lightboxCloser:{},lightboxUpdater:{},scrollbarRecompensor:{},slideChangeFacade:{},slideIndexChanger:{},sourcesPointerDown:{},sourceDisplayFacade:{},stageManager:{},windowResizeActioner:{}},this.ap={},this.fs={},this.sws={},this.e=function(t){e.props[t]&&e.props[t](e)},function(e){var t=e.ap,n=(e.componentsServices,e.core),o=n.globalEventsController,s=n.scrollbarRecompensor,r=n.sourceDisplayFacade,c=n.stageManager,d=n.windowResizeActioner,p=e.data,h=e.e,f=e.elements,m=(e.props,e.stageIndexes),v=e.sws,b=0;function x(){var t,n,o=e.props,s=o.autoplay,r=o.autoplays;b=!0,function(e){var t=e.props,n=t.autoplays;e.c=t.sources.length;for(var o=0;o0)&&(e.loc=1),Z(e),e.fs.i(),f.container=document.createElement(e.ud?"dialog":"div"),f.container.className="".concat(i,"container ").concat(a," ").concat(g),f.container.setAttribute("tabindex","0"),function(e){var t=e.elements;t.slideSwipingHoverer=document.createElement("div"),t.slideSwipingHoverer.className="".concat(i,"slide-swiping-hoverer ").concat(a," ").concat(u)}(e),O(e),function(e){var t=e.core.sourcesPointerDown,n=e.elements,o=e.props.sources,i=document.createElement("div");i.className="".concat(u," ").concat(a),n.container.appendChild(i),i.addEventListener("pointerdown",t.listener),n.sourceWrappersContainer=i;for(var s=0;s1&&(n=(t=e).core.slideChangeFacade,D(t,n.changeToPrevious,"previous","M18.271,9.212H3.615l4.184-4.184c0.306-0.306,0.306-0.801,0-1.107c-0.306-0.306-0.801-0.306-1.107,0L1.21,9.403C1.194,9.417,1.174,9.421,1.158,9.437c-0.181,0.181-0.242,0.425-0.209,0.66c0.005,0.038,0.012,0.071,0.022,0.109c0.028,0.098,0.075,0.188,0.142,0.271c0.021,0.026,0.021,0.061,0.045,0.085c0.015,0.016,0.034,0.02,0.05,0.033l5.484,5.483c0.306,0.307,0.801,0.307,1.107,0c0.306-0.305,0.306-0.801,0-1.105l-4.184-4.185h14.656c0.436,0,0.788-0.353,0.788-0.788S18.707,9.212,18.271,9.212z"),D(t,n.changeToNext,"next","M1.729,9.212h14.656l-4.184-4.184c-0.307-0.306-0.307-0.801,0-1.107c0.305-0.306,0.801-0.306,1.106,0l5.481,5.482c0.018,0.014,0.037,0.019,0.053,0.034c0.181,0.181,0.242,0.425,0.209,0.66c-0.004,0.038-0.012,0.071-0.021,0.109c-0.028,0.098-0.075,0.188-0.143,0.271c-0.021,0.026-0.021,0.061-0.045,0.085c-0.015,0.016-0.034,0.02-0.051,0.033l-5.483,5.483c-0.306,0.307-0.802,0.307-1.106,0c-0.307-0.305-0.307-0.801,0-1.105l4.184-4.185H1.729c-0.436,0-0.788-0.353-0.788-0.788S1.293,9.212,1.729,9.212z")),function(e){for(var t=e.props.sources,n=e.resolve,o=n(L),i=n(M),s=n(R,[o,i]),r=0;r0&&void 0!==arguments[0]?arguments[0]:0,i=m.previous,a=m.current,u=m.next;m.current=n,b||function(e){var t=e.stageIndexes,n=e.core.stageManager,o=e.props.sources.length-1;n.getPreviousSlideIndex=function(){return 0===t.current?o:t.current-1},n.getNextSlideIndex=function(){return t.current===o?0:t.current+1},n.updateStageIndexes=0===o?function(){}:1===o?function(){0===t.current?(t.next=1,delete t.previous):(t.previous=0,delete t.next)}:function(){t.previous=n.getPreviousSlideIndex(),t.next=n.getNextSlideIndex()},n.i=o<=2?function(){return!0}:function(e){var n=t.current;if(0===n&&e===o||n===o&&0===e)return!0;var i=n-e;return-1===i||0===i||1===i}}(e),c.updateStageIndexes(),b?(v.c(),v.a(),v.b(i),v.b(a),v.b(u),h("onShow")):x(),r.displaySourcesWhichShouldBeDisplayed(),e.sn(n+1),document.body.appendChild(f.container),e.ud&&f.container.showModal(),f.container.focus(),document.documentElement.classList.add(l),s.addRecompense(),o.attachListeners(),d.runActions(),f.smw[n].n(),t.p(n),h("onOpen")}}(this),this.close=function(){return e.core.lightboxCloser.closeLightbox()}},window.fsLightboxInstances={},Q(),window.refreshFsLightbox=function(){for(var e in fsLightboxInstances){var t=fsLightboxInstances[e].props;fsLightboxInstances[e]=new FsLightbox,fsLightboxInstances[e].props=t,fsLightboxInstances[e].props.sources=[],fsLightboxInstances[e].elements.a=[]}Q()}}])},735(){class e extends HTMLElement{connectedCallback(){this.videoId=this.getAttribute("videoid");let t=this.querySelector(".lyt-playbtn,.lty-playbtn");if(this.playLabel=t&&t.textContent.trim()||this.getAttribute("playlabel")||"Play",this.dataset.title=this.getAttribute("title")||"",this.style.backgroundImage||(this.style.backgroundImage=`url("https://i.ytimg.com/vi/${this.videoId}/hqdefault.jpg")`,this.upgradePosterImage()),t||(t=document.createElement("button"),t.type="button",t.classList.add("lyt-playbtn","lty-playbtn"),this.append(t)),!t.textContent){const e=document.createElement("span");e.className="lyt-visually-hidden",e.textContent=this.playLabel,t.append(e)}this.addNoscriptIframe(),"A"===t.nodeName&&(t.removeAttribute("href"),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),t.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.activate())})),this.addEventListener("pointerover",e.warmConnections,{once:!0}),this.addEventListener("focusin",e.warmConnections,{once:!0}),this.addEventListener("click",this.activate),this.needsYTApi=this.hasAttribute("js-api")||navigator.vendor.includes("Apple")||navigator.userAgent.includes("Mobi")}static addPrefetch(e,t,n){const o=document.createElement("link");o.rel=e,o.href=t,n&&(o.as=n),document.head.append(o)}static warmConnections(){e.preconnected||(e.addPrefetch("preconnect","https://www.youtube-nocookie.com"),e.addPrefetch("preconnect","https://www.google.com"),e.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),e.addPrefetch("preconnect","https://static.doubleclick.net"),e.preconnected=!0)}fetchYTPlayerApi(){window.YT||window.YT&&window.YT.Player||(this.ytApiPromise=new Promise((e,t)=>{var n=document.createElement("script");n.src="https://www.youtube.com/iframe_api",n.async=!0,n.onload=t=>{YT.ready(e)},n.onerror=t,this.append(n)}))}async getYTPlayer(){return this.playerPromise||await this.activate(),this.playerPromise}async addYTPlayerIframe(){this.fetchYTPlayerApi(),await this.ytApiPromise;const e=document.createElement("div");this.append(e);const t=Object.fromEntries(this.getParams().entries());this.playerPromise=new Promise(n=>{let o=new YT.Player(e,{width:"100%",videoId:this.videoId,playerVars:t,events:{onReady:e=>{e.target.playVideo(),n(o)}}})})}addNoscriptIframe(){const e=this.createBasicIframe(),t=document.createElement("noscript");t.innerHTML=e.outerHTML,this.append(t)}getParams(){const e=new URLSearchParams(this.getAttribute("params")||[]);return e.append("autoplay","1"),e.append("playsinline","1"),e}async activate(){if(this.classList.contains("lyt-activated"))return;if(this.classList.add("lyt-activated"),this.needsYTApi)return this.addYTPlayerIframe(this.getParams());const e=this.createBasicIframe();this.append(e),e.focus()}createBasicIframe(){const e=document.createElement("iframe");return e.width=560,e.height=315,e.title=this.playLabel,e.allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",e.allowFullscreen=!0,e.referrerPolicy="strict-origin-when-cross-origin",e.src=`https://www.youtube-nocookie.com/embed/${encodeURIComponent(this.videoId)}?${this.getParams().toString()}`,e}upgradePosterImage(){setTimeout(()=>{const e=`https://i.ytimg.com/vi_webp/${this.videoId}/sddefault.webp`,t=new Image;t.fetchPriority="low",t.referrerpolicy="origin",t.src=e,t.onload=t=>{90==t.target.naturalHeight&&120==t.target.naturalWidth||(this.style.backgroundImage=`url("${e}")`)}},100)}}customElements.define("lite-youtube",e)},534(e,t,n){"use strict";class o{constructor(){}onReady(){}registerEvents(){}initiate(e){if(e&&!e.includes(salla.config.get("page.slug")))return app.log(`The Class For (${e.join(",")}) Skipped.`);this.onReady(),this.registerEvents(),app.log(`The Class For (${e?.join(",")||"*"}) Loaded🎉`)}}o.initiateWhenReady=function(e=null){"ready"===window.app?.status?(new this).initiate(e):document.addEventListener("theme::ready",()=>(new this).initiate(e))};const i=o;n.d(t,["A",0,i])}};const t={};function n(o){const i=t[o];if(void 0!==i)return i.exports;const s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var o=0;oObject.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";n(735);var e=n(534),t=n(870),o=n.n(t);function i(e,t){var n,o,i,s;function r(e){var r,a,c;e.preventDefault(),r=function(e){var t,o=0,i=0;return e=e||window.event,t=n.getBoundingClientRect(),o=e.pageX-t.left,i=e.pageY-t.top,{x:o-=window.pageXOffset,y:i-=window.pageYOffset}}(e),a=r.x,c=r.y,a>n.width-i/t&&(a=n.width-i/t),an.height-s/t&&(c=n.height-s/t),cthis.initImagesZooming()))}initProductOptionValidations(){document.querySelector(".product-form")?.addEventListener("change",function(){this.checkValidity()&&salla.product.getPrice(new FormData(this))})}initImagesZooming(){const e=document.querySelector(".image-slider .magnify-wrapper.swiper-slide-active .img-magnifier-glass");window.innerWidth<1024||e||(setTimeout(()=>{const e=document.querySelector(".image-slider .swiper-slide-active img");i(e?.id,2)},250),document.querySelector("salla-slider.details-slider").addEventListener("slideChange",e=>{setTimeout(()=>{const e=document.querySelector(".image-slider .swiper-slide-active .img-magnifier-glass");if(window.innerWidth<1024||e)return;const t=document.querySelector(".image-slider .magnify-wrapper.swiper-slide-active img");i(t?.id,2)},250)}))}registerEvents(){salla.event.on("product::price.updated.failed",()=>{app.element(".price-wrapper").classList.add("hidden");const e=app.element(".out-of-stock");e.classList.remove("hidden"),e.classList.remove("scale-pulse"),e.offsetWidth,e.classList.add("scale-pulse")}),salla.product.event.onPriceUpdated(e=>{app.element(".out-of-stock").classList.add("hidden"),app.element(".price-wrapper").classList.remove("hidden");let t=e.data,n=t.has_sale_price&&t.regular_price>t.price;app.startingPriceTitle?.classList.add("hidden"),app.productWeight.forEach(e=>{e.innerHTML=t.weight||""}),app.totalPrice.forEach(e=>{e.innerHTML=salla.money(t.price)}),app.beforePrice.forEach(e=>{e.innerHTML=salla.money(t.regular_price)}),app.productSku.forEach(e=>{e.innerHTML=t.sku||""}),app.toggleClassIf(".price_is_on_sale","showed","hidden",()=>n),app.toggleClassIf(".starting-or-normal-price","hidden","showed",()=>n),document.querySelectorAll(".total-price, .product-weight").forEach(e=>{e.classList.remove("scale-pulse"),e.offsetWidth,e.classList.add("scale-pulse")})}),app.onClick("#btn-show-more",e=>app.all("#more-content",t=>{e.target.classList.add("is-expanded"),t.style=`max-height:${t.scrollHeight}px`})||e.target.remove())}}s.initiateWhenReady(["product.single"])})(),(()=>{"use strict";var e=n(534);const t=function(){function e(e){var t=this;this.listener=function(e){(e.matches?t.matchFns:t.unmatchFns).forEach(function(e){e()})},this.toggler=window.matchMedia(e),this.toggler.addListener(this.listener),this.matchFns=[],this.unmatchFns=[]}return e.prototype.add=function(e,t){this.matchFns.push(e),this.unmatchFns.push(t),(this.toggler.matches?e:t)()},e}();var o=function(e){return Array.prototype.slice.call(e)},i=function(e,t){return o((t||document).querySelectorAll(e))},s="mm-spn";const r=function(){function e(e,t,n,o,i){this.node=e,this.title=t,this.slidingSubmenus=o,this.selectedClass=n,this.node.classList.add(s),this.node.classList.add(s+"--"+i),this.node.classList.add(s+"--"+(this.slidingSubmenus?"navbar":"vertical")),this._setSelectedl(),this._initAnchors()}return Object.defineProperty(e.prototype,"prefix",{get:function(){return s},enumerable:!1,configurable:!0}),e.prototype.openPanel=function(e){var t=e.parentElement;if(this.slidingSubmenus){var n=e.dataset.mmSpnTitle;t===this.node?this.node.classList.add(s+"--main"):(this.node.classList.remove(s+"--main"),n||o(t.children).forEach(function(e){e.matches("a, span")&&(n=e.textContent)})),n||(n=this.title),this.node.dataset.mmSpnTitle=n,i("."+s+"--open",this.node).forEach(function(e){e.classList.remove(s+"--open"),e.classList.remove(s+"--parent")}),e.classList.add(s+"--open"),e.classList.remove(s+"--parent");for(var r=e.parentElement.closest("ul");r;)r.classList.add(s+"--open"),r.classList.add(s+"--parent"),r=r.parentElement.closest("ul")}else{var a=e.matches("."+s+"--open");i("."+s+"--open",this.node).forEach(function(e){e.classList.remove(s+"--open")}),e.classList[a?"remove":"add"](s+"--open");for(var c=e.parentElement.closest("ul");c;)c.classList.add(s+"--open"),c=c.parentElement.closest("ul")}},e.prototype._setSelectedl=function(){var e=i("."+this.selectedClass,this.node),t=e[e.length-1],n=null;t&&(n=t.closest("ul")),n||(n=this.node.querySelector("ul")),this.openPanel(n)},e.prototype._initAnchors=function(){var e=this;this.node.addEventListener("click",function(t){var n=t.target,r=!1;r=r||function(e){return!!e.matches("a")}(n),r=r||function(t){var n;return!!(n=t.closest("span")?t.parentElement:!!t.closest("li")&&t)&&(o(n.children).forEach(function(t){t.matches("ul")&&e.openPanel(t)}),!0)}(n),r=r||function(t){var n=i("."+s+"--open",t),o=n[n.length-1];if(o){var r=o.parentElement.closest("ul");if(r)return e.openPanel(r),!0}return!1}(n),r&&t.stopImmediatePropagation()})},e}();var a="mm-ocd";const c=function(){function e(e,t){var n=this;void 0===e&&(e=null),this.wrapper=document.createElement("div"),this.wrapper.classList.add(""+a),this.wrapper.classList.add(a+"--"+t),this.content=document.createElement("div"),this.content.classList.add(a+"__content"),this.wrapper.append(this.content),this.backdrop=document.createElement("div"),this.backdrop.classList.add(a+"__backdrop"),this.wrapper.append(this.backdrop),document.body.append(this.wrapper),e&&this.content.append(e);var o=function(e){n.close(),e.stopImmediatePropagation()};this.backdrop.addEventListener("touchstart",o,{passive:!0}),this.backdrop.addEventListener("mousedown",o,{passive:!0})}return Object.defineProperty(e.prototype,"prefix",{get:function(){return a},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.wrapper.classList.add(a+"--open"),document.body.classList.add(a+"-opened")},e.prototype.close=function(){this.wrapper.classList.remove(a+"--open"),document.body.classList.remove(a+"-opened")},e}(),l=function(){function e(e,n){void 0===n&&(n="all"),this.menu=e,this.toggler=new t(n)}return e.prototype.navigation=function(e){var t=this;if(!this.navigator){var n=(e=e||{}).title,o=void 0===n?"Menu":n,i=e.selectedClass,s=void 0===i?"Selected":i,a=e.slidingSubmenus,c=void 0===a||a,l=e.theme,d=void 0===l?"light":l;this.navigator=new r(this.menu,o,s,c,d),this.toggler.add(function(){return t.menu.classList.add(t.navigator.prefix)},function(){return t.menu.classList.remove(t.navigator.prefix)})}return this.navigator},e.prototype.offcanvas=function(e){var t=this;if(!this.drawer){var n=(e=e||{}).position,o=void 0===n?"left":n;this.drawer=new c(null,o);var i=document.createComment("original menu location");this.menu.after(i),this.toggler.add(function(){t.drawer.content.append(t.menu)},function(){t.drawer.close(),i.after(t.menu)})}return this.drawer},e}(),d=l;window.MmenuLight=l;class u extends e.A{onReady(){let e=app.element("salla-products-list"),t=new URLSearchParams(window.location.search);t.has("sort")&&(app.element("#product-filter").value=t.get("sort")),app.on("change","#product-filter",async t=>{window.history.replaceState(null,null,salla.helpers.addParamToUrl("sort",t.currentTarget.value)),e.sortBy=t.currentTarget.value,await e.reload(),e.setAttribute("filters",`{"sort": "${t.currentTarget.value}"}`)}),salla.event.on("salla-products-list::products.fetched",e=>{e.title&&(app.element("#page-main-title").innerHTML=e.title)}),this.initiateMobileMenu()}initiateMobileMenu(){let e=app.element("#filters-menu"),t=app.element("a[href='#filters-menu']"),n=app.element("button.close-filters");if(!e)return;e=new d(e,"(max-width: 1024px)","( slidingSubmenus: false)");const o=e.offcanvas({position:salla.config.get("theme.is_rtl")?"right":"left"});t.addEventListener("click",e=>{document.body.classList.add("filters-opened"),e.preventDefault()||o.close()||o.open()}),n.addEventListener("click",e=>{document.body.classList.remove("filters-opened"),e.preventDefault()||o.close()}),salla.event.on("salla-filters::changed",e=>{Object.entries(e).length&&(document.body.classList.remove("filters-opened"),o.close())})}}u.initiateWhenReady(["product.index","product.index.latest","product.index.offers","product.index.search","product.index.tag"])})()})(); \ No newline at end of file diff --git a/src/assets/js/product.js b/src/assets/js/product.js index 580ff0276..33702bc7a 100644 --- a/src/assets/js/product.js +++ b/src/assets/js/product.js @@ -26,9 +26,10 @@ class Product extends BasePage { initProductOptionValidations() { document.querySelector('.product-form')?.addEventListener('change', function(){ - // reportValidity() natively focuses/scrolls to the first empty required option mid-edit; read validity instead - const isComplete = Array.from(this.elements).every(el => el.validity.valid); - isComplete && salla.product.getPrice(new FormData(this)); + // Prefer checkValidity() over iterating form.elements: some controls (e.g. fieldset) + // can make `el.validity.valid` throw/fail and block the live price request entirely. + // checkValidity() keeps the same gate without focus/scroll (unlike reportValidity). + this.checkValidity() && salla.product.getPrice(new FormData(this)); }); }