{"version":3,"file":"PathRedirect.VTPcUp9a.mjs","names":[],"sources":["https:/framerusercontent.com/modules/A3qLb4bTJqkw37t3VrhG/fIZIRBIYmGY6W3lpbBbe/PathRedirect.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect}from\"react\";/**\n * Sends a retired URL to its replacement.\n *\n * A stopgap, not the right tool. A retired address should answer with a 301\n * from the server, which is a single hop, costs no render, and is the only\n * form a search engine treats as a true move. Framer exposes that as the\n * Redirects feature and this project's plan does not include it, so the next\n * best thing is a page that leaves as soon as it arrives.\n *\n * It leaves twice over, because the two mechanisms fail in different places.\n * The meta refresh is in the served HTML — Framer server-renders a code\n * component's JSX — so it works with no JavaScript at all and starts the\n * moment the first bytes land. A zero-delay refresh is also the one redirect\n * a crawler will follow and pass signals through, which is what keeps the old\n * links worth anything. The effect then fires on hydration and is faster in\n * practice on a browser that has already run the script.\n *\n * `replace`, never `assign`: this page must not enter history, or Back from\n * the destination lands here and bounces the reader straight forward again.\n *\n * The visible line is the third fallback, for the reader whose browser has\n * honoured neither. It is a real link, so it works when nothing else does.\n *\n * Nothing fires on the canvas — a meta refresh inside the editor would\n * navigate the editor itself, and the effect would drag the designer off the\n * page they are editing.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n */export default function PathRedirect(props){const{to=\"/\",label=\"Go to the home page\",style}=props;const target=typeof to===\"string\"&&to.trim().length>0?to.trim():\"/\";const live=RenderTarget.current()!==RenderTarget.canvas&&RenderTarget.current()!==RenderTarget.thumbnail&&RenderTarget.current()!==RenderTarget.export;useEffect(()=>{if(!live)return;window.location.replace(target);},[live,target]);return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\",minHeight:200,fontFamily:'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif',fontSize:16,lineHeight:\"1.5em\",color:\"#4B5063\",textAlign:\"center\",...style},children:[live?/*#__PURE__*/_jsx(\"meta\",{httpEquiv:\"refresh\",content:`0; url=${target}`}):null,/*#__PURE__*/_jsxs(\"p\",{style:{margin:0},children:[\"This page has moved.\",\" \",/*#__PURE__*/_jsx(\"a\",{href:target,style:{color:\"#1F2129\"},children:label}),\".\"]})]});}addPropertyControls(PathRedirect,{to:{type:ControlType.String,title:\"Send to\",defaultValue:\"/\",placeholder:\"/\"},label:{type:ControlType.String,title:\"Link text\",defaultValue:\"Go to the home page\",description:\"Shown only if neither redirect is honoured.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PathRedirect\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PathRedirect.map"],"mappings":"sMA+BG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,KAAG,IAAI,QAAM,sBAAsB,SAAO,EAAY,EAAO,OAAO,GAAK,UAAU,EAAG,KAAK,CAAC,CAAC,OAAO,EAAE,EAAG,KAAK,EAAE,IAAU,EAAK,EAAa,QAAQ,IAAI,EAAa,QAAQ,EAAa,QAAQ,IAAI,EAAa,WAAW,EAAa,QAAQ,IAAI,EAAa,OAAuF,OAAhF,MAAc,CAAK,GAAY,EAAO,SAAS,QAAQ,CAAM,CAAE,EAAE,CAAC,EAAK,CAAM,CAAC,EAAsB,EAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,MAAM,OAAO,OAAO,OAAO,UAAU,IAAI,WAAW,mEAAmE,SAAS,GAAG,WAAW,QAAQ,MAAM,UAAU,UAAU,SAAS,GAAG,CAAK,EAAE,SAAS,CAAC,EAAkB,EAAK,OAAO,CAAC,UAAU,UAAU,QAAQ,UAAU,GAAQ,CAAC,EAAE,KAAkB,EAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,uBAAuB,IAAiB,EAAK,IAAI,CAAC,KAAK,EAAO,MAAM,CAAC,MAAM,SAAS,EAAE,SAAS,CAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,qBA/Bj4B,IAAiE,IAA6B,EA+BoyB,EAAoB,EAAa,CAAC,GAAG,CAAC,KAAK,EAAY,OAAO,MAAM,UAAU,aAAa,IAAI,YAAY,GAAG,EAAE,MAAM,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,aAAa,sBAAsB,YAAY,6CAA6C,CAAC,CAAC"}