1(function(){"use strict";const PFAND_VARIANTS={einweg_025:55180615942529,mehrweg_015:55180615975297,mehrweg_008:55180616008065},PFAND_PRODUCT_ID=0xde7c59d8181;let pendingPfandAdditions=new Set;async function addPfandToCart(pfandType,quantity){const variantId=PFAND_VARIANTS[pfandType];if(!(!variantId||pendingPfandAdditions.has(variantId))){pendingPfandAdditions.add(variantId);try{console.log("[Pfand] Adding:",pfandType,"->",variantId,"x",quantity),(await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:variantId,quantity,properties:{_pfand_auto_added:"true"}}]})})).ok&&(console.log("[Pfand] Added successfully"),document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})))}catch(e){console.error("[Pfand] Error:",e)}finally{pendingPfandAdditions.delete(variantId)}}}function init(){console.log("[Pfand] Initializing SIRPLUS Pfand system"),document.addEventListener("submit",function(e){const form=e.target;if(!form.matches('form[action*="/cart/add"]'))return;const pfandInput=form.querySelector('input[name="properties[_pfand_type]"]'),pfandType=pfandInput?pfandInput.value:form.dataset.pfandType;if(pfandType&&PFAND_VARIANTS[pfandType]){const qtyInput=form.querySelector('input[name="quantity"]'),qty=qtyInput&&parseInt(qtyInput.value,10)||1,pfandQtyInput=form.querySelector('input[name="properties[_pfand_quantity]"]'),pfandQty=pfandQtyInput&&parseInt(pfandQtyInput.value,10)||1;setTimeout(()=>addPfandToCart(pfandType,qty*pfandQty),500)}},!0),document.addEventListener("variant:add",function(e){const pfandType=e.detail?.pfandType||e.detail?.properties?._pfand_type;if(pfandType&&PFAND_VARIANTS[pfandType]){const pfandQty=parseInt(e.detail?.properties?._pfand_quantity||"1",10)||1;setTimeout(()=>addPfandToCart(pfandType,(e.detail?.quantity||1)*pfandQty),500)}})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init()})(),(function(){"use strict";const PFAND_API="https://api.sirplus.de/v1/products/pfand-map",BASE_VARIANT={einweg_025:55180615942529,mehrweg_015:55180615975297,mehrweg_008:55180616008065},MULTIPACK={55341782335873:{type:"einweg_025",units:3},55341782565249:{type:"einweg_025",units:12}};let _pfandMap=null;const PFAND_MAP_SS_KEY="_pfand_map_v1";async function getPfandMap(){if(_pfandMap)return _pfandMap;try{const ss=sessionStorage.getItem(PFAND_MAP_SS_KEY);if(ss)return _pfandMap=JSON.parse(ss),_pfandMap}catch{}try{const res=await fetch(PFAND_API,{headers:{Accept:"application/json"}});if(res.ok){const json=await res.json();_pfandMap=json&&json.data&&json.data.map?json.data.map:{};try{sessionStorage.setItem(PFAND_MAP_SS_KEY,JSON.stringify(_pfandMap))}catch{}return _pfandMap}}catch(e){console.error("[Pfand] map fetch failed:",e)}return _pfandMap||{}}function hidePfandControls(){fetch("/cart.js").then(r=>r.json()).then(cart=>{var items=document.querySelectorAll(".line-item");cart.items.forEach((item,i)=>{var isPfand=item.properties&&item.properties._pfand_auto_added==="true"||item.product_id===0xde7c59d8181;if(isPfand){var el=items[i];el&&(el.querySelectorAll(".quantity-selector").forEach(q=>q.style.display="none"),el.querySelectorAll(".line-item__remove-button").forEach(b=>b.style.display="none"))}})}).catch(()=>{})}let _pfandSyncTimer=null,_pfandSyncing=!1;function schedulePfandSync(){_pfandSyncTimer&&clearTimeout(_pfandSyncTimer),_pfandSyncTimer=setTimeout(()=>{_pfandSyncing||syncPfandQuantities()},300)}async function syncPfandQuantities(){if(!_pfandSyncing){_pfandSyncing=!0;try{const[cart,map]=await Promise.all([fetch("/cart.js").then(r=>r.json()),getPfandMap()]),requiredUnits={};for(const item of cart.items){if(item.product_id===0xde7c59d8181)continue;const info=map[String(item.product_id)];if(!info||!info.type||!BASE_VARIANT[info.type])continue;const perUnit=parseInt(info.qty,10)||1;requiredUnits[info.type]=(requiredUnits[info.type]||0)+item.quantity*perUnit}const providedByMultipack={},baseLines={};for(const item of cart.items){if(MULTIPACK[item.variant_id]){const m=MULTIPACK[item.variant_id];providedByMultipack[m.type]=(providedByMultipack[m.type]||0)+item.quantity*m.units}for(const[type,vid]of Object.entries(BASE_VARIANT))item.variant_id===vid&&(baseLines[type]=item)}const updates={},toAdd=[],allTypes=new Set([...Object.keys(requiredUnits),...Object.keys(baseLines)]);for(const type of allTypes){const required=requiredUnits[type]||0,provided=providedByMultipack[type]||0,desiredBase=Math.max(0,required-provided),line=baseLines[type];line?line.quantity!==desiredBase&&(updates[line.key]=desiredBase):desiredBase>0&&toAdd.push({id:BASE_VARIANT[type],quantity:desiredBase,properties:{_pfand_auto_added:"true"}})}let changed=!1;toAdd.length>0&&(await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:toAdd})}),changed=!0),Object.keys(updates).length>0&&(await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates})}),changed=!0),changed&&document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0}))}catch(e){console.error("[Pfand] sync error:",e)}finally{_pfandSyncing=!1}}}window.__pfandSync=syncPfandQuantities,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",hidePfandControl
1s):hidePfandControls(),document.addEventListener("cart:refresh",hidePfandControls),document.addEventListener("cart:updated",hidePfandControls),document.addEventListener("cart:refresh",schedulePfandSync),document.addEventListener("cart:updated",schedulePfandSync),setTimeout(syncPfandQuantities,1e3),new MutationObserver(()=>setTimeout(hidePfandControls,100)).observe(document.body,{childList:!0,subtree:!0});let _checkoutGuardPassed=!1;document.addEventListener("click",async function(e){const btn=e.target.closest('[name="checkout"], .cart__checkout, button[name="checkout"]');if(!(!btn||_checkoutGuardPassed)){e.preventDefault();try{await syncPfandQuantities()}catch{}_checkoutGuardPassed=!0,btn.form?btn.form.submit():btn.tagName==="A"&&btn.href?window.location.href=btn.href:btn.click()}},!0)})();class ContentDrawer extends HTMLElement{constructor(){super(),this.toolbarElement=this.querySelector(".shortcodetoolbar"),this.popoverElement=document.getElementById("tableofcontents-popup"),this.button=this.toolbarElement.querySelector(".shortcodetoolbar__item"),this.closeBtn=this.popoverElement.querySelector('[data-action="close-popup"]'),this.pageOverlay=document.querySelector(".pageoverlay")}connectedCallback(){const isVisible=this.popoverElement.getAttribute("aria-hidden")==="false";this.button.setAttribute("aria-expanded",isVisible),this.button.addEventListener("click",()=>{const isVisible2=this.popoverElement.getAttribute("aria-hidden")==="false";this.popoverElement.setAttribute("aria-hidden",isVisible2),this.button.setAttribute("aria-expanded",isVisible2),this.pageOverlay&&this.pageOverlay.classList.toggle("is-visible",!isVisible2)}),this.closeBtn.addEventListener("click",()=>{this.popoverElement.setAttribute("aria-hidden","true"),this.button.setAttribute("aria-expanded","false"),this.pageOverlay&&this.pageOverlay.classList.remove("is-visible")})}}customElements.define("content-drawer",ContentDrawer);class TableOfContents extends HTMLElement{constructor(){super(),this.summarys=document.querySelectorAll(".tableofcontents"),this.summarys=Array.prototype.slice.call(this.summarys),this.content=document.querySelector(".article__body"),this.anchorMap=new Map,this.anchors=[],this.links=[],this.popoverElement=document.getElementById("tableofcontents-popup"),this.pageOverlay=document.querySelector(".pageoverlay"),this.activeClass="active-link",this.announcement_bar=document.querySelector(".top-bar"),this.headerHeight=this.getHeaderHeight()}getHeaderHeight(){const header=document.querySelector("header"),announcementBar=document.querySelector(".top-bar"),headerHeight=header?header.offsetHeight:0,announcementHeight=announcementBar?announcementBar.offsetHeight:0;return headerHeight+announcementHeight}connectedCallback(){this.content.querySelectorAll(".anchor").forEach(anchor=>{this.anchorMap.set(anchor,[]),this.anchors.push(anchor)}),this.summarys.forEach(summary=>{summary.querySelectorAll(".toc--content-link").forEach(link=>{this.links.push(link);const anchor=this.content.querySelector(new URL(link.href).hash);anchor&&this.anchorMap.get(anchor).push(link),link.addEventListener("click",e=>{e.preventDefault();let aElement=e.target;aElement.nodeName!=="A"&&(aElement=e.target.closest("a"));const targetId=aElement.getAttribute("href").substring(1),target=document.getElementById(targetId),offsetPosition=target.getBoundingClientRect().top+window.scrollY-this.headerHeight;target&&target.scrollIntoView({top:offsetPosition,behavior:"smooth"}),this.links.forEach(l=>l.classList.remove(this.activeClass)),aElement.classList.add(this.activeClass);let parentElement=aElement.parentElement;for(;parentElement&&!parentElement.classList.contains("popup");)parentElement=parentElement.parentElement;parentElement&&(this.popoverElement.setAttribute("aria-hidden","true"),this.pageOverlay.classList.remove("is-visible"))})})})}}customElements.define("table-of-content",TableOfContents);class TocCollapsible extends HTMLElement{constructor(){super(),this.isOpen=!1,this.shortcodetoolbar=document.querySelector(".shortcodetoolbar"),this.lastScrollY=null,this.handleScroll=this.handleScroll.bind(this)}connectedCallback(){if(this.toggleBtn=this.querySelector(".toggle"),this.content=this.querySelector(".toggle-content"),this.toggleLabel=this.querySelector(".toggle-label"),!this.toggleBtn||!this.content||!this.toggleLabel)return;const isMobile=window.matchMedia("(max-width: 768px)").matches,expandedAttr=isMobile?this.toggleBtn.getAttribute("aria-expanded-mobile"):this.toggleBtn.getAttribute("aria-expanded");this.isOpen=expandedAttr==="true",isMobile&&!this.classList.contains("toc-below-banner")&&(this.isOpen=!1,this.toggleBtn.setAttribute("aria-expanded","fal
1se")),this.labelOpen=this.toggleLabel.getAttribute("toggle-label-open")||"Show",this.labelClose=this.toggleLabel.getAttribute("toggle-label-close")||"Hide",this.isOpen?(this.content.style.display="block",this.toggleLabel.textContent=this.labelClose):(this.content.style.display="none",this.toggleLabel.textContent=this.labelOpen),this.toggleBtn.addEventListener("click",e=>{e.preventDefault(),this.isOpen?(this.slideUp(this.content),this.toggleLabel.textContent=this.labelOpen,this.toggleBtn.setAttribute("aria-expanded","false")):(this.slideDown(this.content),this.toggleLabel.textContent=this.labelClose,this.toggleBtn.setAttribute("aria-expanded","true")),this.isOpen=!this.isOpen}),window.addEventListener("scroll",this.handleScroll),this.handleScroll(),isMobile&&!this.classList.contains("toc-below-banner")&&this.querySelectorAll(".toc--content-link").forEach(link=>{link.addEventListener("click",()=>{this.isOpen&&(this.slideUp(this.content),this.toggleLabel.textContent=this.labelOpen,this.toggleBtn.setAttribute("aria-expanded","false"),this.isOpen=!1)})})}disconnectedCallback(){window.removeEventListener("scroll",this.handleScroll)}slideDown(element,duration=300){element.style.display="block",element.style.height="0px";const fullHeight=element.scrollHeight;let start=null;function animate(timestamp){start||(start=timestamp);const progress=timestamp-start,height=Math.min(progress/duration*fullHeight,fullHeight);element.style.height=height+"px",progress<duration?requestAnimationFrame(animate):element.style.height=""}requestAnimationFrame(animate)}slideUp(element,duration=300){const fullHeight=element.scrollHeight;let start=null;function animate(timestamp){start||(start=timestamp);const progress=timestamp-start,height=Math.max(fullHeight-progress/duration*fullHeight,0);element.style.height=height+"px",progress<duration?requestAnimationFrame(animate):(element.style.display="none",element.style.height="")}requestAnimationFrame(animate)}handleScroll(){if(!this.closest(".shortcodetoolbar"))return;const currentScrollY=window.scrollY,pageContentTop=document.querySelector(".page-content")?.offsetTop||0;currentScrollY>=pageContentTop?this.shortcodetoolbar.classList.remove("fixed"):currentScrollY<pageContentTop&&this.shortcodetoolbar.classList.add("fixed")}}customElements.define("toc-collapsible",TocCollapsible); 2//# sourceMappingURL=/cdn/shop/t/374/assets/custom.js.map?v=75712491691211518271782628662
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.