(function(shopify) { (()=>{var X="WebPixel::Render";var g=o=>shopify.extend(X,o);var Q="https://connect.facebook.net/en_US/fbevents.js",Y=["default","title","default title",""];function Z(){window.fbq&&typeof window.fbq=="function"||(window.fbq=function(){window.fbq.callMethod?window.fbq.callMethod.apply(window.fbq,arguments):window.fbq.queue.push(arguments)},window._fbq||(window._fbq=window.fbq),window.fbq.push=window.fbq,window.fbq.loaded=!0,window.fbq.version="2.0",window.fbq.queue=[])}function H(){let o=document.createElement("script");return o.setAttribute("async","true"),o.setAttribute("src",Q),o}function $(){var h;let o=document.getElementsByTagName("script")[0];o===void 0?document.head.appendChild(H()):(h=o.parentNode)==null||h.insertBefore(H(),o)}Z();$();g(({analytics:o,browser:h,settings:K,init:G,customerPrivacy:J})=>{let k=K.pixel_id;function f(t,n,c={},a={}){window.fbq("trackShopify",k,t,c,{eventID:n},a)}function w(t){let n=[],c=t.data.checkout.lineItems;if(c!=null)for(let a of c){let i=a.variant.product.id||a.variant.id||a.variant.sku;i!=null&&n.push(parseInt(i))}return n}function q(t){let n=t.data.checkout.lineItems;if(n!=null){for(let c of n)if(c.variant.product.id)return"product_group"}return"product"}function I(t){let n=[],c=t.data.checkout.lineItems;if(c!=null)for(let a of c){let i=a.variant.id||a.variant.sku||a.variant.product.id;i!=null&&n.push(parseInt(i))}return n}function C(t){let n=t.data.checkout.lineItems;if(n!=null){for(let c of n)if(c.variant.id||c.variant.sku)return"product"}return"product_group"}function A(t){let n=0,c=t.data.checkout.lineItems;if(c!=null)for(let a of c)n+=a.quantity||1;return n}function L(t){var a;let n=[],c=t.data.checkout.lineItems;if(c!=null)for(let i of c){let d=i.variant.product.id||i.variant.id||i.variant.sku,e=i.variant.id||i.variant.sku||i.variant.product.id;if(d!=null&&e!=null){let r={};r.id=d?parseInt(d):null,r.sku=e?parseInt(e):null,r.item_price=(a=i.variant.price)==null?void 0:a.amount,r.quantity=i.quantity||1,r.currency=t.data.checkout.currencyCode||"USD",n.push(r)}}return n}function V(t,n){return n==null||Y.includes(n.toLowerCase())?t||"":t+" - "+n}function y(t){var c,a,i,d,e,r,s,l,m,u,p,_;let n={};n.ct=((c=t.data.checkout.billingAddress)==null?void 0:c.city)||((a=t.data.checkout.shippingAddress)==null?void 0:a.city),n.country=((i=t.data.checkout.billingAddress)==null?void 0:i.countryCode)||((d=t.data.checkout.shippingAddress)==null?void 0:d.countryCode),n.fn=((e=t.data.checkout.billingAddress)==null?void 0:e.firstName)||((r=t.data.checkout.shippingAddress)==null?void 0:r.firstName),n.ln=((s=t.data.checkout.billingAddress)==null?void 0:s.lastName)||((l=t.data.checkout.shippingAddress)==null?void 0:l.lastName),n.ph=t.data.checkout.phone,n.st=((m=t.data.checkout.billingAddress)==null?void 0:m.provinceCode)||((u=t.data.checkout.shippingAddress)==null?void 0:u.provinceCode),n.zp=((p=t.data.checkout.billingAddress)==null?void 0:p.zip)||((_=t.data.checkout.shippingAddress)==null?void 0:_.zip),n.em=t.data.checkout.email,window.fbq("set","userData",n)}function P(t){t?window.fbq("dataProcessingOptions",[]):window.fbq("dataProcessingOptions",["LDU"],0,0)}let b=G.customerPrivacy.saleOfDataAllowed;P(b),window.fbq("init",k,{},{agent:"shopify_web_pixel"}),J.subscribe("visitorConsentCollected",t=>{b=t.customerPrivacy.saleOfDataAllowed,P(b)}),o.subscribe("page_viewed",t=>{f("PageView",t.id)}),o.subscribe("search_submitted",t=>{let n=t.data.searchResult.query||"";f("Search",t.id,{search_string:n})}),o.subscribe("product_viewed",t=>{let n=t.data.productVariant.product.id||t.data.productVariant.id||t.data.productVariant.sku,c=n?[parseInt(n)]:[],a=t.data.productVariant.product.id?"product_group":"product",i=V(t.data.productVariant.product.title,t.data.productVariant.title),d=t.data.productVariant.product.type||"",e=t.data.productVariant.price.currencyCode||"USD",r=t.data.productVariant.price.amount,s=t.data.productVariant.id||t.data.productVariant.sku||t.data.productVariant.product.id,l=s?[parseInt(s)]:[],m=t.data.productVariant.id||t.data.productVariant.sku?"product":"product_group",u={};u.id=n?parseInt(n):null,u.sku=s?parseInt(s):null,u.item_price=r,u.quantity=1,u.currency=e;let p=[u];f("ViewContent",t.id,{content_ids:c,content_type:a,content_name:i,content_category:d,currency:e,value:r},{product_variant_ids:l,content_type_favor_variant:m,contents:p})}),o.subscribe("product_added_to_cart",t=>{var D,S,N,O,x,T,E,U,F,R,j,z,B,M,W;let n=((D=t.data.cartLine)==null?void 0:D.merchandise.product.id)||((S=t.data.cartLine)==null?void 0:S.merchandise.id)||((N=t.data.cartLine)==null?void 0:N.merchandise.sku),c=n?[parseInt(n)]:[],a=(O=t.data.cartLine)!=null&&O.merchandise.product.id?"product_group":"product",i=V((x=t.data.cartLine)==null?void 0:x.merchandise.product.title,(T=t.data.cartLine)==null?void 0:T.merchandise.title),d=((E=t.data.cartLine)==null?void 0:E.merchandise.product.type)||"",e=((U=t.data.cartLine)==null?void 0:U.merchandise.price.currencyCode)||"USD",r=(F=t.data.cartLine)==null?void 0:F.merchandise.price.amount,s=((R=t.data.cartLine)==null?void 0:R.quantity)||1,l=((j=t.data.cartLine)==null?void 0:j.merchandise.id)||((z=t.data.cartLine)==null?void 0:z.merchandise.sku)||((B=t.data.cartLine)==null?void 0:B.merchandise.product.id),m=l?[parseInt(l)]:[],u=(M=t.data.cartLine)!=null&&M.merchandise.id||(W=t.data.cartLine)!=null&&W.merchandise.sku?"product":"product_group",p={};p.id=n?parseInt(n):null,p.sku=l?parseInt(l):null,p.item_price=r,p.quantity=s,p.currency=e;let _=[p];f("AddToCart",t.id,{content_ids:c,content_type:a,content_name:i,content_category:d,currency:e,value:r,num_items:s},{product_variant_ids:m,content_type_favor_variant:u,contents:_})}),o.subscribe("checkout_started",t=>{y(t);let n=w(t),c=q(t),a=t.data.checkout.currencyCode||"USD",i=t.data.checkout.subtotalPrice.amount,d=A(t),e=I(t),r=C(t),s=L(t);f("InitiateCheckout",t.id,{content_ids:n,content_type:c,currency:a,value:i,num_items:d},{product_variant_ids:e,content_type_favor_variant:r,contents:s})}),o.subscribe("checkout_completed",t=>{y(t);let n=w(t),c=q(t),a=t.data.checkout.currencyCode||"USD",i=t.data.checkout.totalPrice.amount,d=A(t),e=I(t),r=C(t),s=L(t);f("Purchase",t.id,{content_ids:n,content_type:c,currency:a,value:i,num_items:d},{product_variant_ids:e,content_type_favor_variant:r,contents:s})}),o.subscribe("payment_info_submitted",t=>{y(t);let n=t.data.checkout.currencyCode||"USD",c=t.data.checkout.totalPrice.amount;f("AddPaymentInfo",t.id,{currency:n,value:c})})});})(); })(self.webPixelsManager.createShopifyExtend('193298613', 'app'));