PageSourceSearch

https://horze.eu/cdn/shop/t/676/assets/remove-products-BD-olmEp.js

js horze.eu collected 2026-09-24 11:36:11 UTC 3,273 bytes, 9 lines download raw bytes

1import{i as g,n as m,t as I}from"./vendor-lit-reactive-element-Cjcwuima.js";import{x as b}from"./vendor-lit-html-nFsY_NSA.js";import{r as q}from"./vendor-lit-element-CtcYdrtK.js";import{b as A,a as v}from"./main-DqQb9x5n.js";import"./vendor-vue-runtime-dom-Dqgu9pQP.js";import"./vendor-vue-runtime-core-DAnRjgOf.js";import"./vendor-vue-reactivity-Df4oAq-x.js";import"./vendor-vue-shared-D3_Apz_L.js";import"./ds-Bp-orcBC.js";import"./vendor-lit-context-BDzdL6mz.js";var C=Object.defineProperty,P=Object.getOwnPropertyDescriptor,h=(i,r,t,e)=>{for(var s=e>1?void 0:e?P(r,t):r,n=i.length-1,o;n>=0;n--)(o=i[n])&&(s=(e?o(r,t,s):o(s))||s);return e&&s&&C(r,t,s),s};let d=class extends q{get button(){return this.querySelector("button")||this}constructor(){super()}firstUpdated(){var i,r;this.product&&(this.button.addEventListener("click",this.handleClick.bind(this)),this.product.id=typeof this.product.id=="string"?parseInt(this.product.id):this.product.id,this.product.quantity=typeof this.product.quantity=="string"?parseInt(this.product.quantity):this.product.quantity,this.product.accessories=((r=(i=this.product)==null?void 0:i.accessories)==null?void 0:r.map(t=>({id:typeof t.id=="string"?parseInt(t.id):t.id,quantity:typeof t.quantity=="string"?parseInt(t.quantity):t.quantity,relationshipId:typeof t.relationshipId=="string"?parseInt(t.relationshipId):t.relationshipId})))||[])}disconnectedCallback(){super.disconnectedCallback(),this.button.removeEventListener("click",this.handleClick)}getQuantityById(i){const r=typeof i=="string"?parseInt(i):i;if((typeof this.product.id=="string"?parseInt(this.product.id):this.product.id)===r)return typeof this.product.quantity=="string"?parseInt(this.product.quantity):this.product.quantity;if(!Array.isArray(this.product.accessories))return 0;const e=this.product.accessories.find(s=>(typeof s.id=="string"?parseInt(s.id):s.id)===r);return e?typeof e.quantity=="string"?parseInt(e.quantity):e.quantity:0}async handleClick(){let i=null;const r=this.closest("cart-form"),t=this.closest("cart-item");if(!r){console.error("Cart form not found");return}const e=[r.getAttribute("data-section-id")];if(t&&t.toggleAttribute("data-loading",!0),r.toggleAttribute("data-loading",!0),!this.product||(i=await A(),!i||!Array.isArray(i.items)))return;const s=new Set([typeof this.product.id=="string"?parseInt(this.product.id):this.product.id]);Array.isArray(this.product.accessories)&&this.product.accessories.forEach(o=>{if(o.id){const c=typeof o.id=="string"?parseInt(o.id):o.id;s.add(c)}});const n={};i.items.forEach(o=>{var p;const c=o.id,a=typeof this.product.id=="string"?parseInt(this.product.id):this.product.id,f=String(this.product.relationshipId??""),y=c===a,u=(p=o.properties)==null?void 0:p._main_product,l=!!u&&u[a]===f;(y||l||s.has(c))&&(n[c]=0)});try{await v(n,e)}catch(o){console.error("Error updating cart:",o)}finally{t&&t.isConnected&&t.toggleAttribute("data-loading",!1),r&&r.isConnected&&r.toggleAttribute("data-loading",!1)}}render(){return b`<slot></slot>`}};d.styles=g`
2        :host {
3            cursor: pointer;
4        }
5
6        ::slotted(button) {
7            cursor: pointer;
8        }
9    `;h([m({type:Object,attribute:!0})],d.prototype,"product",2);d=h([I("remove-products")],d);export{d as RemoveProducts};

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.