!function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0?1:0)-(t<0?1:0)||+t}function c(t){var e=t.getBoundingClientRect();return{height:n(e.height,t.offsetHeight),width:n(e.width,t.offsetWidth)}}function h(t,e,i,n){var o=t&&t[e];return null==o?i:n&&"function"==typeof o?o():o}function g(t){return Math.round(1e6*t)/1e6}function p(t){var e,i,n,o,r,a,l,s;function d(t){return 1-Math.pow(1-t,3)}function c(){return n?t.track.velocity():0}function h(t,e){void 0===e&&(e=1e3);var i=147e-9+(t=Math.abs(t))/e;return{dist:Math.pow(t,2)/i,dur:t/i}}function g(){var e=t.track.details;e&&(r=e.min,a=e.max,l=e.minIdx,s=e.maxIdx)}function p(){t.animator.stop()}t.on("updated",g),t.on("optionsChanged",g),t.on("created",g),t.on("dragStarted",function(){n=!1,p(),e=i=t.track.details.abs}),t.on("dragChecked",function(){n=!0}),t.on("dragEnded",function(){var n,g,m,f,b,y,S=t.options.mode;"snap"===S&&(n=t.track,m=(g=t.track.details).position,f=v(c()),(m>a||ma){var x=E=x||l0||l>w&&i<0)return e;var d=Math.max(0,1-Math.abs((lx&&y0||y===w&&i<0)&&s(e),f+=d,!b&&Math.abs(f*o)>5&&(b=!0),t.track.add(d),m=a,t.emit("dragged")}}function T(e){!c&&t.track.details&&t.track.details.length&&(f=0,c=!0,b=!1,p=!0,g=e.id,A(e),m=B(e),t.emit("dragStarted"))}function C(e){c&&g===e.idChanged&&(c=!1,t.emit("dragEnded"))}function A(t){var e=L(),i=e?t.y:t.x,n=e?t.x:t.y,o=void 0!==y&&void 0!==S&&Math.abs(S-n)<=Math.abs(y-i);return y=i,S=n,o}function B(t){return L()?t.y:t.x}function L(){return t.options.vertical}function M(){o=t.size,r=L()?window.innerHeight:window.innerWidth;var e=t.track.details;e&&(x=e.min,w=e.max)}function O(t){b&&(s(t),l(t))}function N(){if(D.purge(),t.options.drag&&!t.options.disabled){h="function"==typeof(o=t.options.dragSpeed||1)?o:function(t){return t*o},n=t.options.rtl?-1:1,M(),e=t.container,i="data-keen-slider-clickable",a("[".concat(i,"]:not([").concat(i,"=false])"),e).map(function(t){D.add(t,"dragstart",s),D.add(t,"mousedown",s),D.add(t,"touchstart",s)}),D.add(e,"dragstart",function(t){l(t)}),D.add(e,"click",O,{capture:!0}),D.input(e,"ksDragStart",T),D.input(e,"ksDrag",I),D.input(e,"ksDragEnd",C),D.input(e,"mousedown",T),D.input(e,"mousemove",I),D.input(e,"mouseleave",C),D.input(e,"mouseup",C),D.input(e,"touchstart",T,{passive:!0}),D.input(e,"touchmove",I,{passive:!1}),D.input(e,"touchend",C),D.input(e,"touchcancel",C),D.add(window,"wheel",function(t){c&&l(t)});var i,o,r="data-keen-slider-scrollable";a("[".concat(r,"]:not([").concat(r,"=false])"),t.container).map(function(t){var e;D.input(t,"touchstart",function(t){e=B(t),E=!0,k=!0},{passive:!0}),D.input(t,"touchmove",function(i){var n=L(),o=n?t.scrollHeight-t.clientHeight:t.scrollWidth-t.clientWidth,r=e-B(i),a=n?t.scrollTop:t.scrollLeft,s=n&&"scroll"===t.style.overflowY||!n&&"scroll"===t.style.overflowX;if(e=B(i),(r<0&&a>0||r>0&&a=1||(t.origin=1-e-(g>1?0:1-g)),t})}e.options.trackConfig=r}function w(){I();var t=e.size;e.options.disabled||t===o||(o=t,E())}function D(){w(),setTimeout(w,500),setTimeout(w,2e3)}function I(){var t=c(e.container);e.size=(e.options.vertical?t.height:t.width)||1}function T(){e.slides=a(e.options.selector,e.container)}e.container=(v=a(i,document)).length?v[0]:null,e.destroy=function(){g.purge(),e.emit("destroyed"),p(!0)},e.prev=function(){e.moveToIdx(e.track.details.abs-1,!0)},e.next=function(){e.moveToIdx(e.track.details.abs+1,!0)},e.update=E,y(e.options)}),f,m,p],l||[],!0),S={},y={emit:function(t){S[t]&&S[t].forEach(function(t){t(y)});var e=y.options&&y.options[t];e&&e(y)},moveToIdx:function(t,e,i){var n=y.track.idxToDist(t,e);if(n){var o=y.options.defaultAnimation;y.animator.start([{distance:n,duration:h(i||o,"duration",500),easing:h(i||o,"easing",function(t){return 1+--t*t*t*t*t})}])}},on:function(t,e,i){void 0===i&&(i=!1),S[t]||(S[t]=[]);var n=S[t].indexOf(e);n>-1?i&&delete S[t][n]:i||S[t].push(e)},options:n},function(){if(y.track=function(t){var i,n,r,a,l,s,d,c,p,m,f,b,y,S,k=1/0,E=[],x=null,w=0;function D(t){M(w+t)}function I(t){var e=T(w+t).abs;return B(e)===e?e:null}function T(t){var i=Math.floor(Math.abs(g(t/n))),o=g((t%n+n)%n);o===n&&(o=0);var r=v(t),a=d.indexOf(e([],d,!0).reduce(function(t,e){return Math.abs(e-o)0?1:-1),{abs:l+i*s*r,origin:a,rel:l}}function C(t,e,i){if(e||!a.loop)return A(t,i);if(B(t)!==t)return null;var n,o=T(null!=i?i:w),r=o.abs,l=t-o.rel,d=r+l;n=A(d);var u=A(d-s*v(l));return(null!==u&&Math.abs(u)6&&(E=E.slice(-6)),w=g(e);var i,n=O().abs;if(n!==x){var r=null!==x;x=n,r&&t.emit("slideChanged")}}function O(e){var o=e?null:function(){if(s){var t=a.loop,e=t?(w%n+n)%n:w,i=(t?w%n:w)-l[0][2],o=0-(i<0&&t?n-Math.abs(i):i),d=0,u=T(w),c=u.abs,h=u.rel,g=l[h][2],k=l.map(function(e,i){var r=o+d;(r<0-e[0]||r>1)&&(r+=(Math.abs(r)>n-1&&t?n:0)*v(-r));var l=i-h,u=v(l),p=l+c;t&&(-1===u&&r>g&&(p+=s),1===u&&rb&&(r-=n));var m=r+e[0]+e[1],y=Math.max(r>=0&&m<=1?1:m<0||r>1?0:r<0?Math.min(1,(e[0]+r)/e[0]):(1-r)/e[0],0);return d+=e[0]+e[1],{abs:p,distance:a.rtl?-1*r+1-e[0]:r,portion:y,size:e[0]}});return h=L(c=B(c)),{abs:B(c),length:r,max:S,maxIdx:m,min:y,minIdx:p,position:w,progress:t?e/n:w/r,rel:h,slides:k,slidesLength:n}}}();return i.details=o,t.emit("detailsChanged"),o}return i={absToRel:L,add:D,details:null,distToIdx:I,idxToDist:C,init:function(e){var i,o,u,v;if(function(){if(s=(l=((a=t.options).trackConfig||[]).map(function(t){return[h(t,"size",1),h(t,"spacing",0),h(t,"origin",0)]})).length){n=g(l.reduce(function(t,e){return t+e[0]+e[1]},0));var e,i=s-1;r=g(n+l[0][2]-l[i][0]-l[i][2]-l[i][1]),d=l.reduce(function(t,i){if(!t)return[0];var n=l[t.length-1],o=t[t.length-1]+(n[0]+n[2])+n[1];return o-=i[2],t[t.length-1]>o&&(o=t[t.length-1]),o=g(o),t.push(o),(!e||e200||(v(n)!==v(e.distance)&&e.distance&&(e={distance:0,lastTimestamp:0,time:0}),e.time&&(e.distance+=n),e.lastTimestamp&&(e.time+=o-e.lastTimestamp),e.lastTimestamp=o),e},{distance:0,lastTimestamp:0,time:0});return e.distance/e.time||0}}}(y),y.animator=function(t){var e,i,n,o,r,a;function l(t){e.active=t}function s(t){e.targetIdx=t}function d(){var e;e=r,window.cancelAnimationFrame(e),l(!1),s(null),a&&t.emit("animationStopped"),a=null}return e={active:!1,start:function(e){if(d(),t.track.details){var u=0,v=t.track.details.position;i=0,n=0,o=e.map(function(t){var e,i=Number(v),o=null!==(e=t.earlyExit)&&void 0!==e?e:t.duration,r=t.easing,a=t.distance*r(o/t.duration)||0;v+=a;var l=n;return n+=o,u+=a,[i,t.distance,l,n,t.duration,r]}),s(t.track.distToIdx(u)),function e(){r=window.requestAnimationFrame(function r(d){a||(a=d),l(!0);var u=d-a;u>n&&(u=n);var v=o[i];if(v[3]{var e,i,n,o;let r;let a=null!==(o=t.options.autoplay)&&void 0!==o?o:{},l=!1,s=null,d=null===(n=t.container)||void 0===n?void 0:null===(i=n.closest(".gp-carousel-wrapper"))||void 0===i?void 0:null===(e=i.getElementsByClassName("gp-carousel-dot-container"))||void 0===e?void 0:e[0];function u(t){t.forEach(t=>{t.isIntersecting?c():v()})}function v(){clearTimeout(r)}function c(){var e,i;clearTimeout(r),r=setTimeout(()=>{!l&&a.enable&&t.next()},null!==(i=null===(e=a)||void 0===e?void 0:e.delay)&&void 0!==i?i:2e3)}function h(){l=!0,v()}function g(){l=!1,c()}t.on("created",()=>{var e;null==d||d.addEventListener("mouseover",h),null==d||d.addEventListener("mouseout",g),a.pauseOnHover&&(t.container.addEventListener("mouseover",h),t.container.addEventListener("mouseout",g)),(null===(e=t.options.autoplay)||void 0===e?void 0:e.enable)&&c()}),t.on("dragStarted",v),t.on("animationEnded",c),t.on("updated",t=>{var e,i;a=null!==(i=null===(e=t.options)||void 0===e?void 0:e.autoplay)&&void 0!==i?i:{},c()}),t.on("destroyed",()=>{t.container.removeEventListener("mouseover",h),t.container.removeEventListener("mouseout",g)}),t.on("optionsChanged",e=>{var i,n,o,r;(null===(i=e.options.autoplay)||void 0===i?void 0:i.pauseOnHover)===a.pauseOnHover||((null===(n=e.options.autoplay)||void 0===n?void 0:n.pauseOnHover)&&(t.container.addEventListener("mouseover",h),t.container.addEventListener("mouseout",g)),(null===(o=e.options.autoplay)||void 0===o?void 0:o.pauseOnHover)||(t.container.removeEventListener("mouseover",h),t.container.removeEventListener("mouseout",g),l=!1)),c(),(a=null!==(r=e.options.autoplay)&&void 0!==r?r:{}).enable&&(s||!t.container||(s=new IntersectionObserver(u,{root:null,threshold:0})).observe(t.container),c())}),t.on("destroyed",()=>{t.container&&(t.container.removeEventListener("mouseover",h),t.container.removeEventListener("mouseout",g)),null==d||d.removeEventListener("mouseover",h),null==d||d.removeEventListener("mouseout",g),v(),s&&(s.disconnect(),s=null)})},S=t=>{let e=new MutationObserver(e=>{e.forEach(()=>{t.update()})}),i={childList:!0},n=new ResizeObserver(function(){o(t),t.update()}),o=t=>{if(t.options.vertical){r(t);return}a(t)},r=t=>{t.slides.forEach(t=>{t&&(t.style.maxWidth="",t.style.minWidth="")})},a=t=>{t.slides.forEach(t=>{t&&(t.style.maxHeight="",t.style.minHeight="")})};t.on("created",()=>{n.observe(t.container),e.observe(t.container,i)}),t.on("destroyed",()=>{n.unobserve(t.container),e.disconnect()})},k=t=>{if(t)return t&&"string"==typeof t&&((null==t?void 0:t.toLowerCase().startsWith("#"))||(null==t?void 0:t.toLowerCase().startsWith("rgb"))||(null==t?void 0:t.toLowerCase().startsWith("hsl"))||(null==t?void 0:t.toLowerCase().startsWith("transparent")))?t:`var(--g-c-${t}, ${t})`},E=["desktop","tablet","mobile"],x=(t,e,i)=>{var n,o,r,a,l,s;switch(e){case"tablet":return null!==(o=null!==(n=null==t?void 0:t.tablet)&&void 0!==n?n:null==t?void 0:t.desktop)&&void 0!==o?o:i;case"mobile":return null!==(l=null!==(a=null!==(r=null==t?void 0:t.mobile)&&void 0!==r?r:null==t?void 0:t.tablet)&&void 0!==a?a:null==t?void 0:t.desktop)&&void 0!==l?l:i;default:return null!==(s=null==t?void 0:t.desktop)&&void 0!==s?s:i}},w=(t,e,i)=>{let n=t.getAttribute("gp-data-interaction"),o=JSON.parse(n||"{}");t.setAttribute("gp-data-interaction",JSON.stringify({...o,[e]:i}))};function D(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let I={EASE_IN:{value:"ease-in",formula:t=>t*t*t},EASE_OUT:{value:"ease-out",formula:t=>1-Math.pow(1-t,3)},EASE_IN_OUT:{value:"ease-in-out",formula:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2},DEFAULT:{value:"default",formula:t=>1+--t*t*t*t*t}},T="gem-slider-item",C="gp-carousel-dot",A="gp-carousel-dot--active",B={DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile"},L={MOBILE:768,TABLET:1024},M="var(--g-c-highlight, highlight)",O="var(--g-c-bg-1, bg-1);",N=()=>{window.removeEventListener("gp-global-loaded",N),customElements.get("gp-carousel")||customElements.define("gp-carousel",class extends GP.Component{connectedCallback(){this.init()}dispatchEventSelectItem(t){this.trigger&&(this.trigger({event:"gp:rollback:select-slide"}),this.trigger({event:"gp:select-slide",data:t}))}nextToIndex(t){var e;null===(e=this.slider)||void 0===e||e.moveToIdx(t,!0,{duration:0}),this.previousIndex=t}moveToIdx(t){var e,i,n,o;let{maxIdx:r=0}=null!==(o=null===(i=this.slider)||void 0===i?void 0:null===(e=i.track)||void 0===e?void 0:e.details)&&void 0!==o?o:{},a=t>r?r:t;null===(n=this.slider)||void 0===n||n.moveToIdx(a)}nextSlide(t){let{key:e,isRollback:i,element:n}=t;if(i){this.moveToIdx(this.previousIndex-1);return}w(n,e,String(this.previousIndex)),this.moveToIdx(this.previousIndex+1)}changeIndexSlideInteraction(t){let{rel:e}=this.getSliderSetting(),{key:i,data:n,isRollback:o,element:r}=t;if(o){this.moveToIdx(Number(n));return}w(r,i,String(e)),this.moveToIdx(n)}previousSlide(t){let{key:e,isRollback:i,element:n}=t;if(i){this.moveToIdx(this.previousIndex+1);return}w(n,e,String(this.previousIndex)),this.moveToIdx(this.previousIndex-1)}getSliderOption(){var t,e,i,n,o,r,a,l;let s=this.getSlideToShow(),d=this.isMobile(),u=`#gp-carousel-${this.componentId}>.${T}`,v=t=>{var e,i,n,o;return{slides:{perView:x(s,t,4)||1,spacing:x(null===(e=this.styles)||void 0===e?void 0:e.spacing,t),origin:this.getOriginCarousel(t),numberOfFullWidthShow:this.getNumberOfFullWidthShow(t)},loop:x(null===(i=this.setting)||void 0===i?void 0:i.loop,t,!1),vertical:x(null===(n=this.setting)||void 0===n?void 0:n.vertical,t),range:this.getMaxNavigationWhenSneak(t),drag:x(null===(o=this.setting)||void 0===o?void 0:o.enableDrag,t,!1)}},c=(()=>{var t,e,i;return this.isMobile()?null!==(e=null!==(t=null==s?void 0:s.mobile)&&void 0!==t?t:null==s?void 0:s.tablet)&&void 0!==e?e:null==s?void 0:s.desktop:this.isTablet()&&null!==(i=null==s?void 0:s.tablet)&&void 0!==i?i:null==s?void 0:s.desktop})(),h=c?{"(max-width: 9999px)":v("desktop"),"(max-width: 1024px)":v("tablet"),"(max-width: 767px)":v("mobile")}:{};return{selector:u,initial:this.getState("moveToIdx")||0,defaultAnimation:{duration:null!==(a=null===(t=this.styles)||void 0===t?void 0:t.playSpeed)&&void 0!==a?a:500,easing:t=>{var e;switch(null===(e=this.setting)||void 0===e?void 0:e.animationMode){case I.EASE_IN.value:return I.EASE_IN.formula(t);case I.EASE_OUT.value:return I.EASE_OUT.formula(t);case I.EASE_IN_OUT.value:return I.EASE_IN_OUT.formula(t);default:return I.DEFAULT.formula(t)}}},dragSpeed:1,renderMode:"performance",mode:"snap",loop:this.getValueByDevice(this.loop,B.DESKTOP,!1),vertical:this.getValueByDevice(null===(e=this.setting)||void 0===e?void 0:e.vertical,B.DESKTOP,!1),drag:this.getValueByDevice(this.enableDrag,B.DESKTOP,!1),rtl:null===(i=this.setting)||void 0===i?void 0:i.rtl,breakpoints:h,autoplay:{delay:(null!==(l=null===(n=this.setting)||void 0===n?void 0:n.autoplayTimeout)&&void 0!==l?l:1)*1e3,pauseOnHover:null===(o=this.setting)||void 0===o?void 0:o.pauseOnHover,enable:null===(r=this.setting)||void 0===r?void 0:r.autoplay},created:t=>{this.onCreated(t)},updated:()=>{if(this.productFormID&&!this.isUpdated){let t=new CustomEvent("activeMoveIndexSlider-"+this.productFormID);window.dispatchEvent(t),this.isUpdated=!0}},slideChanged:t=>{let e=0;e=this.productMedia>0?t.track.details.rel%this.productMedia:t.track.details.rel,this.setAttribute("active-index",e.toString()),this.previousIndex=e;let i=new Event("changeActiveIndex");this.dispatchEvent(i)},dragStarted:d?void 0:t=>{t.container.style.cursor="grabbing"},dragEnded:d?void 0:t=>{t.container.style.cursor="auto"},animationStarted:d?void 0:t=>{this.isRunningAnimation?t.options.defaultAnimation={duration:500,easing:t=>I.DEFAULT.formula(t)}:this.isRunningAnimation=!0},animationEnded:d?void 0:t=>{var e,i,n;let o=null===(e=this.setting)||void 0===e?void 0:e.animationMode;this.isRunningAnimation=!1,t.options.defaultAnimation={duration:(null===(i=this.styles)||void 0===i?void 0:i.playSpeed)===0?1:(null===(n=this.styles)||void 0===n?void 0:n.playSpeed)||500,easing(t){switch(o){case I.EASE_IN.value:return I.EASE_IN.formula(t);case I.EASE_OUT.value:return I.EASE_OUT.formula(t);case I.EASE_IN_OUT.value:return I.EASE_IN_OUT.formula(t);default:return I.DEFAULT.formula(t)}}}}}}onCreated(t){this.setSlider(t),this.getBackAndNextButton(),this.getDotContainer(),this.initSliderEvent(),this.updateDotClickEvent(),this.renderSliderDots(),this.checkDisableArrowButton(),this.showWrapper()}setSlider(t){this.slider=t}getBackAndNextButton(){var t,e;this.nextButton=null===(t=this.getElementsByClassName(`gp-carousel-action-next ${this.componentId}`))||void 0===t?void 0:t[0],this.backButton=null===(e=this.getElementsByClassName(`gp-carousel-action-back ${this.componentId}`))||void 0===e?void 0:e[0]}getDotContainer(){var t;this.dotContainer=null===(t=this.getElementsByClassName(`gp-carousel-dot-container-${this.componentId}`))||void 0===t?void 0:t[0]}initSliderEvent(){this.addEventNextAndBackSlide(),this.addEventSlideChange(),this.addEventAnimationEnded(),this.addEventOptionsChange()}addEventLazyImage(){let t=this,e=this.querySelectorAll(`#gp-carousel-${this.componentId} .gem-slider-item`);e&&t&&e.forEach(e=>{let i=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){let r=t.target.querySelector("img:not(.image-zoom)");if(r&&!r.classList.contains("gp_lazyload")&&!r.classList.contains("gp_lazyloaded")){var e,n,o;r.classList.add("gp_lazyload"),null===(o=window)||void 0===o||null===(n=o.gpLazySizes)||void 0===n||null===(e=n.loader)||void 0===e||e.unveil(r)}i.disconnect()}})},{root:t,rootMargin:"100%"});i.observe(e)})}addEventNextAndBackSlide(){var t,e;null===(t=this.nextButton)||void 0===t||t.addEventListener("click",t=>{var e;t.preventDefault(),null===(e=this.slider)||void 0===e||e.next()}),null===(e=this.backButton)||void 0===e||e.addEventListener("click",t=>{var e;t.preventDefault(),null===(e=this.slider)||void 0===e||e.prev()})}addEventSlideChange(){var t;null===(t=this.slider)||void 0===t||t.on("slideChanged",t=>{this.setSlider(t),this.checkDisableArrowButton(),setTimeout(()=>{this.updateDotColor()},10)})}checkDisableArrowButton(){var t,e,i,n,o,r;let a=null===(t=this.slider)||void 0===t?void 0:t.options.loop;if(a)return;let{abs:l=0,maxIdx:s=0}=null!==(r=null===(i=this.slider)||void 0===i?void 0:null===(e=i.track)||void 0===e?void 0:e.details)&&void 0!==r?r:{},d=this.getValueByDevice(null===(n=this.setting)||void 0===n?void 0:n.navigationEnable,this.getDeviceName(),!0),u=this.getValueByDevice(null===(o=this.setting)||void 0===o?void 0:o.navigationStyle,this.getDeviceName(),"none");if("none"!==u&&d){if(s===1/0)return;this.checkDisabledForBackButton(l),this.checkDisabledForNextButton(l,s)}}checkDisabledForBackButton(t){if(this.backButton){if(0===t){this.disableArrowButton(this.backButton);return}this.enableArrowButton(this.backButton)}}checkDisabledForNextButton(t,e){if(this.nextButton){if(t===e){this.disableArrowButton(this.nextButton);return}this.enableArrowButton(this.nextButton)}}disableArrowButton(t){!1!==this.isHiddenArrowWhenDisabled&&(t.style.setProperty("visibility","hidden","important"),t.dataset.hidden="true"),t.disabled=!0}enableArrowButton(t){!1!==this.isHiddenArrowWhenDisabled&&(t.style.removeProperty("visibility"),t.dataset.hidden="false"),t.disabled=!1}addEventAnimationEnded(){var t;null===(t=this.slider)||void 0===t||t.on("animationEnded",t=>{this.setSlider(t)})}updateDotColor(){var t,e,i,n,o;let{isInfinity:r,rel:a,slidePerPage:l}=this.getSliderSetting(),s=this.getActiveIndexDot(r,a,l),d=null===(e=this.dotContainer)||void 0===e?void 0:null===(t=e.getElementsByClassName(`${A}`))||void 0===t?void 0:t[0];if(!d)return;let u=(null===(i=d.dataset)||void 0===i?void 0:i.index)?parseInt(null===(n=d.dataset)||void 0===n?void 0:n.index,10):void 0;if(u===s)return;let{activeBgc:v,inactiveBgc:c}=this.getDotBackgroundColorFrom(d);d.style.backgroundColor=c||O,d.classList.remove(A);let h=null===(o=this.dotContainer)||void 0===o?void 0:o.querySelector(`#gp-carousel-${this.componentId}-${s}`);h&&(h.style.backgroundColor=v||M,h.classList.add(A))}getDotBackgroundColorFrom(t){let e=t.previousElementSibling,i="";if(e)i=e.style.backgroundColor;else{var n;let e=t.nextElementSibling;i=(null===(n=e.style)||void 0===n?void 0:n.backgroundColor)||""}let o=t.style.backgroundColor;return{activeBgc:o,inactiveBgc:i}}addEventOptionsChange(){var t;null===(t=this.slider)||void 0===t||t.on("optionsChanged",t=>{this.setSlider(t),this.updateDotClickEvent(),this.renderSliderDots(),this.checkDisableArrowButton()})}updateDotClickEvent(){this.dotContainer&&this.dotContainer.addEventListener("click",t=>{t.preventDefault();let e=t.target;!e.classList.contains(C)||e.classList.contains(A)||(this.changeStyleForDots(e),this.goToSlideByIndex(this.getSlideIndexByDot(e)))})}changeStyleForDots(t){var e,i;let n=null===(i=this.dotContainer)||void 0===i?void 0:null===(e=i.getElementsByClassName(`${A}`))||void 0===e?void 0:e[0];if(!n)return;let o=n.style.backgroundColor,r=t.style.backgroundColor;t.style.backgroundColor=o,t.classList.add(A),n.style.backgroundColor=r,n.classList.remove(A)}getSlideIndexByDot(t){var e;return(null===(e=t.dataset)||void 0===e?void 0:e.index)?parseInt(t.dataset.index,10):void 0}goToSlideByIndex(t){var e,i;if(void 0===t)return;let n=this.getValueByDevice(this.loop,this.getDeviceName(),!1)?t:this.getIndexSlideItem(t);x(null===(e=this.setting)||void 0===e?void 0:e.sneakPeak,this.getDeviceName())&&(n=t),this.previousIndex=n,null===(i=this.slider)||void 0===i||i.moveToIdx(n)}getIndexSlideItem(t){var e,i;let n=null!==(i=null===(e=this.slider)||void 0===e?void 0:e.slides.length)&&void 0!==i?i:0,o=this.getSlideToShow(),r=this.getValueByDevice(o,this.getDeviceName(),4),a=t*r;return a>=n-r&&(a=n-r),a}renderSliderDots(t=!1){var e,i;let{isInfinity:n,rel:o,slidePerPage:r}=this.getSliderSetting(),a=this.getValueByDevice(null===(e=this.setting)||void 0===e?void 0:e.dot,this.getDeviceName(),!0),l=this.getValueByDevice(null===(i=this.setting)||void 0===i?void 0:i.dotStyle,this.getDeviceName(),"none");if("none"===l||!a)return;let s=t?[0]:this.getDotItems();if(!this.dotContainer||0===s.length)return;let d="";s.forEach(t=>{let e=this.getActiveIndexDot(n,o,r),i=t===e;d+=this.renderDot({idx:t,isActive:i})}),this.dotContainer.innerHTML=d}renderDot(t){var e,i,n;let{idx:o,isActive:r}=t,a=r?null===(e=this.setting)||void 0===e?void 0:e.dotActiveColor:null===(i=this.setting)||void 0===i?void 0:i.dotColor,l=r?M:O;return` `}getSliderSetting(){var t,e,i,n,o,r,a,l,s,d,u,v;let c=this.getSlideToShow();return{isInfinity:(null===(i=this.slider)||void 0===i?void 0:null===(e=i.track)||void 0===e?void 0:null===(t=e.details)||void 0===t?void 0:t.maxIdx)===1/0,slidePerPage:this.getValueByDevice(c,this.getDeviceName(),4),totalSliderItem:null!==(u=null===(a=this.slider)||void 0===a?void 0:null===(r=a.track)||void 0===r?void 0:null===(o=r.details)||void 0===o?void 0:null===(n=o.slides)||void 0===n?void 0:n.length)&&void 0!==u?u:0,rel:null!==(v=null===(d=this.slider)||void 0===d?void 0:null===(s=d.track)||void 0===s?void 0:null===(l=s.details)||void 0===l?void 0:l.rel)&&void 0!==v?v:0}}getValueByDevice(t,e,i){var n,o,r,a,l,s;let d=e||this.getDeviceName();switch(d){case B.MOBILE:return null!==(r=null!==(o=null!==(n=null==t?void 0:t.mobile)&&void 0!==n?n:null==t?void 0:t.tablet)&&void 0!==o?o:null==t?void 0:t.desktop)&&void 0!==r?r:i;case B.TABLET:return null!==(l=null!==(a=null==t?void 0:t.tablet)&&void 0!==a?a:null==t?void 0:t.desktop)&&void 0!==l?l:i;default:return null!==(s=null==t?void 0:t.desktop)&&void 0!==s?s:i}}setWrapperHeight(){this.getSliderWrapper(),this.checkHeightAndAddEventResize()}setCarouselGap(){var t,e,i,n,o,r;this.sliderSelector=this.querySelector(`#gp-carousel-${this.componentId}`),this.sliderSelector&&(null===(t=this.sliderSelector)||void 0===t||t.style.removeProperty("--cg"),null===(e=this.sliderSelector)||void 0===e||e.style.removeProperty("--cg-tablet"),null===(i=this.sliderSelector)||void 0===i||i.style.removeProperty("--cg-mobile"),null===(n=this.sliderSelector)||void 0===n||n.style.removeProperty("--rg"),null===(o=this.sliderSelector)||void 0===o||o.style.removeProperty("--rg-tablet"),null===(r=this.sliderSelector)||void 0===r||r.style.removeProperty("--rg-mobile"))}getSliderWrapper(){var t;this.sliderWrapper=null===(t=this.getElementsByClassName("gp-carousel-wrapper"))||void 0===t?void 0:t[0]}getSliderSelector(){this.sliderSelector=this.querySelector(`#gp-carousel-${this.componentId}`)}setCarouselOffset(){let t=this.querySelector(`#gp-carousel-${this.componentId}>.${T}`);t&&(null==t||t.style.removeProperty("--ml"),null==t||t.style.removeProperty("--ml-tablet"),null==t||t.style.removeProperty("--ml-mobile"))}showWrapper(){var t;let e=null===(t=this.getElementsByClassName("gp-carousel-wrapper"))||void 0===t?void 0:t[0];e&&(e.style.visibility="")}checkHeightAndAddEventResize(){this.checkWrapperHeight(),window.addEventListener("resize",()=>{this.checkWrapperHeight()})}checkWrapperHeight(){var t,e;let i=this.getDeviceName();if(null===(t=null===(e=this.setting)||void 0===e?void 0:e.vertical)||void 0===t?void 0:t[i]){let t=this.getHeightByDevice(i);if(!t||!this.sliderWrapper)return;this.sliderWrapper.style.height=t}}getHeightByDevice(t){var e,i,n,o,r,a,l;let s=null===(e=this.styles)||void 0===e?void 0:e.sizeSetting;switch(t){case"desktop":return null==s?void 0:null===(i=s.desktop)||void 0===i?void 0:i.height;case"tablet":return(null==s?void 0:null===(n=s.tablet)||void 0===n?void 0:n.height)||(null==s?void 0:null===(o=s.desktop)||void 0===o?void 0:o.height);case"mobile":return(null==s?void 0:null===(r=s.mobile)||void 0===r?void 0:r.height)||(null==s?void 0:null===(a=s.tablet)||void 0===a?void 0:a.height)||(null==s?void 0:null===(l=s.desktop)||void 0===l?void 0:l.height)}}getDeviceName(){return window.innerWidth<768?B.MOBILE:window.innerWidth>=768&&window.innerWidth<1025?B.TABLET:B.DESKTOP}updateOptionStyles(t){this.styles={...this.styles,...t},this.checkWrapperHeight()}rerender(){var t;null===(t=this.slider)||void 0===t||t.update()}constructor(){super(),D(this,"componentId",""),D(this,"setting",void 0),D(this,"styles",void 0),D(this,"slider",void 0),D(this,"sliderWrapper",void 0),D(this,"nextButton",void 0),D(this,"backButton",void 0),D(this,"dotContainer",void 0),D(this,"isHiddenArrowWhenDisabled",void 0),D(this,"hasRemoveSpacing",!1),D(this,"productFormID",void 0),D(this,"sliderSelector",void 0),D(this,"isRunningAnimation",!1),D(this,"isUpdated",!1),D(this,"previousIndex",0),D(this,"loop",void 0),D(this,"productMedia",0),D(this,"enableDrag",void 0),D(this,"init",()=>{var t;let e=this.closest(".gps > section");if(null==e?void 0:e.classList.contains("gps-lazy")){null==e||e.addEventListener("GpLazyLoaded",this.init);return}if(null==e||e.removeEventListener("GpLazyLoaded",this.init),this.componentId=this.getState("id"),this.productFormID=null===(t=this.closest("gp-product form"))||void 0===t?void 0:t.getAttribute("id"),!this.componentId)return;let i=this.getAttribute("product-media");if(this.productMedia=i?Number(i):0,this.setting=this.getState("setting"),this.styles=this.getState("styles"),this.getLoopSetting(),this.getEnableDragSetting(),this.isHiddenArrowWhenDisabled=this.getState("isHiddenArrowWhenDisabled"),i&&"1"===i){this.getDotContainer(),this.renderSliderDots(!0);let t=this.querySelector("img[data-srcset]");t&&!t.classList.contains("gp_lazyload")&&t.classList.add("gp_lazyload");return}this.slider=new b(`#gp-carousel-${this.componentId}`,this.getSliderOption(),[t=>S(t),y]),this.addEventLazyImage(),this.setWrapperHeight(),this.setCarouselOffset(),this.onListenerChangeSlideInteraction(),this.setCarouselGap();let n=this.querySelector(".gem-slider");null==n||n.addEventListener("click",t=>{var e;let i=null===(e=t.target.closest(".gem-slider-item"))||void 0===e?void 0:e.getAttribute("data-index");this.dispatchEventSelectItem(Number(i))})}),D(this,"getLoopSetting",()=>{var t;this.loop=null===(t=this.setting)||void 0===t?void 0:t.loop}),D(this,"getEnableDragSetting",()=>{var t;this.enableDrag=null===(t=this.setting)||void 0===t?void 0:t.enableDrag,E.forEach(t=>{var e,i;let n=this.getValueByDevice(null===(e=this.setting)||void 0===e?void 0:e.enableAction,this.getDeviceName(),!0);this.enableDrag={...this.enableDrag,[t]:!!n&&this.getValueByDevice(null===(i=this.setting)||void 0===i?void 0:i.enableDrag,this.getDeviceName(),!1)}})}),D(this,"getSneakPeakByDevice",()=>{var t;return x(null===(t=this.setting)||void 0===t?void 0:t.sneakPeak,this.getDeviceName(),!1)}),D(this,"isMobile",()=>window.innerWidthwindow.innerWidthwindow.innerWidth>=L.TABLET),D(this,"getNumberOfFullWidthShow",t=>{var e,i,n;let o="center"===x(null===this||void 0===this?void 0:null===(e=this.setting)||void 0===e?void 0:e.sneakPeakType,t)?2:1;return"number"==typeof x(null===(i=this.setting)||void 0===i?void 0:i.itemNumber,t,4)?x(null===(n=this.setting)||void 0===n?void 0:n.itemNumber,t,4)-o:void 0}),D(this,"getOriginCarousel",t=>{var e,i;let n="center"===x(null===(e=this.setting)||void 0===e?void 0:e.sneakPeakType,t)&&x(null===(i=this.setting)||void 0===i?void 0:i.sneakPeak,t)?"center":"auto";return n}),D(this,"getMaxNavigationWhenSneak",t=>{var e,i,n;if("center"!==this.getOriginCarousel(t))return{};let o=(null===(i=this.setting)||void 0===i?void 0:null===(e=i.childItem)||void 0===e?void 0:e.length)||1,r=Number(x(this.getSlideToShow(),t,1))||2;x(null===this||void 0===this?void 0:null===(n=this.setting)||void 0===n?void 0:n.sneakPeak,t)&&(r=Math.trunc(Number(this.getNumberOfFullWidthShow(t))||1));let a=o-r,l=x(this.loop,t,!1);return l?{max:void 0}:{max:a}}),D(this,"getActiveIndexDot",(t,e,i)=>{let n=t?e:Math.ceil(e/i);return this.getSneakPeakByDevice()&&(n=e),n}),D(this,"getSlideToShowFromOldData",()=>{var t;if(!(null===(t=this.setting)||void 0===t?void 0:t.slidesToShow))return null;let e={};return E.forEach(t=>{var i;let n=x(null===(i=this.setting)||void 0===i?void 0:i.slidesToShow,t);e[t]=n?"auto"===n?4:n:1}),e}),D(this,"getSlideToShow",()=>{let t=this.getSlideToShowFromOldData();if(t)return t;let e={};return E.forEach(t=>{var i,n,o,r,a,l,s,d;let u=x(null===(i=this.setting)||void 0===i?void 0:i.sneakPeak,t),v=u?"center"===x(null===(n=this.setting)||void 0===n?void 0:n.sneakPeakType,t)?null!==(s=x(null===(o=this.setting)||void 0===o?void 0:o.sneakPeakOffsetCenter,t))&&void 0!==s?s:0:null!==(d=x(null===(r=this.setting)||void 0===r?void 0:r.sneakPeakOffsetForward,t))&&void 0!==d?d:0:0,c=x(null===(a=this.setting)||void 0===a?void 0:a.itemNumber,t)||0,h="center"===x(null===(l=this.setting)||void 0===l?void 0:l.sneakPeakType,t)?-2:-1;e[t]="auto"===c?c:c+v/100*h}),e}),D(this,"getDotItems",()=>{let{isInfinity:t,totalSliderItem:e,slidePerPage:i}=this.getSliderSetting(),n=[];if(this.getSneakPeakByDevice()){let i=this.getDeviceName(),o=this.getNumberOfFullWidthShow(i);n=Array.from({length:t?e:e-(o||0)+1},(t,e)=>e)}else n=Array.from({length:t?e:Math.ceil(e/i)},(t,e)=>e);return n}),D(this,"onListenerChangeSlideInteraction",()=>{this.onTrigger&&(this.onTrigger({event:"gp:change-previous-slide"},t=>{let{isRollback:e,data:i,uniqueStorageKey:n}=t||{};this.previousSlide({isRollback:e,data:i,key:n,element:this})}),this.onTrigger({event:"gp:change-next-slide"},t=>{let{isRollback:e,uniqueStorageKey:i,data:n}=t||{};this.nextSlide({isRollback:e,data:n,key:i,element:this})}),this.onTrigger({event:"gp:change-index-slide"},t=>{let{isRollback:e,uniqueStorageKey:i,data:n}=t||{};this.changeIndexSlideInteraction({isRollback:e,data:n,key:i,element:this})}))})}})};"completed"===window.gpReadyState?N():window.addEventListener("gp-global-loaded",N)}();