1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[32215],{156:t=>{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 s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?o(Array.isArray(t)?[]:{},t,e):t}function r(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function o(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=s;var u,d,h=Array.isArray(i);return h!==Array.isArray(t)?s(i,l):h?l.arrayMerge(t,i,l):(d={},(u=l).isMergeableObject(t)&&n(t).forEach(function(e){d[e]=s(t[e],u)}),n(i).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&u.isMergeableObject(i[e])?d[e]=(function(t,e){if(!e.customMerge)return o;var i=e.customMerge(t);return"function"==typeof i?i:o})(e,u)(t[e],i[e],u):d[e]=s(i[e],u))}),d)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return o(t,i,e)},{})},t.exports=o},215:(t,e,i)=>{i.r(e),i.d(e,{default:()=>u});var s=i(220),r=i(308);let n={MAIL:"0",PACKSTATION:"1",POST_OFFICE:"2"},a={UNKNOWN:"",PACKSTATION:"P"};var o=i(707);class l{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!l.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===l.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(|-)/,""),r=o.A.toLowerCamelCase(s,"-");if(!l.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 n=t.dataset[r];if(void 0===n){if(i)throw Error(`The required data attribute "${e}" does not exist on ${t}!`);return n}return o.A.parsePrimitive(n)}static querySelector(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!l.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelector(e)||!1;if(i&&!1===s)throw Error(`The required element "${e}" does not exist in parent node!`);return s}static querySelectorAll(t,e){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(i&&!l.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelectorAll(e);if(0===s.length&&(s=!1),i&&!1===s)throw Error(`At least one item of "${e}" must exist in parent node!`);return s}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,e=` 2 input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]), 3 select:not([tabindex^="-"]):not([disabled]), 4 textarea:not([tabindex^="-"]):not([disabled]), 5 button:not([tabindex^="-"]):not([disabled]), 6 a[href]:not([tabindex^="-"]):not([disabled]), 7 [tabindex]:not([tabindex^="-"]):not([disabled]) 8 `;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]}}class u extends s.A{static #t=this.options={streetValues:{packstation:"Packstation",postOffice:"Postfiliale"},selectors:{formSelector:"form",addressFormSubmit:".address-form-submit",addressType:'input[type="radio"][name="repertusPackstationAddressType"]',addressTypePackstation:"#repertusPackstationAddressType1",packstationFieldSet:".repertusPackstationAddressFields",packstationType:"#repertusPackstationAddressPackstationType",packstationNumber:"#repertusPackstationAddressPackstationNumber",dhlNumber:"#repertusPackstationAddressPostNumber",dhlNumberSaveTo:"#shippingAddressAdditionalField1",city:"",zip:"",street:"",country:"",countryState:"",department:"",vatId:"",cookieButton:"#repertusPackstationOpenCookie",dhlNumberOnlyNumericalError:"#only-numerical-error"},config:{savePostnumberField:"additionalAddressLine1"},countryIdGermany:null};init(){this._initDefaultValues(),this.emitter=new r.A,this.formToggleCheckbox=l.querySelector(document,"#differentShippingAddress",!1),this.formToggleCheckbox&&(this.formFieldTogglePluginEmitter=new r.A(this.formToggleCheckbox)),this.$el=this.el,this.$form=this.$el.closest(this.options.selectors.formSelector),this.id=this.$form.getAttribute("data-tonur-packstation-form-id"),this.$addressTypeSelection=this.$el.querySelectorAll(this.options.selectors.addressType),this.$packstationFieldSet=this.$el.querySelector(this.options.selectors.packstationFieldSet),this.$packstationNumberField=this.$el.querySelector(this.options.selectors.packstationNumber),this.$dhlNumberField=this.$el.querySelector(this.options.selectors.dhlNumber),this.$packstationTypeField=this.$el.querySelector(this.options.selectors.packstationType),this.$zipField=this.$form.querySelector(this.options.selectors.zip),this.$cityField=this.$form.querySelector(this.options.selectors.city),this.$countryField=this.$form.querySelector(this.options.selectors.country),this.$countryStateField=this.$form.querySelector(this.options.selectors.countryState),this.$street=this.$form.querySelector(this.options.selectors.street),this.$dhlNumberSaveToField=this.$form.querySelector(this.options.selectors.dhlNumberSaveTo),this.$departmentField=this.$form.querySelector(this.options.selectors.department),this.$vatIdField=this.$form.querySelector(this.options.selectors.vatId),this.$cookieButton=this.$el.querySelector(this.options.selectors.cookieButton),this.dhlNumberOnlyNumericalError=this.el.querySelector(this.options.selectors.dhlNumberOnlyNumericalError),this._registerEvents(),this._handleRelevantDataChanged(!1)}_initDefaultValues(){this.currentAddressType=n.MAIL,this.currentPackstationType=a.UNKNOWN,this.currentDhlNumber="",this.currentPackstationNumber=""}_registerEvents(){this.emitter.subscribe("TonurPackstation_selectLocation-"+this.id,t=>{this._setPackstationDataToForm(t.detail),this._handleRelevantDataChanged()}),this.formToggleCheckbox&&this.formFieldTogglePluginEmitter.subscribe("onChange",()=>{this._updateView()}),this.$addressTypeSelection.forEach(t=>t.addEventListener("change",this._onRelevantDataForStreetChanged.bind(this))),this.$packstationNumberField.addEventListener("change",this._onRelevantDataForStreetChanged.bind(this)),this.$packstationTypeField.addEventListener("change",this._onRelevantDataForStreetChanged.bind(this)),this.$dhlNumberField.addEventListener("change",this._onRelevantDataForStreetChanged.bind(this)),this.$dhlNumberField.addEventListener("input",t=>{isNaN(t.target.value)?(this.dhlNumberOnlyNumericalError.classList.remove("d-none"),t.target.value=t.target.value.replace(/[^0-9]/g,"")):this.dhlNumberOnlyNumericalError.classList.add("d-none")}),this.$cookieButton.addEventListener("click",t=>{t.preventDefault(),window.PluginManager.getPluginInstances("CookieConfiguration").forEach(t=>{t.openOffCanvas()})})}_onRelevantDataForStreetChanged(){this._handleRelevantDataChanged()}_handleRelevantDataChanged(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this._updateCurrentValues(),this._calculateStreetValue(),t&&(this._updateFormFields(),this._setCountryToGermanyIfNecessary()),this._updateView()}_updateCurrentValues(){this._updateCurrentAddressType(),this._updateCurrentPackstationType(),this._updateDhlNumber(),this._updatePackstationNumber(),this._updateCurrentZip(),this._updateCurrentCity()}_updateCurrentAddressType(){for(let t=0;t<this.$addressTypeSelection.length;t++)if(this.$addressTypeSelection[t].checked){this.currentAddressType=this.$addressTypeSelection[t].value;break}}_updateCurrentPackstationType(){this.currentPackstationType=this.$packstationTypeField.value}_updateDhlNumber(){this.currentDhlNumber=this.$dhlNumberField.value}_updatePackstationNumber(){this.currentPackstationNumber=this.$packstationNumberField.value}_updateCurrentZip(){this.currentZip=this.$zipField.value}_updateCurrentCity(){this.currentCity=this.$cityField.value}setInputFieldValue(t,e){t&&(t.value=e,t.dispatchEvent(new Event("input",{bubbles:!0})))}_updateFormFields(){this.setInputFieldValue(this.$street,this.currentStreet),this.setInputFieldValue(this.$dhlNumberSaveToField,this.currentDhlNumber),this.setInputFieldValue(this.$packstationNumberField,this.currentPackstationNumber),this.setInputFieldValue(this.$dhlNumberField,this.currentDhlNumber),this.setInputFieldValue(this.$zipField,this.currentZip),this.setInputFieldValue(this.$cityField,this.currentCity),this._setCountryToInitialValue()}_updateView(){let t=this.currentAddressType===n.PACKSTATION||this.currentAddressType===n.PO
8ST_OFFICE,e="company"===this.options.config.savePostnumberField;t?(this.$packstationFieldSet&&(this.$packstationFieldSet.classList.remove("d-none"),this.$packstationFieldSet.querySelectorAll("input").forEach(function(t){t.disabled=!1})),this.$street&&(this.$street.parentElement.style.display="none"),this.$dhlNumberSaveToField&&(this.$dhlNumberSaveToField.parentElement.style.display="none"),this.$departmentField&&this.$departmentField.parentElement.classList.add("d-none"),this.$vatIdField&&this.$vatIdField.parentElement.classList.add("d-none")):(this.$packstationFieldSet&&(this.$packstationFieldSet.classList.add("d-none"),this.$packstationFieldSet.querySelectorAll("input").forEach(function(t){t.disabled=!0})),this.$street&&(this.$street.parentElement.style.display="block"),this.$dhlNumberSaveToField&&(this.$dhlNumberSaveToField.parentElement.style.display="block"),this.$departmentField&&this.$departmentField.parentElement.classList.toggle("d-none",e),this.$vatIdField&&this.$vatIdField.parentElement.classList.toggle("d-none",e)),this.$emitter.publish("TonurPackstationForm/updateView",{id:this.id,isPackstationOrPostOffice:t,streetValue:this.currentPackstationType===a.PACKSTATION?this.options.streetValues.packstation:this.options.streetValues.postOffice})}_setCountryToGermanyIfNecessary(){(this.currentAddressType===n.PACKSTATION||this.currentAddressType===n.POST_OFFICE)&&null!==this.options.countryIdGermany&&this.$countryField.value!==this.options.countryIdGermany&&(this.$countryField.value=this.options.countryIdGermany,this._fireChangeEventForDOMElement(this.$countryField[0]))}_setCountryToInitialValue(){if(this.currentAddressType===n.MAIL)try{let t=this.$countryField.dataset.initialCountryId;if(t===this.options.countryIdGermany)return;this.$countryField.value=t,t?this._fireChangeEventForDOMElement(this.$countryField):(this.$countryStateField.parentNode.classList.toggle("d-none",!0),this.$countryStateField.setAttribute("disabled","disabled"))}catch(t){console.log("An error occurred setting country to initial value"),console.log(t)}}_fireChangeEventForDOMElement(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(void 0===t)return;let s=document.createEvent("HTMLEvents");s.initEvent("change",e,i),t.dispatchEvent(s)}_setPackstationDataToForm(t){this.setInputFieldValue(this.$packstationNumberField,t.number),this.setInputFieldValue(this.$packstationTypeField,t.type),this.setInputFieldValue(this.$zipField,t.address.postalCode),this.setInputFieldValue(this.$cityField,t.address.addressLocality);let e=Array.from(this.$addressTypeSelection).find(t=>t.value===n.PACKSTATION);e&&(e.checked=!0,this.currentAddressType=n.PACKSTATION,e.click())}_calculateStreetValue(){if(""===this.currentPackstationNumber||this.currentAddressType===n.MAIL){this.street="",this.currentStreet="",this.currentZip="",this.currentCity="",this.currentAddressType===n.MAIL&&(this.currentPackstationNumber="",this.currentDhlNumber="");return}this.currentStreet=this.options.streetValues.packstation,this.currentPackstationType!==a.PACKSTATION&&(this.currentStreet=this.options.streetValues.postOffice),this.currentStreet+=" "+this.currentPackstationNumber}}},308:(t,e,i)=>{i.d(e,{A:()=>s});class s{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],s=new CustomEvent(t,{detail:e,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,r=t.split("."),n=i.scope?e.bind(i.scope):e;if(i.once&&!0===i.once){let e=n;n=function(i){s.unsubscribe(t),e(i)}}return this.el.addEventListener(r[0],n),this.listeners.push({splitEventName:r,opts:i,cb:n}),!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}
8reset(){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}}},707:(t,e,i)=>{i.d(e,{A:()=>s});class s{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=s.toUpperCamelCase(t,e);return s.lcFirst(i)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>s.ucFirst(t.toLowerCase())).join(""):s.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},220:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(156),r=i.n(s),n=i(707),a=i(308);class o{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 a.A(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()),r().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=n.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=n.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}}}}]);
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.