{"version":3,"file":"PasswordProtection.DJaLBJDQ.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/v9paIXaM4lEvrBwhDAph/TLt9pofpuueNIuQ8HAex/PasswordProtection.js"],"sourcesContent":["// Password protection popup with customizable styling, password, and home button\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Password Protection Popup\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function PasswordProtection(props){const{password,title,description,placeholder,buttonText,errorMessage,backgroundColor,overlayColor,textColor,buttonColor,buttonTextColor,errorColor,borderRadius,titleFont,descriptionFont,inputFont,buttonFont,homeButtonText,style}=props;const[inputValue,setInputValue]=useState(\"\");const[isUnlocked,setIsUnlocked]=useState(false);const[showError,setShowError]=useState(false);const handleSubmit=e=>{e.preventDefault();if(inputValue===password){startTransition(()=>{setIsUnlocked(true);setShowError(false);});}else{startTransition(()=>{setShowError(true);});}};const handleInputChange=e=>{setInputValue(e.target.value);if(showError){startTransition(()=>setShowError(false));}};const handleHomeClick=e=>{e.preventDefault();if(typeof window!==\"undefined\"){window.history.back();}};if(isUnlocked){return null;}const isCanvas=RenderTarget.current()===RenderTarget.canvas;const useFixedPosition=!isCanvas;return /*#__PURE__*/_jsx(\"div\",{style:{position:useFixedPosition?\"fixed\":\"relative\",top:useFixedPosition?0:undefined,left:useFixedPosition?0:undefined,width:useFixedPosition?\"100vw\":\"100%\",height:useFixedPosition?\"100vh\":\"100%\",minHeight:useFixedPosition?undefined:400,backgroundColor:overlayColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:useFixedPosition?9999:undefined,padding:20,...style},children:/*#__PURE__*/_jsxs(\"div\",{style:{backgroundColor:backgroundColor,borderRadius:borderRadius,padding:40,maxWidth:400,width:\"100%\",boxShadow:\"0 10px 40px rgba(0, 0, 0, 0.2)\",display:\"flex\",flexDirection:\"column\",gap:24},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:12},children:[/*#__PURE__*/_jsx(\"h1\",{style:{margin:0,color:textColor,...titleFont},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:textColor,opacity:.8,...descriptionFont},children:description})]}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:{display:\"flex\",flexDirection:\"column\",gap:16},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:8},children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:inputValue,onChange:handleInputChange,placeholder:placeholder,style:{padding:\"12px 16px\",borderRadius:borderRadius/2,border:showError?`2px solid ${errorColor}`:\"2px solid rgba(0, 0, 0, 0.1)\",backgroundColor:\"#FFFFFF\",color:\"#000000\",outline:\"none\",transition:\"border-color 0.2s\",...inputFont},\"aria-label\":\"Password input\",\"aria-invalid\":showError}),showError&&/*#__PURE__*/_jsx(\"span\",{style:{color:errorColor,fontSize:14,...inputFont},role:\"alert\",children:errorMessage})]}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{padding:\"12px 24px\",borderRadius:borderRadius/2,border:\"none\",backgroundColor:buttonColor,color:buttonTextColor,cursor:\"pointer\",transition:\"opacity 0.2s\",...buttonFont},onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.9\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";},children:buttonText}),/*#__PURE__*/_jsx(\"a\",{href:\"#\",onClick:handleHomeClick,style:{padding:\"12px 24px\",borderRadius:borderRadius/2,border:`2px solid ${buttonColor}`,backgroundColor:\"transparent\",color:buttonColor,cursor:\"pointer\",transition:\"opacity 0.2s\",textDecoration:\"none\",textAlign:\"center\",display:\"block\",...buttonFont},onMouseEnter:e=>{e.currentTarget.style.opacity=\"0.7\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"1\";},children:homeButtonText})]})]})});}addPropertyControls(PasswordProtection,{password:{type:ControlType.String,title:\"Password\",defaultValue:\"password123\",obscured:true},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Protected Content\"},description:{type:ControlType.String,title:\"Description\",defaultValue:\"Please enter the password to access this page.\",displayTextArea:true},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter password\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Unlock\"},homeButtonText:{type:ControlType.String,title:\"Home Button Text\",defaultValue:\"Return Home\"},errorMessage:{type:ControlType.String,title:\"Error Message\",defaultValue:\"Incorrect password. Please try again.\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},overlayColor:{type:ControlType.Color,title:\"Overlay\",defaultValue:\"rgba(0, 0, 0, 0.5)\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#000000\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\",defaultValue:\"#FFFFFF\"},errorColor:{type:ControlType.Color,title:\"Error Color\",defaultValue:\"#FF5588\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:16,min:0,max:32,step:1},titleFont:{type:ControlType.Font,title:\"Title Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Bold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},descriptionFont:{type:ControlType.Font,title:\"Description Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},inputFont:{type:ControlType.Font,title:\"Input Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},buttonFont:{type:ControlType.Font,title:\"Button Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PasswordProtection\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"400\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PasswordProtection.map"],"mappings":"6MASG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,WAAS,QAAM,cAAY,cAAY,aAAW,eAAa,kBAAgB,eAAa,YAAU,cAAY,kBAAgB,aAAW,eAAa,YAAU,kBAAgB,YAAU,aAAW,iBAAe,SAAO,EAAW,CAAC,EAAW,GAAeA,EAAS,GAAG,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAa,GAAG,CAAC,EAAE,gBAAgB,CAA2B,EAAvB,IAAa,MAA8B,CAAC,EAAc,GAAK,CAAC,EAAa,GAAM,MAA8B,CAAC,EAAa,GAAK,EAAG,EAAU,EAAkB,GAAG,CAAC,EAAc,EAAE,OAAO,MAAM,CAAI,GAAW,MAAoB,EAAa,GAAM,CAAC,EAAU,EAAgB,GAAG,CAAC,EAAE,gBAAgB,CAAW,IAAS,QAAa,EAAO,QAAQ,MAAM,EAAI,GAAG,EAAY,OAAO,KAAkE,IAAM,EAAnD,EAAa,SAAS,GAAG,EAAa,OAAwC,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,EAAiB,QAAQ,WAAW,IAAI,EAAiB,EAAE,IAAA,GAAU,KAAK,EAAiB,EAAE,IAAA,GAAU,MAAM,EAAiB,QAAQ,OAAO,OAAO,EAAiB,QAAQ,OAAO,U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