1"use strict";(globalThis.webpackChunkapp_custom_swatch=globalThis.webpackChunkapp_custom_swatch||[]).push([[822],{34618:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}}),n(60825);var s=n(23029),i=n(92901),r=n(56822),a=n(53954),o=n(85501);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function u(e){return function(e){function t(){return(0,s.A)(this,t),e=this,n=t,i=arguments,n=(0,a.A)(n),(0,r.A)(e,c()?Reflect.construct(n,i||[],(0,a.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,o.A)(t,e),(0,i.A)(t,[{key:"init",value:function(){this.eventBus().on("canvas.engraving.start","disableAddToCart"),this.eventBus().on("canvas.engraving.finish","enableAddToCart")}},{key:"disableAddToCart",value:function(){this.ref("self").disable()}},{key:"enableAddToCart",value:function(){this.ref("self").enable()}}])}(e)}},98624:function(e,t,n){n.r(t),n.d(t,{default:function(){return d}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=n(77670),h=n(69372),f=n(86474);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function d(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,v()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({step:"step",canvas:"canvas",classBusy:"m-busy",classNoHeight:"m-no-height",tooltip:"tooltip"},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.renderTooltip(),this.eventBus().on("step.back.request","onStepBack"),this.eventBus().on("viewtype.change","renderTooltip"),this.eventBus().on("zoom.modal.request","onZoomRequest"),this.eventBus().on("back.view.updated","onBackViewUpdate"),this.eventBus().on("step.change.request","onStepChangeRequest"),this.eventBus().on("customization.step.resolved","onStepResolved"),this.eventBus().on("add.no.height.class","addNoHeightClass")}},{key:"addNoHeightClass",value:function(){this.ref(this.prefs().canvas).addClass(this.prefs().classNoHeight)}},{key:"renderTooltip",value:function(){var e=this;return this.render("tooltipContent",{isMobile:f.isMobileView()},this.ref(this.prefs().tooltip)).then((function(){e.eventBus().emit("canvas.tooltip.rendered")}))}},{key:"onStepResolved",value:function(e){var t=this;return this.images=e,this.render("stepEngraving",e,this.ref(this.prefs().step)).then((function(){t.eventBus().emit("canvas.engraving.rendered")}))}},{key:"onBackViewUpdate",value:function(e){if(!e)return!1;this.images.back=e.view,this.images.backPreview=e.preview}},{key:"onStepBack",value:function(){this.ref(this.prefs().canvas).removeClass(this.prefs().classBusy),this.ref(this.prefs().step).get().className="",this.ref(this.prefs().step).empty(),this.ref(this.prefs().canvas).removeClass(this.prefs().classNoHeight)}},{key:"onZoomRequest",value:function(e){var t=this;if(!e||!e.url)return!1;var n={front:this.images.front,frontPreview:this.images.frontPreview,back:this.images.back,backPreview:this.images.backPreview,activeSlide:e.activeSlide};(0,l.uf)(e.url,n).then((function(e){return t.eventBus().emit("zoom.request.approved",e)})).catch((function(e){return t.onZoomError(e)}))}},{key:"onZoomError",value:function(e){(0,h._K)(e)}},{key:"onStepChangeRequest",value:function(){this.ref(this.prefs().canvas).addClass(this.prefs().classBusy)}}])}(e)}},32585:function(e,t,n){n.r(t),n.d(t,{default:function(){return v}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(60825);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=(n(28706),n(26099),n(23500),n(77670)),h=n(69372);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function v(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,p()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?f(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({shippingMethods:"shippingMethods",shippingFormBlock:"shippingFormBlock",billingForm:"dwfrm_canvasMuseumBilling",selectedShippingClass:"selectedShipping",shippingForm:"dwfrm_canvasMuseumShipping",activeTabClass:"m-active"},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.isShippingSelected=!1,this.shippingIsDifferent=!1,this.eventBus().on("canvasmuseum.shipping.selected","shippingSelected"),this.eventBus().on("canvasmuseum.render.shippings","showShippingMethods"),this.eventBus().on("canvasmuseum.shippingform.submit","submitShippingForm"),this.eventBus().on("canvasmuseum.billingform.status.updated","updateFormStatus"),this.isShippingMethodSelected(this.ref(this.prefs().shippingMethods).get().children)}},{key:"updateFormStatus",value:function(){this.shippingIsDifferent=!this.shippingIsDifferent,this.shippingIsDifferent?this.ref(this.prefs().shippingFormBlock).show():this.ref(this.prefs().shippingFormBlock).hide(),this.eventBus().emit("canvasmuseum.forms.status.updated",this.shippingIsDifferent)}},{key:"submitFormsStep",value:function(){this.ref(this.prefs().billingForm).validate()&&this.ref(this.prefs().billingForm).handleSubmit()}},{key:"submitShippingForm",value:function(){this.ref(this.prefs().shippingForm).validate()&&this.ref(this.prefs().shippingForm).handleSubmit()}},{key:"showShippingMethods",value:function(e){var t=this;(0,l.uf)(e,{}).then((function(e){return t.updateShippingMethods(e)})).catch((function(e){return(0,h._K)(e)}))}},{key:"isShippingMethodSelected",value:function(e){for(var t=0;t<e.length;t++)if(e[t].className.indexOf(this.prefs().selectedShippingClass)>-1)return!0;return!1}},{key:"updateShippingMethods",value:function(e){var t=this.ref(this.prefs().shippingMethods);t.empty(),t.append(e),this.isShippingMethodSelected(t.get().children)&&(this.isShippingSelected=!0,this.eventBus().emit("canvasmuseum.accordion.shipping.selected")),this.showShippingMethodsBlock()}},{key:"shippingSelected",value:function(){this.isShippingSelected=!0}},{key:"showShippingMethodsBlock",value:function(){this.accordionTabHandle("canvasShipping","hide"),this.accordionTabHandle("canvasDelivery","show")}},{key:"updateCurrentShippingMethod",value:function(e){var t=e.els[0].id;this.eventBus().emit("canvasmuseum.shipping.method.updated",t)}},{key:"finishCheckout",value:function(){this.accordionTabHandle("canvasDelivery","hide"),this.isShippingSelected&&this.eventBus().emit("canvasmuseum.enable.confirm.button")}},{key:"accordionTabHandle",value:function(e,t){var n=this.ref("self").get(),s=this.prefs().activeTabClass,i=n.querySelectorAll('[data-accordion-title="'.concat(e,'"], [data-accordion-content="').concat(e,'"]'));"show"===t?i.forEach((function(e){e.classList.add(s)})):"hide"===t&&i.forEach((function(e){e.classList.remove(s)}))}}])}(e)}},82454:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(e,t,n,s){var i=(0,c.A)((0,o.A)(1&s?e.prototype:e),t,n);return 2&s&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function p(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?l(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},f(t,"prefs",this,3)([]))}},{key:"init",value:function(){f(t,"init",this,3)([])}},{key:"onSubmitted",value:function(e){e&&!e.error?this.eventBus().emit("canvasmuseum.billing.submitted"):this.eventBus().emit("canvasmuseum.checkout.error")}},{key:"closeForm",value:function(){this.emit("closed")}},{key:"updateFormStatus",value:function(){this.eventBus().emit("canvasmuseum.billingform.status.updated")}}])}(e)}},52434:function(e,t,n){n.r(t),n.d(t,{default:function(){return f}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({pid:"",flowType:"",calleoFlowTypes:"",available:!1,readyToOrder:!1,proceed:"proceed",showAddToCartBtn:"showAddToCartBtn"},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.activeStep=1,this.productData=null,this.watchFrontImage="",this.flowType=this.prefs().flowType,this.calleoFlowTypes=this.prefs().calleoFlowTypes,this.eventBus().on("size.info.changed","onSizeChange"),this.eventBus().on("customization.step.resolved","renderButtons"),this.eventBus().on("canvas.engraving.resolved","renderButtons"),this.eventBus().on("step.back.request","renderButtons"),this.eventBus().on("canvas.validation.success","enableNextButton"),this.eventBus().on("canvas.validation.fail","disableNextButton"),this.eventBus().on("engrave.image.updated","updateEngravingImgAttr"),this.eventBus().on("engraving.text.change","updateEngravingTextAttr"),this.eventBus().on("engraving.text.remove","updateEngravingTextAttr")}},{key:"onStepRequestChange",value:function(){this.eventBus().emit("step.change.request")}},{key:"onSizeChange",value:function(e){this.renderPrice(e)}},{key:"renderButtons",value:function(e){this.activeStep=e.step||1,this.watchFrontImage=e.smallFront,this.productData="addToCartData"in e?e.addToCartData:null,this.ref(this.prefs().proceed).hide(),this.ref(this.prefs().showAddToCartBtn).hide(),1===this.activeStep?this.ref(this.prefs().proceed).show():(this.ref(this.prefs().showAddToCartBtn).show(),this.eventBus().emit("add.no.height.class"))}},{key:"showCheckout",value:function(){var e={brand:"swatch",smallFront:this.watchFrontImage,productData:this.productData},t=this.isCalleoFlowType()?"canvasshop.addproductmodal.show":"canvasmuseum.checkout.show",n=function(){this.eventBus().emit(t,e)}.bind(this);this.eventBus().emit("engrave.update.text",n)}},{key:"isCalleoFlowType",value:function(){return this.calleoFlowTypes.indexOf(this.flowType)>-1}},{key:"renderCustomizationStep",value:function(e,t){e&&2===this.activeStep&&t.preventDefault(),this.eventBus().emit("step.back.request",{step:1})}},{key:"renderPrice",value:function(e){this.has("priceContainer")&&e.price&&e.price.sales&&this.render("priceTemplate",e,this.ref("priceContainer"))}},{key:"enableNextButton",value:function(){var e=this.has(this.prefs().proceed)?this.ref(this.prefs().proceed):null;e&&e.data("isAvailable")&&e.enable()}},{key:"disableNextButton",value:function(){var e=this.has(this.prefs().proceed)?this.ref(this.prefs().proceed):null;e&&e.disable()}},{key:"updateEngravingImgAttr",value:function(e){this.productData&&(this.productData.engraveShot=e)}},{key:"updateEngravingTextAttr",value:function(e){if(this.productData){var t=e.text;this.productData.engraving=t,t&&0!==t.length||this.updateEngravingImgAttr("")}}}])}(e)}},6650:function(e,t,n){n.r(t),n.d(t,{default:function(){return d}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=(n(23792),n(26099),n(3362),n(9391),n(47764),n(62953),n(77670)),h=n(69372);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function v(e,t,n,s){var i=(0,c.A)((0,o.A)(1&s?e.prototype:e),t,n);return 2&s&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function d(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,p()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?f(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({showEvent:"",addToCartUrl:"",getStoresUrl:"",defaultLocale:"",getOrderInfoUrl:"",getOrderTotalUrl:"",removeFromCartUrl:"",getShippingMethodsUrl:"",selectShippingMethodUrl:"",watchImage:"watchImg",listOfStores:"storesList",qrCodeBlock:"qrCodeBlock",paymentForm:"paymentForm",orderTotals:"orderTotals",checkoutType:"checkoutType",checkoutForm:"checkoutForm",storesCtnr:"storesContainer",canvasNoteText:"canvasNoteText",canvasCancelNoteText:"canvasCancelNoteText",canvasSuccessNoteText:"canvasSuccessNoteText",canvasErrorNoteText:"canvasErrorNoteText",checkoutStores:"checkoutStores",confirmOrderButton:"confirmOrderButton",orderTotalInfoBlock:"orderTotalInfoBlock",orderTotalInfoContent:"orderTotalInfoContent",cancelButton:"cancelButton",finishButton:"finishButton",errorBlock:"errorBlock",shopId:"",terminalId:""},v(t,"prefs",this,3)([]))}},{key:"init",value:function(){v(t,"init",this,3)([]),this.watchImageURL="",this.productData=null,this.productUUID=null,this.isProductAdded=!1,this.isFormSubmitted=!0,this.isShippingSelected=!1,this.isShippingDifferentAddress=!1,this.currentLocale=this.prefs().defaultLocale,this.translations={"data-translate":["btnDeliveryCountry","btnBackToCatalog","btnDeliveryAbroad","checkoutFormTitle","checkoutNextBtn","selectStoreTitle","checkoutQRCodeTitle","checkoutPaymentTitle","checkoutDeliveryTitle","checkoutDeliveryEditLabel","checkoutPaymentEditLabel","formDeliveryTitle","formPaymentTitle","formShippingTitle","formShippingIsDifferent","checkoutFinishBtn","checkoutConfirmBtn","checkoutEditBtn","checkoutPayBtn","checkoutCancelBtn","checkoutPayTitle","checkoutPayText","checkoutSuccessText","checkoutFinishOrderBtn","checkoutRetryBtn","checkoutCancelhBtn","checkoutErrorTextLine1","checkoutErrorTextLine2"],"data-translate-placeholder":"engravingInputText","data-translate-label":"formShippingIsDifferent"},this.eventBus().on(this.prefs().showEvent,"onShow"),this.eventBus().on("canvasmuseum.checkout.error","showError"),this.eventBus().on("canvasmuseum.set.storeqrcode","setQRCode"),this.eventBus().on("canvasmuseum.language.changed","updateLocale"),this.eventBus().on("canvasmuseum.billing.submitted","billingSubmitted"),this.eventBus().on("canvasmuseum.shipping.submitted","shippingSubmitted"),this.eventBus().on("canvasmuseum.forms.status.updated","updateFormsStatus"),this.eventBus().on("canvasmuseum.accordion.shipping.selected","shippingMethodSelected"),this.eventBus().on("canvasmuseum.shipping.method.updated","updateCurrentShippingMethod")}},{key:"onShow",value:function(e){var t=this;this.watchImageURL=e.smallFront,this.productData=e.productData,this.productData.canvasShopWatch=!0,this.showModal({}).then((function(){return t.translateModal()}))}},{key:"updateLocale",value:function(e){this.currentLocale=e.locale}},{key:"translateModal",value:function(){var e={defaultLocale:this.prefs().defaultLocale,translations:this.translations};this.eventBus().emit("canvasmuseum.translate.modal",e)}},{key:"closeCanvasMuseumCheckoutModal",value:function(){v(t,"closeModal",this,3)([])}},{key:"closeModal",value:function(){this.isProductAdded&&this.removeProductFromCart(),this.closeCanvasMuseumCheckoutModal()}},{key:"setWatchImg",value:function(){this.ref(this.prefs().watchImage).attr("src",this.watchImageURL)}},{key:"displayStores",value:function(e){var t=this.ref(this.prefs().listOfStores);t.empty(),t.append(e),this.ref(this.prefs().checkoutStores).show()}},{key:"deliveryInCountry",value:function(){this.setWatchImg(),this.ref(this.prefs().checkoutType).hide(),this.ref(this.prefs().paymentForm).show(),this.addProductToCart()}},{key:"deliveryInAbroad",value:function(){var e=this;this.ref(this.prefs().checkoutType).hide(),this.ref(this.prefs().paymentForm).show(),this.ref(this.prefs().canvasNoteText).hide(),this.ref(this.prefs().checkoutForm).hide(),this.ref("self").addClass("m-scrollbar_override"),this.has("scrollbar",(function(e){Promise.resolve().then(n.bind(n,13283)).then((function(t){t.default.destroy(e.get())}))})),(0,l.uf)(this.prefs().getStoresUrl,{}).then((function(t){return e.displayStores(t)})).catch((function(){return e.onStoresError()}))}},{key:"setQRCode",value:function(e){var t=this;this.ref(this.prefs().storesCtnr).hide(),n.e(380).then(n.t.bind(n,97283,23)).then((function(n){new(0,n.default)({width:400,height:400,data:e,image:t.prefs().swatchImgUrl,dotsOptions:{color:"#000",type:"rounded"},backgroundOptions:{color:"#fff"},imageOptions:{crossOrigin:"anonymous",margin:5}}).append(document.getElementById("canvasMuseumQRCode")),t.ref(t.prefs().qrCodeBlock).show()}))}},{key:"showOrderTotal",value:function(){var e=this;(0,l.uf)(this.prefs().getOrderTotalUrl,{locale:this.currentLocale}).then((function(t){return e.updatePageOrderTotal(t)}
1)).catch((function(){return e.showError()}))}},{key:"updatePageOrderTotal",value:function(e){var t=this.ref(this.prefs().orderTotals);t.empty(),t.append(e),this.showShippingForm()}},{key:"showShippingForm",value:function(){this.ref(this.prefs().checkoutForm).show()}},{key:"addProductToCart",value:function(){var e=this;this.productData?(0,l.zP)(this.prefs().addToCartUrl,this.productData).then((function(t){e.isProductAdded=!0,e.productUUID=t.pliUUID,e.showOrderTotal()})).catch((function(){return e.showError()})):this.showError()}},{key:"removeProductFromCart",value:function(){var e={uuid:this.productUUID,pid:this.productData.bundleID};(0,l.zP)(this.prefs().removeFromCartUrl,e,"GET")}},{key:"billingSubmitted",value:function(){this.isShippingDifferentAddress?this.eventBus().emit("canvasmuseum.shippingform.submit"):(this.isFormSubmitted=!0,this.eventBus().emit("canvasmuseum.render.shippings",this.prefs().getShippingMethodsUrl))}},{key:"shippingSubmitted",value:function(){this.isFormSubmitted=!0,this.eventBus().emit("canvasmuseum.render.shippings",this.prefs().getShippingMethodsUrl)}},{key:"updateFormsStatus",value:function(e){this.isShippingDifferentAddress=e}},{key:"updateCurrentShippingMethod",value:function(e){var t=this;(0,l.zP)(this.prefs().selectShippingMethodUrl,{methodID:e}).then((function(e){e.error?t.showError():(t.isShippingSelected=!0,t.showOrderTotal(),t.eventBus().emit("canvasmuseum.shipping.selected"))})).catch((function(){return t.showError()}))}},{key:"shippingMethodSelected",value:function(){this.isShippingSelected=!0}},{key:"onStoresError",value:function(){}},{key:"showError",value:function(e){e&&this.ref(this.prefs().canvasErrorNoteText).setText(e),this.ref(this.prefs().cancelButton).hide(),this.ref(this.prefs().canvasNoteText).hide(),this.ref(this.prefs().errorBlock).show()}},{key:"confirmOrder",value:function(){var e=this;this.ref(this.prefs().checkoutForm).hide(),(0,l.uf)(this.prefs().getOrderInfoUrl,{locale:this.currentLocale}).then((function(t){var n=e.ref(e.prefs().orderTotalInfoContent);n.empty(),n.append(t),e.ref(e.prefs().orderTotalInfoBlock).show()})).catch((function(){return e.showError()}))}},{key:"editOrder",value:function(){this.ref(this.prefs().orderTotalInfoBlock).hide(),this.ref(this.prefs().checkoutForm).show()}},{key:"payOrder",value:function(){var e=this;if(this.isFormSubmitted&&this.isShippingSelected){this.ref(this.prefs().cancelButton).show(),this.ref(this.prefs().cancelButton).focus(),this.ref(this.prefs().canvasNoteText).hide(),this.ref(this.prefs().orderTotalInfoBlock).hide(),this.ref(this.prefs().errorBlock).hide(),this.waitingResponse=!0;var t=this.prefs().submitFlow1Url;t=(0,h.u0)(t,"shopID",this.prefs().shopId),t=(0,h.u0)(t,"terminalID",this.prefs().terminalId),(0,l.zP)(t,{}).then((function(t){return e.showTerminalInfo(t)})).catch((function(){return e.showError()})).finally((function(){e.waitingResponse=!1}))}}},{key:"showTerminalInfo",value:function(e){e&&e.error?(this.showError(e.errorMessage),this.ref(this.prefs().cancelButton).hide(),this.ref(this.prefs().orderTotalInfoBlock).hide()):e&&e.success&&this.waitingResponse&&(this.ref(this.prefs().cancelButton).hide(),this.ref(this.prefs().finishButton).show())}},{key:"handleCancelClick",value:function(){var e=this;if(this.waitingResponse||!this.ref(this.prefs().errorBlock).hasAttr("hidden")){this.waitingResponse=!1;var t={shopID:this.prefs().shopId,terminalID:this.prefs().terminalId};(0,l.Ve)(this.prefs().cancelFlow1Url,t).then((function(){e.ref(e.prefs().cancelButton).hide(),e.ref(e.prefs().errorBlock).hide(),e.ref(e.prefs().orderTotalInfoBlock).show()})).catch((function(){return e.showError()}))}}},{key:"handleFinishClick",value:function(){location.reload()}}])}(e)}},46159:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}}),n(60825);var s=n(23029),i=n(92901),r=n(56822),a=n(53954),o=n(85501);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function u(e){return function(e){function t(){return(0,s.A)(this,t),e=this,n=t,i=arguments,n=(0,a.A)(n),(0,r.A)(e,c()?Reflect.construct(n,i||[],(0,a.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,o.A)(t,e),(0,i.A)(t,[{key:"init",value:function(){this.eventBus().on("canvasmuseum.enable.confirm.button","enableAddToCart")}}])}(e)}},2966:function(e,t,n){n.r(t),n.d(t,{default:function(){return m}}),n(52675),n(83851),n(81278),n(79432),n(60825);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=(n(28706),n(2008),n(23418),n(26099),n(47764),n(23500),n(36363)),h=n(95187);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var v=.8,d="#ffffff";function m(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,p()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?f(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({patterns:"patterns",patternCategory:"patternCategory",patternTitle:"patternTitle",patternsToggler:"patternsToggler",mechanisms:"mechanisms",mechanismCategory:"mechanismCategory",mechanismsToggler:"mechanismsToggler",sizes:"sizes",sizesToggler:"sizesToggler",panelActive:"active",panelPassive:"passive",itemCode:"code",masterIdCode:"master",priceCode:"price",swatchPayCode:"isswatchpay",itemName:"name",itemSubName:"subName",filename:"filename",sleeveID:"sleeve",productDescription:"description",productCaseMaterial:"casematerial",productStrapMaterial:"strapmaterial",productWaterproof:"waterproof",productMovementColor:"movemcolor",productCaseColor:"casecolor",productCaseInfo:"case",thumb:"thumb",previewLarge:"previewLarge",previewSmall:"previewSmall",opacity:"opacity",background:"background",watchHead:"watchHead",classEmpty:"m-empty",classActive:"m-active",classDisabled:"m-disabled",classVisible:"m-visible",selectorSize:".js-size",selectorPattern:".js-pattern",selectorMechanismBundle:".js-mechanism-bundle",selectorMechanismList:".js-mechanisms",selectorMechanism:".js-mechanism"},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.panelActive=this.prefs().patterns,this.eventBus().on("canvas.animation.done","onCanvasAnimationDone"),this.eventBus().on("pattern.category.render","renderCategory"),this.eventBus().on("canvas.mechanisms.render","renderMechanisms"),this.eventBus().on("pattern.changed","renderMechanisms"),this.eventBus().on("selected.size.apply","selectSize"),this.eventBus().on("selected.mechanism.apply","selectMechanism"),this.eventBus().on("canvas.zoom.updated","hide"),this.eventBus().on("canvas.rotation.updated","hide"),this.eventBus().on("pattern.change.request","setPattern")}},{key:"setPatternCategory",value:function(e){this.eventBus().emit("pattern.category.changed",e.data("pattern"))}},{key:"onCanvasAnimationDone",value:function(){var e=this;this.prefs().showInitPanel&&this.has(this.prefs().initPanel+"Toggler",(function(t){e.togglePanel(t)}))}},{key:"hide",value:function(){var e=this.prefs().classActive;this.ref("self").removeClass(e),this.ref(this.prefs().patterns).removeClass(e),this.ref(this.prefs().mechanisms).removeClass(e),this.ref(this.prefs().sizes).removeClass(e)}},{key:"renderMechanisms",value:function(e){var t=this,n=this.ref("self").get(),s=n.querySelectorAll(this.prefs().selectorMechanism),i=n.querySelectorAll(this.prefs().selectorMechanismList);if(!e||!e.mechanisms||!e.mechanisms.length)return s.forEach((function(e){return e.classList.add(t.prefs().classVisible)})),i.forEach((function(e){return e.classList.remove(t.prefs().classEmpty)})),!1;s.forEach((function(n){var s=~e.mechanisms.indexOf(n.dataset.code);n.classList.toggle(t.prefs().classVisible,s)})),i.forEach((function(e){var n=e.querySelectorAll(".".concat(t.prefs().classVisible,",.").concat(t.prefs().classDisabled));e.classList.toggle(t.prefs().classEmpty,!n.length)})),this.eventBus().emit("canvas.mechanisms.render.complete")}},{key:"togglePanel",value:function(e){var t=this,n=this.prefs().classActive,s=this.ref("self").get().querySelectorAll(this.prefs().selectorMechanism),i=this.ref("self").get().querySelectorAll(this.prefs().selectorPattern);this.panelActive=e.data(this.prefs().panelActive),this.panelsPassive="string"==typeof e.data(this.prefs().panelPassive)?e.data(this.prefs().panelPassive).split(" "):[],e.data("active")&&this.eventBus().emit("canvas.panel.open",e.data("active")),this.has(this.panelActive)&&this.ref(this.panelActive).toggleClass(n),Array.isArray(this.panelsPassive)&&this.panelsPassive.forEach((function(e){return t.ref(e).removeClass(n)})),this.isSizesActive=this.ref(this.prefs().sizes).hasClass(n),this.isPatternActive=this.ref(this.prefs().patterns).hasClass(n),this.isMechanismActive=this.ref(this.prefs().mechanisms).hasClass(n),this.hasActivePanel=this.isSizesActive||this.isPatternActive||this.isMechanismActive,i.forEac
1h((function(e){e.tabIndex=t.isPatternActive?0:-1})),s.forEach((function(e){e.tabIndex=t.isPatternActive?-1:0})),this.ref("self").toggleClass(this.prefs().classActive,this.hasActivePanel),this.has(this.prefs().sizesToggler)&&this.ref(this.prefs().sizesToggler).toggleClass(n,this.isSizesActive),this.ref(this.prefs().patternsToggler).toggleClass(n,this.isPatternActive),this.ref(this.prefs().mechanismsToggler).toggleClass(n,this.isMechanismActive)}},{key:"handlePanel",value:function(){var e=this,t=this.prefs().classActive,n=["self",this.prefs().patternsToggler,this.prefs().mechanismsToggler,this.prefs().sizesToggler,this.prefs().patterns,this.prefs().mechanisms,this.prefs().sizes];this.ref("self").hasClass(t)?n.forEach((function(n){return e.ref(n).removeClass(t)})):(this.ref("self").addClass(t),this.ref(this.panelActive).toggleClass(t),this.ref("".concat(this.panelActive).concat("Toggler")).toggleClass(t)),this.eventBus().emit("panel.updated")}},{key:"handleSizeClick",value:function(e){this.setSize(e)}},{key:"setSize",value:function(e,t){var n=this,s=this.prefs().classActive,i=this.ref("self").get();i.querySelectorAll(this.prefs().selectorSize).forEach((function(e){return e.classList.remove(s)})),e.addClass(s);var r={bundleCode:e.data(this.prefs().itemCode),bundleName:e.data(this.prefs().itemName),bundleSubName:e.data(this.prefs().itemSubName),masterProductId:e.data(this.prefs().masterIdCode),price:e.data(this.prefs().priceCode)};i.querySelectorAll(this.prefs().selectorMechanismBundle).forEach((function(e){e.dataset[n.prefs().itemCode]===r.bundleCode?e.classList.add(s):e.classList.remove(s)})),t||this.eventBus().emit("size.changed",r),this.eventBus().emit("size.info.changed",r)}},{key:"setPattern",value:function(e,t){var n=this.prefs().classActive,s=this.ref("self").get().querySelectorAll(this.prefs().selectorPattern),i={code:e.data(this.prefs().itemCode),thumb:e.data(this.prefs().thumb),previewLarge:e.data(this.prefs().previewLarge),previewSmall:e.data(this.prefs().previewSmall),opacity:e.data(this.prefs().opacity)||v,background:e.data(this.prefs().background)||d,mechanisms:e.data(this.prefs().watchHead),filename:e.data(this.prefs().filename),sleeveID:e.data(this.prefs().sleeveID)};s.forEach((function(e){return e.classList.remove(n)})),e.addClass(n),this.eventBus().emit("pattern.changed",i,{resetCoords:!t})}},{key:"setMechanism",value:function(e){var t=this.prefs().classActive;this.ref("self").get().querySelectorAll(this.prefs().selectorMechanism).forEach((function(e){return e.classList.remove(t)})),e.addClass(t);var n={description:e.data(this.prefs().productDescription),caseMaterial:e.data(this.prefs().productCaseMaterial),strapMaterial:e.data(this.prefs().productStrapMaterial),waterproof:e.data(this.prefs().productWaterproof),movementColor:e.data(this.prefs().productMovementColor),caseColor:e.data(this.prefs().productCaseColor),caseInfo:e.data(this.prefs().productCaseInfo),productCode:e.data(this.prefs().itemCode),price:e.data(this.prefs().priceCode),isSwatchPay:e.data(this.prefs().swatchPayCode)};this.eventBus().emit("mechanism.changed",n)}},{key:"selectSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n="".concat(this.prefs().selectorSize,"[data-code=").concat(e,"]"),s=this.ref("self").get().querySelector(n);s&&this.setSize(new h.s([s]),t)}},{key:"selectMechanism",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="".concat(this.prefs().selectorMechanism,"[data-bundle=").concat(t,"]"),s=this.ref("self").get().querySelectorAll(n),i=null,r=e.split(";"),a=function(){var e=r[o];if((i=Array.from(s).filter((function(t){return t.dataset.code===e}))).length)return 1},o=0;o<r.length&&!a();o++);Array.isArray(i)&&this.setMechanism(new h.s(i))}},{key:"renderCategory",value:function(e,t){var n=this.prefs().classActive,s=this.ref(this.prefs().patternCategory).get().children,i=this.ref(this.prefs().patternTitle).get().children,r=Array.from(s).concat(Array.from(i)),a=r.filter((function(t){return t.dataset.pattern===String(e)}));if(r.forEach((function(e){return e.classList.remove(n)})),a&&a.length){a.forEach((function(e){(0,l.Rt)(e),e.classList.add(n)}));var o=this.prefs().selectorPattern;"string"==typeof t&&(o=o+'[data-code="'+t+'"]');var c=new h.s([a[0].querySelector(o)]);this.setPattern(c,t)}
1this.eventBus().emit("pattern.category.carousel.render",e)}},{key:"handleTogglePanel",value:function(e,t){13===t.keyCode&&this.togglePanel(e)}},{key:"handleSetPattern",value:function(e,t){13===t.keyCode&&this.setPattern(e)}},{key:"handleVisibilityPanel",value:function(e,t){13===t.keyCode&&this.handlePanel()}},{key:"resetGroups",value:function(e){for(var t=0;t<e;t++)if(this.has("toggleButton".concat(t))){var n=this.ref("toggleButton".concat(t)),s=n.data("group");n.removeClass(this.prefs().classActive),this.has(s)&&this.ref(s).removeClass(this.prefs().classActive)}}},{key:"toggleGroups",value:function(e){var t=e.data("buttons"),n=e.data("group");if(this.resetGroups(t),e.addClass(this.prefs().classActive),this.has(n)){var s=this.ref(n),i=s.get().querySelectorAll(this.prefs().selectorSize)[0];s.addClass(this.prefs().classActive),i&&this.setSize(new h.s([i]))}}}])}(e)}},8777:function(e,t,n){n.r(t),n.d(t,{default:function(){return d}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(60825);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=(n(28706),n(62062),n(26099),n(23500),n(36363)),h=n(7769),f=n(86474);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function d(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,v()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({selectorMechanismBundleActive:".b-canvas_mechanism.m-active.js-mechanism-bundle",selectorMechanismTitleActive:".b-canvas_mechanism-title_group.m-active.js-mechanism-bundle",selectorMechanismList:".js-mechanisms",selectorActiveMechanism:".js-mechanism.m-active",selectorbundleWrapper:".js-bundle-wrapper",selectorAllRefs:"div[data-ref]",classActive:"m-active",classEmpty:"m-empty",mechanismScrollContainerRef:"mechanismScrollContainer",mechanismScrollBottomBtnRef:"mechanismScrollBottomBtn",scrollShift:20},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.eventBus().on("size.changed","onMechanismUpdates"),this.eventBus().on("canvas.mechanisms.render.complete","onMechanismUpdates"),f.isDesktopView()?(this.desktopScrollEvent=(0,h.s)(this.onDesktopScrollEvent.bind(this),100),this.initDesktopScrollEvent(),this.eventBus().on("size.changed","initDesktopScrollEvent"),this.eventBus().on("canvas.panel.open","initDesktopScrollEvent")):(this.mobileScrollEvent=(0,h.s)(this.onMobileScrollEvent.bind(this),100),this.initMobileScrollEvent(),this.mobileScrollEvent(),this.eventBus().on("size.changed","initMobileScrollEvent"),this.eventBus().on("canvas.panel.open","focusAciveMechanism"))}},{key:"onMechanismUpdates",value:function(){this.getCategories(),this.getCategoriesTitles()}},{key:"getActiveTitles",value:function(){return this.ref("self").get().querySelector(this.prefs().selectorMechanismTitleActive)}},{key:"focusAciveMechanism",value:function(e){var t=this.getActiveBundle().querySelector("".concat(this.prefs().selectorActiveMechanism));t&&"mechanisms"===e&&setTimeout((function(){(0,l.Rt)(t)}),200)}},{key:"getCategories",value:function(){for(var e=[],t=this.getMechanismActiveLists(),n=0;n<t.length;n+=1){var s=t[n].dataset.ref;s&&e.push(s)}this.categories=e}},{key:"getCategoriesTitles",value:function(){this.categoriesTitle=this.categories.map((function(e){return e+"Title"}))}},{key:"getActiveBundle",value:function(){return this.ref("self").get().querySelector(this.prefs().selectorMechanismBundleActive)}},{key:"getMechanismActiveLists",value:function(){var e=this.getActiveBundle();return e?e.querySelectorAll("".concat(this.prefs().selectorMechanismList,"
1:not(.").concat(this.prefs().classEmpty,")")):null}},{key:"showScrollBottomButton",value:function(){this.has(this.prefs().mechanismScrollBottomBtnRef)&&this.ref(this.prefs().mechanismScrollBottomBtnRef).addClass(this.prefs().classActive)}},{key:"hideScrollBottomButton",value:function(){this.has(this.prefs().mechanismScrollBottomBtnRef)&&this.ref(this.prefs().mechanismScrollBottomBtnRef).removeClass(this.prefs().classActive)}},{key:"initDesktopScrollEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e||"mechanisms"===e){var t=this.ref("self").get(),n=t.offsetHeight;this.has(this.prefs().mechanismScrollContainerRef)&&this.ref(this.prefs().mechanismScrollContainerRef).get().offsetHeight>n&&(t.addEventListener("scroll",this.desktopScrollEvent),this.showScrollBottomButton())}}},{key:"initMobileScrollEvent",value:function(){var e=this.getActiveBundle();e&&e.addEventListener("scroll",this.mobileScrollEvent)}},{key:"onDesktopScrollEvent",value:function(){var e=this.ref("self").get();e.offsetHeight+e.scrollTop>=this.ref(this.prefs().mechanismScrollContainerRef).get().offsetHeight?this.hideScrollBottomButton():this.showScrollBottomButton()}},{key:"onMobileScrollEvent",value:function(){var e=this,t=this.getActiveBundle(),n=t.querySelector("".concat(this.prefs().selectorbundleWrapper)),s=this.getMechanismActiveLists();if(t&&s&&n){var i=document.documentElement.clientWidth/2,r=t.scrollLeft,a=t.offsetWidth,o=n.offsetWidth,c=r<=this.prefs().scrollShift,u=a+r+this.prefs().scrollShift>=o;if(c)return void this.setTitle(this.categoriesTitle[0]);if(u)return void this.setTitle(this.categoriesTitle[this.categoriesTitle.length-1]);s.forEach((function(t){var n=t.dataset.title,s=t.getBoundingClientRect();Math.abs(s.left)<i&&e.setTitle(n)}))}}},{key:"scrollBottom",value:function(){var e=this.getActiveBundle(),t=this.categories[this.categories.length-1];e&&t&&(0,l.Rt)(e.querySelector("div[data-ref=".concat(t,"]")))}},{key:"resetActiveCategories",value:function(){for(var e=this.getActiveTitles().querySelectorAll(this.prefs().selectorAllRefs),t=0;t<e.length;t+=1)e[t].classList.remove(this.prefs().classActive)}},{key:"setTitle",value:function(e){var t=this.getActiveTitles().querySelector("div[data-ref=".concat(e,"]"));e!==this.activeCategory&&(this.resetActiveCategories(),this.activeCategory=e,t.classList.add(this.prefs().classActive))}},{key:"changeCategory",value:function(e){var t=this.getActiveBundle(),n=e.data("direction"),s=this.categoriesTitle.indexOf(this.activeCategory);if("next"===n){var i=this.categories[s+1];i&&(0,l.Rt)(t.querySelector("div[data-ref=".concat(i,"]")))}if("prev"===n){var r=this.categories[s-1];r&&(0,l.Rt)(t.querySelector("div[data-ref=".concat(r,"]")))}}}])}(e)}},17228:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=(n(69085),n(42762),n(77670));function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}function p(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,f()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({engrave:"text",shot:"image",defaultLocale:"",engravingConfig:"",classHidden:"d-none",classBusy:"m-busy",classError:"m-error",classInvalid:"m-invalid",validateEngravingTextUrl:""},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.validateEngravingTextUrl=this.config.validateEngravingTextUrl;var e=this.prefs().engravingConfig,t=this.prefs().defaultLocale;this.config={text:"",image:"",dpi:e.dpi,font:e.font,color:e.color,position:e.position},this.stopWords=sessionStorage.getItem("stopWords")||[],this.defaultLocale=t,this.translations={"data-translate":["engravingTitleLabel","engravingTextLabel","shippingLabel","engravingForbiddenText","descriptionLabel","productDetailsLabel","watchCaseMaterialLabel","watchStrapMaterialLabel","watchWarrantyLabel","watchWaterproofLabel","watchCaseLabel","watchMovementLabel","watchCaseColorLabel"],"data-translate-placeholder":"engravingInputText","data-translate-content":"shippingAndReturnsText"},this.eventBus().on("engrave.image.updated","onImageUpdate"),this.eventBus().on("engrave.update.text","update"),this.eventBus().on("engrave.remove.text","remove"),this.eventBus().on("step.back.request","remove"),this.translateEgravingPage()}},{key:"translateEgravingPage",value:function(){var e={translations:this.translations,defaultLocale:this.defaultLocale};this.eventBus().emit("canvasmuseum.translate.modal",e)}},{key:"getValidatedEngravingText",value:function(e,t){var n=this;this.ref("self").removeClass(this.prefs().classInvalid),(0,l.zP)(this.validateEngravingTextUrl,{engraving:e},"POST").then((function(e){e.error&&n.ref("self").addClass(n.prefs().classInvalid),t(e.engraving)}))}},{key:"update",value:function(e){var t=this;if(!this.ref(this.prefs().engrave).isValid())return this.ref("self").addClass(this.prefs().classError),!1;var n=this.ref(this.prefs().engrave).getValue();return n?n===this.config.text?("function"==typeof e&&e(),!1):(this.ref("self").addClass(this.prefs().classBusy),void this.getValidatedEngravingText(n,(function(n){var s=n.trim();if(s){t.config.text=s,t.eventBus().emit("canvas.engraving.start"),t.ref("self").removeClass(t.prefs().classError),t.ref("engravingClear").enable();var i=Object.assign({},t.config);
1i.callback=e,t.eventBus().emit("engraving.text.change",i)}else"function"==typeof e?t.remove(e):t.remove(null)}))):(this.remove(e),!1)}},{key:"remove",value:function(e){this.config.text="",this.ref(this.prefs().engrave).setValue(""),this.ref("self").removeClass(this.prefs().classError),this.ref("self").removeClass(this.prefs().classInvalid),this.ref("self").removeClass(this.prefs().classBusy),this.ref(this.prefs().shot).addClass(this.prefs().classHidden),this.ref("engravingUpdate").disable(),this.ref("engravingClear").disable();var t=Object.assign({},this.config);t.callback=e,this.eventBus().emit("engraving.text.remove",t)}},{key:"onImageUpdate",value:function(e){if(!e)return!1;this.ref(this.prefs().shot).attr("src",e),this.ref("self").removeClass(this.prefs().classBusy),this.ref(this.prefs().shot).removeClass(this.prefs().classHidden),this.ref(this.prefs().shot).attr("style","top: ".concat(3.65*this.config.position.y-294,"px"))}},{key:"enableEngravingButton",value:function(){this.ref("engravingUpdate").enable()}}])}(e)}},69690:function(e,t,n){n.r(t),n.d(t,{default:function(){return j}}),n(2008),n(83851),n(81278),n(79432),n(60825);var s=n(5544),i=n(64467),r=n(23029),a=n(92901),o=n(56822),c=n(53954),u=n(90991),l=n(85501),h=(n(52675),n(89463),n(23792),n(40150),n(9868),n(5506),n(26099),n(3362),n(9391),n(27495),n(38781),n(47764),n(25440),n(42762),n(23500),n(62953),n(7769)),f=n(77670),p=n(69372);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}window.jQuery=window.$=n(74692);var m="front",g="back",y="mechanism",b="backSticker",k=210,O="#ffffff",w="data-translate",A="data-translate-label",S="data-translate-image",B="data-translate-content",P="data-translate-placeholder",C={OPACITY_ONLOAD:0,OPACITY_ONMOVE:1,OPACITY_ONSTOP:2};function j(e){return function(e){function t(){return(0,r.A)(this,t),e=this,n=t,s=arguments,n=(0,c.A)(n),(0,o.A)(e,d()?Reflect.construct(n,s||[],(0,c.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,l.A)(t,e),(0,a.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,i.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({container:".js-canvas-iframe",shopID:"",bundleID:"",masterProductId:"",mechanism:"",pattern:"",patternFilename:"",patternSleeve:"",position:"",defaultPosition:"",opacity:"",patternThumb:"",patternPreviewLarge:"",patternPreviewSmall:"",patternOpacity:"",patternBackground:"",patternWatchHead:"",patternZoom:"",patternRotation:"",routing:"",description:"",caseMaterial:"",strapMaterial:"",waterproof:"",movementColor:"",caseColor:"",caseInfo:"",locale:"",classBusy:"m-busy",classInvalid:"m-invalid",attributeShopID:"shopID",attributeBundle:"1",attributeMechanism:"2",attributePattern:"3",attributePosition:"4",attributeZoom:"9",attributeRotation:"10",emarsyaSrc:"",emarsyaMapping:""},(e=t,n=this,"function"==typeof(s=(0,u.A)((0,c.A)(e.prototype),"prefs",n))?function(e){return s.apply(n,e)}:s)([]));var e,n,s}},{key:"init",value:function(){var e=this;this.setConfigs(),this.eventBus().on("step.back.request","onStepBack"),this.eventBus().on("size.changed","onBundleChange"),this.eventBus().on("pattern.changed","onPatternChange"),this.eventBus().on("mechanism.changed","onMechanismChange"),this.eventBus().on("canvas.animation.done","onCanvasAnimationDone"),this.eventBus().on("canvas.engraving.rendered","onEngraveRender"),this.eventBus().on("engraving.text.change","onEngraveChange"),this.eventBus().on("engraving.text.remove","onEngraveRemoval"),this.eventBus().on("step.change.request","onStepChangeRequest"),this.eventBus().on("pattern.modal.request","getPatternData"),this.eventBus().on("canvas.zoom.updated","on
1ZoomUpdated"),this.eventBus().on("canvas.rotation.updated","onRotationUpdated"),this.eventBus().on("canvas.sliders.reset","onSlidersReset"),this.eventBus().on("canvasmuseum.store.selected","createCanvasProductLink"),this.eventBus().on("canvasmuseum.translate.page","languageSelected"),this.eventBus().on("canvasmuseum.translate.modal","translateModal"),this.eventBus().on("device.sleepmode.awake","onDeviceSleepAwake"),this.eventBus().on("canvas.validation.request","validateCanvas"),import(this.prefs().emarsyaSrc).then((function(t){return e.load(t)}))}},{key:"load",value:function(e){var t=this;this.emersya=e.emersya,this.emersya.opacity=this.visualization.opacity.onload,this.emersya.background=this.prefs().patternBackground||this.visualization.background,this.emarsyaMapping=this.prefs().emarsyaMapping,this.emersya.loadViewer(this.routing,this.prefs().container,this.callbacks,(function(){return t.emersya.setGlobalConfigurations(t.emarsyaMapping[t.bundle],+t.coords[0],+t.coords[1],+t.zoom,+t.rotation,t.pattern.code,t.view,t.mechanismConfig,t.customText)})),this.emersya.setBackgroundOpacity(this.emersya.opacity),this.emersya.setBackgroundColor(this.emersya.background),this.mechanism&&this.emersya.setConfiguration(y,this.mechanism);var n=[];this.pattern.mechanisms&&this.pattern.mechanisms.length&&(n=this.pattern.mechanisms.split(";")),this.eventBus().emit("canvas.mechanisms.render",{mechanisms:n},{bundleId:this.bundle}),Number.isNaN(parseInt(this.pattern.categoryNumber,10))||this.eventBus().emit("pattern.category.changed",+this.pattern.categoryNumber,this.pattern.code)}},{key:"onDeviceSleepAwake",value:function(e,t){this.debugMode&&console.log("onDeviceSleepAwake",e,t),t&&(null==t?void 0:t.secondPassed.secondsTotal)>1800&&window.location.reload()}},{key:"onStepBack",value:function(){this.setView(m)}},{key:"onPatternChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{resetCoords:!0};if(!e||!this.emersya)return!1;this.pattern=e,this.head=this.pattern.mechanisms,this.visualization.opacity=this.getOpacityConfig(this.pattern.opacity),t.resetCoords&&(this.coords=[+this.prefs().defaultPosition[0],+this.prefs().defaultPosition[1]]),this.setPageURL(),this.setCanvasView(),this.validateCanvas(),this.eventBus().emit("selected.mechanism.apply",this.head,this.bundle)}},{key:"getPatternData",value:function(){this.eventBus().emit("pattern.modal.render",this.pattern)}},{key:"onZoomUpdated",value:function(e){var t=this;this.emersya&&this.emersya.setScaling(e,(function(){"function"==typeof t.debouncedPositionStop&&t.debouncedPositionStop()}))}},{key:"onRotationUpdated",value:function(e){var t=this;this.emersya&&this.emersya.setRotationAngle(e,(function(){"function"==typeof t.debouncedPositionStop&&t.debouncedPositionStop()}))}},{key:"onSlidersReset",value:function(){this.zoom=this.prefs().zoomRange.default,this.rotation=this.prefs().defaultRotation,(0,h.s)(this.eventBus().emit("update.zoom.value",this.zoom),200),(0,h.s)(this.eventBus().emit("update.rotation.value",this.rotation),200),this.setPageURL()}},{key:"onBundleChange",value:function(e){var t=this,n=this.bundle;this.productInfo=e,this.bundle=this.productInfo.bundleCode,this.masterProductID=this.productInfo.masterProductId,this.setPageURL(),this.bundle!==n&&(this.emersya&&this.emersya.setWatch(this.emarsyaMapping[this.bundle]),setTimeout((function(){return t.emersya.setWatch(t.emarsyaMapping[t.bundle])}),0),this.eventBus().emit("selected.mechanism.apply",this.head,this.bundle),this.eventBus().emit("datalayer.canvas.change.size",e))}},{key:"onMechanismChange",value:function(e){this.emersya&&e&&(this.productInfo=e,this.mechanism=this.productInfo.productCode,this.setPageURL(),this.emersya&&this.mechanism&&this.emersya.setConfiguration(y,this.mechanism),this.validateCanvas())}},{key:"setCanvasView",value:function(){this.pattern&&this.emersya&&(this.emersya.setPattern(this.pattern.code),this.emersya.setBackgroundColor(this.pattern.background),this.emersya.setBackgroundOpacity(this.visualization.opacity.onload),this.mechanism&&this.emersya.setConfiguration(y,this.mechanism))}},{key:"onStepChangeRequest",value:function(){var e=this;this.ref("self").addClass(this.prefs().classBusy),this.getFrontURL().then((function(){return e.getSmallFrontURL()})).then((function(){return e.getFrontPreviewURL()})).then((function(){return e.setView(g)})).then((function(){return e.getBackURL()})).then((function(){return e.getBackPreviewURL()})).then((function(){return e.submitStepRequest()})).catch((function(t){return e.onStepRequestError(t)}))}},{key:"getFrontURL",value:function(){var e=this;return this.getFullScreenshot().then((function(t){e.front=t})).catch((function(e){return(0,p._K)(e)}))}},{key:"getSmallFrontURL",value:function(){var e=this;
1return this.getSmallScreenshot().then((function(t){e.smallFront=t})).catch((function(e){return(0,p._K)(e)}))}},{key:"getFrontPreviewURL",value:function(){var e=this;return this.getFullScreenshot(k,k).then((function(t){e.frontPreview=t})).catch((function(e){return(0,p._K)(e)}))}},{key:"getBackURL",value:function(){var e=this;return this.getFullScreenshot().then((function(t){e.back=t})).catch((function(e){return(0,p._K)(e)}))}},{key:"getBackPreviewURL",value:function(){var e=this;return this.getFullScreenshot(k,k).then((function(t){e.backPreview=t})).catch((function(e){return(0,p._K)(e)}))}},{key:"setView",value:function(e){var t=this;return this.view=e,new Promise((function(e,n){return t.emersya?t.emersya.setViewpoint(t.view,(function(){return e()})):n()}))}},{key:"getFullScreenshot",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1023,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1023,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O;return new Promise((function(i){return e.emersya.getFullScreenshot((function(e){return i(e)}),t,n,s)}))}},{key:"getSmallScreenshot",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:192,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return new Promise((function(s){return e.emersya.getSmallScreenshot((function(e){return s(e)}),t,n)}))}},{key:"getStepContext",value:function(){return{front:this.front,frontPreview:this.frontPreview,smallFront:this.smallFront,back:this.back,backPreview:this.backPreview,productInfo:this.productInfo,addToCartData:this.getProductData(),step:2}}},{key:"submitStepRequest",value:function(){var e=this.getStepContext();this.eventBus().emit("customization.step.resolved",e),this.eventBus().emit("range.sliders.close"),this.eventBus().emit("customization.step.unset.height")}},{key:"onCanvasAnimationDone",value:function(){this.isCanvasReady=!0,this.validateCanvas()}},{key:"validateCanvas",value:function(){var e=Boolean(this.bundle&&this.mechanism&&this.pattern),t=Boolean(this.isCanvasReady),n=e&&t;this.eventBus().emit("canvas.validation.".concat(n?"success":"fail"))}},{key:"onStepRequestError",value:function(e){(0,p._K)(e),this.ref("self").removeClass(this.prefs().classBusy)}},{key:"onEngraveRender",value:function(){var e=this.getStepContext();this.eventBus().emit("canvas.engraving.resolved",e)}},{key:"onEngraveChange",value:function(e){var t=this;this.setCustomText(e,(function(){t.onAfterEngraveUpdated(e).then((function(){e.callback&&"function"==typeof e.callback&&e.callback()}))}))}},{key:"onEngraveRemoval",value:function(e){var t=this;this.engraveShot="",this.setCustomText(e,(function(){t.updateBackView().then((function(){e.callback&&"function"==typeof e.callback&&e.callback()}))}))}},{key:"setCustomText",value:function(e,t){var n=this,s=e.text||"";return this.visualization.engrave=s.trim(),new Promise((function(){n.emersya.setCustomText(b,s,e.font,e.color,e.position.x,e.position.y,27.7,9.34,t)}))}},{key:"onAfterEngraveUpdated",value:function(e){var t=this;return this.updateBackView().then((function(){return t.setEngraveShot(e)})).catch((function(e){return(0,p._K)(e)})).finally((function(){return t.eventBus().emit("canvas.engraving.finish")}))}},{key:"updateBackView",value:function(){var e=this;return this.updateBackURL().then((function(){return e.updateBackPreviewURL()})).then((function(){return e.eventBus().emit("back.view.updated",{view:e.back,preview:e.backPreview})})).catch((function(e){return(0,p._K)(e)}))}},{key:"updateBackURL",value:function(){var e=this;return this.getFullScreenshot().then((function(t){e.back=t})).catch((function(e){return(0,p._K)(e)}))}},{key:"updateBackPreviewURL",value:function(){var e=this;return this.getFullScreenshot(k,k).then((function(t){e.backPreview=t})).catch((function(e){return(0,p._K)(e)}))}},{key:"getEngraveShot",value:function(e){var t=this;return new Promise((function(n){return t.emersya.getPNG(e.dpi,(function(e){return n(e)}))}))}},{key:"setEngraveShot",value:function(e){var t=this;return this.getEngraveShot(e).then((function(e){t.eventBus().emit("engrave.image.updated",e),t.engraveShot=e})).catch((function(e){return(0,p._K)(e)}))}},{key:"getCanvasDebugInfo",value:function(){if(this.debugMode){var e={url:document.URL,imageUrl:this.front,zoom:this.zoom,rotation:this.rotation,position:this.getCoordinatesStr()};return JSON.stringify(e)}return""}},{key:"getProductData",value:function(){var e=this.mechanism;return{image:this.front,backImage:this.back,bundleID:this.bundle,pid:e,filename:this.pattern.filename,patternCode:this.pattern.code,sleeveID:this.pattern.sleeveID,engraveShot:this.engraveShot||"",engraving:this.visualization.engrave||"",zoom:this.zoom,rotation:this.rotation,position:this.getCoordinatesStr(),debugInfo:this.getCanvasDebugInfo(),canvasShopWatch:!1,shopI
1d:this.shopID}}},{key:"createCanvasProductLink",value:function(e){var t=this.getProductData(),n=(0,p.u0)(e,"bundleID",t.bundleID);n=(0,p.u0)(n,"pid",t.pid),n=(0,p.u0)(n,"filename",t.filename),n=(0,p.u0)(n,"engraving",t.engraving),n=(0,p.u0)(n,"image",t.image),n=(0,p.u0)(n,"zoom",t.zoom),n=(0,p.u0)(n,"rotation",t.rotation),n=(0,p.u0)(n,"position",t.position),n=(0,p.u0)(n,"backImage",t.backImage),n=(0,p.u0)(n,"engraveShot",t.engraveShot),n=(0,p.u0)(n,"sleeveID",t.sleeveID),n=(0,p.u0)(n,"patternCode",t.patternCode),n=(0,p.u0)(n,"canvasShopWatch",t.canvasShopWatch),n=(0,p.u0)(n,"shopId",t.shopId),this.eventBus().emit("canvasmuseum.set.storeqrcode",n)}},{key:"afterProductAdded",value:function(e,t){if(!e||!e.redirect)return!1;window.location=e.redirect}},{key:"getCoordinatesStr",value:function(){return[this.coords[0].toString().replace(".","_"),this.coords[1].toString().replace(".","_")].toString()}},{key:"setPageURL",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href,t=(0,p.dh)(e,this.prefs().attributeShopID);t=(0,p.dh)(e,this.prefs().attributeBundle),t=(0,p.dh)(t,this.prefs().attributeMechanism),t=(0,p.dh)(t,this.prefs().attributePattern),t=(0,p.dh)(t,this.prefs().attributePosition),t=(0,p.dh)(t,this.prefs().attributeZoom),t=(0,p.dh)(t,this.prefs().attributeRotation);var n=(0,p.u0)(t,this.prefs().attributeShopID,this.shopID);n=(0,p.u0)(n,this.prefs().attributeBundle,this.bundle),n=(0,p.u0)(n,this.prefs().attributeMechanism,this.mechanism),n=(0,p.u0)(n,this.prefs().attributePattern,this.pattern.code),n=(0,p.u0)(n,this.prefs().attributePosition,this.getCoordinatesStr()),this.hasEnabledRotationAndScale&&(n=(0,p.u0)(n,this.prefs().attributeZoom,this.zoom),n=(0,p.u0)(n,this.prefs().attributeRotation,this.rotation));try{window.history.replaceState({},"",encodeURI(n))}catch(e){console.warn("History replace warning!",e.message)}}},{key:"getOpacity",value:function(e,t){switch(t){case C.OPACITY_ONLOAD:return e[C.OPACITY_ONLOAD]||this.prefs().opacity[C.OPACITY_ONLOAD];case C.OPACITY_ONMOVE:return e[C.OPACITY_ONMOVE]||this.prefs().opacity[C.OPACITY_ONMOVE];case C.OPACITY_ONSTOP:return e[C.OPACITY_ONSTOP]||this.prefs().opacity[C.OPACITY_ONSTOP];default:return"0"}}},{key:"getOpacityConfig",value:function(e){return e||(e=[]),{onload:this.getOpacity(e,C.OPACITY_ONLOAD),onmove:this.getOpacity(e,C.OPACITY_ONMOVE),onstop:this.getOpacity(e,C.OPACITY_ONSTOP)}}},{key:"getWatchPosition",value:function(){var e=+this.prefs().defaultPosition[0],t=+this.prefs().defaultPosition[1];return this.prefs().position.length&&(e=+this.prefs().position[0],t=+this.prefs().position[1]),[e,t]}},{key:"setConfigs",value:function(){this.view=m,this.hasEnabledRotationAndScale=this.prefs().zoomEnabled&&this.prefs().rotationEnabled,this.mechanism=this.prefs().mechanism,this.shopID=this.prefs().shopId,this.bundle=this.prefs().bundleId,this.masterProductID=this.prefs().masterProductId,this.routing=this.prefs().routing,this.rotation=this.prefs().patternRotation,this.zoom=this.prefs().patternZoom,this.debugMode=this.prefs().debugMode,this.pattern={code:this.prefs().pattern,thumb:this.prefs().patternThumb,categoryNumber:this.prefs().patternCategoryId,categoryName:this.prefs().patternCategoryName,previewLarge:this.prefs().patternPreviewLarge,previewSmall:this.prefs().patternPreviewSmall,opacity:this.prefs().patternOpacity,background:this.prefs().patternBackground,mechanisms:this.prefs().patternWatchHead,filename:this.prefs().patternFilename,sleeveID:this.prefs().patternSleeve},this.productInfo={description:this.prefs().description,caseMaterial:this.prefs().caseMaterial,strapMaterial:this.prefs().strapMaterial,waterproof:this.prefs().waterproof,movementColor:this.prefs().movementColor,caseColor:this.prefs().caseColor,caseInfo:this.prefs().caseInfo},this.visualization={engrave:"",background:O,opacity:this.getOpacityConfig(this.pattern.opacity)},this.customText={color:"#000000",font:"Regular",height:0,layer:b,size:"20",text:"",width:0,x:0,y:0},this.mechanismConfig={elem:y,value:this.mechanism},this.translations={},this.sizesTranslations={},this.mechanismsTranslations={},this.currentLanguage="",this.currentLocale=this.prefs().locale,this.coords=this.getWatchPosition(),this.debouncedPositionStop=(0,h.s)(this.onPatternPositionStopped.bind(this),400),this.callbacks={onPatternSetError:this.onCavasError.bind(this),onCustomTextError:this.onCavasError.bind(this),onScreenshotError:this.onCavasError.bind(this),onPatternAnimationStopped:this.onPatternAnimationStopped.bind(this),onPatternPositionUpdate:this.onPatternPositionUpdate.bind(this),onPatternRotationUpdate:this.onPatternRotationUpdate.bind(this),onPatternScaleUpdate:this.onPatternScaleUpdate.bind(this),onPatternPositionStopped:this.debouncedPositionStop,onPatternMinMaxScalesUpdate:this.onPatternMinMaxScalesUpdate.bind(this)},this.setPageURL()}},{key:"onPatternRotationUpdate",value:function(e){this.rotation=e.toFixed(0),(0,h.s)(this.eventBus().emit("update.rotation.value",this.rotation),200),this.setPageURL()}},{key:"onPatternScaleUpdate",value:function(e){this.zoom=e.toFixed(3),(0,h.s)(this.eventBus().emit("update.zoom.value",this.zoom),200),this.setPageURL()}},{key:"onPatternMinMaxScalesUpdate",value:function(e,t){e&&this.zoom<e&&this.onZoomUpd
1ated(+this.prefs().zoomRange.default),e&&t&&!this.isMobile&&this.hasEnabledRotationAndScale&&this.eventBus().emit("update.zoom.range",{min:e,max:t})}},{key:"onPatternAnimationStopped",value:function(){if(this.eventBus().emit("canvas.animation.done"),!this.emersya)return!1;this.setPageURL(),this.emersya.setBackgroundOpacity(this.visualization.opacity.onstop),this.mechanism&&this.emersya.setConfiguration(y,this.mechanism)}},{key:"onPatternPositionUpdate",value:function(e,t){if(!this.emersya)return!1;Number.isNaN(+e)||Number.isNaN(+t)||(this.coords=[+e,+t]),this.emersya.setBackgroundOpacity(this.visualization.opacity.onmove)}},{key:"onPatternPositionStopped",value:function(){if(!this.emersya)return!1;this.isCanvasReady&&(this.eventBus().emit("pattern.position.update"),this.setPageURL()),this.emersya.setBackgroundOpacity(this.visualization.opacity.onstop)}},{key:"onCavasError",value:function(e){(0,p._K)(e)}},{key:"languageSelected",value:function(e){var t=this;if(this.currentLocale!==e.locale){this.currentLocale=e.locale,this.currentLanguage=e.language;var n={locale:this.currentLocale,pid:this.mechanism,bundleIDs:this.prefs().bundleIds,isSwatchPay:this.prefs().isSwatchPay};(0,f.zP)(e.url,n,"GET").then((function(e){return t.changePageLanguage(e)}))}}},{key:"changePageLanguage",value:function(e){e.translations&&(this.translations=e.translations,this.translateWrapper()),e.sizesTranslations&&(this.sizesTranslations=e.sizesTranslations,this.translateSizesDetails()),e.mechanismsTranslations&&(this.mechanismsTranslations=e.mechanismsTranslations,this.translateMechanismsDetails());var t={lang:this.currentLanguage,locale:this.currentLocale};this.eventBus().emit("canvasmuseum.language.changed",t,e)}},{key:"translateWrapper",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.translations,n=0,i=Object.entries(t);n<i.length;n++){var r=(0,s.A)(i[n],2),a=r[0],o=r[1],c=e.querySelector("["+w+'="'+a+'"]'),u=e.querySelector("["+P+'="'+a+'"]'),l=e.querySelector("["+S+'="'+a+'"]'),h=e.querySelector("["+B+'="'+a+'"]');c&&(c.textContent=o,c.hasAttribute("data-hover-content")&&c.setAttribute("data-hover-content",o)),u&&(u.placeholder=o),l&&(l.alt=o,l.title=o),h&&(h.innerHTML=o)}}},{key:"translateModal",value:function(e){this.currentLocale!==e.defaultLocale&&this.translateText(document,e.translations)}},{key:"translateText",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments.length>1?arguments[1]:void 0,n=0,i=Object.entries(t);n<i.length;n++){var r=(0,s.A)(i[n],2),a=r[0],o=r[1];if(Array.isArray(o))for(var c=0;c<o.length;c++)this.translateElement(e,a,o[c]);else this.translateElement(e,a,o)}}},{key:"translateElement",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,s=e.querySelector("["+t+'="'+n+'"]'),i=this.translations[n];if(s&&i)switch(t){case A:case w:s.textContent=i,s.hasAttribute("data-hover-content")&&s.setAttribute("data-hover-content",i);break;case P:s.placeholder=i;break;case S:s.alt=i,s.title=i;break;case B:s.innerHTML=i}}},{key:"translateSizesDetails",value:function(){for(var e=0,t=Object.entries(this.sizesTranslations);e<t.length;e++){var n=(0,s.A)(t[e],2),i=n[0],r=n[1],a=document.querySelector('[data-translate-size-code="'+i+'"]');if(a){var o=a.querySelector('[data-code="'+i+'"]');o.setAttribute("data-name",r.bundleName),o.setAttribute("data-subname",r.bundleSubName),this.translateWrapper(a,r)}}this.view===m&&this.eventBus().emit("selected.size.apply",this.bundle,!0)}},{key:"translateMechanismsDetails",value:function(){for(var e=this,t=function(){var t=(0,s.A)(i[n],2),r=t[0],a=t[1],o=r.split("_"),c=(0,s.A)(o,2),u=c[0],l=c[1],h=document.querySelectorAll('[data-bundle="'+u+'"][data-translate-mechanisms-type="'+l+'"]');h&&h.forEach((function(t){return e.translateWrapper(t,a)}))},n=0,i=Object.entries(this.mechanismsTranslations.mechanismTypes);n<i.length;n++)t();for(var r=0,a=Object.entries(this.mechanismsTranslations.allVariants);r<a.length;r++){var o=(0,s.A)(a[r],2),c=o[0],u=o[1],l=document.querySelector('[data-code="'+c+'"]');l&&(l.setAttribute("data-description",u.description),l.setAttribute("data-casematerial",u.casematerial),l.setAttribute("data-strapmaterial",u.strapmaterial),l.setAttribute("data-waterproof",u.waterproof),l.setAttribute("data-movemcolor",u.movemcolor),l.setAttribute("data-casecolor",u.casecolor),l.setAttribute("data-case",u.case),this.translateWrapper(l,u))}this.view===m&&this.eventBus().emit("selected.mechanism.apply",this.mechanism,this.bundle)}}])}(e)}},78626:function(e,t,n){n.r(t),n.d(t,{default:function(){return f}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?l(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({pid:"",available:!1,languageSwitcher:"languageSwitcher"},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.eventBus().on("size.info.changed","onSizeChange"),this.eventBus().on("customization.step.resolved","renderButtons"),this.eventBus().on("step.back.request","renderButtons"),this.eventBus().on("canvasmuseum.language.changed","changeLanguageTitle"),this.activeStep=1}},{key:"onStepRequestChange",value:function(){this.eventBus().emit("step.change.request")}},{key:"renderButtons",value:function(e){this.activeStep=e.step||1}},{key:"renderCustomizationStep",value:function(e,t){e&&2===this.activeStep&&t.preventDefault(),this.eventBus().emit("step.back.request",{step:1})}},{key:"onSizeChange",value:function(e){this.renderBundleData(e),this.renderPrice(e)}},{key:"renderBundleData",value:function(e){this.has("bundleContainer")&&e.bundleName&&this.ref("bundleContainer").setText(e.bundleName)}},{key:"renderPrice",value:function(e){this.has("priceContainer")&&e.price&&e.price.sales&&this.render("priceTemplate",e,this.ref("priceContainer"))}},{key:"showLanguagePopup",value:function(){this.eventBus().emit("canvasmuseum.switchlanguage.show")}},{key:"changeLanguageTitle",value:function(e){this.ref(this.prefs().languageSwitcher).empty(),this.ref(this.prefs().languageSwitcher).append(e.lang)}}])}(e)}},36231:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(e,t,n,s){var i=(0,c.A)((0,o.A)(1&s?e.prototype:e),t,n);return 2&s&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function p(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({showEvent:"",defaultLocale:""},f(t,"prefs",this,3)([]))}},{key:"init",value:function(){f(t,"init",this,3)([]),this.translations={"data-translate-content":"helpModalText"},this.eventBus().on(this.prefs().showEvent,"onShow")}},{key:"onShow",value:function(){var e=this;this.showModal({}).then((function(){return e.translateModal()}))}},{key:"translateModal",value:function(){var e={defaultLocale:this.prefs().defaultLocale,translations:this.translations};this.eventBus().emit("canvasmuseum.translate.modal",e)}}])}(e)}},99833:function(e,t,n){n.r(t),n.d(t,{default:function(){return v}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=n(91713),h=n(63320);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function v(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,p()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?f(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({url:"",back:"back",front:"front",main:"main",thumbs:"thumbs",modal:"modal",content:"content",backPreview:"backPreview",classShow:"m-show",selectorNext:".js-button-next",selectorPrev:".js-button-prev"},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.initCarousels(),this.eventBus().on("back.view.updated","onBackViewUpdate"),this.eventBus().on("zoom.request.approved","onModalOpen")}},{key:"onBackViewUpdate",value:function(e){if(!e)return!1;this.ref(this.prefs().back).attr("src",e.view),this.ref(this.prefs().backPreview).attr("src",e.preview)}},{key:"initCarousels",value:function(){this.carousel={main:this.ref(this.prefs().main),thumbs:this.ref(this.prefs().thumbs)},this.options={main:{slidesPerView:this.carousel.main.data("slidesPerView")||1,thumbs:{swiper:this.thumbs}},thumbs:{allowTouchMove:!1,spaceBetween:15,slidesPerView:this.carousel.thumbs.data("slidesPerView")||2,direction:this.carousel.thumbs.data("direction")||"horizontal"}},this.carousel.main.data("navigation")&&(this.options.main.navigation={nextEl:this.prefs().selectorNext,prevEl:this.prefs().selectorPrev}),this.carousel.main.data("zoom")&&(this.options.main.zoom={maxRatio:2.5,toggle:!1}),l.A.use([h.A]),this.thumbs=new l.A(this.carousel.thumbs.get(),this.options.thumbs),this.thumbs&&(this.options.main.thumbs={swiper:this.thumbs}),this.main=new l.A(this.carousel.main.get(),this.options.main),this.carousel.main.data("initial")&&this.main.slideTo(+this.carousel.main.data("initial"))}},{key:"onModalRequest",value:function(){var e={url:this.prefs().url,activeSlide:this.main.activeIndex};this.eventBus().emit("zoom.modal.request",e)}},{key:"onModalOpen",value:function(e){if(!e)return!1;var t=this.ref(this.prefs().content);t.empty(),t.append(e),this.ref(this.prefs().modal).addClass(this.prefs().classShow)}},{key:"onModalClose",value:function(){var e=this.ref(this.prefs().content);this.ref(this.prefs().modal).removeClass(this.prefs().classShow),e.empty()}},{key:"handleModalRequest",value:function(e,t){13===t.keyCode&&this.onModalRequest()}},{key:"handleClick",value:function(e,t){13===t.keyCode&&this.main.slideTo(+e.els[0].dataset.index)}}])}(e)}},18500:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}}),n(60825);var s=n(23029),i=n(92901),r=n(56822),a=n(53954),o=n(85501);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function u(e){return function(e){function t(){return(0,s.A)(this,t),e=this,n=t,i=arguments,n=(0,a.A)(n),(0,r.A)(e,c()?Reflect.construct(n,i||[],(0,a.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,o.A)(t,e),(0,i.A)(t,[{key:"zoomImage",value:function(e,t){t.deltaY<0?this.zoomIn():this.zoomOut()}},{key:"zoomIn",value:function(){var e;null!==(e=this.main)&&void 0!==e&&e.zoom&&this.main.zoom.in()}},{key:"zoomOut",value:function(){var e;null!==(e=this.main)&&void 0!==e&&e.zoom&&this.main.zoom.out()}}])}(e)}},84036:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(e,t,n,s){var i=(0,c.A)((0,o.A)(1&s?e.prototype:e),t,n);return 2&s&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function p(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?l(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({showEvent:"",defaultlocale:"",getTranslationsUrl:""},f(t,"prefs",this,3)([]))}},{key:"init",value:function(){f(t,"init",this,3)([]),this.eventBus().on(this.prefs().showEvent,"onShow")}},{key:"onShow",value:function(){this.showModal({})}},{key:"changeLanguage",value:function(e){var t={locale:e.attr("data-locale"),language:e.attr("data-language-name"),url:this.prefs().getTranslationsUrl};this.eventBus().emit("canvasmuseum.translate.page",t),this.closeModal()}}])}(e)}},60944:function(e,t,n){n.r(t),n.d(t,{default:function(){return v}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(60825);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=(n(23418),n(26099),n(47764),n(23500),n(86474));function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(f=function(){return!!e})()}function p(e,t,n,s){var i=(0,c.A)((0,o.A)(1&s?e.prototype:e),t,n);return 2&s&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function v(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,f()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({classVisible:"m-visible",classHidden:"m-hidden",selectorSlider:".js-range-slider"},p(t,"prefs",this,3)([]))}},{key:"init",value:function(){p(t,"init",this,3)([]),this.eventBus().on("pattern.modal.render","renderPatternModal"),this.eventBus().on("range.sliders.close","closeRangeSliders"),this.eventBus().on("customization.step.resolved","hide"),this.eventBus().on("step.back.request","show")}},{key:"hide",value:function(){this.ref("self").addClass(this.prefs().classHidden
1)}},{key:"show",value:function(){this.ref("self").removeClass(this.prefs().classHidden)}},{key:"onPatternRequest",value:function(){this.eventBus().emit("pattern.modal.request")}},{key:"renderPatternModal",value:function(e){if(!e)return!1;p(t,"showModal",this,3)([{thumbnail:l.isMobileView()?e.previewSmall:e.previewLarge,isPatternModal:!0}])}},{key:"renderHelp",value:function(){this.eventBus().emit("canvasmuseum.help.modal.show")}},{key:"toggleRangeSlider",value:function(e){this.closeRangeSliders(),e.toggleClass(this.prefs().classVisible)}},{key:"closeRangeSliders",value:function(){var e=this,t=this.ref("self").get().querySelectorAll(this.prefs().selectorSlider);Array.from(t).forEach((function(t){return t.classList.remove(e.prefs().classVisible)}))}},{key:"handleRangeSlider",value:function(e,t){13===t.keyCode&&this.toggleRangeSlider(e)}},{key:"handlePatternRequest",value:function(e,t){13===t.keyCode&&this.onPatternRequest()}},{key:"handleRenderHelp",value:function(e,t){13===t.keyCode&&this.renderHelp()}}])}(e)}},4511:function(e,t,n){n.r(t),n.d(t,{default:function(){return d}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=n(91713),h=n(86474);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}var v=0;function d(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,p()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({classActive:"m-active",classNotCenterSlide:"m-from-start"},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.carousel=this.ref("self").get(),this.eventBus().on("canvas.animation.done","build"),this.eventBus().on("pattern.category.changed","build"),this.eventBus().on("pattern.category.carousel.render","build"),this.eventBus().on("viewtype.change","rebuild")}},{key:"getOptions",value:function(){return h.isMobileView()?{slidesPerView:4}:{direction:"vertical",slidesPerColumn:2,slidesPerView:3,mousewheel:!0}}},{key:"build",value:function(){return!!this.isActive()&&(this.swiper&&this.centerSlides(this.swiper),this.swiper?(this.swiper.slideTo(v),!1):(this.swiper=new l.A(this.carousel,this.getOptions()),void this.swiper.slideTo(v)))}},{key:"rebuild",value:function(){this.swiper&&this.swiper.params.init&&(this.swiper.destroy(!0,!0),this.swiper=void 0),this.build()}},{key:"centerSlides",value:function(e){e.slides.length>4&&e.$wrapperEl.addClass(this.prefs().classNotCenterSlide)}},{key:"handleSetPattern",value:function(e){this.eventBus().emit("pattern.change.request",e)}},{key:"slideNext",value:function(){if(!this.swiper||this.swiper&&this.swiper.isEnd)return this.eventBus().emit("pattern.select.increment"),!1;this.swiper.slideNext()}},{key:"slidePrev",value:function(){if(!this.swiper||this.swiper&&this.swiper.isBeginning)return this.eventBus().emit("pattern.select.decrement"),!1;this.swiper.slidePrev()}},{key:"isActive",value:function(){return this.ref("self").hasClass(this.prefs().classActive)}}])}(e)}},43025:function(e,t,n){n.r(t),n.d(t,{default:function(){return l}}),n(60825);var s=n(23029),i=n(92901),r=n(56822),a=n(53954),o=n(90991),c=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function l(e){return function(e){function t(){return(0,s.A)(this,t),e=this,n=t,i=arguments,n=(0,a.A)(n),(0,r.A)(e,u()?Reflect.construct(n,i||[],(0,a.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,c.A)(t,e),(0,i.A)(t,[{key:"init",value:function(){var e,n,s;(e=t,n=this,"function"==typeof(s=(0,o.A)((0,a.A)(e.prototype),"init",n))?function(e){return s.apply(n,e)}:s)([]),this.selected=+this.select.selected(),this.initPattern=null,this.options=this.select.data.data,this.total=this.options.length,this.eventBus().on("pattern.select.decrement","setPreviousPattern"),this.eventBus().on("pattern.select.increment","setNextPattern"),this.eventBus().on("pattern.c
1ategory.changed","setPatternCategory")}},{key:"onChange",value:function(){this.selected=+this.select.selected(),this.eventBus().emit("pattern.category.render",this.selected,this.initPattern),this.initPattern=null}},{key:"setPreviousPattern",value:function(){var e=this.selected-1<0;this.selected=e?this.total-1:this.selected-1,this.select.set(this.selected)}},{key:"setNextPattern",value:function(){var e=this.selected+1>=this.total;this.selected=e?+this.options[0].value:this.selected+1,this.select.set(this.selected)}},{key:"setPatternCategory",value:function(e,t){this.selected=e,this.initPattern=t,this.select.set(this.selected)}}])}(e)}},47839:function(e,t,n){n.r(t),n.d(t,{default:function(){return v}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501),l=n(13729),h=n.n(l);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function v(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,p()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({slider:"slider",min:"",max:"",start:"",step:"",type:""},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){var e=this.ref(this.prefs().slider).get();this.slider=h().create(e,{start:+this.prefs().start,step:+this.prefs().step,animate:!1,range:{min:+this.prefs().min,max:+this.prefs().max}}),this.position=+this.prefs().start,this.slider.on("slide",this.onUpdate.bind(this)),this.eventBus().on("pattern.changed","onPatternChange"),this.eventBus().on("update.zoom.range","updateZoomRange"),this.eventBus().on("update.zoom.value","updateZoomValue"),this.eventBus().on("update.rotation.value","updateRotationValue")}},{key:"destroy",value:function(){this.slider&&this.slider.destroy()}},{key:"increase",value:function(){if(this.position=+this.slider.get(),this.position+=+this.prefs().step,this.position>+this.prefs().max)return this.position=+this.prefs().max,!1;this.slider.set(this.position),this.onUpdate([this.position])}},{key:"decrease",value:function(){if(this.position=+this.slider.get(),this.position-=+this.prefs().step,this.position<+this.prefs().min)return this.position=+this.prefs().min,!1;this.slider.set(this.position),this.onUpdate([this.position])}},{key:"onUpdate",value:function(e){if(!e&&!e[0])return!1;this.position=parseFloat(e[0]),this.eventBus().emit("canvas.".concat(this.prefs().type,".updated"),this.position)}},{key:"onPatternChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{resetCoords:!0};this.slider.reset(),t.resetCoords&&this.eventBus().emit("canvas.sliders.reset")}},{key:"updateZoomRange",value:function(e){"zoom"===this.prefs().type&&this.slider.updateOptions({range:{min:e.min,max:e.max}})}},{key:"toggleRangeSlider",value:function(){this.eventBus().emit("range.sliders.close")}},{key:"updateZoomValue",value:function(e){"zoom"===this.prefs().type&&this.slider.get()!==e&&this.slider.set(e)}},{key:"updateRotationValue",value:function(e){"rotation"===this.prefs().type&&this.slider.get()!==e&&this.slider.set(e)}}])}(e)}},93015:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(e,t,n,s){var i=(0,c.A)((0,o.A)(1&s?e.prototype:e),t,n);return 2&s&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function p(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?l(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},f(t,"prefs",this,3)([]))}},{key:"init",value:function(){f(t,"init",this,3)([])}},{key:"onSubmitted",value:function(e){e&&!e.error?this.eventBus().emit("canvasmuseum.shipping.submitted"):this.eventBus().emit("canvasmuseum.checkout.error")}},{key:"closeForm",value:function(){this.emit("closed")}}])}(e)}},32094:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}}),n(60825);var s=n(23029),i=n(92901),r=n(56822),a=n(53954),o=n(85501);function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function u(e){return function(e){function t(){return(0,s.A)(this,t),e=this,n=t,i=arguments,n=(0,a.A)(n),(0,r.A)(e,c()?Reflect.construct(n,i||[],(0,a.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,o.A)(t,e),(0,i.A)(t,[{key:"onChange",value:function(e){if("els"in e){var t=e.els[0],n=t.selectedIndex,s=t.options[n].dataset.url;this.eventBus().emit("canvasmuseum.store.selected",s)}}}])}(e)}},25364:function(e,t,n){n.r(t),n.d(t,{default:function(){return l}}),n(60825);var s=n(23029),i=n(92901),r=n(56822),a=n(53954),o=n(90991),c=n(85501);function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function l(e){return function(e){function t(){return(0,s.A)(this,t),e=this,n=t,i=arguments,n=(0,a.A)(n),(0,r.A)(e,u()?Reflect.construct(n,i||[],(0,a.A)(e).constructor):n.apply(e,i));var e,n,i}return(0,c.A)(t,e),(0,i.A)(t,[{key:"init",value:function(){var e,n,s;(e=t,n=this,"function"==typeof(s=(0,o.A)((0,a.A)(e.prototype),"init",n))?function(e){return s.apply(n,e)}:s)([]),this.eventBus().on("canvasmuseum.language.changed","translateModalLink")}},{key:"translateModalLink",value:function(e,t){var n;null!==(n=t.translations)&&void 0!==n&&n.swatchpayModalUrl&&(this.config.url=t.translations.swatchpayModalUrl)}}])}(e)}},8940:function(e,t,n){n.r(t),n.d(t,{default:function(){return f}}),n(52675),n(2008),n(83851),n(81278),n(79432),n(26099),n(60825),n(23500);var s=n(64467),i=n(23029),r=n(92901),a=n(56822),o=n(53954),c=n(90991),u=n(85501);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function f(e){return function(e){function t(){return(0,i.A)(this,t),e=this,n=t,s=arguments,n=(0,o.A)(n),(0,a.A)(e,h()?Reflect.construct(n,s||[],(0,o.A)(e).constructor):n.apply(e,s));var e,n,s}return(0,u.A)(t,e),(0,r.A)(t,[{key:"prefs",value:function(){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){(0,s.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({tooltip:"tooltip"},(e=t,n=this,"function"==typeof(i=(0,c.A)((0,o.A)(e.prototype),"prefs",n))?function(e){return i.apply(n,e)}:i)([]));var e,n,i}},{key:"init",value:function(){this.eventBus().on("canvas.animation.done","show"),this.eventBus().on("pattern.position.update","hide"),this.eventBus().on("canvas.tooltip.rendered","toggle"),this.eventBus().on("panel.updated","hide")}},{key:"show",value:function(){this.isActive=!0,this.ref("self").show()}},{key:"hide",value:function(){this.isActive=!1,this.ref("self").hide()}},{key:"toggle",value:function(){this.isActive&&this.show()}}])}(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.