{"version":3,"file":"MetaPixelTracker.Dbp-eHhA.mjs","names":["useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/L7WbtGZD97sfN2D4Z7id/ELxZrcjMUxDuXipejkdz/MetaPixelTracker.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function MetaPixelTracker(props){const{pixelId}=props;const resolvedPixelId=useMemo(()=>{const value=(pixelId??\"\").trim();return value.length>0?value:\"4094558604155293\";},[pixelId]);const initializeAndTrack=useCallback(()=>{if(typeof window===\"undefined\")return;if(!resolvedPixelId)return;const w=window;if(typeof w.fbq!==\"function\"){const fbq=function(...args){if(fbq.callMethod){fbq.callMethod.apply(fbq,args);}else{fbq.queue.push(args);}};fbq.push=fbq;fbq.loaded=true;fbq.version=\"2.0\";fbq.queue=[];w.fbq=fbq;w._fbq=w._fbq||fbq;}const scriptSelector='script#meta-pixel-script, script[src=\"https://connect.facebook.net/en_US/fbevents.js\"]';const existingScript=document.querySelector(scriptSelector);if(!existingScript){const script=document.createElement(\"script\");script.id=\"meta-pixel-script\";script.async=true;script.src=\"https://connect.facebook.net/en_US/fbevents.js\";const firstScript=document.getElementsByTagName(\"script\")[0];if(firstScript&&firstScript.parentNode){firstScript.parentNode.insertBefore(script,firstScript);}else{document.head.appendChild(script);}}w.fbq(\"init\",resolvedPixelId);w.fbq(\"track\",\"PageView\");},[resolvedPixelId]);useEffect(()=>{if(typeof window!==\"undefined\"){initializeAndTrack();}},[initializeAndTrack]);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{position:\"relative\",width:0,height:0,overflow:\"hidden\",pointerEvents:\"none\"}});}addPropertyControls(MetaPixelTracker,{pixelId:{type:ControlType.String,title:\"Pixel ID\",defaultValue:\"4094558604155293\",placeholder:\"Enter Meta Pixel ID\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MetaPixelTracker\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MetaPixelTracker.map"],"mappings":"sMAGG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,WAAS,EAAY,EAAgBA,MAAY,CAAC,IAAM,GAAO,GAAS,IAAI,MAAM,CAAC,OAAO,EAAM,OAAO,EAAE,EAAM,oBAAqB,CAAC,EAAQ,CAAC,CAAO,EAAmBC,MAAgB,CAAuC,GAA5B,IAAS,QAAsB,CAAC,EAAgB,OAAO,IAAM,EAAE,EAAO,GAAG,OAAO,EAAE,KAAM,WAAW,CAAC,IAAM,EAAI,SAAS,GAAG,EAAK,CAAI,EAAI,WAAY,EAAI,WAAW,MAAM,EAAI,EAAK,CAAO,EAAI,MAAM,KAAK,EAAK,EAAI,EAAI,KAAK,EAAI,EAAI,OAAO,GAAK,EAAI,QAAQ,MAAM,EAAI,MAAM,EAAE,CAAC,EAAE,IAAI,EAAI,EAAE,KAAK,EAAE,MAAM,EAA+K,GAAG,CAA1C,SAAS,cAAvH,yFAAoJ,CAAoB,CAAC,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,GAAG,oBAAoB,EAAO,MAAM,GAAK,EAAO,IAAI,iDAAiD,IAAM,EAAY,SAAS,qBAAqB,SAAS,CAAC,GAAM,GAAa,EAAY,WAAY,EAAY,WAAW,aAAa,EAAO,EAAY,CAAO,SAAS,KAAK,YAAY,EAAO,CAAG,EAAE,IAAI,OAAO,EAAgB,CAAC,EAAE,IAAI,QAAQ,WAAW,EAAG,CAAC,EAAgB,CAAC,CAA8F,OAA7F,MAAc,CAAW,IAAS,QAAa,GAAoB,EAAI,CAAC,EAAmB,CAAC,CAAqB,EAAK,MAAM,CAAC,cAAc,GAAK,MAAM,CAAC,SAAS,WAAW,MAAM,EAAE,OAAO,EAAE,SAAS,SAAS,cAAc,OAAO,CAAC,CAAC,sBAH50C,IAAiD,IAAoD,CAGyuC,EAAoB,EAAiB,CAAC,QAAQ,CAAC,KAAK,EAAY,OAAO,MAAM,WAAW,aAAa,mBAAmB,YAAY,sBAAsB,CAAC,CAAC"}