1import{B as t,a as e}from"./BaseElement.DY9JFAhm.min.js";import{H as i}from"./HTMLUpdateUtility.D9m4RNh_.min.js";import{W as n}from"./WithShopifyCart.DW2M6rUR.min.js";import{a as s,t as r,x as o,n as l}from"./vendor-lit.DPhFYw_F.min.js";import{d as a,O as c}from"./debounce.7obvWBYM.min.js";import{F as h}from"./FormElement.CKSCJb95.min.js";import{L as d}from"./LiveRegionUtility.H7cxURKH.min.js";import"./quantity-input.rHNsHy88.min.js";import{f as u}from"./firstFocusableElement.CXP_yyKj.min.js";import"./WithApiClient.CLZvm1QW.min.js";import"./vendor.MggefUiv.min.js";import"./cart-sections.ofJR4fky.min.js";import"./data-layer.Byss8d-g.min.js";import"./aria-live-region-context.CV5M0wsv.min.js";var p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,y=(t,e,i,n)=>{for(var s,r=n>1?void 0:n?m(e,i):e,o=t.length-1;o>=0;o--)(s=t[o])&&(r=(n?s(e,i,r):s(r))||r);return n&&r&&p(e,i,r),r};let v=class extends(n(t)){constructor(){super(...arguments),this.$htmlUpdateUtility=new i(this),this._lastFetchedProductId=null,this._fetchInProgress=!1,this._abortController=null}async updated(){var t,e,i,n,s,r,o,l,a,c,h,d;const u=(null==(t=this.cart)?void 0:t.items)??[];if(0===u.length)return this._lastFetchedProductId=null,this._fetchInProgress=!1,null==(e=this._abortController)||e.abort(),this._abortController=null,void(this.innerHTML="");const p=u[0].product_id;if(p===this._lastFetchedProductId||this._fetchInProgress)return;null==(i=this._abortController)||i.abort(),this._abortController=new AbortController;const m=this._abortController.signal;this._fetchInProgress=!0;const y=p;try{const t=await this.fetchCartRecommendationsSection(p,m);if((null==(r=null==(s=null==(n=this.cart)?void 0:n.items)?void 0:s[0])?void 0:r.product_id)!==y)return;if(this._lastFetchedProductId=y,!t)return void(this.innerHTML="");const e=(new DOMParser).parseFromString(t,"text/html").body.firstElementChild;e&&await this.$htmlUpdateUtility.setInnerHTML(this,e)}catch{if(m.aborted)return;(null==(a=null==(l=null==(o=this.cart)?void 0:o.items)?void 0:l[0])?void 0:a.product_id)===y&&(this.innerHTML="")}finally{this._fetchInProgress=!1,this._abortController=null;const t=(null==(d=null==(h=null==(c=this.cart)?void 0:c.items)?void 0:h[0])?void 0:d.product_id)??null;null!=t&&t!==this._lastFetchedProductId&&this.requestUpdate()}}};y([s()],v.prototype,"_lastFetchedProductId",2),v=y([r("cart-drawer-recommendations")],v);Object.getOwnPropertyDescriptor;let g=class extends(n(t)){constructor(){super(),this._handleInput=this._handleInput.bind(this),this._handleInputDebounced=a(this._handleInput,c)}connectedCallback(){super.connectedCallback(),this.addEventListener("input",this._handleInputDebounced)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("input",this._handleInputDebounced)}_handleInput(t){const e=t.target.value;this.updateCartNoteAndAttributes({note:e},{sections:!1})}};g=((t,e)=>{for(var i,n=e,s=t.length-1;s>=0;s--)(i=t[s])&&(n=i(n)||n);return n})([r("cart-note")],g);var b=Object.defineProperty,_=Object.getOwnPropertyDescriptor,C=(t,e,i,n)=>{for(var s,r=n>1?void 0:n?_(e,i):e,o=t.length-1;o>=0;o--)(s=t[o])&&(r=(n?s(e,i,r):s(r))||r);return n&&r&&b(e,i,r),r};let f=class extends(n(e)){_handleClick(t){t.preventDefault(),this.key&&this.removeItemFromCart([this.key])}render(){return o` <slot @click=${this._handleClick}></slot> `}};C([l({type:String})],f.prototype,"key",2),f=C([r("cart-remove-toggle")],f);var I=Object.defineProperty,S=Object.getOwnPropertyDescriptor,E=(t,e,i,n)=>{for(var s,r=n>1?void 0:n?S(e,i):e,o=t.length-1;o>=0;o--)(s=t[o])&&(r=(n?s(e,i,r):s(r))||r);return n&&r&&I(e,i,r),r};let P=class extends(n(h)){constructor(){super(),this.$liveRegionUtility=new d(this),this.changeEvent=ne
1w Event("change",{bubbles:!0}),this._handleChange=this._handleChange.bind(this),this._handleDebounceChange=a(this._handleChange,c),this._handleChangeEvent=t=>{const e=this.closest("cart-sections");this.shopifyCartLoading||(null==e?void 0:e.classList.contains("loading"))||(null==e||e.classList.add("loading"),this._handleDebounceChange(t))}}createRenderRoot(){return this}_cacheElementSelectors(){this._input=this.querySelector("input"),this._select=this.querySelector(".SelectWrapper")}get input(){return this._input}get select(){return this._select}async _handleChange(){var t;const e=this.closest("cart-sections");try{if(!0===this.input.checked){this.select.classList.remove("hidden");const e=null==(t=this.select.querySelector("select"))?void 0:t.value;await this.changeItemToCart({id:this.lineItemKey,quantity:this.quantity,selling_plan:e})}else this.select.classList.add("hidden"),await this.changeItemToCart({id:this.lineItemKey,quantity:this.quantity,selling_plan:null});await(null==e?void 0:e.updateComplete)}catch(i){this.$liveRegionUtility.announce({message:"Failed to update subscription."})}finally{null==e||e.classList.remove("loading")}}connectedCallback(){super.connectedCallback(),this._cacheElementSelectors(),this.addEventListener("change",this._handleChangeEvent)}disconnectedCallback(){this.removeEventListener("change",this._handleChangeEvent)}};E([l({type:Number,attribute:"quantity"})],P.prototype,"quantity",2),E([l({type:String,attribute:"key"})],P.prototype,"lineItemKey",2),P=E([r("cart-subscribe")],P);var j=Object.defineProperty,w=Object.getOwnPropertyDescriptor,O=(t,e,i,n)=>{for(var s,r=n>1?void 0:n?w(e,i):e,o=t.length-1;o>=0;o--)(s=t[o])&&(r=(n?s(e,i,r):s(r))||r);return n&&r&&j(e,i,r),r};let k=class extends(n(t)){constructor(){super(...arguments),this.$htmlUpdateUtility=new i(this)}connectedCallback(){super.connectedCallback(),this.handleFreeSamples(),this.$htmlUpdateUtility.addPostProcessCallback(()=>{var t,e;null==(e=null==(t=null==window?void 0:window.Shopify)?void 0:t.PaymentButton)||e.init(),this.lastFocusedElementSelectorId&&setTimeout(()=>{var t;const e=document.querySelector(`#${this.lastFocusedElementSelectorId}`);e?null==e||e.focus():null==(t=u(this))||t.focus(),this.lastFocusedElementSelectorId=null},50)})}updated(){if(this.cartSections[this.sectionId]&&JSON.stringify(this.cartSections[this.sectionId])!==k.SECTIONS_CACHE[this.sectionId]){k.SECTIONS_CACHE[this.sectionId]=JSON.stringify(this.cartSections[this.sectionId]);const t=this.$htmlUpdateUtility.parseSectionStringForSelector(this.cartSections[this.sectionId],`[section-id="${this.sectionId}"]`);t&&this.$htmlUpdateUtility.replace(this,t)}}};k.SECTIONS_CACHE={},O([l({type:String,attribute:"section-id"})],k.prototype,"sectionId",2),k=O([r("cart-sections")],k);
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.