1(function(){"use strict";class De{constructor(){this._request=null}get(e,t,i="application/json"){const s=this._createPreparedRequest("GET",e,i);return this._sendRequest(s,null,t)}post(e,t,i,s="application/json"){s=this._getContentType(t,s);const a=this._createPreparedRequest("POST",e,s);return this._sendRequest(a,t,i)}delete(e,t,i,s="application/json"){s=this._getContentType(t,s);const a=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(a,t,i)}patch(e,t,i,s="application/json"){s=this._getContentType(t,s);const a=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(a,t,i)}abort(){if(this._request)return this._request.abort()}_registerOnLoaded(e,t){t&&e.addEventListener("loadend",()=>{t(e.responseText,e)})}_sendRequest(e,t,i){return this._registerOnLoaded(e,i),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,i){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}}class P{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return P.isIPhoneDevice()||P.isIPadDevice()}static isNativeWindowsBrowser(){return P.isIEBrowser()||P.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return navigator.userAgent.toLowerCase().indexOf("msie")!==-1||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":P.isTouchDevice(),"is-ios":P.isIOSDevice(),"is-native-windows":P.isNativeWindowsBrowser(),"is-iphone":P.isIPhoneDevice(),"is-ipad":P.isIPadDevice(),"is-ie":P.isIEBrowser(),"is-edge":P.isEdgeBrowser()}}}class fe{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(const i of e.entries())t(i[1],i[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(i=>{t(e[i],i)});throw new Error("The element type ".concat(typeof e," is not iterable!"))}}const X="modal-backdrop",$e="modal-backdrop-open",Be="no-scroll",ge=350,Rt={ON_CLICK:"backdrop/onclick"};class Y{constructor(){return Y.instance||(Y.instance=this),Y.instance}create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());const t=document.body.lastChild;document.documentElement.classList.add(Be),setTimeout(()=>{t.classList.add($e),typeof e=="function"&&e()},75),this._dispatchEvents()}remove(e=ge){const t=this._getBackdrops();fe.iterate(t,i=>i.classList.remove($e)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(Be)}_dispatchEvents(){const e=P.isTouchDevice()?"touchstart":"click";document.addEventListener(e,t=>{t.target.classList.contains(X)&&document.dispatchEvent(new CustomEvent(Rt.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(".".concat(X))}_removeExistingBackdrops(){if(this._exists()===!1)return;const e=this._getBackdrops();fe.iterate(e,t=>t.remove())}_exists(){return document.querySelectorAll(".".concat(X)).length>0}_getTemplate(){return'<div class="'.concat(X,'"></div>')}}const xe=Object.freeze(new Y);class me{static create(e=null){xe.create(e)}static remove(e=ge){xe.remove(e)}static SELECTOR_CLASS(){return X}}const ie="loader",Dt="visually-hidden",ye={BEFORE:"before",INNER:"inner"};class Q{constructor(e,t=ye.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===ye.INNER){this.parent.innerHTML=Q.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),Q.getTemplate())}}remove(){const e=this.parent.querySelectorAll(".".concat(ie));fe.iterate(e,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(ie)).length>0}_getPosition(){return this.position===ye.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(ie,'" role="status">
1\n <span class="').concat(Dt,'">Loading...</span>\n </div>')}static SELECTOR_CLASS(){return ie}}class $t extends Q{constructor(){super(document.body)}create(e=!0){this.exists()||e&&(me.create(),document.querySelector(".".concat(me.SELECTOR_CLASS())).insertAdjacentHTML("beforeend",Q.getTemplate()))}remove(e=!0){super.remove(),e&&me.remove()}}const We=Object.freeze(new $t);class Ue{static create(e=!0){We.create(e)}static remove(e=!0){We.remove(e)}}var $=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function He(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var be,Ke;function Bt(){if(Ke)return be;Ke=1;var l=function(h){return e(h)&&!t(h)};function e(d){return!!d&&typeof d=="object"}function t(d){var h=Object.prototype.toString.call(d);return h==="[object RegExp]"||h==="[object Date]"||a(d)}var i=typeof Symbol=="function"&&Symbol.for,s=i?Symbol.for("react.element"):60103;function a(d){return d.$$typeof===s}function c(d){return Array.isArray(d)?[]:{}}function g(d,h){return h.clone!==!1&&h.isMergeableObject(d)?L(c(d),d,h):d}function y(d,h,p){return d.concat(h).map(function(A){return g(A,p)})}function S(d,h){if(!h.customMerge)return L;var p=h.customMerge(d);return typeof p=="function"?p:L}function w(d){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(d).filter(function(h){return Object.propertyIsEnumerable.call(d,h)}):[]}function C(d){return Object.keys(d).concat(w(d))}function O(d,h){try{return h in d}catch(p){return!1}}function k(d,h){return O(d,h)&&!(Object.hasOwnProperty.call(d,h)&&Object.propertyIsEnumerable.call(d,h))}function q(d,h,p){var A={};return p.isMergeableObject(d)&&C(d).forEach(function(b){A[b]=g(d[b],p)}),C(h).forEach(function(b){k(d,b)||(O(d,b)&&p.isMergeableObject(h[b])?A[b]=S(b,p)(d[b],h[b],p):A[b]=g(h[b],p))}),A}function L(d,h,p){p=p||{},p.arrayMerge=p.arrayMerge||y,p.isMergeableObject=p.isMergeableObject||l,p.cloneUnlessOtherwiseSpecified=g;var A=Array.isArray(h),b=Array.isArray(d),H=A===b;return H?A?p.arrayMerge(d,h,p):q(d,h,p):g(h,p)}L.all=function(h,p){if(!Array.isArray(h))throw new Error("first argument should be an array");return h.reduce(function(A,b){return L(A,b,p)},{})};var D=L;return be=D,be}var xt=Bt();const Wt=He(xt);class B{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){const i=B.toUpperCamelCase(e,t);return B.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(s=>B.ucFirst(s.toLowerCase())).join(""):B.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class T{static isNode(e){return typeof e!="object"||e===null?!1:e===document||e===window?!0:e instanceof Node}static hasAttribute(e,t){if(!T.isNode(e))throw new Error("The element must be a valid HTML Node!");return typeof e.hasAttribute!="function"?!1:e.hasAttribute(t)}static getAttribute(e,t,i=!0){if(i&&T.hasAttribute(e,t)===!1)throw new Error('The required property "'.concat(t,'" does not exist!'));if(typeof e.getAttribute!="function"){if(i)throw new Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t,i=!0){const s=t.replace(/^data(|-)/,""),a=B.toLowerCamelCase(s,"-");if(!T.isNode(e)){if(i)throw new Error("The passed node is not a valid HTML Node!");return}if(typeof e.dataset>"u"){if(i)throw new Error("This node doesn't support the dataset attribute!");return}const c=e.dataset[a];if(typeof c>"u"){if(i)throw new Error('The required data attribute "'.concat(t,'" does not exist on ').concat(e,"!"));return c}return B.parsePrimitive(c)}static querySelector(e,t,i=!0){if(i&&!T.isNode(e))throw new Error("The parent node is not a valid HTML Node!");const s=e.querySelector(t)||!1;if(i&&s===!1)throw new Error('The required element "'.concat(t,'" does not exist in parent node!'));return s}static querySelectorAll(e,t,i=!0){if(i&&!T.isNode(e))throw new Error("The parent node is not a valid HTML Node!");let s=e.querySelectorAll(t);if(s.length===0&&(s=!1),i&&s===!1)throw new Error('At least one item of "'.concat(t,'" must exist in parent node!'));return s}}class Ut{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e,t={},i=!1){const s=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(e,t,i={}){const s=this,a=e.split(".");let c=i.scope?t.bind(i.scope):t;if(i.once&&i.once===!0){const g=c;c=function(S){s.unsubscribe(e),g(S)}}return this.el.addEventListener(a[0],c),this.listeners.push({splitEventName:a,opts:i,cb:c}),!0}unsubscribe(e){const t=e.split(".");return this.listeners=this.listeners.reduce((i,s)=>s.splitEventName.sort().toString()===t.sort().toString()?(this.el.removeEventListener(s.splitEventName[0],s.cb),i):(i.push(s),i),[]),!0}
1reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}class ve{constructor(e,t={},i=!1){if(!T.isNode(e))throw new Error("There is no valid element given.");this.el=e,this.$emitter=new Ut(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}init(){throw new Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){const t=B.toDashCase(this._pluginName),i=T.getDataAttribute(this.el,"data-".concat(t,"-config"),!1),s=T.getAttribute(this.el,"data-".concat(t,"-options"),!1),a=[this.constructor.options,this.options,e];i&&a.push(window.PluginConfigManager.get(this._pluginName,i));try{s&&a.push(JSON.parse(s))}catch(c){throw new Error('The data attribute "data-'.concat(t,'-options" could not be parsed to json: ').concat(c.message))}return Wt.all(a.filter(c=>c instanceof Object&&!(c instanceof Array)).map(c=>c||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}const Ge="js-pseudo-modal",Ht="js-pseudo-modal-template",Kt="js-pseudo-modal-template-content-element",Gt="js-pseudo-modal-template-title-element",Ve=window.bootstrap;class Vt{constructor(e,t=!0,i=".".concat(Ht),s=".".concat(Kt),a=".".concat(Gt)){this._content=e,this._useBackdrop=t,this._templateSelector=i,this._templateContentSelector=s,this._templateTitleSelector=a}open(e){this._create(),setTimeout(this._open.bind(this,e),ge)}close(){const e=this.getModal();this._modalInstance=Ve.Modal.getInstance(e)}getModal(){return this._modal||this._create(),this._modal}updatePosition(){this._modalInstance.handleUpdate()}updateContent(e,t){this._content=e,this._setModalContent(e),this.updatePosition(),typeof t=="function"&&t.bind(this)()}_open(e){this.getModal(),this._modal.addEventListener("hidden.bs.modal",this._modalWrapper.remove),this._modal.addEventListener("shown.bs.modal",e),this._modalInstance.show()}_create(){this._modalMarkupEl=T.querySelector(document,this._templateSelector),this._createModalWrapper(),this._modalWrapper.innerHTML=this._content,this._modal=this._createModalMarkup(),this._modalInstance=new Ve.Modal(this._modal,{backdrop:this._useBackdrop}),document.body.insertAdjacentElement("beforeend",this._modalWrapper)}_createModalWrapper(){this._modalWrapper=T.querySelector(document,".".concat(Ge),!1),this._modalWrapper||(this._modalWrapper=document.createElement("div"),this._modalWrapper.classList.add(Ge))}_createModalMarkup(){const e=T.querySelector(this._modalWrapper,".modal",!1);if(e)return e;const t=this._modalWrapper.innerHTML;return this._modalWrapper.innerHTML=this._modalMarkupEl.innerHTML,this._setModalContent(t),T.querySelector(this._modalWrapper,".modal")}_setModalTitle(e=""){try{const t=T.querySelector(this._modalWrapper,this._templateTitleSelector);t.innerHTML=e}catch(t){}}_setModalContent(e){const t=T.querySelector(this._modalWrapper,this._templateContentSelector);t.innerHTML=e;try{const i=T.querySelector(t,this._templateTitleSelector);i&&(this._setModalTitle(i.innerHTML),i.parentNode.removeChild(i))}catch(i){}}}const Zt='[data-bs-toggle="tooltip"]';function Ze(){document.querySelectorAll(Zt).forEach(l=>new window.bootstrap.Tooltip(l))}const W=[{key:"regular",streetValuePrefix:null,isDhlSpecificAddressType:!1},{key:"packstation",streetValuePrefix:"Packstation",isDhlSpecificAddressType:!0},{key:"post-office",streetValuePrefix:"Postfiliale",isDhlSpecificAddressType:!0},{key:"paketshop",streetValuePrefix:"Paketshop",isDhlSpecificAddressType:!0}],ze={"handicapped-access":{icon:"wheelchair"},parking:{icon:"parking"}},ne={hidden:"d-none",visible:"d-block"};class zt{constructor(e){this.container=e,this.addressFormsByKey={},this.addressFormContainerByKey={},this.currentAddressType=null,this.formFieldTogglePlugin=window.PluginManager.getPlugin("FormFieldToggle").get("class"),W.forEach(t=>{this.addressFormsByKey[t.key]=this.container.querySelector(".pickware-dhl-".concat(t.key,"-address-form")),this.addressFormContainerByKey[t.key]=this.container.querySelector(".pickware-dhl-".concat(t.key,"-address-form-container"))}),this.updateAddressFormWhenAccountTypeHasChanged()}showAddressForm(e){this.currentAddressType=e,this.toggleCompanyForm(!e.isDhlSpecificAddressType&&!this.isPrivateAddressAccountType()),W.filter(t=>
1t.key!==e.key).forEach(t=>this.toggleAddressForm(t,!1)),this.toggleAddressForm(e,!0),e.isDhlSpecificAddressType&&this.enableSpecialAddressFormFields(e)}toggleAddressForm(e,t){const i=this.addressFormsByKey[e.key],s=this.addressFormContainerByKey[e.key];if(!(!i||!s)){if(!t){i.remove();return}s&&s.appendChild(i)}}enableSpecialAddressFormFields(e){this.container.querySelectorAll(".pickware-dhl-".concat(e.key,"-address-form-container input")).forEach(s=>{var a;s.disabled="",s.classList.contains((a=this.formFieldTogglePlugin.options)==null?void 0:a.wasRequiredCls)&&(s.classList.remove(this.formFieldTogglePlugin.options.wasRequiredCls),s.setAttribute("required","required"))});const i=this.container.querySelector(".pickware-dhl-".concat(e.key,"-country"));i&&(i.disabled="")}toggleCompanyForm(e){const t=this.container.querySelector(".address-contact-type-company, .js-field-toggle-contact-type-company");t&&(e?this.showNode(t):this.hideNode(t))}hideNode(e){e&&(e.classList.remove(ne.visible),e.classList.add(ne.hidden))}showNode(e,t=!0){e&&(e.classList.remove(ne.hidden),t&&e.classList.add(ne.visible))}getAddressAccountTypeSelectField(){var t;const e=this.container.closest(".pickware-dhl-location-finder-wrapper");return(t=e==null?void 0:e.querySelector('select[data-form-field-toggle-target=".js-field-toggle-contact-type-company"]'))!=null?t:null}isPrivateAddressAccountType(){var e;return((e=this.getAddressAccountTypeSelectField())==null?void 0:e.value)==="private"}updateAddressFormWhenAccountTypeHasChanged(){const e=this.getAddressAccountTypeSelectField();e==null||e.addEventListener("change",()=>{this.currentAddressType!==null&&this.showAddressForm(this.currentAddressType)})}}function Jt(l,e,t,i){function s(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function g(w){try{S(i.next(w))}catch(C){c(C)}}function y(w){try{S(i.throw(w))}catch(C){c(C)}}function S(w){w.done?a(w.value):s(w.value).then(g,y)}S((i=i.apply(l,[])).next())})}typeof SuppressedError=="function"&&SuppressedError;function Xt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var we,Je;function Yt(){return Je||(Je=1,we=function l(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var i,s,a;if(Array.isArray(e)){if(i=e.length,i!=t.length)return!1;for(s=i;s--!==0;)if(!l(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(a=Object.keys(e),i=a.length,i!==Object.keys(t).length)return!1;for(s=i;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[s]))return!1;for(s=i;s--!==0;){var c=a[s];if(!l(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}),we}var Qt=Yt(),er=Xt(Qt);const Xe="__googleMapsScriptId";var G;(function(l){l[l.INITIALIZED=0]="INITIALIZED",l[l.LOADING=1]="LOADING",l[l.SUCCESS=2]="SUCCESS",l[l.FAILURE=3]="FAILURE"})(G||(G={}));class U{constructor({apiKey:e,authReferrerPolicy:t,channel:i,client:s,id:a=Xe,language:c,libraries:g=[],mapIds:y,nonce:S,region:w,retries:C=3,url:O="https://maps.googleapis.com/maps/api/js",version:k}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=e,this.authReferrerPolicy=t,this.channel=i,this.client=s,this.id=a||Xe,this.language=c,this.libraries=g,this.mapIds=y,this.nonce=S,this.region=w,this.retries=C,this.url=O,this.version=k,U.instance){if(!er(this.options,U.instance.options))throw new Error("Loader must not be called again with different options. ".concat(JSON.stringify(this.options)," !== ").concat(JSON.stringify(U.instance.options)));return U.instance}U.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?G.FAILURE:this.done?G.SUCCESS:this.loading?G.LOADING:G.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback=__googleMapsCallback&loading=async",this.apiKey&&(e+="&key=".concat(this.apiKey)),this.channel&&(e+="&channel=".concat(this.channel)),this.client&&(e+="&client=".concat(this.client)),this.libraries.length>0&&(e+="&libraries=".concat(this.libraries.join(","))),this.language&&(e+="&language=".concat(this.language)),this.region&&(e+="®ion=".concat(this.region)),this.version&&(e+="&v=".concat(this.version)),this.mapIds&&(e+="&map_ids=".concat(this.mapIds.join(","))),this.authReferrerPolicy&&(e+="&auth_referrer_policy=".concat(this.authReferrerPolicy)),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>
1{this.loadCallback(i=>{i?t(i.error):e(window.google)})})}importLibrary(e){return this.execute(),google.maps.importLibrary(e)}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){var e,t;if(document.getElementById(this.id)){this.callback();return}const i={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(i).forEach(a=>!i[a]&&delete i[a]),!((t=(e=window==null?void 0:window.google)===null||e===void 0?void 0:e.maps)===null||t===void 0)&&t.importLibrary||(a=>{let c,g,y,S="The Google Maps JavaScript API",w="google",C="importLibrary",O="__ib__",k=document,q=window;q=q[w]||(q[w]={});const L=q.maps||(q.maps={}),D=new Set,d=new URLSearchParams,h=()=>c||(c=new Promise((p,A)=>Jt(this,void 0,void 0,function*(){var b;yield g=k.createElement("script"),g.id=this.id,d.set("libraries",[...D]+"");for(y in a)d.set(y.replace(/[A-Z]/g,H=>"_"+H[0].toLowerCase()),a[y]);d.set("callback",w+".maps."+O),g.src=this.url+"?"+d,L[O]=p,g.onerror=()=>c=A(Error(S+" could not load.")),g.nonce=this.nonce||((b=k.querySelector("script[nonce]"))===null||b===void 0?void 0:b.nonce)||"",k.head.append(g)})));L[C]?console.warn(S+" only loads once. Ignoring:",a):L[C]=(p,...A)=>D.add(p)&&h().then(()=>L[C](p,...A))})(i);const s=this.libraries.map(a=>this.importLibrary(a));s.length||s.push(this.importLibrary("core")),Promise.all(s).then(()=>this.callback(),a=>{const c=new ErrorEvent("error",{error:a});this.loadErrorCallback(c)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error("Failed to load Google Maps script, retrying in ".concat(t," ms.")),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=e,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),!this.loading)if(this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading=!0,this.setScript()}}}var ee={exports:{}},Se,Ye;function Qe(){if(Ye)return Se;Ye=1;var l=/<%=([\s\S]+?)%>/g;return Se=l,Se}var Ae,et;function tr(){if(et)return Ae;et=1;var l=Qe(),e="[object Null]",t="[object Symbol]",i="[object Undefined]",s=/[&<>"']/g,a=RegExp(s.source),c=/<%-([\s\S]+?)%>/g,g=/<%([\s\S]+?)%>/g,y={"&":"&","<":"<",">":">",'"':""","'":"'"},S=typeof $=="object"&&$&&$.Object===Object&&$,w=typeof self=="object"&&self&&self.Object===Object&&self,C=S||w||Function("return this")();function O(u,j){for(var x=-1,V=u==null?0:u.length,Z=Array(V);++x<V;)Z[x]=j(u[x],x,u);return Z}function k(u){return function(j){return u==null?void 0:u[j]}}var q=k(y),L=Object.prototype,D=L.hasOwnProperty,d=L.toString,h=C.Symbol,p=h?h.toStringTag:void 0,A=h?h.prototype:void 0,b=A?A.toString:void 0,H={escape:c,evaluate:g,interpolate:l,variable:"",imports:{_:{escape:Oe}}};function Le(u){return u==null?u===void 0?i:e:p&&p in Object(u)?Te(u):Ce(u)}function se(u){if(typeof u=="string")return u;if(Ie(u))return O(u,se)+"";if(Fe(u))return b?b.call(u):"";var j=u+"";return j=="0"&&1/u==-1/0?"-0":j}function Te(u){var j=D.call(u,p),x=u[p];try{u[p]=void 0;var V=!0}catch(rt){}var Z=d.call(u);return V&&(j?u[p]=x:delete u[p]),Z}function Ce(u){return d.call(u)}var Ie=Array.isArray;function Pe(u){return u!=null&&typeof u=="object"}function Fe(u){return typeof u=="symbol"||Pe(u)&&Le(u)==t}function Me(u){return u==null?"":se(u)}function Oe(u){return u=Me(u),u&&a.test(u)?u.replace(s,q):u}return Ae=H,Ae}ee.exports;var tt;function rr(){return tt||(tt=1,(function(l,e){var t=Qe(),i=tr(),s="Invalid `variable` option passed into `_.template`",a="Invalid `imports` option passed into `_.template`",c=800,g=16,y=9007199254740991,S="[object Arguments]",w="[object Array]",C="[object AsyncFunction]",O="[object Boolean]",k="[object Date]",q="[object DOMException]",L="[object Error]",D="[object Function]",d="[object GeneratorFunction]",h="[object Map]",p="[object Number]",A="[object Null]",b
1="[object Object]",H="[object Proxy]",Le="[object RegExp]",se="[object Set]",Te="[object String]",Ce="[object Symbol]",Ie="[object Undefined]",Pe="[object WeakMap]",Fe="[object ArrayBuffer]",Me="[object DataView]",Oe="[object Float32Array]",u="[object Float64Array]",j="[object Int8Array]",x="[object Int16Array]",V="[object Int32Array]",Z="[object Uint8Array]",rt="[object Uint8ClampedArray]",lr="[object Uint16Array]",dr="[object Uint32Array]",ur=/\b__p \+= '';/g,hr=/\b(__p \+=) '' \+/g,pr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,fr=/[\\^$.*+?()[\]{}|]/g,it=/[()=,{}\[\]\/\s]/,gr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mr=/^\[object .+?Constructor\]$/,yr=/^(?:0|[1-9]\d*)$/,oe=/($^)/,br=/['\n\r\u2028\u2029\\]/g,v={};v[Oe]=v[u]=v[j]=v[x]=v[V]=v[Z]=v[rt]=v[lr]=v[dr]=!0,v[S]=v[w]=v[Fe]=v[O]=v[Me]=v[k]=v[L]=v[D]=v[h]=v[p]=v[b]=v[Le]=v[se]=v[Te]=v[Pe]=!1;var vr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nt=typeof $=="object"&&$&&$.Object===Object&&$,wr=typeof self=="object"&&self&&self.Object===Object&&self,ke=nt||wr||Function("return this")(),st=e&&!e.nodeType&&e,te=st&&!0&&l&&!l.nodeType&&l,ot=te&&te.exports===st,qe=ot&&nt.process,at=(function(){try{var r=te&&te.require&&te.require("util").types;return r||qe&&qe.binding&&qe.binding("util")}catch(n){}})(),ct=at&&at.isTypedArray;function lt(r,n,o){switch(o.length){case 0:return r.call(n);case 1:return r.call(n,o[0]);case 2:return r.call(n,o[0],o[1]);case 3:return r.call(n,o[0],o[1],o[2])}return r.apply(n,o)}function Sr(r,n){for(var o=-1,f=r==null?0:r.length;++o<f&&n(r[o],o,r)!==!1;);return r}function dt(r,n){for(var o=-1,f=r==null?0:r.length,m=Array(f);++o<f;)m[o]=n(r[o],o,r);return m}function Ar(r,n){for(var o=-1,f=Array(r);++o<r;)f[o]=n(o);return f}function Er(r){return function(n){return r(n)}}function _r(r,n){return dt(n,function(o){return r[o]})}function Lr(r){return"\\"+vr[r]}function Tr(r,n){return r==null?void 0:r[n]}function ut(r,n){return function(o){return r(n(o))}}var Cr=Function.prototype,re=Object.prototype,je=ke["__core-js_shared__"],ae=Cr.toString,N=re.hasOwnProperty,ht=(function(){var r=
1/[^.]+$/.exec(je&&je.keys&&je.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})(),pt=re.toString,Ir=ae.call(Object),Pr=RegExp("^"+ae.call(N).replace(fr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ft=ot?ke.Buffer:void 0,ce=ke.Symbol,Fr=ut(Object.getPrototypeOf,Object),Mr=re.propertyIsEnumerable,K=ce?ce.toStringTag:void 0,le=(function(){try{var r=Ur(Object,"defineProperty");return r({},"",{}),r}catch(n){}})(),Or=ft?ft.isBuffer:void 0,kr=ut(Object.keys,Object),gt=Math.max,qr=Date.now,mt=ce?ce.prototype:void 0,yt=mt?mt.toString:void 0;function jr(r,n){var o=Lt(r),f=!o&&Yr(r),m=!o&&!f&&Qr(r),E=!o&&!f&&!m&&ri(r),F=o||f||m||E,_=F?Ar(r.length,String):[],R=_.length;for(var M in r)N.call(r,M)&&!(F&&(M=="length"||m&&(M=="offset"||M=="parent")||E&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||Et(M,R)))&&_.push(M);return _}function Nr(r,n,o){var f=r[n];(!(N.call(r,n)&&Ne(f,o))||o===void 0&&!(n in r))&&bt(r,n,o)}function bt(r,n,o){n=="__proto__"&&le?le(r,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[n]=o}function z(r){return r==null?r===void 0?Ie:A:K&&K in Object(r)?Hr(r):Vr(r)}function vt(r){return J(r)&&z(r)==S}function Rr(r){if(!Re(r)||Kr(r))return!1;var n=It(r)?Pr:mr;return n.test(Xr(r))}function Dr(r){return J(r)&&Pt(r.length)&&!!v[z(r)]}function $r(r){if(!Gr(r))return kr(r);var n=[];for(var o in Object(r))N.call(r,o)&&o!="constructor"&&n.push(o);return n}function wt(r,n){return zr(Zr(r,n,Ot),r+"")}var Br=le?function(r,n){return le(r,"toString",{configurable:!0,enumerable:!1,value:oi(n),writable:!0})}:Ot;function St(r){if(typeof r=="string")return r;if(Lt(r))return dt(r,St)+"";if(ti(r))return yt?yt.call(r):"";var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}function xr(r,n,o,f){var m=!o;o||(o={});for(var E=-1,F=n.length;++E<F;){var _=n[E],R=f?f(o[_],r[_],_,o,r):void 0;R===void 0&&(R=r[_]),m?bt(o,_,R):Nr(o,_,R)}return o}function Wr(r){return wt(function(n,o){var f=-1,m=o.length,E=m>1?o[m-1]:void 0,F=m>2?o[2]:void 0;for(E=r.length>3&&typeof E=="function"?(m--,E):void 0,F&&_t(o[0],o[1],F)&&(E=m<3?void 0:E,m=1),n=Object(n);++f<m;){var _=o[f];_&&r(n,_,f,E)}return n})}function At(r,n,o,f){return r===void 0||Ne(r,re[o])&&!N.call(f,o)?n:r}function Ur(r,n){var o=Tr(r,n);return Rr(o)?o:void 0}function Hr(r){var n=N.call(r,K),o=r[K];try{r[K]=void 0;var f=!0}catch(E){}var m=pt.call(r);return f&&(n?r[K]=o:delete r[K]),m}function Et(r,n){var o=typeof r;return n=n==null?y:n,!!n&&(o=="number"||o!="symbol"&&yr.test(r))&&r>-1&&r%1==0&&r<n}function _t(r,n,o){if(!Re(o))return!1;var f=typeof n;return(f=="number"?Tt(o)&&Et(n,o.length):f=="string"&&n in o)?Ne(o[n],r):!1}function Kr(r){return!!ht&&ht in r}function Gr(r){var n=r&&r.constructor,o=typeof n=="function"&&n.prototype||re;return r===o}function Vr(r){return pt.call(r)}function Zr(r,n,o){return n=gt(n===void 0?r.length-1:n,0),function(){for(var f=arguments,m=-1,E=gt(f.length-n,0),F=Array(E);++m<E;)F[m]=f[n+m];m=-1;for(var _=Array(n+1);++m<n;)_[m]=f[m];return _[n]=o(F),lt(r,this,_)}}var zr=Jr(Br);function Jr(r){var n=0,o=0;return function(){var f=qr(),m=g-(f-o);if(o=f,m>0){if(++n>=c)return arguments[0]}else n=0;return r.apply(void 0,arguments)}}function Xr(r){if(r!=null){try{return ae.call(r)}catch(n){}try{return r+""}catch(n){}}return""}function Ne(r,n){return r===n||r!==r&&n!==n}var Yr=vt((function(){return arguments})())?vt:function(r){return J(r)&&N.call(r,"callee")&&!Mr.call(r,"callee")},Lt=Array.isArray;function Tt(r){return r!=null&&Pt(r.length)&&!It(r)}var Qr=Or||ai;function Ct(r){if(!J(r))return!1;var n=z(r);return n==L||n==q||typeof r.message=="string"&&typeof r.name=="string"&&!ei(r)}function It(r){if(!Re(r))return!1;var n=z(r);return n==D||n==d||n==C||n==H}function Pt(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=y}function Re(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}function J(r){return r!=null&&typeof r=="object"}function ei(r){if(!J(r)||z(r)!=b)return!1;var n=Fr(r);if(n===null)return!0;var o=N.call(n,"constructor")&&n.constructor;return typeof o=="function"&&o instanceof o&&ae.call(o)==Ir}function ti(r){return typeof r=="symbol"||J(r)&&z(r)==Ce}var ri=ct?Er(ct):Dr;function ii(r){return r==null?"":St(r)}var Ft=Wr(function(r,n,o,f){xr(n,Mt(n),r,f)});function Mt(r){return Tt(r)?jr(r):$r(r)}function ni(r,n,o){var f=i.imports._.templateSettings||i;o&&_t(r,n,o)&&(n=void 0),r=ii(r),n=Ft({},n,f,At);var m=Ft({},n.imports,f.imports,At),E=Mt(m),F=_r(m,E);Sr(E,function(he){if(it.test(he))throw new Error(a)});var _,R,M=0,kt=n.interpolate||oe,I="__p += '",ci=RegExp((n.escape||oe).source+"|"+kt.source+"|"+(kt===t?gr:oe).source+"|"+(n.evaluate||oe).source+"|$","g"),li=N.call(n,"sourceURL")?"//# sourceURL="+(n.sourceURL+"").replace(/\s/g," ")+"\n":"";r.replace(ci,function(he,qt,pe,di,jt,Nt){return pe||(pe=di),I+=r.slice(M,Nt).replace(br,Lr),qt&&(_=!0,I+="' +\n__e("+qt+") +\n'"),jt&&(R=!0,I+="';\n"+jt+";\n__p += '"),pe&&(I+="' +\n((__t = ("+pe+")) == null ? '' : __t) +\n'"),M=Nt+he.length,he}),I+="';\n";var de=N.call(n,"variable")&&n.variable;if(!de)I="with (obj) {\n"+I+"\n}\n";else if(it.test(de))throw new Error(s);I=(R?I.replace(ur,""):I).replace(hr,"$1").replace(pr,"$1;"),I="function("+(de||"obj")+") {\n"+(de?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(_?", __e = _.escape":"")+(R?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";
1\n")+I+"return __p\n}";var ue=si(function(){return Function(E,li+"return "+I).apply(void 0,F)});if(ue.source=I,Ct(ue))throw ue;return ue}var si=wt(function(r,n){try{return lt(r,void 0,n)}catch(o){return Ct(o)?o:new Error(o)}});function oi(r){return function(){return r}}function Ot(r){return r}function ai(){return!1}l.exports=ni})(ee,ee.exports)),ee.exports}var ir=rr();const nr=He(ir),Ee={MODAL:"modal",INLINE:"inline"};class sr{constructor({addressFormContainer:e,wrapper:t,selectionCallback:i}){if(this.addressFormContainer=e,this.selectionCallback=i,this.locationFinderWrapper=t,this.behavior=this.locationFinderWrapper.getAttribute("data-behavior"),!Object.values(Ee).includes(this.behavior))throw new Error("Invalid location finder behaviour given");if(this.element=this.locationFinderWrapper.querySelector(".pickware-dhl-location-finder"),this.dsgvoConfirmationWindow=this.locationFinderWrapper.querySelector(".pickware-dhl-dsgvo-confirmation-window"),this.dsgvoConfirmationWindow&&(this.dsgvoConfirmationButton=this.dsgvoConfirmationWindow.querySelector(".pickware-dhl-dsgvo-confirmation-window__accept-button")),!this.element||!this.dsgvoConfirmationWindow||!this.dsgvoConfirmationButton){this.isReadyToUse=!1;return}this.userHasConfirmedDsgvo=!1,this.apiKey=this.element.getAttribute("data-google-maps-api-key"),this.googleMapsZoomThreshold=parseInt(this.element.getAttribute("data-google-maps-zoom-threshold"),10),this.mapIconElement=this.element.querySelector(".pickware-dhl-location-finder-map-icons"),this.mapErrorsElement=this.element.querySelector(".pickware-dhl-location-finder-map-errors"),this.suspendMapRefreshing=!1}
1async init(){!this.isGoogleMapsApiKeyConfigured()||!await this.checkDsgvoConfirmation()||(this.client=new De,this.getLocationFinderFormSubmitButton().addEventListener("click",this.refreshMap.bind(this,{addressTypeConfiguration:void 0,useCoordinates:!1})),await this.initialiseMap(),this.isReadyToUse=!0,this.element.dispatchEvent(new Event("pickwareDhlLocationFinderReady")),this.hideNode(this.dsgvoConfirmationWindow))}async initialiseMap(){this.loader=new U({apiKey:this.apiKey,version:"weekly"}),this.google=await this.loader.load(),this.map=new this.google.maps.Map(this.getLocationFinderMap(),{zoom:6,center:{lat:51.16591,lng:10.451526}}),this.openInfoWindows=[],this.errorInfoWindow=new this.google.maps.InfoWindow;const e=this.getPanToGeolocationButton();this.map.controls[this.google.maps.ControlPosition.TOP_CENTER].push(e),e.addEventListener("click",this.handlePanToGeolocation.bind(this,e));const t=this.refreshMapIfAllowed.bind(this);this.google.maps.event.addListener(this.map,"dragend",t),this.google.maps.event.addListener(this.map,"zoom_changed",t)}handlePanToGeolocation(e){navigator.geolocation?navigator.geolocation.getCurrentPosition(t=>{const i={lat:t.coords.latitude,lng:t.coords.longitude};this.map.setCenter(i),this.refreshMap({addressTypeConfiguration:void 0,useCoordinates:!0})},()=>{this.handleMapsError({errorKey:"geolocation-failed",position:this.map.getCenter()}),e.disabled=!0}):(this.handleMapsError({errorKey:"no-browser-geolocation",position:this.map.getCenter()}),e.disabled=!0)}refreshMapIfAllowed(){this.map.getZoom()<=this.googleMapsZoomThreshold&&!this.suspendMapRefreshing&&this.refreshMap({addressTypeConfiguration:void 0,useCoordinates:!0})}async refreshMap({addressTypeConfiguration:e,useCoordinates:t=!1}){if(!this.isGoogleMapsApiKeyConfigured())return;this.showNode(this.getLoadingSpinner());const i=new URLSearchParams(this.getRequestData({addressTypeConfiguration:e,useCoordinates:t}));this.client.abort(),this.client.get("".concat(this.getLocationFinderForm().getAttribute("data-action"),"?").concat(i.toString()),this.renderLocationMarkers.bind(this,t))}getRequestData({addressTypeConfiguration:e,useCoordinates:t}){const i={},s=this.getLocationFinderZipcodeInput();if(s.value&&s.value!==""&&(i.zipcode=s.value),t&&(i.latitude=this.map.getCenter().lat(),i.longitude=this.map.getCenter().lng(),i.radiusInMeters=this.getShownRadiusInMetersFromMapsZoomLevel(this.map.getZoom())),e)i.allowedLocationType=e.key;else{const a=W.find(c=>{const g=this.addressFormContainer.querySelector(".pickware-dhl-radio-button-".concat(c.key));return g&&g.checked&&c.isDhlSpecificAddressType});a&&(i.allowedLocationType=a.key)}return i}getShownRadiusInMetersFromMapsZoomLevel(e){return 4e4/2**e*1e3}renderLocationMarkers(e,t,i){if(i.status!==200){this.hideNode(this.getLoadingSpinner());return}let s;try{s=JSON.parse(t)}catch(c){this.hideNode(this.getLoadingSpinner());return}if(this.clearMarkers(),s.length===0){this.hideNode(this.getLoadingSpinner());return}const a=new this.google.maps.LatLngBounds;s.forEach(c=>{const g=this.createMarkerForLocation(c);this.markers.push(g),a.extend(g.getPosition())}),e||(this.suspendMapRefreshing=!0,this.map.fitBounds(a),this.map.getZoom()&&this.map.getZoom()>this.googleMapsZoomThreshold&&this.map.setZoom(this.googleMapsZoomThreshold),this.suspendMapRefreshing=!1),this.hideNode(this.getLoadingSpinner())}createMarkerForLocation(e){const t=new this.google.maps.Marker({position:{lat:e.place.geo.latitude,lng:e.place.geo.longitude},map:this.map,icon:this.getIconFromLocationType({locationType:e.type}),title:e.title}),i=new this.google.maps.InfoWindow({content:this.createInfoPopup({location:e,marker:t}),maxWidth:300});return t.addListener("click",()=>{this.closeAllOpenInfoBoxes(),i.open(this.map,t),this.openInfoWindows=[i]}),t}createInfoPopup({location:e,marker:t}){const i=this.getInfoPopupTemplate()({title:e.title,address:this.getAddressFromLocation(e)}),s=new DOMParser().parseFromString(i,"text/html").body.firstChild,a=".pickware-dhl-location-finder-info-popup-icons__".concat(e.type);s.querySelectorAll(".pickware-dhl-location-finder-info-popup-icons > img.icon").forEach(y=>this.hideNode(y)),this.showNode(s.querySelector(a));const c=s.querySelector(".pickware-dhl-location-finder-info-popup-submit-button");return c.addEventListener("click",()=>{this.selectionCallback({addressType:e.type,number:e.number,zipcode:e.place.address.postalCode,city:e.place.address.addressLocality}),this.markLocationAsSelected({locationType:e.type,button:c,marker:t})}),this.getAddressFormSpecialNumberInput(e.type).value===e.number?this.markLocationAsSelected({locationType:e.type,button:c,marker:t}):this.hideNode(c.querySelector(".pickware-dhl-location-finder-info-popup-submit-button__selected-message")),e.serviceTypes.forEac
1h(y=>{ze[y]&&this.showNode(s.querySelector(".pickware-dhl-location-finder-info-popup-icons__".concat(ze[y].icon)))}),s.querySelectorAll(".pickware-dhl-location-finder-info-popup-opening-hours__day").forEach(y=>{const S=e.openingHoursByDay[y.getAttribute("data-value")];S&&(y.innerHTML=S.map(w=>"".concat(w.opens.substring(0,5)," - ").concat(w.closes.substring(0,5))).join(", "))}),s}getAddressFromLocation(e){return"".concat(e.name,"<br/>").concat(e.place.address.streetAddress,"<br/>").concat(e.place.address.postalCode," ").concat(e.place.address.addressLocality)}clearMarkers(){this.markers=this.markers||[],this.markers.forEach(e=>{e.setMap(null)}),this.markers=[]}markLocationAsSelected({locationType:e,button:t,marker:i}){this.currentlySelectedLocationMarker&&(this.currentlySelectedLocationMarker.button.classList.remove("btn-success"),this.showNode(this.currentlySelectedLocationMarker.button.querySelector(".pickware-dhl-location-finder-info-popup-submit-button__select-message")),this.hideNode(this.currentlySelectedLocationMarker.button.querySelector(".pickware-dhl-location-finder-info-popup-submit-button__selected-message")),this.currentlySelectedLocationMarker.marker.setIcon(this.getIconFromLocationType({locationType:e}))),t.classList.add("btn-success"),this.hideNode(t.querySelector(".pickware-dhl-location-finder-info-popup-submit-button__select-message")),this.showNode(t.querySelector(".pickware-dhl-location-finder-info-popup-submit-button__selected-message")),this.currentlySelectedLocationMarker={button:t,marker:i},i.setIcon(this.getIconFromLocationType({locationType:e,selected:!0}))}getIconFromLocationType({locationType:e,selected:t=!1}){return{url:this.mapIconElement.getAttribute("data-".concat(e).concat(t?"-selected":"")),scaledSize:new this.google.maps.Size(30,30)}}async checkDsgvoConfirmation(){const e=this;return new Promise(t=>{function i(){e.dsgvoConfirmationButton.removeEventListener("click",i),e.userHasConfirmedDsgvo=!0,t(!0)}e.dsgvoConfirmationButton.addEventListener("click",i)})}handleMapsError({errorKey:e,position:t}){this.errorInfoWindow.setPosition(t),this.errorInfoWindow.setContent(this.getMapErrorElement(e).innerHTML),this.errorInfoWindow.open(this.map)}isGoogleMapsApiKeyConfigured(){return this.apiKey&&this.apiKey!==""}closeAllOpenInfoBoxes(){this.openInfoWindows.forEach(e=>e.close())}getLocationFinderForm(){return this.element.querySelector(".pickware-dhl-location-finder-form")}getLocationFinderMap(){return this.element.querySelector(".pickware-dhl-location-finder__map")}getMapErrorElement(e){return this.mapErrorsElement.querySelector(".pickware-dhl-location-finder-map-errors__".concat(e))}getPanToGeolocationButton(){return this.element.querySelector(".pickware-dhl-location-finder__pan-to-location-button")}getLocationFinderFormSubmitButton(){return this.element.querySelector(".pickware-dhl-location-finder-form__submit-button")}getLocationFinderZipcodeInput(){return this.element.querySelector(".pickware-dhl-location-finder-form__zipcode-input")}getLoadingSpinner(){return this.element.querySelector(".pickware-dhl-location-finder-form__loading-spinner")}getAddressFormSpecialNumberInput(e){return this.addressFormContainer.querySelector(".pickware-dhl-".concat(e,"-number"))}getInfoPopupTemplate(){return nr(this.element.querySelector(".pickware-dhl-location-finder-info-popup-template").innerHTML)}hideNode(e){e&&e.classList.add("d-none")}showNode(e){e&&e.classList.remove("d-none")}}class or extends ve{init(){this.container=this.el.closest(".pickware-dhl-component-address-form-container"),this.container&&(Ze(),this.initialiseLocationFinder(),this.addressFormSwitcher=new zt(this.container),this.initialiseSpecialAddressForms(),this.selectInitialAddressType(),this.addChangeListenerToRadioButtons())}initialiseLocationFinder(){this.locationFinderWrapper=this.el.closest(".pickware-dhl-location-finder-wrapper"),this.locationFinderWrapper&&(this.locationFinder=new sr({addressFormContainer:this.container,wrapper:this.locationFinderWrapper,selectionCallback:this.applyLocationFinderSelection.bind(this)}),this.locationFinder.element&&(this.locationFinder.init(),this.locationFinder.element.addEventListener("pickwareDhlLocationFinderReady",()=>{this.currentAddressConfiguration&&this.currentAddressConfiguration.isDhlSpecificAddressType&&this.showLocationFinder(this.currentAddressConfiguration),this.getLocationFinderSelectOnMapButton().removeEventListener("click",this.scrollNodeIntoView.bind(this,this.locationFinder.dsgvoConfirmationWindow)),this.getLocationFinderSelectOnMapButton().addEventListener("click",this.scrollNodeIntoView.bind(this,this.locationFinder.element))}),this.locationFinder.behavior===Ee.INLINE&&this.getLocationFinderSelectOnMapButton().addEventListener("click",this.scrollNodeIntoView.bind(this,this.locationFinder.dsgvoConfirmationWindow))))}initialiseSpecialAddressForms(){W.filter(e=>
1e.isDhlSpecificAddressType).forEach(e=>{const t=this.container.querySelector(".pickware-dhl-".concat(e.key,"-street")),i=this.container.querySelector(".pickware-dhl-".concat(e.key,"-number")),s=this.container.querySelector(".pickware-dhl-".concat(e.key,"-zipcode"));!t||!i||(this.setInitialSpecialAddressNumberValue(e,t,i),this.addChangeListenerToSpecialAddressNumberField(e,t,i),this.locationFinder&&s.addEventListener("change",()=>{this.locationFinder.getLocationFinderZipcodeInput().value=s.value}),this.setHiddenSpecialAddressValues(e))})}setInitialSpecialAddressNumberValue(e,t,i){const s="".concat(e.streetValuePrefix," (.*)"),c=new RegExp(s,"g").exec(t.value);if(!c||c.length<1){i.value="";return}i.value=c[1]}addChangeListenerToSpecialAddressNumberField(e,t,i){i.addEventListener("change",()=>{t.value="".concat(e.streetValuePrefix," ").concat(i.value)})}setHiddenSpecialAddressValues(e){const t=".pickware-dhl-".concat(e.key,"-country"),i=this.container.querySelector(t),s=this.container.querySelector("".concat(t,' option[iso="DE"]'));i&&s&&(i.value=s.getAttribute("value"))}selectInitialAddressType(){const e=this.container.querySelector(".pickware-dhl-packstation-street");if(!e)return;const t=W.find(c=>e.value&&e.value.startsWith(c.streetValuePrefix)),i=W.find(c=>!c.isDhlSpecificAddressType),s=t||i,a=this.container.querySelector(".pickware-dhl-radio-button-".concat(s.key));a&&(a.checked="checked",this.selectAddressType(s.key))}addChangeListenerToRadioButtons(){this.container.querySelectorAll('input[type="radio"]').forEach(t=>{t.addEventListener("change",()=>this.selectAddressType(t.value))})}selectAddressType(e){const t=W.find(i=>i.key===e);if(this.addressFormSwitcher.showAddressForm(t),this.currentAddressConfiguration=t,t.isDhlSpecificAddressType&&this.locationFinder){this.locationFinder.dsgvoConfirmationWindow&&!this.locationFinder.userHasConfirmedDsgvo&&this.locationFinder.isGoogleMapsApiKeyConfigured()&&(this.showNode(this.getLocationFinderSelectOnMapButton()),this.showNode(this.locationFinder.dsgvoConfirmationWindow));const i=this.container.querySelector(".pickware-dhl-".concat(t.key,"-zipcode"));this.locationFinder.getLocationFinderZipcodeInput().value=i.value,this.locationFinder.isReadyToUse&&this.showLocationFinder(t)}else this.locationFinder&&(this.locationFinder.dsgvoConfirmationWindow&&this.hideNode(this.locationFinder.dsgvoConfirmationWindow),this.hideLocationFinder())}applyLocationFinderSelection({addressType:e,number:t,zipcode:i,city:s}){var y;const a=this.container.querySelector(".pickware-dhl-".concat(e,"-number")),c=this.container.querySelector(".pickware-dhl-".concat(e,"-city")),g=this.container.querySelector(".pickware-dhl-".concat(e,"-zipcode"));a.value=t,a.dispatchEvent(new Event("change")),g.value=i,c.value=s,a.dispatchEvent(new Event("input")),g.dispatchEvent(new Event("input")),c.dispatchEvent(new Event("input")),this.locationFinder.behavior===Ee.INLINE?this.scrollNodeIntoView(this.locationFinderWrapper):(y=window.bootstrap.Modal.getInstance(this.getLocationFinderModal()))==null||y.hide()}getLocationFinderSelectOnMapButton(){return this.locationFinderWrapper.querySelector(".pickware-dhl-location-finder__select-on-map-button")}getLocationFinderModal(){return this.locationFinderWrapper.querySelector(".pickware-dhl-location-finder-modal")}hideLocationFinder(){this.hideNode(this.locationFinder.element),this.hideNode(this.getLocationFinderSelectOnMapButton())}showLocationFinder(e){this.showNode(this.locationFinder.element),this.showNode(this.getLocationFinderSelectOnMapButton());const t=this.container.querySelector(".pickware-dhl-".concat(e.key,"-zipcode"));t.value&&t.value!==""&&this.locationFinder.refreshMap({addressTypeConfiguration:e})}hideNode(e){e&&e.classList.add("d-none")}showNode(e){e&&e.classList.remove("d-none")}scrollNodeIntoView(e){e&&e.scrollIntoView({behavior:"smooth"})}}class ar extends ve{init(){Ze(),this.getPreferredDaySelectionButtons().forEach(t=>{t.addEventListener("click",this.onPreferredDaySelectionButtonClicked.bind(this,t))});const e=this.getPreferredDayInput();e&&this.renderPreferredDaySelectionButtonsState(e.getAttribute("value")),this.getPreferredDeliveryForm().addEventListener("submit",this.onPreferredDeliveryFormSubmit.bind(this))}onPreferredDeliveryFormSubmit(e){if(this.getPreferredDeliveryForm().classList.add("was-validated"),this.getPreferredLocationInput().value&&this.getPreferredNeighbourInput().value){e.preventDefault(),e.stopPropagation(),this.getPreferredDeliveryNeighbourAndLocationAlert().removeAttribute("style");const t=this.getPreferredDeliveryNeighbourAndLocationAlert().querySelector(".alert-content");this.getPreferredLocationInput().setCustomValidity(t.innerHtml),this.getPreferredNeighbourInput().setCustomValidity(t.innerHtml)}else this.getPreferredDeliveryNeighbourAndLocationAlert().setAttribute("style","display: none"),this.getPreferredLocationInput().setCustomValidity(""),this.getPreferredNeighbourInput().setCustomValidity("")}onPreferredDaySelectionButtonClicked(e){const t=this.getPreferredDayInput();t.getAttribute("value")===e.getAttribute("data-value")?t.setAttribute("value",""):t.setAttribute("value",e.getAttribute("data-value")),this.renderPreferredDaySelectionButtonsState(t.getAttribute("value"))}renderPreferredDaySelectionButtonsState(e){this.getPreferredDaySelectionButtons().forEac
1h(t=>{t.getAttribute("data-value")===e?(t.classList.remove("btn-outline-primary"),t.classList.add("btn-primary")):(t.classList.remove("btn-primary"),t.classList.add("btn-outline-primary"))})}getPreferredDeliveryForm(){return document.querySelector("#pickware-dhl-preferred-delivery-form")}getPreferredDeliveryNeighbourAndLocationAlert(){return document.querySelector(".pickware-dhl-preferred-delivery__location-neighbour-alert")}getPreferredDaySelectionButtons(){return document.querySelectorAll(".pickware-dhl-preferred-day-selection__button")}getPreferredDayInput(){return document.querySelector("#pickware-dhl-preferred-day-input")}getPreferredLocationInput(){return document.querySelector("#pickware-dhl-preferred-location-input")}getPreferredNeighbourInput(){return document.querySelector("#pickware-dhl-preferred-neighbour-input")}}class cr extends ve{constructor(e,t={},i=!1){const s={editorModalClass:"pickware-storefront-pseudo-modal"};if(super(e,{...s,...t},i),this.options.url===void 0)throw new Error("A URL has to be supplied to the modal!")}init(){this.client=new De,this.el.addEventListener("click",this.prepareModal.bind(this))}prepareModal(e){e.preventDefault(),Ue.create();const t=this.getRequestData();this.client.abort(),this.client.post(this.options.url,JSON.stringify(t),i=>this.openModal(i))}getRequestData(){return{...this.options,url:void 0,editorModalClass:void 0}}openModal(e){const t=new Vt(e);Ue.remove(),t.open(this.onAfterModalOpened.bind(this)),t.getModal().classList.add(this.options.editorModalClass)}onAfterModalOpened(){window.PluginManager.initializePlugins()}}const _e=window.PluginManager;_e.register("PickwareDhlAddressFormPlugin",or,"[pickware-dhl-address-form]"),_e.register("PickwareDhlPreferredDeliveryPlugin",ar,"[data-pickware-dhl-preferred-delivery]"),_e.register("PickwareStorefrontPseudoModal",cr,"[data-pickware-storefront-pseudo-modal]")})();
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.