{"version":3,"file":"AppendUTM.BC2RJSip.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/JGJHLdRXhaKcj26AnwfP/2ln5c5Dw2kIka2WqBJqw/AppendUTM.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";export function withUTMParams(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const handleClick=event=>{const button=event.currentTarget;// Find the anchor element inside the button (if any)\nconst anchor=button.tagName===\"A\"?button:button.querySelector(\"a\");if(!anchor||!(anchor instanceof HTMLAnchorElement))return;let checkoutURL=anchor.href;if(!checkoutURL)return;const urlParams=new URLSearchParams(window.location.search);if(urlParams.toString()){const separator=checkoutURL.includes(\"?\")?\"&\":\"?\";anchor.href=checkoutURL+separator+urlParams.toString();}props.onClick?.(event);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick});});}export function AppendUTM(){return{onClick:event=>{const button=event.currentTarget// General type first\n;// Find the anchor element inside the button (if any)\nconst anchor=button.tagName===\"A\"?button:button.querySelector(\"a\");if(!anchor||!(anchor instanceof HTMLAnchorElement))return;// Skip if no valid link\nlet checkoutURL=anchor.href;if(!checkoutURL)return;const urlParams=new URLSearchParams(window.location.search);if(urlParams.toString()){const separator=checkoutURL.includes(\"?\")?\"&\":\"?\";anchor.href=checkoutURL+separator+urlParams.toString();}}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withAppendUTM(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...AppendUTM(props)});};}withAppendUTM.displayName=\"AppendUTM\";\nexport const __FramerMetadata__ = {\"exports\":{\"withAppendUTM\":{\"type\":\"reactHoc\",\"name\":\"withAppendUTM\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"AppendUTM\":{\"type\":\"override\",\"name\":\"AppendUTM\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUTMParams\":{\"type\":\"reactHoc\",\"name\":\"withUTMParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AppendUTM.map"],"mappings":"gSAAyE,SAAgB,EAAc,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAY,GAAO,CAAC,IAAM,EAAO,EAAM,cACtM,EAAO,EAAO,UAAU,IAAI,EAAO,EAAO,cAAc,IAAI,CAAC,GAAG,CAAC,GAAQ,EAAE,aAAkB,mBAAmB,OAAO,IAAI,EAAY,EAAO,KAAK,GAAG,CAAC,EAAY,OAAO,IAAM,EAAU,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,GAAG,EAAU,UAAU,CAAC,CAAC,IAAM,EAAU,EAAY,SAAS,IAAI,CAAC,IAAI,IAAI,EAAO,KAAK,EAAY,EAAU,EAAU,UAAU,CAAE,EAAM,UAAU,EAAM,EAAG,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,QAAQ,EAAY,CAAC,EAAG,CAAE,SAAgB,GAAW,CAAC,MAAM,CAAC,QAAQ,GAAO,CAAC,IAAM,EAAO,EAAM,cAEvhB,EAAO,EAAO,UAAU,IAAI,EAAO,EAAO,cAAc,IAAI,CAAC,GAAG,CAAC,GAAQ,EAAE,aAAkB,mBAAmB,OACtH,IAAI,EAAY,EAAO,KAAK,GAAG,CAAC,EAAY,OAAO,IAAM,EAAU,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,GAAG,EAAU,UAAU,CAAC,CAAC,IAAM,EAAU,EAAY,SAAS,IAAI,CAAC,IAAI,IAAI,EAAO,KAAK,EAAY,EAAU,EAAU,UAAU,GAAI,CAAqJ,SAAgB,EAAc,EAAE,CAAC,MAAO,KAAQ,EAA+BA,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAU,EAAM,CAAC,CAAC,uBAJngB,IAA8B,IAIgU,CAAyK,EAAc,YAAY"}