{"version":3,"file":"PasswordNew.BAF5ntvH.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/KVKJfKwX1qrdSfPVzobB/9ODhTNIxiNIm4ztWeqxP/PasswordNew.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{Frame,addPropertyControls,ControlType,useNavigate}from\"framer\";export function PasswordWall(props){const{password,redirectURL,backgroundColor,textColor,fontSize,buttonColor,buttonTextColor}=props;const[inputPassword,setInputPassword]=useState(\"\");const[error,setError]=useState(\"\");const[isActive,setIsActive]=useState(true);const navigate=useNavigate()// Framer navigation hook\n;// Disable scrolling when the PasswordWall is active\nuseEffect(()=>{if(isActive){document.body.style.overflow=\"hidden\";}else{document.body.style.overflow=\"auto\";}// Cleanup on unmount\nreturn()=>{document.body.style.overflow=\"auto\";};},[isActive]);const handlePasswordSubmit=()=>{if(inputPassword===password){setIsActive(false);navigate(redirectURL)// Use Framer's navigate for internal routing\n;}else{setError(\"Incorrect password. Please try again.\");}};if(!isActive){return null// Hide the PasswordWall once the password is correct\n;}return /*#__PURE__*/_jsxs(Frame,{background:backgroundColor,width:\"100%\",height:\"100%\",style:{display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",color:textColor,textAlign:\"center\"},children:[/*#__PURE__*/_jsx(\"h1\",{style:{fontSize},children:\"Please Enter Password\"}),/*#__PURE__*/_jsx(\"input\",{type:\"password\",placeholder:\"Password\",style:{padding:\"10px\",fontSize,border:\"1px solid #ccc\",borderRadius:\"4px\",margin:\"10px 0\"},value:inputPassword,onChange:e=>{setInputPassword(e.target.value);setError(\"\");}}),error&&/*#__PURE__*/_jsx(\"p\",{style:{color:\"red\",fontSize:\"14px\"},children:error}),/*#__PURE__*/_jsx(\"button\",{style:{padding:\"10px 20px\",fontSize,backgroundColor:buttonColor,color:buttonTextColor,border:\"none\",borderRadius:\"4px\",cursor:\"pointer\"},onClick:handlePasswordSubmit,children:\"Submit\"})]});}// Add property controls for customization\naddPropertyControls(PasswordWall,{password:{type:ControlType.String,title:\"Password\",defaultValue:\"1234\"},redirectURL:{type:ControlType.String,title:\"Redirect URL\",defaultValue:\"/protected\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#ffffff\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:10,max:30},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#007BFF\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text Color\",defaultValue:\"#ffffff\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"PasswordWall\":{\"type\":\"reactComponent\",\"name\":\"PasswordWall\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PasswordNew.map"],"mappings":"kMAAqK,SAAgB,EAAa,EAAM,CAAC,GAAK,CAAC,WAAS,cAAY,kBAAgB,YAAU,WAAS,cAAY,mBAAiB,EAAW,CAAC,EAAc,GAAkBA,EAAS,GAAG,CAAM,CAAC,EAAM,GAAUA,EAAS,GAAG,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAK,CAAO,EAAS,GAAa,CAKrc,OAHF,OAAkB,EAAU,SAAS,KAAK,MAAM,SAAS,SAAe,SAAS,KAAK,MAAM,SAAS,WAC3F,CAAC,SAAS,KAAK,MAAM,SAAS,SAAW,CAAC,EAAS,CAAC,CACE,EAC1C,EAAM,EAAM,CAAC,WAAW,EAAgB,MAAM,OAAO,OAAO,OAAO,MAAM,CAAC,QAAQ,OAAO,cAAc,SAAS,eAAe,SAAS,WAAW,SAAS,MAAM,EAAU,UAAU,SAAS,CAAC,SAAS,CAAc,EAAK,KAAK,CAAC,MAAM,CAAC,WAAS,CAAC,SAAS,wBAAwB,CAAC,CAAc,EAAK,QAAQ,CAAC,KAAK,WAAW,YAAY,WAAW,MAAM,CA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