PageSourceSearch

https://helixflag.com/assets/UserProfile-ClnkUWuA.js

js helixflag.com collected 2026-10-02 01:31:35 UTC 29,270 bytes, 1 lines download raw bytes

1import{a as B,e as Ze,r as o,b as c,j as e}from"./index-EQVk02tg.js";import{W as m,i as et,b as tt,t as st,a as De,c as at,d as D,e as nt}from"./toAuthenticatorAttachment-Bvom-xHz.js";import{L as V}from"./Layout-CRdY9eup.js";import{I as $}from"./InsuranceLayout-1BAdOaQH.js";import"./Layout-CJPQ5iiB.js";function ot({error:i,options:p}){var x,f,g;const{publicKey:n}=p;if(!n)throw Error("options was missing required publicKey property");if(i.name==="AbortError"){if(p.signal instanceof AbortSignal)return new m({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:i})}else if(i.name==="ConstraintError"){if(((x=n.authenticatorSelection)==null?void 0:x.requireResidentKey)===!0)return new m({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:i});if(p.mediation==="conditional"&&((f=n.authenticatorSelection)==null?void 0:f.userVerification)==="required")return new m({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:i});if(((g=n.authenticatorSelection)==null?void 0:g.userVerification)==="required")return new m({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:i})}else{if(i.name==="InvalidStateError")return new m({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:i});if(i.name==="NotAllowedError")return new m({message:i.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:i});if(i.name==="NotSupportedError")return n.pubKeyCredParams.filter(u=>u.type==="public-key").length===0?new m({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:i}):new m({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:i});if(i.name==="SecurityError"){const l=globalThis.location.hostname;if(et(l)){if(n.rp.id!==l)return new m({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:i})}else return new m({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:i})}else if(i.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new m({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:i})}else if(i.name==="UnknownError")return new m({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:i})}return i}async function it(i){var I;!i.optionsJSON&&i.challenge&&(i={optionsJSON:i});const{optionsJSON:p,useAutoRegister:n=!1}=i;if(!tt())throw new Error("WebAuthn is not supported in this browser");const x={...p,challenge:De(p.challenge),user:{...p.user,id:De(p.user.id)},excludeCredentials:(I=p.excludeCredentials)==null?void 0:I.map(st)},f={};n&&(f.mediation="conditional"),f.publicKey=x,f.signal=at.createNewAbortSignal();let g;try{g=await navigator.credentials.create(f)}catch(h){throw ot({error:h,options:f})}if(!g)throw new Error("Registration was not completed");const{id:l,rawId:u,response:d,type:k}=g;let S;typeof d.getTransports=="function"&&(S=d.getTransports());let N;if(typeof d.getPublicKeyAlgorithm=="function")try{N=d.getPublicKeyAlgorithm()}catch(h){}let T;if(typeof d.getPublicKey=="function")try{const h=d.getPublicKey();h!==null&&(T=D(h))}catch(h){}let L;if(typeof d.getAuthenticatorData=="function")try{L=D(d.getAuthenticatorData())}catch(h){}return{id:l,rawId:D(u),response:{attestationObject:D(d.attestationObject),clientDataJSON:D(d.clientDataJSON),transports:S,publicKeyAlgorithm:N,publicKey:T,authenticatorData:L},type:k,clientExtensionResults:g.getClientExtensionResults(),authenticatorAttachment:nt(g.authenticatorAttachment)}}const de=({value:i,onChange:p,label:n,required:x=!0,minLength:f,autoCompleteType:g,id:l})=>{var S;const u=B();((S=u==null?void 0:u.user)==null?void 0:S.industry_type)==="insurance"?$:V;const[d,k]=o.useState(!1);return e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:l,children:n}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[e.jsx("input",{id:l,name:l,type:d?"text":"password",value:i,onChange:p,required:x,minLength:f,autoComplete:g||"new-password",style:{paddingRight:"40px"}}),e.jsx("button",{type:"button",onClick:()=>k(!d),style:{position:"absolute",right:"10px",background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",color:"#94a3b8"}
1,tabIndex:-1,children:d?e.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",width:"20",height:"20",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):e.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",width:"20",height:"20",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})]})]})},ut=()=>{var Te,Le,Ie;const i=B(),p=((Te=i==null?void 0:i.user)==null?void 0:Te.industry_type)==="insurance"?$:V,{user:n,updateUser:x}=B(),g=(Le=Ze().state)==null?void 0:Le.mfaSetupRequired,[l,u]=o.useState({first_name:"",last_name:"",phone:"",job_title:""}),[d,k]=o.useState(!1),[S,N]=o.useState(""),[T,L]=o.useState(""),[I,h]=o.useState(""),[z,ce]=o.useState(""),[pe,ue]=o.useState(""),[he,O]=o.useState(""),[xe,ge]=o.useState(""),[me,fe]=o.useState(!1),[y,q]=o.useState(!1),[R,E]=o.useState(!1),[ye,b]=o.useState(""),[be,F]=o.useState(""),[W,A]=o.useState(null),[H,G]=o.useState(""),[Y,J]=o.useState(""),[w,Q]=o.useState(!1),[C,P]=o.useState(!1),[we,j]=o.useState(""),[je,U]=o.useState(""),[M,_]=o.useState(null),[Se,X]=o.useState(""),[Be,Z]=o.useState(""),[ee,te]=o.useState(""),[se,ae]=o.useState(""),[ve,ze]=o.useState([]),[ke,Re]=o.useState(!1),[Ee,v]=o.useState(""),[Ae,K]=o.useState(""),[Ce,ne]=o.useState(""),[Oe,oe]=o.useState(!1),[Pe,Fe]=o.useState([]),[We,_e]=o.useState(!1);o.useEffect(()=>{n&&(u({first_name:n.first_name||"",last_name:n.last_name||"",phone:n.phone||"",job_title:n.job_title||""}),q(n.two_factor_enabled||!1),Q(n.totp_enabled||!1),re(),Ue())},[n]);const Ue=async()=>{_e(!0);try{const t=await c.get("/users/me/signed-documents");Fe(t.data)}catch{}finally{_e(!1)}},Me=async t=>{try{const s=await c.get(`/users/me/signed-documents/${t.id}/download`,{responseType:"blob"}),a=window.URL.createObjectURL(new Blob([s.data])),r=document.createElement("a");r.href=a,r.download=t.original_filename,document.body.appendChild(r),r.click(),r.remove(),window.URL.revokeObjectURL(a)}catch{alert("Failed to download document")}},ie=t=>{var a;const s=B();return((a=s==null?void 0:s.user)==null?void 0:a.industry_type)==="insurance"?$:V,t?new Date(t).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):""},Ke=t=>{var a;const s=B();return((a=s==null?void 0:s.user)==null?void 0:a.industry_type)==="insurance"?$:V,t?t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/(1024*1024)).toFixed(1)+" MB":""},Ve=async t=>{var s,a;t.preventDefault(),N(""),L(""),k(!0);try{const r=await c.patch("/users/me",l);x(r.data),L("Profile updated successfully")}catch(r){N(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to update profile")}finally{k(!1)}},$e=async()=>{var t,s;b(""),F(""),E(!0);try{await c.post("/auth/2fa/enable"),A("verify"),G("")}catch(a){b(((s=(t=a.response)==null?void 0:t.data)==null?void 0:s.detail)||"Failed to send verification code")}finally{E(!1)}},qe=async t=>{var s,a;t.preventDefault(),b(""),E(!0);try{await c.post("/auth/2fa/confirm",{code:H}),q(!0),A(null),G(""),F("Two-factor authentication has been enabled."),x({two_factor_enabled:!0})}catch(r){b(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Invalid verification code")}finally{E(!1)}},He=async t=>{var s,a;t.preventDefault(),b(""),E(!0);try{await c.post("/auth/2fa/disable",{password:Y}),q(!1),A(null),J(""),F("Two-factor authentication has been disabled."),x({two_factor_enabled:!1})}catch(r){b(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to disable 2FA")}finally{E(!1)}},re=async()=>{try{const t=await c.get("/auth/passkeys");ze(t.data)}catch{}},Ne=async()=>{var t,s;v(""),K(""),Re(!0);try{const r=(await c.post("/auth/passkey/register-options")).data,le=await it({optionsJSON:r});await c.post("/auth/passkey/register-verify",{...le,device_name:Ce.trim()||"Passkey"}),K("Passkey registered successfully!"),ne(""),oe(!1),re()}catch(a){a.name==="NotAllowedError"?v(""):(s=(t=a.response)==null?void 0:t.data)!=null&&s.detail?v(a.response.data.detail):v("Failed to register passkey. Please try again.")}finally{Re(!1)}},Ge=async(t,s)=>{var a,r;if(confirm(`Remove passkey "${s}"? You won't be able to use it to sign in anymore.`))try{await c.delete(`/auth/passkeys/${t}`),K(`Passkey "${s}" has been removed.`),re()}catch(le){v(((r=(a=le.response)==null?void 0:a.data)==null?void 0:r.detail)||"Failed to remove passkey")}},Ye=async()=>{var t,s;j(""),U(""),P(!0);try{const a=await c.post("/auth/totp/setup");X(a.data.qr_code),Z(a.data.secret),_("setup"),te("")}catch(a){j(((s=(t=a.response)==null?void 0:t.data)==null?void 0:s.detail)||"Failed to start authenticator setup")}finally{P(!1)}},Je=async t=>{var s,a;t.preventDefault(),j(""),P(!0);try{await c.post("/auth/totp/confirm",{code:ee}),Q(!0),_(null),X(""),Z(""),te(""),U("Authenticator app has been enabled."),x({totp_enabled:!0})}catch(r){j(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Invalid code. Please try again.")}finally{P(!1)}},Qe=async t=>{var s,a;t.preventDefault(),j(""),P(!0);try{await c.post("/auth/totp/disable",{password:se}),Q(!1),_(null),ae(""),U("Authenticator app has been disabled."),x({totp_enabled:!1})}catch(r){j(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to disable authenticator")}finally{P(!1)}},Xe=async t=>{var s,a;if(t.preventDefault(),O(""),ge(""),z!==pe){O("New passwords do not match");return}if(z.length<8){O("Password must be at least 8 characters");return}fe(!0);try{await c.post("/users/me/change-password",{current_password:I,new_password:z}),ge("Password changed successfully"),h(""),ce(""),ue("")}catch(r){O(((a=(s=r.response)==null?void 0:s.data)==null?void 0:a.detail)||"Failed to change password")}finally{fe(!1)}};return e.jsxs(p,{children:[e.jsx("h1",{style:{marginBottom:"24px"},children:"My Profile"}),g&&e.jsxs("div",{style:{padding:"16px 20px",marginBottom:"24px",borderRadius:"10px",background:"rgba(239, 68, 68, 0.08)",border:"1px solid rgba(239, 68, 68, 0.25)",display:"flex",alignItems:"center",gap:"12px"},children:[e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#dc2626",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:"600",fontSize:"15px",color:"#dc2626",marginBottom:"2px"},children:"Multi-factor authentication is required"}),e.jsx("div",{style:{fontSize:"13px",color:"#64748b"},children:"Your organization requires MFA. Please enable at least one method below to continue using the platform."})]}),e.jsx("button",{onClick:()=>{var t;return(t=document.getElementById("mfa-section"))==null?void 0:t.scrollIntoView({behavior:"smooth"})},style:{padding:"8px 18px",background:"#dc2626",color:"#fff",border:"none",borderRadius:"6px",fontWeight:600,fontSize:"13px",cursor:"pointer",whiteSpace:"nowrap",fontFamily:"inherit"},children:"Set Up MFA"})]}),e.jsxs("div",{className:"grid grid-2",children:[e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{marginBottom:"16
1px"},children:"Profile Information"}),S&&e.jsx("div",{className:"error",style:{marginBottom:"16px"},children:S}),T&&e.jsx("div",{className:"success",style:{marginBottom:"16px"},children:T}),e.jsxs("form",{onSubmit:Ve,children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Email"}),e.jsx("input",{type:"text",value:(n==null?void 0:n.email)||"",disabled:!0})]}),e.jsxs("div",{className:"grid grid-2",children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"First Name"}),e.jsx("input",{type:"text",value:l.first_name,onChange:t=>u({...l,first_name:t.target.value}),placeholder:"Enter your first name",maxLength:100})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Last Name"}),e.jsx("input",{type:"text",value:l.last_name,onChange:t=>u({...l,last_name:t.target.value}),placeholder:"Enter your last name",maxLength:100})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Phone Number"}),e.jsx("input",{type:"tel",value:l.phone,onChange:t=>u({...l,phone:t.target.value}),placeholder:"Enter your phone number",maxLength:20})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:"Job Title"}),e.jsx("input",{type:"text",value:l.job_title,onChange:t=>u({...l,job_title:t.target.value}),placeholder:"Enter your job title",maxLength:100})]}),e.jsxs("div",{style:{marginTop:"8px",padding:"12px",background:"rgba(100, 116, 139, 0.1)",borderRadius:"8px",fontSize:"13px",color:"#64748b"},children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Role:"})," ",(Ie=n==null?void 0:n.role)==null?void 0:Ie.replace("_"," ")]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Status:"})," ",n==null?void 0:n.status]}),(n==null?void 0:n.organization_id)&&e.jsxs("div",{children:[e.jsx("strong",{children:"Organization ID:"})," ",n.organization_id]})]}),e.jsx("button",{type:"submit",className:"btn btn-primary",disabled:d,style:{marginTop:"16px"},children:d?"Saving...":"Save Profile"})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("h2",{style:{marginBottom:"16px"},children:"Change Password"}),he&&e.jsx("div",{className:"error",style:{marginBottom:"16px"},children:he}),xe&&e.jsx("div",{className:"success",style:{marginBottom:"16px"},children:xe}),e.jsxs("form",{onSubmit:Xe,children:[e.jsx(de,{id:"profile-current-password",label:"Current Password",value:I,onChange:t=>h(t.target.value),autoCompleteType:"current-password"}),e.jsx(de,{id:"profile-new-password",label:"New Password",value:z,onChange:t=>ce(t.target.value),minLength:8,autoCompleteType:"new-password"}),e.jsx(de,{id:"profile-confirm-password",label:"Confirm New Password",value:pe,onChange:t=>ue(t.target.value),autoCompleteType:"new-password",minLength:8}),e.jsx("button",{type:"submit",className:"btn btn-primary",disabled:me,children:me?"Changing Password...":"Change Password"})]})]})]}),e.jsxs("div",{id:"mfa-section",className:"card",style:{marginTop:"24px"},children:[e.jsxs("h2",{style:{marginBottom:"16px",display:"flex",alignItems:"center",gap:"10px"},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#dc2626",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Two-Factor Authentication"]}),ye&&e.jsx("div",{className:"error",style:{marginBottom:"16px"},children:ye}),be&&e.jsx("div",{className:"success",style:{marginBottom:"16px"},children:be}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px",background:y?"rgba(34, 197, 94, 0.08)":"rgba(100, 116, 139, 0.06)",border:`1px solid ${y?"rgba(34, 197, 94, 0.2)":"#e5e7eb"}`,borderRadius:"8px",marginBottom:W?"16px":"0"},children:[e.jsxs("div",{children:[e.jsxs("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"4px"},children:["Email Verification",e.jsx("span",{style:{display:"inline-block",marginLeft:"8px",padding:"2px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:y?"rgba(34, 197, 94, 0.15)":"rgba(100, 116, 139, 0.1)",color:y?"#16a34a":"#64748b"},children:y?"ENABLED":"DISABLED"})]}),e.jsx("div",{style:{fontSize:"13px",color:"#64748b"},children:y?"A verification code will be sent to your email each time you log in.":"Add an extra layer of security by requiring a verification code sent to your email when you sign in."})]}),!W&&e.jsx("button",{onClick:y?()=>{A("disable"),b(""),F("")}:$e,disabled:R,className:`btn ${y?"btn-secondary":"btn-primary"}
1`,style:{whiteSpace:"nowrap",marginLeft:"16px",fontSize:"13px"},children:R?"Please wait...":y?"Disable":"Enable"})]}),W==="verify"&&e.jsxs("form",{onSubmit:qe,style:{padding:"16px",background:"rgba(59, 130, 246, 0.05)",border:"1px solid rgba(59, 130, 246, 0.15)",borderRadius:"8px"},children:[e.jsxs("div",{style:{fontSize:"13px",color:"#475569",marginBottom:"12px"},children:["A 6-digit verification code has been sent to ",e.jsx("strong",{children:n==null?void 0:n.email}),". Enter it below to confirm."]}),e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:H,onChange:t=>G(t.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",maxLength:6,style:{textAlign:"center",fontSize:"18px",letterSpacing:"4px",fontFamily:"monospace",fontWeight:"700",width:"160px"}}),e.jsx("button",{type:"submit",className:"btn btn-primary",disabled:R||H.length!==6,style:{fontSize:"13px"},children:R?"Verifying...":"Confirm"}),e.jsx("button",{type:"button",onClick:()=>{A(null),b("")},style:{background:"none",border:"none",color:"#64748b",cursor:"pointer",fontSize:"13px"},children:"Cancel"})]})]}),W==="disable"&&e.jsxs("form",{onSubmit:He,style:{padding:"16px",background:"rgba(239, 68, 68, 0.05)",border:"1px solid rgba(239, 68, 68, 0.15)",borderRadius:"8px"},children:[e.jsx("div",{style:{fontSize:"13px",color:"#475569",marginBottom:"12px"},children:"Enter your password to disable two-factor authentication."}),e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e.jsx("input",{type:"password",value:Y,onChange:t=>J(t.target.value),placeholder:"Current password",autoComplete:"current-password",style:{width:"240px"}}),e.jsx("button",{type:"submit",className:"btn",disabled:R||!Y,style:{fontSize:"13px",background:"#dc2626",color:"white",border:"none"},children:R?"Disabling...":"Disable 2FA"}),e.jsx("button",{type:"button",onClick:()=>{A(null),b(""),J("")},style:{background:"none",border:"none",color:"#64748b",cursor:"pointer",fontSize:"13px"},children:"Cancel"})]})]})]}),e.jsxs("div",{className:"card",style:{marginTop:"24px"},children:[e.jsxs("h2",{style:{marginBottom:"16px",display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#dc2626",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Authenticator App"]}),we&&e.jsx("div",{className:"error",style:{marginBottom:"16px"},children:we}),je&&e.jsx("div",{className:"success",style:{marginBottom:"16px"},children:je}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px",background:w?"rgba(34, 197, 94, 0.08)":"rgba(100, 116, 139, 0.06)",border:`1px solid ${w?"rgba(34, 197, 94, 0.2)":"#e5e7eb"}`,borderRadius:"8px",marginBottom:M?"16px":"0"},children:[e.jsxs("div",{children:[e.jsxs("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"4px"},children:["Google Authenticator / Authy",e.jsx("span",{style:{display:"inline-block",marginLeft:"8px",padding:"2px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:w?"rgba(34, 197, 94, 0.15)":"rgba(100, 116, 139, 0.1)",color:w?"#16a34a":"#64748b"},children:w?"ENABLED":"DISABLED"})]}),e.jsx("div",{style:{fontSize:"13px",color:"#64748b"},children:w?"Your authenticator app generates a new code every 30 seconds for login verification.":"Use an authenticator app like Google Authenticator, Authy, or 1Password for time-based verification codes."})]}),!M&&e.jsx("button",{onClick:w?()=>{_("disable"),j(""),U("")}:Ye,disabled:C,className:`btn ${w?"btn-secondary":"btn-primary"}`,style:{whiteSpace:"nowrap",marginLeft:"16px",fontSize:"13px"},children:C?"Please wait...":w?"Disable":"Set Up"})]}),M==="setup"&&e.jsxs("div",{style:{padding:"20px",background:"rgba(59, 130, 246, 0.05)",border:"1px solid rgba(59, 130, 246, 0.15)",borderRadius:"8px"},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:"600",marginBottom:"12px",color:"#1e293b"},children:"Step 1: Scan QR Code"}),e.jsx("div",{style:{fontSize:"13px",color:"#475569",marginBottom:"16
1px"},children:"Open your authenticator app and scan this QR code. If you can't scan, enter the secret key manually."}),e.jsxs("div",{style:{display:"flex",gap:"24px",alignItems:"flex-start",flexWrap:"wrap"},children:[e.jsx("div",{style:{background:"white",padding:"12px",borderRadius:"12px",border:"1px solid #e5e7eb",display:"inline-block"},children:Se&&e.jsx("img",{src:Se,alt:"TOTP QR Code",style:{width:"180px",height:"180px",display:"block"}})}),e.jsxs("div",{style:{flex:1,minWidth:"240px"},children:[e.jsx("div",{style:{fontSize:"12px",color:"#64748b",marginBottom:"4px",fontWeight:"500"},children:"Manual entry key:"}),e.jsx("div",{style:{fontFamily:"monospace",fontSize:"14px",fontWeight:"700",padding:"8px 12px",background:"rgba(100, 116, 139, 0.08)",borderRadius:"6px",border:"1px solid #e5e7eb",letterSpacing:"2px",wordBreak:"break-all",marginBottom:"20px",userSelect:"all"},children:Be}),e.jsx("div",{style:{fontSize:"14px",fontWeight:"600",marginBottom:"8px",color:"#1e293b"},children:"Step 2: Enter Verification Code"}),e.jsx("form",{onSubmit:Je,children:e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e.jsx("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",value:ee,onChange:t=>te(t.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",maxLength:6,style:{textAlign:"center",fontSize:"18px",letterSpacing:"4px",fontFamily:"monospace",fontWeight:"700",width:"160px"}}),e.jsx("button",{type:"submit",className:"btn btn-primary",disabled:C||ee.length!==6,style:{fontSize:"13px"},children:C?"Verifying...":"Verify & Enable"})]})}),e.jsx("button",{type:"button",onClick:()=>{_(null),j(""),X(""),Z("")},style:{background:"none",border:"none",color:"#64748b",cursor:"pointer",fontSize:"13px",marginTop:"8px"},children:"Cancel"})]})]})]}),M==="disable"&&e.jsxs("form",{onSubmit:Qe,style:{padding:"16px",background:"rgba(239, 68, 68, 0.05)",border:"1px solid rgba(239, 68, 68, 0.15)",borderRadius:"8px"},children:[e.jsx("div",{style:{fontSize:"13px",color:"#475569",marginBottom:"12px"},children:"Enter your password to disable the authenticator app."}),e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e.jsx("input",{type:"password",value:se,onChange:t=>ae(t.target.value),placeholder:"Current password",autoComplete:"current-password",style:{width:"240px"}}),e.jsx("button",{type:"submit",className:"btn",disabled:C||!se,style:{fontSize:"13px",background:"#dc2626",color:"white",border:"none"},children:C?"Disabling...":"Disable Authenticator"}),e.jsx("button",{type:"button",onClick:()=>{_(null),j(""),ae("")},style:{background:"none",border:"none",color:"#64748b",cursor:"pointer",fontSize:"13px"},children:"Cancel"})]})]})]}),e.jsxs("div",{className:"card",style:{marginTop:"24px"},children:[e.jsxs("h2",{style:{marginBottom:"16px",display:"flex",alignItems:"center",gap:"10px"},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#dc2626",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M15.5 7.5a3.5 3.5 0 11-7 0 3.5 3.5 0 017 0z"}),e.jsx("path",{d:"M12 11c-2.21 0-4 1.79-4 4v1h2l1 5h2l1-5h2v-1c0-2.21-1.79-4-4-4z"})]}),"Passkeys"]}),Ee&&e.jsx("div",{className:"error",style:{marginBottom:"16px"},children:Ee}),Ae&&e.jsx("div",{className:"success",style:{marginBottom:"16px"},children:Ae}),e.jsx("div",{style:{fontSize:"13px",color:"#64748b",marginBottom:"16px"},children:"Passkeys let you sign in with your fingerprint, face, or phone - no password needed. Works with Face ID, Touch ID, Windows Hello, Android biometrics, and security keys."}),ve.length>0&&e.jsx("div",{style:{display:"grid",gap:"8px",marginBottom:"16px"},children:ve.map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 14px",border:"1px solid #e5e7eb",borderRadius:"8px",background:"white"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",borderRadius:"8px",background:"rgba(34, 197, 94, 0.1)",color:"#16a34a",flexShrink:0},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("path",{d:"M9 12l2 2 4-4"})]})}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:"500",fontSize:"14px"},children:t.device_name}),e.jsxs("div",{style:{fontSize:"12px",color:"#94a3b8"},children:["Added ",ie(t.created_at),t.last_used_at&&` · Last used ${ie(t.last_used_at)}`]})]})]}),e.jsx("button",{onClick:()=>Ge(t.id,t.device_name),style:{padding:"4px 10px",border:"1px solid #fca5a5",borderRadius:"6px",background:"#fef2f2",color:"#dc2626",cursor:"pointer",fontSize:"12px",fontWeight:"500"},children:"Remove"})]},t.id))}),Oe?e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e.jsx("input",{type:"text",value:Ce,onChange:t=>ne(t.target.value),placeholder:"Name this passkey (e.g. iPhone, MacBook)",maxLength:100,style:{flex:1},onKeyDown:t=>{t.key==="Enter"&&Ne()},autoFocus:!0}),e.jsx("button",{onClick:Ne,disabled:ke,className:"btn btn-primary",style:{fontSize:"13px",whiteSpace:"nowrap"},children:ke?"Waiting...":"Continue"}),e.jsx("button",{onClick:()=>{oe(!1),ne(""),v("")},style:{background:"none",border:"none",color:"#64748b",cursor:"pointer",fontSize:"13px"},children:"Cancel"})]}):e.jsx("button",{onClick:()=>{oe(!0),v(""),K("")},className:"btn btn-primary",style:{fontSize:"13px"},children:"+ Add a Passkey"})]}),e.jsxs("div",{className:"card",style:{marginTop:"24px"}
1,children:[e.jsxs("h2",{style:{marginBottom:"16px",display:"flex",alignItems:"center",gap:"10px"},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#dc2626",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),"Signed Documents"]}),We?e.jsx("div",{style:{textAlign:"center",padding:"20px",color:"#64748b"},children:"Loading..."}):Pe.length===0?e.jsx("div",{style:{textAlign:"center",padding:"30px",color:"#94a3b8",fontSize:"14px"},children:"No signed documents yet. Documents you sign will appear here automatically."}):e.jsx("div",{style:{display:"grid",gap:"10px"},children:Pe.map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",border:"1px solid #e5e7eb",borderRadius:"8px",background:"white",transition:"border-color 0.15s"},onMouseEnter:s=>s.currentTarget.style.borderColor="#dc2626",onMouseLeave:s=>s.currentTarget.style.borderColor="#e5e7eb",children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1},children:[e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"8px",fontSize:"11px",fontWeight:"700",background:"#dc262618",color:"#dc2626",letterSpacing:"0.5px",flexShrink:0},children:"PDF"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:"500",fontSize:"14px",marginBottom:"2px"},children:t.title}),e.jsxs("div",{style:{fontSize:"12px",color:"#94a3b8"},children:["Signed by ",t.signer_name||t.signer_email,t.signed_at&&` on ${ie(t.signed_at)}`,t.file_size>0&&` · ${Ke(t.file_size)}`]})]})]}),e.jsx("button",{onClick:()=>Me(t),style:{padding:"6px 14px",border:"1px solid #bfdbfe",borderRadius:"6px",background:"#eff6ff",color:"#1e40af",cursor:"pointer",fontSize:"12px",fontWeight:"500",flexShrink:0},children:"Download"})]},t.id))})]})]})};export{ut as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.