{"version":3,"file":"PasswordProtectionOverride.BCfSF4PR.mjs","names":["useState","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/5HiGJLDEsLBgc3iAxRmB/rWrgZ1tHz7Fn7Bqq1is1/PasswordProtectionOverride.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";// This override can be applied to any page or component to add password protection\nexport function PasswordProtectionOverride(props){// State to track if user is authenticated\nconst[isAuthenticated,setIsAuthenticated]=useState(false);// State for password input\nconst[password,setPassword]=useState(\"\");// State for error message\nconst[error,setError]=useState(\"\");// State for button hover\nconst[isHovered,setIsHovered]=useState(false);// Replace this with your desired password\nconst correctPassword=\"progress.ember_tang9oak\";useEffect(()=>{// Check if already authenticated\nconst authStatus=localStorage.getItem(\"auth\")===\"true\";setIsAuthenticated(authStatus);},[]);// Handle password submission\nconst handleSubmit=e=>{e.preventDefault();if(password===correctPassword){// Store authentication in localStorage\nlocalStorage.setItem(\"auth\",\"true\");setIsAuthenticated(true);setError(\"\");}else{setError(\"Incorrect password. Please try again.\");}};// If authenticated, return without modifications\nif(isAuthenticated){return{};}// If not authenticated, return an overlay component\nreturn{// This will override the component's children, adding the modal on top\nchildren:/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:\"#FCF6F2\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:9999},children:/*#__PURE__*/_jsxs(\"div\",{style:{width:\"90%\",maxWidth:\"400px\",padding:\"30px\",backgroundColor:\"white\",borderRadius:\"0px\",boxShadow:\"0 4px 10px rgba(0,0,0,0.1)\"},children:[/*#__PURE__*/_jsx(\"h2\",{style:{marginTop:0,marginBottom:\"20px\"},children:\"Enter Password\"}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:password,onChange:e=>setPassword(e.target.value),placeholder:\"Password\",style:{width:\"100%\",padding:\"16px 0px\",fontSize:\"24px\",border:\"0px\",borderBottom:\"1.5px solid #2B2927\",borderRadius:\"0px\",marginBottom:\"52px\"}}),error&&/*#__PURE__*/_jsx(\"p\",{style:{color:\"red\",margin:\"10px 0\"},children:error}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),style:{width:\"100%\",padding:\"12px 24px 12px 24px\",backgroundColor:isHovered?\"#444240\":\"#2B2927\",color:\"white\",border:\"none\",borderRadius:\"1000px\",fontSize:\"16px\",cursor:\"pointer\",transition:\"background-color 0.2s ease\"},children:\"Submit\"})]})]})})};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withPasswordProtectionOverride(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...PasswordProtectionOverride(props)});};}withPasswordProtectionOverride.displayName=\"PasswordProtectionOverride\";\nexport const __FramerMetadata__ = {\"exports\":{\"withPasswordProtectionOverride\":{\"type\":\"reactHoc\",\"name\":\"withPasswordProtectionOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PasswordProtectionOverride\":{\"type\":\"override\",\"name\":\"PasswordProtectionOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PasswordProtectionOverride.map"],"mappings":"yLACA,SAAgB,EAA2B,EAAM,CACjD,GAAK,CAAC,EAAgB,GAAoBA,EAAS,GAAM,CACpD,CAAC,EAAS,GAAaA,EAAS,GAAG,CACnC,CAAC,EAAM,GAAUA,EAAS,GAAG,CAC7B,CAAC,EAAU,GAAcA,EAAS,GAAM,CAM7C,OALgD,MAAc,CACP,EAAtC,aAAa,QAAQ,OAAO,GAAG,OAAqC,EAAG,EAAE,CAAC,CAGxF,EAAuB,EAAE,CAC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