1/*! Copyright 2025 SweetCode. All rights reserved. */ 2(self.webpackChunkPixel_Manager_for_WooCommerce=self.webpackChunkPixel_Manager_for_WooCommerce||[]).push([[236],{8875(){!function(e,t){e.registerAdapter("openai",new class{adapt(e,t,n){if(!pmwDataLayer?.pixels?.openai?.pixel_id)return null;const a={page_view:()=>this.adaptPageView(e),view_item:()=>this.adaptViewContent(e),add_to_cart:()=>this.adaptAddToCart(e),begin_checkout:()=>this.adaptStartCheckout(e),purchase:()=>this.adaptPurchase(e),account_created:()=>this.adaptAccountCreated(e)};return a[t]?a[t]():null}getBaseData(){return"function"==typeof e.getOpenAIBaseData?e.getOpenAIBaseData():{timestamp_ms:Date.now(),source_url:window.location.href}}adaptPageView(t){const n=this.getBaseData();return n.event_id=e.getRandomEventId(),n.event_name="page_viewed",n.event_data={type:"contents"},n}adaptAccountCreated(t){const n=this.getBaseData();return n.event_id=e.getRandomEventId(),n.event_name="registration_completed",n.event_data={type:"customer_action"},n}buildContent(n,a,r){const i={id:e.getProductIdForSpecificPixel(n,"openai"),name:n.name,content_type:"product",quantity:a};return n.price!==t&&null!==n.price&&""!==n.price&&(i.amount=e.openaiToMinorUnits(n.price,r),i.currency=r),i}adaptViewContent(t){if(!t?.product)return null;const n=t.product,a=e.getProductCurrency(n),r=this.getBaseData();return r.event_id=e.getRandomEventId(),r.event_name="contents_viewed",r.event_data={type:"contents",amount:e.openaiToMinorUnits(n.price,a),currency:a,contents:[this.buildContent(n,1,a)]},r}adaptAddToCart(t){if(!t?.product)return null;const n=t.product,a=n.quantity||1,r=e.getProductCurrency(n),i=this.getBaseData();return i.event_id=e.getRandomEventId(),i.event_name="items_added",i.event_data={type:"contents",amount:e.openaiToMinorUnits(n.price*a,r),currency:r,contents:[this.buildContent(n,a,r)]},i}adaptStartCheckout(n){const a=n.currency||pmwDataLayer?.shop?.currency,r=pmwDataLayer?.cart&&!e.isEmptyObject(pmwDataLayer.cart)?Object.values(pmwDataLayer.cart):[],i=Array.isArray(n.items)&&n.items.length?n.items:r,o=n.value!==t?n.value:e.getCartValue(),p=this.getBaseData();return p.event_id=e.getRandomEventId(),p.event_name="checkout_started",p.event_data={type:"contents",amount:e.openaiToMinorUnits(o||0,a),currency:a,contents:i.map(e=>this.buildContent(e,e.quantity,a)).filter(e=>null!==e.id)},p}adaptPurchase(t){const n=t&&t.order||pmwDataLayer?.order;if(!n)return null;const a=n.currency||pmwDataLayer?.shop?.currency,r=Array.isArray(n.items)?n.items:Object.values(n.items||{}),i=this.getBaseData();return i.event_id=n.id?"pmw_"+n.id.toString():e.getRandomEventId(),i.event_name="order_created",i.event_data={type:"contents",amount:e.openaiToMinorUnits(n.value?.marketing??0,a),currency:a,contents:r.map(e=>this.buildContent(e,e.quantity,a)).filter(e=>null!==e.id)},i}},{supportsS2S:!0,supportsEventDeduplication:!0,supportsPageViewS2S:!0,isActive:()=>!0===pmwDataLayer?.pixels?.openai?.loaded&&!0===e.consent.categories.get().marketing,isConfigured:()=>!!pmwDataLayer?.pixels?.openai?.pixel_id})}(window.pmw=window.pmw||{})},7482(){pmw.bus.on("pmw:load-pixels",()=>{pmwDataLayer?.pixels?.openai?.pixel_id&&!pmwDataLayer?.pixels?.openai?.loaded&&pmw.consent.canPixelBeFired("marketing","OpenAI")&&pmw.loadOpenAIPixel()}),pmw.bus.on("pmw:pixel:page-view",e=>{try{if(pmw.canNotFireOpenAIEvent())return;if(!pmw.shouldFireBrowserPixel(e,"openai"))return;const t=e.pixels?.openai;if(!t)return;oaiq("measure",t.event_name,t.event_data,{event_id:t.event_id}),pmw.console.log("OpenAI Pixel: page_viewed event sent",t.event_data)}catch(e){console.error(e)}}),pmw.bus.on("pmw:pixel:add-to-cart",e=>{try{if(pmw.canNotFireOpenAIEvent())return;if(!pmw.shouldFireBrowserPixel(e,"openai"))return;const t=e.pixels?.openai;if(!t)return;oaiq("measure",t.event_name,t.event_data,{event_id:t.event_id}),pmw.console.log("OpenAI Pixel: items_added event sent",t.event_data)}catch(e){console.error(e)}}),pmw.bus.on("pmw:pixel:view-item",e=>{try{if(pmw.canNotFireOpenAIEvent())return;if(!pmw.shouldFireBrowserPixel(e,"openai"))return;const t=e.pixels?.openai;if(!t)return;oaiq("measure",t.event_name,t.event_data,{event_id:t.event_id}),pmw.console.log("OpenAI Pixel: contents_viewed event sent",t.event_data)}catch(e){console.error(e)}}),pmw.bus.on("pmw:pixel:begin-checkout",e=>{try{if(pmw.canNotFireOpenAIEvent())return;if(!pmw.shouldFireBrowserPixel(e,"openai"))return;const t=e.pixels?.openai;if(!t)return;oaiq("measure",t.event_name,t.event_data,{event_id:t.event_id}),pmw.console.log("OpenAI Pixel: checkout_started event sent",t.event_data)}catch(e){console.error(e)}}),pmw.bus.on("pmw:pixel:purchase",e=>{try{if(pmw.canNotFireOpenAIEvent())return;if(!pmw.shouldFireBrowserPixel(e,"openai"))return;const t=e.pixels?.openai;if(!t)return;oaiq("measure",t.event_name,t.event_data,{event_id:t.event_id}),pmw.console.log("OpenAI Pixel: order_created event sent",t.event_data)}catch(e){console.error(e)}}),pmw.bus.on("pmw:pixel:account-created",e=>{try{if(pmw.canNotFireOpenAIEvent())return;if(!pmw.shouldFireBrowserPixel(e,"openai"))return;const t=e.pixels?.openai;if(!t)return;oaiq("measure",t.event_name,t.event_data,{event_id:t.event_id}),pmw.console.log("OpenAI Pixel: registration_completed event sent",t.event_data)}catch(e){console.error(e)}}
2),document.addEventListener("pmw:consent:update",({detail:e})=>{try{if(!pmwDataLayer?.pixels?.openai?.loaded)return;const t=!!e?.marketing;oaiq("consent",t),pmw.console.log("OpenAI Pixel: consent updated: "+(t?"granted":"denied"))}catch(e){console.error(e)}},!0)},2193(){!function(e){e.getOpenAIPixelId=()=>pmwDataLayer.pixels.openai.pixel_id,e.getOpenAIUserData=()=>{const e={};if(!pmwDataLayer?.pixels?.openai?.advanced_matching)return e;const t=pmwDataLayer?.user;return t?.email?.sha256&&(e.email_sha256=t.email.sha256),t?.phone?.openai&&(e.phone_number_sha256=t.phone.openai),t?.id?.sha256&&(e.external_id_sha256=t.id.sha256),t?.first_name?.openai&&(e.first_name_sha256=t.first_name.openai),t?.last_name?.openai&&(e.last_name_sha256=t.last_name.openai),t?.country?.raw&&(e.country=String(t.country.raw).toUpperCase()),t?.city?.raw&&(e.city=t.city.raw),(t?.state?.openai||t?.state?.raw)&&(e.region=t.state.openai||t.state.raw),t?.postcode?.raw&&(e.postal_code=t.postcode.raw),e},e.loadOpenAIPixel=()=>{try{!function(e,t,n){if(!e.oaiq){var a=function(){a.q.push(arguments)};a.q=[],e.oaiq=a;var r=t.createElement(n);r.async=!0,r.src="https://bzrcdn.openai.com/sdk/oaiq.min.js";var i=t.getElementsByTagName(n)[0];i.parentNode.insertBefore(r,i)}}(window,document,"script");const t={pixelId:e.getOpenAIPixelId()},n=e.getOpenAIUserData();Object.keys(n).length>0&&(t.user=n),oaiq("consent",!0),oaiq("init",t),pmwDataLayer.pixels.openai.loaded=!0,e.console.log("OpenAI Pixel: pixel loaded")}catch(e){console.error(e)}},e.openaiCurrencyExponent=e=>{const t=(e||"").toUpperCase();return-1!==["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"].indexOf(t)?0:-1!==["BHD","IQD","JOD","KWD","LYD","OMR","TND"].indexOf(t)?3:2},e.openaiToMinorUnits=(t,n)=>{const a=e.openaiCurrencyExponent(n);return Math.round((Number(t)||0)*Math.pow(10,a))},e.canFireOpenAIEvent=()=>!!pmwDataLayer?.pixels?.openai?.loaded&&!!e.consent.categories.get().marketing,e.canNotFireOpenAIEvent=()=>!e.canFireOpenAIEvent()}(window.pmw=window.pmw||{})},8261(e,t,n){n(8875),n(2193),n(7482)}}]); 3//# sourceMappingURL=pixel-openai.138d9413.chunk.min.js.map
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.