paskia 0.8.1__py3-none-any.whl → 0.9.0__py3-none-any.whl

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.
Files changed (53) hide show
  1. paskia/_version.py +2 -2
  2. paskia/authsession.py +14 -27
  3. paskia/bootstrap.py +31 -103
  4. paskia/db/__init__.py +25 -51
  5. paskia/db/background.py +17 -37
  6. paskia/db/jsonl.py +168 -6
  7. paskia/db/migrations.py +34 -0
  8. paskia/db/operations.py +400 -723
  9. paskia/db/structs.py +214 -90
  10. paskia/fastapi/__main__.py +24 -28
  11. paskia/fastapi/admin.py +101 -160
  12. paskia/fastapi/api.py +47 -83
  13. paskia/fastapi/mainapp.py +13 -6
  14. paskia/fastapi/remote.py +16 -39
  15. paskia/fastapi/reset.py +27 -17
  16. paskia/fastapi/session.py +2 -2
  17. paskia/fastapi/user.py +21 -27
  18. paskia/fastapi/ws.py +27 -62
  19. paskia/fastapi/wschat.py +62 -0
  20. paskia/frontend-build/auth/admin/index.html +5 -5
  21. paskia/frontend-build/auth/assets/{AccessDenied-Bc249ASC.css → AccessDenied-DPkUS8LZ.css} +1 -1
  22. paskia/frontend-build/auth/assets/AccessDenied-Fmeb6EtF.js +8 -0
  23. paskia/frontend-build/auth/assets/{RestrictedAuth-DgdJyscT.css → RestrictedAuth-CvR33_Z0.css} +1 -1
  24. paskia/frontend-build/auth/assets/RestrictedAuth-DsJXicIw.js +1 -0
  25. paskia/frontend-build/auth/assets/{_plugin-vue_export-helper-rKFEraYH.js → _plugin-vue_export-helper-nhjnO_bd.js} +1 -1
  26. paskia/frontend-build/auth/assets/admin-CPE1pLMm.js +1 -0
  27. paskia/frontend-build/auth/assets/{admin-BeNu48FR.css → admin-DzzjSg72.css} +1 -1
  28. paskia/frontend-build/auth/assets/{auth-BKX7shEe.css → auth-C7k64Wad.css} +1 -1
  29. paskia/frontend-build/auth/assets/auth-YIZvPlW_.js +1 -0
  30. paskia/frontend-build/auth/assets/{forward-Dzg-aE1C.js → forward-DmqVHZ7e.js} +1 -1
  31. paskia/frontend-build/auth/assets/reset-Chtv69AT.css +1 -0
  32. paskia/frontend-build/auth/assets/reset-s20PATTN.js +1 -0
  33. paskia/frontend-build/auth/assets/{restricted-C0IQufuH.js → restricted-D3AJx3_6.js} +1 -1
  34. paskia/frontend-build/auth/index.html +5 -5
  35. paskia/frontend-build/auth/restricted/index.html +4 -4
  36. paskia/frontend-build/int/forward/index.html +4 -4
  37. paskia/frontend-build/int/reset/index.html +3 -3
  38. paskia/globals.py +2 -2
  39. paskia/migrate/__init__.py +62 -55
  40. paskia/migrate/sql.py +72 -22
  41. paskia/remoteauth.py +1 -2
  42. paskia/sansio.py +6 -12
  43. {paskia-0.8.1.dist-info → paskia-0.9.0.dist-info}/METADATA +1 -1
  44. paskia-0.9.0.dist-info/RECORD +57 -0
  45. paskia/frontend-build/auth/assets/AccessDenied-aTdCvz9k.js +0 -8
  46. paskia/frontend-build/auth/assets/RestrictedAuth-BLMK7-nL.js +0 -1
  47. paskia/frontend-build/auth/assets/admin-tVs8oyLv.js +0 -1
  48. paskia/frontend-build/auth/assets/auth-Dk3q4pNS.js +0 -1
  49. paskia/frontend-build/auth/assets/reset-BWF4cWKR.css +0 -1
  50. paskia/frontend-build/auth/assets/reset-C_Td1_jn.js +0 -1
  51. paskia-0.8.1.dist-info/RECORD +0 -55
  52. {paskia-0.8.1.dist-info → paskia-0.9.0.dist-info}/WHEEL +0 -0
  53. {paskia-0.8.1.dist-info → paskia-0.9.0.dist-info}/entry_points.txt +0 -0
@@ -1,2 +1,2 @@
1
1
  (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function Qn(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const K={},ft=[],Ae=()=>{},cr=()=>!1,dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),es=e=>e.startsWith("onUpdate:"),re=Object.assign,ts=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ai=Object.prototype.hasOwnProperty,U=(e,t)=>Ai.call(e,t),T=Array.isArray,ut=e=>jt(e)==="[object Map]",bt=e=>jt(e)==="[object Set]",Rs=e=>jt(e)==="[object Date]",P=e=>typeof e=="function",q=e=>typeof e=="string",pe=e=>typeof e=="symbol",V=e=>e!==null&&typeof e=="object",ar=e=>(V(e)||P(e))&&P(e.then)&&P(e.catch),fr=Object.prototype.toString,jt=e=>fr.call(e),Ri=e=>jt(e).slice(8,-1),ur=e=>jt(e)==="[object Object]",hn=e=>q(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,At=Qn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),pn=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Ti=/-\w/g,Je=pn(e=>e.replace(Ti,t=>t.slice(1).toUpperCase())),Oi=/\B([A-Z])/g,Ye=pn(e=>e.replace(Oi,"-$1").toLowerCase()),dr=pn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Tn=pn(e=>e?`on${dr(e)}`:""),qe=(e,t)=>!Object.is(e,t),zt=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},hr=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},gn=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Ts;const mn=()=>Ts||(Ts=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ns(e){if(T(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=q(s)?Mi(s):ns(s);if(r)for(const i in r)t[i]=r[i]}return t}else if(q(e)||V(e))return e}const Ci=/;(?![^(]*\))/g,Ii=/:([^]+)/,Pi=/\/\*[^]*?\*\//g;function Mi(e){const t={};return e.replace(Pi,"").split(Ci).forEach(n=>{if(n){const s=n.split(Ii);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ss(e){let t="";if(q(e))t=e;else if(T(e))for(let n=0;n<e.length;n++){const s=ss(e[n]);s&&(t+=s+" ")}else if(V(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ni="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Di=Qn(Ni);function pr(e){return!!e||e===""}function Fi(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=lt(e[s],t[s]);return n}function lt(e,t){if(e===t)return!0;let n=Rs(e),s=Rs(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=pe(e),s=pe(t),n||s)return e===t;if(n=T(e),s=T(t),n||s)return n&&s?Fi(e,t):!1;if(n=V(e),s=V(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,i=Object.keys(t).length;if(r!==i)return!1;for(const o in e){const l=e.hasOwnProperty(o),c=t.hasOwnProperty(o);if(l&&!c||!l&&c||!lt(e[o],t[o]))return!1}}return String(e)===String(t)}function rs(e,t){return e.findIndex(n=>lt(n,t))}const gr=e=>!!(e&&e.__v_isRef===!0),Ui=e=>q(e)?e:e==null?"":T(e)||V(e)&&(e.toString===fr||!P(e.toString))?gr(e)?Ui(e.value):JSON.stringify(e,mr,2):String(e),mr=(e,t)=>gr(t)?mr(e,t.value):ut(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],i)=>(n[On(s,i)+" =>"]=r,n),{})}:bt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>On(n))}:pe(t)?On(t):V(t)&&!T(t)&&!ur(t)?String(t):t,On=(e,t="")=>{var n;return pe(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let z;class br{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=z,!t&&z&&(this.index=(z.scopes||(z.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=z;try{return z=this,t()}finally{z=n}}}on(){++this._on===1&&(this.prevScope=z,z=this)}off(){this._on>0&&--this._on===0&&(z=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Cc(e){return new br(e)}function ji(){return z}function Ic(e,t=!1){z&&z.cleanups.push(e)}let $;const Cn=new WeakSet;class _r{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,z&&z.active&&z.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Cn.has(this)&&(Cn.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||wr(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Os(this),Er(this);const t=$,n=he;$=this,he=!0;try{return this.fn()}finally{Sr(this),$=t,he=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ls(t);this.deps=this.depsTail=void 0,Os(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Cn.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){$n(this)&&this.run()}get dirty(){return $n(this)}}let yr=0,Rt,Tt;function wr(e,t=!1){if(e.flags|=8,t){e.next=Tt,Tt=e;return}e.next=Rt,Rt=e}function is(){yr++}function os(){if(--yr>0)return;if(Tt){let t=Tt;for(Tt=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Rt;){let t=Rt;for(Rt=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Er(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Sr(e){let t,n=e.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),ls(s),Ki(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}e.deps=t,e.depsTail=n}function $n(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(vr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function vr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Mt)||(e.globalVersion=Mt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!$n(e))))return;e.flags|=2;const t=e.dep,n=$,s=he;$=e,he=!0;try{Er(e);const r=e.fn(e._value);(t.version===0||qe(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{$=n,he=s,Sr(e),e.flags&=-3}}function ls(e,t=!1){const{dep:n,prevSub:s,nextSub:r}=e;if(s&&(s.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)ls(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ki(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let he=!0;const xr=[];function Ue(){xr.push(he),he=!1}function je(){const e=xr.pop();he=e===void 0?!0:e}function Os(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=$;$=void 0;try{t()}finally{$=n}}}let Mt=0;class Li{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class cs{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!$||!he||$===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==$)n=this.activeLink=new Li($,this),$.deps?(n.prevDep=$.depsTail,$.depsTail.nextDep=n,$.depsTail=n):$.deps=$.depsTail=n,Ar(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=$.depsTail,n.nextDep=void 0,$.depsTail.nextDep=n,$.depsTail=n,$.deps===n&&($.deps=s)}return n}trigger(t){this.version++,Mt++,this.notify(t)}notify(t){is();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{os()}}}function Ar(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)Ar(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const sn=new WeakMap,rt=Symbol(""),Vn=Symbol(""),Nt=Symbol("");function X(e,t,n){if(he&&$){let s=sn.get(e);s||sn.set(e,s=new Map);let r=s.get(n);r||(s.set(n,r=new cs),r.map=s,r.key=n),r.track()}}function Ne(e,t,n,s,r,i){const o=sn.get(e);if(!o){Mt++;return}const l=c=>{c&&c.trigger()};if(is(),t==="clear")o.forEach(l);else{const c=T(e),d=c&&hn(n);if(c&&n==="length"){const u=Number(s);o.forEach((p,S)=>{(S==="length"||S===Nt||!pe(S)&&S>=u)&&l(p)})}else switch((n!==void 0||o.has(void 0))&&l(o.get(n)),d&&l(o.get(Nt)),t){case"add":c?d&&l(o.get("length")):(l(o.get(rt)),ut(e)&&l(o.get(Vn)));break;case"delete":c||(l(o.get(rt)),ut(e)&&l(o.get(Vn)));break;case"set":ut(e)&&l(o.get(rt));break}}os()}function Hi(e,t){const n=sn.get(e);return n&&n.get(t)}function ct(e){const t=F(e);return t===e?t:(X(t,"iterate",Nt),fe(e)?t:t.map(ge))}function bn(e){return X(e=F(e),"iterate",Nt),e}function ke(e,t){return Ke(e)?it(e)?pt(ge(t)):pt(t):ge(t)}const $i={__proto__:null,[Symbol.iterator](){return In(this,Symbol.iterator,e=>ke(this,e))},concat(...e){return ct(this).concat(...e.map(t=>T(t)?ct(t):t))},entries(){return In(this,"entries",e=>(e[1]=ke(this,e[1]),e))},every(e,t){return Oe(this,"every",e,t,void 0,arguments)},filter(e,t){return Oe(this,"filter",e,t,n=>n.map(s=>ke(this,s)),arguments)},find(e,t){return Oe(this,"find",e,t,n=>ke(this,n),arguments)},findIndex(e,t){return Oe(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Oe(this,"findLast",e,t,n=>ke(this,n),arguments)},findLastIndex(e,t){return Oe(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Oe(this,"forEach",e,t,void 0,arguments)},includes(...e){return Pn(this,"includes",e)},indexOf(...e){return Pn(this,"indexOf",e)},join(e){return ct(this).join(e)},lastIndexOf(...e){return Pn(this,"lastIndexOf",e)},map(e,t){return Oe(this,"map",e,t,void 0,arguments)},pop(){return St(this,"pop")},push(...e){return St(this,"push",e)},reduce(e,...t){return Cs(this,"reduce",e,t)},reduceRight(e,...t){return Cs(this,"reduceRight",e,t)},shift(){return St(this,"shift")},some(e,t){return Oe(this,"some",e,t,void 0,arguments)},splice(...e){return St(this,"splice",e)},toReversed(){return ct(this).toReversed()},toSorted(e){return ct(this).toSorted(e)},toSpliced(...e){return ct(this).toSpliced(...e)},unshift(...e){return St(this,"unshift",e)},values(){return In(this,"values",e=>ke(this,e))}};function In(e,t,n){const s=bn(e),r=s[t]();return s!==e&&!fe(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const Vi=Array.prototype;function Oe(e,t,n,s,r,i){const o=bn(e),l=o!==e&&!fe(e),c=o[t];if(c!==Vi[t]){const p=c.apply(e,i);return l?ge(p):p}let d=n;o!==e&&(l?d=function(p,S){return n.call(this,ke(e,p),S,e)}:n.length>2&&(d=function(p,S){return n.call(this,p,S,e)}));const u=c.call(o,d,s);return l&&r?r(u):u}function Cs(e,t,n,s){const r=bn(e);let i=n;return r!==e&&(fe(e)?n.length>3&&(i=function(o,l,c){return n.call(this,o,l,c,e)}):i=function(o,l,c){return n.call(this,o,ke(e,l),c,e)}),r[t](i,...s)}function Pn(e,t,n){const s=F(e);X(s,"iterate",Nt);const r=s[t](...n);return(r===-1||r===!1)&&_n(n[0])?(n[0]=F(n[0]),s[t](...n)):r}function St(e,t,n=[]){Ue(),is();const s=F(e)[t].apply(e,n);return os(),je(),s}const ki=Qn("__proto__,__v_isRef,__isVue"),Rr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(pe));function Wi(e){pe(e)||(e=String(e));const t=F(this);return X(t,"has",e),t.hasOwnProperty(e)}class Tr{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(r?i?eo:Pr:i?Ir:Cr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=T(t);if(!r){let c;if(o&&(c=$i[n]))return c;if(n==="hasOwnProperty")return Wi}const l=Reflect.get(t,n,G(t)?t:s);if((pe(n)?Rr.has(n):ki(n))||(r||X(t,"get",n),i))return l;if(G(l)){const c=o&&hn(n)?l:l.value;return r&&V(c)?Wn(c):c}return V(l)?r?Wn(l):fs(l):l}}class Or extends Tr{constructor(t=!1){super(!1,t)}set(t,n,s,r){let i=t[n];const o=T(t)&&hn(n);if(!this._isShallow){const d=Ke(i);if(!fe(s)&&!Ke(s)&&(i=F(i),s=F(s)),!o&&G(i)&&!G(s))return d||(i.value=s),!0}const l=o?Number(n)<t.length:U(t,n),c=Reflect.set(t,n,s,G(t)?t:r);return t===F(r)&&(l?qe(s,i)&&Ne(t,"set",n,s):Ne(t,"add",n,s)),c}deleteProperty(t,n){const s=U(t,n);t[n];const r=Reflect.deleteProperty(t,n);return r&&s&&Ne(t,"delete",n,void 0),r}has(t,n){const s=Reflect.has(t,n);return(!pe(n)||!Rr.has(n))&&X(t,"has",n),s}ownKeys(t){return X(t,"iterate",T(t)?"length":rt),Reflect.ownKeys(t)}}class Bi extends Tr{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const qi=new Or,Ji=new Bi,Gi=new Or(!0);const kn=e=>e,Bt=e=>Reflect.getPrototypeOf(e);function Yi(e,t,n){return function(...s){const r=this.__v_raw,i=F(r),o=ut(i),l=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,d=r[e](...s),u=n?kn:t?pt:ge;return!t&&X(i,"iterate",c?Vn:rt),{next(){const{value:p,done:S}=d.next();return S?{value:p,done:S}:{value:l?[u(p[0]),u(p[1])]:u(p),done:S}},[Symbol.iterator](){return this}}}}function qt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function zi(e,t){const n={get(r){const i=this.__v_raw,o=F(i),l=F(r);e||(qe(r,l)&&X(o,"get",r),X(o,"get",l));const{has:c}=Bt(o),d=t?kn:e?pt:ge;if(c.call(o,r))return d(i.get(r));if(c.call(o,l))return d(i.get(l));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&X(F(r),"iterate",rt),r.size},has(r){const i=this.__v_raw,o=F(i),l=F(r);return e||(qe(r,l)&&X(o,"has",r),X(o,"has",l)),r===l?i.has(r):i.has(r)||i.has(l)},forEach(r,i){const o=this,l=o.__v_raw,c=F(l),d=t?kn:e?pt:ge;return!e&&X(c,"iterate",rt),l.forEach((u,p)=>r.call(i,d(u),d(p),o))}};return re(n,e?{add:qt("add"),set:qt("set"),delete:qt("delete"),clear:qt("clear")}:{add(r){!t&&!fe(r)&&!Ke(r)&&(r=F(r));const i=F(this);return Bt(i).has.call(i,r)||(i.add(r),Ne(i,"add",r,r)),this},set(r,i){!t&&!fe(i)&&!Ke(i)&&(i=F(i));const o=F(this),{has:l,get:c}=Bt(o);let d=l.call(o,r);d||(r=F(r),d=l.call(o,r));const u=c.call(o,r);return o.set(r,i),d?qe(i,u)&&Ne(o,"set",r,i):Ne(o,"add",r,i),this},delete(r){const i=F(this),{has:o,get:l}=Bt(i);let c=o.call(i,r);c||(r=F(r),c=o.call(i,r)),l&&l.call(i,r);const d=i.delete(r);return c&&Ne(i,"delete",r,void 0),d},clear(){const r=F(this),i=r.size!==0,o=r.clear();return i&&Ne(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Yi(r,e,t)}),n}function as(e,t){const n=zi(e,t);return(s,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?s:Reflect.get(U(n,r)&&r in s?n:s,r,i)}const Xi={get:as(!1,!1)},Zi={get:as(!1,!0)},Qi={get:as(!0,!1)};const Cr=new WeakMap,Ir=new WeakMap,Pr=new WeakMap,eo=new WeakMap;function to(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function no(e){return e.__v_skip||!Object.isExtensible(e)?0:to(Ri(e))}function fs(e){return Ke(e)?e:us(e,!1,qi,Xi,Cr)}function so(e){return us(e,!1,Gi,Zi,Ir)}function Wn(e){return us(e,!0,Ji,Qi,Pr)}function us(e,t,n,s,r){if(!V(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=no(e);if(i===0)return e;const o=r.get(e);if(o)return o;const l=new Proxy(e,i===2?s:n);return r.set(e,l),l}function it(e){return Ke(e)?it(e.__v_raw):!!(e&&e.__v_isReactive)}function Ke(e){return!!(e&&e.__v_isReadonly)}function fe(e){return!!(e&&e.__v_isShallow)}function _n(e){return e?!!e.__v_raw:!1}function F(e){const t=e&&e.__v_raw;return t?F(t):e}function ro(e){return!U(e,"__v_skip")&&Object.isExtensible(e)&&hr(e,"__v_skip",!0),e}const ge=e=>V(e)?fs(e):e,pt=e=>V(e)?Wn(e):e;function G(e){return e?e.__v_isRef===!0:!1}function Pc(e){return io(e,!1)}function io(e,t){return G(e)?e:new oo(e,t)}class oo{constructor(t,n){this.dep=new cs,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:F(t),this._value=n?t:ge(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||fe(t)||Ke(t);t=s?t:F(t),qe(t,n)&&(this._rawValue=t,this._value=s?t:ge(t),this.dep.trigger())}}function Mr(e){return G(e)?e.value:e}const lo={get:(e,t,n)=>t==="__v_raw"?e:Mr(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return G(r)&&!G(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function Nr(e){return it(e)?e:new Proxy(e,lo)}function Mc(e){const t=T(e)?new Array(e.length):{};for(const n in e)t[n]=ao(e,n);return t}class co{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=F(t);let r=!0,i=t;if(!T(t)||!hn(String(n)))do r=!_n(i)||fe(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=Mr(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&G(this._raw[this._key])){const n=this._object[this._key];if(G(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Hi(this._raw,this._key)}}function ao(e,t,n){return new co(e,t,n)}class fo{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new cs(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Mt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&$!==this)return wr(this,!0),!0}get value(){const t=this.dep.track();return vr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function uo(e,t,n=!1){let s,r;return P(e)?s=e:(s=e.get,r=e.set),new fo(s,r,n)}const Jt={},rn=new WeakMap;let tt;function ho(e,t=!1,n=tt){if(n){let s=rn.get(n);s||rn.set(n,s=[]),s.push(e)}}function po(e,t,n=K){const{immediate:s,deep:r,once:i,scheduler:o,augmentJob:l,call:c}=n,d=C=>r?C:fe(C)||r===!1||r===0?De(C,1):De(C);let u,p,S,x,O=!1,N=!1;if(G(e)?(p=()=>e.value,O=fe(e)):it(e)?(p=()=>d(e),O=!0):T(e)?(N=!0,O=e.some(C=>it(C)||fe(C)),p=()=>e.map(C=>{if(G(C))return C.value;if(it(C))return d(C);if(P(C))return c?c(C,2):C()})):P(e)?t?p=c?()=>c(e,2):e:p=()=>{if(S){Ue();try{S()}finally{je()}}const C=tt;tt=u;try{return c?c(e,3,[x]):e(x)}finally{tt=C}}:p=Ae,t&&r){const C=p,J=r===!0?1/0:r;p=()=>De(C(),J)}const Q=ji(),D=()=>{u.stop(),Q&&Q.active&&ts(Q.effects,u)};if(i&&t){const C=t;t=(...J)=>{C(...J),D()}}let k=N?new Array(e.length).fill(Jt):Jt;const B=C=>{if(!(!(u.flags&1)||!u.dirty&&!C))if(t){const J=u.run();if(r||O||(N?J.some(($e,me)=>qe($e,k[me])):qe(J,k))){S&&S();const $e=tt;tt=u;try{const me=[J,k===Jt?void 0:N&&k[0]===Jt?[]:k,x];k=J,c?c(t,3,me):t(...me)}finally{tt=$e}}}else u.run()};return l&&l(B),u=new _r(p),u.scheduler=o?()=>o(B,!1):B,x=C=>ho(C,!1,u),S=u.onStop=()=>{const C=rn.get(u);if(C){if(c)c(C,4);else for(const J of C)J();rn.delete(u)}},t?s?B(!0):k=u.run():o?o(B.bind(null,!0),!0):u.run(),D.pause=u.pause.bind(u),D.resume=u.resume.bind(u),D.stop=D,D}function De(e,t=1/0,n){if(t<=0||!V(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,G(e))De(e.value,t,n);else if(T(e))for(let s=0;s<e.length;s++)De(e[s],t,n);else if(bt(e)||ut(e))e.forEach(s=>{De(s,t,n)});else if(ur(e)){for(const s in e)De(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&De(e[s],t,n)}return e}function Kt(e,t,n,s){try{return s?e(...s):e()}catch(r){yn(r,t,n)}}function Te(e,t,n,s){if(P(e)){const r=Kt(e,t,n,s);return r&&ar(r)&&r.catch(i=>{yn(i,t,n)}),r}if(T(e)){const r=[];for(let i=0;i<e.length;i++)r.push(Te(e[i],t,n,s));return r}}function yn(e,t,n,s=!0){const r=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||K;if(t){let l=t.parent;const c=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let p=0;p<u.length;p++)if(u[p](e,c,d)===!1)return}l=l.parent}if(i){Ue(),Kt(i,null,10,[e,c,d]),je();return}}go(e,n,r,s,o)}function go(e,t,n,s=!0,r=!1){if(r)throw e;console.error(e)}const ne=[];let Se=-1;const dt=[];let We=null,at=0;const Dr=Promise.resolve();let on=null;function Fr(e){const t=on||Dr;return e?t.then(this?e.bind(this):e):t}function mo(e){let t=Se+1,n=ne.length;for(;t<n;){const s=t+n>>>1,r=ne[s],i=Dt(r);i<e||i===e&&r.flags&2?t=s+1:n=s}return t}function ds(e){if(!(e.flags&1)){const t=Dt(e),n=ne[ne.length-1];!n||!(e.flags&2)&&t>=Dt(n)?ne.push(e):ne.splice(mo(t),0,e),e.flags|=1,Ur()}}function Ur(){on||(on=Dr.then(Kr))}function bo(e){T(e)?dt.push(...e):We&&e.id===-1?We.splice(at+1,0,e):e.flags&1||(dt.push(e),e.flags|=1),Ur()}function Is(e,t,n=Se+1){for(;n<ne.length;n++){const s=ne[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;ne.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function jr(e){if(dt.length){const t=[...new Set(dt)].sort((n,s)=>Dt(n)-Dt(s));if(dt.length=0,We){We.push(...t);return}for(We=t,at=0;at<We.length;at++){const n=We[at];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}We=null,at=0}}const Dt=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Kr(e){try{for(Se=0;Se<ne.length;Se++){const t=ne[Se];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Kt(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Se<ne.length;Se++){const t=ne[Se];t&&(t.flags&=-2)}Se=-1,ne.length=0,jr(),on=null,(ne.length||dt.length)&&Kr()}}let Z=null,Lr=null;function ln(e){const t=Z;return Z=e,Lr=e&&e.type.__scopeId||null,t}function _o(e,t=Z,n){if(!t||e._n)return e;const s=(...r)=>{s._d&&Hs(-1);const i=ln(t);let o;try{o=e(...r)}finally{ln(i),s._d&&Hs(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Nc(e,t){if(Z===null)return e;const n=vn(Z),s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[i,o,l,c=K]=t[r];i&&(P(i)&&(i={mounted:i,updated:i}),i.deep&&De(o),s.push({dir:i,instance:n,value:o,oldValue:void 0,arg:l,modifiers:c}))}return e}function Qe(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;o<r.length;o++){const l=r[o];i&&(l.oldValue=i[o].value);let c=l.dir[s];c&&(Ue(),Te(c,n,8,[e.el,l,e,t]),je())}}const yo=Symbol("_vte"),wo=e=>e.__isTeleport,Eo=Symbol("_leaveCb");function hs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Hr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const cn=new WeakMap;function Ot(e,t,n,s,r=!1){if(T(e)){e.forEach((O,N)=>Ot(O,t&&(T(t)?t[N]:t),n,s,r));return}if(ht(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ot(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?vn(s.component):s.el,o=r?null:i,{i:l,r:c}=e,d=t&&t.r,u=l.refs===K?l.refs={}:l.refs,p=l.setupState,S=F(p),x=p===K?cr:O=>U(S,O);if(d!=null&&d!==c){if(Ps(t),q(d))u[d]=null,x(d)&&(p[d]=null);else if(G(d)){d.value=null;const O=t;O.k&&(u[O.k]=null)}}if(P(c))Kt(c,l,12,[o,u]);else{const O=q(c),N=G(c);if(O||N){const Q=()=>{if(e.f){const D=O?x(c)?p[c]:u[c]:c.value;if(r)T(D)&&ts(D,i);else if(T(D))D.includes(i)||D.push(i);else if(O)u[c]=[i],x(c)&&(p[c]=u[c]);else{const k=[i];c.value=k,e.k&&(u[e.k]=k)}}else O?(u[c]=o,x(c)&&(p[c]=o)):N&&(c.value=o,e.k&&(u[e.k]=o))};if(o){const D=()=>{Q(),cn.delete(e)};D.id=-1,cn.set(e,D),ce(D,n)}else Ps(e),Q()}}}function Ps(e){const t=cn.get(e);t&&(t.flags|=8,cn.delete(e))}mn().requestIdleCallback;mn().cancelIdleCallback;const ht=e=>!!e.type.__asyncLoader,$r=e=>e.type.__isKeepAlive;function So(e,t){Vr(e,"a",t)}function vo(e,t){Vr(e,"da",t)}function Vr(e,t,n=se){const s=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(wn(t,s,n),n){let r=n.parent;for(;r&&r.parent;)$r(r.parent.vnode)&&xo(s,t,n,r),r=r.parent}}function xo(e,t,n,s){const r=wn(t,e,s,!0);kr(()=>{ts(s[t],r)},n)}function wn(e,t,n=se,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Ue();const l=Lt(n),c=Te(t,n,e,o);return l(),je(),c});return s?r.unshift(i):r.push(i),i}}const He=e=>(t,n=se)=>{(!Ut||e==="sp")&&wn(e,(...s)=>t(...s),n)},Ao=He("bm"),Ro=He("m"),To=He("bu"),Oo=He("u"),Co=He("bum"),kr=He("um"),Io=He("sp"),Po=He("rtg"),Mo=He("rtc");function No(e,t=se){wn("ec",e,t)}const Do=Symbol.for("v-ndc");function Dc(e,t,n,s){let r;const i=n,o=T(e);if(o||q(e)){const l=o&&it(e);let c=!1,d=!1;l&&(c=!fe(e),d=Ke(e),e=bn(e)),r=new Array(e.length);for(let u=0,p=e.length;u<p;u++)r[u]=t(c?d?pt(ge(e[u])):ge(e[u]):e[u],u,void 0,i)}else if(typeof e=="number"){r=new Array(e);for(let l=0;l<e;l++)r[l]=t(l+1,l,void 0,i)}else if(V(e))if(e[Symbol.iterator])r=Array.from(e,(l,c)=>t(l,c,void 0,i));else{const l=Object.keys(e);r=new Array(l.length);for(let c=0,d=l.length;c<d;c++){const u=l[c];r[c]=t(e[u],u,c,i)}}else r=[];return r}function Fc(e,t,n={},s,r){if(Z.ce||Z.parent&&ht(Z.parent)&&Z.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),Yn(),zn(ue,null,[Re("slot",n,s&&s())],d?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),Yn();const o=i&&Wr(i(n)),l=n.key||o&&o.key,c=zn(ue,{key:(l&&!pe(l)?l:`_${t}`)+(!o&&s?"_fb":"")},o||(s?s():[]),o&&e._===1?64:-2);return i&&i._c&&(i._d=!0),c}function Wr(e){return e.some(t=>ms(t)?!(t.type===Le||t.type===ue&&!Wr(t.children)):!0)?e:null}const Bn=e=>e?di(e)?vn(e):Bn(e.parent):null,Ct=re(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Bn(e.parent),$root:e=>Bn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>qr(e),$forceUpdate:e=>e.f||(e.f=()=>{ds(e.update)}),$nextTick:e=>e.n||(e.n=Fr.bind(e.proxy)),$watch:e=>qo.bind(e)}),Mn=(e,t)=>e!==K&&!e.__isScriptSetup&&U(e,t),Fo={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:l,appContext:c}=e;if(t[0]!=="$"){const S=o[t];if(S!==void 0)switch(S){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(Mn(s,t))return o[t]=1,s[t];if(r!==K&&U(r,t))return o[t]=2,r[t];if(U(i,t))return o[t]=3,i[t];if(n!==K&&U(n,t))return o[t]=4,n[t];qn&&(o[t]=0)}}const d=Ct[t];let u,p;if(d)return t==="$attrs"&&X(e.attrs,"get",""),d(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==K&&U(n,t))return o[t]=4,n[t];if(p=c.config.globalProperties,U(p,t))return p[t]},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return Mn(r,t)?(r[t]=n,!0):s!==K&&U(s,t)?(s[t]=n,!0):U(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,props:i,type:o}},l){let c;return!!(n[l]||e!==K&&l[0]!=="$"&&U(e,l)||Mn(t,l)||U(i,l)||U(s,l)||U(Ct,l)||U(r.config.globalProperties,l)||(c=o.__cssModules)&&c[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:U(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Ms(e){return T(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let qn=!0;function Uo(e){const t=qr(e),n=e.proxy,s=e.ctx;qn=!1,t.beforeCreate&&Ns(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:c,inject:d,created:u,beforeMount:p,mounted:S,beforeUpdate:x,updated:O,activated:N,deactivated:Q,beforeDestroy:D,beforeUnmount:k,destroyed:B,unmounted:C,render:J,renderTracked:$e,renderTriggered:me,errorCaptured:Ve,serverPrefetch:Ht,expose:ze,inheritAttrs:_t,components:$t,directives:Vt,filters:An}=t;if(d&&jo(d,s,null),o)for(const W in o){const L=o[W];P(L)&&(s[W]=L.bind(n))}if(r){const W=r.call(n,n);V(W)&&(e.data=fs(W))}if(qn=!0,i)for(const W in i){const L=i[W],Xe=P(L)?L.bind(n,n):P(L.get)?L.get.bind(n,n):Ae,kt=!P(L)&&P(L.set)?L.set.bind(n):Ae,Ze=xl({get:Xe,set:kt});Object.defineProperty(s,W,{enumerable:!0,configurable:!0,get:()=>Ze.value,set:be=>Ze.value=be})}if(l)for(const W in l)Br(l[W],s,n,W);if(c){const W=P(c)?c.call(n):c;Reflect.ownKeys(W).forEach(L=>{ko(L,W[L])})}u&&Ns(u,e,"c");function ee(W,L){T(L)?L.forEach(Xe=>W(Xe.bind(n))):L&&W(L.bind(n))}if(ee(Ao,p),ee(Ro,S),ee(To,x),ee(Oo,O),ee(So,N),ee(vo,Q),ee(No,Ve),ee(Mo,$e),ee(Po,me),ee(Co,k),ee(kr,C),ee(Io,Ht),T(ze))if(ze.length){const W=e.exposed||(e.exposed={});ze.forEach(L=>{Object.defineProperty(W,L,{get:()=>n[L],set:Xe=>n[L]=Xe,enumerable:!0})})}else e.exposed||(e.exposed={});J&&e.render===Ae&&(e.render=J),_t!=null&&(e.inheritAttrs=_t),$t&&(e.components=$t),Vt&&(e.directives=Vt),Ht&&Hr(e)}function jo(e,t,n=Ae){T(e)&&(e=Jn(e));for(const s in e){const r=e[s];let i;V(r)?"default"in r?i=Xt(r.from||s,r.default,!0):i=Xt(r.from||s):i=Xt(r),G(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[s]=i}}function Ns(e,t,n){Te(T(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Br(e,t,n,s){let r=s.includes(".")?Yr(n,s):()=>n[s];if(q(e)){const i=t[e];P(i)&&Nn(r,i)}else if(P(e))Nn(r,e.bind(n));else if(V(e))if(T(e))e.forEach(i=>Br(i,t,n,s));else{const i=P(e.handler)?e.handler.bind(n):t[e.handler];P(i)&&Nn(r,i,e)}}function qr(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let c;return l?c=l:!r.length&&!n&&!s?c=t:(c={},r.length&&r.forEach(d=>an(c,d,o,!0)),an(c,t,o)),V(t)&&i.set(t,c),c}function an(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&an(e,i,n,!0),r&&r.forEach(o=>an(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=Ko[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const Ko={data:Ds,props:Fs,emits:Fs,methods:xt,computed:xt,beforeCreate:te,created:te,beforeMount:te,mounted:te,beforeUpdate:te,updated:te,beforeDestroy:te,beforeUnmount:te,destroyed:te,unmounted:te,activated:te,deactivated:te,errorCaptured:te,serverPrefetch:te,components:xt,directives:xt,watch:Ho,provide:Ds,inject:Lo};function Ds(e,t){return t?e?function(){return re(P(e)?e.call(this,this):e,P(t)?t.call(this,this):t)}:t:e}function Lo(e,t){return xt(Jn(e),Jn(t))}function Jn(e){if(T(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function te(e,t){return e?[...new Set([].concat(e,t))]:t}function xt(e,t){return e?re(Object.create(null),e,t):t}function Fs(e,t){return e?T(e)&&T(t)?[...new Set([...e,...t])]:re(Object.create(null),Ms(e),Ms(t??{})):t}function Ho(e,t){if(!e)return t;if(!t)return e;const n=re(Object.create(null),e);for(const s in t)n[s]=te(e[s],t[s]);return n}function Jr(){return{app:null,config:{isNativeTag:cr,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let $o=0;function Vo(e,t){return function(s,r=null){P(s)||(s=re({},s)),r!=null&&!V(r)&&(r=null);const i=Jr(),o=new WeakSet,l=[];let c=!1;const d=i.app={_uid:$o++,_component:s,_props:r,_container:null,_context:i,_instance:null,version:Al,get config(){return i.config},set config(u){},use(u,...p){return o.has(u)||(u&&P(u.install)?(o.add(u),u.install(d,...p)):P(u)&&(o.add(u),u(d,...p))),d},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),d},component(u,p){return p?(i.components[u]=p,d):i.components[u]},directive(u,p){return p?(i.directives[u]=p,d):i.directives[u]},mount(u,p,S){if(!c){const x=d._ceVNode||Re(s,r);return x.appContext=i,S===!0?S="svg":S===!1&&(S=void 0),e(x,u,S),c=!0,d._container=u,u.__vue_app__=d,vn(x.component)}},onUnmount(u){l.push(u)},unmount(){c&&(Te(l,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(u,p){return i.provides[u]=p,d},runWithContext(u){const p=ot;ot=d;try{return u()}finally{ot=p}}};return d}}let ot=null;function ko(e,t){if(se){let n=se.provides;const s=se.parent&&se.parent.provides;s===n&&(n=se.provides=Object.create(s)),n[e]=t}}function Xt(e,t,n=!1){const s=ui();if(s||ot){let r=ot?ot._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&P(t)?t.call(s&&s.proxy):t}}function Uc(){return!!(ui()||ot)}const Wo=Symbol.for("v-scx"),Bo=()=>Xt(Wo);function Nn(e,t,n){return Gr(e,t,n)}function Gr(e,t,n=K){const{immediate:s,deep:r,flush:i,once:o}=n,l=re({},n),c=t&&s||!t&&i!=="post";let d;if(Ut){if(i==="sync"){const x=Bo();d=x.__watcherHandles||(x.__watcherHandles=[])}else if(!c){const x=()=>{};return x.stop=Ae,x.resume=Ae,x.pause=Ae,x}}const u=se;l.call=(x,O,N)=>Te(x,u,O,N);let p=!1;i==="post"?l.scheduler=x=>{ce(x,u&&u.suspense)}:i!=="sync"&&(p=!0,l.scheduler=(x,O)=>{O?x():ds(x)}),l.augmentJob=x=>{t&&(x.flags|=4),p&&(x.flags|=2,u&&(x.id=u.uid,x.i=u))};const S=po(e,t,l);return Ut&&(d?d.push(S):c&&S()),S}function qo(e,t,n){const s=this.proxy,r=q(e)?e.includes(".")?Yr(s,e):()=>s[e]:e.bind(s,s);let i;P(t)?i=t:(i=t.handler,n=t);const o=Lt(this),l=Gr(r,i.bind(s),n);return o(),l}function Yr(e,t){const n=t.split(".");return()=>{let s=e;for(let r=0;r<n.length&&s;r++)s=s[n[r]];return s}}const Jo=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Je(t)}Modifiers`]||e[`${Ye(t)}Modifiers`];function Go(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||K;let r=n;const i=t.startsWith("update:"),o=i&&Jo(s,t.slice(7));o&&(o.trim&&(r=n.map(u=>q(u)?u.trim():u)),o.number&&(r=n.map(gn)));let l,c=s[l=Tn(t)]||s[l=Tn(Je(t))];!c&&i&&(c=s[l=Tn(Ye(t))]),c&&Te(c,e,6,r);const d=s[l+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Te(d,e,6,r)}}const Yo=new WeakMap;function zr(e,t,n=!1){const s=n?Yo:t.emitsCache,r=s.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!P(e)){const c=d=>{const u=zr(d,t,!0);u&&(l=!0,re(o,u))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(V(e)&&s.set(e,null),null):(T(i)?i.forEach(c=>o[c]=null):re(o,i),V(e)&&s.set(e,o),o)}function En(e,t){return!e||!dn(t)?!1:(t=t.slice(2).replace(/Once$/,""),U(e,t[0].toLowerCase()+t.slice(1))||U(e,Ye(t))||U(e,t))}function Us(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:c,render:d,renderCache:u,props:p,data:S,setupState:x,ctx:O,inheritAttrs:N}=e,Q=ln(e);let D,k;try{if(n.shapeFlag&4){const C=r||s,J=C;D=ve(d.call(J,C,u,p,x,S,O)),k=l}else{const C=t;D=ve(C.length>1?C(p,{attrs:l,slots:o,emit:c}):C(p,null)),k=t.props?l:zo(l)}}catch(C){It.length=0,yn(C,e,1),D=Re(Le)}let B=D;if(k&&N!==!1){const C=Object.keys(k),{shapeFlag:J}=B;C.length&&J&7&&(i&&C.some(es)&&(k=Xo(k,i)),B=gt(B,k,!1,!0))}return n.dirs&&(B=gt(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(n.dirs):n.dirs),n.transition&&hs(B,n.transition),D=B,ln(Q),D}const zo=e=>{let t;for(const n in e)(n==="class"||n==="style"||dn(n))&&((t||(t={}))[n]=e[n]);return t},Xo=(e,t)=>{const n={};for(const s in e)(!es(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Zo(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:l,patchFlag:c}=t,d=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return s?js(s,o,d):!!o;if(c&8){const u=t.dynamicProps;for(let p=0;p<u.length;p++){const S=u[p];if(o[S]!==s[S]&&!En(d,S))return!0}}}else return(r||l)&&(!l||!l.$stable)?!0:s===o?!1:s?o?js(s,o,d):!0:!!o;return!1}function js(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const i=s[r];if(t[i]!==e[i]&&!En(n,i))return!0}return!1}function Qo({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s===e)(e=t.vnode).el=n,t=t.parent;else break}}const Xr={},Zr=()=>Object.create(Xr),Qr=e=>Object.getPrototypeOf(e)===Xr;function el(e,t,n,s=!1){const r={},i=Zr();e.propsDefaults=Object.create(null),ei(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:so(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function tl(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=F(r),[c]=e.propsOptions;let d=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let p=0;p<u.length;p++){let S=u[p];if(En(e.emitsOptions,S))continue;const x=t[S];if(c)if(U(i,S))x!==i[S]&&(i[S]=x,d=!0);else{const O=Je(S);r[O]=Gn(c,l,O,x,e,!1)}else x!==i[S]&&(i[S]=x,d=!0)}}}else{ei(e,t,r,i)&&(d=!0);let u;for(const p in l)(!t||!U(t,p)&&((u=Ye(p))===p||!U(t,u)))&&(c?n&&(n[p]!==void 0||n[u]!==void 0)&&(r[p]=Gn(c,l,p,void 0,e,!0)):delete r[p]);if(i!==l)for(const p in i)(!t||!U(t,p))&&(delete i[p],d=!0)}d&&Ne(e.attrs,"set","")}function ei(e,t,n,s){const[r,i]=e.propsOptions;let o=!1,l;if(t)for(let c in t){if(At(c))continue;const d=t[c];let u;r&&U(r,u=Je(c))?!i||!i.includes(u)?n[u]=d:(l||(l={}))[u]=d:En(e.emitsOptions,c)||(!(c in s)||d!==s[c])&&(s[c]=d,o=!0)}if(i){const c=F(n),d=l||K;for(let u=0;u<i.length;u++){const p=i[u];n[p]=Gn(r,c,p,d[p],e,!U(d,p))}}return o}function Gn(e,t,n,s,r,i){const o=e[n];if(o!=null){const l=U(o,"default");if(l&&s===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&P(c)){const{propsDefaults:d}=r;if(n in d)s=d[n];else{const u=Lt(r);s=d[n]=c.call(null,t),u()}}else s=c;r.ce&&r.ce._setProp(n,s)}o[0]&&(i&&!l?s=!1:o[1]&&(s===""||s===Ye(n))&&(s=!0))}return s}const nl=new WeakMap;function ti(e,t,n=!1){const s=n?nl:t.propsCache,r=s.get(e);if(r)return r;const i=e.props,o={},l=[];let c=!1;if(!P(e)){const u=p=>{c=!0;const[S,x]=ti(p,t,!0);re(o,S),x&&l.push(...x)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!c)return V(e)&&s.set(e,ft),ft;if(T(i))for(let u=0;u<i.length;u++){const p=Je(i[u]);Ks(p)&&(o[p]=K)}else if(i)for(const u in i){const p=Je(u);if(Ks(p)){const S=i[u],x=o[p]=T(S)||P(S)?{type:S}:re({},S),O=x.type;let N=!1,Q=!0;if(T(O))for(let D=0;D<O.length;++D){const k=O[D],B=P(k)&&k.name;if(B==="Boolean"){N=!0;break}else B==="String"&&(Q=!1)}else N=P(O)&&O.name==="Boolean";x[0]=N,x[1]=Q,(N||U(x,"default"))&&l.push(p)}}const d=[o,l];return V(e)&&s.set(e,d),d}function Ks(e){return e[0]!=="$"&&!At(e)}const ps=e=>e==="_"||e==="_ctx"||e==="$stable",gs=e=>T(e)?e.map(ve):[ve(e)],sl=(e,t,n)=>{if(t._n)return t;const s=_o((...r)=>gs(t(...r)),n);return s._c=!1,s},ni=(e,t,n)=>{const s=e._ctx;for(const r in e){if(ps(r))continue;const i=e[r];if(P(i))t[r]=sl(r,i,s);else if(i!=null){const o=gs(i);t[r]=()=>o}}},si=(e,t)=>{const n=gs(t);e.slots.default=()=>n},ri=(e,t,n)=>{for(const s in t)(n||!ps(s))&&(e[s]=t[s])},rl=(e,t,n)=>{const s=e.slots=Zr();if(e.vnode.shapeFlag&32){const r=t._;r?(ri(s,t,n),n&&hr(s,"_",r,!0)):ni(t,s)}else t&&si(e,t)},il=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=K;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:ri(r,t,n):(i=!t.$stable,ni(t,r)),o=t}else t&&(si(e,t),o={default:1});if(i)for(const l in r)!ps(l)&&o[l]==null&&delete r[l]},ce=fl;function ol(e){return ll(e)}function ll(e,t){const n=mn();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:d,setElementText:u,parentNode:p,nextSibling:S,setScopeId:x=Ae,insertStaticContent:O}=e,N=(a,f,h,_=null,g=null,m=null,E=void 0,w=null,y=!!f.dynamicChildren)=>{if(a===f)return;a&&!vt(a,f)&&(_=Wt(a),be(a,g,m,!0),a=null),f.patchFlag===-2&&(y=!1,f.dynamicChildren=null);const{type:b,ref:R,shapeFlag:v}=f;switch(b){case Sn:Q(a,f,h,_);break;case Le:D(a,f,h,_);break;case Fn:a==null&&k(f,h,_,E);break;case ue:$t(a,f,h,_,g,m,E,w,y);break;default:v&1?J(a,f,h,_,g,m,E,w,y):v&6?Vt(a,f,h,_,g,m,E,w,y):(v&64||v&128)&&b.process(a,f,h,_,g,m,E,w,y,wt)}R!=null&&g?Ot(R,a&&a.ref,m,f||a,!f):R==null&&a&&a.ref!=null&&Ot(a.ref,null,m,a,!0)},Q=(a,f,h,_)=>{if(a==null)s(f.el=l(f.children),h,_);else{const g=f.el=a.el;f.children!==a.children&&d(g,f.children)}},D=(a,f,h,_)=>{a==null?s(f.el=c(f.children||""),h,_):f.el=a.el},k=(a,f,h,_)=>{[a.el,a.anchor]=O(a.children,f,h,_,a.el,a.anchor)},B=({el:a,anchor:f},h,_)=>{let g;for(;a&&a!==f;)g=S(a),s(a,h,_),a=g;s(f,h,_)},C=({el:a,anchor:f})=>{let h;for(;a&&a!==f;)h=S(a),r(a),a=h;r(f)},J=(a,f,h,_,g,m,E,w,y)=>{if(f.type==="svg"?E="svg":f.type==="math"&&(E="mathml"),a==null)$e(f,h,_,g,m,E,w,y);else{const b=a.el&&a.el._isVueCE?a.el:null;try{b&&b._beginPatch(),Ht(a,f,g,m,E,w,y)}finally{b&&b._endPatch()}}},$e=(a,f,h,_,g,m,E,w)=>{let y,b;const{props:R,shapeFlag:v,transition:A,dirs:I}=a;if(y=a.el=o(a.type,m,R&&R.is,R),v&8?u(y,a.children):v&16&&Ve(a.children,y,null,_,g,Dn(a,m),E,w),I&&Qe(a,null,_,"created"),me(y,a,a.scopeId,E,_),R){for(const H in R)H!=="value"&&!At(H)&&i(y,H,null,R[H],m,_);"value"in R&&i(y,"value",null,R.value,m),(b=R.onVnodeBeforeMount)&&Ee(b,_,a)}I&&Qe(a,null,_,"beforeMount");const M=cl(g,A);M&&A.beforeEnter(y),s(y,f,h),((b=R&&R.onVnodeMounted)||M||I)&&ce(()=>{b&&Ee(b,_,a),M&&A.enter(y),I&&Qe(a,null,_,"mounted")},g)},me=(a,f,h,_,g)=>{if(h&&x(a,h),_)for(let m=0;m<_.length;m++)x(a,_[m]);if(g){let m=g.subTree;if(f===m||li(m.type)&&(m.ssContent===f||m.ssFallback===f)){const E=g.vnode;me(a,E,E.scopeId,E.slotScopeIds,g.parent)}}},Ve=(a,f,h,_,g,m,E,w,y=0)=>{for(let b=y;b<a.length;b++){const R=a[b]=w?Be(a[b]):ve(a[b]);N(null,R,f,h,_,g,m,E,w)}},Ht=(a,f,h,_,g,m,E)=>{const w=f.el=a.el;let{patchFlag:y,dynamicChildren:b,dirs:R}=f;y|=a.patchFlag&16;const v=a.props||K,A=f.props||K;let I;if(h&&et(h,!1),(I=A.onVnodeBeforeUpdate)&&Ee(I,h,f,a),R&&Qe(f,a,h,"beforeUpdate"),h&&et(h,!0),(v.innerHTML&&A.innerHTML==null||v.textContent&&A.textContent==null)&&u(w,""),b?ze(a.dynamicChildren,b,w,h,_,Dn(f,g),m):E||L(a,f,w,null,h,_,Dn(f,g),m,!1),y>0){if(y&16)_t(w,v,A,h,g);else if(y&2&&v.class!==A.class&&i(w,"class",null,A.class,g),y&4&&i(w,"style",v.style,A.style,g),y&8){const M=f.dynamicProps;for(let H=0;H<M.length;H++){const j=M[H],ie=v[j],oe=A[j];(oe!==ie||j==="value")&&i(w,j,ie,oe,g,h)}}y&1&&a.children!==f.children&&u(w,f.children)}else!E&&b==null&&_t(w,v,A,h,g);((I=A.onVnodeUpdated)||R)&&ce(()=>{I&&Ee(I,h,f,a),R&&Qe(f,a,h,"updated")},_)},ze=(a,f,h,_,g,m,E)=>{for(let w=0;w<f.length;w++){const y=a[w],b=f[w],R=y.el&&(y.type===ue||!vt(y,b)||y.shapeFlag&198)?p(y.el):h;N(y,b,R,null,_,g,m,E,!0)}},_t=(a,f,h,_,g)=>{if(f!==h){if(f!==K)for(const m in f)!At(m)&&!(m in h)&&i(a,m,f[m],null,g,_);for(const m in h){if(At(m))continue;const E=h[m],w=f[m];E!==w&&m!=="value"&&i(a,m,w,E,g,_)}"value"in h&&i(a,"value",f.value,h.value,g)}},$t=(a,f,h,_,g,m,E,w,y)=>{const b=f.el=a?a.el:l(""),R=f.anchor=a?a.anchor:l("");let{patchFlag:v,dynamicChildren:A,slotScopeIds:I}=f;I&&(w=w?w.concat(I):I),a==null?(s(b,h,_),s(R,h,_),Ve(f.children||[],h,R,g,m,E,w,y)):v>0&&v&64&&A&&a.dynamicChildren?(ze(a.dynamicChildren,A,h,g,m,E,w),(f.key!=null||g&&f===g.subTree)&&ii(a,f,!0)):L(a,f,h,R,g,m,E,w,y)},Vt=(a,f,h,_,g,m,E,w,y)=>{f.slotScopeIds=w,a==null?f.shapeFlag&512?g.ctx.activate(f,h,_,E,y):An(f,h,_,g,m,E,y):ws(a,f,y)},An=(a,f,h,_,g,m,E)=>{const w=a.component=_l(a,_,g);if($r(a)&&(w.ctx.renderer=wt),yl(w,!1,E),w.asyncDep){if(g&&g.registerDep(w,ee,E),!a.el){const y=w.subTree=Re(Le);D(null,y,f,h),a.placeholder=y.el}}else ee(w,a,f,h,g,m,E)},ws=(a,f,h)=>{const _=f.component=a.component;if(Zo(a,f,h))if(_.asyncDep&&!_.asyncResolved){W(_,f,h);return}else _.next=f,_.update();else f.el=a.el,_.vnode=f},ee=(a,f,h,_,g,m,E)=>{const w=()=>{if(a.isMounted){let{next:v,bu:A,u:I,parent:M,vnode:H}=a;{const ye=oi(a);if(ye){v&&(v.el=H.el,W(a,v,E)),ye.asyncDep.then(()=>{a.isUnmounted||w()});return}}let j=v,ie;et(a,!1),v?(v.el=H.el,W(a,v,E)):v=H,A&&zt(A),(ie=v.props&&v.props.onVnodeBeforeUpdate)&&Ee(ie,M,v,H),et(a,!0);const oe=Us(a),_e=a.subTree;a.subTree=oe,N(_e,oe,p(_e.el),Wt(_e),a,g,m),v.el=oe.el,j===null&&Qo(a,oe.el),I&&ce(I,g),(ie=v.props&&v.props.onVnodeUpdated)&&ce(()=>Ee(ie,M,v,H),g)}else{let v;const{el:A,props:I}=f,{bm:M,m:H,parent:j,root:ie,type:oe}=a,_e=ht(f);et(a,!1),M&&zt(M),!_e&&(v=I&&I.onVnodeBeforeMount)&&Ee(v,j,f),et(a,!0);{ie.ce&&ie.ce._def.shadowRoot!==!1&&ie.ce._injectChildStyle(oe);const ye=a.subTree=Us(a);N(null,ye,h,_,a,g,m),f.el=ye.el}if(H&&ce(H,g),!_e&&(v=I&&I.onVnodeMounted)){const ye=f;ce(()=>Ee(v,j,ye),g)}(f.shapeFlag&256||j&&ht(j.vnode)&&j.vnode.shapeFlag&256)&&a.a&&ce(a.a,g),a.isMounted=!0,f=h=_=null}};a.scope.on();const y=a.effect=new _r(w);a.scope.off();const b=a.update=y.run.bind(y),R=a.job=y.runIfDirty.bind(y);R.i=a,R.id=a.uid,y.scheduler=()=>ds(R),et(a,!0),b()},W=(a,f,h)=>{f.component=a;const _=a.vnode.props;a.vnode=f,a.next=null,tl(a,f.props,_,h),il(a,f.children,h),Ue(),Is(a),je()},L=(a,f,h,_,g,m,E,w,y=!1)=>{const b=a&&a.children,R=a?a.shapeFlag:0,v=f.children,{patchFlag:A,shapeFlag:I}=f;if(A>0){if(A&128){kt(b,v,h,_,g,m,E,w,y);return}else if(A&256){Xe(b,v,h,_,g,m,E,w,y);return}}I&8?(R&16&&yt(b,g,m),v!==b&&u(h,v)):R&16?I&16?kt(b,v,h,_,g,m,E,w,y):yt(b,g,m,!0):(R&8&&u(h,""),I&16&&Ve(v,h,_,g,m,E,w,y))},Xe=(a,f,h,_,g,m,E,w,y)=>{a=a||ft,f=f||ft;const b=a.length,R=f.length,v=Math.min(b,R);let A;for(A=0;A<v;A++){const I=f[A]=y?Be(f[A]):ve(f[A]);N(a[A],I,h,null,g,m,E,w,y)}b>R?yt(a,g,m,!0,!1,v):Ve(f,h,_,g,m,E,w,y,v)},kt=(a,f,h,_,g,m,E,w,y)=>{let b=0;const R=f.length;let v=a.length-1,A=R-1;for(;b<=v&&b<=A;){const I=a[b],M=f[b]=y?Be(f[b]):ve(f[b]);if(vt(I,M))N(I,M,h,null,g,m,E,w,y);else break;b++}for(;b<=v&&b<=A;){const I=a[v],M=f[A]=y?Be(f[A]):ve(f[A]);if(vt(I,M))N(I,M,h,null,g,m,E,w,y);else break;v--,A--}if(b>v){if(b<=A){const I=A+1,M=I<R?f[I].el:_;for(;b<=A;)N(null,f[b]=y?Be(f[b]):ve(f[b]),h,M,g,m,E,w,y),b++}}else if(b>A)for(;b<=v;)be(a[b],g,m,!0),b++;else{const I=b,M=b,H=new Map;for(b=M;b<=A;b++){const le=f[b]=y?Be(f[b]):ve(f[b]);le.key!=null&&H.set(le.key,b)}let j,ie=0;const oe=A-M+1;let _e=!1,ye=0;const Et=new Array(oe);for(b=0;b<oe;b++)Et[b]=0;for(b=I;b<=v;b++){const le=a[b];if(ie>=oe){be(le,g,m,!0);continue}let we;if(le.key!=null)we=H.get(le.key);else for(j=M;j<=A;j++)if(Et[j-M]===0&&vt(le,f[j])){we=j;break}we===void 0?be(le,g,m,!0):(Et[we-M]=b+1,we>=ye?ye=we:_e=!0,N(le,f[we],h,null,g,m,E,w,y),ie++)}const vs=_e?al(Et):ft;for(j=vs.length-1,b=oe-1;b>=0;b--){const le=M+b,we=f[le],xs=f[le+1],As=le+1<R?xs.el||xs.placeholder:_;Et[b]===0?N(null,we,h,As,g,m,E,w,y):_e&&(j<0||b!==vs[j]?Ze(we,h,As,2):j--)}}},Ze=(a,f,h,_,g=null)=>{const{el:m,type:E,transition:w,children:y,shapeFlag:b}=a;if(b&6){Ze(a.component.subTree,f,h,_);return}if(b&128){a.suspense.move(f,h,_);return}if(b&64){E.move(a,f,h,wt);return}if(E===ue){s(m,f,h);for(let v=0;v<y.length;v++)Ze(y[v],f,h,_);s(a.anchor,f,h);return}if(E===Fn){B(a,f,h);return}if(_!==2&&b&1&&w)if(_===0)w.beforeEnter(m),s(m,f,h),ce(()=>w.enter(m),g);else{const{leave:v,delayLeave:A,afterLeave:I}=w,M=()=>{a.ctx.isUnmounted?r(m):s(m,f,h)},H=()=>{m._isLeaving&&m[Eo](!0),v(m,()=>{M(),I&&I()})};A?A(m,M,H):H()}else s(m,f,h)},be=(a,f,h,_=!1,g=!1)=>{const{type:m,props:E,ref:w,children:y,dynamicChildren:b,shapeFlag:R,patchFlag:v,dirs:A,cacheIndex:I}=a;if(v===-2&&(g=!1),w!=null&&(Ue(),Ot(w,null,h,a,!0),je()),I!=null&&(f.renderCache[I]=void 0),R&256){f.ctx.deactivate(a);return}const M=R&1&&A,H=!ht(a);let j;if(H&&(j=E&&E.onVnodeBeforeUnmount)&&Ee(j,f,a),R&6)xi(a.component,h,_);else{if(R&128){a.suspense.unmount(h,_);return}M&&Qe(a,null,f,"beforeUnmount"),R&64?a.type.remove(a,f,h,wt,_):b&&!b.hasOnce&&(m!==ue||v>0&&v&64)?yt(b,f,h,!1,!0):(m===ue&&v&384||!g&&R&16)&&yt(y,f,h),_&&Es(a)}(H&&(j=E&&E.onVnodeUnmounted)||M)&&ce(()=>{j&&Ee(j,f,a),M&&Qe(a,null,f,"unmounted")},h)},Es=a=>{const{type:f,el:h,anchor:_,transition:g}=a;if(f===ue){vi(h,_);return}if(f===Fn){C(a);return}const m=()=>{r(h),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(a.shapeFlag&1&&g&&!g.persisted){const{leave:E,delayLeave:w}=g,y=()=>E(h,m);w?w(a.el,m,y):y()}else m()},vi=(a,f)=>{let h;for(;a!==f;)h=S(a),r(a),a=h;r(f)},xi=(a,f,h)=>{const{bum:_,scope:g,job:m,subTree:E,um:w,m:y,a:b}=a;Ls(y),Ls(b),_&&zt(_),g.stop(),m&&(m.flags|=8,be(E,a,f,h)),w&&ce(w,f),ce(()=>{a.isUnmounted=!0},f)},yt=(a,f,h,_=!1,g=!1,m=0)=>{for(let E=m;E<a.length;E++)be(a[E],f,h,_,g)},Wt=a=>{if(a.shapeFlag&6)return Wt(a.component.subTree);if(a.shapeFlag&128)return a.suspense.next();const f=S(a.anchor||a.el),h=f&&f[yo];return h?S(h):f};let Rn=!1;const Ss=(a,f,h)=>{a==null?f._vnode&&be(f._vnode,null,null,!0):N(f._vnode||null,a,f,null,null,null,h),f._vnode=a,Rn||(Rn=!0,Is(),jr(),Rn=!1)},wt={p:N,um:be,m:Ze,r:Es,mt:An,mc:Ve,pc:L,pbc:ze,n:Wt,o:e};return{render:Ss,hydrate:void 0,createApp:Vo(Ss)}}function Dn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function et({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function cl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ii(e,t,n=!1){const s=e.children,r=t.children;if(T(s)&&T(r))for(let i=0;i<s.length;i++){const o=s[i];let l=r[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=r[i]=Be(r[i]),l.el=o.el),!n&&l.patchFlag!==-2&&ii(o,l)),l.type===Sn&&l.patchFlag!==-1&&(l.el=o.el),l.type===Le&&!l.el&&(l.el=o.el)}}function al(e){const t=e.slice(),n=[0];let s,r,i,o,l;const c=e.length;for(s=0;s<c;s++){const d=e[s];if(d!==0){if(r=n[n.length-1],e[r]<d){t[s]=r,n.push(s);continue}for(i=0,o=n.length-1;i<o;)l=i+o>>1,e[n[l]]<d?i=l+1:o=l;d<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}function oi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:oi(t)}function Ls(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const li=e=>e.__isSuspense;function fl(e,t){t&&t.pendingBranch?T(e)?t.effects.push(...e):t.effects.push(e):bo(e)}const ue=Symbol.for("v-fgt"),Sn=Symbol.for("v-txt"),Le=Symbol.for("v-cmt"),Fn=Symbol.for("v-stc"),It=[];let ae=null;function Yn(e=!1){It.push(ae=e?null:[])}function ul(){It.pop(),ae=It[It.length-1]||null}let Ft=1;function Hs(e,t=!1){Ft+=e,e<0&&ae&&t&&(ae.hasOnce=!0)}function ci(e){return e.dynamicChildren=Ft>0?ae||ft:null,ul(),Ft>0&&ae&&ae.push(e),e}function jc(e,t,n,s,r,i){return ci(fi(e,t,n,s,r,i,!0))}function zn(e,t,n,s,r){return ci(Re(e,t,n,s,r,!0))}function ms(e){return e?e.__v_isVNode===!0:!1}function vt(e,t){return e.type===t.type&&e.key===t.key}const ai=({key:e})=>e??null,Zt=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?q(e)||G(e)||P(e)?{i:Z,r:e,k:t,f:!!n}:e:null);function fi(e,t=null,n=null,s=0,r=null,i=e===ue?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ai(t),ref:t&&Zt(t),scopeId:Lr,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Z};return l?(bs(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=q(n)?8:16),Ft>0&&!o&&ae&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&ae.push(c),c}const Re=dl;function dl(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===Do)&&(e=Le),ms(e)){const l=gt(e,t,!0);return n&&bs(l,n),Ft>0&&!i&&ae&&(l.shapeFlag&6?ae[ae.indexOf(e)]=l:ae.push(l)),l.patchFlag=-2,l}if(vl(e)&&(e=e.__vccOpts),t){t=hl(t);let{class:l,style:c}=t;l&&!q(l)&&(t.class=ss(l)),V(c)&&(_n(c)&&!T(c)&&(c=re({},c)),t.style=ns(c))}const o=q(e)?1:li(e)?128:wo(e)?64:V(e)?4:P(e)?2:0;return fi(e,t,n,s,r,o,i,!0)}function hl(e){return e?_n(e)||Qr(e)?re({},e):e:null}function gt(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:c}=e,d=t?gl(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&ai(d),ref:t&&t.ref?n&&i?T(i)?i.concat(Zt(t)):[i,Zt(t)]:Zt(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ue?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&gt(e.ssContent),ssFallback:e.ssFallback&&gt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&s&&hs(u,c.clone(u)),u}function pl(e=" ",t=0){return Re(Sn,null,e,t)}function Kc(e="",t=!1){return t?(Yn(),zn(Le,null,e)):Re(Le,null,e)}function ve(e){return e==null||typeof e=="boolean"?Re(Le):T(e)?Re(ue,null,e.slice()):ms(e)?Be(e):Re(Sn,null,String(e))}function Be(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:gt(e)}function bs(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(T(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),bs(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Qr(t)?t._ctx=Z:r===3&&Z&&(Z.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else P(t)?(t={default:t,_ctx:Z},n=32):(t=String(t),s&64?(n=16,t=[pl(t)]):n=8);e.children=t,e.shapeFlag|=n}function gl(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const r in s)if(r==="class")t.class!==s.class&&(t.class=ss([t.class,s.class]));else if(r==="style")t.style=ns([t.style,s.style]);else if(dn(r)){const i=t[r],o=s[r];o&&i!==o&&!(T(i)&&i.includes(o))&&(t[r]=i?[].concat(i,o):o)}else r!==""&&(t[r]=s[r])}return t}function Ee(e,t,n,s=null){Te(e,t,7,[n,s])}const ml=Jr();let bl=0;function _l(e,t,n){const s=e.type,r=(t?t.appContext:e.appContext)||ml,i={uid:bl++,vnode:e,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new br(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ti(s,r),emitsOptions:zr(s,r),emit:null,emitted:null,propsDefaults:K,inheritAttrs:s.inheritAttrs,ctx:K,data:K,props:K,attrs:K,slots:K,refs:K,setupState:K,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=Go.bind(null,i),e.ce&&e.ce(i),i}let se=null;const ui=()=>se||Z;let fn,Xn;{const e=mn(),t=(n,s)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(s),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};fn=t("__VUE_INSTANCE_SETTERS__",n=>se=n),Xn=t("__VUE_SSR_SETTERS__",n=>Ut=n)}const Lt=e=>{const t=se;return fn(e),e.scope.on(),()=>{e.scope.off(),fn(t)}},$s=()=>{se&&se.scope.off(),fn(null)};function di(e){return e.vnode.shapeFlag&4}let Ut=!1;function yl(e,t=!1,n=!1){t&&Xn(t);const{props:s,children:r}=e.vnode,i=di(e);el(e,s,i,t),rl(e,r,n||t);const o=i?wl(e,t):void 0;return t&&Xn(!1),o}function wl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Fo);const{setup:s}=n;if(s){Ue();const r=e.setupContext=s.length>1?Sl(e):null,i=Lt(e),o=Kt(s,e,0,[e.props,r]),l=ar(o);if(je(),i(),(l||e.sp)&&!ht(e)&&Hr(e),l){if(o.then($s,$s),t)return o.then(c=>{Vs(e,c)}).catch(c=>{yn(c,e,0)});e.asyncDep=o}else Vs(e,o)}else hi(e)}function Vs(e,t,n){P(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:V(t)&&(e.setupState=Nr(t)),hi(e)}function hi(e,t,n){const s=e.type;e.render||(e.render=s.render||Ae);{const r=Lt(e);Ue();try{Uo(e)}finally{je(),r()}}}const El={get(e,t){return X(e,"get",""),e[t]}};function Sl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,El),slots:e.slots,emit:e.emit,expose:t}}function vn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Nr(ro(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ct)return Ct[n](e)},has(t,n){return n in t||n in Ct}})):e.proxy}function vl(e){return P(e)&&"__vccOpts"in e}const xl=(e,t)=>uo(e,t,Ut),Al="3.5.25";let Zn;const ks=typeof window<"u"&&window.trustedTypes;if(ks)try{Zn=ks.createPolicy("vue",{createHTML:e=>e})}catch{}const pi=Zn?e=>Zn.createHTML(e):e=>e,Rl="http://www.w3.org/2000/svg",Tl="http://www.w3.org/1998/Math/MathML",Ce=typeof document<"u"?document:null,Ws=Ce&&Ce.createElement("template"),Ol={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t==="svg"?Ce.createElementNS(Rl,e):t==="mathml"?Ce.createElementNS(Tl,e):n?Ce.createElement(e,{is:n}):Ce.createElement(e);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>Ce.createTextNode(e),createComment:e=>Ce.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ce.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{Ws.innerHTML=pi(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Ws.content;if(s==="svg"||s==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Cl=Symbol("_vtc");function Il(e,t,n){const s=e[Cl];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Bs=Symbol("_vod"),Pl=Symbol("_vsh"),Ml=Symbol(""),Nl=/(?:^|;)\s*display\s*:/;function Dl(e,t,n){const s=e.style,r=q(n);let i=!1;if(n&&!r){if(t)if(q(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&Qt(s,l,"")}else for(const o in t)n[o]==null&&Qt(s,o,"");for(const o in n)o==="display"&&(i=!0),Qt(s,o,n[o])}else if(r){if(t!==n){const o=s[Ml];o&&(n+=";"+o),s.cssText=n,i=Nl.test(n)}}else t&&e.removeAttribute("style");Bs in e&&(e[Bs]=i?s.display:"",e[Pl]&&(s.display="none"))}const qs=/\s*!important$/;function Qt(e,t,n){if(T(n))n.forEach(s=>Qt(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Fl(e,t);qs.test(n)?e.setProperty(Ye(s),n.replace(qs,""),"important"):e[s]=n}}const Js=["Webkit","Moz","ms"],Un={};function Fl(e,t){const n=Un[t];if(n)return n;let s=Je(t);if(s!=="filter"&&s in e)return Un[t]=s;s=dr(s);for(let r=0;r<Js.length;r++){const i=Js[r]+s;if(i in e)return Un[t]=i}return t}const Gs="http://www.w3.org/1999/xlink";function Ys(e,t,n,s,r,i=Di(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Gs,t.slice(6,t.length)):e.setAttributeNS(Gs,t,n):n==null||i&&!pr(n)?e.removeAttribute(t):e.setAttribute(t,i?"":pe(n)?String(n):n)}function zs(e,t,n,s,r){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?pi(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(l!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=pr(n):n==null&&l==="string"?(n="",o=!0):l==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(r||t)}function Fe(e,t,n,s){e.addEventListener(t,n,s)}function Ul(e,t,n,s){e.removeEventListener(t,n,s)}const Xs=Symbol("_vei");function jl(e,t,n,s,r=null){const i=e[Xs]||(e[Xs]={}),o=i[t];if(s&&o)o.value=s;else{const[l,c]=Kl(t);if(s){const d=i[t]=$l(s,r);Fe(e,l,d,c)}else o&&(Ul(e,l,o,c),i[t]=void 0)}}const Zs=/(?:Once|Passive|Capture)$/;function Kl(e){let t;if(Zs.test(e)){t={};let s;for(;s=e.match(Zs);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ye(e.slice(2)),t]}let jn=0;const Ll=Promise.resolve(),Hl=()=>jn||(Ll.then(()=>jn=0),jn=Date.now());function $l(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Te(Vl(s,n.value),t,5,[s])};return n.value=e,n.attached=Hl(),n}function Vl(e,t){if(T(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const Qs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,kl=(e,t,n,s,r,i)=>{const o=r==="svg";t==="class"?Il(e,s,o):t==="style"?Dl(e,n,s):dn(t)?es(t)||jl(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Wl(e,t,s,o))?(zs(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ys(e,t,s,o,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!q(s))?zs(e,Je(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Ys(e,t,s,o))};function Wl(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Qs(t)&&P(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Qs(t)&&q(n)?!1:t in e}const Ge=e=>{const t=e.props["onUpdate:modelValue"]||!1;return T(t)?n=>zt(t,n):t};function Bl(e){e.target.composing=!0}function er(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const de=Symbol("_assign");function tr(e,t,n){return t&&(e=e.trim()),n&&(e=gn(e)),e}const nr={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[de]=Ge(r);const i=s||r.props&&r.props.type==="number";Fe(e,t?"change":"input",o=>{o.target.composing||e[de](tr(e.value,n,i))}),(n||i)&&Fe(e,"change",()=>{e.value=tr(e.value,n,i)}),t||(Fe(e,"compositionstart",Bl),Fe(e,"compositionend",er),Fe(e,"change",er))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:r,number:i}},o){if(e[de]=Ge(o),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?gn(e.value):e.value,c=t??"";l!==c&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||r&&e.value.trim()===c)||(e.value=c))}},ql={deep:!0,created(e,t,n){e[de]=Ge(n),Fe(e,"change",()=>{const s=e._modelValue,r=mt(e),i=e.checked,o=e[de];if(T(s)){const l=rs(s,r),c=l!==-1;if(i&&!c)o(s.concat(r));else if(!i&&c){const d=[...s];d.splice(l,1),o(d)}}else if(bt(s)){const l=new Set(s);i?l.add(r):l.delete(r),o(l)}else o(gi(e,i))})},mounted:sr,beforeUpdate(e,t,n){e[de]=Ge(n),sr(e,t,n)}};function sr(e,{value:t,oldValue:n},s){e._modelValue=t;let r;if(T(t))r=rs(t,s.props.value)>-1;else if(bt(t))r=t.has(s.props.value);else{if(t===n)return;r=lt(t,gi(e,!0))}e.checked!==r&&(e.checked=r)}const Jl={created(e,{value:t},n){e.checked=lt(t,n.props.value),e[de]=Ge(n),Fe(e,"change",()=>{e[de](mt(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[de]=Ge(s),t!==n&&(e.checked=lt(t,s.props.value))}},Gl={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=bt(t);Fe(e,"change",()=>{const i=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?gn(mt(o)):mt(o));e[de](e.multiple?r?new Set(i):i:i[0]),e._assigning=!0,Fr(()=>{e._assigning=!1})}),e[de]=Ge(s)},mounted(e,{value:t}){rr(e,t)},beforeUpdate(e,t,n){e[de]=Ge(n)},updated(e,{value:t}){e._assigning||rr(e,t)}};function rr(e,t){const n=e.multiple,s=T(t);if(!(n&&!s&&!bt(t))){for(let r=0,i=e.options.length;r<i;r++){const o=e.options[r],l=mt(o);if(n)if(s){const c=typeof l;c==="string"||c==="number"?o.selected=t.some(d=>String(d)===String(l)):o.selected=rs(t,l)>-1}else o.selected=t.has(l);else if(lt(mt(o),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function mt(e){return"_value"in e?e._value:e.value}function gi(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Lc={created(e,t,n){Gt(e,t,n,null,"created")},mounted(e,t,n){Gt(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Gt(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Gt(e,t,n,s,"updated")}};function Yl(e,t){switch(e){case"SELECT":return Gl;case"TEXTAREA":return nr;default:switch(t){case"checkbox":return ql;case"radio":return Jl;default:return nr}}}function Gt(e,t,n,s,r){const o=Yl(e.tagName,n.props&&n.props.type)[r];o&&o(e,t,n,s)}const zl=["ctrl","shift","alt","meta"],Xl={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>zl.some(n=>e[`${n}Key`]&&!t.includes(n))},Hc=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((r,...i)=>{for(let o=0;o<t.length;o++){const l=Xl[t[o]];if(l&&l(r,t))return}return e(r,...i)}))},Zl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},$c=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(r=>{if(!("key"in r))return;const i=Ye(r.key);if(t.some(o=>o===i||Zl[o]===i))return e(r)}))},Ql=re({patchProp:kl},Ol);let ir;function ec(){return ir||(ir=ol(Ql))}const Vc=((...e)=>{const t=ec().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=nc(s);if(!r)return;const i=t._component;!P(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,tc(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function tc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function nc(e){return q(e)?document.querySelector(e):e}function xe(e){const t=new Uint8Array(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function un(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4,s=t.padEnd(t.length+n,"="),r=atob(s),i=new ArrayBuffer(r.length),o=new Uint8Array(i);for(let l=0;l<r.length;l++)o[l]=r.charCodeAt(l);return i}function _s(){return sc.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const sc={stubThis:e=>e};function mi(e){const{id:t}=e;return{...e,id:un(t),transports:e.transports}}function bi(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}class Y extends Error{constructor({message:t,code:n,cause:s,name:r}){super(t,{cause:s}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??s.name,this.code=n}}function rc({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Y({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(n.authenticatorSelection?.requireResidentKey===!0)return new Y({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&n.authenticatorSelection?.userVerification==="required")return new Y({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(n.authenticatorSelection?.userVerification==="required")return new Y({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Y({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Y({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return n.pubKeyCredParams.filter(r=>r.type==="public-key").length===0?new Y({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Y({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const s=globalThis.location.hostname;if(bi(s)){if(n.rp.id!==s)return new Y({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Y({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Y({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Y({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}class ic{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const _i=new ic,oc=["cross-platform","platform"];function yi(e){if(e&&!(oc.indexOf(e)<0))return e}async function lc(e){!e.optionsJSON&&e.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});const{optionsJSON:t,useAutoRegister:n=!1}=e;if(!_s())throw new Error("WebAuthn is not supported in this browser");const s={...t,challenge:un(t.challenge),user:{...t.user,id:un(t.user.id)},excludeCredentials:t.excludeCredentials?.map(mi)},r={};n&&(r.mediation="conditional"),r.publicKey=s,r.signal=_i.createNewAbortSignal();let i;try{i=await navigator.credentials.create(r)}catch(O){throw rc({error:O,options:r})}if(!i)throw new Error("Registration was not completed");const{id:o,rawId:l,response:c,type:d}=i;let u;typeof c.getTransports=="function"&&(u=c.getTransports());let p;if(typeof c.getPublicKeyAlgorithm=="function")try{p=c.getPublicKeyAlgorithm()}catch(O){Kn("getPublicKeyAlgorithm()",O)}let S;if(typeof c.getPublicKey=="function")try{const O=c.getPublicKey();O!==null&&(S=xe(O))}catch(O){Kn("getPublicKey()",O)}let x;if(typeof c.getAuthenticatorData=="function")try{x=xe(c.getAuthenticatorData())}catch(O){Kn("getAuthenticatorData()",O)}return{id:o,rawId:xe(l),response:{attestationObject:xe(c.attestationObject),clientDataJSON:xe(c.clientDataJSON),transports:u,publicKeyAlgorithm:p,publicKey:S,authenticatorData:x},type:d,clientExtensionResults:i.getClientExtensionResults(),authenticatorAttachment:yi(i.authenticatorAttachment)}}function Kn(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
2
- `,t)}function cc(){if(!_s())return Ln.stubThis(new Promise(t=>t(!1)));const e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Ln.stubThis(new Promise(t=>t(!1))):Ln.stubThis(e.isConditionalMediationAvailable())}const Ln={stubThis:e=>e};function ac({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Y({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Y({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=globalThis.location.hostname;if(bi(s)){if(n.rpId!==s)return new Y({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Y({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Y({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}async function fc(e){!e.optionsJSON&&e.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});const{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:s=!0}=e;if(!_s())throw new Error("WebAuthn is not supported in this browser");let r;t.allowCredentials?.length!==0&&(r=t.allowCredentials?.map(mi));const i={...t,challenge:un(t.challenge),allowCredentials:r},o={};if(n){if(!await cc())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&s)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation="conditional",i.allowCredentials=[]}o.publicKey=i,o.signal=_i.createNewAbortSignal();let l;try{l=await navigator.credentials.get(o)}catch(x){throw ac({error:x,options:o})}if(!l)throw new Error("Authentication was not completed");const{id:c,rawId:d,response:u,type:p}=l;let S;return u.userHandle&&(S=xe(u.userHandle)),{id:c,rawId:xe(d),response:{authenticatorData:xe(u.authenticatorData),clientDataJSON:xe(u.clientDataJSON),signature:xe(u.signature),userHandle:S},type:p,clientExtensionResults:l.getClientExtensionResults(),authenticatorAttachment:yi(l.authenticatorAttachment)}}class uc extends WebSocket{#n=[];#e=[];#t=null;#s=!1;constructor(t,n,s,r,i){super(new URL(s,document.baseURI.replace(/^http/,"ws")),r),this.binaryType=i||"blob",this.onopen=()=>{this.#s=!0,t(this)},this.onmessage=o=>{this.#e.length?this.#e.shift().resolve(o.data):this.#n.push(o.data)},this.onclose=o=>{if(!this.#s){n(new Error(`Failed to connect to server (code ${o.code})`));return}let l;if(o.wasClean)switch(o.code){case 1e3:l="Connection closed normally";break;case 1001:l="Server is going away";break;case 1002:l="Protocol error";break;case 1003:l="Unsupported data received";break;case 1006:l="Connection lost unexpectedly";break;case 1007:l="Invalid data received";break;case 1008:l="Policy violation";break;case 1009:l="Message too large";break;case 1010:l="Extension negotiation failed";break;case 1011:l="Server encountered an error";break;case 1012:l="Server is restarting";break;case 1013:l="Server is overloaded, try again later";break;case 1014:l="Bad gateway";break;case 1015:l="TLS handshake failed";break;default:l=`Connection closed (code ${o.code})`}else l=o.code===1006?"Connection lost unexpectedly":`Connection closed with error (code ${o.code})`;this.#t=new Error(l),this.#e.splice(0).forEach(c=>c.reject(this.#t))}}receive(){return this.#n.length?Promise.resolve(this.#n.shift()):this.#t?Promise.reject(this.#t):new Promise((t,n)=>this.#e.push({resolve:t,reject:n}))}async receive_bytes(){const t=await this.receive();if(typeof t=="string")throw console.error("WebSocket received text data, expected a binary message",t),new Error("WebSocket received text data, expected a binary message");return t instanceof Blob?t.bytes():new Uint8Array(t)}async receive_json(){const t=await this.receive();if(typeof t!="string")throw console.error("WebSocket received binary data, expected JSON string",t),new Error("WebSocket received binary data, expected JSON string");try{return JSON.parse(t)}catch(n){throw console.error("Failed to parse JSON from WebSocket message",t,n),new Error("Failed to parse JSON from WebSocket message")}}send_json(t){let n;try{n=JSON.stringify(t)}catch(s){throw new Error(`Failed to stringify data for WebSocket: ${s.message}`)}this.send(n)}}function wi(e,t={}){const{protocols:n,binaryType:s}=t;return new Promise((r,i)=>{new uc(r,i,e,n,s)})}let Yt=null,nt=null;async function dc(){return nt||Yt||(Yt=fetch("/auth/api/settings").then(e=>e.ok?e.json():{}).then(e=>(nt=e||{},nt)).catch(()=>(nt={},nt)),Yt)}function Pt(){const e=nt?.ui_base_path||"/auth/";return e==="/"?"/":e.endsWith("/")?e:e+"/"}function kc(){return Pt()==="/"?"/admin/":Pt()+"admin/"}function Wc(e=""){const t=e.startsWith("/")?e.slice(1):e;return t?Pt()==="/"?"/"+t:Pt()+t:Pt()}const hc=1e3;class ys extends Error{constructor(t,n,s){super(s?.detail||`Request failed: ${n.status}`),this.name="ApiError",this.url=t,this.status=n.status,this.statusText=n.statusText,this.data=s}}class en extends Error{constructor(t,n=null){super(t),this.name="NetworkError",this.originalError=n}}class or extends Error{constructor(){super("Authentication cancelled"),this.name="AuthCancelledError"}}let Pe=null,Me=null,st=null,Ie=null,tn=0;function pc(){tn++,document.body.classList.add("has-backdrop")}function gc(){tn=Math.max(0,tn-1),tn===0&&document.body.classList.remove("has-backdrop")}const Hn={};async function Bc(e="login"){if(Hn[e])return Hn[e];const t=await fetch("/auth/api/forward",{credentials:"include"});if(t.status===401||t.status===403){const n=await t.json();if(n.auth?.iframe){let s=n.auth.iframe;return e!==n.auth.mode&&(s=s.replace(/mode=[^&]*/,`mode=${e}`)),Hn[e]=s,s}}throw new Error("Unable to fetch auth iframe URL")}function Ei(e){return Me||(document.getElementById("auth-iframe")?(Me=new Promise((t,n)=>{st=t,Ie=n}),Me):(Me=new Promise((t,n)=>{st=t,Ie=n}),nn(),pc(),Pe=document.createElement("iframe"),Pe.id="auth-iframe",Pe.title="Authentication",Pe.allow="publickey-credentials-get; publickey-credentials-create",Pe.src=e,document.body.appendChild(Pe),Me))}function nn(){Pe&&(Pe.remove(),Pe=null,gc())}function mc(e){const t=e.data;if(t?.type)switch(t.type){case"auth-success":nn(),st&&(st(),Me=null,st=null,Ie=null);break;case"auth-back":case"auth-close-request":nn(),Ie&&(Ie(new or),Me=null,st=null,Ie=null);break;case"auth-error":t.cancelled&&Ie&&(nn(),Ie(new or),Me=null,st=null,Ie=null);break}}typeof window<"u"&&window.addEventListener("message",mc);async function bc(e,t={}){const{timeout:n=hc,...s}=t;for(s.credentials=s.credentials||"include";;){let r;try{r=await fetch(e,{...s,signal:n&&AbortSignal.timeout(n)})}catch(i){throw i.name==="TimeoutError"?new en("Request timed out",i):i.name==="AbortError"?i:i.name==="TypeError"&&i.message==="Failed to fetch"?new en("Unable to connect to server",i):new en(i.message||"Network error",i)}if(r.status===401||r.status===403){let i=null;try{i=(await r.clone().json()).auth}catch{}if(i?.iframe&&window===window.top){await Ei(i.iframe);continue}}return r}}async function qc(e,t={}){const n={...t};n.headers={Accept:"application/json",...n.headers},n.body&&typeof n.body=="object"&&!(n.body instanceof FormData)&&(n.headers={"Content-Type":"application/json",...n.headers},n.body=JSON.stringify(n.body));const s=await bc(e,n),r=await s.json();if(!s.ok)throw new ys(e,s,r);return r}async function Jc(e,t={}){const n={credentials:"include",...t,headers:{Accept:"application/json",...t.headers}},s=await fetch(e,n),r=await s.json();if(!s.ok)throw new ys(e,s,r);return r}function Gc(e){return e instanceof en||e instanceof ys?e.message:e.name==="TimeoutError"?"Request timed out":e.name==="TypeError"&&e.message==="Failed to fetch"?"Unable to connect to server":e.message||"An error occurred"}async function Si(e){const n=(await dc())?.auth_host;return n&&location.host!==n?`//${n}${e}`:e}async function _c(e=null,t=null,n=null){let s=[];e&&s.push(`reset=${encodeURIComponent(e)}`),t&&s.push(`name=${encodeURIComponent(t)}`);const r=s.length?`?${s.join("&")}`:"";for(;;){const i=await wi(await Si(`/auth/ws/register${r}`));try{const o=await i.receive_json();if((o.status===401||o.status===403)&&o.auth?.iframe){i.close(),await Ei(o.auth.iframe);continue}if(o.status)throw new Error(o.detail||`Registration failed: ${o.status}`);n&&n();const l=await lc(o);i.send_json(l);const c=await i.receive_json();if(c.status)throw new Error(c.detail||`Registration failed: ${c.status}`);return c}catch(o){throw i.close(),console.error("Registration error:",o),Error(o.name==="NotAllowedError"?"Passkey registration cancelled":o.message)}}}async function yc(){const e=await wi(await Si("/auth/ws/authenticate"));try{let t=await e.receive_json();if(t.status>=400)throw new Error(t.detail||`Authentication failed: ${t.status}`);const n=await fc(t);if(e.send_json(n),t=await e.receive_json(),t.status>=400)throw new Error(t.detail||`Authentication failed: ${t.status}`);return t}catch(t){throw console.error("Authentication error:",t),Error(t.name==="NotAllowedError"?"Passkey authentication cancelled":t.message)}finally{e.close()}}const Yc={authenticate:yc,register:_c},wc={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},Ec=new Set(["text","email","password","search","tel","url","number"]),Sc=e=>{const t=wc[e.key];if(!t)return null;const n=e.target;return(n.tagName==="INPUT"&&Ec.has(n.type)||n.tagName==="TEXTAREA")&&(t==="left"||t==="right")&&n.value!==""?null:t},xn=(e,t=null)=>{if(!e)return[];const n=t||e.dataset?.navItems||'button:not([disabled]), a, [tabindex="0"], [tabindex="-1"]:not([disabled])';return Array.from(e.querySelectorAll(n))},vc=(e,t)=>{const n=xn(e,t);if(n.length===0)return null;const s=n[0].getBoundingClientRect().top;let r=0;for(const i of n)if(Math.abs(i.getBoundingClientRect().top-s)<5)r++;else break;return{items:n,cols:Math.max(1,r)}},xc=(e,t,n,s={})=>{const r=xn(e,s.itemSelector);if(r.length===0)return"none";const i=r.indexOf(t);return i===-1?"none":n==="left"?i>0?(r[i-1].focus(),"moved"):"boundary":n==="right"&&i<r.length-1?(r[i+1].focus(),"moved"):"boundary"},zc=(e,t,n,s={})=>{const r=vc(e,s.itemSelector);if(!r)return"none";const{items:i,cols:o}=r,l=i.indexOf(t);if(l===-1)return"none";const c=Math.floor(l/o),d=l%o;let u=l;switch(n){case"left":if(d===0)return"boundary";u=l-1;break;case"right":if(l>=i.length-1)return"boundary";u=l+1;break;case"up":if(c===0)return"boundary";u=l-o;break;case"down":if(l+o>=i.length)return"boundary";u=l+o;break;default:return"none"}return u!==l?(i[u].focus(),"moved"):"none"},Xc=(e,t={})=>{if(!e)return null;const n=e.querySelector("[data-nav-primary]")||t.primarySelector&&e.querySelector(t.primarySelector);if(n)return n.focus(),n;const s=xn(e,t.itemSelector);return s.length>0?(s[0].focus(),s[0]):null},Zc=(e,t,n={})=>{if(!e)return null;const s=xn(e,n.itemSelector);if(s.length===0)return null;const r=t<0?s.length+t:t;return r>=0&&r<s.length?(s[r].focus(),s[r]):null},Qc=(e,t,n)=>e.key!=="Escape"?!1:(e.preventDefault(),t?.("up"),!0),ea=(e,t)=>{const n=navigator.userAgent.includes("Mac OS");return e.key==="Delete"||n&&e.key==="Backspace"?(e.preventDefault(),t?.(),!0):!1},Ac=e=>{if(!e)return null;const t=[".btn-primary:not([disabled])",".btn-secondary:not([disabled])","button:not([disabled])"];for(const n of t){const s=e.querySelector(n);if(s)return s.focus(),s}return null},ta=e=>{if(!e)return null;const t=e.querySelector('input:not([disabled]):not([type="hidden"]), textarea:not([disabled])');return t?(t.focus(),typeof t.select=="function"&&t.select(),t):Ac(e)},Rc=".button-row, .modal-actions, .actions, .role-actions, .ancillary-actions",Tc=e=>{const t=Sc(e);if(!t)return;const n=e.target;if(n.tagName!=="BUTTON"&&n.tagName!=="A")return;const s=n.closest(Rc);s&&(t==="left"||t==="right")&&(e.preventDefault(),xc(s,n,t,{itemSelector:"button:not([disabled]), a"}))};let lr=!1;const na=()=>{lr||typeof document>"u"||(document.addEventListener("keydown",Tc),lr=!0)},sa=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n};export{ea as $,_o as A,Sc as B,Xc as C,xc as D,Zc as E,ue as F,Yc as G,qc as H,Bc as I,Vc as J,na as K,$c as L,Cc as M,ro as N,fs as O,G as P,it as Q,F as R,ji as S,Ic as T,Mc as U,Xt as V,Uc as W,yc as X,_c as Y,zc as Z,sa as _,kr as a,Qc as a0,Fc as a1,ta as a2,Lc as a3,Pt as a4,ys as a5,Gc as a6,Jc as a7,Ac as a8,jc as b,xl as c,Yn as d,fi as e,Kc as f,ss as g,Nc as h,Dc as i,ns as j,pl as k,Hc as l,dc as m,Fr as n,Ro as o,wi as p,Wc as q,Pc as r,fc as s,Ui as t,kc as u,nr as v,Nn as w,Re as x,zn as y,Mr as z};
2
+ `,t)}function cc(){if(!_s())return Ln.stubThis(new Promise(t=>t(!1)));const e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Ln.stubThis(new Promise(t=>t(!1))):Ln.stubThis(e.isConditionalMediationAvailable())}const Ln={stubThis:e=>e};function ac({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Y({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Y({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=globalThis.location.hostname;if(bi(s)){if(n.rpId!==s)return new Y({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Y({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Y({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}async function fc(e){!e.optionsJSON&&e.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});const{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:s=!0}=e;if(!_s())throw new Error("WebAuthn is not supported in this browser");let r;t.allowCredentials?.length!==0&&(r=t.allowCredentials?.map(mi));const i={...t,challenge:un(t.challenge),allowCredentials:r},o={};if(n){if(!await cc())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&s)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation="conditional",i.allowCredentials=[]}o.publicKey=i,o.signal=_i.createNewAbortSignal();let l;try{l=await navigator.credentials.get(o)}catch(x){throw ac({error:x,options:o})}if(!l)throw new Error("Authentication was not completed");const{id:c,rawId:d,response:u,type:p}=l;let S;return u.userHandle&&(S=xe(u.userHandle)),{id:c,rawId:xe(d),response:{authenticatorData:xe(u.authenticatorData),clientDataJSON:xe(u.clientDataJSON),signature:xe(u.signature),userHandle:S},type:p,clientExtensionResults:l.getClientExtensionResults(),authenticatorAttachment:yi(l.authenticatorAttachment)}}class uc extends WebSocket{#n=[];#e=[];#t=null;#s=!1;constructor(t,n,s,r,i){super(new URL(s,document.baseURI.replace(/^http/,"ws")),r),this.binaryType=i||"blob",this.onopen=()=>{this.#s=!0,t(this)},this.onmessage=o=>{this.#e.length?this.#e.shift().resolve(o.data):this.#n.push(o.data)},this.onclose=o=>{if(!this.#s){n(new Error(`Failed to connect to server (code ${o.code})`));return}let l;if(o.wasClean)switch(o.code){case 1e3:l="Connection closed normally";break;case 1001:l="Server is going away";break;case 1002:l="Protocol error";break;case 1003:l="Unsupported data received";break;case 1006:l="Connection lost unexpectedly";break;case 1007:l="Invalid data received";break;case 1008:l="Policy violation";break;case 1009:l="Message too large";break;case 1010:l="Extension negotiation failed";break;case 1011:l="Server encountered an error";break;case 1012:l="Server is restarting";break;case 1013:l="Server is overloaded, try again later";break;case 1014:l="Bad gateway";break;case 1015:l="TLS handshake failed";break;default:l=`Connection closed (code ${o.code})`}else l=o.code===1006?"Connection lost unexpectedly":`Connection closed with error (code ${o.code})`;this.#t=new Error(l),this.#e.splice(0).forEach(c=>c.reject(this.#t))}}receive(){return this.#n.length?Promise.resolve(this.#n.shift()):this.#t?Promise.reject(this.#t):new Promise((t,n)=>this.#e.push({resolve:t,reject:n}))}async receive_bytes(){const t=await this.receive();if(typeof t=="string")throw console.error("WebSocket received text data, expected a binary message",t),new Error("WebSocket received text data, expected a binary message");return t instanceof Blob?t.bytes():new Uint8Array(t)}async receive_json(){const t=await this.receive();if(typeof t!="string")throw console.error("WebSocket received binary data, expected JSON string",t),new Error("WebSocket received binary data, expected JSON string");try{return JSON.parse(t)}catch(n){throw console.error("Failed to parse JSON from WebSocket message",t,n),new Error("Failed to parse JSON from WebSocket message")}}send_json(t){let n;try{n=JSON.stringify(t)}catch(s){throw new Error(`Failed to stringify data for WebSocket: ${s.message}`)}this.send(n)}}function wi(e,t={}){const{protocols:n,binaryType:s}=t;return new Promise((r,i)=>{new uc(r,i,e,n,s)})}let Yt=null,nt=null;async function dc(){return nt||Yt||(Yt=fetch("/auth/api/settings").then(e=>e.ok?e.json():{}).then(e=>(nt=e||{},nt)).catch(()=>(nt={},nt)),Yt)}function Pt(){const e=nt?.ui_base_path||"/auth/";return e==="/"?"/":e.endsWith("/")?e:e+"/"}function kc(){return Pt()==="/"?"/admin/":Pt()+"admin/"}function Wc(e=""){const t=e.startsWith("/")?e.slice(1):e;return t?Pt()==="/"?"/"+t:Pt()+t:Pt()}const hc=1e3;class ys extends Error{constructor(t,n,s){super(s?.detail||`Request failed: ${n.status}`),this.name="ApiError",this.url=t,this.status=n.status,this.statusText=n.statusText,this.data=s}}class en extends Error{constructor(t,n=null){super(t),this.name="NetworkError",this.originalError=n}}class or extends Error{constructor(){super("Authentication cancelled"),this.name="AuthCancelledError"}}let Pe=null,Me=null,st=null,Ie=null,tn=0;function pc(){tn++,document.body.classList.add("has-backdrop")}function gc(){tn=Math.max(0,tn-1),tn===0&&document.body.classList.remove("has-backdrop")}const Hn={};async function Bc(e="login"){if(Hn[e])return Hn[e];const t=await fetch("/auth/api/forward");if(t.status===401||t.status===403){const n=await t.json();if(n.auth?.iframe){let s=n.auth.iframe;return e!==n.auth.mode&&(s=s.replace(/mode=[^&]*/,`mode=${e}`)),Hn[e]=s,s}}throw new Error("Unable to fetch auth iframe URL")}function Ei(e){return Me||(document.getElementById("auth-iframe")?(Me=new Promise((t,n)=>{st=t,Ie=n}),Me):(Me=new Promise((t,n)=>{st=t,Ie=n}),nn(),pc(),Pe=document.createElement("iframe"),Pe.id="auth-iframe",Pe.title="Authentication",Pe.allow="publickey-credentials-get; publickey-credentials-create",Pe.src=e,document.body.appendChild(Pe),Me))}function nn(){Pe&&(Pe.remove(),Pe=null,gc())}function mc(e){const t=e.data;if(t?.type)switch(t.type){case"auth-success":nn(),st&&(st(),Me=null,st=null,Ie=null);break;case"auth-back":case"auth-close-request":nn(),Ie&&(Ie(new or),Me=null,st=null,Ie=null);break;case"auth-error":t.cancelled&&Ie&&(nn(),Ie(new or),Me=null,st=null,Ie=null);break}}typeof window<"u"&&window.addEventListener("message",mc);async function bc(e,t={}){const{timeout:n=hc,...s}=t;for(s.credentials=s.credentials||"include";;){let r;try{r=await fetch(e,{...s,signal:n&&AbortSignal.timeout(n)})}catch(i){throw i.name==="TimeoutError"?new en("Request timed out",i):i.name==="AbortError"?i:i.name==="TypeError"&&i.message==="Failed to fetch"?new en("Unable to connect to server",i):new en(i.message||"Network error",i)}if(r.status===401||r.status===403){let i=null;try{i=(await r.clone().json()).auth}catch{}if(i?.iframe&&window===window.top){await Ei(i.iframe);continue}}return r}}async function qc(e,t={}){const n={...t};n.headers={Accept:"application/json",...n.headers},n.body&&typeof n.body=="object"&&!(n.body instanceof FormData)&&(n.headers={"Content-Type":"application/json",...n.headers},n.body=JSON.stringify(n.body));const s=await bc(e,n),r=await s.json();if(!s.ok)throw new ys(e,s,r);return r}async function Jc(e,t={}){const n={...t,headers:{Accept:"application/json",...t.headers}},s=await fetch(e,n),r=await s.json();if(!s.ok)throw new ys(e,s,r);return r}function Gc(e){return e instanceof en||e instanceof ys?e.message:e.name==="TimeoutError"?"Request timed out":e.name==="TypeError"&&e.message==="Failed to fetch"?"Unable to connect to server":e.message||"An error occurred"}async function Si(e){const n=(await dc())?.auth_host;return n&&location.host!==n?`//${n}${e}`:e}async function _c(e=null,t=null,n=null){let s=[];e&&s.push(`reset=${encodeURIComponent(e)}`),t&&s.push(`name=${encodeURIComponent(t)}`);const r=s.length?`?${s.join("&")}`:"";for(;;){const i=await wi(await Si(`/auth/ws/register${r}`));try{const o=await i.receive_json();if((o.status===401||o.status===403)&&o.auth?.iframe){i.close(),await Ei(o.auth.iframe);continue}if(o.status)throw new Error(o.detail||`Registration failed: ${o.status}`);n&&n();const l=await lc(o);i.send_json(l);const c=await i.receive_json();if(c.status)throw new Error(c.detail||`Registration failed: ${c.status}`);return c}catch(o){throw i.close(),console.error("Registration error:",o),Error(o.name==="NotAllowedError"?"Passkey registration cancelled":o.message)}}}async function yc(){const e=await wi(await Si("/auth/ws/authenticate"));try{let t=await e.receive_json();if(t.status>=400)throw new Error(t.detail||`Authentication failed: ${t.status}`);const n=await fc(t);if(e.send_json(n),t=await e.receive_json(),t.status>=400)throw new Error(t.detail||`Authentication failed: ${t.status}`);return t}catch(t){throw console.error("Authentication error:",t),Error(t.name==="NotAllowedError"?"Passkey authentication cancelled":t.message)}finally{e.close()}}const Yc={authenticate:yc,register:_c},wc={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},Ec=new Set(["text","email","password","search","tel","url","number"]),Sc=e=>{const t=wc[e.key];if(!t)return null;const n=e.target;return(n.tagName==="INPUT"&&Ec.has(n.type)||n.tagName==="TEXTAREA")&&(t==="left"||t==="right")&&n.value!==""?null:t},xn=(e,t=null)=>{if(!e)return[];const n=t||e.dataset?.navItems||'button:not([disabled]), a, [tabindex="0"], [tabindex="-1"]:not([disabled])';return Array.from(e.querySelectorAll(n))},vc=(e,t)=>{const n=xn(e,t);if(n.length===0)return null;const s=n[0].getBoundingClientRect().top;let r=0;for(const i of n)if(Math.abs(i.getBoundingClientRect().top-s)<5)r++;else break;return{items:n,cols:Math.max(1,r)}},xc=(e,t,n,s={})=>{const r=xn(e,s.itemSelector);if(r.length===0)return"none";const i=r.indexOf(t);return i===-1?"none":n==="left"?i>0?(r[i-1].focus(),"moved"):"boundary":n==="right"&&i<r.length-1?(r[i+1].focus(),"moved"):"boundary"},zc=(e,t,n,s={})=>{const r=vc(e,s.itemSelector);if(!r)return"none";const{items:i,cols:o}=r,l=i.indexOf(t);if(l===-1)return"none";const c=Math.floor(l/o),d=l%o;let u=l;switch(n){case"left":if(d===0)return"boundary";u=l-1;break;case"right":if(l>=i.length-1)return"boundary";u=l+1;break;case"up":if(c===0)return"boundary";u=l-o;break;case"down":if(l+o>=i.length)return"boundary";u=l+o;break;default:return"none"}return u!==l?(i[u].focus(),"moved"):"none"},Xc=(e,t={})=>{if(!e)return null;const n=e.querySelector("[data-nav-primary]")||t.primarySelector&&e.querySelector(t.primarySelector);if(n)return n.focus(),n;const s=xn(e,t.itemSelector);return s.length>0?(s[0].focus(),s[0]):null},Zc=(e,t,n={})=>{if(!e)return null;const s=xn(e,n.itemSelector);if(s.length===0)return null;const r=t<0?s.length+t:t;return r>=0&&r<s.length?(s[r].focus(),s[r]):null},Qc=(e,t,n)=>e.key!=="Escape"?!1:(e.preventDefault(),t?.("up"),!0),ea=(e,t)=>{const n=navigator.userAgent.includes("Mac OS");return e.key==="Delete"||n&&e.key==="Backspace"?(e.preventDefault(),t?.(),!0):!1},Ac=e=>{if(!e)return null;const t=[".btn-primary:not([disabled])",".btn-secondary:not([disabled])","button:not([disabled])"];for(const n of t){const s=e.querySelector(n);if(s)return s.focus(),s}return null},ta=e=>{if(!e)return null;const t=e.querySelector('input:not([disabled]):not([type="hidden"]), textarea:not([disabled])');return t?(t.focus(),typeof t.select=="function"&&t.select(),t):Ac(e)},Rc=".button-row, .modal-actions, .actions, .role-actions, .ancillary-actions",Tc=e=>{const t=Sc(e);if(!t)return;const n=e.target;if(n.tagName!=="BUTTON"&&n.tagName!=="A")return;const s=n.closest(Rc);s&&(t==="left"||t==="right")&&(e.preventDefault(),xc(s,n,t,{itemSelector:"button:not([disabled]), a"}))};let lr=!1;const na=()=>{lr||typeof document>"u"||(document.addEventListener("keydown",Tc),lr=!0)},sa=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n};export{ea as $,_o as A,Sc as B,Xc as C,xc as D,Zc as E,ue as F,Yc as G,qc as H,Bc as I,Vc as J,na as K,$c as L,Cc as M,ro as N,fs as O,G as P,it as Q,F as R,ji as S,Ic as T,Mc as U,Xt as V,Uc as W,yc as X,_c as Y,zc as Z,sa as _,kr as a,Qc as a0,Fc as a1,ta as a2,Lc as a3,Pt as a4,ys as a5,Gc as a6,Jc as a7,Ac as a8,jc as b,xl as c,Yn as d,fi as e,Kc as f,ss as g,Nc as h,Dc as i,ns as j,pl as k,Hc as l,dc as m,Fr as n,Ro as o,wi as p,Wc as q,Pc as r,fc as s,Ui as t,kc as u,nr as v,Nn as w,Re as x,zn as y,Mr as z};
@@ -0,0 +1 @@
1
+ import{_ as re,r as k,c as I,b as p,d as m,e as o,f as T,t as A,F as C,i as X,j as ke,C as te,B as G,D as ie,l as Se,L as $e,y as H,x as ae,E as De,H as P,A as Ye,k as z,h as ne,v as oe,z as ge,o as We,a as Ze,q as Qe,u as Xe,w as _e,J as et,K as tt}from"./_plugin-vue_export-helper-nhjnO_bd.js";import{u as Oe,U as st,_ as nt,a as ot,R as at,N as me,M as it,b as rt,L as lt,A as fe,B as ut,c as dt}from"./AccessDenied-Fmeb6EtF.js";import"./helpers-DzjFIx78.js";const ct={key:0},mt=["onClick"],ft=["onClick"],gt={class:"role-names"},vt={class:"center"},yt={key:0,class:"center"},pt=["onClick"],ht={key:0,class:"permissions-section"},bt={class:"matrix-scroll"},wt=["title"],$t=["title"],Dt={class:"display-text"},kt=["checked","onChange"],St={class:"perm-name-cell"},Ot={class:"perm-title"},Rt={class:"display-text"},Ct=["onClick"],At={class:"perm-id-info"},Ut={class:"id-text"},Et={class:"perm-domain"},Mt={class:"perm-members center"},Pt={class:"perm-actions center"},qt=["onClick"],xt={__name:"AdminOverview",props:{info:Object,orgs:Array,permissions:Array,permissionSummary:Object,navigationDisabled:{type:Boolean,default:!1}},emits:["createOrg","openOrg","updateOrg","deleteOrg","toggleOrgPermission","openDialog","deletePermission","renamePermissionDisplay","navigateOut"],setup(n,{expose:J,emit:Y}){const S=n,L=Y,E=k(null),c=k(null),y=k(null),q=k(null),N=k(null),K=k(null),x=I(()=>[...S.orgs].sort((r,t)=>{const s=r.display_name.localeCompare(t.display_name);return s!==0?s:r.uuid.localeCompare(t.uuid)})),w=I(()=>[...S.permissions].sort((r,t)=>r.scope.localeCompare(t.scope))),F=I(()=>S.info?.ctx.permissions.includes("auth:admin")),$=I(()=>S.info?.ctx.permissions.includes("auth:org:admin"));function _(r){return r.roles.slice().sort((t,s)=>t.display_name.localeCompare(s.display_name)).map(t=>t.display_name).join(", ")}function Z(r,t){if(S.navigationDisabled)return;const s=G(r);if(!s)return;const D=r.target,l=D.closest("tr");if(!l)return;const d=l.closest("tbody");if(!d)return;const h=Array.from(d.querySelectorAll("tr")),R=h.indexOf(l);if(R===-1)return;if(s==="left"||s==="right"){r.preventDefault();const M=Array.from(l.querySelectorAll("a, button:not([disabled])")),B=M.indexOf(D);if(B===-1)return;s==="left"&&B>0?M[B-1].focus():s==="right"&&B<M.length-1&&M[B+1].focus();return}let V=R;if(s==="up"&&R>0)V=R-1;else if(s==="down"&&R<h.length-1)V=R+1;else if(s==="up"&&R===0){r.preventDefault(),t==="org"?te(c.value,{itemSelector:"button"}):t==="perm"&&te(N.value,{itemSelector:"button"});return}else if(s==="down"&&R===h.length-1){if(r.preventDefault(),t==="org"&&F.value&&q.value){const M=q.value.querySelector('input[type="checkbox"]');M?M.focus():te(N.value,{itemSelector:"button"})}return}if(V!==R){r.preventDefault();const B=h[V].querySelector("a, button:not([disabled])");B&&B.focus()}}function ee(r){if(S.navigationDisabled)return;const t=G(r);if(t){if(r.preventDefault(),t==="left"||t==="right")ie(c.value,r.target,t,{itemSelector:"button"});else if(t==="up")L("navigateOut","up");else if(t==="down"){const s=y.value?.querySelector("tbody tr a, tbody tr button:not([disabled])");s&&s.focus()}}}function g(r){if(S.navigationDisabled)return;const t=G(r);if(!t)return;const s=r.target;if(s.tagName!=="INPUT")return;r.preventDefault();const D=Array.from(q.value.querySelectorAll('input[type="checkbox"]')),l=D.indexOf(s);if(l===-1)return;const d=x.value.length,h=w.value.length;if(d===0||h===0)return;const R=Math.floor(l/d),V=l%d;let M=l;if(t==="left")V>0&&(M=l-1);else if(t==="right")V<d-1&&(M=l+1);else if(t==="up")if(R>0)M=l-d;else{const le=y.value?.querySelector("tbody tr:last-child")?.querySelector("a, button:not([disabled])");le&&le.focus();return}else if(t==="down")if(R<h-1)M=l+d;else{te(N.value,{itemSelector:"button"});return}M!==l&&D[M]&&D[M].focus()}function u(r){if(S.navigationDisabled)return;const t=G(r);if(t){if(r.preventDefault(),t==="left"||t==="right")ie(N.value,r.target,t,{itemSelector:"button"});else if(t==="up"){const s=q.value?.querySelectorAll('input[type="checkbox"]');if(s?.length){const D=x.value.length,d=(w.value.length-1)*D;s[d]?s[d].focus():s[0].focus()}else{const l=y.value?.querySelector("tbody tr:last-child")?.querySelector("a, button:not([disabled])");l&&l.focus()}}else if(t==="down"){const s=K.value?.querySelector("tbody tr button:not([disabled])");s&&s.focus()}}}function f(){if(F.value)te(c.value,{itemSelector:"button"});else{const r=y.value?.querySelector("tbody tr a, tbody tr button:not([disabled])");r&&r.focus()}}return J({focusFirstElement:f}),(r,t)=>(m(),p(C,null,[o("div",{class:"permissions-section",ref_key:"orgSection",ref:E},[o("h2",null,A(F.value?"Organizations":"Your Organizations"),1),o("div",{class:"actions",ref_key:"orgActionsRef",ref:c,onKeydown:ee},[F.value?(m(),p("button",{key:0,onClick:t[0]||(t[0]=s=>r.$emit("createOrg"))},"+ Create Org")):T("",!0)],544),o("table",{class:"org-table",ref_key:"orgTableRef",ref:y,onKeydown:t[1]||(t[1]=s=>Z(s,"org"))},[o("thead",null,[o("tr",null,[t[4]||(t[4]=o("th",null,"Name",-1)),t[5]||(t[5]=o("th",null,"Roles",-1)),t[6]||(t[6]=o("th",null,"Members",-1)),F.value?(m(),p("th",ct,"Actions")):T("",!0)])]),o("tbody",null,[(m(!0),p(C,null,X(x.value,s=>(m(),p("tr",{key:s.uuid},[o("td",null,[o("a",{href:"#org/{{o.uuid}}",onClick:Se(D=>r.$emit("openOrg",s),["prevent"])},A(s.display_name),9,mt),F.value||$.value?(m(),p("button",{key:0,onClick:D=>r.$emit("updateOrg",s),class:"icon-btn edit-org-btn","aria-label":"Rename organization",title:"Rename organization"},"✏️",8,ft)):T("",!0)]),o("td",gt,A(_(s)),1),o("td",vt,A(s.roles.reduce((D,l)=>D+l.users.length,0)),1),F.value?(m(),p("td",yt,[o("button",{onClick:D=>r.$emit("deleteOrg",s),class:"icon-btn delete-icon","aria-label":"Delete organization",title:"Delete organization"},"❌",8,pt)])):T("",!0)]))),128))])],544)],512),F.value?(m(),p("div",ht,[t[10]||(t[10]=o("h2",null,"Permissions",-1)),o("div",{class:"matrix-wrapper",ref_key:"permMatrixRef",ref:q,onKeydown:g},[o("div",bt,[o("div",{class:"perm-matrix-grid",style:ke({gridTemplateColumns:"minmax(180px, 1fr) "+x.value.map(()=>"2.2rem").join(" ")})},[t[7]||(t[7]=o("div",{class:"grid-head perm-head"},"Permission",-1)),(m(!0),p(C,null,X(x.value,s=>(m(),p("div",{key:"head-"+s.uuid,class:"grid-head org-head",title:s.display_name},[o("span",null,A(s.display_name),1)],8,wt))),128)),(m(!0),p(C,null,X(w.value,s=>(m(),p(C,{key:s.uuid},[o("div",{class:"perm-name",title:s.scope},[o("span",Dt,A(s.display_name),1)],8,$t),(m(!0),p(C,null,X(x.value,D=>(m(),p("div",{key:D.uuid+"-"+s.uuid,class:"matrix-cell"},[o("input",{type:"checkbox",checked:D.permissions.includes(s.uuid),onChange:l=>r.$emit("toggleOrgPermission",D,s.uuid,l.target.checked)},null,40,kt)]))),128))],64))),128))],4)]),t[8]||(t[8]=o("p",{class:"matrix-hint muted"},"Toggle which permissions each organization can grant to its members.",-1))],544),o("div",{class:"actions",ref_key:"permActionsRef",ref:N,onKeydown:u},[F.value?(m(),p("button",{key:0,onClick:t[2]||(t[2]=s=>r.$emit("openDialog","perm-create",{display_name:"",scope:"",domain:""}))},"+ Create Permission")):T("",!0)],544),o("table",{class:"org-table",ref_key:"permTableRef",ref:K,onKeydown:t[3]||(t[3]=s=>Z(s,"perm"))},[t[9]||(t[9]=o("thead",null,[o("tr",null,[o("th",{scope:"col"},"Permission"),o("th",{scope:"col"},"Domain"),o("th",{scope:"col",class:"center"},"Members"),o("th",{scope:"col",class:"center"},"Actions")])],-1)),o("tbody",null,[(m(!0),p(C,null,X(w.value,s=>(m(),p("tr",{key:s.uuid},[o("td",St,[o("div",Ot,[o("span",Rt,A(s.display_name),1),o("button",{onClick:D=>r.$emit("renamePermissionDisplay",s),class:"icon-btn edit-display-btn","aria-label":"Edit permission",title:"Edit permission"},"✏️",8,Ct)]),o("div",At,[o("span",Ut,A(s.scope),1)])]),o("td",Et,A(s.domain||"—"),1),o("td",Mt,A(n.permissionSummary[s.uuid]?.userCount||0),1),o("td",Pt,[o("button",{onClick:D=>r.$emit("deletePermission",s),class:"icon-btn delete-icon","aria-label":"Delete permission",title:"Delete permission"},"❌",8,qt)])]))),128))])],544)])):T("",!0)],64))}},Nt=re(xt,[["__scopeId","data-v-56228c4a"]]),Tt=["title"],Lt={class:"org-name"},Ft={class:"matrix-scroll"},It=["title"],Kt=["title"],Bt=["checked","onChange"],zt=["onDrop"],Vt=["onKeydown"],jt=["title"],Ht=["onClick"],Gt={class:"role-actions"},Jt=["onClick"],Yt=["onDragstart","onClick","onKeydown","title"],Wt={class:"name"},Zt={class:"meta"},Qt=["onKeydown"],Xt=["onClick"],_t={__name:"AdminOrgDetail",props:{selectedOrg:Object,permissions:Array,navigationDisabled:{type:Boolean,default:!1}},emits:["updateOrg","createRole","updateRole","deleteRole","createUserInRole","openUser","toggleRolePermission","onRoleDragOver","onRoleDrop","onUserDragStart","navigateOut"],setup(n,{expose:J,emit:Y}){const S=n,L=Y,E=k(null),c=k(null),y=k(null),q=I(()=>[...S.selectedOrg.roles].sort((g,u)=>{const f=g.display_name.toLowerCase(),r=u.display_name.toLowerCase();return f!==r?f.localeCompare(r):g.uuid.localeCompare(u.uuid)})),N=I(()=>{const g=new Set(S.selectedOrg.permissions||[]);return S.permissions.filter(u=>g.has(u.uuid))});function K(g,u,f){L("toggleRolePermission",g,u,f)}function x(g){if(S.navigationDisabled)return;const u=G(g);if(u){if(g.preventDefault(),u==="left"||u==="right")ie(E.value,g.target,u,{itemSelector:"button"});else if(u==="up")L("navigateOut","up");else if(u==="down"){const f=c.value?.querySelector('input[type="checkbox"]');f?f.focus():Z()}}}function w(g){if(S.navigationDisabled)return;const u=G(g);if(!u)return;const f=g.target;if(f.tagName!=="INPUT")return;g.preventDefault();const r=Array.from(c.value.querySelectorAll('input[type="checkbox"]')),t=r.indexOf(f);if(t===-1)return;const s=q.value.length,D=S.selectedOrg.permissions.length,l=Math.floor(t/s),d=t%s;let h=t;if(u==="left"&&d>0)h=t-1;else if(u==="right"&&d<s-1)h=t+1;else if(u==="up"&&l>0)h=t-s;else if(u==="down"&&l<D-1)h=t+s;else if(u==="up"&&l===0){const R=E.value?.querySelector("button");R&&R.focus();return}else if(u==="down"&&l===D-1){Z();return}h!==t&&r[h]&&r[h].focus()}function F(g){if(S.navigationDisabled)return;const u=G(g);if(!u)return;const f=g.target;if(!f.classList.contains("user-chip"))return;const r=f.closest(".user-list");if(!r)return;const t=Array.from(r.querySelectorAll(".user-chip")),s=t.indexOf(f);if(s!==-1){if(u==="up"&&s>0){g.preventDefault(),t[s-1].focus();return}else if(u==="down"&&s<t.length-1){g.preventDefault(),t[s+1].focus();return}if(u==="up"&&s===0){g.preventDefault();const l=r.closest(".role-column")?.querySelector(".role-header button");l&&l.focus();return}if(!(u==="down"&&s===t.length-1)&&(u==="left"||u==="right")){g.preventDefault();const D=Array.from(y.value?.querySelectorAll(".role-column")||[]),l=r.closest(".role-column"),d=D.indexOf(l);let h=u==="left"?d-1:d+1;if(h>=0&&h<D.length){const R=D[h],V=R.querySelectorAll(".user-chip"),M=Math.min(s,V.length-1);if(V[M])V[M].focus();else{const B=R.querySelector(".plus-btn");B&&B.focus()}}else if(u==="left"&&d===0){const R=c.value?.querySelector('input[type="checkbox"]:last-of-type');R&&R.focus()}}}}function $(g,u){if(S.navigationDisabled)return;const f=G(g);if(!f)return;const r=Array.from(y.value?.querySelectorAll(".role-column")||[]);if(f==="left"||f==="right"){g.preventDefault();const t=g.currentTarget.querySelectorAll("button:not([disabled])"),s=Array.from(t).indexOf(g.target);if(f==="left"&&s>0)t[s-1].focus();else if(f==="right"&&s<t.length-1)t[s+1].focus();else if(f==="left"&&s===0&&u>0){const l=r[u-1]?.querySelectorAll(".role-header button");l?.length&&l[l.length-1].focus()}else if(f==="right"&&s===t.length-1&&u<r.length-1){const l=r[u+1]?.querySelector(".role-header button");l&&l.focus()}}else if(f==="up"){g.preventDefault();const t=c.value?.querySelectorAll('input[type="checkbox"]');if(t?.length){const s=q.value.length,l=(S.selectedOrg.permissions.length-1)*s+u;t[l]?t[l].focus():t[t.length-1].focus()}else{const s=E.value?.querySelector("button");s&&s.focus()}}else if(f==="down"){g.preventDefault();const s=r[u]?.querySelector(".user-chip");s&&s.focus()}}function _(g,u){if(S.navigationDisabled)return;const f=G(g);if(!f)return;const r=Array.from(y.value?.querySelectorAll(".role-column")||[]);if(f==="up"){g.preventDefault();const s=r[u]?.querySelector(".role-header button");s&&s.focus()}else if(f==="left"&&u>0){g.preventDefault();const t=r[u-1],s=t?.querySelector(".empty-role button"),D=t?.querySelector(".user-chip:last-child");s?s.focus():D&&D.focus()}else if(f==="right"&&u<r.length-1){g.preventDefault();const t=r[u+1],s=t?.querySelector(".empty-role button"),D=t?.querySelector(".user-chip");s?s.focus():D&&D.focus()}}function Z(){const u=y.value?.querySelector(".role-column")?.querySelector(".role-header button");u&&u.focus()}function ee(){const g=E.value?.querySelector("button");g&&g.focus()}return J({focusFirstElement:ee}),(g,u)=>(m(),p(C,null,[o("h2",{class:"org-title",ref_key:"orgTitleRef",ref:E,onKeydown:x,title:n.selectedOrg.uuid},[o("span",Lt,A(n.selectedOrg.display_name),1),o("button",{onClick:u[0]||(u[0]=f=>g.$emit("updateOrg",n.selectedOrg)),class:"icon-btn","aria-label":"Rename organization",title:"Rename organization"},"✏️")],40,Tt),o("div",{class:"matrix-wrapper",ref_key:"permMatrixRef",ref:c,onKeydown:w},[o("div",Ft,[o("div",{class:"perm-matrix-grid",style:ke({gridTemplateColumns:"minmax(180px, 1fr) "+q.value.map(()=>"2.2rem").join(" ")+" 2.2rem"})},[u[5]||(u[5]=o("div",{class:"grid-head perm-head"},"Permission",-1)),(m(!0),p(C,null,X(q.value,f=>(m(),p("div",{key:"head-"+f.uuid,class:"grid-head role-head",title:f.display_name},[o("span",null,A(f.display_name),1)],8,It))),128)),o("div",{class:"grid-head role-head add-role-head",title:"Add role",onClick:u[1]||(u[1]=f=>g.$emit("createRole",n.selectedOrg)),role:"button",tabindex:"0",onKeydown:u[2]||(u[2]=$e(f=>g.$emit("createRole",n.selectedOrg),["enter"]))},"➕",32),(m(!0),p(C,null,X(N.value,f=>(m(),p(C,{key:f.uuid},[o("div",{class:"perm-name",title:f.scope},A(f.display_name),9,Kt),(m(!0),p(C,null,X(q.value,r=>(m(),p("div",{key:r.uuid+"-"+f.uuid,class:"matrix-cell"},[o("input",{type:"checkbox",checked:r.permissions.includes(f.uuid),onChange:t=>K(r,f.uuid,t.target.checked)},null,40,Bt)]))),128)),u[4]||(u[4]=o("div",{class:"matrix-cell add-role-cell"},null,-1))],64))),128))],4)]),u[6]||(u[6]=o("p",{class:"matrix-hint muted"},"Toggle which permissions each role grants.",-1))],544),o("div",{class:"roles-grid",ref_key:"rolesGridRef",ref:y},[(m(!0),p(C,null,X(q.value,(f,r)=>(m(),p("div",{key:f.uuid,class:"role-column",onDragover:u[3]||(u[3]=t=>g.$emit("onRoleDragOver",t)),onDrop:t=>g.$emit("onRoleDrop",t,n.selectedOrg,f)},[o("div",{class:"role-header",onKeydown:t=>$(t,r)},[o("strong",{class:"role-name",title:f.uuid},[o("span",null,A(f.display_name),1),o("button",{onClick:t=>g.$emit("updateRole",f),class:"icon-btn","aria-label":"Edit role",title:"Edit role"},"✏️",8,Ht)],8,jt),o("div",Gt,[o("button",{onClick:t=>g.$emit("createUserInRole",n.selectedOrg,f),class:"plus-btn","aria-label":"Add user",title:"Add user"},"➕",8,Jt)])],40,Vt),f.users.length>0?(m(),p("ul",{key:0,class:"user-list",onKeydown:F},[(m(!0),p(C,null,X(f.users.slice().sort((t,s)=>{const D=t.display_name.toLowerCase(),l=s.display_name.toLowerCase();return D!==l?D.localeCompare(l):t.uuid.localeCompare(s.uuid)}),t=>(m(),p("li",{key:t.uuid,class:"user-chip",tabindex:"0",draggable:"true",onDragstart:s=>g.$emit("onUserDragStart",s,t,n.selectedOrg.uuid),onClick:s=>g.$emit("openUser",t),onKeydown:$e(s=>g.$emit("openUser",t),["enter"]),title:t.uuid},[o("span",Wt,A(t.display_name),1),o("span",Zt,A(t.last_seen?new Date(t.last_seen).toLocaleDateString():"—"),1)],40,Yt))),128))],32)):(m(),p("div",{key:1,class:"empty-role",onKeydown:t=>_(t,r)},[u[7]||(u[7]=o("p",{class:"empty-text muted"},"No members",-1)),o("button",{onClick:t=>g.$emit("deleteRole",f),class:"icon-btn delete-icon","aria-label":"Delete empty role",title:"Delete role"},"❌",8,Xt)],40,Qt))],40,zt))),128))],512)],64))}},es=re(_t,[["__scopeId","data-v-f76fbbc3"]]),ts={class:"user-detail"},ss={key:0,class:"error small"},ns=["disabled"],os={class:"section-block","data-section":"registered-passkeys"},as={class:"section-body"},is={__name:"AdminUserDetail",props:{selectedUser:Object,userDetail:Object,selectedOrg:Object,loading:Boolean,showRegModal:Boolean,navigationDisabled:{type:Boolean,default:!1}},emits:["generateUserRegistrationLink","goOverview","openOrg","onUserNameSaved","closeRegModal","editUserName","refreshUserDetail","navigateOut"],setup(n,{expose:J,emit:Y}){const S=n,L=Y,E=Oe(),c=k({}),y=k(null),q=k(null),N=k(null),K=k(null),x=k(null),w=k(null),F=k(null),$=I(()=>S.showRegModal);function _(){E.showMessage(`📋 Link copied! Send it to ${S.selectedUser.display_name}.`),L("closeRegModal")}function Z(){L("editUserName",S.selectedUser)}async function ee(l){try{const d=await P(`/auth/api/admin/orgs/${S.selectedUser.org}/users/${S.selectedUser.uuid}/credentials/${l.credential}`,{method:"DELETE"});d.status==="ok"?L("onUserNameSaved"):console.error("Failed to delete credential",d)}catch(d){console.error("Delete credential error",d)}}async function g(l){const d=l?.id;if(d){c.value={...c.value,[d]:!0};try{const h=await P(`/auth/api/admin/orgs/${S.selectedUser.org}/users/${S.selectedUser.uuid}/sessions/${d}`,{method:"DELETE"});if(h.status==="ok"){if(h.current_session_terminated){sessionStorage.clear(),location.reload();return}L("refreshUserDetail"),E.showMessage("Session terminated","success",2500)}else E.showMessage(h.detail||"Failed to terminate session","error")}catch(h){console.error("Terminate session error",h),E.showMessage(h.message||"Failed to terminate session","error")}finally{const h={...c.value};delete h[d],c.value=h}}}function u(l){if($.value||S.navigationDisabled)return;const d=G(l);d&&(l.preventDefault(),d==="left"||d==="right"?ie(N.value,l.target,d,{itemSelector:".mini-btn"}):d==="up"?L("navigateOut","up"):d==="down"&&te(K.value,{itemSelector:"button"}))}function f(l){if($.value||S.navigationDisabled)return;const d=G(l);d&&(l.preventDefault(),d==="left"||d==="right"?ie(K.value,l.target,d,{itemSelector:"button"}):d==="up"?te(N.value,{itemSelector:".mini-btn"}):d==="down"&&x.value?.$el?.focus())}function r(l){$.value||S.navigationDisabled||(l==="up"?te(K.value,{itemSelector:"button"}):l==="down"&&De(w.value?.$el,0,{itemSelector:".session-group"}))}function t(l){if(!($.value||S.navigationDisabled)){if(l==="up")x.value?.$el?.focus();else if(l==="down"){const d=F.value?.querySelector("button");d&&d.focus()}}}function s(l){if($.value||S.navigationDisabled)return;const d=G(l);d&&(l.preventDefault(),d==="up"&&De(w.value?.$el,-1,{itemSelector:".session-group"}))}function D(){te(N.value,{itemSelector:".mini-btn"})}return J({focusFirstElement:D}),(l,d)=>(m(),p("div",ts,[o("div",{ref_key:"userInfoRef",ref:N,onKeydown:u},[n.userDetail&&!n.userDetail.error?(m(),H(st,{key:0,name:n.userDetail.display_name||n.selectedUser.display_name,visits:n.userDetail.visits,"created-at":n.userDetail.created_at,"last-seen":n.userDetail.last_seen,loading:n.loading,"org-display-name":n.userDetail.org.display_name,"role-name":n.userDetail.role,"update-endpoint":`/auth/api/admin/orgs/${n.selectedUser.org}/users/${n.selectedUser.uuid}/display-name`,onSaved:d[0]||(d[0]=h=>l.$emit("onUserNameSaved")),onEditName:Z},null,8,["name","visits","created-at","last-seen","loading","org-display-name","role-name","update-endpoint"])):T("",!0)],544),n.userDetail?.error?(m(),p("div",ss,A(n.userDetail.error),1)):T("",!0),n.userDetail&&!n.userDetail.error?(m(),p(C,{key:1},[o("div",{class:"registration-actions",ref_key:"regActionsRef",ref:K,onKeydown:f},[o("button",{class:"btn-secondary reg-token-btn",onClick:d[1]||(d[1]=h=>l.$emit("generateUserRegistrationLink",n.selectedUser)),disabled:n.loading},"Generate Registration Token",8,ns),d[6]||(d[6]=o("p",{class:"matrix-hint muted"}," Generate a one-time registration link so this user can register or add another passkey. Copy the link from the dialog and send it to the user, or have the user scan the QR code on their device. ",-1))],544),o("section",os,[d[7]||(d[7]=o("div",{class:"section-header"},[o("h2",null,"Registered Passkeys")],-1)),o("div",as,[ae(nt,{ref_key:"credentialListRef",ref:x,credentials:n.userDetail.credentials,"aaguid-info":n.userDetail.aaguid_info,"allow-delete":!0,"hovered-credential-uuid":y.value,"hovered-session-credential-uuid":q.value?.credential,"navigation-disabled":$.value,onDelete:ee,onCredentialHover:d[2]||(d[2]=h=>y.value=h),onNavigateOut:r},null,8,["credentials","aaguid-info","hovered-credential-uuid","hovered-session-credential-uuid","navigation-disabled"])])]),ae(ot,{ref_key:"sessionListRef",ref:w,sessions:n.userDetail.sessions||[],"terminating-sessions":c.value,"hovered-credential-uuid":y.value,"navigation-disabled":$.value,"empty-message":"This user has no active sessions.","section-description":"View and manage the active sessions for this user.",onTerminate:g,onSessionHover:d[3]||(d[3]=h=>q.value=h),onNavigateOut:t},null,8,["sessions","terminating-sessions","hovered-credential-uuid","navigation-disabled"])],64)):T("",!0),o("div",{class:"actions ancillary-actions",ref_key:"backButtonRef",ref:F,onKeydown:s},[n.selectedOrg?(m(),p("button",{key:0,onClick:d[4]||(d[4]=h=>l.$emit("openOrg",n.selectedOrg)),class:"icon-btn",title:"Back to Org"},"↩️")):T("",!0)],544),n.showRegModal?(m(),H(at,{key:2,endpoint:`/auth/api/admin/orgs/${n.selectedUser.org}/users/${n.selectedUser.uuid}/create-link`,"user-name":n.userDetail?.display_name||n.selectedUser.display_name,onClose:d[5]||(d[5]=h=>l.$emit("closeRegModal")),onCopied:_},null,8,["endpoint","user-name"])):T("",!0)]))}},rs=re(is,[["__scopeId","data-v-0b259926"]]),ls={class:"modal-title"},us={key:0},ds={key:2},cs={class:"small muted"},ms=["placeholder","pattern"],fs={class:"small muted"},gs={key:7},vs={key:8,class:"error small"},ys={key:9,class:"modal-actions"},ps=["disabled"],hs=["disabled"],bs={__name:"AdminDialogs",props:{dialog:Object,PERMISSION_ID_PATTERN:String,settings:Object},emits:["submitDialog","closeDialog"],setup(n,{emit:J}){const Y=n,S=new Set(["org-update","role-update","user-update-name"]),L=I(()=>Y.settings?.rp_id||"the configured domain");return(E,c)=>n.dialog.type?(m(),H(it,{key:0,onClose:c[14]||(c[14]=y=>E.$emit("closeDialog"))},{default:Ye(()=>[o("h3",ls,[n.dialog.type==="org-create"?(m(),p(C,{key:0},[z("Create Organization")],64)):n.dialog.type==="org-update"?(m(),p(C,{key:1},[z("Rename Organization")],64)):n.dialog.type==="role-create"?(m(),p(C,{key:2},[z("Create Role")],64)):n.dialog.type==="role-update"?(m(),p(C,{key:3},[z("Edit Role")],64)):n.dialog.type==="user-create"?(m(),p(C,{key:4},[z("Add User To Role")],64)):n.dialog.type==="user-update-name"?(m(),p(C,{key:5},[z("Edit User Name")],64)):n.dialog.type==="perm-create"||n.dialog.type==="perm-display"?(m(),p(C,{key:6},[z(A(n.dialog.type==="perm-create"?"Create Permission":"Edit Permission"),1)],64)):n.dialog.type==="confirm"?(m(),p(C,{key:7},[z("Confirm")],64)):T("",!0)]),o("form",{onSubmit:c[13]||(c[13]=Se(y=>E.$emit("submitDialog"),["prevent"])),class:"modal-form"},[n.dialog.type==="org-create"?(m(),p("label",us,[c[15]||(c[15]=z("Name ",-1)),ne(o("input",{ref:"nameInput","onUpdate:modelValue":c[0]||(c[0]=y=>n.dialog.data.name=y),required:""},null,512),[[oe,n.dialog.data.name]])])):n.dialog.type==="org-update"?(m(),H(me,{key:1,label:"Organization Name",modelValue:n.dialog.data.name,"onUpdate:modelValue":c[1]||(c[1]=y=>n.dialog.data.name=y),busy:n.dialog.busy,error:n.dialog.error,onCancel:c[2]||(c[2]=y=>E.$emit("closeDialog"))},null,8,["modelValue","busy","error"])):n.dialog.type==="role-create"?(m(),p("label",ds,[c[16]||(c[16]=z("Role Name ",-1)),ne(o("input",{"onUpdate:modelValue":c[3]||(c[3]=y=>n.dialog.data.name=y),placeholder:"Role name",required:""},null,512),[[oe,n.dialog.data.name]])])):n.dialog.type==="role-update"?(m(),H(me,{key:3,label:"Role Name",modelValue:n.dialog.data.name,"onUpdate:modelValue":c[4]||(c[4]=y=>n.dialog.data.name=y),busy:n.dialog.busy,error:n.dialog.error,onCancel:c[5]||(c[5]=y=>E.$emit("closeDialog"))},null,8,["modelValue","busy","error"])):n.dialog.type==="user-create"?(m(),p(C,{key:4},[o("p",cs,"Role: "+A(n.dialog.data.role.display_name),1),o("label",null,[c[17]||(c[17]=z("Display Name ",-1)),ne(o("input",{"onUpdate:modelValue":c[6]||(c[6]=y=>n.dialog.data.name=y),placeholder:"User display name",required:""},null,512),[[oe,n.dialog.data.name]])])],64)):n.dialog.type==="user-update-name"?(m(),H(me,{key:5,label:"Display Name",modelValue:n.dialog.data.name,"onUpdate:modelValue":c[7]||(c[7]=y=>n.dialog.data.name=y),busy:n.dialog.busy,error:n.dialog.error,onCancel:c[8]||(c[8]=y=>E.$emit("closeDialog"))},null,8,["modelValue","busy","error"])):n.dialog.type==="perm-create"||n.dialog.type==="perm-display"?(m(),p(C,{key:6},[o("label",null,[c[18]||(c[18]=z("Display Name ",-1)),ne(o("input",{ref:"displayNameInput","onUpdate:modelValue":c[9]||(c[9]=y=>n.dialog.data.display_name=y),required:""},null,512),[[oe,n.dialog.data.display_name]])]),o("label",null,[c[19]||(c[19]=z("Permission Scope ",-1)),ne(o("input",{"onUpdate:modelValue":c[10]||(c[10]=y=>n.dialog.data.scope=y),placeholder:n.dialog.type==="perm-create"?"yourapp:permission":n.dialog.data.permission.scope,required:"",pattern:n.PERMISSION_ID_PATTERN,title:"Allowed: A-Za-z0-9:._~-","data-form-type":"other"},null,8,ms),[[oe,n.dialog.data.scope]])]),c[21]||(c[21]=o("p",{class:"small muted"},"E.g. yourapp:reports. Changing the scope name may break deployed applications.",-1)),o("label",null,[c[20]||(c[20]=z("Domain Scope ",-1)),ne(o("input",{"onUpdate:modelValue":c[11]||(c[11]=y=>n.dialog.data.domain=y),placeholder:"e.g. app.example.com","data-form-type":"other"},null,512),[[oe,n.dialog.data.domain]])]),o("p",fs,"If set, this permission is effective only on the specified domain, which can be "+A(L.value)+" or its subdomain.",1)],64)):n.dialog.type==="confirm"?(m(),p("p",gs,A(n.dialog.data.message),1)):T("",!0),n.dialog.error&&!ge(S).has(n.dialog.type)?(m(),p("div",vs,A(n.dialog.error),1)):T("",!0),ge(S).has(n.dialog.type)?T("",!0):(m(),p("div",ys,[o("button",{type:"button",class:"btn-secondary",onClick:c[12]||(c[12]=y=>E.$emit("closeDialog")),disabled:n.dialog.busy}," Cancel ",8,ps),o("button",{type:"submit",class:"btn-primary",disabled:n.dialog.busy},A(n.dialog.type==="confirm"?"OK":"Save"),9,hs)]))],32)]),_:1})):T("",!0)}},ws=re(bs,[["__scopeId","data-v-8d16c6cc"]]),$s={class:"app-shell admin-shell"},Ds={class:"app-main"},ks={key:4,class:"view-root view-root--wide view-admin"},Ss={class:"view-header"},Os={class:"section-block admin-section"},Rs={class:"section-body admin-section-body"},Cs={class:"admin-panels"},As="^[A-Za-z0-9:._~-]+$",Us={__name:"AdminApp",setup(n){const J=k(null),Y=k(!0),S=k("Loading..."),L=k(!1),E=k(!1),c=k(null),y=k([]),q=k([]),N=k(null),K=k(null),x=k(null),w=Oe(),F=k(null);k(null),k(""),k(null),k("");const $=k({type:null,data:null,busy:!1,error:""}),_=k(null),Z=k(null),ee=k(null),g=k(null),u=k(null),f=I(()=>$.value.type!==null||ue.value),r=I(()=>J.value?.ctx.permissions.includes("auth:admin")),t=I(()=>J.value?.ctx.permissions.includes("auth:org:admin"));function s(e){if(!F.value)return;const a=e.target.closest(".org-add-menu"),i=e.target.closest(".add-org-btn");!a&&!i&&(F.value=null)}We(async()=>{document.addEventListener("click",s),window.addEventListener("hashchange",d),await w.loadSettings(),w.settings?.rp_name&&(document.title=w.settings.rp_name+" Admin"),await B()}),Ze(()=>{document.removeEventListener("click",s),window.removeEventListener("hashchange",d)});const D=I(()=>{const e={};for(const i of y.value){const v={uuid:i.uuid,display_name:i.display_name},b=new Set(i.permissions||[]);for(const O of i.permissions||[])e[O]||(e[O]={orgs:[],orgSet:new Set,userCount:0}),e[O].orgSet.has(i.uuid)||(e[O].orgs.push(v),e[O].orgSet.add(i.uuid));for(const O of i.roles)for(const U of O.permissions)b.has(U)&&(e[U]||(e[U]={orgs:[],orgSet:new Set,userCount:0}),e[U].orgSet.has(i.uuid)||(e[U].orgs.push(v),e[U].orgSet.add(i.uuid)),e[U].userCount+=O.users.length)}const a={};for(const[i,v]of Object.entries(e))a[i]={orgs:v.orgs.sort((b,O)=>b.display_name.localeCompare(O.display_name)),userCount:v.userCount};return a});function l(e){Q("perm-display",{permission:e,scope:e.scope,display_name:e.display_name,domain:e.domain||""})}function d(){const e=window.location.hash||"";N.value=null,K.value=null,e.startsWith("#org/")?N.value=e.slice(5):e.startsWith("#user/")&&(K.value=e.slice(6))}async function h(){const e=await P("/auth/api/admin/orgs");y.value=e.map(a=>{const i=a.roles.map(b=>({...b,org:a.uuid,users:[]})),v=Object.fromEntries(i.map(b=>[b.display_name,b]));for(const b of a.users||[])v[b.role]&&v[b.role].users.push(b);return{...a,roles:i}})}async function R(){q.value=await P("/auth/api/admin/permissions")}async function V(){const e=await P("/auth/api/validate",{method:"POST"});J.value=e,L.value=!0}function M(){J.value=null,y.value=[],q.value=[],x.value=null,L.value=!1}async function B(){Y.value=!0,S.value="Loading...",c.value=null;try{await Promise.all([h(),R()]),await V(),!r.value&&t.value&&y.value.length===1&&(!window.location.hash||window.location.hash==="#overview")?(N.value=y.value[0].uuid,window.location.hash=`#org/${N.value}`,w.showMessage(`Navigating to ${y.value[0].display_name} Administration`,"info",3e3)):d()}catch(e){M(),e.name==="AuthCancelledError"?E.value=!0:c.value=e.message}finally{Y.value=!1}}function le(){Q("org-create",{})}function ve(e){Q("org-update",{org:e,name:e.display_name})}function Ce(e){Q("user-update-name",{user:e,name:e.display_name})}async function ye(e){await P(`/auth/api/admin/orgs/${e}`,{method:"DELETE"}),await Promise.all([h(),R()])}function Ae(e){if(e.roles.reduce((b,O)=>b+O.users.length,0)===0){ye(e.uuid).then(()=>{w.showMessage(`Organization "${e.display_name}" deleted.`,"success",2500)}).catch(b=>{w.showMessage(b.message||"Failed to delete organization","error")});return}const v=e.roles.filter(b=>b.users.length>0).map(b=>`${b.users.length} ${b.display_name}`).join(", ");Q("confirm",{message:`Delete organization "${e.display_name}", including accounts of ${v})?`,action:async()=>{await ye(e.uuid)}})}function Ue(e,a){Q("user-create",{org:e,role:a})}async function Ee(e,a,i){if(a.role!==i)try{await P(`/auth/api/admin/orgs/${e.uuid}/users/${a.uuid}/role`,{method:"PATCH",body:{role:i}}),await h()}catch(v){w.showMessage(v.message||"Failed to update user role")}}function Me(e,a,i){e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify({user_uuid:a.uuid,org:i}))}function Pe(e){e.preventDefault(),e.dataTransfer.dropEffect="move"}function qe(e,a,i){e.preventDefault();try{const v=JSON.parse(e.dataTransfer.getData("text/plain"));if(v.org!==a.uuid)return;const b=a.roles.flatMap(O=>O.users).find(O=>O.uuid===v.user_uuid);b&&Ee(a,b,i.display_name)}catch{}}function xe(e){Q("role-create",{org:e})}function Ne(e){Q("role-update",{role:e,name:e.display_name})}function Te(e){P(`/auth/api/admin/orgs/${e.org}/roles/${e.uuid}`,{method:"DELETE"}).then(()=>{w.showMessage(`Role "${e.display_name}" deleted.`,"success",2500),h()}).catch(a=>{w.showMessage(a.message||"Failed to delete role","error")})}async function Le(e,a,i){const v=[...e.permissions],b=i?[...e.permissions,a]:e.permissions.filter(O=>O!==a);e.permissions=b;try{const O=i?"POST":"DELETE";await P(`/auth/api/admin/orgs/${e.org}/roles/${e.uuid}/permissions/${a}`,{method:O}),await h()}catch(O){w.showMessage(O.message||"Failed to update role permission"),e.permissions=v}}async function pe(e){const a=new URLSearchParams({permission_uuid:e});await P(`/auth/api/admin/permission?${a.toString()}`,{method:"DELETE"}),await R()}function Fe(e){const a=D.value[e.uuid]?.userCount||0;let i=0;for(const O of y.value)for(const U of O.roles)U.permissions.includes(e.uuid)&&i++;if(i===0){pe(e.uuid).then(()=>{w.showMessage(`Permission "${e.display_name}" deleted.`,"success",2500)}).catch(O=>{w.showMessage(O.message||"Failed to delete permission","error")});return}const v=[];i>0&&v.push(`${i} role${i!==1?"s":""}`),a>0&&v.push(`${a} user${a!==1?"s":""}`);const b=v.join(", ");Q("confirm",{message:`Delete permission "${e.display_name}" (${b})?`,action:async()=>{await pe(e.uuid)}})}const se=I(()=>y.value.find(e=>e.uuid===N.value)||null);function he(e){window.location.hash=`#org/${e.uuid}`}function Ie(){window.location.hash="#overview"}function Ke(e){window.location.hash=`#user/${e.uuid}`}const j=I(()=>{if(!K.value)return null;for(const e of y.value)for(const a of e.roles){const i=a.users.find(v=>v.uuid===K.value);if(i)return{...i,org:e.uuid,role_display_name:a.display_name}}return null}),Be=I(()=>j.value?"Admin: User":se.value?"Admin: Org":(w.settings?.rp_name||"Master")+" Admin"),ze=I(()=>{const e=[{label:"Auth",href:Qe()},{label:"Admin",href:Xe()}];let a=null;j.value&&(a=y.value.find(v=>v.uuid===j.value.org)||null);const i=se.value||a;return i&&e.push({label:i.display_name,href:`#org/${i.uuid}`}),j.value&&e.push({label:j.value.display_name,href:`#user/${j.value.uuid}`}),e});_e(j,async e=>{if(!e){x.value=null;return}try{x.value=await P(`/auth/api/admin/orgs/${e.org}/users/${e.uuid}`)}catch(a){x.value={error:a.message}}});const ue=k(!1);function Ve(e){ue.value=!0}async function je(e,a,i){const v=e.permissions.includes(a);if(i&&v||!i&&!v)return;const b=i?[...e.permissions,a]:e.permissions.filter(U=>U!==a),O=[...e.permissions];e.permissions=b;try{const U=new URLSearchParams({permission_uuid:a});await P(`/auth/api/admin/orgs/${e.uuid}/permission?${U.toString()}`,{method:i?"POST":"DELETE"}),await h()}catch(U){w.showMessage(U.message||"Failed to update organization permission","error"),e.permissions=O}}function Q(e,a){const i=document.activeElement;if(_.value=i,e==="confirm"&&i){const v=i.closest("tr");if(v){const b=v.closest("tbody");if(b){const O=Array.from(b.querySelectorAll("tr")),U=O.indexOf(v);$.value.focusContext={tbody:b,index:U,total:O.length,selector:"button:not([disabled]), a"}}}}$.value={...$.value,type:e,data:a,busy:!1,error:""}}function W(){const e=_.value,a=$.value.focusContext;$.value={type:null,data:null,busy:!1,error:""},He(e,a),_.value=null}function He(e,a){if(!e)return;if(document.body.contains(e)&&!e.disabled){e.focus();return}if(a?.tbody&&a.selector){const b=Array.from(a.tbody.querySelectorAll("tr"));if(b.length>0){const O=Math.min(a.index,b.length-1),de=b[O]?.querySelector(a.selector);if(de){de.focus();return}}}const i=document.querySelector(".admin-panels");if(!i)return;const v=i.querySelector('button:not([disabled]), a, input:not([disabled]), [tabindex="0"]');v&&v.focus()}function Ge(e){if(f.value)return;const a=G(e);a&&a==="down"&&(e.preventDefault(),ee.value?ee.value.focusFirstElement?.():g.value?g.value.focusFirstElement?.():u.value&&u.value.focusFirstElement?.())}function ce(e){f.value||e==="up"&&Z.value?.focusCurrent?.()}async function be(){if(await h(),j.value)try{x.value=await P(`/auth/api/admin/orgs/${j.value.org}/users/${j.value.uuid}`)}catch(e){w.showMessage(e.message||"Failed to reload user","error")}}async function we(){await be(),w.showMessage("User renamed","success",1500)}async function Je(){if(!(!$.value.type||$.value.busy)){$.value.busy=!0,$.value.error="";try{const e=$.value.type;if(e==="org-create"){const a=$.value.data.name?.trim();if(!a)throw new Error("Name required");W(),P("/auth/api/admin/orgs",{method:"POST",body:{display_name:a,permissions:[]}}).then(()=>{w.showMessage(`Organization "${a}" created.`,"success",2500),Promise.all([h(),R()])}).catch(i=>{w.showMessage(i.message||"Failed to create organization","error")});return}else if(e==="org-update"){const{org:a}=$.value.data,i=$.value.data.name?.trim();if(!i)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.uuid}`,{method:"PATCH",body:{display_name:i}}).then(()=>{w.showMessage(`Organization renamed to "${i}".`,"success",2500),h()}).catch(v=>{w.showMessage(v.message||"Failed to update organization","error")});return}else if(e==="role-create"){const{org:a}=$.value.data,i=$.value.data.name?.trim();if(!i)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.uuid}/roles`,{method:"POST",body:{display_name:i,permissions:[]}}).then(()=>{w.showMessage(`Role "${i}" created.`,"success",2500),h()}).catch(v=>{w.showMessage(v.message||"Failed to create role","error")});return}else if(e==="role-update"){const{role:a}=$.value.data,i=$.value.data.name?.trim();if(!i)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.org}/roles/${a.uuid}`,{method:"PATCH",body:{display_name:i}}).then(()=>{w.showMessage(`Role renamed to "${i}".`,"success",2500),h()}).catch(v=>{w.showMessage(v.message||"Failed to update role","error")});return}else if(e==="user-create"){const{org:a,role:i}=$.value.data,v=$.value.data.name?.trim();if(!v)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.uuid}/users`,{method:"POST",body:{display_name:v,role:i.display_name}}).then(()=>{w.showMessage(`User "${v}" added to ${i.display_name} role.`,"success",2500),h()}).catch(b=>{w.showMessage(b.message||"Failed to add user","error")});return}else if(e==="user-update-name"){const{user:a}=$.value.data,i=$.value.data.name?.trim();if(!i)throw new Error("Name required");W(),P(`/auth/api/admin/orgs/${a.org}/users/${a.uuid}/display-name`,{method:"PATCH",body:{display_name:i}}).then(()=>{w.showMessage(`User renamed to "${i}".`,"success",2500),we()}).catch(v=>{w.showMessage(v.message||"Failed to update user name","error")});return}else if(e==="perm-display"){const{permission:a}=$.value.data,i=$.value.data.scope?.trim(),v=$.value.data.display_name?.trim(),b=$.value.data.domain?.trim()||"";if(!v)throw new Error("Display name required");if(!i)throw new Error("Scope required");W();const O=a.domain||"";if(i===a.scope&&v===a.display_name&&b===O)return;const U=new URLSearchParams({permission_uuid:a.uuid});i!==a.scope&&U.set("scope",i),v!==a.display_name&&U.set("display_name",v),b!==O&&U.set("domain",b||""),P(`/auth/api/admin/permission?${U.toString()}`,{method:"PATCH"}).then(()=>{w.showMessage(`Permission "${v}" updated.`,"success",2500),R()}).catch(de=>{w.showMessage(de.message||"Failed to update permission","error")});return}else if(e==="perm-create"){const a=$.value.data.scope?.trim();if(!a)throw new Error("Scope required");const i=$.value.data.display_name?.trim();if(!i)throw new Error("Display name required");const v=$.value.data.domain?.trim()||"";W(),P("/auth/api/admin/permissions",{method:"POST",body:{scope:a,display_name:i,domain:v||void 0}}).then(()=>{w.showMessage(`Permission "${i}" created.`,"success",2500),R()}).catch(b=>{w.showMessage(b.message||"Failed to create permission","error")});return}else if(e==="confirm"){const a=$.value.data.action;if(W(),a)try{await a()}catch(i){w.showMessage(i.message||"Action failed","error")}return}W()}catch(e){$.value.error=e.message||"Error"}finally{$.value.busy=!1}}}return(e,a)=>(m(),p("div",$s,[ae(rt),o("main",Ds,[Y.value?(m(),H(lt,{key:0,message:S.value},null,8,["message"])):E.value?(m(),H(fe,{key:1})):c.value?(m(),H(fe,{key:2,icon:"⚠️",title:"Error",message:c.value},null,8,["message"])):L.value&&!r.value&&!t.value?(m(),H(fe,{key:3,icon:"⛔",message:"You do not have admin permissions for this application."})):L.value&&(r.value||t.value)?(m(),p("section",ks,[o("header",Ss,[o("h1",null,A(Be.value),1),ae(ut,{ref_key:"breadcrumbsRef",ref:Z,entries:ze.value,onKeydown:Ge},null,8,["entries"])]),o("section",Os,[o("div",Rs,[o("div",Cs,[!j.value&&!se.value&&(r.value||t.value)?(m(),H(Nt,{key:0,ref_key:"adminOverviewRef",ref:ee,info:J.value,orgs:y.value,permissions:q.value,"navigation-disabled":f.value,"permission-summary":D.value,onCreateOrg:le,onOpenOrg:he,onUpdateOrg:ve,onDeleteOrg:Ae,onToggleOrgPermission:je,onOpenDialog:Q,onDeletePermission:Fe,onRenamePermissionDisplay:l,onNavigateOut:ce},null,8,["info","orgs","permissions","navigation-disabled","permission-summary"])):j.value?(m(),H(rs,{key:1,ref_key:"adminUserDetailRef",ref:u,"selected-user":j.value,"user-detail":x.value,"selected-org":se.value,loading:Y.value,"show-reg-modal":ue.value,"navigation-disabled":f.value,onGenerateUserRegistrationLink:Ve,onGoOverview:Ie,onOpenOrg:he,onOnUserNameSaved:we,onRefreshUserDetail:be,onEditUserName:Ce,onCloseRegModal:a[0]||(a[0]=i=>ue.value=!1),onNavigateOut:ce},null,8,["selected-user","user-detail","selected-org","loading","show-reg-modal","navigation-disabled"])):se.value?(m(),H(es,{key:2,ref_key:"adminOrgDetailRef",ref:g,"selected-org":se.value,permissions:q.value,"navigation-disabled":f.value,onUpdateOrg:ve,onCreateRole:xe,onUpdateRole:Ne,onDeleteRole:Te,onCreateUserInRole:Ue,onOpenUser:Ke,onToggleRolePermission:Le,onOnRoleDragOver:Pe,onNavigateOut:ce,onOnRoleDrop:qe,onOnUserDragStart:Me},null,8,["selected-org","permissions","navigation-disabled"])):T("",!0)])])])])):T("",!0)]),ae(ws,{dialog:$.value,"permission-id-pattern":As,settings:ge(w).settings,onSubmitDialog:Je,onCloseDialog:W},null,8,["dialog","settings"])]))}},Es=re(Us,[["__scopeId","data-v-1d1c1f6a"]]),Re=et(Es);Re.use(dt());Re.mount("#admin-app");tt();
@@ -1 +1 @@
1
- .permissions-section[data-v-ee865306]{margin-bottom:var(--space-xl)}.permissions-section h2[data-v-ee865306]{margin-bottom:var(--space-md)}.actions[data-v-ee865306]{display:flex;flex-wrap:wrap;gap:var(--space-sm);align-items:center}.actions button[data-v-ee865306]{width:auto}.org-table a[data-v-ee865306]{text-decoration:none;color:var(--color-link)}.org-table a[data-v-ee865306]:hover{text-decoration:underline}.org-table .center[data-v-ee865306]{width:6rem;min-width:6rem}.org-table .role-names[data-v-ee865306]{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.perm-name-cell[data-v-ee865306]{display:flex;flex-direction:column;gap:.3rem}.perm-title[data-v-ee865306]{font-weight:600;color:var(--color-heading)}.perm-id-info[data-v-ee865306]{font-size:.8rem;color:var(--color-text-muted);display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.perm-domain[data-v-ee865306]{color:var(--color-text-muted);font-size:.9rem}.icon-btn[data-v-ee865306]{background:none;border:none;color:var(--color-text-muted);padding:.2rem;border-radius:var(--radius-sm);cursor:pointer;transition:background .2s ease,color .2s ease}.icon-btn[data-v-ee865306]:hover{color:var(--color-heading);background:var(--color-surface-muted)}.delete-icon[data-v-ee865306]{color:var(--color-danger)}.delete-icon[data-v-ee865306]:hover{background:var(--color-danger-bg);color:var(--color-danger-text)}.matrix-wrapper[data-v-ee865306]{margin:var(--space-md) 0;padding:var(--space-lg)}.matrix-scroll[data-v-ee865306]{overflow-x:auto}.matrix-hint[data-v-ee865306]{font-size:.8rem;color:var(--color-text-muted)}.perm-matrix-grid[data-v-ee865306]{display:inline-grid;gap:.25rem;align-items:stretch}.perm-matrix-grid[data-v-ee865306]>*{padding:.35rem .45rem;font-size:.75rem}.perm-matrix-grid .grid-head[data-v-ee865306]{color:var(--color-text-muted);text-transform:uppercase;font-weight:600;letter-spacing:.05em}.perm-matrix-grid .perm-head[data-v-ee865306]{display:flex;align-items:flex-end;justify-content:flex-start;padding:.35rem .45rem;font-size:.75rem}.perm-matrix-grid .org-head[data-v-ee865306]{display:flex;align-items:flex-end;justify-content:center}.perm-matrix-grid .org-head span[data-v-ee865306]{writing-mode:vertical-rl;transform:rotate(180deg);font-size:.65rem}.perm-name[data-v-ee865306]{font-weight:600;color:var(--color-heading);padding:.35rem .45rem;font-size:.75rem}.display-text[data-v-ee865306]{margin-right:var(--space-xs)}.edit-display-btn[data-v-ee865306]{padding:.1rem .2rem;font-size:.8rem}.edit-org-btn[data-v-ee865306]{padding:.1rem .2rem;font-size:.8rem;margin-left:var(--space-xs)}.perm-actions[data-v-ee865306],.center[data-v-ee865306]{text-align:center}.muted[data-v-ee865306]{color:var(--color-text-muted)}.card.surface[data-v-f76fbbc3]{padding:var(--space-lg)}.org-title[data-v-f76fbbc3]{display:flex;align-items:center;gap:var(--space-sm);margin-bottom:var(--space-lg)}.org-name[data-v-f76fbbc3]{font-size:1.5rem;font-weight:600;color:var(--color-heading)}.icon-btn[data-v-f76fbbc3]{background:none;border:none;color:var(--color-text-muted);padding:.2rem;border-radius:var(--radius-sm);cursor:pointer;transition:background .2s ease,color .2s ease}.icon-btn[data-v-f76fbbc3]:hover{color:var(--color-heading);background:var(--color-surface-muted)}.matrix-wrapper[data-v-f76fbbc3]{margin:var(--space-md) 0;padding:var(--space-lg)}.matrix-scroll[data-v-f76fbbc3]{overflow-x:auto}.matrix-hint[data-v-f76fbbc3]{font-size:.8rem;color:var(--color-text-muted)}.perm-matrix-grid[data-v-f76fbbc3]{display:inline-grid;gap:.25rem;align-items:stretch}.perm-matrix-grid[data-v-f76fbbc3]>*{padding:.35rem .45rem;font-size:.75rem}.perm-matrix-grid .grid-head[data-v-f76fbbc3]{color:var(--color-text-muted);text-transform:uppercase;font-weight:600;letter-spacing:.05em}.perm-matrix-grid .perm-head[data-v-f76fbbc3]{display:flex;align-items:flex-end;justify-content:flex-start;padding:.35rem .45rem;font-size:.75rem}.perm-matrix-grid .role-head[data-v-f76fbbc3]{display:flex;align-items:flex-end;justify-content:center}.perm-matrix-grid .role-head span[data-v-f76fbbc3]{writing-mode:vertical-rl;transform:rotate(180deg);font-size:.65rem}.perm-matrix-grid .add-role-head[data-v-f76fbbc3]{cursor:pointer}.perm-name[data-v-f76fbbc3]{font-weight:600;color:var(--color-heading);padding:.35rem .45rem;font-size:.75rem}.roles-grid[data-v-f76fbbc3]{display:flex;gap:var(--space-lg);margin-top:var(--space-lg)}.role-column[data-v-f76fbbc3]{flex:1;min-width:200px;border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-md)}.role-header[data-v-f76fbbc3]{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--space-md)}.role-name[data-v-f76fbbc3]{display:flex;align-items:center;gap:var(--space-xs);font-size:1.1rem;color:var(--color-heading)}.role-actions[data-v-f76fbbc3]{display:flex;gap:var(--space-xs)}.plus-btn[data-v-f76fbbc3]{background:var(--color-accent-soft);color:var(--color-accent);border:none;border-radius:var(--radius-sm);padding:.25rem .45rem;font-size:1.1rem;cursor:pointer}.plus-btn[data-v-f76fbbc3]:hover{background:#2563eb2e}.user-list[data-v-f76fbbc3]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:var(--space-xs)}.user-chip[data-v-f76fbbc3]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:.45rem .6rem;display:flex;justify-content:space-between;gap:var(--space-sm);cursor:grab}.user-chip[data-v-f76fbbc3]:focus{outline:2px solid var(--color-accent);outline-offset:1px}.user-chip .meta[data-v-f76fbbc3]{font-size:.7rem;color:var(--color-text-muted)}.empty-role[data-v-f76fbbc3]{border:1px dashed var(--color-border-strong);border-radius:var(--radius-md);padding:var(--space-sm);display:flex;flex-direction:column;gap:var(--space-xs);align-items:flex-start}.empty-text[data-v-f76fbbc3]{margin:0}.delete-icon[data-v-f76fbbc3]{color:var(--color-danger)}.delete-icon[data-v-f76fbbc3]:hover{background:var(--color-danger-bg);color:var(--color-danger-text)}.muted[data-v-f76fbbc3]{color:var(--color-text-muted)}@media(max-width:720px){.roles-grid[data-v-f76fbbc3]{flex-direction:column}}.user-detail[data-v-70289426]{display:flex;flex-direction:column;gap:var(--space-lg)}.actions[data-v-70289426]{display:flex;flex-wrap:wrap;gap:var(--space-sm);align-items:center}.ancillary-actions[data-v-70289426]{margin-top:-.5rem}.reg-token-btn[data-v-70289426]{align-self:flex-start}.registration-actions[data-v-70289426]{display:flex;flex-direction:column;gap:.5rem}.icon-btn[data-v-70289426]{background:none;border:none;color:var(--color-text-muted);padding:.2rem;border-radius:var(--radius-sm);cursor:pointer;transition:background .2s ease,color .2s ease}.icon-btn[data-v-70289426]:hover{color:var(--color-heading);background:var(--color-surface-muted)}.matrix-hint[data-v-70289426]{font-size:.8rem;color:var(--color-text-muted)}.error[data-v-70289426]{color:var(--color-danger-text)}.small[data-v-70289426]{font-size:.9rem}.muted[data-v-70289426]{color:var(--color-text-muted)}.error[data-v-4e9dba95]{color:var(--color-danger-text)}.small[data-v-4e9dba95]{font-size:.9rem}.muted[data-v-4e9dba95]{color:var(--color-text-muted)}.optional[data-v-4e9dba95]{font-weight:400;color:var(--color-text-muted);font-size:.85em}.view-admin[data-v-17f9d23b]{padding-bottom:var(--space-3xl)}.view-header[data-v-17f9d23b]{display:flex;flex-direction:column;gap:var(--space-sm)}.admin-section[data-v-17f9d23b]{margin-top:var(--space-xl)}.admin-section-body[data-v-17f9d23b],.admin-panels[data-v-17f9d23b]{display:flex;flex-direction:column;gap:var(--space-xl)}.access-denied-container[data-v-17f9d23b]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;padding:2rem}.access-denied-content[data-v-17f9d23b]{text-align:center;max-width:480px}.access-denied-content h2[data-v-17f9d23b]{margin:0 0 1rem;color:var(--color-heading);font-size:1.5rem}.access-denied-content .error-detail[data-v-17f9d23b]{margin:0 0 1.5rem;color:var(--color-text-muted)}.access-denied-content .button-row[data-v-17f9d23b]{display:flex;gap:.75rem;justify-content:center}
1
+ .permissions-section[data-v-56228c4a]{margin-bottom:var(--space-xl)}.permissions-section h2[data-v-56228c4a]{margin-bottom:var(--space-md)}.actions[data-v-56228c4a]{display:flex;flex-wrap:wrap;gap:var(--space-sm);align-items:center}.actions button[data-v-56228c4a]{width:auto}.org-table a[data-v-56228c4a]{text-decoration:none;color:var(--color-link)}.org-table a[data-v-56228c4a]:hover{text-decoration:underline}.org-table .center[data-v-56228c4a]{width:6rem;min-width:6rem}.org-table .role-names[data-v-56228c4a]{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.perm-name-cell[data-v-56228c4a]{display:flex;flex-direction:column;gap:.3rem}.perm-title[data-v-56228c4a]{font-weight:600;color:var(--color-heading)}.perm-id-info[data-v-56228c4a]{font-size:.8rem;color:var(--color-text-muted);display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.perm-domain[data-v-56228c4a]{color:var(--color-text-muted);font-size:.9rem}.icon-btn[data-v-56228c4a]{background:none;border:none;color:var(--color-text-muted);padding:.2rem;border-radius:var(--radius-sm);cursor:pointer;transition:background .2s ease,color .2s ease}.icon-btn[data-v-56228c4a]:hover{color:var(--color-heading);background:var(--color-surface-muted)}.delete-icon[data-v-56228c4a]{color:var(--color-danger)}.delete-icon[data-v-56228c4a]:hover{background:var(--color-danger-bg);color:var(--color-danger-text)}.matrix-wrapper[data-v-56228c4a]{margin:var(--space-md) 0;padding:var(--space-lg)}.matrix-scroll[data-v-56228c4a]{overflow-x:auto}.matrix-hint[data-v-56228c4a]{font-size:.8rem;color:var(--color-text-muted)}.perm-matrix-grid[data-v-56228c4a]{display:inline-grid;gap:.25rem;align-items:stretch}.perm-matrix-grid[data-v-56228c4a]>*{padding:.35rem .45rem;font-size:.75rem}.perm-matrix-grid .grid-head[data-v-56228c4a]{color:var(--color-text-muted);text-transform:uppercase;font-weight:600;letter-spacing:.05em}.perm-matrix-grid .perm-head[data-v-56228c4a]{display:flex;align-items:flex-end;justify-content:flex-start;padding:.35rem .45rem;font-size:.75rem}.perm-matrix-grid .org-head[data-v-56228c4a]{display:flex;align-items:flex-end;justify-content:center}.perm-matrix-grid .org-head span[data-v-56228c4a]{writing-mode:vertical-rl;transform:rotate(180deg);font-size:.65rem}.perm-name[data-v-56228c4a]{font-weight:600;color:var(--color-heading);padding:.35rem .45rem;font-size:.75rem}.display-text[data-v-56228c4a]{margin-right:var(--space-xs)}.edit-display-btn[data-v-56228c4a]{padding:.1rem .2rem;font-size:.8rem}.edit-org-btn[data-v-56228c4a]{padding:.1rem .2rem;font-size:.8rem;margin-left:var(--space-xs)}.perm-actions[data-v-56228c4a],.center[data-v-56228c4a]{text-align:center}.muted[data-v-56228c4a]{color:var(--color-text-muted)}.card.surface[data-v-f76fbbc3]{padding:var(--space-lg)}.org-title[data-v-f76fbbc3]{display:flex;align-items:center;gap:var(--space-sm);margin-bottom:var(--space-lg)}.org-name[data-v-f76fbbc3]{font-size:1.5rem;font-weight:600;color:var(--color-heading)}.icon-btn[data-v-f76fbbc3]{background:none;border:none;color:var(--color-text-muted);padding:.2rem;border-radius:var(--radius-sm);cursor:pointer;transition:background .2s ease,color .2s ease}.icon-btn[data-v-f76fbbc3]:hover{color:var(--color-heading);background:var(--color-surface-muted)}.matrix-wrapper[data-v-f76fbbc3]{margin:var(--space-md) 0;padding:var(--space-lg)}.matrix-scroll[data-v-f76fbbc3]{overflow-x:auto}.matrix-hint[data-v-f76fbbc3]{font-size:.8rem;color:var(--color-text-muted)}.perm-matrix-grid[data-v-f76fbbc3]{display:inline-grid;gap:.25rem;align-items:stretch}.perm-matrix-grid[data-v-f76fbbc3]>*{padding:.35rem .45rem;font-size:.75rem}.perm-matrix-grid .grid-head[data-v-f76fbbc3]{color:var(--color-text-muted);text-transform:uppercase;font-weight:600;letter-spacing:.05em}.perm-matrix-grid .perm-head[data-v-f76fbbc3]{display:flex;align-items:flex-end;justify-content:flex-start;padding:.35rem .45rem;font-size:.75rem}.perm-matrix-grid .role-head[data-v-f76fbbc3]{display:flex;align-items:flex-end;justify-content:center}.perm-matrix-grid .role-head span[data-v-f76fbbc3]{writing-mode:vertical-rl;transform:rotate(180deg);font-size:.65rem}.perm-matrix-grid .add-role-head[data-v-f76fbbc3]{cursor:pointer}.perm-name[data-v-f76fbbc3]{font-weight:600;color:var(--color-heading);padding:.35rem .45rem;font-size:.75rem}.roles-grid[data-v-f76fbbc3]{display:flex;gap:var(--space-lg);margin-top:var(--space-lg)}.role-column[data-v-f76fbbc3]{flex:1;min-width:200px;border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-md)}.role-header[data-v-f76fbbc3]{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--space-md)}.role-name[data-v-f76fbbc3]{display:flex;align-items:center;gap:var(--space-xs);font-size:1.1rem;color:var(--color-heading)}.role-actions[data-v-f76fbbc3]{display:flex;gap:var(--space-xs)}.plus-btn[data-v-f76fbbc3]{background:var(--color-accent-soft);color:var(--color-accent);border:none;border-radius:var(--radius-sm);padding:.25rem .45rem;font-size:1.1rem;cursor:pointer}.plus-btn[data-v-f76fbbc3]:hover{background:#2563eb2e}.user-list[data-v-f76fbbc3]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:var(--space-xs)}.user-chip[data-v-f76fbbc3]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:.45rem .6rem;display:flex;justify-content:space-between;gap:var(--space-sm);cursor:grab}.user-chip[data-v-f76fbbc3]:focus{outline:2px solid var(--color-accent);outline-offset:1px}.user-chip .meta[data-v-f76fbbc3]{font-size:.7rem;color:var(--color-text-muted)}.empty-role[data-v-f76fbbc3]{border:1px dashed var(--color-border-strong);border-radius:var(--radius-md);padding:var(--space-sm);display:flex;flex-direction:column;gap:var(--space-xs);align-items:flex-start}.empty-text[data-v-f76fbbc3]{margin:0}.delete-icon[data-v-f76fbbc3]{color:var(--color-danger)}.delete-icon[data-v-f76fbbc3]:hover{background:var(--color-danger-bg);color:var(--color-danger-text)}.muted[data-v-f76fbbc3]{color:var(--color-text-muted)}@media(max-width:720px){.roles-grid[data-v-f76fbbc3]{flex-direction:column}}.user-detail[data-v-0b259926]{display:flex;flex-direction:column;gap:var(--space-lg)}.actions[data-v-0b259926]{display:flex;flex-wrap:wrap;gap:var(--space-sm);align-items:center}.ancillary-actions[data-v-0b259926]{margin-top:-.5rem}.reg-token-btn[data-v-0b259926]{align-self:flex-start}.registration-actions[data-v-0b259926]{display:flex;flex-direction:column;gap:.5rem}.icon-btn[data-v-0b259926]{background:none;border:none;color:var(--color-text-muted);padding:.2rem;border-radius:var(--radius-sm);cursor:pointer;transition:background .2s ease,color .2s ease}.icon-btn[data-v-0b259926]:hover{color:var(--color-heading);background:var(--color-surface-muted)}.matrix-hint[data-v-0b259926]{font-size:.8rem;color:var(--color-text-muted)}.error[data-v-0b259926]{color:var(--color-danger-text)}.small[data-v-0b259926]{font-size:.9rem}.muted[data-v-0b259926]{color:var(--color-text-muted)}.error[data-v-8d16c6cc]{color:var(--color-danger-text)}.small[data-v-8d16c6cc]{font-size:.9rem}.muted[data-v-8d16c6cc]{color:var(--color-text-muted)}.optional[data-v-8d16c6cc]{font-weight:400;color:var(--color-text-muted);font-size:.85em}.view-admin[data-v-1d1c1f6a]{padding-bottom:var(--space-3xl)}.view-header[data-v-1d1c1f6a]{display:flex;flex-direction:column;gap:var(--space-sm)}.admin-section[data-v-1d1c1f6a]{margin-top:var(--space-xl)}.admin-section-body[data-v-1d1c1f6a],.admin-panels[data-v-1d1c1f6a]{display:flex;flex-direction:column;gap:var(--space-xl)}
@@ -1 +1 @@
1
- .pairing-entry[data-v-77a073d9]{display:flex;flex-direction:column;gap:1rem}.pairing-form[data-v-77a073d9]{display:flex;flex-direction:column;gap:.5rem}.input-row[data-v-77a073d9]{display:flex;align-items:center;gap:.5rem}.input-wrapper[data-v-77a073d9]{position:relative;display:flex;width:280px;max-width:100%}.slot-machine[data-v-77a073d9]{position:absolute;left:0;top:0;width:100%;height:100%;gap:0;box-sizing:border-box;z-index:1;pointer-events:none}.input-wrapper.focused.has-error .slot-machine[data-v-77a073d9]{background:var(--color-error-bg, rgba(239, 68, 68, .05))}.slot-reel[data-v-77a073d9]{flex:1 1 33.333%;overflow:visible}.slot-reel[data-v-77a073d9]:not(:last-child){margin-right:.5rem}.slot-word[data-v-77a073d9]{font-weight:600;letter-spacing:.05em;text-align:center;width:100%;color:var(--color-text);display:flex;align-items:center;justify-content:center;position:relative}.slot-word .typed-prefix[data-v-77a073d9]{color:var(--color-text)}.slot-word .hint-suffix[data-v-77a073d9]{color:var(--color-text-muted);opacity:.6}.cursor-overlay[data-v-77a073d9]{position:absolute;width:2px;height:1.2em;background:var(--color-text);animation:none;pointer-events:none;left:calc(50% + (var(--cursor-pos) - var(--word-len, 0) / 2) * .65em);transform:translate(-1px);opacity:0}.input-wrapper.focused .cursor-overlay[data-v-77a073d9]{opacity:1;animation:cursorBlink-77a073d9 .25s alternate infinite}.input-wrapper.focused.has-selection .cursor-overlay[data-v-77a073d9]{animation:none}.selection-overlay[data-v-77a073d9]{position:absolute;height:1.2em;background:var(--color-primary, #3b82f6);opacity:.3;pointer-events:none;left:calc(50% + (var(--sel-start) - var(--word-len, 0) / 2) * .65em);width:calc((var(--sel-end) - var(--sel-start)) * .65em)}@keyframes cursorBlink-77a073d9{0%,50%{opacity:1}80%,to{opacity:0}}.slot-reel.invalid-word .slot-word[data-v-77a073d9],.slot-reel.invalid-word .slot-word .typed-prefix[data-v-77a073d9]{color:var(--color-error, #ef4444)}.slot-reel.invalid-word .cursor-overlay[data-v-77a073d9]{background:var(--color-error, #ef4444)}.slot-reel.empty .slot-word[data-v-77a073d9]{color:var(--color-text-muted)}.pairing-input[data-v-77a073d9]{flex:1;width:100%;height:100%;border-radius:var(--radius-sm, 6px);position:relative;z-index:0}.pairing-input.hidden-input[data-v-77a073d9]{opacity:0}.pairing-input[data-v-77a073d9]:disabled{cursor:not-allowed}.pairing-input[data-v-77a073d9]::placeholder{color:transparent}.processing-status[data-v-77a073d9]{display:flex;align-items:center;gap:.25rem;font-size:.875rem;color:var(--color-text-muted)}.processing-icon[data-v-77a073d9]{font-size:.875rem}.processing-spinner-small[data-v-77a073d9]{width:12px;height:12px;border:2px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:spin-77a073d9 .8s linear infinite}@keyframes spin-77a073d9{to{transform:rotate(360deg)}}.device-info[data-v-77a073d9]{display:flex;flex-direction:column;gap:.5rem}.device-permit-text[data-v-77a073d9]{margin:0;font-size:.95rem;color:var(--color-text)}.device-meta[data-v-77a073d9]{margin:0;font-size:.8rem;color:var(--color-text-muted);font-family:SF Mono,Monaco,Cascadia Code,Roboto Mono,Consolas,Courier New,monospace}.error-message[data-v-77a073d9]{margin:0;font-size:.875rem;color:var(--color-error, #ef4444);margin-bottom:1rem}.view-lede[data-v-4eb8b156]{margin:0;color:var(--color-text-muted);font-size:1rem}.section-header[data-v-4eb8b156]{display:flex;flex-direction:column;gap:.4rem}.empty-state[data-v-4eb8b156]{margin:0;color:var(--color-text-muted);text-align:center;padding:1rem 0}.logout-note[data-v-4eb8b156]{margin:.75rem 0 0;color:var(--color-text-muted);font-size:.875rem}.remote-auth-inline[data-v-4eb8b156]{display:flex;flex-direction:column;gap:.5rem}.remote-auth-label[data-v-4eb8b156]{display:block;margin:0;font-size:.875rem;color:var(--color-text-muted);font-weight:500}.remote-auth-description[data-v-4eb8b156]{font-size:.75rem;color:var(--color-text-muted)}.host-view[data-v-054244d9]{padding:3rem 1.5rem 4rem}.host-actions[data-v-054244d9]{display:flex;flex-direction:column;gap:.75rem}.host-actions .button-row[data-v-054244d9]{gap:.75rem;flex-wrap:wrap}.host-actions .button-row button[data-v-054244d9]{flex:1 1 0}.note[data-v-054244d9],.empty-state[data-v-054244d9]{margin:0;color:var(--color-text-muted)}
1
+ .pairing-entry[data-v-77a073d9]{display:flex;flex-direction:column;gap:1rem}.pairing-form[data-v-77a073d9]{display:flex;flex-direction:column;gap:.5rem}.input-row[data-v-77a073d9]{display:flex;align-items:center;gap:.5rem}.input-wrapper[data-v-77a073d9]{position:relative;display:flex;width:280px;max-width:100%}.slot-machine[data-v-77a073d9]{position:absolute;left:0;top:0;width:100%;height:100%;gap:0;box-sizing:border-box;z-index:1;pointer-events:none}.input-wrapper.focused.has-error .slot-machine[data-v-77a073d9]{background:var(--color-error-bg, rgba(239, 68, 68, .05))}.slot-reel[data-v-77a073d9]{flex:1 1 33.333%;overflow:visible}.slot-reel[data-v-77a073d9]:not(:last-child){margin-right:.5rem}.slot-word[data-v-77a073d9]{font-weight:600;letter-spacing:.05em;text-align:center;width:100%;color:var(--color-text);display:flex;align-items:center;justify-content:center;position:relative}.slot-word .typed-prefix[data-v-77a073d9]{color:var(--color-text)}.slot-word .hint-suffix[data-v-77a073d9]{color:var(--color-text-muted);opacity:.6}.cursor-overlay[data-v-77a073d9]{position:absolute;width:2px;height:1.2em;background:var(--color-text);animation:none;pointer-events:none;left:calc(50% + (var(--cursor-pos) - var(--word-len, 0) / 2) * .65em);transform:translate(-1px);opacity:0}.input-wrapper.focused .cursor-overlay[data-v-77a073d9]{opacity:1;animation:cursorBlink-77a073d9 .25s alternate infinite}.input-wrapper.focused.has-selection .cursor-overlay[data-v-77a073d9]{animation:none}.selection-overlay[data-v-77a073d9]{position:absolute;height:1.2em;background:var(--color-primary, #3b82f6);opacity:.3;pointer-events:none;left:calc(50% + (var(--sel-start) - var(--word-len, 0) / 2) * .65em);width:calc((var(--sel-end) - var(--sel-start)) * .65em)}@keyframes cursorBlink-77a073d9{0%,50%{opacity:1}80%,to{opacity:0}}.slot-reel.invalid-word .slot-word[data-v-77a073d9],.slot-reel.invalid-word .slot-word .typed-prefix[data-v-77a073d9]{color:var(--color-error, #ef4444)}.slot-reel.invalid-word .cursor-overlay[data-v-77a073d9]{background:var(--color-error, #ef4444)}.slot-reel.empty .slot-word[data-v-77a073d9]{color:var(--color-text-muted)}.pairing-input[data-v-77a073d9]{flex:1;width:100%;height:100%;border-radius:var(--radius-sm, 6px);position:relative;z-index:0}.pairing-input.hidden-input[data-v-77a073d9]{opacity:0}.pairing-input[data-v-77a073d9]:disabled{cursor:not-allowed}.pairing-input[data-v-77a073d9]::placeholder{color:transparent}.processing-status[data-v-77a073d9]{display:flex;align-items:center;gap:.25rem;font-size:.875rem;color:var(--color-text-muted)}.processing-icon[data-v-77a073d9]{font-size:.875rem}.processing-spinner-small[data-v-77a073d9]{width:12px;height:12px;border:2px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:spin-77a073d9 .8s linear infinite}@keyframes spin-77a073d9{to{transform:rotate(360deg)}}.device-info[data-v-77a073d9]{display:flex;flex-direction:column;gap:.5rem}.device-permit-text[data-v-77a073d9]{margin:0;font-size:.95rem;color:var(--color-text)}.device-meta[data-v-77a073d9]{margin:0;font-size:.8rem;color:var(--color-text-muted);font-family:SF Mono,Monaco,Cascadia Code,Roboto Mono,Consolas,Courier New,monospace}.error-message[data-v-77a073d9]{margin:0;font-size:.875rem;color:var(--color-error, #ef4444);margin-bottom:1rem}.view-lede[data-v-89d5d936]{margin:0;color:var(--color-text-muted);font-size:1rem}.section-header[data-v-89d5d936]{display:flex;flex-direction:column;gap:.4rem}.empty-state[data-v-89d5d936]{margin:0;color:var(--color-text-muted);text-align:center;padding:1rem 0}.logout-note[data-v-89d5d936]{margin:.75rem 0 0;color:var(--color-text-muted);font-size:.875rem}.remote-auth-inline[data-v-89d5d936]{display:flex;flex-direction:column;gap:.5rem}.remote-auth-label[data-v-89d5d936]{display:block;margin:0;font-size:.875rem;color:var(--color-text-muted);font-weight:500}.remote-auth-description[data-v-89d5d936]{font-size:.75rem;color:var(--color-text-muted)}.host-view[data-v-237999a2]{padding:3rem 1.5rem 4rem}.host-actions[data-v-237999a2]{display:flex;flex-direction:column;gap:.75rem}.host-actions .button-row[data-v-237999a2]{gap:.75rem;flex-wrap:wrap}.host-actions .button-row button[data-v-237999a2]{flex:1 1 0}.note[data-v-237999a2],.empty-state[data-v-237999a2]{margin:0;color:var(--color-text-muted)}
@@ -0,0 +1 @@
1
+ import{_ as Me,r as f,w as Ze,c as C,o as Ee,n as ye,a as Be,b as _,d as v,e as a,f as N,g as $e,h as lt,F as de,i as rt,j as Le,t as $,k as K,v as it,l as Je,m as ut,s as ct,p as dt,q as ft,u as vt,x as oe,y as J,z as b,A as ze,B as fe,C as We,D as we,E as Ae,G as ht,H as Pe,I as pt,J as gt,K as mt}from"./_plugin-vue_export-helper-nhjnO_bd.js";import{u as _e,B as yt,U as Ge,_ as wt,a as bt,N as _t,M as kt,R as It,L as xt,b as St,A as Ct,c as $t}from"./AccessDenied-Fmeb6EtF.js";import{i as Fe,a as X,g as je,b as Oe,c as qe,s as Ye}from"./pow-2N9bxgAo.js";import{g as be}from"./helpers-DzjFIx78.js";const Lt={class:"pairing-entry"},Wt={key:0,class:"input-row"},At={class:"slot-word"},Pt={class:"typed-prefix"},Mt={class:"hint-suffix"},Et={key:0,class:"cursor-overlay",style:{"--cursor-pos":0,"--word-len":0}},Bt=["placeholder"],Dt={key:0,class:"processing-status"},Nt={class:"processing-icon"},Tt={key:1,class:"device-info"},Vt={class:"device-permit-text"},Ut={class:"device-meta"},Ht={key:0,class:"error-message",style:{"margin-top":"0.5rem"}},Kt={class:"button-row",style:{"margin-top":"0.75rem",display:"flex",gap:"0.5rem"}},Rt=["disabled"],zt=["disabled"],Ft={__name:"RemoteAuthPermit",props:{title:{type:String,default:"Help Another Device Sign In"},description:{type:String,default:"Enter the code shown on the device that needs to sign in."},placeholder:{type:String,default:"Enter three words"},action:{type:String,default:"login"}},emits:["completed","error","cancelled","back","register","deviceInfoVisible"],setup(ae,{expose:o,emit:A}){const L=A,k=f(!1),x=f(null),D=f(null);let c=null,V=null;try{V=_e()}catch{}const P=f(null),R=f(null),i=f(""),M=f(!1),E=f(""),y=f(null),p=f("");Ze(y,e=>{L("deviceInfoVisible",!!e)});const d=f(!1),h=f(!1),g=f(0),O=f(0),G=f(0),le=f(!1),ve=f(!1);let ee=0,te=!1,Y=null,se=null,z=null,F=null,T=null,Z=null;function ne(e,s="info",t=3e3){V&&V.showMessage(e,s,t)}async function re(){try{const e=await ut();D.value=e}catch(e){console.warn("Unable to load settings",e)}}function ie(e,s){if(!e||s<0)return{word:"",start:0,end:0};let t=s,u=s;for(;t>0&&/[a-zA-Z]/.test(e[t-1]);)t--;for(;u<e.length&&/[a-zA-Z]/.test(e[u]);)u++;return{word:e.slice(t,u),start:t,end:u}}function Q(e){return e.trim().split(/[.\s]+/).filter(s=>s.length>0)}function B(e){const s=Q(e),t=[];for(const u of s){let r=u.toLowerCase();for(;r.length>0&&t.length<3;){let S=null;for(let w=Math.min(r.length,6);w>=3;w--){const I=r.slice(0,w);if(X(I)){S=I;break}}if(S)t.push(S),r=r.slice(S.length);else{t.push(r);break}}if(t.length>=3)break}return t}function he(e){const s=/[.\s]$/.test(e),t=B(e);return s?t.length:Math.max(0,t.length-1)}function pe(e){if(!e)return{valid:!0,segments:[]};const s=[],t=/[.\s]$/.test(e);let u,r=/([a-zA-Z]+)|([.\s]+)/g;for(;(u=r.exec(e))!==null;)u[1]?s.push({text:u[1],isWord:!0,start:u.index}):u[2]&&s.push({text:u[2],isWord:!1,start:u.index});const S=s.filter(I=>I.isWord);let w=!0;return S.forEach((I,U)=>{const W=U===S.length-1,q=I.text.toLowerCase();W&&!t?I.invalid=!Fe(q):I.invalid=!X(q),I.invalid&&(w=!1)}),{valid:w,segments:s}}C(()=>{const{segments:e}=pe(i.value);return e.map(s=>({text:s.text,invalid:s.invalid||!1}))});function ke(e){return pe(e).valid}function Ie(e){return B(e).length>0&&B(e).every(s=>X(s))}function ge(e){if(/[.\s]$/.test(e))return"";const t=e.match(/[a-zA-Z]+$/);return t?t[0].toLowerCase():""}function xe(e,s){if(!e||s===0)return{wordIndex:0,charIndex:0};const t=e.slice(0,s),u=/[.\s]$/.test(t),r=B(t);if(r.length===0)return{wordIndex:0,charIndex:0};if(u)return{wordIndex:Math.min(r.length,2),charIndex:0};const S=r[r.length-1],w=r.length-1;B(e);const I=S.length;return w<2&&!ve.value&&X(S)?{wordIndex:w+1,charIndex:0}:{wordIndex:Math.min(w,2),charIndex:I}}function ue(e,s){if(!e||s===0)return{wordIndex:0,charIndex:0};const t=e.slice(0,s),u=/[.\s]$/.test(t),r=B(t);if(r.length===0)return{wordIndex:0,charIndex:0};if(u)return{wordIndex:Math.min(r.length,2),charIndex:0};const S=r[r.length-1],w=r.length-1;return{wordIndex:Math.min(w,2),charIndex:S.length}}const l=C(()=>{const e=B(i.value),s=[],t=ge(i.value),u=p.value,r=/[.\s]$/.test(i.value),S=O.value!==G.value,w=ue(i.value,Math.min(O.value,G.value)),I=ue(i.value,Math.max(O.value,G.value)),U=S?ue(i.value,g.value):xe(i.value,g.value);for(let W=0;W<3;W++){const q=U.wordIndex===W;let j=-1,H=-1;if(S&&(W>w.wordIndex&&W<I.wordIndex?(j=0,H=e[W]?.length??0):W===w.wordIndex&&W===I.wordIndex?(j=w.charIndex,H=I.charIndex):W===w.wordIndex?(j=w.charIndex,H=e[W]?.length??0):W===I.wordIndex&&(j=0,H=I.charIndex)),W<e.length){const me=e[W].toLowerCase(),Ke=W===e.length-1,Re=Ke&&!r?!Fe(me):!X(me);if(Ke&&!r&&u&&t){const at=u.length;s.push({text:"",typedPrefix:t,hintSuffix:u.slice(t.length),invalid:Re,hasCursor:q,cursorCharIndex:q?U.charIndex:-1,wordLen:at,selectionStartChar:j,selectionEndChar:H})}else s.push({text:me,invalid:Re,hasCursor:q,cursorCharIndex:q?U.charIndex:-1,wordLen:me.length,selectionStartChar:j,selectionEndChar:H})}else s.push({text:"",invalid:!1,hasCursor:q,cursorCharIndex:0,wordLen:0,selectionStartChar:j,selectionEndChar:H})}return s}),n=C(()=>O.value!==G.value),m=C(()=>{const e=B(i.value);return e.length===3&&e.every(s=>X(s))});function De(e){return B(e).join(".")}function Xe(){if(!Y||z)return;const e=qe(Y);z=Ye(e,se).then(s=>{F=s,z=null})}async function Ne(){if(F){const s=F;return F=null,s}if(z){await z;const s=F;return F=null,s}if(!Y)throw new Error("No PoW challenge available");const e=qe(Y);return await Ye(e,se)}function Te(e){e?.challenge&&(Y=e.challenge,se=e.work,F=null,z=null,Xe())}async function Se(){if(!(c||te)){te=!0;try{const e=D.value?.auth_host,s="/auth/ws/remote-auth/permit",t=e&&location.host!==e?`//${e}${s}`:s;c=await dt(t);const u=await c.receive_json();if(u.status&&u.detail)throw new Error(u.detail);if(!u.pow?.challenge)throw new Error("Server did not send PoW challenge");Te(u.pow)}catch(e){throw console.error("WebSocket connection error:",e),c=null,e}finally{te=!1}}}function et(e){if(e.key==="Tab"||e.key===" "||e.key==="Escape"){nt(e);return}setTimeout(Ve,0)}function Ve(){const e=P.value,s=e?.selectionStart??i.value.length,t=e?.selectionEnd??s,r=(e?.selectionDirection??"none")==="backward"?s:t;ve.value=r<ee,ee=r,g.value=r,G.value=t,O.value=s}function tt(){g.value=P.value?.selectionStart??i.value.length;const{word:e,end:s}=ie(i.value,g.value);if(he(i.value)>=3||!e||e.length<1||g.value!==s){p.value="";return}const u=je(e.toLowerCase());u&&u!==e.toLowerCase()?p.value=u:p.value=""}function Ue(){if(!p.value)return!1;const{word:e,start:s,end:t}=ie(i.value,g.value);if(!e)return!1;const u=i.value.slice(0,s),w=B(u).length===2?"":" ",I=i.value.slice(t);i.value=u+p.value+w+I.trimStart();const U=s+p.value.length+w.length;return ye(()=>{P.value?.setSelectionRange(U,U),g.value=U}),p.value="",!0}function ce(){g.value=P.value?.selectionStart??i.value.length;const e=g.value,t=i.value.slice(0,e).match(/([a-zA-Z]+) $/);if(t){const r=t[1].toLowerCase(),S=je(r);if(S&&S!==r&&!X(r)){const w=e-t[0].length,I=i.value.slice(0,w),U=i.value.slice(e),j=B(I).length===2?"":" ";i.value=I+S+j+U;const H=w+S.length+j.length;ye(()=>{P.value?.setSelectionRange(H,H),g.value=H})}}tt(),T&&(clearTimeout(T),T=null),y.value=null,x.value=null,h.value=!1,d.value=!ke(i.value);const u=B(i.value);if(u.length>=1&&!c&&!te&&Se(),u.length===3){if(!Ie(i.value))return;T=setTimeout(()=>{st()},150)}}async function st(){if(!(M.value||k.value||!m.value||De(i.value)===Z&&y.value)){M.value=!0,E.value="pow",x.value=null,h.value=!1;try{if(await Se(),!c)throw new Error("Failed to connect");const s=await Ne(),t=Oe(s),u=De(i.value);if(!m.value)return;E.value="server",c.send_json({code:u,pow:t});const r=await c.receive_json();if(Te(r.pow),typeof r.status=="number"&&r.status>=400){ne(r.detail||"Request failed","error"),h.value=!0,y.value=null,Z=null;return}r.status==="found"&&r.host?(y.value={host:r.host,user_agent_pretty:r.user_agent_pretty,client_ip:r.client_ip,action:r.action||"login"},Z=u,ye(()=>{R.value?.focus()})):(ne("Unexpected response from server","error"),h.value=!0,y.value=null,Z=null)}catch(s){console.error("Lookup error:",s),ne(s.message||"Lookup failed","error"),h.value=!0,y.value=null,Z=null,c&&(c.close(),c=null)}finally{M.value=!1,E.value=""}}}function nt(e){if(e.key==="Escape"){i.value="",ce(),e.preventDefault();return}if(e.key==="Tab"){if(p.value&&Ue()){e.preventDefault(),ce();return}i.value.trim()&&e.preventDefault();return}e.key===" "&&p.value&&Ue()&&(e.preventDefault(),ce())}async function ot(){if(!(!y.value||k.value)){k.value=!0,x.value=null;try{if(c||await Se(),!c)throw new Error("Failed to connect");const e=await Ne(),s=Oe(e);c.send_json({authenticate:!0,pow:s});const t=await c.receive_json();if(typeof t.status=="number"&&t.status>=400)throw new Error(t.detail||"Authentication failed");if(!t.optionsJSON)throw new Error(t.detail||"Failed to get authentication options");const u=await ct(t);c.send_json(u);const r=await c.receive_json();if(typeof r.status=="number"&&r.status>=400)throw new Error(r.detail||"Authentication failed");if(r.status==="success")ne("Device authenticated successfully!","success",3e3),L("completed"),Ce();else throw new Error(r.detail||"Authentication failed")}catch(e){console.error("Pairing error:",e);const s=e.name==="NotAllowedError"?"Passkey authentication was cancelled":e.message||"Authentication failed";x.value=s,L("error",s)}finally{k.value=!1,c&&(c.close(),c=null)}}}async function He(){if(c){try{c.send_json({deny:!0}),await new Promise(e=>setTimeout(e,100))}catch(e){console.error("Error sending deny message:",e)}c.close(),c=null}Ce()}function Ce(){i.value="",x.value=null,h.value=!1,y.value=null,M.value=!1,E.value="",p.value="",d.value=!1,Z=null,c&&(c.close(),c=null),Y=null,se=null,z=null,F=null}return Ee(async()=>{await re(),ye(()=>{g.value=P.value?.selectionStart??0})}),Be(()=>{T&&(clearTimeout(T),T=null),c&&(c.close(),c=null)}),o({reset:Ce,deny:He,code:i,handleInput:ce,loading:k,error:x}),(e,s)=>(v(),_("div",Lt,[a("form",{onSubmit:Je(ot,["prevent"]),class:"pairing-form"},[y.value?y.value?(v(),_("div",Tt,[a("p",Vt,[K("Permit "+$(y.value.action==="register"?"registration":"login")+" to ",1),a("strong",null,$(y.value.host),1)]),a("p",Ut,$(y.value.user_agent_pretty),1),x.value?(v(),_("p",Ht,$(x.value),1)):N("",!0),a("div",Kt,[a("button",{type:"button",class:"btn-secondary",disabled:k.value,onClick:He,style:{flex:"1"}}," Deny ",8,Rt),a("button",{ref_key:"submitBtnRef",ref:R,type:"submit",disabled:k.value,class:"btn-primary",style:{flex:"1"}},$(k.value?"Authenticating…":"Authorize"),9,zt)])])):N("",!0):(v(),_("div",Wt,[a("div",{class:$e(["input-wrapper",{"has-error":h.value,"is-complete":y.value&&!h.value,focused:le.value,"has-selection":n.value}])},[a("div",{class:$e(["slot-machine",{"has-error":h.value,"is-complete":y.value&&!h.value}]),"aria-hidden":"true"},[(v(!0),_(de,null,rt(l.value,(t,u)=>(v(),_("div",{key:u,class:$e(["slot-reel",{"invalid-word":t.invalid,empty:!t.text&&!t.typedPrefix}])},[a("div",At,[t.selectionStartChar>=0&&t.selectionEndChar>t.selectionStartChar?(v(),_("span",{key:0,class:"selection-overlay",style:Le({"--sel-start":t.selectionStartChar,"--sel-end":t.selectionEndChar,"--word-len":t.wordLen})},null,4)):N("",!0),t.typedPrefix?(v(),_(de,{key:1},[a("span",Pt,$(t.typedPrefix),1),a("span",Mt,$(t.hintSuffix),1),t.hasCursor?(v(),_("span",{key:0,class:"cursor-overlay",style:Le({"--cursor-pos":t.cursorCharIndex,"--word-len":t.wordLen})},null,4)):N("",!0)],64)):t.text?(v(),_(de,{key:2},[K($(t.text)+" ",1),t.hasCursor?(v(),_("span",{key:0,class:"cursor-overlay",style:Le({"--cursor-pos":t.cursorCharIndex,"--word-len":t.wordLen})},null,4)):N("",!0)],64)):(v(),_(de,{key:3},[t.hasCursor?(v(),_("span",Et)):N("",!0)],64))])],2))),128))],2),lt(a("input",{ref_key:"inputRef",ref:P,"onUpdate:modelValue":s[0]||(s[0]=t=>i.value=t),type:"text",placeholder:ae.placeholder,autocomplete:"off",autocapitalize:"none",autocorrect:"off",spellcheck:"false",class:"pairing-input hidden-input",onInput:ce,onKeydown:et,onMouseup:Ve,onFocus:s[1]||(s[1]=t=>le.value=!0),onBlur:s[2]||(s[2]=t=>le.value=!1)},null,40,Bt),[[it,i.value]])],2),E.value?(v(),_("div",Dt,[a("span",Nt,$(E.value==="pow"?"🔐":"📡"),1),s[3]||(s[3]=a("span",{class:"processing-spinner-small"},null,-1))])):N("",!0)]))],32)]))}},jt=Me(Ft,[["__scopeId","data-v-77a073d9"]]),Ot={class:"view-root","data-view":"profile"},qt={class:"view-header"},Yt={class:"remote-auth-inline"},Zt={key:0,class:"remote-auth-label"},Jt={class:"section-block"},Gt={class:"section-body"},Qt={class:"section-block"},Xt=["disabled"],es=["disabled"],ts=["disabled"],ss={key:0,class:"logout-note"},ns={key:1,class:"logout-note"},os={__name:"ProfileView",setup(ae){const o=_e(),A=f(null),L=f(!1),k=f(!1),x=f(""),D=f(!1),c=f(null),V=f(null),P=f(!1),R=f(null),i=f(null),M=f(null),E=f(null),y=f(null),p=f(null),d=f(null),h=f(null),g=C(()=>L.value||k.value);Ze(L,l=>{l&&(x.value=o.userInfo?.ctx.user.display_name??"")}),Ee(()=>{A.value=setInterval(()=>{o.userInfo&&(o.userInfo={...o.userInfo})},6e4)}),Be(()=>{A.value&&clearInterval(A.value)});const O=async()=>{try{await ht.register(null,null,()=>{o.showMessage("Adding new passkey...","info")}),await o.loadUserInfo(),o.showMessage("New passkey added successfully!","success",3e3)}catch(l){console.error("Failed to add new passkey:",l),o.showMessage(l.message,"error")}},G=()=>{o.showMessage("The other device is now signed in!","success",4e3),setTimeout(()=>R.value?.reset(),3e3)},le=l=>{l.includes("cancelled")||o.showMessage(l,"error",4e3)},ve=()=>{o.showMessage("📋 Link copied! Send it to your other device."),k.value=!1},ee=l=>{We(l,{primarySelector:".btn-primary",itemSelector:"button"})},te=l=>{if(g.value)return;const n=fe(l);n&&n==="down"&&(l.preventDefault(),We(h.value,{primarySelector:".mini-btn",itemSelector:".mini-btn, .pairing-input"}))},Y=l=>{if(g.value)return;const n=fe(l);if(!n)return;l.preventDefault(),n==="left"||n==="right"?we(h.value,l.target,n,{itemSelector:".mini-btn, .pairing-input"}):n==="up"?p.value?.focusCurrent?.():n==="down"&&i.value?.$el?.focus()},se=l=>{g.value||(l==="down"||l==="right"?ee(M.value):(l==="up"||l==="left")&&We(h.value,{primarySelector:".mini-btn",itemSelector:".mini-btn, .pairing-input"}))},z=l=>{if(g.value)return;const n=fe(l);n&&(l.preventDefault(),n==="left"||n==="right"?we(M.value,l.target,n,{itemSelector:"button"}):n==="up"?Ae(i.value?.$el,0,{itemSelector:".credential-item"}):n==="down"&&Ae(E.value?.$el,0,{itemSelector:".session-group"}))},F=l=>{g.value||(l==="up"?ee(M.value):l==="down"&&ee(y.value))},T=l=>{if(g.value)return;const n=fe(l);n&&(l.preventDefault(),n==="left"||n==="right"?we(y.value,l.target,n,{itemSelector:"button"}):n==="up"&&Ae(E.value?.$el,-1,{itemSelector:".session-group"}))},Z=async l=>{const n=l?.credential;if(n)try{await o.deleteCredential(n),o.showMessage("Passkey deleted! You should also remove it from your password manager or device.","success",3e3)}catch(m){o.showMessage(`Failed to delete passkey: ${m.message}`,"error")}},ne=C(()=>o.settings?.rp_name||"this service"),re=C(()=>o.userInfo?.sessions||[]),ie=C(()=>re.value.find(n=>n.is_current)?.host||"this host"),Q=f({}),B=async l=>{const n=l?.id;if(n){Q.value={...Q.value,[n]:!0};try{await o.terminateSession(n)}catch(m){o.showMessage(m.message||"Failed to terminate session","error",5e3)}finally{const m={...Q.value};delete m[n],Q.value=m}}},he=async()=>{await o.logoutEverywhere()},pe=async()=>{await o.logout()},ke=()=>{x.value=o.userInfo?.ctx.user.display_name??"",L.value=!0},Ie=C(()=>{const l=o.userInfo?.ctx.permissions;return l.includes("auth:admin")||l.includes("auth:org:admin")}),ge=C(()=>re.value.length>1),xe=C(()=>{const l=[{label:"Auth",href:ft()}];return Ie.value&&l.push({label:"Admin",href:vt()}),l}),ue=async()=>{const l=x.value.trim();if(!l){o.showMessage("Name cannot be empty","error");return}try{D.value=!0,await Pe("/auth/api/user/display-name",{method:"PATCH",body:{display_name:l}}),L.value=!1,await o.loadUserInfo(),o.showMessage("Name updated successfully!","success",3e3)}catch(n){o.showMessage(n.message||"Failed to update name","error")}finally{D.value=!1}};return(l,n)=>(v(),_("section",Ot,[a("header",qt,[n[10]||(n[10]=a("h1",null,"User Profile",-1)),oe(yt,{ref_key:"breadcrumbs",ref:p,entries:xe.value,onKeydown:te},null,8,["entries"]),n[11]||(n[11]=a("p",{class:"view-lede"},"Account dashboard for managing credentials and authenticating with other devices.",-1))]),a("section",{class:"section-block",ref_key:"userInfoSection",ref:h},[b(o).userInfo?.ctx?(v(),J(Ge,{key:0,ref_key:"userBasicInfo",ref:d,name:b(o).userInfo.ctx.user.display_name,visits:b(o).userInfo.visits,"created-at":b(o).userInfo.created_at,"last-seen":b(o).userInfo.last_seen,loading:b(o).isLoading,"update-endpoint":"/auth/api/user/display-name",onSaved:n[1]||(n[1]=m=>b(o).loadUserInfo()),onEditName:ke,onKeydown:Y},{default:ze(()=>[a("div",Yt,[P.value?N("",!0):(v(),_("label",Zt,"Code words:")),oe(jt,{ref_key:"pairingEntry",ref:R,title:"",description:"",onCompleted:G,onError:le,onDeviceInfoVisible:n[0]||(n[0]=m=>P.value=m)},null,512)]),n[12]||(n[12]=a("p",{class:"remote-auth-description"},"Provided by another device requesting remote auth.",-1))]),_:1},8,["name","visits","created-at","last-seen","loading"])):N("",!0)],512),a("section",Jt,[n[13]||(n[13]=a("div",{class:"section-header"},[a("h2",null,"Your Passkeys"),a("p",{class:"section-description"},[K("Ideally have at least two passkeys in case you lose one. More than one user can be registered on the same device, giving you a choice at login. "),a("a",{href:"https://bitwarden.com/pricing/",target:"_blank",rel:"noopener noreferrer"},"Bitwarden"),K(" can sync one passkey to all your devices. Other secure options include "),a("b",null,"local passkeys"),K(", as well as hardware keys such as "),a("a",{href:"https://www.yubico.com",target:"_blank",rel:"noopener noreferrer"},"YubiKey"),K(". Cloud sync via Google, Microsoft or iCloud is discouraged.")])],-1)),a("div",Gt,[oe(wt,{ref_key:"credentialList",ref:i,credentials:b(o).userInfo?.credentials||[],"aaguid-info":b(o).userInfo?.aaguid_info||{},loading:b(o).isLoading,"hovered-credential-uuid":c.value,"hovered-session-credential-uuid":V.value?.credential,"navigation-disabled":g.value,"allow-delete":"",onDelete:Z,onCredentialHover:n[2]||(n[2]=m=>c.value=m),onNavigateOut:se},null,8,["credentials","aaguid-info","loading","hovered-credential-uuid","hovered-session-credential-uuid","navigation-disabled"]),a("div",{class:"button-row",ref_key:"credentialButtons",ref:M},[a("button",{onClick:O,class:"btn-primary",onKeydown:z},"Register New",32),a("button",{onClick:n[3]||(n[3]=m=>k.value=!0),class:"btn-secondary",onKeydown:z},"Another Device",32)],512)])]),oe(bt,{ref_key:"sessionList",ref:E,sessions:re.value,"terminating-sessions":Q.value,"hovered-credential-uuid":c.value,"navigation-disabled":g.value,onTerminate:B,onSessionHover:n[4]||(n[4]=m=>V.value=m),onNavigateOut:F,"section-description":"You are currently signed in to the following sessions. If you don't recognize something, consider deleting not only the session but the associated passkey you suspect is compromised, as only this terminates all linked sessions and prevents logging in again."},null,8,["sessions","terminating-sessions","hovered-credential-uuid","navigation-disabled"]),L.value?(v(),J(kt,{key:0,onClose:n[7]||(n[7]=m=>L.value=!1)},{default:ze(()=>[n[14]||(n[14]=a("h3",null,"Edit Display Name",-1)),a("form",{onSubmit:Je(ue,["prevent"]),class:"modal-form"},[oe(_t,{label:"Display Name",modelValue:x.value,"onUpdate:modelValue":n[5]||(n[5]=m=>x.value=m),busy:D.value,onCancel:n[6]||(n[6]=m=>L.value=!1)},null,8,["modelValue","busy"])],32)]),_:1})):N("",!0),a("section",Qt,[a("div",{class:"button-row",ref_key:"logoutButtons",ref:y},[a("button",{type:"button",class:"btn-secondary",onClick:n[8]||(n[8]=(...m)=>b(be)&&b(be)(...m)),onKeydown:T}," Back ",32),ge.value?(v(),_(de,{key:1},[a("button",{onClick:pe,class:"btn-danger",disabled:b(o).isLoading,onKeydown:T},"Logout",40,es),a("button",{onClick:he,class:"btn-danger",disabled:b(o).isLoading,onKeydown:T},"All",40,ts)],64)):(v(),_("button",{key:0,onClick:he,class:"btn-danger",disabled:b(o).isLoading,onKeydown:T},"Logout",40,Xt))],512),ge.value?(v(),_("p",ns,[n[16]||(n[16]=a("strong",null,"Logout",-1)),K(" this session on "+$(ie.value)+", or ",1),n[17]||(n[17]=a("strong",null,"All",-1)),K(" sessions across all sites and devices for "+$(ne.value)+". You'll need to log in again with your passkey afterwards.",1)])):(v(),_("p",ss,[n[15]||(n[15]=a("strong",null,"Logout",-1)),K(" from "+$(ie.value)+".",1)]))]),k.value?(v(),J(It,{key:1,endpoint:"/auth/api/user/create-link",onClose:n[9]||(n[9]=m=>k.value=!1),onCopied:ve})):N("",!0)]))}},as=Me(os,[["__scopeId","data-v-89d5d936"]]),ls={class:"view-root host-view","data-view":"host-profile"},rs={class:"view-header"},is={class:"view-lede"},us={class:"section-body"},cs={key:1,class:"empty-state"},ds={class:"section-block"},fs={class:"section-body host-actions"},vs=["disabled"],hs=["disabled"],ps={class:"note"},gs={__name:"HostProfileView",props:{initializing:{type:Boolean,default:!1}},setup(ae){const o=_e(),A=window.location.host,L=f(null),k=f(null),x=C(()=>o.userInfo?.ctx||null),D=C(()=>x.value?.org.display_name??""),c=C(()=>x.value?.role.display_name??""),V=C(()=>{const p=o.settings?.rp_name;return p?`${p} account`:"Account overview"}),P=C(()=>`You're signed in to ${A}.`),R=C(()=>o.settings?.auth_host||""),i=C(()=>{const p=R.value;if(!p)return"";let d=o.settings?.ui_base_path??"/auth/";return d.startsWith("/")||(d=`/${d}`),d.endsWith("/")||(d=`${d}/`),`${window.location.protocol||"https:"}//${p}${d}`}),M=()=>{i.value&&(window.location.href=i.value)},E=async()=>{await o.logout()},y=p=>{const d=fe(p);d&&(p.preventDefault(),(d==="left"||d==="right")&&we(k.value,p.target,d,{itemSelector:"button"}))};return(p,d)=>(v(),_("section",ls,[a("header",rs,[a("h1",null,$(V.value),1),a("p",is,$(P.value),1)]),a("section",{class:"section-block",ref_key:"userInfoSection",ref:L},[a("div",us,[x.value?(v(),J(Ge,{key:0,name:x.value.user.display_name,visits:b(o).userInfo?.visits||0,"created-at":b(o).userInfo?.created_at,"last-seen":b(o).userInfo?.last_seen,"org-display-name":D.value,"role-name":c.value,"can-edit":!1},null,8,["name","visits","created-at","last-seen","org-display-name","role-name"])):(v(),_("p",cs,$(ae.initializing?"Loading your account…":"No active session found."),1))])],512),a("section",ds,[a("div",fs,[a("div",{class:"button-row",ref_key:"buttonRow",ref:k,onKeydown:y},[a("button",{type:"button",class:"btn-secondary",onClick:d[0]||(d[0]=(...h)=>b(be)&&b(be)(...h))}," Back "),a("button",{type:"button",class:"btn-danger",disabled:b(o).isLoading,onClick:E},$(b(o).isLoading?"Signing out…":"Logout"),9,vs),i.value?(v(),_("button",{key:0,type:"button",class:"btn-primary",disabled:b(o).isLoading,onClick:M}," Full Profile ",8,hs)):N("",!0)],544),a("p",ps,[d[1]||(d[1]=a("strong",null,"Logout",-1)),K(" from "+$(b(A))+", or access your ",1),d[2]||(d[2]=a("strong",null,"Full Profile",-1)),K(" at "+$(R.value)+" (you may need to sign in again).",1)])])])]))}},ms=Me(gs,[["__scopeId","data-v-237999a2"]]),ys={class:"app-shell"},ws={class:"app-main"},bs={__name:"App",setup(ae){const o=_e(),A=f("loading"),L=f("Loading...");function k(d){if(!d)return null;const h=d.trim().toLowerCase();return h?h.replace(/:80$/,"").replace(/:443$/,""):null}const x=C(()=>{const d=o.settings?.auth_host;if(!d)return!1;const h=k(window.location.host),g=k(d);return h!==g});let D=null,c=null;function V(){o.userInfo=null,A.value="terminal"}async function P(){try{return o.userInfo=await Pe("/auth/api/user-info",{method:"POST"}),A.value="profile",y(),!0}catch{return o.userInfo=null,!1}}async function R(){i();const d=await pt("login");c=document.createElement("iframe"),c.id="auth-iframe",c.title="Authentication",c.allow="publickey-credentials-get; publickey-credentials-create",c.src=d,document.body.appendChild(c),L.value="Authentication required..."}function i(){c&&(c.remove(),c=null)}function M(d){const h=d.data;if(h?.type)switch(h.type){case"auth-success":i(),A.value="loading",L.value="Loading user profile...",P();break;case"auth-error":h.cancelled?console.log("Authentication cancelled by user"):o.showMessage(h.message||"Authentication failed","error",5e3);break;case"auth-cancelled":console.log("Authentication cancelled");break;case"auth-back":i(),V();break;case"auth-close-request":i();break}}async function E(){try{await Pe("/auth/api/validate",{method:"POST"})}catch{p(),V()}}function y(){p(),D=setInterval(E,120*1e3)}function p(){D&&(clearInterval(D),D=null)}return Ee(async()=>{window.addEventListener("message",M),await o.loadSettings();const d=o.settings?.rp_name;if(d){const g=o.settings?.auth_host,O=g&&k(window.location.host)!==k(g);document.title=O?`${d} · Account summary`:d}await P()||R()}),Be(()=>{window.removeEventListener("message",M),p(),i()}),(d,h)=>(v(),_("div",ys,[oe(St),a("main",ws,[A.value==="profile"&&x.value?(v(),J(ms,{key:0})):A.value==="profile"?(v(),J(as,{key:1})):A.value==="loading"?(v(),J(xt,{key:2,message:L.value},null,8,["message"])):A.value==="terminal"?(v(),J(Ct,{key:3})):N("",!0)])]))}},Qe=gt(bs);Qe.use($t());Qe.mount("#app");mt();
@@ -1 +1 @@
1
- import{c as o,a4 as d,o as u,y as s,d as m,z as l,J as h,K as p}from"./_plugin-vue_export-helper-rKFEraYH.js";import{R as f}from"./RestrictedAuth-BLMK7-nL.js";import{g as a}from"./helpers-DzjFIx78.js";import"./pow-2N9bxgAo.js";const w={__name:"RestrictedForward",setup(_){const n=o(()=>d()),r=o(()=>{const e=document.documentElement.getAttribute("data-mode");return e==="reauth"?"reauth":e==="forbidden"?"forbidden":"login"});function c(){location.reload()}function i(){const t=n.value||"/auth/";window.location.pathname!==t&&history.replaceState(null,"",t),window.location.href=t}return u(()=>{window.addEventListener("keydown",t=>{t.key==="Escape"&&a()})}),(t,e)=>(m(),s(f,{mode:r.value,onAuthenticated:c,onBack:l(a),onHome:i},null,8,["mode","onBack"]))}};h(w).mount("#app");p();
1
+ import{c as o,a4 as d,o as u,y as s,d as m,z as l,J as h,K as p}from"./_plugin-vue_export-helper-nhjnO_bd.js";import{R as f}from"./RestrictedAuth-DsJXicIw.js";import{g as a}from"./helpers-DzjFIx78.js";import"./pow-2N9bxgAo.js";const w={__name:"RestrictedForward",setup(_){const n=o(()=>d()),r=o(()=>{const e=document.documentElement.getAttribute("data-mode");return e==="reauth"?"reauth":e==="forbidden"?"forbidden":"login"});function c(){location.reload()}function i(){const t=n.value||"/auth/";window.location.pathname!==t&&history.replaceState(null,"",t),window.location.href=t}return u(()=>{window.addEventListener("keydown",t=>{t.key==="Escape"&&a()})}),(t,e)=>(m(),s(f,{mode:r.value,onAuthenticated:c,onBack:l(a),onHome:i},null,8,["mode","onBack"]))}};h(w).mount("#app");p();
@@ -0,0 +1 @@
1
+ .center[data-v-7ca316fc]{text-align:center}.button-row.center[data-v-7ca316fc]{display:flex;justify-content:center}.section-body[data-v-7ca316fc]{gap:1.25rem}.name-edit span[data-v-7ca316fc]{color:var(--color-text-muted);font-size:.9rem}
@@ -0,0 +1 @@
1
+ import{_ as C,O as E,r as i,c as h,a4 as b,o as F,b as c,d as u,f as N,e as t,t as m,g as $,h as z,v as K,L as V,m as D,H as x,a5 as I,a6 as U,G,J as H,K as J}from"./_plugin-vue_export-helper-nhjnO_bd.js";const L={class:"app-shell"},O={key:0,class:"global-status",style:{display:"block"}},j={class:"view-root"},Y={class:"surface surface--tight",style:{"max-width":"560px",margin:"0 auto",width:"100%"}},q={class:"view-header",style:{"text-align":"center"}},Q={class:"view-lede"},W={key:0,class:"section-block"},X={key:1,class:"section-block"},Z={key:2,class:"section-block"},ee={class:"section-body"},se={class:"name-edit"},te=["disabled"],ae=["disabled"],ne={__name:"ResetApp",setup(ie){const o=E({show:!1,message:"",type:"info"}),d=i(!0),n=i(!1),l=i(""),T=i(null),g=i(null),f=i(""),y=i("");let p=null;const P=h(()=>g.value?.token_type||"your enrollment"),R=h(()=>d.value?"Preparing your secure enrollment…":v.value?`Finish up ${P.value}. You may edit the name below if needed, and it will be saved to your passkey.`:"This authentication link is no longer valid.");h(()=>b());const v=h(()=>!!(l.value&&g.value));function r(e,s="info",a=3e3){o.show=!0,o.message=e,o.type=s,p&&clearTimeout(p),a>0&&(p=setTimeout(()=>{o.show=!1},a))}async function S(){try{const e=await D();T.value=e,e?.rp_name&&(document.title=`${e.rp_name} · Passkey Setup`)}catch(e){console.warn("Unable to load settings",e)}}async function B(){if(l.value)try{g.value=await x("/auth/api/token-info",{method:"GET",headers:{Authorization:`Bearer ${l.value}`}}),f.value=g.value.display_name}catch(e){console.error("Failed to load token info",e);const s=e instanceof I?e.data?.detail||"The authentication link is invalid or expired.":U(e);y.value=s}}async function _(){if(!v.value||n.value)return;n.value=!0,r("Starting passkey registration…","info");let e;try{const s=f.value.trim()||null;e=await G.register(l.value,s)}catch(s){n.value=!1;const a=s?.message||"Passkey registration cancelled",w=a==="Passkey registration cancelled";r(w?a:`Registration failed: ${a}`,w?"info":"error",4e3);return}try{await A(e)}catch(s){n.value=!1;const a=s?.message||"Failed to establish session";r(a,"error",4e3);return}r("Passkey registered successfully!","success",800),setTimeout(()=>{n.value=!1,k()},800)}async function A(e){if(!e?.session_token)throw new Error("Registration response missing session_token");return await x("/auth/api/set-session",{method:"POST",headers:{Authorization:`Bearer ${e.session_token}`}})}function k(){const e=b.value||"/auth/";window.location.pathname!==e&&history.replaceState(null,"",e),window.location.reload()}function M(){const e=window.location.pathname.split("/").filter(Boolean);if(!e.length)return"";const s=e[e.length-1],a=e.slice(0,-1);return a.length>1||a.length===1&&a[0]!=="auth"||!s.includes(".")?"":s}return F(async()=>{if(l.value=M(),await S(),!l.value){const e="Reset link is missing or malformed.";y.value=e,r(e,"error",0),d.value=!1;return}await B(),d.value=!1}),(e,s)=>(u(),c("div",L,[o.show?(u(),c("div",O,[t("div",{class:$(["status",o.type])},m(o.message),3)])):N("",!0),t("main",j,[t("div",Y,[t("header",q,[s[1]||(s[1]=t("h1",null,"🔑 Registration",-1)),t("p",Q,m(R.value),1)]),d.value?(u(),c("section",W,[...s[2]||(s[2]=[t("div",{class:"section-body center"},[t("p",null,"Loading reset details…")],-1)])])):v.value?(u(),c("section",Z,[t("div",ee,[t("label",se,[s[3]||(s[3]=t("span",null,"👤 Name",-1)),z(t("input",{type:"text","onUpdate:modelValue":s[0]||(s[0]=a=>f.value=a),disabled:n.value,maxlength:"64",onKeyup:V(_,["enter"])},null,40,te),[[K,f.value]])]),t("button",{class:"btn-primary",disabled:n.value,onClick:_},m(n.value?"Registering…":"Register Passkey"),9,ae)])])):(u(),c("section",X,[t("div",{class:"section-body center"},[t("div",{class:"button-row center",style:{"justify-content":"center"}},[t("button",{class:"btn-secondary",onClick:k},"Return to sign-in")])])]))])])]))}},oe=C(ne,[["__scopeId","data-v-7ca316fc"]]);H(oe).mount("#app");J();
@@ -1 +1 @@
1
- import{r as p,c as h,o as m,y as l,d as f,J as w,K as k}from"./_plugin-vue_export-helper-rKFEraYH.js";import{R as y}from"./RestrictedAuth-BLMK7-nL.js";import"./pow-2N9bxgAo.js";const _={__name:"RestrictedApi",setup(g){const o=p(null);function c(){const e=window.location.pathname.match(/\/auth\/([^/]+)$/);if(e){const r=e[1],s=r.split(".");if(s.length===5&&s.every(d=>d.length>0))return r}return null}const i=h(()=>{const e=new URLSearchParams(window.location.hash.slice(1)).get("mode");return e==="reauth"?"reauth":e==="forbidden"?"forbidden":"login"});function n(t){window.parent&&window.parent!==window&&window.parent.postMessage(t,"*")}function u(t){n({type:"auth-success",authenticated:!0,sessionToken:t.session_token})}function a(){n({type:"auth-back"})}return m(()=>{o.value=c(),n({type:"auth-ready"}),window.addEventListener("keydown",t=>{t.key==="Escape"&&a()})}),(t,e)=>(f(),l(y,{mode:i.value,"remote-auth-token":o.value,onAuthenticated:u,onBack:a},null,8,["mode","remote-auth-token"]))}};w(_).mount("#app");k();
1
+ import{r as p,c as h,o as m,y as l,d as f,J as w,K as k}from"./_plugin-vue_export-helper-nhjnO_bd.js";import{R as y}from"./RestrictedAuth-DsJXicIw.js";import"./pow-2N9bxgAo.js";const _={__name:"RestrictedApi",setup(g){const o=p(null);function c(){const e=window.location.pathname.match(/\/auth\/([^/]+)$/);if(e){const r=e[1],s=r.split(".");if(s.length===5&&s.every(d=>d.length>0))return r}return null}const i=h(()=>{const e=new URLSearchParams(window.location.hash.slice(1)).get("mode");return e==="reauth"?"reauth":e==="forbidden"?"forbidden":"login"});function n(t){window.parent&&window.parent!==window&&window.parent.postMessage(t,"*")}function u(t){n({type:"auth-success",authenticated:!0,sessionToken:t.session_token})}function a(){n({type:"auth-back"})}return m(()=>{o.value=c(),n({type:"auth-ready"}),window.addEventListener("keydown",t=>{t.key==="Escape"&&a()})}),(t,e)=>(f(),l(y,{mode:i.value,"remote-auth-token":o.value,onAuthenticated:u,onBack:a},null,8,["mode","remote-auth-token"]))}};w(_).mount("#app");k();
@@ -4,14 +4,14 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Auth Profile</title>
7
- <script type="module" crossorigin src="/auth/assets/auth-Dk3q4pNS.js"></script>
8
- <link rel="modulepreload" crossorigin href="/auth/assets/_plugin-vue_export-helper-rKFEraYH.js">
7
+ <script type="module" crossorigin src="/auth/assets/auth-YIZvPlW_.js"></script>
8
+ <link rel="modulepreload" crossorigin href="/auth/assets/_plugin-vue_export-helper-nhjnO_bd.js">
9
9
  <link rel="modulepreload" crossorigin href="/auth/assets/helpers-DzjFIx78.js">
10
- <link rel="modulepreload" crossorigin href="/auth/assets/AccessDenied-aTdCvz9k.js">
10
+ <link rel="modulepreload" crossorigin href="/auth/assets/AccessDenied-Fmeb6EtF.js">
11
11
  <link rel="modulepreload" crossorigin href="/auth/assets/pow-2N9bxgAo.js">
12
12
  <link rel="stylesheet" crossorigin href="/auth/assets/_plugin-vue_export-helper-BTzJAQlS.css">
13
- <link rel="stylesheet" crossorigin href="/auth/assets/AccessDenied-Bc249ASC.css">
14
- <link rel="stylesheet" crossorigin href="/auth/assets/auth-BKX7shEe.css">
13
+ <link rel="stylesheet" crossorigin href="/auth/assets/AccessDenied-DPkUS8LZ.css">
14
+ <link rel="stylesheet" crossorigin href="/auth/assets/auth-C7k64Wad.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="app"></div>