1"use strict";(self.webpackChunkgcom_rhythm=self.webpackChunkgcom_rhythm||[]).push([[356],{185(t,e,r){function a(t){const e=t.querySelector("quantity-spinner input, quantity-selector select"),r=Number(e?.value||t.getAttribute("qty")||0);return Number.isNaN(r)?0:r}function u(t=document){const e=Array.from(t.querySelectorAll(".cart__item[data-group-handle][data-group-limit]")).reduce((t,e)=>{const r=e.dataset.groupHandle;return t[r]=t[r]||[],t[r].push(e),t},{});Object.values(e).forEach(t=>{t.forEach(e=>{const r=Number(e.dataset.groupLimit),u=Number(e.dataset.groupBasePurchaseLimit);if(Number.isNaN(r))return;const n=t.reduce((t,r)=>r===e?t:t+a(r),0);let i=Math.max(r-n,0);Number.isNaN(u)||(i=Math.min(i,u));const s=e.querySelector("quantity-spinner, quantity-selector"),c=s?.querySelector("input, select");if(!s||!c)return;c.max=String(i),c.dataset.hardPurchaseLimit=String(i),s.hardPurchaseLimit=i,function(t,e){if("SELECT"!==t.tagName)return;const r=Number(t.value),a=Number(t.querySelector("option")?.value||0),u=Math.max(e,r);t.innerHTML="";for(let e=a;e<=u;e++){const a=document.createElement("option");a.value=String(e),a.textContent=String(e),a.selected=e===r,t.append(a)}}(c,i);const o=s.querySelector(".js-quantity-spinner-increase");o&&(0===i?o.setAttribute("disabled","disabled"):o.removeAttribute("disabled"),o.classList.toggle("opacity-40",a(e)>=i))})})}r.d(e,{syncGroupQuantityLimits:()=>u})}}]);
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.