1import{B as t,a as e}from"./BaseElement.wji90fuE.min.js";import{d as i,O as s}from"./debounce.uPZYEJlg.min.js";import{W as n}from"./WithShopifyCart.Dy1sQhoJ.min.js";import{t as o,x as r,n as c,o as a,r as l}from"./vendor-lit.2u3dzq2T.min.js";import{i as h,m as d,r as m,a as p,c as u,b as y}from"./quantity-input.D5LxLoax.min.js";import{L as f}from"./LiveRegionUtility.DmzSUgxG.min.js";import{f as v}from"./firstFocusableElement.CXP_yyKj.min.js";import{H as C}from"./HTMLUpdateUtility.Y324tWjQ.min.js";import"./WithApiClient.B8AOHZZP.min.js";import"./fetchWithCache.BJ12kVQ7.min.js";import"./vendor.D2HIaoTS.min.js";import"./cart-sections.BcMbGr3r.min.js";import"./FormElement.BYiZF-mA.min.js";import"./component-lines.JhiZpC4W.min.js";import"./parse-components.C8CZCsyT.min.js";import"./aria-live-region-context.Cpevadk3.min.js";Object.getOwnPropertyDescriptor;let S=class extends(n(t)){constructor(){super(),this._handleInput=this._handleInput.bind(this),this._handleInputDebounced=i(this._handleInput,s)}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})}};S=((t,e)=>{for(var i,s=e,n=t.length-1;n>=0;n--)(i=t[n])&&(s=i(s)||s);return s})([o("cart-note")],S);var k=Object.defineProperty,b=Object.getOwnPropertyDescriptor,j=(t,e,
1i,s)=>{for(var n,o=s>1?void 0:s?b(e,i):e,r=t.length-1;r>=0;r--)(n=t[r])&&(o=(s?n(e,i,o):n(o))||o);return s&&o&&k(e,i,o),o};let I=class extends(n(e)){constructor(){super(...arguments),this.$liveRegionUtility=new f(this),this._handleClick=t=>{if(t.preventDefault(),this.key&&!h(this.key)){if("true"===this.dataset.confirm){const t=this.dataset.confirmText||"Remove this item from your cart?";if(!window.confirm(t))return}d(this.key),m(this.key,this.lineQuantity,{send:()=>this.removeItemFromCart([this.key]),onSettled:()=>y(this.key),onError:()=>{u(this.key);const t=this.dataset.errorMessage;t&&this.$liveRegionUtility.announce({message:t})}})}}}connectedCallback(){super.connectedCallback(),this.key&&p(this.key)}get lineQuantity(){var t,e,i;return(null==(i=null==(e=null==(t=this.cart)?void 0:t.items)?void 0:e.find(t=>t.key===this.key))?void 0:i.quantity)??1}render(){return r` <slot @click=${this._handleClick}></slot> `}};j([c({type:String})],I.prototype,"key",2),I=j([o("cart-remove-toggle")],I);var g=Object.defineProperty,T=Object.getOwnPropertyDescriptor,U=(t,e,i,s)=>{for(var n,o=s>1?void 0:s?T(e,i):e,r=t.length-1;r>=0;r--)(n=t[r])&&(o=(s?n(e,i,o):n(o))||o);return s&&o&&g(e,i,o),o};let E=class extends(n(t)){constructor(){super(...arguments),this.$htmlUpdateUtility=new C(this),this.sectionHTML=null}connectedCallback(){super.connectedCallback(),null===this.sectionHTML&&(this.sectionHTML=this.innerHTML,this.innerHTML=""),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=v(this))||t.focus(),this.lastFocusedElementSelectorId=null},50)})}updated(t){if(t.has("sectionHTML")&&this.$htmlUpdateUtility.reRunScripts(this),this.cartSections[this.sectionId]&&JSON.stringify(this.cartSections[this.sectionId])!==E.SECTIONS_CACHE[this.sectionId]){E.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.wrapUpdateProcess(this,t,t=>{this.sectionHTML=t.innerHTML})}}render(){return r`${a(this.sectionHTML)}`}};E.SECTIONS_CACHE={},U([c({type:String,attribute:"section-id"})],E.prototype,"sectionId",2),U([l()],E.prototype,"sectionHTML",2),E=U([o("cart-sections")],E);export{E as CartSections};
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.