{
  "version": 3,
  "sources": ["/cdn/shop/t/2/assets/openai-ads-pixel.js?cb=1784858883"],
  "sourcesContent": ["(() => {\n  const config = window.openAIAdsConfig;\n  if (!config?.pixelId) return;\n\n  let initialized = false;\n  let initialEventsSent = false;\n\n  function measure(eventName, eventData, options) {\n    if (!initialized || typeof window.oaiq !== 'function') return;\n    window.oaiq('measure', eventName, eventData, options);\n  }\n\n  function sendInitialEvents() {\n    if (initialEventsSent) return;\n    initialEventsSent = true;\n\n    measure('page_viewed', {\n      type: 'contents',\n      contents: [\n        {\n          id: window.location.pathname,\n          name: config.pageTitle,\n          content_type: 'page',\n        },\n      ],\n    });\n\n    if (config.pageType === 'product' && config.product) {\n      measure('contents_viewed', {\n        type: 'contents',\n        amount: config.product.amount,\n        currency: config.product.currency,\n        contents: [\n          {\n            id: config.product.id,\n            name: config.product.name,\n            content_type: 'product',\n            amount: config.product.amount,\n            currency: config.product.currency,\n          },\n        ],\n      });\n    }\n\n    const orderPathMatch = window.location.pathname.match(\n      /\\/checkouts\\/([^/]+)\\/(?:thank_you|post_purchase)(?:\\/|$)/\n    );\n    if (orderPathMatch) {\n      const orderStorageKey = `openai_ads_order_created_${orderPathMatch[1]}`;\n\n      try {\n        if (window.localStorage.getItem(orderStorageKey)) return;\n        window.localStorage.setItem(orderStorageKey, '1');\n      } catch (_error) {\n        // Continue when storage is unavailable so the conversion is not lost.\n      }\n\n      window.oaiq('measure', 'order_created', { type: 'contents' });\n    }\n  }\n\n  function initializePixel() {\n    if (initialized) return;\n\n    const queue = function () {\n      queue.q.push(arguments);\n    };\n    queue.q = [];\n    window.oaiq = window.oaiq || queue;\n\n    const script = document.createElement('script');\n    script.async = true;\n    script.src = 'https://bzrcdn.openai.com/sdk/oaiq.min.js';\n    document.head.appendChild(script);\n\n    window.oaiq('init', { pixelId: config.pixelId });\n    initialized = true;\n    sendInitialEvents();\n  }\n\n  function marketingAllowed() {\n    return Boolean(window.Shopify?.customerPrivacy?.marketingAllowed?.());\n  }\n\n  function initializeWhenAllowed() {\n    if (marketingAllowed()) initializePixel();\n  }\n\n  function loadConsentTracking() {\n    if (window.Shopify?.customerPrivacy) {\n      initializeWhenAllowed();\n      return;\n    }\n\n    if (typeof window.Shopify?.loadFeatures !== 'function') return;\n    window.Shopify.loadFeatures(\n      [{ name: 'consent-tracking-api', version: '0.1' }],\n      initializeWhenAllowed\n    );\n  }\n\n  document.addEventListener('visitorConsentCollected', initializeWhenAllowed);\n\n  document.addEventListener(\n    'click',\n    (event) => {\n      if (!event.target.closest('[name=\"checkout\"], a[href*=\"/checkout\"]')) return;\n      measure('checkout_started', { type: 'contents' });\n    },\n    true\n  );\n\n  document.addEventListener('DOMContentLoaded', () => {\n    loadConsentTracking();\n\n    if (typeof subscribe !== 'function' || typeof PUB_SUB_EVENTS === 'undefined') return;\n    subscribe(PUB_SUB_EVENTS.cartUpdate, (event) => {\n      if (event?.source !== 'product-form') return;\n\n      const item = event.cartData;\n      const quantity = Number(item?.quantity || 1);\n      const amount = Number(item?.final_price ?? item?.price);\n      const eventData = {\n        type: 'contents',\n        contents: [\n          {\n            id: String(event.productVariantId || item?.variant_id || item?.id || ''),\n            name: item?.product_title || item?.title || '',\n            content_type: 'product',\n            quantity,\n          },\n        ],\n      };\n\n      if (Number.isFinite(amount)) {\n        eventData.amount = amount * quantity;\n        eventData.currency = config.currency;\n        eventData.contents[0].amount = amount;\n        eventData.contents[0].currency = config.currency;\n      }\n\n      measure('items_added', eventData);\n    });\n  });\n})();\n"],
  "mappings": "CAAC,IAAM,CACL,MAAM,OAAS,OAAO,gBACtB,GAAI,CAAC,QAAQ,QAAS,OAEtB,IAAI,YAAc,GACd,kBAAoB,GAExB,SAAS,QAAQ,UAAW,UAAW,QAAS,CAC1C,CAAC,aAAe,OAAO,OAAO,MAAS,YAC3C,OAAO,KAAK,UAAW,UAAW,UAAW,OAAO,CACtD,CAEA,SAAS,mBAAoB,CAC3B,GAAI,kBAAmB,OACvB,kBAAoB,GAEpB,QAAQ,cAA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