{"version":3,"file":"Experiments.DKPg1Apf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/T3q2G5KrzSyWMarZyaV8/OWZxaBHbEuZj5L16G5aP/Experiments.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";/**\n * PostHog Experiment — Code Override (not a Code Component)\n * ------------------------------------------------------\n * Attach this directly to your ALREADY-DESIGNED footer layer on the\n * canvas (select the layer → right panel → Code/Overrides → pick the\n * export below). The layer keeps whatever sizing/pinning you gave it\n * — this only controls whether it renders at all, so there's no\n * separate \"Control\" design, no ComponentInstance slot, and no width\n * problem: it's the same layer, not a copy of it.\n *\n * Setup:\n * 1. PostHog web snippet already installed in Site Settings →\n *    General → Custom Code → \"End of <head> tag\".\n * 2. In PostHog, the \"How it works\" experiment uses feature flag key\n *    \"lp-prominent-how-it-works-sections\" with three variants:\n *    control, deficit-oriented, comparison.\n * 3. Design one layer per variant on canvas (three separate designs).\n * 4. Select each layer → Code Overrides → choose the matching export\n *    below (\"withHowItWorksControl\" / \"...DeficitOriented\" /\n *    \"...Comparison\").\n * 5. Publish. Each layer only renders for visitors whose flag\n *    resolves to its matching variant; everyone else sees nothing\n *    from that layer.\n *\n * To run more than one experiment this way, copy one of the\n * `export const withX = (Component: ComponentType): ComponentType => ...`\n * lines at the bottom with a new flag key and export name, then pick\n * that export for the other layer.\n *\n * IMPORTANT: Framer's Overrides dropdown only detects exports whose\n * signature is LITERALLY `(Component: ComponentType) => ComponentType`\n * written at the export statement itself — it does a static scan,\n * not full type inference. `export const x = someFactory(...)` will\n * NOT show up even though it works at runtime, because the\n * `: ComponentType` annotation isn't visible right there. That's why\n * every export below is its own arrow function with that exact\n * annotation, delegating to the shared factory internally.\n *\n * QA override via URL: append `?ph_override_<experimentName>=<variant>`\n * to the page URL to force a specific variant for yourself. This now\n * calls PostHog's own posthog.featureFlags.overrideFeatureFlags() so\n * the forced value is visible to ANY getFeatureFlag() call on the\n * page (not just this override), and persists across a reload (it's\n * stored in local storage by the SDK) until cleared. This is\n * client-side only (visible to anyone who looks, not a real access\n * gate) — fine for QA/screenshots/demos, not for anything that needs\n * to be secret.\n *\n * Caveat: PostHog's docs don't document whether overrideFeatureFlags\n * merges with or replaces earlier overrides when called more than\n * once (e.g. two experiments overridden via URL on the same page\n * load). If you see one override \"winning\" over another, check the\n * console — PostHog logs when it applies an override — and clear\n * stale ones with `posthog.featureFlags.overrideFeatureFlags({flags: {}})`\n * before retesting.\n */// Reads ?ph_override_<experimentName>=<variant> from the URL, if present.\nfunction getVariantOverrideFromQuery(experimentName){if(typeof window===\"undefined\")return null;try{const params=new URLSearchParams(window.location.search);const value=params.get(`ph_override_${experimentName}`);return value&&value.length>0?value:null;}catch{return null;}}function makeVisibilityOverride(experimentName,targetVariant){return function(Component){return function WithExperimentVisibility(props){// null = flag result not known yet -> stays hidden until resolved\nconst[resolvedVariant,setResolvedVariant]=useState(null);useEffect(()=>{if(typeof window===\"undefined\")return;const posthog=window.posthog;// QA escape hatch: if the URL carries an override for\n// this experiment, tell PostHog itself about it (so\n// every getFeatureFlag() call on the page agrees, and\n// it survives a reload), then reflect it locally too\n// so this layer updates immediately without waiting\n// on a reload.\nconst queryOverride=getVariantOverrideFromQuery(experimentName);if(queryOverride!==null){console.info(`[${experimentName}] variant forced via URL to \"${queryOverride}\" (?ph_override_${experimentName}=...)`);if(posthog?.featureFlags?.overrideFeatureFlags){try{posthog.featureFlags.overrideFeatureFlags({flags:{[experimentName]:queryOverride}});}catch(err){console.warn(`[${experimentName}] overrideFeatureFlags failed`,err);}}else{console.warn(`[${experimentName}] posthog.featureFlags.overrideFeatureFlags not available — falling back to local-only override.`);}setResolvedVariant(queryOverride);return;}if(!posthog){console.warn(`[${experimentName}] window.posthog not found. Is the PostHog snippet installed in Site Settings → Custom Code?`);return;}// Calling getFeatureFlag() here also logs the exposure event.\nconst applyFlag=()=>{setResolvedVariant(posthog.getFeatureFlag(experimentName));};posthog.onFeatureFlags(applyFlag);// Also check immediately: if flags were already loaded\n// before this component mounted, onFeatureFlags' callback\n// may not fire again on its own, and we'd stay stuck on\n// null forever even though PostHog already knows the\n// variant (this is the \"console says 'test' but nothing\n// renders\" symptom).\napplyFlag();},[]);if(resolvedVariant!==targetVariant)return null;return /*#__PURE__*/_jsx(Component,{...props});};};}// One export per variant/layer. Pick the exported name in Framer's\n// Code Overrides dropdown on the layer you want it to control.\n// Each export MUST be written exactly like this — an arrow function\n// with `(Component: ComponentType): ComponentType` right here — for\n// Framer to detect it. See the note above.\n// \"How it works\" section — multivariate, flag key\n// \"lp-prominent-how-it-works-sections\", three variants: control,\n// deficit-oriented, comparison. Design three separate layers (one\n// per variant) and attach the matching export to each.\nexport const withHowItWorksControl=Component=>makeVisibilityOverride(\"lp-prominent-how-it-works-sections\",\"control\")(Component);export const withHowItWorksDeficitOriented=Component=>makeVisibilityOverride(\"lp-prominent-how-it-works-sections\",\"deficit-oriented\")(Component);export const withHowItWorksComparison=Component=>makeVisibilityOverride(\"lp-prominent-how-it-works-sections\",\"comparison\")(Component);\nexport const __FramerMetadata__ = {\"exports\":{\"withHowItWorksComparison\":{\"type\":\"reactHoc\",\"name\":\"withHowItWorksComparison\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHowItWorksDeficitOriented\":{\"type\":\"reactHoc\",\"name\":\"withHowItWorksDeficitOriented\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHowItWorksControl\":{\"type\":\"reactHoc\",\"name\":\"withHowItWorksControl\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Experiments.map"],"mappings":"uIAwDA,SAAS,EAA4B,EAAe,CAAC,GAAU,IAAS,OAAY,OAAO,KAAK,GAAG,CAA0D,IAAM,EAAM,IAApD,gBAAgB,EAAO,SAAS,MAAyB,CAAC,CAAC,IAAI,eAAe,GAAgB,EAAE,OAAO,GAAO,EAAM,OAAO,EAAE,EAAM,IAAK,MAAM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