PageSourceSearch

https://www.pollin.at/theme/5bd9a148a665a42f1544782eb74680e9/js/tonur-packstation6/tonur-packstation6.js

js pollin.at collected 2026-10-09 23:02:12 UTC 75,606 bytes, 26 lines download raw bytes

1(()=>{"use strict";var e={156(e){var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function n(e,t,i){return e.concat(t).map(function(e){return s(e,i)})}function o(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function r(e,t){try{return t in e}catch(e){return!1}}function a(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=s;var c,d,h=Array.isArray(i);return h!==Array.isArray(e)?s(i,l):h?l.arrayMerge(e,i,l):(d={},(c=l).isMergeableObject(e)&&o(e).forEach(function(t){d[t]=s(e[t],c)}),o(i).forEach(function(t){(!r(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(r(e,t)&&c.isMergeableObject(i[t])?d[t]=(function(e,t){if(!t.customMerge)return a;var i=t.customMerge(e);return"function"==typeof i?i:a})(t,c)(e[t],i[t],c):d[t]=s(i[t],c))}),d)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return a(e,i,t)},{})},e.exports=a}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);class s{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,n=e.split("."),o=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=o;o=function(i){s.unsubscribe(e),t(i)}}return this.el.addEventListener(n[0],o),this.listeners.push({splitEventName:n,opts:i,cb:o}),!0}unsubscribe(e){arguments.length>1&&"function"==typeof arguments[1]&&console.warn(`[NativeEventEmitter] Unsubscribing by passing the subscriber function as a second argument is not supported. By default, all listeners for the event will be removed. Use a suffix (separated by a dot) on the event name when subscribing/unsubscribing to identify/target your specific listener only, e.g. "${e}.MyCustomPlugin"`);let t=e.split(".");return this.listeners=this.listeners.reduce((e,i)=>([...i.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),e),[]),!0}reset(){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 n{constructor(){if(void 0===this.loadMap)throw TypeError("Must override method loadMap");if(void 0===this.addLocations)throw TypeError("Must override method addLocations");if(void 0===this.clearMap)throw TypeError("Must override method clearMap")}isPackstation(e){return"P"===e.data_type}isPostoffice(e){return"F"===e.data_type}prepareLocations(e){let t=[];return e.forEach(e=>{if(null===e.location.keyword||""===e.location.keyword||null===e.location.keywordId||""===e.location.keywordId)return;let i=null;switch(e.location.type){case"postoffice":case"postbank":case"servicepoint":i="F";break;case"locker":i="P"}if(null===i)return;let s=`${e.location.keyword} ${e.location.keywordId}`.trim(),n={Monday:"http://schema.org/Monday",Tuesday:"http://schema.org/Tuesday",Wednesday:"http://schema.org/Wednesday",Thursday:"http://schema.org/Thursday",Friday:"http://schema.org/Friday",Saturday:"http://schema.org/Saturday",Sunday:"http://schema.org/Sunday"}
1[new Date().toLocaleString("en-US",{weekday:"long"})],o=e.openingHours.find(e=>e.dayOfWeek===n),r=null;void 0!==o&&(r=`${this.snippets.today}: ${o.opens.slice(0,-3)} - ${o.closes.slice(0,-3)} ${this.snippets.time}`);let a=e.location?.leanLocker===!0,l=`
2            ${e.name&&""!==e.name?`${e.name}<br/>`:""}
3            ${e.place.address.streetAddress}<br/>
4            ${e.place.address.postalCode} ${e.place.address.addressLocality}
5            ${r?`<br/>${r}`:""}
6            ${a?`<br/><strong>${this.snippets.appRequired}</strong>`:""}`.trim();t.push({location:e.place.geo,title:s,description:l,requireApp:a,data_type:i,data_number:e.location.keywordId,data_address:e.place.address})}),t}}class o{static addToHead(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((s,n)=>{let o=document.getElementsByTagName("head")[0],r=this.findExistingTag(e,t);if(r){this.waitForTag(r,e,i).then(s).catch(()=>{r.remove(),this.appendTag(o,e,t,i,s,n)});return}this.appendTag(o,e,t,i,s,n)})}static appendTag(e,t,i,s,n,o){let r=this.createTag(t,i);"script"===t&&(r.async=!0);let a=this.attachLoadHandlers(r,t,s,n,o);e.appendChild(r),"link"===t&&window.setTimeout(()=>{a(),n(r)},0)}static attachLoadHandlers(e,t,i,s,n){let o=null,r=()=>{o&&window.clearTimeout(o),e.removeEventListener("load",l),e.removeEventListener("error",c)},a=()=>{if("function"!=typeof i.isReady||i.isReady()){r(),s(e);return}this.waitUntilReady(i).then(()=>{r(),s(e)}).catch(e=>{r(),n(e)})},l=()=>a(),c=e=>{r(),n(e)};return e.addEventListener("load",l),e.addEventListener("error",c),"script"===t&&(o=window.setTimeout(()=>{a()},i.loadTimeout||5e3)),r}static waitForTag(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"function"==typeof i.isReady&&i.isReady()||"link"===t?Promise.resolve(e):this.waitUntilReady(i)}static waitUntilReady(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((t,i)=>{if("function"!=typeof e.isReady){t();return}let s=e.pollInterval||100,n=e.timeout||5e3,o=Date.now(),r=()=>{if(e.isReady()){t();return}if(Date.now()-o>=n){i(Error("Timed out while waiting for external asset readiness."));return}window.setTimeout(r,s)};r()})}static findExistingTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.src||t.href;if(!i)return null;let s=t.src?"src":"href",n=t.src?"data-cmp-src":"data-cmp-href",o=i.replace(/"/g,'\\"');return document.head.querySelector(`${e}[${s}="${o}"], ${e}[${n}="${o}"]`)}static createTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=document.createElement(e);return Object.assign(i,t),i}}class r{static getRepertusBingMapsKey(){return"AtjO-nXY_oay1yzbIiQJ9YOMrp6BzvkSM32ufBieSJc6NgBX8Y0lmWdHoX2xWeXD"}static isTestModeKey(e){return e===r.getRepertusBingMapsKey()}static handle(e){e===this.getRepertusBingMapsKey()?this.showOverlay():this.hideOverlay()}static showOverlay(){document.getElementById("packstationTestMode").classList.remove("is--hidden")}static hideOverlay(){document.getElementById("packstationTestMode").classList.add("is--hidden")}}class a extends n{constructor(e,t,i,n,o){super(),this.url="https://www.bing.com/maps/sdkrelease/mapcontrol",this.mapContainer=e,this.mapApiKey=t,this.snippets=i,this.id=n,this.emitter=new s,this.config=o}loadMap(){return this.isReady()?Promise.resolve(this.initMap()):new Promise((e,t)=>{o.addToHead("script",{src:this.url,type:"text/javascript"},{isReady:()=>this.isReady()}).then(()=>{if(!this.initMap()){let i=setInterval(()=>{this.initMap()&&(clearInterval(i),e(!0))},700);window.setTimeout(()=>{clearInterval(i),t(Error("Timed out while initializing Bing Map."))},5e3);return}e(!0)}).catch(e=>{console.error("An error occurred while loading script: "+this.url),console.error(e),t(e)})})}isReady(){return!!(window.Microsoft&&window.Microsoft.Maps)}initMap(){try{return this.map=new window.Microsoft.Maps.Map(this.mapContainer,{credentials:this.mapApiKey,enableSearchLogo:!1,enableClickableLogo:!1,showDashboard:!1,showMapTypeSelector:!1,showScalebar:!1,zoom:13}),this.addPushPinLegend(),r.handle(this.mapApiKey),!0}catch(e){return console.error("An error occurred initialing Bing Map."),console.error(e),!1}}addLocations(e){let t=!0,i=new window.Microsoft.Maps.Infobox(new window.Microsoft.Maps.Location(0,0),{visible:!1,offset:new window.Microsoft.Maps.Point(10,20),height:110,width:250,showCloseButton:!0,zIndex:99,actions:[{label:this.snippets.select_packstation,eventHandler:()=>{this._selectLocation(this.target)}}]});this.map.entities.clear();let s={};
6e.forEach(e=>{s=this.setColorConfig(e,s);let n=new window.Microsoft.Maps.Pushpin(new window.Microsoft.Maps.Location(e.location.latitude,e.location.longitude),s);window.Microsoft.Maps.Events.addHandler(n,"click",()=>{this.map.setView({center:n.getLocation()})}),t&&(t=!1,this.map.setView({center:new window.Microsoft.Maps.Location(e.location.latitude,e.location.longitude)})),n.title=e.title,n.description=e.description,n.data_number=e.data_number,n.data_address=e.data_address,n.data_type=e.data_type,this.map.entities.push(n);let o=function(e){if("pushpin"===e.targetType){let t=e.target.getLocation();this.target=e.target,i.setLocation(t),i.setOptions({visible:!0,title:this.target.title,description:this.target.description})}};window.Microsoft.Maps.Events.addHandler(n,"click",o),window.Microsoft.Maps.Events.addHandler(n,"mouseover",o)}),i.setMap(this.map)}clearMap(){this.map.entities.clear()}_selectLocation(e){this.emitter.publish("TonurPackstation_selectLocation-"+this.id,{address:e.data_address,type:e.data_type,number:e.data_number})}setColorConfig(e,t){if(void 0===this.config||!this.config||void 0===this.config.color||!this.config.color)return delete t.color,t;let i=null;return this.isPackstation(e)&&this.config.color.packstation?i=this.config.color.packstation:this.isPostoffice(e)&&this.config.color.postoffice&&(i=this.config.color.postoffice),t.color=i,t}addPushPinLegend(){if(void 0===this.config||null===this.config.shopPushPinLegend||!this.config.shopPushPinLegend)return;let e="";this.config.color.packstation&&(e+='<li><span style="background-color:'+this.config.color.packstation+';"></span>Packstation</li>'),this.config.color.postoffice&&(e+='<li><span style="background-color:'+this.config.color.postoffice+';"></span>Postfiliale</li>'),document.getElementById("packstationLegend").innerHTML='<ul class="legend-labels">'+e+"</ul>"}}class l extends n{static #e=this.instanceCounter=0;constructor(e,t,i,n,o){super(),this.url="https://unpkg.com/[email protected]/dist/leaflet.js",this.mapContainer=e,this.mapApiKey=t,this.snippets=i,this.id=n,this.instanceId=++this.constructor.instanceCounter,this.emitter=new s,this.config=o}loadMap(){return this.isReady()?Promise.resolve(this.initMap()):new Promise((e,t)=>{o.addToHead("link",{rel:"stylesheet",href:"https://unpkg.com/[email protected]/dist/leaflet.css"}).catch(e=>{console.error("An error occurred while loading stylesheet: https://unpkg.com/[email protected]/dist/leaflet.css"),console.error(e),t(e)}),o.addToHead("script",{src:this.url},{isReady:()=>this.isReady()}).then(()=>{if(!this.initMap()){let i=setInterval(()=>{this.initMap()&&(clearInterval(i),e(!0))},700);window.setTimeout(()=>{clearInterval(i),t(Error("Timed out while initializing Open Street Map."))},5e3);return}e(!0)}).catch(e=>{console.error("An error occurred while loading script: "+this.url),console.error(e),t(e)})})}isReady(){return void 0!==window.L}initMap(){try{return this.map=L.map(this.mapContainer).setView([51,9],13),this.tileLayer=this._createTileLayer(),this._registerTileDebugHandlers(),this._scheduleTileVisibilityRecovery(),this.map.zoomControl.setPosition("topright"),window.setTimeout(()=>{this.map&&this.map.invalidateSize()},150),this.addPushPinLegend(),!0}catch(e){return console.error("An error occurred initialing Open Street Map."),console.error(e),!1}}_createTileLayer(){return L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'}).addTo(this.map)}_registerTileDebugHandlers(){this.tileLayer&&(this.tileLayer.on("tileloadstart",e=>{this._bindTileVisibilityRecovery(e.tile)}),this.tileLayer.on("tileload",e=>{this._forceVisibleTile(e.tile)}))}_getMapNode(){return"string"==typeof this.mapContainer?document.getElementById(this.mapContainer.replace("#","")):this.mapContainer}_scheduleTileVisibilityRecovery(){[50,150,400,1e3].forEach(e=>{window.setTimeout(()=>{this._recoverVisibleTiles()},e)}),window.addEventListener("CookiebotOnAccept",()=>{this._recoverVisibleTiles()},{once:!0}),window.addEventListener("CookiebotOnTagsExecuted",()=>{this._recoverVisibleTiles()},{once:!0})}_recoverVisibleTiles(){let e=this._getMapNode();
6e&&e.querySelectorAll(".leaflet-tile").forEach(e=>{this._bindTileVisibilityRecovery(e),this._forceVisibleTile(e)})}_bindTileVisibilityRecovery(e){e&&"true"!==e.dataset.tonurTileRecoveryBound&&(e.dataset.tonurTileRecoveryBound="true",e.addEventListener("load",()=>this._forceVisibleTile(e),{once:!0}))}_forceVisibleTile(e){e&&e.complete&&0!==e.naturalWidth&&(e.classList.add("leaflet-tile-loaded"),e.style.visibility="inherit")}addLocations(e){this.clearMap();let t={},i={},s=[];e.forEach(e=>{t=this.setColorConfig(e,t),t=this.setIconConfig(e,t);let n=L.divIcon({className:"tonur-custom-pin",iconAnchor:[0,24],labelAnchor:[-6,0],popupAnchor:[0,-36],html:`<span style="${t.color?"background-color:"+t.color:""}">
7                             ${t.icon}
8                      </span>`});(i=L.marker([e.location.latitude,e.location.longitude],{icon:n,loc:e}).addTo(this.map)).bindPopup(`
9                  <h4>${e.title}</h4>
10                  ${e.description}<br/>
11                  <button id="tonur-packstation-select">${this.snippets.select_packstation}</button>
12            `),i.on("popupopen",e=>{e.popup._contentNode.querySelector("#tonur-packstation-select").addEventListener("click",()=>{this._selectLocation(e.target.options.loc)})}),s.push(i)});let n=L.featureGroup(s);this.map.fitBounds(n.getBounds())}clearMap(){this.map.eachLayer(e=>{e instanceof L.Marker&&e.remove()})}_selectLocation(e){this.emitter.publish("TonurPackstation_selectLocation-"+this.id,{address:e.data_address,type:e.data_type,number:e.data_number})}setColorConfig(e,t){if(void 0===this.config||!this.config||void 0===this.config.color||!this.config.color)return delete t.color,t;let i=null;return this.isPackstation(e)&&this.config.color.packstation?i=this.config.color.packstation:this.isPostoffice(e)&&this.config.color.postoffice&&(i=this.config.color.postoffice),t.color=i,t}setIconConfig(e,t){let i={packstation_lean_locker:{condition:this.isPackstation(e)&&e.requireApp,id:"dhl_icons_packstation_lean_locker",svg:`<svg id="dhl_icons_packstation_lean_locker" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
13                <path fill="${this.config.color.packstationIcon||"#d70511"}" d="M32,37H42v4H32ZM13.5,26a5.4967,5.4967,0,0,1-5.4747-5C8.01,20.835,8,20.6689,8,20.5A5.5015,5.5015,0,0,1,13.5,15c.1688,0,.3351.01.5.0254v-3c-.1664-.01-.3312-.0254-.5-.0254A8.51,8.51,0,0,0,5,20.5c0,.1687.0156.3335.0253.5H8v8H18V23.6553A5.4623,5.4623,0,0,1,13.5,26ZM32,35H42V31H32Zm0-6H42V19H32ZM18,13v4H44V13Zm2,16H30V19H20ZM8,41H18V37H8Zm0-6H18V31H8Zm12,6H30V37H20Zm0-6H30V31H20ZM13.5,10c.1688,0,.3331.0173.5.0254v-3C13.8327,7.019,13.6688,7,13.5,7A13.5155,13.5155,0,0,0,0,20.5c0,.1687-.0062.3328,0,.5H3s0-.3313,0-.5A10.512,10.512,0,0,1,13.5,10ZM11,20.5A2.5,2.5,0,1,0,13.5,18,2.5,2.5,0,0,0,11,20.5Z"/>
14            </svg>`},packstation:{condition:this.isPackstation(e),id:"dhl_icons_packstation",svg:`<svg id="dhl_icons_packstation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
15                <path fill="${this.config.color.packstationIcon||"#d70511"}" d="M7,39H17V35H7Zm24,0H41V35H31ZM19,39H29V35H19ZM7,33H17V29H7Zm24,0H41V29H31ZM19,15H29V33H19Zm2,12h6V17H21ZM7,27H17V15H7Zm24,0H41V15H31ZM43,9v4H5V9Z"/>
16            </svg>`},postoffice:{condition:this.isPostoffice(e),id:"dhl_icons_postoffice",svg:`<svg id="dhl_icons_postoffice" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
17                <path fill="${this.config.color.postofficeIcon||"#d70511"}" d="M41,44h-6v-19h-10v19h-2v-19h-10v19h-6v-28c0-.6.4-1,1-1h32c.6,0,1,.4,1,1v28ZM22.5,11.6h0l-1.4,1.4h1.3l1.4-1.4h-1.3ZM20.7,11.6h1.3l-1.4,1.4h-1.3l1.4-1.4h0ZM25.5,11.6h0l1.4,1.4h-1.3l-1.4-1.4h1.3ZM27.3,11.6h0l1.4,1.4h-1.3l-1.4-1.4h1.3ZM26.9,5.5c0,.8-.2,1.5-.4,2.3,0-1.5-1.2-2.8-2.8-2.8,0,0,0,0-.1,0-1.6,0-2.9,1.2-2.9,2.8,0,.2,0,.4,0,.6-.5-.8-.7-1.8-.5-2.7l-1,.3c-.2,2.3,1.2,5.4,4.7,5.4,2.9,0,5.3-2.3,5.4-5.2l-2.4-.6ZM23.6,9.8c-1.1,0-1.9-.9-1.9-1.9,0-1.1.9-1.9,1.9-1.9,1.1,0,1.9.9,1.9,1.9,0,1.1-.9,1.9-1.9,1.9h0Z"/>
18            </svg>`}};for(let e in i){let s=i[e];if(s.condition)return document.getElementById(s.id)?t.icon=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><use xlink:href="#${s.id}"/></svg>`:t.icon=s.svg,t}}addPushPinLegend(){if(void 0===this.config||null===this.config.shopPushPinLegend||!this.config.shopPushPinLegend
18)return;let e="";this.config.color.packstation&&(e+='<li><span style="background-color:'+this.config.color.packstation+';"></span>Packstation</li>'),this.config.color.postoffice&&(e+='<li><span style="background-color:'+this.config.color.postoffice+';"></span>Postfiliale</li>'),document.getElementById("packstationLegend").innerHTML='<ul class="legend-labels">'+e+"</ul>"}}let c="loader",d={BEFORE:"before",INNER:"inner"};class h{constructor(e,t=d.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===d.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=h.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),h.getTemplate())}}remove(){if(this.position===d.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${c}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${c}`).length>0}_getPosition(){return this.position===d.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${c}" role="status">
19                    <span class="visually-hidden">Loading...</span>
20                </div>`}static SELECTOR_CLASS(){return c}}let u="element-loader-backdrop";class p extends h{static create(e){e.classList.add("has-element-loader"),p.exists(e)||(p.appendLoader(e),setTimeout(()=>{let t=e.querySelector(`.${u}`);t&&t.classList.add("element-loader-backdrop-open")},1))}static remove(e){e.classList.remove("has-element-loader");let t=e.querySelector(`.${u}`);t&&t.remove()}static exists(e){return e.querySelectorAll(`.${u}`).length>0}static getTemplate(){return`
21        <div class="${u}">
22            <div class="loader" role="status">
23                <span class="visually-hidden">Loading...</span>
24            </div>
25        </div>
26        `}static appendLoader(e){e.insertAdjacentHTML("beforeend",p.getTemplate())}}class f{static v4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}}class m{static #e=this.adapterName="consentmanager";getName(){return this.constructor.adapterName}isAvailable(){return"function"==typeof window.__cmp}openPreferences(){if(this.isAvailable())try{return window.__cmp("showScreenAdvanced"),!0}catch{}return window.location.hash="cmpscreencustom",!1}hasConsent(e){let t=this._getConsentData(),i=e.type||"purpose",s=e.key||"";if(!s)return!1;switch(i){case"purpose":case"category":return!!(t.purposeConsents&&t.purposeConsents[s]);case"vendor":return!!(t.vendorConsents&&t.vendorConsents[s]);case"custom":return!!t&&!!s&&!!s.split(".").reduce((e,t)=>{if(e&&Object.prototype.hasOwnProperty.call(e,t))return e[t]},t);default:return!1}}subscribe(e,t){if(!this.isAvailable()||"function"!=typeof e)return()=>{};let i=["settings","consent","consentapproved","consentrejected","consentcustom"],s=()=>{e(this.hasConsent(t),{provider:this.getName(),target:t,source:this._getConsentData()})};return i.forEach(e=>{try{window.__cmp("addEventListener",[e,s,!1],null)}catch{return null}}),()=>{this.isAvailable()&&i.forEach(e=>{try{window.__cmp("removeEventListener",[e,s,!1],null)}catch{return null}})}}waitUntilReady(e){return Promise.resolve(this.hasConsent(e))}_getConsentData(){if(!this.isAvailable())return{};
26try{return window.__cmp("getCMPData")||{}}catch{return{}}}}let g={"packstation-map-osm":"preferences","packstation-map-bm":"preferences"};class v{static #e=this.adapterName="cookiebot";static #t=this.lastConsentEventTimestamp=0;static #i=this.lastTagsExecutedTimestamp=0;static #s=this.isTrackingInitialized=!1;constructor(){this._initTracking()}getName(){return this.constructor.adapterName}isAvailable(){return!!(window.Cookiebot||document.querySelector('script#Cookiebot, script[data-cbid], script[src*="cookiebot"]'))}openPreferences(){return window.Cookiebot&&"function"==typeof window.Cookiebot.renew?(window.Cookiebot.renew(),!0):!!window.Cookiebot&&"function"==typeof window.Cookiebot.show&&(window.Cookiebot.show(),!0)}hasConsent(e){let t=window.Cookiebot;if(!t)return!1;if("custom"===e.type){var i;return i=e.key,!!t&&!!i&&!!i.split(".").reduce((e,t)=>{if(e&&Object.prototype.hasOwnProperty.call(e,t))return e[t]},t)}let s=this._resolveCategoryKey(e);return!!s&&!!(t.consent&&t.consent[s])}subscribe(e,t){if(!this.isAvailable()||"function"!=typeof e)return()=>{};let i=["CookiebotOnConsentReady","CookiebotOnAccept","CookiebotOnDecline","CookiebotOnTagsExecuted"],s=()=>{e(this.hasConsent(t),{provider:this.getName(),target:t,source:window.Cookiebot||{}})};return i.forEach(e=>{window.addEventListener(e,s)}),()=>{i.forEach(e=>{window.removeEventListener(e,s)})}}waitUntilReady(e){return this.isAvailable()&&this.hasConsent(e)?this.constructor.lastTagsExecutedTimestamp>=this.constructor.lastConsentEventTimestamp?Promise.resolve(!0):new Promise(t=>{let i=()=>{s(),t(this.hasConsent(e))},s=()=>{window.removeEventListener("CookiebotOnTagsExecuted",i),window.clearTimeout(n)},n=window.setTimeout(i,150);window.addEventListener("CookiebotOnTagsExecuted",i,{once:!0})}):Promise.resolve(!1)}_resolveCategoryKey(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.key?Object.prototype.hasOwnProperty.call(g,e.key)?g[e.key]:["category","purpose"].includes(e.type)?e.key:null:null}_initTracking(){if(this.constructor.isTrackingInitialized||"undefined"==typeof window)return;let e=()=>{this.constructor.lastConsentEventTimestamp=Date.now()};window.addEventListener("CookiebotOnConsentReady",e),window.addEventListener("CookiebotOnAccept",e),window.addEventListener("CookiebotOnDecline",e),window.addEventListener("CookiebotOnTagsExecuted",()=>{this.constructor.lastTagsExecutedTimestamp=Date.now()}),this.constructor.isTrackingInitialized=!0}}class y{static #e=this.adapterName="noop";getName(){return this.constructor.adapterName}isAvailable(){return!0}openPreferences(){return!1}hasConsent(){return!1}subscribe(){return()=>{}}waitUntilReady(){return Promise.resolve(!1)}}class _{static isSupported(){return"undefined"!==document.cookie}static setItem(e,t,i){if(null==e)throw Error("You must specify a key to set a cookie");let s=new Date;s.setTime(s.getTime()+864e5*i);let n="";"https:"===location.protocol&&(n="secure"),document.cookie=`${e}=${t};expires=${s.toUTCString()};path=/;sameSite=lax;${n}`}static getItem(e){if(!e)return!1;let t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let s=i[e];for(;" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(t))return s.substring(t.length,s.length)}return!1}static removeItem(e){document.cookie=`${e}= ; expires = Thu, 01 Jan 1970 00:00:00 GMT;path=/`}static key(){return""}static clear(){}}let b="js-offcanvas-singleton",k=new WeakMap;class C{constructor(){this.$emitter=new s}open(e,t,i,s,n,o,r){this._removeExistingOffCanvas();let a=this._createOffCanvas(i,o,r,s);this.setContent(e,n),this._openOffcanvas(a,t)}setContent(e,t){let i=this.getOffCanvas();i[0]&&(i[0].innerHTML=e,this._registerEvents(t),this._setAriaAttrs())}setAdditionalClassName(e){this.getOffCanvas()[0].classList.add(e)}getOffCanvas(){return document.querySelectorAll(`.${b}`)}close(e){let t=this.getOffCanvas();t.forEach(e=>{bootstrap.Offcanvas.getInstance(e).hide()}),setTimeout(()=>{this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:t})},e)}goBackInHistory(){window.history.back()}exists(){return this.getOffCanvas().length>0}_openOffcanvas(e,t){window.focusHandler.saveFocusState("offcanvas"),this._disableBackgroun
26dAccessibility(e),window.focusHandler._addFocusTrapGuard(e),C.bsOffcanvas.show(),window.history.pushState("offcanvas-open",""),"function"==typeof t&&t()}_registerEvents(e){let t=this.getOffCanvas();t.forEach(i=>{let s=()=>{setTimeout(()=>{this._restoreBackgroundState(),i.remove(),window.focusHandler._removeFocusTrapGuard(),window.focusHandler.resumeFocusState("offcanvas"),this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:t})},e),i.removeEventListener("hide.bs.offcanvas",s)};i.addEventListener("hide.bs.offcanvas",s)}),window.addEventListener("popstate",this.close.bind(this,e),{once:!0}),document.querySelectorAll(".js-offcanvas-close").forEach(t=>{t.addEventListener("click",this.close.bind(this,e))})}_setAriaAttrs(){let e=this.getOffCanvas()[0],t="off-canvas-headline",i=e.querySelector(`[data-id="${t}"]`);i&&!e.hasAttribute("aria-labelledby")&&(i.setAttribute("id",t),e.setAttribute("aria-labelledby",t))}_disableBackgroundAccessibility(e){let t=[...document.body.children].filter(t=>t!==e).map(e=>({element:e,inert:e.inert,ariaHidden:e.getAttribute("aria-hidden")}));k.set(this,t),t.forEach(e=>{let{element:t}=e;t.inert=!0,t.setAttribute("aria-hidden","true")})}
26_restoreBackgroundState(){let e=k.get(this);e?.forEach(e=>{let{element:t,inert:i,ariaHidden:s}=e;if(t.inert=i,null===s){t.removeAttribute("aria-hidden");return}t.setAttribute("aria-hidden",s)}),k.delete(this)}_removeExistingOffCanvas(){this.getOffCanvas().forEach(e=>{let t=bootstrap.Offcanvas.getInstance(e);t&&"function"==typeof t.dispose&&t.dispose(),e.remove(),window.focusHandler._removeFocusTrapGuard()}),this._restoreBackgroundState(),C.bsOffcanvas=null}_getPositionClass(e){return"left"===e?"offcanvas-start":"right"===e?"offcanvas-end":`offcanvas-${e}`}_createOffCanvas(e,t,i,s){let n=document.createElement("div");if(n.classList.add("offcanvas",b),n.classList.add(this._getPositionClass(e)),n.setAttribute("tabindex","-1"),!0===t&&n.classList.add("is-fullwidth"),i){let e=typeof i;if("string"===e)n.classList.add(i);else if(Array.isArray(i))i.forEach(e=>{n.classList.add(e)});else throw Error(`The type "${e}" is not supported. Please pass an array or a string.`)}return document.body.appendChild(n),C.bsOffcanvas=new bootstrap.Offcanvas(n,{backdrop:!1!==s||"static"}),n}}let w=Object.freeze(new C);class T{static open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",s=!(arguments.length>3)||void 0===arguments[3]||arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";w.open(e,t,i,s,n,o,r)}static setContent(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:350;w.setContent(e,t,i)}static setAdditionalClassName(e){w.setAdditionalClassName(e)}static close(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;w.close(e)}static exists(){return w.exists()}static getOffCanvas(){return w.getOffCanvas()}static REMOVE_OFF_CANVAS_DELAY(){return 350}}class E extends T{static open(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left",n=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:T.REMOVE_OFF_CANVAS_DELAY(),r=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";if(!e)throw Error("A url must be given!");w._removeExistingOffCanvas();let l=w._createOffCanvas(s,r,a,n);this.setContent(e,t,i,n,o),w._openOffcanvas(l)}static setContent(e,t,i,s,n){super.setContent(`<div class="offcanvas-body">${h.getTemplate()}</div>`,n);let o=e=>{super.setContent(e,n),"function"==typeof i&&i(e)};t?fetch(e,{method:"POST",body:t instanceof FormData?t:JSON.stringify(t),headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(e=>E.executeCallback(o,e)):fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(e=>E.executeCallback(o,e))}static executeCallback(e,t){"function"==typeof e&&e(t);let i=T.getOffCanvas();i.length>0&&window.PluginManager.initializePluginsInParentElement(i[0])}}var P=i(156),$=i.n(P);class S{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){let i=S.toUpperCamelCase(e,t);return S.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>S.ucFirst(e.toLowerCase())).join(""):S.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class A{constructor(e,t={},i=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=e,this.$emitter=new s(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(t),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(){}destroy(){}
26_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),$().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=S.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=S.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-options`);if(i)try{return JSON.parse(i)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_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}}class M{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,i);return this._sendRequest(s,null,t)}post(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("POST",e,s);return this._sendRequest(n,t,i)}delete(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(n,t,i)}patch(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(n,t,i)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):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}}let O="CookieConfiguration_Update",N="CookieConfiguration_CloseOffCanvas";class F extends A{static #e=this.lastTriggerElement=null;static #t=this.options={defaultCookieExpiration:30,offCanvasPosition:"left",submitEvent:"click",cookiePreference:"cookie-preference",cookieConfigHash:"cookie-config-hash",cookieSelector:"[data-cookie]",buttonOpenSelector:".js-cookie-configuration-button button",buttonSubmitSelector:".js-offcanvas-cookie-submit",buttonPermissionSelector:".js-cookie-permission-button",buttonAcceptAllSelector:".js-offcanvas-cookie-accept-all",globalButtonAcceptAllSelector:".js-cookie-accept-all-button",globalButtonPermissionSelector:".js-cookie-permission-button",parentInputSelector:".offcanvas-cookie-parent-input",customLinkSelector:`[href="${window.router["frontend.cookie.offcanvas"]}"]`,entriesActiveClass:"offcanvas-cookie-entries--active",entriesClass:"offcanvas-cookie-entries",groupClass:"offcanvas-cookie-group",parentInputClass:"offcanvas-cookie-parent-input",consentAcceptButtonSelector:".js-wishlist-cookie-accept",consentLoginButtonSelector:".js-wishlist-login",consentCancelButtonSelector:".js-wishlist-cookie-offcanvas-cancel",consentPreferencesButtonSelector:".js-wishlist-cookie-preferences"};init(){this.lastState={active:[],inactive:[]},this._cleanupTasks=[],this._httpClient=new M,this._registerEvents(),this._checkCookieConfigurationHash(),document.$emitter.subscribe("CookieConfiguration/requestConsent",e=>{e instanceof CustomEvent&&(e=e.detail),this.openRequestConsentOffCanvas(e.route,e.cookieName)}),this._registerCleanup(()=>{document.$emitter.unsubscribe("CookieConfiguration/requestConsent")})}destroy(){if(this._cleanupTasks&&this._cleanupTasks.length>0){let e=this._cleanupTasks.slice();this._cleanupTasks=[];for(let t=0;t<e.length;t++)try{e[t]()}catch(e){}}}_getDefaultCookieExpiration(){let{defaultCookieExpiration:e}=this.options,t=Number(e);return Number.isInteger(t)&&t>0?t:30}_registerEvents(){if(this._delegatedEventHandler)return;let{submitEvent:e,buttonOpenSelector:t,customLinkSelector:i,buttonPermissionSelector:s,globalButtonAcceptAllSelector:n}=this.options;this._delegatedEventHandler=e=>{let o=e.target;if(o.closest(i)){this._handleCustomLink(e);return}if(o.closest(t)){this.openOffCanvas();return}if(o.closest(s)){this._handlePermission(e);return}if(o.closest(n)){this._acceptAllCookiesFromCookieBar(e);return}},document.addEventListener(e,this._delegatedEventHandler,!0),this._registerCleanup(()=>{document.removeEventListener(e,this._delegatedEventHandler,!0),this._delegatedEventHandler=null})}_registerOffCanvasEvents(){let e=this._getOffCanvas();e&&!e.hasAttribute("data-offcanvas-events-registered")&&(this._offCanvasDelegatedHandler||(this._offCanvasDelegatedHandler=this._handleOffCanvasClick.bind(this)),e.setAttribute("data-offcanvas-events-registered","true"),e.addEventListener("click",this._offCanvasDelegatedHandler,!0),this._registerCleanup(()=>{e.removeEventListener("click",this._offCanvasDelegatedHandler,!0),e.removeAttribute("data-offcanvas-events-registered"),this._offCanvasDelegatedHandler=null}))}_handleOffCanvasClick(e){let{buttonSubmitSelector:t,buttonAcceptAllSelector:i}=this.options,s=e.target;if(s.closest(t)){e.preventDefault(),this._handleSubmit(e);return}if(s.closest(i)){e.preventDefault(),this._acceptAllCookiesFromOffCanvas(e);return}if("checkbox"===s.type){this._handleCheckbox(e);return}}_handleCustomLink(e){0!==e.button||e.ctrlKey||e.metaKey||e.shiftKey||e.defaultPrevented||(e.preventDefault(),this.openOffCanvas())}async _fetchCookieGroups(){try{let e=window.router["frontend.cookie.groups"],t=await fetch(e,{method:"GET",headers:{"X-Requested-With":"XMLHttpRequest"}});return await t.json()}catch(e){return console.error("Failed to fetch cookie groups:",e),null}}async _checkCookieConfigurationHash(){let{cookiePreference:e,cookieConfigHash:t}=this.options,i=_.getItem(e),s=_.getItem(t);if(!i&&!s)return;let n=await this._fetchCookieGroups();if(!n)return;let o=n.hash,r=n.languageId,a=this._getStoredHashForLanguage(s,r);if(a&&a!==o){await this._resetCookieConfiguration(n);return}if(i&&!a){this._showCookieBar();return}a&&this._storeHashForLanguage(r,o,s)}_parseStoredHashes(e){if(!e)return{};try{let t=JSON.parse(e);if("object"==typeof t&&null!==t)return t}catch(e){}return{}}_getStoredHashForLanguage(e,t){return this._parseStoredHashes(e)[t]||null}_storeHashForLanguage(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,{cookieConfigHash:s}=this.options,n=i??_.getItem(s),o=this._parseStoredHashes(n);o[e]=t,_.setItem(s,JSON.stringify(o),this._getDefaultCookieExpiration())}async _resetCookieConfiguration(e){let t=e.elements||[],{activeCookieNames:i,inactiveCookieNames:s}=this._applyCookieConfiguration(t,"required",[],e.languageId);_.removeItem(this.options.cookiePreference);let n=i.filter(e=>e!==this.options.cookiePreference);this._handleUpdateListener(n,s),this._checkAndShowCookieBarIfNeeded()}_getTechnicallyRequiredCookieNames(){return["session-","timezone"]}async _handlePermission(e){e.preventDefault();let t=await this._fetchCookieGroups();if(!t)return;let i=t.elements,{activeCookieNames:s,inactiveCookieNames:n}=this._applyCookieConfiguration(i,"required",[],t.languageId);this._handleUpdateListener(s,n),this._hideCookieBar(),this.closeOffCanvas()}_applyCookieConfiguration(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=this._getTechnicallyRequiredCookieNames(),o=this._extractAllCookiesFromGroups(e),r=[],a=[];for(let e=0;e<o.length;e++){let s=o[e];("required"===t?s.isRequired:"selected"!==t||s.isRequired||i.includes(s.cookie))?r.push(s):a.push(s.cookie)}for(let e=0;e<a.length;e++)_.getItem(a[e])&&_.removeItem(a[e]);let l=[...n];for(let e=0;e<r.length;e++){let t=r[e],i=n.some(e=>t.cookie===e),o=t.cookie===this.options.cookieConfigHash;i||l.push(t.cookie),!t.value||i||(o&&s?this._storeHashForLanguage(s,t.value):o||_.setItem(t.cookie,t.value,t.expiration||this._getDefaultCookieExpiration()))}return{activeCookieNames:l,inactiveCookieNames:a}}_extractAllCookiesFromGroups(e){let t=[];for(let i=0;i<e.length;i++){let s=e[i],n=s.isRequired||!1;if(s.entries)for(let e=0;e<s.entries.length;e++){let i=s.entries[e];i.cookie&&t.push({cookie:i.cookie,value:i.value,expiration:i.expiration,isRequired:n})}s.cookie&&t.push({cookie:s.cookie,value:s.value,expiration:s.expiration,isRequired:n})}return t}
26_handleUpdateListener(e,t){let i=this._getUpdatedCookies(e,t);"function"==typeof window.registerGoogleReCaptchaPlugins&&(window.registerGoogleReCaptchaPlugins(),PluginManager.initializePlugins()),document.$emitter.publish(O,i)}_isLastStateEmpty(){return 0===this.lastState.active.length&&0===this.lastState.inactive.length}_getUpdatedCookies(e,t){let{lastState:i}=this,s={};return this._isLastStateEmpty()?(e.forEach(e=>{s[e]=!0}),t.forEach(e=>{s[e]=!1})):(e.forEach(e=>{i.inactive.includes(e)&&(s[e]=!0)}),t.forEach(e=>{i.active.includes(e)&&(s[e]=!1)})),s}openOffCanvas(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{offCanvasPosition:t}=this.options,i=window.router["frontend.cookie.offcanvas"];this._hideCookieBar(),E.open(i,!1,this._onOffCanvasOpened.bind(this,e),t)}closeOffCanvas(e){E.close(),"function"==typeof e&&e()}_checkAndShowCookieBarIfNeeded(){let{cookiePreference:e}=this.options;_.getItem(e)||this._showCookieBar()}_onOffCanvasOpened(e){this._registerOffCanvasEvents(),this._setInitialState(),this._setInitialOffcanvasState(),this._registerOffCanvasCloseListener(),PluginManager.initializePlugins(),"function"==typeof e&&e()}_registerOffCanvasCloseListener(){this._onOffCanvasOnceHandler=()=>{this._checkAndShowCookieBarIfNeeded()},w.$emitter.subscribe("onCloseOffcanvas",this._onOffCanvasOnceHandler,{once:!0}),this._registerCleanup(()=>{w.$emitter.unsubscribe("onCloseOffcanvas"),this._onOffCanvasOnceHandler=null})}_registerCleanup(e){this._cleanupTasks||(this._cleanupTasks=[]),this._cleanupTasks.push(e)}_hideCookieBar(){let e=new CustomEvent("hideCookieBar");document.dispatchEvent(e)}_showCookieBar(){let e=new CustomEvent("showCookieBar");document.dispatchEvent(e)}openRequestConsentOffCanvas(e,t){e&&t&&(F.lastTriggerElement=document.activeElement,E.open(e,!1,()=>{window.PluginManager.initializePlugins();let e=document.querySelector(".offcanvas");e&&this._registerConsentOffcanvasEvents(e,t)},"left"))}_registerConsentOffcanvasEvents(e,t){let{consentAcceptButtonSelector:i,consentLoginButtonSelector:s,consentCancelButtonSelector:n,consentPreferencesButtonSelector:o}=this.options,r=e.querySelector(i);r&&r.addEventListener("click",this._onAccept.bind(this,t));let a=e.querySelector(s);a&&a.addEventListener("click",this._onLogin.bind(this));let l=e.querySelector(n);l&&l.addEventListener("click",this._onCancel.bind(this));let c=e.querySelector(o);c&&c.addEventListener("click",this._onPreferences.bind(this))}_setInitialState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=e||this._getCookies("all"),i=[],s=[];t.forEach(e=>{let{cookie:t,required:n}=e;_.getItem(t)||n?i.push(t):s.push(t)}),this.lastState={active:i,inactive:s}}_setInitialOffcanvasState(){let e=this.lastState.active,t=this._getOffCanvas();e.forEach(e=>{let i=t.querySelector(`[data-cookie="${e}"]`);i.checked=!0,this._childCheckboxEvent(i)})}_handleCheckbox(e){let{parentInputClass:t}=this.options,{target:i}=e;(i.classList.contains(t)?this._parentCheckboxEvent:this._childCheckboxEvent).call(this,i)}_findParentEl(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(;e&&!e.classList.contains(i);){if(e.classList.contains(t))return e;e=e.parentElement}return null}_isChecked(e){return!!e.checked}_parentCheckboxEvent(e){let{groupClass:t}=this.options,i=this._isChecked(e),s=this._findParentEl(e,t);this._toggleWholeGroup(i,s)}_childCheckboxEvent(e){let{groupClass:t}=this.options,i=this._isChecked(e),s=this._findParentEl(e,t);this._toggleParentCheckbox(i,s)}_toggleWholeGroup(e,t){Array.from(t.querySelectorAll("input")).forEach(t=>{t.checked=e})}_toggleParentCheckbox(e,t){let{parentInputSelector:i}=this.options,s=Array.from(t.querySelectorAll(`input:not(${i})`)),n=Array.from(t.querySelectorAll(`input:not(${i}):checked`));if(s.length>0){let e=t.querySelector(i);if(e){let t=n.length>0,i=t&&n.length!==s.length;e.checked=t,e.indeterminate=i}}}async _handleSubmit(){let e=this._getCookies("active").filter(e=>{let{required:t}=e;return!t}).map(e=>{let{cookie:t}=e;return t}),t=await this._fetchCookieGroups();if(!t)return;let i=t.elements,{activeCookieNames:s,inactiveCookieNames:n}=this._applyCookieConfiguration(i,"selected",e,t.languageId);this._handleUpdateListener(s,n),this.closeOffCanvas(document.$emitter.publish(N))}async acceptAllCookies(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:i,inactiveCookieNames:s}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(i,s),this._hideCookieBar(),this.closeOffCanvas()}async _acceptAllCookiesFromCookieBar(){let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:i,inactiveCookieNames:s}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(i,s),this._hideCookieBar()}async _acceptAllCookiesFromOffCanvas(){let e=await this._fetchCookieGroups();if(!e)return;let t=e.elements,{activeCookieNames:i,inactiveCookieNames:s}=this._applyCookieConfiguration(t,"all",[],e.languageId);this._handleUpdateListener(i,s),this.closeOffCanvas(document.$emitter.publish(N))}_getCookies(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,{cookieSelector:i}=this.options;return t||(t=this._getOffCanvas()),Array.from(t.querySelectorAll(i)).filter(t=>{switch(e){case"all":return!0;case"active":return this._isChecked(t);case"inactive":return!this._isChecked(t);default:return!1}}).map(e=>{let{cookie:t,cookieValue:i,cookieExpiration:s,cookieRequired:n}=e.dataset;return{cookie:t,value:i,expiration:s,required:n}})}_getOffCanvas(){let e=T?T.getOffCanvas():[];return!!e&&e.length>0&&e[0]}_onAccept(e){_.setItem(e,"1",this._getDefaultCookieExpiration()),E.close()}_navigateTo(e){window.location.href=e}
26_onLogin(){E.close(),this._navigateTo(window.router["frontend.account.login.page"])}_onCancel(){E.close()}_onPreferences(e){e.preventDefault(),E.close(),this.openOffCanvas(()=>{let e=document.querySelector(".offcanvas");e&&e.addEventListener("hidden.bs.offcanvas",this._restoreFocus.bind(this),{once:!0})})}_restoreFocus(){let e=F.lastTriggerElement;e?.focus?.()}}class I{static #e=this.adapterName="shopware";getName(){return this.constructor.adapterName}isAvailable(){return!!(window.useDefaultCookieConsent&&window.router&&window.router["frontend.cookie.offcanvas"])}openPreferences(){let e=window.router?.["frontend.cookie.offcanvas"];if(!e)return!1;let t=this._getPluginInstances("CookiePermission");if(t.length>0){let e=t[0];e&&"function"==typeof e._hideCookieBar&&e._hideCookieBar(),e&&"function"==typeof e._removeBodyPadding&&e._removeBodyPadding()}let i=this._getPluginInstances("CookieConfiguration");if(i.length>0){let e=i[0];if(e&&"function"==typeof e.openOffCanvas)return e.openOffCanvas(),!0}return E.open(e,!1,()=>{window.PluginManager&&"function"==typeof window.PluginManager.initializePlugins&&window.PluginManager.initializePlugins()},"left"),!0}hasConsent(e){let t=this._resolveCookieName(e);return!!t&&!!_.getItem(t)}subscribe(e,t){let i=this._resolveCookieName(t);if(!i||"function"!=typeof e)return()=>{};let s=s=>{let n=s.detail||{};Object.prototype.hasOwnProperty.call(n,i)&&e(!!n[i],{provider:this.getName(),target:t,source:n})};return document.addEventListener(O,s),()=>document.removeEventListener(O,s)}waitUntilReady(e){return Promise.resolve(this.hasConsent(e))}_resolveCookieName(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.key||""||null}_getPluginInstances(e){if(!window.PluginManager||"function"!=typeof window.PluginManager.getPluginInstances)return[];try{let t=window.PluginManager.getPluginInstances(e)||[];if(Array.isArray(t))return t;if("function"==typeof t.values)return Array.from(t.values());return[]}catch{return[]}}}let q={required:!0,provider:"auto",targetType:"purpose",targetKey:"packstation-map"};class H{constructor(e={}){this.options=this._normalizeOptions(e),this.target={type:this.options.targetType,key:this.options.targetKey},this.adapter=this._resolveAdapter()}openPreferences(){return!this.isConsentRequired()||this.adapter.openPreferences(this.target)}hasConsent(){return!this.isConsentRequired()||this.adapter.hasConsent(this.target)}subscribe(e){return this.isConsentRequired()?this.adapter.subscribe(e,this.target):()=>{}}waitUntilReady(){return this.isConsentRequired()?"function"!=typeof this.adapter.waitUntilReady?Promise.resolve(this.hasConsent()):this.adapter.waitUntilReady(this.target):Promise.resolve(!0)}isConsentRequired(){return this.options.required}getProviderName(){return this.adapter.getName()}_resolveAdapter(){let e={cookiebot:v,consentmanager:m,shopware:I};if("auto"!==this.options.provider&&Object.prototype.hasOwnProperty.call(e,this.options.provider)){let t=new e[this.options.provider];if(t.isAvailable())return t}return[m,v,I].map(e=>new e).find(e=>e.isAvailable())||new y}_normalizeOptions(e){let t={...q,...e||{}};return t.required=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("boolean"==typeof e)return e;if("number"==typeof e)return 0!==e;if("string"==typeof e){let t=e.trim().toLowerCase();if(["1","true","yes","on"].includes(t))return!0;if(["0","false","no","off",""].includes(t))return!1}return t}(t.required,q.required),t.provider=String(t.provider||q.provider).toLowerCase(),t.targetType=String(t.targetType||q.targetType).toLowerCase(),t.targetKey=String(t.targetKey||q.targetKey),t}}class x{constructor(e,t,i,s,n){this.options={mapType:e,mapApiKey:t,snippets:i,config:n},this.id=s||f.v4(),this.consentService=new H(n?.consent||{})}_getBodyTemplate(){let e='<div class="packstation mb-3">\n<div class="alert alert-warning" id="packstationAlert-'+this.id+'" role="alert" hidden>\n<div class="alert-content-container"><div class="alert-content">'+this.options.snippets.no_packstation_found+'</div></div></div>   <div class="d-flex gap-2">\n';return this.options.config.useCombinedCityZipField||(e+='       <div class="form-group flex-fill">\n           <label class="form-label" for="packstationZip-'+this.id+'">'+this.options.snippets.zip+'*</label>\n           <input form="tonur-packstation-search-form" class="form-control lh-sm" name="packstationZip" id="packstationZip-'+this.id+'" type="text" placeholder="'+this.options.snippets.zip+'" required="required"/>\n       </div>\n'),e+='       <div class="form-group flex-fill">
26\n           <label class="form-label" for="packstationCity-'+this.id+'">'+(this.options.config.useCombinedCityZipField?this.options.snippets.zip+", "+this.options.snippets.city:this.options.snippets.city)+'*</label>\n           <input form="tonur-packstation-search-form" class="form-control lh-sm" name="packstationCity" id="packstationCity-'+this.id+'" type="text" placeholder="'+(this.options.config.useCombinedCityZipField?this.options.snippets.zip+", "+this.options.snippets.city:this.options.snippets.city)+'" required="required"/>\n       </div>\n       <div class="form-group align-self-end">\n           <button form="tonur-packstation-search-form" class="btn btn-primary btn-block" type="button" id="searchPackstation-'+this.id+'">'+this.options.snippets.search+'</button>\n       </div>\n   </div>\n   <div id="packstationLegend" class="legend"></div>\n   <div id="packstationTestMode" class="tonur-packstation-map-test-mode-overlay is--hidden">Test mode</div>\n   <div id="packstationMap-'+this.id+'">   </div>\n</div>'}async _loadPackstationMap(e){if(this.$element){p.create(this.$element);try{(await this.consentService.waitUntilReady(),"bingMaps"===this.options.mapType)?this.map=new a(e,this.options.mapApiKey,this.options.snippets,this.id,this.options.config):this.map=new l("packstationMap-"+this.id,this.options.mapApiKey,this.options.snippets,this.id,this.options.config),await this.map.loadMap()}finally{this.$element&&p.remove(this.$element)}}}_searchPackstation(e){let t=e.getAttribute("action"),i=new FormData(e),s={};this.$element&&!this.searching&&(this.$element.querySelector("#packstationAlert-"+this.id).setAttribute("hidden",!0),this.searching=!0,p.create(this.$element),i.forEach(function(e,t){s[t]=e}),this._doSearch(t,s))}_doSearch(e,t){fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(e=>e.text()).then(e=>{let t=JSON.parse(e);0===t.length?(this.$element.querySelector("#packstationAlert-"+this.id).removeAttribute("hidden"),this.map.clearMap()):this.map.addLocations(this.map.prepareLocations(t)),p.remove(this.$element),this.searching=!1})}_registerEvents(){let e=this.$element.querySelector("#searchPackstation-"+this.id),t=document.querySelector("#tonur-packstation-search-form");t.addEventListener("submit",e=>{e.preventDefault(),e.stopPropagation(),this.handlePackstationForm(t)}),e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();let t=e.target.form;this.handlePackstationForm(t)})}handlePackstationForm(e){let t=this.$element.querySelector("#packstationCity-"+this.id),i=t.value;if(t.classList.toggle("is-invalid",!i.trim()),i.trim()){if(!this.options.config.useCombinedCityZipField){let e=this.$element.querySelector("#packstationZip-"+this.id),t=e.value;if(e.classList.toggle("is-invalid",!t.trim()),!t.trim())return}this._searchPackstation(e)}}insertBefore(e){if(null===this.$element)return null;let t=document.createElement("div");t.innerHTML=this._getBodyTemplate();let i=e.parentNode.insertBefore(t,e);return this.$element=i,this._loadPackstationMap("#packstationMap-"+this.id),this._registerEvents.call(this),i}insertAfter(e){if(null===this.$element)return null;let t=document.createElement("div");t.innerHTML=this._getBodyTemplate();let i=e.parentNode.insertBefore(t,e.nextSibling);return this.$element=i,this._loadPackstationMap("#packstationMap-"+this.id),this._registerEvents.call(this),i}append(e){if(null===this.$element)return null;let t=document.createElement("div");return t.innerHTML=this._getBodyTemplate(),e.appendChild(t),this.$element=e,this._loadPackstationMap("#packstationMap-"+this.id),this._registerEvents.call(this),e}remove(){null!==this.$element&&(this.$element.remove(),this.$element=null)}}class R{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return R.isIPhoneDevice()||R.isIPadDevice()}static isNativeWindowsBrowser(){return R.isIEBrowser()||R.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":R.isTouchDevice(),"is-ios":R.isIOSDevice(),"is-native-windows":R.isNativeWindowsBrowser(),"is-iphone":R.isIPhoneDevice(),"is-ipad":R.isIPadDevice(),"is-ie"
26:R.isIEBrowser(),"is-edge":R.isEdgeBrowser()}}}let B="modal-backdrop",D="modal-backdrop-open",V="no-scroll",j={ON_CLICK:"backdrop/onclick"};class z{constructor(){return z.instance||(z.instance=this),z.instance}create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let t=document.body.lastChild;document.documentElement.classList.add(V),setTimeout(function(){t.classList.add(D),"function"==typeof e&&e()},75),this._dispatchEvents()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;this._getBackdrops().forEach(e=>e.classList.remove(D)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(V)}_dispatchEvents(){let e=R.isTouchDevice()?"touchstart":"click";document.addEventListener(e,function(e){e.target.classList.contains(B)&&document.dispatchEvent(new CustomEvent(j.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${B}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(e=>e.remove())}_exists(){return document.querySelectorAll(`.${B}`).length>0}_getTemplate(){return`<div class="${B}"></div>`}}Object.freeze(new z);let Z="js-pseudo-modal",K="js-pseudo-modal-template-root-element";class U{constructor(e,t=!0,i=".js-pseudo-modal-template",s=".js-pseudo-modal-template-content-element",n=".js-pseudo-modal-template-title-element"){this._content=e,this._useBackdrop=t,this._templateSelector=i,this._templateContentSelector=s,this._templateTitleSelector=n}open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:350;this._hideExistingModal(),this._create(),setTimeout(this._open.bind(this,e),t)}close(){let e=this.getModal();this._modalInstance=bootstrap.Modal.getInstance(e),this._modalInstance.hide()}getModal(){return this._modal||this._create(),this._modal}updatePosition(){this._modalInstance.handleUpdate()}updateContent(e,t){this._content=e,this._setModalContent(e),this.updatePosition(),"function"==typeof t&&t.bind(this)()}_hideExistingModal(){try{let e=document.querySelector(`.${Z} .modal`);if(!e)return;let t=bootstrap.Modal.getInstance(e);if(!t)return;t.hide(),window.focusHandler._removeFocusTrapGuard()}catch(e){console.warn(`[PseudoModalUtil] Unable to hide existing pseudo modal before opening pseudo modal: ${e.message}`)}}_open(e){this.getModal(),this._modal.addEventListener("hidden.bs.modal",this._modalWrapper.remove),this._modal.addEventListener("shown.bs.modal",e),this._modal.addEventListener("hidden.bs.modal",()=>window.focusHandler._removeFocusTrapGuard()),this._modal.addEventListener("hide.bs.modal",()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}),this._modalInstance.show(),window.focusHandler._addFocusTrapGuard(this._modalWrapper)}_create(){this._modalMarkupEl=document.querySelector(this._templateSelector),this._createModalWrapper(),this._modalWrapper.innerHTML=this._content,this._modal=this._createModalMarkup(),this._modalInstance=new bootstrap.Modal(this._modal,{backdrop:this._useBackdrop}),document.body.insertAdjacentElement("beforeend",this._modalWrapper)}_createModalWrapper(){this._modalWrapper=document.querySelector(`.${Z}`),this._modalWrapper||(this._modalWrapper=document.createElement("div"),this._modalWrapper.classList.add(Z))}_createModalMarkup(){let e=this._modalWrapper.querySelector(".modal");if(e)return e;let t=this._modalWrapper.innerHTML;return this._modalWrapper.innerHTML=this._modalMarkupEl.innerHTML,this._setModalContent(t),this._modalWrapper.querySelector(".modal")}_setModalTitle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{this._modalWrapper.querySelector(this._templateTitleSelector).innerHTML=e}catch(e){}}_setModalContent(e){let t=this._modalWrapper.querySelector(this._templateContentSelector);t.innerHTML=e;let i=t.querySelector(`.${K}`);if(i){this._modalWrapper.querySelector(`.${K}`).replaceChildren(i);return}try{let e=t.querySelector(this._templateTitleSelector);e&&(this._setModalTitle(e.innerHTML),e.parentNode.removeChild(e))}catch(e){}}}class W{constructor(){return W.instance||(this._data={$element:null}
26,this.options={mapType:null,mapApiKey:null,snippets:null,config:null,useCombinedCityZipField:null},W.instance=this),W.instance}init(e,t,i,s){this.options.mapType=e,this.options.mapApiKey=t,this.options.snippets=i,this.options.config=s,this.options.zipCode=s.zipCode,this.options.city=s.city}_getModalTemplate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return'<div id="repertusPackstationMapModal" class="js-pseudo-modal-template" tabindex="-1" data-id="'+e+'">\n<div class="js-pseudo-modal-template-title-element">'+this.options.snippets.search_packstation_post_office+'</div>\n<div class="js-pseudo-modal-template-content-element"><div id="repertusPackstationMapModalBody" class="modal-body"></div></div>\n</div>'}openModal(e){this._data.$element=new U(e),this._data.$element.open(this.onOpenModal.bind(this))}onOpenModal(){let e=this._data.$element.getModal().querySelector("#repertusPackstationMapModal"),t=e.querySelector("#repertusPackstationMapModalBody"),i=e.dataset.id,n=new x(this.options.mapType,this.options.mapApiKey,this.options.snippets,i,this.options.config);t&&n.append(t),new s().subscribe("TonurPackstation_selectLocation-"+i,()=>{this.hide()}),window.PluginManager.initializePlugins()}show(e){return this.openModal(this._getModalTemplate(e)),!0}hide(){return this._data.$element._modalInstance.hide(),!0}}Object.freeze(new W);let G=window.PluginBaseClass;class X extends G{static #e=this.options={mapType:null,mapApiKey:null,snippets:null,cookieMissingPermissionSelector:"#TonurPackstationCookieMissingPermission",color:{packstation:null,postoffice:null,packstationIcon:null,postoffice_Icon:null},consent:{required:!0,provider:"auto",targetType:"purpose",targetKey:"packstation-map"},testMode:!0,validatePostNumber:!1,useCombinedCityZipField:!0};init(){if(this.$cookieMissingPermissionInfo=this.el.parentElement.querySelector(this.options.cookieMissingPermissionSelector),this.$form=this.el.closest("form"),!this.$form)throw Error("Could not find form!");this.id=this.$form.getAttribute("data-tonur-packstation-form-id"),this.id||(this.id=f.v4(),this.$form.setAttribute("data-tonur-packstation-form-id",this.id)),this.emitter=new s,this.consentService=new H(this.options.consent),this._boundMapClickHandler=this._onMapClick.bind(this),this._isMapInitialized=!1,this.addDataValidation(),this._unsubscribeConsent=this.consentService.subscribe(e=>{this._handleConsentStateChanged(e)}),this._handleConsentStateChanged(this.consentService.hasConsent())}_registerEvents(){this.el.addEventListener("click",this._boundMapClickHandler),this.emitter.subscribe("TonurPackstation_selectLocation-"+this.id,()=>{this._closeMap()}),this._isMapInitialized=!0}_onMapClick(e){if(e.preventDefault(),e.stopPropagation(),1===this._mode){if(this._closeMap())return;this.inlineForm=new x(this.options.mapType,this.getMapApiKey(),this.options.snippets,this.id,this.options),this.inlineForm.insertBefore(this.$form.querySelector(".repertusPackstationAddressFields"))}else this.modal=new W,this.modal.init(this.options.mapType,this.getMapApiKey(),this.options.snippets,this.options),this.modal.show(this.id);window.PluginManager.initializePlugins()}_closeMap(){return this.modal?(this.modal.hide(),this.modal=null,!0):!!this.inlineForm&&(this.inlineForm.remove(),this.inlineForm=null,!0)}_handleConsentStateChanged(e){if(this._applyConsentState(e),e){this.initPackstationMap();return}this._closeMap(),this.removeEvents()}initPackstationMap(){if(!this.options.mapType||!this.getMapApiKey()&&"openStreetMap"!==this.options.mapType)throw Error("The options for the packstation map are incomplete!");let e=this.$form.closest(".modal");this._mode=e?1:2,this._isMapInitialized||this._registerEvents()}removeEvents(){this._isMapInitialized&&(this.el.removeEventListener("click",this._boundMapClickHandler),this.emitter.unsubscribe("TonurPackstation_selectLocation-"+this.id),this._isMapInitialized=!1)}_applyConsentState(e){this.el.disabled=!e,this.$cookieMissingPermissionInfo&&this.$cookieMissingPermissionInfo.classList.toggle("is--hidden",e)}getMapApiKey(){return this.options.testMode?r.getRepertusBingMapsKey():this.options.mapApiKey}addDataValidation(){!this.options.validatePostNumber||this.$form.hasAttribute("data-form-validation")||(this.$form.setAttribute("data-form-validation","true"),window.PluginManager.initializePlugins())}}let J={MAIL:"0",PACKSTATION:"1",POST_OFFICE:"2"},Y={UNKNOWN:"",PACKSTATION:"P"},Q=window.PluginBaseClass;class ee extends Q{static #e=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"},consent:{required:!0,provider:"auto",targetType:"purpose",targetKey:"packstation-map"},countryIdGermany:null};init(){this._initDefaultValues(),this.emitter=new s,this.formToggleCheckbox=document.querySelector("#differentShippingAddress"),this.formToggleCheckbox&&(this.formFieldTogglePluginEmitter=new s(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.id||(this.id=f.v4(),this.$form.setAttribute("data-tonur-packstation-form-id",this.id)),this.consentService=new H(this.options.consent),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=J.MAIL,this.currentPackstationType=Y.UNKNOWN,this.currentDhlNumber="",this.currentPackstationNumber=""}_registerEvents(){this.emitter.subscribe("TonurPackstation_selectLocation-"+this.id,e=>{this._setPackstationDataToForm(e.detail),this._handleRelevantDataChanged()}),this.formToggleCheckbox&&this.formFieldTogglePluginEmitter.subscribe("onChange",()=>{this._updateView()}
26),this.$addressTypeSelection.forEach(e=>e.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",e=>{isNaN(e.target.value)?(this.dhlNumberOnlyNumericalError.classList.remove("d-none"),e.target.value=e.target.value.replace(/[^0-9]/g,"")):this.dhlNumberOnlyNumericalError.classList.add("d-none")}),this.$cookieButton&&this.$cookieButton.addEventListener("click",e=>{e.preventDefault(),this.consentService.openPreferences()})}_onRelevantDataForStreetChanged(){this._handleRelevantDataChanged()}_handleRelevantDataChanged(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this._updateCurrentValues(),this._calculateStreetValue(),e&&(this._updateFormFields(),this._setCountryToGermanyIfNecessary()),this._updateView()}_updateCurrentValues(){this._updateCurrentAddressType(),this._updateCurrentPackstationType(),this._updateDhlNumber(),this._updatePackstationNumber(),this._updateCurrentZip(),this._updateCurrentCity()}_updateCurrentAddressType(){for(let e=0;e<this.$addressTypeSelection.length;e++)if(this.$addressTypeSelection[e].checked){this.currentAddressType=this.$addressTypeSelection[e].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(e,t){e&&(e.value=t,e.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 e=this.currentAddressType===J.PACKSTATION||this.currentAddressType===J.POST_OFFICE,t="company"===this.options.config.savePostnumberField;e?(this.$packstationFieldSet&&(this.$packstationFieldSet.classList.remove("d-none"),this.$packstationFieldSet.querySelectorAll("input").forEach(function(e){e.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(e){e.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",t),this.$vatIdField&&this.$vatIdField.parentElement.classList.toggle("d-none",t)),this.$emitter.publish("TonurPackstationForm/updateView",{id:this.id,isPackstationOrPostOffice:e,streetValue:this.currentPackstationType===Y.PACKSTATION?this.options.streetValues.packstation:this.options.streetValues.postOffice})}_setCountryToGermanyIfNecessary(){(this.currentAddressType===J.PACKSTATION||this.currentAddressType===J.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===J.MAIL)try{let e=this.$countryField.dataset.initialCountryId;if(e===this.options.countryIdGermany)return;this.$countryField.value=e,e?this._fireChangeEventForDOMElement(this.$countryField):(this.$countryStateField.parentNode.classList.toggle("d-none",!0),this.$countryStateField.setAttribute("disabled","disabled"))}catch(e){console.error("An error occurred setting country to initial value"),console.error(e)}}_fireChangeEventForDOMElement(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(void 0===e)return;let s=document.createEvent("HTMLEvents");s.initEvent("change",t,i),e.dispatchEvent(s)}_setPackstationDataToForm(e){this.setInputFieldValue(this.$packstationNumberField,e.number),this.setInputFieldValue(this.$packstationTypeField,e.type),this.setInputFieldValue(this.$zipField,e.address.postalCode),this.setInputFieldValue(this.$cityField,e.address.addressLocality);let t=Array.from(this.$addressTypeSelection).find(e=>e.value===J.PACKSTATION);t&&(t.checked=!0,this.currentAddressType=J.PACKSTATION,t.click())}_calculateStreetValue(){if(""===this.currentPackstationNumber||this.currentAddressType===J.MAIL){this.street="",this.currentStreet="",this.currentZip="",this.currentCity="",this.currentAddressType===J.MAIL&&(this.currentPackstationNumber="",this.currentDhlNumber="");return}this.currentStreet=this.options.streetValues.packstation,this.currentPackstationType!==Y.PACKSTATION&&(this.currentStreet=this.options.streetValues.postOffice),this.currentStreet+=" "+this.currentPackstationNumber}}let et=window.PluginBaseClass;class ei extends et{static #e=this.options={selectors:{houseNumberLogin:"#addressAddressHouseNumber",streetAddressLogin:"#addressAddressStreet",AddressPackstationNumber:"#repertusPackstationAddressPackstationNumber",packstationType:"#repertusPackstationAddressPackstationType"}};init(){if(this.AddressPackstationNumberSelector=this.options.selectors.AddressPackstationNumber,this.packstationType=this.options.selectors.packstationType,this.$el=this.el,this.$form=this.$el.closest("form"),this.id=this.$form.getAttribute("data-tonur-packstation-form-id"),void 0===this.id)return;let e=this.el.parentElement.querySelectorAll("div[data-acris-separate-street] input"),t=e[0],i=e[1],s=t.getAttribute("id");s.includes("billingAddress")||s.includes("AddressHouseNumber")||(this.$addressTypeSelection=this.$el.querySelector(this.options.selectors.addressType),this.$houseNumber=i??this.$form.querySelector(this.options.selectors.house
26NumberLogin),this.$streetAddress=t??this.$form.querySelector(this.options.selectors.streetAddressLogin),this.$houseNumberPlaceholderStarttext=this.$houseNumber.placeholder,this.$streetPlaceholderStarttext=this.$streetAddress.placeholder,this.$streetLabel=this.$form.querySelector(`label[for="${this.$streetAddress.id}"]`),this.$houseNumberLabel=this.$form.querySelector(`label[for="${this.$houseNumber.id}"]`),this.$streetLabelStartText=this.$streetLabel.textContent,this.$houseNumberLabelStartText=this.$houseNumberLabel.textContent,this._registerEvents(),this.triggerUpdatePackstationView())}_registerEvents(){window.PluginManager.getPluginInstances("TonurPackstationForm").forEach(e=>{e.$emitter.subscribe("TonurPackstationForm/updateView",this._updateView.bind(this))})}_updateView(e){if(this.id!==e.detail.id)return;let t=this.$form.querySelector(this.AddressPackstationNumberSelector),i=this.$form.querySelector(this.packstationType),s=e.detail.isPackstationOrPostOffice,n=this.$form.querySelector(`label[for="${i.id}"]`),o=this.$form.querySelector(`label[for="${t.id}"]`);this.$streetAddress.value="",this.$houseNumber.value="",s?(this.$houseNumber.value=t.value,this.$streetAddress.value=e.detail.streetValue,this.$houseNumberLabel.textContent=o.textContent,this.$streetLabel.textContent=n.textContent,this.$houseNumber.placeholder=t.placeholder,this.$streetAddress.placeholder=n.textContent,i.parentNode.style.display="none",t.parentNode.style.display="none",this.$houseNumber.parentNode.style.display="block",this.$streetAddress.parentNode.style.display="block",this._startSyncPackstationNumber(this.$houseNumber,t)):(this.$houseNumberLabel.textContent=this.$houseNumberLabelStartText,this.$streetLabel.textContent=this.$streetLabelStartText,this.$houseNumber.placeholder=this.$houseNumberPlaceholderStarttext,this.$streetAddress.placeholder=this.$streetPlaceholderStarttext,this._stopSyncPackstationNumber(this.$houseNumber))}_startSyncPackstationNumber(e,t){this.syncNumber=function(){t.value=e.value},e.addEventListener("change",this.syncNumber)}_stopSyncPackstationNumber(e){this.syncNumber&&(e.removeEventListener("change",this.syncNumber),this.syncNumber=null)}triggerUpdatePackstationView(){window.PluginManager.getPluginInstances("TonurPackstationForm").forEach(e=>{e.id===this.id&&e._handleRelevantDataChanged(!1)})}}let es=window.PluginManager;es.register("TonurPackstationMap",X,"[data-tonur-packstation-map]"),es.register("TonurPackstationForm",ee,"[data-tonur-packstation-form]"),es.register("TonurPackstationAcrisSeparateStreetCSPlugin",ei,"[data-tonur-acris-separate-street]")})();

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.