{"version":3,"file":"Redirection.CSUwA2jV.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/0cUo3vQzlQ3eTC85a2p0/CyLrvtGPS2z2CyburSRd/useIsEditor.js","https:/framerusercontent.com/modules/cwr96XxXBEL3fEysRno0/irLnUSOVlvkYHc1sVmhP/Redirection.js"],"sourcesContent":["import{useState,useEffect}from\"react\";export function useIsEditor(){// Helper to parse current location\nconst getEditorState=()=>{if(typeof window===\"undefined\")return false// SSR fallback\n;const url=window.location.href;// Framer canvas/editor URLs typically contain \"/canvas/\"\n// Preview often contains \"/preview/\"\n// Published sites are custom, usually do not contain framer.com URLs\nconsole.log(\"window.location.href: \",window.location.href);return url.includes(\"/canvas/\");};const[isEditor,setIsEditor]=useState(getEditorState());useEffect(()=>{// Listen to location changes for SPA navigation\nconst handleChange=()=>setIsEditor(getEditorState());window.addEventListener(\"popstate\",handleChange);window.addEventListener(\"pushstate\",handleChange);window.addEventListener(\"replaceState\",handleChange);// In practice, these events are rare—manual reload is usually required\nreturn()=>{window.removeEventListener(\"popstate\",handleChange);window.removeEventListener(\"pushstate\",handleChange);window.removeEventListener(\"replaceState\",handleChange);};},[]);return isEditor;}\nexport const __FramerMetadata__ = {\"exports\":{\"useIsEditor\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useIsEditor.map","\"use client\";import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useIsEditor}from\"https://framerusercontent.com/modules/0cUo3vQzlQ3eTC85a2p0/CyLrvtGPS2z2CyburSRd/useIsEditor.js\";export default function Redirection(props){const{url,...rest}=props;const isEditor=useIsEditor();React.useEffect(()=>{if(isEditor||typeof window===\"undefined\"||typeof document===\"undefined\"||!url)return;if(document.location.hostname===\"pedagome.fr\")document.location.replace(url);},[url,isEditor]);return /*#__PURE__*/_jsx(\"div\",{...rest,children:\"Redirection ...\"});}addPropertyControls(Redirection,{url:{type:ControlType.Link,title:\"Rediriger vers\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Redirection\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Redirection.map"],"mappings":"+LAAsC,SAAgB,GAAa,CACnE,IAAM,MAAmB,CAAC,GAAU,IAAS,OAAY,MAAO,GAC/D,IAAM,EAAI,EAAO,SAAS,KAGgC,OAA3D,QAAQ,IAAI,yBAAyB,EAAO,SAAS,KAAK,CAAQ,EAAI,SAAS,WAAW,EAAQ,CAAC,EAAS,GAAaA,EAAS,GAAgB,CAAC,CAEiC,OAFhC,MAAc,CAClK,IAAM,MAAiB,EAAY,GAAgB,CAAC,CACpD,OADqD,EAAO,iBAAiB,WAAW,EAAa,CAAC,EAAO,iBAAiB,YAAY,EAAa,CAAC,EAAO,iBAAiB,eAAe,EAAa,KAClM,CAAC,EAAO,oBAAoB,WAAW,EAAa,CAAC,EAAO,oBAAoB,YAAY,EAAa,CAAC,EAAO,oBAAoB,eAAe,EAAa,GAAK,EAAE,CAAC,CAAQ,uBAPrJ,ICA0N,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,MAAI,GAAG,GAAM,EAAY,EAAS,GAAa,CAA0M,OAAzM,MAAoB,CAAI,GAAiB,IAAS,QAAa,OAAO,SAAW,KAAa,CAAC,GAAc,SAAS,SAAS,WAAW,eAAc,SAAS,SAAS,QAAQ,EAAI,EAAG,CAAC,EAAI,EAAS,CAAC,CAAqB,EAAK,MAAM,CAAC,GAAG,EAAK,SAAS,kBAAkB,CAAC,sBAAtjB,IAA4B,IAAoD,IAAwH,CAAgX,EAAoB,EAAY,CAAC,IAAI,CAAC,KAAK,EAAY,KAAK,MAAM,iBAAiB,CAAC,CAAC"}