{"version":3,"file":"AvoidLayoutJumping_Prod.D8NAcFS4.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/6Zs9CjkPbKzHjoy8LK08/iqoIwmJw4hztafi4V4IV/Fb_pixel.js","https:/framerusercontent.com/modules/h8ioHyt4BUxuvVCE1Q10/aTM6mEMGlM19JjX8exDe/AvoidLayoutJumping_Prod.js"],"sourcesContent":["/*\n * Framer Commerce\n * Confidential and Proprietary - All Rights Reserved\n */// Utility function to clean Shopify GID to just the numeric ID\nconst cleanShopifyId=gid=>gid?.split(\"/\").pop()||\"\";/**\n * Check if marketing consent is granted\n * Uses the global FCConsentManager if available\n */const checkMarketingConsent=()=>{if(typeof window!==\"undefined\"&&window.FCConsentManager){const consent=window.FCConsentManager.getConsent();// Check marketing consent from the consent manager\nreturn consent.marketing===true;}// No FCConsentManager = allow tracking (Framer's approach)\n// Pass the GDPR compliance decision to the project owner\nreturn true;};// Standardized Facebook Pixel AddToCart tracking function\nexport const trackFacebookPixelAddToCart=data=>{// Check consent before tracking\nif(!checkMarketingConsent()){// Silently skip tracking - no consent\nreturn;}if(typeof fbq!==\"function\"){console.warn(\"Facebook Pixel not available\");return;}const{variant,product,quantity=1,currency=\"USD\"}=data;if(!variant||!product){console.warn(\"Missing variant or product data for Facebook Pixel tracking\");return;}const item_id=cleanShopifyId(variant.id);const item_name=product.title||\"\";const item_variant=variant.title||\"\";const price=parseFloat(variant.price?.amount||\"0\");const value=price*quantity;const finalCurrency=variant.price?.currencyCode||currency;// Validate required data\nif(!item_id||!item_name||price<=0){console.warn(\"❌ Skipping Facebook Pixel AddToCart: missing required data\",{item_id,item_name,price,value});return;}const fbqData={content_type:\"product\",content_ids:[item_id],content_name:item_name,content_category:product.productType||\"\",content_brand:product.vendor||\"\",value:parseFloat(value.toFixed(2)),currency:finalCurrency,contents:[{id:item_id,price:parseFloat(price.toFixed(2)),quantity:parseInt(quantity.toString())}]};// console.log('[Facebook Pixel] Firing AddToCart', item_id, item_name);\n// console.log('[Facebook Pixel] AddToCart with data:', fbqData);\n// console.log('[Facebook Pixel] AddToCart timestamp:', new Date().toISOString());\nfbq(\"track\",\"AddToCart\",fbqData,{eventID:\"addtocart_\"+Date.now()});};// Standardized Facebook Pixel InitiateCheckout tracking function\nexport const trackFacebookPixelInitiateCheckout=data=>{// Check consent before tracking\nif(!checkMarketingConsent()){// Silently skip tracking - no consent\nreturn;}if(typeof fbq!==\"function\"){console.warn(\"Facebook Pixel not available\");return;}const{variant,product,quantity=1,currency=\"USD\",value:providedValue,content_ids:providedContentIds,content_name:providedContentName,num_items:providedNumItems}=data;let fbqData={content_type:\"product\",currency:currency};// If we have variant and product data, calculate from them\nif(variant&&product){const item_id=cleanShopifyId(variant.id);const item_name=product.title||\"\";const price=parseFloat(variant.price?.amount||\"0\");const calculatedValue=price*quantity;const finalCurrency=variant.price?.currencyCode||currency;// Validate required data\nif(!item_id||!item_name||price<=0){console.warn(\"❌ Skipping Facebook Pixel InitiateCheckout: missing required data\",{item_id,item_name,price,calculatedValue});return;}fbqData={content_type:\"product\",content_ids:[item_id],content_name:item_name,content_category:product.productType||\"\",content_brand:product.vendor||\"\",value:parseFloat(calculatedValue.toFixed(2)),currency:finalCurrency,num_items:parseInt(quantity.toString())};}else if(providedContentIds&&providedValue!==undefined){// Ensure providedValue is a valid number\nconst numericValue=typeof providedValue===\"number\"?providedValue:parseFloat(providedValue)||0;fbqData={content_type:\"product\",content_ids:providedContentIds,content_name:providedContentName||\"Checkout\",value:parseFloat(numericValue.toFixed(2)),currency:currency,num_items:parseInt((providedNumItems||1).toString())};}else{console.warn(\"❌ Skipping Facebook Pixel InitiateCheckout: insufficient data\",data);return;}// console.log('[Facebook Pixel] Firing InitiateCheckout', fbqData.content_ids?.[0], fbqData.content_name);\n// console.log('[Facebook Pixel] InitiateCheckout with data:', fbqData);\n// console.log('[Facebook Pixel] InitiateCheckout timestamp:', new Date().toISOString());\n// Use sendBeacon if requested, otherwise use regular tracking\nconst eventOptions={eventID:\"initiatecheckout_\"+Date.now()};if(data.useBeacon){fbq(\"track\",\"InitiateCheckout\",fbqData,{...eventOptions,transport:\"beacon\"});}else{fbq(\"track\",\"InitiateCheckout\",fbqData,eventOptions);}};// Standardized Facebook Pixel RemoveFromCart tracking function\nexport const trackFacebookPixelRemoveFromCart=data=>{// Check consent before tracking\nif(!checkMarketingConsent()){// Silently skip tracking - no consent\nreturn;}if(typeof fbq!==\"function\"){console.warn(\"Facebook Pixel not available\");return;}const{lineItem,currency=\"USD\"}=data;if(!lineItem){console.warn(\"Missing lineItem data for Facebook Pixel RemoveFromCart tracking\");return;}const item_id=cleanShopifyId(lineItem.merchandise.id);const item_name=lineItem.merchandise.product?.title||\"\";const item_variant=lineItem.merchandise.title||\"\";const price=parseFloat(lineItem.cost.subtotalAmount.amount||\"0\");const quantity=lineItem.quantity||1;const value=price*quantity;const finalCurrency=lineItem.cost.subtotalAmount.currencyCode||currency;// Validate required data\nif(!item_id||!item_name||price<=0){console.warn(\"❌ Skipping Facebook Pixel RemoveFromCart: missing required data\",{item_id,item_name,price,value,quantity});return;}const fbqData={content_type:\"product\",content_ids:[item_id],content_name:item_name,content_category:lineItem.merchandise.product?.productType||\"\",content_brand:lineItem.merchandise.product?.vendor||\"\",value:parseFloat(value.toFixed(2)),currency:finalCurrency,contents:[{id:item_id,price:parseFloat(price.toFixed(2)),quantity:parseInt(quantity.toString())}]};// console.log('[Facebook Pixel] Firing RemoveFromCart with data:', fbqData);\nfbq(\"track\",\"RemoveFromCart\",fbqData,{eventID:\"removefromcart_\"+Date.now()});};// Standardized Facebook Pixel ViewContent tracking function\nexport const trackFacebookPixelViewContent=data=>{// Check consent before tracking\nif(!checkMarketingConsent()){// Silently skip tracking - no consent\nreturn;}if(typeof fbq!==\"function\"){console.warn(\"Facebook Pixel not available\");return;}const{variant,product,currency=\"USD\"}=data;if(!product){console.warn(\"Missing product data for Facebook Pixel ViewContent tracking\");return;}const item_id=variant?cleanShopifyId(variant.id):cleanShopifyId(product.id);const item_name=product.title||\"\";const item_variant=variant?.title||\"\";const price=variant?parseFloat(variant.price?.amount||\"0\"):parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\");const finalCurrency=variant?.price?.currencyCode||product.priceRange?.minVariantPrice?.currencyCode||currency;// Validate required data\nif(!item_id||!item_name||price<=0){console.warn(\"❌ Skipping Facebook Pixel ViewContent: missing required data\",{item_id,item_name,price});return;}const fbqData={content_type:\"product\",content_ids:[item_id],content_name:item_name,content_category:product.productType||\"\",content_brand:product.vendor||\"\",value:parseFloat(price.toFixed(2)),currency:finalCurrency};// console.log('[Facebook Pixel] Firing ViewContent with data:', fbqData);\nfbq(\"track\",\"ViewContent\",fbqData,{eventID:\"viewcontent_\"+Date.now()});};export default function initializeFacebookPixel(facebookPixelId){!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments);};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version=\"2.0\";n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;// Add onload and onerror event handlers\nt.onload=()=>{if(typeof fbq!==\"undefined\"){fbq(\"init\",facebookPixelId);fbq(\"track\",\"PageView\");}else{// Handle case where fbq is not defined\n}};t.onerror=()=>{// Handle Facebook Pixel script load failure\n};s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s);}(window,document,\"script\",\"https://connect.facebook.net/en_US/fbevents.js\");}\nexport const __FramerMetadata__ = {\"exports\":{\"trackFacebookPixelRemoveFromCart\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"trackFacebookPixelAddToCart\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"trackFacebookPixelViewContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"trackFacebookPixelInitiateCheckout\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Fb_pixel.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n *\n * @framerDisableUnlink\n */export default function AvoidLayoutJumping({direction,style}){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const rafId=useRef();const vertical=direction===\"vertical\"||direction===\"both\";const horizontal=direction===\"horizontal\"||direction===\"both\";useEffect(()=>{if(isCanvas)return;const parent=ref.current?.parentElement?.parentElement;if(!parent)return;const container=parent.parentElement;if(!container)return;const updateSize=()=>{const rect=parent.getBoundingClientRect();if(horizontal){container.style.width=`${rect.width}px`;}if(vertical){container.style.height=`${rect.height}px`;}rafId.current=requestAnimationFrame(updateSize);};// Start the RAF loop\nrafId.current=requestAnimationFrame(updateSize);return()=>{if(rafId.current){cancelAnimationFrame(rafId.current);}if(container){if(horizontal){container.style.width=\"\";}if(vertical){container.style.height=\"\";}}};},[direction]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...style}});}AvoidLayoutJumping.displayName=\"Layout Jump Preventer\";addPropertyControls(AvoidLayoutJumping,{direction:{type:ControlType.Enum,defaultValue:\"vertical\",options:[\"vertical\",\"horizontal\",\"both\"],optionTitles:[\"Vertical\",\"Horizontal\",\"Both\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",// @ts-ignore\noptionIcons:[\"direction-vertical\",\"direction-horizontal\",\"direction-all\"],description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AvoidLayoutJumping\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata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