{"version":3,"file":"PasswordGate.aMMIs2Cu.mjs","names":["useState","e"],"sources":["https:/framerusercontent.com/modules/sy5kA1qsZRbzFFjahwxz/Cluz4wfcgMkMv7bXlOq1/PasswordGate.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useState}from\"react\";export default function PasswordGate(props){const{password=\"scaleorfail_404\",heading=\"This work is private\",subtext=\"Enter the password to view this case study.\",buttonLabel=\"Unlock\",placeholder=\"Password\",homeLabel=\"← Back to homepage\",homeHref=\"/\",grape=\"\",bgImage=\"\",bg=\"#FDFBF7\",accent=\"#B83280\",textColor=\"#2F3637\",font=\"Figtree, sans-serif\",storageKey=\"cs-unlocked\"}=props;const isStatic=useIsStaticRenderer();const[unlocked,setUnlocked]=useState(false);const[value,setValue]=useState(\"\");const[error,setError]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;try{if(window.sessionStorage.getItem(storageKey)===\"1\")setUnlocked(true);}catch(e){}},[storageKey]);// On the canvas, show a small marker instead of covering the page so it stays editable.\nif(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{display:\"inline-flex\",alignItems:\"center\",gap:6,padding:\"6px 10px\",borderRadius:8,background:bg,border:`1px solid ${accent}`,color:accent,fontFamily:font,fontSize:12,whiteSpace:\"nowrap\"},children:\"🔒 Password gate (locks on published site)\"});}if(unlocked)return null;function onSubmit(e){e.preventDefault();if(value===password){try{window.sessionStorage.setItem(storageKey,\"1\");}catch(e){}setUnlocked(true);}else{setError(true);}}const wrap={position:\"fixed\",top:0,left:0,right:0,bottom:0,zIndex:2147483e3,background:bg,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:24,fontFamily:font,overflowY:\"auto\",WebkitOverflowScrolling:\"touch\"};if(bgImage){wrap.backgroundImage=`url(\"${bgImage}\")`;wrap.backgroundSize=\"cover\";wrap.backgroundPosition=\"center\";}const formStyle={width:\"100%\",maxWidth:360,display:\"flex\",flexDirection:\"column\",gap:14,alignItems:\"center\",textAlign:\"center\"};if(bgImage){// a readable card over the backdrop image\nformStyle.background=bg;formStyle.padding=28;formStyle.borderRadius=16;formStyle.boxShadow=\"0px 16px 44px rgba(60,40,55,0.22)\";}const inputStyle={width:\"100%\",boxSizing:\"border-box\",padding:\"12px 14px\",fontSize:15,borderRadius:10,border:`1px solid ${error?accent:\"rgba(0,0,0,0.15)\"}`,outline:\"none\",fontFamily:font,color:textColor,background:\"#fff\"};return /*#__PURE__*/_jsx(\"div\",{style:wrap,children:/*#__PURE__*/_jsxs(\"form\",{onSubmit:onSubmit,style:formStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:26,fontWeight:600,color:textColor,lineHeight:1.2},children:heading}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:15,color:textColor,opacity:.7,lineHeight:1.45},children:subtext}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:value,placeholder:placeholder,autoComplete:\"off\",autoCapitalize:\"none\",autoCorrect:\"off\",spellCheck:false,inputMode:\"text\",onChange:e=>{setValue(e.target.value);setError(false);},style:inputStyle}),grape?/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":true,style:{position:\"absolute\",top:-10,right:-10,fontSize:28,lineHeight:1,transform:\"rotate(8deg)\",pointerEvents:\"none\",userSelect:\"none\"},children:grape}):null]}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{width:\"100%\",padding:\"12px 14px\",fontSize:15,fontWeight:600,borderRadius:10,border:\"none\",background:accent,color:\"#fff\",cursor:\"pointer\",fontFamily:font},children:buttonLabel}),error&&/*#__PURE__*/_jsx(\"div\",{style:{fontSize:13,color:accent},children:\"Incorrect password — try again.\"}),homeLabel?/*#__PURE__*/_jsx(\"a\",{href:homeHref,onClick:e=>{// Force a real navigation (Framer's client router can swallow anchor\n// clicks from code components). Resolve the homepage relative to the\n// current page so it works on the published domain (pages sit at the\n// root) AND in Framer Preview (served under a sub-path) — a bare \"/\"\n// hits the wrong root in Preview and 404s.\ne.preventDefault();if(typeof window===\"undefined\")return;const target=!homeHref||homeHref===\"/\"?new URL(\".\",window.location.href).href:homeHref;window.location.assign(target);},style:{fontSize:13,color:textColor,opacity:.6,textDecoration:\"none\",fontFamily:font,marginTop:2,cursor:\"pointer\"},onMouseEnter:e=>{e.currentTarget.style.opacity=\"1\";e.currentTarget.style.textDecoration=\"underline\";},onMouseLeave:e=>{e.currentTarget.style.opacity=\"0.6\";e.currentTarget.style.textDecoration=\"none\";},children:homeLabel}):null]})});}addPropertyControls(PasswordGate,{password:{type:ControlType.String,title:\"Password\",defaultValue:\"scaleorfail_404\",obscured:true},heading:{type:ControlType.String,title:\"Heading\",defaultValue:\"This work is private\"},subtext:{type:ControlType.String,title:\"Subtext\",defaultValue:\"Enter the password to view this case study.\",displayTextArea:true},buttonLabel:{type:ControlType.String,title:\"Button\",defaultValue:\"Unlock\"},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Password\"},homeLabel:{type:ControlType.String,title:\"Home Link\",defaultValue:\"← Back to homepage\"},homeHref:{type:ControlType.String,title:\"Home Link URL\",defaultValue:\"/\"},grape:{type:ControlType.String,title:\"Corner Mark\",defaultValue:\"\"},bgImage:{type:ControlType.String,title:\"Backdrop\",defaultValue:\"\"},bg:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FDFBF7\"},accent:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#B83280\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#2F3637\"},font:{type:ControlType.String,title:\"Font\",defaultValue:\"Figtree, sans-serif\"},storageKey:{type:ControlType.String,title:\"Storage Key\",defaultValue:\"cs-unlocked\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PasswordGate\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\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