{"version":3,"file":"Sales_Password_Gate.DJ-890O2.mjs","names":["useId","useState"],"sources":["https:/framerusercontent.com/modules/2Oofhe5j3dUI93dDg8bE/gzpEQbWADImkPxDIdlrX/Sales_Password_Gate.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useId,useState}from\"react\";const FONT='\"Aeonik Regular\", \"Aeonik Regular Placeholder\", \"Aeonik\", sans-serif';// Glass surfaces from the Figma frames.\nconst GLASS_FILL=\"rgba(33, 22, 91, 0.2)\";const GLASS_BORDER=\"rgba(140, 134, 170, 0.2)\";const BUTTON_BORDER=\"rgba(82, 73, 127, 0.4)\";const BLUR=\"blur(16px)\";function readUnlocked(key){try{return window.sessionStorage.getItem(key)===\"1\";}catch{return false;}}function selectorFor(names){return names.split(\",\").map(n=>n.trim()).filter(Boolean).map(n=>`[data-framer-name=\"${n.replace(/[\"\\\\]/g,\"\\\\$&\")}\"]`).join(\",\");}/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1200\n */export default function SalesPasswordGate(props){const{password=\"\",storageKey=\"fundamental-sales\",hideLayers=\"\",background,title=\"Enter Password\",placeholder=\"Enter password\",buttonText=\"Submit\",errorText=\"Incorrect password. Please try again.\",previewOnCanvas=false,style}=props;const onCanvas=RenderTarget.current()===RenderTarget.canvas;const scope=\"spg\"+useId().replace(/[^a-zA-Z0-9]/g,\"\");// Locked on the server and on first paint, so gated content never flashes.\nconst[unlocked,setUnlocked]=useState(false);const[ready,setReady]=useState(false);const[value,setValue]=useState(\"\");const[error,setError]=useState(false);const[focused,setFocused]=useState(false);useEffect(()=>{setUnlocked(readUnlocked(storageKey));setReady(true);},[storageKey]);if(onCanvas&&!previewOnCanvas)return null;if(ready&&unlocked)return null;const submit=()=>{if(value===password){try{window.sessionStorage.setItem(storageKey,\"1\");}catch{}// Close the keyboard first and start the page from the top.\nconst active=document.activeElement;active?.blur?.();window.scrollTo(0,0);setUnlocked(true);setError(false);}else{setError(true);setValue(\"\");}};const bg=typeof background===\"string\"?background:background?.src;const hidden=onCanvas?\"\":selectorFor(hideLayers);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",minHeight:\"100vh\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"128px 20px\",boxSizing:\"border-box\",backgroundColor:\"rgb(12, 9, 43)\",backgroundImage:bg?`url(${bg})`:undefined,backgroundSize:\"cover\",backgroundPosition:\"center\",fontFamily:FONT},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                ${hidden?`${hidden} { display: none !important; }`:\"\"}\n                .${scope}-input::placeholder { color: rgba(255, 255, 255, 0.3); -webkit-text-fill-color: rgba(255, 255, 255, 0.3); opacity: 1; font-size: 14px; }\n                .${scope}-input:focus { outline: none; border-color: rgba(255, 255, 255, 0.5); }\n                .${scope}-input:-webkit-autofill,\n                .${scope}-input:-webkit-autofill:focus {\n                    -webkit-text-fill-color: transparent;\n                    -webkit-box-shadow: 0 0 0 1000px rgba(33, 22, 91, 0.2) inset;\n                    transition: background-color 9999s ease-in-out 0s;\n                }\n                @keyframes ${scope}-blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }\n                .${scope}-button:hover { background-color: rgba(33, 22, 91, 0.35); }\n            `}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:e=>{e.preventDefault();submit();},style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:16,width:320,maxWidth:\"100%\",padding:48,boxSizing:\"border-box\",borderRadius:24,background:GLASS_FILL,border:`1.25px solid ${GLASS_BORDER}`,backdropFilter:BLUR,WebkitBackdropFilter:BLUR},children:[/*#__PURE__*/_jsx(\"div\",{style:{color:\"#fff\",fontSize:24,lineHeight:\"130%\",textAlign:\"center\"},children:title}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",className:`${scope}-input`,value:value,placeholder:placeholder,\"aria-label\":title,autoComplete:\"current-password\",onFocus:()=>setFocused(true),onBlur:()=>setFocused(false),onChange:e=>{setValue(e.target.value);setError(false);},style:{width:\"100%\",height:42,padding:\"0 16px\",boxSizing:\"border-box\",borderRadius:8,background:GLASS_FILL,border:`0.5px solid ${GLASS_BORDER}`,// 16px stops iOS from zooming into the field.\nfontSize:16,fontFamily:FONT,color:\"transparent\",WebkitTextFillColor:\"transparent\",caretColor:\"transparent\"}}),/*#__PURE__*/_jsxs(\"div\",{\"aria-hidden\":true,style:{position:\"absolute\",inset:\"0 16px\",display:\"flex\",alignItems:\"center\",gap:5,overflow:\"hidden\",pointerEvents:\"none\"},children:[Array.from({length:value.length},(_,i)=>/*#__PURE__*/_jsx(\"span\",{style:{flex:\"none\",width:5,height:5,borderRadius:\"50%\",background:\"#fff\"}},i)),focused&&/*#__PURE__*/_jsx(\"span\",{style:{flex:\"none\",width:1,height:16,marginLeft:value.length?1:0,background:\"#fff\",animation:`${scope}-blink 1s step-end infinite`}})]})]}),error&&/*#__PURE__*/_jsx(\"div\",{role:\"alert\",style:{color:\"rgb(255, 170, 170)\",fontSize:13,lineHeight:\"130%\",textAlign:\"center\"},children:errorText}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",className:`${scope}-button`,style:{padding:\"12px 24px\",borderRadius:999,background:GLASS_FILL,border:`1px solid ${BUTTON_BORDER}`,backdropFilter:BLUR,WebkitBackdropFilter:BLUR,color:\"#fff\",fontFamily:FONT,fontSize:18,lineHeight:\"normal\",cursor:\"pointer\",transition:\"background-color 0.2s ease\"},children:buttonText})]})]});}SalesPasswordGate.displayName=\"Sales Password Gate\";addPropertyControls(SalesPasswordGate,{password:{type:ControlType.String,title:\"Password\",defaultValue:\"\"},storageKey:{type:ControlType.String,title:\"Storage Key\",defaultValue:\"fundamental-sales\",description:\"Pages sharing this key unlock together.\"},hideLayers:{type:ControlType.String,title:\"Hide Layers\",defaultValue:\"\",description:\"Layer names hidden while locked, comma separated.\"},background:{type:ControlType.ResponsiveImage,title:\"Background\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Enter Password\"},placeholder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter password\"},buttonText:{type:ControlType.String,title:\"Button\",defaultValue:\"Submit\"},errorText:{type:ControlType.String,title:\"Error\",defaultValue:\"Incorrect password. Please try again.\"},previewOnCanvas:{type:ControlType.Boolean,title:\"Canvas Preview\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SalesPasswordGate\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1200\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Sales_Password_Gate.map"],"mappings":"0MAC4J,SAAS,EAAa,EAAI,CAAC,GAAG,CAAC,OAAO,EAAO,eAAe,QAAQ,CAAG,IAAI,GAAI,MAAM,CAAC,MAAO,EAAM,CAAC,CAAC,SAAS,EAAY,EAAM,CAAC,OAAO,EAAM,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,GAAG,sBAAsB,EAAE,QAAQ,SAAS,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,GAAG,CAAE,CAI1Z,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,WAAS,GAAG,aAAW,oBAAoB,aAAW,GAAG,aAAW,QAAM,iBAAiB,cAAY,iBAAiB,aAAW,SAAS,YAAU,wCAAwC,kBAAgB,GAAM,SAAO,EAAY,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAM,MAAMA,EAAM,CAAC,CAAC,QAAQ,gBAAgB,EAAE,EACtY,CAAC,EAAS,GAAaC,EAAS,EAAK,EAA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