{
  "version": 3,
  "sources": ["/cdn/shop/t/56/assets/shopify-cart.js?cb=1"],
  "sourcesContent": ["/* Shopify Cart API adapter. Loaded only by the theme; app.js keeps the prototype store. */\nwindow.createAuraShopifyCart = D => {\n  const root = window.AURA_ROUTES?.root || '/';\n  const url = path => root.replace(/\\/?$/, '/') + path;\n  let queue = Promise.resolve(), sequence = Date.now();\n  const request = async (path, body) => {\n    const res = await fetch(url(path), { credentials: 'same-origin', cache: 'no-store',\n      ...(body ? { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) } : {}) });\n    const result = await res.json();\n    if (!res.ok) throw new Error(result.description || result.message || 'The cart could not be updated. Please try again.');\n    return result;\n  };\n  const cart = {\n    items: [], attributes: {}, total: 0, discounts: [], loading: true,\n    variantFor(handle, mode = 'pro', color = null) {\n      const p = D.byHandle(handle);\n      return p?.variants?.find(v => v.mode === mode && (!p.colors?.length || !color || v.color === color)) || null;\n    },\n    priceOf: line => line.unitPrice,\n    count() { return this.items.reduce((sum, line) => sum + line.qty, 0); },\n    subtotal() { return this.total; },\n    discountTotal() { return this.discounts.reduce((sum, d) => sum + d.amount, 0); },\n    compareTotal() { return this.items.reduce((sum, l) => sum + Math.max(l.compare || 0, l.unitPrice) * l.qty, 0); },\n    hasPro() { return this.items.some(l => l.variant === 'pro'); },\n    apply(state) {\n      this.attributes = state.attributes || {}; this.total = state.total_price / 100;\n      // Discounts Shopify applied (the automatic bundle discount, or a code), one row per title.\n      // Each line also keeps its total after them (finalTotal), which the cart shows.\n      const off = new Map();\n      for (const line of state.items) for (const a of line.line_level_discount_allocations || []) off.set(a.discount_application.title, (off.get(a.discount_application.title) || 0) + a.amount / 100);\n      for (const a of state.cart_level_discount_applications || []) off.set(a.title, (off.get(a.title) || 0) + a.total_allocated_amount / 100);\n      this.discounts = [...off].map(([title, amount]) => ({ title, amount })).filter(d => d.amount > 0);\n      this.items = state.items.map((line, i) => {\n        // option names as a store really has them (\"Instalaltion\", \" Installation\", \"Color\")\n        const options = line.options_with_values || [];\n        const installation = options.find(o => /instal/i.test(o.name))?.value || options[0]?.value || '';\n        const variant = /diy|delivered/i.test(installation) ? 'diy' : 'pro';\n        const colour = options.find(o => /colou?r/i.test(o.name))?.value || null;\n        // A deleted/unpublished product can remain in a real cart. Keep its line usable.\n        if (!D.byHandle(line.handle)) {\n          const p = { handle: line.handle, name: line.product_title, type: line.product_type, url: line.url,\n            images: [line.image || D.asset('assets/img/shop-all.webp')], price: [line.price / 100, line.price / 100], compare: 0, tint: '#E8E5DF', variants: [] };\n          D.rememberCartProduct(p);\n        }\n        const p = D.byHandle(line.handle);\n        return { key: line.key, handle: line.handle, variant, color: colour,\n          qty: line.quantity, variantId: line.variant_id, unitPrice: line.original_price / 100,\n          finalTotal: line.final_line_price / 100,\n          lineDiscounts: (line.line_level_discount_allocations || []).map(a => ({ title: a.discount_application.title, amount: a.amount / 100 })),\n          compare: p.variants?.find(v => v.id === line.variant_id)?.compare || p.compare || 0,\n          properties: line.properties || {}, image: line.image, sellingPlan: line.selling_plan_allocation?.selling_plan?.id,\n          position: Number(line.properties?._aura_position) || i };\n      }).sort((a, b) => a.position - b.position);\n      this.loading = false;\n      document.dispatchEvent(new CustomEvent('cart:change', { detail: state }));\n      return state;\n    },\n    async refresh() { return this.apply(await request('cart.js')); },\n    run(work) {\n      const result = queue.then(async () => {\n        document.documentElement.classList.add('is-cart-busy');\n        try { return await work(); }\n        catch (error) {\n          this.loading = false;\n          window.A?.toast(window.A.esc(error.message));\n          document.dispatchEvent(new CustomEvent('cart:error', { detail: error.message }));\n          await this.refresh().catch(() => {});\n          return false;\n        } finally { document.documentElement.classList.remove('is-cart-busy'); }\n      });\n      queue = result.catch(() => {});\n      return result;\n    },\n    add(handle, mode = 'pro', color = null, qty = 1, properties = {}) {\n      return this.run(async () => {\n        if (color && !D.byHandle(handle)?.colors?.length) { properties = { Configuration: color, ...properties }; color = null; }\n        const variant = this.variantFor(handle, mode, color);\n        if (!variant?.available) throw new Error('This option is currently unavailable. Please choose another option.');\n        const existing = this.items.find(l => l.variantId === variant.id &&\n          JSON.stringify(Object.fromEntries(Object.entries(l.properties).filter(([k]) => !k.startsWith('_')))) === JSON.stringify(properties));\n        await request('cart/add.js', { items: [{ id: variant.id, quantity: Math.max(1, Number(qty) || 1),\n          properties: { ...properties, _aura_position: String(existing?.position ?? ++sequence) } }] });\n        await this.refresh();\n        document.querySelectorAll('[data-cart-count]').forEach(b => { b.classList.remove('is-bump'); void b.offsetWidth; b.classList.add('is-bump'); });\n        return true;\n      });\n    },\n    set(key, qty) { return this.run(async () => { await request('cart/change.js', { id: key, quantity: Math.max(0, Math.min(20, Number(qty) || 0)) }); await this.refresh(); return true; }); },\n    remove(key) { return this.set(key, 0); },\n    clear() { return this.run(async () => { await request('cart/clear.js', {}); await this.refresh(); return true; }); },\n    setVariant(key, mode) {\n      return this.run(async () => {\n        const line = this.items.find(l => l.key === key); if (!line || line.variant === mode) return true;\n        const variant = this.variantFor(line.handle, mode, line.color);\n        if (!variant?.available) throw new Error('This installation option is currently unavailable.');\n        const properties = { ...line.properties, _aura_position: String(line.position) };\n        const added = await request('cart/add.js', { items: [{ id: variant.id, quantity: line.qty, properties,\n          ...(line.sellingPlan ? { selling_plan: line.sellingPlan } : {}) }] });\n        try { await request('cart/change.js', { id: key, quantity: 0 }); }\n        catch (error) {\n          // Retain the original line if removal fails, and undo just this addition.\n          const newLine = added.items[0];\n          await request('cart/change.js', { id: newLine.key, quantity: Math.max(0, newLine.quantity - line.qty) });\n          throw error;\n        }\n        await this.refresh(); return true;\n      });\n    },\n    setAttributes(attributes) { return this.run(async () => { this.apply(await request('cart/update.js', { attributes })); return true; }); },\n    idle() { return queue; },\n  };\n  cart.ready = cart.run(() => cart.refresh());\n  return cart;\n};\n"],
  "mappings": "AACA,OAAO,sBAAwB,GAAK,CAClC,MAAM,KAAO,OAAO,aAAa,MAAQ,IACnC,IAAM,MAAQ,KAAK,QAAQ,OAAQ,GAAG,EAAI,KAChD,IA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