import{r as t,h as i,H as s}from"./p-9add63ef.js";import{s as e,b as d}from"./p-b3860daf.js";import{g as o}from"./p-2da8d1fe.js";import"./p-2b28ea49.js";import"./p-13f5e4e1.js";import"./p-3f6362a4.js";import"./p-ec182234.js";import"./p-dd24e53c.js";import"./p-fb28f84f.js";import"./p-830ab1a3.js";const a=":host{display:block}";const n=a;let l=0;const h=class{constructor(i){t(this,i);this.inputId=`sc-quantity-${++l}`;this.helpId=`sc-quantity-help-text-${l}`;this.labelId=`sc-quantity-label-${l}`;this.size="medium";this.name=undefined;this.errors=undefined;this.showLabel=true;this.label=undefined;this.required=false;this.help=undefined;this.productId=undefined}render(){var t,a,n,l,h,r,p;const c=o((t=e[this.productId])===null||t===void 0?void 0:t.product,(a=e[this.productId])===null||a===void 0?void 0:a.selectedVariant);return i(s,{key:"afa4524c5e4e2cc4583d6de12e35c29252607f55"},i("sc-form-control",{key:"55432e328d5c7273f8d208112f8695fdf2192a20",exportparts:"label, help-text, form-control",size:this.size,required:this.required,label:this.label,showLabel:this.showLabel,help:this.help,inputId:this.inputId,helpId:this.helpId,labelId:this.labelId,name:this.name},i("sc-quantity-select",{key:"adb7155bd9b55ba9d67ef57181a93e7a562cddd2",size:this.size,quantity:Math.max(((l=(n=e[this.productId])===null||n===void 0?void 0:n.selectedPrice)===null||l===void 0?void 0:l.ad_hoc)?1:(h=e[this.productId])===null||h===void 0?void 0:h.quantity,1),disabled:(p=(r=e[this.productId])===null||r===void 0?void 0:r.selectedPrice)===null||p===void 0?void 0:p.ad_hoc,onScInput:t=>d(this.productId,{quantity:t.detail}),...!!c?{max:c}:{}})))}};h.style=n;export{h as sc_product_quantity};
//# sourceMappingURL=p-5d8f857d.entry.js.map