{"version":3,"file":"utils.CS2rv9hr.mjs","names":[],"sources":["https:/framerusercontent.com/modules/RFM6zI5MxOiqwwNiQep4/2CcJhEanvh9oX5JHRkd8/send.js","https:/framerusercontent.com/modules/tfq8EDfrazNLXzc9LJte/hLcdFz4t8UjInDMvzq41/utils.js"],"sourcesContent":["import{isBrowser}from\"framer-motion\";export const DEFAULT_DOMAIN=\"https://www.googletagmanager.com\";export const DEFAULT_SCRIPT_NAME=\"gtm.js\";/**\n * Function to get and set dataLayer\n * @param dataLayer - The dataLayer\n * @param dataLayerName - The dataLayer name\n */const getDataLayerSnippet=(dataLayer,dataLayerName=\"dataLayer\")=>`window['${dataLayerName}']=window['${dataLayerName}']||[];`+(dataLayer?`window['${dataLayerName}'].push(${JSON.stringify(dataLayer)});`:\"\")+`window['${dataLayerName}'].push({'gtm.start':new Date().getTime(),event:'gtm.js'})`;/**\n * Function to get the GTM script\n * @param dataLayerName - The name of the dataLayer\n * @param customDomain - Custom domain for gtm\n * @param customScriptName - Custom script file name for gtm\n * @param environment - The parameters to use a custom environment\n * @param id - The id of the container\n */const getGTMScript=(dataLayerName,id,environment,customDomain=DEFAULT_DOMAIN,customScriptName=DEFAULT_SCRIPT_NAME)=>{let params=\"\";if(environment){const{gtm_auth,gtm_preview}=environment;params=`&gtm_auth=${gtm_auth}&gtm_preview=${gtm_preview}&gtm_cookies_win=x`;}return`${customDomain}/${customScriptName}?id=${id}${dataLayerName===\"dataLayer\"?\"\":`&l=${dataLayerName}`}${params}`;};/**\n * Function to setup the Google Tag Manager\n * @param params - The snippets params\n */const setupGTM=params=>{const getDataLayerScript=()=>{const dataLayerScript=document.createElement(\"script\");if(params.nonce){dataLayerScript.setAttribute(\"nonce\",params.nonce);}dataLayerScript.innerHTML=getDataLayerSnippet(params.dataLayer,params.dataLayerName);return dataLayerScript;};const getScript=()=>{const script=document.createElement(\"script\");if(params.nonce){script.setAttribute(\"nonce\",params.nonce);}script.src=getGTMScript(params.dataLayerName,params.id,params.environment,params.customDomain,params.customScriptName);script.crossOrigin=\"anonymous\"// allows for more detailed INP collection\n;return script;};return{getDataLayerScript,getScript};};/**\n * Function to init the GTM\n * @param dataLayer - The dataLayer\n * @param dataLayerName - The dataLayer name\n * @param environment - Specify the custom environment to use\n * @param nonce - Server-generated nonce\n * @param id - The ID of the GTM\n */export const initGTM=({dataLayer,dataLayerName,environment,nonce,id,customDomain,customScriptName})=>{const gtm=setupGTM({dataLayer,dataLayerName,environment,nonce,id,customDomain,customScriptName});const dataLayerScript=gtm.getDataLayerScript();const script=gtm.getScript();document.head.append(dataLayerScript,script);};export function sendToGTM(){if(isBrowser){window[\"dataLayer\"]=window[\"dataLayer\"]||[];window[\"dataLayer\"].push(arguments);}}\nexport const __FramerMetadata__ = {\"exports\":{\"DEFAULT_DOMAIN\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEFAULT_SCRIPT_NAME\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"initGTM\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"sendToGTM\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./send.map","import{isBrowser}from\"framer-motion\";import{useLayoutEffect}from\"react\";export const DEFAULT_FONT_FAMILY=`\"Inter\", system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"`;export function getFlexboxValues(position){const positionParts=position.split(\"-\");let justifyContent,alignItems;switch(positionParts[0]){case\"top\":alignItems=\"flex-start\";break;case\"bottom\":alignItems=\"flex-end\";break;case\"center\":alignItems=\"center\";break;default:alignItems=\"initial\";break;}switch(positionParts[1]){case\"left\":justifyContent=\"flex-start\";break;case\"right\":justifyContent=\"flex-end\";break;case\"center\":justifyContent=\"center\";break;default:justifyContent=\"initial\";break;}return{justifyContent,alignItems};}export function getMultipleShadows(...shadows){const output=[];shadows.forEach(shadow=>{return shadow&&output.push(shadow);});return output.join(\", \");}export function getShadow(shadow){if(shadow){return`${shadow.shadowX}px ${shadow.shadowY}px ${shadow.shadowBlur}px ${shadow.shadowColor}`;}else return null;}export function safeJSONParse(jsonString,onError){try{return JSON.parse(jsonString);}catch{if(onError)onError();}}export const getCookie=(name,cookies)=>{cookies=cookies?cookies:isBrowser?document.cookie:\"\";var _cookies_match;const[,,cookie]=(_cookies_match=cookies.match(`(^|;) ?${name}=([^;]*)(;|$)`))!==null&&_cookies_match!==void 0?_cookies_match:[null,null,null];return cookie;};/**\n * Yields to main thread before continuing execution, which might allow the browser to paint.\n * If `options.priority` is 'user-blocking', it will asynchronously resolve in older browsers.\n * @param {object} options - see https://github.com/WICG/scheduling-apis/blob/main/explainers/yield-and-continuation.md\n * @see interactionResponse for guaranteeing execution after a paint\n */export function yieldToMain(options){if(\"scheduler\"in window){if(\"yield\"in scheduler)return scheduler.yield(options);if(\"postTask\"in scheduler)return scheduler.postTask(()=>{},options);}if((options===null||options===void 0?void 0:options.priority)===\"user-blocking\"){// `setTimeout` could suffer from being delayed for longer: https://developer.chrome.com/blog/introducing-scheduler-yield-origin-trial#the_problem_with_current_yielding_strategies\n// so for browsers not supporting yield, we guarantee execution for high priority actions, but this does not create space for a paint opportunity as trade-off.\nreturn Promise.resolve();}return new Promise(resolve=>{setTimeout(resolve);});}/**\n * Helper function for `yieldToMain`, which yields before calling `fn`.\n * @see yieldToMain\n */export async function yieldBeforeCb(fn,options){await yieldToMain(options);return fn();}/**\n * Similar to `yieldToMain`, but also waits for the next animation frame before yielding (with a fallback of 100ms if the animation frame never fires).\n * Compared to `yieldToMain`, it guarantees improved INP, but might make processing a little slower. Use only if necessary.\n * @see yieldToMain\n */export function interactionResponse(options){return new Promise(resolve=>{setTimeout(resolve,200)// Fallback for the case where the animation frame never fires.\n;requestAnimationFrame(()=>{void yieldBeforeCb(resolve,options);});});}/**\n * Runs `fn` after the next paint. Similar to `useEffect`, but *guarantees* that the function is run after the next paint.\n * @important Does not support a cleanup fn.\n * @see https://thoughtspile.github.io/2021/11/15/unintentional-layout-effect/\n */export function useAfterPaintEffect(fn,deps,options){useLayoutEffect(()=>{const runAfterPaint=async()=>{await interactionResponse(options);fn();};void runAfterPaint();// eslint-disable-next-line react-hooks/exhaustive-deps -- deps are passed in\n},deps);}\nexport const __FramerMetadata__ = {\"exports\":{\"useAfterPaintEffect\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getCookie\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"safeJSONParse\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getFlexboxValues\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"yieldBeforeCb\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getShadow\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getMultipleShadows\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FlexboxPosition\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"yieldToMain\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"interactionResponse\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEFAULT_FONT_FAMILY\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./utils.map"],"mappings":"4JAsBqU,SAAgB,GAAW,CAAI,IAAW,EAAO,UAAa,EAAO,WAAc,CAAC,EAAE,EAAO,UAAa,KAAK,SAAS,EAAG,iCAtB5Z,EAAc,EAAe,mCAAgD,EAAoB,SAI5H,GAAqB,EAAU,EAAc,cAAc,WAAW,EAAc,aAAa,EAAc,UAAU,EAAU,WAAW,EAAc,UAAU,K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