{"version":3,"file":"RunFileReturnLink.z5N1ymyT.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","window","_e","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","init_framer_CaDWdxiz","ControlType","addPropertyControls","cleanAnchor","a","value","GAME_PLAN_ANCHORS","cleanPath","DEFAULT_RETURN","returnHref","anchor","path","anchorFromUrl","RETURN_PARAM","RunFileReturnLink","props","fromUrl","setFromUrl","href","destination","section","style","column","CSS","label","init_RunFileReturnLink"],"sources":["https:/framerusercontent.com/modules/2vvsnYgJI8ZVrQGa6CNj/GfCWr4k0FBBWZ4TNarPc/RunFileReturnLink.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Provisional return link for Run File worksheet pages (RF01 now, RF04 next).\n// Destination defaults to the Game Plan preview. A section anchor can come from\n// the page URL (?from=know-the-job) or from the Section control; the URL wins.\n// Only anchors in GAME_PLAN_ANCHORS are accepted. Anything else is ignored and\n// the link goes to the destination with no anchor.\nexport const DEFAULT_RETURN=\"/game-plans/thinking-about-running\";export const RETURN_PARAM=\"from\";export const GAME_PLAN_ANCHORS=[\"game-plan-top\",\"roadmap\",\"know-the-job\",\"know-the-race\",\"know-the-rules\",\"know-what-youre-taking-on\",\"know-your-support\",\"make-the-call\",\"go-deeper-1\",\"go-deeper-2\",\"go-deeper-3\",\"go-deeper-4\",\"go-deeper-5\",\"go-deeper-6\",\"nobody-1\",\"nobody-4\",\"decisions-6\",\"rf01\",\"rf02\",\"rf03\",\"rf04\",\"rf05\",\"rf06\"];export function cleanAnchor(value){const a=(value||\"\").trim().replace(/^#/,\"\").toLowerCase();return GAME_PLAN_ANCHORS.indexOf(a)!==-1?a:\"\";}// Internal paths only (\"/something\"). Full URLs, \"//host\" and empty values fall back to the default.\nexport function cleanPath(value){const p=(value||\"\").trim();return p.charAt(0)===\"/\"&&p.charAt(1)!==\"/\"&&p.indexOf(\"#\")===-1&&p.indexOf(\"?\")===-1?p:DEFAULT_RETURN;}export function returnHref(path,anchor){const a=cleanAnchor(anchor);return cleanPath(path)+(a?\"#\"+a:\"\");}export function anchorFromUrl(){if(typeof window===\"undefined\")return\"\";try{return cleanAnchor(new URLSearchParams(window.location.search).get(RETURN_PARAM));}catch(e){return\"\";}}const CSS=[\".rfr{width:100%;box-sizing:border-box;margin:0 auto;padding:0 24px;font-family:Rubik,system-ui,sans-serif;-webkit-font-smoothing:antialiased}\",\".rfr--text{max-width:760px}\",\".rfr--wide{max-width:1000px}\",\".rfr a{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 4px 0 0;font-family:'Geist Mono',ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1.4;letter-spacing:.08em;text-transform:uppercase;font-weight:500;color:#2B2622;text-decoration:none}\",\".rfr a:hover .rfr-label{color:#A44F33}\",\".rfr a:focus-visible{outline:3px solid #A44F33;outline-offset:2px;border-radius:2px}\",\"@media (max-width:1000px) and (min-width:721px){.rfr--wide{padding:0 max(24px,calc(50% - 356px))}}\",\"@media (max-width:720px){.rfr--wide{padding:0 16px}}\",\"@media (max-width:600px){.rfr--text{padding:0 16px}}\",\"@media print{.rfr{display:none!important}}\"].join(\"\\n\");/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function RunFileReturnLink(props){const{label=\"Game Plan\",destination=DEFAULT_RETURN,section=\"\",column=\"text\",style}=props;const[fromUrl,setFromUrl]=useState(\"\");useEffect(()=>{setFromUrl(anchorFromUrl());},[]);const href=returnHref(destination,fromUrl||section);return /*#__PURE__*/_jsx(\"div\",{style:{...style,display:\"flex\",justifyContent:\"center\"},children:/*#__PURE__*/_jsxs(\"nav\",{className:\"rfr rfr--\"+(column===\"wide\"?\"wide\":\"text\"),style:{width:\"100%\",maxWidth:column===\"wide\"?1e3:760,marginLeft:\"auto\",marginRight:\"auto\"},\"aria-label\":\"Return\",children:[/*#__PURE__*/_jsx(\"style\",{children:CSS}),/*#__PURE__*/_jsxs(\"a\",{href:href,\"data-return-href\":href,children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",children:\"←\"}),/*#__PURE__*/_jsx(\"span\",{className:\"rfr-label\",children:label})]})]})});}addPropertyControls(RunFileReturnLink,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Game Plan\"},destination:{type:ControlType.String,title:\"Destination\",defaultValue:DEFAULT_RETURN,description:\"Internal path. Invalid values fall back to the Game Plan.\"},section:{type:ControlType.Enum,title:\"Section\",options:[\"\"].concat(GAME_PLAN_ANCHORS),optionTitles:[\"None\"].concat(GAME_PLAN_ANCHORS),defaultValue:\"\",description:\"Fallback anchor. ?from= in the page URL overrides it.\"},column:{type:ControlType.Enum,title:\"Column\",options:[\"text\",\"wide\"],optionTitles:[\"Text column (760)\",\"Worksheet (1000)\"],defaultValue:\"text\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"returnHref\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"cleanAnchor\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"cleanPath\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RETURN_PARAM\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"RunFileReturnLink\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"anchorFromUrl\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GAME_PLAN_ANCHORS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"DEFAULT_RETURN\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RunFileReturnLink.map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