1(self.webpackChunk=self.webpackChunk||[]).push([[84230],{113(t,e,i){"use strict";i.r(e),i.d(e,{default:()=>r});let r={type:["checkbox"],validate:t=>{let{element:e,operator:i}=t;return"X"===i?e.checked:!e.checked}}},156(t){"use strict";var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?l(Array.isArray(t)?[]:{},t,e):t}function n(t,e,i){return t.concat(e).map(function(t){return r(t,i)})}function s(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function o(t,e){try{return e in t}catch(t){return!1}}function l(t,i,a){(a=a||{}).arrayMerge=a.arrayMerge||n,a.isMergeableObject=a.isMergeableObject||e,a.cloneUnlessOtherwiseSpecified=r;var u,c,d=Array.isArray(i);return d!==Array.isArray(t)?r(i,a):d?a.arrayMerge(t,i,a):(c={},(u=a).isMergeableObject(t)&&s(t).forEach(function(e){c[e]=r(t[e],u)}),s(i).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&u.isMergeableObject(i[e])?c[e]=(function(t,e){if(!e.customMerge)return l;var i=e.customMerge(t);return"function"==typeof i?i:l})(e,u)(t[e],i[e],u):c[e]=r(i[e],u))}),c)}l.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return l(t,i,e)},{})},t.exports=l},168(t,e,i){"use strict";i.r(e),i.d(e,{default:()=>r});let r={type:["datetime","timestamp"],validate:t=>{let{element:e,operator:i}=t;return"X"===i?e.value.length>0:!e.value.length}}},230(t,e,i){"use strict";i.r(e),i.d(e,{default:()=>l});var r=i(643),n=i(795);let s=t=>{let e={},r=()=>{let t=i(895);return t.keys().reduce((e,i)=>{let r=t(i).default;return r.type.forEach(t=>{e[t]=r}),e},{})},n=t=>Object.keys(e).includes(t);return{name:"option-type-handler-manager",handlers:e=r(),clear:function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e={},t&&(e=r()),!0},has:n,get:t=>n(t)?e[t]:null,add:function(t,i){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!(!r&&n(t))&&(e[t]=i,!0)},remove:t=>!!n(t)&&(delete e[t],!0),call:function(i,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"validate";for(var s=arguments.length,o=Array(s>3?s-3:0),l=3;l<s;l++)o[l-3]=arguments[l];let a=e[r][n].apply(i,o);return t.publish(`swagCustomizedProducts/optionType/${n}/${r}`,{params:o}),a}}},o=t=>{let e=t.getBoundingClientRect();return{left:e.left+window.scrollX,top:e.top+window.scrollY}};class l extends r.A{static #t=this.options={...super.options,formControlSelector:".swag-customized-products-form-control",collapsePanelSelector:".collapse",scrollOffset:80,prefixes:{optionId:"swag-customized-products-option-id-",uploadElement:"customized-products-dropzone-input-"}};init(){this.isStepByStepActive=n.A.hasAttribute(this.el,"data-swag-customized-product-step-by-step"),this.stepByStepModePlugin=null,this.isStepByStepActive&&(this.stepByStepModePlugin=window.PluginManager.getPluginInstanceFromElement(this.el,"SwagCustomizedProductsStepByStepWizard")),this.violationHolderElement=n.A.querySelector(this.buyForm,".swag-customized-products__violation-list-holder"),this.violationTemplate=this.violationHolderElement.querySelector("div"),this.violationTemplateString=this.violationTemplate.cloneNode(!0).children[0].outerHTML,this.isViolation=!1,this.violationTemplate.parentNode.removeChild(this.violationTemplate),this.translations={excludeItem:n.A.getDataAttribute(this.el,"swag-exclusion-translation-excludeitem"),headline:n.A.getDataAttribute(this.el,"swag-exclusion-translation-headline")},this.exclusions=n.A.getDataAttribute(this.el,"data-swag-exclusion-list-validation-options")??[];let t=this.collectInputElements(this.el,this.options);this.mergeExclusionWithElements(t),this.optionTypeManager=s(this.$emitter),this.onInputChange(),this._registerEventListeners()}_registerEventListeners(){this.buyForm.addEventListener("change",this.onInputChange.bind(this),!1),this.violationHolderElement.addEventListener("click",this.onViolationHolderElementClick.bind(this))}onViolationHolderElementClick(t){let e=t.target;if(!e.matches(".entry__link"))return;t.preventDefault();let i=n.A.getDataAttribute(e,"data-target"),r=n.A.querySelector(this.el,`#${i}`);this.isStepByStepActive&&this.switchPageInStepByStep(r);let s=r.closest(this.options.collapsePanelSelector);s&&!this.isStepByStepActive&&bootstrap.Collapse.getOrCreateInstance(s).show();let{top:l}=o(r);window.scrollTo({top:l-this.options.scrollOffset,left:0,behavior:"smooth"})}switchPageInStepByStep(t){let e=this.stepByStepModePlugin,i=t.closest(".swag-customized-products__item"),r=e.navigationEntries.find(t=>t.pageEl.isSameNode(i));return!!r&&(e.transitionToPage.call(e,r.pageNum+1),!0)}onInputChange(){let t=this.buildViolations();if(this.isViolation=t,t){this.$emitter.publish("buyButtonDisable",!0);return}this.$emitter.publish("buyButtonDisable",!1)}collectInputElements(t,e){return Array.from(n.A.querySelectorAll(t,e.formControlSelector)).map(t=>{let e=this.extractIdFromElement(t),i=t.defaultValue;return{element:t,id:e,defaultValue:i}})}mergeExclusionWithElements(t){if(this.exclusions.length<=0)return;let e=e=>{let{element:i}=t.find(t=>
1t.id===e);return i};this.exclusions.forEach(t=>{t.forEach(t=>{t.element=e(t.id)},[])})}buildViolations(){let t=this.exclusions.map(t=>({violationFound:t.reduce((t,e)=>{let{element:i,operator:r,type:n}=e;return t?t=this.validateElementState(i,r.type,n):t},!0),elements:t}));if(!(t=t.filter(t=>!0===t.violationFound))||t.length<=0)return l.updateViolationListDisplay([],this.violationHolderElement,this.translations,this.violationTemplateString),!1;let e=t.map(t=>t.elements).map(t=>{let e=[...t],i=e.shift(),r=l.findLabelForFormElement(i.element),n=e.map(t=>({labelText:l.findLabelForFormElement(t.element),element:t.element}));return{element:i.element,labelText:r,excludedElements:n}});return l.updateViolationListDisplay(e,this.violationHolderElement,this.translations,this.violationTemplateString),!0}extractIdFromElement(t){let e=t.id;return e&&e.length?e.replace(this.options.prefixes.optionId,"").replace(this.options.prefixes.uploadElement,""):""}validateElementState(t,e,i){return this.optionTypeManager.call(this,this.optionTypeManager.has(i)?i:"default","validate",{element:t,operator:e,type:i})}static findLabelForFormElement(t){return t.closest(".swag-customized-products-option",!1).querySelector(".swag-customized-products-option__title").innerText.trim()}static updateViolationListDisplay(t,e,i,r){let n=(t,e)=>i.excludeItem.replace("%1",t).replace("%2",e);if(!t||t.length<=0)return e.innerHTML="",!1;let s=` 2 <ul class="violation-list"> 3 ${t.map(t=>{let e=t.excludedElements.map(t=>{let e=t.element.id;return`<li> 4 <strong class="entry__link" data-target="${e}"> 5 ${t.labelText} 6 </strong> 7 </li>`});return e=`<ul class="excluded-element-list">${e.join("")}</ul>`,`<li class="violation-list__entry">${n(`<strong class="entry__link" data-target="${t.element.id}">${t.labelText}</strong>`,e)}</li>`}).join("")} 8 </ul> 9 `;return r=(r=r.replace("%1",i.headline)).replace("%2",s),e.innerHTML=r,!0}}},369(t,e,i){"use strict";i.r(e),i.d(e,{default:()=>r});let r={type:["colorselect","imageselect","select"],validate:t=>{let{element:e,operator:i}=t;return"select"===e.tagName.toLowerCase()?"X"===i?e.value.length>0:!e.value.length:"X"===i?!e.checked:e.checked}}},428(t,e,i){"use strict";i.r(e),i.d(e,{default:()=>r});let r={type:["default"],validate:t=>{let{element:e,operator:i}=t;return"X"===i?e.value.length>0:!e.value.length}}},456(t,e,i){"use strict";i.r(e),i.d(e,{default:()=>r});let r={type:["htmleditor"],validate:t=>{let{element:e,operator:i}=t,r=window.PluginManager.getPluginInstanceFromElement(e,"SwagCustomizedProductsHtmlEditor");return"X"===i?!r.isEmpty():r.isEmpty()}}},643(t,e,i){"use strict";i.d(e,{A:()=>o,l:()=>s});var r=i(737),n=i(795);let s=t=>{if("function"==typeof Event)return new Event(t);let e=document.createEvent("Event");return e.initEvent(t,!0,!0),e};class o extends r.A{static #t=this.options={selectors:{customProductsForm:"form .swag-customized-products",buyForm:"#productDetailPageBuyProductForm",buyWidget:"#productDetailPageBuyProductForm.buy-widget",buyButton:"#productDetailPageBuyProductForm .btn-buy",subscription:{buyForm:"#productDetailPageSubscriptionBuyProductForm",buyWidget:"#productDetailPageSubscriptionBuyProductForm .buy-widget",buyButton:"#productDetailPageSubscriptionBuyProductForm .btn-buy",oneTimeRadio:"#subscription-interval-option-one-time-buy"}}};static #e=this._isSubscription=!1;_init(){this._context={customProductsForm:n.A.querySelector(document,this.options.selectors.customProductsForm),buyForm:n.A.querySelector(document,this.options.selectors.buyForm),buyWidget:n.A.querySelector(document,this.options.selectors.buyWidget),buyButton:n.A.querySelector(document,this.options.selectors.buyButton),subscription:{buyForm:n.A.querySelector(document,this.options.selectors.subscription.buyForm,!1),buyWidget:n.A.querySelector(document,this.options.selectors.subscription.buyWidget,!1),buyButton:n.A.querySelector(document,this.options.selectors.subscription.buyButton,!1),oneTimeRadio:n.A.querySelector(document,this.options.selectors.subscription.oneTimeRadio,!1)}},this._wrapAddEventListener(this._context.buyForm,this._context.subscription.buyForm),this._wrapAddEventListener(this._context.buyButton,this._context.subscription.buy
9Button),super._init()}get buyForm(){return o._isSubscription?this._context.subscription.buyForm:this._context.buyForm}get buyButton(){return o._isSubscription?this._context.subscription.buyButton:this._context.buyButton}get buyWidget(){return o._isSubscription?this._context.subscription.buyWidget:this._context.buyWidget}get customProductsForm(){return this._context.customProductsForm}_wrapAddEventListener(t,e){let i=this._contextSwitchingEventListener.bind(this,t,e);t&&(t.addEventListener=i),e&&(e.addEventListener=i)}_contextSwitchingEventListener(t,e,i,r){for(var n=arguments.length,s=Array(n>4?n-4:0),l=4;l<n;l++)s[l-4]=arguments[l];EventTarget.prototype.addEventListener.apply(t,[i,function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];o._isSubscription||r(...e)},...s]),e&&EventTarget.prototype.addEventListener.apply(e,[i,function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];o._isSubscription&&r(...e)},...s])}}},707(t,e,i){"use strict";i.d(e,{A:()=>r});class r{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let i=r.toUpperCamelCase(t,e);return r.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>r.ucFirst(t.toLowerCase())).join(""):r.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},737(t,e,i){"use strict";i.d(e,{A:()=>l});var r=i(156),n=i.n(r),s=i(707);class o{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(r),r}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,n=t.split("."),s=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=s;s=function(i){r.unsubscribe(t),e(i)}}return this.el.addEventListener(n[0],s),this.listeners.push({splitEventName:n,opts:i,cb:s}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,i)=>([...i.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):t.push(i),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class l{constructor(t,e={},i=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=[this.constructor.options,this.options,t];return e.push(this._getConfigFromDataAttribute()),e.push(this._getOptionsFromDataAttribute()),n().all(e.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=s.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=s.A.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${e}-options`);if(i)try{return JSON.parse(i)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}}
9,795(t,e,i){"use strict";i.d(e,{A:()=>n});var r=i(707);class n{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!n.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!1===n.hasAttribute(t,e))throw Error(`The required property "${e}" does not exist!`);if("function"!=typeof t.getAttribute){if(i)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=e.replace(/^data(|-)/,""),o=r.A.toLowerCamelCase(s,"-");if(!n.isNode(t)){if(i)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(i)throw Error("This node doesn't support the dataset attribute!");return}let l=t.dataset[o];if(void 0===l){if(i)throw Error(`The required data attribute "${e}" does not exist on ${t}!`);return l}return r.A.parsePrimitive(l)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!n.isNode(t))throw Error("The parent node is not a valid HTML Node!");let r=t.querySelector(e)||!1;if(i&&!1===r)throw Error(`The required element "${e}" does not exist in parent node!`);return r}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!n.isNode(t))throw Error("The parent node is not a valid HTML Node!");let r=t.querySelectorAll(e);if(0===r.length&&(r=!1),i&&!1===r)throw Error(`At least one item of "${e}" must exist in parent node!`);return r}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,e=` 10 input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]), 11 select:not([tabindex^="-"]):not([disabled]), 12 textarea:not([tabindex^="-"]):not([disabled]), 13 button:not([tabindex^="-"]):not([disabled]), 14 a[href]:not([tabindex^="-"]):not([disabled]), 15 [tabindex]:not([tabindex^="-"]):not([disabled]) 16 `;return t.querySelectorAll(e)}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}},895(t,e,i){var r={"./exclusion-list-type-checkbox.js":113,"./exclusion-list-type-colorselect.js":369,"./exclusion-list-type-datetime-timestamp.js":168,"./exclusion-list-type-default.js":428,"./exclusion-list-type-htmleditor.js":456,"./exclusion-list-type-numberfield.js":917,"./exclusion-list-type-upload.js":973};function n(t){return i(s(t))}function s(t){if(!i.o(r,t)){var e=Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}n.keys=function(){return Object.keys(r)},n.resolve=s,t.exports=n,n.id=895},917(t,e,i){"use strict";i.r(e),i.d(e,{default:()=>r});let r={type:["numberfield"],validate:t=>{let{element:e,operator:i}=t,r=e.defaultValue;return"X"===i?e.value!==r:e.value===r}}},973(t,e,i){"use strict";i.r(e),i.d(e,{default:()=>r});let r={type:["imageupload","fileupload"],validate:t=>{let{element:e,operator:i}=t,r=window.PluginManager.getPluginInstanceFromElement(e.closest(".customized-products-upload"),"SwagCustomizedProductsFileUpload");return"X"===i?r.registry.size>0:!r.registry.size}}}}]);
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.