{"version":3,"file":"ProjectAuth.BZUt8f6e.mjs","names":["useState","useRef","e","React","EyeSlash","Eye","LockSimpleOpen","LockSimple","ArrowUUpLeft"],"sources":["https:/framerusercontent.com/modules/8HOLvl2Pk7iYzRP2CXq3/kTebPjbn8UHB7wu0n9CA/ProjectAuth.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import React,{useState,useEffect,useRef}from\"react\";import{addPropertyControls}from\"framer\";import{Eye,EyeSlash,LockSimple,LockSimpleOpen,ArrowUUpLeft}from\"phosphor-react\";// ===== CUSTOMIZATION SECTION =====\n// Edit this section to customize the password protection\n// Add or remove passwords here (case-sensitive)\nconst ALLOWED_PASSWORDS=[\"RiverTiger7\"];// Customize the text content here\nconst TEXT_CONTENT={title:[\"🔒 Enter password\"],subtitle:\"Psst, the password can be found in the header of my submitted resume\",errorMessage:\"Error: Password incorrect\",buttonText:\"Unlock access\",returnButtonText:\"Return to site\"};// Change this URL to where you want users to return when clicking the link to return\nconst RETURN_URL=\"https://andycabindol.com\";// Customize the design here\nconst STYLE_TOKENS={colors:{background:\"#FFFFFF\",text:\"#000000\",primary:\"#000000\",secondaryText:\"#605D64\",buttonText:\"#FFFFFF\",error:\"#D8512A\",inputBorder:\"#CCCCCC\",inputBorderFocus:\"#000000\",inputBorderError:\"#D8512A\",buttonHover:\"#333333\",linkHover:\"#333333\"},fonts:{heading:\"Syncopate, sans-serif\",body:\"General Sans, sans-serif\",button:\"General Sans, sans-serif\"},fontSizes:{title:\"clamp(1.25rem, 1.586vw + 1.151rem, 2rem)\",paragraph:\"18px\",input:\"16px\",button:\"16px\",small:\"14px\"},fontWeights:{normal:\"500\",medium:\"600\",bold:\"800\"},spacing:{xs:\"4px\",sm:\"8px\",md:\"12px\",lg:\"24px\",xl:\"32px\",xxl:\"48px\"},borderRadius:{small:\"8px\"},container:{maxWidth:\"400px\"}};// ===== END OF CUSTOMIZATION SECTION =====\nconst styles={container:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",minHeight:\"100vh\",backgroundColor:STYLE_TOKENS.colors.background,fontFamily:STYLE_TOKENS.fonts.body,color:STYLE_TOKENS.colors.text,padding:STYLE_TOKENS.spacing.md},header:{marginBottom:STYLE_TOKENS.spacing.lg,textAlign:\"center\"},title:{fontSize:STYLE_TOKENS.fontSizes.title,fontWeight:STYLE_TOKENS.fontWeights.bold,fontFamily:STYLE_TOKENS.fonts.heading,lineHeight:\"125%\",marginBottom:STYLE_TOKENS.spacing.xs},subtitle:{fontFamily:STYLE_TOKENS.fonts.body,fontWeight:STYLE_TOKENS.fontWeights.normal,fontSize:STYLE_TOKENS.fontSizes.paragraph,lineHeight:\"150%\",margin:\"0px\",color:STYLE_TOKENS.colors.secondaryText},form:{width:\"100%\",maxWidth:STYLE_TOKENS.container.maxWidth},inputContainer:{position:\"relative\"},input:{width:\"100%\",fontFamily:STYLE_TOKENS.fonts.body,fontSize:STYLE_TOKENS.fontSizes.paragraph,fontWeight:STYLE_TOKENS.fontWeights.normal,paddingTop:STYLE_TOKENS.spacing.md,paddingBottom:STYLE_TOKENS.spacing.md,paddingLeft:STYLE_TOKENS.spacing.md,paddingRight:STYLE_TOKENS.spacing.xxl,fontSize:STYLE_TOKENS.fontSizes.input,border:`1px solid ${STYLE_TOKENS.colors.inputBorder}`,borderRadius:STYLE_TOKENS.borderRadius.small,outline:\"none\",transition:\"border-color 0.3s\",WebkitAppearance:\"none\",MozAppearance:\"none\",appearance:\"none\"},inputError:{borderColor:STYLE_TOKENS.colors.inputBorderError},showPasswordButton:{position:\"absolute\",right:STYLE_TOKENS.spacing.md,top:\"50%\",transform:\"translateY(-50%)\",background:\"none\",border:\"none\",cursor:\"pointer\",padding:\"0\"},button:{width:\"100%\",padding:STYLE_TOKENS.spacing.md,marginTop:STYLE_TOKENS.spacing.lg,fontFamily:STYLE_TOKENS.fonts.button,fontSize:STYLE_TOKENS.fontSizes.button,fontWeight:STYLE_TOKENS.fontWeights.medium,color:STYLE_TOKENS.colors.buttonText,backgroundColor:STYLE_TOKENS.colors.primary,border:\"none\",borderRadius:STYLE_TOKENS.borderRadius.small,cursor:\"pointer\",transition:\"background-color 0.3s\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},buttonHovered:{backgroundColor:STYLE_TOKENS.colors.buttonHover},error:{color:STYLE_TOKENS.colors.error,marginTop:STYLE_TOKENS.spacing.md,fontSize:STYLE_TOKENS.fontSizes.small},returnLink:{marginTop:STYLE_TOKENS.spacing.xxl,color:STYLE_TOKENS.colors.text,textDecoration:\"none\",fontSize:STYLE_TOKENS.fontSizes.small,display:\"flex\",alignItems:\"center\"},returnLinkHovered:{color:STYLE_TOKENS.colors.linkHover}};export function requireAuth(Component){return props=>{const[authenticated,setAuthenticated]=useState(false);const[showPassword,setShowPassword]=useState(false);const[errorMessage,setErrorMessage]=useState(\"\");const passwordRef=useRef(null);const[loading,setLoading]=useState(true);const[hovered,setHovered]=useState(false);const validateAuth=e=>{e.preventDefault()// Prevent default form submission behavior\n;const inputPassword=e.target.elements.password.value;if(ALLOWED_PASSWORDS.includes(inputPassword)){setAuthenticated(true)// Set authenticated state to true\n;setErrorMessage(\"\")// Clear any existing error message\n;}else{setAuthenticated(false)// Ensure authenticated state is false\n;setErrorMessage(TEXT_CONTENT.errorMessage)// Set error message for invalid password\n;}// Optionally clear the password field after submission\ne.target.elements.password.value=\"\";};useEffect(()=>{if(passwordRef.current){passwordRef.current.focus();}setTimeout(()=>setLoading(false),1e3);},[]);if(!authenticated){return /*#__PURE__*/_jsxs(\"div\",{style:styles.container,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.header,children:[/*#__PURE__*/_jsx(\"h1\",{style:styles.title,children:TEXT_CONTENT.title.map((line,index)=>/*#__PURE__*/_jsxs(React.Fragment,{children:[line,/*#__PURE__*/_jsx(\"br\",{})]},index))}),/*#__PURE__*/_jsx(\"p\",{style:styles.subtitle,children:TEXT_CONTENT.subtitle})]}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:validateAuth,style:styles.form,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.inputContainer,children:[/*#__PURE__*/_jsx(\"input\",{type:showPassword?\"text\":\"password\",name:\"password\",ref:passwordRef,style:{...styles.input,...errorMessage?styles.inputError:{}},onFocus:e=>e.target.style.borderColor=STYLE_TOKENS.colors.inputBorderFocus,onBlur:e=>e.target.style.borderColor=errorMessage?STYLE_TOKENS.colors.inputBorderError:STYLE_TOKENS.colors.inputBorder,autoComplete:\"new-password\"}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>setShowPassword(!showPassword),style:styles.showPasswordButton,children:showPassword?/*#__PURE__*/_jsx(EyeSlash,{size:20,color:STYLE_TOKENS.colors.secondaryText}):/*#__PURE__*/_jsx(Eye,{size:20,color:STYLE_TOKENS.colors.secondaryText})})]}),errorMessage&&/*#__PURE__*/_jsx(\"p\",{style:styles.error,children:errorMessage}),/*#__PURE__*/_jsxs(\"button\",{type:\"submit\",style:{...styles.button,...hovered?styles.buttonHovered:{}},onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),children:[hovered?/*#__PURE__*/_jsx(LockSimpleOpen,{size:20}):/*#__PURE__*/_jsx(LockSimple,{size:20}),/*#__PURE__*/_jsx(\"span\",{style:{marginLeft:STYLE_TOKENS.spacing.sm},children:TEXT_CONTENT.buttonText})]})]}),/*#__PURE__*/_jsxs(\"a\",{href:RETURN_URL,style:styles.returnLink,onMouseEnter:e=>e.currentTarget.style.color=STYLE_TOKENS.colors.linkHover,onMouseOut:e=>e.currentTarget.style.color=STYLE_TOKENS.colors.text,children:[/*#__PURE__*/_jsx(ArrowUUpLeft,{size:16,style:{marginRight:STYLE_TOKENS.spacing.sm}}),TEXT_CONTENT.returnButtonText]})]});}return /*#__PURE__*/_jsx(Component,{...props});};}// Add property controls (if needed)\naddPropertyControls(requireAuth,{});\nexport const __FramerMetadata__ = {\"exports\":{\"requireAuth\":{\"type\":\"reactHoc\",\"name\":\"requireA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