@strands.gg/accui 2.17.15 → 2.17.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -2,4 +2,4 @@
2
2
  `);await navigator.clipboard.writeText(w)}catch(w){console.warn("Failed to copy backup codes to clipboard:",w)}},I=()=>{o("success")};return(w,h)=>(e.openBlock(),e.createBlock(_e,{modelValue:C.value,"onUpdate:modelValue":h[5]||(h[5]=D=>C.value=D),title:"Setup Authenticator App","card-class":"modal-card"},{default:e.withCtx(()=>[s.value===1?(e.openBlock(),e.createElementBlock("div",d1,[h[8]||(h[8]=e.createElementVNode("div",null,[e.createElementVNode("h3",{class:"step-title"},"Name Your Device"),e.createElementVNode("p",{class:"step-description"},' Give this authenticator a memorable name (e.g., "iPhone", "Work Phone") ')],-1)),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:m.value,"onUpdate:modelValue":h[0]||(h[0]=D=>m.value=D),label:"Device Name",placeholder:"My Authenticator",error:y.value,disabled:e.unref(f)},null,8,["modelValue","error","disabled"]),e.createElementVNode("div",u1,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:$,disabled:e.unref(f)},{default:e.withCtx(()=>[...h[6]||(h[6]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{variant:"primary",onClick:p,disabled:!m.value.trim()||e.unref(f),loading:e.unref(f)},{default:e.withCtx(()=>[...h[7]||(h[7]=[e.createTextVNode(" Continue ",-1)])]),_:1},8,["disabled","loading"])])])):e.createCommentVNode("",!0),s.value===2?(e.openBlock(),e.createElementBlock("div",m1,[h[13]||(h[13]=e.createElementVNode("div",null,[e.createElementVNode("h3",{class:"step-title"},"Scan QR Code"),e.createElementVNode("p",{class:"step-description"}," Scan this QR code with your authenticator app (Google Authenticator, Authy, etc.) ")],-1)),e.createElementVNode("div",p1,[M.value?(e.openBlock(),e.createElementBlock("div",f1,[e.createElementVNode("img",{src:M.value,alt:"TOTP QR Code",class:"qr-image",width:"200",height:"200"},null,8,v1)])):(e.openBlock(),e.createElementBlock("div",h1,[e.createVNode(e.unref(S.StrandsUiLoader),{size:24})]))]),e.createElementVNode("div",C1,[h[9]||(h[9]=e.createElementVNode("p",{class:"manual-label"}," Can't scan? Enter this code manually: ",-1)),e.createElementVNode("code",g1,e.toDisplayString(u.value?.secret||"..."),1)]),u.value?.backup_codes?(e.openBlock(),e.createElementBlock("div",y1,[...h[10]||(h[10]=[e.createElementVNode("div",{class:"flex items-start space-x-2"},[e.createElementVNode("svg",{class:"w-5 h-5 text-yellow-600 mt-0.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})]),e.createElementVNode("div",null,[e.createElementVNode("p",{class:"text-sm font-medium text-yellow-800"},"Save Your Backup Codes"),e.createElementVNode("p",{class:"text-sm text-yellow-700 mt-1"}," After setup, you'll receive backup codes. Store them safely - they're your only way to recover access if you lose your device. ")])],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",k1,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:h[1]||(h[1]=D=>s.value=1),disabled:e.unref(f)},{default:e.withCtx(()=>[...h[11]||(h[11]=[e.createTextVNode(" Back ",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{variant:"primary",onClick:h[2]||(h[2]=D=>s.value=3),disabled:e.unref(f)},{default:e.withCtx(()=>[...h[12]||(h[12]=[e.createTextVNode(" I've Added It ",-1)])]),_:1},8,["disabled"])])])):e.createCommentVNode("",!0),s.value===3?(e.openBlock(),e.createElementBlock("div",w1,[h[16]||(h[16]=e.createElementVNode("div",null,[e.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900 mb-2"},"Verify Setup"),e.createElementVNode("p",{class:"text-sm text-gray-600 mb-4"}," Enter the 6-digit code from your authenticator app to complete setup ")],-1)),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:k.value,"onUpdate:modelValue":h[3]||(h[3]=D=>k.value=D),type:"pincode",label:"Verification Code","max-length":6,variant:"numeric",error:r.value,disabled:e.unref(f),onComplete:T},null,8,["modelValue","error","disabled"]),e.createElementVNode("div",V1,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:h[4]||(h[4]=D=>s.value=2),disabled:e.unref(f)},{default:e.withCtx(()=>[...h[14]||(h[14]=[e.createTextVNode(" Back ",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{variant:"primary",onClick:v,disabled:k.value.length!==6||e.unref(f),loading:e.unref(f)},{default:e.withCtx(()=>[...h[15]||(h[15]=[e.createTextVNode(" Verify & Enable ",-1)])]),_:1},8,["disabled","loading"])])])):e.createCommentVNode("",!0),s.value===4?(e.openBlock(),e.createElementBlock("div",N1,[h[20]||(h[20]=e.createElementVNode("div",{class:"totp-setup-success"},[e.createElementVNode("div",{class:"totp-setup-success-icon"},[e.createElementVNode("svg",{class:"totp-setup-check-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])]),e.createElementVNode("h3",{class:"totp-setup-step-title"},"TOTP Setup Complete!"),e.createElementVNode("p",{class:"totp-setup-success-description"}," Your authenticator app is now active for two-factor authentication. ")],-1)),e.createElementVNode("div",E1,[h[18]||(h[18]=e.createElementVNode("div",{class:"totp-setup-backup-header"},[e.createElementVNode("svg",{class:"totp-setup-backup-warning-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})]),e.createElementVNode("div",null,[e.createElementVNode("p",{class:"totp-setup-backup-header-title"},"Save These Backup Codes"),e.createElementVNode("p",{class:"totp-setup-backup-header-description"}," Store these codes in a safe place. Each code can only be used once. ")])],-1)),e.createElementVNode("div",b1,[e.createElementVNode("div",x1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value?.backup_codes,(D,L)=>(e.openBlock(),e.createElementBlock("div",{key:L,class:"totp-setup-backup-code"},e.toDisplayString(D),1))),128))])]),e.createElementVNode("div",B1,[e.createVNode(e.unref(ee),{variant:"secondary",size:"sm",onClick:x},{default:e.withCtx(()=>[...h[17]||(h[17]=[e.createTextVNode(" 📋 Copy Codes ",-1)])]),_:1})])]),e.createElementVNode("div",S1,[e.createVNode(e.unref(ee),{variant:"primary",onClick:I},{default:e.withCtx(()=>[...h[19]||(h[19]=[e.createTextVNode(" Done ",-1)])]),_:1})])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue"]))}}),Ot=S._export_sfc(M1,[["__scopeId","data-v-a23ed8a3"]]),$1={key:0,class:"email-mfa-setup-step"},T1={class:"email-mfa-setup-step-actions"},A1={key:1,class:"email-mfa-setup-step"},_1={class:"email-mfa-setup-resend-section"},z1={class:"email-mfa-setup-step-actions"},D1={key:2,class:"email-mfa-setup-step"},I1={class:"email-mfa-setup-final-actions"},L1=e.defineComponent({__name:"StrandsEmailMfaSetupModal",props:{show:{type:Boolean}},emits:["close","success"],setup(a,{emit:l}){const t=a,o=l,{setupEmailMfa:E,sendEmailMfaCode:b,verifyEmailMfaCode:f,loading:C}=Ye(),s=e.computed({get:()=>t.show,set:g=>{g||o("close")}}),m=e.ref(1),y=e.ref(""),k=e.ref(""),r=e.ref(""),u=e.ref(""),M=e.ref(null),$=e.ref(!1),p=e.ref(0);let T=null;e.watch(()=>t.show,g=>{g&&(m.value=1,y.value="",k.value="",r.value="",u.value="",M.value=null,$.value=!1,p.value=0,T&&(clearInterval(T),T=null))}),e.watch(r,()=>{u.value&&(u.value="")}),e.onBeforeUnmount(()=>{T&&clearInterval(T)});const v=()=>{o("close")},x=async()=>{if(!y.value.trim()){k.value="Device name is required";return}k.value="";try{const g=await E(y.value.trim());M.value=g.device_id,await b(g.device_id),m.value=2,D()}catch(g){console.error("Failed to setup email MFA:",g),k.value=g instanceof Error?g.message:"Failed to setup email MFA"}},I=g=>{u.value="",g.length===6&&w()},w=async()=>{if(!(!M.value||!r.value)){u.value="";try{await f(M.value,r.value)?m.value=3:u.value="Invalid verification code"}catch(g){console.error("Failed to verify email MFA code:",g),u.value=g instanceof Error?g.message:"Invalid verification code"}}},h=async()=>{if(!(!M.value||$.value))try{await b(M.value),D()}catch(g){console.warn("Failed to resend email MFA verification code:",g)}},D=()=>{$.value=!0,p.value=30,T=setInterval(()=>{p.value-=1,p.value<=0&&($.value=!1,T&&(clearInterval(T),T=null))},1e3)},L=()=>{o("success")};return(g,N)=>(e.openBlock(),e.createBlock(_e,{modelValue:s.value,"onUpdate:modelValue":N[3]||(N[3]=Z=>s.value=Z),title:"Setup Email 2FA","card-class":"email-mfa-setup-modal"},{default:e.withCtx(()=>[m.value===1?(e.openBlock(),e.createElementBlock("div",$1,[N[7]||(N[7]=e.createElementVNode("div",null,[e.createElementVNode("h3",{class:"email-mfa-setup-step-title"},"Name Your Email 2FA"),e.createElementVNode("p",{class:"email-mfa-setup-step-description"},' Give this email 2FA method a memorable name (e.g., "Personal Email", "Work Email") ')],-1)),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:y.value,"onUpdate:modelValue":N[0]||(N[0]=Z=>y.value=Z),label:"Device Name",placeholder:"Personal Email",error:k.value,disabled:e.unref(C)},null,8,["modelValue","error","disabled"]),e.createVNode(e.unref(S.StrandsUiAlert),{variant:"info",title:"Email 2FA"},{default:e.withCtx(()=>[...N[4]||(N[4]=[e.createTextVNode(" Verification codes will be sent to your registered email address when logging in. ",-1)])]),_:1}),e.createElementVNode("div",T1,[e.createVNode(e.unref(ee),{color:"secondary",onClick:v,disabled:e.unref(C)},{default:e.withCtx(()=>[...N[5]||(N[5]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{onClick:x,disabled:!y.value.trim()||e.unref(C),loading:e.unref(C)},{default:e.withCtx(()=>[...N[6]||(N[6]=[e.createTextVNode(" Setup Email 2FA ",-1)])]),_:1},8,["disabled","loading"])])])):e.createCommentVNode("",!0),m.value===2?(e.openBlock(),e.createElementBlock("div",A1,[N[10]||(N[10]=e.createElementVNode("div",null,[e.createElementVNode("h3",{class:"email-mfa-setup-step-title"},"Test Email 2FA"),e.createElementVNode("p",{class:"email-mfa-setup-step-description"}," We've sent a test verification code to your email. Enter it below to complete setup. ")],-1)),N[11]||(N[11]=e.createElementVNode("div",{class:"email-mfa-setup-success-notification"},[e.createElementVNode("div",{class:"email-mfa-setup-success-content"},[e.createElementVNode("svg",{class:"email-mfa-setup-success-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})]),e.createElementVNode("div",null,[e.createElementVNode("p",{class:"email-mfa-setup-success-title"},"Code Sent!"),e.createElementVNode("p",{class:"email-mfa-setup-success-description"}," Check your email inbox for the verification code. ")])])],-1)),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:r.value,"onUpdate:modelValue":N[1]||(N[1]=Z=>r.value=Z),type:"pincode",label:"Verification Code","max-length":6,variant:"numeric",error:u.value,disabled:e.unref(C),onComplete:I},null,8,["modelValue","error","disabled"]),e.createElementVNode("div",_1,[e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:h,disabled:e.unref(C)||$.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString($.value?`Resend in ${p.value}s`:"Resend Code"),1)]),_:1},8,["disabled"])]),e.createElementVNode("div",z1,[e.createVNode(e.unref(ee),{color:"secondary",onClick:N[2]||(N[2]=Z=>m.value=1),disabled:e.unref(C)},{default:e.withCtx(()=>[...N[8]||(N[8]=[e.createTextVNode(" Back ",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{onClick:w,disabled:r.value.length!==6||e.unref(C),loading:e.unref(C)},{default:e.withCtx(()=>[...N[9]||(N[9]=[e.createTextVNode(" Verify & Enable ",-1)])]),_:1},8,["disabled","loading"])])])):e.createCommentVNode("",!0),m.value===3?(e.openBlock(),e.createElementBlock("div",D1,[N[13]||(N[13]=e.createElementVNode("div",{class:"email-mfa-setup-completion"},[e.createElementVNode("div",{class:"email-mfa-setup-completion-icon"},[e.createElementVNode("svg",{class:"email-mfa-setup-check-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])]),e.createElementVNode("h3",{class:"email-mfa-setup-step-title"},"Email 2FA Setup Complete!"),e.createElementVNode("p",{class:"email-mfa-setup-completion-description"}," Email verification is now active for your account. You'll receive codes at your registered email address. ")],-1)),N[14]||(N[14]=e.createElementVNode("div",{class:"email-mfa-setup-info"},[e.createElementVNode("div",{class:"email-mfa-setup-info-content"},[e.createElementVNode("svg",{class:"email-mfa-setup-info-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})]),e.createElementVNode("div",null,[e.createElementVNode("p",{class:"email-mfa-setup-info-title"},"How it works"),e.createElementVNode("p",{class:"email-mfa-setup-info-description"}," When logging in, you'll receive a 6-digit code at your email address. Enter this code to complete authentication. ")])])],-1)),e.createElementVNode("div",I1,[e.createVNode(e.unref(ee),{variant:"primary",onClick:L},{default:e.withCtx(()=>[...N[12]||(N[12]=[e.createTextVNode(" Done ",-1)])]),_:1})])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue"]))}}),Rt=S._export_sfc(L1,[["__scopeId","data-v-34ee7825"]]),U1={key:0,class:"hardware-key-setup-step"},H1={class:"hardware-key-setup-actions"},P1={key:1,class:"hardware-key-setup-step"},j1={class:"hardware-key-setup-instructions"},O1={class:"hardware-key-setup-instructions-header"},R1={class:"hardware-key-setup-instructions-list"},F1={class:"hardware-key-setup-actions"},q1={key:2,class:"hardware-key-setup-step"},K1={class:"hardware-key-setup-progress"},Z1={class:"hardware-key-setup-progress-icon"},G1={class:"hardware-key-setup-progress-message"},Y1={key:3,class:"hardware-key-setup-step"},W1={class:"hardware-key-setup-backup-codes"},Q1={class:"hardware-key-setup-codes-container"},X1={class:"hardware-key-setup-codes-grid"},J1={class:"hardware-key-setup-copy-action"},ec={class:"hardware-key-setup-final-action"},tc={key:4,class:"hardware-key-setup-step"},ac={class:"hardware-key-setup-error"},oc={class:"hardware-key-setup-error-message"},nc={class:"hardware-key-setup-actions"},lc=e.defineComponent({__name:"StrandsHardwareKeySetupModal",props:{show:{type:Boolean},deviceType:{default:"hardware"}},emits:["close","success"],setup(a,{emit:l}){const t=a,o=l,{loading:E}=Ye(),{registerHardwareKey:b,completeHardwareKeyRegistration:f,currentSession:C}=Ie.useStrandsAuth(),s=e.ref(!1),m=e.computed(()=>E.value||s.value),y=e.computed(()=>t.deviceType==="passkey"?"Setup Passkey":"Setup Hardware Key"),k=e.computed({get:()=>t.show,set:g=>{g||o("close")}}),r=e.ref(1),u=e.ref(""),M=e.ref(""),$=e.ref("Please touch your hardware key when prompted"),p=e.ref(""),T=e.ref([]);e.watch(()=>t.show,g=>{g&&(r.value=1,u.value="",M.value="",$.value="Please touch your hardware key when prompted",p.value="",T.value=[])});const v=()=>{o("close")},x=g=>g==="passkey"?{authenticatorAttachment:void 0,requireResidentKey:!0,residentKey:"required",userVerification:"required"}:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,residentKey:"discouraged",userVerification:"discouraged"},I=(g,N)=>{const Z=J=>{try{if(!J)return new Uint8Array(32);if(J instanceof Uint8Array)return new Uint8Array(J);if(J&&typeof J=="object"&&J.buffer)return new Uint8Array(J.buffer);if(Array.isArray(J))return new Uint8Array(J);if(typeof J=="string"){const ie=atob(J),me=new Uint8Array(ie.length);for(let ve=0;ve<ie.length;ve++)me[ve]=ie.charCodeAt(ve);return me}return crypto.getRandomValues(new Uint8Array(32))}catch{return crypto.getRandomValues(new Uint8Array(32))}};try{const J={rp:g.rp||{name:"Strands Accounts"},user:{id:Z(g.user?.id),name:g.user?.name||"user",displayName:g.user?.displayName||g.user?.name||"User"},challenge:Z(g.challenge),pubKeyCredParams:g.pubKeyCredParams||[{type:"public-key",alg:-7},{type:"public-key",alg:-35},{type:"public-key",alg:-36},{type:"public-key",alg:-257},{type:"public-key",alg:-258},{type:"public-key",alg:-259},{type:"public-key",alg:-37},{type:"public-key",alg:-38},{type:"public-key",alg:-39},{type:"public-key",alg:-8}],timeout:g.timeout||(N==="passkey"?3e5:12e4),authenticatorSelection:g.authenticatorSelection||x(N),attestation:g.attestation||(N==="passkey"?"none":"direct")};return g.excludeCredentials&&Array.isArray(g.excludeCredentials)&&g.excludeCredentials.length>0&&(J.excludeCredentials=g.excludeCredentials.map(ie=>({type:"public-key",id:Z(ie.id)}))),J}catch{throw new Error("Unable to process WebAuthn challenge data")}},w=async()=>{if(!u.value.trim()){M.value="Device name is required";return}M.value="",r.value=2},h=async()=>{s.value=!0,r.value=3,$.value=`Starting ${t.deviceType==="passkey"?"passkey":"hardware key"} registration...`;try{if(!window.navigator.credentials||!window.PublicKeyCredential)throw new Error("WebAuthn is not supported in this browser");try{await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable?.(),PublicKeyCredential.isConditionalMediationAvailable&&await PublicKeyCredential.isConditionalMediationAvailable()}catch{}if(!C.value?.accessToken)throw new Error("Not authenticated. Please sign in again.");const{device_id:g,challenge:N}=await b(u.value.trim(),C.value.accessToken);if(!N||typeof N!="object")throw new Error("Invalid challenge received from server");const Z=I(N,t.deviceType);$.value="Please touch your hardware key now...";const J=await navigator.credentials.create({publicKey:Z});if(!J)throw new Error("Hardware key registration was cancelled");$.value="Completing registration...";const ie=J.response;try{if(!J.rawId)throw new Error("Missing rawId in credential");if(!ie.clientDataJSON)throw new Error("Missing clientDataJSON in credential response");if(!ie.attestationObject)throw new Error("Missing attestationObject in credential response");const me=J.rawId instanceof ArrayBuffer?Array.from(new Uint8Array(J.rawId)):Array.from(J.rawId),ve=ie.clientDataJSON instanceof ArrayBuffer?Array.from(new Uint8Array(ie.clientDataJSON)):Array.from(ie.clientDataJSON),fe=ie.attestationObject instanceof ArrayBuffer?Array.from(new Uint8Array(ie.attestationObject)):Array.from(ie.attestationObject),ue={id:J.id,rawId:me,response:{clientDataJSON:ve,attestationObject:fe},type:J.type},W=await f(g,ue,C.value.accessToken);T.value=W.backup_codes||[],r.value=4}catch(me){throw new Error(`Failed to process hardware key data: ${me instanceof Error?me.message:String(me)}`)}}catch(g){let N="Hardware key registration failed";if(g instanceof Error){const Z=g.message.toLowerCase();Z.includes("not supported")||Z.includes("webauthn")?N="WebAuthn is not supported in this browser. Please use Chrome, Firefox, Safari, or Edge.":Z.includes("cancelled")||Z.includes("aborted")?N="Hardware key registration was cancelled. Please try again and touch your key when prompted.":Z.includes("timeout")?N="Hardware key registration timed out. Please ensure your key is connected and try again.":Z.includes("not allowed")||Z.includes("invalid state")?N="This hardware key may already be registered or cannot be used. Try a different key or contact support.":Z.includes("can't be used")||Z.includes("newer or different")?N="Your hardware key is not compatible. Please ensure you have a FIDO2/WebAuthn compatible key like YubiKey 5 Series, and that it's properly connected.":Z.includes("user verification")||Z.includes("pin")?N="Hardware key verification failed. If your key has a PIN, please enter it when prompted.":N=g.message}p.value=N,r.value=5}finally{s.value=!1}},D=async()=>{if(T.value.length)try{const g=T.value.join(`
3
3
  `);await navigator.clipboard.writeText(g)}catch{}},L=()=>{o("success")};return(g,N)=>(e.openBlock(),e.createBlock(_e,{modelValue:k.value,"onUpdate:modelValue":N[3]||(N[3]=Z=>k.value=Z),title:y.value,"card-class":"hardware-key-setup-modal"},{default:e.withCtx(()=>[r.value===1?(e.openBlock(),e.createElementBlock("div",U1,[N[6]||(N[6]=e.createElementVNode("div",null,[e.createElementVNode("h3",{class:"hardware-key-setup-step-title"},"Name Your Hardware Key"),e.createElementVNode("p",{class:"hardware-key-setup-step-description"},' Give your hardware key a memorable name (e.g., "YubiKey 5", "Work Security Key") ')],-1)),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:u.value,"onUpdate:modelValue":N[0]||(N[0]=Z=>u.value=Z),label:"Device Name",placeholder:"My Hardware Key",error:M.value,disabled:m.value},null,8,["modelValue","error","disabled"]),e.createElementVNode("div",H1,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:v,disabled:m.value},{default:e.withCtx(()=>[...N[4]||(N[4]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{variant:"primary",onClick:w,disabled:!u.value.trim()||m.value,loading:m.value},{default:e.withCtx(()=>[...N[5]||(N[5]=[e.createTextVNode(" Continue ",-1)])]),_:1},8,["disabled","loading"])])])):e.createCommentVNode("",!0),r.value===2?(e.openBlock(),e.createElementBlock("div",P1,[N[17]||(N[17]=e.createElementVNode("div",null,[e.createElementVNode("h3",{class:"hardware-key-setup-step-title"},"Register Hardware Key"),e.createElementVNode("p",{class:"hardware-key-setup-step-description"}," Insert your hardware key and follow your browser's prompts to complete registration. ")],-1)),N[18]||(N[18]=e.createElementVNode("div",{class:"hardware-key-setup-illustration"},[e.createElementVNode("div",{class:"hardware-key-setup-illustration-content"},[e.createElementVNode("div",{class:"hardware-key-setup-icon-container"},[e.createElementVNode("svg",{class:"hardware-key-setup-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m0 0a2 2 0 012 2v6a2 2 0 01-2 2H9a2 2 0 01-2-2V9a2 2 0 012-2m0 0V7a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h3m0 0v8m0-8h8m-8 8h8"})])]),e.createElementVNode("p",{class:"hardware-key-setup-status"},"Hardware Key Ready"),e.createElementVNode("p",{class:"hardware-key-setup-substatus"},'Click "Register Key" when ready')])],-1)),e.createElementVNode("div",j1,[e.createElementVNode("div",O1,[N[14]||(N[14]=e.createElementVNode("svg",{class:"hardware-key-setup-info-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",null,[N[13]||(N[13]=e.createElementVNode("p",{class:"hardware-key-setup-instructions-title"},"Setup Instructions",-1)),e.createElementVNode("ul",R1,[t.deviceType==="passkey"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[N[7]||(N[7]=e.createElementVNode("li",null,"• Your browser will prompt you to create a passkey",-1)),N[8]||(N[8]=e.createElementVNode("li",null,"• Use Touch ID, Face ID, Windows Hello, or PIN",-1)),N[9]||(N[9]=e.createElementVNode("li",null,"• Follow the prompts to complete setup",-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[N[10]||(N[10]=e.createElementVNode("li",null,"• Insert your hardware key into a USB port",-1)),N[11]||(N[11]=e.createElementVNode("li",null,"• Your browser will prompt you to interact with the key",-1)),N[12]||(N[12]=e.createElementVNode("li",null,"• Touch the key's button or sensor when prompted",-1))],64))])])])]),e.createElementVNode("div",F1,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:N[1]||(N[1]=Z=>r.value=1),disabled:m.value},{default:e.withCtx(()=>[...N[15]||(N[15]=[e.createTextVNode(" Back ",-1)])]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{variant:"primary",onClick:h,disabled:m.value,loading:m.value},{default:e.withCtx(()=>[...N[16]||(N[16]=[e.createTextVNode(" Register Key ",-1)])]),_:1},8,["disabled","loading"])])])):e.createCommentVNode("",!0),r.value===3?(e.openBlock(),e.createElementBlock("div",q1,[e.createElementVNode("div",K1,[e.createElementVNode("div",Z1,[e.createVNode(e.unref(S.StrandsUiLoader),{size:24,class:"hardware-key-setup-loader"})]),N[19]||(N[19]=e.createElementVNode("h3",{class:"hardware-key-setup-step-title"},"Registering Hardware Key",-1)),e.createElementVNode("p",G1,e.toDisplayString($.value),1)]),N[20]||(N[20]=e.createElementVNode("div",{class:"hardware-key-setup-progress-indicator"},[e.createElementVNode("div",{class:"hardware-key-setup-progress-content"},[e.createElementVNode("div",{class:"hardware-key-setup-progress-check"},[e.createElementVNode("div",{class:"hardware-key-setup-check-icon"},[e.createElementVNode("svg",{class:"hardware-key-setup-check",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])])]),e.createElementVNode("p",{class:"hardware-key-setup-progress-text"},"Touch your hardware key to complete registration")])],-1))])):e.createCommentVNode("",!0),r.value===4?(e.openBlock(),e.createElementBlock("div",Y1,[N[24]||(N[24]=e.createElementVNode("div",{class:"hardware-key-setup-success"},[e.createElementVNode("div",{class:"hardware-key-setup-success-icon"},[e.createElementVNode("svg",{class:"hardware-key-setup-success-check",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])]),e.createElementVNode("h3",{class:"hardware-key-setup-step-title"},"Hardware Key Setup Complete!"),e.createElementVNode("p",{class:"hardware-key-setup-success-message"}," Your hardware key is now active for two-factor authentication. ")],-1)),e.createElementVNode("div",W1,[N[22]||(N[22]=e.createElementVNode("div",{class:"hardware-key-setup-backup-codes-header"},[e.createElementVNode("svg",{class:"hardware-key-setup-warning-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})]),e.createElementVNode("div",null,[e.createElementVNode("p",{class:"hardware-key-setup-backup-codes-title"},"Save These Backup Codes"),e.createElementVNode("p",{class:"hardware-key-setup-backup-codes-description"}," Store these codes in a safe place. Each code can only be used once if you lose your hardware key. ")])],-1)),e.createElementVNode("div",Q1,[e.createElementVNode("div",X1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(Z,J)=>(e.openBlock(),e.createElementBlock("div",{key:J,class:"hardware-key-setup-code"},e.toDisplayString(Z),1))),128))])]),e.createElementVNode("div",J1,[e.createVNode(e.unref(ee),{variant:"secondary",size:"sm",onClick:D},{default:e.withCtx(()=>[...N[21]||(N[21]=[e.createTextVNode(" 📋 Copy Codes ",-1)])]),_:1})])]),e.createElementVNode("div",ec,[e.createVNode(e.unref(ee),{variant:"primary",onClick:L},{default:e.withCtx(()=>[...N[23]||(N[23]=[e.createTextVNode(" Done ",-1)])]),_:1})])])):e.createCommentVNode("",!0),r.value===5?(e.openBlock(),e.createElementBlock("div",tc,[e.createElementVNode("div",ac,[N[25]||(N[25]=e.createElementVNode("div",{class:"hardware-key-setup-error-icon"},[e.createElementVNode("svg",{class:"hardware-key-setup-error-x",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})])],-1)),N[26]||(N[26]=e.createElementVNode("h3",{class:"hardware-key-setup-step-title"},"Registration Failed",-1)),e.createElementVNode("p",oc,e.toDisplayString(p.value),1)]),e.createElementVNode("div",nc,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:N[2]||(N[2]=Z=>r.value=1)},{default:e.withCtx(()=>[...N[27]||(N[27]=[e.createTextVNode(" Start Over ",-1)])]),_:1}),e.createVNode(e.unref(ee),{variant:"primary",onClick:v},{default:e.withCtx(()=>[...N[28]||(N[28]=[e.createTextVNode(" Close ",-1)])]),_:1})])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]))}}),$t=S._export_sfc(lc,[["__scopeId","data-v-40b99818"]]),sc={class:"accui-component-scope"},rc={key:0,class:"backup-codes-loading"},ic={key:1,class:"backup-codes-content"},cc={key:0,class:"backup-codes-device-info"},dc={class:"backup-codes-device-content"},uc={class:"backup-codes-device-name"},mc={class:"backup-codes-device-type"},pc={key:1},fc={class:"backup-codes-grid-wrapper"},vc={class:"backup-codes-grid"},hc={class:"backup-codes-actions"},Cc={class:"backup-codes-main-actions"},gc={class:"backup-codes-main-actions-content"},yc={key:2,class:"backup-codes-regenerate-warning"},kc={class:"backup-codes-regenerate-content"},wc={class:"backup-codes-regenerate-actions"},Vc=e.defineComponent({__name:"StrandsBackupCodesModal",props:{show:{type:Boolean},device:{}},emits:["close"],setup(a,{emit:l}){const t=a,o=l,{regenerateBackupCodes:E,loading:b,getDeviceTypeName:f}=Ye(),C=e.computed({get:()=>t.show,set:$=>{$||o("close")}}),s=e.ref([]),m=e.ref(!1);e.watch(()=>t.show,async $=>{$&&t.device&&(m.value=!1,s.value=[])}),e.onMounted(async()=>{t.show&&t.device&&(s.value=[])});const y=()=>{o("close")},k=()=>{m.value=!0},r=async()=>{if(t.device)try{const $=await E(t.device.id);s.value=$.backup_codes,m.value=!1}catch($){console.error("Failed to regenerate backup codes:",$)}},u=async()=>{if(s.value.length!==0)try{const $=s.value.join(`
4
4
  `);await navigator.clipboard.writeText($)}catch($){console.warn("Failed to copy backup codes to clipboard:",$)}},M=()=>{if(s.value.length===0)return;const $=t.device?.device_name||"device",p=new Date().toISOString().split("T")[0],T=`strands-backup-codes-${$}-${p}.txt`,v=["Strands Account Backup Codes","============================","",`Device: ${t.device?.device_name}`,`Generated: ${new Date().toLocaleString()}`,"","IMPORTANT:","- Each code can only be used once","- Store these codes in a safe place","- Use these if you lose access to your authenticator","","Backup Codes:",...s.value.map((h,D)=>`${D+1}. ${h}`),"","============================"].join(`
5
- `),x=new Blob([v],{type:"text/plain"}),I=URL.createObjectURL(x),w=document.createElement("a");w.href=I,w.download=T,document.body.appendChild(w),w.click(),document.body.removeChild(w),URL.revokeObjectURL(I)};return($,p)=>(e.openBlock(),e.createElementBlock("div",sc,[e.createVNode(_e,{modelValue:C.value,"onUpdate:modelValue":p[1]||(p[1]=T=>C.value=T),title:"Backup Codes","card-class":"backup-codes-modal"},{default:e.withCtx(()=>[e.unref(b)?(e.openBlock(),e.createElementBlock("div",rc,[e.createVNode(e.unref(S.StrandsUiLoader),{size:24}),p[2]||(p[2]=e.createElementVNode("span",{class:"backup-codes-loading-text"},"Loading backup codes...",-1))])):(e.openBlock(),e.createElementBlock("div",ic,[a.device?(e.openBlock(),e.createElementBlock("div",cc,[e.createElementVNode("div",dc,[p[3]||(p[3]=e.createElementVNode("span",{class:"backup-codes-device-icon"},"📱",-1)),e.createElementVNode("div",null,[e.createElementVNode("h3",uc,e.toDisplayString(a.device.device_name),1),e.createElementVNode("p",mc,e.toDisplayString(e.unref(f)(a.device.device_type)),1)])])])):e.createCommentVNode("",!0),p[14]||(p[14]=e.createElementVNode("div",{class:"backup-codes-warning"},[e.createElementVNode("div",{class:"backup-codes-warning-content"},[e.createElementVNode("svg",{class:"backup-codes-warning-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})]),e.createElementVNode("div",null,[e.createElementVNode("p",{class:"backup-codes-warning-title"},"Important Security Information"),e.createElementVNode("ul",{class:"backup-codes-warning-list"},[e.createElementVNode("li",null,"• Each backup code can only be used once"),e.createElementVNode("li",null,"• Store these codes in a safe place"),e.createElementVNode("li",null,"• Use backup codes if you lose access to your authenticator"),e.createElementVNode("li",null,"• Regenerating codes will invalidate all previous codes")])])])],-1)),s.value.length>0?(e.openBlock(),e.createElementBlock("div",pc,[p[6]||(p[6]=e.createElementVNode("h3",{class:"backup-codes-section-title"},"Your Backup Codes",-1)),e.createElementVNode("div",fc,[e.createElementVNode("div",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(T,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"backup-codes-code-item"},e.toDisplayString(T),1))),128))])]),e.createElementVNode("div",hc,[e.createVNode(e.unref(ee),{variant:"secondary",size:"sm",onClick:u},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createTextVNode(" 📋 Copy All Codes ",-1)])]),_:1}),e.createVNode(e.unref(ee),{variant:"secondary",size:"sm",onClick:M},{default:e.withCtx(()=>[...p[5]||(p[5]=[e.createTextVNode(" 💾 Download ",-1)])]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("div",Cc,[e.createElementVNode("div",gc,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:k,disabled:e.unref(b),loading:e.unref(b)},{default:e.withCtx(()=>[...p[7]||(p[7]=[e.createTextVNode(" 🔄 Regenerate Codes ",-1)])]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(ee),{variant:"primary",onClick:y},{default:e.withCtx(()=>[...p[8]||(p[8]=[e.createTextVNode(" Done ",-1)])]),_:1})])]),m.value?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",kc,[p[13]||(p[13]=e.createElementVNode("svg",{class:"backup-codes-regenerate-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",null,[p[11]||(p[11]=e.createElementVNode("p",{class:"backup-codes-regenerate-title"},"Regenerate Backup Codes?",-1)),p[12]||(p[12]=e.createElementVNode("p",{class:"backup-codes-regenerate-description"}," This will invalidate all current backup codes. Make sure to save the new ones. ",-1)),e.createElementVNode("div",wc,[e.createVNode(e.unref(ee),{variant:"primary",size:"sm",onClick:r,disabled:e.unref(b),loading:e.unref(b)},{default:e.withCtx(()=>[...p[9]||(p[9]=[e.createTextVNode(" Yes, Regenerate ",-1)])]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(ee),{variant:"secondary",size:"sm",onClick:p[0]||(p[0]=T=>m.value=!1)},{default:e.withCtx(()=>[...p[10]||(p[10]=[e.createTextVNode(" Cancel ",-1)])]),_:1})])])])])):e.createCommentVNode("",!0)]))]),_:1},8,["modelValue"])]))}}),ha=S._export_sfc(Vc,[["__scopeId","data-v-0d97d17e"]]),Nc={class:"accui-component-scope"},Ec={class:"confirm-modal-title"},bc={class:"confirm-modal-message"},xc={class:"confirm-modal-actions"},Bc=e.defineComponent({__name:"StrandsConfirmModal",props:{show:{type:Boolean},title:{},message:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},variant:{default:"primary"}},emits:["confirm","cancel"],setup(a,{emit:l}){const t=a,o=l,E=e.ref(!1),b=e.computed({get:()=>t.show,set:s=>{s||o("cancel")}}),f=()=>{E.value=!0,o("confirm")},C=()=>{o("cancel")};return(s,m)=>(e.openBlock(),e.createElementBlock("div",Nc,[e.createVNode(_e,{modelValue:b.value,"onUpdate:modelValue":m[0]||(m[0]=y=>b.value=y),"card-class":"confirm-modal"},{header:e.withCtx(()=>[e.createElementVNode("h2",Ec,e.toDisplayString(a.title),1)]),default:e.withCtx(()=>[e.createElementVNode("p",bc,e.toDisplayString(a.message),1),e.createElementVNode("div",xc,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:C,disabled:E.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.cancelText),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{variant:a.variant,onClick:f,disabled:E.value,loading:E.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.confirmText),1)]),_:1},8,["variant","disabled","loading"])])]),_:1},8,["modelValue"])]))}}),Ca=S._export_sfc(Bc,[["__scopeId","data-v-52537e14"]]),Sc={class:"mfa-content"},Mc={key:0,class:"mfa-loading"},$c={key:1,class:"mfa-sections"},Tc={class:"mfa-status-overview"},Ac={class:"mfa-status-content"},_c={class:"mfa-status-subtitle"},zc={class:"mfa-status-badges"},Dc={key:0,class:"mfa-status-badge mfa-status-badge-enabled"},Ic={key:1,class:"mfa-status-badge mfa-status-badge-disabled"},Lc={key:0,class:"mfa-add-devices"},Uc={class:"mfa-device-options"},Hc={class:"mfa-device-option"},Pc={class:"mfa-device-option-content"},jc={class:"mfa-device-option-icon"},Oc={class:"mfa-device-option"},Rc={class:"mfa-device-option-content"},Fc={class:"mfa-device-option-icon"},qc={class:"mfa-device-option"},Kc={class:"mfa-device-option-content"},Zc={class:"mfa-device-option-icon"},Gc={class:"mfa-device-option"},Yc={class:"mfa-device-option-content"},Wc={class:"mfa-device-option-icon"},Qc={key:1,class:"mfa-manage-devices"},Xc={key:0,class:"mfa-empty-state"},Jc={class:"mfa-empty-icon"},e2={key:1,class:"mfa-devices-list"},t2={class:"mfa-device-header"},a2={class:"mfa-device-info"},o2={class:"mfa-device-icon"},n2={class:"mfa-device-name"},l2={class:"mfa-device-meta"},s2={class:"mfa-device-actions"},r2={key:0,class:"mfa-device-warning"},i2={class:"mfa-warning-content"},c2={class:"mfa-warning-icon"},d2={key:1,class:"mfa-device-backup"},u2=e.defineComponent({__name:"StrandsMfaModal",props:{modelValue:{type:Boolean}},emits:["update:modelValue","mfa-updated"],setup(a,{emit:l}){const t=a,o=l,{mfaEnabled:E,loading:b,activeMfaDevices:f,fetchMfaDevices:C,disableMfaDevice:s,sendEmailMfaCode:m}=Ye(),y={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.h("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})])}},k={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"m4 4 16 0c1.1 0 2 .9 2 2l0 12c0 1.1-.9 2-2 2l-16 0c-1.1 0-2-.9-2-2l0-12c0-1.1.9-2 2-2z"}),e.h("polyline",{points:"22,6 12,13 2,6"})])}},r={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}),e.h("circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"})])}},u={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4"}),e.h("path",{d:"M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2"}),e.h("path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02"}),e.h("path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"}),e.h("path",{d:"M8.65 22c.21-.66.45-1.32.57-2"}),e.h("path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88"}),e.h("path",{d:"M2 16h.01"}),e.h("path",{d:"M21.8 16c.2-2 .131-5.354 0-6"}),e.h("path",{d:"M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2"})])}},M={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"})])}},$={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),e.h("path",{d:"M12 9v4"}),e.h("path",{d:"m12 17 .01 0"})])}},p=e.ref("add"),T=e.reactive({}),v=e.reactive({}),x=e.ref(!1),I=e.ref(!1),w=e.ref(!1),h=e.ref(!1),D=e.computed({get:()=>t.modelValue||!1,set:ue=>o("update:modelValue",ue)}),L=e.computed(()=>{const ue=[{label:"Add Device",value:"add"}];return f.value&&f.value.length>0&&ue.push({label:"Manage Devices",value:"manage"}),ue});e.watch(()=>f.value,ue=>{ue&&ue.length>0&&p.value==="add"&&(p.value="manage")}),e.onMounted(async()=>{await C()});const g=async ue=>{try{T[ue.id]=!0,await m(ue.id)}catch(W){console.error("Failed to send email MFA code:",W)}finally{T[ue.id]=!1}},N=async ue=>{try{v[ue.id]=!0,await s(ue.id),await C(),o("mfa-updated")}catch(W){console.error("Failed to remove device:",W)}finally{v[ue.id]=!1}},Z=async()=>{await C(),p.value="manage",o("mfa-updated")},J=async()=>{await C(),p.value="manage",o("mfa-updated")},ie=async()=>{await C(),p.value="manage",o("mfa-updated")},me=async()=>{await C(),p.value="manage",o("mfa-updated")},ve=ue=>({totp:"Authenticator App",email:"Email Verification",hardware:"Hardware Key",passkey:"Passkey"})[ue]||ue,fe=ue=>{if(!ue)return"Unknown";const W=new Date(ue),U=new Date().getTime()-W.getTime(),Q=Math.floor(U/(1e3*60)),K=Math.floor(U/(1e3*60*60)),j=Math.floor(U/(1e3*60*60*24));return Q<1?"Just now":Q<60?`${Q}m ago`:K<24?`${K}h ago`:j<7?`${j}d ago`:j<30?`${Math.floor(j/7)}w ago`:j<365?`${Math.floor(j/30)}mo ago`:`${Math.floor(j/365)}y ago`};return(ue,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(_e),{modelValue:D.value,"onUpdate:modelValue":W[6]||(W[6]=O=>D.value=O),title:"Two-Factor Authentication","card-class":"mfa-modal-card"},{default:e.withCtx(()=>[e.createElementVNode("div",Sc,[e.unref(b)?(e.openBlock(),e.createElementBlock("div",Mc,[e.createVNode(e.unref(S.StrandsUiLoader),{size:32}),W[11]||(W[11]=e.createElementVNode("span",{class:"mfa-loading-text"},"Loading MFA settings...",-1))])):(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("div",Tc,[e.createElementVNode("div",Ac,[e.createElementVNode("div",null,[W[12]||(W[12]=e.createElementVNode("h3",{class:"mfa-status-title"},"Two-Factor Authentication",-1)),e.createElementVNode("p",_c,e.toDisplayString(e.unref(E)?"Enabled":"Add extra security to your account"),1)]),e.createElementVNode("div",zc,[e.unref(E)?(e.openBlock(),e.createElementBlock("span",Dc,[e.createVNode(M,{size:12,class:"mfa-badge-icon"}),W[13]||(W[13]=e.createTextVNode(" Enabled ",-1))])):(e.openBlock(),e.createElementBlock("span",Ic," Not Enabled "))])])]),e.createVNode(e.unref(S.StrandsUiTabs),{modelValue:p.value,"onUpdate:modelValue":W[5]||(W[5]=O=>p.value=O),tabs:L.value,"tab-width":"fit"},{content:e.withCtx(({activeTab:O})=>[O?.value==="add"?(e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("div",null,[W[22]||(W[22]=e.createElementVNode("h3",{class:"mfa-section-title"},"Choose Your Authentication Method",-1)),e.createElementVNode("div",Uc,[e.createElementVNode("div",Hc,[e.createElementVNode("div",Pc,[e.createElementVNode("div",jc,[e.createVNode(y,{size:24})]),W[14]||(W[14]=e.createElementVNode("div",{class:"mfa-device-option-info"},[e.createElementVNode("h4",{class:"mfa-device-option-title"},"Authenticator App"),e.createElementVNode("p",{class:"mfa-device-option-description"},"Use apps like Google Authenticator, or Authy")],-1))]),e.createVNode(e.unref(ee),{variant:"outline",size:"sm",onClick:W[0]||(W[0]=U=>x.value=!0)},{default:e.withCtx(()=>[...W[15]||(W[15]=[e.createTextVNode(" Setup ",-1)])]),_:1})]),e.createElementVNode("div",Oc,[e.createElementVNode("div",Rc,[e.createElementVNode("div",Fc,[e.createVNode(k,{size:24})]),W[16]||(W[16]=e.createElementVNode("div",{class:"mfa-device-option-info"},[e.createElementVNode("h4",{class:"mfa-device-option-title"},"Email Verification"),e.createElementVNode("p",{class:"mfa-device-option-description"},"Receive verification codes via email")],-1))]),e.createVNode(e.unref(ee),{variant:"outline",size:"sm",onClick:W[1]||(W[1]=U=>I.value=!0)},{default:e.withCtx(()=>[...W[17]||(W[17]=[e.createTextVNode(" Setup ",-1)])]),_:1})]),e.createElementVNode("div",qc,[e.createElementVNode("div",Kc,[e.createElementVNode("div",Zc,[e.createVNode(r,{size:24})]),W[18]||(W[18]=e.createElementVNode("div",{class:"mfa-device-option-info"},[e.createElementVNode("h4",{class:"mfa-device-option-title"},"Hardware Key"),e.createElementVNode("p",{class:"mfa-device-option-description"},"Use a physical security key (YubiKey, etc.)")],-1))]),e.createVNode(e.unref(ee),{variant:"outline",size:"sm",onClick:W[2]||(W[2]=U=>w.value=!0)},{default:e.withCtx(()=>[...W[19]||(W[19]=[e.createTextVNode(" Setup ",-1)])]),_:1})]),e.createElementVNode("div",Gc,[e.createElementVNode("div",Yc,[e.createElementVNode("div",Wc,[e.createVNode(u,{size:24})]),W[20]||(W[20]=e.createElementVNode("div",{class:"mfa-device-option-info"},[e.createElementVNode("h4",{class:"mfa-device-option-title"},"Passkey"),e.createElementVNode("p",{class:"mfa-device-option-description"},"Use biometric authentication or device PIN")],-1))]),e.createVNode(e.unref(ee),{variant:"outline",size:"sm",onClick:W[3]||(W[3]=U=>h.value=!0)},{default:e.withCtx(()=>[...W[21]||(W[21]=[e.createTextVNode(" Setup ",-1)])]),_:1})])])])])):O?.value==="manage"?(e.openBlock(),e.createElementBlock("div",Qc,[e.unref(f).length===0?(e.openBlock(),e.createElementBlock("div",Xc,[e.createElementVNode("div",Jc,[e.createVNode(M,{size:48})]),W[24]||(W[24]=e.createElementVNode("h3",{class:"mfa-empty-title"},"No MFA Devices",-1)),W[25]||(W[25]=e.createElementVNode("p",{class:"mfa-empty-description"},"You haven't set up any multi-factor authentication devices yet.",-1)),e.createVNode(e.unref(ee),{onClick:W[4]||(W[4]=U=>p.value="add"),variant:"primary"},{default:e.withCtx(()=>[...W[23]||(W[23]=[e.createTextVNode(" Add First Device ",-1)])]),_:1})])):(e.openBlock(),e.createElementBlock("div",e2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),U=>(e.openBlock(),e.createElementBlock("div",{key:U.id,class:"mfa-device-card"},[e.createElementVNode("div",t2,[e.createElementVNode("div",a2,[e.createElementVNode("div",o2,[U.device_type==="totp"?(e.openBlock(),e.createBlock(y,{key:0,size:20})):U.device_type==="email"?(e.openBlock(),e.createBlock(k,{key:1,size:20})):U.device_type==="hardware"?(e.openBlock(),e.createBlock(r,{key:2,size:20})):U.device_type==="passkey"?(e.openBlock(),e.createBlock(u,{key:3,size:20})):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createElementVNode("h4",n2,e.toDisplayString(U.name||ve(U.device_type)),1),e.createElementVNode("p",l2,"Added "+e.toDisplayString(fe(U.created_at)),1)])]),e.createElementVNode("div",s2,[U.device_type==="email"&&!U.verified?(e.openBlock(),e.createBlock(e.unref(ee),{key:0,variant:"outline",size:"xs",onClick:Q=>g(U),disabled:T[U.id]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T[U.id]?"Sending...":"Test"),1)]),_:2},1032,["onClick","disabled"])):e.createCommentVNode("",!0),e.createVNode(Ca,{title:`Remove ${ve(U.device_type)}?`,message:`Are you sure you want to remove this ${ve(U.device_type).toLowerCase()}? You will no longer be able to use it for authentication.`,"confirm-text":"Remove Device","confirm-variant":"danger",onConfirm:Q=>N(U)},{trigger:e.withCtx(()=>[e.createVNode(e.unref(ee),{variant:"ghost",size:"xs",disabled:v[U.id]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v[U.id]?"Removing...":"Remove"),1)]),_:2},1032,["disabled"])]),_:2},1032,["title","message","onConfirm"])])]),U.device_type==="email"&&!U.verified?(e.openBlock(),e.createElementBlock("div",r2,[e.createElementVNode("div",i2,[e.createElementVNode("div",c2,[e.createVNode($,{size:16})]),W[26]||(W[26]=e.createElementVNode("span",{class:"mfa-warning-text"},"Email not verified - click Test to verify",-1))])])):e.createCommentVNode("",!0),U.backup_codes&&U.backup_codes.length>0?(e.openBlock(),e.createElementBlock("div",d2,[e.createVNode(ha,{device:U},{trigger:e.withCtx(()=>[e.createVNode(e.unref(ee),{variant:"outline",size:"xs"},{default:e.withCtx(()=>[...W[27]||(W[27]=[e.createTextVNode(" View Backup Codes ",-1)])]),_:1})]),_:1},8,["device"])])):e.createCommentVNode("",!0)]))),128))]))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","tabs"])]))])]),_:1},8,["modelValue"]),e.createVNode(Ot,{show:x.value,onSuccess:Z,onClose:W[7]||(W[7]=O=>x.value=!1)},null,8,["show"]),e.createVNode(Rt,{show:I.value,onSuccess:J,onClose:W[8]||(W[8]=O=>I.value=!1)},null,8,["show"]),e.createVNode($t,{show:w.value,"device-type":"hardware",onSuccess:ie,onClose:W[9]||(W[9]=O=>w.value=!1)},null,8,["show"]),e.createVNode($t,{show:h.value,"device-type":"passkey",onSuccess:me,onClose:W[10]||(W[10]=O=>h.value=!1)},null,8,["show"])],64))}}),Ft=S._export_sfc(u2,[["__scopeId","data-v-64c9f1a1"]]),m2={class:"accui-component-scope"},p2={class:"settings-content"},f2={class:"settings-section"},v2={class:"settings-option"},h2={class:"settings-option-content"},C2={class:"settings-option-controls"},g2={key:0,class:"preview-icon",fill:"currentColor",viewBox:"0 0 24 24"},y2={key:1,class:"preview-icon",fill:"currentColor",viewBox:"0 0 24 24"},k2={class:"settings-option"},w2={class:"settings-option-content"},V2={class:"settings-option-controls"},N2={key:0,class:"preview-icon",fill:"currentColor",viewBox:"0 0 24 24"},E2={key:1,class:"preview-icon",fill:"currentColor",viewBox:"0 0 24 24"},b2={class:"settings-footer"},x2=e.defineComponent({__name:"StrandsSettingsModal",props:{open:{type:Boolean,default:!1}},emits:["close","settings-updated"],setup(a,{emit:l}){const t=l,{currentUser:o,updateUserSettings:E}=Ie.useStrandsAuth(),b=e.ref(!1),f=e.ref(null),C=e.reactive({levelUpSounds:o.value?.settings?.levelUpSounds??!0,milestoneSounds:o.value?.settings?.milestoneSounds??!0});e.watch(()=>o.value?.settings,r=>{r&&(C.levelUpSounds=r.levelUpSounds??!0,C.milestoneSounds=r.milestoneSounds??!0)},{deep:!0});const s=(r,u)=>{C[r]=u},m=()=>{f.value||(f.value="regular",Ht.playLevelUp(5),setTimeout(()=>{f.value==="regular"&&(f.value=null)},800))},y=()=>{f.value||(f.value="milestone",Ht.playLevelUp(50),setTimeout(()=>{f.value==="milestone"&&(f.value=null)},2500))},k=async r=>{if(!b.value){b.value=!0;try{await E({...o.value?.settings,...C}),t("settings-updated",{...C})}catch(u){console.warn("Failed to save settings:",u)}finally{b.value=!1,r()}}};return(r,u)=>(e.openBlock(),e.createElementBlock("div",m2,[e.createVNode(_e,{onClose:r.onClose,title:"Account Settings","card-class":"max-w-lg"},e.createSlots({footer:e.withCtx(({handleClose:M})=>[e.createElementVNode("div",b2,[e.createVNode(S.StrandsUiButton,{variant:"secondary",onClick:M},{default:e.withCtx(()=>[...u[11]||(u[11]=[e.createTextVNode(" Close ",-1)])]),_:1},8,["onClick"]),e.createVNode(S.StrandsUiButton,{variant:"primary",onClick:$=>k(M),loading:b.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.value?"Saving...":"Save Settings"),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",p2,[e.createElementVNode("div",f2,[u[10]||(u[10]=e.createElementVNode("h3",{class:"settings-section-title"},"Audio Preferences",-1)),e.createElementVNode("div",v2,[e.createElementVNode("div",h2,[u[6]||(u[6]=e.createElementVNode("div",{class:"settings-option-info"},[e.createElementVNode("label",{for:"level-up-sounds",class:"settings-option-label"}," Level Up Sounds "),e.createElementVNode("p",{class:"settings-option-description"}," Play sound effects when you level up ")],-1)),e.createElementVNode("div",C2,[e.createVNode(S.StrandsUiButton,{variant:"outline",size:"sm",onClick:m,disabled:f.value==="regular","aria-label":f.value==="regular"?"Stop preview":"Play preview",class:"preview-icon-button"},{default:e.withCtx(()=>[f.value!=="regular"?(e.openBlock(),e.createElementBlock("svg",g2,[...u[4]||(u[4]=[e.createElementVNode("path",{d:"M8 5v14l11-7z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",y2,[...u[5]||(u[5]=[e.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12"},null,-1)])]))]),_:1},8,["disabled","aria-label"]),e.createVNode(Mt,{id:"level-up-sounds",modelValue:C.levelUpSounds,"onUpdate:modelValue":[u[0]||(u[0]=M=>C.levelUpSounds=M),u[1]||(u[1]=M=>s("levelUpSounds",M))]},null,8,["modelValue"])])])]),e.createElementVNode("div",k2,[e.createElementVNode("div",w2,[u[9]||(u[9]=e.createElementVNode("div",{class:"settings-option-info"},[e.createElementVNode("label",{for:"milestone-sounds",class:"settings-option-label"}," Milestone Level Sounds "),e.createElementVNode("p",{class:"settings-option-description"}," Play special celebration sounds for milestone levels ")],-1)),e.createElementVNode("div",V2,[e.createVNode(S.StrandsUiButton,{variant:"outline",size:"sm",onClick:y,disabled:f.value==="milestone","aria-label":f.value==="milestone"?"Stop preview":"Play preview",class:"preview-icon-button"},{default:e.withCtx(()=>[f.value!=="milestone"?(e.openBlock(),e.createElementBlock("svg",N2,[...u[7]||(u[7]=[e.createElementVNode("path",{d:"M8 5v14l11-7z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",E2,[...u[8]||(u[8]=[e.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12"},null,-1)])]))]),_:1},8,["disabled","aria-label"]),e.createVNode(Mt,{id:"milestone-sounds",modelValue:C.milestoneSounds,"onUpdate:modelValue":[u[2]||(u[2]=M=>C.milestoneSounds=M),u[3]||(u[3]=M=>s("milestoneSounds",M))]},null,8,["modelValue"])])])])])])]),_:2},[r.$slots.trigger?{name:"trigger",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"trigger",{},void 0,!0)]),key:"0"}:void 0]),1032,["onClose"])]))}}),ga=S._export_sfc(x2,[["__scopeId","data-v-64545f74"]]),B2={class:"strands-sessions-modal"},S2={key:0,class:"sessions-loading"},M2={key:1,class:"sessions-empty"},$2={key:2,class:"sessions-container"},T2={key:0,class:"session-stats"},A2={class:"stat-card"},_2={class:"stat-value"},z2={class:"stat-card"},D2={class:"stat-value"},I2={key:0,class:"stat-card"},L2={class:"stat-value"},U2={class:"sessions-list"},H2={class:"session-header"},P2={class:"session-device-info"},j2={class:"session-device-name"},O2={key:0,class:"session-current-badge"},R2={class:"session-location"},F2={key:0,class:"session-actions"},q2={class:"session-details"},K2={class:"detail-row"},Z2={class:"detail-icon"},G2={class:"detail-text"},Y2={class:"detail-row"},W2={class:"detail-icon"},Q2={class:"detail-text"},X2={class:"detail-row"},J2={class:"detail-icon"},ed={class:"detail-text"},td={class:"detail-row"},ad={class:"detail-icon"},od={class:"detail-text"},nd={key:1,class:"bulk-actions"},ld={key:1},sd=e.defineComponent({__name:"StrandsSessionsModal",props:{modelValue:{type:Boolean}},emits:["update:modelValue","sessions-updated"],setup(a,{emit:l}){const t=a,o=l,{getUserSessions:E,revokeSession:b,revokeAllOtherSessions:f}=Ie.useStrandsAuth(),C={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"}),e.h("circle",{cx:"12",cy:"10",r:"3"})])}},s={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),e.h("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),e.h("line",{x1:"12",y1:"17",x2:"12",y2:"21"})])}},m={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("circle",{cx:"12",cy:"12",r:"10"}),e.h("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),e.h("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})])}},y={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("circle",{cx:"12",cy:"12",r:"10"}),e.h("polyline",{points:"12,6 12,12 16,14"})])}},k={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.h("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.h("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.h("line",{x1:"3",y1:"10",x2:"21",y2:"10"})])}},r=e.ref([]),u=e.ref(null),M=e.ref(!1),$=e.ref(null),p=e.reactive({}),T=e.ref(!1),v=e.computed({get:()=>t.modelValue||!1,set:N=>o("update:modelValue",N)});e.watch(()=>v.value,N=>{N&&x()}),e.onMounted(()=>{(typeof t.modelValue>"u"||t.modelValue)&&x()});const x=async()=>{M.value=!0,$.value=null;try{const N=await E();if(r.value=N||[],r.value.length>0){const Z=r.value.filter(ie=>ie.is_current||ie.last_activity_at),J=[...new Set(r.value.map(ie=>D(ie)).filter(Boolean))];u.value={total_sessions:r.value.length,active_sessions:Z.length,unique_locations:J}}else u.value=null}catch(N){$.value=N instanceof Error?N.message:"Failed to load sessions",console.error("Failed to load sessions:",N)}finally{M.value=!1}},I=async N=>{p[N]=!0;try{await b(N),await x(),o("sessions-updated")}catch(Z){console.error("Failed to revoke session:",Z),$.value=Z instanceof Error?Z.message:"Failed to revoke session"}finally{p[N]=!1}},w=async()=>{T.value=!0;try{await f(),await x(),o("sessions-updated")}catch(N){console.error("Failed to revoke all other sessions:",N),$.value=N instanceof Error?N.message:"Failed to revoke sessions"}finally{T.value=!1}},h=N=>{if(N.device_name)return N.device_name;const Z=N.user_agent||"";return Z.includes("Mobile")||Z.includes("Android")||Z.includes("iPhone")?"Mobile Device":Z.includes("iPad")?"iPad":Z.includes("Mac")?"Mac":Z.includes("Windows")?"Windows PC":Z.includes("Linux")?"Linux":"Unknown Device"},D=N=>{const Z=[];return N.city&&Z.push(N.city),N.region&&Z.push(N.region),N.country&&Z.push(N.country),Z.length>0?Z.join(", "):N.ip_address||"Unknown Location"},L=N=>{if(!N)return"Unknown";const Z=new Date(N),ie=new Date().getTime()-Z.getTime(),me=Math.floor(ie/(1e3*60)),ve=Math.floor(ie/(1e3*60*60)),fe=Math.floor(ie/(1e3*60*60*24));return me<1?"Just now":me<60?`${me}m ago`:ve<24?`${ve}h ago`:fe<7?`${fe}d ago`:fe<30?`${Math.floor(fe/7)}w ago`:fe<365?`${Math.floor(fe/30)}mo ago`:`${Math.floor(fe/365)}y ago`},g=N=>N?new Date(N).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Unknown";return(N,Z)=>(e.openBlock(),e.createBlock(e.unref(_e),{modelValue:v.value,"onUpdate:modelValue":Z[0]||(Z[0]=J=>v.value=J),title:"Active Sessions",subtitle:"Manage your active devices"},{default:e.withCtx(()=>[e.createElementVNode("div",B2,[M.value?(e.openBlock(),e.createElementBlock("div",S2,[e.createVNode(e.unref(S.StrandsUiLoader),{size:40}),Z[1]||(Z[1]=e.createElementVNode("p",{class:"loading-text"},"Loading sessions...",-1))])):r.value.length===0?(e.openBlock(),e.createElementBlock("div",M2,[...Z[2]||(Z[2]=[e.createElementVNode("div",{class:"empty-icon"},[e.createElementVNode("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e.createElementVNode("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"}),e.createElementVNode("line",{x1:"8",y1:"14",x2:"12",y2:"14"})])],-1),e.createElementVNode("h3",{class:"empty-title"},"No Active Sessions",-1),e.createElementVNode("p",{class:"empty-description"},"You don't have any active sessions at the moment.",-1)])])):(e.openBlock(),e.createElementBlock("div",$2,[u.value?(e.openBlock(),e.createElementBlock("div",T2,[e.createElementVNode("div",A2,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"stat-label"},"Total Sessions",-1)),e.createElementVNode("span",_2,e.toDisplayString(u.value.total_sessions),1)]),e.createElementVNode("div",z2,[Z[4]||(Z[4]=e.createElementVNode("span",{class:"stat-label"},"Active Devices",-1)),e.createElementVNode("span",D2,e.toDisplayString(u.value.active_sessions),1)]),u.value.unique_locations&&u.value.unique_locations.length>0?(e.openBlock(),e.createElementBlock("div",I2,[Z[5]||(Z[5]=e.createElementVNode("span",{class:"stat-label"},"Locations",-1)),e.createElementVNode("span",L2,e.toDisplayString(u.value.unique_locations.length),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",U2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,J=>(e.openBlock(),e.createElementBlock("div",{key:J.id,class:e.normalizeClass(["session-card",{"current-session":J.is_current}])},[e.createElementVNode("div",H2,[e.createElementVNode("div",P2,[e.createElementVNode("h4",j2,[e.createTextVNode(e.toDisplayString(h(J))+" ",1),J.is_current?(e.openBlock(),e.createElementBlock("span",O2," Current ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",R2,[e.createVNode(C,{size:14}),e.createElementVNode("span",null,e.toDisplayString(D(J)),1)])]),J.is_current?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",F2,[e.createVNode(e.unref(ee),{variant:"outline",size:"xs",onClick:ie=>I(J.id),disabled:p[J.id]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p[J.id]?"Ending...":"End Session"),1)]),_:2},1032,["onClick","disabled"])]))]),e.createElementVNode("div",q2,[e.createElementVNode("div",K2,[e.createElementVNode("span",Z2,[e.createVNode(s,{size:14})]),e.createElementVNode("span",G2,e.toDisplayString(J.user_agent||"Unknown device"),1)]),e.createElementVNode("div",Y2,[e.createElementVNode("span",W2,[e.createVNode(m,{size:14})]),e.createElementVNode("span",Q2,e.toDisplayString(J.ip_address),1)]),e.createElementVNode("div",X2,[e.createElementVNode("span",J2,[e.createVNode(y,{size:14})]),e.createElementVNode("span",ed," Last active "+e.toDisplayString(L(J.last_activity_at||J.created_at)),1)]),e.createElementVNode("div",td,[e.createElementVNode("span",ad,[e.createVNode(k,{size:14})]),e.createElementVNode("span",od," Started "+e.toDisplayString(g(J.created_at)),1)])])],2))),128))]),r.value.length>1?(e.openBlock(),e.createElementBlock("div",nd,[e.createVNode(e.unref(ee),{variant:"outline",onClick:w,disabled:T.value},{default:e.withCtx(()=>[T.value?(e.openBlock(),e.createBlock(e.unref(S.StrandsUiLoader),{key:0,size:16})):(e.openBlock(),e.createElementBlock("span",ld,"End All Other Sessions"))]),_:1},8,["disabled"]),Z[6]||(Z[6]=e.createElementVNode("p",{class:"bulk-actions-hint"}," This will sign you out on all other devices ",-1))])):e.createCommentVNode("",!0)]))])]),_:1},8,["modelValue"]))}}),ya=S._export_sfc(sd,[["__scopeId","data-v-1958a7a9"]]),rd={class:"accui-component-scope"},id={class:"profile-content-layout"},cd={class:"profile-image-section"},dd={class:"profile-image-container"},ud={class:"profile-image-wrapper"},md={key:0,class:"profile-avatar profile-avatar-with-image"},pd=["src","alt"],fd={key:1,class:"profile-avatar profile-avatar-initials"},vd=["disabled"],hd={key:1,class:"profile-upload-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Cd={class:"profile-form-grid"},gd={class:"profile-section"},yd={class:"profile-setting-card"},kd={class:"profile-setting-header"},wd={class:"profile-setting-subtitle"},Vd={key:0,class:"profile-change-form"},Nd={class:"profile-field-section"},Ed={class:"profile-field-header"},bd={class:"profile-field-subtitle"},xd={key:0,class:"profile-change-form"},Bd={class:"profile-password-section"},Sd={class:"profile-field-section"},Md={class:"profile-field-header"},$d={class:"profile-field-subtitle"},Td={key:0,class:"profile-change-form"},Ad={class:"profile-field-section"},_d={class:"profile-field-header profile-field-header-vertical"},zd={class:"profile-mfa-content"},Dd={class:"profile-field-subtitle"},Id={key:0,class:"profile-mfa-chips"},Ld={class:"profile-field-section"},Ud={class:"profile-field-header"},Hd={class:"profile-field-subtitle"},Pd={key:0},jd={key:1},Od={class:"profile-field-actions"},Rd={key:0,class:"profile-actions-section"},Fd={key:0,class:"animate-fade-in"},qd={class:"alert-success"},Kd={class:"profile-help-item"},Zd={class:"profile-alert-message"},Gd={key:1,class:"animate-fade-in"},Yd={class:"alert-error"},Wd={class:"profile-help-item"},Qd={class:"profile-alert-message"},Xd={class:"profile-footer-actions"},Jd={key:0},eu={class:"profile-footer-text"},tu={key:0,class:"profile-avatar-modal-overlay"},au={class:"profile-avatar-modal"},ou={class:"profile-avatar-modal-content"},nu=e.defineComponent({__name:"StrandsUserProfile",props:{user:{},config:{},autoFetch:{type:Boolean,default:!0},inModal:{type:Boolean,default:!1}},emits:["profile-updated","error","manage-sessions","mfa-toggle"],setup(a,{emit:l}){const t={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.h("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})])}},o={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"m4 4 16 0c1.1 0 2 .9 2 2l0 12c0 1.1-.9 2-2 2l-16 0c-1.1 0-2-.9-2-2l0-12c0-1.1.9-2 2-2z"}),e.h("polyline",{points:"22,6 12,13 2,6"})])}},E={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}),e.h("circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"})])}},b=a,f=l,{getSupportEmail:C,getUrl:s}=Se.useStrandsConfig(b.config),{fetchProfile:m,updateProfile:y,changeEmail:k,changeUsername:r,getUsernameCooldown:u,checkUsernameAvailability:M,getUserSessions:$,currentUser:p,currentSession:T,isAuthenticated:v,refreshToken:x,signOut:I}=Ie.useStrandsAuth(),{activeMfaDevices:w,fetchMfaDevices:h}=Ye(),D=e.ref(null),L=e.ref(!1),g=e.computed(()=>p.value||b.user||D.value),N=e.ref(!1),Z=e.ref(!1),J=e.ref(!1),ie=e.ref(!1),me=e.ref(!1),ve=e.ref(!1),fe=e.ref(!1),ue=e.ref(!1),W=e.ref(!1),O=e.ref(!1),U=e.ref(!1),Q=e.ref(null),K=e.ref(""),j=e.ref(""),Y=e.ref([]),he=e.ref(!1),Ce=e.reactive({canChange:!0,cooldownEnd:null,daysRemaining:0}),ke=e.reactive({available:!1,message:"",checking:!1}),pe=e.ref(),X=e.reactive({firstName:"",lastName:"",email:""}),ae=e.reactive({newEmail:"",password:"",errors:{newEmail:"",password:""}}),ye=e.reactive({current:"",new:"",confirm:""}),H=e.reactive({username:"",errors:{username:""}}),se=e.reactive({firstName:"",lastName:"",email:""}),R=e.computed(()=>{const F=g.value;return F?X.firstName!==(F.firstName||"")||X.lastName!==(F.lastName||""):!1}),ne=e.computed(()=>ye.current&&ye.new&&ye.confirm&&ye.new===ye.confirm&&ye.new.length>=8),oe=e.computed(()=>ae.newEmail&&ae.password&&ae.newEmail!==g.value?.email&&ae.newEmail.includes("@")),we=e.computed(()=>{const F=/^[a-zA-Z0-9_-]{3,30}$/;return H.username&&F.test(H.username)&&H.username!==g.value?.username&&!ke.checking}),Ve=e.computed(()=>{const F=g.value;if(!F)return"Never";const _=F.passwordUpdatedAt||F.createdAt;if(!_)return"Never";const de=new Date(_),ot=new Date().getTime()-de.getTime(),$e=Math.floor(ot/(1e3*60*60*24));if($e===0)return"Today";if($e===1)return"Yesterday";if($e<30)return`${$e} days ago`;if($e<365){const Re=Math.floor($e/30);return Re===1?"1 month ago":`${Re} months ago`}const Le=Math.floor($e/365);return Le===1?"1 year ago":`${Le} years ago`}),Ee=e.computed(()=>{const F=w.value||[],_={totp:0,email:0,hardware:0,passkey:0};return F.forEach(de=>{de.device_type in _&&_[de.device_type]++}),_}),Pe=e.computed(()=>{const F=[],_=Ee.value;if(_.totp>0&&F.push({type:"totp",count:_.totp,label:_.totp===1?"Auth app":"Auth apps",icon:t,color:"chip-blue"}),_.email>0&&F.push({type:"email",count:_.email,label:"Email",icon:o,color:"chip-green"}),_.hardware>0||_.passkey>0){const de=_.hardware+_.passkey;F.push({type:"hardware",count:de,label:de===1?"Key":"Keys",icon:E,color:"chip-purple"})}return F}),Ne=F=>{if(F<=1)return 0;let _=0;for(let de=1;de<F;de++)_+=4*de+Math.pow(1.5,de/4);return Math.floor(_)},Je=F=>{let _=1;for(;;){const de=Ne(_+1);if(F<de||(_++,_>1e3))break}return _},Te=e.computed(()=>Je(g.value?.xp||0)),ft=e.computed(()=>{const F=Te.value,_=Ne(F);return(g.value?.xp||0)-_}),Me=e.computed(()=>{const F=Te.value,_=Ne(F);return Ne(F+1)-_}),vt=e.computed(()=>Math.round(ft.value/Me.value*100)),et=e.computed(()=>2*Math.PI*54),ht=e.computed(()=>vt.value/100*et.value);e.computed(()=>{const F=et.value*5/360;return et.value-ht.value-F});const Ct=(F,_)=>!F&&!_?"U":`${F?.[0]||""}${_?.[0]||""}`.toUpperCase(),je=async()=>{if(!(!b.autoFetch||b.user||!v.value)){L.value=!0;try{await m(),v.value&&await h()}catch(F){console.error("Failed to load profile:",F);const _=F instanceof Error?F.message:"Failed to load profile";j.value=_,f("error",_)}finally{L.value=!1}}},ze=async()=>{if(v.value){he.value=!0;try{const F=await $();Y.value=F||[]}catch(F){console.warn("Failed to load sessions (non-critical):",F)}finally{he.value=!1}}};e.watch(()=>g.value,F=>{F&&(X.firstName=F.firstName||"",X.lastName=F.lastName||"",X.email=F.email)},{immediate:!0}),e.watch(()=>v.value,(F,_)=>{F&&!_?setTimeout(()=>{ze()},500):F||(Y.value=[])},{immediate:!1}),e.watch(()=>T.value,F=>{F&&v.value&&setTimeout(()=>{ze()},100)}),e.onMounted(()=>{je(),ze()});const De=()=>{K.value="",j.value="",Object.keys(se).forEach(F=>{se[F]=""})},We=async()=>{De(),N.value=!0;try{const F=await y({firstName:X.firstName,lastName:X.lastName});F&&(K.value="Profile updated successfully",f("profile-updated",F))}catch(F){console.error("Failed to update profile:",F);const _=F instanceof Error?F.message:"Failed to update profile";j.value=_,f("error",_)}finally{N.value=!1}},Qe=async()=>{if(ne.value){De(),N.value=!0;try{await new Promise(F=>setTimeout(F,1e3)),K.value="Password updated successfully",ie.value=!1,ye.current="",ye.new="",ye.confirm=""}catch(F){console.error("Failed to update password:",F),j.value="Failed to update password"}finally{N.value=!1}}},Xe=async()=>{if(oe.value){ae.errors.newEmail="",ae.errors.password="",De(),ve.value=!0;try{const F=await k(ae.newEmail,ae.password);K.value=F.message||"Email updated successfully. Please verify your new email address.",me.value=!1,ae.newEmail="",ae.password="",g.value&&f("profile-updated",g.value)}catch(F){console.error("Failed to update email:",F);const _=F instanceof Error?F.message:"Failed to update email";_.includes("password")?ae.errors.password="Invalid password":_.includes("email")?ae.errors.newEmail=_:j.value=_,f("error",_)}finally{ve.value=!1}}},gt=async()=>{if(fe.value)fe.value=!1,H.username="",H.errors.username="",ke.available=!1,ke.message="";else{ue.value=!0;try{const F=await u();Ce.canChange=F.can_change,Ce.cooldownEnd=F.cooldown_end?new Date(F.cooldown_end):null,Ce.daysRemaining=F.days_remaining||0,Ce.canChange?(fe.value=!0,H.username=g.value?.username||""):j.value=`You can change your username again in ${Ce.daysRemaining} days`}catch(F){console.error("Failed to check username cooldown:",F),j.value="Failed to check username cooldown",fe.value=!0}finally{ue.value=!1}}},_t=async()=>{if(!we.value){if(!/^[a-zA-Z0-9_-]{3,30}$/.test(H.username)){H.errors.username="Username must be 3-30 characters and contain only letters, numbers, hyphens, and underscores";return}ke.checking=!0,ke.message="Checking availability...";try{const _=await M(H.username);if(ke.available=_.available,ke.message=_.message,!_.available){H.errors.username="Username is not available";return}}catch(_){console.error("Failed to check username availability:",_),H.errors.username="Failed to check username availability";return}finally{ke.checking=!1}}De(),ue.value=!0;try{const F=await r(H.username);K.value=F.message||"Username updated successfully",fe.value=!1,H.username="",H.errors.username="",ke.available=!1,ke.message="",g.value&&f("profile-updated",g.value)}catch(F){console.error("Failed to update username:",F);const _=F instanceof Error?F.message:"Failed to update username";_.includes("taken")?H.errors.username="Username is already taken":_.includes("cooldown")||_.includes("30 days")?(j.value=_,fe.value=!1):H.errors.username=_,f("error",_)}finally{ue.value=!1}},yt=()=>{Z.value||pe.value?.click()},kt=F=>{const _=F.target,de=_.files?.[0];if(de){if(!de.type.startsWith("image/")){j.value="Please select an image file";return}if(de.size>5*1024*1024){j.value="File size must be less than 5MB";return}Q.value=de,W.value=!0}_&&(_.value="")},wt=async F=>{await Vt(F),W.value=!1,Q.value=null},Fe=F=>{j.value=F},qe=()=>{W.value=!1,Q.value=null},Vt=async F=>{Z.value=!0,De();try{const _=new FormData;_.append("avatar",F);const de={};T.value?.accessToken&&(de.Authorization=`Bearer ${T.value.accessToken}`);const Oe=await fetch(s("avatar"),{method:"POST",body:_,headers:de});if(!Oe.ok)if(Oe.status===401)try{if(await x()&&T.value?.accessToken){const Le=await fetch(s("avatar"),{method:"POST",body:_,headers:{Authorization:`Bearer ${T.value.accessToken}`}});if(!Le.ok){const nt=await Le.json().catch(()=>({}));throw new Error(nt.message||`Upload failed: ${Le.status} ${Le.statusText}`)}const Re=await Le.json();p.value&&(p.value.avatar=Re.avatar_url,typeof window<"u"&&localStorage.setItem("strands_auth_user",JSON.stringify(p.value))),D.value&&(D.value.avatar=Re.avatar_url);try{await m()}catch{}K.value="Avatar updated successfully",g.value&&f("profile-updated",g.value);return}else throw new Error("Authentication expired. Please sign in again.")}catch{throw new Error("Authentication expired. Please sign in again.")}else{const $e=await Oe.json().catch(()=>({}));throw new Error($e.message||`Upload failed: ${Oe.status} ${Oe.statusText}`)}const ot=await Oe.json();p.value&&(p.value.avatar=ot.avatar_url,typeof window<"u"&&localStorage.setItem("strands_auth_user",JSON.stringify(p.value))),D.value&&(D.value.avatar=ot.avatar_url);try{await m()}catch{}K.value="Avatar updated successfully",g.value&&f("profile-updated",g.value)}catch(_){console.error("Failed to upload avatar:",_);const de=_ instanceof Error?_.message:"Failed to upload avatar";j.value=de,f("error",de)}finally{Z.value=!1}},Nt=async()=>{try{await m(),await h(),K.value="MFA settings updated successfully",f("mfa-toggle",g.value?.mfaEnabled||!1)}catch(F){console.warn("Failed to refresh profile after MFA update:",F)}},tt=()=>{K.value="Settings updated successfully"},at=()=>{ze()},Et=()=>{const F=g.value;F&&(X.firstName=F.firstName||"",X.lastName=F.lastName||"",X.email=F.email),De(),ie.value=!1,me.value=!1,ye.current="",ye.new="",ye.confirm="",ae.newEmail="",ae.password="",ae.errors.newEmail="",ae.errors.password=""},bt=async()=>{J.value=!0,De();try{await I(),K.value="Signed out successfully"}catch(F){console.error("Failed to sign out:",F);const _=F instanceof Error?F.message:"Failed to sign out";j.value=_,f("error",_),J.value=!1}};return e.onMounted(async()=>{if(g.value&&v.value)try{const F=await u();Ce.canChange=F.can_change,Ce.cooldownEnd=F.cooldown_end?new Date(F.cooldown_end):null,Ce.daysRemaining=F.days_remaining||0}catch(F){console.warn("Failed to fetch username cooldown:",F)}}),(F,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",rd,[e.createVNode(e.unref(S.StrandsUiCard),{variant:a.inModal?"simple":"modern",color:a.inModal?"default":"secondary",class:e.normalizeClass(a.inModal?"profile-container-modal profile-container-width":"profile-container profile-container-width profile-max-width profile-centered profile-animated")},{default:e.withCtx(()=>[e.createElementVNode("div",id,[_[30]||(_[30]=e.createElementVNode("div",{class:"profile-header"},[e.createElementVNode("h1",{class:"profile-title"},"Profile Settings"),e.createElementVNode("p",{class:"profile-subtitle"},"Manage your account information and preferences")],-1)),e.createElementVNode("div",cd,[e.createElementVNode("div",dd,[e.createElementVNode("div",ud,[e.createVNode(e.unref(mt),{size:140,value:g.value?.xp||0,max:g.value?.next_level_xp||1,level:g.value?.level||0,"level-label":`LEVEL ${g.value?.level||0}`,"user-settings":g.value?.settings,class:"profile-progress-ring"},null,8,["value","max","level","level-label","user-settings"]),g.value?.avatar?(e.openBlock(),e.createElementBlock("div",md,[e.createElementVNode("img",{src:g.value.avatar,alt:`${g.value.firstName} ${g.value.lastName}`,class:"profile-avatar-image",width:"120",height:"120"},null,8,pd)])):(e.openBlock(),e.createElementBlock("div",fd,e.toDisplayString(Ct(g.value?.firstName,g.value?.lastName)),1)),e.createElementVNode("button",{class:"profile-upload-overlay",onClick:yt,disabled:Z.value},[Z.value?(e.openBlock(),e.createBlock(e.unref(S.StrandsUiLoader),{key:0,size:24,variant:"spinner"})):(e.openBlock(),e.createElementBlock("svg",hd,[..._[14]||(_[14]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"},null,-1),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 616 0z"},null,-1)])]))],8,vd)])]),e.createElementVNode("input",{ref_key:"avatarFileInput",ref:pe,type:"file",accept:"image/*",class:"profile-file-input",onChange:kt},null,544)]),e.createElementVNode("form",{onSubmit:e.withModifiers(We,["prevent"]),class:"profile-form"},[e.createElementVNode("div",Cd,[e.createElementVNode("div",gd,[_[17]||(_[17]=e.createElementVNode("h3",{class:"profile-section-title"},"Personal Information",-1)),e.createVNode(e.unref(S.StrandsUiInput),{id:"firstName",modelValue:X.firstName,"onUpdate:modelValue":_[0]||(_[0]=de=>X.firstName=de),type:"text",label:"First name",placeholder:"Enter your first name",autocomplete:"given-name",disabled:N.value||L.value,error:se.firstName},null,8,["modelValue","disabled","error"]),e.createVNode(e.unref(S.StrandsUiInput),{id:"lastName",modelValue:X.lastName,"onUpdate:modelValue":_[1]||(_[1]=de=>X.lastName=de),type:"text",label:"Last name",placeholder:"Enter your last name",autocomplete:"family-name",disabled:N.value||L.value,error:se.lastName},null,8,["modelValue","disabled","error"]),e.createElementVNode("div",yd,[e.createElementVNode("div",kd,[e.createElementVNode("div",null,[_[15]||(_[15]=e.createElementVNode("h4",{class:"profile-setting-title"},"Email Address",-1)),e.createElementVNode("p",wd,e.toDisplayString(g.value?.email),1)]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:_[2]||(_[2]=de=>me.value=!me.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(me.value?"Cancel":"Change"),1)]),_:1})]),e.createVNode(e.Transition,{name:"expand"},{default:e.withCtx(()=>[me.value?(e.openBlock(),e.createElementBlock("div",Vd,[e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ae.newEmail,"onUpdate:modelValue":_[3]||(_[3]=de=>ae.newEmail=de),type:"email",placeholder:"New email address",autocomplete:"email",error:ae.errors.newEmail},null,8,["modelValue","error"]),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ae.password,"onUpdate:modelValue":_[4]||(_[4]=de=>ae.password=de),type:"password",placeholder:"Current password",autocomplete:"current-password",error:ae.errors.password},null,8,["modelValue","error"]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:Xe,disabled:!oe.value||ve.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ve.value?"Updating...":"Update Email"),1)]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",Nd,[e.createElementVNode("div",Ed,[e.createElementVNode("div",null,[_[16]||(_[16]=e.createElementVNode("h4",{class:"profile-field-title"},"Username",-1)),e.createElementVNode("p",bd,e.toDisplayString(g.value?.username||"No username set"),1)]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",disabled:!Ce.canChange||ue.value,onClick:gt},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ce.cooldownEnd?`Wait ${Ce.daysRemaining} day${Ce.daysRemaining===1?"":"s"} to change`:fe.value?"Cancel":g.value?.username?"Change":"Set Username"),1)]),_:1},8,["disabled"])]),e.createVNode(e.Transition,{name:"expand"},{default:e.withCtx(()=>[fe.value?(e.openBlock(),e.createElementBlock("div",xd,[e.createVNode(e.unref(S.StrandsUiInput),{modelValue:H.username,"onUpdate:modelValue":_[5]||(_[5]=de=>H.username=de),type:"text",placeholder:"Enter username (3-30 characters)",autocomplete:"username",error:H.errors.username},null,8,["modelValue","error"]),ke.message?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["profile-availability-message",ke.available?"success":"error"])},e.toDisplayString(ke.message),3)):e.createCommentVNode("",!0),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:_t,disabled:!we.value||ue.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ue.value?"Updating...":"Update Username"),1)]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),_:1})])]),e.createElementVNode("div",Bd,[_[23]||(_[23]=e.createElementVNode("h3",{class:"profile-section-title"},"Security Settings",-1)),e.createElementVNode("div",Sd,[e.createElementVNode("div",Md,[e.createElementVNode("div",null,[_[18]||(_[18]=e.createElementVNode("h4",{class:"profile-field-title"},"Password",-1)),e.createElementVNode("p",$d,"Last updated "+e.toDisplayString(Ve.value),1)]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:_[6]||(_[6]=de=>ie.value=!ie.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ie.value?"Cancel":"Change"),1)]),_:1})]),e.createVNode(e.Transition,{name:"expand"},{default:e.withCtx(()=>[ie.value?(e.openBlock(),e.createElementBlock("div",Td,[e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ye.current,"onUpdate:modelValue":_[7]||(_[7]=de=>ye.current=de),type:"password",placeholder:"Current password",autocomplete:"current-password"},null,8,["modelValue"]),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ye.new,"onUpdate:modelValue":_[8]||(_[8]=de=>ye.new=de),type:"password",placeholder:"New password",autocomplete:"new-password"},null,8,["modelValue"]),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ye.confirm,"onUpdate:modelValue":_[9]||(_[9]=de=>ye.confirm=de),type:"password",placeholder:"Confirm new password",autocomplete:"new-password"},null,8,["modelValue"]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:Qe,disabled:!ne.value},{default:e.withCtx(()=>[..._[19]||(_[19]=[e.createTextVNode(" Update Password ",-1)])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",Ad,[e.createElementVNode("div",_d,[e.createElementVNode("div",zd,[e.createElementVNode("div",null,[_[20]||(_[20]=e.createElementVNode("h4",{class:"profile-field-title"},"Two-Factor Authentication",-1)),e.createElementVNode("p",Dd,e.toDisplayString(g.value?.mfaEnabled?"Enabled":"Add extra security to your account"),1)]),Pe.value.length>0?(e.openBlock(),e.createElementBlock("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,de=>(e.openBlock(),e.createElementBlock("div",{key:de.type,class:e.normalizeClass(["mfa-device-chip",de.color])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(de.icon),{size:12})),e.createElementVNode("span",null,e.toDisplayString(de.count),1),e.createElementVNode("span",null,e.toDisplayString(de.label),1)],2))),128))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",class:"profile-toggle-container",onClick:_[10]||(_[10]=de=>O.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value?.mfaEnabled?"Manage":"Setup"),1)]),_:1})])]),e.createElementVNode("div",Ld,[e.createElementVNode("div",Ud,[e.createElementVNode("div",null,[_[21]||(_[21]=e.createElementVNode("h4",{class:"profile-field-title"},"Active Sessions",-1)),e.createElementVNode("p",Hd,[he.value?(e.openBlock(),e.createElementBlock("span",Pd,"Loading sessions...")):(e.openBlock(),e.createElementBlock("span",jd,e.toDisplayString(Y.value.length)+" active device"+e.toDisplayString(Y.value.length!==1?"s":""),1))])]),e.createElementVNode("div",Od,[e.createVNode(e.unref(ee),{color:"secondary",size:"sm",disabled:he.value,onClick:_[11]||(_[11]=de=>U.value=!0)},{default:e.withCtx(()=>[..._[22]||(_[22]=[e.createTextVNode(" Manage ",-1)])]),_:1},8,["disabled"])])])])])]),R.value?(e.openBlock(),e.createElementBlock("div",Rd,[e.createVNode(e.unref(ee),{type:"submit",disabled:N.value,loading:N.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.value?"Saving changes...":"Save changes"),1)]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(ee),{color:"secondary",onClick:Et,disabled:N.value},{default:e.withCtx(()=>[..._[24]||(_[24]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)],32),K.value?(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("div",qd,[e.createElementVNode("div",Kd,[_[25]||(_[25]=e.createElementVNode("svg",{class:"profile-help-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.236 4.53L7.53 10.173a.75.75 0 00-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"})],-1)),e.createElementVNode("p",Zd,e.toDisplayString(K.value),1)])])])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("div",Gd,[e.createElementVNode("div",Yd,[e.createElementVNode("div",Wd,[_[26]||(_[26]=e.createElementVNode("svg",{class:"profile-help-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"})],-1)),e.createElementVNode("p",Qd,e.toDisplayString(j.value),1)])])])):e.createCommentVNode("",!0),e.createVNode(Ge,{config:b.config},{default:e.withCtx(()=>[e.createElementVNode("div",Xd,[e.createVNode(e.unref(ee),{color:"danger",onClick:bt,disabled:J.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(J.value?"Signing out...":"Sign Out"),1)]),_:1},8,["disabled"]),e.createVNode(ga,{onSettingsUpdated:tt},{trigger:e.withCtx(()=>[e.createVNode(e.unref(ee),{color:"secondary",icon:""},{icon:e.withCtx(()=>[..._[27]||(_[27]=[e.createElementVNode("svg",{class:"profile-action-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])]),_:1})]),_:1})]),e.unref(C)()?(e.openBlock(),e.createElementBlock("div",Jd,[e.createElementVNode("p",eu,[_[29]||(_[29]=e.createTextVNode(" Need help? ",-1)),e.createVNode(e.unref(S.StrandsUiLink),{variant:"primary",href:`mailto:${e.unref(C)()}`},{default:e.withCtx(()=>[..._[28]||(_[28]=[e.createTextVNode(" Contact Support ",-1)])]),_:1},8,["href"])])])):e.createCommentVNode("",!0)]),_:1},8,["config"])]),W.value?(e.openBlock(),e.createElementBlock("div",tu,[e.createElementVNode("div",au,[e.createElementVNode("div",ou,[e.createElementVNode("div",{class:"profile-avatar-modal-header"},[_[32]||(_[32]=e.createElementVNode("h2",{class:"profile-modal-title"},"Edit Avatar",-1)),e.createElementVNode("button",{onClick:qe,class:"profile-avatar-modal-close"},[..._[31]||(_[31]=[e.createElementVNode("svg",{class:"profile-avatar-modal-close-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e.createVNode(e.unref(Tt),{uploading:Z.value,"preselected-file":Q.value,onUpload:wt,onError:Fe},null,8,["uploading","preselected-file"])])])])):e.createCommentVNode("",!0)]),_:1},8,["variant","color","class"])]),e.createVNode(Ft,{modelValue:O.value,"onUpdate:modelValue":_[12]||(_[12]=de=>O.value=de),onMfaUpdated:Nt},null,8,["modelValue"]),e.createVNode(ya,{modelValue:U.value,"onUpdate:modelValue":_[13]||(_[13]=de=>U.value=de),onSessionsUpdated:at},null,8,["modelValue"])],64))}}),ka=S._export_sfc(nu,[["__scopeId","data-v-9430e3ba"]]),lu={class:"accui-component-scope"},su={class:"accui-w-full accui-min-w-100 accui-max-w-md accui-mx-auto accui-animate-slide-up"},ru={class:"accui-mt-8 accui-text-center"},iu={key:0,class:"accui-mt-6 accui-text-center"},cu={class:"accui-text-neutral-400 accui-text-sm"},du=e.defineComponent({__name:"StrandsPasswordReset",props:{config:{}},emits:["success","error","back-to-signin"],setup(a,{emit:l}){const t=a,o=l,{getSupportEmail:E}=Se.useStrandsConfig(t.config),b=e.ref(!1),f=e.ref(""),C=e.ref(!1),s=e.reactive({email:""}),m=async()=>{b.value=!0,f.value="";try{await new Promise(y=>setTimeout(y,1e3)),C.value=!0,o("success",s.email)}catch{f.value="Failed to send password reset email. Please try again.",o("error",f.value)}finally{b.value=!1}};return(y,k)=>(e.openBlock(),e.createElementBlock("div",lu,[e.createElementVNode("div",su,[e.createVNode(e.unref(S.StrandsUiCard),{variant:"modern",color:"secondary"},{default:e.withCtx(()=>[k[6]||(k[6]=e.createElementVNode("div",{class:"accui-text-center accui-mb-8"},[e.createElementVNode("h1",{class:"accui-text-3xl accui-font-bold accui-text-gradient accui-mb-2"},"Reset password"),e.createElementVNode("p",{class:"accui-text-neutral-600"},"Enter your email address and we'll send you a link to reset your password")],-1)),e.createElementVNode("form",{onSubmit:e.withModifiers(m,["prevent"]),class:"accui-space-y-6"},[e.createVNode(e.unref(S.StrandsUiInput),{id:"email",modelValue:s.email,"onUpdate:modelValue":k[0]||(k[0]=r=>s.email=r),type:"email",label:"Email address",placeholder:"Enter your email address",autocomplete:"email",required:"",disabled:b.value||C.value,error:f.value?"Email address not found":void 0},null,8,["modelValue","disabled","error"]),e.createVNode(e.unref(ee),{type:"submit",variant:"primary","full-width":"",disabled:b.value||!s.email.trim()||C.value,loading:b.value,"loading-text":"Sending link..."},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.value?"Link sent!":"Send reset link"),1)]),_:1},8,["disabled","loading"])],32),C.value?(e.openBlock(),e.createBlock(e.unref(S.StrandsUiAlert),{key:0,variant:"success",message:`Check your email - We've sent a password reset link to ${s.email}`,class:"accui-mt-6 accui-animate-fade-in"},null,8,["message"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(e.unref(S.StrandsUiAlert),{key:1,variant:"error",message:f.value,class:"accui-mt-6 accui-animate-fade-in",dismissible:"",onDismiss:k[1]||(k[1]=r=>f.value="")},null,8,["message"])):e.createCommentVNode("",!0),e.createElementVNode("div",ru,[e.createVNode(e.unref(S.StrandsUiLink),{onClick:k[2]||(k[2]=r=>y.$emit("back-to-signin")),class:"accui-inline-flex accui-items-center accui-gap-2"},{default:e.withCtx(()=>[...k[3]||(k[3]=[e.createElementVNode("svg",{class:"accui-w-4 accui-h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),e.createTextVNode(" Back to sign in ",-1)])]),_:1})]),e.createVNode(Ge,{config:t.config},{default:e.withCtx(()=>[e.unref(E)()?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("p",cu,[k[5]||(k[5]=e.createTextVNode(" Need help? ",-1)),e.createVNode(e.unref(S.StrandsUiLink),{variant:"primary",href:`mailto:${e.unref(E)()}`},{default:e.withCtx(()=>[...k[4]||(k[4]=[e.createTextVNode(" Contact Support ",-1)])]),_:1},8,["href"])])])):e.createCommentVNode("",!0)]),_:1},8,["config"])]),_:1})])]))}}),uu=S._export_sfc(du,[["__scopeId","data-v-d5af9f1c"]]),mu={key:1,class:"animate-fade-in"},pu={key:2,class:"animate-fade-in"},fu=e.defineComponent({__name:"SignedIn",props:{showFallback:{type:Boolean,default:!0},inline:{type:Boolean,default:!1}},emits:["sign-in-required"],setup(a,{emit:l}){const t=l,{isAuthenticated:o,isInitializing:E,user:b,signOut:f,initialize:C}=Ie.useStrandsAuth();typeof window<"u"&&C();const s=e.computed(()=>E.value),m=e.computed(()=>!s.value&&o.value),y=e.computed(()=>!s.value&&!o.value),k=()=>{t("sign-in-required")};return(r,u)=>m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["animate-fade-in",a.inline?"is_inline":""])},[e.renderSlot(r.$slots,"default",{user:e.unref(b),signOut:e.unref(f)},void 0,!0)],2)):y.value&&a.showFallback?(e.openBlock(),e.createElementBlock("div",mu,[e.renderSlot(r.$slots,"fallback",{signIn:k},()=>[e.createElementVNode("div",{class:"signed-in-fallback"},[u[0]||(u[0]=e.createStaticVNode('<div class="signed-in-icon-container" data-v-02f9ccb4><svg class="signed-in-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-02f9ccb4><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" data-v-02f9ccb4></path></svg></div><h3 class="signed-in-title" data-v-02f9ccb4>Sign in required</h3><p class="signed-in-subtitle" data-v-02f9ccb4>You need to be signed in to access this content.</p>',3)),e.createElementVNode("button",{onClick:k,class:"signed-in-button"}," Sign in ")])],!0)])):s.value?(e.openBlock(),e.createElementBlock("div",pu,[e.renderSlot(r.$slots,"loading",{},()=>[e.createVNode(e.unref(S.StrandsUiLoader),{size:30,variant:"circle","show-particles":!0})],!0)])):e.createCommentVNode("",!0)}}),wa=S._export_sfc(fu,[["__scopeId","data-v-02f9ccb4"]]),vu=e.defineComponent({__name:"StrandsConfigProvider",props:{config:{}},setup(a){const l=a;return e.onMounted(()=>{Se.provideStrandsConfig(l.config)}),Se.provideStrandsConfig(l.config),(t,o)=>e.renderSlot(t.$slots,"default")}}),hu=["fill","stroke","viewBox","aria-hidden"],Cu=e.defineComponent({__name:"SvgIcon",props:{name:{},class:{default:""},size:{default:"md"},fill:{default:"none"},stroke:{default:"currentColor"},ariaHidden:{type:Boolean,default:!0}},setup(a){const l=a,t={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"},o=e.computed(()=>`${t[l.size]} ${l.class}`),E=e.computed(()=>"0 0 24 24"),b={eye:()=>e.h("g",[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"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"})]),"eye-slash":()=>e.h("g",[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"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.878 9.878L3 3m6.878 6.878L21 21"})]),camera:()=>e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0710.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),"chevron-left":()=>e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}),loading:()=>e.h("g",[e.h("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.h("path",{class:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]),"check-circle":()=>e.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.236 4.53L7.53 10.173a.75.75 0 00-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"}),"x-circle":()=>e.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"}),lock:()=>e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"}),user:()=>e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"}),google:()=>e.h("g",{fill:"currentColor"},[e.h("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.h("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.h("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.h("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]),github:()=>e.h("path",{"fill-rule":"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z","clip-rule":"evenodd"})},f=e.computed(()=>{const C=b[l.name];return C?C():e.h("path",{d:""})});return(C,s)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(o.value),fill:a.fill,stroke:a.stroke,viewBox:E.value,"aria-hidden":a.ariaHidden},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.value)))],10,hu))}}),gu=["onKeydown","aria-expanded"],yu={class:"mini-profile-avatar-container"},ku=["src","alt","width","height"],wu={key:1,class:"mini-profile-avatar-default"},Vu={class:"mini-profile-content"},Nu={class:"mini-profile-name"},Eu={class:"mini-profile-email"},bu=["src","alt","width","height"],xu={key:1,class:"avatar-default"},Bu={key:0},Su=["onKeydown"],Mu={class:"dropdown-content"},$u={key:0,class:"dropdown-header"},Tu={key:0,class:"dropdown-avatar-container"},Au=["src","alt"],_u={key:1,class:"dropdown-avatar-default"},zu={class:"dropdown-user-details"},Du={class:"dropdown-user-name"},Iu={class:"dropdown-user-email"},Lu={key:1,class:"dropdown-divider"},Uu={class:"sign-in-auth-wrapper"},Hu=e.defineComponent({__name:"StrandsUserButton",props:{hideUser:{type:Boolean,default:!1},variant:{default:"minimal"},size:{default:"md"},redirectUrl:{default:"/"},user:{default:void 0},menuAlign:{default:"right"},menuVerticalAlign:{default:"bottom"},fullWidth:{type:Boolean,default:!1}},emits:["profile-updated","signed-out","signed-in"],setup(a,{emit:l}){const t=a,o=l,{currentUser:E,signOut:b,isAuthenticated:f}=Ie.useStrandsAuth(),C=e.ref(!1),s=e.ref(!1),m=e.ref(!1),y=e.ref(),k=e.ref(),r=e.ref(),u=e.computed(()=>k.value),{floatingStyle:M,updatePosition:$}=S.useFloatingPosition({trigger:u,floating:r,placement:"bottom-end",offset:8,shift:!0,flip:!0,autoUpdate:!0,clickOutside:{enabled:!0,handler:()=>h()}}),p=e.computed(()=>{if(t.variant==="mini-profile")switch(t.size){case"sm":return 32;case"md":return 44;case"lg":return 56;default:return 44}switch(t.size){case"sm":return 24;case"md":return 32;case"lg":return 40;default:return 32}}),T=e.computed(()=>{switch(t.size){case"sm":return 48;case"md":return 64;case"lg":return 80;default:return 64}}),v=e.computed(()=>t.user?t.user:f.value?E.value:null),x=e.computed(()=>v.value?v.value.username?v.value.username:v.value.firstName&&v.value.lastName?`${v.value.firstName} ${v.value.lastName}`:v.value.firstName?v.value.firstName:v.value.email||"User":"User"),I=()=>{C.value=!C.value,C.value&&e.nextTick(()=>{$()})},w=()=>{C.value=!0},h=()=>{C.value=!1},D=()=>{},L=()=>{},g=()=>{k.value?.$el?.focus()},N=()=>{},Z=()=>{s.value=!0,h()},J=()=>{o("profile-updated")},ie=()=>{},me=()=>{m.value=!0},ve=()=>{m.value=!1,o("signed-in")},fe=()=>{},ue=async()=>{try{await b(),h(),o("signed-out")}catch{}};return(W,O)=>(e.openBlock(),e.createElementBlock("div",{class:"accui-component-scope",ref_key:"containerRef",ref:y},[e.createVNode(wa,{invert:!!t.user},{fallback:e.withCtx(()=>[e.createVNode(e.unref(ee),{onClick:me,"aria-label":"Sign in"},{"leading-icon":e.withCtx(()=>[...O[9]||(O[9]=[e.createElementVNode("svg",{class:"sign-in-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"})],-1)])]),default:e.withCtx(()=>[O[10]||(O[10]=e.createTextVNode(" Sign In ",-1))]),_:1}),e.createVNode(e.unref(_e),{modelValue:m.value,"onUpdate:modelValue":O[1]||(O[1]=U=>m.value=U)},{default:e.withCtx(()=>[e.createElementVNode("div",Uu,[e.createVNode(e.unref(pa),{onSignedIn:ve,onError:fe,"redirect-url":a.redirectUrl,"in-modal":""},null,8,["redirect-url"])])]),_:1},8,["modelValue"])]),loading:e.withCtx(()=>[e.createVNode(S.StrandsUiLoader,{variant:"circle",size:30})]),default:e.withCtx(()=>[a.variant==="mini-profile"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"triggerRef",ref:k,class:e.normalizeClass(["mini-profile-static-card",`user-button-size-${a.size}`,{"mini-profile-active":C.value,"full-width":a.fullWidth}]),onClick:I,onKeydown:[e.withKeys(I,["enter"]),e.withKeys(e.withModifiers(I,["prevent"]),["space"]),e.withKeys(h,["escape"]),e.withKeys(e.withModifiers(w,["prevent"]),["arrow-down"])],role:"button",tabindex:"0","aria-haspopup":"true","aria-expanded":C.value,"aria-label":"User menu"},[e.createElementVNode("div",yu,[e.createVNode(e.unref(mt),{size:T.value,value:v.value?.xp||0,max:v.value?.next_level_xp||100,level:v.value?.level||1,"level-label":`LEVEL ${v.value?.level||1}`,"user-settings":v.value?.settings,class:"mini-profile-level-progress"},null,8,["size","value","max","level","level-label","user-settings"]),v.value?.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:v.value.avatar,alt:`${v.value?.firstName||v.value?.email}'s avatar`,class:"mini-profile-avatar-image",width:p.value,height:p.value,loading:"eager"},null,8,ku)):(e.openBlock(),e.createElementBlock("div",wu,[...O[2]||(O[2]=[e.createElementVNode("svg",{class:"mini-profile-avatar-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z","clip-rule":"evenodd"})],-1)])]))]),e.createElementVNode("div",Vu,[e.createElementVNode("div",Nu,e.toDisplayString(x.value),1),e.createElementVNode("div",Eu,e.toDisplayString(v.value?.email),1)]),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["mini-profile-dropdown-arrow",{"dropdown-arrow-open":C.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...O[3]||(O[3]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],42,gu)):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"triggerRef",ref:k,class:e.normalizeClass(["user-button-wrapper",{"full-width":a.fullWidth}])},[e.createVNode(e.unref(ee),{color:"secondary",size:a.size,active:C.value,onClick:I,onKeydown:[e.withKeys(I,["enter"]),e.withKeys(e.withModifiers(I,["prevent"]),["space"]),e.withKeys(h,["escape"]),e.withKeys(e.withModifiers(w,["prevent"]),["arrow-down"])],"aria-haspopup":"true","aria-expanded":C.value,"aria-label":"User menu"},{"leading-icon":e.withCtx(()=>[v.value?.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:v.value.avatar,alt:`${v.value?.firstName||v.value?.email}'s avatar`,class:"avatar-image",width:p.value,height:p.value,loading:"eager"},null,8,bu)):(e.openBlock(),e.createElementBlock("div",xu,[...O[4]||(O[4]=[e.createElementVNode("svg",{class:"avatar-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z","clip-rule":"evenodd"})],-1)])]))]),"trailing-icon":e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["dropdown-arrow",{"dropdown-arrow-open":C.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...O[5]||(O[5]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))]),default:e.withCtx(()=>[a.hideUser?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Bu,e.toDisplayString(x.value),1))]),_:1},8,["size","active","onKeydown","aria-expanded"])],2)),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[C.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:r,class:"strands-user-dropdown",style:e.normalizeStyle(e.unref(M)),role:"menu","aria-orientation":"vertical",onKeydown:[e.withKeys(h,["escape"]),e.withKeys(e.withModifiers(L,["prevent"]),["arrow-up"]),e.withKeys(e.withModifiers(D,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(g,["prevent"]),["home"]),e.withKeys(e.withModifiers(N,["prevent"]),["end"])]},[e.createElementVNode("div",Mu,[a.variant!=="mini-profile"?(e.openBlock(),e.createElementBlock("div",$u,[v.value?(e.openBlock(),e.createElementBlock("div",Tu,[e.createVNode(e.unref(mt),{size:80,value:v.value.xp,max:v.value.next_level_xp,level:v.value.level,"level-label":`LEVEL ${v.value.level}`,"user-settings":v.value.settings,class:"level-progress-overlay"},null,8,["value","max","level","level-label","user-settings"]),v.value?.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:v.value.avatar,alt:`${v.value.firstName||v.value.email}'s avatar`,class:"dropdown-avatar-image",width:"64",height:"64"},null,8,Au)):(e.openBlock(),e.createElementBlock("div",_u,[...O[6]||(O[6]=[e.createElementVNode("svg",{class:"dropdown-avatar-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z","clip-rule":"evenodd"})],-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("div",zu,[e.createElementVNode("div",Du,e.toDisplayString(x.value),1),e.createElementVNode("div",Iu,e.toDisplayString(v.value?.email),1)])])):e.createCommentVNode("",!0),e.renderSlot(W.$slots,"default",{},void 0,!0),a.variant!=="mini-profile"?(e.openBlock(),e.createElementBlock("div",Lu)):e.createCommentVNode("",!0),e.createVNode(e.unref(ut),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ut).Item,{color:"secondary",onClick:Z},{default:e.withCtx(()=>[...O[7]||(O[7]=[e.createTextVNode("Profile",-1)])]),_:1}),e.createVNode(e.unref(ut).Item,{color:"danger",onClick:ue},{default:e.withCtx(()=>[...O[8]||(O[8]=[e.createTextVNode("Sign Out",-1)])]),_:1})]),_:1})])],44,Su)):e.createCommentVNode("",!0)])),e.createVNode(e.unref(_e),{modelValue:s.value,"onUpdate:modelValue":O[0]||(O[0]=U=>s.value=U)},{default:e.withCtx(()=>[e.createVNode(e.unref(ka),{user:v.value,onProfileUpdated:J,onError:ie,"in-modal":""},null,8,["user"])]),_:1},8,["modelValue"])]),_:3},8,["invert"])],512))}}),Pu=S._export_sfc(Hu,[["__scopeId","data-v-9e62a2ea"]]),ju=e.defineComponent({__name:"StrandsNav",props:{direction:{default:"column"}},setup(a,{expose:l}){const t=a,o=()=>["user-nav",`user-nav-${t.direction}`],E=e.reactive({items:[]});e.provide("userNavState",E);const b=C=>{const s=E.items.findIndex(m=>m.id===C.id);s>=0?E.items[s]=C:E.items.push(C)},f=C=>{const s=E.items.findIndex(m=>m.id===C);s>=0&&E.items.splice(s,1)};return e.provide("registerNavItem",b),e.provide("unregisterNavItem",f),l({items:E.items}),(C,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o())},[e.renderSlot(C.$slots,"default",{},void 0,!0)],2))}}),Ou=S._export_sfc(ju,[["__scopeId","data-v-dfb31e47"]]),Ru={key:0,class:"strands-nav-item-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Fu=["d"],qu={key:0,class:"strands-nav-item-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ku=["d"],Va=e.defineComponent({__name:"StrandsNavItem",props:{variant:{default:"primary"},size:{default:"sm"},type:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean},loadingText:{},fullWidth:{type:Boolean},color:{default:"secondary"},fontWeight:{},icon:{type:Boolean},squircle:{type:Boolean,default:!0},to:{},href:{},external:{type:Boolean},tabindex:{},title:{},align:{}},setup(a){const l=a,t=e.useSlots(),o=e.inject("registerNavItem"),E=e.inject("unregisterNavItem"),b=e.ref(`nav-item-${Math.random().toString(36).substring(2,11)}`),f=e.getCurrentInstance(),C=e.computed(()=>{if(typeof window<"u"&&f){const u=f.vnode.el?.parentElement;if(u)return u.closest('[role="menu"]')!==null}return!1}),s=()=>{try{const u=t.default?.();return u?u.map(M=>typeof M.children=="string"?M.children:M.children&&Array.isArray(M.children)?M.children.map($=>typeof $=="string"?$:"").join(""):"").join("").trim():""}catch{return""}},m=()=>l.type==="button"?"":["strands-nav-item",`strands-nav-item--color-${l.color}`,{"strands-nav-item--disabled":l.disabled}],y=()=>{l.disabled},k=u=>{const M={dashboard:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"};return M[u]||M.dashboard},r=e.computed(()=>({id:b.value,label:s(),to:l.to,icon:l.icon,disabled:l.disabled,variant:l.variant,size:l.size}));return e.onMounted(()=>{o&&o(r.value)}),e.onUnmounted(()=>{E&&E(b.value)}),e.watch(()=>[l.to,l.icon,l.disabled],()=>{o&&o(r.value)},{deep:!0}),(u,M)=>(e.openBlock(),e.createBlock(e.unref(ee),{to:l.to,onClick:y,class:e.normalizeClass(m()),variant:l.variant,color:l.color,size:l.size,squircle:l.squircle,disabled:l.disabled,"full-width":"",role:C.value?"menuitem":void 0,tabindex:"-1"},e.createSlots({default:e.withCtx(()=>[l.icon&&l.type!=="button"?(e.openBlock(),e.createElementBlock("svg",qu,[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:k(l.icon)},null,8,Ku)])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default")]),_:2},[l.type==="button"?{name:"icon",fn:e.withCtx(()=>[l.icon?(e.openBlock(),e.createElementBlock("svg",Ru,[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:k(l.icon)},null,8,Fu)])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["to","class","variant","color","size","squircle","disabled","role"]))}}),ut=Ou;ut.Item=Va;const Zu={class:"accui-p-2 accui-border-b"},Gu=e.defineComponent({__name:"VirtualList",props:{items:{},itemHeight:{},containerHeight:{},itemKey:{type:[String,Function],default:"id"},overscan:{default:5}},setup(a,{expose:l}){const t=a,o=e.ref(),E=e.ref(0),b=e.computed(()=>{const r=Math.floor(E.value/t.itemHeight),u=Math.min(r+Math.ceil(t.containerHeight/t.itemHeight),t.items.length-1);return{start:Math.max(0,r-t.overscan),end:Math.min(t.items.length-1,u+t.overscan)}}),f=e.computed(()=>{const{start:r,end:u}=b.value,M=[];for(let $=r;$<=u;$++)M.push({index:$,data:t.items[$],top:$*t.itemHeight});return M}),C=e.computed(()=>t.items.length*t.itemHeight),s=r=>typeof t.itemKey=="function"?t.itemKey(r):r[t.itemKey]||r.id||Math.random();let m=null;const y=r=>{m&&clearTimeout(m),m=setTimeout(()=>{const u=r.target;E.value=u.scrollTop},16)};return e.onUnmounted(()=>{m&&clearTimeout(m)}),l({scrollToItem:(r,u="start")=>{if(!o.value)return;let M=r*t.itemHeight;u==="center"?M-=t.containerHeight/2-t.itemHeight/2:u==="end"&&(M-=t.containerHeight-t.itemHeight),o.value.scrollTop=Math.max(0,M)}}),(r,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollContainer",ref:o,style:e.normalizeStyle({height:a.containerHeight+"px",overflowY:"auto"}),onScroll:y,class:"accui-virtual-list"},[e.createElementVNode("div",{style:e.normalizeStyle({height:C.value+"px",position:"relative"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,M=>(e.openBlock(),e.createElementBlock("div",{key:s(M.data),style:e.normalizeStyle({position:"absolute",top:M.top+"px",left:0,right:0,height:a.itemHeight+"px"})},[e.renderSlot(r.$slots,"default",{item:M.data,index:M.index},()=>[e.createElementVNode("div",Zu,e.toDisplayString(JSON.stringify(M.data)),1)],!0)],4))),128))],4)],36))}}),Yu=S._export_sfc(Gu,[["__scopeId","data-v-1561f0b5"]]),Wu=()=>{},Qu={class:"accui-component-scope"},Xu={class:"mfa-setup-header"},Ju={class:"mfa-setup-status-container"},e3={class:"mfa-setup-content"},t3={key:0,class:"mfa-setup-loading"},a3={key:1,class:"mfa-setup-sections"},o3={key:0,class:"mfa-setup-status-alert"},n3={class:"mfa-setup-status-content"},l3={class:"mfa-setup-status-icon"},s3={class:"mfa-setup-methods-grid"},r3={class:"mfa-setup-method-content"},i3={class:"mfa-setup-method-icon mfa-setup-totp-icon"},c3={class:"mfa-setup-method-content"},d3={class:"mfa-setup-method-icon mfa-setup-email-icon"},u3={key:1,class:"mfa-setup-manage-section"},m3={class:"mfa-setup-manage-header"},p3={class:"mfa-setup-manage-description"},f3={class:"mfa-setup-footer"},v3=e.defineComponent({__name:"StrandsMFASetup",props:{show:{type:Boolean,default:!1}},emits:["success","error","close"],setup(a,{emit:l}){const t={props:{size:{type:[String,Number],default:24}},render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.h("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})])}},o={props:{size:{type:[String,Number],default:24}},render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"m4 4 16 0c1.1 0 2 .9 2 2l0 12c0 1.1-.9 2-2 2l-16 0c-1.1 0-2-.9-2-2l0-12c0-1.1.9-2 2-2z"}),e.h("polyline",{points:"22,6 12,13 2,6"})])}},E={props:{size:{type:[String,Number],default:24}},render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"})])}},b={props:{size:{type:[String,Number],default:24}},render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),e.h("circle",{cx:"12",cy:"12",r:"3"})])}},f=a,C=l,{mfaEnabled:s,loading:m,activeMfaDevices:y,fetchMfaDevices:k}=Ye(),r=e.computed({get:()=>f.show,set:D=>{D||C("close")}}),u=e.ref(!1),M=e.ref(!1),$=e.ref(!1),p=e.ref(!1);e.watch(()=>f.show,async D=>{D&&await k()}),e.onMounted(async()=>{f.show&&await k()});const T=()=>{C("close")},v=()=>{u.value=!0},x=()=>{M.value=!0},I=()=>{p.value=!0},w=async()=>{u.value=!1,M.value=!1,$.value=!1,await k(),C("success")},h=async()=>{await k()};return(D,L)=>(e.openBlock(),e.createElementBlock("div",Qu,[e.createVNode(_e,{modelValue:r.value,"onUpdate:modelValue":L[0]||(L[0]=g=>r.value=g),"card-class":"mfa-setup-modal"},{header:e.withCtx(()=>[e.createElementVNode("div",Xu,[L[5]||(L[5]=e.createElementVNode("div",null,[e.createElementVNode("h2",{class:"mfa-setup-title"},"Two-Factor Authentication"),e.createElementVNode("p",{class:"mfa-setup-subtitle"},"Add extra security to your account")],-1)),e.createElementVNode("div",Ju,[e.createElementVNode("span",{class:e.normalizeClass(["mfa-setup-status-badge",e.unref(s)||e.unref(y).length>0?"mfa-setup-status-enabled":"mfa-setup-status-disabled"])},e.toDisplayString(e.unref(s)||e.unref(y).length>0?"Enabled":"Not Enabled"),3)])])]),footer:e.withCtx(()=>[e.createElementVNode("div",f3,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:T,disabled:e.unref(m)},{default:e.withCtx(()=>[...L[15]||(L[15]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"])])]),default:e.withCtx(()=>[e.createElementVNode("div",e3,[e.unref(m)?(e.openBlock(),e.createElementBlock("div",t3,[e.createVNode(e.unref(S.StrandsUiLoader),{size:32}),L[6]||(L[6]=e.createElementVNode("span",{class:"mfa-setup-loading-text"},"Loading MFA settings...",-1))])):(e.openBlock(),e.createElementBlock("div",a3,[e.unref(s)||e.unref(y).length>0?(e.openBlock(),e.createElementBlock("div",o3,[e.createElementVNode("div",n3,[e.createElementVNode("div",l3,[e.createVNode(E,{size:20,class:"mfa-setup-shield-icon"})]),L[7]||(L[7]=e.createElementVNode("div",null,[e.createElementVNode("span",{class:"mfa-setup-status-title"},"2FA is currently enabled on your account"),e.createElementVNode("p",{class:"mfa-setup-status-description"},"Your account has additional security protection")],-1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[L[12]||(L[12]=e.createElementVNode("h3",{class:"mfa-setup-methods-title"},"Choose Your Authentication Method",-1)),e.createElementVNode("div",s3,[e.createElementVNode("div",{class:"mfa-setup-method-card",onClick:v},[e.createElementVNode("div",r3,[e.createElementVNode("div",i3,[e.createVNode(t,{size:28,class:"mfa-setup-icon-svg"})]),L[9]||(L[9]=e.createElementVNode("div",{class:"mfa-setup-method-info"},[e.createElementVNode("h4",{class:"mfa-setup-method-title"},"Authenticator App"),e.createElementVNode("p",{class:"mfa-setup-method-description"},"Use Google Authenticator, Authy, or any TOTP-compatible app to generate secure codes")],-1)),e.createVNode(e.unref(ee),{variant:"primary",size:"md",onClick:e.withModifiers(v,["stop"]),disabled:e.unref(m),class:"mfa-setup-method-button"},{default:e.withCtx(()=>[...L[8]||(L[8]=[e.createTextVNode(" Setup Authenticator ",-1)])]),_:1},8,["disabled"])])]),e.createElementVNode("div",{class:"mfa-setup-method-card",onClick:x},[e.createElementVNode("div",c3,[e.createElementVNode("div",d3,[e.createVNode(o,{size:28,class:"mfa-setup-icon-svg"})]),L[11]||(L[11]=e.createElementVNode("div",{class:"mfa-setup-method-info"},[e.createElementVNode("h4",{class:"mfa-setup-method-title"},"Email Verification"),e.createElementVNode("p",{class:"mfa-setup-method-description"},"Receive verification codes directly in your email inbox for easy access")],-1)),e.createVNode(e.unref(ee),{variant:"primary",size:"md",onClick:e.withModifiers(x,["stop"]),disabled:e.unref(m),class:"mfa-setup-method-button"},{default:e.withCtx(()=>[...L[10]||(L[10]=[e.createTextVNode(" Setup Email 2FA ",-1)])]),_:1},8,["disabled"])])])])]),e.unref(y).length>0?(e.openBlock(),e.createElementBlock("div",u3,[e.createElementVNode("div",m3,[e.createElementVNode("div",null,[L[13]||(L[13]=e.createElementVNode("h3",{class:"mfa-setup-manage-title"},"Manage Existing Methods",-1)),e.createElementVNode("p",p3,e.toDisplayString(e.unref(y).length)+" device(s) currently active",1)]),e.createVNode(e.unref(ee),{variant:"secondary",size:"md",onClick:I,disabled:e.unref(m)},{default:e.withCtx(()=>[e.createVNode(b,{size:16,class:"mfa-setup-manage-icon"}),L[14]||(L[14]=e.createTextVNode(" Manage Devices ",-1))]),_:1},8,["disabled"])])])):e.createCommentVNode("",!0)]))])]),_:1},8,["modelValue"]),u.value?(e.openBlock(),e.createBlock(Ot,{key:0,show:u.value,onClose:L[1]||(L[1]=g=>u.value=!1),onSuccess:w},null,8,["show"])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createBlock(Rt,{key:1,show:M.value,onClose:L[2]||(L[2]=g=>M.value=!1),onSuccess:w},null,8,["show"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createBlock($t,{key:2,show:$.value,onClose:L[3]||(L[3]=g=>$.value=!1),onSuccess:w},null,8,["show"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(Ft,{key:3,show:p.value,onClose:L[4]||(L[4]=g=>p.value=!1),onMfaUpdated:h},null,8,["show"])):e.createCommentVNode("",!0)]))}}),h3=S._export_sfc(v3,[["__scopeId","data-v-5e4af8e5"]]);function rt(){const{config:a}=Se.useStrandsConfig(),{currentSession:l,refreshToken:t,getAuthHeaders:o}=Ie.useStrandsAuth(),E=async(y,k={})=>{const{autoRefresh:r=!0,requireAuth:u=!0,baseURL:M,...$}=k;if(u&&!l.value?.accessToken)throw new Error("User is not authenticated");let p=y;const T=M||a.value.baseUrl;T&&typeof y=="string"&&!y.startsWith("http")&&(p=new URL(y,T).toString());const v=new Headers($.headers);if(l.value?.accessToken)try{const w=o();Object.entries(w).forEach(([h,D])=>{v.set(h,D)})}catch(w){if(console.warn("[Strands Auth] Failed to get auth headers:",w),u)throw w}const x={...$,headers:v};let I=await fetch(p,x);if(I.status===401&&r&&l.value?.refreshToken)try{if(await t()&&l.value?.accessToken){const h=o();Object.entries(h).forEach(([D,L])=>{v.set(D,L)}),I=await fetch(p,{...x,headers:v})}}catch(w){console.error("[Strands Auth] Token refresh failed:",w)}return I};return{authenticatedFetch:E,get:(y,k)=>E(y,{...k,method:"GET"}),post:(y,k,r)=>{const u=new Headers(r?.headers);return k&&typeof k=="object"&&!u.has("Content-Type")&&u.set("Content-Type","application/json"),E(y,{...r,method:"POST",headers:u,body:typeof k=="object"?JSON.stringify(k):k})},put:(y,k,r)=>{const u=new Headers(r?.headers);return k&&typeof k=="object"&&!u.has("Content-Type")&&u.set("Content-Type","application/json"),E(y,{...r,method:"PUT",headers:u,body:typeof k=="object"?JSON.stringify(k):k})},delete:(y,k)=>E(y,{...k,method:"DELETE"}),patch:(y,k,r)=>{const u=new Headers(r?.headers);return k&&typeof k=="object"&&!u.has("Content-Type")&&u.set("Content-Type","application/json"),E(y,{...r,method:"PATCH",headers:u,body:typeof k=="object"?JSON.stringify(k):k})}}}const C3={get:async(a,l)=>{const{get:t}=rt();return t(a,l)},post:async(a,l,t)=>{const{post:o}=rt();return o(a,l,t)},put:async(a,l,t)=>{const{put:o}=rt();return o(a,l,t)},delete:async(a,l)=>{const{delete:t}=rt();return t(a,l)},patch:async(a,l,t)=>{const{patch:o}=rt();return o(a,l,t)}},g3=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),y3=a=>{const l=[];let t=0;a.length<8?l.push("Password must be at least 8 characters long"):t+=1,/[A-Z]/.test(a)?t+=1:l.push("Password must contain at least one uppercase letter"),/[a-z]/.test(a)?t+=1:l.push("Password must contain at least one lowercase letter"),/\d/.test(a)?t+=1:l.push("Password must contain at least one number"),/[!@#$%^&*(),.?":{}|<>]/.test(a)?t+=1:l.push("Password must contain at least one special character");const o=l.length===0;let E="weak";return t>=4?E="strong":t>=3&&(E="medium"),{isValid:o,strength:E,errors:l}},k3=a=>a.trim().length>=2,w3=a=>a.trim().length>0,V3=(a,l)=>a===l,N3=(a,l)=>{const t=a?.charAt(0).toUpperCase()||"",o=l?.charAt(0).toUpperCase()||"";return t+o||"U"},E3=a=>(typeof a=="string"?new Date(a):a).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),b3=(a,l)=>{let t;return(...o)=>{clearTimeout(t),t=setTimeout(()=>a(...o),l)}};exports.StrandsUIPlugin=S.StrandsUIPlugin;exports.StrandsUiAlert=S.StrandsUiAlert;exports.StrandsUiCard=S.StrandsUiCard;exports.StrandsUiDivider=S.UiDivider;exports.StrandsUiInput=S.StrandsUiInput;exports.StrandsUiLink=S.StrandsUiLink;exports.StrandsUiLoader=S.StrandsUiLoader;exports.StrandsUiTabs=S.StrandsUiTabs;exports.StrandsUiTooltip=S.UiTooltip;exports.UiAlert=S.StrandsUiAlert;exports.UiCard=S.StrandsUiCard;exports.UiDivider=S.UiDivider;exports.UiInput=S.StrandsUiInput;exports.UiLink=S.StrandsUiLink;exports.UiLoader=S.StrandsUiLoader;exports.UiTabs=S.StrandsUiTabs;exports.UiTooltip=S.UiTooltip;exports.useFloatingPosition=S.useFloatingPosition;exports.provideStrandsConfig=Se.provideStrandsConfig;exports.setStrandsConfig=Se.setStrandsConfig;exports.useStrandsConfig=Se.useStrandsConfig;exports.useStrandsAuth=Ie.useStrandsAuth;exports.$authFetch=C3;exports.IconGithub=va;exports.IconGoogle=fa;exports.SignedIn=wa;exports.StrandsAuth=pa;exports.StrandsBackupCodesModal=ha;exports.StrandsCompleteSignUp=c1;exports.StrandsConfigProvider=vu;exports.StrandsConfirmModal=Ca;exports.StrandsEmailMfaSetupModal=Rt;exports.StrandsHardwareKeySetupModal=$t;exports.StrandsLogo=pt;exports.StrandsMFASetup=h3;exports.StrandsMfaModal=Ft;exports.StrandsMfaVerification=jt;exports.StrandsNav=ut;exports.StrandsNavItem=Va;exports.StrandsPasswordReset=uu;exports.StrandsSecuredFooter=Ge;exports.StrandsSessionsModal=ya;exports.StrandsSettingsModal=ga;exports.StrandsSignIn=pi;exports.StrandsSignUp=Zi;exports.StrandsTotpSetupModal=Ot;exports.StrandsUiApp=Jt;exports.StrandsUiAvatarEditor=Tt;exports.StrandsUiButton=ee;exports.StrandsUiCheckboxGroup=ua;exports.StrandsUiColorPicker=na;exports.StrandsUiHero=sa;exports.StrandsUiLevelProgress=mt;exports.StrandsUiModal=_e;exports.StrandsUiPill=ma;exports.StrandsUiRadioGroup=da;exports.StrandsUiSlider=ca;exports.StrandsUiTable=la;exports.StrandsUiThemeToggle=ia;exports.StrandsUiToggle=Mt;exports.StrandsUserButton=Pu;exports.StrandsUserProfile=ka;exports.SvgIcon=Cu;exports.UiApp=Jt;exports.UiAvatarEditor=Tt;exports.UiAvatarEditorSimple=Tt;exports.UiButton=ee;exports.UiCheckboxGroup=ua;exports.UiColorPicker=na;exports.UiHero=sa;exports.UiLevelProgress=mt;exports.UiModal=_e;exports.UiPill=ma;exports.UiRadioGroup=da;exports.UiSlider=ca;exports.UiTable=la;exports.UiThemeToggle=ia;exports.UiToggle=Mt;exports.VirtualList=Yu;exports.debounce=b3;exports.formatDate=E3;exports.getInitials=N3;exports.isRequired=w3;exports.isValidEmail=g3;exports.isValidName=k3;exports.passwordsMatch=V3;exports.preloadCriticalComponents=Wu;exports.tailwindColors=aa;exports.useAuthenticatedFetch=rt;exports.useGlobalModalStack=Mo;exports.useModalStack=ta;exports.useModalTeleport=So;exports.useOAuthProviders=At;exports.useTheme=ra;exports.validatePassword=y3;
5
+ `),x=new Blob([v],{type:"text/plain"}),I=URL.createObjectURL(x),w=document.createElement("a");w.href=I,w.download=T,document.body.appendChild(w),w.click(),document.body.removeChild(w),URL.revokeObjectURL(I)};return($,p)=>(e.openBlock(),e.createElementBlock("div",sc,[e.createVNode(_e,{modelValue:C.value,"onUpdate:modelValue":p[1]||(p[1]=T=>C.value=T),title:"Backup Codes","card-class":"backup-codes-modal"},{default:e.withCtx(()=>[e.unref(b)?(e.openBlock(),e.createElementBlock("div",rc,[e.createVNode(e.unref(S.StrandsUiLoader),{size:24}),p[2]||(p[2]=e.createElementVNode("span",{class:"backup-codes-loading-text"},"Loading backup codes...",-1))])):(e.openBlock(),e.createElementBlock("div",ic,[a.device?(e.openBlock(),e.createElementBlock("div",cc,[e.createElementVNode("div",dc,[p[3]||(p[3]=e.createElementVNode("span",{class:"backup-codes-device-icon"},"📱",-1)),e.createElementVNode("div",null,[e.createElementVNode("h3",uc,e.toDisplayString(a.device.device_name),1),e.createElementVNode("p",mc,e.toDisplayString(e.unref(f)(a.device.device_type)),1)])])])):e.createCommentVNode("",!0),p[14]||(p[14]=e.createElementVNode("div",{class:"backup-codes-warning"},[e.createElementVNode("div",{class:"backup-codes-warning-content"},[e.createElementVNode("svg",{class:"backup-codes-warning-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})]),e.createElementVNode("div",null,[e.createElementVNode("p",{class:"backup-codes-warning-title"},"Important Security Information"),e.createElementVNode("ul",{class:"backup-codes-warning-list"},[e.createElementVNode("li",null,"• Each backup code can only be used once"),e.createElementVNode("li",null,"• Store these codes in a safe place"),e.createElementVNode("li",null,"• Use backup codes if you lose access to your authenticator"),e.createElementVNode("li",null,"• Regenerating codes will invalidate all previous codes")])])])],-1)),s.value.length>0?(e.openBlock(),e.createElementBlock("div",pc,[p[6]||(p[6]=e.createElementVNode("h3",{class:"backup-codes-section-title"},"Your Backup Codes",-1)),e.createElementVNode("div",fc,[e.createElementVNode("div",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(T,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"backup-codes-code-item"},e.toDisplayString(T),1))),128))])]),e.createElementVNode("div",hc,[e.createVNode(e.unref(ee),{variant:"secondary",size:"sm",onClick:u},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createTextVNode(" 📋 Copy All Codes ",-1)])]),_:1}),e.createVNode(e.unref(ee),{variant:"secondary",size:"sm",onClick:M},{default:e.withCtx(()=>[...p[5]||(p[5]=[e.createTextVNode(" 💾 Download ",-1)])]),_:1})])])):e.createCommentVNode("",!0),e.createElementVNode("div",Cc,[e.createElementVNode("div",gc,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:k,disabled:e.unref(b),loading:e.unref(b)},{default:e.withCtx(()=>[...p[7]||(p[7]=[e.createTextVNode(" 🔄 Regenerate Codes ",-1)])]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(ee),{variant:"primary",onClick:y},{default:e.withCtx(()=>[...p[8]||(p[8]=[e.createTextVNode(" Done ",-1)])]),_:1})])]),m.value?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",kc,[p[13]||(p[13]=e.createElementVNode("svg",{class:"backup-codes-regenerate-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)),e.createElementVNode("div",null,[p[11]||(p[11]=e.createElementVNode("p",{class:"backup-codes-regenerate-title"},"Regenerate Backup Codes?",-1)),p[12]||(p[12]=e.createElementVNode("p",{class:"backup-codes-regenerate-description"}," This will invalidate all current backup codes. Make sure to save the new ones. ",-1)),e.createElementVNode("div",wc,[e.createVNode(e.unref(ee),{variant:"primary",size:"sm",onClick:r,disabled:e.unref(b),loading:e.unref(b)},{default:e.withCtx(()=>[...p[9]||(p[9]=[e.createTextVNode(" Yes, Regenerate ",-1)])]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(ee),{variant:"secondary",size:"sm",onClick:p[0]||(p[0]=T=>m.value=!1)},{default:e.withCtx(()=>[...p[10]||(p[10]=[e.createTextVNode(" Cancel ",-1)])]),_:1})])])])])):e.createCommentVNode("",!0)]))]),_:1},8,["modelValue"])]))}}),ha=S._export_sfc(Vc,[["__scopeId","data-v-0d97d17e"]]),Nc={class:"accui-component-scope"},Ec={class:"confirm-modal-title"},bc={class:"confirm-modal-message"},xc={class:"confirm-modal-actions"},Bc=e.defineComponent({__name:"StrandsConfirmModal",props:{show:{type:Boolean},title:{},message:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},variant:{default:"primary"}},emits:["confirm","cancel"],setup(a,{emit:l}){const t=a,o=l,E=e.ref(!1),b=e.computed({get:()=>t.show,set:s=>{s||o("cancel")}}),f=()=>{E.value=!0,o("confirm")},C=()=>{o("cancel")};return(s,m)=>(e.openBlock(),e.createElementBlock("div",Nc,[e.createVNode(_e,{modelValue:b.value,"onUpdate:modelValue":m[0]||(m[0]=y=>b.value=y),"card-class":"confirm-modal"},{header:e.withCtx(()=>[e.createElementVNode("h2",Ec,e.toDisplayString(a.title),1)]),default:e.withCtx(()=>[e.createElementVNode("p",bc,e.toDisplayString(a.message),1),e.createElementVNode("div",xc,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:C,disabled:E.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.cancelText),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(ee),{variant:a.variant,onClick:f,disabled:E.value,loading:E.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.confirmText),1)]),_:1},8,["variant","disabled","loading"])])]),_:1},8,["modelValue"])]))}}),Ca=S._export_sfc(Bc,[["__scopeId","data-v-52537e14"]]),Sc={class:"mfa-content"},Mc={key:0,class:"mfa-loading"},$c={key:1,class:"mfa-sections"},Tc={class:"mfa-status-overview"},Ac={class:"mfa-status-content"},_c={class:"mfa-status-subtitle"},zc={class:"mfa-status-badges"},Dc={key:0,class:"mfa-status-badge mfa-status-badge-enabled"},Ic={key:1,class:"mfa-status-badge mfa-status-badge-disabled"},Lc={key:0,class:"mfa-add-devices"},Uc={class:"mfa-device-options"},Hc={class:"mfa-device-option"},Pc={class:"mfa-device-option-content"},jc={class:"mfa-device-option-icon"},Oc={class:"mfa-device-option"},Rc={class:"mfa-device-option-content"},Fc={class:"mfa-device-option-icon"},qc={class:"mfa-device-option"},Kc={class:"mfa-device-option-content"},Zc={class:"mfa-device-option-icon"},Gc={class:"mfa-device-option"},Yc={class:"mfa-device-option-content"},Wc={class:"mfa-device-option-icon"},Qc={key:1,class:"mfa-manage-devices"},Xc={key:0,class:"mfa-empty-state"},Jc={class:"mfa-empty-icon"},e2={key:1,class:"mfa-devices-list"},t2={class:"mfa-device-header"},a2={class:"mfa-device-info"},o2={class:"mfa-device-icon"},n2={class:"mfa-device-name"},l2={class:"mfa-device-meta"},s2={class:"mfa-device-actions"},r2={key:0,class:"mfa-device-warning"},i2={class:"mfa-warning-content"},c2={class:"mfa-warning-icon"},d2={key:1,class:"mfa-device-backup"},u2=e.defineComponent({__name:"StrandsMfaModal",props:{modelValue:{type:Boolean}},emits:["update:modelValue","mfa-updated"],setup(a,{emit:l}){const t=a,o=l,{mfaEnabled:E,loading:b,activeMfaDevices:f,fetchMfaDevices:C,disableMfaDevice:s,sendEmailMfaCode:m}=Ye(),y={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.h("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})])}},k={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"m4 4 16 0c1.1 0 2 .9 2 2l0 12c0 1.1-.9 2-2 2l-16 0c-1.1 0-2-.9-2-2l0-12c0-1.1.9-2 2-2z"}),e.h("polyline",{points:"22,6 12,13 2,6"})])}},r={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}),e.h("circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"})])}},u={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M2 12C2 6.5 6.5 2 12 2a10 10 0 0 1 8 4"}),e.h("path",{d:"M5 19.5C5.5 18 6 15 6 12c0-.7.12-1.37.34-2"}),e.h("path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02"}),e.h("path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"}),e.h("path",{d:"M8.65 22c.21-.66.45-1.32.57-2"}),e.h("path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88"}),e.h("path",{d:"M2 16h.01"}),e.h("path",{d:"M21.8 16c.2-2 .131-5.354 0-6"}),e.h("path",{d:"M9 6.8a6 6 0 0 1 9 5.2c0 .47 0 1.17-.02 2"})])}},M={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"})])}},$={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),e.h("path",{d:"M12 9v4"}),e.h("path",{d:"m12 17 .01 0"})])}},p=e.ref("add"),T=e.reactive({}),v=e.reactive({}),x=e.ref(!1),I=e.ref(!1),w=e.ref(!1),h=e.ref(!1),D=e.computed({get:()=>t.modelValue||!1,set:ue=>o("update:modelValue",ue)}),L=e.computed(()=>{const ue=[{label:"Add Device",value:"add"}];return f.value&&f.value.length>0&&ue.push({label:"Manage Devices",value:"manage"}),ue});e.watch(()=>f.value,ue=>{ue&&ue.length>0&&p.value==="add"&&(p.value="manage")}),e.onMounted(async()=>{await C()});const g=async ue=>{try{T[ue.id]=!0,await m(ue.id)}catch(W){console.error("Failed to send email MFA code:",W)}finally{T[ue.id]=!1}},N=async ue=>{try{v[ue.id]=!0,await s(ue.id),await C(),o("mfa-updated")}catch(W){console.error("Failed to remove device:",W)}finally{v[ue.id]=!1}},Z=async()=>{await C(),p.value="manage",o("mfa-updated")},J=async()=>{await C(),p.value="manage",o("mfa-updated")},ie=async()=>{await C(),p.value="manage",o("mfa-updated")},me=async()=>{await C(),p.value="manage",o("mfa-updated")},ve=ue=>({totp:"Authenticator App",email:"Email Verification",hardware:"Hardware Key",passkey:"Passkey"})[ue]||ue,fe=ue=>{if(!ue)return"Unknown";const W=new Date(ue),U=new Date().getTime()-W.getTime(),Q=Math.floor(U/(1e3*60)),K=Math.floor(U/(1e3*60*60)),j=Math.floor(U/(1e3*60*60*24));return Q<1?"Just now":Q<60?`${Q}m ago`:K<24?`${K}h ago`:j<7?`${j}d ago`:j<30?`${Math.floor(j/7)}w ago`:j<365?`${Math.floor(j/30)}mo ago`:`${Math.floor(j/365)}y ago`};return(ue,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(_e),{modelValue:D.value,"onUpdate:modelValue":W[6]||(W[6]=O=>D.value=O),title:"Two-Factor Authentication","card-class":"mfa-modal-card"},{default:e.withCtx(()=>[e.createElementVNode("div",Sc,[e.unref(b)?(e.openBlock(),e.createElementBlock("div",Mc,[e.createVNode(e.unref(S.StrandsUiLoader),{size:32}),W[11]||(W[11]=e.createElementVNode("span",{class:"mfa-loading-text"},"Loading MFA settings...",-1))])):(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("div",Tc,[e.createElementVNode("div",Ac,[e.createElementVNode("div",null,[W[12]||(W[12]=e.createElementVNode("h3",{class:"mfa-status-title"},"Two-Factor Authentication",-1)),e.createElementVNode("p",_c,e.toDisplayString(e.unref(E)?"Enabled":"Add extra security to your account"),1)]),e.createElementVNode("div",zc,[e.unref(E)?(e.openBlock(),e.createElementBlock("span",Dc,[e.createVNode(M,{size:12,class:"mfa-badge-icon"}),W[13]||(W[13]=e.createTextVNode(" Enabled ",-1))])):(e.openBlock(),e.createElementBlock("span",Ic," Not Enabled "))])])]),e.createVNode(e.unref(S.StrandsUiTabs),{modelValue:p.value,"onUpdate:modelValue":W[5]||(W[5]=O=>p.value=O),tabs:L.value,"tab-width":"fit"},{content:e.withCtx(({activeTab:O})=>[O?.value==="add"?(e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("div",null,[W[22]||(W[22]=e.createElementVNode("h3",{class:"mfa-section-title"},"Choose Your Authentication Method",-1)),e.createElementVNode("div",Uc,[e.createElementVNode("div",Hc,[e.createElementVNode("div",Pc,[e.createElementVNode("div",jc,[e.createVNode(y,{size:24})]),W[14]||(W[14]=e.createElementVNode("div",{class:"mfa-device-option-info"},[e.createElementVNode("h4",{class:"mfa-device-option-title"},"Authenticator App"),e.createElementVNode("p",{class:"mfa-device-option-description"},"Use apps like Google Authenticator, or Authy")],-1))]),e.createVNode(e.unref(ee),{variant:"outline",size:"sm",onClick:W[0]||(W[0]=U=>x.value=!0)},{default:e.withCtx(()=>[...W[15]||(W[15]=[e.createTextVNode(" Setup ",-1)])]),_:1})]),e.createElementVNode("div",Oc,[e.createElementVNode("div",Rc,[e.createElementVNode("div",Fc,[e.createVNode(k,{size:24})]),W[16]||(W[16]=e.createElementVNode("div",{class:"mfa-device-option-info"},[e.createElementVNode("h4",{class:"mfa-device-option-title"},"Email Verification"),e.createElementVNode("p",{class:"mfa-device-option-description"},"Receive verification codes via email")],-1))]),e.createVNode(e.unref(ee),{variant:"outline",size:"sm",onClick:W[1]||(W[1]=U=>I.value=!0)},{default:e.withCtx(()=>[...W[17]||(W[17]=[e.createTextVNode(" Setup ",-1)])]),_:1})]),e.createElementVNode("div",qc,[e.createElementVNode("div",Kc,[e.createElementVNode("div",Zc,[e.createVNode(r,{size:24})]),W[18]||(W[18]=e.createElementVNode("div",{class:"mfa-device-option-info"},[e.createElementVNode("h4",{class:"mfa-device-option-title"},"Hardware Key"),e.createElementVNode("p",{class:"mfa-device-option-description"},"Use a physical security key (YubiKey, etc.)")],-1))]),e.createVNode(e.unref(ee),{variant:"outline",size:"sm",onClick:W[2]||(W[2]=U=>w.value=!0)},{default:e.withCtx(()=>[...W[19]||(W[19]=[e.createTextVNode(" Setup ",-1)])]),_:1})]),e.createElementVNode("div",Gc,[e.createElementVNode("div",Yc,[e.createElementVNode("div",Wc,[e.createVNode(u,{size:24})]),W[20]||(W[20]=e.createElementVNode("div",{class:"mfa-device-option-info"},[e.createElementVNode("h4",{class:"mfa-device-option-title"},"Passkey"),e.createElementVNode("p",{class:"mfa-device-option-description"},"Use biometric authentication or device PIN")],-1))]),e.createVNode(e.unref(ee),{variant:"outline",size:"sm",onClick:W[3]||(W[3]=U=>h.value=!0)},{default:e.withCtx(()=>[...W[21]||(W[21]=[e.createTextVNode(" Setup ",-1)])]),_:1})])])])])):O?.value==="manage"?(e.openBlock(),e.createElementBlock("div",Qc,[e.unref(f).length===0?(e.openBlock(),e.createElementBlock("div",Xc,[e.createElementVNode("div",Jc,[e.createVNode(M,{size:48})]),W[24]||(W[24]=e.createElementVNode("h3",{class:"mfa-empty-title"},"No MFA Devices",-1)),W[25]||(W[25]=e.createElementVNode("p",{class:"mfa-empty-description"},"You haven't set up any multi-factor authentication devices yet.",-1)),e.createVNode(e.unref(ee),{onClick:W[4]||(W[4]=U=>p.value="add"),variant:"primary"},{default:e.withCtx(()=>[...W[23]||(W[23]=[e.createTextVNode(" Add First Device ",-1)])]),_:1})])):(e.openBlock(),e.createElementBlock("div",e2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),U=>(e.openBlock(),e.createElementBlock("div",{key:U.id,class:"mfa-device-card"},[e.createElementVNode("div",t2,[e.createElementVNode("div",a2,[e.createElementVNode("div",o2,[U.device_type==="totp"?(e.openBlock(),e.createBlock(y,{key:0,size:20})):U.device_type==="email"?(e.openBlock(),e.createBlock(k,{key:1,size:20})):U.device_type==="hardware"?(e.openBlock(),e.createBlock(r,{key:2,size:20})):U.device_type==="passkey"?(e.openBlock(),e.createBlock(u,{key:3,size:20})):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[e.createElementVNode("h4",n2,e.toDisplayString(U.name||ve(U.device_type)),1),e.createElementVNode("p",l2,"Added "+e.toDisplayString(fe(U.created_at)),1)])]),e.createElementVNode("div",s2,[U.device_type==="email"&&!U.verified?(e.openBlock(),e.createBlock(e.unref(ee),{key:0,variant:"outline",size:"xs",onClick:Q=>g(U),disabled:T[U.id]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T[U.id]?"Sending...":"Test"),1)]),_:2},1032,["onClick","disabled"])):e.createCommentVNode("",!0),e.createVNode(Ca,{title:`Remove ${ve(U.device_type)}?`,message:`Are you sure you want to remove this ${ve(U.device_type).toLowerCase()}? You will no longer be able to use it for authentication.`,"confirm-text":"Remove Device","confirm-variant":"danger",onConfirm:Q=>N(U)},{trigger:e.withCtx(()=>[e.createVNode(e.unref(ee),{variant:"ghost",size:"xs",disabled:v[U.id]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v[U.id]?"Removing...":"Remove"),1)]),_:2},1032,["disabled"])]),_:2},1032,["title","message","onConfirm"])])]),U.device_type==="email"&&!U.verified?(e.openBlock(),e.createElementBlock("div",r2,[e.createElementVNode("div",i2,[e.createElementVNode("div",c2,[e.createVNode($,{size:16})]),W[26]||(W[26]=e.createElementVNode("span",{class:"mfa-warning-text"},"Email not verified - click Test to verify",-1))])])):e.createCommentVNode("",!0),U.backup_codes&&U.backup_codes.length>0?(e.openBlock(),e.createElementBlock("div",d2,[e.createVNode(ha,{device:U},{trigger:e.withCtx(()=>[e.createVNode(e.unref(ee),{variant:"outline",size:"xs"},{default:e.withCtx(()=>[...W[27]||(W[27]=[e.createTextVNode(" View Backup Codes ",-1)])]),_:1})]),_:1},8,["device"])])):e.createCommentVNode("",!0)]))),128))]))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","tabs"])]))])]),_:1},8,["modelValue"]),e.createVNode(Ot,{show:x.value,onSuccess:Z,onClose:W[7]||(W[7]=O=>x.value=!1)},null,8,["show"]),e.createVNode(Rt,{show:I.value,onSuccess:J,onClose:W[8]||(W[8]=O=>I.value=!1)},null,8,["show"]),e.createVNode($t,{show:w.value,"device-type":"hardware",onSuccess:ie,onClose:W[9]||(W[9]=O=>w.value=!1)},null,8,["show"]),e.createVNode($t,{show:h.value,"device-type":"passkey",onSuccess:me,onClose:W[10]||(W[10]=O=>h.value=!1)},null,8,["show"])],64))}}),Ft=S._export_sfc(u2,[["__scopeId","data-v-64c9f1a1"]]),m2={class:"accui-component-scope"},p2={class:"settings-content"},f2={class:"settings-section"},v2={class:"settings-option"},h2={class:"settings-option-content"},C2={class:"settings-option-controls"},g2={key:0,class:"preview-icon",fill:"currentColor",viewBox:"0 0 24 24"},y2={key:1,class:"preview-icon",fill:"currentColor",viewBox:"0 0 24 24"},k2={class:"settings-option"},w2={class:"settings-option-content"},V2={class:"settings-option-controls"},N2={key:0,class:"preview-icon",fill:"currentColor",viewBox:"0 0 24 24"},E2={key:1,class:"preview-icon",fill:"currentColor",viewBox:"0 0 24 24"},b2={class:"settings-footer"},x2=e.defineComponent({__name:"StrandsSettingsModal",props:{open:{type:Boolean,default:!1}},emits:["close","settings-updated"],setup(a,{emit:l}){const t=l,{currentUser:o,updateUserSettings:E}=Ie.useStrandsAuth(),b=e.ref(!1),f=e.ref(null),C=e.reactive({levelUpSounds:o.value?.settings?.levelUpSounds??!0,milestoneSounds:o.value?.settings?.milestoneSounds??!0});e.watch(()=>o.value?.settings,r=>{r&&(C.levelUpSounds=r.levelUpSounds??!0,C.milestoneSounds=r.milestoneSounds??!0)},{deep:!0});const s=(r,u)=>{C[r]=u},m=()=>{f.value||(f.value="regular",Ht.playLevelUp(5),setTimeout(()=>{f.value==="regular"&&(f.value=null)},800))},y=()=>{f.value||(f.value="milestone",Ht.playLevelUp(50),setTimeout(()=>{f.value==="milestone"&&(f.value=null)},2500))},k=async r=>{if(!b.value){b.value=!0;try{await E({...o.value?.settings,...C}),t("settings-updated",{...C})}catch(u){console.warn("Failed to save settings:",u)}finally{b.value=!1,r()}}};return(r,u)=>(e.openBlock(),e.createElementBlock("div",m2,[e.createVNode(_e,{onClose:r.onClose,title:"Account Settings","card-class":"max-w-lg"},e.createSlots({footer:e.withCtx(({handleClose:M})=>[e.createElementVNode("div",b2,[e.createVNode(S.StrandsUiButton,{variant:"secondary",onClick:M},{default:e.withCtx(()=>[...u[11]||(u[11]=[e.createTextVNode(" Close ",-1)])]),_:1},8,["onClick"]),e.createVNode(S.StrandsUiButton,{variant:"primary",onClick:$=>k(M),loading:b.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.value?"Saving...":"Save Settings"),1)]),_:1},8,["onClick","loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",p2,[e.createElementVNode("div",f2,[u[10]||(u[10]=e.createElementVNode("h3",{class:"settings-section-title"},"Audio Preferences",-1)),e.createElementVNode("div",v2,[e.createElementVNode("div",h2,[u[6]||(u[6]=e.createElementVNode("div",{class:"settings-option-info"},[e.createElementVNode("label",{for:"level-up-sounds",class:"settings-option-label"}," Level Up Sounds "),e.createElementVNode("p",{class:"settings-option-description"}," Play sound effects when you level up ")],-1)),e.createElementVNode("div",C2,[e.createVNode(S.StrandsUiButton,{variant:"outline",size:"sm",onClick:m,disabled:f.value==="regular","aria-label":f.value==="regular"?"Stop preview":"Play preview",class:"preview-icon-button"},{default:e.withCtx(()=>[f.value!=="regular"?(e.openBlock(),e.createElementBlock("svg",g2,[...u[4]||(u[4]=[e.createElementVNode("path",{d:"M8 5v14l11-7z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",y2,[...u[5]||(u[5]=[e.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12"},null,-1)])]))]),_:1},8,["disabled","aria-label"]),e.createVNode(Mt,{id:"level-up-sounds",modelValue:C.levelUpSounds,"onUpdate:modelValue":[u[0]||(u[0]=M=>C.levelUpSounds=M),u[1]||(u[1]=M=>s("levelUpSounds",M))]},null,8,["modelValue"])])])]),e.createElementVNode("div",k2,[e.createElementVNode("div",w2,[u[9]||(u[9]=e.createElementVNode("div",{class:"settings-option-info"},[e.createElementVNode("label",{for:"milestone-sounds",class:"settings-option-label"}," Milestone Level Sounds "),e.createElementVNode("p",{class:"settings-option-description"}," Play special celebration sounds for milestone levels ")],-1)),e.createElementVNode("div",V2,[e.createVNode(S.StrandsUiButton,{variant:"outline",size:"sm",onClick:y,disabled:f.value==="milestone","aria-label":f.value==="milestone"?"Stop preview":"Play preview",class:"preview-icon-button"},{default:e.withCtx(()=>[f.value!=="milestone"?(e.openBlock(),e.createElementBlock("svg",N2,[...u[7]||(u[7]=[e.createElementVNode("path",{d:"M8 5v14l11-7z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",E2,[...u[8]||(u[8]=[e.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12"},null,-1)])]))]),_:1},8,["disabled","aria-label"]),e.createVNode(Mt,{id:"milestone-sounds",modelValue:C.milestoneSounds,"onUpdate:modelValue":[u[2]||(u[2]=M=>C.milestoneSounds=M),u[3]||(u[3]=M=>s("milestoneSounds",M))]},null,8,["modelValue"])])])])])])]),_:2},[r.$slots.trigger?{name:"trigger",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"trigger",{},void 0,!0)]),key:"0"}:void 0]),1032,["onClose"])]))}}),ga=S._export_sfc(x2,[["__scopeId","data-v-64545f74"]]),B2={class:"strands-sessions-modal"},S2={key:0,class:"sessions-loading"},M2={key:1,class:"sessions-empty"},$2={key:2,class:"sessions-container"},T2={key:0,class:"session-stats"},A2={class:"stat-card"},_2={class:"stat-value"},z2={class:"stat-card"},D2={class:"stat-value"},I2={key:0,class:"stat-card"},L2={class:"stat-value"},U2={class:"sessions-list"},H2={class:"session-header"},P2={class:"session-device-info"},j2={class:"session-device-name"},O2={key:0,class:"session-current-badge"},R2={class:"session-location"},F2={key:0,class:"session-actions"},q2={class:"session-details"},K2={class:"detail-row"},Z2={class:"detail-icon"},G2={class:"detail-text"},Y2={class:"detail-row"},W2={class:"detail-icon"},Q2={class:"detail-text"},X2={class:"detail-row"},J2={class:"detail-icon"},ed={class:"detail-text"},td={class:"detail-row"},ad={class:"detail-icon"},od={class:"detail-text"},nd={key:1,class:"bulk-actions"},ld={key:1},sd=e.defineComponent({__name:"StrandsSessionsModal",props:{modelValue:{type:Boolean}},emits:["update:modelValue","sessions-updated"],setup(a,{emit:l}){const t=a,o=l,{getUserSessions:E,revokeSession:b,revokeAllOtherSessions:f}=Ie.useStrandsAuth(),C={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"}),e.h("circle",{cx:"12",cy:"10",r:"3"})])}},s={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),e.h("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),e.h("line",{x1:"12",y1:"17",x2:"12",y2:"21"})])}},m={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("circle",{cx:"12",cy:"12",r:"10"}),e.h("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),e.h("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})])}},y={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("circle",{cx:"12",cy:"12",r:"10"}),e.h("polyline",{points:"12,6 12,12 16,14"})])}},k={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),e.h("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.h("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.h("line",{x1:"3",y1:"10",x2:"21",y2:"10"})])}},r=e.ref([]),u=e.ref(null),M=e.ref(!1),$=e.ref(null),p=e.reactive({}),T=e.ref(!1),v=e.computed({get:()=>t.modelValue||!1,set:N=>o("update:modelValue",N)});e.watch(()=>v.value,N=>{N&&x()}),e.onMounted(()=>{(typeof t.modelValue>"u"||t.modelValue)&&x()});const x=async()=>{M.value=!0,$.value=null;try{const N=await E();if(r.value=N||[],r.value.length>0){const Z=r.value.filter(ie=>ie.is_current||ie.last_activity_at),J=[...new Set(r.value.map(ie=>D(ie)).filter(Boolean))];u.value={total_sessions:r.value.length,active_sessions:Z.length,unique_locations:J}}else u.value=null}catch(N){$.value=N instanceof Error?N.message:"Failed to load sessions",console.error("Failed to load sessions:",N)}finally{M.value=!1}},I=async N=>{p[N]=!0;try{await b(N),await x(),o("sessions-updated")}catch(Z){console.error("Failed to revoke session:",Z),$.value=Z instanceof Error?Z.message:"Failed to revoke session"}finally{p[N]=!1}},w=async()=>{T.value=!0;try{await f(),await x(),o("sessions-updated")}catch(N){console.error("Failed to revoke all other sessions:",N),$.value=N instanceof Error?N.message:"Failed to revoke sessions"}finally{T.value=!1}},h=N=>{if(N.device_name)return N.device_name;const Z=N.user_agent||"";return Z.includes("Mobile")||Z.includes("Android")||Z.includes("iPhone")?"Mobile Device":Z.includes("iPad")?"iPad":Z.includes("Mac")?"Mac":Z.includes("Windows")?"Windows PC":Z.includes("Linux")?"Linux":"Unknown Device"},D=N=>{const Z=[];return N.city&&Z.push(N.city),N.region&&Z.push(N.region),N.country&&Z.push(N.country),Z.length>0?Z.join(", "):N.ip_address||"Unknown Location"},L=N=>{if(!N)return"Unknown";const Z=new Date(N),ie=new Date().getTime()-Z.getTime(),me=Math.floor(ie/(1e3*60)),ve=Math.floor(ie/(1e3*60*60)),fe=Math.floor(ie/(1e3*60*60*24));return me<1?"Just now":me<60?`${me}m ago`:ve<24?`${ve}h ago`:fe<7?`${fe}d ago`:fe<30?`${Math.floor(fe/7)}w ago`:fe<365?`${Math.floor(fe/30)}mo ago`:`${Math.floor(fe/365)}y ago`},g=N=>N?new Date(N).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Unknown";return(N,Z)=>(e.openBlock(),e.createBlock(e.unref(_e),{modelValue:v.value,"onUpdate:modelValue":Z[0]||(Z[0]=J=>v.value=J),title:"Active Sessions",subtitle:"Manage your active devices"},{default:e.withCtx(()=>[e.createElementVNode("div",B2,[M.value?(e.openBlock(),e.createElementBlock("div",S2,[e.createVNode(e.unref(S.StrandsUiLoader),{size:40}),Z[1]||(Z[1]=e.createElementVNode("p",{class:"loading-text"},"Loading sessions...",-1))])):r.value.length===0?(e.openBlock(),e.createElementBlock("div",M2,[...Z[2]||(Z[2]=[e.createElementVNode("div",{class:"empty-icon"},[e.createElementVNode("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e.createElementVNode("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"}),e.createElementVNode("line",{x1:"8",y1:"14",x2:"12",y2:"14"})])],-1),e.createElementVNode("h3",{class:"empty-title"},"No Active Sessions",-1),e.createElementVNode("p",{class:"empty-description"},"You don't have any active sessions at the moment.",-1)])])):(e.openBlock(),e.createElementBlock("div",$2,[u.value?(e.openBlock(),e.createElementBlock("div",T2,[e.createElementVNode("div",A2,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"stat-label"},"Total Sessions",-1)),e.createElementVNode("span",_2,e.toDisplayString(u.value.total_sessions),1)]),e.createElementVNode("div",z2,[Z[4]||(Z[4]=e.createElementVNode("span",{class:"stat-label"},"Active Devices",-1)),e.createElementVNode("span",D2,e.toDisplayString(u.value.active_sessions),1)]),u.value.unique_locations&&u.value.unique_locations.length>0?(e.openBlock(),e.createElementBlock("div",I2,[Z[5]||(Z[5]=e.createElementVNode("span",{class:"stat-label"},"Locations",-1)),e.createElementVNode("span",L2,e.toDisplayString(u.value.unique_locations.length),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",U2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,J=>(e.openBlock(),e.createElementBlock("div",{key:J.id,class:e.normalizeClass(["session-card",{"current-session":J.is_current}])},[e.createElementVNode("div",H2,[e.createElementVNode("div",P2,[e.createElementVNode("h4",j2,[e.createTextVNode(e.toDisplayString(h(J))+" ",1),J.is_current?(e.openBlock(),e.createElementBlock("span",O2," Current ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",R2,[e.createVNode(C,{size:14}),e.createElementVNode("span",null,e.toDisplayString(D(J)),1)])]),J.is_current?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",F2,[e.createVNode(e.unref(ee),{variant:"outline",size:"xs",onClick:ie=>I(J.id),disabled:p[J.id]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p[J.id]?"Ending...":"End Session"),1)]),_:2},1032,["onClick","disabled"])]))]),e.createElementVNode("div",q2,[e.createElementVNode("div",K2,[e.createElementVNode("span",Z2,[e.createVNode(s,{size:14})]),e.createElementVNode("span",G2,e.toDisplayString(J.user_agent||"Unknown device"),1)]),e.createElementVNode("div",Y2,[e.createElementVNode("span",W2,[e.createVNode(m,{size:14})]),e.createElementVNode("span",Q2,e.toDisplayString(J.ip_address),1)]),e.createElementVNode("div",X2,[e.createElementVNode("span",J2,[e.createVNode(y,{size:14})]),e.createElementVNode("span",ed," Last active "+e.toDisplayString(L(J.last_activity_at||J.created_at)),1)]),e.createElementVNode("div",td,[e.createElementVNode("span",ad,[e.createVNode(k,{size:14})]),e.createElementVNode("span",od," Started "+e.toDisplayString(g(J.created_at)),1)])])],2))),128))]),r.value.length>1?(e.openBlock(),e.createElementBlock("div",nd,[e.createVNode(e.unref(ee),{variant:"outline",onClick:w,disabled:T.value},{default:e.withCtx(()=>[T.value?(e.openBlock(),e.createBlock(e.unref(S.StrandsUiLoader),{key:0,size:16})):(e.openBlock(),e.createElementBlock("span",ld,"End All Other Sessions"))]),_:1},8,["disabled"]),Z[6]||(Z[6]=e.createElementVNode("p",{class:"bulk-actions-hint"}," This will sign you out on all other devices ",-1))])):e.createCommentVNode("",!0)]))])]),_:1},8,["modelValue"]))}}),ya=S._export_sfc(sd,[["__scopeId","data-v-1958a7a9"]]),rd={class:"accui-component-scope"},id={class:"profile-content-layout"},cd={class:"profile-image-section"},dd={class:"profile-image-container"},ud={class:"profile-image-wrapper"},md={key:0,class:"profile-avatar profile-avatar-with-image"},pd=["src","alt"],fd={key:1,class:"profile-avatar profile-avatar-initials"},vd=["disabled"],hd={key:1,class:"profile-upload-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Cd={class:"profile-form-grid"},gd={class:"profile-section"},yd={class:"profile-setting-card"},kd={class:"profile-setting-header"},wd={class:"profile-setting-subtitle"},Vd={key:0,class:"profile-change-form"},Nd={class:"profile-field-section"},Ed={class:"profile-field-header"},bd={class:"profile-field-subtitle"},xd={key:0,class:"profile-change-form"},Bd={class:"profile-password-section"},Sd={class:"profile-field-section"},Md={class:"profile-field-header"},$d={class:"profile-field-subtitle"},Td={key:0,class:"profile-change-form"},Ad={class:"profile-field-section"},_d={class:"profile-field-header profile-field-header-vertical"},zd={class:"profile-mfa-content"},Dd={class:"profile-field-subtitle"},Id={key:0,class:"profile-mfa-chips"},Ld={class:"profile-field-section"},Ud={class:"profile-field-header"},Hd={class:"profile-field-subtitle"},Pd={key:0},jd={key:1},Od={class:"profile-field-actions"},Rd={key:0,class:"profile-actions-section"},Fd={key:0,class:"animate-fade-in"},qd={class:"alert-success"},Kd={class:"profile-help-item"},Zd={class:"profile-alert-message"},Gd={key:1,class:"animate-fade-in"},Yd={class:"alert-error"},Wd={class:"profile-help-item"},Qd={class:"profile-alert-message"},Xd={class:"profile-footer-actions"},Jd={key:0},eu={class:"profile-footer-text"},tu={key:0,class:"profile-avatar-modal-overlay"},au={class:"profile-avatar-modal"},ou={class:"profile-avatar-modal-content"},nu=e.defineComponent({__name:"StrandsUserProfile",props:{user:{},config:{},autoFetch:{type:Boolean,default:!0},inModal:{type:Boolean,default:!1}},emits:["profile-updated","error","manage-sessions","mfa-toggle"],setup(a,{emit:l}){const t={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.h("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})])}},o={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"m4 4 16 0c1.1 0 2 .9 2 2l0 12c0 1.1-.9 2-2 2l-16 0c-1.1 0-2-.9-2-2l0-12c0-1.1.9-2 2-2z"}),e.h("polyline",{points:"22,6 12,13 2,6"})])}},E={props:["size"],render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}),e.h("circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"})])}},b=a,f=l,{getSupportEmail:C,getUrl:s}=Se.useStrandsConfig(b.config),{fetchProfile:m,updateProfile:y,changeEmail:k,changeUsername:r,getUsernameCooldown:u,checkUsernameAvailability:M,getUserSessions:$,currentUser:p,currentSession:T,isAuthenticated:v,refreshToken:x,signOut:I}=Ie.useStrandsAuth(),{activeMfaDevices:w,fetchMfaDevices:h}=Ye(),D=e.ref(null),L=e.ref(!1),g=e.computed(()=>p.value||b.user||D.value),N=e.ref(!1),Z=e.ref(!1),J=e.ref(!1),ie=e.ref(!1),me=e.ref(!1),ve=e.ref(!1),fe=e.ref(!1),ue=e.ref(!1),W=e.ref(!1),O=e.ref(!1),U=e.ref(!1),Q=e.ref(null),K=e.ref(""),j=e.ref(""),Y=e.ref([]),he=e.ref(!1),Ce=e.reactive({canChange:!0,cooldownEnd:null,daysRemaining:0}),ke=e.reactive({available:!1,message:"",checking:!1}),pe=e.ref(),X=e.reactive({firstName:"",lastName:"",email:""}),ae=e.reactive({newEmail:"",password:"",errors:{newEmail:"",password:""}}),ye=e.reactive({current:"",new:"",confirm:""}),H=e.reactive({username:"",errors:{username:""}}),se=e.reactive({firstName:"",lastName:"",email:""}),R=e.computed(()=>{const F=g.value;return F?X.firstName!==(F.firstName||"")||X.lastName!==(F.lastName||""):!1}),ne=e.computed(()=>ye.current&&ye.new&&ye.confirm&&ye.new===ye.confirm&&ye.new.length>=8),oe=e.computed(()=>ae.newEmail&&ae.password&&ae.newEmail!==g.value?.email&&ae.newEmail.includes("@")),we=e.computed(()=>{const F=/^[a-zA-Z0-9_-]{3,30}$/;return H.username&&F.test(H.username)&&H.username!==g.value?.username&&!ke.checking}),Ve=e.computed(()=>{const F=g.value;if(!F)return"Never";const _=F.passwordUpdatedAt||F.createdAt;if(!_)return"Never";const de=new Date(_),ot=new Date().getTime()-de.getTime(),$e=Math.floor(ot/(1e3*60*60*24));if($e===0)return"Today";if($e===1)return"Yesterday";if($e<30)return`${$e} days ago`;if($e<365){const Re=Math.floor($e/30);return Re===1?"1 month ago":`${Re} months ago`}const Le=Math.floor($e/365);return Le===1?"1 year ago":`${Le} years ago`}),Ee=e.computed(()=>{const F=w.value||[],_={totp:0,email:0,hardware:0,passkey:0};return F.forEach(de=>{de.device_type in _&&_[de.device_type]++}),_}),Pe=e.computed(()=>{const F=[],_=Ee.value;if(_.totp>0&&F.push({type:"totp",count:_.totp,label:_.totp===1?"Auth app":"Auth apps",icon:t,color:"chip-blue"}),_.email>0&&F.push({type:"email",count:_.email,label:"Email",icon:o,color:"chip-green"}),_.hardware>0||_.passkey>0){const de=_.hardware+_.passkey;F.push({type:"hardware",count:de,label:de===1?"Key":"Keys",icon:E,color:"chip-purple"})}return F}),Ne=F=>{if(F<=1)return 0;let _=0;for(let de=1;de<F;de++)_+=4*de+Math.pow(1.5,de/4);return Math.floor(_)},Je=F=>{let _=1;for(;;){const de=Ne(_+1);if(F<de||(_++,_>1e3))break}return _},Te=e.computed(()=>Je(g.value?.xp||0)),ft=e.computed(()=>{const F=Te.value,_=Ne(F);return(g.value?.xp||0)-_}),Me=e.computed(()=>{const F=Te.value,_=Ne(F);return Ne(F+1)-_}),vt=e.computed(()=>Math.round(ft.value/Me.value*100)),et=e.computed(()=>2*Math.PI*54),ht=e.computed(()=>vt.value/100*et.value);e.computed(()=>{const F=et.value*5/360;return et.value-ht.value-F});const Ct=(F,_)=>!F&&!_?"U":`${F?.[0]||""}${_?.[0]||""}`.toUpperCase(),je=async()=>{if(!(!b.autoFetch||b.user||!v.value)){L.value=!0;try{await m(),v.value&&await h()}catch(F){console.error("Failed to load profile:",F);const _=F instanceof Error?F.message:"Failed to load profile";j.value=_,f("error",_)}finally{L.value=!1}}},ze=async()=>{if(v.value){he.value=!0;try{const F=await $();Y.value=F||[]}catch(F){console.warn("Failed to load sessions (non-critical):",F)}finally{he.value=!1}}};e.watch(()=>g.value,F=>{F&&(X.firstName=F.firstName||"",X.lastName=F.lastName||"",X.email=F.email)},{immediate:!0}),e.watch(()=>v.value,(F,_)=>{F&&!_?setTimeout(()=>{ze()},500):F||(Y.value=[])},{immediate:!1}),e.watch(()=>T.value,F=>{F&&v.value&&setTimeout(()=>{ze()},100)}),e.onMounted(()=>{je(),ze()});const De=()=>{K.value="",j.value="",Object.keys(se).forEach(F=>{se[F]=""})},We=async()=>{De(),N.value=!0;try{const F=await y({firstName:X.firstName,lastName:X.lastName});F&&(K.value="Profile updated successfully",f("profile-updated",F))}catch(F){console.error("Failed to update profile:",F);const _=F instanceof Error?F.message:"Failed to update profile";j.value=_,f("error",_)}finally{N.value=!1}},Qe=async()=>{if(ne.value){De(),N.value=!0;try{await new Promise(F=>setTimeout(F,1e3)),K.value="Password updated successfully",ie.value=!1,ye.current="",ye.new="",ye.confirm=""}catch(F){console.error("Failed to update password:",F),j.value="Failed to update password"}finally{N.value=!1}}},Xe=async()=>{if(oe.value){ae.errors.newEmail="",ae.errors.password="",De(),ve.value=!0;try{const F=await k(ae.newEmail,ae.password);K.value=F.message||"Email updated successfully. Please verify your new email address.",me.value=!1,ae.newEmail="",ae.password="",g.value&&f("profile-updated",g.value)}catch(F){console.error("Failed to update email:",F);const _=F instanceof Error?F.message:"Failed to update email";_.includes("password")?ae.errors.password="Invalid password":_.includes("email")?ae.errors.newEmail=_:j.value=_,f("error",_)}finally{ve.value=!1}}},gt=async()=>{if(fe.value)fe.value=!1,H.username="",H.errors.username="",ke.available=!1,ke.message="";else{ue.value=!0;try{const F=await u();Ce.canChange=F.can_change,Ce.cooldownEnd=F.cooldown_end?new Date(F.cooldown_end):null,Ce.daysRemaining=F.days_remaining||0,Ce.canChange?(fe.value=!0,H.username=g.value?.username||""):j.value=`You can change your username again in ${Ce.daysRemaining} days`}catch(F){console.error("Failed to check username cooldown:",F),j.value="Failed to check username cooldown",fe.value=!0}finally{ue.value=!1}}},_t=async()=>{if(!we.value){if(!/^[a-zA-Z0-9_-]{3,30}$/.test(H.username)){H.errors.username="Username must be 3-30 characters and contain only letters, numbers, hyphens, and underscores";return}ke.checking=!0,ke.message="Checking availability...";try{const _=await M(H.username);if(ke.available=_.available,ke.message=_.message,!_.available){H.errors.username="Username is not available";return}}catch(_){console.error("Failed to check username availability:",_),H.errors.username="Failed to check username availability";return}finally{ke.checking=!1}}De(),ue.value=!0;try{const F=await r(H.username);K.value=F.message||"Username updated successfully",fe.value=!1,H.username="",H.errors.username="",ke.available=!1,ke.message="",g.value&&f("profile-updated",g.value)}catch(F){console.error("Failed to update username:",F);const _=F instanceof Error?F.message:"Failed to update username";_.includes("taken")?H.errors.username="Username is already taken":_.includes("cooldown")||_.includes("30 days")?(j.value=_,fe.value=!1):H.errors.username=_,f("error",_)}finally{ue.value=!1}},yt=()=>{Z.value||pe.value?.click()},kt=F=>{const _=F.target,de=_.files?.[0];if(de){if(!de.type.startsWith("image/")){j.value="Please select an image file";return}if(de.size>5*1024*1024){j.value="File size must be less than 5MB";return}Q.value=de,W.value=!0}_&&(_.value="")},wt=async F=>{await Vt(F),W.value=!1,Q.value=null},Fe=F=>{j.value=F},qe=()=>{W.value=!1,Q.value=null},Vt=async F=>{Z.value=!0,De();try{const _=new FormData;_.append("avatar",F);const de={};T.value?.accessToken&&(de.Authorization=`Bearer ${T.value.accessToken}`);const Oe=await fetch(s("avatar"),{method:"POST",body:_,headers:de});if(!Oe.ok)if(Oe.status===401)try{if(await x()&&T.value?.accessToken){const Le=await fetch(s("avatar"),{method:"POST",body:_,headers:{Authorization:`Bearer ${T.value.accessToken}`}});if(!Le.ok){const nt=await Le.json().catch(()=>({}));throw new Error(nt.message||`Upload failed: ${Le.status} ${Le.statusText}`)}const Re=await Le.json();p.value&&(p.value.avatar=Re.avatar_url,typeof window<"u"&&localStorage.setItem("strands_auth_user",JSON.stringify(p.value))),D.value&&(D.value.avatar=Re.avatar_url);try{await m()}catch{}K.value="Avatar updated successfully",g.value&&f("profile-updated",g.value);return}else throw new Error("Authentication expired. Please sign in again.")}catch{throw new Error("Authentication expired. Please sign in again.")}else{const $e=await Oe.json().catch(()=>({}));throw new Error($e.message||`Upload failed: ${Oe.status} ${Oe.statusText}`)}const ot=await Oe.json();p.value&&(p.value.avatar=ot.avatar_url,typeof window<"u"&&localStorage.setItem("strands_auth_user",JSON.stringify(p.value))),D.value&&(D.value.avatar=ot.avatar_url);try{await m()}catch{}K.value="Avatar updated successfully",g.value&&f("profile-updated",g.value)}catch(_){console.error("Failed to upload avatar:",_);const de=_ instanceof Error?_.message:"Failed to upload avatar";j.value=de,f("error",de)}finally{Z.value=!1}},Nt=async()=>{try{await m(),await h(),K.value="MFA settings updated successfully",f("mfa-toggle",g.value?.mfaEnabled||!1)}catch(F){console.warn("Failed to refresh profile after MFA update:",F)}},tt=()=>{K.value="Settings updated successfully"},at=()=>{ze()},Et=()=>{const F=g.value;F&&(X.firstName=F.firstName||"",X.lastName=F.lastName||"",X.email=F.email),De(),ie.value=!1,me.value=!1,ye.current="",ye.new="",ye.confirm="",ae.newEmail="",ae.password="",ae.errors.newEmail="",ae.errors.password=""},bt=async()=>{J.value=!0,De();try{await I(),K.value="Signed out successfully"}catch(F){console.error("Failed to sign out:",F);const _=F instanceof Error?F.message:"Failed to sign out";j.value=_,f("error",_),J.value=!1}};return e.onMounted(async()=>{if(g.value&&v.value)try{const F=await u();Ce.canChange=F.can_change,Ce.cooldownEnd=F.cooldown_end?new Date(F.cooldown_end):null,Ce.daysRemaining=F.days_remaining||0}catch(F){console.warn("Failed to fetch username cooldown:",F)}}),(F,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",rd,[e.createVNode(e.unref(S.StrandsUiCard),{variant:a.inModal?"simple":"modern",color:a.inModal?"default":"secondary",class:e.normalizeClass(a.inModal?"profile-container-modal profile-container-width":"profile-container profile-container-width profile-max-width profile-centered profile-animated")},{default:e.withCtx(()=>[e.createElementVNode("div",id,[_[30]||(_[30]=e.createElementVNode("div",{class:"profile-header"},[e.createElementVNode("h1",{class:"profile-title"},"Profile Settings"),e.createElementVNode("p",{class:"profile-subtitle"},"Manage your account information and preferences")],-1)),e.createElementVNode("div",cd,[e.createElementVNode("div",dd,[e.createElementVNode("div",ud,[e.createVNode(e.unref(mt),{size:140,value:g.value?.xp||0,max:g.value?.next_level_xp||1,level:g.value?.level||0,"level-label":`LEVEL ${g.value?.level||0}`,"user-settings":g.value?.settings,class:"profile-progress-ring"},null,8,["value","max","level","level-label","user-settings"]),g.value?.avatar?(e.openBlock(),e.createElementBlock("div",md,[e.createElementVNode("img",{src:g.value.avatar,alt:`${g.value.firstName} ${g.value.lastName}`,class:"profile-avatar-image",width:"120",height:"120"},null,8,pd)])):(e.openBlock(),e.createElementBlock("div",fd,e.toDisplayString(Ct(g.value?.firstName,g.value?.lastName)),1)),e.createElementVNode("button",{class:"profile-upload-overlay",onClick:yt,disabled:Z.value},[Z.value?(e.openBlock(),e.createBlock(e.unref(S.StrandsUiLoader),{key:0,size:24,variant:"spinner"})):(e.openBlock(),e.createElementBlock("svg",hd,[..._[14]||(_[14]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"},null,-1),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 616 0z"},null,-1)])]))],8,vd)])]),e.createElementVNode("input",{ref_key:"avatarFileInput",ref:pe,type:"file",accept:"image/*",class:"profile-file-input",onChange:kt},null,544)]),e.createElementVNode("form",{onSubmit:e.withModifiers(We,["prevent"]),class:"profile-form"},[e.createElementVNode("div",Cd,[e.createElementVNode("div",gd,[_[17]||(_[17]=e.createElementVNode("h3",{class:"profile-section-title"},"Personal Information",-1)),e.createVNode(e.unref(S.StrandsUiInput),{id:"firstName",modelValue:X.firstName,"onUpdate:modelValue":_[0]||(_[0]=de=>X.firstName=de),type:"text",label:"First name",placeholder:"Enter your first name",autocomplete:"given-name",disabled:N.value||L.value,error:se.firstName},null,8,["modelValue","disabled","error"]),e.createVNode(e.unref(S.StrandsUiInput),{id:"lastName",modelValue:X.lastName,"onUpdate:modelValue":_[1]||(_[1]=de=>X.lastName=de),type:"text",label:"Last name",placeholder:"Enter your last name",autocomplete:"family-name",disabled:N.value||L.value,error:se.lastName},null,8,["modelValue","disabled","error"]),e.createElementVNode("div",yd,[e.createElementVNode("div",kd,[e.createElementVNode("div",null,[_[15]||(_[15]=e.createElementVNode("h4",{class:"profile-setting-title"},"Email Address",-1)),e.createElementVNode("p",wd,e.toDisplayString(g.value?.email),1)]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:_[2]||(_[2]=de=>me.value=!me.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(me.value?"Cancel":"Change"),1)]),_:1})]),e.createVNode(e.Transition,{name:"expand"},{default:e.withCtx(()=>[me.value?(e.openBlock(),e.createElementBlock("div",Vd,[e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ae.newEmail,"onUpdate:modelValue":_[3]||(_[3]=de=>ae.newEmail=de),type:"email",placeholder:"New email address",autocomplete:"email",error:ae.errors.newEmail},null,8,["modelValue","error"]),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ae.password,"onUpdate:modelValue":_[4]||(_[4]=de=>ae.password=de),type:"password",placeholder:"Current password",autocomplete:"current-password",error:ae.errors.password},null,8,["modelValue","error"]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:Xe,disabled:!oe.value||ve.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ve.value?"Updating...":"Update Email"),1)]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",Nd,[e.createElementVNode("div",Ed,[e.createElementVNode("div",null,[_[16]||(_[16]=e.createElementVNode("h4",{class:"profile-field-title"},"Username",-1)),e.createElementVNode("p",bd,e.toDisplayString(g.value?.username||"No username set"),1)]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",disabled:!Ce.canChange||ue.value,onClick:gt},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ce.cooldownEnd?`Wait ${Ce.daysRemaining} day${Ce.daysRemaining===1?"":"s"} to change`:fe.value?"Cancel":g.value?.username?"Change":"Set Username"),1)]),_:1},8,["disabled"])]),e.createVNode(e.Transition,{name:"expand"},{default:e.withCtx(()=>[fe.value?(e.openBlock(),e.createElementBlock("div",xd,[e.createVNode(e.unref(S.StrandsUiInput),{modelValue:H.username,"onUpdate:modelValue":_[5]||(_[5]=de=>H.username=de),type:"text",placeholder:"Enter username (3-30 characters)",autocomplete:"username",error:H.errors.username},null,8,["modelValue","error"]),ke.message?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["profile-availability-message",ke.available?"success":"error"])},e.toDisplayString(ke.message),3)):e.createCommentVNode("",!0),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:_t,disabled:!we.value||ue.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ue.value?"Updating...":"Update Username"),1)]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),_:1})])]),e.createElementVNode("div",Bd,[_[23]||(_[23]=e.createElementVNode("h3",{class:"profile-section-title"},"Security Settings",-1)),e.createElementVNode("div",Sd,[e.createElementVNode("div",Md,[e.createElementVNode("div",null,[_[18]||(_[18]=e.createElementVNode("h4",{class:"profile-field-title"},"Password",-1)),e.createElementVNode("p",$d,"Last updated "+e.toDisplayString(Ve.value),1)]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:_[6]||(_[6]=de=>ie.value=!ie.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ie.value?"Cancel":"Change"),1)]),_:1})]),e.createVNode(e.Transition,{name:"expand"},{default:e.withCtx(()=>[ie.value?(e.openBlock(),e.createElementBlock("div",Td,[e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ye.current,"onUpdate:modelValue":_[7]||(_[7]=de=>ye.current=de),type:"password",placeholder:"Current password",autocomplete:"current-password"},null,8,["modelValue"]),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ye.new,"onUpdate:modelValue":_[8]||(_[8]=de=>ye.new=de),type:"password",placeholder:"New password",autocomplete:"new-password"},null,8,["modelValue"]),e.createVNode(e.unref(S.StrandsUiInput),{modelValue:ye.confirm,"onUpdate:modelValue":_[9]||(_[9]=de=>ye.confirm=de),type:"password",placeholder:"Confirm new password",autocomplete:"new-password"},null,8,["modelValue"]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",onClick:Qe,disabled:!ne.value},{default:e.withCtx(()=>[..._[19]||(_[19]=[e.createTextVNode(" Update Password ",-1)])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),_:1})]),e.createElementVNode("div",Ad,[e.createElementVNode("div",_d,[e.createElementVNode("div",zd,[e.createElementVNode("div",null,[_[20]||(_[20]=e.createElementVNode("h4",{class:"profile-field-title"},"Two-Factor Authentication",-1)),e.createElementVNode("p",Dd,e.toDisplayString(g.value?.mfaEnabled?"Enabled":"Add extra security to your account"),1)]),Pe.value.length>0?(e.openBlock(),e.createElementBlock("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,de=>(e.openBlock(),e.createElementBlock("div",{key:de.type,class:e.normalizeClass(["mfa-device-chip",de.color])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(de.icon),{size:12})),e.createElementVNode("span",null,e.toDisplayString(de.count),1),e.createElementVNode("span",null,e.toDisplayString(de.label),1)],2))),128))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(ee),{color:"secondary",size:"sm",class:"profile-toggle-container",onClick:_[10]||(_[10]=de=>O.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value?.mfaEnabled?"Manage":"Setup"),1)]),_:1})])]),e.createElementVNode("div",Ld,[e.createElementVNode("div",Ud,[e.createElementVNode("div",null,[_[21]||(_[21]=e.createElementVNode("h4",{class:"profile-field-title"},"Active Sessions",-1)),e.createElementVNode("p",Hd,[he.value?(e.openBlock(),e.createElementBlock("span",Pd,"Loading sessions...")):(e.openBlock(),e.createElementBlock("span",jd,e.toDisplayString(Y.value.length)+" active device"+e.toDisplayString(Y.value.length!==1?"s":""),1))])]),e.createElementVNode("div",Od,[e.createVNode(e.unref(ee),{color:"secondary",size:"sm",disabled:he.value,onClick:_[11]||(_[11]=de=>U.value=!0)},{default:e.withCtx(()=>[..._[22]||(_[22]=[e.createTextVNode(" Manage ",-1)])]),_:1},8,["disabled"])])])])])]),R.value?(e.openBlock(),e.createElementBlock("div",Rd,[e.createVNode(e.unref(ee),{type:"submit",disabled:N.value,loading:N.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.value?"Saving changes...":"Save changes"),1)]),_:1},8,["disabled","loading"]),e.createVNode(e.unref(ee),{color:"secondary",onClick:Et,disabled:N.value},{default:e.withCtx(()=>[..._[24]||(_[24]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)],32),K.value?(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("div",qd,[e.createElementVNode("div",Kd,[_[25]||(_[25]=e.createElementVNode("svg",{class:"profile-help-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.236 4.53L7.53 10.173a.75.75 0 00-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"})],-1)),e.createElementVNode("p",Zd,e.toDisplayString(K.value),1)])])])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("div",Gd,[e.createElementVNode("div",Yd,[e.createElementVNode("div",Wd,[_[26]||(_[26]=e.createElementVNode("svg",{class:"profile-help-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"})],-1)),e.createElementVNode("p",Qd,e.toDisplayString(j.value),1)])])])):e.createCommentVNode("",!0),e.createVNode(Ge,{config:b.config},{default:e.withCtx(()=>[e.createElementVNode("div",Xd,[e.createVNode(e.unref(ee),{color:"danger",onClick:bt,disabled:J.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(J.value?"Signing out...":"Sign Out"),1)]),_:1},8,["disabled"]),e.createVNode(ga,{onSettingsUpdated:tt},{trigger:e.withCtx(()=>[e.createVNode(e.unref(ee),{color:"secondary",icon:""},{icon:e.withCtx(()=>[..._[27]||(_[27]=[e.createElementVNode("svg",{class:"profile-action-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)])]),_:1})]),_:1})]),e.unref(C)()?(e.openBlock(),e.createElementBlock("div",Jd,[e.createElementVNode("p",eu,[_[29]||(_[29]=e.createTextVNode(" Need help? ",-1)),e.createVNode(e.unref(S.StrandsUiLink),{variant:"primary",href:`mailto:${e.unref(C)()}`},{default:e.withCtx(()=>[..._[28]||(_[28]=[e.createTextVNode(" Contact Support ",-1)])]),_:1},8,["href"])])])):e.createCommentVNode("",!0)]),_:1},8,["config"])]),W.value?(e.openBlock(),e.createElementBlock("div",tu,[e.createElementVNode("div",au,[e.createElementVNode("div",ou,[e.createElementVNode("div",{class:"profile-avatar-modal-header"},[_[32]||(_[32]=e.createElementVNode("h2",{class:"profile-modal-title"},"Edit Avatar",-1)),e.createElementVNode("button",{onClick:qe,class:"profile-avatar-modal-close"},[..._[31]||(_[31]=[e.createElementVNode("svg",{class:"profile-avatar-modal-close-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),e.createVNode(e.unref(Tt),{uploading:Z.value,"preselected-file":Q.value,onUpload:wt,onError:Fe},null,8,["uploading","preselected-file"])])])])):e.createCommentVNode("",!0)]),_:1},8,["variant","color","class"])]),e.createVNode(Ft,{modelValue:O.value,"onUpdate:modelValue":_[12]||(_[12]=de=>O.value=de),onMfaUpdated:Nt},null,8,["modelValue"]),e.createVNode(ya,{modelValue:U.value,"onUpdate:modelValue":_[13]||(_[13]=de=>U.value=de),onSessionsUpdated:at},null,8,["modelValue"])],64))}}),ka=S._export_sfc(nu,[["__scopeId","data-v-9430e3ba"]]),lu={class:"accui-component-scope"},su={class:"accui-w-full accui-min-w-100 accui-max-w-md accui-mx-auto accui-animate-slide-up"},ru={class:"accui-mt-8 accui-text-center"},iu={key:0,class:"accui-mt-6 accui-text-center"},cu={class:"accui-text-neutral-400 accui-text-sm"},du=e.defineComponent({__name:"StrandsPasswordReset",props:{config:{}},emits:["success","error","back-to-signin"],setup(a,{emit:l}){const t=a,o=l,{getSupportEmail:E}=Se.useStrandsConfig(t.config),b=e.ref(!1),f=e.ref(""),C=e.ref(!1),s=e.reactive({email:""}),m=async()=>{b.value=!0,f.value="";try{await new Promise(y=>setTimeout(y,1e3)),C.value=!0,o("success",s.email)}catch{f.value="Failed to send password reset email. Please try again.",o("error",f.value)}finally{b.value=!1}};return(y,k)=>(e.openBlock(),e.createElementBlock("div",lu,[e.createElementVNode("div",su,[e.createVNode(e.unref(S.StrandsUiCard),{variant:"modern",color:"secondary"},{default:e.withCtx(()=>[k[6]||(k[6]=e.createElementVNode("div",{class:"accui-text-center accui-mb-8"},[e.createElementVNode("h1",{class:"accui-text-3xl accui-font-bold accui-text-gradient accui-mb-2"},"Reset password"),e.createElementVNode("p",{class:"accui-text-neutral-600"},"Enter your email address and we'll send you a link to reset your password")],-1)),e.createElementVNode("form",{onSubmit:e.withModifiers(m,["prevent"]),class:"accui-space-y-6"},[e.createVNode(e.unref(S.StrandsUiInput),{id:"email",modelValue:s.email,"onUpdate:modelValue":k[0]||(k[0]=r=>s.email=r),type:"email",label:"Email address",placeholder:"Enter your email address",autocomplete:"email",required:"",disabled:b.value||C.value,error:f.value?"Email address not found":void 0},null,8,["modelValue","disabled","error"]),e.createVNode(e.unref(ee),{type:"submit",variant:"primary","full-width":"",disabled:b.value||!s.email.trim()||C.value,loading:b.value,"loading-text":"Sending link..."},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.value?"Link sent!":"Send reset link"),1)]),_:1},8,["disabled","loading"])],32),C.value?(e.openBlock(),e.createBlock(e.unref(S.StrandsUiAlert),{key:0,variant:"success",message:`Check your email - We've sent a password reset link to ${s.email}`,class:"accui-mt-6 accui-animate-fade-in"},null,8,["message"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(e.unref(S.StrandsUiAlert),{key:1,variant:"error",message:f.value,class:"accui-mt-6 accui-animate-fade-in",dismissible:"",onDismiss:k[1]||(k[1]=r=>f.value="")},null,8,["message"])):e.createCommentVNode("",!0),e.createElementVNode("div",ru,[e.createVNode(e.unref(S.StrandsUiLink),{onClick:k[2]||(k[2]=r=>y.$emit("back-to-signin")),class:"accui-inline-flex accui-items-center accui-gap-2"},{default:e.withCtx(()=>[...k[3]||(k[3]=[e.createElementVNode("svg",{class:"accui-w-4 accui-h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),e.createTextVNode(" Back to sign in ",-1)])]),_:1})]),e.createVNode(Ge,{config:t.config},{default:e.withCtx(()=>[e.unref(E)()?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("p",cu,[k[5]||(k[5]=e.createTextVNode(" Need help? ",-1)),e.createVNode(e.unref(S.StrandsUiLink),{variant:"primary",href:`mailto:${e.unref(E)()}`},{default:e.withCtx(()=>[...k[4]||(k[4]=[e.createTextVNode(" Contact Support ",-1)])]),_:1},8,["href"])])])):e.createCommentVNode("",!0)]),_:1},8,["config"])]),_:1})])]))}}),uu=S._export_sfc(du,[["__scopeId","data-v-d5af9f1c"]]),mu={key:1,class:"animate-fade-in"},pu={key:2,class:"animate-fade-in"},fu=e.defineComponent({__name:"SignedIn",props:{showFallback:{type:Boolean,default:!0},inline:{type:Boolean,default:!1}},emits:["sign-in-required"],setup(a,{emit:l}){const t=l,{isAuthenticated:o,isInitializing:E,user:b,signOut:f}=Ie.useStrandsAuth(),C=typeof window<"u",s=e.computed(()=>!C||E.value),m=e.computed(()=>!s.value&&o.value),y=e.computed(()=>!s.value&&!o.value),k=()=>{t("sign-in-required")};return(r,u)=>m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["animate-fade-in",a.inline?"is_inline":""])},[e.renderSlot(r.$slots,"default",{user:e.unref(b),signOut:e.unref(f)},void 0,!0)],2)):y.value&&a.showFallback?(e.openBlock(),e.createElementBlock("div",mu,[e.renderSlot(r.$slots,"fallback",{signIn:k},()=>[e.createElementVNode("div",{class:"signed-in-fallback"},[u[0]||(u[0]=e.createStaticVNode('<div class="signed-in-icon-container" data-v-0094f02a><svg class="signed-in-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-0094f02a><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" data-v-0094f02a></path></svg></div><h3 class="signed-in-title" data-v-0094f02a>Sign in required</h3><p class="signed-in-subtitle" data-v-0094f02a>You need to be signed in to access this content.</p>',3)),e.createElementVNode("button",{onClick:k,class:"signed-in-button"}," Sign in ")])],!0)])):s.value?(e.openBlock(),e.createElementBlock("div",pu,[e.renderSlot(r.$slots,"loading",{},()=>[e.createVNode(e.unref(S.StrandsUiLoader),{size:30,variant:"circle","show-particles":!0})],!0)])):e.createCommentVNode("",!0)}}),wa=S._export_sfc(fu,[["__scopeId","data-v-0094f02a"]]),vu=e.defineComponent({__name:"StrandsConfigProvider",props:{config:{}},setup(a){const l=a;return e.onMounted(()=>{Se.provideStrandsConfig(l.config)}),Se.provideStrandsConfig(l.config),(t,o)=>e.renderSlot(t.$slots,"default")}}),hu=["fill","stroke","viewBox","aria-hidden"],Cu=e.defineComponent({__name:"SvgIcon",props:{name:{},class:{default:""},size:{default:"md"},fill:{default:"none"},stroke:{default:"currentColor"},ariaHidden:{type:Boolean,default:!0}},setup(a){const l=a,t={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"},o=e.computed(()=>`${t[l.size]} ${l.class}`),E=e.computed(()=>"0 0 24 24"),b={eye:()=>e.h("g",[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"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"})]),"eye-slash":()=>e.h("g",[e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"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.878 9.878L3 3m6.878 6.878L21 21"})]),camera:()=>e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0710.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),"chevron-left":()=>e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}),loading:()=>e.h("g",[e.h("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.h("path",{class:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]),"check-circle":()=>e.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.236 4.53L7.53 10.173a.75.75 0 00-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"}),"x-circle":()=>e.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"}),lock:()=>e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"}),user:()=>e.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"}),google:()=>e.h("g",{fill:"currentColor"},[e.h("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.h("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.h("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.h("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]),github:()=>e.h("path",{"fill-rule":"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z","clip-rule":"evenodd"})},f=e.computed(()=>{const C=b[l.name];return C?C():e.h("path",{d:""})});return(C,s)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(o.value),fill:a.fill,stroke:a.stroke,viewBox:E.value,"aria-hidden":a.ariaHidden},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.value)))],10,hu))}}),gu=["onKeydown","aria-expanded"],yu={class:"mini-profile-avatar-container"},ku=["src","alt","width","height"],wu={key:1,class:"mini-profile-avatar-default"},Vu={class:"mini-profile-content"},Nu={class:"mini-profile-name"},Eu={class:"mini-profile-email"},bu=["src","alt","width","height"],xu={key:1,class:"avatar-default"},Bu={key:0},Su=["onKeydown"],Mu={class:"dropdown-content"},$u={key:0,class:"dropdown-header"},Tu={key:0,class:"dropdown-avatar-container"},Au=["src","alt"],_u={key:1,class:"dropdown-avatar-default"},zu={class:"dropdown-user-details"},Du={class:"dropdown-user-name"},Iu={class:"dropdown-user-email"},Lu={key:1,class:"dropdown-divider"},Uu={class:"sign-in-auth-wrapper"},Hu=e.defineComponent({__name:"StrandsUserButton",props:{hideUser:{type:Boolean,default:!1},variant:{default:"minimal"},size:{default:"md"},redirectUrl:{default:"/"},user:{default:void 0},menuAlign:{default:"right"},menuVerticalAlign:{default:"bottom"},fullWidth:{type:Boolean,default:!1}},emits:["profile-updated","signed-out","signed-in"],setup(a,{emit:l}){const t=a,o=l,{currentUser:E,signOut:b,isAuthenticated:f}=Ie.useStrandsAuth(),C=e.ref(!1),s=e.ref(!1),m=e.ref(!1),y=e.ref(),k=e.ref(),r=e.ref(),u=e.computed(()=>k.value),{floatingStyle:M,updatePosition:$}=S.useFloatingPosition({trigger:u,floating:r,placement:"bottom-end",offset:8,shift:!0,flip:!0,autoUpdate:!0,clickOutside:{enabled:!0,handler:()=>h()}}),p=e.computed(()=>{if(t.variant==="mini-profile")switch(t.size){case"sm":return 32;case"md":return 44;case"lg":return 56;default:return 44}switch(t.size){case"sm":return 24;case"md":return 32;case"lg":return 40;default:return 32}}),T=e.computed(()=>{switch(t.size){case"sm":return 48;case"md":return 64;case"lg":return 80;default:return 64}}),v=e.computed(()=>t.user?t.user:f.value?E.value:null),x=e.computed(()=>v.value?v.value.username?v.value.username:v.value.firstName&&v.value.lastName?`${v.value.firstName} ${v.value.lastName}`:v.value.firstName?v.value.firstName:v.value.email||"User":"User"),I=()=>{C.value=!C.value,C.value&&e.nextTick(()=>{$()})},w=()=>{C.value=!0},h=()=>{C.value=!1},D=()=>{},L=()=>{},g=()=>{k.value?.$el?.focus()},N=()=>{},Z=()=>{s.value=!0,h()},J=()=>{o("profile-updated")},ie=()=>{},me=()=>{m.value=!0},ve=()=>{m.value=!1,o("signed-in")},fe=()=>{},ue=async()=>{try{await b(),h(),o("signed-out")}catch{}};return(W,O)=>(e.openBlock(),e.createElementBlock("div",{class:"accui-component-scope",ref_key:"containerRef",ref:y},[e.createVNode(wa,{invert:!!t.user},{fallback:e.withCtx(()=>[e.createVNode(e.unref(ee),{onClick:me,"aria-label":"Sign in"},{"leading-icon":e.withCtx(()=>[...O[9]||(O[9]=[e.createElementVNode("svg",{class:"sign-in-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"})],-1)])]),default:e.withCtx(()=>[O[10]||(O[10]=e.createTextVNode(" Sign In ",-1))]),_:1}),e.createVNode(e.unref(_e),{modelValue:m.value,"onUpdate:modelValue":O[1]||(O[1]=U=>m.value=U)},{default:e.withCtx(()=>[e.createElementVNode("div",Uu,[e.createVNode(e.unref(pa),{onSignedIn:ve,onError:fe,"redirect-url":a.redirectUrl,"in-modal":""},null,8,["redirect-url"])])]),_:1},8,["modelValue"])]),loading:e.withCtx(()=>[e.createVNode(S.StrandsUiLoader,{variant:"circle",size:30})]),default:e.withCtx(()=>[a.variant==="mini-profile"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"triggerRef",ref:k,class:e.normalizeClass(["mini-profile-static-card",`user-button-size-${a.size}`,{"mini-profile-active":C.value,"full-width":a.fullWidth}]),onClick:I,onKeydown:[e.withKeys(I,["enter"]),e.withKeys(e.withModifiers(I,["prevent"]),["space"]),e.withKeys(h,["escape"]),e.withKeys(e.withModifiers(w,["prevent"]),["arrow-down"])],role:"button",tabindex:"0","aria-haspopup":"true","aria-expanded":C.value,"aria-label":"User menu"},[e.createElementVNode("div",yu,[e.createVNode(e.unref(mt),{size:T.value,value:v.value?.xp||0,max:v.value?.next_level_xp||100,level:v.value?.level||1,"level-label":`LEVEL ${v.value?.level||1}`,"user-settings":v.value?.settings,class:"mini-profile-level-progress"},null,8,["size","value","max","level","level-label","user-settings"]),v.value?.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:v.value.avatar,alt:`${v.value?.firstName||v.value?.email}'s avatar`,class:"mini-profile-avatar-image",width:p.value,height:p.value,loading:"eager"},null,8,ku)):(e.openBlock(),e.createElementBlock("div",wu,[...O[2]||(O[2]=[e.createElementVNode("svg",{class:"mini-profile-avatar-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z","clip-rule":"evenodd"})],-1)])]))]),e.createElementVNode("div",Vu,[e.createElementVNode("div",Nu,e.toDisplayString(x.value),1),e.createElementVNode("div",Eu,e.toDisplayString(v.value?.email),1)]),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["mini-profile-dropdown-arrow",{"dropdown-arrow-open":C.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...O[3]||(O[3]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))],42,gu)):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"triggerRef",ref:k,class:e.normalizeClass(["user-button-wrapper",{"full-width":a.fullWidth}])},[e.createVNode(e.unref(ee),{color:"secondary",size:a.size,active:C.value,onClick:I,onKeydown:[e.withKeys(I,["enter"]),e.withKeys(e.withModifiers(I,["prevent"]),["space"]),e.withKeys(h,["escape"]),e.withKeys(e.withModifiers(w,["prevent"]),["arrow-down"])],"aria-haspopup":"true","aria-expanded":C.value,"aria-label":"User menu"},{"leading-icon":e.withCtx(()=>[v.value?.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:v.value.avatar,alt:`${v.value?.firstName||v.value?.email}'s avatar`,class:"avatar-image",width:p.value,height:p.value,loading:"eager"},null,8,bu)):(e.openBlock(),e.createElementBlock("div",xu,[...O[4]||(O[4]=[e.createElementVNode("svg",{class:"avatar-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z","clip-rule":"evenodd"})],-1)])]))]),"trailing-icon":e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["dropdown-arrow",{"dropdown-arrow-open":C.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...O[5]||(O[5]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))]),default:e.withCtx(()=>[a.hideUser?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Bu,e.toDisplayString(x.value),1))]),_:1},8,["size","active","onKeydown","aria-expanded"])],2)),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[C.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:r,class:"strands-user-dropdown",style:e.normalizeStyle(e.unref(M)),role:"menu","aria-orientation":"vertical",onKeydown:[e.withKeys(h,["escape"]),e.withKeys(e.withModifiers(L,["prevent"]),["arrow-up"]),e.withKeys(e.withModifiers(D,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(g,["prevent"]),["home"]),e.withKeys(e.withModifiers(N,["prevent"]),["end"])]},[e.createElementVNode("div",Mu,[a.variant!=="mini-profile"?(e.openBlock(),e.createElementBlock("div",$u,[v.value?(e.openBlock(),e.createElementBlock("div",Tu,[e.createVNode(e.unref(mt),{size:80,value:v.value.xp,max:v.value.next_level_xp,level:v.value.level,"level-label":`LEVEL ${v.value.level}`,"user-settings":v.value.settings,class:"level-progress-overlay"},null,8,["value","max","level","level-label","user-settings"]),v.value?.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:v.value.avatar,alt:`${v.value.firstName||v.value.email}'s avatar`,class:"dropdown-avatar-image",width:"64",height:"64"},null,8,Au)):(e.openBlock(),e.createElementBlock("div",_u,[...O[6]||(O[6]=[e.createElementVNode("svg",{class:"dropdown-avatar-icon",fill:"currentColor",viewBox:"0 0 20 20"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z","clip-rule":"evenodd"})],-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("div",zu,[e.createElementVNode("div",Du,e.toDisplayString(x.value),1),e.createElementVNode("div",Iu,e.toDisplayString(v.value?.email),1)])])):e.createCommentVNode("",!0),e.renderSlot(W.$slots,"default",{},void 0,!0),a.variant!=="mini-profile"?(e.openBlock(),e.createElementBlock("div",Lu)):e.createCommentVNode("",!0),e.createVNode(e.unref(ut),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ut).Item,{color:"secondary",onClick:Z},{default:e.withCtx(()=>[...O[7]||(O[7]=[e.createTextVNode("Profile",-1)])]),_:1}),e.createVNode(e.unref(ut).Item,{color:"danger",onClick:ue},{default:e.withCtx(()=>[...O[8]||(O[8]=[e.createTextVNode("Sign Out",-1)])]),_:1})]),_:1})])],44,Su)):e.createCommentVNode("",!0)])),e.createVNode(e.unref(_e),{modelValue:s.value,"onUpdate:modelValue":O[0]||(O[0]=U=>s.value=U)},{default:e.withCtx(()=>[e.createVNode(e.unref(ka),{user:v.value,onProfileUpdated:J,onError:ie,"in-modal":""},null,8,["user"])]),_:1},8,["modelValue"])]),_:3},8,["invert"])],512))}}),Pu=S._export_sfc(Hu,[["__scopeId","data-v-9e62a2ea"]]),ju=e.defineComponent({__name:"StrandsNav",props:{direction:{default:"column"}},setup(a,{expose:l}){const t=a,o=()=>["user-nav",`user-nav-${t.direction}`],E=e.reactive({items:[]});e.provide("userNavState",E);const b=C=>{const s=E.items.findIndex(m=>m.id===C.id);s>=0?E.items[s]=C:E.items.push(C)},f=C=>{const s=E.items.findIndex(m=>m.id===C);s>=0&&E.items.splice(s,1)};return e.provide("registerNavItem",b),e.provide("unregisterNavItem",f),l({items:E.items}),(C,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o())},[e.renderSlot(C.$slots,"default",{},void 0,!0)],2))}}),Ou=S._export_sfc(ju,[["__scopeId","data-v-dfb31e47"]]),Ru={key:0,class:"strands-nav-item-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Fu=["d"],qu={key:0,class:"strands-nav-item-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ku=["d"],Va=e.defineComponent({__name:"StrandsNavItem",props:{variant:{default:"primary"},size:{default:"sm"},type:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean},loadingText:{},fullWidth:{type:Boolean},color:{default:"secondary"},fontWeight:{},icon:{type:Boolean},squircle:{type:Boolean,default:!0},to:{},href:{},external:{type:Boolean},tabindex:{},title:{},align:{}},setup(a){const l=a,t=e.useSlots(),o=e.inject("registerNavItem"),E=e.inject("unregisterNavItem"),b=e.ref(`nav-item-${Math.random().toString(36).substring(2,11)}`),f=e.getCurrentInstance(),C=e.computed(()=>{if(typeof window<"u"&&f){const u=f.vnode.el?.parentElement;if(u)return u.closest('[role="menu"]')!==null}return!1}),s=()=>{try{const u=t.default?.();return u?u.map(M=>typeof M.children=="string"?M.children:M.children&&Array.isArray(M.children)?M.children.map($=>typeof $=="string"?$:"").join(""):"").join("").trim():""}catch{return""}},m=()=>l.type==="button"?"":["strands-nav-item",`strands-nav-item--color-${l.color}`,{"strands-nav-item--disabled":l.disabled}],y=()=>{l.disabled},k=u=>{const M={dashboard:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"};return M[u]||M.dashboard},r=e.computed(()=>({id:b.value,label:s(),to:l.to,icon:l.icon,disabled:l.disabled,variant:l.variant,size:l.size}));return e.onMounted(()=>{o&&o(r.value)}),e.onUnmounted(()=>{E&&E(b.value)}),e.watch(()=>[l.to,l.icon,l.disabled],()=>{o&&o(r.value)},{deep:!0}),(u,M)=>(e.openBlock(),e.createBlock(e.unref(ee),{to:l.to,onClick:y,class:e.normalizeClass(m()),variant:l.variant,color:l.color,size:l.size,squircle:l.squircle,disabled:l.disabled,"full-width":"",role:C.value?"menuitem":void 0,tabindex:"-1"},e.createSlots({default:e.withCtx(()=>[l.icon&&l.type!=="button"?(e.openBlock(),e.createElementBlock("svg",qu,[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:k(l.icon)},null,8,Ku)])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default")]),_:2},[l.type==="button"?{name:"icon",fn:e.withCtx(()=>[l.icon?(e.openBlock(),e.createElementBlock("svg",Ru,[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:k(l.icon)},null,8,Fu)])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["to","class","variant","color","size","squircle","disabled","role"]))}}),ut=Ou;ut.Item=Va;const Zu={class:"accui-p-2 accui-border-b"},Gu=e.defineComponent({__name:"VirtualList",props:{items:{},itemHeight:{},containerHeight:{},itemKey:{type:[String,Function],default:"id"},overscan:{default:5}},setup(a,{expose:l}){const t=a,o=e.ref(),E=e.ref(0),b=e.computed(()=>{const r=Math.floor(E.value/t.itemHeight),u=Math.min(r+Math.ceil(t.containerHeight/t.itemHeight),t.items.length-1);return{start:Math.max(0,r-t.overscan),end:Math.min(t.items.length-1,u+t.overscan)}}),f=e.computed(()=>{const{start:r,end:u}=b.value,M=[];for(let $=r;$<=u;$++)M.push({index:$,data:t.items[$],top:$*t.itemHeight});return M}),C=e.computed(()=>t.items.length*t.itemHeight),s=r=>typeof t.itemKey=="function"?t.itemKey(r):r[t.itemKey]||r.id||Math.random();let m=null;const y=r=>{m&&clearTimeout(m),m=setTimeout(()=>{const u=r.target;E.value=u.scrollTop},16)};return e.onUnmounted(()=>{m&&clearTimeout(m)}),l({scrollToItem:(r,u="start")=>{if(!o.value)return;let M=r*t.itemHeight;u==="center"?M-=t.containerHeight/2-t.itemHeight/2:u==="end"&&(M-=t.containerHeight-t.itemHeight),o.value.scrollTop=Math.max(0,M)}}),(r,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollContainer",ref:o,style:e.normalizeStyle({height:a.containerHeight+"px",overflowY:"auto"}),onScroll:y,class:"accui-virtual-list"},[e.createElementVNode("div",{style:e.normalizeStyle({height:C.value+"px",position:"relative"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,M=>(e.openBlock(),e.createElementBlock("div",{key:s(M.data),style:e.normalizeStyle({position:"absolute",top:M.top+"px",left:0,right:0,height:a.itemHeight+"px"})},[e.renderSlot(r.$slots,"default",{item:M.data,index:M.index},()=>[e.createElementVNode("div",Zu,e.toDisplayString(JSON.stringify(M.data)),1)],!0)],4))),128))],4)],36))}}),Yu=S._export_sfc(Gu,[["__scopeId","data-v-1561f0b5"]]),Wu=()=>{},Qu={class:"accui-component-scope"},Xu={class:"mfa-setup-header"},Ju={class:"mfa-setup-status-container"},e3={class:"mfa-setup-content"},t3={key:0,class:"mfa-setup-loading"},a3={key:1,class:"mfa-setup-sections"},o3={key:0,class:"mfa-setup-status-alert"},n3={class:"mfa-setup-status-content"},l3={class:"mfa-setup-status-icon"},s3={class:"mfa-setup-methods-grid"},r3={class:"mfa-setup-method-content"},i3={class:"mfa-setup-method-icon mfa-setup-totp-icon"},c3={class:"mfa-setup-method-content"},d3={class:"mfa-setup-method-icon mfa-setup-email-icon"},u3={key:1,class:"mfa-setup-manage-section"},m3={class:"mfa-setup-manage-header"},p3={class:"mfa-setup-manage-description"},f3={class:"mfa-setup-footer"},v3=e.defineComponent({__name:"StrandsMFASetup",props:{show:{type:Boolean,default:!1}},emits:["success","error","close"],setup(a,{emit:l}){const t={props:{size:{type:[String,Number],default:24}},render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),e.h("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})])}},o={props:{size:{type:[String,Number],default:24}},render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"m4 4 16 0c1.1 0 2 .9 2 2l0 12c0 1.1-.9 2-2 2l-16 0c-1.1 0-2-.9-2-2l0-12c0-1.1.9-2 2-2z"}),e.h("polyline",{points:"22,6 12,13 2,6"})])}},E={props:{size:{type:[String,Number],default:24}},render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"})])}},b={props:{size:{type:[String,Number],default:24}},render(){return e.h("svg",{width:this.size,height:this.size,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.h("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),e.h("circle",{cx:"12",cy:"12",r:"3"})])}},f=a,C=l,{mfaEnabled:s,loading:m,activeMfaDevices:y,fetchMfaDevices:k}=Ye(),r=e.computed({get:()=>f.show,set:D=>{D||C("close")}}),u=e.ref(!1),M=e.ref(!1),$=e.ref(!1),p=e.ref(!1);e.watch(()=>f.show,async D=>{D&&await k()}),e.onMounted(async()=>{f.show&&await k()});const T=()=>{C("close")},v=()=>{u.value=!0},x=()=>{M.value=!0},I=()=>{p.value=!0},w=async()=>{u.value=!1,M.value=!1,$.value=!1,await k(),C("success")},h=async()=>{await k()};return(D,L)=>(e.openBlock(),e.createElementBlock("div",Qu,[e.createVNode(_e,{modelValue:r.value,"onUpdate:modelValue":L[0]||(L[0]=g=>r.value=g),"card-class":"mfa-setup-modal"},{header:e.withCtx(()=>[e.createElementVNode("div",Xu,[L[5]||(L[5]=e.createElementVNode("div",null,[e.createElementVNode("h2",{class:"mfa-setup-title"},"Two-Factor Authentication"),e.createElementVNode("p",{class:"mfa-setup-subtitle"},"Add extra security to your account")],-1)),e.createElementVNode("div",Ju,[e.createElementVNode("span",{class:e.normalizeClass(["mfa-setup-status-badge",e.unref(s)||e.unref(y).length>0?"mfa-setup-status-enabled":"mfa-setup-status-disabled"])},e.toDisplayString(e.unref(s)||e.unref(y).length>0?"Enabled":"Not Enabled"),3)])])]),footer:e.withCtx(()=>[e.createElementVNode("div",f3,[e.createVNode(e.unref(ee),{variant:"secondary",onClick:T,disabled:e.unref(m)},{default:e.withCtx(()=>[...L[15]||(L[15]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"])])]),default:e.withCtx(()=>[e.createElementVNode("div",e3,[e.unref(m)?(e.openBlock(),e.createElementBlock("div",t3,[e.createVNode(e.unref(S.StrandsUiLoader),{size:32}),L[6]||(L[6]=e.createElementVNode("span",{class:"mfa-setup-loading-text"},"Loading MFA settings...",-1))])):(e.openBlock(),e.createElementBlock("div",a3,[e.unref(s)||e.unref(y).length>0?(e.openBlock(),e.createElementBlock("div",o3,[e.createElementVNode("div",n3,[e.createElementVNode("div",l3,[e.createVNode(E,{size:20,class:"mfa-setup-shield-icon"})]),L[7]||(L[7]=e.createElementVNode("div",null,[e.createElementVNode("span",{class:"mfa-setup-status-title"},"2FA is currently enabled on your account"),e.createElementVNode("p",{class:"mfa-setup-status-description"},"Your account has additional security protection")],-1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[L[12]||(L[12]=e.createElementVNode("h3",{class:"mfa-setup-methods-title"},"Choose Your Authentication Method",-1)),e.createElementVNode("div",s3,[e.createElementVNode("div",{class:"mfa-setup-method-card",onClick:v},[e.createElementVNode("div",r3,[e.createElementVNode("div",i3,[e.createVNode(t,{size:28,class:"mfa-setup-icon-svg"})]),L[9]||(L[9]=e.createElementVNode("div",{class:"mfa-setup-method-info"},[e.createElementVNode("h4",{class:"mfa-setup-method-title"},"Authenticator App"),e.createElementVNode("p",{class:"mfa-setup-method-description"},"Use Google Authenticator, Authy, or any TOTP-compatible app to generate secure codes")],-1)),e.createVNode(e.unref(ee),{variant:"primary",size:"md",onClick:e.withModifiers(v,["stop"]),disabled:e.unref(m),class:"mfa-setup-method-button"},{default:e.withCtx(()=>[...L[8]||(L[8]=[e.createTextVNode(" Setup Authenticator ",-1)])]),_:1},8,["disabled"])])]),e.createElementVNode("div",{class:"mfa-setup-method-card",onClick:x},[e.createElementVNode("div",c3,[e.createElementVNode("div",d3,[e.createVNode(o,{size:28,class:"mfa-setup-icon-svg"})]),L[11]||(L[11]=e.createElementVNode("div",{class:"mfa-setup-method-info"},[e.createElementVNode("h4",{class:"mfa-setup-method-title"},"Email Verification"),e.createElementVNode("p",{class:"mfa-setup-method-description"},"Receive verification codes directly in your email inbox for easy access")],-1)),e.createVNode(e.unref(ee),{variant:"primary",size:"md",onClick:e.withModifiers(x,["stop"]),disabled:e.unref(m),class:"mfa-setup-method-button"},{default:e.withCtx(()=>[...L[10]||(L[10]=[e.createTextVNode(" Setup Email 2FA ",-1)])]),_:1},8,["disabled"])])])])]),e.unref(y).length>0?(e.openBlock(),e.createElementBlock("div",u3,[e.createElementVNode("div",m3,[e.createElementVNode("div",null,[L[13]||(L[13]=e.createElementVNode("h3",{class:"mfa-setup-manage-title"},"Manage Existing Methods",-1)),e.createElementVNode("p",p3,e.toDisplayString(e.unref(y).length)+" device(s) currently active",1)]),e.createVNode(e.unref(ee),{variant:"secondary",size:"md",onClick:I,disabled:e.unref(m)},{default:e.withCtx(()=>[e.createVNode(b,{size:16,class:"mfa-setup-manage-icon"}),L[14]||(L[14]=e.createTextVNode(" Manage Devices ",-1))]),_:1},8,["disabled"])])])):e.createCommentVNode("",!0)]))])]),_:1},8,["modelValue"]),u.value?(e.openBlock(),e.createBlock(Ot,{key:0,show:u.value,onClose:L[1]||(L[1]=g=>u.value=!1),onSuccess:w},null,8,["show"])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createBlock(Rt,{key:1,show:M.value,onClose:L[2]||(L[2]=g=>M.value=!1),onSuccess:w},null,8,["show"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createBlock($t,{key:2,show:$.value,onClose:L[3]||(L[3]=g=>$.value=!1),onSuccess:w},null,8,["show"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(Ft,{key:3,show:p.value,onClose:L[4]||(L[4]=g=>p.value=!1),onMfaUpdated:h},null,8,["show"])):e.createCommentVNode("",!0)]))}}),h3=S._export_sfc(v3,[["__scopeId","data-v-5e4af8e5"]]);function rt(){const{config:a}=Se.useStrandsConfig(),{currentSession:l,refreshToken:t,getAuthHeaders:o}=Ie.useStrandsAuth(),E=async(y,k={})=>{const{autoRefresh:r=!0,requireAuth:u=!0,baseURL:M,...$}=k;if(u&&!l.value?.accessToken)throw new Error("User is not authenticated");let p=y;const T=M||a.value.baseUrl;T&&typeof y=="string"&&!y.startsWith("http")&&(p=new URL(y,T).toString());const v=new Headers($.headers);if(l.value?.accessToken)try{const w=o();Object.entries(w).forEach(([h,D])=>{v.set(h,D)})}catch(w){if(console.warn("[Strands Auth] Failed to get auth headers:",w),u)throw w}const x={...$,headers:v};let I=await fetch(p,x);if(I.status===401&&r&&l.value?.refreshToken)try{if(await t()&&l.value?.accessToken){const h=o();Object.entries(h).forEach(([D,L])=>{v.set(D,L)}),I=await fetch(p,{...x,headers:v})}}catch(w){console.error("[Strands Auth] Token refresh failed:",w)}return I};return{authenticatedFetch:E,get:(y,k)=>E(y,{...k,method:"GET"}),post:(y,k,r)=>{const u=new Headers(r?.headers);return k&&typeof k=="object"&&!u.has("Content-Type")&&u.set("Content-Type","application/json"),E(y,{...r,method:"POST",headers:u,body:typeof k=="object"?JSON.stringify(k):k})},put:(y,k,r)=>{const u=new Headers(r?.headers);return k&&typeof k=="object"&&!u.has("Content-Type")&&u.set("Content-Type","application/json"),E(y,{...r,method:"PUT",headers:u,body:typeof k=="object"?JSON.stringify(k):k})},delete:(y,k)=>E(y,{...k,method:"DELETE"}),patch:(y,k,r)=>{const u=new Headers(r?.headers);return k&&typeof k=="object"&&!u.has("Content-Type")&&u.set("Content-Type","application/json"),E(y,{...r,method:"PATCH",headers:u,body:typeof k=="object"?JSON.stringify(k):k})}}}const C3={get:async(a,l)=>{const{get:t}=rt();return t(a,l)},post:async(a,l,t)=>{const{post:o}=rt();return o(a,l,t)},put:async(a,l,t)=>{const{put:o}=rt();return o(a,l,t)},delete:async(a,l)=>{const{delete:t}=rt();return t(a,l)},patch:async(a,l,t)=>{const{patch:o}=rt();return o(a,l,t)}},g3=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),y3=a=>{const l=[];let t=0;a.length<8?l.push("Password must be at least 8 characters long"):t+=1,/[A-Z]/.test(a)?t+=1:l.push("Password must contain at least one uppercase letter"),/[a-z]/.test(a)?t+=1:l.push("Password must contain at least one lowercase letter"),/\d/.test(a)?t+=1:l.push("Password must contain at least one number"),/[!@#$%^&*(),.?":{}|<>]/.test(a)?t+=1:l.push("Password must contain at least one special character");const o=l.length===0;let E="weak";return t>=4?E="strong":t>=3&&(E="medium"),{isValid:o,strength:E,errors:l}},k3=a=>a.trim().length>=2,w3=a=>a.trim().length>0,V3=(a,l)=>a===l,N3=(a,l)=>{const t=a?.charAt(0).toUpperCase()||"",o=l?.charAt(0).toUpperCase()||"";return t+o||"U"},E3=a=>(typeof a=="string"?new Date(a):a).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),b3=(a,l)=>{let t;return(...o)=>{clearTimeout(t),t=setTimeout(()=>a(...o),l)}};exports.StrandsUIPlugin=S.StrandsUIPlugin;exports.StrandsUiAlert=S.StrandsUiAlert;exports.StrandsUiCard=S.StrandsUiCard;exports.StrandsUiDivider=S.UiDivider;exports.StrandsUiInput=S.StrandsUiInput;exports.StrandsUiLink=S.StrandsUiLink;exports.StrandsUiLoader=S.StrandsUiLoader;exports.StrandsUiTabs=S.StrandsUiTabs;exports.StrandsUiTooltip=S.UiTooltip;exports.UiAlert=S.StrandsUiAlert;exports.UiCard=S.StrandsUiCard;exports.UiDivider=S.UiDivider;exports.UiInput=S.StrandsUiInput;exports.UiLink=S.StrandsUiLink;exports.UiLoader=S.StrandsUiLoader;exports.UiTabs=S.StrandsUiTabs;exports.UiTooltip=S.UiTooltip;exports.useFloatingPosition=S.useFloatingPosition;exports.provideStrandsConfig=Se.provideStrandsConfig;exports.setStrandsConfig=Se.setStrandsConfig;exports.useStrandsConfig=Se.useStrandsConfig;exports.useStrandsAuth=Ie.useStrandsAuth;exports.$authFetch=C3;exports.IconGithub=va;exports.IconGoogle=fa;exports.SignedIn=wa;exports.StrandsAuth=pa;exports.StrandsBackupCodesModal=ha;exports.StrandsCompleteSignUp=c1;exports.StrandsConfigProvider=vu;exports.StrandsConfirmModal=Ca;exports.StrandsEmailMfaSetupModal=Rt;exports.StrandsHardwareKeySetupModal=$t;exports.StrandsLogo=pt;exports.StrandsMFASetup=h3;exports.StrandsMfaModal=Ft;exports.StrandsMfaVerification=jt;exports.StrandsNav=ut;exports.StrandsNavItem=Va;exports.StrandsPasswordReset=uu;exports.StrandsSecuredFooter=Ge;exports.StrandsSessionsModal=ya;exports.StrandsSettingsModal=ga;exports.StrandsSignIn=pi;exports.StrandsSignUp=Zi;exports.StrandsTotpSetupModal=Ot;exports.StrandsUiApp=Jt;exports.StrandsUiAvatarEditor=Tt;exports.StrandsUiButton=ee;exports.StrandsUiCheckboxGroup=ua;exports.StrandsUiColorPicker=na;exports.StrandsUiHero=sa;exports.StrandsUiLevelProgress=mt;exports.StrandsUiModal=_e;exports.StrandsUiPill=ma;exports.StrandsUiRadioGroup=da;exports.StrandsUiSlider=ca;exports.StrandsUiTable=la;exports.StrandsUiThemeToggle=ia;exports.StrandsUiToggle=Mt;exports.StrandsUserButton=Pu;exports.StrandsUserProfile=ka;exports.SvgIcon=Cu;exports.UiApp=Jt;exports.UiAvatarEditor=Tt;exports.UiAvatarEditorSimple=Tt;exports.UiButton=ee;exports.UiCheckboxGroup=ua;exports.UiColorPicker=na;exports.UiHero=sa;exports.UiLevelProgress=mt;exports.UiModal=_e;exports.UiPill=ma;exports.UiRadioGroup=da;exports.UiSlider=ca;exports.UiTable=la;exports.UiThemeToggle=ia;exports.UiToggle=Mt;exports.VirtualList=Yu;exports.debounce=b3;exports.formatDate=E3;exports.getInitials=N3;exports.isRequired=w3;exports.isValidEmail=g3;exports.isValidName=k3;exports.passwordsMatch=V3;exports.preloadCriticalComponents=Wu;exports.tailwindColors=aa;exports.useAuthenticatedFetch=rt;exports.useGlobalModalStack=Mo;exports.useModalStack=ta;exports.useModalTeleport=So;exports.useOAuthProviders=At;exports.useTheme=ra;exports.validatePassword=y3;