{"version":3,"file":"ProtectedContentOverlay.DMnzQ2fS.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/aEWyayU8i27fjURhZ7xD/H8oIrSheunVmJHHkpwzZ/ProtectedContentOverlay.js"],"sourcesContent":["// Overlay for Protected Content with progressive blur until correct password is entered\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Protected Content Overlay\n *\n * Shows a full overlay with progressive blur, blocking interaction and blurring the background until the correct password is entered.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ProtectedContentOverlay(props){const{password=\"framer\",blurAmount=16,overlayColor=\"rgba(255,255,255,0.6)\",heading=\"Protected Content\",buttonText=\"Unlock\",style,children}=props;const[input,setInput]=useState(\"\");const[unlocked,setUnlocked]=useState(false);const[blur,setBlur]=useState(0);const blurRef=useRef(0);useEffect(()=>{if(!unlocked){blurRef.current=0;function animate(){blurRef.current+=2;startTransition(()=>{setBlur(Math.min(blurAmount,blurRef.current));});if(blurRef.current<blurAmount){requestAnimationFrame(animate);}}animate();}else{setBlur(0);}},[unlocked,blurAmount]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\"},children:[children,!unlocked&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",zIndex:9999,pointerEvents:\"auto\",background:overlayColor,backdropFilter:`blur(${blur}px)`,WebkitBackdropFilter:`blur(${blur}px)`,transition:\"backdrop-filter 0.3s cubic-bezier(.4,0,.2,1)\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"flex-start\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",marginTop:40,gap:16},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:20,fontWeight:600,color:\"#222\",marginBottom:8},children:heading}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:e=>{e.preventDefault();if(input===password)startTransition(()=>setUnlocked(true));},style:{display:\"flex\",flexDirection:\"row\",alignItems:\"center\",gap:8,background:\"none\",boxShadow:\"none\",padding:0,borderRadius:0,minWidth:0},children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:input,onChange:e=>setInput(e.target.value),placeholder:\"Enter password\",style:{fontSize:16,padding:\"10px 16px\",borderRadius:6,border:\"1px solid #ccc\",outline:\"none\",width:180},\"aria-label\":\"Password\"}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{fontSize:16,padding:\"10px 24px\",borderRadius:6,border:\"none\",background:\"#111\",color:\"#fff\",cursor:\"pointer\",fontWeight:600},children:buttonText})]})]})})]});}addPropertyControls(ProtectedContentOverlay,{heading:{type:ControlType.String,title:\"Heading\",defaultValue:\"Protected Content\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Unlock\"},password:{type:ControlType.String,title:\"Password\",defaultValue:\"framer\",obscured:false},blurAmount:{type:ControlType.Number,title:\"Blur Amount\",defaultValue:16,min:0,max:32,step:1,unit:\"px\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"rgba(255,255,255,0.6)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProtectedContentOverlay\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProtectedContentOverlay.map"],"mappings":"gSAQG,SAAwB,EAAwB,EAAM,CAAC,GAAK,CAAC,WAAS,SAAS,aAAW,GAAG,eAAa,wBAAwB,UAAQ,oBAAoB,aAAW,SAAS,QAAM,WAAS,CAAC,EAAW,CAAC,EAAM,EAAS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