{"version":3,"file":"Redirect.PENwXE2N.mjs","names":[],"sources":["https:/framerusercontent.com/modules/u1xMzOYIcHvf1xVUrute/umVVS4ajLdQ8WLYIgjfi/Redirect.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerDisableUnlink\n * @framerSupportedLayoutHeight any\n */ export default function Redirect(props){// Function to check if running inside Framer\nconst isInsideFramerBuilder=()=>{// Checking for Framer-specific global objects\nreturn typeof window[\"Framer\"]!==\"undefined\";};// Automatically redirect if isActive is true, URL is provided, and not running inside Framer builder\nReact.useEffect(()=>{if(props.isActive&&props.url&&!isInsideFramerBuilder()){const timer=setTimeout(()=>{if(props.newTab){window.open(props.url,\"_blank\");}else{window.location.href=props.url;}},props.seconds*1e3);return()=>clearTimeout(timer);}},[props.seconds,props.url,props.isActive,props.newTab]);return /*#__PURE__*/ _jsx(\"div\",{style:{...containerStyle,width:props.width,height:props.height}});};// Define property controls\naddPropertyControls(Redirect,{isActive:{type:ControlType.Boolean,title:\"Active\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Toggle to activate or deactivate the redirect.\"},seconds:{type:ControlType.Number,title:\"Seconds\",defaultValue:5,min:0,max:60,step:1,description:\"Time in seconds before redirecting.\"},url:{type:ControlType.String,title:\"URL\",description:\"The URL to redirect to.\"},newTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Toggle to open the URL in a new tab.\"}});// Styles are written in object syntax\nconst containerStyle={opacity:0};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Redirect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"* @framerSupportedLayoutHeight any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Redirect.map"],"mappings":"0SAII,SAAwB,EAAS,EAAM,CAC3C,IAAM,EAAsB,IACd,EAAO,gBACwR,MAA7S,GAAgB,IAAI,CAAC,GAAG,EAAM,UAAU,EAAM,MAAM,GAAuB,CAAC,CAAC,IAAM,EAAM,WAAW,IAAI,CAAC,AAAG,EAAM,OAAQ,EAAO,KAAK,EAAM,IAAI,SAAS,CAAO,EAAO,SAAS,KAAK,EAAM,GAAM,EAAC,EAAM,QAAQ,IAAI,CAAC,MAAM,IAAI,aAAa,EAAM,AAAE,CAAC,EAAC,CAAC,EAAM,QAAQ,EAAM,IAAI,EAAM,SAAS,EAAM,MAAO,EAAC,CAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAe,MAAM,EAAM,MAAM,OAAO,EAAM,MAAO,CAAC,EAAC,AAAE,gBAE3Y,IATN,GAA2C,IAA4B,IAAoD,CAQ3H,EAAoB,EAAS,CAAC,SAAS,CAAC,KAAK,EAAY,QAAQ,MAAM,SAAS,cAAa,EAAM,aAAa,KAAK,cAAc,MAAM,YAAY,gDAAiD,EAAC,QAAQ,CAAC,KAAK,EAAY,OAAO,MAAM,UAAU,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,EAAE,YAAY,qCAAsC,EAAC,IAAI,CAAC,KAAK,EAAY,OAAO,MAAM,MAAM,YAAY,yBAA0B,EAAC,OAAO,CAAC,KAAK,EAAY,QAAQ,MAAM,UAAU,cAAa,EAAM,aAAa,KAAK,cAAc,MAAM,YAAY,sCAAuC,CAAC,EAAC,CACvjB,EAAe,CAAC,QAAQ,CAAE"}