{"version":3,"file":"PreloaderConnection.D2LIziwI.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/hTl0eZ8TUoz435wI1IcW/5BRkaXpkxygpndxXXD1i/PreloaderConnection.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";export function PreloaderConnection(props){// 1️⃣ Bail out immediately in the Canvas editor\nif(RenderTarget.current()===RenderTarget.canvas){return null;}const{duration,connectedFrameDesktop,connectedFrameTablet,connectedFrameMobile}=props;const[visible,setVisible]=React.useState(true);// Hide after `duration` seconds\nReact.useEffect(()=>{const timer=setTimeout(()=>setVisible(false),duration*1e3);return()=>clearTimeout(timer);},[duration]);if(!visible)return null;// Pick the right set based on window.innerWidth (real device)\nconst w=typeof window!==\"undefined\"?window.visualViewport?.width||window.innerWidth:Infinity;let framesToShow=connectedFrameDesktop||[];if(w<=809&&connectedFrameMobile?.length){framesToShow=connectedFrameMobile;}else if(w<=1199&&connectedFrameTablet?.length){framesToShow=connectedFrameTablet;}return /*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:9999,background:\"transparent\"},children:framesToShow.map((frame,i)=>/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"},children:/*#__PURE__*/React.cloneElement(frame,{style:{width:\"100%\",height:\"100%\",objectFit:\"cover\"}})},i))});}PreloaderConnection.displayName=\"Preloader Connection\";addPropertyControls(PreloaderConnection,{duration:{type:ControlType.Number,title:\"Duration\",defaultValue:3,min:.5,max:10,step:.1,unit:\"s\",displayStepper:true},connectedFrameDesktop:{type:ControlType.Array,title:\"Desktop Frame\",propertyControl:{type:ControlType.ComponentInstance}},connectedFrameTablet:{type:ControlType.Array,title:\"Tablet Frame\",propertyControl:{type:ControlType.ComponentInstance}},connectedFrameMobile:{type:ControlType.Array,title:\"Mobile Frame\",propertyControl:{type:ControlType.ComponentInstance}}});\nexport const __FramerMetadata__ = {\"exports\":{\"PreloaderConnection\":{\"type\":\"reactComponent\",\"name\":\"PreloaderConnection\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PreloaderConnection.map"],"mappings":"mMAAwI,SAAgB,EAAoB,EAAM,CAClL,GAAG,EAAa,QAAQ,IAAI,EAAa,OAAQ,OAAO,KAAM,GAAK,CAAC,WAAS,wBAAsB,uBAAqB,wBAAsB,EAAW,CAAC,EAAQ,GAAYA,EAAe,EAAI,EACrE,GAA5H,MAAoB,CAAC,IAAM,EAAM,eAAe,EAAW,EAAK,EAAE,EAAS,GAAG,EAAE,UAAU,aAAa,CAAK,CAAE,EAAE,CAAC,CAAQ,CAAC,EAAK,CAAC,EAAQ,OAAO,KAC/I,IAAM,EAAS,IAAS,OAA4D,IAAhD,EAAO,gBAAgB,OAAO,EAAO,WAAwB,EAAa,GAAuB,CAAC,EAAgK,OAA3J,GAAG,KAAK,GAAsB,OAAQ,EAAa,EAA8B,GAAG,MAAM,GAAsB,SAAQ,EAAa,GAA0C,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,OAAO,QAAQ,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,OAAO,KAAK,WAAW,aAAa,EAAE,SAAS,EAAa,KAAK,EAAM,IAAiB,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,eAAe,SAAS,WAAW,QAAQ,EAAE,SAAsB,EAAmB,EAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,UAAU,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,C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