{"version":3,"file":"Main.ChajLDY3.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/oxpbyvuUwToWjEwt2dd9/LDR16haG1uIrQWSiCoOl/experimentConfig.js","https:/framerusercontent.com/modules/spmN4v92zycoCtxMzwmg/RwqguoZugEjmqhRVcusz/Main.js"],"sourcesContent":["// Auto-generated by Epsilon Labs A/B Test Builder plugin\n// Use the plugin to make changes\nexport const CONFIG={tabletBreakpoint:1200,mobileBreakpoint:810};export const EXPERIMENTS=[{id:33,componentName:\"Joris Huge Button\",variations:{control:{id:66,variant:null,props:null},treatment:{id:67,variant:null,props:{testJorisVariable:\"New Button Text\"}}}},{id:135,componentName:\"Predesign AB\",variations:{control:{id:215,variant:{mobile:\"B Mobile\",tablet:\"B Tablet\",desktop:\"B Desktop\"},props:null},treatment:{id:216,variant:{mobile:\"Static Mobile\",tablet:\"Static Tablet\",desktop:\"Static Desktop\"},props:null}}},{id:220,componentName:\"2. Steps AB\",variations:{control:{id:388,variant:null,props:null},treatment:{id:389,variant:{mobile:\"B\",tablet:\"B\",desktop:\"B\"},props:null}}},{id:245,componentName:\"3. Predesigned AB\",variations:{control:{id:438,variant:null,props:null},treatment:{id:439,variant:{mobile:\"B\",tablet:\"B\",desktop:\"B\"},props:null}}},{id:257,componentName:\"0. Navi AB\",variations:{control:{id:462,variant:{mobile:\"A\",tablet:\"A\",desktop:\"A\"},props:null},treatment:{id:463,variant:{mobile:\"B\",tablet:\"B\",desktop:\"B\"},props:null}}}];// Draft experiments (not exported, not used in overrides)\nconst DRAFT_EXPERIMENTS=[{id:149,componentName:\"Transparent Navi\",variations:{control:{id:244,variant:null,props:null},treatment:{id:245,variant:{mobile:\"Test Phone\",tablet:null,desktop:null},props:null}}},{id:161,componentName:\"Transparent Navi\",variations:{control:{id:268,variant:null,props:null},treatment:{id:269,variant:null,props:{shopNoticeSaveDraft:\"New Button Text\"}}}},{id:59,componentName:\"Coursor Nxt\",variations:{control:{id:118,variant:null,props:null},treatment:{id:119,variant:{mobile:\"Variant 1\",tablet:\"Variant 1\",desktop:\"Variant 1\"},props:null}}},{id:263,componentName:\"7. Showroom AB\",variations:{control:{id:474,variant:{mobile:\"A\",tablet:\"A\",desktop:\"A\"},props:null},treatment:{id:475,variant:{mobile:\"B\",tablet:\"B\",desktop:\"B\"},props:null}}}];\nexport const __FramerMetadata__ = {\"exports\":{\"Experiment\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CONFIG\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"EXPERIMENTS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./experimentConfig.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useMemo}from\"react\";import{CONFIG,EXPERIMENTS}from\"https://framerusercontent.com/modules/oxpbyvuUwToWjEwt2dd9/LDR16haG1uIrQWSiCoOl/experimentConfig.js\";// Helper: Only log if debug mode is explicitly enabled\nfunction logDebug(message,data){if(typeof window===\"undefined\")return;// Check for debug flag in URL or SessionStorage\nconst params=new URLSearchParams(window.location.search);const isDebugUrl=params.get(\"epsilon_lab_debug\")===\"true\";const isDebugSession=sessionStorage.getItem(\"epsilon_lab_debug\")===\"true\";if(!isDebugUrl&&!isDebugSession)return;const prefix=\"%c[AB Debug]\";const style=\"background: #333; color: #bada55; padding: 2px 5px; border-radius: 3px; font-weight: bold;\";if(data){console.log(`${prefix} ${message}`,style,data);}else{console.log(`${prefix} ${message}`,style);}}function getDeviceType(width){if(width<CONFIG.mobileBreakpoint){return\"mobile\";}else if(width<CONFIG.tabletBreakpoint){return\"tablet\";}return\"desktop\";}function getInitialVariation(componentName){logDebug(`Checking config for component name: \"${componentName}\"`);const experiment=EXPERIMENTS.find(exp=>exp.componentName===componentName);if(!experiment){logDebug(`❌ No experiment config found for \"${componentName}\".`);return{variation:null,experiment:null,isPreview:false};}logDebug(`✅ Found config for experiment ID: ${experiment.id}`);if(typeof window!==\"undefined\"){// 1. PRIORITY: Check URL Query Params for Preview\nconst params=new URLSearchParams(window.location.search);const labsParam=params.get(\"labs\")// e.g. \"1234_12345\"\n;if(labsParam){const[previewExpId,previewVarId]=labsParam.split(\"_\");logDebug(`URL Params detected: Exp=${previewExpId}, Var=${previewVarId}`);const targetExpId=parseInt(previewExpId);const targetVarId=parseInt(previewVarId);if(targetExpId===experiment.id){const variationKey=Object.keys(experiment.variations).find(key=>experiment.variations[key].id===targetVarId);if(variationKey){logDebug(`🎯 PREVIEW MATCH! Applying variation \"${variationKey}\"`);return{variation:targetVarId,experiment,isPreview:true};}else{// We force this log even without debug mode because it's a configuration error\nconsole.warn(`[Epsilon Preview] Experiment ID matched, but Variation ID ${targetVarId} not found in config.`);}}else{logDebug(`Skipping preview: URL ID (${targetExpId}) != Component ID (${experiment.id})`);}}// 2. SECONDARY: Check Session Storage for Preview\ntry{const sessionData=sessionStorage.getItem(\"epsilon_lab_preview_mode\");if(sessionData){const mode=JSON.parse(sessionData);if(mode.enabled&&mode.type===\"single\"&&mode.experimentId===experiment.id){logDebug(`Session Storage Preview matched for Variation: ${mode.variationId}`);return{variation:mode.variationId,experiment,isPreview:true};}}}catch(e){console.error(\"Error parsing preview mode\",e);}}// 3. Check Script (Standard Running/Pseudo check)\nif(typeof window!==\"undefined\"&&window.epsilonLab){const exists=window.epsilonLab.experimentExists(experiment.id);if(!exists){logDebug(`Experiment ${experiment.id} not found in active script (likely draft/ended).`);return{variation:null,experiment:null,isPreview:false};}}// 4. Local Storage (Bucketing)\nconst storageKey=\"epsilon_lab_bucketing\";let bucketingData={};try{const storedValue=localStorage.getItem(storageKey);if(storedValue)bucketingData=JSON.parse(storedValue);}catch(e){}const expId=experiment.id.toString();if(bucketingData[expId]){return{variation:bucketingData[expId],experiment,isPreview:false};}else{// 5. Random Assignment\nconst variationKeys=Object.keys(experiment.variations);const randomVariation=variationKeys[Math.floor(Math.random()*variationKeys.length)];const variationId=experiment.variations[randomVariation].id;return{variation:variationId,experiment,isPreview:false};}}export function abTestSetup(Component){return props=>{const componentName=props.name||Component.displayName||\"\";const hasExperiment=EXPERIMENTS.some(exp=>exp.componentName===componentName);// If the script is already loaded, resolve the full experiment\n// state synchronously — no useEffect delay, no layout shift\nconst scriptLoaded=hasExperiment&&typeof window!==\"undefined\"&&!!window.epsilonLab;const syncResult=scriptLoaded?getInitialVariation(componentName):null;let initialReady=true;let initialAllowed=false;let initialVariation=null;let initialExperiment=null;let initialPreview=false;if(hasExperiment){if(scriptLoaded&&syncResult){initialVariation=syncResult.variation;initialExperiment=syncResult.experiment;initialPreview=syncResult.isPreview;initialAllowed=syncResult.experiment!==null;initialReady=true;}else if(!scriptLoaded){initialReady=false;initialAllowed=null;}}const[deviceType,setDeviceType]=useState(typeof window!==\"undefined\"?getDeviceType(window.innerWidth):\"desktop\");const[isReady,setIsReady]=useState(initialReady);const[experimentAllowed,setExperimentAllowed]=useState(initialAllowed);const[isPreviewMode,setIsPreviewMode]=useState(initialPreview);const[activeVariation,setActiveVariation]=useState(initialVariation);const[activeExperiment,setActiveExperiment]=useState(initialExperiment);useEffect(()=>{if(!hasExperiment)return;if(scriptLoaded)return;const initialize=()=>{const{variation,experiment,isPreview}=getInitialVariation(componentName);setActiveVariation(variation);setActiveExperiment(experiment);setIsPreviewMode(isPreview);setExperimentAllowed(experiment!==null);};const params=new URLSearchParams(window.location.search);if(params.has(\"labs\")||sessionStorage.getItem(\"epsilon_lab_preview_mode\")){initialize();return;}// If the script loads, initialize normally\nwindow.addEventListener(\"epsilonLabReady\",initialize,{once:true});// Fallback: if the script never loads (ad blocker, network error),\n// render the default component after a short timeout\nconst timeout=setTimeout(()=>{window.removeEventListener(\"epsilonLabReady\",initialize);logDebug(\"Script load timeout — rendering default component\");setExperimentAllowed(false);setIsReady(true);},300);return()=>{window.removeEventListener(\"epsilonLabReady\",initialize);clearTimeout(timeout);};},[componentName]);const{overrideVariant,overrideProps}=useMemo(()=>{let variant=null;let newProps={}// Renamed to avoid confusion with component 'props'\n;if(activeExperiment&&activeVariation!==null&&experimentAllowed){const variationKey=Object.keys(activeExperiment.variations).find(key=>activeExperiment.variations[key].id===activeVariation);if(variationKey){const config=activeExperiment.variations[variationKey];if(config.variant)variant=config.variant[deviceType];// UPGRADE: Allow config.props to be a function that reads Framer props!\nif(config.props){newProps=typeof config.props===\"function\"?config.props(props):config.props;}}}return{overrideVariant:variant,overrideProps:newProps};},[activeExperiment,activeVariation,deviceType,experimentAllowed,props])// Notice 'props' was added to this array\n;useEffect(()=>{const updateSize=()=>setDeviceType(getDeviceType(window.innerWidth));window.addEventListener(\"resize\",updateSize);return()=>window.removeEventListener(\"resize\",updateSize);},[]);useEffect(()=>{if(experimentAllowed===null)return;if(!activeExperiment||activeVariation===null||!experimentAllowed){setIsReady(true);return;}// Skip API calls in preview mode to prevent errors with Draft experiments\nif(isPreviewMode){setIsReady(true);return;}const storageKey=\"epsilon_lab_bucketing\";let bucketingData={};try{const storedValue=localStorage.getItem(storageKey);if(storedValue)bucketingData=JSON.parse(storedValue);}catch(e){}const expId=activeExperiment.id.toString();if(window.epsilonLab){if(bucketingData[expId]){window.epsilonLab.activatePage(`framer-page-${activeExperiment.id}`);}else{window.epsilonLab.forceVariation(activeExperiment.id,activeVariation);window.epsilonLab.activatePage(`framer-page-${activeExperiment.id}`);}}setIsReady(true);},[activeExperiment,activeVariation,experimentAllowed,isPreviewMode]);if(!isReady){return /*#__PURE__*/_jsx(\"div\",{style:{visibility:\"hidden\"},children:/*#__PURE__*/_jsx(Component,{...props})});}return /*#__PURE__*/_jsx(Component,{...props,...overrideProps,...overrideVariant?{variant:overrideVariant}:{}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"abTestSetup\":{\"type\":\"reactHoc\",\"name\":\"abTestSetup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"2JAEa,EAAO,CAAC,iBAAiB,K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