From 94f68760244dcc9e73d94dea35bc05ba9aa6d201 Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Tue, 14 Jul 2026 00:07:12 +0200 Subject: [PATCH] Add location-aware automatic default bounding box MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OpenSky "Default bounding box" now follows where flying happens. A new "Automatic" picker mode (the default) resolves the live-map area from a location cascade — drone telemetry → phone GPS → browser geolocation → the user's Region country → Europe — instead of a fixed box. Manual presets and Custom coordinates still work. - Web App: new shared countries.js dataset (all countries + bbox, offline point→country); the bbox picker gains all European countries and an Automatic option (client pref prefs.autoBbox); the Region setting expands from 6 locale entries to all countries; the live map resolves the cascade each poll and sends it as ?bbox=. - API Server: the states endpoint accepts and validates a ?bbox= override (validBBox); the Web App BFF forwards the query; the hub relays new phoneLatitude/phoneLongitude telemetry to the Web App. - Fly App: reports the phone's own GPS (geolocator) alongside telemetry, used as the "your location" fallback. - API panel: the OpenSky bbox picker lists all European countries. Builds verified across web, panel, both Go modules and the Fly App APK. Region list, Automatic default and the cascade ?bbox= override verified in the browser. Co-Authored-By: Claude Opus 4.8 --- .../api/dist/assets/index--4fMszzi.js | 17 -- .../api/dist/assets/index-CwiTp2Sb.js | 17 ++ API Server/internal/api/dist/index.html | 2 +- API Server/internal/api/integrations.go | 35 ++- API Server/internal/hub/models.go | 10 + API Server/panel/src/App.vue | 58 +++- Fly App/lib/flight_model.dart | 4 + Fly App/lib/main.dart | 42 +++ Fly App/pubspec.lock | 80 ++++++ Fly App/pubspec.yaml | 4 + Web App/server/bff.go | 7 +- Web App/server/dist/assets/index-BSx6Lf8i.js | 20 ++ Web App/server/dist/assets/index-CznFJTz4.js | 20 -- ...{index-D0ghlckk.css => index-FLz21UuE.css} | 2 +- Web App/server/dist/index.html | 4 +- Web App/web/src/api.js | 16 +- Web App/web/src/components/Dashboard.vue | 66 ++++- Web App/web/src/components/Settings.vue | 43 ++- Web App/web/src/countries.js | 257 ++++++++++++++++++ Web App/web/src/prefs.js | 4 + 20 files changed, 637 insertions(+), 71 deletions(-) delete mode 100644 API Server/internal/api/dist/assets/index--4fMszzi.js create mode 100644 API Server/internal/api/dist/assets/index-CwiTp2Sb.js create mode 100644 Web App/server/dist/assets/index-BSx6Lf8i.js delete mode 100644 Web App/server/dist/assets/index-CznFJTz4.js rename Web App/server/dist/assets/{index-D0ghlckk.css => index-FLz21UuE.css} (76%) create mode 100644 Web App/web/src/countries.js diff --git a/API Server/internal/api/dist/assets/index--4fMszzi.js b/API Server/internal/api/dist/assets/index--4fMszzi.js deleted file mode 100644 index 5ecbe51..0000000 --- a/API Server/internal/api/dist/assets/index--4fMszzi.js +++ /dev/null @@ -1,17 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function s(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=s(o);fetch(o.href,i)}})();/** -* @vue/shared v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function An(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ne={},Nt=[],tt=()=>{},$o=()=>!1,Ks=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),zs=e=>e.startsWith("onUpdate:"),Se=Object.assign,On=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},Qi=Object.prototype.hasOwnProperty,Q=(e,t)=>Qi.call(e,t),N=Array.isArray,Ft=e=>ms(e)==="[object Map]",Wt=e=>ms(e)==="[object Set]",eo=e=>ms(e)==="[object Date]",B=e=>typeof e=="function",ce=e=>typeof e=="string",st=e=>typeof e=="symbol",te=e=>e!==null&&typeof e=="object",jo=e=>(te(e)||B(e))&&B(e.then)&&B(e.catch),Do=Object.prototype.toString,ms=e=>Do.call(e),el=e=>ms(e).slice(8,-1),Lo=e=>ms(e)==="[object Object]",Rn=e=>ce(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ss=An(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ws=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},tl=/-\w/g,Be=Ws(e=>e.replace(tl,t=>t.slice(1).toUpperCase())),sl=/\B([A-Z])/g,xt=Ws(e=>e.replace(sl,"-$1").toLowerCase()),No=Ws(e=>e.charAt(0).toUpperCase()+e.slice(1)),on=Ws(e=>e?`on${No(e)}`:""),et=(e,t)=>!Object.is(e,t),Is=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Gs=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let to;const qs=()=>to||(to=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function In(e){if(N(e)){const t={};for(let s=0;s{if(s){const n=s.split(ol);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Ue(e){let t="";if(ce(e))t=e;else if(N(e))for(let s=0;svt(s,t))}const Ho=e=>!!(e&&e.__v_isRef===!0),O=e=>ce(e)?e:e==null?"":N(e)||te(e)&&(e.toString===Do||!B(e.toString))?Ho(e)?O(e.value):JSON.stringify(e,Bo,2):String(e),Bo=(e,t)=>Ho(t)?Bo(e,t.value):Ft(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,o],i)=>(s[ln(n,i)+" =>"]=o,s),{})}:Wt(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>ln(s))}:st(t)?ln(t):te(t)&&!N(t)&&!Lo(t)?String(t):t,ln=(e,t="")=>{var s;return st(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/** -* @vue/reactivity v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let ve;class ul{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&ve&&(ve.active?(this.parent=ve,this.index=(ve.scopes||(ve.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t0&&--this._on===0){if(ve===this)ve=this.prevScope;else{let t=ve;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s0)return;if(os){let t=os;for(os=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;ns;){let t=ns;for(ns=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Go(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function qo(e){let t,s=e.depsTail,n=s;for(;n;){const o=n.prevDep;n.version===-1?(n===s&&(s=o),jn(n),dl(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=s}function vn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Jo(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Jo(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===cs)||(e.globalVersion=cs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!vn(e))))return;e.flags|=2;const t=e.dep,s=re,n=Ke;re=e,Ke=!0;try{Go(e);const o=e.fn(e._value);(t.version===0||et(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{re=s,Ke=n,qo(e),e.flags&=-3}}function jn(e,t=!1){const{dep:s,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let i=s.computed.deps;i;i=i.nextDep)jn(i,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function dl(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Ke=!0;const Yo=[];function nt(){Yo.push(Ke),Ke=!1}function ot(){const e=Yo.pop();Ke=e===void 0?!0:e}function so(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=re;re=void 0;try{t()}finally{re=s}}}let cs=0;class pl{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Dn{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(!re||!Ke||re===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==re)s=this.activeLink=new pl(re,this),re.deps?(s.prevDep=re.depsTail,re.depsTail.nextDep=s,re.depsTail=s):re.deps=re.depsTail=s,Xo(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=re.depsTail,s.nextDep=void 0,re.depsTail.nextDep=s,re.depsTail=s,re.deps===s&&(re.deps=n)}return s}trigger(t){this.version++,cs++,this.notify(t)}notify(t){Un();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{$n()}}}function Xo(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Xo(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const bn=new WeakMap,Tt=Symbol(""),yn=Symbol(""),us=Symbol("");function we(e,t,s){if(Ke&&re){let n=bn.get(e);n||bn.set(e,n=new Map);let o=n.get(s);o||(n.set(s,o=new Dn),o.map=n,o.key=s),o.track()}}function ut(e,t,s,n,o,i){const l=bn.get(e);if(!l){cs++;return}const r=c=>{c&&c.trigger()};if(Un(),t==="clear")l.forEach(r);else{const c=N(e),g=c&&Rn(s);if(c&&s==="length"){const h=Number(n);l.forEach((y,R)=>{(R==="length"||R===us||!st(R)&&R>=h)&&r(y)})}else switch((s!==void 0||l.has(void 0))&&r(l.get(s)),g&&r(l.get(us)),t){case"add":c?g&&r(l.get("length")):(r(l.get(Tt)),Ft(e)&&r(l.get(yn)));break;case"delete":c||(r(l.get(Tt)),Ft(e)&&r(l.get(yn)));break;case"set":Ft(e)&&r(l.get(Tt));break}}$n()}function jt(e){const t=Z(e);return t===e?t:(we(t,"iterate",us),Ve(e)?t:t.map(ze))}function Js(e){return we(e=Z(e),"iterate",us),e}function Ze(e,t){return pt(e)?Bt(Pt(e)?ze(t):t):ze(t)}const hl={__proto__:null,[Symbol.iterator](){return an(this,Symbol.iterator,e=>Ze(this,e))},concat(...e){return jt(this).concat(...e.map(t=>N(t)?jt(t):t))},entries(){return an(this,"entries",e=>(e[1]=Ze(this,e[1]),e))},every(e,t){return rt(this,"every",e,t,void 0,arguments)},filter(e,t){return rt(this,"filter",e,t,s=>s.map(n=>Ze(this,n)),arguments)},find(e,t){return rt(this,"find",e,t,s=>Ze(this,s),arguments)},findIndex(e,t){return rt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return rt(this,"findLast",e,t,s=>Ze(this,s),arguments)},findLastIndex(e,t){return rt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return rt(this,"forEach",e,t,void 0,arguments)},includes(...e){return cn(this,"includes",e)},indexOf(...e){return cn(this,"indexOf",e)},join(e){return jt(this).join(e)},lastIndexOf(...e){return cn(this,"lastIndexOf",e)},map(e,t){return rt(this,"map",e,t,void 0,arguments)},pop(){return Jt(this,"pop")},push(...e){return Jt(this,"push",e)},reduce(e,...t){return no(this,"reduce",e,t)},reduceRight(e,...t){return no(this,"reduceRight",e,t)},shift(){return Jt(this,"shift")},some(e,t){return rt(this,"some",e,t,void 0,arguments)},splice(...e){return Jt(this,"splice",e)},toReversed(){return jt(this).toReversed()},toSorted(e){return jt(this).toSorted(e)},toSpliced(...e){return jt(this).toSpliced(...e)},unshift(...e){return Jt(this,"unshift",e)},values(){return an(this,"values",e=>Ze(this,e))}};function an(e,t,s){const n=Js(e),o=n[t]();return n!==e&&!Ve(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=s(i.value)),i}),o}const ml=Array.prototype;function rt(e,t,s,n,o,i){const l=Js(e),r=l!==e&&!Ve(e),c=l[t];if(c!==ml[t]){const y=c.apply(e,i);return r?ze(y):y}let g=s;l!==e&&(r?g=function(y,R){return s.call(this,Ze(e,y),R,e)}:s.length>2&&(g=function(y,R){return s.call(this,y,R,e)}));const h=c.call(l,g,n);return r&&o?o(h):h}function no(e,t,s,n){const o=Js(e),i=o!==e&&!Ve(e);let l=s,r=!1;o!==e&&(i?(r=n.length===0,l=function(g,h,y){return r&&(r=!1,g=Ze(e,g)),s.call(this,g,Ze(e,h),y,e)}):s.length>3&&(l=function(g,h,y){return s.call(this,g,h,y,e)}));const c=o[t](l,...n);return r?Ze(e,c):c}function cn(e,t,s){const n=Z(e);we(n,"iterate",us);const o=n[t](...s);return(o===-1||o===!1)&&Vn(s[0])?(s[0]=Z(s[0]),n[t](...s)):o}function Jt(e,t,s=[]){nt(),Un();const n=Z(e)[t].apply(e,s);return $n(),ot(),n}const gl=An("__proto__,__v_isRef,__isVue"),Zo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(st));function vl(e){st(e)||(e=String(e));const t=Z(this);return we(t,"has",e),t.hasOwnProperty(e)}class Qo{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(s==="__v_isReactive")return!o;if(s==="__v_isReadonly")return o;if(s==="__v_isShallow")return i;if(s==="__v_raw")return n===(o?i?Tl:ni:i?si:ti).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const l=N(t);if(!o){let c;if(l&&(c=hl[s]))return c;if(s==="hasOwnProperty")return vl}const r=Reflect.get(t,s,Ce(t)?t:n);if((st(s)?Zo.has(s):gl(s))||(o||we(t,"get",s),i))return r;if(Ce(r)){const c=l&&Rn(s)?r:r.value;return o&&te(c)?_n(c):c}return te(r)?o?_n(r):Nn(r):r}}class ei extends Qo{constructor(t=!1){super(!1,t)}set(t,s,n,o){let i=t[s];const l=N(t)&&Rn(s);if(!this._isShallow){const g=pt(i);if(!Ve(n)&&!pt(n)&&(i=Z(i),n=Z(n)),!l&&Ce(i)&&!Ce(n))return g||(i.value=n),!0}const r=l?Number(s)e,Ts=e=>Reflect.getPrototypeOf(e);function wl(e,t,s){return function(...n){const o=this.__v_raw,i=Z(o),l=Ft(i),r=e==="entries"||e===Symbol.iterator&&l,c=e==="keys"&&l,g=o[e](...n),h=s?xn:t?Bt:ze;return!t&&we(i,"iterate",c?yn:Tt),Se(Object.create(g),{next(){const{value:y,done:R}=g.next();return R?{value:y,done:R}:{value:r?[h(y[0]),h(y[1])]:h(y),done:R}}})}}function Ps(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Cl(e,t){const s={get(o){const i=this.__v_raw,l=Z(i),r=Z(o);e||(et(o,r)&&we(l,"get",o),we(l,"get",r));const{has:c}=Ts(l),g=t?xn:e?Bt:ze;if(c.call(l,o))return g(i.get(o));if(c.call(l,r))return g(i.get(r));i!==l&&i.get(o)},get size(){const o=this.__v_raw;return!e&&we(Z(o),"iterate",Tt),o.size},has(o){const i=this.__v_raw,l=Z(i),r=Z(o);return e||(et(o,r)&&we(l,"has",o),we(l,"has",r)),o===r?i.has(o):i.has(o)||i.has(r)},forEach(o,i){const l=this,r=l.__v_raw,c=Z(r),g=t?xn:e?Bt:ze;return!e&&we(c,"iterate",Tt),r.forEach((h,y)=>o.call(i,g(h),g(y),l))}};return Se(s,e?{add:Ps("add"),set:Ps("set"),delete:Ps("delete"),clear:Ps("clear")}:{add(o){const i=Z(this),l=Ts(i),r=Z(o),c=!t&&!Ve(o)&&!pt(o)?r:o;return l.has.call(i,c)||et(o,c)&&l.has.call(i,o)||et(r,c)&&l.has.call(i,r)||(i.add(c),ut(i,"add",c,c)),this},set(o,i){!t&&!Ve(i)&&!pt(i)&&(i=Z(i));const l=Z(this),{has:r,get:c}=Ts(l);let g=r.call(l,o);g||(o=Z(o),g=r.call(l,o));const h=c.call(l,o);return l.set(o,i),g?et(i,h)&&ut(l,"set",o,i):ut(l,"add",o,i),this},delete(o){const i=Z(this),{has:l,get:r}=Ts(i);let c=l.call(i,o);c||(o=Z(o),c=l.call(i,o)),r&&r.call(i,o);const g=i.delete(o);return c&&ut(i,"delete",o,void 0),g},clear(){const o=Z(this),i=o.size!==0,l=o.clear();return i&&ut(o,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=wl(o,e,t)}),s}function Ln(e,t){const s=Cl(e,t);return(n,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(Q(s,o)&&o in n?s:n,o,i)}const Sl={get:Ln(!1,!1)},kl={get:Ln(!1,!0)},El={get:Ln(!0,!1)};const ti=new WeakMap,si=new WeakMap,ni=new WeakMap,Tl=new WeakMap;function Pl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Nn(e){return pt(e)?e:Fn(e,!1,yl,Sl,ti)}function Al(e){return Fn(e,!1,_l,kl,si)}function _n(e){return Fn(e,!0,xl,El,ni)}function Fn(e,t,s,n,o){if(!te(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const l=Pl(el(e));if(l===0)return e;const r=new Proxy(e,l===2?n:s);return o.set(e,r),r}function Pt(e){return pt(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function pt(e){return!!(e&&e.__v_isReadonly)}function Ve(e){return!!(e&&e.__v_isShallow)}function Vn(e){return e?!!e.__v_raw:!1}function Z(e){const t=e&&e.__v_raw;return t?Z(t):e}function Ol(e){return!Q(e,"__v_skip")&&Object.isExtensible(e)&&Fo(e,"__v_skip",!0),e}const ze=e=>te(e)?Nn(e):e,Bt=e=>te(e)?_n(e):e;function Ce(e){return e?e.__v_isRef===!0:!1}function D(e){return Rl(e,!1)}function Rl(e,t){return Ce(e)?e:new Il(e,t)}class Il{constructor(t,s){this.dep=new Dn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:Z(t),this._value=s?t:ze(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Ve(t)||pt(t);t=n?t:Z(t),et(t,s)&&(this._rawValue=t,this._value=n?t:ze(t),this.dep.trigger())}}function Qt(e){return Ce(e)?e.value:e}const Ml={get:(e,t,s)=>t==="__v_raw"?e:Qt(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const o=e[t];return Ce(o)&&!Ce(s)?(o.value=s,!0):Reflect.set(e,t,s,n)}};function oi(e){return Pt(e)?e:new Proxy(e,Ml)}class Ul{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new Dn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=cs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&re!==this)return Wo(this,!0),!0}get value(){const t=this.dep.track();return Jo(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function $l(e,t,s=!1){let n,o;return B(e)?n=e:(n=e.get,o=e.set),new Ul(n,o,s)}const As={},js=new WeakMap;let Et;function jl(e,t=!1,s=Et){if(s){let n=js.get(s);n||js.set(s,n=[]),n.push(e)}}function Dl(e,t,s=ne){const{immediate:n,deep:o,once:i,scheduler:l,augmentJob:r,call:c}=s,g=j=>o?j:Ve(j)||o===!1||o===0?ft(j,1):ft(j);let h,y,R,M,q=!1,U=!1;if(Ce(e)?(y=()=>e.value,q=Ve(e)):Pt(e)?(y=()=>g(e),q=!0):N(e)?(U=!0,q=e.some(j=>Pt(j)||Ve(j)),y=()=>e.map(j=>{if(Ce(j))return j.value;if(Pt(j))return g(j);if(B(j))return c?c(j,2):j()})):B(e)?t?y=c?()=>c(e,2):e:y=()=>{if(R){nt();try{R()}finally{ot()}}const j=Et;Et=h;try{return c?c(e,3,[M]):e(M)}finally{Et=j}}:y=tt,t&&o){const j=y,z=o===!0?1/0:o;y=()=>ft(j(),z)}const W=fl(),Y=()=>{h.stop(),W&&W.active&&On(W.effects,h)};if(i&&t){const j=t;t=(...z)=>{const Ie=j(...z);return Y(),Ie}}let V=U?new Array(e.length).fill(As):As;const X=j=>{if(!(!(h.flags&1)||!h.dirty&&!j))if(t){const z=h.run();if(j||o||q||(U?z.some((Ie,De)=>et(Ie,V[De])):et(z,V))){R&&R();const Ie=Et;Et=h;try{const De=[z,V===As?void 0:U&&V[0]===As?[]:V,M];V=z,c?c(t,3,De):t(...De)}finally{Et=Ie}}}else h.run()};return r&&r(X),h=new Ko(y),h.scheduler=l?()=>l(X,!1):X,M=j=>jl(j,!1,h),R=h.onStop=()=>{const j=js.get(h);if(j){if(c)c(j,4);else for(const z of j)z();js.delete(h)}},t?n?X(!0):V=h.run():l?l(X.bind(null,!0),!0):h.run(),Y.pause=h.pause.bind(h),Y.resume=h.resume.bind(h),Y.stop=Y,Y}function ft(e,t=1/0,s){if(t<=0||!te(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Ce(e))ft(e.value,t,s);else if(N(e))for(let n=0;n{ft(n,t,s)});else if(Lo(e)){for(const n in e)ft(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&ft(e[n],t,s)}return e}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function gs(e,t,s,n){try{return n?e(...n):e()}catch(o){Ys(o,t,s)}}function We(e,t,s,n){if(B(e)){const o=gs(e,t,s,n);return o&&jo(o)&&o.catch(i=>{Ys(i,t,s)}),o}if(N(e)){const o=[];for(let i=0;i>>1,o=Pe[n],i=fs(o);i=fs(s)?Pe.push(e):Pe.splice(Nl(t),0,e),e.flags|=1,ri()}}function ri(){Ds||(Ds=ii.then(ci))}function Fl(e){N(e)?Vt.push(...e):gt&&e.id===-1?gt.splice(Dt+1,0,e):e.flags&1||(Vt.push(e),e.flags|=1),ri()}function oo(e,t,s=Xe+1){for(;sfs(s)-fs(n));if(Vt.length=0,gt){gt.push(...t);return}for(gt=t,Dt=0;Dte.id==null?e.flags&2?-1:1/0:e.id;function ci(e){try{for(Xe=0;Xe{n._d&&go(-1);const i=Ls(t);let l;try{l=e(...o)}finally{Ls(i),n._d&&go(1)}return l};return n._n=!0,n._c=!0,n._d=!0,n}function le(e,t){if(Fe===null)return e;const s=en(Fe),n=e.dirs||(e.dirs=[]);for(let o=0;o1)return s&&B(t)?t.call(n&&n.proxy):t}}const Bl=Symbol.for("v-scx"),Kl=()=>Ms(Bl);function un(e,t,s){return fi(e,t,s)}function fi(e,t,s=ne){const{immediate:n,deep:o,flush:i,once:l}=s,r=Se({},s),c=t&&n||!t&&i!=="post";let g;if(ps){if(i==="sync"){const M=Kl();g=M.__watcherHandles||(M.__watcherHandles=[])}else if(!c){const M=()=>{};return M.stop=tt,M.resume=tt,M.pause=tt,M}}const h=Ae;r.call=(M,q,U)=>We(M,h,q,U);let y=!1;i==="post"?r.scheduler=M=>{Re(M,h&&h.suspense)}:i!=="sync"&&(y=!0,r.scheduler=(M,q)=>{q?M():Hn(M)}),r.augmentJob=M=>{t&&(M.flags|=4),y&&(M.flags|=2,h&&(M.id=h.uid,M.i=h))};const R=Dl(e,t,r);return ps&&(g?g.push(R):c&&R()),R}function zl(e,t,s){const n=this.proxy,o=ce(e)?e.includes(".")?di(n,e):()=>n[e]:e.bind(n,n);let i;B(t)?i=t:(i=t.handler,s=t);const l=vs(this),r=fi(o,i.bind(n),s);return l(),r}function di(e,t){const s=t.split(".");return()=>{let n=e;for(let o=0;oe.__isTeleport,fn=Symbol("_leaveCb");function Bn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Bn(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 pi(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function io(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Ns=new WeakMap;function is(e,t,s,n,o=!1){if(N(e)){e.forEach((U,W)=>is(U,t&&(N(t)?t[W]:t),s,n,o));return}if(ls(n)&&!o){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&is(e,t,s,n.component.subTree);return}const i=n.shapeFlag&4?en(n.component):n.el,l=o?null:i,{i:r,r:c}=e,g=t&&t.r,h=r.refs===ne?r.refs={}:r.refs,y=r.setupState,R=Z(y),M=y===ne?$o:U=>io(h,U)?!1:Q(R,U),q=(U,W)=>!(W&&io(h,W));if(g!=null&&g!==c){if(lo(t),ce(g))h[g]=null,M(g)&&(y[g]=null);else if(Ce(g)){const U=t;q(g,U.k)&&(g.value=null),U.k&&(h[U.k]=null)}}if(B(c)){nt();try{gs(c,r,12,[l,h])}finally{ot()}}else{const U=ce(c),W=Ce(c);if(U||W){const Y=()=>{if(e.f){const V=U?M(c)?y[c]:h[c]:q()||!e.k?c.value:h[e.k];if(o)N(V)&&On(V,i);else if(N(V))V.includes(i)||V.push(i);else if(U)h[c]=[i],M(c)&&(y[c]=h[c]);else{const X=[i];q(c,e.k)&&(c.value=X),e.k&&(h[e.k]=X)}}else U?(h[c]=l,M(c)&&(y[c]=l)):W&&(q(c,e.k)&&(c.value=l),e.k&&(h[e.k]=l))};if(l){const V=()=>{Y(),Ns.delete(e)};V.id=-1,Ns.set(e,V),Re(V,s)}else lo(e),Y()}}}function lo(e){const t=Ns.get(e);t&&(t.flags|=8,Ns.delete(e))}qs().requestIdleCallback;qs().cancelIdleCallback;const ls=e=>!!e.type.__asyncLoader,hi=e=>e.type.__isKeepAlive;function ql(e,t){mi(e,"a",t)}function Jl(e,t){mi(e,"da",t)}function mi(e,t,s=Ae){const n=e.__wdc||(e.__wdc=()=>{let o=s;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Xs(t,n,s),s){let o=s.parent;for(;o&&o.parent;)hi(o.parent.vnode)&&Yl(n,t,s,o),o=o.parent}}function Yl(e,t,s,n){const o=Xs(t,e,n,!0);Kn(()=>{On(n[t],o)},s)}function Xs(e,t,s=Ae,n=!1){if(s){const o=s[e]||(s[e]=[]),i=t.__weh||(t.__weh=(...l)=>{nt();const r=vs(s),c=We(t,s,e,l);return r(),ot(),c});return n?o.unshift(i):o.push(i),i}}const ht=e=>(t,s=Ae)=>{(!ps||e==="sp")&&Xs(e,(...n)=>t(...n),s)},Xl=ht("bm"),gi=ht("m"),Zl=ht("bu"),Ql=ht("u"),er=ht("bum"),Kn=ht("um"),tr=ht("sp"),sr=ht("rtg"),nr=ht("rtc");function or(e,t=Ae){Xs("ec",e,t)}const ir=Symbol.for("v-ndc");function xe(e,t,s,n){let o;const i=s,l=N(e);if(l||ce(e)){const r=l&&Pt(e);let c=!1,g=!1;r&&(c=!Ve(e),g=pt(e),e=Js(e)),o=new Array(e.length);for(let h=0,y=e.length;ht(r,c,void 0,i));else{const r=Object.keys(e);o=new Array(r.length);for(let c=0,g=r.length;ce?Di(e)?en(e):wn(e.parent):null,rs=Se(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=>wn(e.parent),$root:e=>wn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>bi(e),$forceUpdate:e=>e.f||(e.f=()=>{Hn(e.update)}),$nextTick:e=>e.n||(e.n=li.bind(e.proxy)),$watch:e=>zl.bind(e)}),dn=(e,t)=>e!==ne&&!e.__isScriptSetup&&Q(e,t),lr={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:o,props:i,accessCache:l,type:r,appContext:c}=e;if(t[0]!=="$"){const R=l[t];if(R!==void 0)switch(R){case 1:return n[t];case 2:return o[t];case 4:return s[t];case 3:return i[t]}else{if(dn(n,t))return l[t]=1,n[t];if(o!==ne&&Q(o,t))return l[t]=2,o[t];if(Q(i,t))return l[t]=3,i[t];if(s!==ne&&Q(s,t))return l[t]=4,s[t];Cn&&(l[t]=0)}}const g=rs[t];let h,y;if(g)return t==="$attrs"&&we(e.attrs,"get",""),g(e);if((h=r.__cssModules)&&(h=h[t]))return h;if(s!==ne&&Q(s,t))return l[t]=4,s[t];if(y=c.config.globalProperties,Q(y,t))return y[t]},set({_:e},t,s){const{data:n,setupState:o,ctx:i}=e;return dn(o,t)?(o[t]=s,!0):n!==ne&&Q(n,t)?(n[t]=s,!0):Q(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:o,props:i,type:l}},r){let c;return!!(s[r]||e!==ne&&r[0]!=="$"&&Q(e,r)||dn(t,r)||Q(i,r)||Q(n,r)||Q(rs,r)||Q(o.config.globalProperties,r)||(c=l.__cssModules)&&c[r])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:Q(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function ro(e){return N(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let Cn=!0;function rr(e){const t=bi(e),s=e.proxy,n=e.ctx;Cn=!1,t.beforeCreate&&ao(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:l,watch:r,provide:c,inject:g,created:h,beforeMount:y,mounted:R,beforeUpdate:M,updated:q,activated:U,deactivated:W,beforeDestroy:Y,beforeUnmount:V,destroyed:X,unmounted:j,render:z,renderTracked:Ie,renderTriggered:De,errorCaptured:Ge,serverPrefetch:Le,expose:Oe,inheritAttrs:de,components:qe,directives:ke,filters:be}=t;if(g&&ar(g,n,null),l)for(const oe in l){const J=l[oe];B(J)&&(n[oe]=J.bind(s))}if(o){const oe=o.call(s,s);te(oe)&&(e.data=Nn(oe))}if(Cn=!0,i)for(const oe in i){const J=i[oe],Je=B(J)?J.bind(s,s):B(J.get)?J.get.bind(s,s):tt,At=!B(J)&&B(J.set)?J.set.bind(s):tt,ye=Tn({get:Je,set:At});Object.defineProperty(n,oe,{enumerable:!0,configurable:!0,get:()=>ye.value,set:ge=>ye.value=ge})}if(r)for(const oe in r)vi(r[oe],n,s,oe);if(c){const oe=B(c)?c.call(s):c;Reflect.ownKeys(oe).forEach(J=>{Hl(J,oe[J])})}h&&ao(h,e,"c");function me(oe,J){N(J)?J.forEach(Je=>oe(Je.bind(s))):J&&oe(J.bind(s))}if(me(Xl,y),me(gi,R),me(Zl,M),me(Ql,q),me(ql,U),me(Jl,W),me(or,Ge),me(nr,Ie),me(sr,De),me(er,V),me(Kn,j),me(tr,Le),N(Oe))if(Oe.length){const oe=e.exposed||(e.exposed={});Oe.forEach(J=>{Object.defineProperty(oe,J,{get:()=>s[J],set:Je=>s[J]=Je,enumerable:!0})})}else e.exposed||(e.exposed={});z&&e.render===tt&&(e.render=z),de!=null&&(e.inheritAttrs=de),qe&&(e.components=qe),ke&&(e.directives=ke),Le&&pi(e)}function ar(e,t,s=tt){N(e)&&(e=Sn(e));for(const n in e){const o=e[n];let i;te(o)?"default"in o?i=Ms(o.from||n,o.default,!0):i=Ms(o.from||n):i=Ms(o),Ce(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:l=>i.value=l}):t[n]=i}}function ao(e,t,s){We(N(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function vi(e,t,s,n){let o=n.includes(".")?di(s,n):()=>s[n];if(ce(e)){const i=t[e];B(i)&&un(o,i)}else if(B(e))un(o,e.bind(s));else if(te(e))if(N(e))e.forEach(i=>vi(i,t,s,n));else{const i=B(e.handler)?e.handler.bind(s):t[e.handler];B(i)&&un(o,i,e)}}function bi(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:l}}=e.appContext,r=i.get(t);let c;return r?c=r:!o.length&&!s&&!n?c=t:(c={},o.length&&o.forEach(g=>Fs(c,g,l,!0)),Fs(c,t,l)),te(t)&&i.set(t,c),c}function Fs(e,t,s,n=!1){const{mixins:o,extends:i}=t;i&&Fs(e,i,s,!0),o&&o.forEach(l=>Fs(e,l,s,!0));for(const l in t)if(!(n&&l==="expose")){const r=cr[l]||s&&s[l];e[l]=r?r(e[l],t[l]):t[l]}return e}const cr={data:co,props:uo,emits:uo,methods:es,computed:es,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:es,directives:es,watch:fr,provide:co,inject:ur};function co(e,t){return t?e?function(){return Se(B(e)?e.call(this,this):e,B(t)?t.call(this,this):t)}:t:e}function ur(e,t){return es(Sn(e),Sn(t))}function Sn(e){if(N(e)){const t={};for(let s=0;st==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Be(t)}Modifiers`]||e[`${xt(t)}Modifiers`];function mr(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||ne;let o=s;const i=t.startsWith("update:"),l=i&&hr(n,t.slice(7));l&&(l.trim&&(o=s.map(h=>ce(h)?h.trim():h)),l.number&&(o=s.map(Gs)));let r,c=n[r=on(t)]||n[r=on(Be(t))];!c&&i&&(c=n[r=on(xt(t))]),c&&We(c,e,6,o);const g=n[r+"Once"];if(g){if(!e.emitted)e.emitted={};else if(e.emitted[r])return;e.emitted[r]=!0,We(g,e,6,o)}}const gr=new WeakMap;function xi(e,t,s=!1){const n=s?gr:t.emitsCache,o=n.get(e);if(o!==void 0)return o;const i=e.emits;let l={},r=!1;if(!B(e)){const c=g=>{const h=xi(g,t,!0);h&&(r=!0,Se(l,h))};!s&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!r?(te(e)&&n.set(e,null),null):(N(i)?i.forEach(c=>l[c]=null):Se(l,i),te(e)&&n.set(e,l),l)}function Zs(e,t){return!e||!Ks(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Q(e,t[0].toLowerCase()+t.slice(1))||Q(e,xt(t))||Q(e,t))}function fo(e){const{type:t,vnode:s,proxy:n,withProxy:o,propsOptions:[i],slots:l,attrs:r,emit:c,render:g,renderCache:h,props:y,data:R,setupState:M,ctx:q,inheritAttrs:U}=e,W=Ls(e);let Y,V;try{if(s.shapeFlag&4){const j=o||n,z=j;Y=Qe(g.call(z,j,h,y,M,R,q)),V=r}else{const j=t;Y=Qe(j.length>1?j(y,{attrs:r,slots:l,emit:c}):j(y,null)),V=t.props?r:vr(r)}}catch(j){as.length=0,Ys(j,e,1),Y=je(bt)}let X=Y;if(V&&U!==!1){const j=Object.keys(V),{shapeFlag:z}=X;j.length&&z&7&&(i&&j.some(zs)&&(V=br(V,i)),X=Kt(X,V,!1,!0))}return s.dirs&&(X=Kt(X,null,!1,!0),X.dirs=X.dirs?X.dirs.concat(s.dirs):s.dirs),s.transition&&Bn(X,s.transition),Y=X,Ls(W),Y}const vr=e=>{let t;for(const s in e)(s==="class"||s==="style"||Ks(s))&&((t||(t={}))[s]=e[s]);return t},br=(e,t)=>{const s={};for(const n in e)(!zs(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function yr(e,t,s){const{props:n,children:o,component:i}=e,{props:l,children:r,patchFlag:c}=t,g=i.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&c>=0){if(c&1024)return!0;if(c&16)return n?po(n,l,g):!!l;if(c&8){const h=t.dynamicProps;for(let y=0;yObject.create(wi),Si=e=>Object.getPrototypeOf(e)===wi;function _r(e,t,s,n=!1){const o={},i=Ci();e.propsDefaults=Object.create(null),ki(e,t,o,i);for(const l in e.propsOptions[0])l in o||(o[l]=void 0);s?e.props=n?o:Al(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function wr(e,t,s,n){const{props:o,attrs:i,vnode:{patchFlag:l}}=e,r=Z(o),[c]=e.propsOptions;let g=!1;if((n||l>0)&&!(l&16)){if(l&8){const h=e.vnode.dynamicProps;for(let y=0;y{c=!0;const[R,M]=Ei(y,t,!0);Se(l,R),M&&r.push(...M)};!s&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!i&&!c)return te(e)&&n.set(e,Nt),Nt;if(N(i))for(let h=0;he==="_"||e==="_ctx"||e==="$stable",Wn=e=>N(e)?e.map(Qe):[Qe(e)],Sr=(e,t,s)=>{if(t._n)return t;const n=Vl((...o)=>Wn(t(...o)),s);return n._c=!1,n},Ti=(e,t,s)=>{const n=e._ctx;for(const o in e){if(zn(o))continue;const i=e[o];if(B(i))t[o]=Sr(o,i,n);else if(i!=null){const l=Wn(i);t[o]=()=>l}}},Pi=(e,t)=>{const s=Wn(t);e.slots.default=()=>s},Ai=(e,t,s)=>{for(const n in t)(s||!zn(n))&&(e[n]=t[n])},kr=(e,t,s)=>{const n=e.slots=Ci();if(e.vnode.shapeFlag&32){const o=t._;o?(Ai(n,t,s),s&&Fo(n,"_",o,!0)):Ti(t,n)}else t&&Pi(e,t)},Er=(e,t,s)=>{const{vnode:n,slots:o}=e;let i=!0,l=ne;if(n.shapeFlag&32){const r=t._;r?s&&r===1?i=!1:Ai(o,t,s):(i=!t.$stable,Ti(t,o)),l=t}else t&&(Pi(e,t),l={default:1});if(i)for(const r in o)!zn(r)&&l[r]==null&&delete o[r]},Re=Rr;function Tr(e){return Pr(e)}function Pr(e,t){const s=qs();s.__VUE__=!0;const{insert:n,remove:o,patchProp:i,createElement:l,createText:r,createComment:c,setText:g,setElementText:h,parentNode:y,nextSibling:R,setScopeId:M=tt,insertStaticContent:q}=e,U=(a,p,v,w=null,_=null,x=null,P=void 0,k=null,S=!!p.dynamicChildren)=>{if(a===p)return;a&&!Yt(a,p)&&(w=Ot(a),ge(a,_,x,!0),a=null),p.patchFlag===-2&&(S=!1,p.dynamicChildren=null);const{type:b,ref:I,shapeFlag:A}=p;switch(b){case Qs:W(a,p,v,w);break;case bt:Y(a,p,v,w);break;case Us:a==null&&V(p,v,w,P);break;case se:qe(a,p,v,w,_,x,P,k,S);break;default:A&1?z(a,p,v,w,_,x,P,k,S):A&6?ke(a,p,v,w,_,x,P,k,S):(A&64||A&128)&&b.process(a,p,v,w,_,x,P,k,S,Ct)}I!=null&&_?is(I,a&&a.ref,x,p||a,!p):I==null&&a&&a.ref!=null&&is(a.ref,null,x,a,!0)},W=(a,p,v,w)=>{if(a==null)n(p.el=r(p.children),v,w);else{const _=p.el=a.el;p.children!==a.children&&g(_,p.children)}},Y=(a,p,v,w)=>{a==null?n(p.el=c(p.children||""),v,w):p.el=a.el},V=(a,p,v,w)=>{[a.el,a.anchor]=q(a.children,p,v,w,a.el,a.anchor)},X=({el:a,anchor:p},v,w)=>{let _;for(;a&&a!==p;)_=R(a),n(a,v,w),a=_;n(p,v,w)},j=({el:a,anchor:p})=>{let v;for(;a&&a!==p;)v=R(a),o(a),a=v;o(p)},z=(a,p,v,w,_,x,P,k,S)=>{if(p.type==="svg"?P="svg":p.type==="math"&&(P="mathml"),a==null)Ie(p,v,w,_,x,P,k,S);else{const b=a.el&&a.el._isVueCE?a.el:null;try{b&&b._beginPatch(),Le(a,p,_,x,P,k,S)}finally{b&&b._endPatch()}}},Ie=(a,p,v,w,_,x,P,k)=>{let S,b;const{props:I,shapeFlag:A,transition:$,dirs:L}=a;if(S=a.el=l(a.type,x,I&&I.is,I),A&8?h(S,a.children):A&16&&Ge(a.children,S,null,w,_,pn(a,x),P,k),L&&St(a,null,w,"created"),De(S,a,a.scopeId,P,w),I){for(const G in I)G!=="value"&&!ss(G)&&i(S,G,null,I[G],x,w);"value"in I&&i(S,"value",null,I.value,x),(b=I.onVnodeBeforeMount)&&Ye(b,w,a)}L&&St(a,null,w,"beforeMount");const K=Ar(_,$);K&&$.beforeEnter(S),n(S,p,v),((b=I&&I.onVnodeMounted)||K||L)&&Re(()=>{try{b&&Ye(b,w,a),K&&$.enter(S),L&&St(a,null,w,"mounted")}finally{}},_)},De=(a,p,v,w,_)=>{if(v&&M(a,v),w)for(let x=0;x{for(let b=S;b{const k=p.el=a.el;let{patchFlag:S,dynamicChildren:b,dirs:I}=p;S|=a.patchFlag&16;const A=a.props||ne,$=p.props||ne;let L;if(v&&kt(v,!1),(L=$.onVnodeBeforeUpdate)&&Ye(L,v,p,a),I&&St(p,a,v,"beforeUpdate"),v&&kt(v,!0),b&&(!a.dynamicChildren||a.dynamicChildren.length!==b.length)&&(S=0,P=!1,b=null),(A.innerHTML&&$.innerHTML==null||A.textContent&&$.textContent==null)&&h(k,""),b?Oe(a.dynamicChildren,b,k,v,w,pn(p,_),x):P||J(a,p,k,null,v,w,pn(p,_),x,!1),S>0){if(S&16)de(k,A,$,v,_);else if(S&2&&A.class!==$.class&&i(k,"class",null,$.class,_),S&4&&i(k,"style",A.style,$.style,_),S&8){const K=p.dynamicProps;for(let G=0;G{L&&Ye(L,v,p,a),I&&St(p,a,v,"updated")},w)},Oe=(a,p,v,w,_,x,P)=>{for(let k=0;k{if(p!==v){if(p!==ne)for(const x in p)!ss(x)&&!(x in v)&&i(a,x,p[x],null,_,w);for(const x in v){if(ss(x))continue;const P=v[x],k=p[x];P!==k&&x!=="value"&&i(a,x,k,P,_,w)}"value"in v&&i(a,"value",p.value,v.value,_)}},qe=(a,p,v,w,_,x,P,k,S)=>{const b=p.el=a?a.el:r(""),I=p.anchor=a?a.anchor:r("");let{patchFlag:A,dynamicChildren:$,slotScopeIds:L}=p;L&&(k=k?k.concat(L):L),a==null?(n(b,v,w),n(I,v,w),Ge(p.children||[],v,I,_,x,P,k,S)):A>0&&A&64&&$&&a.dynamicChildren&&a.dynamicChildren.length===$.length?(Oe(a.dynamicChildren,$,v,_,x,P,k),(p.key!=null||_&&p===_.subTree)&&Oi(a,p,!0)):J(a,p,v,I,_,x,P,k,S)},ke=(a,p,v,w,_,x,P,k,S)=>{p.slotScopeIds=k,a==null?p.shapeFlag&512?_.ctx.activate(p,v,w,P,S):be(p,v,w,_,x,P,S):Gt(a,p,S)},be=(a,p,v,w,_,x,P)=>{const k=a.component=Fr(a,w,_);if(hi(a)&&(k.ctx.renderer=Ct),Hr(k,!1,P),k.asyncDep){if(_&&_.registerDep(k,me,P),!a.el){const S=k.subTree=je(bt);Y(null,S,p,v),a.placeholder=S.el}}else me(k,a,p,v,_,x,P)},Gt=(a,p,v)=>{const w=p.component=a.component;if(yr(a,p,v))if(w.asyncDep&&!w.asyncResolved){oe(w,p,v);return}else w.next=p,w.update();else p.el=a.el,w.vnode=p},me=(a,p,v,w,_,x,P)=>{const k=()=>{if(a.isMounted){let{next:A,bu:$,u:L,parent:K,vnode:G}=a;{const ue=Ri(a);if(ue){A&&(A.el=G.el,oe(a,A,P)),ue.asyncDep.then(()=>{Re(()=>{a.isUnmounted||b()},_)});return}}let F=A,ee;kt(a,!1),A?(A.el=G.el,oe(a,A,P)):A=G,$&&Is($),(ee=A.props&&A.props.onVnodeBeforeUpdate)&&Ye(ee,K,A,G),kt(a,!0);const ae=fo(a),Ee=a.subTree;a.subTree=ae,U(Ee,ae,y(Ee.el),Ot(Ee),a,_,x),A.el=ae.el,F===null&&xr(a,ae.el),L&&Re(L,_),(ee=A.props&&A.props.onVnodeUpdated)&&Re(()=>Ye(ee,K,A,G),_)}else{let A;const{el:$,props:L}=p,{bm:K,m:G,parent:F,root:ee,type:ae}=a,Ee=ls(p);kt(a,!1),K&&Is(K),!Ee&&(A=L&&L.onVnodeBeforeMount)&&Ye(A,F,p),kt(a,!0);{ee.ce&&ee.ce._hasShadowRoot()&&ee.ce._injectChildStyle(ae,a.parent?a.parent.type:void 0);const ue=a.subTree=fo(a);U(null,ue,v,w,a,_,x),p.el=ue.el}if(G&&Re(G,_),!Ee&&(A=L&&L.onVnodeMounted)){const ue=p;Re(()=>Ye(A,F,ue),_)}(p.shapeFlag&256||F&&ls(F.vnode)&&F.vnode.shapeFlag&256)&&a.a&&Re(a.a,_),a.isMounted=!0,p=v=w=null}};a.scope.on();const S=a.effect=new Ko(k);a.scope.off();const b=a.update=S.run.bind(S),I=a.job=S.runIfDirty.bind(S);I.i=a,I.id=a.uid,S.scheduler=()=>Hn(I),kt(a,!0),b()},oe=(a,p,v)=>{p.component=a;const w=a.vnode.props;a.vnode=p,a.next=null,wr(a,p.props,w,v),Er(a,p.children,v),nt(),oo(a),ot()},J=(a,p,v,w,_,x,P,k,S=!1)=>{const b=a&&a.children,I=a?a.shapeFlag:0,A=p.children,{patchFlag:$,shapeFlag:L}=p;if($>0){if($&128){At(b,A,v,w,_,x,P,k,S);return}else if($&256){Je(b,A,v,w,_,x,P,k,S);return}}L&8?(I&16&&wt(b,_,x),A!==b&&h(v,A)):I&16?L&16?At(b,A,v,w,_,x,P,k,S):wt(b,_,x,!0):(I&8&&h(v,""),L&16&&Ge(A,v,w,_,x,P,k,S))},Je=(a,p,v,w,_,x,P,k,S)=>{a=a||Nt,p=p||Nt;const b=a.length,I=p.length,A=Math.min(b,I);let $;for($=0;$I?wt(a,_,x,!0,!1,A):Ge(p,v,w,_,x,P,k,S,A)},At=(a,p,v,w,_,x,P,k,S)=>{let b=0;const I=p.length;let A=a.length-1,$=I-1;for(;b<=A&&b<=$;){const L=a[b],K=p[b]=S?ct(p[b]):Qe(p[b]);if(Yt(L,K))U(L,K,v,null,_,x,P,k,S);else break;b++}for(;b<=A&&b<=$;){const L=a[A],K=p[$]=S?ct(p[$]):Qe(p[$]);if(Yt(L,K))U(L,K,v,null,_,x,P,k,S);else break;A--,$--}if(b>A){if(b<=$){const L=$+1,K=L$)for(;b<=A;)ge(a[b],_,x,!0),b++;else{const L=b,K=b,G=new Map;for(b=K;b<=$;b++){const ie=p[b]=S?ct(p[b]):Qe(p[b]);ie.key!=null&&G.set(ie.key,b)}let F,ee=0;const ae=$-K+1;let Ee=!1,ue=0;const pe=new Array(ae);for(b=0;b=ae){ge(ie,_,x,!0);continue}let he;if(ie.key!=null)he=G.get(ie.key);else for(F=K;F<=$;F++)if(pe[F-K]===0&&Yt(ie,p[F])){he=F;break}he===void 0?ge(ie,_,x,!0):(pe[he-K]=b+1,he>=ue?ue=he:Ee=!0,U(ie,p[he],v,null,_,x,P,k,S),ee++)}const it=Ee?Or(pe):Nt;for(F=it.length-1,b=ae-1;b>=0;b--){const ie=K+b,he=p[ie],ys=p[ie+1],xs=ie+1{const{el:x,type:P,transition:k,children:S,shapeFlag:b}=a;if(b&6){ye(a.component.subTree,p,v,w);return}if(b&128){a.suspense.move(p,v,w);return}if(b&64){P.move(a,p,v,Ct);return}if(P===se){n(x,p,v);for(let A=0;Ak.enter(x),_));else{const{leave:A,delayLeave:$,afterLeave:L}=k,K=()=>{a.ctx.isUnmounted?o(x):n(x,p,v)},G=()=>{const F=x._isLeaving||!!x[fn];x._isLeaving&&x[fn](!0),k.persisted&&!F?K():A(x,()=>{K(),L&&L()})};$?$(x,K,G):G()}else n(x,p,v)},ge=(a,p,v,w=!1,_=!1)=>{const{type:x,props:P,ref:k,children:S,dynamicChildren:b,shapeFlag:I,patchFlag:A,dirs:$,cacheIndex:L,memo:K}=a;if(A===-2&&(_=!1),k!=null&&(nt(),is(k,null,v,a,!0),ot()),L!=null&&(p.renderCache[L]=void 0),I&256){p.ctx.deactivate(a);return}const G=I&1&&$,F=!ls(a);let ee;if(F&&(ee=P&&P.onVnodeBeforeUnmount)&&Ye(ee,p,a),I&6)qt(a.component,v,w);else{if(I&128){a.suspense.unmount(v,w);return}G&&St(a,null,p,"beforeUnmount"),I&64?a.type.remove(a,p,v,Ct,w):b&&!b.hasOnce&&(x!==se||A>0&&A&64)?wt(b,p,v,!1,!0):(x===se&&A&384||!_&&I&16)&&wt(S,p,v),w&&_t(a)}const ae=K!=null&&L==null;(F&&(ee=P&&P.onVnodeUnmounted)||G||ae)&&Re(()=>{ee&&Ye(ee,p,a),G&&St(a,null,p,"unmounted"),ae&&(a.el=null)},v)},_t=a=>{const{type:p,el:v,anchor:w,transition:_}=a;if(p===se){tn(v,w);return}if(p===Us){j(a);return}const x=()=>{o(v),_&&!_.persisted&&_.afterLeave&&_.afterLeave()};if(a.shapeFlag&1&&_&&!_.persisted){const{leave:P,delayLeave:k}=_,S=()=>P(v,x);k?k(a.el,x,S):S()}else x()},tn=(a,p)=>{let v;for(;a!==p;)v=R(a),o(a),a=v;o(p)},qt=(a,p,v)=>{const{bum:w,scope:_,job:x,subTree:P,um:k,m:S,a:b}=a;mo(S),mo(b),w&&Is(w),_.stop(),x&&(x.flags|=8,ge(P,a,p,v)),k&&Re(k,p),Re(()=>{a.isUnmounted=!0},p)},wt=(a,p,v,w=!1,_=!1,x=0)=>{for(let P=x;P{if(a.shapeFlag&6)return Ot(a.component.subTree);if(a.shapeFlag&128)return a.suspense.next();const p=R(a.anchor||a.el),v=p&&p[Wl];return v?R(v):p};let Rt=!1;const bs=(a,p,v)=>{let w;a==null?p._vnode&&(ge(p._vnode,null,null,!0),w=p._vnode.component):U(p._vnode||null,a,p,null,null,null,v),p._vnode=a,Rt||(Rt=!0,oo(w),ai(),Rt=!1)},Ct={p:U,um:ge,m:ye,r:_t,mt:be,mc:Ge,pc:J,pbc:Oe,n:Ot,o:e};return{render:bs,hydrate:void 0,createApp:pr(bs)}}function pn({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function kt({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ar(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Oi(e,t,s=!1){const n=e.children,o=t.children;if(N(n)&&N(o))for(let i=0;i>1,e[s[r]]0&&(t[n]=s[i-1]),s[i]=n)}}for(i=s.length,l=s[i-1];i-- >0;)s[i]=l,l=t[l];return s}function Ri(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ri(t)}function mo(e){if(e)for(let t=0;te.__isSuspense;function Rr(e,t){t&&t.pendingBranch?N(e)?t.effects.push(...e):t.effects.push(e):Fl(e)}const se=Symbol.for("v-fgt"),Qs=Symbol.for("v-txt"),bt=Symbol.for("v-cmt"),Us=Symbol.for("v-stc"),as=[];let $e=null;function E(e=!1){as.push($e=e?null:[])}function Ir(){as.pop(),$e=as[as.length-1]||null}let ds=1;function go(e,t=!1){ds+=e,e<0&&$e&&t&&($e.hasOnce=!0)}function Ui(e){return e.dynamicChildren=ds>0?$e||Nt:null,Ir(),ds>0&&$e&&$e.push(e),e}function T(e,t,s,n,o,i){return Ui(d(e,t,s,n,o,i,!0))}function Mr(e,t,s,n,o){return Ui(je(e,t,s,n,o,!0))}function $i(e){return e?e.__v_isVNode===!0:!1}function Yt(e,t){return e.type===t.type&&e.key===t.key}const ji=({key:e})=>e??null,$s=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?ce(e)||Ce(e)||B(e)?{i:Fe,r:e,k:t,f:!!s}:e:null);function d(e,t=null,s=null,n=0,o=null,i=e===se?0:1,l=!1,r=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ji(t),ref:t&&$s(t),scopeId:ui,slotScopeIds:null,children:s,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:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Fe};return r?(Vs(c,s),i&128&&e.normalize(c)):s&&(c.shapeFlag|=ce(s)?8:16),ds>0&&!l&&$e&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&$e.push(c),c}const je=Ur;function Ur(e,t=null,s=null,n=0,o=null,i=!1){if((!e||e===ir)&&(e=bt),$i(e)){const r=Kt(e,t,!0);return s&&Vs(r,s),ds>0&&!i&&$e&&(r.shapeFlag&6?$e[$e.indexOf(e)]=r:$e.push(r)),r.patchFlag=-2,r}if(Wr(e)&&(e=e.__vccOpts),t){t=$r(t);let{class:r,style:c}=t;r&&!ce(r)&&(t.class=Ue(r)),te(c)&&(Vn(c)&&!N(c)&&(c=Se({},c)),t.style=In(c))}const l=ce(e)?1:Mi(e)?128:Gl(e)?64:te(e)?4:B(e)?2:0;return d(e,t,s,n,o,l,i,!0)}function $r(e){return e?Vn(e)||Si(e)?Se({},e):e:null}function Kt(e,t,s=!1,n=!1){const{props:o,ref:i,patchFlag:l,children:r,transition:c}=e,g=t?Dr(o||{},t):o,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:g,key:g&&ji(g),ref:t&&t.ref?s&&i?N(i)?i.concat($s(t)):[i,$s(t)]:$s(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==se?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Kt(e.ssContent),ssFallback:e.ssFallback&&Kt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&Bn(h,c.clone(h)),h}function Ne(e=" ",t=0){return je(Qs,null,e,t)}function jr(e,t){const s=je(Us,null,e);return s.staticCount=t,s}function H(e="",t=!1){return t?(E(),Mr(bt,null,e)):je(bt,null,e)}function Qe(e){return e==null||typeof e=="boolean"?je(bt):N(e)?je(se,null,e.slice()):$i(e)?ct(e):je(Qs,null,String(e))}function ct(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Kt(e)}function Vs(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(N(t))s=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),Vs(e,o()),o._c&&(o._d=!0));return}else{s=32;const o=t._;!o&&!Si(t)?t._ctx=Fe:o===3&&Fe&&(Fe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(B(t)){if(n&65){Vs(e,{default:t});return}t={default:t,_ctx:Fe},s=32}else t=String(t),n&64?(s=16,t=[Ne(t)]):s=8;e.children=t,e.shapeFlag|=s}function Dr(...e){const t={};for(let s=0;sAe||Fe;let Hs,En;{const e=qs(),t=(s,n)=>{let o;return(o=e[s])||(o=e[s]=[]),o.push(n),i=>{o.length>1?o.forEach(l=>l(i)):o[0](i)}};Hs=t("__VUE_INSTANCE_SETTERS__",s=>Ae=s),En=t("__VUE_SSR_SETTERS__",s=>ps=s)}const vs=e=>{const t=Ae;return Hs(e),e.scope.on(),()=>{e.scope.off(),Hs(t)}},vo=()=>{Ae&&Ae.scope.off(),Hs(null)};function Di(e){return e.vnode.shapeFlag&4}let ps=!1;function Hr(e,t=!1,s=!1){t&&En(t);const{props:n,children:o}=e.vnode,i=Di(e);_r(e,n,i,t),kr(e,o,s||t);const l=i?Br(e,t):void 0;return t&&En(!1),l}function Br(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,lr);const{setup:n}=s;if(n){nt();const o=e.setupContext=n.length>1?zr(e):null,i=vs(e),l=gs(n,e,0,[e.props,o]),r=jo(l);if(ot(),i(),(r||e.sp)&&!ls(e)&&pi(e),r){if(l.then(vo,vo),t)return l.then(c=>{bo(e,c)}).catch(c=>{Ys(c,e,0)});e.asyncDep=l}else bo(e,l)}else Li(e)}function bo(e,t,s){B(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:te(t)&&(e.setupState=oi(t)),Li(e)}function Li(e,t,s){const n=e.type;e.render||(e.render=n.render||tt);{const o=vs(e);nt();try{rr(e)}finally{ot(),o()}}}const Kr={get(e,t){return we(e,"get",""),e[t]}};function zr(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Kr),slots:e.slots,emit:e.emit,expose:t}}function en(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(oi(Ol(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in rs)return rs[s](e)},has(t,s){return s in t||s in rs}})):e.proxy}function Wr(e){return B(e)&&"__vccOpts"in e}const Tn=(e,t)=>$l(e,t,ps),Gr="3.5.39";/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Pn;const yo=typeof window<"u"&&window.trustedTypes;if(yo)try{Pn=yo.createPolicy("vue",{createHTML:e=>e})}catch{}const Ni=Pn?e=>Pn.createHTML(e):e=>e,qr="http://www.w3.org/2000/svg",Jr="http://www.w3.org/1998/Math/MathML",at=typeof document<"u"?document:null,xo=at&&at.createElement("template"),Yr={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const o=t==="svg"?at.createElementNS(qr,e):t==="mathml"?at.createElementNS(Jr,e):s?at.createElement(e,{is:s}):at.createElement(e);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>at.createTextNode(e),createComment:e=>at.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>at.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,o,i){const l=s?s.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),s),!(o===i||!(o=o.nextSibling)););else{xo.innerHTML=Ni(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const r=xo.content;if(n==="svg"||n==="mathml"){const c=r.firstChild;for(;c.firstChild;)r.appendChild(c.firstChild);r.removeChild(c)}t.insertBefore(r,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Xr=Symbol("_vtc");function Zr(e,t,s){const n=e[Xr];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Bs=Symbol("_vod"),Fi=Symbol("_vsh"),Xt={name:"show",beforeMount(e,{value:t},{transition:s}){e[Bs]=e.style.display==="none"?"":e.style.display,s&&t?s.beforeEnter(e):Zt(e,t)},mounted(e,{value:t},{transition:s}){s&&t&&s.enter(e)},updated(e,{value:t,oldValue:s},{transition:n}){!t!=!s&&(n?t?(n.beforeEnter(e),Zt(e,!0),n.enter(e)):n.leave(e,()=>{Zt(e,!1)}):Zt(e,t))},beforeUnmount(e,{value:t}){Zt(e,t)}};function Zt(e,t){e.style.display=t?e[Bs]:"none",e[Fi]=!t}const Qr=Symbol(""),ea=/(?:^|;)\s*display\s*:/;function ta(e,t,s){const n=e.style,o=ce(s);let i=!1;if(s&&!o){if(t)if(ce(t))for(const l of t.split(";")){const r=l.slice(0,l.indexOf(":")).trim();s[r]==null&&ts(n,r,"")}else for(const l in t)s[l]==null&&ts(n,l,"");for(const l in s){l==="display"&&(i=!0);const r=s[l];r!=null?na(e,l,!ce(t)&&t?t[l]:void 0,r)||ts(n,l,r):ts(n,l,"")}}else if(o){if(t!==s){const l=n[Qr];l&&(s+=";"+l),n.cssText=s,i=ea.test(s)}}else t&&e.removeAttribute("style");Bs in e&&(e[Bs]=i?n.display:"",e[Fi]&&(n.display="none"))}const _o=/\s*!important$/;function ts(e,t,s){if(N(s))s.forEach(n=>ts(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=sa(e,t);_o.test(s)?e.setProperty(xt(n),s.replace(_o,""),"important"):e[n]=s}}const wo=["Webkit","Moz","ms"],hn={};function sa(e,t){const s=hn[t];if(s)return s;let n=Be(t);if(n!=="filter"&&n in e)return hn[t]=n;n=No(n);for(let o=0;omn||(ca.then(()=>mn=0),mn=Date.now());function fa(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const o=s.value;if(N(o)){const i=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{i.call(n),n._stopped=!0};const l=o.slice(),r=[n];for(let c=0;ce.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,da=(e,t,s,n,o,i)=>{const l=o==="svg";t==="class"?Zr(e,n,l):t==="style"?ta(e,s,n):Ks(t)?zs(t)||ia(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):pa(e,t,n,l))?(ko(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&So(e,t,n,l,i,t!=="value")):e._isVueCE&&(ha(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ce(n)))?ko(e,Be(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),So(e,t,n,l))};function pa(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&To(t)&&B(s));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 o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return To(t)&&ce(s)?!1:t in e}function ha(e,t){const s=e._def.props;if(!s)return!1;const n=Be(t);return Array.isArray(s)?s.some(o=>Be(o)===n):Object.keys(s).some(o=>Be(o)===n)}const yt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return N(t)?s=>Is(t,s):t};function ma(e){e.target.composing=!0}function Po(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const He=Symbol("_assign");function Ao(e,t,s){return t&&(e=e.trim()),s&&(e=Gs(e)),e}const _e={created(e,{modifiers:{lazy:t,trim:s,number:n}},o){e[He]=yt(o);const i=n||o.props&&o.props.type==="number";dt(e,t?"change":"input",l=>{l.target.composing||e[He](Ao(e.value,s,i))}),(s||i)&&dt(e,"change",()=>{e.value=Ao(e.value,s,i)}),t||(dt(e,"compositionstart",ma),dt(e,"compositionend",Po),dt(e,"change",Po))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:o,number:i}},l){if(e[He]=yt(l),e.composing)return;const r=(i||e.type==="number")&&!/^0\d/.test(e.value)?Gs(e.value):e.value,c=t??"";if(r===c)return;const g=e.getRootNode();(g instanceof Document||g instanceof ShadowRoot)&&g.activeElement===e&&e.type!=="range"&&(n&&t===s||o&&e.value.trim()===c)||(e.value=c)}},Vi={deep:!0,created(e,t,s){e[He]=yt(s),dt(e,"change",()=>{const n=e._modelValue,o=zt(e),i=e.checked,l=e[He];if(N(n)){const r=Mn(n,o),c=r!==-1;if(i&&!c)l(n.concat(o));else if(!i&&c){const g=[...n];g.splice(r,1),l(g)}}else if(Wt(n)){const r=new Set(n);i?r.add(o):r.delete(o),l(r)}else l(Hi(e,i))})},mounted:Oo,beforeUpdate(e,t,s){e[He]=yt(s),Oo(e,t,s)}};function Oo(e,{value:t,oldValue:s},n){e._modelValue=t;let o;if(N(t))o=Mn(t,n.props.value)>-1;else if(Wt(t))o=t.has(n.props.value);else{if(t===s)return;o=vt(t,Hi(e,!0))}e.checked!==o&&(e.checked=o)}const ga={created(e,{value:t},s){e.checked=vt(t,s.props.value),e[He]=yt(s),dt(e,"change",()=>{e[He](zt(e))})},beforeUpdate(e,{value:t,oldValue:s},n){e[He]=yt(n),t!==s&&(e.checked=vt(t,n.props.value))}},Lt={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const o=Wt(t);dt(e,"change",()=>{const i=Array.prototype.filter.call(e.options,l=>l.selected).map(l=>s?Gs(zt(l)):zt(l));e[He](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,li(()=>{e._assigning=!1})}),e[He]=yt(n)},mounted(e,{value:t}){Ro(e,t)},beforeUpdate(e,t,s){e[He]=yt(s)},updated(e,{value:t}){e._assigning||Ro(e,t)}};function Ro(e,t){const s=e.multiple,n=N(t);if(!(s&&!n&&!Wt(t))){for(let o=0,i=e.options.length;oString(g)===String(r)):l.selected=Mn(t,r)>-1}else l.selected=t.has(r);else if(vt(zt(l),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function zt(e){return"_value"in e?e._value:e.value}function Hi(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const va={created(e,t,s){Os(e,t,s,null,"created")},mounted(e,t,s){Os(e,t,s,null,"mounted")},beforeUpdate(e,t,s,n){Os(e,t,s,n,"beforeUpdate")},updated(e,t,s,n){Os(e,t,s,n,"updated")}};function ba(e,t){switch(e){case"SELECT":return Lt;case"TEXTAREA":return _e;default:switch(t){case"checkbox":return Vi;case"radio":return ga;default:return _e}}}function Os(e,t,s,n,o){const l=ba(e.tagName,s.props&&s.props.type)[o];l&&l(e,t,s,n)}const ya=["ctrl","shift","alt","meta"],xa={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)=>ya.some(s=>e[`${s}Key`]&&!t.includes(s))},_a=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((o,...i)=>{for(let l=0;l{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(o=>{if(!("key"in o))return;const i=xt(o.key);if(t.some(l=>l===i||wa[l]===i))return e(o)}))},Ca=Se({patchProp:da},Yr);let Mo;function Sa(){return Mo||(Mo=Tr(Ca))}const ka=((...e)=>{const t=Sa().createApp(...e),{mount:s}=t;return t.mount=n=>{const o=Ta(n);if(!o)return;const i=t._component;!B(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const l=s(o,!1,Ea(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),l},t});function Ea(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ta(e){return ce(e)?document.querySelector(e):e}const Bi="pilotvault-theme";function Pa(){try{return localStorage.getItem(Bi)==="dark"?"dark":"light"}catch{return"light"}}const hs=D(Pa());function Ki(e){hs.value=e,document.documentElement.setAttribute("data-theme",e);try{localStorage.setItem(Bi,e)}catch{}}function Uo(){Ki(hs.value==="dark"?"light":"dark")}Ki(hs.value);const Aa={class:"overflow-hidden rounded-lg border border-subtle bg-card shadow-xs"},Oa={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},Ra={class:"text-base font-semibold text-primary"},Ia={class:"pv-eyebrow"},Ma={class:"w-full text-left text-sm"},Ua={class:"border-t border-subtle px-5 py-2.5 font-mono text-xs whitespace-nowrap"},$a={class:"text-primary"},ja={class:"border-t border-subtle px-5 py-2.5 text-secondary"},gn={__name:"EndpointTable",props:{title:String,auth:String,endpoints:Array},setup(e){const t={GET:"text-success",POST:"text-brand-text",PATCH:"text-warning",DELETE:"text-danger"};return(s,n)=>(E(),T("div",Aa,[d("div",Oa,[d("div",Ra,O(e.title),1),d("span",Ia,O(e.auth),1)]),d("table",Ma,[n[0]||(n[0]=d("thead",null,[d("tr",{class:"pv-eyebrow"},[d("th",{class:"px-5 py-2.5 font-medium"},"Endpoint"),d("th",{class:"px-5 py-2.5 font-medium"},"Description")])],-1)),d("tbody",null,[(E(!0),T(se,null,xe(e.endpoints,o=>(E(),T("tr",{key:o.method+o.path,class:"transition-colors hover:bg-sunken"},[d("td",Ua,[d("span",{class:Ue(["font-semibold",t[o.method]])},O(o.method),3),d("span",$a,O(o.path),1)]),d("td",ja,O(o.desc),1)]))),128))])])]))}},Da={class:"mx-auto flex max-w-5xl flex-col gap-6 px-6 pt-12 pb-16"},La={class:"flex items-center gap-3"},Na={key:0,class:"pv-eyebrow hidden truncate sm:inline"},Fa=["title"],Va={key:0,class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ha={key:1,class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ba={key:0,class:"rounded-lg border border-subtle bg-card px-5 py-10 text-center shadow-sm"},Ka={key:1,class:"mx-auto w-full max-w-sm rounded-lg border border-subtle bg-card shadow-sm"},za={class:"flex flex-col gap-1"},Wa={class:"flex flex-col gap-1"},Ga={key:0,class:"rounded-sm bg-danger-tint px-3 py-2 text-xs font-medium text-danger"},qa=["disabled"],Ja={class:"flex gap-1 self-start rounded-lg border border-subtle bg-card p-1 shadow-sm"},Ya=["onClick"],Xa={class:"flex flex-col gap-6"},Za={class:"rounded-lg border border-subtle bg-card shadow-sm"},Qa={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},ec={class:"pv-eyebrow"},tc={class:"min-w-0"},sc={class:"text-sm font-semibold text-primary"},nc={key:0,class:"truncate font-mono text-xs text-secondary"},oc={class:"flex items-center justify-between gap-3 border-t border-subtle px-5 py-3.5"},ic={class:"font-mono text-xs text-secondary"},lc={class:"flex flex-col gap-6"},rc={class:"rounded-lg border border-subtle bg-card shadow-sm"},ac={class:"flex flex-col gap-3 px-5 py-5"},cc={class:"flex flex-col gap-3 sm:flex-row"},uc={class:"flex flex-1 flex-col gap-1"},fc={class:"flex flex-1 flex-col gap-1"},dc={class:"flex flex-col gap-3 sm:flex-row"},pc={class:"flex flex-1 flex-col gap-1"},hc=["value"],mc={class:"flex flex-1 flex-col gap-1"},gc=["value"],vc={key:0,class:"rounded-sm bg-danger-tint px-3 py-2 text-xs font-medium text-danger"},bc={key:1,class:"rounded-sm bg-success-tint px-3 py-2 text-xs font-medium text-success"},yc=["disabled"],xc={class:"rounded-lg border border-subtle bg-card shadow-sm"},_c={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},wc={class:"pv-eyebrow"},Cc={class:"flex flex-col"},Sc={key:0,class:"px-5 py-3 text-xs font-medium text-danger"},kc={key:1,class:"border-b border-subtle bg-sunken px-5 py-2.5 font-mono text-xs text-secondary"},Ec={key:2,class:"px-5 py-6 text-sm text-secondary"},Tc={class:"flex flex-wrap items-center gap-x-3 gap-y-2"},Pc={class:"min-w-0 flex-1"},Ac={class:"flex flex-wrap items-center gap-2"},Oc={class:"truncate text-sm font-semibold text-primary"},Rc={key:0,class:"rounded-sm bg-brand/10 px-1.5 py-0.5 font-mono text-[10px] font-medium text-brand-text"},Ic={key:1,class:"rounded-sm bg-warning-tint px-1.5 py-0.5 font-mono text-[10px] font-medium text-warning"},Mc={class:"mt-0.5 font-mono text-xs text-secondary"},Uc={class:"flex shrink-0 items-center gap-2"},$c=["onClick"],jc=["disabled","onClick"],Dc={key:0,class:"mt-3 flex flex-col gap-3 rounded-md border border-subtle bg-sunken px-4 py-4"},Lc={class:"flex flex-col gap-3 sm:flex-row"},Nc={class:"flex flex-1 flex-col gap-1"},Fc={class:"flex flex-1 flex-col gap-1"},Vc={class:"flex flex-col gap-3 sm:flex-row"},Hc={class:"flex flex-1 flex-col gap-1"},Bc=["disabled"],Kc=["value"],zc={key:0,class:"text-[11px] text-muted"},Wc={class:"flex flex-1 flex-col gap-1"},Gc=["value"],qc={class:"flex items-center gap-2"},Jc={class:"flex items-center gap-2"},Yc=["disabled","onClick"],Xc={class:"flex flex-col gap-6"},Zc={class:"rounded-lg border border-subtle bg-card shadow-sm"},Qc={class:"flex flex-col gap-3 px-5 py-5"},eu={class:"flex flex-col gap-2 sm:flex-row"},tu=["disabled"],su={key:0,class:"rounded-sm bg-danger-tint px-3 py-2 text-xs font-medium text-danger"},nu={key:1,class:"rounded-sm bg-success-tint px-3 py-2 text-xs font-medium text-success"},ou={class:"rounded-lg border border-subtle bg-card shadow-sm"},iu={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},lu={class:"pv-eyebrow"},ru={class:"flex flex-col"},au={key:0,class:"border-b border-subtle bg-sunken px-5 py-2.5 font-mono text-xs text-secondary"},cu={key:1,class:"px-5 py-6 text-sm text-secondary"},uu={class:"flex flex-wrap items-center gap-x-3 gap-y-2"},fu={class:"min-w-0 flex-1"},du={class:"truncate text-sm font-semibold text-primary"},pu={class:"mt-0.5 font-mono text-xs text-secondary"},hu={class:"flex shrink-0 items-center gap-2"},mu=["onClick"],gu=["disabled","title","onClick"],vu={key:0,class:"mt-3 flex flex-col gap-2 rounded-md border border-subtle bg-sunken px-4 py-4 sm:flex-row sm:items-end"},bu={class:"flex flex-1 flex-col gap-1"},yu=["onKeyup"],xu={class:"flex items-center gap-2"},_u=["disabled","onClick"],wu={class:"flex flex-col gap-6"},Cu={class:"rounded-lg border border-subtle bg-card shadow-sm"},Su={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},ku={class:"flex flex-col gap-3 px-5 py-5"},Eu={class:"flex flex-col gap-1"},Tu={class:"flex flex-col gap-1"},Pu={class:"flex flex-col gap-1"},Au=["placeholder"],Ou={key:0,class:"font-mono text-[11px] text-muted"},Ru={key:0},Iu={key:1},Mu={key:1,class:"rounded-sm bg-danger-tint px-3 py-2 text-xs font-medium text-danger"},Uu={key:2,class:"rounded-sm bg-success-tint px-3 py-2 text-xs font-medium text-success"},$u={class:"flex flex-wrap items-center gap-2"},ju=["disabled"],Du=["disabled"],Lu={class:"flex flex-col gap-6"},Nu={class:"rounded-lg border border-subtle bg-card shadow-sm"},Fu={class:"flex flex-col"},Vu={key:0,class:"px-5 py-3 text-xs font-medium text-danger"},Hu={key:1,class:"border-b border-subtle bg-sunken px-5 py-2.5 font-mono text-xs text-secondary"},Bu={key:2,class:"px-5 py-6 text-sm text-secondary"},Ku={key:3,class:"flex gap-1 overflow-x-auto overflow-y-hidden border-b border-subtle px-3 pt-1"},zu=["onClick"],Wu={key:4,class:"px-5 py-6 text-sm text-secondary"},Gu={class:"flex flex-wrap items-center gap-x-3 gap-y-2"},qu={class:"min-w-0 flex-1"},Ju={class:"flex flex-wrap items-center gap-2"},Yu={class:"text-sm font-semibold text-primary"},Xu=["title"],Zu={key:0},Qu={class:"mt-0.5 font-mono text-xs text-secondary"},ef={key:0,class:"mt-0.5 text-[11px] text-secondary"},tf={key:1,class:"mt-2 flex flex-col gap-1.5"},sf={class:"rounded-sm bg-sunken px-1.5 py-0.5 font-mono text-[10px] text-secondary"},nf={key:0,class:"font-mono text-[10px] text-muted"},of={key:1,class:"w-full text-[11px] text-secondary sm:w-auto"},lf={key:2,class:"mt-1 truncate font-mono text-[11px] text-muted"},rf={class:"flex shrink-0 items-center gap-2"},af=["disabled","onClick"],cf=["onClick"],uf=["disabled","onClick"],ff=["disabled","onClick"],df={key:0,class:"mt-3 flex flex-col gap-2 rounded-md border border-subtle bg-sunken px-4 py-4"},pf={class:"pv-eyebrow"},hf={key:0,class:"text-danger"},mf=["onUpdate:modelValue"],gf=["value"],vf=["value","onChange"],bf=["label"],yf=["value"],xf=["onUpdate:modelValue"],_f=["onUpdate:modelValue","type","placeholder"],wf={key:3,class:"text-[11px] text-muted"},Cf={class:"flex items-center gap-2"},Sf=["disabled","onClick"],kf={class:"border-t border-subtle px-5 py-4"},Ef={class:"flex flex-col gap-2 sm:flex-row"},Tf=["disabled"],Pf={key:0,class:"mt-2 text-xs font-medium text-danger"},Rs="pv_panel_token",Af={__name:"App",setup(e){const t=D(localStorage.getItem(Rs)||""),s=D(null),n=D(!1),o=D(!0),i=D({email:"",password:""}),l=D(""),r=D(!1),c=D("overview"),g=[{id:"overview",label:"Overview"},{id:"users",label:"Users"},{id:"organizations",label:"Organizations"},{id:"pocketbase",label:"PocketBase"},{id:"plugins",label:"Plugins"}];async function h(m){try{const u=await fetch("/api/me",{headers:{Authorization:m}});if(!u.ok)return!1;const f=await u.json();return f.role!=="superadmin"?!1:(s.value={id:f.id,email:f.email,role:f.role},!0)}catch{return!1}}async function y(m){t.value=m,localStorage.setItem(Rs,m),n.value=!0,Zn(),Ie(),mt(),Ut(),he()}async function R(){l.value="";const m=i.value.email.trim().toLowerCase();if(!m||!i.value.password){l.value="Enter your email and password.";return}r.value=!0;try{const u=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:m,password:i.value.password})}),f=await u.json().catch(()=>({}));if(!u.ok||!f.token){l.value="Invalid email or password.";return}if(!await h(f.token)){l.value="Access to this panel is restricted to superadmins.";return}i.value.password="",await y(f.token)}catch{l.value="Cannot reach the API server."}finally{r.value=!1}}function M(){Qn(),localStorage.removeItem(Rs),t.value="",s.value=null,n.value=!1}const q=D(null),U=D({url:"",adminEmail:"",adminPassword:""}),W=D(null),Y=D(""),V=D(""),X=D(!1),j=D(!1);function z(m){const u={Authorization:t.value};return m&&(u["Content-Type"]="application/json"),u}async function Ie(){try{const m=await fetch("/api/admin/pb-config",{headers:z()});if(!m.ok)return;const u=await m.json();q.value=u,U.value={url:u.url||"",adminEmail:u.adminEmail||"",adminPassword:""},W.value=u.probe||null}catch{}}async function De(){Y.value="",V.value="",j.value=!0;try{const m=await fetch("/api/admin/pb-config/test",{method:"POST",headers:z(!0),body:JSON.stringify(U.value)});W.value=await m.json()}catch{V.value="Could not run the test."}finally{j.value=!1}}async function Ge(){var m;if(Y.value="",V.value="",!U.value.url.trim()){V.value="A PocketBase URL is required.";return}X.value=!0;try{const u=await fetch("/api/admin/pb-config",{method:"PUT",headers:z(!0),body:JSON.stringify(U.value)}),f=await u.json().catch(()=>({}));if(!u.ok){V.value=f.error||"Could not save the connection.";return}q.value=f.config,W.value=((m=f.config)==null?void 0:m.probe)||null,U.value={url:f.config.url,adminEmail:f.config.adminEmail,adminPassword:""},Y.value=f.warning||"Connection saved."}catch{V.value="Could not reach the API server."}finally{X.value=!1}}const Le=D([]),Oe=D(""),de=D(""),qe=D(""),ke=D({}),be=D(""),Gt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},{label:"Countries",options:[{value:"49,14.1,54.9,24.2",label:"Poland"},{value:"50.5,3.2,53.7,7.3",label:"Netherlands"},{value:"47.2,5.8,55.1,15.1",label:"Germany"},{value:"41.3,-5.2,51.1,9.6",label:"France"},{value:"49.9,-8.7,59,1.8",label:"United Kingdom"},{value:"35.9,-9.6,43.8,3.4",label:"Spain"},{value:"36.6,6.6,47.1,18.6",label:"Italy"},{value:"24,-125,49.5,-66.5",label:"United States"}]}],me=Gt.flatMap(m=>m.options);function oe(m){const u=String(m||"").split(",").map(C=>C.trim());if(u.length!==4)return"";const f=u.map(Number);return f.some(C=>Number.isNaN(C))?"":f.join(",")}const J=D({});function Je(m){if(J.value[m])return"__custom__";const u=oe(ke.value[m]),f=u&&me.find(C=>oe(C.value)===u);return f?f.value:"__custom__"}function At(m,u){if(u==="__custom__"){J.value={...J.value,[m]:!0};return}J.value={...J.value,[m]:!1},ke.value[m]=u}const ye=D({name:"",baseURL:"",provider:""}),ge=D(""),_t=D(!1),tn=[{id:"apis-external",label:"APIs — External"},{id:"drives-external",label:"Drives — External"},{id:"drives-local",label:"Drives — Local"}],qt=D("apis-external");function wt(m){return m.category||"apis-external"}function Ot(m){return Le.value.filter(u=>wt(u)===m)}const Rt=Tn(()=>Ot(qt.value)),bs={builtin:"bg-success-tint text-success",external:"bg-warning-tint text-warning"},Ct={ok:"bg-success-tint text-success",degraded:"bg-warning-tint text-warning",down:"bg-danger-tint text-danger"};async function mt(){Oe.value="";try{const m=await fetch("/api/admin/plugins",{headers:z()});if(!m.ok){Oe.value="Could not load plugins.";return}const u=await m.json();Le.value=u.plugins||[];for(const f of Le.value)f.enabled&&!f.health&&a(f.name)}catch{Oe.value="Could not reach the API server."}}async function a(m){try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(m)}/health`,{method:"POST",headers:z()}),f=await u.json().catch(()=>({}));if(u.ok&&f.health){const C=p(m);C&&(C.health=f.health)}}catch{}}function p(m){return Le.value.find(u=>u.name===m)}async function v(m){be.value=m.name,de.value="";try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(m.name)}`,{method:"PUT",headers:z(!0),body:JSON.stringify({enabled:!m.enabled})}),f=await u.json().catch(()=>({}));u.ok?f.warning&&(de.value=`${m.name}: ${f.warning}`):de.value=f.error||"Could not update the plugin.",await mt()}finally{be.value=""}}function w(m){qe.value=qe.value===m.name?"":m.name;const u={...m.config||{}};for(const f of m.configFields||[])u[f.key]===void 0&&f.default&&(u[f.key]=f.default);ke.value=u,J.value={}}async function _(m){be.value=m.name,de.value="";try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(m.name)}`,{method:"PUT",headers:z(!0),body:JSON.stringify({config:ke.value})}),f=await u.json().catch(()=>({}));u.ok?(de.value=f.warning?`${m.name}: ${f.warning}`:"Configuration saved.",qe.value=""):de.value=f.error||"Could not save the configuration.",await mt()}finally{be.value=""}}async function x(m){be.value=m.name,de.value="";try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(m.name)}/health`,{method:"POST",headers:z()}),f=await u.json().catch(()=>({}));if(u.ok&&f.health){const C=p(m.name);C&&(C.health=f.health)}else de.value=f.error||"Health check failed."}finally{be.value=""}}async function P(m){if(m.kind==="external"){be.value=m.name;try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(m.name)}`,{method:"DELETE",headers:z()});if(!u.ok){const f=await u.json().catch(()=>({}));de.value=f.error||"Could not remove the plugin."}await mt()}finally{be.value=""}}}async function k(){if(ge.value="",!ye.value.name.trim()||!ye.value.baseURL.trim()){ge.value="Name and base URL are required.";return}_t.value=!0;try{const m=await fetch("/api/admin/plugins",{method:"POST",headers:z(!0),body:JSON.stringify(ye.value)}),u=await m.json().catch(()=>({}));if(!m.ok){ge.value=u.error||"Could not register the plugin.";return}ye.value={name:"",baseURL:"",provider:""},de.value="External plugin registered.",await mt()}catch{ge.value="Could not reach the API server."}finally{_t.value=!1}}const S=D([]),b=D([]),I=D(""),A=[{value:"user",label:"User"},{value:"admin",label:"Admin"},{value:"superadmin",label:"Superadmin"}],$={user:"User",admin:"Admin",superadmin:"Superadmin"},L={user:"bg-sunken text-secondary",admin:"bg-warning-tint text-warning",superadmin:"bg-success-tint text-success"},K=Tn(()=>{const m={};for(const u of S.value)u.organization&&(m[u.organization]=(m[u.organization]||0)+1);return m});function G(m,u){if(!m)return u;if(m.error)return m.error;if(m.data&&typeof m.data=="object"){const f=[];for(const C in m.data)m.data[C]&&m.data[C].message&&f.push(`${C}: ${m.data[C].message}`);if(f.length)return f.join("; ")}return m.message||u}const F=D({email:"",password:"",role:"user",organization:""}),ee=D(""),ae=D(""),Ee=D(!1),ue=D(""),pe=D({}),it=D(""),ie=D("");async function he(){I.value="";try{const m=await fetch("/api/users",{headers:z()}),u=await m.json().catch(()=>({}));if(!m.ok){I.value=G(u,"Could not load users.");return}S.value=u.users||[]}catch{I.value="Could not reach the API server."}}async function ys(){ee.value="",ae.value="";const m=F.value.email.trim().toLowerCase();if(!m||!m.includes("@")){ee.value="A valid email is required.";return}if(F.value.password.length<8){ee.value="Password must be at least 8 characters.";return}Ee.value=!0;try{const u=await fetch("/api/users",{method:"POST",headers:z(!0),body:JSON.stringify({email:m,password:F.value.password,role:F.value.role,organization:F.value.organization})}),f=await u.json().catch(()=>({}));if(!u.ok){ee.value=G(f,"Could not create the user.");return}F.value={email:"",password:"",role:"user",organization:""},ae.value=`Created ${f.user?f.user.email:"user"}.`,await he()}catch{ee.value="Could not reach the API server."}finally{Ee.value=!1}}function xs(m){ie.value="",ue.value=ue.value===m.id?"":m.id,pe.value={email:m.email,role:m.role,organization:m.organization||"",verified:!!m.verified,password:""}}async function zi(m){ie.value="",it.value=m.id;try{const u={},f=pe.value;if(f.email.trim().toLowerCase()!==m.email&&(u.email=f.email.trim().toLowerCase()),f.role!==m.role&&(u.role=f.role),(f.organization||"")!==(m.organization||"")&&(u.organization=f.organization||""),f.verified!==!!m.verified&&(u.verified=f.verified),f.password&&(u.password=f.password),Object.keys(u).length===0){ie.value="No changes to save.";return}const C=await fetch(`/api/users/${encodeURIComponent(m.id)}`,{method:"PATCH",headers:z(!0),body:JSON.stringify(u)}),fe=await C.json().catch(()=>({}));if(!C.ok){ie.value=G(fe,"Could not update the user.");return}ie.value=`Updated ${m.email}.`,ue.value="",await he()}catch{ie.value="Could not reach the API server."}finally{it.value=""}}async function Wi(m){if(m.id!==(s.value&&s.value.id)&&confirm(`Delete user ${m.email}? This cannot be undone.`)){ie.value="",it.value=m.id;try{const u=await fetch(`/api/users/${encodeURIComponent(m.id)}`,{method:"DELETE",headers:z()}),f=await u.json().catch(()=>({}));if(!u.ok){ie.value=G(f,"Could not delete the user.");return}ie.value=`Deleted ${m.email}.`,ue.value===m.id&&(ue.value=""),await he()}catch{ie.value="Could not reach the API server."}finally{it.value=""}}}const _s=D(""),It=D(""),ws=D(""),Cs=D(!1),lt=D(""),Ss=D(""),Mt=D(""),Me=D("");async function Ut(){try{const m=await fetch("/api/orgs",{headers:z()});if(!m.ok)return;const u=await m.json().catch(()=>({}));b.value=u.organizations||[]}catch{}}async function Gn(){It.value="",ws.value="";const m=_s.value.trim();if(!m){It.value="An organization name is required.";return}Cs.value=!0;try{const u=await fetch("/api/orgs",{method:"POST",headers:z(!0),body:JSON.stringify({name:m})}),f=await u.json().catch(()=>({}));if(!u.ok){It.value=G(f,"Could not create the organization.");return}_s.value="",ws.value=`Created ${f.organization?f.organization.name:"organization"}.`,await Ut()}catch{It.value="Could not reach the API server."}finally{Cs.value=!1}}function Gi(m){Me.value="",lt.value=lt.value===m.id?"":m.id,Ss.value=m.name}async function qn(m){Me.value="";const u=Ss.value.trim();if(!u){Me.value="An organization name is required.";return}if(u===m.name){lt.value="";return}Mt.value=m.id;try{const f=await fetch(`/api/orgs/${encodeURIComponent(m.id)}`,{method:"PATCH",headers:z(!0),body:JSON.stringify({name:u})}),C=await f.json().catch(()=>({}));if(!f.ok){Me.value=G(C,"Could not rename the organization.");return}Me.value=`Renamed to ${u}.`,lt.value="",await Ut(),await he()}catch{Me.value="Could not reach the API server."}finally{Mt.value=""}}async function qi(m){const u=K.value[m.id]||0;if(u>0){Me.value=`${m.name} still has ${u} member${u===1?"":"s"}; reassign or remove them first.`;return}if(confirm(`Delete organization ${m.name}?`)){Me.value="",Mt.value=m.id;try{const f=await fetch(`/api/orgs/${encodeURIComponent(m.id)}`,{method:"DELETE",headers:z()}),C=await f.json().catch(()=>({}));if(!f.ok){Me.value=G(C,"Could not delete the organization.");return}Me.value=`Deleted ${m.name}.`,lt.value===m.id&&(lt.value=""),await Ut()}catch{Me.value="Could not reach the API server."}finally{Mt.value=""}}}const sn=D(null),ks=D(null),$t=D({apiServer:{status:"checking",detail:""},pocketBase:{status:"checking",detail:""},webApp:{status:"checking",detail:""}});let Es=null;const Ji=[{key:"apiServer",label:"API server"},{key:"pocketBase",label:"PocketBase"},{key:"webApp",label:"Web App"}],Jn={checking:{label:"checking",cls:"bg-sunken text-secondary"},ok:{label:"operational",cls:"bg-success-tint text-success"},down:{label:"unreachable",cls:"bg-danger-tint text-danger"},unreachable:{label:"unreachable",cls:"bg-danger-tint text-danger"}};function Yn(m){const u=[];return m.httpStatus&&u.push("HTTP "+m.httpStatus),m.url&&u.push(m.url),typeof m.latencyMs=="number"&&u.push(m.latencyMs+"ms"),u.join(" · ")}async function Xn(){var m,u;try{const f=await fetch("/api/status");if(!f.ok)throw new Error("status "+f.status);const C=await f.json(),fe=C.apiServer||{};ks.value=fe.devices??0,$t.value={apiServer:{status:"ok",detail:""},pocketBase:{status:((m=C.pocketBase)==null?void 0:m.status)==="ok"?"ok":"down",detail:Yn(C.pocketBase||{})},webApp:{status:((u=C.webApp)==null?void 0:u.status)==="ok"?"ok":"down",detail:Yn(C.webApp||{})}}}catch{ks.value=null,$t.value={apiServer:{status:"unreachable",detail:""},pocketBase:{status:"unreachable",detail:""},webApp:{status:"unreachable",detail:""}}}sn.value=new Date}function Zn(){Xn(),clearInterval(Es),Es=setInterval(Xn,1e4)}function Qn(){clearInterval(Es),Es=null}gi(async()=>{t.value&&await h(t.value)?(n.value=!0,Zn(),Ie(),mt(),Ut(),he()):t.value&&(localStorage.removeItem(Rs),t.value=""),o.value=!1}),Kn(()=>Qn());const Yi=[{method:"POST",path:"/api/auth/login",desc:"Exchange email + password for a session (via PocketBase)"},{method:"GET",path:"/api/auth/validate",desc:"Validate the current session token"},{method:"GET",path:"/api/me",desc:"Caller's id, email, role, and organization from their token"},{method:"GET",path:"/api/preferences",desc:"Read the caller's saved settings blob"},{method:"PUT",path:"/api/preferences",desc:"Persist the caller's settings onto their user record"},{method:"GET",path:"/api/devices",desc:"List connected devices and last-known state"},{method:"GET",path:"/api/devices/{id}/track",desc:"GPS track history for a device"},{method:"POST",path:"/api/devices/{id}/command",desc:"Send a command down to a device"},{method:"DELETE",path:"/api/devices/{id}",desc:"Forget a device's stored state"},{method:"GET",path:"/ws/ui",desc:"Live telemetry stream (WebSocket)"}],Xi=[{method:"GET",path:"/api/users",desc:"List users (admin: own org · superadmin: all)"},{method:"POST",path:"/api/users",desc:"Create a user {email, password, role, organization?}"},{method:"PATCH",path:"/api/users/{id}",desc:"Edit a user (role/org changes are scope-checked)"},{method:"DELETE",path:"/api/users/{id}",desc:"Delete a user (not self; admins in-org only)"},{method:"GET",path:"/api/orgs",desc:"List organizations (admin: own · superadmin: all)"},{method:"POST",path:"/api/orgs",desc:"Create an organization {name} (superadmin)"},{method:"PATCH",path:"/api/orgs/{id}",desc:"Rename an organization (superadmin)"},{method:"DELETE",path:"/api/orgs/{id}",desc:"Delete an empty organization (superadmin)"},{method:"GET",path:"/api/admin/pb-config",desc:"Read the PocketBase connection + live probe (superadmin)"},{method:"POST",path:"/api/admin/pb-config/test",desc:"Test a candidate connection without applying (superadmin)"},{method:"PUT",path:"/api/admin/pb-config",desc:"Update + persist the PocketBase connection (superadmin)"},{method:"GET",path:"/api/admin/plugins",desc:"List plugins + state + last health (superadmin)"},{method:"POST",path:"/api/admin/plugins",desc:"Register an external plugin {name, baseURL} (superadmin)"},{method:"PUT",path:"/api/admin/plugins/{name}",desc:"Enable/disable + configure a plugin (superadmin)"},{method:"DELETE",path:"/api/admin/plugins/{name}",desc:"Remove an external plugin (superadmin)"},{method:"POST",path:"/api/admin/plugins/{name}/health",desc:"Run a plugin health check (superadmin)"}],Zi=[{method:"GET",path:"/ws/device?id={id}",desc:"Device telemetry uplink (WebSocket)"},{method:"POST",path:"/api/telemetry?id={id}",desc:"Push a single telemetry event over HTTP"},{method:"GET",path:"/healthz",desc:"Readiness probe"}];return(m,u)=>(E(),T("div",Da,[d("div",La,[u[25]||(u[25]=jr('
PilotVault
API server
',3)),n.value&&s.value?(E(),T("span",Na,O(s.value.email),1)):H("",!0),n.value?(E(),T("button",{key:1,class:"pv-btn-sec pv-btn-sm",onClick:M},"Sign out")):H("",!0),d("button",{class:"pv-btn-sec pv-btn-sm",title:Qt(hs)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:u[0]||(u[0]=(...f)=>Qt(Uo)&&Qt(Uo)(...f))},[Qt(hs)==="dark"?(E(),T("svg",Va,[...u[22]||(u[22]=[d("circle",{cx:"12",cy:"12",r:"4"},null,-1),d("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(E(),T("svg",Ha,[...u[23]||(u[23]=[d("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"},null,-1)])])),u[24]||(u[24]=Ne(" Theme ",-1))],8,Fa)]),o.value?(E(),T("div",Ba,[...u[26]||(u[26]=[d("span",{class:"pv-eyebrow"},"Checking session…",-1)])])):n.value?(E(),T(se,{key:2},[d("div",Ja,[(E(),T(se,null,xe(g,f=>d("button",{key:f.id,class:Ue(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",c.value===f.id?"bg-brand text-on-brand":"text-secondary hover:text-primary"]),onClick:C=>c.value=f.id},O(f.label),11,Ya)),64))]),le(d("div",Xa,[d("div",Za,[d("div",Qa,[u[30]||(u[30]=d("div",{class:"text-base font-semibold text-primary"},"Status",-1)),d("span",ec,O(sn.value?"checked "+sn.value.toLocaleTimeString():"—"),1)]),d("div",null,[(E(),T(se,null,xe(Ji,f=>d("div",{key:f.key,class:"flex items-center justify-between gap-3 border-t border-subtle px-5 py-3.5 first:border-t-0"},[d("div",tc,[d("div",sc,O(f.label),1),$t.value[f.key].detail?(E(),T("div",nc,O($t.value[f.key].detail),1)):H("",!0)]),d("span",{class:Ue(["inline-flex shrink-0 items-center gap-1.5 rounded-sm px-2.5 py-1 font-mono text-xs font-medium",Jn[$t.value[f.key].status].cls])},[u[31]||(u[31]=d("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),Ne(" "+O(Jn[$t.value[f.key].status].label),1)],2)])),64)),d("div",oc,[u[32]||(u[32]=d("div",{class:"text-sm font-semibold text-primary"},"Devices",-1)),d("span",ic,O(ks.value===null?"—":ks.value+" online"),1)])])]),je(gn,{title:"Client API",auth:"PocketBase session",endpoints:Yi}),je(gn,{title:"Management API",auth:"Admin · superadmin",endpoints:Xi}),je(gn,{title:"Device API",auth:"Device uplink",endpoints:Zi})],512),[[Xt,c.value==="overview"]]),le(d("div",lc,[d("div",rc,[u[38]||(u[38]=d("div",{class:"border-b border-subtle px-5 py-4"},[d("div",{class:"text-base font-semibold text-primary"},"Add user"),d("span",{class:"pv-eyebrow"},"Create an account")],-1)),d("div",ac,[d("div",cc,[d("label",uc,[u[33]||(u[33]=d("span",{class:"pv-eyebrow"},"Email",-1)),le(d("input",{"onUpdate:modelValue":u[3]||(u[3]=f=>F.value.email=f),type:"email",class:"pv-input",placeholder:"pilot@pilotvault.local",autocomplete:"off",spellcheck:"false"},null,512),[[_e,F.value.email]])]),d("label",fc,[u[34]||(u[34]=d("span",{class:"pv-eyebrow"},"Password",-1)),le(d("input",{"onUpdate:modelValue":u[4]||(u[4]=f=>F.value.password=f),type:"password",class:"pv-input",placeholder:"min. 8 characters",autocomplete:"new-password"},null,512),[[_e,F.value.password]])])]),d("div",dc,[d("label",pc,[u[35]||(u[35]=d("span",{class:"pv-eyebrow"},"Role",-1)),le(d("select",{"onUpdate:modelValue":u[5]||(u[5]=f=>F.value.role=f),class:"pv-input"},[(E(),T(se,null,xe(A,f=>d("option",{key:f.value,value:f.value},O(f.label),9,hc)),64))],512),[[Lt,F.value.role]])]),d("label",mc,[u[37]||(u[37]=d("span",{class:"pv-eyebrow"},"Organization",-1)),le(d("select",{"onUpdate:modelValue":u[6]||(u[6]=f=>F.value.organization=f),class:"pv-input"},[u[36]||(u[36]=d("option",{value:""},"— none —",-1)),(E(!0),T(se,null,xe(b.value,f=>(E(),T("option",{key:f.id,value:f.id},O(f.name),9,gc))),128))],512),[[Lt,F.value.organization]])])]),ee.value?(E(),T("p",vc,O(ee.value),1)):ae.value?(E(),T("p",bc,O(ae.value),1)):H("",!0),d("div",null,[d("button",{class:"pv-btn",disabled:Ee.value,onClick:ys},O(Ee.value?"Creating…":"Create user"),9,yc)])])]),d("div",xc,[d("div",_c,[d("div",null,[u[39]||(u[39]=d("div",{class:"text-base font-semibold text-primary"},"Users",-1)),d("span",wc,O(S.value.length)+" total",1)]),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:he},"Refresh")]),d("div",Cc,[I.value?(E(),T("p",Sc,O(I.value),1)):H("",!0),ie.value?(E(),T("p",kc,O(ie.value),1)):H("",!0),!S.value.length&&!I.value?(E(),T("p",Ec,"No users yet.")):H("",!0),(E(!0),T(se,null,xe(S.value,f=>(E(),T("div",{key:f.id,class:"border-t border-subtle px-5 py-4 first:border-t-0"},[d("div",Tc,[d("div",Pc,[d("div",Ac,[d("span",Oc,O(f.email),1),d("span",{class:Ue(["rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-medium uppercase tracking-wider",L[f.role]])},O($[f.role]||f.role),3),f.id===(s.value&&s.value.id)?(E(),T("span",Rc,"you")):H("",!0),f.verified?H("",!0):(E(),T("span",Ic,"unverified"))]),d("div",Mc,O(f.organizationName||(f.organization?f.organization:"no organization")),1)]),d("div",Uc,[d("button",{class:"pv-btn-sec pv-btn-sm",onClick:C=>xs(f)},O(ue.value===f.id?"Close":"Edit"),9,$c),f.id!==(s.value&&s.value.id)?(E(),T("button",{key:0,class:"pv-btn-sec pv-btn-sm !text-danger",disabled:it.value===f.id,onClick:C=>Wi(f)}," Delete ",8,jc)):H("",!0)])]),ue.value===f.id?(E(),T("div",Dc,[d("div",Lc,[d("label",Nc,[u[40]||(u[40]=d("span",{class:"pv-eyebrow"},"Email",-1)),le(d("input",{"onUpdate:modelValue":u[7]||(u[7]=C=>pe.value.email=C),type:"email",class:"pv-input",autocomplete:"off",spellcheck:"false"},null,512),[[_e,pe.value.email]])]),d("label",Fc,[u[41]||(u[41]=d("span",{class:"pv-eyebrow"},"New password",-1)),le(d("input",{"onUpdate:modelValue":u[8]||(u[8]=C=>pe.value.password=C),type:"password",class:"pv-input",placeholder:"leave blank to keep current",autocomplete:"new-password"},null,512),[[_e,pe.value.password]])])]),d("div",Vc,[d("label",Hc,[u[42]||(u[42]=d("span",{class:"pv-eyebrow"},"Role",-1)),le(d("select",{"onUpdate:modelValue":u[9]||(u[9]=C=>pe.value.role=C),class:"pv-input",disabled:f.id===(s.value&&s.value.id)},[(E(),T(se,null,xe(A,C=>d("option",{key:C.value,value:C.value},O(C.label),9,Kc)),64))],8,Bc),[[Lt,pe.value.role]]),f.id===(s.value&&s.value.id)?(E(),T("span",zc,"You cannot change your own role.")):H("",!0)]),d("label",Wc,[u[44]||(u[44]=d("span",{class:"pv-eyebrow"},"Organization",-1)),le(d("select",{"onUpdate:modelValue":u[10]||(u[10]=C=>pe.value.organization=C),class:"pv-input"},[u[43]||(u[43]=d("option",{value:""},"— none —",-1)),(E(!0),T(se,null,xe(b.value,C=>(E(),T("option",{key:C.id,value:C.id},O(C.name),9,Gc))),128))],512),[[Lt,pe.value.organization]])])]),d("label",qc,[le(d("input",{"onUpdate:modelValue":u[11]||(u[11]=C=>pe.value.verified=C),type:"checkbox",class:"h-4 w-4"},null,512),[[Vi,pe.value.verified]]),u[45]||(u[45]=d("span",{class:"text-sm text-primary"},"Verified",-1))]),d("div",Jc,[d("button",{class:"pv-btn pv-btn-sm",disabled:it.value===f.id,onClick:C=>zi(f)},"Save changes",8,Yc),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:u[12]||(u[12]=C=>ue.value="")},"Cancel")])])):H("",!0)]))),128))])])],512),[[Xt,c.value==="users"]]),le(d("div",Xc,[d("div",Zc,[u[46]||(u[46]=d("div",{class:"border-b border-subtle px-5 py-4"},[d("div",{class:"text-base font-semibold text-primary"},"Add organization"),d("span",{class:"pv-eyebrow"},"Create a tenant")],-1)),d("div",Qc,[d("div",eu,[le(d("input",{"onUpdate:modelValue":u[13]||(u[13]=f=>_s.value=f),class:"pv-input flex-1",placeholder:"Acme Aerial Ltd.",autocomplete:"off",spellcheck:"false",onKeyup:Io(Gn,["enter"])},null,544),[[_e,_s.value]]),d("button",{class:"pv-btn",disabled:Cs.value,onClick:Gn},O(Cs.value?"Creating…":"Create"),9,tu)]),It.value?(E(),T("p",su,O(It.value),1)):ws.value?(E(),T("p",nu,O(ws.value),1)):H("",!0)])]),d("div",ou,[d("div",iu,[d("div",null,[u[47]||(u[47]=d("div",{class:"text-base font-semibold text-primary"},"Organizations",-1)),d("span",lu,O(b.value.length)+" total",1)]),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:Ut},"Refresh")]),d("div",ru,[Me.value?(E(),T("p",au,O(Me.value),1)):H("",!0),b.value.length?H("",!0):(E(),T("p",cu,"No organizations yet.")),(E(!0),T(se,null,xe(b.value,f=>(E(),T("div",{key:f.id,class:"border-t border-subtle px-5 py-4 first:border-t-0"},[d("div",uu,[d("div",fu,[d("div",du,O(f.name),1),d("div",pu,O(K.value[f.id]||0)+" member"+O((K.value[f.id]||0)===1?"":"s"),1)]),d("div",hu,[d("button",{class:"pv-btn-sec pv-btn-sm",onClick:C=>Gi(f)},O(lt.value===f.id?"Close":"Rename"),9,mu),d("button",{class:"pv-btn-sec pv-btn-sm !text-danger",disabled:Mt.value===f.id||(K.value[f.id]||0)>0,title:(K.value[f.id]||0)>0?"Reassign or remove members first":"Delete organization",onClick:C=>qi(f)}," Delete ",8,gu)])]),lt.value===f.id?(E(),T("div",vu,[d("label",bu,[u[48]||(u[48]=d("span",{class:"pv-eyebrow"},"Name",-1)),le(d("input",{"onUpdate:modelValue":u[14]||(u[14]=C=>Ss.value=C),class:"pv-input",autocomplete:"off",spellcheck:"false",onKeyup:Io(C=>qn(f),["enter"])},null,40,yu),[[_e,Ss.value]])]),d("div",xu,[d("button",{class:"pv-btn pv-btn-sm",disabled:Mt.value===f.id,onClick:C=>qn(f)},"Save",8,_u),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:u[15]||(u[15]=C=>lt.value="")},"Cancel")])])):H("",!0)]))),128))])])],512),[[Xt,c.value==="organizations"]]),le(d("div",wu,[d("div",Cu,[d("div",Su,[u[50]||(u[50]=d("div",null,[d("div",{class:"text-base font-semibold text-primary"},"PocketBase connection"),d("span",{class:"pv-eyebrow"},"Settings")],-1)),W.value?(E(),T("span",{key:0,class:Ue(["inline-flex shrink-0 items-center gap-1.5 rounded-sm px-2.5 py-1 font-mono text-xs font-medium",W.value.reachable?W.value.superuser?"bg-success-tint text-success":"bg-warning-tint text-warning":"bg-danger-tint text-danger"])},[u[49]||(u[49]=d("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),Ne(" "+O(W.value.reachable?W.value.superuser?"connected":"reachable":"unreachable"),1)],2)):H("",!0)]),d("div",ku,[d("label",Eu,[u[51]||(u[51]=d("span",{class:"pv-eyebrow"},"PocketBase URL",-1)),le(d("input",{"onUpdate:modelValue":u[16]||(u[16]=f=>U.value.url=f),class:"pv-input",placeholder:"http://10.2.1.10:8026",spellcheck:"false"},null,512),[[_e,U.value.url]])]),d("label",Tu,[u[52]||(u[52]=d("span",{class:"pv-eyebrow"},"Service account email",-1)),le(d("input",{"onUpdate:modelValue":u[17]||(u[17]=f=>U.value.adminEmail=f),class:"pv-input",placeholder:"admin@pilotvault.local",autocomplete:"off",spellcheck:"false"},null,512),[[_e,U.value.adminEmail]])]),d("label",Pu,[u[53]||(u[53]=d("span",{class:"pv-eyebrow"},"Service account password",-1)),le(d("input",{"onUpdate:modelValue":u[18]||(u[18]=f=>U.value.adminPassword=f),type:"password",class:"pv-input",autocomplete:"new-password",placeholder:q.value&&q.value.adminConfigured?"leave blank to keep current":"set a password"},null,8,Au),[[_e,U.value.adminPassword]])]),W.value?(E(),T("div",Ou,[Ne(" health: "+O(W.value.reachable?"ok":"down"),1),W.value.latencyMs?(E(),T("span",Ru," · "+O(W.value.latencyMs)+"ms",1)):H("",!0),Ne(" · superuser auth: "+O(W.value.superuser?"ok":"—"),1),W.value.detail?(E(),T("span",Iu," · "+O(W.value.detail),1)):H("",!0)])):H("",!0),V.value?(E(),T("p",Mu,O(V.value),1)):Y.value?(E(),T("p",Uu,O(Y.value),1)):H("",!0),d("div",$u,[d("button",{class:"pv-btn",disabled:X.value,onClick:Ge},O(X.value?"Saving…":"Save connection"),9,ju),d("button",{class:"pv-btn-sec",disabled:j.value,onClick:De},O(j.value?"Testing…":"Test connection"),9,Du)]),u[54]||(u[54]=d("p",{class:"text-[11px] text-muted"}," The service account is used only for user & organization management. Changing the URL repoints the whole API Server at a new PocketBase and may sign you out. ",-1))])])],512),[[Xt,c.value==="pocketbase"]]),le(d("div",Lu,[d("div",Nu,[d("div",{class:"flex items-center justify-between border-b border-subtle px-5 py-4"},[u[55]||(u[55]=d("div",null,[d("div",{class:"text-base font-semibold text-primary"},"Plugins"),d("span",{class:"pv-eyebrow"},"External integrations")],-1)),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:mt},"Refresh")]),d("div",Fu,[Oe.value?(E(),T("p",Vu,O(Oe.value),1)):H("",!0),de.value?(E(),T("p",Hu,O(de.value),1)):H("",!0),!Le.value.length&&!Oe.value?(E(),T("p",Bu,"No plugins registered yet.")):H("",!0),Le.value.length?(E(),T("div",Ku,[(E(),T(se,null,xe(tn,f=>d("button",{key:f.id,class:Ue(["-mb-px whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",qt.value===f.id?"border-brand text-primary":"border-transparent text-secondary hover:text-primary"]),onClick:C=>qt.value=f.id},O(f.label),11,zu)),64))])):H("",!0),Le.value.length&&!Rt.value.length?(E(),T("p",Wu,"No plugins in this category.")):H("",!0),(E(!0),T(se,null,xe(Rt.value,f=>(E(),T("div",{key:f.name,class:"border-t border-subtle px-5 py-4 first:border-t-0"},[d("div",Gu,[d("div",qu,[d("div",Ju,[d("span",Yu,O(f.name),1),d("span",{class:Ue(["rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-medium uppercase tracking-wider",bs[f.kind]])},O(f.kind),3),f.health?(E(),T("span",{key:0,class:Ue(["inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-medium",Ct[f.health.status]]),title:f.health.detail||""},[u[56]||(u[56]=d("span",{class:"h-1 w-1 rounded-full bg-current"},null,-1)),Ne(O(f.health.status),1),f.health.latencyMs?(E(),T("span",Zu," · "+O(f.health.latencyMs)+"ms",1)):H("",!0)],10,Xu)):H("",!0)]),d("div",Qu,O(f.provider)+" · v"+O(f.version)+" · "+O(f.authType),1),f.health&&f.health.detail?(E(),T("div",ef,O(f.health.detail),1)):H("",!0),f.capabilities&&f.capabilities.length?(E(),T("div",tf,[u[57]||(u[57]=d("div",{class:"pv-eyebrow"},"Capabilities",-1)),(E(!0),T(se,null,xe(f.capabilities,C=>(E(),T("div",{key:C.id,class:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5"},[d("span",sf,O(C.id),1),C.method||C.endpoint?(E(),T("span",nf,O(C.method)+" "+O(C.endpoint),1)):H("",!0),C.description?(E(),T("span",of,O(C.description),1)):H("",!0)]))),128))])):H("",!0),f.baseURL?(E(),T("div",lf,O(f.baseURL),1)):H("",!0)]),d("div",rf,[d("button",{class:Ue(["pv-btn-sec pv-btn-sm",f.enabled?"!border-transparent !bg-success-tint !text-success":""]),disabled:be.value===f.name,onClick:C=>v(f)},[d("span",{class:Ue(["h-1.5 w-1.5 rounded-full",f.enabled?"bg-success":"bg-muted"])},null,2),Ne(" "+O(f.enabled?"Enabled":"Disabled"),1)],10,af),f.configFields&&f.configFields.length?(E(),T("button",{key:0,class:"pv-btn-sec pv-btn-sm",onClick:C=>w(f)},"Configure",8,cf)):H("",!0),d("button",{class:"pv-btn-sec pv-btn-sm",disabled:be.value===f.name,onClick:C=>x(f)},"Check",8,uf),f.kind==="external"?(E(),T("button",{key:1,class:"pv-btn-sec pv-btn-sm !text-danger",disabled:be.value===f.name,onClick:C=>P(f)},"Remove",8,ff)):H("",!0)])]),qe.value===f.name?(E(),T("div",df,[(E(!0),T(se,null,xe(f.configFields,C=>(E(),T("label",{key:C.key,class:"flex flex-col gap-1"},[d("span",pf,[Ne(O(C.label),1),C.required?(E(),T("span",hf," *")):H("",!0)]),C.type==="select"?le((E(),T("select",{key:0,"onUpdate:modelValue":fe=>ke.value[C.key]=fe,class:"pv-input"},[(E(!0),T(se,null,xe(C.options,fe=>(E(),T("option",{key:fe.value,value:fe.value},O(fe.label),9,gf))),128))],8,mf)),[[Lt,ke.value[C.key]]]):C.type==="bbox"?(E(),T(se,{key:1},[d("select",{value:Je(C.key),class:"pv-input",onChange:fe=>At(C.key,fe.target.value)},[(E(),T(se,null,xe(Gt,fe=>d("optgroup",{key:fe.label,label:fe.label},[(E(!0),T(se,null,xe(fe.options,nn=>(E(),T("option",{key:nn.value,value:nn.value},O(nn.label),9,yf))),128))],8,bf)),64)),u[58]||(u[58]=d("option",{value:"__custom__"},"Custom…",-1))],40,vf),Je(C.key)==="__custom__"?le((E(),T("input",{key:0,"onUpdate:modelValue":fe=>ke.value[C.key]=fe,type:"text",class:"pv-input font-mono",autocomplete:"off",placeholder:"50.5,3.2,53.7,7.3"},null,8,xf)),[[_e,ke.value[C.key]]]):H("",!0)],64)):le((E(),T("input",{key:2,"onUpdate:modelValue":fe=>ke.value[C.key]=fe,type:C.secret||C.type==="password"?"password":C.type==="number"?"number":"text",class:"pv-input",autocomplete:"off",placeholder:C.help||""},null,8,_f)),[[va,ke.value[C.key]]]),C.help?(E(),T("span",wf,O(C.help),1)):H("",!0)]))),128)),d("div",Cf,[d("button",{class:"pv-btn pv-btn-sm",disabled:be.value===f.name,onClick:C=>_(f)},"Save configuration",8,Sf),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:u[19]||(u[19]=C=>qe.value="")},"Cancel")])])):H("",!0)]))),128)),d("div",kf,[u[59]||(u[59]=d("div",{class:"pv-eyebrow mb-2"},"Register external plugin",-1)),d("div",Ef,[le(d("input",{"onUpdate:modelValue":u[20]||(u[20]=f=>ye.value.name=f),class:"pv-input sm:w-40",placeholder:"name",autocomplete:"off",spellcheck:"false"},null,512),[[_e,ye.value.name]]),le(d("input",{"onUpdate:modelValue":u[21]||(u[21]=f=>ye.value.baseURL=f),class:"pv-input flex-1",placeholder:"https://plugin.example.com",autocomplete:"off",spellcheck:"false"},null,512),[[_e,ye.value.baseURL]]),d("button",{class:"pv-btn",disabled:_t.value,onClick:k},O(_t.value?"Adding…":"Add"),9,Tf)]),ge.value?(E(),T("p",Pf,O(ge.value),1)):H("",!0),u[60]||(u[60]=d("p",{class:"mt-2 text-[11px] text-muted"},[Ne(" A remote service that answers "),d("span",{class:"font-mono"},"GET /health"),Ne(" and "),d("span",{class:"font-mono"},"GET /manifest"),Ne(" — added at runtime, no rebuild. ")],-1))])])])],512),[[Xt,c.value==="plugins"]])],64)):(E(),T("div",Ka,[u[29]||(u[29]=d("div",{class:"border-b border-subtle px-5 py-4"},[d("div",{class:"text-base font-semibold text-primary"},"Sign in"),d("span",{class:"pv-eyebrow"},"Superadmin access only")],-1)),d("form",{class:"flex flex-col gap-3 px-5 py-5",onSubmit:_a(R,["prevent"])},[d("label",za,[u[27]||(u[27]=d("span",{class:"pv-eyebrow"},"Email",-1)),le(d("input",{"onUpdate:modelValue":u[1]||(u[1]=f=>i.value.email=f),type:"email",autocomplete:"username",class:"pv-input",placeholder:"superadmin@pilotvault.local"},null,512),[[_e,i.value.email]])]),d("label",Wa,[u[28]||(u[28]=d("span",{class:"pv-eyebrow"},"Password",-1)),le(d("input",{"onUpdate:modelValue":u[2]||(u[2]=f=>i.value.password=f),type:"password",autocomplete:"current-password",class:"pv-input",placeholder:"••••••••"},null,512),[[_e,i.value.password]])]),l.value?(E(),T("p",Ga,O(l.value),1)):H("",!0),d("button",{type:"submit",class:"pv-btn mt-1",disabled:r.value},O(r.value?"Signing in…":"Sign in"),9,qa)],32)])),u[61]||(u[61]=d("p",{class:"text-center font-mono text-[11px] text-muted"}," PilotVault — live drone telemetry, command & control. ",-1))]))}};ka(Af).mount("#app"); diff --git a/API Server/internal/api/dist/assets/index-CwiTp2Sb.js b/API Server/internal/api/dist/assets/index-CwiTp2Sb.js new file mode 100644 index 0000000..5162385 --- /dev/null +++ b/API Server/internal/api/dist/assets/index-CwiTp2Sb.js @@ -0,0 +1,17 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function s(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(l){if(l.ep)return;l.ep=!0;const o=s(l);fetch(l.href,o)}})();/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function An(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ne={},Nt=[],tt=()=>{},Ul=()=>!1,Ks=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),zs=e=>e.startsWith("onUpdate:"),Se=Object.assign,On=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},Qo=Object.prototype.hasOwnProperty,Q=(e,t)=>Qo.call(e,t),N=Array.isArray,Ft=e=>gs(e)==="[object Map]",Wt=e=>gs(e)==="[object Set]",el=e=>gs(e)==="[object Date]",B=e=>typeof e=="function",ce=e=>typeof e=="string",st=e=>typeof e=="symbol",te=e=>e!==null&&typeof e=="object",$l=e=>(te(e)||B(e))&&B(e.then)&&B(e.catch),jl=Object.prototype.toString,gs=e=>jl.call(e),ei=e=>gs(e).slice(8,-1),Ll=e=>gs(e)==="[object Object]",Mn=e=>ce(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ss=An(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ws=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},ti=/-\w/g,Be=Ws(e=>e.replace(ti,t=>t.slice(1).toUpperCase())),si=/\B([A-Z])/g,xt=Ws(e=>e.replace(si,"-$1").toLowerCase()),Dl=Ws(e=>e.charAt(0).toUpperCase()+e.slice(1)),ln=Ws(e=>e?`on${Dl(e)}`:""),et=(e,t)=>!Object.is(e,t),Rs=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Gs=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let tl;const Js=()=>tl||(tl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Rn(e){if(N(e)){const t={};for(let s=0;s{if(s){const n=s.split(li);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Ue(e){let t="";if(ce(e))t=e;else if(N(e))for(let s=0;svt(s,t))}const Vl=e=>!!(e&&e.__v_isRef===!0),O=e=>ce(e)?e:e==null?"":N(e)||te(e)&&(e.toString===jl||!B(e.toString))?Vl(e)?O(e.value):JSON.stringify(e,Hl,2):String(e),Hl=(e,t)=>Vl(t)?Hl(e,t.value):Ft(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,l],o)=>(s[on(n,o)+" =>"]=l,s),{})}:Wt(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>on(s))}:st(t)?on(t):te(t)&&!N(t)&&!Ll(t)?String(t):t,on=(e,t="")=>{var s;return st(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let ve;class ui{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&ve&&(ve.active?(this.parent=ve,this.index=(ve.scopes||(ve.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t0&&--this._on===0){if(ve===this)ve=this.prevScope;else{let t=ve;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s0)return;if(ls){let t=ls;for(ls=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;ns;){let t=ns;for(ns=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Wl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Gl(e){let t,s=e.depsTail,n=s;for(;n;){const l=n.prevDep;n.version===-1?(n===s&&(s=l),jn(n),di(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=l}e.deps=t,e.depsTail=s}function vn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Jl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Jl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===cs)||(e.globalVersion=cs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!vn(e))))return;e.flags|=2;const t=e.dep,s=re,n=Ke;re=e,Ke=!0;try{Wl(e);const l=e.fn(e._value);(t.version===0||et(l,e._value))&&(e.flags|=128,e._value=l,t.version++)}catch(l){throw t.version++,l}finally{re=s,Ke=n,Gl(e),e.flags&=-3}}function jn(e,t=!1){const{dep:s,prevSub:n,nextSub:l}=e;if(n&&(n.nextSub=l,e.prevSub=void 0),l&&(l.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let o=s.computed.deps;o;o=o.nextDep)jn(o,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function di(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let Ke=!0;const ql=[];function nt(){ql.push(Ke),Ke=!1}function lt(){const e=ql.pop();Ke=e===void 0?!0:e}function sl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=re;re=void 0;try{t()}finally{re=s}}}let cs=0;class pi{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ln{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(!re||!Ke||re===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==re)s=this.activeLink=new pi(re,this),re.deps?(s.prevDep=re.depsTail,re.depsTail.nextDep=s,re.depsTail=s):re.deps=re.depsTail=s,Yl(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=re.depsTail,s.nextDep=void 0,re.depsTail.nextDep=s,re.depsTail=s,re.deps===s&&(re.deps=n)}return s}trigger(t){this.version++,cs++,this.notify(t)}notify(t){Un();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{$n()}}}function Yl(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Yl(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const bn=new WeakMap,Tt=Symbol(""),yn=Symbol(""),us=Symbol("");function we(e,t,s){if(Ke&&re){let n=bn.get(e);n||bn.set(e,n=new Map);let l=n.get(s);l||(n.set(s,l=new Ln),l.map=n,l.key=s),l.track()}}function ut(e,t,s,n,l,o){const i=bn.get(e);if(!i){cs++;return}const r=c=>{c&&c.trigger()};if(Un(),t==="clear")i.forEach(r);else{const c=N(e),m=c&&Mn(s);if(c&&s==="length"){const h=Number(n);i.forEach((y,M)=>{(M==="length"||M===us||!st(M)&&M>=h)&&r(y)})}else switch((s!==void 0||i.has(void 0))&&r(i.get(s)),m&&r(i.get(us)),t){case"add":c?m&&r(i.get("length")):(r(i.get(Tt)),Ft(e)&&r(i.get(yn)));break;case"delete":c||(r(i.get(Tt)),Ft(e)&&r(i.get(yn)));break;case"set":Ft(e)&&r(i.get(Tt));break}}$n()}function jt(e){const t=Z(e);return t===e?t:(we(t,"iterate",us),Ve(e)?t:t.map(ze))}function qs(e){return we(e=Z(e),"iterate",us),e}function Ze(e,t){return pt(e)?Bt(Pt(e)?ze(t):t):ze(t)}const hi={__proto__:null,[Symbol.iterator](){return an(this,Symbol.iterator,e=>Ze(this,e))},concat(...e){return jt(this).concat(...e.map(t=>N(t)?jt(t):t))},entries(){return an(this,"entries",e=>(e[1]=Ze(this,e[1]),e))},every(e,t){return rt(this,"every",e,t,void 0,arguments)},filter(e,t){return rt(this,"filter",e,t,s=>s.map(n=>Ze(this,n)),arguments)},find(e,t){return rt(this,"find",e,t,s=>Ze(this,s),arguments)},findIndex(e,t){return rt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return rt(this,"findLast",e,t,s=>Ze(this,s),arguments)},findLastIndex(e,t){return rt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return rt(this,"forEach",e,t,void 0,arguments)},includes(...e){return cn(this,"includes",e)},indexOf(...e){return cn(this,"indexOf",e)},join(e){return jt(this).join(e)},lastIndexOf(...e){return cn(this,"lastIndexOf",e)},map(e,t){return rt(this,"map",e,t,void 0,arguments)},pop(){return qt(this,"pop")},push(...e){return qt(this,"push",e)},reduce(e,...t){return nl(this,"reduce",e,t)},reduceRight(e,...t){return nl(this,"reduceRight",e,t)},shift(){return qt(this,"shift")},some(e,t){return rt(this,"some",e,t,void 0,arguments)},splice(...e){return qt(this,"splice",e)},toReversed(){return jt(this).toReversed()},toSorted(e){return jt(this).toSorted(e)},toSpliced(...e){return jt(this).toSpliced(...e)},unshift(...e){return qt(this,"unshift",e)},values(){return an(this,"values",e=>Ze(this,e))}};function an(e,t,s){const n=qs(e),l=n[t]();return n!==e&&!Ve(e)&&(l._next=l.next,l.next=()=>{const o=l._next();return o.done||(o.value=s(o.value)),o}),l}const gi=Array.prototype;function rt(e,t,s,n,l,o){const i=qs(e),r=i!==e&&!Ve(e),c=i[t];if(c!==gi[t]){const y=c.apply(e,o);return r?ze(y):y}let m=s;i!==e&&(r?m=function(y,M){return s.call(this,Ze(e,y),M,e)}:s.length>2&&(m=function(y,M){return s.call(this,y,M,e)}));const h=c.call(i,m,n);return r&&l?l(h):h}function nl(e,t,s,n){const l=qs(e),o=l!==e&&!Ve(e);let i=s,r=!1;l!==e&&(o?(r=n.length===0,i=function(m,h,y){return r&&(r=!1,m=Ze(e,m)),s.call(this,m,Ze(e,h),y,e)}):s.length>3&&(i=function(m,h,y){return s.call(this,m,h,y,e)}));const c=l[t](i,...n);return r?Ze(e,c):c}function cn(e,t,s){const n=Z(e);we(n,"iterate",us);const l=n[t](...s);return(l===-1||l===!1)&&Vn(s[0])?(s[0]=Z(s[0]),n[t](...s)):l}function qt(e,t,s=[]){nt(),Un();const n=Z(e)[t].apply(e,s);return $n(),lt(),n}const mi=An("__proto__,__v_isRef,__isVue"),Xl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(st));function vi(e){st(e)||(e=String(e));const t=Z(this);return we(t,"has",e),t.hasOwnProperty(e)}class Zl{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const l=this._isReadonly,o=this._isShallow;if(s==="__v_isReactive")return!l;if(s==="__v_isReadonly")return l;if(s==="__v_isShallow")return o;if(s==="__v_raw")return n===(l?o?Ti:so:o?to:eo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const i=N(t);if(!l){let c;if(i&&(c=hi[s]))return c;if(s==="hasOwnProperty")return vi}const r=Reflect.get(t,s,Ce(t)?t:n);if((st(s)?Xl.has(s):mi(s))||(l||we(t,"get",s),o))return r;if(Ce(r)){const c=i&&Mn(s)?r:r.value;return l&&te(c)?_n(c):c}return te(r)?l?_n(r):Nn(r):r}}class Ql extends Zl{constructor(t=!1){super(!1,t)}set(t,s,n,l){let o=t[s];const i=N(t)&&Mn(s);if(!this._isShallow){const m=pt(o);if(!Ve(n)&&!pt(n)&&(o=Z(o),n=Z(n)),!i&&Ce(o)&&!Ce(n))return m||(o.value=n),!0}const r=i?Number(s)e,Ts=e=>Reflect.getPrototypeOf(e);function wi(e,t,s){return function(...n){const l=this.__v_raw,o=Z(l),i=Ft(o),r=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,m=l[e](...n),h=s?xn:t?Bt:ze;return!t&&we(o,"iterate",c?yn:Tt),Se(Object.create(m),{next(){const{value:y,done:M}=m.next();return M?{value:y,done:M}:{value:r?[h(y[0]),h(y[1])]:h(y),done:M}}})}}function Ps(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ci(e,t){const s={get(l){const o=this.__v_raw,i=Z(o),r=Z(l);e||(et(l,r)&&we(i,"get",l),we(i,"get",r));const{has:c}=Ts(i),m=t?xn:e?Bt:ze;if(c.call(i,l))return m(o.get(l));if(c.call(i,r))return m(o.get(r));o!==i&&o.get(l)},get size(){const l=this.__v_raw;return!e&&we(Z(l),"iterate",Tt),l.size},has(l){const o=this.__v_raw,i=Z(o),r=Z(l);return e||(et(l,r)&&we(i,"has",l),we(i,"has",r)),l===r?o.has(l):o.has(l)||o.has(r)},forEach(l,o){const i=this,r=i.__v_raw,c=Z(r),m=t?xn:e?Bt:ze;return!e&&we(c,"iterate",Tt),r.forEach((h,y)=>l.call(o,m(h),m(y),i))}};return Se(s,e?{add:Ps("add"),set:Ps("set"),delete:Ps("delete"),clear:Ps("clear")}:{add(l){const o=Z(this),i=Ts(o),r=Z(l),c=!t&&!Ve(l)&&!pt(l)?r:l;return i.has.call(o,c)||et(l,c)&&i.has.call(o,l)||et(r,c)&&i.has.call(o,r)||(o.add(c),ut(o,"add",c,c)),this},set(l,o){!t&&!Ve(o)&&!pt(o)&&(o=Z(o));const i=Z(this),{has:r,get:c}=Ts(i);let m=r.call(i,l);m||(l=Z(l),m=r.call(i,l));const h=c.call(i,l);return i.set(l,o),m?et(o,h)&&ut(i,"set",l,o):ut(i,"add",l,o),this},delete(l){const o=Z(this),{has:i,get:r}=Ts(o);let c=i.call(o,l);c||(l=Z(l),c=i.call(o,l)),r&&r.call(o,l);const m=o.delete(l);return c&&ut(o,"delete",l,void 0),m},clear(){const l=Z(this),o=l.size!==0,i=l.clear();return o&&ut(l,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(l=>{s[l]=wi(l,e,t)}),s}function Dn(e,t){const s=Ci(e,t);return(n,l,o)=>l==="__v_isReactive"?!e:l==="__v_isReadonly"?e:l==="__v_raw"?n:Reflect.get(Q(s,l)&&l in n?s:n,l,o)}const Si={get:Dn(!1,!1)},ki={get:Dn(!1,!0)},Ei={get:Dn(!0,!1)};const eo=new WeakMap,to=new WeakMap,so=new WeakMap,Ti=new WeakMap;function Pi(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Nn(e){return pt(e)?e:Fn(e,!1,yi,Si,eo)}function Ai(e){return Fn(e,!1,_i,ki,to)}function _n(e){return Fn(e,!0,xi,Ei,so)}function Fn(e,t,s,n,l){if(!te(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=l.get(e);if(o)return o;const i=Pi(ei(e));if(i===0)return e;const r=new Proxy(e,i===2?n:s);return l.set(e,r),r}function Pt(e){return pt(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function pt(e){return!!(e&&e.__v_isReadonly)}function Ve(e){return!!(e&&e.__v_isShallow)}function Vn(e){return e?!!e.__v_raw:!1}function Z(e){const t=e&&e.__v_raw;return t?Z(t):e}function Oi(e){return!Q(e,"__v_skip")&&Object.isExtensible(e)&&Nl(e,"__v_skip",!0),e}const ze=e=>te(e)?Nn(e):e,Bt=e=>te(e)?_n(e):e;function Ce(e){return e?e.__v_isRef===!0:!1}function L(e){return Mi(e,!1)}function Mi(e,t){return Ce(e)?e:new Ri(e,t)}class Ri{constructor(t,s){this.dep=new Ln,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:Z(t),this._value=s?t:ze(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Ve(t)||pt(t);t=n?t:Z(t),et(t,s)&&(this._rawValue=t,this._value=n?t:ze(t),this.dep.trigger())}}function Qt(e){return Ce(e)?e.value:e}const Ii={get:(e,t,s)=>t==="__v_raw"?e:Qt(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const l=e[t];return Ce(l)&&!Ce(s)?(l.value=s,!0):Reflect.set(e,t,s,n)}};function no(e){return Pt(e)?e:new Proxy(e,Ii)}class Ui{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new Ln(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=cs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&re!==this)return zl(this,!0),!0}get value(){const t=this.dep.track();return Jl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function $i(e,t,s=!1){let n,l;return B(e)?n=e:(n=e.get,l=e.set),new Ui(n,l,s)}const As={},js=new WeakMap;let Et;function ji(e,t=!1,s=Et){if(s){let n=js.get(s);n||js.set(s,n=[]),n.push(e)}}function Li(e,t,s=ne){const{immediate:n,deep:l,once:o,scheduler:i,augmentJob:r,call:c}=s,m=j=>l?j:Ve(j)||l===!1||l===0?ft(j,1):ft(j);let h,y,M,I,J=!1,U=!1;if(Ce(e)?(y=()=>e.value,J=Ve(e)):Pt(e)?(y=()=>m(e),J=!0):N(e)?(U=!0,J=e.some(j=>Pt(j)||Ve(j)),y=()=>e.map(j=>{if(Ce(j))return j.value;if(Pt(j))return m(j);if(B(j))return c?c(j,2):j()})):B(e)?t?y=c?()=>c(e,2):e:y=()=>{if(M){nt();try{M()}finally{lt()}}const j=Et;Et=h;try{return c?c(e,3,[I]):e(I)}finally{Et=j}}:y=tt,t&&l){const j=y,z=l===!0?1/0:l;y=()=>ft(j(),z)}const W=fi(),Y=()=>{h.stop(),W&&W.active&&On(W.effects,h)};if(o&&t){const j=t;t=(...z)=>{const Re=j(...z);return Y(),Re}}let V=U?new Array(e.length).fill(As):As;const X=j=>{if(!(!(h.flags&1)||!h.dirty&&!j))if(t){const z=h.run();if(j||l||J||(U?z.some((Re,Le)=>et(Re,V[Le])):et(z,V))){M&&M();const Re=Et;Et=h;try{const Le=[z,V===As?void 0:U&&V[0]===As?[]:V,I];V=z,c?c(t,3,Le):t(...Le)}finally{Et=Re}}}else h.run()};return r&&r(X),h=new Bl(y),h.scheduler=i?()=>i(X,!1):X,I=j=>ji(j,!1,h),M=h.onStop=()=>{const j=js.get(h);if(j){if(c)c(j,4);else for(const z of j)z();js.delete(h)}},t?n?X(!0):V=h.run():i?i(X.bind(null,!0),!0):h.run(),Y.pause=h.pause.bind(h),Y.resume=h.resume.bind(h),Y.stop=Y,Y}function ft(e,t=1/0,s){if(t<=0||!te(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Ce(e))ft(e.value,t,s);else if(N(e))for(let n=0;n{ft(n,t,s)});else if(Ll(e)){for(const n in e)ft(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&ft(e[n],t,s)}return e}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function ms(e,t,s,n){try{return n?e(...n):e()}catch(l){Ys(l,t,s)}}function We(e,t,s,n){if(B(e)){const l=ms(e,t,s,n);return l&&$l(l)&&l.catch(o=>{Ys(o,t,s)}),l}if(N(e)){const l=[];for(let o=0;o>>1,l=Pe[n],o=fs(l);o=fs(s)?Pe.push(e):Pe.splice(Ni(t),0,e),e.flags|=1,io()}}function io(){Ls||(Ls=lo.then(ao))}function Fi(e){N(e)?Vt.push(...e):mt&&e.id===-1?mt.splice(Lt+1,0,e):e.flags&1||(Vt.push(e),e.flags|=1),io()}function ll(e,t,s=Xe+1){for(;sfs(s)-fs(n));if(Vt.length=0,mt){mt.push(...t);return}for(mt=t,Lt=0;Lte.id==null?e.flags&2?-1:1/0:e.id;function ao(e){try{for(Xe=0;Xe{n._d&&gl(-1);const o=Ds(t);let i;try{i=e(...l)}finally{Ds(o),n._d&&gl(1)}return i};return n._n=!0,n._c=!0,n._d=!0,n}function ie(e,t){if(Fe===null)return e;const s=en(Fe),n=e.dirs||(e.dirs=[]);for(let l=0;l1)return s&&B(t)?t.call(n&&n.proxy):t}}const Bi=Symbol.for("v-scx"),Ki=()=>Is(Bi);function un(e,t,s){return uo(e,t,s)}function uo(e,t,s=ne){const{immediate:n,deep:l,flush:o,once:i}=s,r=Se({},s),c=t&&n||!t&&o!=="post";let m;if(ps){if(o==="sync"){const I=Ki();m=I.__watcherHandles||(I.__watcherHandles=[])}else if(!c){const I=()=>{};return I.stop=tt,I.resume=tt,I.pause=tt,I}}const h=Ae;r.call=(I,J,U)=>We(I,h,J,U);let y=!1;o==="post"?r.scheduler=I=>{Me(I,h&&h.suspense)}:o!=="sync"&&(y=!0,r.scheduler=(I,J)=>{J?I():Hn(I)}),r.augmentJob=I=>{t&&(I.flags|=4),y&&(I.flags|=2,h&&(I.id=h.uid,I.i=h))};const M=Li(e,t,r);return ps&&(m?m.push(M):c&&M()),M}function zi(e,t,s){const n=this.proxy,l=ce(e)?e.includes(".")?fo(n,e):()=>n[e]:e.bind(n,n);let o;B(t)?o=t:(o=t.handler,s=t);const i=vs(this),r=uo(l,o.bind(n),s);return i(),r}function fo(e,t){const s=t.split(".");return()=>{let n=e;for(let l=0;le.__isTeleport,fn=Symbol("_leaveCb");function Bn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Bn(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 po(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ol(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Ns=new WeakMap;function os(e,t,s,n,l=!1){if(N(e)){e.forEach((U,W)=>os(U,t&&(N(t)?t[W]:t),s,n,l));return}if(is(n)&&!l){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&os(e,t,s,n.component.subTree);return}const o=n.shapeFlag&4?en(n.component):n.el,i=l?null:o,{i:r,r:c}=e,m=t&&t.r,h=r.refs===ne?r.refs={}:r.refs,y=r.setupState,M=Z(y),I=y===ne?Ul:U=>ol(h,U)?!1:Q(M,U),J=(U,W)=>!(W&&ol(h,W));if(m!=null&&m!==c){if(il(t),ce(m))h[m]=null,I(m)&&(y[m]=null);else if(Ce(m)){const U=t;J(m,U.k)&&(m.value=null),U.k&&(h[U.k]=null)}}if(B(c)){nt();try{ms(c,r,12,[i,h])}finally{lt()}}else{const U=ce(c),W=Ce(c);if(U||W){const Y=()=>{if(e.f){const V=U?I(c)?y[c]:h[c]:J()||!e.k?c.value:h[e.k];if(l)N(V)&&On(V,o);else if(N(V))V.includes(o)||V.push(o);else if(U)h[c]=[o],I(c)&&(y[c]=h[c]);else{const X=[o];J(c,e.k)&&(c.value=X),e.k&&(h[e.k]=X)}}else U?(h[c]=i,I(c)&&(y[c]=i)):W&&(J(c,e.k)&&(c.value=i),e.k&&(h[e.k]=i))};if(i){const V=()=>{Y(),Ns.delete(e)};V.id=-1,Ns.set(e,V),Me(V,s)}else il(e),Y()}}}function il(e){const t=Ns.get(e);t&&(t.flags|=8,Ns.delete(e))}Js().requestIdleCallback;Js().cancelIdleCallback;const is=e=>!!e.type.__asyncLoader,ho=e=>e.type.__isKeepAlive;function Ji(e,t){go(e,"a",t)}function qi(e,t){go(e,"da",t)}function go(e,t,s=Ae){const n=e.__wdc||(e.__wdc=()=>{let l=s;for(;l;){if(l.isDeactivated)return;l=l.parent}return e()});if(Xs(t,n,s),s){let l=s.parent;for(;l&&l.parent;)ho(l.parent.vnode)&&Yi(n,t,s,l),l=l.parent}}function Yi(e,t,s,n){const l=Xs(t,e,n,!0);Kn(()=>{On(n[t],l)},s)}function Xs(e,t,s=Ae,n=!1){if(s){const l=s[e]||(s[e]=[]),o=t.__weh||(t.__weh=(...i)=>{nt();const r=vs(s),c=We(t,s,e,i);return r(),lt(),c});return n?l.unshift(o):l.push(o),o}}const ht=e=>(t,s=Ae)=>{(!ps||e==="sp")&&Xs(e,(...n)=>t(...n),s)},Xi=ht("bm"),mo=ht("m"),Zi=ht("bu"),Qi=ht("u"),er=ht("bum"),Kn=ht("um"),tr=ht("sp"),sr=ht("rtg"),nr=ht("rtc");function lr(e,t=Ae){Xs("ec",e,t)}const or=Symbol.for("v-ndc");function xe(e,t,s,n){let l;const o=s,i=N(e);if(i||ce(e)){const r=i&&Pt(e);let c=!1,m=!1;r&&(c=!Ve(e),m=pt(e),e=qs(e)),l=new Array(e.length);for(let h=0,y=e.length;ht(r,c,void 0,o));else{const r=Object.keys(e);l=new Array(r.length);for(let c=0,m=r.length;ce?Lo(e)?en(e):wn(e.parent):null,rs=Se(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=>wn(e.parent),$root:e=>wn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>bo(e),$forceUpdate:e=>e.f||(e.f=()=>{Hn(e.update)}),$nextTick:e=>e.n||(e.n=oo.bind(e.proxy)),$watch:e=>zi.bind(e)}),dn=(e,t)=>e!==ne&&!e.__isScriptSetup&&Q(e,t),ir={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:l,props:o,accessCache:i,type:r,appContext:c}=e;if(t[0]!=="$"){const M=i[t];if(M!==void 0)switch(M){case 1:return n[t];case 2:return l[t];case 4:return s[t];case 3:return o[t]}else{if(dn(n,t))return i[t]=1,n[t];if(l!==ne&&Q(l,t))return i[t]=2,l[t];if(Q(o,t))return i[t]=3,o[t];if(s!==ne&&Q(s,t))return i[t]=4,s[t];Cn&&(i[t]=0)}}const m=rs[t];let h,y;if(m)return t==="$attrs"&&we(e.attrs,"get",""),m(e);if((h=r.__cssModules)&&(h=h[t]))return h;if(s!==ne&&Q(s,t))return i[t]=4,s[t];if(y=c.config.globalProperties,Q(y,t))return y[t]},set({_:e},t,s){const{data:n,setupState:l,ctx:o}=e;return dn(l,t)?(l[t]=s,!0):n!==ne&&Q(n,t)?(n[t]=s,!0):Q(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:l,props:o,type:i}},r){let c;return!!(s[r]||e!==ne&&r[0]!=="$"&&Q(e,r)||dn(t,r)||Q(o,r)||Q(n,r)||Q(rs,r)||Q(l.config.globalProperties,r)||(c=i.__cssModules)&&c[r])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:Q(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function rl(e){return N(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let Cn=!0;function rr(e){const t=bo(e),s=e.proxy,n=e.ctx;Cn=!1,t.beforeCreate&&al(t.beforeCreate,e,"bc");const{data:l,computed:o,methods:i,watch:r,provide:c,inject:m,created:h,beforeMount:y,mounted:M,beforeUpdate:I,updated:J,activated:U,deactivated:W,beforeDestroy:Y,beforeUnmount:V,destroyed:X,unmounted:j,render:z,renderTracked:Re,renderTriggered:Le,errorCaptured:Ge,serverPrefetch:De,expose:Oe,inheritAttrs:de,components:Je,directives:ke,filters:be}=t;if(m&&ar(m,n,null),i)for(const le in i){const q=i[le];B(q)&&(n[le]=q.bind(s))}if(l){const le=l.call(s,s);te(le)&&(e.data=Nn(le))}if(Cn=!0,o)for(const le in o){const q=o[le],qe=B(q)?q.bind(s,s):B(q.get)?q.get.bind(s,s):tt,At=!B(q)&&B(q.set)?q.set.bind(s):tt,ye=Tn({get:qe,set:At});Object.defineProperty(n,le,{enumerable:!0,configurable:!0,get:()=>ye.value,set:me=>ye.value=me})}if(r)for(const le in r)vo(r[le],n,s,le);if(c){const le=B(c)?c.call(s):c;Reflect.ownKeys(le).forEach(q=>{Hi(q,le[q])})}h&&al(h,e,"c");function ge(le,q){N(q)?q.forEach(qe=>le(qe.bind(s))):q&&le(q.bind(s))}if(ge(Xi,y),ge(mo,M),ge(Zi,I),ge(Qi,J),ge(Ji,U),ge(qi,W),ge(lr,Ge),ge(nr,Re),ge(sr,Le),ge(er,V),ge(Kn,j),ge(tr,De),N(Oe))if(Oe.length){const le=e.exposed||(e.exposed={});Oe.forEach(q=>{Object.defineProperty(le,q,{get:()=>s[q],set:qe=>s[q]=qe,enumerable:!0})})}else e.exposed||(e.exposed={});z&&e.render===tt&&(e.render=z),de!=null&&(e.inheritAttrs=de),Je&&(e.components=Je),ke&&(e.directives=ke),De&&po(e)}function ar(e,t,s=tt){N(e)&&(e=Sn(e));for(const n in e){const l=e[n];let o;te(l)?"default"in l?o=Is(l.from||n,l.default,!0):o=Is(l.from||n):o=Is(l),Ce(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[n]=o}}function al(e,t,s){We(N(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function vo(e,t,s,n){let l=n.includes(".")?fo(s,n):()=>s[n];if(ce(e)){const o=t[e];B(o)&&un(l,o)}else if(B(e))un(l,e.bind(s));else if(te(e))if(N(e))e.forEach(o=>vo(o,t,s,n));else{const o=B(e.handler)?e.handler.bind(s):t[e.handler];B(o)&&un(l,o,e)}}function bo(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:l,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,r=o.get(t);let c;return r?c=r:!l.length&&!s&&!n?c=t:(c={},l.length&&l.forEach(m=>Fs(c,m,i,!0)),Fs(c,t,i)),te(t)&&o.set(t,c),c}function Fs(e,t,s,n=!1){const{mixins:l,extends:o}=t;o&&Fs(e,o,s,!0),l&&l.forEach(i=>Fs(e,i,s,!0));for(const i in t)if(!(n&&i==="expose")){const r=cr[i]||s&&s[i];e[i]=r?r(e[i],t[i]):t[i]}return e}const cr={data:cl,props:ul,emits:ul,methods:es,computed:es,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:es,directives:es,watch:fr,provide:cl,inject:ur};function cl(e,t){return t?e?function(){return Se(B(e)?e.call(this,this):e,B(t)?t.call(this,this):t)}:t:e}function ur(e,t){return es(Sn(e),Sn(t))}function Sn(e){if(N(e)){const t={};for(let s=0;st==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Be(t)}Modifiers`]||e[`${xt(t)}Modifiers`];function gr(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||ne;let l=s;const o=t.startsWith("update:"),i=o&&hr(n,t.slice(7));i&&(i.trim&&(l=s.map(h=>ce(h)?h.trim():h)),i.number&&(l=s.map(Gs)));let r,c=n[r=ln(t)]||n[r=ln(Be(t))];!c&&o&&(c=n[r=ln(xt(t))]),c&&We(c,e,6,l);const m=n[r+"Once"];if(m){if(!e.emitted)e.emitted={};else if(e.emitted[r])return;e.emitted[r]=!0,We(m,e,6,l)}}const mr=new WeakMap;function xo(e,t,s=!1){const n=s?mr:t.emitsCache,l=n.get(e);if(l!==void 0)return l;const o=e.emits;let i={},r=!1;if(!B(e)){const c=m=>{const h=xo(m,t,!0);h&&(r=!0,Se(i,h))};!s&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!r?(te(e)&&n.set(e,null),null):(N(o)?o.forEach(c=>i[c]=null):Se(i,o),te(e)&&n.set(e,i),i)}function Zs(e,t){return!e||!Ks(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Q(e,t[0].toLowerCase()+t.slice(1))||Q(e,xt(t))||Q(e,t))}function fl(e){const{type:t,vnode:s,proxy:n,withProxy:l,propsOptions:[o],slots:i,attrs:r,emit:c,render:m,renderCache:h,props:y,data:M,setupState:I,ctx:J,inheritAttrs:U}=e,W=Ds(e);let Y,V;try{if(s.shapeFlag&4){const j=l||n,z=j;Y=Qe(m.call(z,j,h,y,I,M,J)),V=r}else{const j=t;Y=Qe(j.length>1?j(y,{attrs:r,slots:i,emit:c}):j(y,null)),V=t.props?r:vr(r)}}catch(j){as.length=0,Ys(j,e,1),Y=je(bt)}let X=Y;if(V&&U!==!1){const j=Object.keys(V),{shapeFlag:z}=X;j.length&&z&7&&(o&&j.some(zs)&&(V=br(V,o)),X=Kt(X,V,!1,!0))}return s.dirs&&(X=Kt(X,null,!1,!0),X.dirs=X.dirs?X.dirs.concat(s.dirs):s.dirs),s.transition&&Bn(X,s.transition),Y=X,Ds(W),Y}const vr=e=>{let t;for(const s in e)(s==="class"||s==="style"||Ks(s))&&((t||(t={}))[s]=e[s]);return t},br=(e,t)=>{const s={};for(const n in e)(!zs(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function yr(e,t,s){const{props:n,children:l,component:o}=e,{props:i,children:r,patchFlag:c}=t,m=o.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&c>=0){if(c&1024)return!0;if(c&16)return n?dl(n,i,m):!!i;if(c&8){const h=t.dynamicProps;for(let y=0;yObject.create(wo),So=e=>Object.getPrototypeOf(e)===wo;function _r(e,t,s,n=!1){const l={},o=Co();e.propsDefaults=Object.create(null),ko(e,t,l,o);for(const i in e.propsOptions[0])i in l||(l[i]=void 0);s?e.props=n?l:Ai(l):e.type.props?e.props=l:e.props=o,e.attrs=o}function wr(e,t,s,n){const{props:l,attrs:o,vnode:{patchFlag:i}}=e,r=Z(l),[c]=e.propsOptions;let m=!1;if((n||i>0)&&!(i&16)){if(i&8){const h=e.vnode.dynamicProps;for(let y=0;y{c=!0;const[M,I]=Eo(y,t,!0);Se(i,M),I&&r.push(...I)};!s&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!o&&!c)return te(e)&&n.set(e,Nt),Nt;if(N(o))for(let h=0;he==="_"||e==="_ctx"||e==="$stable",Wn=e=>N(e)?e.map(Qe):[Qe(e)],Sr=(e,t,s)=>{if(t._n)return t;const n=Vi((...l)=>Wn(t(...l)),s);return n._c=!1,n},To=(e,t,s)=>{const n=e._ctx;for(const l in e){if(zn(l))continue;const o=e[l];if(B(o))t[l]=Sr(l,o,n);else if(o!=null){const i=Wn(o);t[l]=()=>i}}},Po=(e,t)=>{const s=Wn(t);e.slots.default=()=>s},Ao=(e,t,s)=>{for(const n in t)(s||!zn(n))&&(e[n]=t[n])},kr=(e,t,s)=>{const n=e.slots=Co();if(e.vnode.shapeFlag&32){const l=t._;l?(Ao(n,t,s),s&&Nl(n,"_",l,!0)):To(t,n)}else t&&Po(e,t)},Er=(e,t,s)=>{const{vnode:n,slots:l}=e;let o=!0,i=ne;if(n.shapeFlag&32){const r=t._;r?s&&r===1?o=!1:Ao(l,t,s):(o=!t.$stable,To(t,l)),i=t}else t&&(Po(e,t),i={default:1});if(o)for(const r in l)!zn(r)&&i[r]==null&&delete l[r]},Me=Mr;function Tr(e){return Pr(e)}function Pr(e,t){const s=Js();s.__VUE__=!0;const{insert:n,remove:l,patchProp:o,createElement:i,createText:r,createComment:c,setText:m,setElementText:h,parentNode:y,nextSibling:M,setScopeId:I=tt,insertStaticContent:J}=e,U=(a,p,v,w=null,_=null,x=null,P=void 0,k=null,S=!!p.dynamicChildren)=>{if(a===p)return;a&&!Yt(a,p)&&(w=Ot(a),me(a,_,x,!0),a=null),p.patchFlag===-2&&(S=!1,p.dynamicChildren=null);const{type:b,ref:R,shapeFlag:A}=p;switch(b){case Qs:W(a,p,v,w);break;case bt:Y(a,p,v,w);break;case Us:a==null&&V(p,v,w,P);break;case se:Je(a,p,v,w,_,x,P,k,S);break;default:A&1?z(a,p,v,w,_,x,P,k,S):A&6?ke(a,p,v,w,_,x,P,k,S):(A&64||A&128)&&b.process(a,p,v,w,_,x,P,k,S,Ct)}R!=null&&_?os(R,a&&a.ref,x,p||a,!p):R==null&&a&&a.ref!=null&&os(a.ref,null,x,a,!0)},W=(a,p,v,w)=>{if(a==null)n(p.el=r(p.children),v,w);else{const _=p.el=a.el;p.children!==a.children&&m(_,p.children)}},Y=(a,p,v,w)=>{a==null?n(p.el=c(p.children||""),v,w):p.el=a.el},V=(a,p,v,w)=>{[a.el,a.anchor]=J(a.children,p,v,w,a.el,a.anchor)},X=({el:a,anchor:p},v,w)=>{let _;for(;a&&a!==p;)_=M(a),n(a,v,w),a=_;n(p,v,w)},j=({el:a,anchor:p})=>{let v;for(;a&&a!==p;)v=M(a),l(a),a=v;l(p)},z=(a,p,v,w,_,x,P,k,S)=>{if(p.type==="svg"?P="svg":p.type==="math"&&(P="mathml"),a==null)Re(p,v,w,_,x,P,k,S);else{const b=a.el&&a.el._isVueCE?a.el:null;try{b&&b._beginPatch(),De(a,p,_,x,P,k,S)}finally{b&&b._endPatch()}}},Re=(a,p,v,w,_,x,P,k)=>{let S,b;const{props:R,shapeFlag:A,transition:$,dirs:D}=a;if(S=a.el=i(a.type,x,R&&R.is,R),A&8?h(S,a.children):A&16&&Ge(a.children,S,null,w,_,pn(a,x),P,k),D&&St(a,null,w,"created"),Le(S,a,a.scopeId,P,w),R){for(const G in R)G!=="value"&&!ss(G)&&o(S,G,null,R[G],x,w);"value"in R&&o(S,"value",null,R.value,x),(b=R.onVnodeBeforeMount)&&Ye(b,w,a)}D&&St(a,null,w,"beforeMount");const K=Ar(_,$);K&&$.beforeEnter(S),n(S,p,v),((b=R&&R.onVnodeMounted)||K||D)&&Me(()=>{try{b&&Ye(b,w,a),K&&$.enter(S),D&&St(a,null,w,"mounted")}finally{}},_)},Le=(a,p,v,w,_)=>{if(v&&I(a,v),w)for(let x=0;x{for(let b=S;b{const k=p.el=a.el;let{patchFlag:S,dynamicChildren:b,dirs:R}=p;S|=a.patchFlag&16;const A=a.props||ne,$=p.props||ne;let D;if(v&&kt(v,!1),(D=$.onVnodeBeforeUpdate)&&Ye(D,v,p,a),R&&St(p,a,v,"beforeUpdate"),v&&kt(v,!0),b&&(!a.dynamicChildren||a.dynamicChildren.length!==b.length)&&(S=0,P=!1,b=null),(A.innerHTML&&$.innerHTML==null||A.textContent&&$.textContent==null)&&h(k,""),b?Oe(a.dynamicChildren,b,k,v,w,pn(p,_),x):P||q(a,p,k,null,v,w,pn(p,_),x,!1),S>0){if(S&16)de(k,A,$,v,_);else if(S&2&&A.class!==$.class&&o(k,"class",null,$.class,_),S&4&&o(k,"style",A.style,$.style,_),S&8){const K=p.dynamicProps;for(let G=0;G{D&&Ye(D,v,p,a),R&&St(p,a,v,"updated")},w)},Oe=(a,p,v,w,_,x,P)=>{for(let k=0;k{if(p!==v){if(p!==ne)for(const x in p)!ss(x)&&!(x in v)&&o(a,x,p[x],null,_,w);for(const x in v){if(ss(x))continue;const P=v[x],k=p[x];P!==k&&x!=="value"&&o(a,x,k,P,_,w)}"value"in v&&o(a,"value",p.value,v.value,_)}},Je=(a,p,v,w,_,x,P,k,S)=>{const b=p.el=a?a.el:r(""),R=p.anchor=a?a.anchor:r("");let{patchFlag:A,dynamicChildren:$,slotScopeIds:D}=p;D&&(k=k?k.concat(D):D),a==null?(n(b,v,w),n(R,v,w),Ge(p.children||[],v,R,_,x,P,k,S)):A>0&&A&64&&$&&a.dynamicChildren&&a.dynamicChildren.length===$.length?(Oe(a.dynamicChildren,$,v,_,x,P,k),(p.key!=null||_&&p===_.subTree)&&Oo(a,p,!0)):q(a,p,v,R,_,x,P,k,S)},ke=(a,p,v,w,_,x,P,k,S)=>{p.slotScopeIds=k,a==null?p.shapeFlag&512?_.ctx.activate(p,v,w,P,S):be(p,v,w,_,x,P,S):Gt(a,p,S)},be=(a,p,v,w,_,x,P)=>{const k=a.component=Fr(a,w,_);if(ho(a)&&(k.ctx.renderer=Ct),Hr(k,!1,P),k.asyncDep){if(_&&_.registerDep(k,ge,P),!a.el){const S=k.subTree=je(bt);Y(null,S,p,v),a.placeholder=S.el}}else ge(k,a,p,v,_,x,P)},Gt=(a,p,v)=>{const w=p.component=a.component;if(yr(a,p,v))if(w.asyncDep&&!w.asyncResolved){le(w,p,v);return}else w.next=p,w.update();else p.el=a.el,w.vnode=p},ge=(a,p,v,w,_,x,P)=>{const k=()=>{if(a.isMounted){let{next:A,bu:$,u:D,parent:K,vnode:G}=a;{const ue=Mo(a);if(ue){A&&(A.el=G.el,le(a,A,P)),ue.asyncDep.then(()=>{Me(()=>{a.isUnmounted||b()},_)});return}}let F=A,ee;kt(a,!1),A?(A.el=G.el,le(a,A,P)):A=G,$&&Rs($),(ee=A.props&&A.props.onVnodeBeforeUpdate)&&Ye(ee,K,A,G),kt(a,!0);const ae=fl(a),Ee=a.subTree;a.subTree=ae,U(Ee,ae,y(Ee.el),Ot(Ee),a,_,x),A.el=ae.el,F===null&&xr(a,ae.el),D&&Me(D,_),(ee=A.props&&A.props.onVnodeUpdated)&&Me(()=>Ye(ee,K,A,G),_)}else{let A;const{el:$,props:D}=p,{bm:K,m:G,parent:F,root:ee,type:ae}=a,Ee=is(p);kt(a,!1),K&&Rs(K),!Ee&&(A=D&&D.onVnodeBeforeMount)&&Ye(A,F,p),kt(a,!0);{ee.ce&&ee.ce._hasShadowRoot()&&ee.ce._injectChildStyle(ae,a.parent?a.parent.type:void 0);const ue=a.subTree=fl(a);U(null,ue,v,w,a,_,x),p.el=ue.el}if(G&&Me(G,_),!Ee&&(A=D&&D.onVnodeMounted)){const ue=p;Me(()=>Ye(A,F,ue),_)}(p.shapeFlag&256||F&&is(F.vnode)&&F.vnode.shapeFlag&256)&&a.a&&Me(a.a,_),a.isMounted=!0,p=v=w=null}};a.scope.on();const S=a.effect=new Bl(k);a.scope.off();const b=a.update=S.run.bind(S),R=a.job=S.runIfDirty.bind(S);R.i=a,R.id=a.uid,S.scheduler=()=>Hn(R),kt(a,!0),b()},le=(a,p,v)=>{p.component=a;const w=a.vnode.props;a.vnode=p,a.next=null,wr(a,p.props,w,v),Er(a,p.children,v),nt(),ll(a),lt()},q=(a,p,v,w,_,x,P,k,S=!1)=>{const b=a&&a.children,R=a?a.shapeFlag:0,A=p.children,{patchFlag:$,shapeFlag:D}=p;if($>0){if($&128){At(b,A,v,w,_,x,P,k,S);return}else if($&256){qe(b,A,v,w,_,x,P,k,S);return}}D&8?(R&16&&wt(b,_,x),A!==b&&h(v,A)):R&16?D&16?At(b,A,v,w,_,x,P,k,S):wt(b,_,x,!0):(R&8&&h(v,""),D&16&&Ge(A,v,w,_,x,P,k,S))},qe=(a,p,v,w,_,x,P,k,S)=>{a=a||Nt,p=p||Nt;const b=a.length,R=p.length,A=Math.min(b,R);let $;for($=0;$R?wt(a,_,x,!0,!1,A):Ge(p,v,w,_,x,P,k,S,A)},At=(a,p,v,w,_,x,P,k,S)=>{let b=0;const R=p.length;let A=a.length-1,$=R-1;for(;b<=A&&b<=$;){const D=a[b],K=p[b]=S?ct(p[b]):Qe(p[b]);if(Yt(D,K))U(D,K,v,null,_,x,P,k,S);else break;b++}for(;b<=A&&b<=$;){const D=a[A],K=p[$]=S?ct(p[$]):Qe(p[$]);if(Yt(D,K))U(D,K,v,null,_,x,P,k,S);else break;A--,$--}if(b>A){if(b<=$){const D=$+1,K=D$)for(;b<=A;)me(a[b],_,x,!0),b++;else{const D=b,K=b,G=new Map;for(b=K;b<=$;b++){const oe=p[b]=S?ct(p[b]):Qe(p[b]);oe.key!=null&&G.set(oe.key,b)}let F,ee=0;const ae=$-K+1;let Ee=!1,ue=0;const pe=new Array(ae);for(b=0;b=ae){me(oe,_,x,!0);continue}let he;if(oe.key!=null)he=G.get(oe.key);else for(F=K;F<=$;F++)if(pe[F-K]===0&&Yt(oe,p[F])){he=F;break}he===void 0?me(oe,_,x,!0):(pe[he-K]=b+1,he>=ue?ue=he:Ee=!0,U(oe,p[he],v,null,_,x,P,k,S),ee++)}const ot=Ee?Or(pe):Nt;for(F=ot.length-1,b=ae-1;b>=0;b--){const oe=K+b,he=p[oe],ys=p[oe+1],xs=oe+1{const{el:x,type:P,transition:k,children:S,shapeFlag:b}=a;if(b&6){ye(a.component.subTree,p,v,w);return}if(b&128){a.suspense.move(p,v,w);return}if(b&64){P.move(a,p,v,Ct);return}if(P===se){n(x,p,v);for(let A=0;Ak.enter(x),_));else{const{leave:A,delayLeave:$,afterLeave:D}=k,K=()=>{a.ctx.isUnmounted?l(x):n(x,p,v)},G=()=>{const F=x._isLeaving||!!x[fn];x._isLeaving&&x[fn](!0),k.persisted&&!F?K():A(x,()=>{K(),D&&D()})};$?$(x,K,G):G()}else n(x,p,v)},me=(a,p,v,w=!1,_=!1)=>{const{type:x,props:P,ref:k,children:S,dynamicChildren:b,shapeFlag:R,patchFlag:A,dirs:$,cacheIndex:D,memo:K}=a;if(A===-2&&(_=!1),k!=null&&(nt(),os(k,null,v,a,!0),lt()),D!=null&&(p.renderCache[D]=void 0),R&256){p.ctx.deactivate(a);return}const G=R&1&&$,F=!is(a);let ee;if(F&&(ee=P&&P.onVnodeBeforeUnmount)&&Ye(ee,p,a),R&6)Jt(a.component,v,w);else{if(R&128){a.suspense.unmount(v,w);return}G&&St(a,null,p,"beforeUnmount"),R&64?a.type.remove(a,p,v,Ct,w):b&&!b.hasOnce&&(x!==se||A>0&&A&64)?wt(b,p,v,!1,!0):(x===se&&A&384||!_&&R&16)&&wt(S,p,v),w&&_t(a)}const ae=K!=null&&D==null;(F&&(ee=P&&P.onVnodeUnmounted)||G||ae)&&Me(()=>{ee&&Ye(ee,p,a),G&&St(a,null,p,"unmounted"),ae&&(a.el=null)},v)},_t=a=>{const{type:p,el:v,anchor:w,transition:_}=a;if(p===se){tn(v,w);return}if(p===Us){j(a);return}const x=()=>{l(v),_&&!_.persisted&&_.afterLeave&&_.afterLeave()};if(a.shapeFlag&1&&_&&!_.persisted){const{leave:P,delayLeave:k}=_,S=()=>P(v,x);k?k(a.el,x,S):S()}else x()},tn=(a,p)=>{let v;for(;a!==p;)v=M(a),l(a),a=v;l(p)},Jt=(a,p,v)=>{const{bum:w,scope:_,job:x,subTree:P,um:k,m:S,a:b}=a;hl(S),hl(b),w&&Rs(w),_.stop(),x&&(x.flags|=8,me(P,a,p,v)),k&&Me(k,p),Me(()=>{a.isUnmounted=!0},p)},wt=(a,p,v,w=!1,_=!1,x=0)=>{for(let P=x;P{if(a.shapeFlag&6)return Ot(a.component.subTree);if(a.shapeFlag&128)return a.suspense.next();const p=M(a.anchor||a.el),v=p&&p[Wi];return v?M(v):p};let Mt=!1;const bs=(a,p,v)=>{let w;a==null?p._vnode&&(me(p._vnode,null,null,!0),w=p._vnode.component):U(p._vnode||null,a,p,null,null,null,v),p._vnode=a,Mt||(Mt=!0,ll(w),ro(),Mt=!1)},Ct={p:U,um:me,m:ye,r:_t,mt:be,mc:Ge,pc:q,pbc:Oe,n:Ot,o:e};return{render:bs,hydrate:void 0,createApp:pr(bs)}}function pn({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function kt({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ar(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Oo(e,t,s=!1){const n=e.children,l=t.children;if(N(n)&&N(l))for(let o=0;o>1,e[s[r]]0&&(t[n]=s[o-1]),s[o]=n)}}for(o=s.length,i=s[o-1];o-- >0;)s[o]=i,i=t[i];return s}function Mo(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Mo(t)}function hl(e){if(e)for(let t=0;te.__isSuspense;function Mr(e,t){t&&t.pendingBranch?N(e)?t.effects.push(...e):t.effects.push(e):Fi(e)}const se=Symbol.for("v-fgt"),Qs=Symbol.for("v-txt"),bt=Symbol.for("v-cmt"),Us=Symbol.for("v-stc"),as=[];let $e=null;function E(e=!1){as.push($e=e?null:[])}function Rr(){as.pop(),$e=as[as.length-1]||null}let ds=1;function gl(e,t=!1){ds+=e,e<0&&$e&&t&&($e.hasOnce=!0)}function Uo(e){return e.dynamicChildren=ds>0?$e||Nt:null,Rr(),ds>0&&$e&&$e.push(e),e}function T(e,t,s,n,l,o){return Uo(d(e,t,s,n,l,o,!0))}function Ir(e,t,s,n,l){return Uo(je(e,t,s,n,l,!0))}function $o(e){return e?e.__v_isVNode===!0:!1}function Yt(e,t){return e.type===t.type&&e.key===t.key}const jo=({key:e})=>e??null,$s=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?ce(e)||Ce(e)||B(e)?{i:Fe,r:e,k:t,f:!!s}:e:null);function d(e,t=null,s=null,n=0,l=null,o=e===se?0:1,i=!1,r=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&jo(t),ref:t&&$s(t),scopeId:co,slotScopeIds:null,children:s,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:o,patchFlag:n,dynamicProps:l,dynamicChildren:null,appContext:null,ctx:Fe};return r?(Vs(c,s),o&128&&e.normalize(c)):s&&(c.shapeFlag|=ce(s)?8:16),ds>0&&!i&&$e&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&$e.push(c),c}const je=Ur;function Ur(e,t=null,s=null,n=0,l=null,o=!1){if((!e||e===or)&&(e=bt),$o(e)){const r=Kt(e,t,!0);return s&&Vs(r,s),ds>0&&!o&&$e&&(r.shapeFlag&6?$e[$e.indexOf(e)]=r:$e.push(r)),r.patchFlag=-2,r}if(Wr(e)&&(e=e.__vccOpts),t){t=$r(t);let{class:r,style:c}=t;r&&!ce(r)&&(t.class=Ue(r)),te(c)&&(Vn(c)&&!N(c)&&(c=Se({},c)),t.style=Rn(c))}const i=ce(e)?1:Io(e)?128:Gi(e)?64:te(e)?4:B(e)?2:0;return d(e,t,s,n,l,i,o,!0)}function $r(e){return e?Vn(e)||So(e)?Se({},e):e:null}function Kt(e,t,s=!1,n=!1){const{props:l,ref:o,patchFlag:i,children:r,transition:c}=e,m=t?Lr(l||{},t):l,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:m,key:m&&jo(m),ref:t&&t.ref?s&&o?N(o)?o.concat($s(t)):[o,$s(t)]:$s(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==se?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Kt(e.ssContent),ssFallback:e.ssFallback&&Kt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&n&&Bn(h,c.clone(h)),h}function Ne(e=" ",t=0){return je(Qs,null,e,t)}function jr(e,t){const s=je(Us,null,e);return s.staticCount=t,s}function H(e="",t=!1){return t?(E(),Ir(bt,null,e)):je(bt,null,e)}function Qe(e){return e==null||typeof e=="boolean"?je(bt):N(e)?je(se,null,e.slice()):$o(e)?ct(e):je(Qs,null,String(e))}function ct(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Kt(e)}function Vs(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(N(t))s=16;else if(typeof t=="object")if(n&65){const l=t.default;l&&(l._c&&(l._d=!1),Vs(e,l()),l._c&&(l._d=!0));return}else{s=32;const l=t._;!l&&!So(t)?t._ctx=Fe:l===3&&Fe&&(Fe.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(B(t)){if(n&65){Vs(e,{default:t});return}t={default:t,_ctx:Fe},s=32}else t=String(t),n&64?(s=16,t=[Ne(t)]):s=8;e.children=t,e.shapeFlag|=s}function Lr(...e){const t={};for(let s=0;sAe||Fe;let Hs,En;{const e=Js(),t=(s,n)=>{let l;return(l=e[s])||(l=e[s]=[]),l.push(n),o=>{l.length>1?l.forEach(i=>i(o)):l[0](o)}};Hs=t("__VUE_INSTANCE_SETTERS__",s=>Ae=s),En=t("__VUE_SSR_SETTERS__",s=>ps=s)}const vs=e=>{const t=Ae;return Hs(e),e.scope.on(),()=>{e.scope.off(),Hs(t)}},ml=()=>{Ae&&Ae.scope.off(),Hs(null)};function Lo(e){return e.vnode.shapeFlag&4}let ps=!1;function Hr(e,t=!1,s=!1){t&&En(t);const{props:n,children:l}=e.vnode,o=Lo(e);_r(e,n,o,t),kr(e,l,s||t);const i=o?Br(e,t):void 0;return t&&En(!1),i}function Br(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ir);const{setup:n}=s;if(n){nt();const l=e.setupContext=n.length>1?zr(e):null,o=vs(e),i=ms(n,e,0,[e.props,l]),r=$l(i);if(lt(),o(),(r||e.sp)&&!is(e)&&po(e),r){if(i.then(ml,ml),t)return i.then(c=>{vl(e,c)}).catch(c=>{Ys(c,e,0)});e.asyncDep=i}else vl(e,i)}else Do(e)}function vl(e,t,s){B(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:te(t)&&(e.setupState=no(t)),Do(e)}function Do(e,t,s){const n=e.type;e.render||(e.render=n.render||tt);{const l=vs(e);nt();try{rr(e)}finally{lt(),l()}}}const Kr={get(e,t){return we(e,"get",""),e[t]}};function zr(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Kr),slots:e.slots,emit:e.emit,expose:t}}function en(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(no(Oi(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in rs)return rs[s](e)},has(t,s){return s in t||s in rs}})):e.proxy}function Wr(e){return B(e)&&"__vccOpts"in e}const Tn=(e,t)=>$i(e,t,ps),Gr="3.5.39";/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Pn;const bl=typeof window<"u"&&window.trustedTypes;if(bl)try{Pn=bl.createPolicy("vue",{createHTML:e=>e})}catch{}const No=Pn?e=>Pn.createHTML(e):e=>e,Jr="http://www.w3.org/2000/svg",qr="http://www.w3.org/1998/Math/MathML",at=typeof document<"u"?document:null,yl=at&&at.createElement("template"),Yr={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const l=t==="svg"?at.createElementNS(Jr,e):t==="mathml"?at.createElementNS(qr,e):s?at.createElement(e,{is:s}):at.createElement(e);return e==="select"&&n&&n.multiple!=null&&l.setAttribute("multiple",n.multiple),l},createText:e=>at.createTextNode(e),createComment:e=>at.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>at.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,l,o){const i=s?s.previousSibling:t.lastChild;if(l&&(l===o||l.nextSibling))for(;t.insertBefore(l.cloneNode(!0),s),!(l===o||!(l=l.nextSibling)););else{yl.innerHTML=No(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const r=yl.content;if(n==="svg"||n==="mathml"){const c=r.firstChild;for(;c.firstChild;)r.appendChild(c.firstChild);r.removeChild(c)}t.insertBefore(r,s)}return[i?i.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Xr=Symbol("_vtc");function Zr(e,t,s){const n=e[Xr];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Bs=Symbol("_vod"),Fo=Symbol("_vsh"),Xt={name:"show",beforeMount(e,{value:t},{transition:s}){e[Bs]=e.style.display==="none"?"":e.style.display,s&&t?s.beforeEnter(e):Zt(e,t)},mounted(e,{value:t},{transition:s}){s&&t&&s.enter(e)},updated(e,{value:t,oldValue:s},{transition:n}){!t!=!s&&(n?t?(n.beforeEnter(e),Zt(e,!0),n.enter(e)):n.leave(e,()=>{Zt(e,!1)}):Zt(e,t))},beforeUnmount(e,{value:t}){Zt(e,t)}};function Zt(e,t){e.style.display=t?e[Bs]:"none",e[Fo]=!t}const Qr=Symbol(""),ea=/(?:^|;)\s*display\s*:/;function ta(e,t,s){const n=e.style,l=ce(s);let o=!1;if(s&&!l){if(t)if(ce(t))for(const i of t.split(";")){const r=i.slice(0,i.indexOf(":")).trim();s[r]==null&&ts(n,r,"")}else for(const i in t)s[i]==null&&ts(n,i,"");for(const i in s){i==="display"&&(o=!0);const r=s[i];r!=null?na(e,i,!ce(t)&&t?t[i]:void 0,r)||ts(n,i,r):ts(n,i,"")}}else if(l){if(t!==s){const i=n[Qr];i&&(s+=";"+i),n.cssText=s,o=ea.test(s)}}else t&&e.removeAttribute("style");Bs in e&&(e[Bs]=o?n.display:"",e[Fo]&&(n.display="none"))}const xl=/\s*!important$/;function ts(e,t,s){if(N(s))s.forEach(n=>ts(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=sa(e,t);xl.test(s)?e.setProperty(xt(n),s.replace(xl,""),"important"):e[n]=s}}const _l=["Webkit","Moz","ms"],hn={};function sa(e,t){const s=hn[t];if(s)return s;let n=Be(t);if(n!=="filter"&&n in e)return hn[t]=n;n=Dl(n);for(let l=0;l<_l.length;l++){const o=_l[l]+n;if(o in e)return hn[t]=o}return t}function na(e,t,s,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&ce(n)&&s===n}const wl="http://www.w3.org/1999/xlink";function Cl(e,t,s,n,l,o=ai(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(wl,t.slice(6,t.length)):e.setAttributeNS(wl,t,s):s==null||o&&!Fl(s)?e.removeAttribute(t):e.setAttribute(t,o?"":st(s)?String(s):s)}function Sl(e,t,s,n,l){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?No(s):s);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const r=o==="OPTION"?e.getAttribute("value")||"":e.value,c=s==null?e.type==="checkbox"?"on":"":String(s);(r!==c||!("_value"in e))&&(e.value=c),s==null&&e.removeAttribute(t),e._value=s;return}let i=!1;if(s===""||s==null){const r=typeof e[t];r==="boolean"?s=Fl(s):s==null&&r==="string"?(s="",i=!0):r==="number"&&(s=0,i=!0)}try{e[t]=s}catch{}i&&e.removeAttribute(l||t)}function dt(e,t,s,n){e.addEventListener(t,s,n)}function la(e,t,s,n){e.removeEventListener(t,s,n)}const kl=Symbol("_vei");function oa(e,t,s,n,l=null){const o=e[kl]||(e[kl]={}),i=o[t];if(n&&i)i.value=n;else{const[r,c]=aa(t);if(n){const m=o[t]=fa(n,l);dt(e,r,m,c)}else i&&(la(e,r,i,c),o[t]=void 0)}}const ia=/(Once|Passive|Capture)$/,ra=/^on:?(?:Once|Passive|Capture)$/;function aa(e){let t,s;for(;(s=e.match(ia))&&!ra.test(e);)t||(t={}),e=e.slice(0,e.length-s[1].length),t[s[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):xt(e.slice(2)),t]}let gn=0;const ca=Promise.resolve(),ua=()=>gn||(ca.then(()=>gn=0),gn=Date.now());function fa(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const l=s.value;if(N(l)){const o=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{o.call(n),n._stopped=!0};const i=l.slice(),r=[n];for(let c=0;ce.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,da=(e,t,s,n,l,o)=>{const i=l==="svg";t==="class"?Zr(e,n,i):t==="style"?ta(e,s,n):Ks(t)?zs(t)||oa(e,t,s,n,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):pa(e,t,n,i))?(Sl(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Cl(e,t,n,i,o,t!=="value")):e._isVueCE&&(ha(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ce(n)))?Sl(e,Be(t),n,o,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Cl(e,t,n,i))};function pa(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&El(t)&&B(s));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 l=e.tagName;if(l==="IMG"||l==="VIDEO"||l==="CANVAS"||l==="SOURCE")return!1}return El(t)&&ce(s)?!1:t in e}function ha(e,t){const s=e._def.props;if(!s)return!1;const n=Be(t);return Array.isArray(s)?s.some(l=>Be(l)===n):Object.keys(s).some(l=>Be(l)===n)}const yt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return N(t)?s=>Rs(t,s):t};function ga(e){e.target.composing=!0}function Tl(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const He=Symbol("_assign");function Pl(e,t,s){return t&&(e=e.trim()),s&&(e=Gs(e)),e}const _e={created(e,{modifiers:{lazy:t,trim:s,number:n}},l){e[He]=yt(l);const o=n||l.props&&l.props.type==="number";dt(e,t?"change":"input",i=>{i.target.composing||e[He](Pl(e.value,s,o))}),(s||o)&&dt(e,"change",()=>{e.value=Pl(e.value,s,o)}),t||(dt(e,"compositionstart",ga),dt(e,"compositionend",Tl),dt(e,"change",Tl))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:l,number:o}},i){if(e[He]=yt(i),e.composing)return;const r=(o||e.type==="number")&&!/^0\d/.test(e.value)?Gs(e.value):e.value,c=t??"";if(r===c)return;const m=e.getRootNode();(m instanceof Document||m instanceof ShadowRoot)&&m.activeElement===e&&e.type!=="range"&&(n&&t===s||l&&e.value.trim()===c)||(e.value=c)}},Vo={deep:!0,created(e,t,s){e[He]=yt(s),dt(e,"change",()=>{const n=e._modelValue,l=zt(e),o=e.checked,i=e[He];if(N(n)){const r=In(n,l),c=r!==-1;if(o&&!c)i(n.concat(l));else if(!o&&c){const m=[...n];m.splice(r,1),i(m)}}else if(Wt(n)){const r=new Set(n);o?r.add(l):r.delete(l),i(r)}else i(Ho(e,o))})},mounted:Al,beforeUpdate(e,t,s){e[He]=yt(s),Al(e,t,s)}};function Al(e,{value:t,oldValue:s},n){e._modelValue=t;let l;if(N(t))l=In(t,n.props.value)>-1;else if(Wt(t))l=t.has(n.props.value);else{if(t===s)return;l=vt(t,Ho(e,!0))}e.checked!==l&&(e.checked=l)}const ma={created(e,{value:t},s){e.checked=vt(t,s.props.value),e[He]=yt(s),dt(e,"change",()=>{e[He](zt(e))})},beforeUpdate(e,{value:t,oldValue:s},n){e[He]=yt(n),t!==s&&(e.checked=vt(t,n.props.value))}},Dt={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const l=Wt(t);dt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>s?Gs(zt(i)):zt(i));e[He](e.multiple?l?new Set(o):o:o[0]),e._assigning=!0,oo(()=>{e._assigning=!1})}),e[He]=yt(n)},mounted(e,{value:t}){Ol(e,t)},beforeUpdate(e,t,s){e[He]=yt(s)},updated(e,{value:t}){e._assigning||Ol(e,t)}};function Ol(e,t){const s=e.multiple,n=N(t);if(!(s&&!n&&!Wt(t))){for(let l=0,o=e.options.length;lString(m)===String(r)):i.selected=In(t,r)>-1}else i.selected=t.has(r);else if(vt(zt(i),t)){e.selectedIndex!==l&&(e.selectedIndex=l);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function zt(e){return"_value"in e?e._value:e.value}function Ho(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const va={created(e,t,s){Os(e,t,s,null,"created")},mounted(e,t,s){Os(e,t,s,null,"mounted")},beforeUpdate(e,t,s,n){Os(e,t,s,n,"beforeUpdate")},updated(e,t,s,n){Os(e,t,s,n,"updated")}};function ba(e,t){switch(e){case"SELECT":return Dt;case"TEXTAREA":return _e;default:switch(t){case"checkbox":return Vo;case"radio":return ma;default:return _e}}}function Os(e,t,s,n,l){const i=ba(e.tagName,s.props&&s.props.type)[l];i&&i(e,t,s,n)}const ya=["ctrl","shift","alt","meta"],xa={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)=>ya.some(s=>e[`${s}Key`]&&!t.includes(s))},_a=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((l,...o)=>{for(let i=0;i{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(l=>{if(!("key"in l))return;const o=xt(l.key);if(t.some(i=>i===o||wa[i]===o))return e(l)}))},Ca=Se({patchProp:da},Yr);let Rl;function Sa(){return Rl||(Rl=Tr(Ca))}const ka=((...e)=>{const t=Sa().createApp(...e),{mount:s}=t;return t.mount=n=>{const l=Ta(n);if(!l)return;const o=t._component;!B(o)&&!o.render&&!o.template&&(o.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const i=s(l,!1,Ea(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),i},t});function Ea(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ta(e){return ce(e)?document.querySelector(e):e}const Bo="pilotvault-theme";function Pa(){try{return localStorage.getItem(Bo)==="dark"?"dark":"light"}catch{return"light"}}const hs=L(Pa());function Ko(e){hs.value=e,document.documentElement.setAttribute("data-theme",e);try{localStorage.setItem(Bo,e)}catch{}}function Il(){Ko(hs.value==="dark"?"light":"dark")}Ko(hs.value);const Aa={class:"overflow-hidden rounded-lg border border-subtle bg-card shadow-xs"},Oa={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},Ma={class:"text-base font-semibold text-primary"},Ra={class:"pv-eyebrow"},Ia={class:"w-full text-left text-sm"},Ua={class:"border-t border-subtle px-5 py-2.5 font-mono text-xs whitespace-nowrap"},$a={class:"text-primary"},ja={class:"border-t border-subtle px-5 py-2.5 text-secondary"},mn={__name:"EndpointTable",props:{title:String,auth:String,endpoints:Array},setup(e){const t={GET:"text-success",POST:"text-brand-text",PATCH:"text-warning",DELETE:"text-danger"};return(s,n)=>(E(),T("div",Aa,[d("div",Oa,[d("div",Ma,O(e.title),1),d("span",Ra,O(e.auth),1)]),d("table",Ia,[n[0]||(n[0]=d("thead",null,[d("tr",{class:"pv-eyebrow"},[d("th",{class:"px-5 py-2.5 font-medium"},"Endpoint"),d("th",{class:"px-5 py-2.5 font-medium"},"Description")])],-1)),d("tbody",null,[(E(!0),T(se,null,xe(e.endpoints,l=>(E(),T("tr",{key:l.method+l.path,class:"transition-colors hover:bg-sunken"},[d("td",Ua,[d("span",{class:Ue(["font-semibold",t[l.method]])},O(l.method),3),d("span",$a,O(l.path),1)]),d("td",ja,O(l.desc),1)]))),128))])])]))}},La={class:"mx-auto flex max-w-5xl flex-col gap-6 px-6 pt-12 pb-16"},Da={class:"flex items-center gap-3"},Na={key:0,class:"pv-eyebrow hidden truncate sm:inline"},Fa=["title"],Va={key:0,class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ha={key:1,class:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ba={key:0,class:"rounded-lg border border-subtle bg-card px-5 py-10 text-center shadow-sm"},Ka={key:1,class:"mx-auto w-full max-w-sm rounded-lg border border-subtle bg-card shadow-sm"},za={class:"flex flex-col gap-1"},Wa={class:"flex flex-col gap-1"},Ga={key:0,class:"rounded-sm bg-danger-tint px-3 py-2 text-xs font-medium text-danger"},Ja=["disabled"],qa={class:"flex gap-1 self-start rounded-lg border border-subtle bg-card p-1 shadow-sm"},Ya=["onClick"],Xa={class:"flex flex-col gap-6"},Za={class:"rounded-lg border border-subtle bg-card shadow-sm"},Qa={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},ec={class:"pv-eyebrow"},tc={class:"min-w-0"},sc={class:"text-sm font-semibold text-primary"},nc={key:0,class:"truncate font-mono text-xs text-secondary"},lc={class:"flex items-center justify-between gap-3 border-t border-subtle px-5 py-3.5"},oc={class:"font-mono text-xs text-secondary"},ic={class:"flex flex-col gap-6"},rc={class:"rounded-lg border border-subtle bg-card shadow-sm"},ac={class:"flex flex-col gap-3 px-5 py-5"},cc={class:"flex flex-col gap-3 sm:flex-row"},uc={class:"flex flex-1 flex-col gap-1"},fc={class:"flex flex-1 flex-col gap-1"},dc={class:"flex flex-col gap-3 sm:flex-row"},pc={class:"flex flex-1 flex-col gap-1"},hc=["value"],gc={class:"flex flex-1 flex-col gap-1"},mc=["value"],vc={key:0,class:"rounded-sm bg-danger-tint px-3 py-2 text-xs font-medium text-danger"},bc={key:1,class:"rounded-sm bg-success-tint px-3 py-2 text-xs font-medium text-success"},yc=["disabled"],xc={class:"rounded-lg border border-subtle bg-card shadow-sm"},_c={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},wc={class:"pv-eyebrow"},Cc={class:"flex flex-col"},Sc={key:0,class:"px-5 py-3 text-xs font-medium text-danger"},kc={key:1,class:"border-b border-subtle bg-sunken px-5 py-2.5 font-mono text-xs text-secondary"},Ec={key:2,class:"px-5 py-6 text-sm text-secondary"},Tc={class:"flex flex-wrap items-center gap-x-3 gap-y-2"},Pc={class:"min-w-0 flex-1"},Ac={class:"flex flex-wrap items-center gap-2"},Oc={class:"truncate text-sm font-semibold text-primary"},Mc={key:0,class:"rounded-sm bg-brand/10 px-1.5 py-0.5 font-mono text-[10px] font-medium text-brand-text"},Rc={key:1,class:"rounded-sm bg-warning-tint px-1.5 py-0.5 font-mono text-[10px] font-medium text-warning"},Ic={class:"mt-0.5 font-mono text-xs text-secondary"},Uc={class:"flex shrink-0 items-center gap-2"},$c=["onClick"],jc=["disabled","onClick"],Lc={key:0,class:"mt-3 flex flex-col gap-3 rounded-md border border-subtle bg-sunken px-4 py-4"},Dc={class:"flex flex-col gap-3 sm:flex-row"},Nc={class:"flex flex-1 flex-col gap-1"},Fc={class:"flex flex-1 flex-col gap-1"},Vc={class:"flex flex-col gap-3 sm:flex-row"},Hc={class:"flex flex-1 flex-col gap-1"},Bc=["disabled"],Kc=["value"],zc={key:0,class:"text-[11px] text-muted"},Wc={class:"flex flex-1 flex-col gap-1"},Gc=["value"],Jc={class:"flex items-center gap-2"},qc={class:"flex items-center gap-2"},Yc=["disabled","onClick"],Xc={class:"flex flex-col gap-6"},Zc={class:"rounded-lg border border-subtle bg-card shadow-sm"},Qc={class:"flex flex-col gap-3 px-5 py-5"},eu={class:"flex flex-col gap-2 sm:flex-row"},tu=["disabled"],su={key:0,class:"rounded-sm bg-danger-tint px-3 py-2 text-xs font-medium text-danger"},nu={key:1,class:"rounded-sm bg-success-tint px-3 py-2 text-xs font-medium text-success"},lu={class:"rounded-lg border border-subtle bg-card shadow-sm"},ou={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},iu={class:"pv-eyebrow"},ru={class:"flex flex-col"},au={key:0,class:"border-b border-subtle bg-sunken px-5 py-2.5 font-mono text-xs text-secondary"},cu={key:1,class:"px-5 py-6 text-sm text-secondary"},uu={class:"flex flex-wrap items-center gap-x-3 gap-y-2"},fu={class:"min-w-0 flex-1"},du={class:"truncate text-sm font-semibold text-primary"},pu={class:"mt-0.5 font-mono text-xs text-secondary"},hu={class:"flex shrink-0 items-center gap-2"},gu=["onClick"],mu=["disabled","title","onClick"],vu={key:0,class:"mt-3 flex flex-col gap-2 rounded-md border border-subtle bg-sunken px-4 py-4 sm:flex-row sm:items-end"},bu={class:"flex flex-1 flex-col gap-1"},yu=["onKeyup"],xu={class:"flex items-center gap-2"},_u=["disabled","onClick"],wu={class:"flex flex-col gap-6"},Cu={class:"rounded-lg border border-subtle bg-card shadow-sm"},Su={class:"flex items-center justify-between border-b border-subtle px-5 py-4"},ku={class:"flex flex-col gap-3 px-5 py-5"},Eu={class:"flex flex-col gap-1"},Tu={class:"flex flex-col gap-1"},Pu={class:"flex flex-col gap-1"},Au=["placeholder"],Ou={key:0,class:"font-mono text-[11px] text-muted"},Mu={key:0},Ru={key:1},Iu={key:1,class:"rounded-sm bg-danger-tint px-3 py-2 text-xs font-medium text-danger"},Uu={key:2,class:"rounded-sm bg-success-tint px-3 py-2 text-xs font-medium text-success"},$u={class:"flex flex-wrap items-center gap-2"},ju=["disabled"],Lu=["disabled"],Du={class:"flex flex-col gap-6"},Nu={class:"rounded-lg border border-subtle bg-card shadow-sm"},Fu={class:"flex flex-col"},Vu={key:0,class:"px-5 py-3 text-xs font-medium text-danger"},Hu={key:1,class:"border-b border-subtle bg-sunken px-5 py-2.5 font-mono text-xs text-secondary"},Bu={key:2,class:"px-5 py-6 text-sm text-secondary"},Ku={key:3,class:"flex gap-1 overflow-x-auto overflow-y-hidden border-b border-subtle px-3 pt-1"},zu=["onClick"],Wu={key:4,class:"px-5 py-6 text-sm text-secondary"},Gu={class:"flex flex-wrap items-center gap-x-3 gap-y-2"},Ju={class:"min-w-0 flex-1"},qu={class:"flex flex-wrap items-center gap-2"},Yu={class:"text-sm font-semibold text-primary"},Xu=["title"],Zu={key:0},Qu={class:"mt-0.5 font-mono text-xs text-secondary"},ef={key:0,class:"mt-0.5 text-[11px] text-secondary"},tf={key:1,class:"mt-2 flex flex-col gap-1.5"},sf={class:"rounded-sm bg-sunken px-1.5 py-0.5 font-mono text-[10px] text-secondary"},nf={key:0,class:"font-mono text-[10px] text-muted"},lf={key:1,class:"w-full text-[11px] text-secondary sm:w-auto"},of={key:2,class:"mt-1 truncate font-mono text-[11px] text-muted"},rf={class:"flex shrink-0 items-center gap-2"},af=["disabled","onClick"],cf=["onClick"],uf=["disabled","onClick"],ff=["disabled","onClick"],df={key:0,class:"mt-3 flex flex-col gap-2 rounded-md border border-subtle bg-sunken px-4 py-4"},pf={class:"pv-eyebrow"},hf={key:0,class:"text-danger"},gf=["onUpdate:modelValue"],mf=["value"],vf=["value","onChange"],bf=["label"],yf=["value"],xf=["onUpdate:modelValue"],_f=["onUpdate:modelValue","type","placeholder"],wf={key:3,class:"text-[11px] text-muted"},Cf={class:"flex items-center gap-2"},Sf=["disabled","onClick"],kf={class:"border-t border-subtle px-5 py-4"},Ef={class:"flex flex-col gap-2 sm:flex-row"},Tf=["disabled"],Pf={key:0,class:"mt-2 text-xs font-medium text-danger"},Ms="pv_panel_token",Af={__name:"App",setup(e){const t=L(localStorage.getItem(Ms)||""),s=L(null),n=L(!1),l=L(!0),o=L({email:"",password:""}),i=L(""),r=L(!1),c=L("overview"),m=[{id:"overview",label:"Overview"},{id:"users",label:"Users"},{id:"organizations",label:"Organizations"},{id:"pocketbase",label:"PocketBase"},{id:"plugins",label:"Plugins"}];async function h(g){try{const u=await fetch("/api/me",{headers:{Authorization:g}});if(!u.ok)return!1;const f=await u.json();return f.role!=="superadmin"?!1:(s.value={id:f.id,email:f.email,role:f.role},!0)}catch{return!1}}async function y(g){t.value=g,localStorage.setItem(Ms,g),n.value=!0,Zn(),Re(),gt(),Ut(),he()}async function M(){i.value="";const g=o.value.email.trim().toLowerCase();if(!g||!o.value.password){i.value="Enter your email and password.";return}r.value=!0;try{const u=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:g,password:o.value.password})}),f=await u.json().catch(()=>({}));if(!u.ok||!f.token){i.value="Invalid email or password.";return}if(!await h(f.token)){i.value="Access to this panel is restricted to superadmins.";return}o.value.password="",await y(f.token)}catch{i.value="Cannot reach the API server."}finally{r.value=!1}}function I(){Qn(),localStorage.removeItem(Ms),t.value="",s.value=null,n.value=!1}const J=L(null),U=L({url:"",adminEmail:"",adminPassword:""}),W=L(null),Y=L(""),V=L(""),X=L(!1),j=L(!1);function z(g){const u={Authorization:t.value};return g&&(u["Content-Type"]="application/json"),u}async function Re(){try{const g=await fetch("/api/admin/pb-config",{headers:z()});if(!g.ok)return;const u=await g.json();J.value=u,U.value={url:u.url||"",adminEmail:u.adminEmail||"",adminPassword:""},W.value=u.probe||null}catch{}}async function Le(){Y.value="",V.value="",j.value=!0;try{const g=await fetch("/api/admin/pb-config/test",{method:"POST",headers:z(!0),body:JSON.stringify(U.value)});W.value=await g.json()}catch{V.value="Could not run the test."}finally{j.value=!1}}async function Ge(){var g;if(Y.value="",V.value="",!U.value.url.trim()){V.value="A PocketBase URL is required.";return}X.value=!0;try{const u=await fetch("/api/admin/pb-config",{method:"PUT",headers:z(!0),body:JSON.stringify(U.value)}),f=await u.json().catch(()=>({}));if(!u.ok){V.value=f.error||"Could not save the connection.";return}J.value=f.config,W.value=((g=f.config)==null?void 0:g.probe)||null,U.value={url:f.config.url,adminEmail:f.config.adminEmail,adminPassword:""},Y.value=f.warning||"Connection saved."}catch{V.value="Could not reach the API server."}finally{X.value=!1}}const De=L([]),Oe=L(""),de=L(""),Je=L(""),ke=L({}),be=L(""),Gt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},{label:"European countries",options:[{value:"39.6,19.3,42.7,21.1",label:"Albania"},{value:"42.4,1.4,42.7,1.8",label:"Andorra"},{value:"46.4,9.5,49.0,17.2",label:"Austria"},{value:"51.2,23.2,56.2,32.8",label:"Belarus"},{value:"49.5,2.5,51.5,6.4",label:"Belgium"},{value:"42.6,15.7,45.3,19.6",label:"Bosnia and Herzegovina"},{value:"41.2,22.4,44.2,28.6",label:"Bulgaria"},{value:"42.4,13.5,46.6,19.4",label:"Croatia"},{value:"34.6,32.3,35.7,34.6",label:"Cyprus"},{value:"48.6,12.1,51.1,18.9",label:"Czechia"},{value:"54.6,8.1,57.8,12.7",label:"Denmark"},{value:"57.5,21.8,59.7,28.2",label:"Estonia"},{value:"59.8,20.6,70.1,31.6",label:"Finland"},{value:"41.3,-5.2,51.1,9.6",label:"France"},{value:"47.2,5.8,55.1,15.1",label:"Germany"},{value:"34.8,19.4,41.8,28.3",label:"Greece"},{value:"45.7,16.1,48.6,22.9",label:"Hungary"},{value:"63.3,-24.6,66.6,-13.5",label:"Iceland"},{value:"51.4,-10.6,55.4,-6.0",label:"Ireland"},{value:"36.6,6.6,47.1,18.6",label:"Italy"},{value:"41.8,20.0,43.3,21.8",label:"Kosovo"},{value:"55.7,20.9,58.1,28.2",label:"Latvia"},{value:"47.0,9.4,47.3,9.6",label:"Liechtenstein"},{value:"53.9,20.9,56.5,26.9",label:"Lithuania"},{value:"49.4,5.7,50.2,6.5",label:"Luxembourg"},{value:"35.8,14.1,36.1,14.6",label:"Malta"},{value:"45.4,26.6,48.5,30.2",label:"Moldova"},{value:"43.72,7.40,43.75,7.44",label:"Monaco"},{value:"41.8,18.4,43.6,20.4",label:"Montenegro"},{value:"50.7,3.3,53.7,7.2",label:"Netherlands"},{value:"40.8,20.4,42.4,23.0",label:"North Macedonia"},{value:"57.9,4.6,71.2,31.1",label:"Norway"},{value:"49.0,14.1,54.9,24.2",label:"Poland"},{value:"36.9,-9.5,42.2,-6.2",label:"Portugal"},{value:"43.6,20.2,48.3,29.7",label:"Romania"},{value:"41.2,19.6,81.9,180",label:"Russia"},{value:"43.89,12.40,43.99,12.52",label:"San Marino"},{value:"42.2,18.8,46.2,23.0",label:"Serbia"},{value:"47.7,16.8,49.6,22.6",label:"Slovakia"},{value:"45.4,13.4,46.9,16.6",label:"Slovenia"},{value:"35.9,-9.4,43.8,3.4",label:"Spain"},{value:"55.3,11.1,69.1,24.2",label:"Sweden"},{value:"45.8,5.9,47.8,10.5",label:"Switzerland"},{value:"35.8,25.7,42.3,44.8",label:"Turkey"},{value:"44.4,22.1,52.4,40.2",label:"Ukraine"},{value:"49.9,-8.7,60.9,1.8",label:"United Kingdom"},{value:"41.900,12.445,41.908,12.458",label:"Vatican City"}]},{label:"Other countries",options:[{value:"24,-125,49.5,-66.5",label:"United States"},{value:"41.7,-141,83.1,-52.6",label:"Canada"},{value:"-43.6,113.3,-10.7,153.6",label:"Australia"},{value:"24,122.9,45.5,145.8",label:"Japan"}]}],ge=Gt.flatMap(g=>g.options);function le(g){const u=String(g||"").split(",").map(C=>C.trim());if(u.length!==4)return"";const f=u.map(Number);return f.some(C=>Number.isNaN(C))?"":f.join(",")}const q=L({});function qe(g){if(q.value[g])return"__custom__";const u=le(ke.value[g]),f=u&&ge.find(C=>le(C.value)===u);return f?f.value:"__custom__"}function At(g,u){if(u==="__custom__"){q.value={...q.value,[g]:!0};return}q.value={...q.value,[g]:!1},ke.value[g]=u}const ye=L({name:"",baseURL:"",provider:""}),me=L(""),_t=L(!1),tn=[{id:"apis-external",label:"APIs — External"},{id:"drives-external",label:"Drives — External"},{id:"drives-local",label:"Drives — Local"}],Jt=L("apis-external");function wt(g){return g.category||"apis-external"}function Ot(g){return De.value.filter(u=>wt(u)===g)}const Mt=Tn(()=>Ot(Jt.value)),bs={builtin:"bg-success-tint text-success",external:"bg-warning-tint text-warning"},Ct={ok:"bg-success-tint text-success",degraded:"bg-warning-tint text-warning",down:"bg-danger-tint text-danger"};async function gt(){Oe.value="";try{const g=await fetch("/api/admin/plugins",{headers:z()});if(!g.ok){Oe.value="Could not load plugins.";return}const u=await g.json();De.value=u.plugins||[];for(const f of De.value)f.enabled&&!f.health&&a(f.name)}catch{Oe.value="Could not reach the API server."}}async function a(g){try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(g)}/health`,{method:"POST",headers:z()}),f=await u.json().catch(()=>({}));if(u.ok&&f.health){const C=p(g);C&&(C.health=f.health)}}catch{}}function p(g){return De.value.find(u=>u.name===g)}async function v(g){be.value=g.name,de.value="";try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(g.name)}`,{method:"PUT",headers:z(!0),body:JSON.stringify({enabled:!g.enabled})}),f=await u.json().catch(()=>({}));u.ok?f.warning&&(de.value=`${g.name}: ${f.warning}`):de.value=f.error||"Could not update the plugin.",await gt()}finally{be.value=""}}function w(g){Je.value=Je.value===g.name?"":g.name;const u={...g.config||{}};for(const f of g.configFields||[])u[f.key]===void 0&&f.default&&(u[f.key]=f.default);ke.value=u,q.value={}}async function _(g){be.value=g.name,de.value="";try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(g.name)}`,{method:"PUT",headers:z(!0),body:JSON.stringify({config:ke.value})}),f=await u.json().catch(()=>({}));u.ok?(de.value=f.warning?`${g.name}: ${f.warning}`:"Configuration saved.",Je.value=""):de.value=f.error||"Could not save the configuration.",await gt()}finally{be.value=""}}async function x(g){be.value=g.name,de.value="";try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(g.name)}/health`,{method:"POST",headers:z()}),f=await u.json().catch(()=>({}));if(u.ok&&f.health){const C=p(g.name);C&&(C.health=f.health)}else de.value=f.error||"Health check failed."}finally{be.value=""}}async function P(g){if(g.kind==="external"){be.value=g.name;try{const u=await fetch(`/api/admin/plugins/${encodeURIComponent(g.name)}`,{method:"DELETE",headers:z()});if(!u.ok){const f=await u.json().catch(()=>({}));de.value=f.error||"Could not remove the plugin."}await gt()}finally{be.value=""}}}async function k(){if(me.value="",!ye.value.name.trim()||!ye.value.baseURL.trim()){me.value="Name and base URL are required.";return}_t.value=!0;try{const g=await fetch("/api/admin/plugins",{method:"POST",headers:z(!0),body:JSON.stringify(ye.value)}),u=await g.json().catch(()=>({}));if(!g.ok){me.value=u.error||"Could not register the plugin.";return}ye.value={name:"",baseURL:"",provider:""},de.value="External plugin registered.",await gt()}catch{me.value="Could not reach the API server."}finally{_t.value=!1}}const S=L([]),b=L([]),R=L(""),A=[{value:"user",label:"User"},{value:"admin",label:"Admin"},{value:"superadmin",label:"Superadmin"}],$={user:"User",admin:"Admin",superadmin:"Superadmin"},D={user:"bg-sunken text-secondary",admin:"bg-warning-tint text-warning",superadmin:"bg-success-tint text-success"},K=Tn(()=>{const g={};for(const u of S.value)u.organization&&(g[u.organization]=(g[u.organization]||0)+1);return g});function G(g,u){if(!g)return u;if(g.error)return g.error;if(g.data&&typeof g.data=="object"){const f=[];for(const C in g.data)g.data[C]&&g.data[C].message&&f.push(`${C}: ${g.data[C].message}`);if(f.length)return f.join("; ")}return g.message||u}const F=L({email:"",password:"",role:"user",organization:""}),ee=L(""),ae=L(""),Ee=L(!1),ue=L(""),pe=L({}),ot=L(""),oe=L("");async function he(){R.value="";try{const g=await fetch("/api/users",{headers:z()}),u=await g.json().catch(()=>({}));if(!g.ok){R.value=G(u,"Could not load users.");return}S.value=u.users||[]}catch{R.value="Could not reach the API server."}}async function ys(){ee.value="",ae.value="";const g=F.value.email.trim().toLowerCase();if(!g||!g.includes("@")){ee.value="A valid email is required.";return}if(F.value.password.length<8){ee.value="Password must be at least 8 characters.";return}Ee.value=!0;try{const u=await fetch("/api/users",{method:"POST",headers:z(!0),body:JSON.stringify({email:g,password:F.value.password,role:F.value.role,organization:F.value.organization})}),f=await u.json().catch(()=>({}));if(!u.ok){ee.value=G(f,"Could not create the user.");return}F.value={email:"",password:"",role:"user",organization:""},ae.value=`Created ${f.user?f.user.email:"user"}.`,await he()}catch{ee.value="Could not reach the API server."}finally{Ee.value=!1}}function xs(g){oe.value="",ue.value=ue.value===g.id?"":g.id,pe.value={email:g.email,role:g.role,organization:g.organization||"",verified:!!g.verified,password:""}}async function zo(g){oe.value="",ot.value=g.id;try{const u={},f=pe.value;if(f.email.trim().toLowerCase()!==g.email&&(u.email=f.email.trim().toLowerCase()),f.role!==g.role&&(u.role=f.role),(f.organization||"")!==(g.organization||"")&&(u.organization=f.organization||""),f.verified!==!!g.verified&&(u.verified=f.verified),f.password&&(u.password=f.password),Object.keys(u).length===0){oe.value="No changes to save.";return}const C=await fetch(`/api/users/${encodeURIComponent(g.id)}`,{method:"PATCH",headers:z(!0),body:JSON.stringify(u)}),fe=await C.json().catch(()=>({}));if(!C.ok){oe.value=G(fe,"Could not update the user.");return}oe.value=`Updated ${g.email}.`,ue.value="",await he()}catch{oe.value="Could not reach the API server."}finally{ot.value=""}}async function Wo(g){if(g.id!==(s.value&&s.value.id)&&confirm(`Delete user ${g.email}? This cannot be undone.`)){oe.value="",ot.value=g.id;try{const u=await fetch(`/api/users/${encodeURIComponent(g.id)}`,{method:"DELETE",headers:z()}),f=await u.json().catch(()=>({}));if(!u.ok){oe.value=G(f,"Could not delete the user.");return}oe.value=`Deleted ${g.email}.`,ue.value===g.id&&(ue.value=""),await he()}catch{oe.value="Could not reach the API server."}finally{ot.value=""}}}const _s=L(""),Rt=L(""),ws=L(""),Cs=L(!1),it=L(""),Ss=L(""),It=L(""),Ie=L("");async function Ut(){try{const g=await fetch("/api/orgs",{headers:z()});if(!g.ok)return;const u=await g.json().catch(()=>({}));b.value=u.organizations||[]}catch{}}async function Gn(){Rt.value="",ws.value="";const g=_s.value.trim();if(!g){Rt.value="An organization name is required.";return}Cs.value=!0;try{const u=await fetch("/api/orgs",{method:"POST",headers:z(!0),body:JSON.stringify({name:g})}),f=await u.json().catch(()=>({}));if(!u.ok){Rt.value=G(f,"Could not create the organization.");return}_s.value="",ws.value=`Created ${f.organization?f.organization.name:"organization"}.`,await Ut()}catch{Rt.value="Could not reach the API server."}finally{Cs.value=!1}}function Go(g){Ie.value="",it.value=it.value===g.id?"":g.id,Ss.value=g.name}async function Jn(g){Ie.value="";const u=Ss.value.trim();if(!u){Ie.value="An organization name is required.";return}if(u===g.name){it.value="";return}It.value=g.id;try{const f=await fetch(`/api/orgs/${encodeURIComponent(g.id)}`,{method:"PATCH",headers:z(!0),body:JSON.stringify({name:u})}),C=await f.json().catch(()=>({}));if(!f.ok){Ie.value=G(C,"Could not rename the organization.");return}Ie.value=`Renamed to ${u}.`,it.value="",await Ut(),await he()}catch{Ie.value="Could not reach the API server."}finally{It.value=""}}async function Jo(g){const u=K.value[g.id]||0;if(u>0){Ie.value=`${g.name} still has ${u} member${u===1?"":"s"}; reassign or remove them first.`;return}if(confirm(`Delete organization ${g.name}?`)){Ie.value="",It.value=g.id;try{const f=await fetch(`/api/orgs/${encodeURIComponent(g.id)}`,{method:"DELETE",headers:z()}),C=await f.json().catch(()=>({}));if(!f.ok){Ie.value=G(C,"Could not delete the organization.");return}Ie.value=`Deleted ${g.name}.`,it.value===g.id&&(it.value=""),await Ut()}catch{Ie.value="Could not reach the API server."}finally{It.value=""}}}const sn=L(null),ks=L(null),$t=L({apiServer:{status:"checking",detail:""},pocketBase:{status:"checking",detail:""},webApp:{status:"checking",detail:""}});let Es=null;const qo=[{key:"apiServer",label:"API server"},{key:"pocketBase",label:"PocketBase"},{key:"webApp",label:"Web App"}],qn={checking:{label:"checking",cls:"bg-sunken text-secondary"},ok:{label:"operational",cls:"bg-success-tint text-success"},down:{label:"unreachable",cls:"bg-danger-tint text-danger"},unreachable:{label:"unreachable",cls:"bg-danger-tint text-danger"}};function Yn(g){const u=[];return g.httpStatus&&u.push("HTTP "+g.httpStatus),g.url&&u.push(g.url),typeof g.latencyMs=="number"&&u.push(g.latencyMs+"ms"),u.join(" · ")}async function Xn(){var g,u;try{const f=await fetch("/api/status");if(!f.ok)throw new Error("status "+f.status);const C=await f.json(),fe=C.apiServer||{};ks.value=fe.devices??0,$t.value={apiServer:{status:"ok",detail:""},pocketBase:{status:((g=C.pocketBase)==null?void 0:g.status)==="ok"?"ok":"down",detail:Yn(C.pocketBase||{})},webApp:{status:((u=C.webApp)==null?void 0:u.status)==="ok"?"ok":"down",detail:Yn(C.webApp||{})}}}catch{ks.value=null,$t.value={apiServer:{status:"unreachable",detail:""},pocketBase:{status:"unreachable",detail:""},webApp:{status:"unreachable",detail:""}}}sn.value=new Date}function Zn(){Xn(),clearInterval(Es),Es=setInterval(Xn,1e4)}function Qn(){clearInterval(Es),Es=null}mo(async()=>{t.value&&await h(t.value)?(n.value=!0,Zn(),Re(),gt(),Ut(),he()):t.value&&(localStorage.removeItem(Ms),t.value=""),l.value=!1}),Kn(()=>Qn());const Yo=[{method:"POST",path:"/api/auth/login",desc:"Exchange email + password for a session (via PocketBase)"},{method:"GET",path:"/api/auth/validate",desc:"Validate the current session token"},{method:"GET",path:"/api/me",desc:"Caller's id, email, role, and organization from their token"},{method:"GET",path:"/api/preferences",desc:"Read the caller's saved settings blob"},{method:"PUT",path:"/api/preferences",desc:"Persist the caller's settings onto their user record"},{method:"GET",path:"/api/devices",desc:"List connected devices and last-known state"},{method:"GET",path:"/api/devices/{id}/track",desc:"GPS track history for a device"},{method:"POST",path:"/api/devices/{id}/command",desc:"Send a command down to a device"},{method:"DELETE",path:"/api/devices/{id}",desc:"Forget a device's stored state"},{method:"GET",path:"/ws/ui",desc:"Live telemetry stream (WebSocket)"}],Xo=[{method:"GET",path:"/api/users",desc:"List users (admin: own org · superadmin: all)"},{method:"POST",path:"/api/users",desc:"Create a user {email, password, role, organization?}"},{method:"PATCH",path:"/api/users/{id}",desc:"Edit a user (role/org changes are scope-checked)"},{method:"DELETE",path:"/api/users/{id}",desc:"Delete a user (not self; admins in-org only)"},{method:"GET",path:"/api/orgs",desc:"List organizations (admin: own · superadmin: all)"},{method:"POST",path:"/api/orgs",desc:"Create an organization {name} (superadmin)"},{method:"PATCH",path:"/api/orgs/{id}",desc:"Rename an organization (superadmin)"},{method:"DELETE",path:"/api/orgs/{id}",desc:"Delete an empty organization (superadmin)"},{method:"GET",path:"/api/admin/pb-config",desc:"Read the PocketBase connection + live probe (superadmin)"},{method:"POST",path:"/api/admin/pb-config/test",desc:"Test a candidate connection without applying (superadmin)"},{method:"PUT",path:"/api/admin/pb-config",desc:"Update + persist the PocketBase connection (superadmin)"},{method:"GET",path:"/api/admin/plugins",desc:"List plugins + state + last health (superadmin)"},{method:"POST",path:"/api/admin/plugins",desc:"Register an external plugin {name, baseURL} (superadmin)"},{method:"PUT",path:"/api/admin/plugins/{name}",desc:"Enable/disable + configure a plugin (superadmin)"},{method:"DELETE",path:"/api/admin/plugins/{name}",desc:"Remove an external plugin (superadmin)"},{method:"POST",path:"/api/admin/plugins/{name}/health",desc:"Run a plugin health check (superadmin)"}],Zo=[{method:"GET",path:"/ws/device?id={id}",desc:"Device telemetry uplink (WebSocket)"},{method:"POST",path:"/api/telemetry?id={id}",desc:"Push a single telemetry event over HTTP"},{method:"GET",path:"/healthz",desc:"Readiness probe"}];return(g,u)=>(E(),T("div",La,[d("div",Da,[u[25]||(u[25]=jr('
PilotVault
API server
',3)),n.value&&s.value?(E(),T("span",Na,O(s.value.email),1)):H("",!0),n.value?(E(),T("button",{key:1,class:"pv-btn-sec pv-btn-sm",onClick:I},"Sign out")):H("",!0),d("button",{class:"pv-btn-sec pv-btn-sm",title:Qt(hs)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:u[0]||(u[0]=(...f)=>Qt(Il)&&Qt(Il)(...f))},[Qt(hs)==="dark"?(E(),T("svg",Va,[...u[22]||(u[22]=[d("circle",{cx:"12",cy:"12",r:"4"},null,-1),d("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(E(),T("svg",Ha,[...u[23]||(u[23]=[d("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"},null,-1)])])),u[24]||(u[24]=Ne(" Theme ",-1))],8,Fa)]),l.value?(E(),T("div",Ba,[...u[26]||(u[26]=[d("span",{class:"pv-eyebrow"},"Checking session…",-1)])])):n.value?(E(),T(se,{key:2},[d("div",qa,[(E(),T(se,null,xe(m,f=>d("button",{key:f.id,class:Ue(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",c.value===f.id?"bg-brand text-on-brand":"text-secondary hover:text-primary"]),onClick:C=>c.value=f.id},O(f.label),11,Ya)),64))]),ie(d("div",Xa,[d("div",Za,[d("div",Qa,[u[30]||(u[30]=d("div",{class:"text-base font-semibold text-primary"},"Status",-1)),d("span",ec,O(sn.value?"checked "+sn.value.toLocaleTimeString():"—"),1)]),d("div",null,[(E(),T(se,null,xe(qo,f=>d("div",{key:f.key,class:"flex items-center justify-between gap-3 border-t border-subtle px-5 py-3.5 first:border-t-0"},[d("div",tc,[d("div",sc,O(f.label),1),$t.value[f.key].detail?(E(),T("div",nc,O($t.value[f.key].detail),1)):H("",!0)]),d("span",{class:Ue(["inline-flex shrink-0 items-center gap-1.5 rounded-sm px-2.5 py-1 font-mono text-xs font-medium",qn[$t.value[f.key].status].cls])},[u[31]||(u[31]=d("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),Ne(" "+O(qn[$t.value[f.key].status].label),1)],2)])),64)),d("div",lc,[u[32]||(u[32]=d("div",{class:"text-sm font-semibold text-primary"},"Devices",-1)),d("span",oc,O(ks.value===null?"—":ks.value+" online"),1)])])]),je(mn,{title:"Client API",auth:"PocketBase session",endpoints:Yo}),je(mn,{title:"Management API",auth:"Admin · superadmin",endpoints:Xo}),je(mn,{title:"Device API",auth:"Device uplink",endpoints:Zo})],512),[[Xt,c.value==="overview"]]),ie(d("div",ic,[d("div",rc,[u[38]||(u[38]=d("div",{class:"border-b border-subtle px-5 py-4"},[d("div",{class:"text-base font-semibold text-primary"},"Add user"),d("span",{class:"pv-eyebrow"},"Create an account")],-1)),d("div",ac,[d("div",cc,[d("label",uc,[u[33]||(u[33]=d("span",{class:"pv-eyebrow"},"Email",-1)),ie(d("input",{"onUpdate:modelValue":u[3]||(u[3]=f=>F.value.email=f),type:"email",class:"pv-input",placeholder:"pilot@pilotvault.local",autocomplete:"off",spellcheck:"false"},null,512),[[_e,F.value.email]])]),d("label",fc,[u[34]||(u[34]=d("span",{class:"pv-eyebrow"},"Password",-1)),ie(d("input",{"onUpdate:modelValue":u[4]||(u[4]=f=>F.value.password=f),type:"password",class:"pv-input",placeholder:"min. 8 characters",autocomplete:"new-password"},null,512),[[_e,F.value.password]])])]),d("div",dc,[d("label",pc,[u[35]||(u[35]=d("span",{class:"pv-eyebrow"},"Role",-1)),ie(d("select",{"onUpdate:modelValue":u[5]||(u[5]=f=>F.value.role=f),class:"pv-input"},[(E(),T(se,null,xe(A,f=>d("option",{key:f.value,value:f.value},O(f.label),9,hc)),64))],512),[[Dt,F.value.role]])]),d("label",gc,[u[37]||(u[37]=d("span",{class:"pv-eyebrow"},"Organization",-1)),ie(d("select",{"onUpdate:modelValue":u[6]||(u[6]=f=>F.value.organization=f),class:"pv-input"},[u[36]||(u[36]=d("option",{value:""},"— none —",-1)),(E(!0),T(se,null,xe(b.value,f=>(E(),T("option",{key:f.id,value:f.id},O(f.name),9,mc))),128))],512),[[Dt,F.value.organization]])])]),ee.value?(E(),T("p",vc,O(ee.value),1)):ae.value?(E(),T("p",bc,O(ae.value),1)):H("",!0),d("div",null,[d("button",{class:"pv-btn",disabled:Ee.value,onClick:ys},O(Ee.value?"Creating…":"Create user"),9,yc)])])]),d("div",xc,[d("div",_c,[d("div",null,[u[39]||(u[39]=d("div",{class:"text-base font-semibold text-primary"},"Users",-1)),d("span",wc,O(S.value.length)+" total",1)]),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:he},"Refresh")]),d("div",Cc,[R.value?(E(),T("p",Sc,O(R.value),1)):H("",!0),oe.value?(E(),T("p",kc,O(oe.value),1)):H("",!0),!S.value.length&&!R.value?(E(),T("p",Ec,"No users yet.")):H("",!0),(E(!0),T(se,null,xe(S.value,f=>(E(),T("div",{key:f.id,class:"border-t border-subtle px-5 py-4 first:border-t-0"},[d("div",Tc,[d("div",Pc,[d("div",Ac,[d("span",Oc,O(f.email),1),d("span",{class:Ue(["rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-medium uppercase tracking-wider",D[f.role]])},O($[f.role]||f.role),3),f.id===(s.value&&s.value.id)?(E(),T("span",Mc,"you")):H("",!0),f.verified?H("",!0):(E(),T("span",Rc,"unverified"))]),d("div",Ic,O(f.organizationName||(f.organization?f.organization:"no organization")),1)]),d("div",Uc,[d("button",{class:"pv-btn-sec pv-btn-sm",onClick:C=>xs(f)},O(ue.value===f.id?"Close":"Edit"),9,$c),f.id!==(s.value&&s.value.id)?(E(),T("button",{key:0,class:"pv-btn-sec pv-btn-sm !text-danger",disabled:ot.value===f.id,onClick:C=>Wo(f)}," Delete ",8,jc)):H("",!0)])]),ue.value===f.id?(E(),T("div",Lc,[d("div",Dc,[d("label",Nc,[u[40]||(u[40]=d("span",{class:"pv-eyebrow"},"Email",-1)),ie(d("input",{"onUpdate:modelValue":u[7]||(u[7]=C=>pe.value.email=C),type:"email",class:"pv-input",autocomplete:"off",spellcheck:"false"},null,512),[[_e,pe.value.email]])]),d("label",Fc,[u[41]||(u[41]=d("span",{class:"pv-eyebrow"},"New password",-1)),ie(d("input",{"onUpdate:modelValue":u[8]||(u[8]=C=>pe.value.password=C),type:"password",class:"pv-input",placeholder:"leave blank to keep current",autocomplete:"new-password"},null,512),[[_e,pe.value.password]])])]),d("div",Vc,[d("label",Hc,[u[42]||(u[42]=d("span",{class:"pv-eyebrow"},"Role",-1)),ie(d("select",{"onUpdate:modelValue":u[9]||(u[9]=C=>pe.value.role=C),class:"pv-input",disabled:f.id===(s.value&&s.value.id)},[(E(),T(se,null,xe(A,C=>d("option",{key:C.value,value:C.value},O(C.label),9,Kc)),64))],8,Bc),[[Dt,pe.value.role]]),f.id===(s.value&&s.value.id)?(E(),T("span",zc,"You cannot change your own role.")):H("",!0)]),d("label",Wc,[u[44]||(u[44]=d("span",{class:"pv-eyebrow"},"Organization",-1)),ie(d("select",{"onUpdate:modelValue":u[10]||(u[10]=C=>pe.value.organization=C),class:"pv-input"},[u[43]||(u[43]=d("option",{value:""},"— none —",-1)),(E(!0),T(se,null,xe(b.value,C=>(E(),T("option",{key:C.id,value:C.id},O(C.name),9,Gc))),128))],512),[[Dt,pe.value.organization]])])]),d("label",Jc,[ie(d("input",{"onUpdate:modelValue":u[11]||(u[11]=C=>pe.value.verified=C),type:"checkbox",class:"h-4 w-4"},null,512),[[Vo,pe.value.verified]]),u[45]||(u[45]=d("span",{class:"text-sm text-primary"},"Verified",-1))]),d("div",qc,[d("button",{class:"pv-btn pv-btn-sm",disabled:ot.value===f.id,onClick:C=>zo(f)},"Save changes",8,Yc),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:u[12]||(u[12]=C=>ue.value="")},"Cancel")])])):H("",!0)]))),128))])])],512),[[Xt,c.value==="users"]]),ie(d("div",Xc,[d("div",Zc,[u[46]||(u[46]=d("div",{class:"border-b border-subtle px-5 py-4"},[d("div",{class:"text-base font-semibold text-primary"},"Add organization"),d("span",{class:"pv-eyebrow"},"Create a tenant")],-1)),d("div",Qc,[d("div",eu,[ie(d("input",{"onUpdate:modelValue":u[13]||(u[13]=f=>_s.value=f),class:"pv-input flex-1",placeholder:"Acme Aerial Ltd.",autocomplete:"off",spellcheck:"false",onKeyup:Ml(Gn,["enter"])},null,544),[[_e,_s.value]]),d("button",{class:"pv-btn",disabled:Cs.value,onClick:Gn},O(Cs.value?"Creating…":"Create"),9,tu)]),Rt.value?(E(),T("p",su,O(Rt.value),1)):ws.value?(E(),T("p",nu,O(ws.value),1)):H("",!0)])]),d("div",lu,[d("div",ou,[d("div",null,[u[47]||(u[47]=d("div",{class:"text-base font-semibold text-primary"},"Organizations",-1)),d("span",iu,O(b.value.length)+" total",1)]),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:Ut},"Refresh")]),d("div",ru,[Ie.value?(E(),T("p",au,O(Ie.value),1)):H("",!0),b.value.length?H("",!0):(E(),T("p",cu,"No organizations yet.")),(E(!0),T(se,null,xe(b.value,f=>(E(),T("div",{key:f.id,class:"border-t border-subtle px-5 py-4 first:border-t-0"},[d("div",uu,[d("div",fu,[d("div",du,O(f.name),1),d("div",pu,O(K.value[f.id]||0)+" member"+O((K.value[f.id]||0)===1?"":"s"),1)]),d("div",hu,[d("button",{class:"pv-btn-sec pv-btn-sm",onClick:C=>Go(f)},O(it.value===f.id?"Close":"Rename"),9,gu),d("button",{class:"pv-btn-sec pv-btn-sm !text-danger",disabled:It.value===f.id||(K.value[f.id]||0)>0,title:(K.value[f.id]||0)>0?"Reassign or remove members first":"Delete organization",onClick:C=>Jo(f)}," Delete ",8,mu)])]),it.value===f.id?(E(),T("div",vu,[d("label",bu,[u[48]||(u[48]=d("span",{class:"pv-eyebrow"},"Name",-1)),ie(d("input",{"onUpdate:modelValue":u[14]||(u[14]=C=>Ss.value=C),class:"pv-input",autocomplete:"off",spellcheck:"false",onKeyup:Ml(C=>Jn(f),["enter"])},null,40,yu),[[_e,Ss.value]])]),d("div",xu,[d("button",{class:"pv-btn pv-btn-sm",disabled:It.value===f.id,onClick:C=>Jn(f)},"Save",8,_u),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:u[15]||(u[15]=C=>it.value="")},"Cancel")])])):H("",!0)]))),128))])])],512),[[Xt,c.value==="organizations"]]),ie(d("div",wu,[d("div",Cu,[d("div",Su,[u[50]||(u[50]=d("div",null,[d("div",{class:"text-base font-semibold text-primary"},"PocketBase connection"),d("span",{class:"pv-eyebrow"},"Settings")],-1)),W.value?(E(),T("span",{key:0,class:Ue(["inline-flex shrink-0 items-center gap-1.5 rounded-sm px-2.5 py-1 font-mono text-xs font-medium",W.value.reachable?W.value.superuser?"bg-success-tint text-success":"bg-warning-tint text-warning":"bg-danger-tint text-danger"])},[u[49]||(u[49]=d("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),Ne(" "+O(W.value.reachable?W.value.superuser?"connected":"reachable":"unreachable"),1)],2)):H("",!0)]),d("div",ku,[d("label",Eu,[u[51]||(u[51]=d("span",{class:"pv-eyebrow"},"PocketBase URL",-1)),ie(d("input",{"onUpdate:modelValue":u[16]||(u[16]=f=>U.value.url=f),class:"pv-input",placeholder:"http://10.2.1.10:8026",spellcheck:"false"},null,512),[[_e,U.value.url]])]),d("label",Tu,[u[52]||(u[52]=d("span",{class:"pv-eyebrow"},"Service account email",-1)),ie(d("input",{"onUpdate:modelValue":u[17]||(u[17]=f=>U.value.adminEmail=f),class:"pv-input",placeholder:"admin@pilotvault.local",autocomplete:"off",spellcheck:"false"},null,512),[[_e,U.value.adminEmail]])]),d("label",Pu,[u[53]||(u[53]=d("span",{class:"pv-eyebrow"},"Service account password",-1)),ie(d("input",{"onUpdate:modelValue":u[18]||(u[18]=f=>U.value.adminPassword=f),type:"password",class:"pv-input",autocomplete:"new-password",placeholder:J.value&&J.value.adminConfigured?"leave blank to keep current":"set a password"},null,8,Au),[[_e,U.value.adminPassword]])]),W.value?(E(),T("div",Ou,[Ne(" health: "+O(W.value.reachable?"ok":"down"),1),W.value.latencyMs?(E(),T("span",Mu," · "+O(W.value.latencyMs)+"ms",1)):H("",!0),Ne(" · superuser auth: "+O(W.value.superuser?"ok":"—"),1),W.value.detail?(E(),T("span",Ru," · "+O(W.value.detail),1)):H("",!0)])):H("",!0),V.value?(E(),T("p",Iu,O(V.value),1)):Y.value?(E(),T("p",Uu,O(Y.value),1)):H("",!0),d("div",$u,[d("button",{class:"pv-btn",disabled:X.value,onClick:Ge},O(X.value?"Saving…":"Save connection"),9,ju),d("button",{class:"pv-btn-sec",disabled:j.value,onClick:Le},O(j.value?"Testing…":"Test connection"),9,Lu)]),u[54]||(u[54]=d("p",{class:"text-[11px] text-muted"}," The service account is used only for user & organization management. Changing the URL repoints the whole API Server at a new PocketBase and may sign you out. ",-1))])])],512),[[Xt,c.value==="pocketbase"]]),ie(d("div",Du,[d("div",Nu,[d("div",{class:"flex items-center justify-between border-b border-subtle px-5 py-4"},[u[55]||(u[55]=d("div",null,[d("div",{class:"text-base font-semibold text-primary"},"Plugins"),d("span",{class:"pv-eyebrow"},"External integrations")],-1)),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:gt},"Refresh")]),d("div",Fu,[Oe.value?(E(),T("p",Vu,O(Oe.value),1)):H("",!0),de.value?(E(),T("p",Hu,O(de.value),1)):H("",!0),!De.value.length&&!Oe.value?(E(),T("p",Bu,"No plugins registered yet.")):H("",!0),De.value.length?(E(),T("div",Ku,[(E(),T(se,null,xe(tn,f=>d("button",{key:f.id,class:Ue(["-mb-px whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",Jt.value===f.id?"border-brand text-primary":"border-transparent text-secondary hover:text-primary"]),onClick:C=>Jt.value=f.id},O(f.label),11,zu)),64))])):H("",!0),De.value.length&&!Mt.value.length?(E(),T("p",Wu,"No plugins in this category.")):H("",!0),(E(!0),T(se,null,xe(Mt.value,f=>(E(),T("div",{key:f.name,class:"border-t border-subtle px-5 py-4 first:border-t-0"},[d("div",Gu,[d("div",Ju,[d("div",qu,[d("span",Yu,O(f.name),1),d("span",{class:Ue(["rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-medium uppercase tracking-wider",bs[f.kind]])},O(f.kind),3),f.health?(E(),T("span",{key:0,class:Ue(["inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-medium",Ct[f.health.status]]),title:f.health.detail||""},[u[56]||(u[56]=d("span",{class:"h-1 w-1 rounded-full bg-current"},null,-1)),Ne(O(f.health.status),1),f.health.latencyMs?(E(),T("span",Zu," · "+O(f.health.latencyMs)+"ms",1)):H("",!0)],10,Xu)):H("",!0)]),d("div",Qu,O(f.provider)+" · v"+O(f.version)+" · "+O(f.authType),1),f.health&&f.health.detail?(E(),T("div",ef,O(f.health.detail),1)):H("",!0),f.capabilities&&f.capabilities.length?(E(),T("div",tf,[u[57]||(u[57]=d("div",{class:"pv-eyebrow"},"Capabilities",-1)),(E(!0),T(se,null,xe(f.capabilities,C=>(E(),T("div",{key:C.id,class:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5"},[d("span",sf,O(C.id),1),C.method||C.endpoint?(E(),T("span",nf,O(C.method)+" "+O(C.endpoint),1)):H("",!0),C.description?(E(),T("span",lf,O(C.description),1)):H("",!0)]))),128))])):H("",!0),f.baseURL?(E(),T("div",of,O(f.baseURL),1)):H("",!0)]),d("div",rf,[d("button",{class:Ue(["pv-btn-sec pv-btn-sm",f.enabled?"!border-transparent !bg-success-tint !text-success":""]),disabled:be.value===f.name,onClick:C=>v(f)},[d("span",{class:Ue(["h-1.5 w-1.5 rounded-full",f.enabled?"bg-success":"bg-muted"])},null,2),Ne(" "+O(f.enabled?"Enabled":"Disabled"),1)],10,af),f.configFields&&f.configFields.length?(E(),T("button",{key:0,class:"pv-btn-sec pv-btn-sm",onClick:C=>w(f)},"Configure",8,cf)):H("",!0),d("button",{class:"pv-btn-sec pv-btn-sm",disabled:be.value===f.name,onClick:C=>x(f)},"Check",8,uf),f.kind==="external"?(E(),T("button",{key:1,class:"pv-btn-sec pv-btn-sm !text-danger",disabled:be.value===f.name,onClick:C=>P(f)},"Remove",8,ff)):H("",!0)])]),Je.value===f.name?(E(),T("div",df,[(E(!0),T(se,null,xe(f.configFields,C=>(E(),T("label",{key:C.key,class:"flex flex-col gap-1"},[d("span",pf,[Ne(O(C.label),1),C.required?(E(),T("span",hf," *")):H("",!0)]),C.type==="select"?ie((E(),T("select",{key:0,"onUpdate:modelValue":fe=>ke.value[C.key]=fe,class:"pv-input"},[(E(!0),T(se,null,xe(C.options,fe=>(E(),T("option",{key:fe.value,value:fe.value},O(fe.label),9,mf))),128))],8,gf)),[[Dt,ke.value[C.key]]]):C.type==="bbox"?(E(),T(se,{key:1},[d("select",{value:qe(C.key),class:"pv-input",onChange:fe=>At(C.key,fe.target.value)},[(E(),T(se,null,xe(Gt,fe=>d("optgroup",{key:fe.label,label:fe.label},[(E(!0),T(se,null,xe(fe.options,nn=>(E(),T("option",{key:nn.value,value:nn.value},O(nn.label),9,yf))),128))],8,bf)),64)),u[58]||(u[58]=d("option",{value:"__custom__"},"Custom…",-1))],40,vf),qe(C.key)==="__custom__"?ie((E(),T("input",{key:0,"onUpdate:modelValue":fe=>ke.value[C.key]=fe,type:"text",class:"pv-input font-mono",autocomplete:"off",placeholder:"50.5,3.2,53.7,7.3"},null,8,xf)),[[_e,ke.value[C.key]]]):H("",!0)],64)):ie((E(),T("input",{key:2,"onUpdate:modelValue":fe=>ke.value[C.key]=fe,type:C.secret||C.type==="password"?"password":C.type==="number"?"number":"text",class:"pv-input",autocomplete:"off",placeholder:C.help||""},null,8,_f)),[[va,ke.value[C.key]]]),C.help?(E(),T("span",wf,O(C.help),1)):H("",!0)]))),128)),d("div",Cf,[d("button",{class:"pv-btn pv-btn-sm",disabled:be.value===f.name,onClick:C=>_(f)},"Save configuration",8,Sf),d("button",{class:"pv-btn-sec pv-btn-sm",onClick:u[19]||(u[19]=C=>Je.value="")},"Cancel")])])):H("",!0)]))),128)),d("div",kf,[u[59]||(u[59]=d("div",{class:"pv-eyebrow mb-2"},"Register external plugin",-1)),d("div",Ef,[ie(d("input",{"onUpdate:modelValue":u[20]||(u[20]=f=>ye.value.name=f),class:"pv-input sm:w-40",placeholder:"name",autocomplete:"off",spellcheck:"false"},null,512),[[_e,ye.value.name]]),ie(d("input",{"onUpdate:modelValue":u[21]||(u[21]=f=>ye.value.baseURL=f),class:"pv-input flex-1",placeholder:"https://plugin.example.com",autocomplete:"off",spellcheck:"false"},null,512),[[_e,ye.value.baseURL]]),d("button",{class:"pv-btn",disabled:_t.value,onClick:k},O(_t.value?"Adding…":"Add"),9,Tf)]),me.value?(E(),T("p",Pf,O(me.value),1)):H("",!0),u[60]||(u[60]=d("p",{class:"mt-2 text-[11px] text-muted"},[Ne(" A remote service that answers "),d("span",{class:"font-mono"},"GET /health"),Ne(" and "),d("span",{class:"font-mono"},"GET /manifest"),Ne(" — added at runtime, no rebuild. ")],-1))])])])],512),[[Xt,c.value==="plugins"]])],64)):(E(),T("div",Ka,[u[29]||(u[29]=d("div",{class:"border-b border-subtle px-5 py-4"},[d("div",{class:"text-base font-semibold text-primary"},"Sign in"),d("span",{class:"pv-eyebrow"},"Superadmin access only")],-1)),d("form",{class:"flex flex-col gap-3 px-5 py-5",onSubmit:_a(M,["prevent"])},[d("label",za,[u[27]||(u[27]=d("span",{class:"pv-eyebrow"},"Email",-1)),ie(d("input",{"onUpdate:modelValue":u[1]||(u[1]=f=>o.value.email=f),type:"email",autocomplete:"username",class:"pv-input",placeholder:"superadmin@pilotvault.local"},null,512),[[_e,o.value.email]])]),d("label",Wa,[u[28]||(u[28]=d("span",{class:"pv-eyebrow"},"Password",-1)),ie(d("input",{"onUpdate:modelValue":u[2]||(u[2]=f=>o.value.password=f),type:"password",autocomplete:"current-password",class:"pv-input",placeholder:"••••••••"},null,512),[[_e,o.value.password]])]),i.value?(E(),T("p",Ga,O(i.value),1)):H("",!0),d("button",{type:"submit",class:"pv-btn mt-1",disabled:r.value},O(r.value?"Signing in…":"Sign in"),9,Ja)],32)])),u[61]||(u[61]=d("p",{class:"text-center font-mono text-[11px] text-muted"}," PilotVault — live drone telemetry, command & control. ",-1))]))}};ka(Af).mount("#app"); diff --git a/API Server/internal/api/dist/index.html b/API Server/internal/api/dist/index.html index 8d58ac4..790c3a3 100644 --- a/API Server/internal/api/dist/index.html +++ b/API Server/internal/api/dist/index.html @@ -6,7 +6,7 @@ PilotVault · API Server - + diff --git a/API Server/internal/api/integrations.go b/API Server/internal/api/integrations.go index 38172cc..8186105 100644 --- a/API Server/internal/api/integrations.go +++ b/API Server/internal/api/integrations.go @@ -7,9 +7,34 @@ import ( "io" "net/http" "net/url" + "strconv" "strings" ) +// validBBox reports whether s is a well-formed "lamin,lomin,lamax,lomax" bounding +// box: four numbers, latitudes in [-90,90], longitudes in [-180,180], and min < max +// on each axis. Used to vet the Live map's client-supplied ?bbox= override before +// it reaches OpenSky. +func validBBox(s string) bool { + parts := strings.Split(s, ",") + if len(parts) != 4 { + return false + } + n := make([]float64, 4) + for i, p := range parts { + v, err := strconv.ParseFloat(strings.TrimSpace(p), 64) + if err != nil { + return false + } + n[i] = v + } + laMin, loMin, laMax, loMax := n[0], n[1], n[2], n[3] + if laMin < -90 || laMax > 90 || loMin < -180 || loMax > 180 { + return false + } + return laMin < laMax && loMin < loMax +} + // Integrations exposes the OpenSky plugin's settings to end users under a // three-layer cascade (superadmin/global → organization → user). Each of the // four settings resolves independently, top wins, and a blank field falls @@ -586,11 +611,19 @@ func (s *Server) handleOpenSkyStates(w http.ResponseWriter, r *http.Request) { return } + // The Live map may request a specific area (auto cascade: drone → device → + // region). Honour a well-formed ?bbox= override; otherwise use the resolved + // config bbox. Malformed input is ignored rather than erroring. + bbox := res.eff.Bbox + if q := strings.TrimSpace(r.URL.Query().Get("bbox")); q != "" && validBBox(q) { + bbox = q + } + cfg := map[string]string{ "clientId": res.eff.ClientID, "clientSecret": res.eff.ClientSecret, "plan": res.eff.Plan, - "bbox": res.eff.Bbox, + "bbox": bbox, "allowAnonymous": boolStr(res.allowAnon), } raw, err := s.plugins.InvokeWith(r.Context(), openSkyPlugin, cfg, "states.bbox", nil) diff --git a/API Server/internal/hub/models.go b/API Server/internal/hub/models.go index 7bb72ae..4054a67 100644 --- a/API Server/internal/hub/models.go +++ b/API Server/internal/hub/models.go @@ -11,6 +11,10 @@ type Telemetry struct { Altitude *float64 `json:"altitude,omitempty"` Latitude *float64 `json:"latitude,omitempty"` Longitude *float64 `json:"longitude,omitempty"` + // Phone's own GPS (reported by the Fly App), distinct from the drone's fix + // above — used as a location fallback for the Web App's auto bounding box. + PhoneLatitude *float64 `json:"phoneLatitude,omitempty"` + PhoneLongitude *float64 `json:"phoneLongitude,omitempty"` VelocityX *float64 `json:"velocityX,omitempty"` VelocityY *float64 `json:"velocityY,omitempty"` VelocityZ *float64 `json:"velocityZ,omitempty"` @@ -100,6 +104,12 @@ func applyTelemetry(t *Telemetry, raw map[string]any) { if v, ok := toFloat(raw["longitude"]); ok { t.Longitude = &v } + if v, ok := toFloat(raw["phoneLatitude"]); ok { + t.PhoneLatitude = &v + } + if v, ok := toFloat(raw["phoneLongitude"]); ok { + t.PhoneLongitude = &v + } if v, ok := toFloat(raw["velocityX"]); ok { t.VelocityX = &v } diff --git a/API Server/panel/src/App.vue b/API Server/panel/src/App.vue index 0b74fb4..da82482 100644 --- a/API Server/panel/src/App.vue +++ b/API Server/panel/src/App.vue @@ -190,15 +190,61 @@ const BBOX_GROUPS = [ { value: "-56,-82,13,-34", label: "South America" }, { value: "-48,110,-10,180", label: "Oceania" }, ] }, - { label: "Countries", options: [ - { value: "49,14.1,54.9,24.2", label: "Poland" }, - { value: "50.5,3.2,53.7,7.3", label: "Netherlands" }, - { value: "47.2,5.8,55.1,15.1", label: "Germany" }, + // European countries (mirrors Web App/web/src/countries.js — keep in sync). + { label: "European countries", options: [ + { value: "39.6,19.3,42.7,21.1", label: "Albania" }, + { value: "42.4,1.4,42.7,1.8", label: "Andorra" }, + { value: "46.4,9.5,49.0,17.2", label: "Austria" }, + { value: "51.2,23.2,56.2,32.8", label: "Belarus" }, + { value: "49.5,2.5,51.5,6.4", label: "Belgium" }, + { value: "42.6,15.7,45.3,19.6", label: "Bosnia and Herzegovina" }, + { value: "41.2,22.4,44.2,28.6", label: "Bulgaria" }, + { value: "42.4,13.5,46.6,19.4", label: "Croatia" }, + { value: "34.6,32.3,35.7,34.6", label: "Cyprus" }, + { value: "48.6,12.1,51.1,18.9", label: "Czechia" }, + { value: "54.6,8.1,57.8,12.7", label: "Denmark" }, + { value: "57.5,21.8,59.7,28.2", label: "Estonia" }, + { value: "59.8,20.6,70.1,31.6", label: "Finland" }, { value: "41.3,-5.2,51.1,9.6", label: "France" }, - { value: "49.9,-8.7,59,1.8", label: "United Kingdom" }, - { value: "35.9,-9.6,43.8,3.4", label: "Spain" }, + { value: "47.2,5.8,55.1,15.1", label: "Germany" }, + { value: "34.8,19.4,41.8,28.3", label: "Greece" }, + { value: "45.7,16.1,48.6,22.9", label: "Hungary" }, + { value: "63.3,-24.6,66.6,-13.5", label: "Iceland" }, + { value: "51.4,-10.6,55.4,-6.0", label: "Ireland" }, { value: "36.6,6.6,47.1,18.6", label: "Italy" }, + { value: "41.8,20.0,43.3,21.8", label: "Kosovo" }, + { value: "55.7,20.9,58.1,28.2", label: "Latvia" }, + { value: "47.0,9.4,47.3,9.6", label: "Liechtenstein" }, + { value: "53.9,20.9,56.5,26.9", label: "Lithuania" }, + { value: "49.4,5.7,50.2,6.5", label: "Luxembourg" }, + { value: "35.8,14.1,36.1,14.6", label: "Malta" }, + { value: "45.4,26.6,48.5,30.2", label: "Moldova" }, + { value: "43.72,7.40,43.75,7.44", label: "Monaco" }, + { value: "41.8,18.4,43.6,20.4", label: "Montenegro" }, + { value: "50.7,3.3,53.7,7.2", label: "Netherlands" }, + { value: "40.8,20.4,42.4,23.0", label: "North Macedonia" }, + { value: "57.9,4.6,71.2,31.1", label: "Norway" }, + { value: "49.0,14.1,54.9,24.2", label: "Poland" }, + { value: "36.9,-9.5,42.2,-6.2", label: "Portugal" }, + { value: "43.6,20.2,48.3,29.7", label: "Romania" }, + { value: "41.2,19.6,81.9,180", label: "Russia" }, + { value: "43.89,12.40,43.99,12.52", label: "San Marino" }, + { value: "42.2,18.8,46.2,23.0", label: "Serbia" }, + { value: "47.7,16.8,49.6,22.6", label: "Slovakia" }, + { value: "45.4,13.4,46.9,16.6", label: "Slovenia" }, + { value: "35.9,-9.4,43.8,3.4", label: "Spain" }, + { value: "55.3,11.1,69.1,24.2", label: "Sweden" }, + { value: "45.8,5.9,47.8,10.5", label: "Switzerland" }, + { value: "35.8,25.7,42.3,44.8", label: "Turkey" }, + { value: "44.4,22.1,52.4,40.2", label: "Ukraine" }, + { value: "49.9,-8.7,60.9,1.8", label: "United Kingdom" }, + { value: "41.900,12.445,41.908,12.458", label: "Vatican City" }, + ] }, + { label: "Other countries", options: [ { value: "24,-125,49.5,-66.5", label: "United States" }, + { value: "41.7,-141,83.1,-52.6", label: "Canada" }, + { value: "-43.6,113.3,-10.7,153.6", label: "Australia" }, + { value: "24,122.9,45.5,145.8", label: "Japan" }, ] }, ]; const BBOX_FLAT = BBOX_GROUPS.flatMap((g) => g.options); diff --git a/Fly App/lib/flight_model.dart b/Fly App/lib/flight_model.dart index c196617..9c94290 100644 --- a/Fly App/lib/flight_model.dart +++ b/Fly App/lib/flight_model.dart @@ -21,6 +21,10 @@ class FlightModel extends ChangeNotifier { double? altitude; double? latitude; double? longitude; + // Phone's own GPS (independent of the drone's fix above); streamed to the + // server as a location fallback for the Web App's automatic bounding box. + double? phoneLatitude; + double? phoneLongitude; int? batteryPercent; UploadStatus upload = UploadStatus.disabled; diff --git a/Fly App/lib/main.dart b/Fly App/lib/main.dart index 73bfd33..66969c9 100644 --- a/Fly App/lib/main.dart +++ b/Fly App/lib/main.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:geolocator/geolocator.dart'; import 'dji_service.dart'; import 'flight_model.dart'; @@ -46,6 +47,7 @@ class _HomePageState extends State { final FlightModel _model = FlightModel(); StreamSubscription>? _sub; StreamSubscription? _authSub; + StreamSubscription? _phoneLocSub; // Streams telemetry to the API Server and receives commands back. late final ServerUploader _uploader; @@ -69,6 +71,43 @@ class _HomePageState extends State { if (mounted) setState(() {}); }); _init(); + _startPhoneLocation(); + } + + /// Streams the phone's own GPS (coarse, low-frequency) and reports it to the + /// server as a telemetry field — a location fallback for the Web App's auto + /// bounding box when the drone has no fix. Best-effort: silently gives up if + /// location services or permission are unavailable. + Future _startPhoneLocation() async { + try { + if (!await Geolocator.isLocationServiceEnabled()) return; + LocationPermission perm = await Geolocator.checkPermission(); + if (perm == LocationPermission.denied) { + perm = await Geolocator.requestPermission(); + } + if (perm == LocationPermission.denied || perm == LocationPermission.deniedForever) { + return; + } + _phoneLocSub = Geolocator.getPositionStream( + locationSettings: const LocationSettings( + accuracy: LocationAccuracy.low, // country-level is all the bbox needs + distanceFilter: 1000, // metres — infrequent updates + ), + ).listen((Position pos) { + _model.phoneLatitude = pos.latitude; + _model.phoneLongitude = pos.longitude; + _model.bump(); + // Report to the server (rides the existing telemetry channel; only the + // phone fields are present, so it never disturbs drone telemetry). + _uploader.onEvent({ + 'type': 'telemetry', + 'phoneLatitude': pos.latitude, + 'phoneLongitude': pos.longitude, + }); + }); + } catch (_) { + // Location plugin/permission unavailable — non-fatal. + } } Future _init() async { @@ -195,6 +234,8 @@ class _HomePageState extends State { if (_model.altitude != null) tel['altitude'] = _model.altitude; if (_model.latitude != null) tel['latitude'] = _model.latitude; if (_model.longitude != null) tel['longitude'] = _model.longitude; + if (_model.phoneLatitude != null) tel['phoneLatitude'] = _model.phoneLatitude; + if (_model.phoneLongitude != null) tel['phoneLongitude'] = _model.phoneLongitude; if (tel.length > 1) events.add(tel); return events; } @@ -235,6 +276,7 @@ class _HomePageState extends State { void dispose() { _sub?.cancel(); _authSub?.cancel(); + _phoneLocSub?.cancel(); _uploadSub?.cancel(); _uploader.dispose(); _serverHost.dispose(); diff --git a/Fly App/pubspec.lock b/Fly App/pubspec.lock index 6cd8ef2..d377e27 100644 --- a/Fly App/pubspec.lock +++ b/Fly App/pubspec.lock @@ -73,6 +73,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" cupertino_icons: dependency: "direct main" description: @@ -105,6 +113,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -144,6 +160,54 @@ packages: description: flutter source: sdk version: "0.0.0" + geolocator: + dependency: "direct main" + description: + name: geolocator + sha256: f62bcd90459e63210bbf9c35deb6a51c521f992a78de19a1fe5c11704f9530e2 + url: "https://pub.dev" + source: hosted + version: "13.0.4" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d + url: "https://pub.dev" + source: hosted + version: "4.6.2" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: "853803d6bb1713c094e935b4a5ae5f19c0308acf81da13fa9ff84fb4c70c0b73" + url: "https://pub.dev" + source: hosted + version: "2.3.14" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: cdb082e4f048b69da244117b7914cc60d2a8897546ffaa4f2529c786ded7aee2 + url: "https://pub.dev" + source: hosted + version: "4.2.8" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: "19e485a0f8d6a88abcf9c53cba3a4105e14b7435ed8ac1c108c067b938fe8429" + url: "https://pub.dev" + source: hosted + version: "4.1.4" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6" + url: "https://pub.dev" + source: hosted + version: "0.2.5" image: dependency: transitive description: @@ -437,6 +501,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.11" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" + url: "https://pub.dev" + source: hosted + version: "4.5.3" vector_math: dependency: transitive description: diff --git a/Fly App/pubspec.yaml b/Fly App/pubspec.yaml index cb887ef..240987a 100644 --- a/Fly App/pubspec.yaml +++ b/Fly App/pubspec.yaml @@ -43,6 +43,10 @@ dependencies: # the platform BiometricPrompt). Requires FlutterFragmentActivity on Android. local_auth: ^2.3.0 + # Phone GPS — reported alongside telemetry as a location fallback for the Web + # App's automatic bounding box when the drone has no fix. + geolocator: ^13.0.1 + dev_dependencies: flutter_test: sdk: flutter diff --git a/Web App/server/bff.go b/Web App/server/bff.go index b02ca94..1e642e8 100644 --- a/Web App/server/bff.go +++ b/Web App/server/bff.go @@ -237,7 +237,12 @@ func (a *App) handleOpenSkyHealth(w http.ResponseWriter, r *http.Request) { // GET /bff/integrations/opensky/states → API Server /api/integrations/opensky/states. // Live aircraft positions for the Live map. func (a *App) handleOpenSkyStates(w http.ResponseWriter, r *http.Request) { - req, _ := http.NewRequest(http.MethodGet, a.apiBaseFor(r)+"/api/integrations/opensky/states", nil) + target := a.apiBaseFor(r) + "/api/integrations/opensky/states" + // Forward the optional ?bbox= override the Live map sends in auto mode. + if r.URL.RawQuery != "" { + target += "?" + r.URL.RawQuery + } + req, _ := http.NewRequest(http.MethodGet, target, nil) req.Header.Set("Authorization", tokenOf(r)) a.doRelay(w, req) } diff --git a/Web App/server/dist/assets/index-BSx6Lf8i.js b/Web App/server/dist/assets/index-BSx6Lf8i.js new file mode 100644 index 0000000..39d0510 --- /dev/null +++ b/Web App/server/dist/assets/index-BSx6Lf8i.js @@ -0,0 +1,20 @@ +(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(u){if(u.ep)return;u.ep=!0;const d=s(u);fetch(u.href,d)}})();/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Or(t){const i=Object.create(null);for(const s of t.split(","))i[s]=1;return s=>s in i}const vt={},Io=[],Wn=()=>{},yu=()=>!1,Ca=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),La=t=>t.startsWith("onUpdate:"),$t=Object.assign,zr=(t,i)=>{const s=t.indexOf(i);s>-1&&t.splice(s,1)},fd=Object.prototype.hasOwnProperty,ft=(t,i)=>fd.call(t,i),De=Array.isArray,$o=t=>Ds(t)==="[object Map]",Zo=t=>Ds(t)==="[object Set]",_l=t=>Ds(t)==="[object Date]",Ye=t=>typeof t=="function",St=t=>typeof t=="string",Nn=t=>typeof t=="symbol",ht=t=>t!==null&&typeof t=="object",xu=t=>(ht(t)||Ye(t))&&Ye(t.then)&&Ye(t.catch),wu=Object.prototype.toString,Ds=t=>wu.call(t),hd=t=>Ds(t).slice(8,-1),ku=t=>Ds(t)==="[object Object]",Ir=t=>St(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,ws=Or(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ma=t=>{const i=Object.create(null);return(s=>i[s]||(i[s]=t(s)))},pd=/-\w/g,In=Ma(t=>t.replace(pd,i=>i.slice(1).toUpperCase())),md=/\B([A-Z])/g,Ni=Ma(t=>t.replace(md,"-$1").toLowerCase()),Su=Ma(t=>t.charAt(0).toUpperCase()+t.slice(1)),tr=Ma(t=>t?`on${Su(t)}`:""),jn=(t,i)=>!Object.is(t,i),ha=(t,...i)=>{for(let s=0;s{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:s})},Aa=t=>{const i=parseFloat(t);return isNaN(i)?t:i},gd=t=>{const i=St(t)?Number(t):NaN;return isNaN(i)?t:i};let bl;const Ea=()=>bl||(bl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Bo(t){if(De(t)){const i={};for(let s=0;s{if(s){const l=s.split(_d);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Ee(t){let i="";if(St(t))i=t;else if(De(t))for(let s=0;szi(s,i))}const Cu=t=>!!(t&&t.__v_isRef===!0),k=t=>St(t)?t:t==null?"":De(t)||ht(t)&&(t.toString===wu||!Ye(t.toString))?Cu(t)?k(t.value):JSON.stringify(t,Lu,2):String(t),Lu=(t,i)=>Cu(i)?Lu(t,i.value):$o(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((s,[l,u],d)=>(s[nr(l,d)+" =>"]=u,s),{})}:Zo(i)?{[`Set(${i.size})`]:[...i.values()].map(s=>nr(s))}:Nn(i)?nr(i):ht(i)&&!De(i)&&!ku(i)?String(i):i,nr=(t,i="")=>{var s;return Nn(t)?`Symbol(${(s=t.description)!=null?s:i})`:t};/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Ut;class Sd{constructor(i=!1){this.detached=i,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!i&&Ut&&(Ut.active?(this.parent=Ut,this.index=(Ut.scopes||(Ut.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,s;if(this.scopes)for(i=0,s=this.scopes.length;i0&&--this._on===0){if(Ut===this)Ut=this.prevScope;else{let i=Ut;for(;i;){if(i.prevScope===this){i.prevScope=this.prevScope;break}i=i.prevScope}}this.prevScope=void 0}}stop(i){if(this._active){this._active=!1;let s,l;for(s=0,l=this.effects.length;s0)return;if(Ss){let i=Ss;for(Ss=void 0;i;){const s=i.next;i.next=void 0,i.flags&=-9,i=s}}let t;for(;ks;){let i=ks;for(ks=void 0;i;){const s=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=s}}if(t)throw t}function Ou(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function zu(t){let i,s=t.depsTail,l=s;for(;l;){const u=l.prevDep;l.version===-1?(l===s&&(s=u),Fr(l),Pd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=s}function mr(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Iu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Iu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ms)||(t.globalVersion=Ms,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!mr(t))))return;t.flags|=2;const i=t.dep,s=bt,l=$n;bt=t,$n=!0;try{Ou(t);const u=t.fn(t._value);(i.version===0||jn(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{bt=s,$n=l,zu(t),t.flags&=-3}}function Fr(t,i=!1){const{dep:s,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),s.subs===t&&(s.subs=l,!l&&s.computed)){s.computed.flags&=-5;for(let d=s.computed.deps;d;d=d.nextDep)Fr(d,!0)}!i&&!--s.sc&&s.map&&s.map.delete(s.key)}function Pd(t){const{prevDep:i,nextDep:s}=t;i&&(i.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=i,t.nextDep=void 0)}let $n=!0;const $u=[];function Kn(){$u.push($n),$n=!1}function Gn(){const t=$u.pop();$n=t===void 0?!0:t}function yl(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const s=bt;bt=void 0;try{i()}finally{bt=s}}}let Ms=0;class Cd{constructor(i,s){this.sub=i,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Rr{constructor(i){this.computed=i,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(i){if(!bt||!$n||bt===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==bt)s=this.activeLink=new Cd(bt,this),bt.deps?(s.prevDep=bt.depsTail,bt.depsTail.nextDep=s,bt.depsTail=s):bt.deps=bt.depsTail=s,Nu(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const l=s.nextDep;l.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=l),s.prevDep=bt.depsTail,s.nextDep=void 0,bt.depsTail.nextDep=s,bt.depsTail=s,bt.deps===s&&(bt.deps=l)}return s}trigger(i){this.version++,Ms++,this.notify(i)}notify(i){Nr();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Dr()}}}function Nu(t){if(t.dep.sc++,t.sub.flags&4){const i=t.dep.computed;if(i&&!t.dep.subs){i.flags|=20;for(let l=i.deps;l;l=l.nextDep)Nu(l)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}const gr=new WeakMap,lo=Symbol(""),vr=Symbol(""),As=Symbol("");function jt(t,i,s){if($n&&bt){let l=gr.get(t);l||gr.set(t,l=new Map);let u=l.get(s);u||(l.set(s,u=new Rr),u.map=l,u.key=s),u.track()}}function ui(t,i,s,l,u,d){const h=gr.get(t);if(!h){Ms++;return}const v=b=>{b&&b.trigger()};if(Nr(),i==="clear")h.forEach(v);else{const b=De(t),C=b&&Ir(s);if(b&&s==="length"){const T=Number(l);h.forEach((M,R)=>{(R==="length"||R===As||!Nn(R)&&R>=T)&&v(M)})}else switch((s!==void 0||h.has(void 0))&&v(h.get(s)),C&&v(h.get(As)),i){case"add":b?C&&v(h.get("length")):(v(h.get(lo)),$o(t)&&v(h.get(vr)));break;case"delete":b||(v(h.get(lo)),$o(t)&&v(h.get(vr)));break;case"set":$o(t)&&v(h.get(lo));break}}Dr()}function Oo(t){const i=ct(t);return i===t?i:(jt(i,"iterate",As),Cn(t)?i:i.map(Dn))}function Oa(t){return jt(t=ct(t),"iterate",As),t}function Zn(t,i){return fi(t)?Uo(uo(t)?Dn(i):i):Dn(i)}const Ld={__proto__:null,[Symbol.iterator](){return or(this,Symbol.iterator,t=>Zn(this,t))},concat(...t){return Oo(this).concat(...t.map(i=>De(i)?Oo(i):i))},entries(){return or(this,"entries",t=>(t[1]=Zn(this,t[1]),t))},every(t,i){return si(this,"every",t,i,void 0,arguments)},filter(t,i){return si(this,"filter",t,i,s=>s.map(l=>Zn(this,l)),arguments)},find(t,i){return si(this,"find",t,i,s=>Zn(this,s),arguments)},findIndex(t,i){return si(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return si(this,"findLast",t,i,s=>Zn(this,s),arguments)},findLastIndex(t,i){return si(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return si(this,"forEach",t,i,void 0,arguments)},includes(...t){return sr(this,"includes",t)},indexOf(...t){return sr(this,"indexOf",t)},join(t){return Oo(this).join(t)},lastIndexOf(...t){return sr(this,"lastIndexOf",t)},map(t,i){return si(this,"map",t,i,void 0,arguments)},pop(){return ps(this,"pop")},push(...t){return ps(this,"push",t)},reduce(t,...i){return xl(this,"reduce",t,i)},reduceRight(t,...i){return xl(this,"reduceRight",t,i)},shift(){return ps(this,"shift")},some(t,i){return si(this,"some",t,i,void 0,arguments)},splice(...t){return ps(this,"splice",t)},toReversed(){return Oo(this).toReversed()},toSorted(t){return Oo(this).toSorted(t)},toSpliced(...t){return Oo(this).toSpliced(...t)},unshift(...t){return ps(this,"unshift",t)},values(){return or(this,"values",t=>Zn(this,t))}};function or(t,i,s){const l=Oa(t),u=l[i]();return l!==t&&!Cn(t)&&(u._next=u.next,u.next=()=>{const d=u._next();return d.done||(d.value=s(d.value)),d}),u}const Md=Array.prototype;function si(t,i,s,l,u,d){const h=Oa(t),v=h!==t&&!Cn(t),b=h[i];if(b!==Md[i]){const M=b.apply(t,d);return v?Dn(M):M}let C=s;h!==t&&(v?C=function(M,R){return s.call(this,Zn(t,M),R,t)}:s.length>2&&(C=function(M,R){return s.call(this,M,R,t)}));const T=b.call(h,C,l);return v&&u?u(T):T}function xl(t,i,s,l){const u=Oa(t),d=u!==t&&!Cn(t);let h=s,v=!1;u!==t&&(d?(v=l.length===0,h=function(C,T,M){return v&&(v=!1,C=Zn(t,C)),s.call(this,C,Zn(t,T),M,t)}):s.length>3&&(h=function(C,T,M){return s.call(this,C,T,M,t)}));const b=u[i](h,...l);return v?Zn(t,b):b}function sr(t,i,s){const l=ct(t);jt(l,"iterate",As);const u=l[i](...s);return(u===-1||u===!1)&&Vr(s[0])?(s[0]=ct(s[0]),l[i](...s)):u}function ps(t,i,s=[]){Kn(),Nr();const l=ct(t)[i].apply(t,s);return Dr(),Gn(),l}const Ad=Or("__proto__,__v_isRef,__isVue"),Du=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Nn));function Ed(t){Nn(t)||(t=String(t));const i=ct(this);return jt(i,"has",t),i.hasOwnProperty(t)}class Fu{constructor(i=!1,s=!1){this._isReadonly=i,this._isShallow=s}get(i,s,l){if(s==="__v_skip")return i.__v_skip;const u=this._isReadonly,d=this._isShallow;if(s==="__v_isReactive")return!u;if(s==="__v_isReadonly")return u;if(s==="__v_isShallow")return d;if(s==="__v_raw")return l===(u?d?Ud:Vu:d?Uu:Bu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=De(i);if(!u){let b;if(h&&(b=Ld[s]))return b;if(s==="hasOwnProperty")return Ed}const v=Reflect.get(i,s,Gt(i)?i:l);if((Nn(s)?Du.has(s):Ad(s))||(u||jt(i,"get",s),d))return v;if(Gt(v)){const b=h&&Ir(s)?v:v.value;return u&&ht(b)?br(b):b}return ht(v)?u?br(v):kt(v):v}}class Ru extends Fu{constructor(i=!1){super(!1,i)}set(i,s,l,u){let d=i[s];const h=De(i)&&Ir(s);if(!this._isShallow){const C=fi(d);if(!Cn(l)&&!fi(l)&&(d=ct(d),l=ct(l)),!h&&Gt(d)&&!Gt(l))return C||(d.value=l),!0}const v=h?Number(s)t,ra=t=>Reflect.getPrototypeOf(t);function Nd(t,i,s){return function(...l){const u=this.__v_raw,d=ct(u),h=$o(d),v=t==="entries"||t===Symbol.iterator&&h,b=t==="keys"&&h,C=u[t](...l),T=s?_r:i?Uo:Dn;return!i&&jt(d,"iterate",b?vr:lo),$t(Object.create(C),{next(){const{value:M,done:R}=C.next();return R?{value:M,done:R}:{value:v?[T(M[0]),T(M[1])]:T(M),done:R}}})}}function la(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Dd(t,i){const s={get(u){const d=this.__v_raw,h=ct(d),v=ct(u);t||(jn(u,v)&&jt(h,"get",u),jt(h,"get",v));const{has:b}=ra(h),C=i?_r:t?Uo:Dn;if(b.call(h,u))return C(d.get(u));if(b.call(h,v))return C(d.get(v));d!==h&&d.get(u)},get size(){const u=this.__v_raw;return!t&&jt(ct(u),"iterate",lo),u.size},has(u){const d=this.__v_raw,h=ct(d),v=ct(u);return t||(jn(u,v)&&jt(h,"has",u),jt(h,"has",v)),u===v?d.has(u):d.has(u)||d.has(v)},forEach(u,d){const h=this,v=h.__v_raw,b=ct(v),C=i?_r:t?Uo:Dn;return!t&&jt(b,"iterate",lo),v.forEach((T,M)=>u.call(d,C(T),C(M),h))}};return $t(s,t?{add:la("add"),set:la("set"),delete:la("delete"),clear:la("clear")}:{add(u){const d=ct(this),h=ra(d),v=ct(u),b=!i&&!Cn(u)&&!fi(u)?v:u;return h.has.call(d,b)||jn(u,b)&&h.has.call(d,u)||jn(v,b)&&h.has.call(d,v)||(d.add(b),ui(d,"add",b,b)),this},set(u,d){!i&&!Cn(d)&&!fi(d)&&(d=ct(d));const h=ct(this),{has:v,get:b}=ra(h);let C=v.call(h,u);C||(u=ct(u),C=v.call(h,u));const T=b.call(h,u);return h.set(u,d),C?jn(d,T)&&ui(h,"set",u,d):ui(h,"add",u,d),this},delete(u){const d=ct(this),{has:h,get:v}=ra(d);let b=h.call(d,u);b||(u=ct(u),b=h.call(d,u)),v&&v.call(d,u);const C=d.delete(u);return b&&ui(d,"delete",u,void 0),C},clear(){const u=ct(this),d=u.size!==0,h=u.clear();return d&&ui(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{s[u]=Nd(u,t,i)}),s}function Br(t,i){const s=Dd(t,i);return(l,u,d)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ft(s,u)&&u in l?s:l,u,d)}const Fd={get:Br(!1,!1)},Rd={get:Br(!1,!0)},Bd={get:Br(!0,!1)};const Bu=new WeakMap,Uu=new WeakMap,Vu=new WeakMap,Ud=new WeakMap;function Vd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function kt(t){return fi(t)?t:Ur(t,!1,zd,Fd,Bu)}function Zd(t){return Ur(t,!1,$d,Rd,Uu)}function br(t){return Ur(t,!0,Id,Bd,Vu)}function Ur(t,i,s,l,u){if(!ht(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const d=u.get(t);if(d)return d;const h=Vd(hd(t));if(h===0)return t;const v=new Proxy(t,h===2?l:s);return u.set(t,v),v}function uo(t){return fi(t)?uo(t.__v_raw):!!(t&&t.__v_isReactive)}function fi(t){return!!(t&&t.__v_isReadonly)}function Cn(t){return!!(t&&t.__v_isShallow)}function Vr(t){return t?!!t.__v_raw:!1}function ct(t){const i=t&&t.__v_raw;return i?ct(i):t}function Hd(t){return!ft(t,"__v_skip")&&Object.isExtensible(t)&&Tu(t,"__v_skip",!0),t}const Dn=t=>ht(t)?kt(t):t,Uo=t=>ht(t)?br(t):t;function Gt(t){return t?t.__v_isRef===!0:!1}function W(t){return jd(t,!1)}function jd(t,i){return Gt(t)?t:new Wd(t,i)}class Wd{constructor(i,s){this.dep=new Rr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?i:ct(i),this._value=s?i:Dn(i),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(i){const s=this._rawValue,l=this.__v_isShallow||Cn(i)||fi(i);i=l?i:ct(i),jn(i,s)&&(this._rawValue=i,this._value=l?i:Dn(i),this.dep.trigger())}}function Oe(t){return Gt(t)?t.value:t}const Kd={get:(t,i,s)=>i==="__v_raw"?t:Oe(Reflect.get(t,i,s)),set:(t,i,s,l)=>{const u=t[i];return Gt(u)&&!Gt(s)?(u.value=s,!0):Reflect.set(t,i,s,l)}};function Zu(t){return uo(t)?t:new Proxy(t,Kd)}class Gd{constructor(i,s,l){this.fn=i,this.setter=s,this._value=void 0,this.dep=new Rr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ms-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&bt!==this)return Eu(this,!0),!0}get value(){const i=this.dep.track();return Iu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function qd(t,i,s=!1){let l,u;return Ye(t)?l=t:(l=t.get,u=t.set),new Gd(l,u,s)}const ua={},ma=new WeakMap;let so;function Yd(t,i=!1,s=so){if(s){let l=ma.get(s);l||ma.set(s,l=[]),l.push(t)}}function Jd(t,i,s=vt){const{immediate:l,deep:u,once:d,scheduler:h,augmentJob:v,call:b}=s,C=fe=>u?fe:Cn(fe)||u===!1||u===0?ci(fe,1):ci(fe);let T,M,R,B,Z=!1,F=!1;if(Gt(t)?(M=()=>t.value,Z=Cn(t)):uo(t)?(M=()=>C(t),Z=!0):De(t)?(F=!0,Z=t.some(fe=>uo(fe)||Cn(fe)),M=()=>t.map(fe=>{if(Gt(fe))return fe.value;if(uo(fe))return C(fe);if(Ye(fe))return b?b(fe,2):fe()})):Ye(t)?i?M=b?()=>b(t,2):t:M=()=>{if(R){Kn();try{R()}finally{Gn()}}const fe=so;so=T;try{return b?b(t,3,[B]):t(B)}finally{so=fe}}:M=Wn,i&&u){const fe=M,Ue=u===!0?1/0:u;M=()=>ci(fe(),Ue)}const he=Td(),pe=()=>{T.stop(),he&&he.active&&zr(he.effects,T)};if(d&&i){const fe=i;i=(...Ue)=>{const $e=fe(...Ue);return pe(),$e}}let q=F?new Array(t.length).fill(ua):ua;const Te=fe=>{if(!(!(T.flags&1)||!T.dirty&&!fe))if(i){const Ue=T.run();if(fe||u||Z||(F?Ue.some(($e,Ie)=>jn($e,q[Ie])):jn(Ue,q))){R&&R();const $e=so;so=T;try{const Ie=[Ue,q===ua?void 0:F&&q[0]===ua?[]:q,B];q=Ue,b?b(i,3,Ie):i(...Ie)}finally{so=$e}}}else T.run()};return v&&v(Te),T=new Mu(M),T.scheduler=h?()=>h(Te,!1):Te,B=fe=>Yd(fe,!1,T),R=T.onStop=()=>{const fe=ma.get(T);if(fe){if(b)b(fe,4);else for(const Ue of fe)Ue();ma.delete(T)}},i?l?Te(!0):q=T.run():h?h(Te.bind(null,!0),!0):T.run(),pe.pause=T.pause.bind(T),pe.resume=T.resume.bind(T),pe.stop=pe,pe}function ci(t,i=1/0,s){if(i<=0||!ht(t)||t.__v_skip||(s=s||new Map,(s.get(t)||0)>=i))return t;if(s.set(t,i),i--,Gt(t))ci(t.value,i,s);else if(De(t))for(let l=0;l{ci(l,i,s)});else if(ku(t)){for(const l in t)ci(t[l],i,s);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&ci(t[l],i,s)}return t}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Fs(t,i,s,l){try{return l?t(...l):t()}catch(u){za(u,i,s)}}function Mn(t,i,s,l){if(Ye(t)){const u=Fs(t,i,s,l);return u&&xu(u)&&u.catch(d=>{za(d,i,s)}),u}if(De(t)){const u=[];for(let d=0;d>>1,u=Xt[l],d=Es(u);d=Es(s)?Xt.push(t):Xt.splice(Qd(i),0,t),t.flags|=1,Wu()}}function Wu(){ga||(ga=Hu.then(Gu))}function ef(t){De(t)?No.push(...t):Oi&&t.id===-1?Oi.splice(zo+1,0,t):t.flags&1||(No.push(t),t.flags|=1),Wu()}function wl(t,i,s=Vn+1){for(;sEs(s)-Es(l));if(No.length=0,Oi){Oi.push(...i);return}for(Oi=i,zo=0;zot.id==null?t.flags&2?-1:1/0:t.id;function Gu(t){try{for(Vn=0;Vn{l._d&&ya(-1);const d=va(i);let h;try{h=t(...u)}finally{va(d),l._d&&ya(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function re(t,i){if(Kt===null)return t;const s=Fa(Kt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return s&&Ye(i)?i.call(l&&l.proxy):i}}const tf=Symbol.for("v-scx"),nf=()=>Ts(tf);function It(t,i,s){return Ju(t,i,s)}function Ju(t,i,s=vt){const{immediate:l,deep:u,flush:d,once:h}=s,v=$t({},s),b=i&&l||!i&&d!=="post";let C;if($s){if(d==="sync"){const B=nf();C=B.__watcherHandles||(B.__watcherHandles=[])}else if(!b){const B=()=>{};return B.stop=Wn,B.resume=Wn,B.pause=Wn,B}}const T=Qt;v.call=(B,Z,F)=>Mn(B,T,Z,F);let M=!1;d==="post"?v.scheduler=B=>{Jt(B,T&&T.suspense)}:d!=="sync"&&(M=!0,v.scheduler=(B,Z)=>{Z?B():Zr(B)}),v.augmentJob=B=>{i&&(B.flags|=4),M&&(B.flags|=2,T&&(B.id=T.uid,B.i=T))};const R=Jd(t,i,v);return $s&&(C?C.push(R):b&&R()),R}function of(t,i,s){const l=this.proxy,u=St(t)?t.includes(".")?Xu(l,t):()=>l[t]:t.bind(l,l);let d;Ye(i)?d=i:(d=i.handler,s=i);const h=Rs(this),v=Ju(u,d.bind(l),s);return h(),v}function Xu(t,i){const s=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,ao=t=>t&&(t.disabled||t.disabled===""),sf=t=>t&&(t.defer||t.defer===""),kl=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Sl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,yr=(t,i)=>{const s=t&&t.to;return St(s)?i?i(s):null:s},af={name:"Teleport",__isTeleport:!0,process(t,i,s,l,u,d,h,v,b,C){const{mc:T,pc:M,pbc:R,o:{insert:B,querySelector:Z,createText:F,createComment:he,parentNode:pe}}=C,q=ao(i.props);let{dynamicChildren:Te}=i;const fe=(Ie,Ge,_e)=>{Ie.shapeFlag&16&&T(Ie.children,Ge,_e,u,d,h,v,b)},Ue=(Ie=i)=>{const Ge=ao(Ie.props),_e=Ie.target=yr(Ie.props,Z),ye=xr(_e,Ie,F,B);_e&&(h!=="svg"&&kl(_e)?h="svg":h!=="mathml"&&Sl(_e)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(_e),Ge||(fe(Ie,_e,ye),_s(Ie,!1)))},$e=Ie=>{const Ge=()=>{if(Ei.get(Ie)===Ge){if(Ei.delete(Ie),ao(Ie.props)){const _e=pe(Ie.el)||s;fe(Ie,_e,Ie.anchor),_s(Ie,!0)}Ue(Ie)}};Ei.set(Ie,Ge),Jt(Ge,d)};if(t==null){const Ie=i.el=F(""),Ge=i.anchor=F("");if(B(Ie,s,l),B(Ge,s,l),sf(i.props)||d&&d.pendingBranch){$e(i);return}q&&(fe(i,s,Ge),_s(i,!0)),Ue()}else{i.el=t.el;const Ie=i.anchor=t.anchor,Ge=Ei.get(t);if(Ge){Ge.flags|=8,Ei.delete(t),$e(i);return}i.targetStart=t.targetStart;const _e=i.target=t.target,ye=i.targetAnchor=t.targetAnchor,ze=ao(t.props),ne=ze?s:_e,je=ze?Ie:ye;if(h==="svg"||kl(_e)?h="svg":(h==="mathml"||Sl(_e))&&(h="mathml"),Te?(R(t.dynamicChildren,Te,ne,u,d,h,v),Wr(t,i,!0)):b||M(t,i,ne,je,u,d,h,v,!1),q)ze?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):ca(i,s,Ie,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const ie=yr(i.props,Z);ie&&(i.target=ie,ca(i,ie,null,C,0))}else ze&&ca(i,_e,ye,C,1);_s(i,q)}},remove(t,i,s,{um:l,o:{remove:u}},d){const{shapeFlag:h,children:v,anchor:b,targetStart:C,targetAnchor:T,target:M,props:R}=t,B=ao(R),Z=d||!B,F=Ei.get(t);if(F&&(F.flags|=8,Ei.delete(t)),M&&(u(C),u(T)),d&&u(b),!F&&(B||M)&&h&16)for(let he=0;he{t.isMounted=!0}),Ho(()=>{t.isUnmounting=!0}),t}const Sn=[Function,Array],tc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Sn,onEnter:Sn,onAfterEnter:Sn,onEnterCancelled:Sn,onBeforeLeave:Sn,onLeave:Sn,onAfterLeave:Sn,onLeaveCancelled:Sn,onBeforeAppear:Sn,onAppear:Sn,onAfterAppear:Sn,onAppearCancelled:Sn},nc=t=>{const i=t.subTree;return i.component?nc(i.component):i},cf={name:"BaseTransition",props:tc,setup(t,{slots:i}){const s=Lc(),l=uf();return()=>{const u=i.default&&sc(i.default(),!0),d=u&&u.length?ic(u):s.subTree?D():void 0;if(!d)return;const h=ct(t),{mode:v}=h;if(l.isLeaving)return ar(d);const b=Tl(d);if(!b)return ar(d);let C=wr(b,h,l,s,M=>C=M);b.type!==Wt&&Os(b,C);let T=s.subTree&&Tl(s.subTree);if(T&&T.type!==Wt&&!ro(T,b)&&nc(s).type!==Wt){let M=wr(T,h,l,s);if(Os(T,M),v==="out-in"&&b.type!==Wt)return l.isLeaving=!0,M.afterLeave=()=>{l.isLeaving=!1,s.job.flags&8||s.update(),delete M.afterLeave,T=void 0},ar(d);v==="in-out"&&b.type!==Wt?M.delayLeave=(R,B,Z)=>{const F=oc(l,T);F[String(T.key)]=T,R[Pn]=()=>{B(),R[Pn]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{Z(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return d}}};function ic(t){let i=t[0];if(t.length>1){for(const s of t)if(s.type!==Wt){i=s;break}}return i}const df=cf;function oc(t,i){const{leavingVNodes:s}=t;let l=s.get(i.type);return l||(l=Object.create(null),s.set(i.type,l)),l}function wr(t,i,s,l,u){const{appear:d,mode:h,persisted:v=!1,onBeforeEnter:b,onEnter:C,onAfterEnter:T,onEnterCancelled:M,onBeforeLeave:R,onLeave:B,onAfterLeave:Z,onLeaveCancelled:F,onBeforeAppear:he,onAppear:pe,onAfterAppear:q,onAppearCancelled:Te}=i,fe=String(t.key),Ue=oc(s,t),$e=(_e,ye)=>{_e&&Mn(_e,l,9,ye)},Ie=(_e,ye)=>{const ze=ye[1];$e(_e,ye),De(_e)?_e.every(ne=>ne.length<=1)&&ze():_e.length<=1&&ze()},Ge={mode:h,persisted:v,beforeEnter(_e){let ye=b;if(!s.isMounted)if(d)ye=he||b;else return;_e[Pn]&&_e[Pn](!0);const ze=Ue[fe];ze&&ro(t,ze)&&ze.el[Pn]&&ze.el[Pn](),$e(ye,[_e])},enter(_e){if(Ue[fe]===t)return;let ye=C,ze=T,ne=M;if(!s.isMounted)if(d)ye=pe||C,ze=q||T,ne=Te||M;else return;let je=!1;_e[ms]=We=>{je||(je=!0,We?$e(ne,[_e]):$e(ze,[_e]),Ge.delayedLeave&&Ge.delayedLeave(),_e[ms]=void 0)};const ie=_e[ms].bind(null,!1);ye?Ie(ye,[_e,ie]):ie()},leave(_e,ye){const ze=String(t.key);if(_e[ms]&&_e[ms](!0),s.isUnmounting)return ye();$e(R,[_e]);let ne=!1;_e[Pn]=ie=>{ne||(ne=!0,ye(),ie?$e(F,[_e]):$e(Z,[_e]),_e[Pn]=void 0,Ue[ze]===t&&delete Ue[ze])};const je=_e[Pn].bind(null,!1);Ue[ze]=t,B?Ie(B,[_e,je]):je()},clone(_e){const ye=wr(_e,i,s,l,u);return u&&u(ye),ye}};return Ge}function ar(t){if(Ia(t))return t=Ii(t),t.children=null,t}function Tl(t){if(!Ia(t))return ec(t.type)&&t.children?ic(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:s}=t;if(s){if(i&16)return s[0];if(i&32&&Ye(s.default))return s.default()}}function Os(t,i){t.shapeFlag&6&&t.component?(t.transition=i,Os(t.component.subTree,i)):t.shapeFlag&128?(t.ssContent.transition=i.clone(t.ssContent),t.ssFallback.transition=i.clone(t.ssFallback)):t.transition=i}function sc(t,i=!1,s){let l=[],u=0;for(let d=0;d1)for(let d=0;dPs(F,i&&(De(i)?i[he]:i),s,l,u));return}if(Do(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&Ps(t,i,s,l.component.subTree);return}const d=l.shapeFlag&4?Fa(l.component):l.el,h=u?null:d,{i:v,r:b}=t,C=i&&i.r,T=v.refs===vt?v.refs={}:v.refs,M=v.setupState,R=ct(M),B=M===vt?yu:F=>Pl(T,F)?!1:ft(R,F),Z=(F,he)=>!(he&&Pl(T,he));if(C!=null&&C!==b){if(Cl(i),St(C))T[C]=null,B(C)&&(M[C]=null);else if(Gt(C)){const F=i;Z(C,F.k)&&(C.value=null),F.k&&(T[F.k]=null)}}if(Ye(b)){Kn();try{Fs(b,v,12,[h,T])}finally{Gn()}}else{const F=St(b),he=Gt(b);if(F||he){const pe=()=>{if(t.f){const q=F?B(b)?M[b]:T[b]:Z()||!t.k?b.value:T[t.k];if(u)De(q)&&zr(q,d);else if(De(q))q.includes(d)||q.push(d);else if(F)T[b]=[d],B(b)&&(M[b]=T[b]);else{const Te=[d];Z(b,t.k)&&(b.value=Te),t.k&&(T[t.k]=Te)}}else F?(T[b]=h,B(b)&&(M[b]=h)):he&&(Z(b,t.k)&&(b.value=h),t.k&&(T[t.k]=h))};if(h){const q=()=>{pe(),_a.delete(t)};q.id=-1,_a.set(t,q),Jt(q,s)}else Cl(t),pe()}}}function Cl(t){const i=_a.get(t);i&&(i.flags|=8,_a.delete(t))}Ea().requestIdleCallback;Ea().cancelIdleCallback;const Do=t=>!!t.type.__asyncLoader,Ia=t=>t.type.__isKeepAlive;function ff(t,i){rc(t,"a",i)}function hf(t,i){rc(t,"da",i)}function rc(t,i,s=Qt){const l=t.__wdc||(t.__wdc=()=>{let u=s;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if($a(i,l,s),s){let u=s.parent;for(;u&&u.parent;)Ia(u.parent.vnode)&&pf(l,i,s,u),u=u.parent}}function pf(t,i,s,l){const u=$a(i,t,l,!0);lc(()=>{zr(l[i],u)},s)}function $a(t,i,s=Qt,l=!1){if(s){const u=s[t]||(s[t]=[]),d=i.__weh||(i.__weh=(...h)=>{Kn();const v=Rs(s),b=Mn(i,s,t,h);return v(),Gn(),b});return l?u.unshift(d):u.push(d),d}}const pi=t=>(i,s=Qt)=>{(!$s||t==="sp")&&$a(t,(...l)=>i(...l),s)},mf=pi("bm"),hi=pi("m"),gf=pi("bu"),vf=pi("u"),Ho=pi("bum"),lc=pi("um"),_f=pi("sp"),bf=pi("rtg"),yf=pi("rtc");function xf(t,i=Qt){$a("ec",t,i)}const wf=Symbol.for("v-ndc");function Be(t,i,s,l){let u;const d=s,h=De(t);if(h||St(t)){const v=h&&uo(t);let b=!1,C=!1;v&&(b=!Cn(t),C=fi(t),t=Oa(t)),u=new Array(t.length);for(let T=0,M=t.length;Ti(v,b,void 0,d));else{const v=Object.keys(t);u=new Array(v.length);for(let b=0,C=v.length;b0;return p(),lt(ue,null,[E("slot",s,l)],C?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),p();const h=d&&uc(d(s)),v=s.key||h&&h.key,b=lt(ue,{key:(v&&!Nn(v)?v:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return b.scopeId&&(b.slotScopeIds=[b.scopeId+"-s"]),d&&d._c&&(d._d=!0),b}function uc(t){return t.some(i=>Is(i)?!(i.type===Wt||i.type===ue&&!uc(i.children)):!0)?t:null}const kr=t=>t?Mc(t)?Fa(t):kr(t.parent):null,Cs=$t(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>kr(t.parent),$root:t=>kr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>dc(t),$forceUpdate:t=>t.f||(t.f=()=>{Zr(t.update)}),$nextTick:t=>t.n||(t.n=ju.bind(t.proxy)),$watch:t=>of.bind(t)}),rr=(t,i)=>t!==vt&&!t.__isScriptSetup&&ft(t,i),Sf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:s,setupState:l,data:u,props:d,accessCache:h,type:v,appContext:b}=t;if(i[0]!=="$"){const R=h[i];if(R!==void 0)switch(R){case 1:return l[i];case 2:return u[i];case 4:return s[i];case 3:return d[i]}else{if(rr(l,i))return h[i]=1,l[i];if(u!==vt&&ft(u,i))return h[i]=2,u[i];if(ft(d,i))return h[i]=3,d[i];if(s!==vt&&ft(s,i))return h[i]=4,s[i];Sr&&(h[i]=0)}}const C=Cs[i];let T,M;if(C)return i==="$attrs"&&jt(t.attrs,"get",""),C(t);if((T=v.__cssModules)&&(T=T[i]))return T;if(s!==vt&&ft(s,i))return h[i]=4,s[i];if(M=b.config.globalProperties,ft(M,i))return M[i]},set({_:t},i,s){const{data:l,setupState:u,ctx:d}=t;return rr(u,i)?(u[i]=s,!0):l!==vt&&ft(l,i)?(l[i]=s,!0):ft(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(d[i]=s,!0)},has({_:{data:t,setupState:i,accessCache:s,ctx:l,appContext:u,props:d,type:h}},v){let b;return!!(s[v]||t!==vt&&v[0]!=="$"&&ft(t,v)||rr(i,v)||ft(d,v)||ft(l,v)||ft(Cs,v)||ft(u.config.globalProperties,v)||(b=h.__cssModules)&&b[v])},defineProperty(t,i,s){return s.get!=null?t._.accessCache[i]=0:ft(s,"value")&&this.set(t,i,s.value,null),Reflect.defineProperty(t,i,s)}};function Ll(t){return De(t)?t.reduce((i,s)=>(i[s]=null,i),{}):t}let Sr=!0;function Tf(t){const i=dc(t),s=t.proxy,l=t.ctx;Sr=!1,i.beforeCreate&&Ml(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:h,watch:v,provide:b,inject:C,created:T,beforeMount:M,mounted:R,beforeUpdate:B,updated:Z,activated:F,deactivated:he,beforeDestroy:pe,beforeUnmount:q,destroyed:Te,unmounted:fe,render:Ue,renderTracked:$e,renderTriggered:Ie,errorCaptured:Ge,serverPrefetch:_e,expose:ye,inheritAttrs:ze,components:ne,directives:je,filters:ie}=i;if(C&&Pf(C,l,null),h)for(const ce in h){const se=h[ce];Ye(se)&&(l[ce]=se.bind(s))}if(u){const ce=u.call(s,s);ht(ce)&&(t.data=kt(ce))}if(Sr=!0,d)for(const ce in d){const se=d[ce],ot=Ye(se)?se.bind(s,s):Ye(se.get)?se.get.bind(s,s):Wn,ee=!Ye(se)&&Ye(se.set)?se.set.bind(s):Wn,be=we({get:ot,set:ee});Object.defineProperty(l,ce,{enumerable:!0,configurable:!0,get:()=>be.value,set:Ne=>be.value=Ne})}if(v)for(const ce in v)cc(v[ce],l,s,ce);if(b){const ce=Ye(b)?b.call(s):b;Reflect.ownKeys(ce).forEach(se=>{Yu(se,ce[se])})}T&&Ml(T,t,"c");function le(ce,se){De(se)?se.forEach(ot=>ce(ot.bind(s))):se&&ce(se.bind(s))}if(le(mf,M),le(hi,R),le(gf,B),le(vf,Z),le(ff,F),le(hf,he),le(xf,Ge),le(yf,$e),le(bf,Ie),le(Ho,q),le(lc,fe),le(_f,_e),De(ye))if(ye.length){const ce=t.exposed||(t.exposed={});ye.forEach(se=>{Object.defineProperty(ce,se,{get:()=>s[se],set:ot=>s[se]=ot,enumerable:!0})})}else t.exposed||(t.exposed={});Ue&&t.render===Wn&&(t.render=Ue),ze!=null&&(t.inheritAttrs=ze),ne&&(t.components=ne),je&&(t.directives=je),_e&&ac(t)}function Pf(t,i,s=Wn){De(t)&&(t=Tr(t));for(const l in t){const u=t[l];let d;ht(u)?"default"in u?d=Ts(u.from||l,u.default,!0):d=Ts(u.from||l):d=Ts(u),Gt(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[l]=d}}function Ml(t,i,s){Mn(De(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,s)}function cc(t,i,s,l){let u=l.includes(".")?Xu(s,l):()=>s[l];if(St(t)){const d=i[t];Ye(d)&&It(u,d)}else if(Ye(t))It(u,t.bind(s));else if(ht(t))if(De(t))t.forEach(d=>cc(d,i,s,l));else{const d=Ye(t.handler)?t.handler.bind(s):i[t.handler];Ye(d)&&It(u,d,t)}}function dc(t){const i=t.type,{mixins:s,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:h}}=t.appContext,v=d.get(i);let b;return v?b=v:!u.length&&!s&&!l?b=i:(b={},u.length&&u.forEach(C=>ba(b,C,h,!0)),ba(b,i,h)),ht(i)&&d.set(i,b),b}function ba(t,i,s,l=!1){const{mixins:u,extends:d}=i;d&&ba(t,d,s,!0),u&&u.forEach(h=>ba(t,h,s,!0));for(const h in i)if(!(l&&h==="expose")){const v=Cf[h]||s&&s[h];t[h]=v?v(t[h],i[h]):i[h]}return t}const Cf={data:Al,props:El,emits:El,methods:bs,computed:bs,beforeCreate:Yt,created:Yt,beforeMount:Yt,mounted:Yt,beforeUpdate:Yt,updated:Yt,beforeDestroy:Yt,beforeUnmount:Yt,destroyed:Yt,unmounted:Yt,activated:Yt,deactivated:Yt,errorCaptured:Yt,serverPrefetch:Yt,components:bs,directives:bs,watch:Mf,provide:Al,inject:Lf};function Al(t,i){return i?t?function(){return $t(Ye(t)?t.call(this,this):t,Ye(i)?i.call(this,this):i)}:i:t}function Lf(t,i){return bs(Tr(t),Tr(i))}function Tr(t){if(De(t)){const i={};for(let s=0;si==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${In(i)}Modifiers`]||t[`${Ni(i)}Modifiers`];function zf(t,i,...s){if(t.isUnmounted)return;const l=t.vnode.props||vt;let u=s;const d=i.startsWith("update:"),h=d&&Of(l,i.slice(7));h&&(h.trim&&(u=s.map(T=>St(T)?T.trim():T)),h.number&&(u=s.map(Aa)));let v,b=l[v=tr(i)]||l[v=tr(In(i))];!b&&d&&(b=l[v=tr(Ni(i))]),b&&Mn(b,t,6,u);const C=l[v+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[v])return;t.emitted[v]=!0,Mn(C,t,6,u)}}const If=new WeakMap;function hc(t,i,s=!1){const l=s?If:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const d=t.emits;let h={},v=!1;if(!Ye(t)){const b=C=>{const T=hc(C,i,!0);T&&(v=!0,$t(h,T))};!s&&i.mixins.length&&i.mixins.forEach(b),t.extends&&b(t.extends),t.mixins&&t.mixins.forEach(b)}return!d&&!v?(ht(t)&&l.set(t,null),null):(De(d)?d.forEach(b=>h[b]=null):$t(h,d),ht(t)&&l.set(t,h),h)}function Na(t,i){return!t||!Ca(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ft(t,i[0].toLowerCase()+i.slice(1))||ft(t,Ni(i))||ft(t,i))}function Ol(t){const{type:i,vnode:s,proxy:l,withProxy:u,propsOptions:[d],slots:h,attrs:v,emit:b,render:C,renderCache:T,props:M,data:R,setupState:B,ctx:Z,inheritAttrs:F}=t,he=va(t);let pe,q;try{if(s.shapeFlag&4){const fe=u||l,Ue=fe;pe=Hn(C.call(Ue,fe,T,M,B,R,Z)),q=v}else{const fe=i;pe=Hn(fe.length>1?fe(M,{attrs:v,slots:h,emit:b}):fe(M,null)),q=i.props?v:$f(v)}}catch(fe){Ls.length=0,za(fe,t,1),pe=E(Wt)}let Te=pe;if(q&&F!==!1){const fe=Object.keys(q),{shapeFlag:Ue}=Te;fe.length&&Ue&7&&(d&&fe.some(La)&&(q=Nf(q,d)),Te=Ii(Te,q,!1,!0))}return s.dirs&&(Te=Ii(Te,null,!1,!0),Te.dirs=Te.dirs?Te.dirs.concat(s.dirs):s.dirs),s.transition&&Os(Te,s.transition),pe=Te,va(he),pe}const $f=t=>{let i;for(const s in t)(s==="class"||s==="style"||Ca(s))&&((i||(i={}))[s]=t[s]);return i},Nf=(t,i)=>{const s={};for(const l in t)(!La(l)||!(l.slice(9)in i))&&(s[l]=t[l]);return s};function Df(t,i,s){const{props:l,children:u,component:d}=t,{props:h,children:v,patchFlag:b}=i,C=d.emitsOptions;if(i.dirs||i.transition)return!0;if(s&&b>=0){if(b&1024)return!0;if(b&16)return l?zl(l,h,C):!!h;if(b&8){const T=i.dynamicProps;for(let M=0;MObject.create(mc),vc=t=>Object.getPrototypeOf(t)===mc;function Rf(t,i,s,l=!1){const u={},d=gc();t.propsDefaults=Object.create(null),_c(t,i,u,d);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);s?t.props=l?u:Zd(u):t.type.props?t.props=u:t.props=d,t.attrs=d}function Bf(t,i,s,l){const{props:u,attrs:d,vnode:{patchFlag:h}}=t,v=ct(u),[b]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let M=0;M{b=!0;const[R,B]=bc(M,i,!0);$t(h,R),B&&v.push(...B)};!s&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!d&&!b)return ht(t)&&l.set(t,Io),Io;if(De(d))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",jr=t=>De(t)?t.map(Hn):[Hn(t)],Vf=(t,i,s)=>{if(i._n)return i;const l=Pe((...u)=>jr(i(...u)),s);return l._c=!1,l},yc=(t,i,s)=>{const l=t._ctx;for(const u in t){if(Hr(u))continue;const d=t[u];if(Ye(d))i[u]=Vf(u,d,l);else if(d!=null){const h=jr(d);i[u]=()=>h}}},xc=(t,i)=>{const s=jr(i);t.slots.default=()=>s},wc=(t,i,s)=>{for(const l in i)(s||!Hr(l))&&(t[l]=i[l])},Zf=(t,i,s)=>{const l=t.slots=gc();if(t.vnode.shapeFlag&32){const u=i._;u?(wc(l,i,s),s&&Tu(l,"_",u,!0)):yc(i,l)}else i&&xc(t,i)},Hf=(t,i,s)=>{const{vnode:l,slots:u}=t;let d=!0,h=vt;if(l.shapeFlag&32){const v=i._;v?s&&v===1?d=!1:wc(u,i,s):(d=!i.$stable,yc(i,u)),h=i}else i&&(xc(t,i),h={default:1});if(d)for(const v in u)!Hr(v)&&h[v]==null&&delete u[v]},Jt=qf;function jf(t){return Wf(t)}function Wf(t,i){const s=Ea();s.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:h,createText:v,createComment:b,setText:C,setElementText:T,parentNode:M,nextSibling:R,setScopeId:B=Wn,insertStaticContent:Z}=t,F=(y,_,w,K=null,H=null,V=null,ae=void 0,te=null,Q=!!_.dynamicChildren)=>{if(y===_)return;y&&!ro(y,_)&&(K=A(y),Ne(y,H,V,!0),y=null),_.patchFlag===-2&&(Q=!1,_.dynamicChildren=null);const{type:G,ref:me,shapeFlag:oe}=_;switch(G){case Da:he(y,_,w,K);break;case Wt:pe(y,_,w,K);break;case ur:y==null&&q(_,w,K,ae);break;case ue:ne(y,_,w,K,H,V,ae,te,Q);break;default:oe&1?Ue(y,_,w,K,H,V,ae,te,Q):oe&6?je(y,_,w,K,H,V,ae,te,Q):(oe&64||oe&128)&&G.process(y,_,w,K,H,V,ae,te,Q,ut)}me!=null&&H?Ps(me,y&&y.ref,V,_||y,!_):me==null&&y&&y.ref!=null&&Ps(y.ref,null,V,y,!0)},he=(y,_,w,K)=>{if(y==null)l(_.el=v(_.children),w,K);else{const H=_.el=y.el;_.children!==y.children&&C(H,_.children)}},pe=(y,_,w,K)=>{y==null?l(_.el=b(_.children||""),w,K):_.el=y.el},q=(y,_,w,K)=>{[y.el,y.anchor]=Z(y.children,_,w,K,y.el,y.anchor)},Te=({el:y,anchor:_},w,K)=>{let H;for(;y&&y!==_;)H=R(y),l(y,w,K),y=H;l(_,w,K)},fe=({el:y,anchor:_})=>{let w;for(;y&&y!==_;)w=R(y),u(y),y=w;u(_)},Ue=(y,_,w,K,H,V,ae,te,Q)=>{if(_.type==="svg"?ae="svg":_.type==="math"&&(ae="mathml"),y==null)$e(_,w,K,H,V,ae,te,Q);else{const G=y.el&&y.el._isVueCE?y.el:null;try{G&&G._beginPatch(),_e(y,_,H,V,ae,te,Q)}finally{G&&G._endPatch()}}},$e=(y,_,w,K,H,V,ae,te)=>{let Q,G;const{props:me,shapeFlag:oe,transition:ke,dirs:Ce}=y;if(Q=y.el=h(y.type,V,me&&me.is,me),oe&8?T(Q,y.children):oe&16&&Ge(y.children,Q,null,K,H,lr(y,V),ae,te),Ce&&to(y,null,K,"created"),Ie(Q,y,y.scopeId,ae,K),me){for(const et in me)et!=="value"&&!ws(et)&&d(Q,et,null,me[et],V,K);"value"in me&&d(Q,"value",null,me.value,V),(G=me.onVnodeBeforeMount)&&Un(G,K,y)}Ce&&to(y,null,K,"beforeMount");const He=Kf(H,ke);He&&ke.beforeEnter(Q),l(Q,_,w),((G=me&&me.onVnodeMounted)||He||Ce)&&Jt(()=>{try{G&&Un(G,K,y),He&&ke.enter(Q),Ce&&to(y,null,K,"mounted")}finally{}},H)},Ie=(y,_,w,K,H)=>{if(w&&B(y,w),K)for(let V=0;V{for(let G=Q;G{const te=_.el=y.el;let{patchFlag:Q,dynamicChildren:G,dirs:me}=_;Q|=y.patchFlag&16;const oe=y.props||vt,ke=_.props||vt;let Ce;if(w&&no(w,!1),(Ce=ke.onVnodeBeforeUpdate)&&Un(Ce,w,_,y),me&&to(_,y,w,"beforeUpdate"),w&&no(w,!0),G&&(!y.dynamicChildren||y.dynamicChildren.length!==G.length)&&(Q=0,ae=!1,G=null),(oe.innerHTML&&ke.innerHTML==null||oe.textContent&&ke.textContent==null)&&T(te,""),G?ye(y.dynamicChildren,G,te,w,K,lr(_,H),V):ae||se(y,_,te,null,w,K,lr(_,H),V,!1),Q>0){if(Q&16)ze(te,oe,ke,w,H);else if(Q&2&&oe.class!==ke.class&&d(te,"class",null,ke.class,H),Q&4&&d(te,"style",oe.style,ke.style,H),Q&8){const He=_.dynamicProps;for(let et=0;et{Ce&&Un(Ce,w,_,y),me&&to(_,y,w,"updated")},K)},ye=(y,_,w,K,H,V,ae)=>{for(let te=0;te<_.length;te++){const Q=y[te],G=_[te],me=Q.el&&(Q.type===ue||!ro(Q,G)||Q.shapeFlag&198)?M(Q.el):w;F(Q,G,me,null,K,H,V,ae,!0)}},ze=(y,_,w,K,H)=>{if(_!==w){if(_!==vt)for(const V in _)!ws(V)&&!(V in w)&&d(y,V,_[V],null,H,K);for(const V in w){if(ws(V))continue;const ae=w[V],te=_[V];ae!==te&&V!=="value"&&d(y,V,te,ae,H,K)}"value"in w&&d(y,"value",_.value,w.value,H)}},ne=(y,_,w,K,H,V,ae,te,Q)=>{const G=_.el=y?y.el:v(""),me=_.anchor=y?y.anchor:v("");let{patchFlag:oe,dynamicChildren:ke,slotScopeIds:Ce}=_;Ce&&(te=te?te.concat(Ce):Ce),y==null?(l(G,w,K),l(me,w,K),Ge(_.children||[],w,me,H,V,ae,te,Q)):oe>0&&oe&64&&ke&&y.dynamicChildren&&y.dynamicChildren.length===ke.length?(ye(y.dynamicChildren,ke,w,H,V,ae,te),(_.key!=null||H&&_===H.subTree)&&Wr(y,_,!0)):se(y,_,w,me,H,V,ae,te,Q)},je=(y,_,w,K,H,V,ae,te,Q)=>{_.slotScopeIds=te,y==null?_.shapeFlag&512?H.ctx.activate(_,w,K,ae,Q):ie(_,w,K,H,V,ae,Q):We(y,_,Q)},ie=(y,_,w,K,H,V,ae)=>{const te=y.component=nh(y,K,H);if(Ia(y)&&(te.ctx.renderer=ut),ih(te,!1,ae),te.asyncDep){if(H&&H.registerDep(te,le,ae),!y.el){const Q=te.subTree=E(Wt);pe(null,Q,_,w),y.placeholder=Q.el}}else le(te,y,_,w,H,V,ae)},We=(y,_,w)=>{const K=_.component=y.component;if(Df(y,_,w))if(K.asyncDep&&!K.asyncResolved){ce(K,_,w);return}else K.next=_,K.update();else _.el=y.el,K.vnode=_},le=(y,_,w,K,H,V,ae)=>{const te=()=>{if(y.isMounted){let{next:oe,bu:ke,u:Ce,parent:He,vnode:et}=y;{const pt=kc(y);if(pt){oe&&(oe.el=et.el,ce(y,oe,ae)),pt.asyncDep.then(()=>{Jt(()=>{y.isUnmounted||G()},H)});return}}let U=oe,O;no(y,!1),oe?(oe.el=et.el,ce(y,oe,ae)):oe=et,ke&&ha(ke),(O=oe.props&&oe.props.onVnodeBeforeUpdate)&&Un(O,He,oe,et),no(y,!0);const xe=Ol(y),Je=y.subTree;y.subTree=xe,F(Je,xe,M(Je.el),A(Je),y,H,V),oe.el=xe.el,U===null&&Ff(y,xe.el),Ce&&Jt(Ce,H),(O=oe.props&&oe.props.onVnodeUpdated)&&Jt(()=>Un(O,He,oe,et),H)}else{let oe;const{el:ke,props:Ce}=_,{bm:He,m:et,parent:U,root:O,type:xe}=y,Je=Do(_);no(y,!1),He&&ha(He),!Je&&(oe=Ce&&Ce.onVnodeBeforeMount)&&Un(oe,U,_),no(y,!0);{O.ce&&O.ce._hasShadowRoot()&&O.ce._injectChildStyle(xe,y.parent?y.parent.type:void 0);const pt=y.subTree=Ol(y);F(null,pt,w,K,y,H,V),_.el=pt.el}if(et&&Jt(et,H),!Je&&(oe=Ce&&Ce.onVnodeMounted)){const pt=_;Jt(()=>Un(oe,U,pt),H)}(_.shapeFlag&256||U&&Do(U.vnode)&&U.vnode.shapeFlag&256)&&y.a&&Jt(y.a,H),y.isMounted=!0,_=w=K=null}};y.scope.on();const Q=y.effect=new Mu(te);y.scope.off();const G=y.update=Q.run.bind(Q),me=y.job=Q.runIfDirty.bind(Q);me.i=y,me.id=y.uid,Q.scheduler=()=>Zr(me),no(y,!0),G()},ce=(y,_,w)=>{_.component=y;const K=y.vnode.props;y.vnode=_,y.next=null,Bf(y,_.props,K,w),Hf(y,_.children,w),Kn(),wl(y),Gn()},se=(y,_,w,K,H,V,ae,te,Q=!1)=>{const G=y&&y.children,me=y?y.shapeFlag:0,oe=_.children,{patchFlag:ke,shapeFlag:Ce}=_;if(ke>0){if(ke&128){ee(G,oe,w,K,H,V,ae,te,Q);return}else if(ke&256){ot(G,oe,w,K,H,V,ae,te,Q);return}}Ce&8?(me&16&&Y(G,H,V),oe!==G&&T(w,oe)):me&16?Ce&16?ee(G,oe,w,K,H,V,ae,te,Q):Y(G,H,V,!0):(me&8&&T(w,""),Ce&16&&Ge(oe,w,K,H,V,ae,te,Q))},ot=(y,_,w,K,H,V,ae,te,Q)=>{y=y||Io,_=_||Io;const G=y.length,me=_.length,oe=Math.min(G,me);let ke;for(ke=0;keme?Y(y,H,V,!0,!1,oe):Ge(_,w,K,H,V,ae,te,Q,oe)},ee=(y,_,w,K,H,V,ae,te,Q)=>{let G=0;const me=_.length;let oe=y.length-1,ke=me-1;for(;G<=oe&&G<=ke;){const Ce=y[G],He=_[G]=Q?li(_[G]):Hn(_[G]);if(ro(Ce,He))F(Ce,He,w,null,H,V,ae,te,Q);else break;G++}for(;G<=oe&&G<=ke;){const Ce=y[oe],He=_[ke]=Q?li(_[ke]):Hn(_[ke]);if(ro(Ce,He))F(Ce,He,w,null,H,V,ae,te,Q);else break;oe--,ke--}if(G>oe){if(G<=ke){const Ce=ke+1,He=Ceke)for(;G<=oe;)Ne(y[G],H,V,!0),G++;else{const Ce=G,He=G,et=new Map;for(G=He;G<=ke;G++){const de=_[G]=Q?li(_[G]):Hn(_[G]);de.key!=null&&et.set(de.key,G)}let U,O=0;const xe=ke-He+1;let Je=!1,pt=0;const Ve=new Array(xe);for(G=0;G=xe){Ne(de,H,V,!0);continue}let Fe;if(de.key!=null)Fe=et.get(de.key);else for(U=He;U<=ke;U++)if(Ve[U-He]===0&&ro(de,_[U])){Fe=U;break}Fe===void 0?Ne(de,H,V,!0):(Ve[Fe-He]=G+1,Fe>=pt?pt=Fe:Je=!0,F(de,_[Fe],w,null,H,V,ae,te,Q),O++)}const Vt=Je?Gf(Ve):Io;for(U=Vt.length-1,G=xe-1;G>=0;G--){const de=He+G,Fe=_[de],Nt=_[de+1],qn=de+1{const{el:V,type:ae,transition:te,children:Q,shapeFlag:G}=y;if(G&6){be(y.component.subTree,_,w,K);return}if(G&128){y.suspense.move(_,w,K);return}if(G&64){ae.move(y,_,w,ut);return}if(ae===ue){l(V,_,w);for(let oe=0;oete.enter(V),H));else{const{leave:oe,delayLeave:ke,afterLeave:Ce}=te,He=()=>{y.ctx.isUnmounted?u(V):l(V,_,w)},et=()=>{const U=V._isLeaving||!!V[Pn];V._isLeaving&&V[Pn](!0),te.persisted&&!U?He():oe(V,()=>{He(),Ce&&Ce()})};ke?ke(V,He,et):et()}else l(V,_,w)},Ne=(y,_,w,K=!1,H=!1)=>{const{type:V,props:ae,ref:te,children:Q,dynamicChildren:G,shapeFlag:me,patchFlag:oe,dirs:ke,cacheIndex:Ce,memo:He}=y;if(oe===-2&&(H=!1),te!=null&&(Kn(),Ps(te,null,w,y,!0),Gn()),Ce!=null&&(_.renderCache[Ce]=void 0),me&256){_.ctx.deactivate(y);return}const et=me&1&&ke,U=!Do(y);let O;if(U&&(O=ae&&ae.onVnodeBeforeUnmount)&&Un(O,_,y),me&6)Ze(y.component,w,K);else{if(me&128){y.suspense.unmount(w,K);return}et&&to(y,null,_,"beforeUnmount"),me&64?y.type.remove(y,_,w,ut,K):G&&!G.hasOnce&&(V!==ue||oe>0&&oe&64)?Y(G,_,w,!1,!0):(V===ue&&oe&384||!H&&me&16)&&Y(Q,_,w),K&&dt(y)}const xe=He!=null&&Ce==null;(U&&(O=ae&&ae.onVnodeUnmounted)||et||xe)&&Jt(()=>{O&&Un(O,_,y),et&&to(y,null,_,"unmounted"),xe&&(y.el=null)},w)},dt=y=>{const{type:_,el:w,anchor:K,transition:H}=y;if(_===ue){at(w,K);return}if(_===ur){fe(y);return}const V=()=>{u(w),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(y.shapeFlag&1&&H&&!H.persisted){const{leave:ae,delayLeave:te}=H,Q=()=>ae(w,V);te?te(y.el,V,Q):Q()}else V()},at=(y,_)=>{let w;for(;y!==_;)w=R(y),u(y),y=w;u(_)},Ze=(y,_,w)=>{const{bum:K,scope:H,job:V,subTree:ae,um:te,m:Q,a:G}=y;$l(Q),$l(G),K&&ha(K),H.stop(),V&&(V.flags|=8,Ne(ae,y,_,w)),te&&Jt(te,_),Jt(()=>{y.isUnmounted=!0},_)},Y=(y,_,w,K=!1,H=!1,V=0)=>{for(let ae=V;ae{if(y.shapeFlag&6)return A(y.component.subTree);if(y.shapeFlag&128)return y.suspense.next();const _=R(y.anchor||y.el),w=_&&_[Qu];return w?R(w):_};let z=!1;const gt=(y,_,w)=>{let K;y==null?_._vnode&&(Ne(_._vnode,null,null,!0),K=_._vnode.component):F(_._vnode||null,y,_,null,null,null,w),_._vnode=y,z||(z=!0,wl(K),Ku(),z=!1)},ut={p:F,um:Ne,m:be,r:dt,mt:ie,mc:Ge,pc:se,pbc:ye,n:A,o:t};return{render:gt,hydrate:void 0,createApp:Ef(gt)}}function lr({type:t,props:i},s){return s==="svg"&&t==="foreignObject"||s==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:s}function no({effect:t,job:i},s){s?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function Kf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function Wr(t,i,s=!1){const l=t.children,u=i.children;if(De(l)&&De(u))for(let d=0;d>1,t[s[v]]0&&(i[l]=s[d-1]),s[d]=l)}}for(d=s.length,h=s[d-1];d-- >0;)s[d]=h,h=i[h];return s}function kc(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:kc(i)}function $l(t){if(t)for(let i=0;it.__isSuspense;function qf(t,i){i&&i.pendingBranch?De(t)?i.effects.push(...t):i.effects.push(t):ef(t)}const ue=Symbol.for("v-fgt"),Da=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),ur=Symbol.for("v-stc"),Ls=[];let mn=null;function p(t=!1){Ls.push(mn=t?null:[])}function Yf(){Ls.pop(),mn=Ls[Ls.length-1]||null}let zs=1;function ya(t,i=!1){zs+=t,t<0&&mn&&i&&(mn.hasOnce=!0)}function Pc(t){return t.dynamicChildren=zs>0?mn||Io:null,Yf(),zs>0&&mn&&mn.push(t),t}function g(t,i,s,l,u,d){return Pc(r(t,i,s,l,u,d,!0))}function lt(t,i,s,l,u){return Pc(E(t,i,s,l,u,!0))}function Is(t){return t?t.__v_isVNode===!0:!1}function ro(t,i){return t.type===i.type&&t.key===i.key}const Cc=({key:t})=>t??null,pa=({ref:t,ref_key:i,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?St(t)||Gt(t)||Ye(t)?{i:Kt,r:t,k:i,f:!!s}:t:null);function r(t,i=null,s=null,l=0,u=null,d=t===ue?0:1,h=!1,v=!1){const b={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Cc(i),ref:i&&pa(i),scopeId:qu,slotScopeIds:null,children:s,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:d,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:Kt};return v?(xa(b,s),d&128&&t.normalize(b)):s&&(b.shapeFlag|=St(s)?8:16),zs>0&&!h&&mn&&(b.patchFlag>0||d&6)&&b.patchFlag!==32&&mn.push(b),b}const E=Jf;function Jf(t,i=null,s=null,l=0,u=null,d=!1){if((!t||t===wf)&&(t=Wt),Is(t)){const v=Ii(t,i,!0);return s&&xa(v,s),zs>0&&!d&&mn&&(v.shapeFlag&6?mn[mn.indexOf(t)]=v:mn.push(v)),v.patchFlag=-2,v}if(rh(t)&&(t=t.__vccOpts),i){i=Xf(i);let{class:v,style:b}=i;v&&!St(v)&&(i.class=Ee(v)),ht(b)&&(Vr(b)&&!De(b)&&(b=$t({},b)),i.style=Bo(b))}const h=St(t)?1:Tc(t)?128:ec(t)?64:ht(t)?4:Ye(t)?2:0;return r(t,i,s,l,u,h,d,!0)}function Xf(t){return t?Vr(t)||vc(t)?$t({},t):t:null}function Ii(t,i,s=!1,l=!1){const{props:u,ref:d,patchFlag:h,children:v,transition:b}=t,C=i?Qf(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Cc(C),ref:i&&i.ref?s&&d?De(d)?d.concat(pa(i)):[d,pa(i)]:pa(i):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:v,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==ue?h===-1?16:h|16:h,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:b,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ii(t.ssContent),ssFallback:t.ssFallback&&Ii(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return b&&l&&Os(T,b.clone(T)),T}function $(t=" ",i=0){return E(Da,null,t,i)}function D(t="",i=!1){return i?(p(),lt(Wt,null,t)):E(Wt,null,t)}function Hn(t){return t==null||typeof t=="boolean"?E(Wt):De(t)?E(ue,null,t.slice()):Is(t)?li(t):E(Da,null,String(t))}function li(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ii(t)}function xa(t,i){let s=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(De(i))s=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),xa(t,u()),u._c&&(u._d=!0));return}else{s=32;const u=i._;!u&&!vc(i)?i._ctx=Kt:u===3&&Kt&&(Kt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(Ye(i)){if(l&65){xa(t,{default:i});return}i={default:i,_ctx:Kt},s=32}else i=String(i),l&64?(s=16,i=[$(i)]):s=8;t.children=i,t.shapeFlag|=s}function Qf(...t){const i={};for(let s=0;sQt||Kt;let wa,Cr;{const t=Ea(),i=(s,l)=>{let u;return(u=t[s])||(u=t[s]=[]),u.push(l),d=>{u.length>1?u.forEach(h=>h(d)):u[0](d)}};wa=i("__VUE_INSTANCE_SETTERS__",s=>Qt=s),Cr=i("__VUE_SSR_SETTERS__",s=>$s=s)}const Rs=t=>{const i=Qt;return wa(t),t.scope.on(),()=>{t.scope.off(),wa(i)}},Nl=()=>{Qt&&Qt.scope.off(),wa(null)};function Mc(t){return t.vnode.shapeFlag&4}let $s=!1;function ih(t,i=!1,s=!1){i&&Cr(i);const{props:l,children:u}=t.vnode,d=Mc(t);Rf(t,l,d,i),Zf(t,u,s||i);const h=d?oh(t,i):void 0;return i&&Cr(!1),h}function oh(t,i){const s=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Sf);const{setup:l}=s;if(l){Kn();const u=t.setupContext=l.length>1?ah(t):null,d=Rs(t),h=Fs(l,t,0,[t.props,u]),v=xu(h);if(Gn(),d(),(v||t.sp)&&!Do(t)&&ac(t),v){if(h.then(Nl,Nl),i)return h.then(b=>{Dl(t,b)}).catch(b=>{za(b,t,0)});t.asyncDep=h}else Dl(t,h)}else Ac(t)}function Dl(t,i,s){Ye(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:ht(i)&&(t.setupState=Zu(i)),Ac(t)}function Ac(t,i,s){const l=t.type;t.render||(t.render=l.render||Wn);{const u=Rs(t);Kn();try{Tf(t)}finally{Gn(),u()}}}const sh={get(t,i){return jt(t,"get",""),t[i]}};function ah(t){const i=s=>{t.exposed=s||{}};return{attrs:new Proxy(t.attrs,sh),slots:t.slots,emit:t.emit,expose:i}}function Fa(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Zu(Hd(t.exposed)),{get(i,s){if(s in i)return i[s];if(s in Cs)return Cs[s](t)},has(i,s){return s in i||s in Cs}})):t.proxy}function rh(t){return Ye(t)&&"__vccOpts"in t}const we=(t,i)=>qd(t,i,$s);function lh(t,i,s){try{ya(-1);const l=arguments.length;return l===2?ht(i)&&!De(i)?Is(i)?E(t,null,[i]):E(t,i):E(t,null,i):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&Is(s)&&(s=[s]),E(t,i,s))}finally{ya(1)}}const uh="3.5.39";/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Lr;const Fl=typeof window<"u"&&window.trustedTypes;if(Fl)try{Lr=Fl.createPolicy("vue",{createHTML:t=>t})}catch{}const Ec=Lr?t=>Lr.createHTML(t):t=>t,ch="http://www.w3.org/2000/svg",dh="http://www.w3.org/1998/Math/MathML",ri=typeof document<"u"?document:null,Rl=ri&&ri.createElement("template"),fh={insert:(t,i,s)=>{i.insertBefore(t,s||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,s,l)=>{const u=i==="svg"?ri.createElementNS(ch,t):i==="mathml"?ri.createElementNS(dh,t):s?ri.createElement(t,{is:s}):ri.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>ri.createTextNode(t),createComment:t=>ri.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ri.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,s,l,u,d){const h=s?s.previousSibling:i.lastChild;if(u&&(u===d||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),s),!(u===d||!(u=u.nextSibling)););else{Rl.innerHTML=Ec(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const v=Rl.content;if(l==="svg"||l==="mathml"){const b=v.firstChild;for(;b.firstChild;)v.appendChild(b.firstChild);v.removeChild(b)}i.insertBefore(v,s)}return[h?h.nextSibling:i.firstChild,s?s.previousSibling:i.lastChild]}},Mi="transition",gs="animation",Ns=Symbol("_vtc"),Oc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},hh=$t({},tc,Oc),ph=t=>(t.displayName="Transition",t.props=hh,t),mh=ph((t,{slots:i})=>lh(df,gh(t),i)),io=(t,i=[])=>{De(t)?t.forEach(s=>s(...i)):t&&t(...i)},Bl=t=>t?De(t)?t.some(i=>i.length>1):t.length>1:!1;function gh(t){const i={};for(const ne in t)ne in Oc||(i[ne]=t[ne]);if(t.css===!1)return i;const{name:s="v",type:l,duration:u,enterFromClass:d=`${s}-enter-from`,enterActiveClass:h=`${s}-enter-active`,enterToClass:v=`${s}-enter-to`,appearFromClass:b=d,appearActiveClass:C=h,appearToClass:T=v,leaveFromClass:M=`${s}-leave-from`,leaveActiveClass:R=`${s}-leave-active`,leaveToClass:B=`${s}-leave-to`}=t,Z=vh(u),F=Z&&Z[0],he=Z&&Z[1],{onBeforeEnter:pe,onEnter:q,onEnterCancelled:Te,onLeave:fe,onLeaveCancelled:Ue,onBeforeAppear:$e=pe,onAppear:Ie=q,onAppearCancelled:Ge=Te}=i,_e=(ne,je,ie,We)=>{ne._enterCancelled=We,oo(ne,je?T:v),oo(ne,je?C:h),ie&&ie()},ye=(ne,je)=>{ne._isLeaving=!1,oo(ne,M),oo(ne,B),oo(ne,R),je&&je()},ze=ne=>(je,ie)=>{const We=ne?Ie:q,le=()=>_e(je,ne,ie);io(We,[je,le]),Ul(()=>{oo(je,ne?b:d),ai(je,ne?T:v),Bl(We)||Vl(je,l,F,le)})};return $t(i,{onBeforeEnter(ne){io(pe,[ne]),ai(ne,d),ai(ne,h)},onBeforeAppear(ne){io($e,[ne]),ai(ne,b),ai(ne,C)},onEnter:ze(!1),onAppear:ze(!0),onLeave(ne,je){ne._isLeaving=!0;const ie=()=>ye(ne,je);ai(ne,M),ne._enterCancelled?(ai(ne,R),jl(ne)):(jl(ne),ai(ne,R)),Ul(()=>{ne._isLeaving&&(oo(ne,M),ai(ne,B),Bl(fe)||Vl(ne,l,he,ie))}),io(fe,[ne,ie])},onEnterCancelled(ne){_e(ne,!1,void 0,!0),io(Te,[ne])},onAppearCancelled(ne){_e(ne,!0,void 0,!0),io(Ge,[ne])},onLeaveCancelled(ne){ye(ne),io(Ue,[ne])}})}function vh(t){if(t==null)return null;if(ht(t))return[cr(t.enter),cr(t.leave)];{const i=cr(t);return[i,i]}}function cr(t){return gd(t)}function ai(t,i){i.split(/\s+/).forEach(s=>s&&t.classList.add(s)),(t[Ns]||(t[Ns]=new Set)).add(i)}function oo(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const s=t[Ns];s&&(s.delete(i),s.size||(t[Ns]=void 0))}function Ul(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let _h=0;function Vl(t,i,s,l){const u=t._endId=++_h,d=()=>{u===t._endId&&l()};if(s!=null)return setTimeout(d,s);const{type:h,timeout:v,propCount:b}=bh(t,i);if(!h)return l();const C=h+"end";let T=0;const M=()=>{t.removeEventListener(C,R),d()},R=B=>{B.target===t&&++T>=b&&M()};setTimeout(()=>{T(s[Z]||"").split(", "),u=l(`${Mi}Delay`),d=l(`${Mi}Duration`),h=Zl(u,d),v=l(`${gs}Delay`),b=l(`${gs}Duration`),C=Zl(v,b);let T=null,M=0,R=0;i===Mi?h>0&&(T=Mi,M=h,R=d.length):i===gs?C>0&&(T=gs,M=C,R=b.length):(M=Math.max(h,C),T=M>0?h>C?Mi:gs:null,R=T?T===Mi?d.length:b.length:0);const B=T===Mi&&/\b(?:transform|all)(?:,|$)/.test(l(`${Mi}Property`).toString());return{type:T,timeout:M,propCount:R,hasTransform:B}}function Zl(t,i){for(;t.lengthHl(s)+Hl(t[l])))}function Hl(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function jl(t){return(t?t.ownerDocument:document).body.offsetHeight}function yh(t,i,s){const l=t[Ns];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):s?t.setAttribute("class",i):t.className=i}const ka=Symbol("_vod"),zc=Symbol("_vsh"),xh={name:"show",beforeMount(t,{value:i},{transition:s}){t[ka]=t.style.display==="none"?"":t.style.display,s&&i?s.beforeEnter(t):vs(t,i)},mounted(t,{value:i},{transition:s}){s&&i&&s.enter(t)},updated(t,{value:i,oldValue:s},{transition:l}){!i!=!s&&(l?i?(l.beforeEnter(t),vs(t,!0),l.enter(t)):l.leave(t,()=>{vs(t,!1)}):vs(t,i))},beforeUnmount(t,{value:i}){vs(t,i)}};function vs(t,i){t.style.display=i?t[ka]:"none",t[zc]=!i}const wh=Symbol(""),kh=/(?:^|;)\s*display\s*:/;function Sh(t,i,s){const l=t.style,u=St(s);let d=!1;if(s&&!u){if(i)if(St(i))for(const h of i.split(";")){const v=h.slice(0,h.indexOf(":")).trim();s[v]==null&&ys(l,v,"")}else for(const h in i)s[h]==null&&ys(l,h,"");for(const h in s){h==="display"&&(d=!0);const v=s[h];v!=null?Ph(t,h,!St(i)&&i?i[h]:void 0,v)||ys(l,h,v):ys(l,h,"")}}else if(u){if(i!==s){const h=l[wh];h&&(s+=";"+h),l.cssText=s,d=kh.test(s)}}else i&&t.removeAttribute("style");ka in t&&(t[ka]=d?l.display:"",t[zc]&&(l.display="none"))}const Wl=/\s*!important$/;function ys(t,i,s){if(De(s))s.forEach(l=>ys(t,i,l));else if(s==null&&(s=""),i.startsWith("--"))t.setProperty(i,s);else{const l=Th(t,i);Wl.test(s)?t.setProperty(Ni(l),s.replace(Wl,""),"important"):t[l]=s}}const Kl=["Webkit","Moz","ms"],dr={};function Th(t,i){const s=dr[i];if(s)return s;let l=In(i);if(l!=="filter"&&l in t)return dr[i]=l;l=Su(l);for(let u=0;ufr||(Oh.then(()=>fr=0),fr=Date.now());function Ih(t,i){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;const u=s.value;if(De(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const h=u.slice(),v=[l];for(let b=0;bt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,$h=(t,i,s,l,u,d)=>{const h=u==="svg";i==="class"?yh(t,l,h):i==="style"?Sh(t,s,l):Ca(i)?La(i)||Lh(t,i,s,l,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):Nh(t,i,l,h))?(Yl(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&ql(t,i,l,h,d,i!=="value")):t._isVueCE&&(Dh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!St(l)))?Yl(t,In(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),ql(t,i,l,h))};function Nh(t,i,s,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Xl(i)&&Ye(s));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&t.tagName==="IFRAME"||i==="form"||i==="list"&&t.tagName==="INPUT"||i==="type"&&t.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return Xl(i)&&St(s)?!1:i in t}function Dh(t,i){const s=t._def.props;if(!s)return!1;const l=In(i);return Array.isArray(s)?s.some(u=>In(u)===l):Object.keys(s).some(u=>In(u)===l)}const $i=t=>{const i=t.props["onUpdate:modelValue"]||!1;return De(i)?s=>ha(i,s):i};function Fh(t){t.target.composing=!0}function Ql(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const Ln=Symbol("_assign");function eu(t,i,s){return i&&(t=t.trim()),s&&(t=Aa(t)),t}const Se={created(t,{modifiers:{lazy:i,trim:s,number:l}},u){t[Ln]=$i(u);const d=l||u.props&&u.props.type==="number";di(t,i?"change":"input",h=>{h.target.composing||t[Ln](eu(t.value,s,d))}),(s||d)&&di(t,"change",()=>{t.value=eu(t.value,s,d)}),i||(di(t,"compositionstart",Fh),di(t,"compositionend",Ql),di(t,"change",Ql))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:s,modifiers:{lazy:l,trim:u,number:d}},h){if(t[Ln]=$i(h),t.composing)return;const v=(d||t.type==="number")&&!/^0\d/.test(t.value)?Aa(t.value):t.value,b=i??"";if(v===b)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===s||u&&t.value.trim()===b)||(t.value=b)}},Sa={deep:!0,created(t,i,s){t[Ln]=$i(s),di(t,"change",()=>{const l=t._modelValue,u=Vo(t),d=t.checked,h=t[Ln];if(De(l)){const v=$r(l,u),b=v!==-1;if(d&&!b)h(l.concat(u));else if(!d&&b){const C=[...l];C.splice(v,1),h(C)}}else if(Zo(l)){const v=new Set(l);d?v.add(u):v.delete(u),h(v)}else h(Ic(t,d))})},mounted:tu,beforeUpdate(t,i,s){t[Ln]=$i(s),tu(t,i,s)}};function tu(t,{value:i,oldValue:s},l){t._modelValue=i;let u;if(De(i))u=$r(i,l.props.value)>-1;else if(Zo(i))u=i.has(l.props.value);else{if(i===s)return;u=zi(i,Ic(t,!0))}t.checked!==u&&(t.checked=u)}const Rh={created(t,{value:i},s){t.checked=zi(i,s.props.value),t[Ln]=$i(s),di(t,"change",()=>{t[Ln](Vo(t))})},beforeUpdate(t,{value:i,oldValue:s},l){t[Ln]=$i(l),i!==s&&(t.checked=zi(i,l.props.value))}},Mt={deep:!0,created(t,{value:i,modifiers:{number:s}},l){const u=Zo(i);di(t,"change",()=>{const d=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>s?Aa(Vo(h)):Vo(h));t[Ln](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,ju(()=>{t._assigning=!1})}),t[Ln]=$i(l)},mounted(t,{value:i}){nu(t,i)},beforeUpdate(t,i,s){t[Ln]=$i(s)},updated(t,{value:i}){t._assigning||nu(t,i)}};function nu(t,i){const s=t.multiple,l=De(i);if(!(s&&!l&&!Zo(i))){for(let u=0,d=t.options.length;uString(C)===String(v)):h.selected=$r(i,v)>-1}else h.selected=i.has(v);else if(zi(Vo(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Vo(t){return"_value"in t?t._value:t.value}function Ic(t,i){const s=i?"_trueValue":"_falseValue";return s in t?t[s]:i}const Bh={created(t,i,s){da(t,i,s,null,"created")},mounted(t,i,s){da(t,i,s,null,"mounted")},beforeUpdate(t,i,s,l){da(t,i,s,l,"beforeUpdate")},updated(t,i,s,l){da(t,i,s,l,"updated")}};function Uh(t,i){switch(t){case"SELECT":return Mt;case"TEXTAREA":return Se;default:switch(i){case"checkbox":return Sa;case"radio":return Rh;default:return Se}}}function da(t,i,s,l,u){const h=Uh(t.tagName,s.props&&s.props.type)[u];h&&h(t,i,s,l)}const Vh=["ctrl","shift","alt","meta"],Zh={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,i)=>Vh.some(s=>t[`${s}Key`]&&!i.includes(s))},Kr=(t,i)=>{if(!t)return t;const s=t._withMods||(t._withMods={}),l=i.join(".");return s[l]||(s[l]=((u,...d)=>{for(let h=0;h{const s=t._withKeys||(t._withKeys={}),l=i.join(".");return s[l]||(s[l]=(u=>{if(!("key"in u))return;const d=Ni(u.key);if(i.some(h=>h===d||Hh[h]===d))return t(u)}))},jh=$t({patchProp:$h},fh);let ou;function Wh(){return ou||(ou=jf(jh))}const Kh=((...t)=>{const i=Wh().createApp(...t),{mount:s}=i;return i.mount=l=>{const u=qh(l);if(!u)return;const d=i._component;!Ye(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=s(u,!1,Gh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Gh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function qh(t){return St(t)?document.querySelector(t):t}const $c="pv_theme",su={light:"#EEF0F3",dark:"#0B1730"},Ta=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function Nc(){return Ta&&Ta.matches?"dark":"light"}function Yh(){try{return localStorage.getItem($c)||"light"}catch{return"light"}}function Dc(t){return t==="system"?Nc():t}function Fc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=su[t]||su.light}const co=W(Yh()),Ro=W(Dc(co.value));function Pa(t){co.value=t;const i=Dc(t);Ro.value=i,Fc(i);try{localStorage.setItem($c,t)}catch{}}function au(){Pa(Ro.value==="dark"?"light":"dark")}Ta&&Ta.addEventListener("change",()=>{if(co.value==="system"){const t=Nc();Ro.value=t,Fc(t)}});async function Jh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function ru(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function Xh(t,i,s){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:s})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Qh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function ep(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function tp(){try{const t=await fetch("/bff/users");return t.ok?{ok:!0,status:200,users:(await t.json()).users||[]}:{ok:!1,status:t.status,users:[]}}catch{return{ok:!1,status:0,users:[]}}}async function np(t,i,s,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:s,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function ip(t,i){const s=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function op(t){const i=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function sp(){try{const t=await fetch("/bff/orgs");return t.ok?{ok:!0,status:200,organizations:(await t.json()).organizations||[]}:{ok:!1,status:t.status,organizations:[]}}catch{return{ok:!1,status:0,organizations:[]}}}async function ap(t){const i=await fetch("/bff/orgs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function rp(t,i){const s=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function lp(t){const i=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function up(){try{const t=await fetch("/bff/preferences");if(!t.ok)return null;const i=await t.json();return i&&typeof i.preferences=="object"?i.preferences:null}catch{return null}}async function cp(t){try{return(await fetch("/bff/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:t})})).ok}catch{return!1}}async function dp(){try{const t=await fetch("/bff/integrations/opensky");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function lu(t){const i=await fetch("/bff/integrations/opensky",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function fp(){const t=await fetch("/bff/integrations/opensky/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function hp(t){try{const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/states${i}`);if(!s.ok)return{states:[],unavailable:!0,detail:"OpenSky unavailable"};const l=await s.json();return{states:l.states||[],time:l.time,unavailable:!!l.unavailable,detail:l.detail||"",plan:l.plan||"",recommendedInterval:l.recommendedInterval||0}}catch{return{states:[],unavailable:!0,detail:"OpenSky unavailable"}}}async function pp(){try{const t=await fetch("/bff/integrations/filetransfer");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function uu(t){const i=await fetch("/bff/integrations/filetransfer",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function mp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function gp(){try{const t=await fetch("/bff/integrations/localstorage");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function fa(t){const i=await fetch("/bff/integrations/localstorage",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function vp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function _p(){try{const t=await fetch("/bff/integrations/webdav");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function cu(t){const i=await fetch("/bff/integrations/webdav",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function bp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Rc(){try{const t=await fetch("/bff/drones");return t.ok?{ok:!0,status:200,drones:(await t.json()).drones||[]}:{ok:!1,status:t.status,drones:[]}}catch{return{ok:!1,status:0,drones:[]}}}async function yp(t){const i=await fetch("/bff/drones",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function xp(t,i){const s=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function wp(t){const i=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function kp(){try{const t=await fetch("/bff/flights");return t.ok?{ok:!0,status:200,flights:(await t.json()).flights||[]}:{ok:!1,status:t.status,flights:[]}}catch{return{ok:!1,status:0,flights:[]}}}async function Sp(t){const i=await fetch("/bff/flights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Tp(t,i){const s=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Pp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Cp(){return"/bff/logbook/export"}async function Lp(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/documents${i}`);return s.ok?{ok:!0,status:200,documents:(await s.json()).documents||[]}:{ok:!1,status:s.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function Mp(t,i){const s=new FormData;Object.entries(t).forEach(([u,d])=>{d!=null&&d!==""&&s.append(u,d)}),i&&s.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:s});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Ap(t,i){const s=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Ep(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function hr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Op(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function zp(t,i,s){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:s})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Bc="pv_prefs",Mr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,showAirTraffic:!0,autoBbox:!0,airTrafficInterval:"auto",twoFactor:!1};function Ip(){try{return{...Mr,...JSON.parse(localStorage.getItem(Bc)||"{}")||{}}}catch{return{...Mr}}}const ve=kt(Ip());function Uc(){try{localStorage.setItem(Bc,JSON.stringify(ve))}catch{}}function Vc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(Mr))i in t&&(ve[i]=t[i]);return!0}const $p={sm:15,md:16,lg:18};function Gr(t){document.documentElement.style.fontSize=($p[t]||16)+"px"}function qr(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Zc(t){const i=new Date(t),s=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let d;switch(ve.dateFormat){case"DMY":d=`${u}/${l}/${s}`;break;case"YMD":d=`${s}/${l}/${u}`;break;case"ISO":d=`${s}-${l}-${u}`;break;default:d=`${l}/${u}/${s}`}let h;return ve.timeFormat==="12"?h=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):h=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:h}}function du(t){return Zc(t).time}function fu(t){const i=Zc(t);return`${i.date} ${i.time}`}let Yr=!1,Ar=!1,Er=null;function Np(){return{...JSON.parse(JSON.stringify(ve)),themeMode:co.value}}function Jr(){!Yr||Ar||(clearTimeout(Er),Er=setTimeout(()=>{cp(Np())},600))}function Dp(t){Ar=!0;try{Vc(t),t.themeMode&&Pa(t.themeMode),Gr(ve.fontSize),qr(ve.reduceMotion),Uc()}finally{Ar=!1}}async function hu(){Yr=!0;const t=await up();t&&Object.keys(t).length?Dp(t):Jr()}function Fp(){Yr=!1,clearTimeout(Er)}It(ve,()=>{Uc(),Jr()},{deep:!0});It(co,Jr);It(()=>ve.fontSize,Gr,{immediate:!0});It(()=>ve.reduceMotion,qr,{immediate:!0});const Rp=["width","height"],Hc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,s)=>(p(),g("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...s[0]||(s[0]=[r("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[r("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),r("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Rp))}},Bp=["title","aria-label"],Up={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Vp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Zp={__name:"ThemeToggle",setup(t){return(i,s)=>(p(),g("button",{class:"btn-icon",type:"button",title:Oe(Ro)==="dark"?"Switch to light":"Switch to dark","aria-label":Oe(Ro)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:s[0]||(s[0]=(...l)=>Oe(au)&&Oe(au)(...l))},[Oe(Ro)==="dark"?(p(),g("svg",Up,[...s[1]||(s[1]=[r("circle",{cx:"12",cy:"12",r:"4"},null,-1),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(p(),g("svg",Vp,[...s[2]||(s[2]=[r("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Bp))}},Hp={class:"relative grid h-full place-items-center p-5"},jp={class:"absolute right-5 top-5"},Wp={class:"mb-6 flex items-center gap-3 text-ink"},Kp={class:"relative mb-1"},Gp=["type"],qp=["aria-label","title"],Yp={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},Jp={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},Xp={key:0,class:"mt-4"},Qp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},em=["disabled"],tm={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const s=t,l=i,u=W(""),d=W(""),h=W(localStorage.getItem("api_url")||s.defaultApiBase||"http://localhost:8080"),v=W(!1),b=W(!1),C=W(!1),T=W("");async function M(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:R,status:B,body:Z}=await Xh(u.value.trim(),d.value,h.value.trim());if(C.value=!1,R){l("signed-in",Z.email);return}T.value=B===400?"Invalid email or password.":B===502?"API server can't reach PocketBase.":Z.message||Z.error||"Cannot reach the API server."}return(R,B)=>(p(),g("div",Hp,[r("div",jp,[E(Zp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:Kr(M,["prevent"])},[r("div",Wp,[E(Hc,{size:34}),B[5]||(B[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),B[9]||(B[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),re(r("input",{"onUpdate:modelValue":B[0]||(B[0]=Z=>u.value=Z),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[Se,u.value]]),B[10]||(B[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",Kp,[re(r("input",{"onUpdate:modelValue":B[1]||(B[1]=Z=>d.value=Z),type:b.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Gp),[[Bh,d.value]]),r("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":b.value?"Hide password":"Show password",title:b.value?"Hide password":"Show password",onClick:B[2]||(B[2]=Z=>b.value=!b.value)},[b.value?(p(),g("svg",Yp,[...B[6]||(B[6]=[r("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),r("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),g("svg",Jp,[...B[7]||(B[7]=[r("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),r("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,qp)]),v.value?(p(),g("div",Xp,[B[8]||(B[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),re(r("input",{"onUpdate:modelValue":B[3]||(B[3]=Z=>h.value=Z),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[Se,h.value]])])):D("",!0),T.value?(p(),g("p",Qp,k(T.value),1)):D("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},k(C.value?"Signing in…":"Sign in"),9,em),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:B[4]||(B[4]=Z=>v.value=!v.value)},k(v.value?"Hide server settings":"Server settings"),1)],32)]))}};function nm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xs={exports:{}};/* @preserve + * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com + * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade + */var im=xs.exports,pu;function om(){return pu||(pu=1,(function(t,i){(function(s,l){l(i)})(im,(function(s){var l="1.9.4";function u(e){var n,o,a,c;for(o=1,a=arguments.length;o"u"||!L||!L.Mixin)){e=Te(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};se.prototype={clone:function(){return new se(this.x,this.y)},add:function(e){return this.clone()._add(ee(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(ee(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new se(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new se(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ot(this.x),this.y=ot(this.y),this},distanceTo:function(e){e=ee(e);var n=e.x-this.x,o=e.y-this.y;return Math.sqrt(n*n+o*o)},equals:function(e){return e=ee(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=ee(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+R(this.x)+", "+R(this.y)+")"}};function ee(e,n,o){return e instanceof se?e:Te(e)?new se(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new se(e.x,e.y):new se(e,n,o)}function be(e,n){if(e)for(var o=n?[e,n]:e,a=0,c=o.length;a=this.min.x&&o.x<=this.max.x&&n.y>=this.min.y&&o.y<=this.max.y},intersects:function(e){e=Ne(e);var n=this.min,o=this.max,a=e.min,c=e.max,m=c.x>=n.x&&a.x<=o.x,P=c.y>=n.y&&a.y<=o.y;return m&&P},overlaps:function(e){e=Ne(e);var n=this.min,o=this.max,a=e.min,c=e.max,m=c.x>n.x&&a.xn.y&&a.y=n.lat&&c.lat<=o.lat&&a.lng>=n.lng&&c.lng<=o.lng},intersects:function(e){e=at(e);var n=this._southWest,o=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>=n.lat&&a.lat<=o.lat,P=c.lng>=n.lng&&a.lng<=o.lng;return m&&P},overlaps:function(e){e=at(e);var n=this._southWest,o=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>n.lat&&a.latn.lng&&a.lng1,vn=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",M,n),window.removeEventListener("testPassiveEventSupport",M,n)}catch{}return e})(),ho=(function(){return!!document.createElement("canvas").getContext})(),Ot=!!(document.createElementNS&&K("svg").createSVGRect),en=!!Ot&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Pt=!Ot&&(function(){try{var e=document.createElement("div");e.innerHTML='';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch{return!1}})(),Va=navigator.platform.indexOf("Mac")===0,Bs=navigator.platform.indexOf("Linux")===0;function tn(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Le={ie:ae,ielt9:te,edge:Q,webkit:G,android:me,android23:oe,androidStock:Ce,opera:He,chrome:et,gecko:U,safari:O,phantom:xe,opera12:Je,win:pt,ie3d:Ve,webkit3d:Vt,gecko3d:de,any3d:Fe,mobile:Nt,mobileWebkit:qn,mobileWebkit3d:fo,msPointer:gn,pointer:Yn,touch:Ba,touchNative:jo,mobileOpera:Wo,mobileGecko:Ko,retina:Ua,passiveEvents:vn,canvas:ho,svg:Ot,vml:Pt,inlineSvg:en,mac:Va,linux:Bs},Us=Le.msPointer?"MSPointerDown":"pointerdown",Vs=Le.msPointer?"MSPointerMove":"pointermove",Zs=Le.msPointer?"MSPointerUp":"pointerup",Go=Le.msPointer?"MSPointerCancel":"pointercancel",qo={touchstart:Us,touchmove:Vs,touchend:Zs,touchcancel:Go},Hs={touchstart:vi,touchmove:nn,touchend:nn,touchcancel:nn},mi={},rt=!1;function gi(e,n,o){return n==="touchstart"&&po(),Hs[n]?(o=Hs[n].bind(this,o),e.addEventListener(qo[n],o,!1),o):(console.warn("wrong event specified:",n),M)}function Yo(e,n,o){if(!qo[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(qo[n],o,!1)}function Zt(e){mi[e.pointerId]=e}function Di(e){mi[e.pointerId]&&(mi[e.pointerId]=e)}function Fi(e){delete mi[e.pointerId]}function po(){rt||(document.addEventListener(Us,Zt,!0),document.addEventListener(Vs,Di,!0),document.addEventListener(Zs,Fi,!0),document.addEventListener(Go,Fi,!0),rt=!0)}function nn(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var o in mi)n.touches.push(mi[o]);n.changedTouches=[n],e(n)}}function vi(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Et(n),nn(e,n)}function Za(e){var n={},o,a;for(a in e)o=e[a],n[a]=o&&o.bind?o.bind(e):o;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var Jo=200;function Xo(e,n){e.addEventListener("dblclick",n);var o=0,a;function c(m){if(m.detail!==1){a=m.detail;return}if(!(m.pointerType==="mouse"||m.sourceCapabilities&&!m.sourceCapabilities.firesTouchEvents)){var P=wo(m);if(!(P.some(function(N){return N instanceof HTMLLabelElement&&N.attributes.for})&&!P.some(function(N){return N instanceof HTMLInputElement||N instanceof HTMLSelectElement}))){var I=Date.now();I-o<=Jo?(a++,a===2&&n(Za(m))):a=1,o=I}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function Ha(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var on=Fn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),sn=Fn(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Jn=sn==="webkitTransition"||sn==="OTransition"?sn+"End":"transitionend";function cn(e){return typeof e=="string"?document.getElementById(e):e}function _i(e,n){var o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){var a=document.defaultView.getComputedStyle(e,null);o=a?a[n]:null}return o==="auto"?null:o}function tt(e,n,o){var a=document.createElement(e);return a.className=n||"",o&&o.appendChild(a),a}function yt(e){var n=e.parentNode;n&&n.removeChild(e)}function mo(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function bi(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function yi(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function go(e,n){if(e.classList!==void 0)return e.classList.contains(n);var o=Me(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}function qe(e,n){if(e.classList!==void 0)for(var o=Z(n),a=0,c=o.length;a0?2*window.devicePixelRatio:1;function it(e){return Le.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/os:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function Rt(e,n){var o=n.relatedTarget;if(!o)return!0;try{for(;o&&o!==e;)o=o.parentNode}catch{return!1}return o!==e}var ki={__proto__:null,on:Ke,off:mt,stopPropagation:Qn,disableScrollPropagation:is,disableClickPropagation:wi,preventDefault:Et,stop:En,getPropagationPath:wo,getMousePosition:Vi,getWheelDelta:it,isExternalTarget:Rt,addListener:Ke,removeListener:mt},ss=ce.extend({run:function(e,n,o,a){this.stop(),this._el=e,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(a||.5,.2),this._startPos=Dt(e),this._offset=n.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=ze(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,o=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var o=this.getCenter(),a=this._limitCenter(o,this._zoom,at(e));return o.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var o=ee(n.paddingTopLeft||n.padding||[0,0]),a=ee(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),m=this.project(e),P=this.getPixelBounds(),I=Ne([P.min.add(o),P.max.subtract(a)]),N=I.getSize();if(!I.contains(m)){this._enforcingBounds=!0;var J=m.subtract(I.getCenter()),ge=I.extend(m).getSize().subtract(N);c.x+=J.x<0?-ge.x:ge.x,c.y+=J.y<0?-ge.y:ge.y,this.panTo(this.unproject(c),n),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=u({animate:!1,pan:!0},e===!0?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),a=n.divideBy(2).round(),c=o.divideBy(2).round(),m=a.subtract(c);return!m.x&&!m.y?this:(e.animate&&e.pan?this.panBy(m):(e.pan&&this._rawPanBy(m),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=u({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),o=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,e):navigator.geolocation.getCurrentPosition(n,o,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var n=e.code,o=e.message||(n===1?"permission denied":n===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:n,message:"Geolocation error: "+o+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,o=e.coords.longitude,a=new Ze(n,o),c=a.toBounds(e.coords.accuracy*2),m=this._locateOptions;if(m.setView){var P=this.getBoundsZoom(c);this.setView(a,m.maxZoom?Math.min(P,m.maxZoom):P)}var I={latlng:a,bounds:c,timestamp:e.timestamp};for(var N in e.coords)typeof e.coords[N]=="number"&&(I[N]=e.coords[N]);this.fire("locationfound",I)}},addHandler:function(e,n){if(!n)return this;var o=this[e]=new n(this);return this._handlers.push(o),this.options[e]&&o.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),yt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ne(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var e;for(e in this._layers)this._layers[e].remove();for(e in this._panes)yt(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var o="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),a=tt("div",o,n||this._mapPane);return e&&(this._panes[e]=a),a},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),o=this.unproject(e.getTopRight());return new dt(n,o)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,n,o){e=at(e),o=ee(o||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),m=this.getMaxZoom(),P=e.getNorthWest(),I=e.getSouthEast(),N=this.getSize().subtract(o),J=Ne(this.project(I,a),this.project(P,a)).getSize(),ge=Le.any3d?this.options.zoomSnap:1,Re=N.x/J.x,Qe=N.y/J.y,qt=n?Math.max(Re,Qe):Math.min(Re,Qe);return a=this.getScaleZoom(qt,a),ge&&(a=Math.round(a/(ge/100))*(ge/100),a=n?Math.ceil(a/ge)*ge:Math.floor(a/ge)*ge),Math.max(c,Math.min(m,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new se(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var o=this._getTopLeftPoint(e,n);return new be(o,o.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,n){var o=this.options.crs;return n=n===void 0?this._zoom:n,o.scale(e)/o.scale(n)},getScaleZoom:function(e,n){var o=this.options.crs;n=n===void 0?this._zoom:n;var a=o.zoom(e*o.scale(n));return isNaN(a)?1/0:a},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(Y(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(ee(e),n)},layerPointToLatLng:function(e){var n=ee(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(Y(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(Y(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(at(e))},distance:function(e,n){return this.options.crs.distance(Y(e),Y(n))},containerPointToLayerPoint:function(e){return ee(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return ee(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(ee(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Y(e)))},mouseEventToContainerPoint:function(e){return Vi(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var n=this._container=cn(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ke(n,"scroll",this._onScroll,this),this._containerId=b(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&Le.any3d,qe(e,"leaflet-container"+(Le.touch?" leaflet-touch":"")+(Le.retina?" leaflet-retina":"")+(Le.ielt9?" leaflet-oldie":"")+(Le.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=_i(e,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&n!=="sticky"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),xt(this._mapPane,new se(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(qe(e.markerPane,"leaflet-zoom-hide"),qe(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,o){xt(this._mapPane,new se(0,0));var a=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,o)._move(e,n)._moveEnd(c),this.fire("viewreset"),a&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,o,a){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),a?o&&o.pinch&&this.fire("zoom",o):((c||o&&o.pinch)&&this.fire("zoom",o),this.fire("move",o)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ne(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){xt(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[b(this._container)]=this;var n=e?mt:Ke;n(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&n(window,"resize",this._onResize,this),Le.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ne(this._resizeRequest),this._resizeRequest=ze(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,n){for(var o=[],a,c=n==="mouseout"||n==="mouseover",m=e.target||e.srcElement,P=!1;m;){if(a=this._targets[b(m)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!Rt(m,e)||(o.push(a),c))||m===this._container)break;m=m.parentNode}return!o.length&&!P&&!c&&this.listens(n,!0)&&(o=[this]),o},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var n=e.target||e.srcElement;if(!(!this._loaded||n._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(n))){var o=e.type;o==="mousedown"&&bo(n),this._fireDOMEvent(e,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,o){if(e.type==="click"){var a=u({},e);a.type="preclick",this._fireDOMEvent(a,a.type,o)}var c=this._findEventTargets(e,n);if(o){for(var m=[],P=0;P0?Math.round(e-n)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(n))},_limitZoom:function(e){var n=this.getMinZoom(),o=this.getMaxZoom(),a=Le.any3d?this.options.zoomSnap:1;return a&&(e=Math.round(e/a)*a),Math.max(n,Math.min(o,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Tt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var o=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(o)?!1:(this.panBy(o,n),!0)},_createAnimProxy:function(){var e=this._proxy=tt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var o=on,a=this._proxy.style[o];_n(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),a===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){yt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();_n(this._proxy,this.project(e,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,n,o){if(this._animatingZoom)return!0;if(o=o||{},!this._zoomAnimated||o.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var a=this.getZoomScale(n),c=this._getCenterOffset(e)._divideBy(1-1/a);return o.animate!==!0&&!this.getSize().contains(c)?!1:(ze(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,o,a){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,qe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:n,noUpdate:a}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Tt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function as(e,n){return new nt(e,n)}var dn=ie.extend({options:{position:"topright"},initialize:function(e){F(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var n=this._map;return n&&n.removeControl(this),this.options.position=e,n&&n.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var n=this._container=this.onAdd(e),o=this.getPosition(),a=e._controlCorners[o];return qe(n,"leaflet-control"),o.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(yt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),Zi=function(e){return new dn(e)};nt.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",o=this._controlContainer=tt("div",n+"control-container",this._container);function a(c,m){var P=n+c+" "+n+m;e[c+m]=tt("div",P,o)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)yt(this._controlCorners[e]);yt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ks=dn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,o,a){return o1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=n&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var n=this._getLayer(b(e.target)),o=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;o&&this._map.fire(o,n)},_createRadioElement:function(e,n){var o='",a=document.createElement("div");return a.innerHTML=o,a.firstChild},_addItem:function(e){var n=document.createElement("label"),o=this._map.hasLayer(e.layer),a;e.overlay?(a=document.createElement("input"),a.type="checkbox",a.className="leaflet-control-layers-selector",a.defaultChecked=o):a=this._createRadioElement("leaflet-base-layers_"+b(this),o),this._layerControlInputs.push(a),a.layerId=b(e.layer),Ke(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var m=document.createElement("span");n.appendChild(m),m.appendChild(a),m.appendChild(c);var P=e.overlay?this._overlaysList:this._baseLayersList;return P.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,n,o,a=[],c=[];this._handlingClick=!0;for(var m=e.length-1;m>=0;m--)n=e[m],o=this._getLayer(n.layerId).layer,n.checked?a.push(o):n.checked||c.push(o);for(m=0;m=0;c--)n=e[c],o=this._getLayer(n.layerId).layer,n.disabled=o.options.minZoom!==void 0&&ao.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ke(e,"click",Et),this.expand();var n=this;setTimeout(function(){mt(e,"click",Et),n._preventClick=!1})}}),ja=function(e,n,o){return new Ks(e,n,o)},ei=dn.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",o=tt("div",n+" leaflet-bar"),a=this.options;return this._zoomInButton=this._createButton(a.zoomInText,a.zoomInTitle,n+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(a.zoomOutText,a.zoomOutTitle,n+"-out",o,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),o},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,o,a,c){var m=tt("a",o,a);return m.innerHTML=e,m.href="#",m.title=n,m.setAttribute("role","button"),m.setAttribute("aria-label",n),wi(m),Ke(m,"click",En),Ke(m,"click",c,this),Ke(m,"click",this._refocusOnMap,this),m},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";Tt(this._zoomInButton,n),Tt(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(qe(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(qe(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});nt.mergeOptions({zoomControl:!0}),nt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ei,this.addControl(this.zoomControl))});var Gs=function(e){return new ei(e)},Hi=dn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",o=tt("div",n),a=this.options;return this._addScales(a,n+"-line",o),e.on(a.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),o},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,o){e.metric&&(this._mScale=tt("div",n,o)),e.imperial&&(this._iScale=tt("div",n,o))},_update:function(){var e=this._map,n=e.getSize().y/2,o=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(o)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var n=this._getRoundNum(e),o=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,o,n/e)},_updateImperial:function(e){var n=e*3.2808399,o,a,c;n>5280?(o=n/5280,a=this._getRoundNum(o),this._updateScale(this._iScale,a+" mi",a/o)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/n))},_updateScale:function(e,n,o){e.style.width=Math.round(this.options.maxWidth*o)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),o=e/n;return o=o>=10?10:o>=5?5:o>=3?3:o>=2?2:1,n*o}}),ji=function(e){return new Hi(e)},ko='',Wi=dn.extend({options:{position:"bottomright",prefix:''+(Le.inlineSvg?ko+" ":"")+"Leaflet"},initialize:function(e){F(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=tt("div","leaflet-control-attribution"),wi(this._container);for(var n in e._layers)e._layers[n].getAttribution&&this.addAttribution(e._layers[n].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var n in this._attributions)this._attributions[n]&&e.push(n);var o=[];this.options.prefix&&o.push(this.options.prefix),e.length&&o.push(e.join(", ")),this._container.innerHTML=o.join(' ')}}});nt.mergeOptions({attributionControl:!0}),nt.addInitHook(function(){this.options.attributionControl&&new Wi().addTo(this)});var Wa=function(e){return new Wi(e)};dn.Layers=Ks,dn.Zoom=ei,dn.Scale=Hi,dn.Attribution=Wi,Zi.layers=ja,Zi.zoom=Gs,Zi.scale=ji,Zi.attribution=Wa;var xn=ie.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});xn.addTo=function(e,n){return e.addHandler(n,this),this};var Ka={Events:le},fn=Le.touch?"touchstart mousedown":"mousedown",Rn=ce.extend({options:{clickTolerance:3},initialize:function(e,n,o,a){F(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=o},enable:function(){this._enabled||(Ke(this._dragStartTarget,fn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Rn._dragging===this&&this.finishDrag(!0),mt(this._dragStartTarget,fn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!go(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Rn._dragging===this&&this.finishDrag();return}if(!(Rn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Rn._dragging=this,this._preventOutline&&bo(this._element),Ri(),bn(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,o=js(this._element);this._startPoint=new se(n.clientX,n.clientY),this._startPos=Dt(this._element),this._parentScale=yo(o);var a=e.type==="mousedown";Ke(document,a?"mousemove":"touchmove",this._onMove,this),Ke(document,a?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,o=new se(n.clientX,n.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)m&&(P=I,m=N);m>o&&(n[P]=1,ti(e,n,o,a,P),ti(e,n,o,P,c))}function Js(e,n){for(var o=[e[0]],a=1,c=0,m=e.length;an&&(o.push(e[a]),c=a);return cn.max.x&&(o|=2),e.yn.max.y&&(o|=8),o}function To(e,n){var o=n.x-e.x,a=n.y-e.y;return o*o+a*a}function Ji(e,n,o,a){var c=n.x,m=n.y,P=o.x-c,I=o.y-m,N=P*P+I*I,J;return N>0&&(J=((e.x-c)*P+(e.y-m)*I)/N,J>1?(c=o.x,m=o.y):J>0&&(c+=P*J,m+=I*J)),P=e.x-c,I=e.y-m,a?P*P+I*I:new se(c,m)}function rn(e){return!Te(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function st(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),rn(e)}function On(e,n){var o,a,c,m,P,I,N,J;if(!e||e.length===0)throw new Error("latlngs not passed");rn(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var ge=Y([0,0]),Re=at(e),Qe=Re.getNorthWest().distanceTo(Re.getSouthWest())*Re.getNorthEast().distanceTo(Re.getNorthWest());Qe<1700&&(ge=Si(e));var qt=e.length,zt=[];for(o=0;oa){N=(m-a)/c,J=[I.x-N*(I.x-P.x),I.y-N*(I.y-P.y)];break}var ln=n.unproject(ee(J));return Y([ln.lat+ge.lat,ln.lng+ge.lng])}var Po={__proto__:null,simplify:Gi,pointToSegmentDistance:Ct,closestPointOnSegment:Ti,clipSegment:Pi,_getEdgeIntersection:Yi,_getBitCode:an,_sqClosestPointOnSegment:Ji,isFlat:rn,_flat:st,polylineCenter:On},Xi={project:function(e){return new se(e.lng,e.lat)},unproject:function(e){return new Ze(e.y,e.x)},bounds:new be([-180,-90],[180,90])},rs={R:6378137,R_MINOR:6356752314245179e-9,bounds:new be([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,o=this.R,a=e.lat*n,c=this.R_MINOR/o,m=Math.sqrt(1-c*c),P=m*Math.sin(a),I=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),m/2);return a=-o*Math.log(Math.max(I,1e-10)),new se(e.lng*n*o,a)},unproject:function(e){for(var n=180/Math.PI,o=this.R,a=this.R_MINOR/o,c=Math.sqrt(1-a*a),m=Math.exp(-e.y/o),P=Math.PI/2-2*Math.atan(m),I=0,N=.1,J;I<15&&Math.abs(N)>1e-7;I++)J=c*Math.sin(P),J=Math.pow((1-J)/(1+J),c/2),N=Math.PI/2-2*Math.atan(m*J)-P,P+=N;return new Ze(P*n,e.x*n/o)}},Xs={__proto__:null,LonLat:Xi,Mercator:rs,SphericalMercator:ut},Ga=u({},z,{code:"EPSG:3395",projection:rs,transformation:(function(){var e=.5/(Math.PI*rs.R);return y(e,.5,-e,.5)})()}),Qi=u({},z,{code:"EPSG:4326",projection:Xi,transformation:y(1/180,1,-1/180,.5)}),eo=u({},A,{projection:Xi,transformation:y(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,n){var o=n.lng-e.lng,a=n.lat-e.lat;return Math.sqrt(o*o+a*a)},infinite:!0});A.Earth=z,A.EPSG3395=Ga,A.EPSG3857=_,A.EPSG900913=w,A.EPSG4326=Qi,A.Simple=eo;var Ht=ce.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[b(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[b(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var n=e.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var o=this.getEvents();n.on(o,this),this.once("remove",function(){n.off(o,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});nt.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=b(e);return this._layers[n]?this:(this._layers[n]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var n=b(e);return this._layers[n]?(this._loaded&&e.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return b(e)in this._layers},eachLayer:function(e,n){for(var o in this._layers)e.call(n,this._layers[o]);return this},_addLayers:function(e){e=e?Te(e)?e:[e]:[];for(var n=0,o=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Ze&&n[0].equals(n[o-1])&&n.pop(),n},_setLatLngs:function(e){pn.prototype._setLatLngs.call(this,e),rn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return rn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,o=new se(n,n);if(e=new be(e.min.subtract(o),e.max.add(o)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var a=0,c=this._rings.length,m;ae.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(n=!n);return n||pn.prototype._containsPoint.call(this,e,!0)}});function x(e,n){return new Li(e,n)}var f=Bt.extend({initialize:function(e,n){F(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=Te(e)?e:e.features,o,a,c;if(n){for(o=0,a=n.length;o0&&c.push(c[0].slice()),c}function Mo(e,n){return e.feature?u({},e.feature,{geometry:n}):ta(n)}function ta(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Qa={toGeoJSON:function(e){return Mo(this,{type:"Point",coordinates:Xa(this.getLatLng(),e)})}};Co.include(Qa),ii.include(Qa),Lo.include(Qa),pn.include({toGeoJSON:function(e){var n=!rn(this._latlngs),o=ea(this._latlngs,n?1:0,!1,e);return Mo(this,{type:(n?"Multi":"")+"LineString",coordinates:o})}}),Li.include({toGeoJSON:function(e){var n=!rn(this._latlngs),o=n&&!rn(this._latlngs[0]),a=ea(this._latlngs,o?2:n?1:0,!0,e);return n||(a=[a]),Mo(this,{type:(o?"Multi":"")+"Polygon",coordinates:a})}}),wn.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(o){n.push(o.toGeoJSON(e).geometry.coordinates)}),Mo(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(e){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(e);var o=n==="GeometryCollection",a=[];return this.eachLayer(function(c){if(c.toGeoJSON){var m=c.toGeoJSON(e);if(o)a.push(m.geometry);else{var P=ta(m);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),o?Mo(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Xr(e,n){return new f(e,n)}var jc=Xr,na=Ht.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,o){this._url=e,this._bounds=at(n),F(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(qe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){yt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&bi(this._image),this},bringToBack:function(){return this._map&&yi(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=at(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName==="IMG",n=this._image=e?this._url:tt("img");if(qe(n,"leaflet-image-layer"),this._zoomAnimated&&qe(n,"leaflet-zoom-animated"),this.options.className&&qe(n,this.options.className),n.onselectstart=M,n.onmousemove=M,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(e){var n=this._map.getZoomScale(e.zoom),o=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;_n(this._image,o,n)},_reset:function(){var e=this._image,n=new be(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=n.getSize();xt(e,n.min),e.style.width=o.x+"px",e.style.height=o.y+"px"},_updateOpacity:function(){At(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Wc=function(e,n,o){return new na(e,n,o)},Qr=na.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName==="VIDEO",n=this._image=e?this._url:tt("video");if(qe(n,"leaflet-image-layer"),this._zoomAnimated&&qe(n,"leaflet-zoom-animated"),this.options.className&&qe(n,this.options.className),n.onselectstart=M,n.onmousemove=M,n.onloadeddata=h(this.fire,this,"load"),e){for(var o=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}Te(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(n.style,"objectFit")&&(n.style.objectFit="fill"),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,n.muted=!!this.options.muted,n.playsInline=!!this.options.playsInline;for(var m=0;mc?(n.height=c+"px",qe(e,m)):Tt(e,m),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),o=this._getAnchor();xt(this._container,n.add(o))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt(_i(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+n,a=this._containerWidth,c=new se(this._containerLeft,-o-this._containerBottom);c._add(Dt(this._container));var m=e.layerPointToContainerPoint(c),P=ee(this.options.autoPanPadding),I=ee(this.options.autoPanPaddingTopLeft||P),N=ee(this.options.autoPanPaddingBottomRight||P),J=e.getSize(),ge=0,Re=0;m.x+a+N.x>J.x&&(ge=m.x+a-J.x+N.x),m.x-ge-I.x<0&&(ge=m.x-I.x),m.y+o+N.y>J.y&&(Re=m.y+o-J.y+N.y),m.y-Re-I.y<0&&(Re=m.y-I.y),(ge||Re)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([ge,Re]))}},_getAnchor:function(){return ee(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),qc=function(e,n){return new ia(e,n)};nt.mergeOptions({closePopupOnClick:!0}),nt.include({openPopup:function(e,n,o){return this._initOverlay(ia,e,n,o).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),Ht.include({bindPopup:function(e,n){return this._popup=this._initOverlay(ia,this._popup,e,n),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof Bt||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){En(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof hn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=n,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var oa=Bn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Bn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Bn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Bn.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",n=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=tt("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+b(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,o,a=this._map,c=this._container,m=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),I=this.options.direction,N=c.offsetWidth,J=c.offsetHeight,ge=ee(this.options.offset),Re=this._getAnchor();I==="top"?(n=N/2,o=J):I==="bottom"?(n=N/2,o=0):I==="center"?(n=N/2,o=J/2):I==="right"?(n=0,o=J/2):I==="left"?(n=N,o=J/2):P.xthis.options.maxZoom||oa?this._retainParent(c,m,P,a):!1)},_retainChildren:function(e,n,o,a){for(var c=2*e;c<2*e+2;c++)for(var m=2*n;m<2*n+2;m++){var P=new se(c,m);P.z=o+1;var I=this._tileCoordsToKey(P),N=this._tiles[I];if(N&&N.active){N.retain=!0;continue}else N&&N.loaded&&(N.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,o);return}for(var Re=c.min.y;Re<=c.max.y;Re++)for(var Qe=c.min.x;Qe<=c.max.x;Qe++){var qt=new se(Qe,Re);if(qt.z=this._tileZoom,!!this._isValidTile(qt)){var zt=this._tiles[this._tileCoordsToKey(qt)];zt?zt.current=!0:P.push(qt)}}if(P.sort(function(ln,Eo){return ln.distanceTo(m)-Eo.distanceTo(m)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var kn=document.createDocumentFragment();for(Qe=0;Qeo.max.x)||!n.wrapLat&&(e.yo.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return at(this.options.bounds).overlaps(a)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,o=this.getTileSize(),a=e.scaleBy(o),c=a.add(o),m=n.unproject(a,e.z),P=n.unproject(c,e.z);return[m,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),o=new dt(n[0],n[1]);return this.options.noWrap||(o=this._map.wrapLatLngBounds(o)),o},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),o=new se(+n[0],+n[1]);return o.z=+n[2],o},_removeTile:function(e){var n=this._tiles[e];n&&(yt(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){qe(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=M,e.onmousemove=M,Le.ielt9&&this.options.opacity<1&&At(e,this.options.opacity)},_addTile:function(e,n){var o=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&ze(h(this._tileReady,this,e,null,c)),xt(c,o),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,o){n&&this.fire("tileerror",{error:n,tile:o,coords:e});var a=this._tileCoordsToKey(e);o=this._tiles[a],o&&(o.loaded=+new Date,this._map._fadeAnimated?(At(o.el,0),ne(this._fadeFrame),this._fadeFrame=ze(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),n||(qe(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Le.ielt9||!this._map._fadeAnimated?ze(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var n=new se(this._wrapX?T(e.x,this._wrapX):e.x,this._wrapY?T(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new be(e.min.unscaleBy(n).floor(),e.max.unscaleBy(n).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Xc(e){return new ds(e)}var Ao=ds.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,n){this._url=e,n=F(this,n),n.detectRetina&&Le.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var o=document.createElement("img");return Ke(o,"load",h(this._tileOnLoad,this,n,o)),Ke(o,"error",h(this._tileOnError,this,n,o)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(o.referrerPolicy=this.options.referrerPolicy),o.alt="",o.src=this.getTileUrl(e),o},getTileUrl:function(e){var n={r:Le.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=o),n["-y"]=o}return q(this._url,u(n,this.options))},_tileOnLoad:function(e,n){Le.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,o){var a=this.options.errorTileUrl;a&&n.getAttribute("src")!==a&&(n.src=a),e(o,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,o=this.options.zoomReverse,a=this.options.zoomOffset;return o&&(e=n-e),e+a},_getSubdomain:function(e){var n=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var e,n;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(n=this._tiles[e].el,n.onload=M,n.onerror=M,!n.complete)){n.src=Ue;var o=this._tiles[e].coords;yt(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:o})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",Ue),ds.prototype._removeTile.call(this,e)},_tileReady:function(e,n,o){if(!(!this._map||o&&o.getAttribute("src")===Ue))return ds.prototype._tileReady.call(this,e,n,o)}});function nl(e,n){return new Ao(e,n)}var il=Ao.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var o=u({},this.defaultWmsParams);for(var a in n)a in this.options||(o[a]=n[a]);n=F(this,n);var c=n.detectRetina&&Le.retina?2:1,m=this.getTileSize();o.width=m.x*c,o.height=m.y*c,this.wmsParams=o},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,Ao.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),o=this._crs,a=Ne(o.project(n[0]),o.project(n[1])),c=a.min,m=a.max,P=(this._wmsVersion>=1.3&&this._crs===Qi?[c.y,c.x,m.y,m.x]:[c.x,c.y,m.x,m.y]).join(","),I=Ao.prototype.getTileUrl.call(this,e);return I+he(this.wmsParams,I,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function Qc(e,n){return new il(e,n)}Ao.WMS=il,nl.wms=Qc;var oi=Ht.extend({options:{padding:.1},initialize:function(e){F(this,e),b(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),qe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,n){var o=this._map.getZoomScale(n,this._zoom),a=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),m=a.multiplyBy(-o).add(c).subtract(this._map._getNewPixelOrigin(e,n));Le.any3d?_n(this._container,m,o):xt(this._container,m)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,n=this._map.getSize(),o=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new be(o,o.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ol=oi.extend({options:{tolerance:0},getEvents:function(){var e=oi.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){oi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ke(e,"mousemove",this._onMouseMove,this),Ke(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ke(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ne(this._redrawRequest),delete this._ctx,yt(this._container),mt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var n in this._layers)e=this._layers[n],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){oi.prototype._update.call(this);var e=this._bounds,n=this._container,o=e.getSize(),a=Le.retina?2:1;xt(n,e.min),n.width=a*o.x,n.height=a*o.y,n.style.width=o.x+"px",n.style.height=o.y+"px",Le.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){oi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[b(e)]=e;var n=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var n=e._order,o=n.next,a=n.prev;o?o.prev=a:this._drawLast=a,a?a.next=o:this._drawFirst=o,delete e._order,delete this._layers[b(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var n=e.options.dashArray.split(/[, ]+/),o=[],a,c;for(c=0;c')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),ed={_initContainer:function(){this._container=tt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(oi.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=fs("shape");qe(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=fs("path"),n.appendChild(e._path),this._updateStyle(e),this._layers[b(e)]=e},_addPath:function(e){var n=e._container;this._container.appendChild(n),e.options.interactive&&e.addInteractiveTarget(n)},_removePath:function(e){var n=e._container;yt(n),e.removeInteractiveTarget(n),delete this._layers[b(e)]},_updateStyle:function(e){var n=e._stroke,o=e._fill,a=e.options,c=e._container;c.stroked=!!a.stroke,c.filled=!!a.fill,a.stroke?(n||(n=e._stroke=fs("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=Te(a.dashArray)?a.dashArray.join(" "):a.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=a.lineCap.replace("butt","flat"),n.joinstyle=a.lineJoin):n&&(c.removeChild(n),e._stroke=null),a.fill?(o||(o=e._fill=fs("fill")),c.appendChild(o),o.color=a.fillColor||a.color,o.opacity=a.fillOpacity):o&&(c.removeChild(o),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),o=Math.round(e._radius),a=Math.round(e._radiusY||o);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+o+","+a+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){bi(e._container)},_bringToBack:function(e){yi(e._container)}},sa=Le.vml?fs:K,hs=oi.extend({_initContainer:function(){this._container=sa("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=sa("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){yt(this._container),mt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){oi.prototype._update.call(this);var e=this._bounds,n=e.getSize(),o=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,o.setAttribute("width",n.x),o.setAttribute("height",n.y)),xt(o,e.min),o.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=sa("path");e.options.className&&qe(n,e.options.className),e.options.interactive&&qe(n,"leaflet-interactive"),this._updateStyle(e),this._layers[b(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){yt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[b(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,o=e.options;n&&(o.stroke?(n.setAttribute("stroke",o.color),n.setAttribute("stroke-opacity",o.opacity),n.setAttribute("stroke-width",o.weight),n.setAttribute("stroke-linecap",o.lineCap),n.setAttribute("stroke-linejoin",o.lineJoin),o.dashArray?n.setAttribute("stroke-dasharray",o.dashArray):n.removeAttribute("stroke-dasharray"),o.dashOffset?n.setAttribute("stroke-dashoffset",o.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),o.fill?(n.setAttribute("fill",o.fillColor||o.color),n.setAttribute("fill-opacity",o.fillOpacity),n.setAttribute("fill-rule",o.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,H(e._parts,n))},_updateCircle:function(e){var n=e._point,o=Math.max(Math.round(e._radius),1),a=Math.max(Math.round(e._radiusY),1)||o,c="a"+o+","+a+" 0 1,0 ",m=e._empty()?"M0 0":"M"+(n.x-o)+","+n.y+c+o*2+",0 "+c+-o*2+",0 ";this._setPath(e,m)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){bi(e._path)},_bringToBack:function(e){yi(e._path)}});Le.vml&&hs.include(ed);function al(e){return Le.svg||Le.vml?new hs(e):null}nt.include({getRenderer:function(e){var n=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(e){if(e==="overlayPane"||e===void 0)return!1;var n=this._paneRenderers[e];return n===void 0&&(n=this._createRenderer({pane:e}),this._paneRenderers[e]=n),n},_createRenderer:function(e){return this.options.preferCanvas&&sl(e)||al(e)}});var rl=Li.extend({initialize:function(e,n){Li.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=at(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function td(e,n){return new rl(e,n)}hs.create=sa,hs.pointsToPath=H,f.geometryToLayer=j,f.coordsToLatLng=Xe,f.coordsToLatLngs=Qs,f.latLngToCoords=Xa,f.latLngsToCoords=ea,f.getFeature=Mo,f.asFeature=ta,nt.mergeOptions({boxZoom:!0});var ll=xn.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Ke(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){mt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){yt(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),bn(),Ri(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ke(document,{contextmenu:En,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=tt("div","leaflet-zoom-box",this._container),qe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new be(this._point,this._startPoint),o=n.getSize();xt(this._box,n.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(yt(this._box),Tt(this._container,"leaflet-crosshair")),An(),es(),mt(document,{contextmenu:En,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new dt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});nt.addInitHook("addHandler","boxZoom",ll),nt.mergeOptions({doubleClickZoom:!0});var ul=xn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var n=this._map,o=n.getZoom(),a=n.options.zoomDelta,c=e.originalEvent.shiftKey?o-a:o+a;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(e.containerPoint,c)}});nt.addInitHook("addHandler","doubleClickZoom",ul),nt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var cl=xn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Rn(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}qe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Tt(this._map._container,"leaflet-grab"),Tt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var n=at(this._map.options.maxBounds);this._offsetLimit=Ne(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var n=this._lastTime=+new Date,o=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(o),this._times.push(n),this._prunePositions(n)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,n){return e-(e-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;e.xn.max.x&&(e.x=this._viscousLimit(e.x,n.max.x)),e.y>n.max.y&&(e.y=this._viscousLimit(e.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,n=Math.round(e/2),o=this._initialWorldOffset,a=this._draggable._newPos.x,c=(a-n+o)%e+n-o,m=(a+n+o)%e-n-o,P=Math.abs(c+o)0?m:-m))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});nt.addInitHook("addHandler","scrollWheelZoom",fl);var nd=600;nt.mergeOptions({tapHold:Le.touchNative&&Le.safari&&Le.mobile,tapTolerance:15});var hl=xn.extend({addHooks:function(){Ke(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){mt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var n=e.touches[0];this._startPos=this._newPos=new se(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Ke(document,"touchend",Et),Ke(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),nd),Ke(document,"touchend touchcancel contextmenu",this._cancel,this),Ke(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){mt(document,"touchend",Et),mt(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),mt(document,"touchend touchcancel contextmenu",this._cancel,this),mt(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new se(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var o=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});o._simulated=!0,n.target.dispatchEvent(o)}});nt.addInitHook("addHandler","tapHold",hl),nt.mergeOptions({touchZoom:Le.touch,bounceAtZoomLimits:!0});var pl=xn.extend({addHooks:function(){qe(this._map._container,"leaflet-touch-zoom"),Ke(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Tt(this._map._container,"leaflet-touch-zoom"),mt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)){var o=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(o.add(a)._divideBy(2))),this._startDist=o.distanceTo(a),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),Ke(document,"touchmove",this._onTouchMove,this),Ke(document,"touchend touchcancel",this._onTouchEnd,this),Et(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,o=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]),c=o.distanceTo(a)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var m=o._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&m.x===0&&m.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(m),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),ne(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ze(P,this,!0),Et(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ne(this._animRequest),mt(document,"touchmove",this._onTouchMove,this),mt(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});nt.addInitHook("addHandler","touchZoom",pl),nt.BoxZoom=ll,nt.DoubleClickZoom=ul,nt.Drag=cl,nt.Keyboard=dl,nt.ScrollWheelZoom=fl,nt.TapHold=hl,nt.TouchZoom=pl,s.Bounds=be,s.Browser=Le,s.CRS=A,s.Canvas=ol,s.Circle=ii,s.CircleMarker=Lo,s.Class=ie,s.Control=dn,s.DivIcon=tl,s.DivOverlay=Bn,s.DomEvent=ki,s.DomUtil=Ui,s.Draggable=Rn,s.Evented=ce,s.FeatureGroup=Bt,s.GeoJSON=f,s.GridLayer=ds,s.Handler=xn,s.Icon=ni,s.ImageOverlay=na,s.LatLng=Ze,s.LatLngBounds=dt,s.Layer=Ht,s.LayerGroup=wn,s.LineUtil=Po,s.Map=nt,s.Marker=Co,s.Mixin=Ka,s.Path=hn,s.Point=se,s.PolyUtil=Ki,s.Polygon=Li,s.Polyline=pn,s.Popup=ia,s.PosAnimation=ss,s.Projection=Xs,s.Rectangle=rl,s.Renderer=oi,s.SVG=hs,s.SVGOverlay=el,s.TileLayer=Ao,s.Tooltip=oa,s.Transformation=wt,s.Util=je,s.VideoOverlay=Qr,s.bind=h,s.bounds=Ne,s.canvas=sl,s.circle=cs,s.circleMarker=_t,s.control=Zi,s.divIcon=Jc,s.extend=u,s.featureGroup=ls,s.geoJSON=Xr,s.geoJson=jc,s.gridLayer=Xc,s.icon=qa,s.imageOverlay=Wc,s.latLng=Y,s.latLngBounds=at,s.layerGroup=zn,s.map=as,s.marker=Ya,s.point=ee,s.polygon=x,s.polyline=Ja,s.popup=qc,s.rectangle=td,s.setOptions=F,s.stamp=b,s.svg=al,s.svgOverlay=Gc,s.tileLayer=nl,s.tooltip=Yc,s.transformation=y,s.version=l,s.videoOverlay=Kc;var id=window.L;s.noConflict=function(){return window.L=id,this},window.L=s}))})(xs,xs.exports)),xs.exports}var sm=om();const Ai=nm(sm),mu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,s=W(null);let l,u,d,h;const v=new Map;function b(Z,F){const he=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",pe=F?"#8a94a6":he,q=typeof Z=="number"?Z:0;return Ai.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(Z){const he=[`${Z.callsign||Z.icao24||"aircraft"}`];return Z.country&&he.push(Z.country),typeof Z.altitude=="number"&&he.push(`${Math.round(Z.altitude)} m`),typeof Z.velocity=="number"&&he.push(`${Math.round(Z.velocity*3.6)} km/h`),Z.onGround&&he.push("on ground"),he.join(" · ")}function T(){if(!l)return;h||(h=Ai.layerGroup().addTo(l));const Z=new Set;for(const F of i.aircraft){if(typeof F.lat!="number"||typeof F.lng!="number")continue;Z.add(F.icao24);const he=[F.lat,F.lng];let pe=v.get(F.icao24);pe?(pe.setLatLng(he),pe.setIcon(b(F.heading,F.onGround)),pe.setTooltipContent(C(F))):(pe=Ai.marker(he,{icon:b(F.heading,F.onGround)}).bindTooltip(C(F)),pe.addTo(h),v.set(F.icao24,pe))}for(const[F,he]of v)Z.has(F)||(h.removeLayer(he),v.delete(F))}function M(){if(!l)return;const Z=i.position;if(Z&&(Z.lat||Z.lng)){const F=[Z.lat,Z.lng];u?u.setLatLng(F):(u=Ai.marker(F).addTo(l),l.setView(F,17))}if(d&&d.remove(),i.trail.length){const F=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Ai.polyline(i.trail,{color:F,weight:3}).addTo(l)}}hi(()=>{l=Ai.map(s.value,{zoomControl:!0}).setView([20,0],2),Ai.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),M(),T(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&B()});let R=!1;function B(){if(R||!l||!i.aircraft.length)return;const Z=i.aircraft.filter(F=>typeof F.lat=="number"&&typeof F.lng=="number").map(F=>[F.lat,F.lng]);Z.length&&(l.fitBounds(Ai.latLngBounds(Z).pad(.2)),R=!0)}return Ho(()=>{l&&l.remove(),l=null}),It(()=>i.position,M,{deep:!0}),It(()=>i.trail,M,{deep:!0}),It(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&B()},{deep:!0}),(Z,F)=>(p(),g("div",{ref_key:"el",ref:s,class:"h-[320px] w-full rounded-lg"},null,512))}},am=["width","height","stroke-width"],rm=["d"],X={__name:"Icon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:18},stroke:{type:[Number,String],default:2}},setup(t){const l=({grid:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",radio:"M4.9 19.1a10 10 0 0 1 0-14.2M7.8 16.2a6 6 0 0 1 0-8.4M16.2 7.8a6 6 0 0 1 0 8.4M19.1 4.9a10 10 0 0 1 0 14.2M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z",route:"M6 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 13V9a4 4 0 0 1 4-4h4",calendar:"M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",book:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z",fileText:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M16 13H8M16 17H8M10 9H8",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",search:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.3-4.3",plus:"M12 5v14M5 12h14",battery:"M3 8h14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1zM22 11v2",signal:"M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 20V4",clock:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",chevronRight:"M9 6l6 6-6 6",play:"M6 3l14 9-14 9V3z",logout:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",wind:"M12.8 19.6A2 2 0 1 0 14 16H2M17.5 8a2.5 2.5 0 1 1 2 4H2M9.6 4.6A2 2 0 1 1 11 8H2",drone:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM6 6 4 4M18 6l2-2M6 18l-2 2M18 18l2 2",user:"M20 21a8 8 0 1 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",users:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",sliders:"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6",alertTriangle:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01",download:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",upload:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",trash:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6",check:"M20 6 9 17l-5-5",mail:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM22 6l-10 7L2 6",lock:"M5 11h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2zM7 11V7a5 5 0 0 1 10 0v4",monitor:"M3 4h18a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8 21h8M12 17v4",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z",smartphone:"M7 2h10a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM11 18h2",image:"M4 4h16a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 21",eye:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",type:"M4 7V4h16v3M9 20h6M12 4v16",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4",moon:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z",x:"M18 6 6 18M6 6l12 12",server:"M20 4H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM20 13H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2zM6 7.5h.01M6 16.5h.01",cloud:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9z"}[t.name]||"").split(" M").map((u,d)=>d?"M"+u:u);return(u,d)=>(p(),g("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke,"stroke-linecap":"round","stroke-linejoin":"round",style:{flex:"none"},"aria-hidden":"true"},[(p(!0),g(ue,null,Be(Oe(l),(h,v)=>(p(),g("path",{key:v,d:h},null,8,rm))),128))],8,am))}},lm=["aria-checked","disabled"],un={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),g("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Ee(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",t.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:u[0]||(u[0]=d=>s("update:modelValue",!t.modelValue))},[r("span",{class:Ee(["inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition",t.modelValue?"translate-x-6":"translate-x-1"])},null,2)],10,lm))}},um={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},cm=["onClick"],Tn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),g("div",um,[(p(!0),g(ue,null,Be(t.options,d=>(p(),g("button",{key:d.value,type:"button",class:Ee(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>s("update:modelValue",d.value)},[d.icon?(p(),lt(X,{key:0,name:d.icon,size:15},null,8,["name"])):D("",!0),$(" "+k(d.label),1)],10,cm))),128))]))}},dm={class:"text-sm font-semibold text-ink"},fm={key:0,class:"mt-0.5 text-xs text-ink-muted"},Ae={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,s=Ts("settingsSearch",{value:""}),l=we(()=>{const u=(s.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(p(),g("div",{key:0,class:Ee(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Ee(t.block?"mb-3":"min-w-0")},[r("div",dm,k(t.title),1),t.desc?(p(),g("div",fm,k(t.desc),1)):D("",!0)],2),r("div",{class:Ee(t.block?"":"shrink-0")},[kf(u.$slots,"default")],2)],2)):D("",!0)}},Ra=[{code:"AL",name:"Albania",continent:"EU",bbox:"39.6,19.3,42.7,21.1"},{code:"AD",name:"Andorra",continent:"EU",bbox:"42.4,1.4,42.7,1.8"},{code:"AT",name:"Austria",continent:"EU",bbox:"46.4,9.5,49.0,17.2"},{code:"BY",name:"Belarus",continent:"EU",bbox:"51.2,23.2,56.2,32.8"},{code:"BE",name:"Belgium",continent:"EU",bbox:"49.5,2.5,51.5,6.4"},{code:"BA",name:"Bosnia and Herzegovina",continent:"EU",bbox:"42.6,15.7,45.3,19.6"},{code:"BG",name:"Bulgaria",continent:"EU",bbox:"41.2,22.4,44.2,28.6"},{code:"HR",name:"Croatia",continent:"EU",bbox:"42.4,13.5,46.6,19.4"},{code:"CY",name:"Cyprus",continent:"EU",bbox:"34.6,32.3,35.7,34.6"},{code:"CZ",name:"Czechia",continent:"EU",bbox:"48.6,12.1,51.1,18.9"},{code:"DK",name:"Denmark",continent:"EU",bbox:"54.6,8.1,57.8,12.7"},{code:"EE",name:"Estonia",continent:"EU",bbox:"57.5,21.8,59.7,28.2"},{code:"FI",name:"Finland",continent:"EU",bbox:"59.8,20.6,70.1,31.6"},{code:"FR",name:"France",continent:"EU",bbox:"41.3,-5.2,51.1,9.6"},{code:"DE",name:"Germany",continent:"EU",bbox:"47.2,5.8,55.1,15.1"},{code:"GR",name:"Greece",continent:"EU",bbox:"34.8,19.4,41.8,28.3"},{code:"HU",name:"Hungary",continent:"EU",bbox:"45.7,16.1,48.6,22.9"},{code:"IS",name:"Iceland",continent:"EU",bbox:"63.3,-24.6,66.6,-13.5"},{code:"IE",name:"Ireland",continent:"EU",bbox:"51.4,-10.6,55.4,-6.0"},{code:"IT",name:"Italy",continent:"EU",bbox:"36.6,6.6,47.1,18.6"},{code:"XK",name:"Kosovo",continent:"EU",bbox:"41.8,20.0,43.3,21.8"},{code:"LV",name:"Latvia",continent:"EU",bbox:"55.7,20.9,58.1,28.2"},{code:"LI",name:"Liechtenstein",continent:"EU",bbox:"47.0,9.4,47.3,9.6"},{code:"LT",name:"Lithuania",continent:"EU",bbox:"53.9,20.9,56.5,26.9"},{code:"LU",name:"Luxembourg",continent:"EU",bbox:"49.4,5.7,50.2,6.5"},{code:"MT",name:"Malta",continent:"EU",bbox:"35.8,14.1,36.1,14.6"},{code:"MD",name:"Moldova",continent:"EU",bbox:"45.4,26.6,48.5,30.2"},{code:"MC",name:"Monaco",continent:"EU",bbox:"43.72,7.40,43.75,7.44"},{code:"ME",name:"Montenegro",continent:"EU",bbox:"41.8,18.4,43.6,20.4"},{code:"NL",name:"Netherlands",continent:"EU",bbox:"50.7,3.3,53.7,7.2"},{code:"MK",name:"North Macedonia",continent:"EU",bbox:"40.8,20.4,42.4,23.0"},{code:"NO",name:"Norway",continent:"EU",bbox:"57.9,4.6,71.2,31.1"},{code:"PL",name:"Poland",continent:"EU",bbox:"49.0,14.1,54.9,24.2"},{code:"PT",name:"Portugal",continent:"EU",bbox:"36.9,-9.5,42.2,-6.2"},{code:"RO",name:"Romania",continent:"EU",bbox:"43.6,20.2,48.3,29.7"},{code:"SM",name:"San Marino",continent:"EU",bbox:"43.89,12.40,43.99,12.52"},{code:"RS",name:"Serbia",continent:"EU",bbox:"42.2,18.8,46.2,23.0"},{code:"SK",name:"Slovakia",continent:"EU",bbox:"47.7,16.8,49.6,22.6"},{code:"SI",name:"Slovenia",continent:"EU",bbox:"45.4,13.4,46.9,16.6"},{code:"ES",name:"Spain",continent:"EU",bbox:"35.9,-9.4,43.8,3.4"},{code:"SE",name:"Sweden",continent:"EU",bbox:"55.3,11.1,69.1,24.2"},{code:"CH",name:"Switzerland",continent:"EU",bbox:"45.8,5.9,47.8,10.5"},{code:"UA",name:"Ukraine",continent:"EU",bbox:"44.4,22.1,52.4,40.2"},{code:"GB",name:"United Kingdom",continent:"EU",bbox:"49.9,-8.7,60.9,1.8"},{code:"VA",name:"Vatican City",continent:"EU",bbox:"41.900,12.445,41.908,12.458"},{code:"RU",name:"Russia",continent:"EU",bbox:"41.2,19.6,81.9,180"},{code:"TR",name:"Turkey",continent:"EU",bbox:"35.8,25.7,42.3,44.8"},{code:"AF",name:"Afghanistan",continent:"AS",bbox:"29.4,60.5,38.5,74.9"},{code:"AM",name:"Armenia",continent:"AS",bbox:"38.8,43.4,41.3,46.6"},{code:"AZ",name:"Azerbaijan",continent:"AS",bbox:"38.4,44.8,41.9,50.4"},{code:"BH",name:"Bahrain",continent:"AS",bbox:"25.8,50.4,26.3,50.7"},{code:"BD",name:"Bangladesh",continent:"AS",bbox:"20.7,88.0,26.6,92.7"},{code:"BT",name:"Bhutan",continent:"AS",bbox:"26.7,88.7,28.3,92.1"},{code:"BN",name:"Brunei",continent:"AS",bbox:"4.0,114.0,5.1,115.4"},{code:"KH",name:"Cambodia",continent:"AS",bbox:"10.4,102.3,14.7,107.6"},{code:"CN",name:"China",continent:"AS",bbox:"18.2,73.5,53.6,134.8"},{code:"GE",name:"Georgia",continent:"AS",bbox:"41.0,40.0,43.6,46.7"},{code:"IN",name:"India",continent:"AS",bbox:"6.7,68.1,35.5,97.4"},{code:"ID",name:"Indonesia",continent:"AS",bbox:"-11.0,95.0,6.1,141.0"},{code:"IR",name:"Iran",continent:"AS",bbox:"25.0,44.0,39.8,63.3"},{code:"IQ",name:"Iraq",continent:"AS",bbox:"29.1,38.8,37.4,48.6"},{code:"IL",name:"Israel",continent:"AS",bbox:"29.5,34.2,33.3,35.9"},{code:"JP",name:"Japan",continent:"AS",bbox:"24.0,122.9,45.5,145.8"},{code:"JO",name:"Jordan",continent:"AS",bbox:"29.2,34.9,33.4,39.3"},{code:"KZ",name:"Kazakhstan",continent:"AS",bbox:"40.6,46.5,55.4,87.3"},{code:"KW",name:"Kuwait",continent:"AS",bbox:"28.5,46.5,30.1,48.4"},{code:"KG",name:"Kyrgyzstan",continent:"AS",bbox:"39.2,69.3,43.3,80.3"},{code:"LA",name:"Laos",continent:"AS",bbox:"13.9,100.1,22.5,107.7"},{code:"LB",name:"Lebanon",continent:"AS",bbox:"33.0,35.1,34.7,36.6"},{code:"MY",name:"Malaysia",continent:"AS",bbox:"0.9,99.6,7.4,119.3"},{code:"MV",name:"Maldives",continent:"AS",bbox:"-0.7,72.7,7.1,73.7"},{code:"MN",name:"Mongolia",continent:"AS",bbox:"41.6,87.7,52.1,119.9"},{code:"MM",name:"Myanmar",continent:"AS",bbox:"9.8,92.2,28.5,101.2"},{code:"NP",name:"Nepal",continent:"AS",bbox:"26.3,80.1,30.4,88.2"},{code:"KP",name:"North Korea",continent:"AS",bbox:"37.7,124.2,43.0,130.7"},{code:"OM",name:"Oman",continent:"AS",bbox:"16.6,52.0,26.4,59.8"},{code:"PK",name:"Pakistan",continent:"AS",bbox:"23.7,60.9,37.1,77.8"},{code:"PH",name:"Philippines",continent:"AS",bbox:"4.6,116.9,21.1,126.6"},{code:"QA",name:"Qatar",continent:"AS",bbox:"24.5,50.7,26.2,51.6"},{code:"SA",name:"Saudi Arabia",continent:"AS",bbox:"16.4,34.6,32.2,55.7"},{code:"SG",name:"Singapore",continent:"AS",bbox:"1.2,103.6,1.5,104.1"},{code:"KR",name:"South Korea",continent:"AS",bbox:"33.1,125.9,38.6,129.6"},{code:"LK",name:"Sri Lanka",continent:"AS",bbox:"5.9,79.7,9.8,81.9"},{code:"SY",name:"Syria",continent:"AS",bbox:"32.3,35.7,37.3,42.4"},{code:"TW",name:"Taiwan",continent:"AS",bbox:"21.9,120.0,25.3,122.0"},{code:"TJ",name:"Tajikistan",continent:"AS",bbox:"36.7,67.4,41.0,75.2"},{code:"TH",name:"Thailand",continent:"AS",bbox:"5.6,97.3,20.5,105.6"},{code:"TL",name:"Timor-Leste",continent:"AS",bbox:"-9.5,124.0,-8.1,127.3"},{code:"TM",name:"Turkmenistan",continent:"AS",bbox:"35.1,52.4,42.8,66.7"},{code:"AE",name:"United Arab Emirates",continent:"AS",bbox:"22.6,51.5,26.1,56.4"},{code:"UZ",name:"Uzbekistan",continent:"AS",bbox:"37.2,55.9,45.6,73.1"},{code:"VN",name:"Vietnam",continent:"AS",bbox:"8.2,102.1,23.4,109.5"},{code:"YE",name:"Yemen",continent:"AS",bbox:"12.1,42.5,19.0,54.5"},{code:"DZ",name:"Algeria",continent:"AF",bbox:"18.9,-8.7,37.1,12.0"},{code:"AO",name:"Angola",continent:"AF",bbox:"-18.0,11.6,-4.4,24.1"},{code:"BJ",name:"Benin",continent:"AF",bbox:"6.2,0.8,12.4,3.9"},{code:"BW",name:"Botswana",continent:"AF",bbox:"-26.9,20.0,-17.8,29.4"},{code:"BF",name:"Burkina Faso",continent:"AF",bbox:"9.4,-5.5,15.1,2.4"},{code:"BI",name:"Burundi",continent:"AF",bbox:"-4.5,29.0,-2.3,30.8"},{code:"CV",name:"Cabo Verde",continent:"AF",bbox:"14.8,-25.4,17.2,-22.7"},{code:"CM",name:"Cameroon",continent:"AF",bbox:"1.7,8.5,13.1,16.2"},{code:"CF",name:"Central African Republic",continent:"AF",bbox:"2.2,14.4,11.0,27.5"},{code:"TD",name:"Chad",continent:"AF",bbox:"7.4,13.5,23.4,24.0"},{code:"KM",name:"Comoros",continent:"AF",bbox:"-12.4,43.2,-11.4,44.5"},{code:"CG",name:"Congo",continent:"AF",bbox:"-5.0,11.1,3.7,18.6"},{code:"CD",name:"DR Congo",continent:"AF",bbox:"-13.5,12.2,5.4,31.3"},{code:"DJ",name:"Djibouti",continent:"AF",bbox:"10.9,41.7,12.7,43.4"},{code:"EG",name:"Egypt",continent:"AF",bbox:"22.0,25.0,31.7,36.9"},{code:"GQ",name:"Equatorial Guinea",continent:"AF",bbox:"0.9,9.3,3.8,11.4"},{code:"ER",name:"Eritrea",continent:"AF",bbox:"12.4,36.4,18.0,43.1"},{code:"SZ",name:"Eswatini",continent:"AF",bbox:"-27.3,30.8,-25.7,32.1"},{code:"ET",name:"Ethiopia",continent:"AF",bbox:"3.4,33.0,14.9,48.0"},{code:"GA",name:"Gabon",continent:"AF",bbox:"-4.0,8.7,2.3,14.5"},{code:"GM",name:"Gambia",continent:"AF",bbox:"13.1,-16.8,13.8,-13.8"},{code:"GH",name:"Ghana",continent:"AF",bbox:"4.7,-3.3,11.2,1.2"},{code:"GN",name:"Guinea",continent:"AF",bbox:"7.2,-15.1,12.7,-7.6"},{code:"GW",name:"Guinea-Bissau",continent:"AF",bbox:"10.9,-16.7,12.7,-13.6"},{code:"CI",name:"Ivory Coast",continent:"AF",bbox:"4.4,-8.6,10.7,-2.5"},{code:"KE",name:"Kenya",continent:"AF",bbox:"-4.7,33.9,5.5,41.9"},{code:"LS",name:"Lesotho",continent:"AF",bbox:"-30.7,27.0,-28.6,29.5"},{code:"LR",name:"Liberia",continent:"AF",bbox:"4.3,-11.5,8.6,-7.4"},{code:"LY",name:"Libya",continent:"AF",bbox:"19.5,9.3,33.2,25.2"},{code:"MG",name:"Madagascar",continent:"AF",bbox:"-25.6,43.2,-11.9,50.5"},{code:"MW",name:"Malawi",continent:"AF",bbox:"-17.1,32.7,-9.4,35.9"},{code:"ML",name:"Mali",continent:"AF",bbox:"10.1,-12.3,25.0,4.3"},{code:"MR",name:"Mauritania",continent:"AF",bbox:"14.7,-17.1,27.3,-4.8"},{code:"MU",name:"Mauritius",continent:"AF",bbox:"-20.5,57.3,-19.9,57.8"},{code:"MA",name:"Morocco",continent:"AF",bbox:"27.7,-13.2,35.9,-1.0"},{code:"MZ",name:"Mozambique",continent:"AF",bbox:"-26.9,30.2,-10.5,40.8"},{code:"NA",name:"Namibia",continent:"AF",bbox:"-28.9,11.7,-16.9,25.3"},{code:"NE",name:"Niger",continent:"AF",bbox:"11.7,0.2,23.5,16.0"},{code:"NG",name:"Nigeria",continent:"AF",bbox:"4.3,2.7,13.9,14.7"},{code:"RW",name:"Rwanda",continent:"AF",bbox:"-2.8,28.9,-1.1,30.9"},{code:"SN",name:"Senegal",continent:"AF",bbox:"12.3,-17.5,16.7,-11.4"},{code:"SL",name:"Sierra Leone",continent:"AF",bbox:"6.9,-13.3,10.0,-10.3"},{code:"SO",name:"Somalia",continent:"AF",bbox:"-1.7,40.9,12.0,51.4"},{code:"ZA",name:"South Africa",continent:"AF",bbox:"-34.8,16.5,-22.1,32.9"},{code:"SS",name:"South Sudan",continent:"AF",bbox:"3.5,24.1,12.2,35.9"},{code:"SD",name:"Sudan",continent:"AF",bbox:"8.7,21.8,22.2,38.6"},{code:"TZ",name:"Tanzania",continent:"AF",bbox:"-11.7,29.3,-1.0,40.4"},{code:"TG",name:"Togo",continent:"AF",bbox:"6.1,-0.1,11.1,1.8"},{code:"TN",name:"Tunisia",continent:"AF",bbox:"30.2,7.5,37.5,11.6"},{code:"UG",name:"Uganda",continent:"AF",bbox:"-1.5,29.6,4.2,35.0"},{code:"ZM",name:"Zambia",continent:"AF",bbox:"-18.1,21.9,-8.2,33.7"},{code:"ZW",name:"Zimbabwe",continent:"AF",bbox:"-22.4,25.2,-15.6,33.1"},{code:"CA",name:"Canada",continent:"NA",bbox:"41.7,-141.0,83.1,-52.6"},{code:"US",name:"United States",continent:"NA",bbox:"24.4,-125.0,49.4,-66.9"},{code:"MX",name:"Mexico",continent:"NA",bbox:"14.5,-118.4,32.7,-86.7"},{code:"GT",name:"Guatemala",continent:"NA",bbox:"13.7,-92.2,17.8,-88.2"},{code:"BZ",name:"Belize",continent:"NA",bbox:"15.9,-89.2,18.5,-87.8"},{code:"SV",name:"El Salvador",continent:"NA",bbox:"13.1,-90.1,14.4,-87.7"},{code:"HN",name:"Honduras",continent:"NA",bbox:"12.9,-89.4,16.5,-83.1"},{code:"NI",name:"Nicaragua",continent:"NA",bbox:"10.7,-87.7,15.0,-83.1"},{code:"CR",name:"Costa Rica",continent:"NA",bbox:"8.0,-85.9,11.2,-82.5"},{code:"PA",name:"Panama",continent:"NA",bbox:"7.2,-83.1,9.6,-77.2"},{code:"CU",name:"Cuba",continent:"NA",bbox:"19.8,-85.0,23.3,-74.1"},{code:"DO",name:"Dominican Republic",continent:"NA",bbox:"17.5,-72.0,19.9,-68.3"},{code:"HT",name:"Haiti",continent:"NA",bbox:"18.0,-74.5,20.1,-71.6"},{code:"JM",name:"Jamaica",continent:"NA",bbox:"17.7,-78.4,18.5,-76.2"},{code:"BS",name:"Bahamas",continent:"NA",bbox:"20.9,-79.0,27.3,-72.7"},{code:"TT",name:"Trinidad and Tobago",continent:"NA",bbox:"10.0,-61.9,11.4,-60.5"},{code:"AR",name:"Argentina",continent:"SA",bbox:"-55.1,-73.6,-21.8,-53.6"},{code:"BO",name:"Bolivia",continent:"SA",bbox:"-22.9,-69.6,-9.7,-57.5"},{code:"BR",name:"Brazil",continent:"SA",bbox:"-33.8,-74.0,5.3,-34.8"},{code:"CL",name:"Chile",continent:"SA",bbox:"-55.9,-75.6,-17.5,-66.4"},{code:"CO",name:"Colombia",continent:"SA",bbox:"-4.2,-79.0,12.5,-66.9"},{code:"EC",name:"Ecuador",continent:"SA",bbox:"-5.0,-81.1,1.4,-75.2"},{code:"GY",name:"Guyana",continent:"SA",bbox:"1.2,-61.4,8.6,-56.5"},{code:"PY",name:"Paraguay",continent:"SA",bbox:"-27.6,-62.6,-19.3,-54.3"},{code:"PE",name:"Peru",continent:"SA",bbox:"-18.4,-81.3,0.0,-68.7"},{code:"SR",name:"Suriname",continent:"SA",bbox:"1.8,-58.1,6.0,-54.0"},{code:"UY",name:"Uruguay",continent:"SA",bbox:"-35.0,-58.4,-30.1,-53.1"},{code:"VE",name:"Venezuela",continent:"SA",bbox:"0.6,-73.4,12.2,-59.8"},{code:"AU",name:"Australia",continent:"OC",bbox:"-43.6,113.3,-10.7,153.6"},{code:"NZ",name:"New Zealand",continent:"OC",bbox:"-47.3,166.4,-34.4,178.6"},{code:"PG",name:"Papua New Guinea",continent:"OC",bbox:"-11.7,140.8,-1.3,155.9"},{code:"FJ",name:"Fiji",continent:"OC",bbox:"-19.2,177.0,-16.0,180.0"}],hm=new Map(Ra.map(t=>[t.code,t]));function pm(t){const i=String(t||"").split(",").map(s=>Number(s.trim()));return i.length!==4||i.some(s=>Number.isNaN(s))?null:i}function mm(t){const i=hm.get(t);return i?i.bbox:""}function pr(t,i){if(typeof t!="number"||typeof i!="number"||Number.isNaN(t)||Number.isNaN(i))return null;let s=null,l=1/0;for(const u of Ra){const d=pm(u.bbox);if(!d)continue;const[h,v,b,C]=d;if(tb||iC)continue;const T=Math.abs(b-h)*Math.abs(C-v);Tt.continent==="EU").slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>({value:t.bbox,label:t.name}))}function vm(){return Ra.slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>[t.code,t.name])}const _m=(t,i)=>{const s=t.__vccOpts||t;for(const[l,u]of i)s[l]=u;return s},bm={class:"mx-auto max-w-[1280px] p-7"},ym={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},xm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},wm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},km={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},Sm=["onClick"],Tm={class:"whitespace-nowrap"},Pm={class:"min-w-0"},Cm={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},Lm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},Mm={key:1,class:"panel mb-5 p-5"},Am={class:"flex items-center gap-1"},Em={class:"flex items-center gap-2"},Om={class:"font-mono text-sm text-ink"},zm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Im={key:0,class:"mt-2 text-xs text-ink-muted"},$m={class:"grid max-w-[420px] gap-2"},Nm={class:"flex items-center gap-3"},Dm={key:2,class:"panel mb-5 p-5"},Fm=["value"],Rm=["value"],Bm=["value"],Um={class:"font-mono text-sm text-ink"},Vm={key:3},Zm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Hm=["onClick"],jm={key:1,class:"panel mb-5 p-5"},Wm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Km={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Gm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},qm={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Ym={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Jm={key:0},Xm={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Qm={class:"font-semibold text-ink-secondary"},eg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},tg={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"credits usage quota remaining daily allowance rate limit"},ng={class:"flex items-center justify-between gap-3"},ig={class:"flex items-center gap-2 text-sm font-semibold text-ink"},og={key:0,class:"text-[11px] text-ink-muted"},sg={class:"mt-2 flex items-baseline gap-1.5"},ag={class:"font-mono text-2xl font-semibold text-ink"},rg={class:"text-sm text-ink-muted"},lg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},ug={class:"mt-2 text-xs text-ink-muted"},cg={class:"mt-2 text-sm text-ink"},dg={class:"font-semibold"},fg={class:"mt-1 text-xs text-ink-muted"},hg={key:1,class:"mt-2 text-xs text-ink-muted"},pg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},mg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},gg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:1,class:"flex flex-col items-end gap-2"},bg={key:0,value:"__auto__"},yg=["label"],xg=["value"],wg={key:0,class:"w-64 text-right text-[11px] leading-snug text-ink-muted"},kg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Sg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Tg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Pg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Cg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},Lg={class:"mt-4 flex flex-wrap items-center gap-3"},Mg=["disabled"],Ag=["disabled"],Eg={key:2,class:"text-xs text-danger-fg"},Og={class:"panel mb-5 p-5"},zg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Ig={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},$g={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ng={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Dg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Fg={key:0},Rg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Bg={class:"font-semibold text-ink-secondary"},Ug={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Vg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Zg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Hg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},jg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Wg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Kg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Gg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},qg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Yg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Jg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Xg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Qg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},ev={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},tv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},nv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},iv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},ov={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},sv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},av={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},rv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},lv={class:"mt-4 flex flex-wrap items-center gap-3"},uv=["disabled"],cv=["disabled"],dv={key:2,class:"text-xs text-danger-fg"},fv={key:3,class:"text-[11px] text-ink-muted"},hv={class:"panel mb-5 p-5"},pv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},mv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},gv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},vv={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},_v={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},bv={key:0},yv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},xv={class:"font-semibold text-ink-secondary"},wv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},kv={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},Sv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Tv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Pv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Cv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Lv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Mv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Av={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ev={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ov={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},zv={class:"mt-4 flex flex-wrap items-center gap-3"},Iv=["disabled"],$v=["disabled"],Nv={key:2,class:"text-xs text-danger-fg"},Dv={key:3,class:"text-[11px] text-ink-muted"},Fv={key:3,class:"panel mb-5 p-5"},Rv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Bv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Uv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Vv={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Zv={key:2,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Hv={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},jv={key:0},Wv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Kv={class:"font-semibold text-ink-secondary"},Gv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},qv={class:"flex w-full flex-col gap-2"},Yv={class:"break-all font-mono text-sm text-ink"},Jv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Xv={key:1,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Qv={key:0,class:"text-xs text-ink-muted"},e_={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},t_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},n_={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},i_={class:"mt-4 flex flex-wrap items-center gap-3"},o_=["disabled"],s_=["disabled"],a_={key:2,class:"text-xs text-danger-fg"},r_={key:3,class:"text-[11px] text-ink-muted"},l_={key:4,class:"panel mb-5 p-5"},u_={class:"flex items-center gap-4"},c_=["src"],d_={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},f_={class:"flex gap-2"},h_={class:"btn-ghost cursor-pointer"},p_={class:"mt-1 text-right text-[11px] text-ink-muted"},m_={key:5,class:"panel mb-5 p-5"},g_={class:"flex items-center gap-3"},v_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},__={class:"flex flex-wrap items-center gap-4"},b_={class:"min-w-0"},y_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},x_={class:"mt-3 flex items-center gap-2"},w_={key:0,class:"mt-2 text-xs text-danger-fg"},k_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},S_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},T_={class:"rounded-lg border border-line bg-surface-2 p-3"},P_={class:"flex items-center gap-3"},C_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},L_={class:"min-w-0 flex-1"},M_={class:"text-sm font-semibold text-ink"},A_={class:"font-mono text-[11px] text-ink-muted"},E_={key:6,class:"mb-5"},O_={key:0,class:"panel mb-5 p-5"},z_={class:"grid max-w-[520px] gap-2"},I_={class:"flex flex-wrap gap-2"},$_=["disabled","title"],N_=["value"],D_=["value"],F_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},R_={class:"flex items-center gap-3"},B_=["disabled"],U_={key:0,class:"text-xs text-danger-fg"},V_={key:1,class:"text-xs text-ink-muted"},Z_={key:1,class:"panel mb-5 p-5"},H_={class:"grid max-w-[520px] gap-2"},j_={class:"flex flex-wrap gap-2"},W_=["value"],K_=["value"],G_={key:1,class:"text-xs text-ink-muted"},q_={class:"font-semibold text-ink-secondary"},Y_={class:"flex items-center gap-3"},J_=["disabled"],X_={key:0,class:"text-xs text-danger-fg"},Q_={class:"panel overflow-hidden p-0"},e1={class:"flex items-center justify-between px-5 py-4"},t1=["disabled"],n1={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},i1={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},o1={key:2,class:"overflow-x-auto"},s1={class:"w-full border-collapse text-sm"},a1={class:"text-left"},r1={class:"px-5 py-3"},l1={class:"text-ink"},u1={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},c1={class:"px-5 py-3"},d1={class:"px-5 py-3"},f1={class:"px-5 py-3"},h1={class:"px-5 py-3 text-right"},p1=["onClick"],m1={key:1,class:"inline-flex items-center gap-1.5"},g1=["onClick"],v1=["onClick"],_1={key:7,class:"mb-5"},b1={key:0,class:"panel mb-5 p-5"},y1={class:"grid max-w-[520px] gap-2"},x1={class:"flex items-center gap-3"},w1={key:0,class:"text-xs text-danger-fg"},k1={key:1,class:"panel mb-5 p-5"},S1={class:"grid max-w-[520px] gap-2"},T1={class:"flex items-center gap-3"},P1=["disabled"],C1={key:0,class:"text-xs text-danger-fg"},L1={class:"panel overflow-hidden p-0"},M1={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},A1={key:1,class:"overflow-x-auto"},E1={class:"w-full border-collapse text-sm"},O1={class:"text-left"},z1={class:"px-5 py-3"},I1={class:"inline-flex items-center gap-2 text-ink"},$1={class:"px-5 py-3 text-ink-secondary"},N1={class:"px-5 py-3 text-right"},D1=["onClick"],F1={key:1,class:"inline-flex items-center gap-1.5"},R1=["onClick"],B1=["disabled","title","onClick"],U1={key:8,class:"mb-5"},V1={class:"panel mb-5 p-5"},Z1={class:"btn-ghost cursor-pointer"},H1={key:0,class:"mt-2 text-xs text-ink-muted"},j1={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},W1={class:"flex items-center gap-2 text-danger-fg"},K1={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},G1={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},q1={class:"mt-3"},Y1={class:"eyebrow mb-1 block"},J1={class:"text-ink"},X1=["placeholder"],Q1={class:"mt-4 flex flex-wrap items-center gap-3"},eb=["disabled"],tb=["disabled"],nb={key:2,class:"text-xs text-ink-muted"},ib={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},ob={key:0,class:"fixed bottom-5 right-5 z-20 flex items-center gap-2 rounded-lg border border-line bg-surface-1 px-4 py-2.5 text-sm text-ink shadow-md"},gu="pv.opensky.health",vu="pv.filetransfer.health",_u="pv.webdav.health",bu="pv.localstorage.health",sb={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const s=t,l=i,u=we(()=>s.role==="superadmin"),d=we(()=>s.role==="admin"||s.role==="superadmin");function h(x){return x==="superadmin"?"Superadmin":x==="admin"?"Admin":"User"}function v(x){return x==="superadmin"||x==="admin"?"shield":"user"}function b(x){return x==="superadmin"||x==="admin"?C.accent:C.neutral}const C={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},T=we(()=>{const x=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&x.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&x.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),x.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),x}),M=W("account"),R=W("");Yu("settingsSearch",R);const B=we(()=>R.value.trim().length>0),Z=we(()=>R.value.trim().toLowerCase());function F(x){return Z.value?(x.label+" "+x.kw).toLowerCase().includes(Z.value)||pe(x.id):!0}const he={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function pe(x){return Z.value?(he[x]||[]).some(f=>f.includes(Z.value)):!0}const q=we(()=>B.value?T.value.filter(F):T.value.filter(x=>x.id===M.value)),Te=we({get:()=>co.value,set:x=>Pa(x)}),fe=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],Ue=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],$e=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Ie=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],Ge=vm(),_e=we(()=>(Ge.find(([x])=>x===ve.region)||[null,ve.region])[1]),ye=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],ze=W(Date.now());let ne=null;const je=we(()=>fu(ze.value)),ie=kt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),We=W("user"),le=kt({clientId:"",clientSecret:"",plan:"",bbox:""}),ce=W(""),se=W(!1),ot=W(!1),ee=W(null),be=W(null),Ne=we(()=>ee.value&&ee.value.credits||null),dt=we(()=>{const x=Ne.value;return!x||!x.daily||x.remaining==null?null:Math.max(0,Math.min(100,Math.round(x.remaining/x.daily*100)))}),at=we(()=>{const x=dt.value;return x==null?"bg-accent":x<=10?"bg-danger":x<=30?"bg-amber":"bg-success"});function Ze(x){return typeof x=="number"?x.toLocaleString():x}function Y(){if(!be.value)return"";const x=Math.max(0,Math.round((Date.now()-be.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const j=Math.round(f/60);return j<24?`${j} h ago`:`${Math.round(j/24)} d ago`}function A(){try{ee.value&&localStorage.setItem(gu,JSON.stringify({health:ee.value,ts:be.value}))}catch{}}function z(){try{const x=localStorage.getItem(gu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(ee.value=f.health,be.value=f.ts||null)}catch{}}const gt=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],ut=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],wt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},{label:"European countries",options:gm()},{label:"Other countries",options:[{value:"24,-125,49.5,-66.5",label:"United States"},{value:"41.7,-141,83.1,-52.6",label:"Canada"},{value:"-43.6,113.3,-10.7,153.6",label:"Australia"},{value:"24,122.9,45.5,145.8",label:"Japan"}]}],y=wt.flatMap(x=>x.options);function _(x){const f=String(x||"").split(",").map(S=>S.trim());if(f.length!==4)return"";const j=f.map(Number);return j.some(S=>Number.isNaN(S))?"":j.join(",")}function w(x){const f=_(x),j=f&&y.find(S=>_(S.value)===f);return j?j.label:""}const K=W(!1),H=we({get(){if(!me.value&&ve.autoBbox)return"__auto__";if(K.value)return"__custom__";const x=_(le.bbox),f=x&&y.find(j=>_(j.value)===x);return f?f.value:"__custom__"},set(x){if(x==="__auto__"){me.value||(ve.autoBbox=!0),K.value=!1;return}if(me.value||(ve.autoBbox=!1),x==="__custom__"){K.value=!0;return}K.value=!1,le.bbox=x}}),V=we(()=>H.value==="__custom__"),ae=we(()=>H.value==="__auto__"),te=we(()=>ie.isSuperadmin),Q=we(()=>ie.isSuperadmin?"user":We.value),G=we(()=>ie.scopes[Q.value]||{editableLayer:"user",fields:{}}),me=we(()=>Q.value==="org");function oe(x){return G.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function ke(x){return te.value||oe(x).locked}function Ce(x){const f=oe(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function He(){le.clientId=oe("clientId").own||"",le.clientSecret=oe("clientSecret").own||"",le.plan=oe("plan").own||"",le.bbox=oe("bbox").own||"",K.value=!1}function et(x){ie.available=!!x.available,ie.orgEnabled=x.orgEnabled!==!1,ie.allowAnonymous=!!x.allowAnonymous,ie.enabled=!!x.enabled,ie.canEditOrg=!!x.canEditOrg,ie.isSuperadmin=!!x.isSuperadmin,ie.scopes=x.scopes||{},We.value==="org"&&!ie.canEditOrg&&(We.value="user"),He(),ie.loaded=!0}It(We,()=>{ce.value="",He()});async function U(){z();const{ok:x,body:f}=await dp();x&&et(f)}async function O(x){const f=me.value;f?ie.orgEnabled=x:ie.enabled=x;const{ok:j,body:S}=await lu(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});j?(et(S),it(f?x?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":x?"OpenSky enabled.":"OpenSky disabled.")):(f?ie.orgEnabled=!x:ie.enabled=!x,it(S.error||"Could not update."))}async function xe(){ce.value="",se.value=!0;const x={};for(const Xe of["clientId","clientSecret","plan","bbox"])ke(Xe)||(x[Xe]=le[Xe]);const f={scope:Q.value,config:x};me.value||(f.enabled=ie.enabled);const{ok:j,body:S}=await lu(f);if(se.value=!1,!j){ce.value=S.error||"Could not save settings.";return}et(S),it(me.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function Je(){ot.value=!0,ee.value=null;const{ok:x,body:f}=await fp();ot.value=!1,ee.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},be.value=Date.now(),A()}function pt(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const Ve=kt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Vt=W("user"),de=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],Fe=kt(Object.fromEntries(de.map(x=>[x,""]))),Nt=W(""),qn=W(!1),fo=W(!1),gn=W(null),Yn=W(null),jo=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],Ba=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Wo=we(()=>Ve.isSuperadmin),Ko=we(()=>Ve.isSuperadmin?"user":Vt.value),Ua=we(()=>Ve.scopes[Ko.value]||{editableLayer:"user",fields:{}}),vn=we(()=>Ko.value==="org"),ho=we(()=>(en("protocol")?Ot("protocol").effective:Fe.protocol)||"sftp");function Ot(x){return Ua.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function en(x){return Wo.value||Ot(x).locked}function Pt(x){const f=Ot(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Va(x){return(jo.find(f=>f.value===x)||{}).label||x||"—"}function Bs(){for(const x of de)Fe[x]=Ot(x).own||"";Fe.protocol||(Fe.protocol="sftp"),Fe.insecureSkipVerify||(Fe.insecureSkipVerify="false")}function tn(x){Ve.available=!!x.available,Ve.orgEnabled=x.orgEnabled!==!1,Ve.enabled=!!x.enabled,Ve.canEditOrg=!!x.canEditOrg,Ve.isSuperadmin=!!x.isSuperadmin,Ve.scopes=x.scopes||{},Vt.value==="org"&&!Ve.canEditOrg&&(Vt.value="user"),Bs(),Ve.loaded=!0}It(Vt,()=>{Nt.value="",Bs()});function Le(){if(!Yn.value)return"";const x=Math.max(0,Math.round((Date.now()-Yn.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const j=Math.round(f/60);return j<24?`${j} h ago`:`${Math.round(j/24)} d ago`}function Us(){try{gn.value&&localStorage.setItem(vu,JSON.stringify({health:gn.value,ts:Yn.value}))}catch{}}function Vs(){try{const x=localStorage.getItem(vu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(gn.value=f.health,Yn.value=f.ts||null)}catch{}}async function Zs(){Vs();const{ok:x,body:f}=await pp();x&&tn(f)}async function Go(x){const f=vn.value;f?Ve.orgEnabled=x:Ve.enabled=x;const{ok:j,body:S}=await uu(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});j?(tn(S),it(f?x?"File transfer enabled for your organization.":"File transfer disabled for your organization.":x?"File transfer enabled.":"File transfer disabled.")):(f?Ve.orgEnabled=!x:Ve.enabled=!x,it(S.error||"Could not update."))}async function qo(){Nt.value="",qn.value=!0;const x={};for(const Xe of de)en(Xe)||(x[Xe]=Fe[Xe]);const f={scope:Ko.value,config:x};vn.value||(f.enabled=Ve.enabled);const{ok:j,body:S}=await uu(f);if(qn.value=!1,!j){Nt.value=S.error||"Could not save settings.";return}tn(S),it(vn.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Hs(){fo.value=!0,gn.value=null;const{ok:x,body:f}=await mp();fo.value=!1,gn.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},Yn.value=Date.now(),Us()}function mi(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const rt=kt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),gi=W("user"),Yo=["baseURL","username","password","insecureSkipVerify","basePath"],Zt=kt(Object.fromEntries(Yo.map(x=>[x,""]))),Di=W(""),Fi=W(!1),po=W(!1),nn=W(null),vi=W(null),Za=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Jo=we(()=>rt.isSuperadmin),Xo=we(()=>rt.isSuperadmin?"user":gi.value),Ha=we(()=>rt.scopes[Xo.value]||{editableLayer:"user",fields:{}}),on=we(()=>Xo.value==="org");function sn(x){return Ha.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Jn(x){return Jo.value||sn(x).locked}function cn(x){const f=sn(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function _i(){for(const x of Yo)Zt[x]=sn(x).own||"";Zt.insecureSkipVerify||(Zt.insecureSkipVerify="false")}function tt(x){rt.available=!!x.available,rt.orgEnabled=x.orgEnabled!==!1,rt.enabled=!!x.enabled,rt.canEditOrg=!!x.canEditOrg,rt.isSuperadmin=!!x.isSuperadmin,rt.scopes=x.scopes||{},gi.value==="org"&&!rt.canEditOrg&&(gi.value="user"),_i(),rt.loaded=!0}It(gi,()=>{Di.value="",_i()});function yt(){if(!vi.value)return"";const x=Math.max(0,Math.round((Date.now()-vi.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const j=Math.round(f/60);return j<24?`${j} h ago`:`${Math.round(j/24)} d ago`}function mo(){try{nn.value&&localStorage.setItem(_u,JSON.stringify({health:nn.value,ts:vi.value}))}catch{}}function bi(){try{const x=localStorage.getItem(_u);if(!x)return;const f=JSON.parse(x);f&&f.health&&(nn.value=f.health,vi.value=f.ts||null)}catch{}}async function yi(){bi();const{ok:x,body:f}=await _p();x&&tt(f)}async function go(x){const f=on.value;f?rt.orgEnabled=x:rt.enabled=x;const{ok:j,body:S}=await cu(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});j?(tt(S),it(f?x?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":x?"WebDAV enabled.":"WebDAV disabled.")):(f?rt.orgEnabled=!x:rt.enabled=!x,it(S.error||"Could not update."))}async function qe(){Di.value="",Fi.value=!0;const x={};for(const Xe of Yo)Jn(Xe)||(x[Xe]=Zt[Xe]);const f={scope:Xo.value,config:x};on.value||(f.enabled=rt.enabled);const{ok:j,body:S}=await cu(f);if(Fi.value=!1,!j){Di.value=S.error||"Could not save settings.";return}tt(S),it(on.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function Tt(){po.value=!0,nn.value=null;const{ok:x,body:f}=await bp();po.value=!1,nn.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},vi.value=Date.now(),mo()}function Qo(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const Me=kt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),At=W("user"),vo=W(""),Fn=W(""),_n=W(!1),xt=W(!1),Dt=W(null),bn=W(null),An=W({}),_o=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Xn=we(()=>Me.isSuperadmin),Ri=we(()=>Me.isSuperadmin?"user":At.value),es=we(()=>Me.scopes[Ri.value]||{editableLayer:"user",fields:{}}),Ft=we(()=>Ri.value==="org");function xi(x){return es.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function bo(x){return Xn.value||xi(x).locked}function Bi(x){const f=xi(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function js(x){return(_o.find(f=>f.value===x)||{}).label||"Inherit"}function yo(){vo.value=xi("readOnly").own||""}function Ui(x){Me.available=!!x.available,Me.orgEnabled=x.orgEnabled!==!1,Me.enabled=!!x.enabled,Me.canEditOrg=!!x.canEditOrg,Me.isSuperadmin=!!x.isSuperadmin,Me.isOrgUser=!!x.isOrgUser,Me.mounts=Array.isArray(x.mounts)?x.mounts:[],Me.privateFolder=!!x.privateFolder,Me.privateEnabled=!!x.privateEnabled,Me.allowPrivate=x.allowPrivate!==!1,Me.rootConfigured=!!x.rootConfigured,Me.scopes=x.scopes||{},At.value==="org"&&!Me.canEditOrg&&(At.value="user"),yo(),Me.loaded=!0}It(At,()=>{Fn.value="",yo()});function Ke(){if(!bn.value)return"";const x=Math.max(0,Math.round((Date.now()-bn.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const j=Math.round(f/60);return j<24?`${j} h ago`:`${Math.round(j/24)} d ago`}function yn(){try{Dt.value&&localStorage.setItem(bu,JSON.stringify({health:Dt.value,ts:bn.value}))}catch{}}function mt(){try{const x=localStorage.getItem(bu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Dt.value=f.health,bn.value=f.ts||null)}catch{}}async function Ws(){mt();const{ok:x,body:f}=await gp();x&&Ui(f)}async function xo(x){const f=Ft.value;f?Me.orgEnabled=x:Me.enabled=x;const{ok:j,body:S}=await fa(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});j?(Ui(S),it(f?x?"Local storage enabled for your organization.":"Local storage disabled for your organization.":x?"Local storage enabled.":"Local storage disabled.")):(f?Me.orgEnabled=!x:Me.enabled=!x,it(S.error||"Could not update."))}async function ts(x){Me.privateFolder=x;const{ok:f,body:j}=await fa({scope:"user",privateFolder:x});f?(Ui(j),it(x?"Private folder enabled.":"Private folder disabled.")):(Me.privateFolder=!x,it(j.error||"Could not update."))}async function ns(x){Me.allowPrivate=x;const{ok:f,body:j}=await fa({scope:"org",allowPrivate:x});f?(Ui(j),it(x?"Members may now create private folders.":"Private folders disabled for your organization.")):(Me.allowPrivate=!x,it(j.error||"Could not update."))}async function Qn(){Fn.value="",_n.value=!0;const x={};bo("readOnly")||(x.readOnly=vo.value);const f={scope:Ri.value,config:x};Ft.value||(f.enabled=Me.enabled);const{ok:j,body:S}=await fa(f);if(_n.value=!1,!j){Fn.value=S.error||"Could not save settings.";return}Ui(S),it(Ft.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function is(){xt.value=!0,Dt.value=null,An.value={};const{ok:x,body:f}=await vp();xt.value=!1,Dt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const j={};if(Array.isArray(f.mounts))for(const S of f.mounts)j[S.id]={status:S.status,detail:S.detail};An.value=j,bn.value=Date.now(),yn()}function wi(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const Et=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],En=W("apis-external");function wo(x){return B.value||En.value===x}const Vi=W("");let os=null;function it(x){Vi.value=x,clearTimeout(os),os=setTimeout(()=>Vi.value="",2200)}const Rt=kt({current:"",next:"",confirm:""}),ki=W(""),ss=W(!1);function nt(){if(ss.value=!1,!Rt.current)return ki.value="Enter your current password.";if(Rt.next.length<8)return ki.value="New password must be at least 8 characters.";if(Rt.next!==Rt.confirm)return ki.value="New passwords do not match.";ki.value="Validated. Connecting to the account service is pending — no password endpoint yet.",Rt.current=Rt.next=Rt.confirm=""}const as=W("");function dn(){as.value="Verification link would be sent once the account service is wired up."}function Zi(x){const f=x.target.files&&x.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){it("Image too large (max ~1.5 MB).");return}const j=new FileReader;j.onload=()=>{ve.avatar=String(j.result),it("Photo updated.")},j.readAsDataURL(f)}function Ks(){ve.avatar="",it("Photo removed.")}const ja=we(()=>{var j,S,Xe;const f=(ve.displayName||ve.name||s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((j=f[0])==null?void 0:j[0])||"P")+(((S=f[1])==null?void 0:S[0])||((Xe=f[0])==null?void 0:Xe[1])||"V")).toUpperCase()}),ei=W(!1),Gs=W(""),Hi=W(""),ji=W(""),ko=W([]);function Wi(x){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let j="";for(let S=0;SWi(4).toLowerCase()+"-"+Wi(4).toLowerCase()),ji.value=""}function Ka(){ve.twoFactor=!1,ko.value=[],ei.value=!1}const fn=navigator.userAgent;function Rn(){return/Edg\//.test(fn)?"Edge":/OPR\//.test(fn)?"Opera":/Chrome\//.test(fn)?"Chrome":/Firefox\//.test(fn)?"Firefox":/Safari\//.test(fn)?"Safari":"Browser"}function qs(){return/Windows/.test(fn)?"Windows":/Mac OS X/.test(fn)?"macOS":/Android/.test(fn)?"Android":/iPhone|iPad/.test(fn)?"iOS":/Linux/.test(fn)?"Linux":"Unknown OS"}const Ys=Date.now(),Si=W([]),Ki=W(!1),Gi=W(""),Ct=kt({email:"",password:"",role:"user",organization:""}),Ti=W(""),So=W(!1),ti=W(""),Js=we(()=>{const x=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&x.push({value:"superadmin",label:"Superadmin"}),x}),qi=W([]);async function Pi(){if(!d.value)return;const x=await sp();x.ok&&(qi.value=x.organizations.slice().sort((f,j)=>f.name.localeCompare(j.name)))}const Yi=we(()=>{const x=qi.value.map(f=>({value:f.id,label:f.name}));return u.value&&x.unshift({value:"",label:"No organization"}),x});async function an(){if(!d.value)return;Ki.value=!0,Gi.value="";const x=await tp();if(Ki.value=!1,!x.ok){Gi.value=x.status===403?"Manager role required.":"Could not load users.";return}Si.value=x.users.slice().sort((f,j)=>f.email.localeCompare(j.email))}function To(x){try{const f=x.data||{},j=Object.keys(f)[0];return j&&f[j]&&f[j].message||x.message||x.error||"Invalid input."}catch{return x.error||"Could not create user."}}async function Ji(){Ti.value="";const x=Ct.email.trim().toLowerCase();if(!x.includes("@"))return Ti.value="Enter a valid email.";if(Ct.password.length<8)return Ti.value="Password must be at least 8 characters.";So.value=!0;const f=u.value?Ct.organization:s.organization,{ok:j,body:S}=await np(x,Ct.password,Ct.role,f);if(So.value=!1,!j)return Ti.value=To(S);Ct.email="",Ct.password="",Ct.role="user",Ct.organization="",it("User created."),an()}async function rn(x){const{ok:f,body:j}=await op(x.id);if(ti.value="",!f)return it(j.error||"Could not remove user.");it("User removed."),an()}const st=kt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),On=W(""),Po=W(!1),Xi=we(()=>!!st.id&&st.email===s.email);function rs(x){ti.value="",st.id=x.id,st.email=x.email,st.role=x.role||"user",st.verified=!!x.verified,st.password="",st.organization=x.organization||"",On.value=""}function Xs(){st.id="",On.value=""}async function Ga(){On.value="";const x=st.email.trim().toLowerCase();if(!x.includes("@"))return On.value="Enter a valid email.";if(st.password&&st.password.length<8)return On.value="New password must be at least 8 characters (or leave blank).";const f={email:x,role:st.role,verified:st.verified};u.value&&(f.organization=st.organization),st.password&&(f.password=st.password),Po.value=!0;const{ok:j,body:S}=await ip(st.id,f);if(Po.value=!1,!j)return On.value=To(S);it("User updated."),Xs(),an()}const Qi=kt({name:""}),eo=W(""),Ht=W(!1),wn=W(""),zn=kt({id:"",name:""}),Bt=W(""),ls=we(()=>{const x={};for(const f of Si.value)f.organization&&(x[f.organization]=(x[f.organization]||0)+1);return x});async function ni(){eo.value="";const x=Qi.name.trim();if(!x)return eo.value="Enter an organization name.";Ht.value=!0;const{ok:f,body:j}=await ap(x);if(Ht.value=!1,!f)return eo.value=To(j);Qi.name="",it("Organization created."),Pi()}function qa(x){wn.value="",zn.id=x.id,zn.name=x.name,Bt.value=""}function Ci(){zn.id="",Bt.value=""}async function us(){Bt.value="";const x=zn.name.trim();if(!x)return Bt.value="Enter an organization name.";const{ok:f,body:j}=await rp(zn.id,x);if(!f)return Bt.value=To(j);it("Organization renamed."),Ci(),Pi(),an()}async function Co(x){const{ok:f,body:j}=await lp(x.id);if(wn.value="",!f)return it(j.error||"Could not delete organization.");it("Organization deleted."),Pi()}function Ya(){const x={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:s.email,prefs:{...ve},themeMode:co.value},f=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),j=URL.createObjectURL(f),S=document.createElement("a");S.href=j,S.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(S),S.click(),S.remove(),URL.revokeObjectURL(j),it("Settings exported.")}const hn=W("");function Lo(x){const f=x.target.files&&x.target.files[0];if(!f)return;const j=new FileReader;j.onload=()=>{try{const S=JSON.parse(String(j.result)),Xe=S.prefs||S;if(!Vc(Xe))throw new Error("bad shape");S.themeMode&&Pa(S.themeMode),Gr(ve.fontSize),qr(ve.reduceMotion),hn.value="Settings imported and applied."}catch{hn.value="That file is not a valid PilotVault settings export."}},j.readAsText(f),x.target.value=""}const _t=kt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let ii=null;const cs=we(()=>s.email||"DELETE MY ACCOUNT"),pn=we(()=>_t.understand&&_t.typed===cs.value);function Ja(){pn.value&&(_t.armed=!0,_t.cooldown=5,clearInterval(ii),ii=setInterval(()=>{_t.cooldown--,_t.cooldown<=0&&clearInterval(ii)},1e3))}It(pn,x=>{!x&&_t.armed&&(_t.armed=!1,_t.cooldown=0,clearInterval(ii))});function Li(){if(!(!_t.armed||_t.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}_t.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return hi(()=>{ne=setInterval(()=>ze.value=Date.now(),1e3),Pi(),an(),U(),Zs(),yi(),Ws()}),Ho(()=>{clearInterval(ne),clearInterval(ii),clearTimeout(os)}),(x,f)=>(p(),g("div",bm,[r("div",ym,[f[63]||(f[63]=r("div",null,[r("div",{class:"eyebrow"},"Preferences"),r("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),r("div",xm,[E(X,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":f[0]||(f[0]=j=>R.value=j),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[Se,R.value]]),R.value?(p(),g("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=j=>R.value="")},[E(X,{name:"x",size:15})])):D("",!0)])]),r("div",wm,[re(r("nav",km,[(p(!0),g(ue,null,Be(T.value,j=>(p(),g("button",{key:j.id,class:Ee(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[M.value===j.id?j.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":j.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:S=>M.value=j.id},[E(X,{name:j.icon,size:17},null,8,["name"]),r("span",Tm,k(j.label),1)],10,Sm))),128))],512),[[xh,!B.value]]),r("div",Pm,[B.value&&!q.value.length?(p(),g("div",Cm," No settings match “"+k(R.value)+"”. ",1)):D("",!0),(p(!0),g(ue,null,Be(q.value,j=>(p(),g(ue,{key:j.id},[B.value?(p(),g("div",Lm,[E(X,{name:j.icon,size:14},null,8,["name"]),$(" "+k(j.label),1)])):D("",!0),j.id==="account"?(p(),g("div",Mm,[E(Ae,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:Pe(()=>[re(r("input",{"onUpdate:modelValue":f[2]||(f[2]=S=>Oe(ve).name=S),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=S=>it("Saved."))},null,544),[[Se,Oe(ve).name]])]),_:1}),E(Ae,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:Pe(()=>[r("div",Am,[f[64]||(f[64]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),re(r("input",{"onUpdate:modelValue":f[4]||(f[4]=S=>Oe(ve).username=S),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=S=>it("Saved."))},null,544),[[Se,Oe(ve).username]])])]),_:1}),E(Ae,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:Pe(()=>[r("div",Em,[r("span",Om,k(t.email||"—"),1),r("span",zm,[E(X,{name:"mail",size:12}),f[65]||(f[65]=$(" Unverified ",-1))])])]),_:1}),E(Ae,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:Pe(()=>[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(t.role)])},[E(X,{name:v(t.role),size:12},null,8,["name"]),$(k(h(t.role)),1)],2)]),_:1}),E(Ae,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:Pe(()=>[r("span",{class:Ee(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},k(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),E(Ae,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:Pe(()=>[r("button",{class:"btn-ghost",onClick:dn},"Send verification link"),as.value?(p(),g("p",Im,k(as.value),1)):D("",!0)]),_:1}),E(Ae,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:Pe(()=>[r("div",$m,[re(r("input",{"onUpdate:modelValue":f[6]||(f[6]=S=>Rt.current=S),type:"password",class:"field",placeholder:"Current password"},null,512),[[Se,Rt.current]]),re(r("input",{"onUpdate:modelValue":f[7]||(f[7]=S=>Rt.next=S),type:"password",class:"field",placeholder:"New password"},null,512),[[Se,Rt.next]]),re(r("input",{"onUpdate:modelValue":f[8]||(f[8]=S=>Rt.confirm=S),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[Se,Rt.confirm]]),r("div",Nm,[r("button",{class:"btn-accent",onClick:nt},"Update password"),ki.value?(p(),g("span",{key:0,class:Ee(["text-xs",ss.value?"text-success-fg":"text-ink-muted"])},k(ki.value),3)):D("",!0)])])]),_:1})])):j.id==="appearance"?(p(),g("div",Dm,[E(Ae,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:Pe(()=>[E(Tn,{modelValue:Te.value,"onUpdate:modelValue":f[9]||(f[9]=S=>Te.value=S),options:fe},null,8,["modelValue"])]),_:1}),E(Ae,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:Pe(()=>[E(Tn,{modelValue:Oe(ve).fontSize,"onUpdate:modelValue":f[10]||(f[10]=S=>Oe(ve).fontSize=S),options:Ue},null,8,["modelValue"])]),_:1}),E(Ae,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:Pe(()=>[E(un,{modelValue:Oe(ve).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=S=>Oe(ve).reduceMotion=S)},null,8,["modelValue"])]),_:1}),E(Ae,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:Pe(()=>[re(r("select",{"onUpdate:modelValue":f[12]||(f[12]=S=>Oe(ve).language=S),class:"field w-48"},[(p(),g(ue,null,Be(Ie,([S,Xe])=>r("option",{key:S,value:S},k(Xe),9,Fm)),64))],512),[[Mt,Oe(ve).language]])]),_:1}),E(Ae,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:Pe(()=>[re(r("select",{"onUpdate:modelValue":f[13]||(f[13]=S=>Oe(ve).region=S),class:"field w-48"},[(p(!0),g(ue,null,Be(Oe(Ge),([S,Xe])=>(p(),g("option",{key:S,value:S},k(Xe),9,Rm))),128))],512),[[Mt,Oe(ve).region]])]),_:1}),E(Ae,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:Pe(()=>[re(r("select",{"onUpdate:modelValue":f[14]||(f[14]=S=>Oe(ve).dateFormat=S),class:"field w-48"},[(p(),g(ue,null,Be(ye,([S,Xe])=>r("option",{key:S,value:S},k(Xe),9,Bm)),64))],512),[[Mt,Oe(ve).dateFormat]])]),_:1}),E(Ae,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:Pe(()=>[E(Tn,{modelValue:Oe(ve).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=S=>Oe(ve).timeFormat=S),options:$e},null,8,["modelValue"])]),_:1}),E(Ae,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:Pe(()=>[r("span",Um,k(je.value),1)]),_:1}),f[66]||(f[66]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):j.id==="integrations"?(p(),g("div",Vm,[B.value?D("",!0):(p(),g("div",Zm,[(p(),g(ue,null,Be(Et,S=>r("button",{key:S.id,type:"button",class:Ee(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",En.value===S.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Xe=>En.value=S.id},[E(X,{name:S.icon,size:16},null,8,["name"]),$(k(S.label),1)],10,Hm)),64))])),wo("apis-external")?(p(),g("div",jm,[r("div",Wm,[r("div",Km,[E(X,{name:"radio",size:20})]),f[67]||(f[67]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Live ADS-B aircraft data. Configure your own OAuth2 credentials, plan and default bounding box. ")],-1))]),ie.loaded&&!ie.available?(p(),g("div",Gm,[E(X,{name:"lock",size:14,class:"mr-1 inline"}),f[68]||(f[68]=$(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),ie.canEditOrg?(p(),g("div",qm,[f[69]||(f[69]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(Tn,{modelValue:We.value,"onUpdate:modelValue":f[16]||(f[16]=S=>We.value=S),options:ut},null,8,["modelValue"])])):D("",!0),me.value?(p(),lt(Ae,{key:2,title:"Enable OpenSky (organization-wide)",desc:"Turn OpenSky on or off for everyone in your organization.",keywords:"enable disable plugin opensky organization"},{default:Pe(()=>[E(un,{"model-value":ie.orgEnabled,disabled:!ie.available,"onUpdate:modelValue":O},null,8,["model-value","disabled"])]),_:1})):(p(),lt(Ae,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:Pe(()=>[E(un,{"model-value":ie.enabled,disabled:!ie.available||!ie.orgEnabled,"onUpdate:modelValue":O},null,8,["model-value","disabled"])]),_:1})),!me.value&&ie.available&&!ie.orgEnabled?(p(),g("div",Ym,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[71]||(f[71]=$("OpenSky is turned off for your organization",-1)),ie.canEditOrg?(p(),g("span",Jm,[...f[70]||(f[70]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),f[72]||(f[72]=$(". ",-1))])):D("",!0),me.value?(p(),g("div",Xm,[E(X,{name:"users",size:13,class:"mr-1 inline"}),f[73]||(f[73]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Qm,k(t.organizationName||"your organization"),1),f[74]||(f[74]=$(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):te.value?(p(),g("div",eg," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),ie.available&&!me.value?(p(),g("div",tg,[r("div",ng,[r("div",ig,[E(X,{name:"signal",size:15}),f[75]||(f[75]=$("Credit usage ",-1))]),be.value?(p(),g("span",og,"Checked "+k(Y()),1)):D("",!0)]),Ne.value?(p(),g(ue,{key:0},[Ne.value.remaining!=null?(p(),g(ue,{key:0},[r("div",sg,[r("span",ag,k(Ze(Ne.value.remaining)),1),r("span",rg,"/ "+k(Ze(Ne.value.daily))+" credits left today",1)]),r("div",lg,[r("div",{class:Ee(["h-full rounded-full transition-all",at.value]),style:Bo({width:dt.value+"%"})},null,6)]),r("div",ug," Used "+k(Ze(Ne.value.daily-Ne.value.remaining))+" today · "+k(Ne.value.probeCost)+" credit"+k(Ne.value.probeCost===1?"":"s")+" per query · "+k(Ne.value.mode),1)],64)):(p(),g(ue,{key:1},[r("div",cg,[f[76]||(f[76]=$("Daily allowance: ",-1)),r("span",dg,k(Ze(Ne.value.daily)),1),f[77]||(f[77]=$(" credits",-1))]),r("div",fg,k(Ne.value.probeCost)+" credit"+k(Ne.value.probeCost===1?"":"s")+" per query · "+k(Ne.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),g("div",hg,[...f[78]||(f[78]=[$(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),$(" below to fetch your live OpenSky credit balance. ",-1)])]))])):D("",!0),E(Ae,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:Pe(()=>[ke("plan")?(p(),g("span",pg,[$(k((gt.find(S=>S.value===oe("plan").effective)||{}).label||oe("plan").effective||"—")+" ",1),Ce("plan")?(p(),g("span",mg,[E(X,{name:"lock",size:10}),$(k(Ce("plan")),1)])):D("",!0)])):(p(),lt(Tn,{key:1,modelValue:le.plan,"onUpdate:modelValue":f[17]||(f[17]=S=>le.plan=S),options:gt},null,8,["modelValue"]))]),_:1}),E(Ae,{title:"Default bounding box",desc:"Automatic follows your location; or pick a region, or enter lamin,lomin,lamax,lomax by hand.",keywords:"bounding box bbox area region country continent world europe custom coordinates automatic location drone"},{default:Pe(()=>[ke("bbox")?(p(),g("span",gg,[$(k(w(oe("bbox").effective)||oe("bbox").effective||"—")+" ",1),Ce("bbox")?(p(),g("span",vg,[E(X,{name:"lock",size:10}),$(k(Ce("bbox")),1)])):D("",!0)])):(p(),g("div",_g,[re(r("select",{"onUpdate:modelValue":f[18]||(f[18]=S=>H.value=S),class:"field w-64"},[me.value?D("",!0):(p(),g("option",bg,"Automatic (by location)")),(p(),g(ue,null,Be(wt,S=>r("optgroup",{key:S.label,label:S.label},[(p(!0),g(ue,null,Be(S.options,Xe=>(p(),g("option",{key:Xe.value,value:Xe.value},k(Xe.label),9,xg))),128))],8,yg)),64)),f[79]||(f[79]=r("option",{value:"__custom__"},"Custom…",-1))],512),[[Mt,H.value]]),ae.value?(p(),g("p",wg," Live map follows drone location → your device location → your Region ("+k(_e.value)+"). ",1)):D("",!0),V.value?re((p(),g("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=S=>le.bbox=S),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[Se,le.bbox]]):D("",!0)]))]),_:1}),E(Ae,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:Pe(()=>[ke("clientId")?(p(),g("span",kg,[$(k(oe("clientId").effective||"—")+" ",1),Ce("clientId")?(p(),g("span",Sg,[E(X,{name:"lock",size:10}),$(k(Ce("clientId")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=S=>le.clientId=S),class:"field w-64",placeholder:"your-api-client"},null,512)),[[Se,le.clientId]])]),_:1}),E(Ae,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:Pe(()=>[ke("clientSecret")?(p(),g("span",Tg,[$(k(oe("clientSecret").effective||"—")+" ",1),Ce("clientSecret")?(p(),g("span",Pg,[E(X,{name:"lock",size:10}),$(k(Ce("clientSecret")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[21]||(f[21]=S=>le.clientSecret=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[Se,le.clientSecret]])]),_:1}),ie.available&&!ie.allowAnonymous?(p(),g("div",Cg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):D("",!0),r("div",Lg,[te.value?D("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:se.value||!ie.available,onClick:xe},k(se.value?"Saving…":me.value?"Save organization settings":"Save settings"),9,Mg)),me.value?D("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:ot.value||!ie.available,onClick:Je},k(ot.value?"Testing…":"Test connection"),9,Ag)),ce.value?(p(),g("span",Eg,k(ce.value),1)):D("",!0),ee.value&&!me.value?(p(),g("span",{key:3,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",pt(ee.value.status)])},[f[80]||(f[80]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(ee.value.detail||ee.value.status),1)],2)):D("",!0)])])):D("",!0),wo("drives-external")?(p(),g(ue,{key:2},[r("div",Og,[r("div",zg,[r("div",Ig,[E(X,{name:"server",size:20})]),f[81]||(f[81]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to an FTP, FTPS or SFTP server. Configure the connection your account uses for file transfers. ")],-1))]),Ve.loaded&&!Ve.available?(p(),g("div",$g,[E(X,{name:"lock",size:14,class:"mr-1 inline"}),f[82]||(f[82]=$(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),Ve.canEditOrg?(p(),g("div",Ng,[f[83]||(f[83]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(Tn,{modelValue:Vt.value,"onUpdate:modelValue":f[22]||(f[22]=S=>Vt.value=S),options:ut},null,8,["modelValue"])])):D("",!0),vn.value?(p(),lt(Ae,{key:2,title:"Enable file transfer (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin ftp sftp organization"},{default:Pe(()=>[E(un,{"model-value":Ve.orgEnabled,disabled:!Ve.available,"onUpdate:modelValue":Go},null,8,["model-value","disabled"])]),_:1})):(p(),lt(Ae,{key:3,title:"Enable file transfer",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin ftp sftp"},{default:Pe(()=>[E(un,{"model-value":Ve.enabled,disabled:!Ve.available||!Ve.orgEnabled,"onUpdate:modelValue":Go},null,8,["model-value","disabled"])]),_:1})),!vn.value&&Ve.available&&!Ve.orgEnabled?(p(),g("div",Dg,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[85]||(f[85]=$("File transfer is turned off for your organization",-1)),Ve.canEditOrg?(p(),g("span",Fg,[...f[84]||(f[84]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),f[86]||(f[86]=$(". ",-1))])):D("",!0),vn.value?(p(),g("div",Rg,[E(X,{name:"users",size:13,class:"mr-1 inline"}),f[87]||(f[87]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Bg,k(t.organizationName||"your organization"),1),f[88]||(f[88]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Wo.value?(p(),g("div",Ug," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),E(Ae,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:Pe(()=>[en("protocol")?(p(),g("span",Vg,[$(k(Va(Ot("protocol").effective))+" ",1),Pt("protocol")?(p(),g("span",Zg,[E(X,{name:"lock",size:10}),$(k(Pt("protocol")),1)])):D("",!0)])):(p(),lt(Tn,{key:1,modelValue:Fe.protocol,"onUpdate:modelValue":f[23]||(f[23]=S=>Fe.protocol=S),options:jo},null,8,["modelValue"]))]),_:1}),E(Ae,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:Pe(()=>[en("host")?(p(),g("span",Hg,[$(k(Ot("host").effective||"—")+" ",1),Pt("host")?(p(),g("span",jg,[E(X,{name:"lock",size:10}),$(k(Pt("host")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=S=>Fe.host=S),class:"field w-64",placeholder:"files.example.com"},null,512)),[[Se,Fe.host]])]),_:1}),E(Ae,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:Pe(()=>[en("port")?(p(),g("span",Wg,[$(k(Ot("port").effective||"default")+" ",1),Pt("port")?(p(),g("span",Kg,[E(X,{name:"lock",size:10}),$(k(Pt("port")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=S=>Fe.port=S),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[Se,Fe.port]])]),_:1}),E(Ae,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:Pe(()=>[en("username")?(p(),g("span",Gg,[$(k(Ot("username").effective||"—")+" ",1),Pt("username")?(p(),g("span",qg,[E(X,{name:"lock",size:10}),$(k(Pt("username")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=S=>Fe.username=S),class:"field w-64",placeholder:"user"},null,512)),[[Se,Fe.username]])]),_:1}),E(Ae,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:Pe(()=>[en("password")?(p(),g("span",Yg,[$(k(Ot("password").effective||"—")+" ",1),Pt("password")?(p(),g("span",Jg,[E(X,{name:"lock",size:10}),$(k(Pt("password")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[27]||(f[27]=S=>Fe.password=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[Se,Fe.password]])]),_:1}),ho.value==="sftp"?(p(),lt(Ae,{key:7,block:"",title:"SSH private key",desc:"PEM key for SFTP key auth — used instead of, or alongside, a password.",keywords:"private key ssh pem identity"},{default:Pe(()=>[en("privateKey")?(p(),g("span",Xg,[$(k(Ot("privateKey").effective||"—")+" ",1),Pt("privateKey")?(p(),g("span",Qg,[E(X,{name:"lock",size:10}),$(k(Pt("privateKey")),1)])):D("",!0)])):re((p(),g("textarea",{key:1,"onUpdate:modelValue":f[28]||(f[28]=S=>Fe.privateKey=S),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[Se,Fe.privateKey]])]),_:1})):D("",!0),ho.value==="sftp"?(p(),lt(Ae,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:Pe(()=>[en("keyPassphrase")?(p(),g("span",ev,[$(k(Ot("keyPassphrase").effective||"—")+" ",1),Pt("keyPassphrase")?(p(),g("span",tv,[E(X,{name:"lock",size:10}),$(k(Pt("keyPassphrase")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=S=>Fe.keyPassphrase=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[Se,Fe.keyPassphrase]])]),_:1})):D("",!0),ho.value==="sftp"?(p(),lt(Ae,{key:9,title:"Host key fingerprint",desc:"Optional SHA256:… fingerprint to pin the server's host key. Blank accepts any key.",keywords:"host key fingerprint verify trust"},{default:Pe(()=>[en("hostKeyFingerprint")?(p(),g("span",nv,[$(k(Ot("hostKeyFingerprint").effective||"—")+" ",1),Pt("hostKeyFingerprint")?(p(),g("span",iv,[E(X,{name:"lock",size:10}),$(k(Pt("hostKeyFingerprint")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[30]||(f[30]=S=>Fe.hostKeyFingerprint=S),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[Se,Fe.hostKeyFingerprint]])]),_:1})):D("",!0),ho.value==="ftps"?(p(),lt(Ae,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:Pe(()=>[en("insecureSkipVerify")?(p(),g("span",ov,[$(k(Ot("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Pt("insecureSkipVerify")?(p(),g("span",sv,[E(X,{name:"lock",size:10}),$(k(Pt("insecureSkipVerify")),1)])):D("",!0)])):(p(),lt(Tn,{key:1,modelValue:Fe.insecureSkipVerify,"onUpdate:modelValue":f[31]||(f[31]=S=>Fe.insecureSkipVerify=S),options:Ba},null,8,["modelValue"]))]),_:1})):D("",!0),E(Ae,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:Pe(()=>[en("basePath")?(p(),g("span",av,[$(k(Ot("basePath").effective||"—")+" ",1),Pt("basePath")?(p(),g("span",rv,[E(X,{name:"lock",size:10}),$(k(Pt("basePath")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[32]||(f[32]=S=>Fe.basePath=S),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[Se,Fe.basePath]])]),_:1}),r("div",lv,[Wo.value?D("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:qn.value||!Ve.available,onClick:qo},k(qn.value?"Saving…":vn.value?"Save organization settings":"Save settings"),9,uv)),vn.value?D("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:fo.value||!Ve.available,onClick:Hs},k(fo.value?"Testing…":"Test connection"),9,cv)),Nt.value?(p(),g("span",dv,k(Nt.value),1)):D("",!0),Yn.value&&!vn.value?(p(),g("span",fv,"Checked "+k(Le()),1)):D("",!0),gn.value&&!vn.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",mi(gn.value.status)])},[f[89]||(f[89]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(gn.value.detail||gn.value.status),1)],2)):D("",!0)])]),r("div",hv,[r("div",pv,[r("div",mv,[E(X,{name:"cloud",size:20})]),f[90]||(f[90]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to a WebDAV server (Nextcloud, ownCloud, IIS, …). Configure the connection your account uses. ")],-1))]),rt.loaded&&!rt.available?(p(),g("div",gv,[E(X,{name:"lock",size:14,class:"mr-1 inline"}),f[91]||(f[91]=$(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),rt.canEditOrg?(p(),g("div",vv,[f[92]||(f[92]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(Tn,{modelValue:gi.value,"onUpdate:modelValue":f[33]||(f[33]=S=>gi.value=S),options:ut},null,8,["modelValue"])])):D("",!0),on.value?(p(),lt(Ae,{key:2,title:"Enable WebDAV (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin webdav organization"},{default:Pe(()=>[E(un,{"model-value":rt.orgEnabled,disabled:!rt.available,"onUpdate:modelValue":go},null,8,["model-value","disabled"])]),_:1})):(p(),lt(Ae,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:Pe(()=>[E(un,{"model-value":rt.enabled,disabled:!rt.available||!rt.orgEnabled,"onUpdate:modelValue":go},null,8,["model-value","disabled"])]),_:1})),!on.value&&rt.available&&!rt.orgEnabled?(p(),g("div",_v,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[94]||(f[94]=$("WebDAV is turned off for your organization",-1)),rt.canEditOrg?(p(),g("span",bv,[...f[93]||(f[93]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),f[95]||(f[95]=$(". ",-1))])):D("",!0),on.value?(p(),g("div",yv,[E(X,{name:"users",size:13,class:"mr-1 inline"}),f[96]||(f[96]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",xv,k(t.organizationName||"your organization"),1),f[97]||(f[97]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Jo.value?(p(),g("div",wv," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),E(Ae,{block:"",title:"Server URL",desc:"WebDAV endpoint including scheme, e.g. https://cloud.example.com/remote.php/dav/files/alice/.",keywords:"url server address endpoint webdav host"},{default:Pe(()=>[Jn("baseURL")?(p(),g("span",kv,[$(k(sn("baseURL").effective||"—")+" ",1),cn("baseURL")?(p(),g("span",Sv,[E(X,{name:"lock",size:10}),$(k(cn("baseURL")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=S=>Zt.baseURL=S),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[Se,Zt.baseURL]])]),_:1}),E(Ae,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:Pe(()=>[Jn("username")?(p(),g("span",Tv,[$(k(sn("username").effective||"—")+" ",1),cn("username")?(p(),g("span",Pv,[E(X,{name:"lock",size:10}),$(k(cn("username")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=S=>Zt.username=S),class:"field w-64",placeholder:"user"},null,512)),[[Se,Zt.username]])]),_:1}),E(Ae,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:Pe(()=>[Jn("password")?(p(),g("span",Cv,[$(k(sn("password").effective||"—")+" ",1),cn("password")?(p(),g("span",Lv,[E(X,{name:"lock",size:10}),$(k(cn("password")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[36]||(f[36]=S=>Zt.password=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[Se,Zt.password]])]),_:1}),E(Ae,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:Pe(()=>[Jn("insecureSkipVerify")?(p(),g("span",Mv,[$(k(sn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),cn("insecureSkipVerify")?(p(),g("span",Av,[E(X,{name:"lock",size:10}),$(k(cn("insecureSkipVerify")),1)])):D("",!0)])):(p(),lt(Tn,{key:1,modelValue:Zt.insecureSkipVerify,"onUpdate:modelValue":f[37]||(f[37]=S=>Zt.insecureSkipVerify=S),options:Za},null,8,["modelValue"]))]),_:1}),E(Ae,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:Pe(()=>[Jn("basePath")?(p(),g("span",Ev,[$(k(sn("basePath").effective||"—")+" ",1),cn("basePath")?(p(),g("span",Ov,[E(X,{name:"lock",size:10}),$(k(cn("basePath")),1)])):D("",!0)])):re((p(),g("input",{key:1,"onUpdate:modelValue":f[38]||(f[38]=S=>Zt.basePath=S),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[Se,Zt.basePath]])]),_:1}),r("div",zv,[Jo.value?D("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:Fi.value||!rt.available,onClick:qe},k(Fi.value?"Saving…":on.value?"Save organization settings":"Save settings"),9,Iv)),on.value?D("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:po.value||!rt.available,onClick:Tt},k(po.value?"Testing…":"Test connection"),9,$v)),Di.value?(p(),g("span",Nv,k(Di.value),1)):D("",!0),vi.value&&!on.value?(p(),g("span",Dv,"Checked "+k(yt()),1)):D("",!0),nn.value&&!on.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Qo(nn.value.status)])},[f[98]||(f[98]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(nn.value.detail||nn.value.status),1)],2)):D("",!0)])])],64)):D("",!0),wo("drives-local")?(p(),g("div",Fv,[r("div",Rv,[r("div",Bv,[E(X,{name:"monitor",size:20})]),f[99]||(f[99]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," A private folder on the server for your files. Each user has their own; members of an organization share one. ")],-1))]),Me.loaded&&!Me.available?(p(),g("div",Uv,[E(X,{name:"lock",size:14,class:"mr-1 inline"}),f[100]||(f[100]=$(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):Me.loaded&&!Me.rootConfigured?(p(),g("div",Vv,[E(X,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[101]||(f[101]=$(" No storage root has been configured by your administrator yet. ",-1))])):D("",!0),Me.canEditOrg?(p(),g("div",Zv,[f[102]||(f[102]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(Tn,{modelValue:At.value,"onUpdate:modelValue":f[39]||(f[39]=S=>At.value=S),options:ut},null,8,["modelValue"])])):D("",!0),Ft.value?(p(),lt(Ae,{key:3,title:"Enable local storage (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin local storage folder organization"},{default:Pe(()=>[E(un,{"model-value":Me.orgEnabled,disabled:!Me.available,"onUpdate:modelValue":xo},null,8,["model-value","disabled"])]),_:1})):(p(),lt(Ae,{key:4,title:"Enable local storage",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin local storage folder"},{default:Pe(()=>[E(un,{"model-value":Me.enabled,disabled:!Me.available||!Me.orgEnabled,"onUpdate:modelValue":xo},null,8,["model-value","disabled"])]),_:1})),!Ft.value&&Me.available&&!Me.orgEnabled?(p(),g("div",Hv,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[104]||(f[104]=$("Local storage is turned off for your organization",-1)),Me.canEditOrg?(p(),g("span",jv,[...f[103]||(f[103]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),f[105]||(f[105]=$(". ",-1))])):D("",!0),Ft.value?(p(),g("div",Wv,[E(X,{name:"users",size:13,class:"mr-1 inline"}),f[106]||(f[106]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Kv,k(t.organizationName||"your organization"),1),f[107]||(f[107]=$(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Xn.value?(p(),g("div",Gv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):D("",!0),Ft.value?(p(),lt(Ae,{key:8,title:"Private folders",desc:"Let members create a private folder inside the organization folder, reachable only by them.",keywords:"private folder members allow policy organization"},{default:Pe(()=>[E(un,{"model-value":Me.allowPrivate,disabled:!Me.available,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})):D("",!0),Ft.value?D("",!0):(p(),g(ue,{key:9},[E(Ae,{block:"",title:"Your folders",desc:"Assigned automatically and isolated — no one else can reach your private folder.",keywords:"folder directory path storage location isolated private shared"},{default:Pe(()=>[r("div",qv,[(p(!0),g(ue,null,Be(Me.mounts,S=>(p(),g("div",{key:S.id,class:"flex flex-wrap items-center gap-2"},[r("span",Yv,k(S.path),1),S.kind==="shared"?(p(),g("span",Jv,[E(X,{name:"users",size:10}),f[108]||(f[108]=$("Shared with your organization",-1))])):(p(),g("span",Xv,[E(X,{name:"lock",size:10}),f[109]||(f[109]=$("Private to you",-1))])),An.value[S.id]?(p(),g("span",{key:2,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",wi(An.value[S.id].status)])},[f[110]||(f[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(An.value[S.id].status),1)],2)):D("",!0)]))),128)),Me.mounts.length?D("",!0):(p(),g("div",Qv,k(Me.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),Me.isOrgUser&&Me.allowPrivate?(p(),lt(Ae,{key:0,title:"My private folder",desc:"Add a private folder inside the organization folder, reachable only by you — you keep the shared folder too.",keywords:"private folder personal isolated organization inside"},{default:Pe(()=>[E(un,{"model-value":Me.privateFolder,disabled:!Me.available||!Me.orgEnabled,"onUpdate:modelValue":ts},null,8,["model-value","disabled"])]),_:1})):Me.isOrgUser&&!Me.allowPrivate?(p(),g("div",e_,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[111]||(f[111]=$("Private folders are turned off by your organization. ",-1))])):D("",!0)],64)),E(Ae,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:Pe(()=>[bo("readOnly")?(p(),g("span",t_,[$(k(js(xi("readOnly").effective))+" ",1),Bi("readOnly")?(p(),g("span",n_,[E(X,{name:"lock",size:10}),$(k(Bi("readOnly")),1)])):D("",!0)])):(p(),lt(Tn,{key:1,modelValue:vo.value,"onUpdate:modelValue":f[40]||(f[40]=S=>vo.value=S),options:_o},null,8,["modelValue"]))]),_:1}),r("div",i_,[Xn.value?D("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:_n.value||!Me.available,onClick:Qn},k(_n.value?"Saving…":Ft.value?"Save organization settings":"Save settings"),9,o_)),Ft.value?D("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:xt.value||!Me.available,onClick:is},k(xt.value?"Testing…":"Test folder"),9,s_)),Fn.value?(p(),g("span",a_,k(Fn.value),1)):D("",!0),bn.value&&!Ft.value?(p(),g("span",r_,"Checked "+k(Ke()),1)):D("",!0),Dt.value&&!Ft.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",wi(Dt.value.status)])},[f[112]||(f[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(Dt.value.detail||Dt.value.status),1)],2)):D("",!0)])])):D("",!0)])):j.id==="profile"?(p(),g("div",l_,[E(Ae,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:Pe(()=>[r("div",u_,[Oe(ve).avatar?(p(),g("img",{key:0,src:Oe(ve).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,c_)):(p(),g("div",d_,k(ja.value),1)),r("div",f_,[r("label",h_,[E(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[113]||(f[113]=$("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Zi},null,32)]),Oe(ve).avatar?(p(),g("button",{key:0,class:"btn-ghost",onClick:Ks},"Remove")):D("",!0)])])]),_:1}),E(Ae,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:Pe(()=>[re(r("input",{"onUpdate:modelValue":f[41]||(f[41]=S=>Oe(ve).displayName=S),class:"field w-56",placeholder:"Jane O.",onBlur:f[42]||(f[42]=S=>it("Saved."))},null,544),[[Se,Oe(ve).displayName]])]),_:1}),E(Ae,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:Pe(()=>[re(r("textarea",{"onUpdate:modelValue":f[43]||(f[43]=S=>Oe(ve).bio=S),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[44]||(f[44]=S=>it("Saved."))},null,544),[[Se,Oe(ve).bio]]),r("div",p_,k((Oe(ve).bio||"").length)+"/240",1)]),_:1}),E(Ae,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:Pe(()=>[E(un,{modelValue:Oe(ve).showEmail,"onUpdate:modelValue":f[45]||(f[45]=S=>Oe(ve).showEmail=S)},null,8,["modelValue"])]),_:1})])):j.id==="security"?(p(),g("div",m_,[E(Ae,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:Pe(()=>[r("div",g_,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Oe(ve).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[114]||(f[114]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(Oe(ve).twoFactor?"Enabled":"Disabled"),1)],2),!Oe(ve).twoFactor&&!ei.value?(p(),g("button",{key:0,class:"btn-accent",onClick:Wa},"Enable 2FA")):Oe(ve).twoFactor?(p(),g("button",{key:1,class:"btn-ghost",onClick:Ka},"Disable")):D("",!0)]),ei.value?(p(),g("div",v_,[r("div",__,[f[116]||(f[116]=r("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[r("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[r("rect",{width:"100",height:"100",fill:"#fff"}),r("g",{fill:"#0F1E3D"},[r("rect",{x:"6",y:"6",width:"24",height:"24"}),r("rect",{x:"70",y:"6",width:"24",height:"24"}),r("rect",{x:"6",y:"70",width:"24",height:"24"}),r("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"40",y:"10",width:"8",height:"8"}),r("rect",{x:"52",y:"20",width:"8",height:"8"}),r("rect",{x:"40",y:"40",width:"8",height:"8"}),r("rect",{x:"60",y:"44",width:"8",height:"8"}),r("rect",{x:"44",y:"60",width:"8",height:"8"}),r("rect",{x:"70",y:"60",width:"8",height:"8"}),r("rect",{x:"80",y:"72",width:"8",height:"8"}),r("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),r("div",b_,[f[115]||(f[115]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",y_,k(Gs.value),1),r("div",x_,[re(r("input",{"onUpdate:modelValue":f[46]||(f[46]=S=>Hi.value=S),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[Se,Hi.value]]),r("button",{class:"btn-accent",onClick:xn},"Verify & enable")]),ji.value?(p(),g("p",w_,k(ji.value),1)):D("",!0)])])])):D("",!0),Oe(ve).twoFactor&&ko.value.length?(p(),g("div",k_,[f[117]||(f[117]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[118]||(f[118]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",S_,[(p(!0),g(ue,null,Be(ko.value,S=>(p(),g("span",{key:S,class:"select-all"},k(S),1))),128))])])):D("",!0),f[119]||(f[119]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),E(Ae,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:Pe(()=>[r("div",T_,[r("div",P_,[r("div",C_,[E(X,{name:"monitor",size:18})]),r("div",L_,[r("div",M_,[$(k(Rn())+" on "+k(qs())+" ",1),f[120]||(f[120]=r("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),r("div",A_,"Signed in "+k(Oe(fu)(Oe(Ys))),1)]),r("button",{class:"btn-ghost",onClick:f[47]||(f[47]=S=>l("logout"))},"Log out")])]),f[121]||(f[121]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[122]||(f[122]=r("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):j.id==="team"?(p(),g("div",E_,[st.id?(p(),g("div",O_,[E(Ae,{block:"",title:`Edit user — ${st.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:Pe(()=>[r("div",z_,[r("div",I_,[re(r("input",{"onUpdate:modelValue":f[48]||(f[48]=S=>st.email=S),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[Se,st.email]]),re(r("select",{"onUpdate:modelValue":f[49]||(f[49]=S=>st.role=S),class:"field w-32",disabled:Xi.value,title:Xi.value?"You cannot change your own role":""},[(p(!0),g(ue,null,Be(Js.value,S=>(p(),g("option",{key:S.value,value:S.value},k(S.label),9,N_))),128))],8,$_),[[Mt,st.role]])]),u.value?re((p(),g("select",{key:0,"onUpdate:modelValue":f[50]||(f[50]=S=>st.organization=S),class:"field",title:"Organization"},[(p(!0),g(ue,null,Be(Yi.value,S=>(p(),g("option",{key:S.value,value:S.value},k(S.label),9,D_))),128))],512)),[[Mt,st.organization]]):D("",!0),re(r("input",{"onUpdate:modelValue":f[51]||(f[51]=S=>st.password=S),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[Se,st.password]]),r("label",F_,[E(un,{modelValue:st.verified,"onUpdate:modelValue":f[52]||(f[52]=S=>st.verified=S)},null,8,["modelValue"]),f[123]||(f[123]=$(" Email verified ",-1))]),r("div",R_,[r("button",{class:"btn-accent",disabled:Po.value,onClick:Ga},k(Po.value?"Saving…":"Save changes"),9,B_),r("button",{class:"btn-ghost",onClick:Xs},"Cancel"),On.value?(p(),g("span",U_,k(On.value),1)):D("",!0),Xi.value?(p(),g("span",V_,"Editing your own account — role locked.")):D("",!0)])])]),_:1},8,["title"])])):(p(),g("div",Z_,[E(Ae,{block:"",title:"Add user",desc:"Create a new account. Admins add users within their organization; superadmins can target any.",keywords:"add user create account role admin organization"},{default:Pe(()=>[r("div",H_,[r("div",j_,[re(r("input",{"onUpdate:modelValue":f[53]||(f[53]=S=>Ct.email=S),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[Se,Ct.email]]),re(r("select",{"onUpdate:modelValue":f[54]||(f[54]=S=>Ct.role=S),class:"field w-32"},[(p(!0),g(ue,null,Be(Js.value,S=>(p(),g("option",{key:S.value,value:S.value},k(S.label),9,W_))),128))],512),[[Mt,Ct.role]])]),u.value?re((p(),g("select",{key:0,"onUpdate:modelValue":f[55]||(f[55]=S=>Ct.organization=S),class:"field",title:"Organization"},[(p(!0),g(ue,null,Be(Yi.value,S=>(p(),g("option",{key:S.value,value:S.value},k(S.label),9,K_))),128))],512)),[[Mt,Ct.organization]]):(p(),g("div",G_,[f[124]||(f[124]=$(" New users join your organization: ",-1)),r("span",q_,k(t.organizationName||"—"),1)])),re(r("input",{"onUpdate:modelValue":f[56]||(f[56]=S=>Ct.password=S),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[Se,Ct.password]]),r("div",Y_,[r("button",{class:"btn-accent",disabled:So.value,onClick:Ji},k(So.value?"Creating…":"Create user"),9,J_),Ti.value?(p(),g("span",X_,k(Ti.value),1)):D("",!0)])])]),_:1})])),r("div",Q_,[r("div",e1,[f[125]||(f[125]=r("div",null,[r("div",{class:"eyebrow"},"Team"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),r("button",{class:"btn-ghost",disabled:Ki.value,onClick:an},k(Ki.value?"Loading…":"Refresh"),9,t1)]),Gi.value?(p(),g("div",n1,k(Gi.value),1)):!Si.value.length&&!Ki.value?(p(),g("div",i1,"No users yet.")):(p(),g("div",o1,[r("table",s1,[r("thead",null,[r("tr",a1,[(p(),g(ue,null,Be(["User","Role","Organization","Status",""],S=>r("th",{key:S,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(S),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Be(Si.value,S=>(p(),g("tr",{key:S.id,class:Ee(["border-b border-line last:border-0",st.id===S.id?"bg-accent-soft":""])},[r("td",r1,[r("span",l1,k(S.email),1),S.email===t.email?(p(),g("span",u1,"(you)")):D("",!0)]),r("td",c1,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(S.role||"user")])},[E(X,{name:v(S.role||"user"),size:12},null,8,["name"]),$(k(h(S.role||"user")),1)],2)]),r("td",d1,[r("span",{class:Ee(["text-sm",S.organizationName?"text-ink-secondary":"text-ink-muted"])},k(S.organizationName||"—"),3)]),r("td",f1,[r("span",{class:Ee(["text-xs",S.verified?"text-success-fg":"text-ink-muted"])},k(S.verified?"Verified":"Unverified"),3)]),r("td",h1,[ti.value===S.id?(p(),g(ue,{key:0},[f[126]||(f[126]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[57]||(f[57]=Xe=>ti.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Xe=>rn(S)}," Remove ",8,p1)],64)):(p(),g("div",m1,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Xe=>rs(S)},[E(X,{name:"settings",size:14}),f[127]||(f[127]=$(" Edit ",-1))],8,g1),S.email!==t.email?(p(),g("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Xe=>ti.value=S.id},[E(X,{name:"trash",size:14}),f[128]||(f[128]=$(" Remove ",-1))],8,v1)):D("",!0)]))])],2))),128))])])]))])])):j.id==="organizations"?(p(),g("div",_1,[zn.id?(p(),g("div",b1,[E(Ae,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:Pe(()=>[r("div",y1,[re(r("input",{"onUpdate:modelValue":f[58]||(f[58]=S=>zn.name=S),class:"field",placeholder:"Organization name",onKeyup:iu(us,["enter"])},null,544),[[Se,zn.name]]),r("div",x1,[r("button",{class:"btn-accent",onClick:us},"Save changes"),r("button",{class:"btn-ghost",onClick:Ci},"Cancel"),Bt.value?(p(),g("span",w1,k(Bt.value),1)):D("",!0)])])]),_:1})])):(p(),g("div",k1,[E(Ae,{block:"",title:"Add organization",desc:"Create a new organization. Assign admins and users to it from User management.",keywords:"add organization create tenant company"},{default:Pe(()=>[r("div",S1,[re(r("input",{"onUpdate:modelValue":f[59]||(f[59]=S=>Qi.name=S),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:iu(ni,["enter"])},null,544),[[Se,Qi.name]]),r("div",T1,[r("button",{class:"btn-accent",disabled:Ht.value,onClick:ni},k(Ht.value?"Creating…":"Create organization"),9,P1),eo.value?(p(),g("span",C1,k(eo.value),1)):D("",!0)])])]),_:1})])),r("div",L1,[r("div",{class:"flex items-center justify-between px-5 py-4"},[f[129]||(f[129]=r("div",null,[r("div",{class:"eyebrow"},"Tenancy"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),r("button",{class:"btn-ghost",onClick:Pi},"Refresh")]),qi.value.length?(p(),g("div",A1,[r("table",E1,[r("thead",null,[r("tr",O1,[(p(),g(ue,null,Be(["Organization","Members",""],S=>r("th",{key:S,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(S),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Be(qi.value,S=>(p(),g("tr",{key:S.id,class:Ee(["border-b border-line last:border-0",zn.id===S.id?"bg-accent-soft":""])},[r("td",z1,[r("span",I1,[E(X,{name:"grid",size:14,class:"text-ink-muted"}),$(k(S.name),1)])]),r("td",$1,k(ls.value[S.id]||0),1),r("td",N1,[wn.value===S.id?(p(),g(ue,{key:0},[f[130]||(f[130]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[60]||(f[60]=Xe=>wn.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Xe=>Co(S)}," Delete ",8,D1)],64)):(p(),g("div",F1,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Xe=>qa(S)},[E(X,{name:"settings",size:14}),f[131]||(f[131]=$(" Rename ",-1))],8,R1),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(ls.value[S.id]||0)>0,title:(ls.value[S.id]||0)>0?"Reassign or remove members first":"",onClick:Xe=>wn.value=S.id},[E(X,{name:"trash",size:14}),f[132]||(f[132]=$(" Delete ",-1))],8,B1)]))])],2))),128))])])])):(p(),g("div",M1,"No organizations yet."))])])):j.id==="advanced"?(p(),g("div",U1,[r("div",V1,[E(Ae,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:Pe(()=>[r("button",{class:"btn-ghost",onClick:Ya},[E(X,{name:"download",size:15,class:"mr-1.5 inline"}),f[133]||(f[133]=$("Export",-1))])]),_:1}),E(Ae,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:Pe(()=>[r("label",Z1,[E(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[134]||(f[134]=$("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Lo},null,32)]),hn.value?(p(),g("p",H1,k(hn.value),1)):D("",!0)]),_:1})]),r("div",j1,[r("div",W1,[E(X,{name:"alertTriangle",size:18}),f[135]||(f[135]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[140]||(f[140]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",K1,[f[139]||(f[139]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",G1,[re(r("input",{"onUpdate:modelValue":f[61]||(f[61]=S=>_t.understand=S),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[Sa,_t.understand]]),f[136]||(f[136]=$(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",q1,[r("label",Y1,[f[137]||(f[137]=$("Type ",-1)),r("span",J1,k(cs.value),1),f[138]||(f[138]=$(" to confirm",-1))]),re(r("input",{"onUpdate:modelValue":f[62]||(f[62]=S=>_t.typed=S),class:"field w-full max-w-[360px] font-mono",placeholder:cs.value},null,8,X1),[[Se,_t.typed]])]),r("div",Q1,[_t.armed?(p(),g("button",{key:1,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50",disabled:_t.cooldown>0,onClick:Li},k(_t.cooldown>0?`Confirm in ${_t.cooldown}s…`:"Permanently delete account"),9,tb)):(p(),g("button",{key:0,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40",disabled:!pn.value,onClick:Ja}," Delete account… ",8,eb)),_t.armed&&_t.cooldown>0?(p(),g("span",nb,"Cooling-off period — read once more.")):D("",!0)]),_t.msg?(p(),g("p",ib,k(_t.msg),1)):D("",!0)])])])):D("",!0)],64))),128))])]),E(mh,{name:"fade"},{default:Pe(()=>[Vi.value?(p(),g("div",ob,[E(X,{name:"check",size:16,class:"text-success-fg"}),$(k(Vi.value),1)])):D("",!0)]),_:1})]))}},ab=_m(sb,[["__scopeId","data-v-977256e5"]]),rb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},lb={class:"flex flex-wrap items-center gap-3"},ub={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},cb=["onClick"],db={class:"ml-auto flex items-center gap-2"},fb=["href"],hb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},pb={class:"eyebrow"},mb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},gb={key:0,class:"panel p-5"},vb={class:"mb-4 flex items-center justify-between"},_b={class:"eyebrow"},bb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},yb={class:"block"},xb={class:"block"},wb={class:"block"},kb={class:"block"},Sb={key:0,value:""},Tb=["value"],Pb={class:"block"},Cb={class:"block"},Lb={class:"block"},Mb={class:"block"},Ab={class:"block"},Eb=["value"],Ob={class:"block"},zb=["value"],Ib={class:"block"},$b=["value"],Nb={class:"block"},Db={class:"mt-3 block"},Fb={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},Rb={class:"block"},Bb={class:"block"},Ub={class:"block"},Vb={class:"block"},Zb={class:"col-span-2 block max-[760px]:col-span-1"},Hb={class:"mt-4 flex items-center gap-3"},jb=["disabled"],Wb={key:0,class:"text-sm text-danger-fg"},Kb={class:"panel overflow-hidden p-0"},Gb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},qb={key:1,class:"grid place-items-center px-5 py-16 text-center"},Yb={key:2,class:"overflow-x-auto"},Jb={class:"w-full border-collapse text-sm"},Xb={class:"text-left"},Qb={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},ey={key:0,class:"text-ink-muted"},ty={class:"px-5 py-3 text-ink-secondary"},ny=["title"],iy={class:"px-5 py-3 font-mono text-ink-secondary"},oy={class:"px-5 py-3 text-ink-secondary"},sy={class:"px-5 py-3"},ay=["onClick"],ry={class:"whitespace-nowrap px-5 py-3 text-right"},ly=["onClick"],uy=["onClick"],cy=["onClick"],dy={key:0,class:"border-b border-line bg-surface-2"},fy={colspan:"7",class:"px-5 py-3"},hy={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},py={class:"text-ink-secondary"},my={class:"text-ink"},gy={class:"text-ink-secondary"},vy={class:"text-ink"},_y={class:"text-ink-secondary"},by={class:"font-mono text-ink"},yy={key:0,class:"text-ink-secondary"},xy={class:"text-ink"},wy={key:0,class:"mt-2 space-y-1"},ky={key:1,class:"mt-2 text-xs text-success-fg"},Sy={key:0,class:"panel p-5"},Ty={class:"mb-4 flex items-center justify-between"},Py={class:"eyebrow"},Cy={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Ly={class:"block"},My={class:"block"},Ay={class:"block"},Ey={class:"block"},Oy={class:"block"},zy={class:"block"},Iy=["value"],$y={class:"mt-3 flex flex-wrap gap-6"},Ny={class:"flex items-center gap-2 text-sm text-ink-secondary"},Dy={class:"flex items-center gap-2 text-sm text-ink-secondary"},Fy={class:"mt-4 flex items-center gap-3"},Ry=["disabled"],By={key:0,class:"text-sm text-danger-fg"},Uy={class:"panel overflow-hidden p-0"},Vy={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Zy={key:1,class:"grid place-items-center px-5 py-16 text-center"},Hy={key:2,class:"overflow-x-auto"},jy={class:"w-full border-collapse text-sm"},Wy={class:"text-left"},Ky={class:"px-5 py-3 font-semibold text-ink"},Gy={class:"px-5 py-3 text-ink-secondary"},qy={class:"px-5 py-3 font-mono text-ink-secondary"},Yy={class:"px-5 py-3"},Jy={key:1,class:"text-ink-muted"},Xy={class:"px-5 py-3"},Qy={class:"whitespace-nowrap px-5 py-3 text-right"},ex=["onClick"],tx=["onClick"],nx=["onClick"],ix={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i=t,s={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},l=W("flights"),u=W([]),d=W([]),h=W(!1),v=W("");async function b(){h.value=!0,v.value="";const[Y,A]=await Promise.all([Rc(),kp()]);(!Y.ok||!A.ok)&&(v.value=Y.status===503||A.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=Y.drones,d.value=A.flights,h.value=!1}hi(b);function C(Y){const A=Y.compliance||{};return A.exempt?{tone:"neutral",label:"Exempt"}:(A.redFlags||[]).length?{tone:"danger",label:`${A.redFlags.length} issue${A.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const T=W("");function M(Y){T.value=T.value===Y?"":Y}const R=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],B=[{value:"commercial",label:"Commercial"},{value:"research",label:"Research"},{value:"public",label:"Public-benefit"},{value:"hobby",label:"Private hobby"},{value:"club_area",label:"Model-club area"}],Z=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function F(){var Y;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((Y=u.value[0])==null?void 0:Y.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const he=W(!1),pe=W(""),q=kt(F()),Te=W(""),fe=W(!1),Ue=W(!1);function $e(){Object.assign(q,F()),pe.value="",Te.value="",Ue.value=!1,he.value=!0}function Ie(Y){Object.assign(q,{operationDate:(Y.operationDate||"").slice(0,10),startTime:Y.startTime||"",endTime:Y.endTime||"",drone:Y.drone||"",areaRoute:Y.areaRoute||"",maxAltitudeAgl:Y.maxAltitudeAgl||"",pilotName:Y.pilotName||"",certificateRef:Y.certificateRef||"",category:Y.category||"open",purpose:Y.purpose||"commercial",loggingPath:Y.loggingPath||"",rawFdrLogUrl:Y.rawFdrLogUrl||"",authorisationRef:Y.authorisationRef||"",weather:Y.weather||"",airspaceRef:Y.airspaceRef||"",observer:Y.observer||"",incidents:Y.incidents||"",notes:Y.notes||""}),pe.value=Y.id,Te.value="",Ue.value=!!(Y.weather||Y.airspaceRef||Y.observer||Y.incidents||Y.notes),he.value=!0}function Ge(){he.value=!1,pe.value=""}async function _e(){var z;if(Te.value="",!q.drone){Te.value="Select a drone first (add one on the Drones tab).";return}fe.value=!0;const Y={...q,maxAltitudeAgl:Number(q.maxAltitudeAgl)||0},A=pe.value?await Tp(pe.value,Y):await Sp(Y);if(fe.value=!1,!A.ok){Te.value=((z=A.body)==null?void 0:z.error)||"Could not save the flight.";return}he.value=!1,await b()}const ye=W("");async function ze(Y){const A=await Pp(Y.id);ye.value="",A.ok&&await b()}const ne=["","C0","C1","C2","C3","C4","C5","C6"];function je(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const ie=W(!1),We=W(""),le=kt(je()),ce=W(""),se=W(!1);function ot(){Object.assign(le,je()),We.value="",ce.value="",ie.value=!0}function ee(Y){Object.assign(le,{name:Y.name||"",model:Y.model||"",serial:Y.serial||"",operatorNumber:Y.operatorNumber||"",mtomGrams:Y.mtomGrams||"",isToy:!!Y.isToy,autologsFlights:!!Y.autologsFlights,cClass:Y.cClass||""}),We.value=Y.id,ce.value="",ie.value=!0}function be(){ie.value=!1,We.value=""}async function Ne(){var z;if(ce.value="",!le.name.trim()){ce.value="Give the drone a name.";return}se.value=!0;const Y={...le,mtomGrams:Number(le.mtomGrams)||0},A=We.value?await xp(We.value,Y):await yp(Y);if(se.value=!1,!A.ok){ce.value=((z=A.body)==null?void 0:z.error)||"Could not save the drone.";return}ie.value=!1,await b()}const dt=W("");async function at(Y){var z;const A=await wp(Y.id);dt.value="",A.ok?await b():ce.value=((z=A.body)==null?void 0:z.error)||"Could not delete the drone."}const Ze=we(()=>{const Y=d.value.length,A=d.value.filter(gt=>{var ut;return(((ut=gt.compliance)==null?void 0:ut.redFlags)||[]).length}).length,z=d.value.filter(gt=>{var ut;return(ut=gt.compliance)==null?void 0:ut.required}).length;return{total:Y,flagged:A,required:z,fleet:u.value.length}});return(Y,A)=>(p(),g("div",rb,[r("div",lb,[r("div",ub,[(p(),g(ue,null,Be([["flights","Flights"],["drones","Drones"]],z=>r("button",{key:z[0],class:Ee(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===z[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:gt=>l.value=z[0]},k(z[1]),11,cb)),64))]),r("div",db,[r("a",{href:Oe(Cp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[E(X,{name:"download",size:15}),A[29]||(A[29]=$(" Export CSV ",-1))],8,fb),l.value==="flights"?(p(),g("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:$e},[E(X,{name:"plus",size:15}),A[30]||(A[30]=$(" Log flight ",-1))])):(p(),g("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:ot},[E(X,{name:"plus",size:15}),A[31]||(A[31]=$(" Add drone ",-1))]))])]),r("div",hb,[(p(!0),g(ue,null,Be([{label:"Flights logged",value:Ze.value.total,tone:"neutral"},{label:"Require logbook",value:Ze.value.required,tone:"neutral"},{label:"Compliance flags",value:Ze.value.flagged,tone:Ze.value.flagged?"danger":"success"},{label:"Registered drones",value:Ze.value.fleet,tone:"neutral"}],z=>(p(),g("div",{key:z.label,class:"panel p-5"},[r("div",pb,k(z.label),1),r("div",{class:Ee(["mt-2 text-[30px] font-bold leading-none tracking-tightest",z.tone==="danger"?"text-danger-fg":z.tone==="success"?"text-success-fg":"text-ink"])},k(z.value),3)]))),128))]),v.value?(p(),g("div",mb,k(v.value),1)):D("",!0),l.value==="flights"?(p(),g(ue,{key:1},[he.value?(p(),g("div",gb,[r("div",vb,[r("div",null,[r("div",_b,k(pe.value?"Edit entry":"New entry"),1),A[32]||(A[32]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),r("button",{class:"btn-icon",onClick:Ge},[E(X,{name:"x",size:16})])]),r("div",bb,[r("label",yb,[A[33]||(A[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),re(r("input",{"onUpdate:modelValue":A[0]||(A[0]=z=>q.operationDate=z),type:"date",class:"field"},null,512),[[Se,q.operationDate]])]),r("label",xb,[A[34]||(A[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),re(r("input",{"onUpdate:modelValue":A[1]||(A[1]=z=>q.startTime=z),type:"time",class:"field"},null,512),[[Se,q.startTime]])]),r("label",wb,[A[35]||(A[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),re(r("input",{"onUpdate:modelValue":A[2]||(A[2]=z=>q.endTime=z),type:"time",class:"field"},null,512),[[Se,q.endTime]])]),r("label",kb,[A[36]||(A[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),re(r("select",{"onUpdate:modelValue":A[3]||(A[3]=z=>q.drone=z),class:"field"},[u.value.length?D("",!0):(p(),g("option",Sb,"— add a drone first —")),(p(!0),g(ue,null,Be(u.value,z=>(p(),g("option",{key:z.id,value:z.id},k(z.name)+k(z.model?` · ${z.model}`:""),9,Tb))),128))],512),[[Mt,q.drone]])]),r("label",Pb,[A[37]||(A[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),re(r("input",{"onUpdate:modelValue":A[4]||(A[4]=z=>q.maxAltitudeAgl=z),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[Se,q.maxAltitudeAgl]])]),r("label",Cb,[A[38]||(A[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),re(r("input",{"onUpdate:modelValue":A[5]||(A[5]=z=>q.areaRoute=z),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[Se,q.areaRoute]])]),r("label",Lb,[A[39]||(A[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),re(r("input",{"onUpdate:modelValue":A[6]||(A[6]=z=>q.pilotName=z),class:"field",placeholder:"Full name"},null,512),[[Se,q.pilotName]])]),r("label",Mb,[A[40]||(A[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),re(r("input",{"onUpdate:modelValue":A[7]||(A[7]=z=>q.certificateRef=z),class:"field",placeholder:"A2 / STS cert no."},null,512),[[Se,q.certificateRef]])]),r("label",Ab,[A[41]||(A[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),re(r("select",{"onUpdate:modelValue":A[8]||(A[8]=z=>q.loggingPath=z),class:"field"},[(p(),g(ue,null,Be(Z,z=>r("option",{key:z.value,value:z.value},k(z.label),9,Eb)),64))],512),[[Mt,q.loggingPath]])]),r("label",Ob,[A[42]||(A[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),re(r("select",{"onUpdate:modelValue":A[9]||(A[9]=z=>q.category=z),class:"field"},[(p(),g(ue,null,Be(R,z=>r("option",{key:z.value,value:z.value},k(z.label),9,zb)),64))],512),[[Mt,q.category]])]),r("label",Ib,[A[43]||(A[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),re(r("select",{"onUpdate:modelValue":A[10]||(A[10]=z=>q.purpose=z),class:"field"},[(p(),g(ue,null,Be(B,z=>r("option",{key:z.value,value:z.value},k(z.label),9,$b)),64))],512),[[Mt,q.purpose]])]),r("label",Nb,[A[44]||(A[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),re(r("input",{"onUpdate:modelValue":A[11]||(A[11]=z=>q.authorisationRef=z),class:"field",placeholder:"Specific-category ref"},null,512),[[Se,q.authorisationRef]])])]),r("label",Db,[A[45]||(A[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),re(r("input",{"onUpdate:modelValue":A[12]||(A[12]=z=>q.rawFdrLogUrl=z),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[Se,q.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:A[13]||(A[13]=z=>Ue.value=!Ue.value)},[E(X,{name:Ue.value?"x":"plus",size:14},null,8,["name"]),A[46]||(A[46]=$(" Operational details (weather, airspace, incidents) ",-1))]),Ue.value?(p(),g("div",Fb,[r("label",Rb,[A[47]||(A[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),re(r("input",{"onUpdate:modelValue":A[14]||(A[14]=z=>q.weather=z),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[Se,q.weather]])]),r("label",Bb,[A[48]||(A[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),re(r("input",{"onUpdate:modelValue":A[15]||(A[15]=z=>q.airspaceRef=z),class:"field"},null,512),[[Se,q.airspaceRef]])]),r("label",Ub,[A[49]||(A[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),re(r("input",{"onUpdate:modelValue":A[16]||(A[16]=z=>q.observer=z),class:"field"},null,512),[[Se,q.observer]])]),r("label",Vb,[A[50]||(A[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),re(r("input",{"onUpdate:modelValue":A[17]||(A[17]=z=>q.incidents=z),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[Se,q.incidents]])]),r("label",Zb,[A[51]||(A[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":A[18]||(A[18]=z=>q.notes=z),rows:"2",class:"field"},null,512),[[Se,q.notes]])])])):D("",!0),r("div",Hb,[r("button",{class:"btn-accent",disabled:fe.value,onClick:_e},k(fe.value?"Saving…":pe.value?"Save changes":"Log flight"),9,jb),r("button",{class:"btn-ghost",onClick:Ge},"Cancel"),Te.value?(p(),g("span",Wb,k(Te.value),1)):D("",!0)])])):D("",!0),r("div",Kb,[h.value?(p(),g("div",Gb,"Loading…")):d.value.length?(p(),g("div",Yb,[r("table",Jb,[r("thead",null,[r("tr",Xb,[(p(),g(ue,null,Be(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],z=>r("th",{key:z,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(z),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Be(d.value,z=>{var gt,ut,wt,y;return p(),g(ue,{key:z.id},[r("tr",{class:Ee(["border-b border-line last:border-0",pe.value===z.id?"bg-accent-soft":""])},[r("td",Qb,[$(k((z.operationDate||"").slice(0,10))+" ",1),z.startTime?(p(),g("span",ey,k(z.startTime),1)):D("",!0)]),r("td",ty,k(z.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:z.areaRoute},k(z.areaRoute||"—"),9,ny),r("td",iy,k(z.maxAltitudeAgl?z.maxAltitudeAgl+" m":"—"),1),r("td",oy,k(z.pilotName||"—"),1),r("td",sy,[r("button",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",s[C(z).tone]]),onClick:_=>M(z.id)},[C(z).tone==="danger"?(p(),lt(X,{key:0,name:"alertTriangle",size:12})):C(z).tone==="success"?(p(),lt(X,{key:1,name:"check",size:12})):D("",!0),$(" "+k(C(z).label),1)],10,ay)]),r("td",ry,[ye.value===z.id?(p(),g(ue,{key:0},[A[54]||(A[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:A[19]||(A[19]=_=>ye.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:_=>ze(z)},"Delete",8,ly)],64)):(p(),g(ue,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:_=>Ie(z)},[E(X,{name:"sliders",size:13}),A[55]||(A[55]=$(" Edit",-1))],8,uy),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:_=>ye.value=z.id},[E(X,{name:"trash",size:13})],8,cy)],64))])],2),T.value===z.id?(p(),g("tr",dy,[r("td",fy,[r("div",hy,[r("span",py,[A[56]||(A[56]=$("Logging path: ",-1)),r("b",my,k(((gt=z.compliance)==null?void 0:gt.loggingPath)||"—"),1)]),r("span",gy,[A[57]||(A[57]=$("Category: ",-1)),r("b",vy,k(z.category||"—"),1)]),r("span",_y,[A[58]||(A[58]=$("Retain until: ",-1)),r("b",by,k((z.retentionUntil||"").slice(0,10)||"—"),1)]),(ut=z.compliance)!=null&&ut.exempt?(p(),g("span",yy,[A[59]||(A[59]=$("Exempt: ",-1)),r("b",xy,k(z.compliance.exemptReason),1)])):D("",!0)]),(((wt=z.compliance)==null?void 0:wt.redFlags)||[]).length?(p(),g("ul",wy,[(p(!0),g(ue,null,Be(z.compliance.redFlags,(_,w)=>(p(),g("li",{key:w,class:"flex items-start gap-2 text-xs text-danger-fg"},[E(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+k(_),1)]))),128))])):(y=z.compliance)!=null&&y.exempt?D("",!0):(p(),g("div",ky,"No compliance gaps detected."))])])):D("",!0)],64)}),128))])])])):(p(),g("div",qb,[E(X,{name:"book",size:26,class:"text-ink-muted"}),A[52]||(A[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),A[53]||(A[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(p(),g(ue,{key:2},[ie.value?(p(),g("div",Sy,[r("div",Ty,[r("div",null,[r("div",Py,k(We.value?"Edit drone":"New drone"),1),A[60]||(A[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:be},[E(X,{name:"x",size:16})])]),r("div",Cy,[r("label",Ly,[A[61]||(A[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),re(r("input",{"onUpdate:modelValue":A[20]||(A[20]=z=>le.name=z),class:"field",placeholder:"Mavic-01"},null,512),[[Se,le.name]])]),r("label",My,[A[62]||(A[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),re(r("input",{"onUpdate:modelValue":A[21]||(A[21]=z=>le.model=z),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[Se,le.model]])]),r("label",Ay,[A[63]||(A[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),re(r("input",{"onUpdate:modelValue":A[22]||(A[22]=z=>le.serial=z),class:"field"},null,512),[[Se,le.serial]])]),r("label",Ey,[A[64]||(A[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),re(r("input",{"onUpdate:modelValue":A[23]||(A[23]=z=>le.operatorNumber=z),class:"field",placeholder:"DNK…"},null,512),[[Se,le.operatorNumber]])]),r("label",Oy,[A[65]||(A[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),re(r("input",{"onUpdate:modelValue":A[24]||(A[24]=z=>le.mtomGrams=z),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[Se,le.mtomGrams]])]),r("label",zy,[A[66]||(A[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),re(r("select",{"onUpdate:modelValue":A[25]||(A[25]=z=>le.cClass=z),class:"field"},[(p(),g(ue,null,Be(ne,z=>r("option",{key:z,value:z},k(z||"— none —"),9,Iy)),64))],512),[[Mt,le.cClass]])])]),r("div",$y,[r("label",Ny,[re(r("input",{"onUpdate:modelValue":A[26]||(A[26]=z=>le.autologsFlights=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Sa,le.autologsFlights]]),A[67]||(A[67]=$(" Auto-logs flights (onboard FDR) ",-1))]),r("label",Dy,[re(r("input",{"onUpdate:modelValue":A[27]||(A[27]=z=>le.isToy=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Sa,le.isToy]]),A[68]||(A[68]=$(" Toy drone (logbook-exempt) ",-1))])]),r("div",Fy,[r("button",{class:"btn-accent",disabled:se.value,onClick:Ne},k(se.value?"Saving…":We.value?"Save changes":"Add drone"),9,Ry),r("button",{class:"btn-ghost",onClick:be},"Cancel"),ce.value?(p(),g("span",By,k(ce.value),1)):D("",!0)])])):D("",!0),r("div",Uy,[h.value?(p(),g("div",Vy,"Loading…")):u.value.length?(p(),g("div",Hy,[r("table",jy,[r("thead",null,[r("tr",Wy,[(p(),g(ue,null,Be(["Name","Model","MTOM","Class","FDR",""],z=>r("th",{key:z,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(z),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Be(u.value,z=>(p(),g("tr",{key:z.id,class:Ee(["border-b border-line last:border-0",We.value===z.id?"bg-accent-soft":""])},[r("td",Ky,k(z.name),1),r("td",Gy,k(z.model||"—"),1),r("td",qy,k(z.mtomGrams?z.mtomGrams+" g":"—"),1),r("td",Yy,[z.cClass?(p(),g("span",{key:0,class:Ee(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.accent])},k(z.cClass),3)):(p(),g("span",Jy,"—")),z.isToy?(p(),g("span",{key:2,class:Ee(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.neutral])},"toy",2)):D("",!0)]),r("td",Xy,[r("span",{class:Ee(["text-xs",z.autologsFlights?"text-success-fg":"text-ink-muted"])},k(z.autologsFlights?"yes":"no"),3)]),r("td",Qy,[dt.value===z.id?(p(),g(ue,{key:0},[A[71]||(A[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:A[28]||(A[28]=gt=>dt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:gt=>at(z)},"Delete",8,ex)],64)):(p(),g(ue,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:gt=>ee(z)},[E(X,{name:"sliders",size:13}),A[72]||(A[72]=$(" Edit",-1))],8,tx),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:gt=>dt.value=z.id},[E(X,{name:"trash",size:13})],8,nx)],64))])],2))),128))])])])):(p(),g("div",Zy,[E(X,{name:"drone",size:26,class:"text-ink-muted"}),A[69]||(A[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),A[70]||(A[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},ox={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},sx={class:"flex flex-wrap items-center gap-3"},ax={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},rx=["onClick"],lx={class:"ml-auto"},ux={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},cx={class:"eyebrow"},dx={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},fx={key:1,class:"panel p-5"},hx={class:"mb-4 flex items-center justify-between"},px={class:"eyebrow"},mx={class:"mt-0.5 text-base font-semibold text-ink"},gx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},vx={class:"col-span-2 block max-[760px]:col-span-1"},_x={class:"block"},bx=["value"],yx={class:"block"},xx=["value"],wx={class:"block"},kx=["value"],Sx={class:"block"},Tx={class:"block"},Px={class:"block"},Cx={class:"block"},Lx=["value"],Mx={class:"block"},Ax={class:"block"},Ex={class:"block"},Ox=["value"],zx={class:"mt-3 block"},Ix={key:0,class:"mt-3"},$x={class:"eyebrow mb-1 block"},Nx={key:1,class:"mt-3 text-xs text-ink-muted"},Dx={class:"mt-4 flex items-center gap-3"},Fx=["disabled"],Rx={key:0,class:"text-sm text-danger-fg"},Bx={class:"panel overflow-hidden p-0"},Ux={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Vx={key:1,class:"grid place-items-center px-5 py-16 text-center"},Zx={class:"mt-3 text-sm font-medium text-ink-secondary"},Hx={class:"mt-1 text-xs text-ink-muted"},jx={key:2,class:"overflow-x-auto"},Wx={class:"w-full border-collapse text-sm"},Kx={class:"text-left"},Gx={class:"px-5 py-3"},qx={class:"font-semibold text-ink"},Yx={key:0,class:"font-mono text-[11px] text-ink-muted"},Jx={class:"px-5 py-3 text-ink-secondary"},Xx={class:"px-5 py-3 text-ink-secondary"},Qx={class:"px-5 py-3"},e0=["onClick"],t0={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},n0={class:"px-5 py-3 font-mono text-ink-secondary"},i0={class:"whitespace-nowrap px-5 py-3 text-right"},o0=["onClick"],s0=["onClick"],a0=["href"],r0=["onClick"],l0=["onClick"],u0=["onClick"],c0={key:0,class:"border-b border-line bg-surface-2"},d0={colspan:"6",class:"px-5 py-3"},f0={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},h0={class:"text-ink-secondary"},p0={class:"text-ink"},m0={class:"text-ink-secondary"},g0={class:"text-ink"},v0={key:0,class:"text-ink-secondary"},_0={class:"text-ink"},b0={key:1,class:"text-ink-secondary"},y0={class:"font-mono text-ink"},x0={key:2,class:"text-ink-secondary"},w0={class:"font-mono text-ink"},k0={class:"text-ink-secondary"},S0={class:"text-ink"},T0={key:0,class:"mt-2 space-y-1"},P0={key:1,class:"mt-2 text-xs text-success-fg"},C0={key:2,class:"mt-2 text-xs text-ink-secondary"},L0={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},M0={class:"flex items-center gap-3 border-b border-line px-5 py-3"},A0={class:"min-w-0"},E0={class:"truncate text-sm font-semibold text-ink"},O0={class:"truncate font-mono text-[11px] text-ink-muted"},z0={class:"ml-auto flex items-center gap-2"},I0=["href"],$0=["href"],N0={class:"flex-1 overflow-auto bg-surface-2"},D0=["src","alt"],F0=["src","title"],R0={key:2,class:"grid place-items-center px-6 py-16 text-center"},B0={class:"mt-1 text-xs text-ink-muted"},U0=["href"],V0={__name:"Documents",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},s=[{value:"certificate",label:"Pilot certificate"},{value:"medical",label:"Medical / training"},{value:"insurance",label:"Insurance / liability"},{value:"background_check",label:"Background check / waiver"},{value:"registration",label:"Aircraft registration"},{value:"maintenance",label:"Maintenance log"},{value:"conformity",label:"Conformity / compliance"},{value:"firmware",label:"Firmware / software"},{value:"incident",label:"Incident / repair report"},{value:"flight_log",label:"Flight log"},{value:"checklist",label:"Pre-flight checklist"},{value:"airspace_auth",label:"Airspace authorisation"},{value:"mission_plan",label:"Mission plan / flight path"},{value:"risk_assessment",label:"Risk assessment / survey"},{value:"contract",label:"Contract / SOW"},{value:"client_insurance",label:"Client insurance cert"},{value:"delivery_report",label:"Delivery / media handoff"},{value:"other",label:"Other"}],l=Object.fromEntries(s.map(y=>[y.value,y.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],d=[{value:"active",label:"Active"},{value:"pending_review",label:"Pending review"},{value:"archived",label:"Archived"}],h=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],v=W([]),b=W([]),C=W(!1),T=W("");async function M(){C.value=!0,T.value="";const[y,_]=await Promise.all([Lp(),Rc()]);y.ok||(T.value=y.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),v.value=y.documents,b.value=_.drones||[],C.value=!1}hi(M);const R=W("all"),B=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],Z=we(()=>{const y=v.value;switch(R.value){case"expiring":return y.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expiring_soon"&&_.status!=="archived"});case"expired":return y.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expired"&&_.status!=="archived"});case"pending":return y.filter(_=>_.status==="pending_review");case"archived":return y.filter(_=>_.status==="archived");default:return y.filter(_=>_.status!=="archived")}});function F(y){if(y.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const _=y.expiry||{};return _.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:_.state==="expiring_soon"?{tone:"warning",label:`Expires in ${_.daysUntilExpiry}d`,icon:"clock"}:_.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const he=W("");function pe(y){he.value=he.value===y?"":y}function q(y){return y.ownerDrone?y.ownerDroneName||"Aircraft":y.ownerRef?y.ownerRef:y.ownerType==="pilot"?"Pilot":y.ownerType?y.ownerType.charAt(0).toUpperCase()+y.ownerType.slice(1):"—"}const Te=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],fe=["pdf","txt","csv","log","json","md","html","htm","xml"];function Ue(y){const _=(y||"").split(".").pop().toLowerCase();return Te.includes(_)?"image":fe.includes(_)?"frame":"none"}const $e=W(null),Ie=we(()=>$e.value?Ue($e.value.fileName):"none"),Ge=we(()=>$e.value?Op($e.value.id):"");function _e(y){$e.value=y}function ye(){$e.value=null}function ze(y){y.key==="Escape"&&$e.value&&ye()}hi(()=>window.addEventListener("keydown",ze)),Ho(()=>window.removeEventListener("keydown",ze));function ne(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const je=W(!1),ie=W(""),We=W(""),le=W(""),ce=kt(ne()),se=W(null),ot=W(null),ee=W(""),be=W(!1);function Ne(){se.value=null,ot.value&&(ot.value.value="")}function dt(){Object.assign(ce,ne()),ie.value="",We.value="",le.value="",Ne(),ee.value="",je.value=!0}function at(y){Object.assign(ce,{title:y.title||"",docType:y.docType||"certificate",ownerType:y.ownerType||"pilot",ownerDrone:y.ownerDrone||"",ownerRef:y.ownerRef||"",reference:y.reference||"",jurisdiction:y.jurisdiction||"",issueDate:y.issueDate||"",expiryDate:y.expiryDate||"",status:y.status||"active",accessTier:y.accessTier||"ops",notes:y.notes||""}),ie.value=y.id,We.value="",le.value="",Ne(),ee.value="",je.value=!0}function Ze(y){at(y),ie.value="",We.value=y.id,le.value=y.title,ce.status="active"}function Y(){je.value=!1,ie.value="",We.value=""}function A(y){var _;se.value=((_=y.target.files)==null?void 0:_[0])||null}async function z(){var _;if(ee.value="",!ce.title.trim()){ee.value="Give the document a title.";return}be.value=!0;let y;if(ie.value)y=await Ap(ie.value,{...ce});else{const w={...ce};We.value&&(w.replaces=We.value),y=await Mp(w,se.value)}if(be.value=!1,!y.ok){ee.value=((_=y.body)==null?void 0:_.error)||"Could not save the document.";return}je.value=!1,ie.value="",We.value="",await M()}const gt=W("");async function ut(y){var w;const _=await Ep(y.id);gt.value="",_.ok?await M():ee.value=((w=_.body)==null?void 0:w.error)||"Could not delete the document."}const wt=we(()=>{const y=v.value.filter(_=>_.status!=="archived");return{total:y.length,expiring:y.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expiring_soon"}).length,expired:y.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expired"}).length,pending:v.value.filter(_=>_.status==="pending_review").length}});return(y,_)=>(p(),g("div",ox,[r("div",sx,[r("div",ax,[(p(),g(ue,null,Be(B,w=>r("button",{key:w[0],class:Ee(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",R.value===w[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:K=>R.value=w[0]},k(w[1]),11,rx)),64))]),r("div",lx,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:dt},[E(X,{name:"upload",size:15}),_[13]||(_[13]=$(" Add document ",-1))])])]),r("div",ux,[(p(!0),g(ue,null,Be([{label:"Documents on file",value:wt.value.total,tone:"neutral"},{label:"Expiring soon",value:wt.value.expiring,tone:wt.value.expiring?"warning":"neutral"},{label:"Expired",value:wt.value.expired,tone:wt.value.expired?"danger":"success"},{label:"Pending review",value:wt.value.pending,tone:wt.value.pending?"accent":"neutral"}],w=>(p(),g("div",{key:w.label,class:"panel p-5"},[r("div",cx,k(w.label),1),r("div",{class:Ee(["mt-2 text-[30px] font-bold leading-none tracking-tightest",w.tone==="danger"?"text-danger-fg":w.tone==="warning"?"text-amber-fg":w.tone==="success"?"text-success-fg":w.tone==="accent"?"text-accent-soft-fg":"text-ink"])},k(w.value),3)]))),128))]),T.value?(p(),g("div",dx,k(T.value),1)):D("",!0),je.value?(p(),g("div",fx,[r("div",hx,[r("div",null,[r("div",px,k(ie.value?"Edit document":We.value?"New version":"New document"),1),r("div",mx,k(We.value?`Supersedes “${le.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:Y},[E(X,{name:"x",size:16})])]),r("div",gx,[r("label",vx,[_[14]||(_[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),re(r("input",{"onUpdate:modelValue":_[0]||(_[0]=w=>ce.title=w),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[Se,ce.title]])]),r("label",_x,[_[15]||(_[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),re(r("select",{"onUpdate:modelValue":_[1]||(_[1]=w=>ce.docType=w),class:"field"},[(p(),g(ue,null,Be(s,w=>r("option",{key:w.value,value:w.value},k(w.label),9,bx)),64))],512),[[Mt,ce.docType]])]),r("label",yx,[_[16]||(_[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),re(r("select",{"onUpdate:modelValue":_[2]||(_[2]=w=>ce.ownerType=w),class:"field"},[(p(),g(ue,null,Be(u,w=>r("option",{key:w.value,value:w.value},k(w.label),9,xx)),64))],512),[[Mt,ce.ownerType]])]),r("label",wx,[_[18]||(_[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),re(r("select",{"onUpdate:modelValue":_[3]||(_[3]=w=>ce.ownerDrone=w),class:"field"},[_[17]||(_[17]=r("option",{value:""},"— none —",-1)),(p(!0),g(ue,null,Be(b.value,w=>(p(),g("option",{key:w.id,value:w.id},k(w.name)+k(w.model?` · ${w.model}`:""),9,kx))),128))],512),[[Mt,ce.ownerDrone]])]),r("label",Sx,[_[19]||(_[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),re(r("input",{"onUpdate:modelValue":_[4]||(_[4]=w=>ce.ownerRef=w),class:"field",placeholder:"Client name / serial / site"},null,512),[[Se,ce.ownerRef]])]),r("label",Tx,[_[20]||(_[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),re(r("input",{"onUpdate:modelValue":_[5]||(_[5]=w=>ce.reference=w),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[Se,ce.reference]])]),r("label",Px,[_[21]||(_[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),re(r("input",{"onUpdate:modelValue":_[6]||(_[6]=w=>ce.jurisdiction=w),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[Se,ce.jurisdiction]])]),r("label",Cx,[_[22]||(_[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),re(r("select",{"onUpdate:modelValue":_[7]||(_[7]=w=>ce.accessTier=w),class:"field"},[(p(),g(ue,null,Be(h,w=>r("option",{key:w.value,value:w.value},k(w.label),9,Lx)),64))],512),[[Mt,ce.accessTier]])]),r("label",Mx,[_[23]||(_[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),re(r("input",{"onUpdate:modelValue":_[8]||(_[8]=w=>ce.issueDate=w),type:"date",class:"field"},null,512),[[Se,ce.issueDate]])]),r("label",Ax,[_[24]||(_[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),re(r("input",{"onUpdate:modelValue":_[9]||(_[9]=w=>ce.expiryDate=w),type:"date",class:"field"},null,512),[[Se,ce.expiryDate]])]),r("label",Ex,[_[25]||(_[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),re(r("select",{"onUpdate:modelValue":_[10]||(_[10]=w=>ce.status=w),class:"field"},[(p(),g(ue,null,Be(d,w=>r("option",{key:w.value,value:w.value},k(w.label),9,Ox)),64))],512),[[Mt,ce.status]])])]),r("label",zx,[_[26]||(_[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":_[11]||(_[11]=w=>ce.notes=w),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[Se,ce.notes]])]),ie.value?(p(),g("div",Nx,[..._[28]||(_[28]=[$(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),$(" on the document — the old version is kept for audit. ",-1)])])):(p(),g("div",Ix,[r("span",$x,"File "+k(We.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:ot,type:"file",class:"field",onChange:A},null,544),_[27]||(_[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",Dx,[r("button",{class:"btn-accent",disabled:be.value,onClick:z},k(be.value?"Saving…":ie.value?"Save changes":We.value?"Upload new version":"Add document"),9,Fx),r("button",{class:"btn-ghost",onClick:Y},"Cancel"),ee.value?(p(),g("span",Rx,k(ee.value),1)):D("",!0)])])):D("",!0),r("div",Bx,[C.value?(p(),g("div",Ux,"Loading…")):Z.value.length?(p(),g("div",jx,[r("table",Wx,[r("thead",null,[r("tr",Kx,[(p(),g(ue,null,Be(["Title","Type","Owner","Expiry","Ver",""],w=>r("th",{key:w,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(w),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Be(Z.value,w=>{var K,H;return p(),g(ue,{key:w.id},[r("tr",{class:Ee(["border-b border-line last:border-0",ie.value===w.id?"bg-accent-soft":""])},[r("td",Gx,[r("div",qx,k(w.title),1),w.reference?(p(),g("div",Yx,k(w.reference),1)):D("",!0)]),r("td",Jx,k(Oe(l)[w.docType]||w.docType||"—"),1),r("td",Xx,k(q(w)),1),r("td",Qx,[r("button",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[F(w).tone]]),onClick:V=>pe(w.id)},[F(w).icon?(p(),lt(X,{key:0,name:F(w).icon,size:12},null,8,["name"])):D("",!0),$(" "+k(F(w).label),1)],10,e0),w.expiryDate?(p(),g("div",t0,k(w.expiryDate),1)):D("",!0)]),r("td",n0,"v"+k(w.version||1),1),r("td",i0,[gt.value===w.id?(p(),g(ue,{key:0},[_[29]||(_[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:_[12]||(_[12]=V=>gt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:V=>ut(w)},"Delete",8,o0)],64)):(p(),g(ue,{key:1},[w.hasFile?(p(),g("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:V=>_e(w)},[E(X,{name:"eye",size:13})],8,s0)):D("",!0),w.hasFile?(p(),g("a",{key:1,href:Oe(hr)(w.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[E(X,{name:"download",size:13})],8,a0)):D("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:V=>Ze(w)},[E(X,{name:"upload",size:13})],8,r0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:V=>at(w)},[E(X,{name:"sliders",size:13}),_[30]||(_[30]=$(" Edit",-1))],8,l0),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:V=>gt.value=w.id},[E(X,{name:"trash",size:13})],8,u0)],64))])],2),he.value===w.id?(p(),g("tr",c0,[r("td",d0,[r("div",f0,[r("span",h0,[_[31]||(_[31]=$("Status: ",-1)),r("b",p0,k(w.status||"—"),1)]),r("span",m0,[_[32]||(_[32]=$("Access: ",-1)),r("b",g0,k(w.accessTier||"—"),1)]),w.jurisdiction?(p(),g("span",v0,[_[33]||(_[33]=$("Jurisdiction: ",-1)),r("b",_0,k(w.jurisdiction),1)])):D("",!0),w.issueDate?(p(),g("span",b0,[_[34]||(_[34]=$("Issued: ",-1)),r("b",y0,k(w.issueDate),1)])):D("",!0),w.expiryDate?(p(),g("span",x0,[_[35]||(_[35]=$("Expires: ",-1)),r("b",w0,k(w.expiryDate),1)])):D("",!0),r("span",k0,[_[36]||(_[36]=$("File: ",-1)),r("b",S0,k(w.hasFile?w.fileName:"none"),1)])]),(((K=w.expiry)==null?void 0:K.flags)||[]).length?(p(),g("ul",T0,[(p(!0),g(ue,null,Be(w.expiry.flags,(V,ae)=>(p(),g("li",{key:ae,class:Ee(["flex items-start gap-2 text-xs",w.expiry.state==="expired"?"text-danger-fg":w.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[E(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+k(V),1)],2))),128))])):((H=w.expiry)==null?void 0:H.state)==="valid"?(p(),g("div",P0,"In force — no action needed.")):D("",!0),w.notes?(p(),g("div",C0,[_[37]||(_[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),$(" "+k(w.notes),1)])):D("",!0)])])):D("",!0)],64)}),128))])])])):(p(),g("div",Vx,[E(X,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",Zx,k(R.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",Hx,k(R.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),lt(lf,{to:"body"},[$e.value?(p(),g("div",{key:0,class:"fixed inset-0 z-50 grid place-items-center p-4",style:{background:"color-mix(in srgb, black 60%, transparent)"},onClick:Kr(ye,["self"])},[r("div",L0,[r("div",M0,[r("div",A0,[r("div",E0,k($e.value.title),1),r("div",O0,k($e.value.fileName),1)]),r("div",z0,[r("a",{href:Ge.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[E(X,{name:"globe",size:14}),_[38]||(_[38]=$(" New tab ",-1))],8,I0),r("a",{href:Oe(hr)($e.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[E(X,{name:"download",size:14}),_[39]||(_[39]=$(" Download ",-1))],8,$0),r("button",{class:"btn-icon",title:"Close",onClick:ye},[E(X,{name:"x",size:16})])])]),r("div",N0,[Ie.value==="image"?(p(),g("img",{key:0,src:Ge.value,alt:$e.value.title,class:"mx-auto block max-w-full"},null,8,D0)):Ie.value==="frame"?(p(),g("iframe",{key:1,src:Ge.value,class:"h-[74vh] w-full border-0 bg-white",title:$e.value.title},null,8,F0)):(p(),g("div",R0,[E(X,{name:"fileText",size:28,class:"text-ink-muted"}),_[41]||(_[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",B0,k($e.value.fileName),1),r("a",{href:Oe(hr)($e.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[E(X,{name:"download",size:15}),_[40]||(_[40]=$(" Download instead ",-1))],8,U0)]))])])])):D("",!0)]))]))}},Z0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},H0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},j0={class:"flex items-center gap-2.5 px-2 pb-5"},W0={class:"flex flex-col gap-0.5"},K0=["onClick"],G0={class:"mt-auto flex flex-col gap-2.5"},q0={class:"rounded-lg bg-surface-2 p-3"},Y0={class:"flex items-center gap-2"},J0={class:"text-xs font-semibold text-ink"},X0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},Q0={class:"flex items-center gap-2.5 px-2 py-1"},ew={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},tw={class:"min-w-0 flex-1"},nw={class:"truncate text-[13px] font-semibold text-ink"},iw={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},ow=["title"],sw={class:"overflow-y-auto"},aw={class:"sticky top-0 z-10 flex items-center gap-4 border-b border-line px-7 py-3.5",style:{background:"color-mix(in srgb, var(--bg-app) 82%, transparent)","backdrop-filter":"blur(10px)"}},rw={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},lw={class:"ml-auto flex items-center gap-3"},uw={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},cw={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},dw={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},fw={class:"flex items-center justify-between"},hw={class:"eyebrow"},pw={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},mw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},gw={class:"panel p-5"},vw={class:"mb-3.5 flex items-center justify-between"},_w={class:"flex items-center gap-2"},bw={class:"relative z-[1200]"},yw={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},xw={class:"flex items-center justify-between gap-3"},ww={class:"mb-1.5 flex items-center justify-between"},kw={class:"font-mono text-[11px] text-ink-muted"},Sw=["value"],Tw={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},Pw={key:0,class:"mt-2.5 text-xs text-ink-muted"},Cw={key:1,class:"mt-2.5 text-xs text-ink-muted"},Lw={key:2,class:"mt-2.5 text-xs text-ink-muted"},Mw={class:"panel p-5"},Aw={class:"mb-3.5 flex items-center justify-between"},Ew={class:"grid place-items-center py-10 text-center"},Ow={class:"panel overflow-hidden p-0"},zw={class:"flex items-center justify-between px-5 py-4"},Iw={class:"flex gap-2"},$w={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Nw={key:1,class:"overflow-x-auto"},Dw={class:"w-full border-collapse text-sm"},Fw={class:"text-left"},Rw=["onClick"],Bw={class:"px-5 py-3 font-mono font-bold text-ink"},Uw={class:"px-5 py-3 text-ink-secondary"},Vw={class:"px-5 py-3"},Zw={class:"px-5 py-3 font-mono text-ink-secondary"},Hw={class:"px-5 py-3"},jw={key:0,class:"flex items-center gap-2"},Ww={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},Kw={class:"font-mono text-xs text-ink-secondary"},Gw={key:1,class:"font-mono text-xs text-ink-muted"},qw={class:"px-5 py-3 font-mono text-ink-secondary"},Yw={class:"px-5 py-3 text-right"},Jw=["onClick"],Xw={key:1,class:"p-7"},Qw={class:"mb-4 flex flex-wrap items-center gap-3"},e2={class:"font-mono text-mode font-bold text-ink"},t2={key:0,class:"rounded-full bg-danger-soft px-2.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-caps text-danger-fg"},n2={key:1,class:"ml-auto flex flex-wrap gap-1.5"},i2=["onClick"],o2={key:0,class:"panel grid place-items-center p-16 text-center"},s2={class:"pill"},a2={class:"pill"},r2={class:"pill"},l2={class:"mt-1 text-sm font-semibold text-ink"},u2={class:"pill"},c2={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},d2={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},f2={class:"panel p-4"},h2={class:"flex items-center gap-4"},p2={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},m2={class:"readout"},g2={class:"panel p-4"},v2={class:"readout"},_2={class:"panel p-4"},b2={class:"space-y-1.5 text-sm"},y2={class:"flex justify-between"},x2={class:"text-ink"},w2={class:"flex justify-between"},k2={class:"text-ink"},S2={class:"flex justify-between"},T2={class:"font-mono tabular text-ink"},P2={class:"flex justify-between"},C2={class:"font-mono tabular text-ink"},L2={class:"panel p-4"},M2={class:"space-y-1.5 text-sm"},A2={class:"flex justify-between"},E2={class:"font-mono tabular text-ink"},O2={class:"flex justify-between"},z2={class:"font-mono tabular text-ink"},I2={class:"flex justify-between"},$2={class:"font-mono tabular text-ink"},N2={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},D2={class:"panel p-4"},F2={class:"flex flex-wrap gap-2"},R2={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},B2={class:"panel p-4"},U2={class:"h-[180px] overflow-y-auto font-mono text-xs"},V2={class:"text-ink-muted"},Z2={class:"font-semibold text-accent"},H2={class:"break-all text-ink"},j2={key:5,class:"p-7"},W2={class:"panel grid place-items-center p-16 text-center"},K2={class:"mt-3 text-sm font-medium text-ink-secondary"},G2={key:0,class:"mt-1 text-xs text-ink-muted"},q2={key:1,class:"mt-1 text-xs text-ink-muted"},Y2="34,-25,72,45",J2={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const s=t,l=i,u=kt({}),d=kt({}),h=W(null),v=W(!1),b=kt([]),C=W(""),T=W([]),M=kt({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),R=we(()=>T.value.filter(U=>!U.onGround).length),B=W(!1);let Z=null;const F=[{value:"auto",label:"Auto"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],he=we(()=>{if(ve.airTrafficInterval==="auto")return M.recommendedInterval||30;const U=Number(ve.airTrafficInterval);return Number.isFinite(U)&&U>0?U:30}),pe=W(null);let q=!1;function Te(){if(!(q||pe.value!==null)){if(typeof navigator>"u"||!navigator.geolocation){pe.value=!1;return}q=!0,navigator.geolocation.getCurrentPosition(U=>{pe.value={lat:U.coords.latitude,lng:U.coords.longitude},q=!1},()=>{pe.value=!1,q=!1},{timeout:8e3,maximumAge:6e5})}}function fe(U,O,xe){const Je=U&&U.telemetry||{},pt=Je[O],Ve=Je[xe];return typeof pt=="number"&&typeof Ve=="number"&&(pt||Ve)?{lat:pt,lng:Ve}:null}function Ue(){const U=fe(ee.value,"latitude","longitude")||ot.value.map(Je=>fe(u[Je],"latitude","longitude")).find(Boolean);if(U){const Je=pr(U.lat,U.lng);if(Je)return Je.bbox}const O=fe(ee.value,"phoneLatitude","phoneLongitude")||ot.value.map(Je=>fe(u[Je],"phoneLatitude","phoneLongitude")).find(Boolean);if(O){const Je=pr(O.lat,O.lng);if(Je)return Je.bbox}if(Te(),pe.value){const Je=pr(pe.value.lat,pe.value.lng);if(Je)return Je.bbox}const xe=mm(ve.region);return xe||Y2}async function $e(){if(!ve.showAirTraffic)return;const U=ve.autoBbox?Ue():void 0,{states:O,unavailable:xe,detail:Je,plan:pt,recommendedInterval:Ve}=await hp(U);T.value=O,M.unavailable=xe,M.detail=Je,M.plan=pt||"",Ve&&(M.recommendedInterval=Ve),M.loaded=!0}function Ie(){Z&&clearInterval(Z),Z=setInterval(()=>{ye.value==="Overview"&&ve.showAirTraffic&&$e()},he.value*1e3)}function Ge(){$e(),Ie()}function _e(){Z&&clearInterval(Z),Z=null}const ye=W("Overview"),ze=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],ne=we(()=>(ze.find(([,U])=>U===ye.value)||["grid"])[0]),je=W(""),ie=W(""),We=W("");let le=null,ce=null,se=!1;const ot=we(()=>Object.keys(u).sort((U,O)=>(u[O].online?1:0)-(u[U].online?1:0)||U.localeCompare(O))),ee=we(()=>h.value?u[h.value]:null),be=we(()=>ee.value&&ee.value.telemetry||{}),Ne=we(()=>!!(ee.value&&ee.value.online)),dt=we(()=>{const U=be.value;return typeof U.latitude=="number"&&typeof U.longitude=="number"&&(U.latitude||U.longitude)?{lat:U.latitude,lng:U.longitude}:null}),at=we(()=>h.value&&d[h.value]||[]),Ze=we(()=>{const U=be.value;return typeof U.velocityX=="number"&&typeof U.velocityY=="number"?Math.hypot(U.velocityX,U.velocityY):null});function Y(U){return U.online?U.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function A(U){const O=U&&U.telemetry||{};return typeof O.velocityX=="number"&&typeof O.velocityY=="number"?Math.hypot(O.velocityX,O.velocityY):null}const z=we(()=>ot.value.map(U=>{const O=u[U],xe=O.telemetry||{},[Je,pt]=Y(O);return{id:U,mission:O.model||(O.connected?"Drone linked":O.online?"App online":"No signal"),status:Je,tone:pt,alt:typeof xe.altitude=="number"?xe.altitude.toFixed(0)+" m":"—",battery:typeof xe.batteryPercent=="number"?xe.batteryPercent:null,speed:A(O)}})),gt=we(()=>ot.value.filter(U=>u[U].online).length),ut=we(()=>ot.value.filter(U=>u[U].online&&u[U].connected).length),wt=we(()=>ot.value.filter(U=>!u[U].online).length),y=we(()=>{const U=ot.value.map(O=>{var xe;return(xe=u[O].telemetry)==null?void 0:xe.batteryPercent}).filter(O=>typeof O=="number");return U.length?Math.round(U.reduce((O,xe)=>O+xe,0)/U.length):null}),_=we(()=>[{label:"Active flights",value:String(ut.value),delta:`${gt.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:y.value==null?"—":y.value+"%",delta:y.value==null?"no telemetry":y.value<40?"low — watch":"nominal",tone:y.value!=null&&y.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(ot.value.length),delta:`${ut.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(wt.value),delta:wt.value?"needs attention":"all reachable",tone:wt.value?"warning":"success",icon:"signal"}]),w={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},K={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},H=we(()=>{var xe,Je,pt;const O=(s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((xe=O[0])==null?void 0:xe[0])||"P")+(((Je=O[1])==null?void 0:Je[0])||((pt=O[0])==null?void 0:pt[1])||"V")).toUpperCase()}),V={superadmin:"Superadmin",admin:"Admin",user:"Operator"},ae=we(()=>V[s.role]||"Operator"),te=we(()=>s.organizationName||(s.role==="superadmin"?"All organizations":"No organization"));function Q(U){var xe;u[U.deviceId]=U;const O=U.telemetry||{};typeof O.latitude=="number"&&typeof O.longitude=="number"&&(O.latitude||O.longitude)&&(d[U.deviceId]||(d[U.deviceId]=[]),d[U.deviceId].push([O.latitude,O.longitude]),d[U.deviceId].length>1e3&&d[U.deviceId].shift()),(!h.value||U.online&&!((xe=u[h.value])!=null&&xe.online))&&(h.value=U.deviceId)}function G(U){delete u[U],delete d[U],h.value===U&&(h.value=ot.value[0]||null)}function me(U){b.unshift({t:du(Date.now()),tag:U.type||"?",text:JSON.stringify(oe(U))}),b.length>200&&b.pop()}function oe(U){const O={...U};return delete O.type,O}function ke(){const U=location.protocol==="https:"?"wss":"ws";le=new WebSocket(`${U}://${location.host}/bff/ws`),le.onopen=()=>v.value=!0,le.onclose=()=>{v.value=!1,se||(ce=setTimeout(ke,1500))},le.onerror=()=>le&&le.close(),le.onmessage=O=>{let xe;try{xe=JSON.parse(O.data)}catch{return}xe.type==="snapshot"?(xe.devices||[]).forEach(Q):xe.type==="update"&&xe.device?(Q(xe.device),xe.event&&xe.device.deviceId===h.value&&me(xe.event)):xe.type==="removed"&&xe.deviceId&&G(xe.deviceId)}}async function Ce(){if(!h.value)return We.value="No device selected.";if(!je.value.trim())return We.value="Enter a command name.";let U;if(ie.value.trim())try{U=JSON.parse(ie.value)}catch{return We.value="Payload is not valid JSON."}const{ok:O,body:xe}=await zp(h.value,je.value.trim(),U);We.value=O?`Sent "${je.value.trim()}".`:`Error: ${xe.error||"failed"}`}function He(U,O,xe=""){return typeof U=="number"?U.toFixed(O)+xe:"—"}function et(U){h.value=U,ye.value="Live flights"}return It(ye,U=>{U==="Overview"&&$e()}),It(()=>ve.showAirTraffic,U=>{U?$e():T.value=[]}),It(he,Ie),hi(async()=>{(await ep()).forEach(Q),ke(),Ge()}),Ho(()=>{se=!0,ce&&clearTimeout(ce),le&&le.close(),_e()}),(U,O)=>{var xe,Je,pt,Ve,Vt;return p(),g("div",Z0,[r("aside",H0,[r("div",j0,[E(Hc,{size:26}),O[11]||(O[11]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",W0,[(p(),g(ue,null,Be(ze,([de,Fe])=>r("button",{key:Fe,class:Ee(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",ye.value===Fe?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:Nt=>ye.value=Fe},[E(X,{name:de,size:18,stroke:ye.value===Fe?2.2:1.8},null,8,["name","stroke"]),$(" "+k(Fe),1)],10,K0)),64))]),r("div",G0,[r("div",q0,[r("div",Y0,[r("span",{class:Ee(["h-2 w-2 rounded-full",v.value?"bg-ready":"bg-caution"])},null,2),r("span",J0,k(v.value?"Link healthy":"Reconnecting…"),1)]),r("span",X0,"API gateway · "+k(v.value?"streaming":"retrying"),1)]),r("div",Q0,[r("div",ew,k(H.value),1),r("div",tw,[r("div",nw,k(t.email||"Operator"),1),r("div",iw,[E(X,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${ae.value} · ${te.value}`},k(ae.value)+" · "+k(te.value),9,ow)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:O[0]||(O[0]=de=>l("logout"))},[E(X,{name:"logout",size:16})])])])]),r("main",sw,[r("header",aw,[r("div",null,[O[12]||(O[12]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",rw,k(ye.value),1)]),r("div",lw,[r("div",uw,[E(X,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":O[1]||(O[1]=de=>C.value=de),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[Se,C.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:O[2]||(O[2]=de=>ye.value="Live flights")},[E(X,{name:"radio",size:16}),O[13]||(O[13]=$(" Live flights ",-1))])])]),ye.value==="Overview"?(p(),g("div",cw,[r("div",dw,[(p(!0),g(ue,null,Be(_.value,de=>(p(),g("div",{key:de.label,class:"panel p-5"},[r("div",fw,[r("span",hw,k(de.label),1),E(X,{name:de.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",pw,k(de.value),1),r("span",{class:Ee(["mt-2 block font-mono text-[11px]",K[de.tone]])},k(de.delta),3)]))),128))]),r("div",mw,[r("div",gw,[r("div",vw,[O[18]||(O[18]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),r("div",_w,[Oe(ve).showAirTraffic&&R.value?(p(),g("span",{key:0,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w.accent]),title:"Live aircraft from OpenSky Network"},[E(X,{name:"radio",size:12}),$(k(R.value)+" aircraft ",1)],2)):D("",!0),ut.value?(p(),g("span",{key:1,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w.success])},[O[14]||(O[14]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(ut.value)+" drones ",1)],2)):D("",!0),r("div",bw,[r("button",{type:"button",class:Ee(["grid h-7 w-7 place-items-center rounded-md text-ink-muted transition hover:bg-surface-2 hover:text-ink",B.value?"bg-surface-2 text-ink":""]),title:"Map settings","aria-label":"Map settings",onClick:O[3]||(O[3]=de=>B.value=!B.value)},[E(X,{name:"settings",size:16})],2),B.value?(p(),g(ue,{key:0},[r("div",{class:"fixed inset-0 z-[1190]",onClick:O[4]||(O[4]=de=>B.value=!1)}),r("div",yw,[O[17]||(O[17]=r("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),r("label",xw,[O[15]||(O[15]=r("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),E(un,{modelValue:Oe(ve).showAirTraffic,"onUpdate:modelValue":O[5]||(O[5]=de=>Oe(ve).showAirTraffic=de)},null,8,["modelValue"])]),r("div",{class:Ee(["mt-3.5",Oe(ve).showAirTraffic?"":"pointer-events-none opacity-40"])},[r("div",ww,[O[16]||(O[16]=r("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),r("span",kw,"every "+k(he.value)+"s",1)]),re(r("select",{"onUpdate:modelValue":O[6]||(O[6]=de=>Oe(ve).airTrafficInterval=de),class:"field"},[(p(),g(ue,null,Be(F,de=>r("option",{key:de.value,value:de.value},k(de.label)+k(de.value==="auto"?` (plan: ${M.recommendedInterval}s)`:""),9,Sw)),64))],512),[[Mt,Oe(ve).airTrafficInterval]]),M.plan?(p(),g("p",Tw," OpenSky plan: "+k(M.plan),1)):D("",!0)],2)])],64)):D("",!0)])])]),E(mu,{position:dt.value,trail:at.value,aircraft:Oe(ve).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),Oe(ve).showAirTraffic?M.loaded&&M.unavailable?(p(),g("p",Cw,k(M.detail||"Live air traffic is unavailable."),1)):(p(),g("p",Lw," Live air traffic from OpenSky Network · updates every "+k(he.value)+"s ",1)):(p(),g("p",Pw," Live air traffic hidden · enable it in Map settings "))]),r("div",Mw,[r("div",Aw,[O[19]||(O[19]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),E(X,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",Ew,[E(X,{name:"calendar",size:24,class:"text-ink-muted"}),O[20]||(O[20]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),O[21]||(O[21]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",Ow,[r("div",zw,[O[24]||(O[24]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",Iw,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w.success])},[O[22]||(O[22]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(ut.value)+" in flight ",1)],2),wt.value?(p(),g("span",{key:0,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w.warning])},[O[23]||(O[23]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(wt.value)+" offline ",1)],2)):D("",!0)])]),z.value.length?(p(),g("div",Nw,[r("table",Dw,[r("thead",null,[r("tr",Fw,[(p(),g(ue,null,Be(["Aircraft","Mission","Status","Alt","Battery","Speed",""],de=>r("th",{key:de,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(de),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Be(z.value,(de,Fe)=>(p(),g("tr",{key:de.id,class:Ee(["cursor-pointer transition hover:bg-surface-2",Feet(de.id)},[r("td",Bw,k(de.id),1),r("td",Uw,k(de.mission),1),r("td",Vw,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w[de.tone]])},[O[25]||(O[25]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(k(de.status),1)],2)]),r("td",Zw,k(de.alt),1),r("td",Hw,[de.battery!=null?(p(),g("div",jw,[r("div",Ww,[r("div",{class:Ee(["h-full",de.battery<40?"bg-caution":"bg-ready"]),style:Bo({width:de.battery+"%"})},null,6)]),r("span",Kw,k(de.battery)+"%",1)])):(p(),g("span",Gw,"—"))]),r("td",qw,[$(k(de.speed==null?"—":de.speed.toFixed(1))+" ",1),O[26]||(O[26]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",Yw,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:Kr(Nt=>et(de.id),["stop"])},[E(X,{name:"play",size:14}),O[27]||(O[27]=$(" Track ",-1))],8,Jw)])],10,Rw))),128))])])])):(p(),g("div",$w," No aircraft connected yet. Devices appear here as they come online. "))])])):ye.value==="Live flights"?(p(),g("div",Xw,[r("div",Qw,[r("span",e2,k(h.value||"No device selected"),1),ee.value&&!Ne.value?(p(),g("span",t2,"Offline")):D("",!0),ot.value.length?(p(),g("div",n2,[(p(!0),g(ue,null,Be(ot.value,de=>(p(),g("button",{key:de,class:Ee(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",de===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:Fe=>h.value=de},[r("span",{class:Ee(["h-2 w-2 rounded-full",u[de].online?"bg-ready":"bg-ink-muted"])},null,2),$(" "+k(de),1)],10,i2))),128))])):D("",!0)]),ot.value.length?(p(),g(ue,{key:1},[r("div",{class:Ee(["mb-4 grid gap-3",!Ne.value&&ee.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",s2,[O[30]||(O[30]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Ee(["mt-1 text-sm font-semibold",Ne.value?((xe=ee.value)==null?void 0:xe.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},k(Ne.value&&((Je=ee.value)!=null&&Je.registration)?ee.value.registration:"—"),3)]),r("div",a2,[O[31]||(O[31]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Ee(["mt-1 text-sm font-semibold",Ne.value?(pt=ee.value)!=null&&pt.connected?"text-success-fg":"text-danger-fg":"text-ink"])},k(ee.value?Ne.value?ee.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",r2,[O[32]||(O[32]=r("div",{class:"eyebrow"},"Model",-1)),r("div",l2,k(((Ve=ee.value)==null?void 0:Ve.model)||"—"),1)]),r("div",u2,[O[33]||(O[33]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",c2,k((Vt=ee.value)!=null&&Vt.lastSeenMs?Oe(du)(ee.value.lastSeenMs):"—"),1)])],2),r("div",d2,[r("div",f2,[O[35]||(O[35]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",h2,[r("div",p2,[r("div",{class:Ee(["h-full transition-all",typeof be.value.batteryPercent=="number"?be.value.batteryPercent<20?"bg-warning":be.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Bo({width:(typeof be.value.batteryPercent=="number"?be.value.batteryPercent:0)+"%"})},null,6)]),r("div",m2,[$(k(typeof be.value.batteryPercent=="number"?be.value.batteryPercent:"—"),1),O[34]||(O[34]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",g2,[O[37]||(O[37]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",v2,[$(k(He(be.value.altitude,1)),1),O[36]||(O[36]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",_2,[O[42]||(O[42]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",b2,[r("div",y2,[O[38]||(O[38]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",x2,k(be.value.flightMode||"—"),1)]),r("div",w2,[O[39]||(O[39]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",k2,k(be.value.isFlying==null?"—":be.value.isFlying?"yes":"no"),1)]),r("div",S2,[O[40]||(O[40]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",T2,k(be.value.satelliteCount==null?"—":be.value.satelliteCount),1)]),r("div",P2,[O[41]||(O[41]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",C2,k(Ze.value==null?"—":He(Ze.value,2," m/s")),1)])])]),r("div",L2,[O[46]||(O[46]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",M2,[r("div",A2,[O[43]||(O[43]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",E2,k(He(be.value.latitude,6)),1)]),r("div",O2,[O[44]||(O[44]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",z2,k(He(be.value.longitude,6)),1)]),r("div",I2,[O[45]||(O[45]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",$2,k(He(typeof be.value.velocityZ=="number"?-be.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",N2,[O[47]||(O[47]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),E(mu,{position:dt.value,trail:at.value},null,8,["position","trail"])]),r("div",D2,[O[48]||(O[48]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",F2,[re(r("input",{"onUpdate:modelValue":O[7]||(O[7]=de=>je.value=de),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[Se,je.value]]),re(r("input",{"onUpdate:modelValue":O[8]||(O[8]=de=>ie.value=de),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[Se,ie.value]]),r("button",{class:"btn-accent",onClick:Ce},"Send")]),r("div",R2,k(We.value),1)]),r("div",B2,[O[49]||(O[49]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",U2,[(p(!0),g(ue,null,Be(b,(de,Fe)=>(p(),g("div",{key:Fe,class:"border-b border-line py-1"},[r("span",V2,k(de.t),1),r("span",Z2,k(de.tag),1),r("span",H2,k(de.text),1)]))),128))])])])],64)):(p(),g("div",o2,[E(X,{name:"radio",size:28,class:"text-ink-muted"}),O[28]||(O[28]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),O[29]||(O[29]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):ye.value==="Logbook"?(p(),lt(ix,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):ye.value==="Documents"?(p(),lt(V0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):ye.value==="Settings"?(p(),lt(ab,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:O[9]||(O[9]=de=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),g("div",j2,[r("div",W2,[E(X,{name:ne.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",K2,k(ye.value),1),ye.value==="Drives"?(p(),g("div",G2,[O[50]||(O[50]=$(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:O[10]||(O[10]=de=>ye.value="Settings")},"Settings → Integrations"),O[51]||(O[51]=$(". ",-1))])):(p(),g("div",q2,"This section is part of the console shell and has no backend yet."))])]))])])}}},X2={key:0,class:"h-full"},Q2={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},ek={__name:"App",setup(t){const i=W(!1),s=W(null),l=W("user"),u=W(""),d=W(""),h=W("");function v(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",d.value=T&&T.organizationName||""}hi(async()=>{h.value=(await Jh()).apiBase||"";const T=await ru();T&&(s.value=T.email,v(T),await hu()),i.value=!0});async function b(T){s.value=T,v(await ru()),await hu()}async function C(){Fp(),await Qh(),s.value=null,l.value="user",u.value="",d.value=""}return(T,M)=>i.value?(p(),g("div",X2,[s.value?(p(),lt(J2,{key:0,email:s.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(p(),lt(tm,{key:1,"default-api-base":h.value,onSignedIn:b},null,8,["default-api-base"]))])):(p(),g("div",Q2,"Loading…"))}};Kh(ek).mount("#app"); diff --git a/Web App/server/dist/assets/index-CznFJTz4.js b/Web App/server/dist/assets/index-CznFJTz4.js deleted file mode 100644 index 1b251c5..0000000 --- a/Web App/server/dist/assets/index-CznFJTz4.js +++ /dev/null @@ -1,20 +0,0 @@ -(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();/** -* @vue/shared v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Mr(t){const i=Object.create(null);for(const o of t.split(","))i[o]=1;return o=>o in i}const mt={},Ms=[],Un=()=>{},_u=()=>!1,wa=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ka=t=>t.startsWith("onUpdate:"),It=Object.assign,Er=(t,i)=>{const o=t.indexOf(i);o>-1&&t.splice(o,1)},cd=Object.prototype.hasOwnProperty,ct=(t,i)=>cd.call(t,i),De=Array.isArray,Es=t=>$o(t)==="[object Map]",Rs=t=>$o(t)==="[object Set]",gl=t=>$o(t)==="[object Date]",We=t=>typeof t=="function",xt=t=>typeof t=="string",Ln=t=>typeof t=="symbol",dt=t=>t!==null&&typeof t=="object",yu=t=>(dt(t)||We(t))&&We(t.then)&&We(t.catch),bu=Object.prototype.toString,$o=t=>bu.call(t),dd=t=>$o(t).slice(8,-1),xu=t=>$o(t)==="[object Object]",Or=t=>xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,yo=Mr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Sa=t=>{const i=Object.create(null);return(o=>i[o]||(i[o]=t(o)))},fd=/-\w/g,Pn=Sa(t=>t.replace(fd,i=>i.slice(1).toUpperCase())),hd=/\B([A-Z])/g,zi=Sa(t=>t.replace(hd,"-$1").toLowerCase()),wu=Sa(t=>t.charAt(0).toUpperCase()+t.slice(1)),Qa=Sa(t=>t?`on${wu(t)}`:""),Vn=(t,i)=>!Object.is(t,i),la=(t,...i)=>{for(let o=0;o{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:o})},Ta=t=>{const i=parseFloat(t);return isNaN(i)?t:i},pd=t=>{const i=xt(t)?Number(t):NaN;return isNaN(i)?t:i};let vl;const Pa=()=>vl||(vl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Is(t){if(De(t)){const i={};for(let o=0;o{if(o){const l=o.split(gd);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Ee(t){let i="";if(xt(t))i=t;else if(De(t))for(let o=0;oMi(o,i))}const Tu=t=>!!(t&&t.__v_isRef===!0),S=t=>xt(t)?t:t==null?"":De(t)||dt(t)&&(t.toString===bu||!We(t.toString))?Tu(t)?S(t.value):JSON.stringify(t,Pu,2):String(t),Pu=(t,i)=>Tu(i)?Pu(t,i.value):Es(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[l,u],d)=>(o[er(l,d)+" =>"]=u,o),{})}:Rs(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>er(o))}:Ln(i)?er(i):dt(i)&&!De(i)&&!xu(i)?String(i):i,er=(t,i="")=>{var o;return Ln(t)?`Symbol(${(o=t.description)!=null?o:i})`:t};/** -* @vue/reactivity v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Rt;class wd{constructor(i=!1){this.detached=i,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!i&&Rt&&(Rt.active?(this.parent=Rt,this.index=(Rt.scopes||(Rt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i0&&--this._on===0){if(Rt===this)Rt=this.prevScope;else{let i=Rt;for(;i;){if(i.prevScope===this){i.prevScope=this.prevScope;break}i=i.prevScope}}this.prevScope=void 0}}stop(i){if(this._active){this._active=!1;let o,l;for(o=0,l=this.effects.length;o0)return;if(xo){let i=xo;for(xo=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let t;for(;bo;){let i=bo;for(bo=void 0;i;){const o=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=o}}if(t)throw t}function Eu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function Ou(t){let i,o=t.depsTail,l=o;for(;l;){const u=l.prevDep;l.version===-1?(l===o&&(o=u),Ir(l),Sd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=o}function fr(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(zu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function zu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Po)||(t.globalVersion=Po,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!fr(t))))return;t.flags|=2;const i=t.dep,o=gt,l=Cn;gt=t,Cn=!0;try{Eu(t);const u=t.fn(t._value);(i.version===0||Vn(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{gt=o,Cn=l,Ou(t),t.flags&=-3}}function Ir(t,i=!1){const{dep:o,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),o.subs===t&&(o.subs=l,!l&&o.computed)){o.computed.flags&=-5;for(let d=o.computed.deps;d;d=d.nextDep)Ir(d,!0)}!i&&!--o.sc&&o.map&&o.map.delete(o.key)}function Sd(t){const{prevDep:i,nextDep:o}=t;i&&(i.nextDep=o,t.prevDep=void 0),o&&(o.prevDep=i,t.nextDep=void 0)}let Cn=!0;const Au=[];function Zn(){Au.push(Cn),Cn=!1}function Hn(){const t=Au.pop();Cn=t===void 0?!0:t}function _l(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const o=gt;gt=void 0;try{i()}finally{gt=o}}}let Po=0;class Td{constructor(i,o){this.sub=i,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Dr{constructor(i){this.computed=i,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(i){if(!gt||!Cn||gt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==gt)o=this.activeLink=new Td(gt,this),gt.deps?(o.prevDep=gt.depsTail,gt.depsTail.nextDep=o,gt.depsTail=o):gt.deps=gt.depsTail=o,$u(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const l=o.nextDep;l.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=l),o.prevDep=gt.depsTail,o.nextDep=void 0,gt.depsTail.nextDep=o,gt.depsTail=o,gt.deps===o&&(gt.deps=l)}return o}trigger(i){this.version++,Po++,this.notify(i)}notify(i){Ar();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{$r()}}}function $u(t){if(t.dep.sc++,t.sub.flags&4){const i=t.dep.computed;if(i&&!t.dep.subs){i.flags|=20;for(let l=i.deps;l;l=l.nextDep)$u(l)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const hr=new WeakMap,os=Symbol(""),pr=Symbol(""),Co=Symbol("");function Zt(t,i,o){if(Cn&>){let l=hr.get(t);l||hr.set(t,l=new Map);let u=l.get(o);u||(l.set(o,u=new Dr),u.map=l,u.key=o),u.track()}}function li(t,i,o,l,u,d){const h=hr.get(t);if(!h){Po++;return}const v=y=>{y&&y.trigger()};if(Ar(),i==="clear")h.forEach(v);else{const y=De(t),C=y&&Or(o);if(y&&o==="length"){const T=Number(l);h.forEach((O,B)=>{(B==="length"||B===Co||!Ln(B)&&B>=T)&&v(O)})}else switch((o!==void 0||h.has(void 0))&&v(h.get(o)),C&&v(h.get(Co)),i){case"add":y?C&&v(h.get("length")):(v(h.get(os)),Es(t)&&v(h.get(pr)));break;case"delete":y||(v(h.get(os)),Es(t)&&v(h.get(pr)));break;case"set":Es(t)&&v(h.get(os));break}}$r()}function Cs(t){const i=lt(t);return i===t?i:(Zt(i,"iterate",Co),wn(t)?i:i.map(Mn))}function Ca(t){return Zt(t=lt(t),"iterate",Co),t}function Fn(t,i){return di(t)?Ds(as(t)?Mn(i):i):Mn(i)}const Pd={__proto__:null,[Symbol.iterator](){return nr(this,Symbol.iterator,t=>Fn(this,t))},concat(...t){return Cs(this).concat(...t.map(i=>De(i)?Cs(i):i))},entries(){return nr(this,"entries",t=>(t[1]=Fn(this,t[1]),t))},every(t,i){return si(this,"every",t,i,void 0,arguments)},filter(t,i){return si(this,"filter",t,i,o=>o.map(l=>Fn(this,l)),arguments)},find(t,i){return si(this,"find",t,i,o=>Fn(this,o),arguments)},findIndex(t,i){return si(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return si(this,"findLast",t,i,o=>Fn(this,o),arguments)},findLastIndex(t,i){return si(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return si(this,"forEach",t,i,void 0,arguments)},includes(...t){return ir(this,"includes",t)},indexOf(...t){return ir(this,"indexOf",t)},join(t){return Cs(this).join(t)},lastIndexOf(...t){return ir(this,"lastIndexOf",t)},map(t,i){return si(this,"map",t,i,void 0,arguments)},pop(){return co(this,"pop")},push(...t){return co(this,"push",t)},reduce(t,...i){return yl(this,"reduce",t,i)},reduceRight(t,...i){return yl(this,"reduceRight",t,i)},shift(){return co(this,"shift")},some(t,i){return si(this,"some",t,i,void 0,arguments)},splice(...t){return co(this,"splice",t)},toReversed(){return Cs(this).toReversed()},toSorted(t){return Cs(this).toSorted(t)},toSpliced(...t){return Cs(this).toSpliced(...t)},unshift(...t){return co(this,"unshift",t)},values(){return nr(this,"values",t=>Fn(this,t))}};function nr(t,i,o){const l=Ca(t),u=l[i]();return l!==t&&!wn(t)&&(u._next=u.next,u.next=()=>{const d=u._next();return d.done||(d.value=o(d.value)),d}),u}const Cd=Array.prototype;function si(t,i,o,l,u,d){const h=Ca(t),v=h!==t&&!wn(t),y=h[i];if(y!==Cd[i]){const O=y.apply(t,d);return v?Mn(O):O}let C=o;h!==t&&(v?C=function(O,B){return o.call(this,Fn(t,O),B,t)}:o.length>2&&(C=function(O,B){return o.call(this,O,B,t)}));const T=y.call(h,C,l);return v&&u?u(T):T}function yl(t,i,o,l){const u=Ca(t),d=u!==t&&!wn(t);let h=o,v=!1;u!==t&&(d?(v=l.length===0,h=function(C,T,O){return v&&(v=!1,C=Fn(t,C)),o.call(this,C,Fn(t,T),O,t)}):o.length>3&&(h=function(C,T,O){return o.call(this,C,T,O,t)}));const y=u[i](h,...l);return v?Fn(t,y):y}function ir(t,i,o){const l=lt(t);Zt(l,"iterate",Co);const u=l[i](...o);return(u===-1||u===!1)&&Fr(o[0])?(o[0]=lt(o[0]),l[i](...o)):u}function co(t,i,o=[]){Zn(),Ar();const l=lt(t)[i].apply(t,o);return $r(),Hn(),l}const Ld=Mr("__proto__,__v_isRef,__isVue"),Iu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ln));function Md(t){Ln(t)||(t=String(t));const i=lt(this);return Zt(i,"has",t),i.hasOwnProperty(t)}class Du{constructor(i=!1,o=!1){this._isReadonly=i,this._isShallow=o}get(i,o,l){if(o==="__v_skip")return i.__v_skip;const u=this._isReadonly,d=this._isShallow;if(o==="__v_isReactive")return!u;if(o==="__v_isReadonly")return u;if(o==="__v_isShallow")return d;if(o==="__v_raw")return l===(u?d?Fd:Bu:d?Fu:Ru).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=De(i);if(!u){let y;if(h&&(y=Pd[o]))return y;if(o==="hasOwnProperty")return Md}const v=Reflect.get(i,o,Wt(i)?i:l);if((Ln(o)?Iu.has(o):Ld(o))||(u||Zt(i,"get",o),d))return v;if(Wt(v)){const y=h&&Or(o)?v:v.value;return u&&dt(y)?gr(y):y}return dt(v)?u?gr(v):bt(v):v}}class Nu extends Du{constructor(i=!1){super(!1,i)}set(i,o,l,u){let d=i[o];const h=De(i)&&Or(o);if(!this._isShallow){const C=di(d);if(!wn(l)&&!di(l)&&(d=lt(d),l=lt(l)),!h&&Wt(d)&&!Wt(l))return C||(d.value=l),!0}const v=h?Number(o)t,na=t=>Reflect.getPrototypeOf(t);function $d(t,i,o){return function(...l){const u=this.__v_raw,d=lt(u),h=Es(d),v=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,C=u[t](...l),T=o?mr:i?Ds:Mn;return!i&&Zt(d,"iterate",y?pr:os),It(Object.create(C),{next(){const{value:O,done:B}=C.next();return B?{value:O,done:B}:{value:v?[T(O[0]),T(O[1])]:T(O),done:B}}})}}function ia(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Id(t,i){const o={get(u){const d=this.__v_raw,h=lt(d),v=lt(u);t||(Vn(u,v)&&Zt(h,"get",u),Zt(h,"get",v));const{has:y}=na(h),C=i?mr:t?Ds:Mn;if(y.call(h,u))return C(d.get(u));if(y.call(h,v))return C(d.get(v));d!==h&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Zt(lt(u),"iterate",os),u.size},has(u){const d=this.__v_raw,h=lt(d),v=lt(u);return t||(Vn(u,v)&&Zt(h,"has",u),Zt(h,"has",v)),u===v?d.has(u):d.has(u)||d.has(v)},forEach(u,d){const h=this,v=h.__v_raw,y=lt(v),C=i?mr:t?Ds:Mn;return!t&&Zt(y,"iterate",os),v.forEach((T,O)=>u.call(d,C(T),C(O),h))}};return It(o,t?{add:ia("add"),set:ia("set"),delete:ia("delete"),clear:ia("clear")}:{add(u){const d=lt(this),h=na(d),v=lt(u),y=!i&&!wn(u)&&!di(u)?v:u;return h.has.call(d,y)||Vn(u,y)&&h.has.call(d,u)||Vn(v,y)&&h.has.call(d,v)||(d.add(y),li(d,"add",y,y)),this},set(u,d){!i&&!wn(d)&&!di(d)&&(d=lt(d));const h=lt(this),{has:v,get:y}=na(h);let C=v.call(h,u);C||(u=lt(u),C=v.call(h,u));const T=y.call(h,u);return h.set(u,d),C?Vn(d,T)&&li(h,"set",u,d):li(h,"add",u,d),this},delete(u){const d=lt(this),{has:h,get:v}=na(d);let y=h.call(d,u);y||(u=lt(u),y=h.call(d,u)),v&&v.call(d,u);const C=d.delete(u);return y&&li(d,"delete",u,void 0),C},clear(){const u=lt(this),d=u.size!==0,h=u.clear();return d&&li(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=$d(u,t,i)}),o}function Nr(t,i){const o=Id(t,i);return(l,u,d)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ct(o,u)&&u in l?o:l,u,d)}const Dd={get:Nr(!1,!1)},Nd={get:Nr(!1,!0)},Rd={get:Nr(!0,!1)};const Ru=new WeakMap,Fu=new WeakMap,Bu=new WeakMap,Fd=new WeakMap;function Bd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bt(t){return di(t)?t:Rr(t,!1,Od,Dd,Ru)}function Vd(t){return Rr(t,!1,Ad,Nd,Fu)}function gr(t){return Rr(t,!0,zd,Rd,Bu)}function Rr(t,i,o,l,u){if(!dt(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const d=u.get(t);if(d)return d;const h=Bd(dd(t));if(h===0)return t;const v=new Proxy(t,h===2?l:o);return u.set(t,v),v}function as(t){return di(t)?as(t.__v_raw):!!(t&&t.__v_isReactive)}function di(t){return!!(t&&t.__v_isReadonly)}function wn(t){return!!(t&&t.__v_isShallow)}function Fr(t){return t?!!t.__v_raw:!1}function lt(t){const i=t&&t.__v_raw;return i?lt(i):t}function Ud(t){return!ct(t,"__v_skip")&&Object.isExtensible(t)&&ku(t,"__v_skip",!0),t}const Mn=t=>dt(t)?bt(t):t,Ds=t=>dt(t)?gr(t):t;function Wt(t){return t?t.__v_isRef===!0:!1}function j(t){return Zd(t,!1)}function Zd(t,i){return Wt(t)?t:new Hd(t,i)}class Hd{constructor(i,o){this.dep=new Dr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?i:lt(i),this._value=o?i:Mn(i),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(i){const o=this._rawValue,l=this.__v_isShallow||wn(i)||di(i);i=l?i:lt(i),Vn(i,o)&&(this._rawValue=i,this._value=l?i:Mn(i),this.dep.trigger())}}function $e(t){return Wt(t)?t.value:t}const jd={get:(t,i,o)=>i==="__v_raw"?t:$e(Reflect.get(t,i,o)),set:(t,i,o,l)=>{const u=t[i];return Wt(u)&&!Wt(o)?(u.value=o,!0):Reflect.set(t,i,o,l)}};function Vu(t){return as(t)?t:new Proxy(t,jd)}class Wd{constructor(i,o,l){this.fn=i,this.setter=o,this._value=void 0,this.dep=new Dr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Po-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&>!==this)return Mu(this,!0),!0}get value(){const i=this.dep.track();return zu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Kd(t,i,o=!1){let l,u;return We(t)?l=t:(l=t.get,u=t.set),new Wd(l,u,o)}const sa={},ca=new WeakMap;let ns;function Gd(t,i=!1,o=ns){if(o){let l=ca.get(o);l||ca.set(o,l=[]),l.push(t)}}function qd(t,i,o=mt){const{immediate:l,deep:u,once:d,scheduler:h,augmentJob:v,call:y}=o,C=he=>u?he:wn(he)||u===!1||u===0?ui(he,1):ui(he);let T,O,B,V,H=!1,F=!1;if(Wt(t)?(O=()=>t.value,H=wn(t)):as(t)?(O=()=>C(t),H=!0):De(t)?(F=!0,H=t.some(he=>as(he)||wn(he)),O=()=>t.map(he=>{if(Wt(he))return he.value;if(as(he))return C(he);if(We(he))return y?y(he,2):he()})):We(t)?i?O=y?()=>y(t,2):t:O=()=>{if(B){Zn();try{B()}finally{Hn()}}const he=ns;ns=T;try{return y?y(t,3,[V]):t(V)}finally{ns=he}}:O=Un,i&&u){const he=O,ye=u===!0?1/0:u;O=()=>ui(he(),ye)}const fe=kd(),ve=()=>{T.stop(),fe&&fe.active&&Er(fe.effects,T)};if(d&&i){const he=i;i=(...ye)=>{const Ne=he(...ye);return ve(),Ne}}let Y=F?new Array(t.length).fill(sa):sa;const Pe=he=>{if(!(!(T.flags&1)||!T.dirty&&!he))if(i){const ye=T.run();if(he||u||H||(F?ye.some((Ne,Ie)=>Vn(Ne,Y[Ie])):Vn(ye,Y))){B&&B();const Ne=ns;ns=T;try{const Ie=[ye,Y===sa?void 0:F&&Y[0]===sa?[]:Y,V];Y=ye,y?y(i,3,Ie):i(...Ie)}finally{ns=Ne}}}else T.run()};return v&&v(Pe),T=new Cu(O),T.scheduler=h?()=>h(Pe,!1):Pe,V=he=>Gd(he,!1,T),B=T.onStop=()=>{const he=ca.get(T);if(he){if(y)y(he,4);else for(const ye of he)ye();ca.delete(T)}},i?l?Pe(!0):Y=T.run():h?h(Pe.bind(null,!0),!0):T.run(),ve.pause=T.pause.bind(T),ve.resume=T.resume.bind(T),ve.stop=ve,ve}function ui(t,i=1/0,o){if(i<=0||!dt(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=i))return t;if(o.set(t,i),i--,Wt(t))ui(t.value,i,o);else if(De(t))for(let l=0;l{ui(l,i,o)});else if(xu(t)){for(const l in t)ui(t[l],i,o);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&ui(t[l],i,o)}return t}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Io(t,i,o,l){try{return l?t(...l):t()}catch(u){La(u,i,o)}}function Sn(t,i,o,l){if(We(t)){const u=Io(t,i,o,l);return u&&yu(u)&&u.catch(d=>{La(d,i,o)}),u}if(De(t)){const u=[];for(let d=0;d>>1,u=Jt[l],d=Lo(u);d=Lo(o)?Jt.push(t):Jt.splice(Jd(i),0,t),t.flags|=1,Hu()}}function Hu(){da||(da=Uu.then(Wu))}function Xd(t){De(t)?Os.push(...t):Li&&t.id===-1?Li.splice(Ls+1,0,t):t.flags&1||(Os.push(t),t.flags|=1),Hu()}function bl(t,i,o=Rn+1){for(;oLo(o)-Lo(l));if(Os.length=0,Li){Li.push(...i);return}for(Li=i,Ls=0;Lst.id==null?t.flags&2?-1:1/0:t.id;function Wu(t){try{for(Rn=0;Rn{l._d&&ma(-1);const d=fa(i);let h;try{h=t(...u)}finally{fa(d),l._d&&ma(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function oe(t,i){if(jt===null)return t;const o=Aa(jt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return o&&We(i)?i.call(l&&l.proxy):i}}const Qd=Symbol.for("v-scx"),ef=()=>wo(Qd);function $t(t,i,o){return qu(t,i,o)}function qu(t,i,o=mt){const{immediate:l,deep:u,flush:d,once:h}=o,v=It({},o),y=i&&l||!i&&d!=="post";let C;if(zo){if(d==="sync"){const V=ef();C=V.__watcherHandles||(V.__watcherHandles=[])}else if(!y){const V=()=>{};return V.stop=Un,V.resume=Un,V.pause=Un,V}}const T=Xt;v.call=(V,H,F)=>Sn(V,T,H,F);let O=!1;d==="post"?v.scheduler=V=>{Yt(V,T&&T.suspense)}:d!=="sync"&&(O=!0,v.scheduler=(V,H)=>{H?V():Br(V)}),v.augmentJob=V=>{i&&(V.flags|=4),O&&(V.flags|=2,T&&(V.id=T.uid,V.i=T))};const B=qd(t,i,v);return zo&&(C?C.push(B):y&&B()),B}function tf(t,i,o){const l=this.proxy,u=xt(t)?t.includes(".")?Yu(l,t):()=>l[t]:t.bind(l,l);let d;We(i)?d=i:(d=i.handler,o=i);const h=Do(this),v=qu(u,d.bind(l),o);return h(),v}function Yu(t,i){const o=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,is=t=>t&&(t.disabled||t.disabled===""),nf=t=>t&&(t.defer||t.defer===""),xl=t=>typeof SVGElement<"u"&&t instanceof SVGElement,wl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,vr=(t,i)=>{const o=t&&t.to;return xt(o)?i?i(o):null:o},sf={name:"Teleport",__isTeleport:!0,process(t,i,o,l,u,d,h,v,y,C){const{mc:T,pc:O,pbc:B,o:{insert:V,querySelector:H,createText:F,createComment:fe,parentNode:ve}}=C,Y=is(i.props);let{dynamicChildren:Pe}=i;const he=(Ie,Ve,pe)=>{Ie.shapeFlag&16&&T(Ie.children,Ve,pe,u,d,h,v,y)},ye=(Ie=i)=>{const Ve=is(Ie.props),pe=Ie.target=vr(Ie.props,H),ze=_r(pe,Ie,F,V);pe&&(h!=="svg"&&xl(pe)?h="svg":h!=="mathml"&&wl(pe)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(pe),Ve||(he(Ie,pe,ze),mo(Ie,!1)))},Ne=Ie=>{const Ve=()=>{if(Ci.get(Ie)===Ve){if(Ci.delete(Ie),is(Ie.props)){const pe=ve(Ie.el)||o;he(Ie,pe,Ie.anchor),mo(Ie,!0)}ye(Ie)}};Ci.set(Ie,Ve),Yt(Ve,d)};if(t==null){const Ie=i.el=F(""),Ve=i.anchor=F("");if(V(Ie,o,l),V(Ve,o,l),nf(i.props)||d&&d.pendingBranch){Ne(i);return}Y&&(he(i,o,Ve),mo(i,!0)),ye()}else{i.el=t.el;const Ie=i.anchor=t.anchor,Ve=Ci.get(t);if(Ve){Ve.flags|=8,Ci.delete(t),Ne(i);return}i.targetStart=t.targetStart;const pe=i.target=t.target,ze=i.targetAnchor=t.targetAnchor,Te=is(t.props),te=Te?o:pe,de=Te?Ie:ze;if(h==="svg"||xl(pe)?h="svg":(h==="mathml"||wl(pe))&&(h="mathml"),Pe?(B(t.dynamicChildren,Pe,te,u,d,h,v),Zr(t,i,!0)):y||O(t,i,te,de,u,d,h,v,!1),Y)Te?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):oa(i,o,Ie,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const _e=vr(i.props,H);_e&&(i.target=_e,oa(i,_e,null,C,0))}else Te&&oa(i,pe,ze,C,1);mo(i,Y)}},remove(t,i,o,{um:l,o:{remove:u}},d){const{shapeFlag:h,children:v,anchor:y,targetStart:C,targetAnchor:T,target:O,props:B}=t,V=is(B),H=d||!V,F=Ci.get(t);if(F&&(F.flags|=8,Ci.delete(t)),O&&(u(C),u(T)),d&&u(y),!F&&(V||O)&&h&16)for(let fe=0;fe{t.isMounted=!0}),Fs(()=>{t.isUnmounting=!0}),t}const yn=[Function,Array],Qu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:yn,onEnter:yn,onAfterEnter:yn,onEnterCancelled:yn,onBeforeLeave:yn,onLeave:yn,onAfterLeave:yn,onLeaveCancelled:yn,onBeforeAppear:yn,onAppear:yn,onAfterAppear:yn,onAppearCancelled:yn},ec=t=>{const i=t.subTree;return i.component?ec(i.component):i},lf={name:"BaseTransition",props:Qu,setup(t,{slots:i}){const o=Pc(),l=rf();return()=>{const u=i.default&&ic(i.default(),!0),d=u&&u.length?tc(u):o.subTree?R():void 0;if(!d)return;const h=lt(t),{mode:v}=h;if(l.isLeaving)return sr(d);const y=kl(d);if(!y)return sr(d);let C=yr(y,h,l,o,O=>C=O);y.type!==Ht&&Mo(y,C);let T=o.subTree&&kl(o.subTree);if(T&&T.type!==Ht&&!ss(T,y)&&ec(o).type!==Ht){let O=yr(T,h,l,o);if(Mo(T,O),v==="out-in"&&y.type!==Ht)return l.isLeaving=!0,O.afterLeave=()=>{l.isLeaving=!1,o.job.flags&8||o.update(),delete O.afterLeave,T=void 0},sr(d);v==="in-out"&&y.type!==Ht?O.delayLeave=(B,V,H)=>{const F=nc(l,T);F[String(T.key)]=T,B[xn]=()=>{V(),B[xn]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{H(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return d}}};function tc(t){let i=t[0];if(t.length>1){for(const o of t)if(o.type!==Ht){i=o;break}}return i}const uf=lf;function nc(t,i){const{leavingVNodes:o}=t;let l=o.get(i.type);return l||(l=Object.create(null),o.set(i.type,l)),l}function yr(t,i,o,l,u){const{appear:d,mode:h,persisted:v=!1,onBeforeEnter:y,onEnter:C,onAfterEnter:T,onEnterCancelled:O,onBeforeLeave:B,onLeave:V,onAfterLeave:H,onLeaveCancelled:F,onBeforeAppear:fe,onAppear:ve,onAfterAppear:Y,onAppearCancelled:Pe}=i,he=String(t.key),ye=nc(o,t),Ne=(pe,ze)=>{pe&&Sn(pe,l,9,ze)},Ie=(pe,ze)=>{const Te=ze[1];Ne(pe,ze),De(pe)?pe.every(te=>te.length<=1)&&Te():pe.length<=1&&Te()},Ve={mode:h,persisted:v,beforeEnter(pe){let ze=y;if(!o.isMounted)if(d)ze=fe||y;else return;pe[xn]&&pe[xn](!0);const Te=ye[he];Te&&ss(t,Te)&&Te.el[xn]&&Te.el[xn](),Ne(ze,[pe])},enter(pe){if(ye[he]===t)return;let ze=C,Te=T,te=O;if(!o.isMounted)if(d)ze=ve||C,Te=Y||T,te=Pe||O;else return;let de=!1;pe[fo]=be=>{de||(de=!0,be?Ne(te,[pe]):Ne(Te,[pe]),Ve.delayedLeave&&Ve.delayedLeave(),pe[fo]=void 0)};const _e=pe[fo].bind(null,!1);ze?Ie(ze,[pe,_e]):_e()},leave(pe,ze){const Te=String(t.key);if(pe[fo]&&pe[fo](!0),o.isUnmounting)return ze();Ne(B,[pe]);let te=!1;pe[xn]=_e=>{te||(te=!0,ze(),_e?Ne(F,[pe]):Ne(H,[pe]),pe[xn]=void 0,ye[Te]===t&&delete ye[Te])};const de=pe[xn].bind(null,!1);ye[Te]=t,V?Ie(V,[pe,de]):de()},clone(pe){const ze=yr(pe,i,o,l,u);return u&&u(ze),ze}};return Ve}function sr(t){if(Ma(t))return t=Ei(t),t.children=null,t}function kl(t){if(!Ma(t))return Xu(t.type)&&t.children?tc(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:o}=t;if(o){if(i&16)return o[0];if(i&32&&We(o.default))return o.default()}}function Mo(t,i){t.shapeFlag&6&&t.component?(t.transition=i,Mo(t.component.subTree,i)):t.shapeFlag&128?(t.ssContent.transition=i.clone(t.ssContent),t.ssFallback.transition=i.clone(t.ssFallback)):t.transition=i}function ic(t,i=!1,o){let l=[],u=0;for(let d=0;d1)for(let d=0;dko(F,i&&(De(i)?i[fe]:i),o,l,u));return}if(zs(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&ko(t,i,o,l.component.subTree);return}const d=l.shapeFlag&4?Aa(l.component):l.el,h=u?null:d,{i:v,r:y}=t,C=i&&i.r,T=v.refs===mt?v.refs={}:v.refs,O=v.setupState,B=lt(O),V=O===mt?_u:F=>Sl(T,F)?!1:ct(B,F),H=(F,fe)=>!(fe&&Sl(T,fe));if(C!=null&&C!==y){if(Tl(i),xt(C))T[C]=null,V(C)&&(O[C]=null);else if(Wt(C)){const F=i;H(C,F.k)&&(C.value=null),F.k&&(T[F.k]=null)}}if(We(y)){Zn();try{Io(y,v,12,[h,T])}finally{Hn()}}else{const F=xt(y),fe=Wt(y);if(F||fe){const ve=()=>{if(t.f){const Y=F?V(y)?O[y]:T[y]:H()||!t.k?y.value:T[t.k];if(u)De(Y)&&Er(Y,d);else if(De(Y))Y.includes(d)||Y.push(d);else if(F)T[y]=[d],V(y)&&(O[y]=T[y]);else{const Pe=[d];H(y,t.k)&&(y.value=Pe),t.k&&(T[t.k]=Pe)}}else F?(T[y]=h,V(y)&&(O[y]=h)):fe&&(H(y,t.k)&&(y.value=h),t.k&&(T[t.k]=h))};if(h){const Y=()=>{ve(),ha.delete(t)};Y.id=-1,ha.set(t,Y),Yt(Y,o)}else Tl(t),ve()}}}function Tl(t){const i=ha.get(t);i&&(i.flags|=8,ha.delete(t))}Pa().requestIdleCallback;Pa().cancelIdleCallback;const zs=t=>!!t.type.__asyncLoader,Ma=t=>t.type.__isKeepAlive;function cf(t,i){oc(t,"a",i)}function df(t,i){oc(t,"da",i)}function oc(t,i,o=Xt){const l=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(Ea(i,l,o),o){let u=o.parent;for(;u&&u.parent;)Ma(u.parent.vnode)&&ff(l,i,o,u),u=u.parent}}function ff(t,i,o,l){const u=Ea(i,t,l,!0);ac(()=>{Er(l[i],u)},o)}function Ea(t,i,o=Xt,l=!1){if(o){const u=o[t]||(o[t]=[]),d=i.__weh||(i.__weh=(...h)=>{Zn();const v=Do(o),y=Sn(i,o,t,h);return v(),Hn(),y});return l?u.unshift(d):u.push(d),d}}const hi=t=>(i,o=Xt)=>{(!zo||t==="sp")&&Ea(t,(...l)=>i(...l),o)},hf=hi("bm"),fi=hi("m"),pf=hi("bu"),mf=hi("u"),Fs=hi("bum"),ac=hi("um"),gf=hi("sp"),vf=hi("rtg"),_f=hi("rtc");function yf(t,i=Xt){Ea("ec",t,i)}const bf=Symbol.for("v-ndc");function Be(t,i,o,l){let u;const d=o,h=De(t);if(h||xt(t)){const v=h&&as(t);let y=!1,C=!1;v&&(y=!wn(t),C=di(t),t=Ca(t)),u=new Array(t.length);for(let T=0,O=t.length;Ti(v,y,void 0,d));else{const v=Object.keys(t);u=new Array(v.length);for(let y=0,C=v.length;y0;return p(),at(re,null,[z("slot",o,l)],C?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),p();const h=d&&rc(d(o)),v=o.key||h&&h.key,y=at(re,{key:(v&&!Ln(v)?v:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),d&&d._c&&(d._d=!0),y}function rc(t){return t.some(i=>Oo(i)?!(i.type===Ht||i.type===re&&!rc(i.children)):!0)?t:null}const br=t=>t?Cc(t)?Aa(t):br(t.parent):null,So=It(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>br(t.parent),$root:t=>br(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>uc(t),$forceUpdate:t=>t.f||(t.f=()=>{Br(t.update)}),$nextTick:t=>t.n||(t.n=Zu.bind(t.proxy)),$watch:t=>tf.bind(t)}),or=(t,i)=>t!==mt&&!t.__isScriptSetup&&ct(t,i),wf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:l,data:u,props:d,accessCache:h,type:v,appContext:y}=t;if(i[0]!=="$"){const B=h[i];if(B!==void 0)switch(B){case 1:return l[i];case 2:return u[i];case 4:return o[i];case 3:return d[i]}else{if(or(l,i))return h[i]=1,l[i];if(u!==mt&&ct(u,i))return h[i]=2,u[i];if(ct(d,i))return h[i]=3,d[i];if(o!==mt&&ct(o,i))return h[i]=4,o[i];xr&&(h[i]=0)}}const C=So[i];let T,O;if(C)return i==="$attrs"&&Zt(t.attrs,"get",""),C(t);if((T=v.__cssModules)&&(T=T[i]))return T;if(o!==mt&&ct(o,i))return h[i]=4,o[i];if(O=y.config.globalProperties,ct(O,i))return O[i]},set({_:t},i,o){const{data:l,setupState:u,ctx:d}=t;return or(u,i)?(u[i]=o,!0):l!==mt&&ct(l,i)?(l[i]=o,!0):ct(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(d[i]=o,!0)},has({_:{data:t,setupState:i,accessCache:o,ctx:l,appContext:u,props:d,type:h}},v){let y;return!!(o[v]||t!==mt&&v[0]!=="$"&&ct(t,v)||or(i,v)||ct(d,v)||ct(l,v)||ct(So,v)||ct(u.config.globalProperties,v)||(y=h.__cssModules)&&y[v])},defineProperty(t,i,o){return o.get!=null?t._.accessCache[i]=0:ct(o,"value")&&this.set(t,i,o.value,null),Reflect.defineProperty(t,i,o)}};function Pl(t){return De(t)?t.reduce((i,o)=>(i[o]=null,i),{}):t}let xr=!0;function kf(t){const i=uc(t),o=t.proxy,l=t.ctx;xr=!1,i.beforeCreate&&Cl(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:h,watch:v,provide:y,inject:C,created:T,beforeMount:O,mounted:B,beforeUpdate:V,updated:H,activated:F,deactivated:fe,beforeDestroy:ve,beforeUnmount:Y,destroyed:Pe,unmounted:he,render:ye,renderTracked:Ne,renderTriggered:Ie,errorCaptured:Ve,serverPrefetch:pe,expose:ze,inheritAttrs:Te,components:te,directives:de,filters:_e}=i;if(C&&Sf(C,l,null),h)for(const le in h){const ie=h[le];We(ie)&&(l[le]=ie.bind(o))}if(u){const le=u.call(o,o);dt(le)&&(t.data=bt(le))}if(xr=!0,d)for(const le in d){const ie=d[le],rt=We(ie)?ie.bind(o,o):We(ie.get)?ie.get.bind(o,o):Un,me=!We(ie)&&We(ie.set)?ie.set.bind(o):Un,Oe=ke({get:rt,set:me});Object.defineProperty(l,le,{enumerable:!0,configurable:!0,get:()=>Oe.value,set:Xe=>Oe.value=Xe})}if(v)for(const le in v)lc(v[le],l,o,le);if(y){const le=We(y)?y.call(o):y;Reflect.ownKeys(le).forEach(ie=>{Gu(ie,le[ie])})}T&&Cl(T,t,"c");function ae(le,ie){De(ie)?ie.forEach(rt=>le(rt.bind(o))):ie&&le(ie.bind(o))}if(ae(hf,O),ae(fi,B),ae(pf,V),ae(mf,H),ae(cf,F),ae(df,fe),ae(yf,Ve),ae(_f,Ne),ae(vf,Ie),ae(Fs,Y),ae(ac,he),ae(gf,pe),De(ze))if(ze.length){const le=t.exposed||(t.exposed={});ze.forEach(ie=>{Object.defineProperty(le,ie,{get:()=>o[ie],set:rt=>o[ie]=rt,enumerable:!0})})}else t.exposed||(t.exposed={});ye&&t.render===Un&&(t.render=ye),Te!=null&&(t.inheritAttrs=Te),te&&(t.components=te),de&&(t.directives=de),pe&&sc(t)}function Sf(t,i,o=Un){De(t)&&(t=wr(t));for(const l in t){const u=t[l];let d;dt(u)?"default"in u?d=wo(u.from||l,u.default,!0):d=wo(u.from||l):d=wo(u),Wt(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[l]=d}}function Cl(t,i,o){Sn(De(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,o)}function lc(t,i,o,l){let u=l.includes(".")?Yu(o,l):()=>o[l];if(xt(t)){const d=i[t];We(d)&&$t(u,d)}else if(We(t))$t(u,t.bind(o));else if(dt(t))if(De(t))t.forEach(d=>lc(d,i,o,l));else{const d=We(t.handler)?t.handler.bind(o):i[t.handler];We(d)&&$t(u,d,t)}}function uc(t){const i=t.type,{mixins:o,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:h}}=t.appContext,v=d.get(i);let y;return v?y=v:!u.length&&!o&&!l?y=i:(y={},u.length&&u.forEach(C=>pa(y,C,h,!0)),pa(y,i,h)),dt(i)&&d.set(i,y),y}function pa(t,i,o,l=!1){const{mixins:u,extends:d}=i;d&&pa(t,d,o,!0),u&&u.forEach(h=>pa(t,h,o,!0));for(const h in i)if(!(l&&h==="expose")){const v=Tf[h]||o&&o[h];t[h]=v?v(t[h],i[h]):i[h]}return t}const Tf={data:Ll,props:Ml,emits:Ml,methods:go,computed:go,beforeCreate:qt,created:qt,beforeMount:qt,mounted:qt,beforeUpdate:qt,updated:qt,beforeDestroy:qt,beforeUnmount:qt,destroyed:qt,unmounted:qt,activated:qt,deactivated:qt,errorCaptured:qt,serverPrefetch:qt,components:go,directives:go,watch:Cf,provide:Ll,inject:Pf};function Ll(t,i){return i?t?function(){return It(We(t)?t.call(this,this):t,We(i)?i.call(this,this):i)}:i:t}function Pf(t,i){return go(wr(t),wr(i))}function wr(t){if(De(t)){const i={};for(let o=0;oi==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Pn(i)}Modifiers`]||t[`${zi(i)}Modifiers`];function Of(t,i,...o){if(t.isUnmounted)return;const l=t.vnode.props||mt;let u=o;const d=i.startsWith("update:"),h=d&&Ef(l,i.slice(7));h&&(h.trim&&(u=o.map(T=>xt(T)?T.trim():T)),h.number&&(u=o.map(Ta)));let v,y=l[v=Qa(i)]||l[v=Qa(Pn(i))];!y&&d&&(y=l[v=Qa(zi(i))]),y&&Sn(y,t,6,u);const C=l[v+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[v])return;t.emitted[v]=!0,Sn(C,t,6,u)}}const zf=new WeakMap;function dc(t,i,o=!1){const l=o?zf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const d=t.emits;let h={},v=!1;if(!We(t)){const y=C=>{const T=dc(C,i,!0);T&&(v=!0,It(h,T))};!o&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!d&&!v?(dt(t)&&l.set(t,null),null):(De(d)?d.forEach(y=>h[y]=null):It(h,d),dt(t)&&l.set(t,h),h)}function Oa(t,i){return!t||!wa(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ct(t,i[0].toLowerCase()+i.slice(1))||ct(t,zi(i))||ct(t,i))}function El(t){const{type:i,vnode:o,proxy:l,withProxy:u,propsOptions:[d],slots:h,attrs:v,emit:y,render:C,renderCache:T,props:O,data:B,setupState:V,ctx:H,inheritAttrs:F}=t,fe=fa(t);let ve,Y;try{if(o.shapeFlag&4){const he=u||l,ye=he;ve=Bn(C.call(ye,he,T,O,V,B,H)),Y=v}else{const he=i;ve=Bn(he.length>1?he(O,{attrs:v,slots:h,emit:y}):he(O,null)),Y=i.props?v:Af(v)}}catch(he){To.length=0,La(he,t,1),ve=z(Ht)}let Pe=ve;if(Y&&F!==!1){const he=Object.keys(Y),{shapeFlag:ye}=Pe;he.length&&ye&7&&(d&&he.some(ka)&&(Y=$f(Y,d)),Pe=Ei(Pe,Y,!1,!0))}return o.dirs&&(Pe=Ei(Pe,null,!1,!0),Pe.dirs=Pe.dirs?Pe.dirs.concat(o.dirs):o.dirs),o.transition&&Mo(Pe,o.transition),ve=Pe,fa(fe),ve}const Af=t=>{let i;for(const o in t)(o==="class"||o==="style"||wa(o))&&((i||(i={}))[o]=t[o]);return i},$f=(t,i)=>{const o={};for(const l in t)(!ka(l)||!(l.slice(9)in i))&&(o[l]=t[l]);return o};function If(t,i,o){const{props:l,children:u,component:d}=t,{props:h,children:v,patchFlag:y}=i,C=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&y>=0){if(y&1024)return!0;if(y&16)return l?Ol(l,h,C):!!h;if(y&8){const T=i.dynamicProps;for(let O=0;OObject.create(hc),mc=t=>Object.getPrototypeOf(t)===hc;function Nf(t,i,o,l=!1){const u={},d=pc();t.propsDefaults=Object.create(null),gc(t,i,u,d);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);o?t.props=l?u:Vd(u):t.type.props?t.props=u:t.props=d,t.attrs=d}function Rf(t,i,o,l){const{props:u,attrs:d,vnode:{patchFlag:h}}=t,v=lt(u),[y]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let O=0;O{y=!0;const[B,V]=vc(O,i,!0);It(h,B),V&&v.push(...V)};!o&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!d&&!y)return dt(t)&&l.set(t,Ms),Ms;if(De(d))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",Ur=t=>De(t)?t.map(Bn):[Bn(t)],Bf=(t,i,o)=>{if(i._n)return i;const l=Ce((...u)=>Ur(i(...u)),o);return l._c=!1,l},_c=(t,i,o)=>{const l=t._ctx;for(const u in t){if(Vr(u))continue;const d=t[u];if(We(d))i[u]=Bf(u,d,l);else if(d!=null){const h=Ur(d);i[u]=()=>h}}},yc=(t,i)=>{const o=Ur(i);t.slots.default=()=>o},bc=(t,i,o)=>{for(const l in i)(o||!Vr(l))&&(t[l]=i[l])},Vf=(t,i,o)=>{const l=t.slots=pc();if(t.vnode.shapeFlag&32){const u=i._;u?(bc(l,i,o),o&&ku(l,"_",u,!0)):_c(i,l)}else i&&yc(t,i)},Uf=(t,i,o)=>{const{vnode:l,slots:u}=t;let d=!0,h=mt;if(l.shapeFlag&32){const v=i._;v?o&&v===1?d=!1:bc(u,i,o):(d=!i.$stable,_c(i,u)),h=i}else i&&(yc(t,i),h={default:1});if(d)for(const v in u)!Vr(v)&&h[v]==null&&delete u[v]},Yt=Kf;function Zf(t){return Hf(t)}function Hf(t,i){const o=Pa();o.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:h,createText:v,createComment:y,setText:C,setElementText:T,parentNode:O,nextSibling:B,setScopeId:V=Un,insertStaticContent:H}=t,F=(b,_,w,K=null,G=null,Z=null,ne=void 0,se=null,Q=!!_.dynamicChildren)=>{if(b===_)return;b&&!ss(b,_)&&(K=E(b),Xe(b,G,Z,!0),b=null),_.patchFlag===-2&&(Q=!1,_.dynamicChildren=null);const{type:U,ref:Se,shapeFlag:I}=_;switch(U){case za:fe(b,_,w,K);break;case Ht:ve(b,_,w,K);break;case rr:b==null&&Y(_,w,K,ne);break;case re:te(b,_,w,K,G,Z,ne,se,Q);break;default:I&1?ye(b,_,w,K,G,Z,ne,se,Q):I&6?de(b,_,w,K,G,Z,ne,se,Q):(I&64||I&128)&&U.process(b,_,w,K,G,Z,ne,se,Q,vt)}Se!=null&&G?ko(Se,b&&b.ref,Z,_||b,!_):Se==null&&b&&b.ref!=null&&ko(b.ref,null,Z,b,!0)},fe=(b,_,w,K)=>{if(b==null)l(_.el=v(_.children),w,K);else{const G=_.el=b.el;_.children!==b.children&&C(G,_.children)}},ve=(b,_,w,K)=>{b==null?l(_.el=y(_.children||""),w,K):_.el=b.el},Y=(b,_,w,K)=>{[b.el,b.anchor]=H(b.children,_,w,K,b.el,b.anchor)},Pe=({el:b,anchor:_},w,K)=>{let G;for(;b&&b!==_;)G=B(b),l(b,w,K),b=G;l(_,w,K)},he=({el:b,anchor:_})=>{let w;for(;b&&b!==_;)w=B(b),u(b),b=w;u(_)},ye=(b,_,w,K,G,Z,ne,se,Q)=>{if(_.type==="svg"?ne="svg":_.type==="math"&&(ne="mathml"),b==null)Ne(_,w,K,G,Z,ne,se,Q);else{const U=b.el&&b.el._isVueCE?b.el:null;try{U&&U._beginPatch(),pe(b,_,G,Z,ne,se,Q)}finally{U&&U._endPatch()}}},Ne=(b,_,w,K,G,Z,ne,se)=>{let Q,U;const{props:Se,shapeFlag:I,transition:M,dirs:ee}=b;if(Q=b.el=h(b.type,Z,Se&&Se.is,Se),I&8?T(Q,b.children):I&16&&Ve(b.children,Q,null,K,G,ar(b,Z),ne,se),ee&&Xi(b,null,K,"created"),Ie(Q,b,b.scopeId,ne,K),Se){for(const Ze in Se)Ze!=="value"&&!yo(Ze)&&d(Q,Ze,null,Se[Ze],Z,K);"value"in Se&&d(Q,"value",null,Se.value,Z),(U=Se.onVnodeBeforeMount)&&Nn(U,K,b)}ee&&Xi(b,null,K,"beforeMount");const Re=jf(G,M);Re&&M.beforeEnter(Q),l(Q,_,w),((U=Se&&Se.onVnodeMounted)||Re||ee)&&Yt(()=>{try{U&&Nn(U,K,b),Re&&M.enter(Q),ee&&Xi(b,null,K,"mounted")}finally{}},G)},Ie=(b,_,w,K,G)=>{if(w&&V(b,w),K)for(let Z=0;Z{for(let U=Q;U{const se=_.el=b.el;let{patchFlag:Q,dynamicChildren:U,dirs:Se}=_;Q|=b.patchFlag&16;const I=b.props||mt,M=_.props||mt;let ee;if(w&&Qi(w,!1),(ee=M.onVnodeBeforeUpdate)&&Nn(ee,w,_,b),Se&&Xi(_,b,w,"beforeUpdate"),w&&Qi(w,!0),U&&(!b.dynamicChildren||b.dynamicChildren.length!==U.length)&&(Q=0,ne=!1,U=null),(I.innerHTML&&M.innerHTML==null||I.textContent&&M.textContent==null)&&T(se,""),U?ze(b.dynamicChildren,U,se,w,K,ar(_,G),Z):ne||ie(b,_,se,null,w,K,ar(_,G),Z,!1),Q>0){if(Q&16)Te(se,I,M,w,G);else if(Q&2&&I.class!==M.class&&d(se,"class",null,M.class,G),Q&4&&d(se,"style",I.style,M.style,G),Q&8){const Re=_.dynamicProps;for(let Ze=0;Ze{ee&&Nn(ee,w,_,b),Se&&Xi(_,b,w,"updated")},K)},ze=(b,_,w,K,G,Z,ne)=>{for(let se=0;se<_.length;se++){const Q=b[se],U=_[se],Se=Q.el&&(Q.type===re||!ss(Q,U)||Q.shapeFlag&198)?O(Q.el):w;F(Q,U,Se,null,K,G,Z,ne,!0)}},Te=(b,_,w,K,G)=>{if(_!==w){if(_!==mt)for(const Z in _)!yo(Z)&&!(Z in w)&&d(b,Z,_[Z],null,G,K);for(const Z in w){if(yo(Z))continue;const ne=w[Z],se=_[Z];ne!==se&&Z!=="value"&&d(b,Z,se,ne,G,K)}"value"in w&&d(b,"value",_.value,w.value,G)}},te=(b,_,w,K,G,Z,ne,se,Q)=>{const U=_.el=b?b.el:v(""),Se=_.anchor=b?b.anchor:v("");let{patchFlag:I,dynamicChildren:M,slotScopeIds:ee}=_;ee&&(se=se?se.concat(ee):ee),b==null?(l(U,w,K),l(Se,w,K),Ve(_.children||[],w,Se,G,Z,ne,se,Q)):I>0&&I&64&&M&&b.dynamicChildren&&b.dynamicChildren.length===M.length?(ze(b.dynamicChildren,M,w,G,Z,ne,se),(_.key!=null||G&&_===G.subTree)&&Zr(b,_,!0)):ie(b,_,w,Se,G,Z,ne,se,Q)},de=(b,_,w,K,G,Z,ne,se,Q)=>{_.slotScopeIds=se,b==null?_.shapeFlag&512?G.ctx.activate(_,w,K,ne,Q):_e(_,w,K,G,Z,ne,Q):be(b,_,Q)},_e=(b,_,w,K,G,Z,ne)=>{const se=b.component=eh(b,K,G);if(Ma(b)&&(se.ctx.renderer=vt),th(se,!1,ne),se.asyncDep){if(G&&G.registerDep(se,ae,ne),!b.el){const Q=se.subTree=z(Ht);ve(null,Q,_,w),b.placeholder=Q.el}}else ae(se,b,_,w,G,Z,ne)},be=(b,_,w)=>{const K=_.component=b.component;if(If(b,_,w))if(K.asyncDep&&!K.asyncResolved){le(K,_,w);return}else K.next=_,K.update();else _.el=b.el,K.vnode=_},ae=(b,_,w,K,G,Z,ne)=>{const se=()=>{if(b.isMounted){let{next:I,bu:M,u:ee,parent:Re,vnode:Ze}=b;{const wt=xc(b);if(wt){I&&(I.el=Ze.el,le(b,I,ne)),wt.asyncDep.then(()=>{Yt(()=>{b.isUnmounted||U()},G)});return}}let Ye=I,ht;Qi(b,!1),I?(I.el=Ze.el,le(b,I,ne)):I=Ze,M&&la(M),(ht=I.props&&I.props.onVnodeBeforeUpdate)&&Nn(ht,Re,I,Ze),Qi(b,!0);const ue=El(b),Ae=b.subTree;b.subTree=ue,F(Ae,ue,O(Ae.el),E(Ae),b,G,Z),I.el=ue.el,Ye===null&&Df(b,ue.el),ee&&Yt(ee,G),(ht=I.props&&I.props.onVnodeUpdated)&&Yt(()=>Nn(ht,Re,I,Ze),G)}else{let I;const{el:M,props:ee}=_,{bm:Re,m:Ze,parent:Ye,root:ht,type:ue}=b,Ae=zs(_);Qi(b,!1),Re&&la(Re),!Ae&&(I=ee&&ee.onVnodeBeforeMount)&&Nn(I,Ye,_),Qi(b,!0);{ht.ce&&ht.ce._hasShadowRoot()&&ht.ce._injectChildStyle(ue,b.parent?b.parent.type:void 0);const wt=b.subTree=El(b);F(null,wt,w,K,b,G,Z),_.el=wt.el}if(Ze&&Yt(Ze,G),!Ae&&(I=ee&&ee.onVnodeMounted)){const wt=_;Yt(()=>Nn(I,Ye,wt),G)}(_.shapeFlag&256||Ye&&zs(Ye.vnode)&&Ye.vnode.shapeFlag&256)&&b.a&&Yt(b.a,G),b.isMounted=!0,_=w=K=null}};b.scope.on();const Q=b.effect=new Cu(se);b.scope.off();const U=b.update=Q.run.bind(Q),Se=b.job=Q.runIfDirty.bind(Q);Se.i=b,Se.id=b.uid,Q.scheduler=()=>Br(Se),Qi(b,!0),U()},le=(b,_,w)=>{_.component=b;const K=b.vnode.props;b.vnode=_,b.next=null,Rf(b,_.props,K,w),Uf(b,_.children,w),Zn(),bl(b),Hn()},ie=(b,_,w,K,G,Z,ne,se,Q=!1)=>{const U=b&&b.children,Se=b?b.shapeFlag:0,I=_.children,{patchFlag:M,shapeFlag:ee}=_;if(M>0){if(M&128){me(U,I,w,K,G,Z,ne,se,Q);return}else if(M&256){rt(U,I,w,K,G,Z,ne,se,Q);return}}ee&8?(Se&16&&W(U,G,Z),I!==U&&T(w,I)):Se&16?ee&16?me(U,I,w,K,G,Z,ne,se,Q):W(U,G,Z,!0):(Se&8&&T(w,""),ee&16&&Ve(I,w,K,G,Z,ne,se,Q))},rt=(b,_,w,K,G,Z,ne,se,Q)=>{b=b||Ms,_=_||Ms;const U=b.length,Se=_.length,I=Math.min(U,Se);let M;for(M=0;MSe?W(b,G,Z,!0,!1,I):Ve(_,w,K,G,Z,ne,se,Q,I)},me=(b,_,w,K,G,Z,ne,se,Q)=>{let U=0;const Se=_.length;let I=b.length-1,M=Se-1;for(;U<=I&&U<=M;){const ee=b[U],Re=_[U]=Q?ri(_[U]):Bn(_[U]);if(ss(ee,Re))F(ee,Re,w,null,G,Z,ne,se,Q);else break;U++}for(;U<=I&&U<=M;){const ee=b[I],Re=_[M]=Q?ri(_[M]):Bn(_[M]);if(ss(ee,Re))F(ee,Re,w,null,G,Z,ne,se,Q);else break;I--,M--}if(U>I){if(U<=M){const ee=M+1,Re=eeM)for(;U<=I;)Xe(b[U],G,Z,!0),U++;else{const ee=U,Re=U,Ze=new Map;for(U=Re;U<=M;U++){const kt=_[U]=Q?ri(_[U]):Bn(_[U]);kt.key!=null&&Ze.set(kt.key,U)}let Ye,ht=0;const ue=M-Re+1;let Ae=!1,wt=0;const cn=new Array(ue);for(U=0;U=ue){Xe(kt,G,Z,!0);continue}let Dt;if(kt.key!=null)Dt=Ze.get(kt.key);else for(Ye=Re;Ye<=M;Ye++)if(cn[Ye-Re]===0&&ss(kt,_[Ye])){Dt=Ye;break}Dt===void 0?Xe(kt,G,Z,!0):(cn[Dt-Re]=U+1,Dt>=wt?wt=Dt:Ae=!0,F(kt,_[Dt],w,null,G,Z,ne,se,Q),ht++)}const tt=Ae?Wf(cn):Ms;for(Ye=tt.length-1,U=ue-1;U>=0;U--){const kt=Re+U,Dt=_[kt],on=_[kt+1],Qt=kt+1{const{el:Z,type:ne,transition:se,children:Q,shapeFlag:U}=b;if(U&6){Oe(b.component.subTree,_,w,K);return}if(U&128){b.suspense.move(_,w,K);return}if(U&64){ne.move(b,_,w,vt);return}if(ne===re){l(Z,_,w);for(let I=0;Ise.enter(Z),G));else{const{leave:I,delayLeave:M,afterLeave:ee}=se,Re=()=>{b.ctx.isUnmounted?u(Z):l(Z,_,w)},Ze=()=>{const Ye=Z._isLeaving||!!Z[xn];Z._isLeaving&&Z[xn](!0),se.persisted&&!Ye?Re():I(Z,()=>{Re(),ee&&ee()})};M?M(Z,Re,Ze):Ze()}else l(Z,_,w)},Xe=(b,_,w,K=!1,G=!1)=>{const{type:Z,props:ne,ref:se,children:Q,dynamicChildren:U,shapeFlag:Se,patchFlag:I,dirs:M,cacheIndex:ee,memo:Re}=b;if(I===-2&&(G=!1),se!=null&&(Zn(),ko(se,null,w,b,!0),Hn()),ee!=null&&(_.renderCache[ee]=void 0),Se&256){_.ctx.deactivate(b);return}const Ze=Se&1&&M,Ye=!zs(b);let ht;if(Ye&&(ht=ne&&ne.onVnodeBeforeUnmount)&&Nn(ht,_,b),Se&6)Ue(b.component,w,K);else{if(Se&128){b.suspense.unmount(w,K);return}Ze&&Xi(b,null,_,"beforeUnmount"),Se&64?b.type.remove(b,_,w,vt,K):U&&!U.hasOnce&&(Z!==re||I>0&&I&64)?W(U,_,w,!1,!0):(Z===re&&I&384||!G&&Se&16)&&W(Q,_,w),K&&ut(b)}const ue=Re!=null&&ee==null;(Ye&&(ht=ne&&ne.onVnodeUnmounted)||Ze||ue)&&Yt(()=>{ht&&Nn(ht,_,b),Ze&&Xi(b,null,_,"unmounted"),ue&&(b.el=null)},w)},ut=b=>{const{type:_,el:w,anchor:K,transition:G}=b;if(_===re){et(w,K);return}if(_===rr){he(b);return}const Z=()=>{u(w),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(b.shapeFlag&1&&G&&!G.persisted){const{leave:ne,delayLeave:se}=G,Q=()=>ne(w,Z);se?se(b.el,Z,Q):Q()}else Z()},et=(b,_)=>{let w;for(;b!==_;)w=B(b),u(b),b=w;u(_)},Ue=(b,_,w)=>{const{bum:K,scope:G,job:Z,subTree:ne,um:se,m:Q,a:U}=b;Al(Q),Al(U),K&&la(K),G.stop(),Z&&(Z.flags|=8,Xe(ne,b,_,w)),se&&Yt(se,_),Yt(()=>{b.isUnmounted=!0},_)},W=(b,_,w,K=!1,G=!1,Z=0)=>{for(let ne=Z;ne{if(b.shapeFlag&6)return E(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const _=B(b.anchor||b.el),w=_&&_[Ju];return w?B(w):_};let A=!1;const it=(b,_,w)=>{let K;b==null?_._vnode&&(Xe(_._vnode,null,null,!0),K=_._vnode.component):F(_._vnode||null,b,_,null,null,null,w),_._vnode=b,A||(A=!0,bl(K),ju(),A=!1)},vt={p:F,um:Xe,m:Oe,r:ut,mt:_e,mc:Ve,pc:ie,pbc:ze,n:E,o:t};return{render:it,hydrate:void 0,createApp:Mf(it)}}function ar({type:t,props:i},o){return o==="svg"&&t==="foreignObject"||o==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:o}function Qi({effect:t,job:i},o){o?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function jf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function Zr(t,i,o=!1){const l=t.children,u=i.children;if(De(l)&&De(u))for(let d=0;d>1,t[o[v]]0&&(i[l]=o[d-1]),o[d]=l)}}for(d=o.length,h=o[d-1];d-- >0;)o[d]=h,h=i[h];return o}function xc(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:xc(i)}function Al(t){if(t)for(let i=0;it.__isSuspense;function Kf(t,i){i&&i.pendingBranch?De(t)?i.effects.push(...t):i.effects.push(t):Xd(t)}const re=Symbol.for("v-fgt"),za=Symbol.for("v-txt"),Ht=Symbol.for("v-cmt"),rr=Symbol.for("v-stc"),To=[];let un=null;function p(t=!1){To.push(un=t?null:[])}function Gf(){To.pop(),un=To[To.length-1]||null}let Eo=1;function ma(t,i=!1){Eo+=t,t<0&&un&&i&&(un.hasOnce=!0)}function Sc(t){return t.dynamicChildren=Eo>0?un||Ms:null,Gf(),Eo>0&&un&&un.push(t),t}function g(t,i,o,l,u,d){return Sc(r(t,i,o,l,u,d,!0))}function at(t,i,o,l,u){return Sc(z(t,i,o,l,u,!0))}function Oo(t){return t?t.__v_isVNode===!0:!1}function ss(t,i){return t.type===i.type&&t.key===i.key}const Tc=({key:t})=>t??null,ua=({ref:t,ref_key:i,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?xt(t)||Wt(t)||We(t)?{i:jt,r:t,k:i,f:!!o}:t:null);function r(t,i=null,o=null,l=0,u=null,d=t===re?0:1,h=!1,v=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Tc(i),ref:i&&ua(i),scopeId:Ku,slotScopeIds:null,children:o,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:d,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:jt};return v?(ga(y,o),d&128&&t.normalize(y)):o&&(y.shapeFlag|=xt(o)?8:16),Eo>0&&!h&&un&&(y.patchFlag>0||d&6)&&y.patchFlag!==32&&un.push(y),y}const z=qf;function qf(t,i=null,o=null,l=0,u=null,d=!1){if((!t||t===bf)&&(t=Ht),Oo(t)){const v=Ei(t,i,!0);return o&&ga(v,o),Eo>0&&!d&&un&&(v.shapeFlag&6?un[un.indexOf(t)]=v:un.push(v)),v.patchFlag=-2,v}if(oh(t)&&(t=t.__vccOpts),i){i=Yf(i);let{class:v,style:y}=i;v&&!xt(v)&&(i.class=Ee(v)),dt(y)&&(Fr(y)&&!De(y)&&(y=It({},y)),i.style=Is(y))}const h=xt(t)?1:kc(t)?128:Xu(t)?64:dt(t)?4:We(t)?2:0;return r(t,i,o,l,u,h,d,!0)}function Yf(t){return t?Fr(t)||mc(t)?It({},t):t:null}function Ei(t,i,o=!1,l=!1){const{props:u,ref:d,patchFlag:h,children:v,transition:y}=t,C=i?Jf(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Tc(C),ref:i&&i.ref?o&&d?De(d)?d.concat(ua(i)):[d,ua(i)]:ua(i):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:v,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==re?h===-1?16:h|16:h,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:y,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ei(t.ssContent),ssFallback:t.ssFallback&&Ei(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&Mo(T,y.clone(T)),T}function D(t=" ",i=0){return z(za,null,t,i)}function R(t="",i=!1){return i?(p(),at(Ht,null,t)):z(Ht,null,t)}function Bn(t){return t==null||typeof t=="boolean"?z(Ht):De(t)?z(re,null,t.slice()):Oo(t)?ri(t):z(za,null,String(t))}function ri(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ei(t)}function ga(t,i){let o=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(De(i))o=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),ga(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=i._;!u&&!mc(i)?i._ctx=jt:u===3&&jt&&(jt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(We(i)){if(l&65){ga(t,{default:i});return}i={default:i,_ctx:jt},o=32}else i=String(i),l&64?(o=16,i=[D(i)]):o=8;t.children=i,t.shapeFlag|=o}function Jf(...t){const i={};for(let o=0;oXt||jt;let va,Sr;{const t=Pa(),i=(o,l)=>{let u;return(u=t[o])||(u=t[o]=[]),u.push(l),d=>{u.length>1?u.forEach(h=>h(d)):u[0](d)}};va=i("__VUE_INSTANCE_SETTERS__",o=>Xt=o),Sr=i("__VUE_SSR_SETTERS__",o=>zo=o)}const Do=t=>{const i=Xt;return va(t),t.scope.on(),()=>{t.scope.off(),va(i)}},$l=()=>{Xt&&Xt.scope.off(),va(null)};function Cc(t){return t.vnode.shapeFlag&4}let zo=!1;function th(t,i=!1,o=!1){i&&Sr(i);const{props:l,children:u}=t.vnode,d=Cc(t);Nf(t,l,d,i),Vf(t,u,o||i);const h=d?nh(t,i):void 0;return i&&Sr(!1),h}function nh(t,i){const o=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,wf);const{setup:l}=o;if(l){Zn();const u=t.setupContext=l.length>1?sh(t):null,d=Do(t),h=Io(l,t,0,[t.props,u]),v=yu(h);if(Hn(),d(),(v||t.sp)&&!zs(t)&&sc(t),v){if(h.then($l,$l),i)return h.then(y=>{Il(t,y)}).catch(y=>{La(y,t,0)});t.asyncDep=h}else Il(t,h)}else Lc(t)}function Il(t,i,o){We(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:dt(i)&&(t.setupState=Vu(i)),Lc(t)}function Lc(t,i,o){const l=t.type;t.render||(t.render=l.render||Un);{const u=Do(t);Zn();try{kf(t)}finally{Hn(),u()}}}const ih={get(t,i){return Zt(t,"get",""),t[i]}};function sh(t){const i=o=>{t.exposed=o||{}};return{attrs:new Proxy(t.attrs,ih),slots:t.slots,emit:t.emit,expose:i}}function Aa(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Vu(Ud(t.exposed)),{get(i,o){if(o in i)return i[o];if(o in So)return So[o](t)},has(i,o){return o in i||o in So}})):t.proxy}function oh(t){return We(t)&&"__vccOpts"in t}const ke=(t,i)=>Kd(t,i,zo);function ah(t,i,o){try{ma(-1);const l=arguments.length;return l===2?dt(i)&&!De(i)?Oo(i)?z(t,null,[i]):z(t,i):z(t,null,i):(l>3?o=Array.prototype.slice.call(arguments,2):l===3&&Oo(o)&&(o=[o]),z(t,i,o))}finally{ma(1)}}const rh="3.5.39";/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Tr;const Dl=typeof window<"u"&&window.trustedTypes;if(Dl)try{Tr=Dl.createPolicy("vue",{createHTML:t=>t})}catch{}const Mc=Tr?t=>Tr.createHTML(t):t=>t,lh="http://www.w3.org/2000/svg",uh="http://www.w3.org/1998/Math/MathML",ai=typeof document<"u"?document:null,Nl=ai&&ai.createElement("template"),ch={insert:(t,i,o)=>{i.insertBefore(t,o||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,o,l)=>{const u=i==="svg"?ai.createElementNS(lh,t):i==="mathml"?ai.createElementNS(uh,t):o?ai.createElement(t,{is:o}):ai.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>ai.createTextNode(t),createComment:t=>ai.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ai.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,o,l,u,d){const h=o?o.previousSibling:i.lastChild;if(u&&(u===d||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),o),!(u===d||!(u=u.nextSibling)););else{Nl.innerHTML=Mc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const v=Nl.content;if(l==="svg"||l==="mathml"){const y=v.firstChild;for(;y.firstChild;)v.appendChild(y.firstChild);v.removeChild(y)}i.insertBefore(v,o)}return[h?h.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},Ti="transition",ho="animation",Ao=Symbol("_vtc"),Ec={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},dh=It({},Qu,Ec),fh=t=>(t.displayName="Transition",t.props=dh,t),hh=fh((t,{slots:i})=>ah(uf,ph(t),i)),es=(t,i=[])=>{De(t)?t.forEach(o=>o(...i)):t&&t(...i)},Rl=t=>t?De(t)?t.some(i=>i.length>1):t.length>1:!1;function ph(t){const i={};for(const te in t)te in Ec||(i[te]=t[te]);if(t.css===!1)return i;const{name:o="v",type:l,duration:u,enterFromClass:d=`${o}-enter-from`,enterActiveClass:h=`${o}-enter-active`,enterToClass:v=`${o}-enter-to`,appearFromClass:y=d,appearActiveClass:C=h,appearToClass:T=v,leaveFromClass:O=`${o}-leave-from`,leaveActiveClass:B=`${o}-leave-active`,leaveToClass:V=`${o}-leave-to`}=t,H=mh(u),F=H&&H[0],fe=H&&H[1],{onBeforeEnter:ve,onEnter:Y,onEnterCancelled:Pe,onLeave:he,onLeaveCancelled:ye,onBeforeAppear:Ne=ve,onAppear:Ie=Y,onAppearCancelled:Ve=Pe}=i,pe=(te,de,_e,be)=>{te._enterCancelled=be,ts(te,de?T:v),ts(te,de?C:h),_e&&_e()},ze=(te,de)=>{te._isLeaving=!1,ts(te,O),ts(te,V),ts(te,B),de&&de()},Te=te=>(de,_e)=>{const be=te?Ie:Y,ae=()=>pe(de,te,_e);es(be,[de,ae]),Fl(()=>{ts(de,te?y:d),oi(de,te?T:v),Rl(be)||Bl(de,l,F,ae)})};return It(i,{onBeforeEnter(te){es(ve,[te]),oi(te,d),oi(te,h)},onBeforeAppear(te){es(Ne,[te]),oi(te,y),oi(te,C)},onEnter:Te(!1),onAppear:Te(!0),onLeave(te,de){te._isLeaving=!0;const _e=()=>ze(te,de);oi(te,O),te._enterCancelled?(oi(te,B),Zl(te)):(Zl(te),oi(te,B)),Fl(()=>{te._isLeaving&&(ts(te,O),oi(te,V),Rl(he)||Bl(te,l,fe,_e))}),es(he,[te,_e])},onEnterCancelled(te){pe(te,!1,void 0,!0),es(Pe,[te])},onAppearCancelled(te){pe(te,!0,void 0,!0),es(Ve,[te])},onLeaveCancelled(te){ze(te),es(ye,[te])}})}function mh(t){if(t==null)return null;if(dt(t))return[lr(t.enter),lr(t.leave)];{const i=lr(t);return[i,i]}}function lr(t){return pd(t)}function oi(t,i){i.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[Ao]||(t[Ao]=new Set)).add(i)}function ts(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const o=t[Ao];o&&(o.delete(i),o.size||(t[Ao]=void 0))}function Fl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let gh=0;function Bl(t,i,o,l){const u=t._endId=++gh,d=()=>{u===t._endId&&l()};if(o!=null)return setTimeout(d,o);const{type:h,timeout:v,propCount:y}=vh(t,i);if(!h)return l();const C=h+"end";let T=0;const O=()=>{t.removeEventListener(C,B),d()},B=V=>{V.target===t&&++T>=y&&O()};setTimeout(()=>{T(o[H]||"").split(", "),u=l(`${Ti}Delay`),d=l(`${Ti}Duration`),h=Vl(u,d),v=l(`${ho}Delay`),y=l(`${ho}Duration`),C=Vl(v,y);let T=null,O=0,B=0;i===Ti?h>0&&(T=Ti,O=h,B=d.length):i===ho?C>0&&(T=ho,O=C,B=y.length):(O=Math.max(h,C),T=O>0?h>C?Ti:ho:null,B=T?T===Ti?d.length:y.length:0);const V=T===Ti&&/\b(?:transform|all)(?:,|$)/.test(l(`${Ti}Property`).toString());return{type:T,timeout:O,propCount:B,hasTransform:V}}function Vl(t,i){for(;t.lengthUl(o)+Ul(t[l])))}function Ul(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Zl(t){return(t?t.ownerDocument:document).body.offsetHeight}function _h(t,i,o){const l=t[Ao];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):o?t.setAttribute("class",i):t.className=i}const _a=Symbol("_vod"),Oc=Symbol("_vsh"),yh={name:"show",beforeMount(t,{value:i},{transition:o}){t[_a]=t.style.display==="none"?"":t.style.display,o&&i?o.beforeEnter(t):po(t,i)},mounted(t,{value:i},{transition:o}){o&&i&&o.enter(t)},updated(t,{value:i,oldValue:o},{transition:l}){!i!=!o&&(l?i?(l.beforeEnter(t),po(t,!0),l.enter(t)):l.leave(t,()=>{po(t,!1)}):po(t,i))},beforeUnmount(t,{value:i}){po(t,i)}};function po(t,i){t.style.display=i?t[_a]:"none",t[Oc]=!i}const bh=Symbol(""),xh=/(?:^|;)\s*display\s*:/;function wh(t,i,o){const l=t.style,u=xt(o);let d=!1;if(o&&!u){if(i)if(xt(i))for(const h of i.split(";")){const v=h.slice(0,h.indexOf(":")).trim();o[v]==null&&vo(l,v,"")}else for(const h in i)o[h]==null&&vo(l,h,"");for(const h in o){h==="display"&&(d=!0);const v=o[h];v!=null?Sh(t,h,!xt(i)&&i?i[h]:void 0,v)||vo(l,h,v):vo(l,h,"")}}else if(u){if(i!==o){const h=l[bh];h&&(o+=";"+h),l.cssText=o,d=xh.test(o)}}else i&&t.removeAttribute("style");_a in t&&(t[_a]=d?l.display:"",t[Oc]&&(l.display="none"))}const Hl=/\s*!important$/;function vo(t,i,o){if(De(o))o.forEach(l=>vo(t,i,l));else if(o==null&&(o=""),i.startsWith("--"))t.setProperty(i,o);else{const l=kh(t,i);Hl.test(o)?t.setProperty(zi(l),o.replace(Hl,""),"important"):t[l]=o}}const jl=["Webkit","Moz","ms"],ur={};function kh(t,i){const o=ur[i];if(o)return o;let l=Pn(i);if(l!=="filter"&&l in t)return ur[i]=l;l=wu(l);for(let u=0;ucr||(Eh.then(()=>cr=0),cr=Date.now());function zh(t,i){const o=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=o.attached)return;const u=o.value;if(De(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const h=u.slice(),v=[l];for(let y=0;yt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Ah=(t,i,o,l,u,d)=>{const h=u==="svg";i==="class"?_h(t,l,h):i==="style"?wh(t,o,l):wa(i)?ka(i)||Ph(t,i,o,l,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):$h(t,i,l,h))?(Gl(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Kl(t,i,l,h,d,i!=="value")):t._isVueCE&&(Ih(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!xt(l)))?Gl(t,Pn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),Kl(t,i,l,h))};function $h(t,i,o,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Yl(i)&&We(o));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&t.tagName==="IFRAME"||i==="form"||i==="list"&&t.tagName==="INPUT"||i==="type"&&t.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return Yl(i)&&xt(o)?!1:i in t}function Ih(t,i){const o=t._def.props;if(!o)return!1;const l=Pn(i);return Array.isArray(o)?o.some(u=>Pn(u)===l):Object.keys(o).some(u=>Pn(u)===l)}const Oi=t=>{const i=t.props["onUpdate:modelValue"]||!1;return De(i)?o=>la(i,o):i};function Dh(t){t.target.composing=!0}function Jl(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const kn=Symbol("_assign");function Xl(t,i,o){return i&&(t=t.trim()),o&&(t=Ta(t)),t}const xe={created(t,{modifiers:{lazy:i,trim:o,number:l}},u){t[kn]=Oi(u);const d=l||u.props&&u.props.type==="number";ci(t,i?"change":"input",h=>{h.target.composing||t[kn](Xl(t.value,o,d))}),(o||d)&&ci(t,"change",()=>{t.value=Xl(t.value,o,d)}),i||(ci(t,"compositionstart",Dh),ci(t,"compositionend",Jl),ci(t,"change",Jl))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:o,modifiers:{lazy:l,trim:u,number:d}},h){if(t[kn]=Oi(h),t.composing)return;const v=(d||t.type==="number")&&!/^0\d/.test(t.value)?Ta(t.value):t.value,y=i??"";if(v===y)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===o||u&&t.value.trim()===y)||(t.value=y)}},ya={deep:!0,created(t,i,o){t[kn]=Oi(o),ci(t,"change",()=>{const l=t._modelValue,u=Ns(t),d=t.checked,h=t[kn];if(De(l)){const v=zr(l,u),y=v!==-1;if(d&&!y)h(l.concat(u));else if(!d&&y){const C=[...l];C.splice(v,1),h(C)}}else if(Rs(l)){const v=new Set(l);d?v.add(u):v.delete(u),h(v)}else h(zc(t,d))})},mounted:Ql,beforeUpdate(t,i,o){t[kn]=Oi(o),Ql(t,i,o)}};function Ql(t,{value:i,oldValue:o},l){t._modelValue=i;let u;if(De(i))u=zr(i,l.props.value)>-1;else if(Rs(i))u=i.has(l.props.value);else{if(i===o)return;u=Mi(i,zc(t,!0))}t.checked!==u&&(t.checked=u)}const Nh={created(t,{value:i},o){t.checked=Mi(i,o.props.value),t[kn]=Oi(o),ci(t,"change",()=>{t[kn](Ns(t))})},beforeUpdate(t,{value:i,oldValue:o},l){t[kn]=Oi(l),i!==o&&(t.checked=Mi(i,l.props.value))}},Et={deep:!0,created(t,{value:i,modifiers:{number:o}},l){const u=Rs(i);ci(t,"change",()=>{const d=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>o?Ta(Ns(h)):Ns(h));t[kn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,Zu(()=>{t._assigning=!1})}),t[kn]=Oi(l)},mounted(t,{value:i}){eu(t,i)},beforeUpdate(t,i,o){t[kn]=Oi(o)},updated(t,{value:i}){t._assigning||eu(t,i)}};function eu(t,i){const o=t.multiple,l=De(i);if(!(o&&!l&&!Rs(i))){for(let u=0,d=t.options.length;uString(C)===String(v)):h.selected=zr(i,v)>-1}else h.selected=i.has(v);else if(Mi(Ns(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ns(t){return"_value"in t?t._value:t.value}function zc(t,i){const o=i?"_trueValue":"_falseValue";return o in t?t[o]:i}const Rh={created(t,i,o){aa(t,i,o,null,"created")},mounted(t,i,o){aa(t,i,o,null,"mounted")},beforeUpdate(t,i,o,l){aa(t,i,o,l,"beforeUpdate")},updated(t,i,o,l){aa(t,i,o,l,"updated")}};function Fh(t,i){switch(t){case"SELECT":return Et;case"TEXTAREA":return xe;default:switch(i){case"checkbox":return ya;case"radio":return Nh;default:return xe}}}function aa(t,i,o,l,u){const h=Fh(t.tagName,o.props&&o.props.type)[u];h&&h(t,i,o,l)}const Bh=["ctrl","shift","alt","meta"],Vh={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,i)=>Bh.some(o=>t[`${o}Key`]&&!i.includes(o))},Hr=(t,i)=>{if(!t)return t;const o=t._withMods||(t._withMods={}),l=i.join(".");return o[l]||(o[l]=((u,...d)=>{for(let h=0;h{const o=t._withKeys||(t._withKeys={}),l=i.join(".");return o[l]||(o[l]=(u=>{if(!("key"in u))return;const d=zi(u.key);if(i.some(h=>h===d||Uh[h]===d))return t(u)}))},Zh=It({patchProp:Ah},ch);let nu;function Hh(){return nu||(nu=Zf(Zh))}const jh=((...t)=>{const i=Hh().createApp(...t),{mount:o}=i;return i.mount=l=>{const u=Kh(l);if(!u)return;const d=i._component;!We(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=o(u,!1,Wh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Wh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Kh(t){return xt(t)?document.querySelector(t):t}const Ac="pv_theme",iu={light:"#EEF0F3",dark:"#0B1730"},ba=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function $c(){return ba&&ba.matches?"dark":"light"}function Gh(){try{return localStorage.getItem(Ac)||"light"}catch{return"light"}}function Ic(t){return t==="system"?$c():t}function Dc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=iu[t]||iu.light}const rs=j(Gh()),$s=j(Ic(rs.value));function xa(t){rs.value=t;const i=Ic(t);$s.value=i,Dc(i);try{localStorage.setItem(Ac,t)}catch{}}function su(){xa($s.value==="dark"?"light":"dark")}ba&&ba.addEventListener("change",()=>{if(rs.value==="system"){const t=$c();$s.value=t,Dc(t)}});async function qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function ou(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function Yh(t,i,o){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:o})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Jh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function Xh(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function Qh(){try{const t=await fetch("/bff/users");return t.ok?{ok:!0,status:200,users:(await t.json()).users||[]}:{ok:!1,status:t.status,users:[]}}catch{return{ok:!1,status:0,users:[]}}}async function ep(t,i,o,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:o,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function tp(t,i){const o=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function np(t){const i=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function ip(){try{const t=await fetch("/bff/orgs");return t.ok?{ok:!0,status:200,organizations:(await t.json()).organizations||[]}:{ok:!1,status:t.status,organizations:[]}}catch{return{ok:!1,status:0,organizations:[]}}}async function sp(t){const i=await fetch("/bff/orgs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function op(t,i){const o=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function ap(t){const i=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function rp(){try{const t=await fetch("/bff/preferences");if(!t.ok)return null;const i=await t.json();return i&&typeof i.preferences=="object"?i.preferences:null}catch{return null}}async function lp(t){try{return(await fetch("/bff/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:t})})).ok}catch{return!1}}async function up(){try{const t=await fetch("/bff/integrations/opensky");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function au(t){const i=await fetch("/bff/integrations/opensky",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function cp(){const t=await fetch("/bff/integrations/opensky/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function dp(){try{const t=await fetch("/bff/integrations/opensky/states");if(!t.ok)return{states:[],unavailable:!0,detail:"OpenSky unavailable"};const i=await t.json();return{states:i.states||[],time:i.time,unavailable:!!i.unavailable,detail:i.detail||"",plan:i.plan||"",recommendedInterval:i.recommendedInterval||0}}catch{return{states:[],unavailable:!0,detail:"OpenSky unavailable"}}}async function fp(){try{const t=await fetch("/bff/integrations/filetransfer");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function ru(t){const i=await fetch("/bff/integrations/filetransfer",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function hp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function pp(){try{const t=await fetch("/bff/integrations/localstorage");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function ra(t){const i=await fetch("/bff/integrations/localstorage",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function mp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function gp(){try{const t=await fetch("/bff/integrations/webdav");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function lu(t){const i=await fetch("/bff/integrations/webdav",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function vp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Nc(){try{const t=await fetch("/bff/drones");return t.ok?{ok:!0,status:200,drones:(await t.json()).drones||[]}:{ok:!1,status:t.status,drones:[]}}catch{return{ok:!1,status:0,drones:[]}}}async function _p(t){const i=await fetch("/bff/drones",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function yp(t,i){const o=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function bp(t){const i=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function xp(){try{const t=await fetch("/bff/flights");return t.ok?{ok:!0,status:200,flights:(await t.json()).flights||[]}:{ok:!1,status:t.status,flights:[]}}catch{return{ok:!1,status:0,flights:[]}}}async function wp(t){const i=await fetch("/bff/flights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function kp(t,i){const o=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Sp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Tp(){return"/bff/logbook/export"}async function Pp(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",o=await fetch(`/bff/documents${i}`);return o.ok?{ok:!0,status:200,documents:(await o.json()).documents||[]}:{ok:!1,status:o.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function Cp(t,i){const o=new FormData;Object.entries(t).forEach(([u,d])=>{d!=null&&d!==""&&o.append(u,d)}),i&&o.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:o});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Lp(t,i){const o=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Mp(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function dr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Ep(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Op(t,i,o){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:o})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Rc="pv_prefs",Pr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,showAirTraffic:!0,airTrafficInterval:"auto",twoFactor:!1};function zp(){try{return{...Pr,...JSON.parse(localStorage.getItem(Rc)||"{}")||{}}}catch{return{...Pr}}}const we=bt(zp());function Fc(){try{localStorage.setItem(Rc,JSON.stringify(we))}catch{}}function Bc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(Pr))i in t&&(we[i]=t[i]);return!0}const Ap={sm:15,md:16,lg:18};function jr(t){document.documentElement.style.fontSize=(Ap[t]||16)+"px"}function Wr(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Vc(t){const i=new Date(t),o=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let d;switch(we.dateFormat){case"DMY":d=`${u}/${l}/${o}`;break;case"YMD":d=`${o}/${l}/${u}`;break;case"ISO":d=`${o}-${l}-${u}`;break;default:d=`${l}/${u}/${o}`}let h;return we.timeFormat==="12"?h=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):h=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:h}}function uu(t){return Vc(t).time}function cu(t){const i=Vc(t);return`${i.date} ${i.time}`}let Kr=!1,Cr=!1,Lr=null;function $p(){return{...JSON.parse(JSON.stringify(we)),themeMode:rs.value}}function Gr(){!Kr||Cr||(clearTimeout(Lr),Lr=setTimeout(()=>{lp($p())},600))}function Ip(t){Cr=!0;try{Bc(t),t.themeMode&&xa(t.themeMode),jr(we.fontSize),Wr(we.reduceMotion),Fc()}finally{Cr=!1}}async function du(){Kr=!0;const t=await rp();t&&Object.keys(t).length?Ip(t):Gr()}function Dp(){Kr=!1,clearTimeout(Lr)}$t(we,()=>{Fc(),Gr()},{deep:!0});$t(rs,Gr);$t(()=>we.fontSize,jr,{immediate:!0});$t(()=>we.reduceMotion,Wr,{immediate:!0});const Np=["width","height"],Uc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,o)=>(p(),g("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...o[0]||(o[0]=[r("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[r("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),r("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Np))}},Rp=["title","aria-label"],Fp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Bp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Vp={__name:"ThemeToggle",setup(t){return(i,o)=>(p(),g("button",{class:"btn-icon",type:"button",title:$e($s)==="dark"?"Switch to light":"Switch to dark","aria-label":$e($s)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...l)=>$e(su)&&$e(su)(...l))},[$e($s)==="dark"?(p(),g("svg",Fp,[...o[1]||(o[1]=[r("circle",{cx:"12",cy:"12",r:"4"},null,-1),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(p(),g("svg",Bp,[...o[2]||(o[2]=[r("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Rp))}},Up={class:"relative grid h-full place-items-center p-5"},Zp={class:"absolute right-5 top-5"},Hp={class:"mb-6 flex items-center gap-3 text-ink"},jp={class:"relative mb-1"},Wp=["type"],Kp=["aria-label","title"],Gp={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},qp={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},Yp={key:0,class:"mt-4"},Jp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Xp=["disabled"],Qp={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const o=t,l=i,u=j(""),d=j(""),h=j(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),v=j(!1),y=j(!1),C=j(!1),T=j("");async function O(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:B,status:V,body:H}=await Yh(u.value.trim(),d.value,h.value.trim());if(C.value=!1,B){l("signed-in",H.email);return}T.value=V===400?"Invalid email or password.":V===502?"API server can't reach PocketBase.":H.message||H.error||"Cannot reach the API server."}return(B,V)=>(p(),g("div",Up,[r("div",Zp,[z(Vp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:Hr(O,["prevent"])},[r("div",Hp,[z(Uc,{size:34}),V[5]||(V[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),V[9]||(V[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),oe(r("input",{"onUpdate:modelValue":V[0]||(V[0]=H=>u.value=H),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[xe,u.value]]),V[10]||(V[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",jp,[oe(r("input",{"onUpdate:modelValue":V[1]||(V[1]=H=>d.value=H),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Wp),[[Rh,d.value]]),r("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":y.value?"Hide password":"Show password",title:y.value?"Hide password":"Show password",onClick:V[2]||(V[2]=H=>y.value=!y.value)},[y.value?(p(),g("svg",Gp,[...V[6]||(V[6]=[r("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),r("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),g("svg",qp,[...V[7]||(V[7]=[r("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),r("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Kp)]),v.value?(p(),g("div",Yp,[V[8]||(V[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),oe(r("input",{"onUpdate:modelValue":V[3]||(V[3]=H=>h.value=H),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[xe,h.value]])])):R("",!0),T.value?(p(),g("p",Jp,S(T.value),1)):R("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},S(C.value?"Signing in…":"Sign in"),9,Xp),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:V[4]||(V[4]=H=>v.value=!v.value)},S(v.value?"Hide server settings":"Server settings"),1)],32)]))}};function em(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _o={exports:{}};/* @preserve - * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com - * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */var tm=_o.exports,fu;function nm(){return fu||(fu=1,(function(t,i){(function(o,l){l(i)})(tm,(function(o){var l="1.9.4";function u(e){var n,s,a,c;for(s=1,a=arguments.length;s"u"||!L||!L.Mixin)){e=Pe(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ie.prototype={clone:function(){return new ie(this.x,this.y)},add:function(e){return this.clone()._add(me(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(me(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new ie(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ie(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=rt(this.x),this.y=rt(this.y),this},distanceTo:function(e){e=me(e);var n=e.x-this.x,s=e.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(e){return e=me(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=me(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+B(this.x)+", "+B(this.y)+")"}};function me(e,n,s){return e instanceof ie?e:Pe(e)?new ie(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ie(e.x,e.y):new ie(e,n,s)}function Oe(e,n){if(e)for(var s=n?[e,n]:e,a=0,c=s.length;a=this.min.x&&s.x<=this.max.x&&n.y>=this.min.y&&s.y<=this.max.y},intersects:function(e){e=Xe(e);var n=this.min,s=this.max,a=e.min,c=e.max,m=c.x>=n.x&&a.x<=s.x,P=c.y>=n.y&&a.y<=s.y;return m&&P},overlaps:function(e){e=Xe(e);var n=this.min,s=this.max,a=e.min,c=e.max,m=c.x>n.x&&a.xn.y&&a.y=n.lat&&c.lat<=s.lat&&a.lng>=n.lng&&c.lng<=s.lng},intersects:function(e){e=et(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>=n.lat&&a.lat<=s.lat,P=c.lng>=n.lng&&a.lng<=s.lng;return m&&P},overlaps:function(e){e=et(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>n.lat&&a.latn.lng&&a.lng1,Ft=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",O,n),window.removeEventListener("testPassiveEventSupport",O,n)}catch{}return e})(),en=(function(){return!!document.createElement("canvas").getContext})(),yt=!!(document.createElementNS&&K("svg").createSVGRect),Ia=!!yt&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ro=!yt&&(function(){try{var e=document.createElement("div");e.innerHTML='';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch{return!1}})(),Us=navigator.platform.indexOf("Mac")===0,Da=navigator.platform.indexOf("Linux")===0;function fn(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var Le={ie:ne,ielt9:se,edge:Q,webkit:U,android:Se,android23:I,androidStock:ee,opera:Re,chrome:Ze,gecko:Ye,safari:ht,phantom:ue,opera12:Ae,win:wt,ie3d:cn,webkit3d:tt,gecko3d:kt,any3d:Dt,mobile:on,mobileWebkit:Qt,mobileWebkit3d:pi,msPointer:Bs,pointer:No,touch:Vs,touchNative:ls,mobileOpera:$a,mobileGecko:dn,retina:us,passiveEvents:Ft,canvas:en,svg:yt,vml:Ro,inlineSvg:Ia,mac:Us,linux:Da},Fo=Le.msPointer?"MSPointerDown":"pointerdown",Zs=Le.msPointer?"MSPointerMove":"pointermove",Bo=Le.msPointer?"MSPointerUp":"pointerup",Vo=Le.msPointer?"MSPointerCancel":"pointercancel",Hs={touchstart:Fo,touchmove:Zs,touchend:Bo,touchcancel:Vo},ot={touchstart:js,touchmove:hs,touchend:hs,touchcancel:hs},an={},cs=!1;function Bt(e,n,s){return n==="touchstart"&&mi(),ot[n]?(s=ot[n].bind(this,s),e.addEventListener(Hs[n],s,!1),s):(console.warn("wrong event specified:",n),O)}function Ai(e,n,s){if(!Hs[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(Hs[n],s,!1)}function ds(e){an[e.pointerId]=e}function fs(e){an[e.pointerId]&&(an[e.pointerId]=e)}function hn(e){delete an[e.pointerId]}function mi(){cs||(document.addEventListener(Fo,ds,!0),document.addEventListener(Zs,fs,!0),document.addEventListener(Bo,hn,!0),document.addEventListener(Vo,hn,!0),cs=!0)}function hs(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in an)n.touches.push(an[s]);n.changedTouches=[n],e(n)}}function js(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&St(n),hs(e,n)}function Ws(e){var n={},s,a;for(a in e)s=e[a],n[a]=s&&s.bind?s.bind(e):s;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var Na=200;function pn(e,n){e.addEventListener("dblclick",n);var s=0,a;function c(m){if(m.detail!==1){a=m.detail;return}if(!(m.pointerType==="mouse"||m.sourceCapabilities&&!m.sourceCapabilities.firesTouchEvents)){var P=_s(m);if(!(P.some(function(N){return N instanceof HTMLLabelElement&&N.attributes.for})&&!P.some(function(N){return N instanceof HTMLInputElement||N instanceof HTMLSelectElement}))){var $=Date.now();$-s<=Na?(a++,a===2&&n(Ws(m))):a=1,s=$}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function En(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var On=Kn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Vt=Kn(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Ks=Vt==="webkitTransition"||Vt==="OTransition"?Vt+"End":"transitionend";function ps(e){return typeof e=="string"?document.getElementById(e):e}function $i(e,n){var s=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!s||s==="auto")&&document.defaultView){var a=document.defaultView.getComputedStyle(e,null);s=a?a[n]:null}return s==="auto"?null:s}function nt(e,n,s){var a=document.createElement(e);return a.className=n||"",s&&s.appendChild(a),a}function _t(e){var n=e.parentNode;n&&n.removeChild(e)}function ms(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function jn(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function gi(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function Gs(e,n){if(e.classList!==void 0)return e.classList.contains(n);var s=Wn(e);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function je(e,n){if(e.classList!==void 0)for(var s=H(n),a=0,c=s.length;a0?2*window.devicePixelRatio:1;function Yn(e){return Le.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Kt:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function ys(e,n){var s=n.relatedTarget;if(!s)return!0;try{for(;s&&s!==e;)s=s.parentNode}catch{return!1}return s!==e}var Fa={__proto__:null,on:He,off:ft,stopPropagation:An,disableScrollPropagation:eo,disableClickPropagation:qn,preventDefault:St,stop:gn,getPropagationPath:_s,getMousePosition:Qe,getWheelDelta:Yn,isExternalTarget:ys,addListener:He,removeListener:ft},bs=le.extend({run:function(e,n,s,a){this.stop(),this._el=e,this._inProgress=!0,this._duration=s||.25,this._easeOutPower=1/Math.max(a||.5,.2),this._startPos=rn(e),this._offset=n.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=Te(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,s=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var s=this.getCenter(),a=this._limitCenter(s,this._zoom,et(e));return s.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var s=me(n.paddingTopLeft||n.padding||[0,0]),a=me(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),m=this.project(e),P=this.getPixelBounds(),$=Xe([P.min.add(s),P.max.subtract(a)]),N=$.getSize();if(!$.contains(m)){this._enforcingBounds=!0;var J=m.subtract($.getCenter()),ge=$.extend(m).getSize().subtract(N);c.x+=J.x<0?-ge.x:ge.x,c.y+=J.y<0?-ge.y:ge.y,this.panTo(this.unproject(c),n),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=u({animate:!1,pan:!0},e===!0?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var s=this.getSize(),a=n.divideBy(2).round(),c=s.divideBy(2).round(),m=a.subtract(c);return!m.x&&!m.y?this:(e.animate&&e.pan?this.panBy(m):(e.pan&&this._rawPanBy(m),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:s}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=u({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),s=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,s,e):navigator.geolocation.getCurrentPosition(n,s,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var n=e.code,s=e.message||(n===1?"permission denied":n===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:n,message:"Geolocation error: "+s+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,s=e.coords.longitude,a=new Ue(n,s),c=a.toBounds(e.coords.accuracy*2),m=this._locateOptions;if(m.setView){var P=this.getBoundsZoom(c);this.setView(a,m.maxZoom?Math.min(P,m.maxZoom):P)}var $={latlng:a,bounds:c,timestamp:e.timestamp};for(var N in e.coords)typeof e.coords[N]=="number"&&($[N]=e.coords[N]);this.fire("locationfound",$)}},addHandler:function(e,n){if(!n)return this;var s=this[e]=new n(this);return this._handlers.push(s),this.options[e]&&s.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),_t(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(te(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var e;for(e in this._layers)this._layers[e].remove();for(e in this._panes)_t(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var s="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),a=nt("div",s,n||this._mapPane);return e&&(this._panes[e]=a),a},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),s=this.unproject(e.getTopRight());return new ut(n,s)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,n,s){e=et(e),s=me(s||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),m=this.getMaxZoom(),P=e.getNorthWest(),$=e.getSouthEast(),N=this.getSize().subtract(s),J=Xe(this.project($,a),this.project(P,a)).getSize(),ge=Le.any3d?this.options.zoomSnap:1,Fe=N.x/J.x,Ge=N.y/J.y,Gt=n?Math.max(Fe,Ge):Math.min(Fe,Ge);return a=this.getScaleZoom(Gt,a),ge&&(a=Math.round(a/(ge/100))*(ge/100),a=n?Math.ceil(a/ge)*ge:Math.floor(a/ge)*ge),Math.max(c,Math.min(m,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ie(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var s=this._getTopLeftPoint(e,n);return new Oe(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,n){var s=this.options.crs;return n=n===void 0?this._zoom:n,s.scale(e)/s.scale(n)},getScaleZoom:function(e,n){var s=this.options.crs;n=n===void 0?this._zoom:n;var a=s.zoom(e*s.scale(n));return isNaN(a)?1/0:a},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(W(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(me(e),n)},layerPointToLatLng:function(e){var n=me(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(W(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(W(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(et(e))},distance:function(e,n){return this.options.crs.distance(W(e),W(n))},containerPointToLayerPoint:function(e){return me(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return me(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(me(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(e)))},mouseEventToContainerPoint:function(e){return Qe(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var n=this._container=ps(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");He(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&Le.any3d,je(e,"leaflet-container"+(Le.touch?" leaflet-touch":"")+(Le.retina?" leaflet-retina":"")+(Le.ielt9?" leaflet-oldie":"")+(Le.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=$i(e,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&n!=="sticky"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),pt(this._mapPane,new ie(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(je(e.markerPane,"leaflet-zoom-hide"),je(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,s){pt(this._mapPane,new ie(0,0));var a=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,s)._move(e,n)._moveEnd(c),this.fire("viewreset"),a&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,s,a){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),a?s&&s.pinch&&this.fire("zoom",s):((c||s&&s.pinch)&&this.fire("zoom",s),this.fire("move",s)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return te(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){pt(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[y(this._container)]=this;var n=e?ft:He;n(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&n(window,"resize",this._onResize,this),Le.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){te(this._resizeRequest),this._resizeRequest=Te(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,n){for(var s=[],a,c=n==="mouseout"||n==="mouseover",m=e.target||e.srcElement,P=!1;m;){if(a=this._targets[y(m)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!ys(m,e)||(s.push(a),c))||m===this._container)break;m=m.parentNode}return!s.length&&!P&&!c&&this.listens(n,!0)&&(s=[this]),s},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var n=e.target||e.srcElement;if(!(!this._loaded||n._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(n))){var s=e.type;s==="mousedown"&&qs(n),this._fireDOMEvent(e,s)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,s){if(e.type==="click"){var a=u({},e);a.type="preclick",this._fireDOMEvent(a,a.type,s)}var c=this._findEventTargets(e,n);if(s){for(var m=[],P=0;P0?Math.round(e-n)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(n))},_limitZoom:function(e){var n=this.getMinZoom(),s=this.getMaxZoom(),a=Le.any3d?this.options.zoomSnap:1;return a&&(e=Math.round(e/a)*a),Math.max(n,Math.min(s,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ce(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var s=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(s)?!1:(this.panBy(s,n),!0)},_createAnimProxy:function(){var e=this._proxy=nt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var s=On,a=this._proxy.style[s];Nt(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),a===this._proxy.style[s]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){_t(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();Nt(this._proxy,this.project(e,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,n,s){if(this._animatingZoom)return!0;if(s=s||{},!this._zoomAnimated||s.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var a=this.getZoomScale(n),c=this._getCenterOffset(e)._divideBy(1-1/a);return s.animate!==!0&&!this.getSize().contains(c)?!1:(Te(function(){this._moveStart(!0,s.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,s,a){this._mapPane&&(s&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,je(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:n,noUpdate:a}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ce(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ba(e,n){return new Je(e,n)}var ln=_e.extend({options:{position:"topright"},initialize:function(e){F(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var n=this._map;return n&&n.removeControl(this),this.options.position=e,n&&n.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var n=this._container=this.onAdd(e),s=this.getPosition(),a=e._controlCorners[s];return je(n,"leaflet-control"),s.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(_t(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),Fi=function(e){return new ln(e)};Je.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",s=this._controlContainer=nt("div",n+"control-container",this._container);function a(c,m){var P=n+c+" "+n+m;e[c+m]=nt("div",P,s)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)_t(this._controlCorners[e]);_t(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var bi=ln.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,s,a){return s1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=n&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var n=this._getLayer(y(e.target)),s=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;s&&this._map.fire(s,n)},_createRadioElement:function(e,n){var s='",a=document.createElement("div");return a.innerHTML=s,a.firstChild},_addItem:function(e){var n=document.createElement("label"),s=this._map.hasLayer(e.layer),a;e.overlay?(a=document.createElement("input"),a.type="checkbox",a.className="leaflet-control-layers-selector",a.defaultChecked=s):a=this._createRadioElement("leaflet-base-layers_"+y(this),s),this._layerControlInputs.push(a),a.layerId=y(e.layer),He(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var m=document.createElement("span");n.appendChild(m),m.appendChild(a),m.appendChild(c);var P=e.overlay?this._overlaysList:this._baseLayersList;return P.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,n,s,a=[],c=[];this._handlingClick=!0;for(var m=e.length-1;m>=0;m--)n=e[m],s=this._getLayer(n.layerId).layer,n.checked?a.push(s):n.checked||c.push(s);for(m=0;m=0;c--)n=e[c],s=this._getLayer(n.layerId).layer,n.disabled=s.options.minZoom!==void 0&&as.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,He(e,"click",St),this.expand();var n=this;setTimeout(function(){ft(e,"click",St),n._preventClick=!1})}}),Zo=function(e,n,s){return new bi(e,n,s)},xi=ln.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",s=nt("div",n+" leaflet-bar"),a=this.options;return this._zoomInButton=this._createButton(a.zoomInText,a.zoomInTitle,n+"-in",s,this._zoomIn),this._zoomOutButton=this._createButton(a.zoomOutText,a.zoomOutTitle,n+"-out",s,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),s},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,s,a,c){var m=nt("a",s,a);return m.innerHTML=e,m.href="#",m.title=n,m.setAttribute("role","button"),m.setAttribute("aria-label",n),qn(m),He(m,"click",gn),He(m,"click",c,this),He(m,"click",this._refocusOnMap,this),m},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";ce(this._zoomInButton,n),ce(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(je(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(je(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Je.mergeOptions({zoomControl:!0}),Je.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new xi,this.addControl(this.zoomControl))});var Bi=function(e){return new xi(e)},Vi=ln.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=nt("div",n),a=this.options;return this._addScales(a,n+"-line",s),e.on(a.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),s},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,s){e.metric&&(this._mScale=nt("div",n,s)),e.imperial&&(this._iScale=nt("div",n,s))},_update:function(){var e=this._map,n=e.getSize().y/2,s=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(s)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var n=this._getRoundNum(e),s=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,s,n/e)},_updateImperial:function(e){var n=e*3.2808399,s,a,c;n>5280?(s=n/5280,a=this._getRoundNum(s),this._updateScale(this._iScale,a+" mi",a/s)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/n))},_updateScale:function(e,n,s){e.style.width=Math.round(this.options.maxWidth*s)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),s=e/n;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,n*s}}),to=function(e){return new Vi(e)},Va='',no=ln.extend({options:{position:"bottomright",prefix:''+(Le.inlineSvg?Va+" ":"")+"Leaflet"},initialize:function(e){F(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=nt("div","leaflet-control-attribution"),qn(this._container);for(var n in e._layers)e._layers[n].getAttribution&&this.addAttribution(e._layers[n].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var n in this._attributions)this._attributions[n]&&e.push(n);var s=[];this.options.prefix&&s.push(this.options.prefix),e.length&&s.push(e.join(", ")),this._container.innerHTML=s.join(' ')}}});Je.mergeOptions({attributionControl:!0}),Je.addInitHook(function(){this.options.attributionControl&&new no().addTo(this)});var Ua=function(e){return new no(e)};ln.Layers=bi,ln.Zoom=xi,ln.Scale=Vi,ln.Attribution=no,Fi.layers=Zo,Fi.zoom=Bi,Fi.scale=to,Fi.attribution=Ua;var Tt=_e.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Tt.addTo=function(e,n){return e.addHandler(n,this),this};var Za={Events:ae},Ho=Le.touch?"touchstart mousedown":"mousedown",$n=le.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){F(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(He(this._dragStartTarget,Ho,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&($n._dragging===this&&this.finishDrag(!0),ft(this._dragStartTarget,Ho,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!Gs(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){$n._dragging===this&&this.finishDrag();return}if(!($n._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&($n._dragging=this,this._preventOutline&&qs(this._element),Ut(),vi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=yi(this._element);this._startPoint=new ie(n.clientX,n.clientY),this._startPos=rn(this._element),this._parentScale=Ys(s);var a=e.type==="mousedown";He(document,a?"mousemove":"touchmove",this._onMove,this),He(document,a?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,s=new ie(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)m&&(P=$,m=N);m>s&&(n[P]=1,Si(e,n,s,a,P),Si(e,n,s,P,c))}function ji(e,n){for(var s=[e[0]],a=1,c=0,m=e.length;an&&(s.push(e[a]),c=a);return cn.max.x&&(s|=2),e.yn.max.y&&(s|=8),s}function Ha(e,n){var s=n.x-e.x,a=n.y-e.y;return s*s+a*a}function qe(e,n,s,a){var c=n.x,m=n.y,P=s.x-c,$=s.y-m,N=P*P+$*$,J;return N>0&&(J=((e.x-c)*P+(e.y-m)*$)/N,J>1?(c=s.x,m=s.y):J>0&&(c+=P*J,m+=$*J)),P=e.x-c,$=e.y-m,a?P*P+$*$:new ie(c,m)}function Pt(e){return!Pe(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Wi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Pt(e)}function xs(e,n){var s,a,c,m,P,$,N,J;if(!e||e.length===0)throw new Error("latlngs not passed");Pt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var ge=W([0,0]),Fe=et(e),Ge=Fe.getNorthWest().distanceTo(Fe.getSouthWest())*Fe.getNorthEast().distanceTo(Fe.getNorthWest());Ge<1700&&(ge=ki(e));var Gt=e.length,At=[];for(s=0;sa){N=(m-a)/c,J=[$.x-N*($.x-P.x),$.y-N*($.y-P.y)];break}var nn=n.unproject(me(J));return W([nn.lat+ge.lat,nn.lng+ge.lng])}var ja={__proto__:null,simplify:Jn,pointToSegmentDistance:Zi,closestPointOnSegment:Hi,clipSegment:Xn,_getEdgeIntersection:Qn,_getBitCode:ei,_sqClosestPointOnSegment:qe,isFlat:Pt,_flat:Wi,polylineCenter:xs},ws={project:function(e){return new ie(e.lng,e.lat)},unproject:function(e){return new Ue(e.y,e.x)},bounds:new Oe([-180,-90],[180,90])},so={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Oe([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,s=this.R,a=e.lat*n,c=this.R_MINOR/s,m=Math.sqrt(1-c*c),P=m*Math.sin(a),$=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),m/2);return a=-s*Math.log(Math.max($,1e-10)),new ie(e.lng*n*s,a)},unproject:function(e){for(var n=180/Math.PI,s=this.R,a=this.R_MINOR/s,c=Math.sqrt(1-a*a),m=Math.exp(-e.y/s),P=Math.PI/2-2*Math.atan(m),$=0,N=.1,J;$<15&&Math.abs(N)>1e-7;$++)J=c*Math.sin(P),J=Math.pow((1-J)/(1+J),c/2),N=Math.PI/2-2*Math.atan(m*J)-P,P+=N;return new Ue(P*n,e.x*n/s)}},ks={__proto__:null,LonLat:ws,Mercator:so,SphericalMercator:vt},Ki=u({},A,{code:"EPSG:3395",projection:so,transformation:(function(){var e=.5/(Math.PI*so.R);return b(e,.5,-e,.5)})()}),Gi=u({},A,{code:"EPSG:4326",projection:ws,transformation:b(1/180,1,-1/180,.5)}),qi=u({},E,{projection:ws,transformation:b(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,n){var s=n.lng-e.lng,a=n.lat-e.lat;return Math.sqrt(s*s+a*a)},infinite:!0});E.Earth=A,E.EPSG3395=Ki,E.EPSG3857=_,E.EPSG900913=w,E.EPSG4326=Gi,E.Simple=qi;var Ct=le.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[y(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[y(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var n=e.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var s=this.getEvents();n.on(s,this),this.once("remove",function(){n.off(s,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Je.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=y(e);return this._layers[n]?this:(this._layers[n]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var n=y(e);return this._layers[n]?(this._loaded&&e.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return y(e)in this._layers},eachLayer:function(e,n){for(var s in this._layers)e.call(n,this._layers[s]);return this},_addLayers:function(e){e=e?Pe(e)?e:[e]:[];for(var n=0,s=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Ue&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(e){Tn.prototype._setLatLngs.call(this,e),Pt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Pt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new ie(n,n);if(e=new Oe(e.min.subtract(s),e.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var a=0,c=this._rings.length,m;ae.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(n=!n);return n||Tn.prototype._containsPoint.call(this,e,!0)}});function q(e,n){return new f(e,n)}var k=vn.extend({initialize:function(e,n){F(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=Pe(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s0&&c.push(c[0].slice()),c}function Ss(e,n){return e.feature?u({},e.feature,{geometry:n}):Yo(n)}function Yo(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ja={toGeoJSON:function(e){return Ss(this,{type:"Point",coordinates:Ya(this.getLatLng(),e)})}};ni.include(Ja),Ji.include(Ja),In.include(Ja),Tn.include({toGeoJSON:function(e){var n=!Pt(this._latlngs),s=qo(this._latlngs,n?1:0,!1,e);return Ss(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),f.include({toGeoJSON:function(e){var n=!Pt(this._latlngs),s=n&&!Pt(this._latlngs[0]),a=qo(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),Ss(this,{type:(s?"Multi":"")+"Polygon",coordinates:a})}}),tn.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(e).geometry.coordinates)}),Ss(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(e){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(e);var s=n==="GeometryCollection",a=[];return this.eachLayer(function(c){if(c.toGeoJSON){var m=c.toGeoJSON(e);if(s)a.push(m.geometry);else{var P=Yo(m);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),s?Ss(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Yr(e,n){return new k(e,n)}var Zc=Yr,Jo=Ct.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=et(n),F(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(je(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){_t(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&jn(this._image),this},bringToBack:function(){return this._map&&gi(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=et(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName==="IMG",n=this._image=e?this._url:nt("img");if(je(n,"leaflet-image-layer"),this._zoomAnimated&&je(n,"leaflet-zoom-animated"),this.options.className&&je(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(e){var n=this._map.getZoomScale(e.zoom),s=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Nt(this._image,s,n)},_reset:function(){var e=this._image,n=new Oe(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();pt(e,n.min),e.style.width=s.x+"px",e.style.height=s.y+"px"},_updateOpacity:function(){zt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),Hc=function(e,n,s){return new Jo(e,n,s)},Jr=Jo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName==="VIDEO",n=this._image=e?this._url:nt("video");if(je(n,"leaflet-image-layer"),this._zoomAnimated&&je(n,"leaflet-zoom-animated"),this.options.className&&je(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onloadeddata=h(this.fire,this,"load"),e){for(var s=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}Pe(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(n.style,"objectFit")&&(n.style.objectFit="fill"),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,n.muted=!!this.options.muted,n.playsInline=!!this.options.playsInline;for(var m=0;mc?(n.height=c+"px",je(e,m)):ce(e,m),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),s=this._getAnchor();pt(this._container,n.add(s))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt($i(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new ie(this._containerLeft,-s-this._containerBottom);c._add(rn(this._container));var m=e.layerPointToContainerPoint(c),P=me(this.options.autoPanPadding),$=me(this.options.autoPanPaddingTopLeft||P),N=me(this.options.autoPanPaddingBottomRight||P),J=e.getSize(),ge=0,Fe=0;m.x+a+N.x>J.x&&(ge=m.x+a-J.x+N.x),m.x-ge-$.x<0&&(ge=m.x-$.x),m.y+s+N.y>J.y&&(Fe=m.y+s-J.y+N.y),m.y-Fe-$.y<0&&(Fe=m.y-$.y),(ge||Fe)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([ge,Fe]))}},_getAnchor:function(){return me(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Kc=function(e,n){return new Xo(e,n)};Je.mergeOptions({closePopupOnClick:!0}),Je.include({openPopup:function(e,n,s){return this._initOverlay(Xo,e,n,s).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),Ct.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Xo,this._popup,e,n),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof vn||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){gn(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof st)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=n,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var Qo=Dn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Dn.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Dn.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Dn.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",n=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=nt("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,s,a=this._map,c=this._container,m=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),$=this.options.direction,N=c.offsetWidth,J=c.offsetHeight,ge=me(this.options.offset),Fe=this._getAnchor();$==="top"?(n=N/2,s=J):$==="bottom"?(n=N/2,s=0):$==="center"?(n=N/2,s=J/2):$==="right"?(n=0,s=J/2):$==="left"?(n=N,s=J/2):P.xthis.options.maxZoom||sa?this._retainParent(c,m,P,a):!1)},_retainChildren:function(e,n,s,a){for(var c=2*e;c<2*e+2;c++)for(var m=2*n;m<2*n+2;m++){var P=new ie(c,m);P.z=s+1;var $=this._tileCoordsToKey(P),N=this._tiles[$];if(N&&N.active){N.retain=!0;continue}else N&&N.loaded&&(N.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,s);return}for(var Fe=c.min.y;Fe<=c.max.y;Fe++)for(var Ge=c.min.x;Ge<=c.max.x;Ge++){var Gt=new ie(Ge,Fe);if(Gt.z=this._tileZoom,!!this._isValidTile(Gt)){var At=this._tiles[this._tileCoordsToKey(Gt)];At?At.current=!0:P.push(Gt)}}if(P.sort(function(nn,Ps){return nn.distanceTo(m)-Ps.distanceTo(m)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var _n=document.createDocumentFragment();for(Ge=0;Ges.max.x)||!n.wrapLat&&(e.ys.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return et(this.options.bounds).overlaps(a)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,s=this.getTileSize(),a=e.scaleBy(s),c=a.add(s),m=n.unproject(a,e.z),P=n.unproject(c,e.z);return[m,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),s=new ut(n[0],n[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),s=new ie(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(_t(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){je(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=O,e.onmousemove=O,Le.ielt9&&this.options.opacity<1&&zt(e,this.options.opacity)},_addTile:function(e,n){var s=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&Te(h(this._tileReady,this,e,null,c)),pt(c,s),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,s){n&&this.fire("tileerror",{error:n,tile:s,coords:e});var a=this._tileCoordsToKey(e);s=this._tiles[a],s&&(s.loaded=+new Date,this._map._fadeAnimated?(zt(s.el,0),te(this._fadeFrame),this._fadeFrame=Te(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(je(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Le.ielt9||!this._map._fadeAnimated?Te(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var n=new ie(this._wrapX?T(e.x,this._wrapX):e.x,this._wrapY?T(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Oe(e.min.unscaleBy(n).floor(),e.max.unscaleBy(n).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function Yc(e){return new ro(e)}var Ts=ro.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,n){this._url=e,n=F(this,n),n.detectRetina&&Le.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var s=document.createElement("img");return He(s,"load",h(this._tileOnLoad,this,n,s)),He(s,"error",h(this._tileOnError,this,n,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(s.referrerPolicy=this.options.referrerPolicy),s.alt="",s.src=this.getTileUrl(e),s},getTileUrl:function(e){var n={r:Le.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=s),n["-y"]=s}return Y(this._url,u(n,this.options))},_tileOnLoad:function(e,n){Le.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,s){var a=this.options.errorTileUrl;a&&n.getAttribute("src")!==a&&(n.src=a),e(s,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,s=this.options.zoomReverse,a=this.options.zoomOffset;return s&&(e=n-e),e+a},_getSubdomain:function(e){var n=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var e,n;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(n=this._tiles[e].el,n.onload=O,n.onerror=O,!n.complete)){n.src=ye;var s=this._tiles[e].coords;_t(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:s})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",ye),ro.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===ye))return ro.prototype._tileReady.call(this,e,n,s)}});function el(e,n){return new Ts(e,n)}var tl=Ts.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var s=u({},this.defaultWmsParams);for(var a in n)a in this.options||(s[a]=n[a]);n=F(this,n);var c=n.detectRetina&&Le.retina?2:1,m=this.getTileSize();s.width=m.x*c,s.height=m.y*c,this.wmsParams=s},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,Ts.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=Xe(s.project(n[0]),s.project(n[1])),c=a.min,m=a.max,P=(this._wmsVersion>=1.3&&this._crs===Gi?[c.y,c.x,m.y,m.x]:[c.x,c.y,m.x,m.y]).join(","),$=Ts.prototype.getTileUrl.call(this,e);return $+fe(this.wmsParams,$,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function Jc(e,n){return new tl(e,n)}Ts.WMS=tl,el.wms=Jc;var ii=Ct.extend({options:{padding:.1},initialize:function(e){F(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),je(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,n){var s=this._map.getZoomScale(n,this._zoom),a=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),m=a.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(e,n));Le.any3d?Nt(this._container,m,s):pt(this._container,m)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,n=this._map.getSize(),s=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new Oe(s,s.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),nl=ii.extend({options:{tolerance:0},getEvents:function(){var e=ii.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ii.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");He(e,"mousemove",this._onMouseMove,this),He(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),He(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){te(this._redrawRequest),delete this._ctx,_t(this._container),ft(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var n in this._layers)e=this._layers[n],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ii.prototype._update.call(this);var e=this._bounds,n=this._container,s=e.getSize(),a=Le.retina?2:1;pt(n,e.min),n.width=a*s.x,n.height=a*s.y,n.style.width=s.x+"px",n.style.height=s.y+"px",Le.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ii.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[y(e)]=e;var n=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var n=e._order,s=n.next,a=n.prev;s?s.prev=a:this._drawLast=a,a?a.next=s:this._drawFirst=s,delete e._order,delete this._layers[y(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var n=e.options.dashArray.split(/[, ]+/),s=[],a,c;for(c=0;c')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Xc={_initContainer:function(){this._container=nt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ii.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=lo("shape");je(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=lo("path"),n.appendChild(e._path),this._updateStyle(e),this._layers[y(e)]=e},_addPath:function(e){var n=e._container;this._container.appendChild(n),e.options.interactive&&e.addInteractiveTarget(n)},_removePath:function(e){var n=e._container;_t(n),e.removeInteractiveTarget(n),delete this._layers[y(e)]},_updateStyle:function(e){var n=e._stroke,s=e._fill,a=e.options,c=e._container;c.stroked=!!a.stroke,c.filled=!!a.fill,a.stroke?(n||(n=e._stroke=lo("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=Pe(a.dashArray)?a.dashArray.join(" "):a.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=a.lineCap.replace("butt","flat"),n.joinstyle=a.lineJoin):n&&(c.removeChild(n),e._stroke=null),a.fill?(s||(s=e._fill=lo("fill")),c.appendChild(s),s.color=a.fillColor||a.color,s.opacity=a.fillOpacity):s&&(c.removeChild(s),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),s=Math.round(e._radius),a=Math.round(e._radiusY||s);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+s+","+a+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){jn(e._container)},_bringToBack:function(e){gi(e._container)}},ea=Le.vml?lo:K,uo=ii.extend({_initContainer:function(){this._container=ea("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ea("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){_t(this._container),ft(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ii.prototype._update.call(this);var e=this._bounds,n=e.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,s.setAttribute("width",n.x),s.setAttribute("height",n.y)),pt(s,e.min),s.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=ea("path");e.options.className&&je(n,e.options.className),e.options.interactive&&je(n,"leaflet-interactive"),this._updateStyle(e),this._layers[y(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){_t(e._path),e.removeInteractiveTarget(e._path),delete this._layers[y(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,s=e.options;n&&(s.stroke?(n.setAttribute("stroke",s.color),n.setAttribute("stroke-opacity",s.opacity),n.setAttribute("stroke-width",s.weight),n.setAttribute("stroke-linecap",s.lineCap),n.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?n.setAttribute("stroke-dasharray",s.dashArray):n.removeAttribute("stroke-dasharray"),s.dashOffset?n.setAttribute("stroke-dashoffset",s.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),s.fill?(n.setAttribute("fill",s.fillColor||s.color),n.setAttribute("fill-opacity",s.fillOpacity),n.setAttribute("fill-rule",s.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,G(e._parts,n))},_updateCircle:function(e){var n=e._point,s=Math.max(Math.round(e._radius),1),a=Math.max(Math.round(e._radiusY),1)||s,c="a"+s+","+a+" 0 1,0 ",m=e._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(e,m)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){jn(e._path)},_bringToBack:function(e){gi(e._path)}});Le.vml&&uo.include(Xc);function sl(e){return Le.svg||Le.vml?new uo(e):null}Je.include({getRenderer:function(e){var n=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(e){if(e==="overlayPane"||e===void 0)return!1;var n=this._paneRenderers[e];return n===void 0&&(n=this._createRenderer({pane:e}),this._paneRenderers[e]=n),n},_createRenderer:function(e){return this.options.preferCanvas&&il(e)||sl(e)}});var ol=f.extend({initialize:function(e,n){f.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=et(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Qc(e,n){return new ol(e,n)}uo.create=ea,uo.pointsToPath=G,k.geometryToLayer=Ke,k.coordsToLatLng=qa,k.coordsToLatLngs=Go,k.latLngToCoords=Ya,k.latLngsToCoords=qo,k.getFeature=Ss,k.asFeature=Yo,Je.mergeOptions({boxZoom:!0});var al=Tt.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){He(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ft(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){_t(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),vi(),Ut(),this._startPoint=this._map.mouseEventToContainerPoint(e),He(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=nt("div","leaflet-zoom-box",this._container),je(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Oe(this._point,this._startPoint),s=n.getSize();pt(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(_t(this._box),ce(this._container,"leaflet-crosshair")),Gn(),_i(),ft(document,{contextmenu:gn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new ut(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Je.addInitHook("addHandler","boxZoom",al),Je.mergeOptions({doubleClickZoom:!0});var rl=Tt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var n=this._map,s=n.getZoom(),a=n.options.zoomDelta,c=e.originalEvent.shiftKey?s-a:s+a;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(e.containerPoint,c)}});Je.addInitHook("addHandler","doubleClickZoom",rl),Je.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ll=Tt.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new $n(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}je(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ce(this._map._container,"leaflet-grab"),ce(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var n=et(this._map.options.maxBounds);this._offsetLimit=Xe(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var n=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(n),this._prunePositions(n)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,n){return e-(e-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;e.xn.max.x&&(e.x=this._viscousLimit(e.x,n.max.x)),e.y>n.max.y&&(e.y=this._viscousLimit(e.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,n=Math.round(e/2),s=this._initialWorldOffset,a=this._draggable._newPos.x,c=(a-n+s)%e+n-s,m=(a+n+s)%e-n-s,P=Math.abs(c+s)0?m:-m))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Je.addInitHook("addHandler","scrollWheelZoom",cl);var ed=600;Je.mergeOptions({tapHold:Le.touchNative&&Le.safari&&Le.mobile,tapTolerance:15});var dl=Tt.extend({addHooks:function(){He(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ft(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var n=e.touches[0];this._startPos=this._newPos=new ie(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(He(document,"touchend",St),He(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),ed),He(document,"touchend touchcancel contextmenu",this._cancel,this),He(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){ft(document,"touchend",St),ft(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),ft(document,"touchend touchcancel contextmenu",this._cancel,this),ft(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ie(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var s=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});s._simulated=!0,n.target.dispatchEvent(s)}});Je.addInitHook("addHandler","tapHold",dl),Je.mergeOptions({touchZoom:Le.touch,bounceAtZoomLimits:!0});var fl=Tt.extend({addHooks:function(){je(this._map._container,"leaflet-touch-zoom"),He(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ce(this._map._container,"leaflet-touch-zoom"),ft(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)){var s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(s.add(a)._divideBy(2))),this._startDist=s.distanceTo(a),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),He(document,"touchmove",this._onTouchMove,this),He(document,"touchend touchcancel",this._onTouchEnd,this),St(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,s=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]),c=s.distanceTo(a)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var m=s._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&m.x===0&&m.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(m),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),te(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Te(P,this,!0),St(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,te(this._animRequest),ft(document,"touchmove",this._onTouchMove,this),ft(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Je.addInitHook("addHandler","touchZoom",fl),Je.BoxZoom=al,Je.DoubleClickZoom=rl,Je.Drag=ll,Je.Keyboard=ul,Je.ScrollWheelZoom=cl,Je.TapHold=dl,Je.TouchZoom=fl,o.Bounds=Oe,o.Browser=Le,o.CRS=E,o.Canvas=nl,o.Circle=Ji,o.CircleMarker=In,o.Class=_e,o.Control=ln,o.DivIcon=Qr,o.DivOverlay=Dn,o.DomEvent=Fa,o.DomUtil=Ra,o.Draggable=$n,o.Evented=le,o.FeatureGroup=vn,o.GeoJSON=k,o.GridLayer=ro,o.Handler=Tt,o.Icon=ti,o.ImageOverlay=Jo,o.LatLng=Ue,o.LatLngBounds=ut,o.Layer=Ct,o.LayerGroup=tn,o.LineUtil=ja,o.Map=Je,o.Marker=ni,o.Mixin=Za,o.Path=st,o.Point=ie,o.PolyUtil=Ot,o.Polygon=f,o.Polyline=Tn,o.Popup=Xo,o.PosAnimation=bs,o.Projection=ks,o.Rectangle=ol,o.Renderer=ii,o.SVG=uo,o.SVGOverlay=Xr,o.TileLayer=Ts,o.Tooltip=Qo,o.Transformation=Lt,o.Util=de,o.VideoOverlay=Jr,o.bind=h,o.bounds=Xe,o.canvas=il,o.circle=Ga,o.circleMarker=ao,o.control=Fi,o.divIcon=qc,o.extend=u,o.featureGroup=Wa,o.geoJSON=Yr,o.geoJson=Zc,o.gridLayer=Yc,o.icon=Wo,o.imageOverlay=Hc,o.latLng=W,o.latLngBounds=et,o.layerGroup=oo,o.map=Ba,o.marker=Ka,o.point=me,o.polygon=q,o.polyline=x,o.popup=Kc,o.rectangle=Qc,o.setOptions=F,o.stamp=y,o.svg=sl,o.svgOverlay=Wc,o.tileLayer=el,o.tooltip=Gc,o.transformation=b,o.version=l,o.videoOverlay=jc;var td=window.L;o.noConflict=function(){return window.L=td,this},window.L=o}))})(_o,_o.exports)),_o.exports}var im=nm();const Pi=em(im),hu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,o=j(null);let l,u,d,h;const v=new Map;function y(H,F){const fe=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",ve=F?"#8a94a6":fe,Y=typeof H=="number"?H:0;return Pi.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(H){const fe=[`${H.callsign||H.icao24||"aircraft"}`];return H.country&&fe.push(H.country),typeof H.altitude=="number"&&fe.push(`${Math.round(H.altitude)} m`),typeof H.velocity=="number"&&fe.push(`${Math.round(H.velocity*3.6)} km/h`),H.onGround&&fe.push("on ground"),fe.join(" · ")}function T(){if(!l)return;h||(h=Pi.layerGroup().addTo(l));const H=new Set;for(const F of i.aircraft){if(typeof F.lat!="number"||typeof F.lng!="number")continue;H.add(F.icao24);const fe=[F.lat,F.lng];let ve=v.get(F.icao24);ve?(ve.setLatLng(fe),ve.setIcon(y(F.heading,F.onGround)),ve.setTooltipContent(C(F))):(ve=Pi.marker(fe,{icon:y(F.heading,F.onGround)}).bindTooltip(C(F)),ve.addTo(h),v.set(F.icao24,ve))}for(const[F,fe]of v)H.has(F)||(h.removeLayer(fe),v.delete(F))}function O(){if(!l)return;const H=i.position;if(H&&(H.lat||H.lng)){const F=[H.lat,H.lng];u?u.setLatLng(F):(u=Pi.marker(F).addTo(l),l.setView(F,17))}if(d&&d.remove(),i.trail.length){const F=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Pi.polyline(i.trail,{color:F,weight:3}).addTo(l)}}fi(()=>{l=Pi.map(o.value,{zoomControl:!0}).setView([20,0],2),Pi.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),O(),T(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&V()});let B=!1;function V(){if(B||!l||!i.aircraft.length)return;const H=i.aircraft.filter(F=>typeof F.lat=="number"&&typeof F.lng=="number").map(F=>[F.lat,F.lng]);H.length&&(l.fitBounds(Pi.latLngBounds(H).pad(.2)),B=!0)}return Fs(()=>{l&&l.remove(),l=null}),$t(()=>i.position,O,{deep:!0}),$t(()=>i.trail,O,{deep:!0}),$t(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&V()},{deep:!0}),(H,F)=>(p(),g("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},sm=["width","height","stroke-width"],om=["d"],X={__name:"Icon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:18},stroke:{type:[Number,String],default:2}},setup(t){const l=({grid:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",radio:"M4.9 19.1a10 10 0 0 1 0-14.2M7.8 16.2a6 6 0 0 1 0-8.4M16.2 7.8a6 6 0 0 1 0 8.4M19.1 4.9a10 10 0 0 1 0 14.2M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z",route:"M6 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 13V9a4 4 0 0 1 4-4h4",calendar:"M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",book:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z",fileText:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M16 13H8M16 17H8M10 9H8",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",search:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.3-4.3",plus:"M12 5v14M5 12h14",battery:"M3 8h14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1zM22 11v2",signal:"M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 20V4",clock:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",chevronRight:"M9 6l6 6-6 6",play:"M6 3l14 9-14 9V3z",logout:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",wind:"M12.8 19.6A2 2 0 1 0 14 16H2M17.5 8a2.5 2.5 0 1 1 2 4H2M9.6 4.6A2 2 0 1 1 11 8H2",drone:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM6 6 4 4M18 6l2-2M6 18l-2 2M18 18l2 2",user:"M20 21a8 8 0 1 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",users:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",sliders:"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6",alertTriangle:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01",download:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",upload:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",trash:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6",check:"M20 6 9 17l-5-5",mail:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM22 6l-10 7L2 6",lock:"M5 11h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2zM7 11V7a5 5 0 0 1 10 0v4",monitor:"M3 4h18a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8 21h8M12 17v4",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z",smartphone:"M7 2h10a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM11 18h2",image:"M4 4h16a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 21",eye:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",type:"M4 7V4h16v3M9 20h6M12 4v16",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4",moon:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z",x:"M18 6 6 18M6 6l12 12",server:"M20 4H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM20 13H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2zM6 7.5h.01M6 16.5h.01",cloud:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9z"}[t.name]||"").split(" M").map((u,d)=>d?"M"+u:u);return(u,d)=>(p(),g("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke,"stroke-linecap":"round","stroke-linejoin":"round",style:{flex:"none"},"aria-hidden":"true"},[(p(!0),g(re,null,Be($e(l),(h,v)=>(p(),g("path",{key:v,d:h},null,8,om))),128))],8,sm))}},am=["aria-checked","disabled"],sn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(p(),g("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Ee(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",t.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:u[0]||(u[0]=d=>o("update:modelValue",!t.modelValue))},[r("span",{class:Ee(["inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition",t.modelValue?"translate-x-6":"translate-x-1"])},null,2)],10,am))}},rm={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},lm=["onClick"],bn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const o=i;return(l,u)=>(p(),g("div",rm,[(p(!0),g(re,null,Be(t.options,d=>(p(),g("button",{key:d.value,type:"button",class:Ee(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>o("update:modelValue",d.value)},[d.icon?(p(),at(X,{key:0,name:d.icon,size:15},null,8,["name"])):R("",!0),D(" "+S(d.label),1)],10,lm))),128))]))}},um={class:"text-sm font-semibold text-ink"},cm={key:0,class:"mt-0.5 text-xs text-ink-muted"},Me={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,o=wo("settingsSearch",{value:""}),l=ke(()=>{const u=(o.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(p(),g("div",{key:0,class:Ee(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Ee(t.block?"mb-3":"min-w-0")},[r("div",um,S(t.title),1),t.desc?(p(),g("div",cm,S(t.desc),1)):R("",!0)],2),r("div",{class:Ee(t.block?"":"shrink-0")},[xf(u.$slots,"default")],2)],2)):R("",!0)}},dm=(t,i)=>{const o=t.__vccOpts||t;for(const[l,u]of i)o[l]=u;return o},fm={class:"mx-auto max-w-[1280px] p-7"},hm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},pm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},mm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},gm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},vm=["onClick"],_m={class:"whitespace-nowrap"},ym={class:"min-w-0"},bm={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},xm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},wm={key:1,class:"panel mb-5 p-5"},km={class:"flex items-center gap-1"},Sm={class:"flex items-center gap-2"},Tm={class:"font-mono text-sm text-ink"},Pm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Cm={key:0,class:"mt-2 text-xs text-ink-muted"},Lm={class:"grid max-w-[420px] gap-2"},Mm={class:"flex items-center gap-3"},Em={key:2,class:"panel mb-5 p-5"},Om=["value"],zm=["value"],Am=["value"],$m={class:"font-mono text-sm text-ink"},Im={key:3},Dm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Nm=["onClick"],Rm={key:1,class:"panel mb-5 p-5"},Fm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Bm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Vm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Um={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Zm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Hm={key:0},jm={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Wm={class:"font-semibold text-ink-secondary"},Km={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Gm={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"credits usage quota remaining daily allowance rate limit"},qm={class:"flex items-center justify-between gap-3"},Ym={class:"flex items-center gap-2 text-sm font-semibold text-ink"},Jm={key:0,class:"text-[11px] text-ink-muted"},Xm={class:"mt-2 flex items-baseline gap-1.5"},Qm={class:"font-mono text-2xl font-semibold text-ink"},eg={class:"text-sm text-ink-muted"},tg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},ng={class:"mt-2 text-xs text-ink-muted"},ig={class:"mt-2 text-sm text-ink"},sg={class:"font-semibold"},og={class:"mt-1 text-xs text-ink-muted"},ag={key:1,class:"mt-2 text-xs text-ink-muted"},rg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},lg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},ug={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},cg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},dg={key:1,class:"flex flex-col items-end gap-2"},fg=["label"],hg=["value"],pg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},mg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},gg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},yg={class:"mt-4 flex flex-wrap items-center gap-3"},bg=["disabled"],xg=["disabled"],wg={key:2,class:"text-xs text-danger-fg"},kg={class:"panel mb-5 p-5"},Sg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Tg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Pg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Cg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Lg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Mg={key:0},Eg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Og={class:"font-semibold text-ink-secondary"},zg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Ag={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},$g={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ig={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Dg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ng={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Rg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Fg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Bg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Vg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ug={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Zg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Hg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},jg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Wg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Kg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Gg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},qg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Yg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Jg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Xg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Qg={class:"mt-4 flex flex-wrap items-center gap-3"},ev=["disabled"],tv=["disabled"],nv={key:2,class:"text-xs text-danger-fg"},iv={key:3,class:"text-[11px] text-ink-muted"},sv={class:"panel mb-5 p-5"},ov={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},av={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},rv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},lv={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},uv={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},cv={key:0},dv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},fv={class:"font-semibold text-ink-secondary"},hv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},pv={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},mv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},gv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},vv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_v={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},yv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},bv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},xv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},wv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},kv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Sv={class:"mt-4 flex flex-wrap items-center gap-3"},Tv=["disabled"],Pv=["disabled"],Cv={key:2,class:"text-xs text-danger-fg"},Lv={key:3,class:"text-[11px] text-ink-muted"},Mv={key:3,class:"panel mb-5 p-5"},Ev={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Ov={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},zv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Av={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},$v={key:2,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Iv={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},Dv={key:0},Nv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Rv={class:"font-semibold text-ink-secondary"},Fv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},Bv={class:"flex w-full flex-col gap-2"},Vv={class:"break-all font-mono text-sm text-ink"},Uv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Zv={key:1,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Hv={key:0,class:"text-xs text-ink-muted"},jv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Wv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Kv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Gv={class:"mt-4 flex flex-wrap items-center gap-3"},qv=["disabled"],Yv=["disabled"],Jv={key:2,class:"text-xs text-danger-fg"},Xv={key:3,class:"text-[11px] text-ink-muted"},Qv={key:4,class:"panel mb-5 p-5"},e_={class:"flex items-center gap-4"},t_=["src"],n_={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},i_={class:"flex gap-2"},s_={class:"btn-ghost cursor-pointer"},o_={class:"mt-1 text-right text-[11px] text-ink-muted"},a_={key:5,class:"panel mb-5 p-5"},r_={class:"flex items-center gap-3"},l_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},u_={class:"flex flex-wrap items-center gap-4"},c_={class:"min-w-0"},d_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},f_={class:"mt-3 flex items-center gap-2"},h_={key:0,class:"mt-2 text-xs text-danger-fg"},p_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},m_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},g_={class:"rounded-lg border border-line bg-surface-2 p-3"},v_={class:"flex items-center gap-3"},__={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},y_={class:"min-w-0 flex-1"},b_={class:"text-sm font-semibold text-ink"},x_={class:"font-mono text-[11px] text-ink-muted"},w_={key:6,class:"mb-5"},k_={key:0,class:"panel mb-5 p-5"},S_={class:"grid max-w-[520px] gap-2"},T_={class:"flex flex-wrap gap-2"},P_=["disabled","title"],C_=["value"],L_=["value"],M_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},E_={class:"flex items-center gap-3"},O_=["disabled"],z_={key:0,class:"text-xs text-danger-fg"},A_={key:1,class:"text-xs text-ink-muted"},$_={key:1,class:"panel mb-5 p-5"},I_={class:"grid max-w-[520px] gap-2"},D_={class:"flex flex-wrap gap-2"},N_=["value"],R_=["value"],F_={key:1,class:"text-xs text-ink-muted"},B_={class:"font-semibold text-ink-secondary"},V_={class:"flex items-center gap-3"},U_=["disabled"],Z_={key:0,class:"text-xs text-danger-fg"},H_={class:"panel overflow-hidden p-0"},j_={class:"flex items-center justify-between px-5 py-4"},W_=["disabled"],K_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},G_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},q_={key:2,class:"overflow-x-auto"},Y_={class:"w-full border-collapse text-sm"},J_={class:"text-left"},X_={class:"px-5 py-3"},Q_={class:"text-ink"},ey={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},ty={class:"px-5 py-3"},ny={class:"px-5 py-3"},iy={class:"px-5 py-3"},sy={class:"px-5 py-3 text-right"},oy=["onClick"],ay={key:1,class:"inline-flex items-center gap-1.5"},ry=["onClick"],ly=["onClick"],uy={key:7,class:"mb-5"},cy={key:0,class:"panel mb-5 p-5"},dy={class:"grid max-w-[520px] gap-2"},fy={class:"flex items-center gap-3"},hy={key:0,class:"text-xs text-danger-fg"},py={key:1,class:"panel mb-5 p-5"},my={class:"grid max-w-[520px] gap-2"},gy={class:"flex items-center gap-3"},vy=["disabled"],_y={key:0,class:"text-xs text-danger-fg"},yy={class:"panel overflow-hidden p-0"},by={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},xy={key:1,class:"overflow-x-auto"},wy={class:"w-full border-collapse text-sm"},ky={class:"text-left"},Sy={class:"px-5 py-3"},Ty={class:"inline-flex items-center gap-2 text-ink"},Py={class:"px-5 py-3 text-ink-secondary"},Cy={class:"px-5 py-3 text-right"},Ly=["onClick"],My={key:1,class:"inline-flex items-center gap-1.5"},Ey=["onClick"],Oy=["disabled","title","onClick"],zy={key:8,class:"mb-5"},Ay={class:"panel mb-5 p-5"},$y={class:"btn-ghost cursor-pointer"},Iy={key:0,class:"mt-2 text-xs text-ink-muted"},Dy={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Ny={class:"flex items-center gap-2 text-danger-fg"},Ry={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Fy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},By={class:"mt-3"},Vy={class:"eyebrow mb-1 block"},Uy={class:"text-ink"},Zy=["placeholder"],Hy={class:"mt-4 flex flex-wrap items-center gap-3"},jy=["disabled"],Wy=["disabled"],Ky={key:2,class:"text-xs text-ink-muted"},Gy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},qy={key:0,class:"fixed bottom-5 right-5 z-20 flex items-center gap-2 rounded-lg border border-line bg-surface-1 px-4 py-2.5 text-sm text-ink shadow-md"},pu="pv.opensky.health",mu="pv.filetransfer.health",gu="pv.webdav.health",vu="pv.localstorage.health",Yy={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=ke(()=>o.role==="superadmin"),d=ke(()=>o.role==="admin"||o.role==="superadmin");function h(x){return x==="superadmin"?"Superadmin":x==="admin"?"Admin":"User"}function v(x){return x==="superadmin"||x==="admin"?"shield":"user"}function y(x){return x==="superadmin"||x==="admin"?C.accent:C.neutral}const C={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},T=ke(()=>{const x=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&x.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&x.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),x.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),x}),O=j("account"),B=j("");Gu("settingsSearch",B);const V=ke(()=>B.value.trim().length>0),H=ke(()=>B.value.trim().toLowerCase());function F(x){return H.value?(x.label+" "+x.kw).toLowerCase().includes(H.value)||ve(x.id):!0}const fe={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function ve(x){return H.value?(fe[x]||[]).some(f=>f.includes(H.value)):!0}const Y=ke(()=>V.value?T.value.filter(F):T.value.filter(x=>x.id===O.value)),Pe=ke({get:()=>rs.value,set:x=>xa(x)}),he=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],ye=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Ne=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Ie=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],Ve=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],pe=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],ze=j(Date.now());let Te=null;const te=ke(()=>cu(ze.value)),de=bt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),_e=j("user"),be=bt({clientId:"",clientSecret:"",plan:"",bbox:""}),ae=j(""),le=j(!1),ie=j(!1),rt=j(null),me=j(null),Oe=ke(()=>rt.value&&rt.value.credits||null),Xe=ke(()=>{const x=Oe.value;return!x||!x.daily||x.remaining==null?null:Math.max(0,Math.min(100,Math.round(x.remaining/x.daily*100)))}),ut=ke(()=>{const x=Xe.value;return x==null?"bg-accent":x<=10?"bg-danger":x<=30?"bg-amber":"bg-success"});function et(x){return typeof x=="number"?x.toLocaleString():x}function Ue(){if(!me.value)return"";const x=Math.max(0,Math.round((Date.now()-me.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const q=Math.round(f/60);return q<24?`${q} h ago`:`${Math.round(q/24)} d ago`}function W(){try{rt.value&&localStorage.setItem(pu,JSON.stringify({health:rt.value,ts:me.value}))}catch{}}function E(){try{const x=localStorage.getItem(pu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(rt.value=f.health,me.value=f.ts||null)}catch{}}const A=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],it=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],vt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},{label:"Countries",options:[{value:"49,14.1,54.9,24.2",label:"Poland"},{value:"50.5,3.2,53.7,7.3",label:"Netherlands"},{value:"47.2,5.8,55.1,15.1",label:"Germany"},{value:"41.3,-5.2,51.1,9.6",label:"France"},{value:"49.9,-8.7,59,1.8",label:"United Kingdom"},{value:"35.9,-9.6,43.8,3.4",label:"Spain"},{value:"36.6,6.6,47.1,18.6",label:"Italy"},{value:"24,-125,49.5,-66.5",label:"United States"}]}],Lt=vt.flatMap(x=>x.options);function b(x){const f=String(x||"").split(",").map(k=>k.trim());if(f.length!==4)return"";const q=f.map(Number);return q.some(k=>Number.isNaN(k))?"":q.join(",")}function _(x){const f=b(x),q=f&&Lt.find(k=>b(k.value)===f);return q?q.label:""}const w=j(!1),K=ke({get(){if(w.value)return"__custom__";const x=b(be.bbox),f=x&&Lt.find(q=>b(q.value)===x);return f?f.value:"__custom__"},set(x){if(x==="__custom__"){w.value=!0;return}w.value=!1,be.bbox=x}}),G=ke(()=>K.value==="__custom__"),Z=ke(()=>de.isSuperadmin),ne=ke(()=>de.isSuperadmin?"user":_e.value),se=ke(()=>de.scopes[ne.value]||{editableLayer:"user",fields:{}}),Q=ke(()=>ne.value==="org");function U(x){return se.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Se(x){return Z.value||U(x).locked}function I(x){const f=U(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function M(){be.clientId=U("clientId").own||"",be.clientSecret=U("clientSecret").own||"",be.plan=U("plan").own||"",be.bbox=U("bbox").own||"",w.value=!1}function ee(x){de.available=!!x.available,de.orgEnabled=x.orgEnabled!==!1,de.allowAnonymous=!!x.allowAnonymous,de.enabled=!!x.enabled,de.canEditOrg=!!x.canEditOrg,de.isSuperadmin=!!x.isSuperadmin,de.scopes=x.scopes||{},_e.value==="org"&&!de.canEditOrg&&(_e.value="user"),M(),de.loaded=!0}$t(_e,()=>{ae.value="",M()});async function Re(){E();const{ok:x,body:f}=await up();x&&ee(f)}async function Ze(x){const f=Q.value;f?de.orgEnabled=x:de.enabled=x;const{ok:q,body:k}=await au(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});q?(ee(k),Qe(f?x?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":x?"OpenSky enabled.":"OpenSky disabled.")):(f?de.orgEnabled=!x:de.enabled=!x,Qe(k.error||"Could not update."))}async function Ye(){ae.value="",le.value=!0;const x={};for(const Ke of["clientId","clientSecret","plan","bbox"])Se(Ke)||(x[Ke]=be[Ke]);const f={scope:ne.value,config:x};Q.value||(f.enabled=de.enabled);const{ok:q,body:k}=await au(f);if(le.value=!1,!q){ae.value=k.error||"Could not save settings.";return}ee(k),Qe(Q.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function ht(){ie.value=!0,rt.value=null;const{ok:x,body:f}=await cp();ie.value=!1,rt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},me.value=Date.now(),W()}function ue(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const Ae=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),wt=j("user"),cn=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],tt=bt(Object.fromEntries(cn.map(x=>[x,""]))),kt=j(""),Dt=j(!1),on=j(!1),Qt=j(null),pi=j(null),Bs=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],No=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],ls=ke(()=>Ae.isSuperadmin),Vs=ke(()=>Ae.isSuperadmin?"user":wt.value),$a=ke(()=>Ae.scopes[Vs.value]||{editableLayer:"user",fields:{}}),dn=ke(()=>Vs.value==="org"),us=ke(()=>(en("protocol")?Ft("protocol").effective:tt.protocol)||"sftp");function Ft(x){return $a.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function en(x){return ls.value||Ft(x).locked}function yt(x){const f=Ft(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Ia(x){return(Bs.find(f=>f.value===x)||{}).label||x||"—"}function Ro(){for(const x of cn)tt[x]=Ft(x).own||"";tt.protocol||(tt.protocol="sftp"),tt.insecureSkipVerify||(tt.insecureSkipVerify="false")}function Us(x){Ae.available=!!x.available,Ae.orgEnabled=x.orgEnabled!==!1,Ae.enabled=!!x.enabled,Ae.canEditOrg=!!x.canEditOrg,Ae.isSuperadmin=!!x.isSuperadmin,Ae.scopes=x.scopes||{},wt.value==="org"&&!Ae.canEditOrg&&(wt.value="user"),Ro(),Ae.loaded=!0}$t(wt,()=>{kt.value="",Ro()});function Da(){if(!pi.value)return"";const x=Math.max(0,Math.round((Date.now()-pi.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const q=Math.round(f/60);return q<24?`${q} h ago`:`${Math.round(q/24)} d ago`}function fn(){try{Qt.value&&localStorage.setItem(mu,JSON.stringify({health:Qt.value,ts:pi.value}))}catch{}}function Le(){try{const x=localStorage.getItem(mu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Qt.value=f.health,pi.value=f.ts||null)}catch{}}async function Fo(){Le();const{ok:x,body:f}=await fp();x&&Us(f)}async function Zs(x){const f=dn.value;f?Ae.orgEnabled=x:Ae.enabled=x;const{ok:q,body:k}=await ru(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});q?(Us(k),Qe(f?x?"File transfer enabled for your organization.":"File transfer disabled for your organization.":x?"File transfer enabled.":"File transfer disabled.")):(f?Ae.orgEnabled=!x:Ae.enabled=!x,Qe(k.error||"Could not update."))}async function Bo(){kt.value="",Dt.value=!0;const x={};for(const Ke of cn)en(Ke)||(x[Ke]=tt[Ke]);const f={scope:Vs.value,config:x};dn.value||(f.enabled=Ae.enabled);const{ok:q,body:k}=await ru(f);if(Dt.value=!1,!q){kt.value=k.error||"Could not save settings.";return}Us(k),Qe(dn.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Vo(){on.value=!0,Qt.value=null;const{ok:x,body:f}=await hp();on.value=!1,Qt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},pi.value=Date.now(),fn()}function Hs(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const ot=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),an=j("user"),cs=["baseURL","username","password","insecureSkipVerify","basePath"],Bt=bt(Object.fromEntries(cs.map(x=>[x,""]))),Ai=j(""),ds=j(!1),fs=j(!1),hn=j(null),mi=j(null),hs=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],js=ke(()=>ot.isSuperadmin),Ws=ke(()=>ot.isSuperadmin?"user":an.value),Na=ke(()=>ot.scopes[Ws.value]||{editableLayer:"user",fields:{}}),pn=ke(()=>Ws.value==="org");function En(x){return Na.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function On(x){return js.value||En(x).locked}function Vt(x){const f=En(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Ks(){for(const x of cs)Bt[x]=En(x).own||"";Bt.insecureSkipVerify||(Bt.insecureSkipVerify="false")}function ps(x){ot.available=!!x.available,ot.orgEnabled=x.orgEnabled!==!1,ot.enabled=!!x.enabled,ot.canEditOrg=!!x.canEditOrg,ot.isSuperadmin=!!x.isSuperadmin,ot.scopes=x.scopes||{},an.value==="org"&&!ot.canEditOrg&&(an.value="user"),Ks(),ot.loaded=!0}$t(an,()=>{Ai.value="",Ks()});function $i(){if(!mi.value)return"";const x=Math.max(0,Math.round((Date.now()-mi.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const q=Math.round(f/60);return q<24?`${q} h ago`:`${Math.round(q/24)} d ago`}function nt(){try{hn.value&&localStorage.setItem(gu,JSON.stringify({health:hn.value,ts:mi.value}))}catch{}}function _t(){try{const x=localStorage.getItem(gu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(hn.value=f.health,mi.value=f.ts||null)}catch{}}async function ms(){_t();const{ok:x,body:f}=await gp();x&&ps(f)}async function jn(x){const f=pn.value;f?ot.orgEnabled=x:ot.enabled=x;const{ok:q,body:k}=await lu(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});q?(ps(k),Qe(f?x?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":x?"WebDAV enabled.":"WebDAV disabled.")):(f?ot.orgEnabled=!x:ot.enabled=!x,Qe(k.error||"Could not update."))}async function gi(){Ai.value="",ds.value=!0;const x={};for(const Ke of cs)On(Ke)||(x[Ke]=Bt[Ke]);const f={scope:Ws.value,config:x};pn.value||(f.enabled=ot.enabled);const{ok:q,body:k}=await lu(f);if(ds.value=!1,!q){Ai.value=k.error||"Could not save settings.";return}ps(k),Qe(pn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function Gs(){fs.value=!0,hn.value=null;const{ok:x,body:f}=await vp();fs.value=!1,hn.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},mi.value=Date.now(),nt()}function je(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const ce=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),zn=j("user"),Wn=j(""),zt=j(""),gs=j(!1),Kn=j(!1),Nt=j(null),pt=j(null),rn=j({}),vi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Gn=ke(()=>ce.isSuperadmin),Ii=ke(()=>ce.isSuperadmin?"user":zn.value),Di=ke(()=>ce.scopes[Ii.value]||{editableLayer:"user",fields:{}}),Ut=ke(()=>Ii.value==="org");function _i(x){return Di.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Ni(x){return Gn.value||_i(x).locked}function vs(x){const f=_i(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function qs(x){return(vi.find(f=>f.value===x)||{}).label||"Inherit"}function Ri(){Wn.value=_i("readOnly").own||""}function yi(x){ce.available=!!x.available,ce.orgEnabled=x.orgEnabled!==!1,ce.enabled=!!x.enabled,ce.canEditOrg=!!x.canEditOrg,ce.isSuperadmin=!!x.isSuperadmin,ce.isOrgUser=!!x.isOrgUser,ce.mounts=Array.isArray(x.mounts)?x.mounts:[],ce.privateFolder=!!x.privateFolder,ce.privateEnabled=!!x.privateEnabled,ce.allowPrivate=x.allowPrivate!==!1,ce.rootConfigured=!!x.rootConfigured,ce.scopes=x.scopes||{},zn.value==="org"&&!ce.canEditOrg&&(zn.value="user"),Ri(),ce.loaded=!0}$t(zn,()=>{zt.value="",Ri()});function Ys(){if(!pt.value)return"";const x=Math.max(0,Math.round((Date.now()-pt.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const q=Math.round(f/60);return q<24?`${q} h ago`:`${Math.round(q/24)} d ago`}function Ra(){try{Nt.value&&localStorage.setItem(vu,JSON.stringify({health:Nt.value,ts:pt.value}))}catch{}}function He(){try{const x=localStorage.getItem(vu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Nt.value=f.health,pt.value=f.ts||null)}catch{}}async function mn(){He();const{ok:x,body:f}=await pp();x&&yi(f)}async function ft(x){const f=Ut.value;f?ce.orgEnabled=x:ce.enabled=x;const{ok:q,body:k}=await ra(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});q?(yi(k),Qe(f?x?"Local storage enabled for your organization.":"Local storage disabled for your organization.":x?"Local storage enabled.":"Local storage disabled.")):(f?ce.orgEnabled=!x:ce.enabled=!x,Qe(k.error||"Could not update."))}async function Uo(x){ce.privateFolder=x;const{ok:f,body:q}=await ra({scope:"user",privateFolder:x});f?(yi(q),Qe(x?"Private folder enabled.":"Private folder disabled.")):(ce.privateFolder=!x,Qe(q.error||"Could not update."))}async function Js(x){ce.allowPrivate=x;const{ok:f,body:q}=await ra({scope:"org",allowPrivate:x});f?(yi(q),Qe(x?"Members may now create private folders.":"Private folders disabled for your organization.")):(ce.allowPrivate=!x,Qe(q.error||"Could not update."))}async function Xs(){zt.value="",gs.value=!0;const x={};Ni("readOnly")||(x.readOnly=Wn.value);const f={scope:Ii.value,config:x};Ut.value||(f.enabled=ce.enabled);const{ok:q,body:k}=await ra(f);if(gs.value=!1,!q){zt.value=k.error||"Could not save settings.";return}yi(k),Qe(Ut.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Qs(){Kn.value=!0,Nt.value=null,rn.value={};const{ok:x,body:f}=await mp();Kn.value=!1,Nt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const q={};if(Array.isArray(f.mounts))for(const k of f.mounts)q[k.id]={status:k.status,detail:k.detail};rn.value=q,pt.value=Date.now(),Ra()}function An(x){return x==="ok"?C.success:x==="degraded"?C.warning:C.danger}const eo=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],qn=j("apis-external");function St(x){return V.value||qn.value===x}const gn=j("");let _s=null;function Qe(x){gn.value=x,clearTimeout(_s),_s=setTimeout(()=>gn.value="",2200)}const Kt=bt({current:"",next:"",confirm:""}),Yn=j(""),ys=j(!1);function Fa(){if(ys.value=!1,!Kt.current)return Yn.value="Enter your current password.";if(Kt.next.length<8)return Yn.value="New password must be at least 8 characters.";if(Kt.next!==Kt.confirm)return Yn.value="New passwords do not match.";Yn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",Kt.current=Kt.next=Kt.confirm=""}const bs=j("");function Je(){bs.value="Verification link would be sent once the account service is wired up."}function Ba(x){const f=x.target.files&&x.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){Qe("Image too large (max ~1.5 MB).");return}const q=new FileReader;q.onload=()=>{we.avatar=String(q.result),Qe("Photo updated.")},q.readAsDataURL(f)}function ln(){we.avatar="",Qe("Photo removed.")}const Fi=ke(()=>{var q,k,Ke;const f=(we.displayName||we.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((q=f[0])==null?void 0:q[0])||"P")+(((k=f[1])==null?void 0:k[0])||((Ke=f[0])==null?void 0:Ke[1])||"V")).toUpperCase()}),bi=j(!1),Zo=j(""),xi=j(""),Bi=j(""),Vi=j([]);function to(x){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let q="";for(let k=0;kto(4).toLowerCase()+"-"+to(4).toLowerCase()),Bi.value=""}function Ua(){we.twoFactor=!1,Vi.value=[],bi.value=!1}const Tt=navigator.userAgent;function Za(){return/Edg\//.test(Tt)?"Edge":/OPR\//.test(Tt)?"Opera":/Chrome\//.test(Tt)?"Chrome":/Firefox\//.test(Tt)?"Firefox":/Safari\//.test(Tt)?"Safari":"Browser"}function Ho(){return/Windows/.test(Tt)?"Windows":/Mac OS X/.test(Tt)?"macOS":/Android/.test(Tt)?"Android":/iPhone|iPad/.test(Tt)?"iOS":/Linux/.test(Tt)?"Linux":"Unknown OS"}const $n=Date.now(),Ui=j([]),wi=j(!1),ki=j(""),Ot=bt({email:"",password:"",role:"user",organization:""}),Jn=j(""),Zi=j(!1),Hi=j(""),jo=ke(()=>{const x=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&x.push({value:"superadmin",label:"Superadmin"}),x}),Si=j([]);async function ji(){if(!d.value)return;const x=await ip();x.ok&&(Si.value=x.organizations.slice().sort((f,q)=>f.name.localeCompare(q.name)))}const io=ke(()=>{const x=Si.value.map(f=>({value:f.id,label:f.name}));return u.value&&x.unshift({value:"",label:"No organization"}),x});async function Xn(){if(!d.value)return;wi.value=!0,ki.value="";const x=await Qh();if(wi.value=!1,!x.ok){ki.value=x.status===403?"Manager role required.":"Could not load users.";return}Ui.value=x.users.slice().sort((f,q)=>f.email.localeCompare(q.email))}function Qn(x){try{const f=x.data||{},q=Object.keys(f)[0];return q&&f[q]&&f[q].message||x.message||x.error||"Invalid input."}catch{return x.error||"Could not create user."}}async function ei(){Jn.value="";const x=Ot.email.trim().toLowerCase();if(!x.includes("@"))return Jn.value="Enter a valid email.";if(Ot.password.length<8)return Jn.value="Password must be at least 8 characters.";Zi.value=!0;const f=u.value?Ot.organization:o.organization,{ok:q,body:k}=await ep(x,Ot.password,Ot.role,f);if(Zi.value=!1,!q)return Jn.value=Qn(k);Ot.email="",Ot.password="",Ot.role="user",Ot.organization="",Qe("User created."),Xn()}async function Ha(x){const{ok:f,body:q}=await np(x.id);if(Hi.value="",!f)return Qe(q.error||"Could not remove user.");Qe("User removed."),Xn()}const qe=bt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),Pt=j(""),Wi=j(!1),xs=ke(()=>!!qe.id&&qe.email===o.email);function ja(x){Hi.value="",qe.id=x.id,qe.email=x.email,qe.role=x.role||"user",qe.verified=!!x.verified,qe.password="",qe.organization=x.organization||"",Pt.value=""}function ws(){qe.id="",Pt.value=""}async function so(){Pt.value="";const x=qe.email.trim().toLowerCase();if(!x.includes("@"))return Pt.value="Enter a valid email.";if(qe.password&&qe.password.length<8)return Pt.value="New password must be at least 8 characters (or leave blank).";const f={email:x,role:qe.role,verified:qe.verified};u.value&&(f.organization=qe.organization),qe.password&&(f.password=qe.password),Wi.value=!0;const{ok:q,body:k}=await tp(qe.id,f);if(Wi.value=!1,!q)return Pt.value=Qn(k);Qe("User updated."),ws(),Xn()}const ks=bt({name:""}),Ki=j(""),Gi=j(!1),qi=j(""),Ct=bt({id:"",name:""}),tn=j(""),oo=ke(()=>{const x={};for(const f of Ui.value)f.organization&&(x[f.organization]=(x[f.organization]||0)+1);return x});async function vn(){Ki.value="";const x=ks.name.trim();if(!x)return Ki.value="Enter an organization name.";Gi.value=!0;const{ok:f,body:q}=await sp(x);if(Gi.value=!1,!f)return Ki.value=Qn(q);ks.name="",Qe("Organization created."),ji()}function Wa(x){qi.value="",Ct.id=x.id,Ct.name=x.name,tn.value=""}function ti(){Ct.id="",tn.value=""}async function Wo(){tn.value="";const x=Ct.name.trim();if(!x)return tn.value="Enter an organization name.";const{ok:f,body:q}=await op(Ct.id,x);if(!f)return tn.value=Qn(q);Qe("Organization renamed."),ti(),ji(),Xn()}async function Yi(x){const{ok:f,body:q}=await ap(x.id);if(qi.value="",!f)return Qe(q.error||"Could not delete organization.");Qe("Organization deleted."),ji()}function Ko(){const x={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...we},themeMode:rs.value},f=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),q=URL.createObjectURL(f),k=document.createElement("a");k.href=q,k.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(k),k.click(),k.remove(),URL.revokeObjectURL(q),Qe("Settings exported.")}const ni=j("");function Ka(x){const f=x.target.files&&x.target.files[0];if(!f)return;const q=new FileReader;q.onload=()=>{try{const k=JSON.parse(String(q.result)),Ke=k.prefs||k;if(!Bc(Ke))throw new Error("bad shape");k.themeMode&&xa(k.themeMode),jr(we.fontSize),Wr(we.reduceMotion),ni.value="Settings imported and applied."}catch{ni.value="That file is not a valid PilotVault settings export."}},q.readAsText(f),x.target.value=""}const st=bt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let In=null;const ao=ke(()=>o.email||"DELETE MY ACCOUNT"),Ji=ke(()=>st.understand&&st.typed===ao.value);function Ga(){Ji.value&&(st.armed=!0,st.cooldown=5,clearInterval(In),In=setInterval(()=>{st.cooldown--,st.cooldown<=0&&clearInterval(In)},1e3))}$t(Ji,x=>{!x&&st.armed&&(st.armed=!1,st.cooldown=0,clearInterval(In))});function Tn(){if(!(!st.armed||st.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}st.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return fi(()=>{Te=setInterval(()=>ze.value=Date.now(),1e3),ji(),Xn(),Re(),Fo(),ms(),mn()}),Fs(()=>{clearInterval(Te),clearInterval(In),clearTimeout(_s)}),(x,f)=>(p(),g("div",fm,[r("div",hm,[f[63]||(f[63]=r("div",null,[r("div",{class:"eyebrow"},"Preferences"),r("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),r("div",pm,[z(X,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":f[0]||(f[0]=q=>B.value=q),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[xe,B.value]]),B.value?(p(),g("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=q=>B.value="")},[z(X,{name:"x",size:15})])):R("",!0)])]),r("div",mm,[oe(r("nav",gm,[(p(!0),g(re,null,Be(T.value,q=>(p(),g("button",{key:q.id,class:Ee(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[O.value===q.id?q.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":q.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:k=>O.value=q.id},[z(X,{name:q.icon,size:17},null,8,["name"]),r("span",_m,S(q.label),1)],10,vm))),128))],512),[[yh,!V.value]]),r("div",ym,[V.value&&!Y.value.length?(p(),g("div",bm," No settings match “"+S(B.value)+"”. ",1)):R("",!0),(p(!0),g(re,null,Be(Y.value,q=>(p(),g(re,{key:q.id},[V.value?(p(),g("div",xm,[z(X,{name:q.icon,size:14},null,8,["name"]),D(" "+S(q.label),1)])):R("",!0),q.id==="account"?(p(),g("div",wm,[z(Me,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:Ce(()=>[oe(r("input",{"onUpdate:modelValue":f[2]||(f[2]=k=>$e(we).name=k),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=k=>Qe("Saved."))},null,544),[[xe,$e(we).name]])]),_:1}),z(Me,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:Ce(()=>[r("div",km,[f[64]||(f[64]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),oe(r("input",{"onUpdate:modelValue":f[4]||(f[4]=k=>$e(we).username=k),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=k=>Qe("Saved."))},null,544),[[xe,$e(we).username]])])]),_:1}),z(Me,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:Ce(()=>[r("div",Sm,[r("span",Tm,S(t.email||"—"),1),r("span",Pm,[z(X,{name:"mail",size:12}),f[65]||(f[65]=D(" Unverified ",-1))])])]),_:1}),z(Me,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:Ce(()=>[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[z(X,{name:v(t.role),size:12},null,8,["name"]),D(S(h(t.role)),1)],2)]),_:1}),z(Me,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:Ce(()=>[r("span",{class:Ee(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},S(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),z(Me,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:Ce(()=>[r("button",{class:"btn-ghost",onClick:Je},"Send verification link"),bs.value?(p(),g("p",Cm,S(bs.value),1)):R("",!0)]),_:1}),z(Me,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:Ce(()=>[r("div",Lm,[oe(r("input",{"onUpdate:modelValue":f[6]||(f[6]=k=>Kt.current=k),type:"password",class:"field",placeholder:"Current password"},null,512),[[xe,Kt.current]]),oe(r("input",{"onUpdate:modelValue":f[7]||(f[7]=k=>Kt.next=k),type:"password",class:"field",placeholder:"New password"},null,512),[[xe,Kt.next]]),oe(r("input",{"onUpdate:modelValue":f[8]||(f[8]=k=>Kt.confirm=k),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[xe,Kt.confirm]]),r("div",Mm,[r("button",{class:"btn-accent",onClick:Fa},"Update password"),Yn.value?(p(),g("span",{key:0,class:Ee(["text-xs",ys.value?"text-success-fg":"text-ink-muted"])},S(Yn.value),3)):R("",!0)])])]),_:1})])):q.id==="appearance"?(p(),g("div",Em,[z(Me,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:Ce(()=>[z(bn,{modelValue:Pe.value,"onUpdate:modelValue":f[9]||(f[9]=k=>Pe.value=k),options:he},null,8,["modelValue"])]),_:1}),z(Me,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:Ce(()=>[z(bn,{modelValue:$e(we).fontSize,"onUpdate:modelValue":f[10]||(f[10]=k=>$e(we).fontSize=k),options:ye},null,8,["modelValue"])]),_:1}),z(Me,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:Ce(()=>[z(sn,{modelValue:$e(we).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=k=>$e(we).reduceMotion=k)},null,8,["modelValue"])]),_:1}),z(Me,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:Ce(()=>[oe(r("select",{"onUpdate:modelValue":f[12]||(f[12]=k=>$e(we).language=k),class:"field w-48"},[(p(),g(re,null,Be(Ie,([k,Ke])=>r("option",{key:k,value:k},S(Ke),9,Om)),64))],512),[[Et,$e(we).language]])]),_:1}),z(Me,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:Ce(()=>[oe(r("select",{"onUpdate:modelValue":f[13]||(f[13]=k=>$e(we).region=k),class:"field w-48"},[(p(),g(re,null,Be(Ve,([k,Ke])=>r("option",{key:k,value:k},S(Ke),9,zm)),64))],512),[[Et,$e(we).region]])]),_:1}),z(Me,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:Ce(()=>[oe(r("select",{"onUpdate:modelValue":f[14]||(f[14]=k=>$e(we).dateFormat=k),class:"field w-48"},[(p(),g(re,null,Be(pe,([k,Ke])=>r("option",{key:k,value:k},S(Ke),9,Am)),64))],512),[[Et,$e(we).dateFormat]])]),_:1}),z(Me,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:Ce(()=>[z(bn,{modelValue:$e(we).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=k=>$e(we).timeFormat=k),options:Ne},null,8,["modelValue"])]),_:1}),z(Me,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:Ce(()=>[r("span",$m,S(te.value),1)]),_:1}),f[66]||(f[66]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):q.id==="integrations"?(p(),g("div",Im,[V.value?R("",!0):(p(),g("div",Dm,[(p(),g(re,null,Be(eo,k=>r("button",{key:k.id,type:"button",class:Ee(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",qn.value===k.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Ke=>qn.value=k.id},[z(X,{name:k.icon,size:16},null,8,["name"]),D(S(k.label),1)],10,Nm)),64))])),St("apis-external")?(p(),g("div",Rm,[r("div",Fm,[r("div",Bm,[z(X,{name:"radio",size:20})]),f[67]||(f[67]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Live ADS-B aircraft data. Configure your own OAuth2 credentials, plan and default bounding box. ")],-1))]),de.loaded&&!de.available?(p(),g("div",Vm,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[68]||(f[68]=D(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),de.canEditOrg?(p(),g("div",Um,[f[69]||(f[69]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(bn,{modelValue:_e.value,"onUpdate:modelValue":f[16]||(f[16]=k=>_e.value=k),options:it},null,8,["modelValue"])])):R("",!0),Q.value?(p(),at(Me,{key:2,title:"Enable OpenSky (organization-wide)",desc:"Turn OpenSky on or off for everyone in your organization.",keywords:"enable disable plugin opensky organization"},{default:Ce(()=>[z(sn,{"model-value":de.orgEnabled,disabled:!de.available,"onUpdate:modelValue":Ze},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:Ce(()=>[z(sn,{"model-value":de.enabled,disabled:!de.available||!de.orgEnabled,"onUpdate:modelValue":Ze},null,8,["model-value","disabled"])]),_:1})),!Q.value&&de.available&&!de.orgEnabled?(p(),g("div",Zm,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[71]||(f[71]=D("OpenSky is turned off for your organization",-1)),de.canEditOrg?(p(),g("span",Hm,[...f[70]||(f[70]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[72]||(f[72]=D(". ",-1))])):R("",!0),Q.value?(p(),g("div",jm,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[73]||(f[73]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Wm,S(t.organizationName||"your organization"),1),f[74]||(f[74]=D(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):Z.value?(p(),g("div",Km," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),de.available&&!Q.value?(p(),g("div",Gm,[r("div",qm,[r("div",Ym,[z(X,{name:"signal",size:15}),f[75]||(f[75]=D("Credit usage ",-1))]),me.value?(p(),g("span",Jm,"Checked "+S(Ue()),1)):R("",!0)]),Oe.value?(p(),g(re,{key:0},[Oe.value.remaining!=null?(p(),g(re,{key:0},[r("div",Xm,[r("span",Qm,S(et(Oe.value.remaining)),1),r("span",eg,"/ "+S(et(Oe.value.daily))+" credits left today",1)]),r("div",tg,[r("div",{class:Ee(["h-full rounded-full transition-all",ut.value]),style:Is({width:Xe.value+"%"})},null,6)]),r("div",ng," Used "+S(et(Oe.value.daily-Oe.value.remaining))+" today · "+S(Oe.value.probeCost)+" credit"+S(Oe.value.probeCost===1?"":"s")+" per query · "+S(Oe.value.mode),1)],64)):(p(),g(re,{key:1},[r("div",ig,[f[76]||(f[76]=D("Daily allowance: ",-1)),r("span",sg,S(et(Oe.value.daily)),1),f[77]||(f[77]=D(" credits",-1))]),r("div",og,S(Oe.value.probeCost)+" credit"+S(Oe.value.probeCost===1?"":"s")+" per query · "+S(Oe.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),g("div",ag,[...f[78]||(f[78]=[D(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),D(" below to fetch your live OpenSky credit balance. ",-1)])]))])):R("",!0),z(Me,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:Ce(()=>[Se("plan")?(p(),g("span",rg,[D(S((A.find(k=>k.value===U("plan").effective)||{}).label||U("plan").effective||"—")+" ",1),I("plan")?(p(),g("span",lg,[z(X,{name:"lock",size:10}),D(S(I("plan")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:be.plan,"onUpdate:modelValue":f[17]||(f[17]=k=>be.plan=k),options:A},null,8,["modelValue"]))]),_:1}),z(Me,{title:"Default bounding box",desc:"Pick a region, or choose Custom to enter lamin,lomin,lamax,lomax by hand — used for live queries and the health probe.",keywords:"bounding box bbox area region country continent world europe custom coordinates"},{default:Ce(()=>[Se("bbox")?(p(),g("span",ug,[D(S(_(U("bbox").effective)||U("bbox").effective||"—")+" ",1),I("bbox")?(p(),g("span",cg,[z(X,{name:"lock",size:10}),D(S(I("bbox")),1)])):R("",!0)])):(p(),g("div",dg,[oe(r("select",{"onUpdate:modelValue":f[18]||(f[18]=k=>K.value=k),class:"field w-64"},[(p(),g(re,null,Be(vt,k=>r("optgroup",{key:k.label,label:k.label},[(p(!0),g(re,null,Be(k.options,Ke=>(p(),g("option",{key:Ke.value,value:Ke.value},S(Ke.label),9,hg))),128))],8,fg)),64)),f[79]||(f[79]=r("option",{value:"__custom__"},"Custom…",-1))],512),[[Et,K.value]]),G.value?oe((p(),g("input",{key:0,"onUpdate:modelValue":f[19]||(f[19]=k=>be.bbox=k),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[xe,be.bbox]]):R("",!0)]))]),_:1}),z(Me,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:Ce(()=>[Se("clientId")?(p(),g("span",pg,[D(S(U("clientId").effective||"—")+" ",1),I("clientId")?(p(),g("span",mg,[z(X,{name:"lock",size:10}),D(S(I("clientId")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=k=>be.clientId=k),class:"field w-64",placeholder:"your-api-client"},null,512)),[[xe,be.clientId]])]),_:1}),z(Me,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:Ce(()=>[Se("clientSecret")?(p(),g("span",gg,[D(S(U("clientSecret").effective||"—")+" ",1),I("clientSecret")?(p(),g("span",vg,[z(X,{name:"lock",size:10}),D(S(I("clientSecret")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[21]||(f[21]=k=>be.clientSecret=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,be.clientSecret]])]),_:1}),de.available&&!de.allowAnonymous?(p(),g("div",_g," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):R("",!0),r("div",yg,[Z.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:le.value||!de.available,onClick:Ye},S(le.value?"Saving…":Q.value?"Save organization settings":"Save settings"),9,bg)),Q.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:ie.value||!de.available,onClick:ht},S(ie.value?"Testing…":"Test connection"),9,xg)),ae.value?(p(),g("span",wg,S(ae.value),1)):R("",!0),rt.value&&!Q.value?(p(),g("span",{key:3,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ue(rt.value.status)])},[f[80]||(f[80]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(rt.value.detail||rt.value.status),1)],2)):R("",!0)])])):R("",!0),St("drives-external")?(p(),g(re,{key:2},[r("div",kg,[r("div",Sg,[r("div",Tg,[z(X,{name:"server",size:20})]),f[81]||(f[81]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to an FTP, FTPS or SFTP server. Configure the connection your account uses for file transfers. ")],-1))]),Ae.loaded&&!Ae.available?(p(),g("div",Pg,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[82]||(f[82]=D(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),Ae.canEditOrg?(p(),g("div",Cg,[f[83]||(f[83]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(bn,{modelValue:wt.value,"onUpdate:modelValue":f[22]||(f[22]=k=>wt.value=k),options:it},null,8,["modelValue"])])):R("",!0),dn.value?(p(),at(Me,{key:2,title:"Enable file transfer (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin ftp sftp organization"},{default:Ce(()=>[z(sn,{"model-value":Ae.orgEnabled,disabled:!Ae.available,"onUpdate:modelValue":Zs},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{key:3,title:"Enable file transfer",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin ftp sftp"},{default:Ce(()=>[z(sn,{"model-value":Ae.enabled,disabled:!Ae.available||!Ae.orgEnabled,"onUpdate:modelValue":Zs},null,8,["model-value","disabled"])]),_:1})),!dn.value&&Ae.available&&!Ae.orgEnabled?(p(),g("div",Lg,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[85]||(f[85]=D("File transfer is turned off for your organization",-1)),Ae.canEditOrg?(p(),g("span",Mg,[...f[84]||(f[84]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[86]||(f[86]=D(". ",-1))])):R("",!0),dn.value?(p(),g("div",Eg,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[87]||(f[87]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Og,S(t.organizationName||"your organization"),1),f[88]||(f[88]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):ls.value?(p(),g("div",zg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),z(Me,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:Ce(()=>[en("protocol")?(p(),g("span",Ag,[D(S(Ia(Ft("protocol").effective))+" ",1),yt("protocol")?(p(),g("span",$g,[z(X,{name:"lock",size:10}),D(S(yt("protocol")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:tt.protocol,"onUpdate:modelValue":f[23]||(f[23]=k=>tt.protocol=k),options:Bs},null,8,["modelValue"]))]),_:1}),z(Me,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:Ce(()=>[en("host")?(p(),g("span",Ig,[D(S(Ft("host").effective||"—")+" ",1),yt("host")?(p(),g("span",Dg,[z(X,{name:"lock",size:10}),D(S(yt("host")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=k=>tt.host=k),class:"field w-64",placeholder:"files.example.com"},null,512)),[[xe,tt.host]])]),_:1}),z(Me,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:Ce(()=>[en("port")?(p(),g("span",Ng,[D(S(Ft("port").effective||"default")+" ",1),yt("port")?(p(),g("span",Rg,[z(X,{name:"lock",size:10}),D(S(yt("port")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=k=>tt.port=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[xe,tt.port]])]),_:1}),z(Me,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:Ce(()=>[en("username")?(p(),g("span",Fg,[D(S(Ft("username").effective||"—")+" ",1),yt("username")?(p(),g("span",Bg,[z(X,{name:"lock",size:10}),D(S(yt("username")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=k=>tt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[xe,tt.username]])]),_:1}),z(Me,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:Ce(()=>[en("password")?(p(),g("span",Vg,[D(S(Ft("password").effective||"—")+" ",1),yt("password")?(p(),g("span",Ug,[z(X,{name:"lock",size:10}),D(S(yt("password")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[27]||(f[27]=k=>tt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,tt.password]])]),_:1}),us.value==="sftp"?(p(),at(Me,{key:7,block:"",title:"SSH private key",desc:"PEM key for SFTP key auth — used instead of, or alongside, a password.",keywords:"private key ssh pem identity"},{default:Ce(()=>[en("privateKey")?(p(),g("span",Zg,[D(S(Ft("privateKey").effective||"—")+" ",1),yt("privateKey")?(p(),g("span",Hg,[z(X,{name:"lock",size:10}),D(S(yt("privateKey")),1)])):R("",!0)])):oe((p(),g("textarea",{key:1,"onUpdate:modelValue":f[28]||(f[28]=k=>tt.privateKey=k),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[xe,tt.privateKey]])]),_:1})):R("",!0),us.value==="sftp"?(p(),at(Me,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:Ce(()=>[en("keyPassphrase")?(p(),g("span",jg,[D(S(Ft("keyPassphrase").effective||"—")+" ",1),yt("keyPassphrase")?(p(),g("span",Wg,[z(X,{name:"lock",size:10}),D(S(yt("keyPassphrase")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=k=>tt.keyPassphrase=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,tt.keyPassphrase]])]),_:1})):R("",!0),us.value==="sftp"?(p(),at(Me,{key:9,title:"Host key fingerprint",desc:"Optional SHA256:… fingerprint to pin the server's host key. Blank accepts any key.",keywords:"host key fingerprint verify trust"},{default:Ce(()=>[en("hostKeyFingerprint")?(p(),g("span",Kg,[D(S(Ft("hostKeyFingerprint").effective||"—")+" ",1),yt("hostKeyFingerprint")?(p(),g("span",Gg,[z(X,{name:"lock",size:10}),D(S(yt("hostKeyFingerprint")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[30]||(f[30]=k=>tt.hostKeyFingerprint=k),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[xe,tt.hostKeyFingerprint]])]),_:1})):R("",!0),us.value==="ftps"?(p(),at(Me,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:Ce(()=>[en("insecureSkipVerify")?(p(),g("span",qg,[D(S(Ft("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),yt("insecureSkipVerify")?(p(),g("span",Yg,[z(X,{name:"lock",size:10}),D(S(yt("insecureSkipVerify")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:tt.insecureSkipVerify,"onUpdate:modelValue":f[31]||(f[31]=k=>tt.insecureSkipVerify=k),options:No},null,8,["modelValue"]))]),_:1})):R("",!0),z(Me,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:Ce(()=>[en("basePath")?(p(),g("span",Jg,[D(S(Ft("basePath").effective||"—")+" ",1),yt("basePath")?(p(),g("span",Xg,[z(X,{name:"lock",size:10}),D(S(yt("basePath")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[32]||(f[32]=k=>tt.basePath=k),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[xe,tt.basePath]])]),_:1}),r("div",Qg,[ls.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:Dt.value||!Ae.available,onClick:Bo},S(Dt.value?"Saving…":dn.value?"Save organization settings":"Save settings"),9,ev)),dn.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:on.value||!Ae.available,onClick:Vo},S(on.value?"Testing…":"Test connection"),9,tv)),kt.value?(p(),g("span",nv,S(kt.value),1)):R("",!0),pi.value&&!dn.value?(p(),g("span",iv,"Checked "+S(Da()),1)):R("",!0),Qt.value&&!dn.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Hs(Qt.value.status)])},[f[89]||(f[89]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(Qt.value.detail||Qt.value.status),1)],2)):R("",!0)])]),r("div",sv,[r("div",ov,[r("div",av,[z(X,{name:"cloud",size:20})]),f[90]||(f[90]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to a WebDAV server (Nextcloud, ownCloud, IIS, …). Configure the connection your account uses. ")],-1))]),ot.loaded&&!ot.available?(p(),g("div",rv,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[91]||(f[91]=D(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):R("",!0),ot.canEditOrg?(p(),g("div",lv,[f[92]||(f[92]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(bn,{modelValue:an.value,"onUpdate:modelValue":f[33]||(f[33]=k=>an.value=k),options:it},null,8,["modelValue"])])):R("",!0),pn.value?(p(),at(Me,{key:2,title:"Enable WebDAV (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin webdav organization"},{default:Ce(()=>[z(sn,{"model-value":ot.orgEnabled,disabled:!ot.available,"onUpdate:modelValue":jn},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:Ce(()=>[z(sn,{"model-value":ot.enabled,disabled:!ot.available||!ot.orgEnabled,"onUpdate:modelValue":jn},null,8,["model-value","disabled"])]),_:1})),!pn.value&&ot.available&&!ot.orgEnabled?(p(),g("div",uv,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[94]||(f[94]=D("WebDAV is turned off for your organization",-1)),ot.canEditOrg?(p(),g("span",cv,[...f[93]||(f[93]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[95]||(f[95]=D(". ",-1))])):R("",!0),pn.value?(p(),g("div",dv,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[96]||(f[96]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",fv,S(t.organizationName||"your organization"),1),f[97]||(f[97]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):js.value?(p(),g("div",hv," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),z(Me,{block:"",title:"Server URL",desc:"WebDAV endpoint including scheme, e.g. https://cloud.example.com/remote.php/dav/files/alice/.",keywords:"url server address endpoint webdav host"},{default:Ce(()=>[On("baseURL")?(p(),g("span",pv,[D(S(En("baseURL").effective||"—")+" ",1),Vt("baseURL")?(p(),g("span",mv,[z(X,{name:"lock",size:10}),D(S(Vt("baseURL")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=k=>Bt.baseURL=k),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[xe,Bt.baseURL]])]),_:1}),z(Me,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:Ce(()=>[On("username")?(p(),g("span",gv,[D(S(En("username").effective||"—")+" ",1),Vt("username")?(p(),g("span",vv,[z(X,{name:"lock",size:10}),D(S(Vt("username")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=k=>Bt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[xe,Bt.username]])]),_:1}),z(Me,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:Ce(()=>[On("password")?(p(),g("span",_v,[D(S(En("password").effective||"—")+" ",1),Vt("password")?(p(),g("span",yv,[z(X,{name:"lock",size:10}),D(S(Vt("password")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[36]||(f[36]=k=>Bt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[xe,Bt.password]])]),_:1}),z(Me,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:Ce(()=>[On("insecureSkipVerify")?(p(),g("span",bv,[D(S(En("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Vt("insecureSkipVerify")?(p(),g("span",xv,[z(X,{name:"lock",size:10}),D(S(Vt("insecureSkipVerify")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:Bt.insecureSkipVerify,"onUpdate:modelValue":f[37]||(f[37]=k=>Bt.insecureSkipVerify=k),options:hs},null,8,["modelValue"]))]),_:1}),z(Me,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:Ce(()=>[On("basePath")?(p(),g("span",wv,[D(S(En("basePath").effective||"—")+" ",1),Vt("basePath")?(p(),g("span",kv,[z(X,{name:"lock",size:10}),D(S(Vt("basePath")),1)])):R("",!0)])):oe((p(),g("input",{key:1,"onUpdate:modelValue":f[38]||(f[38]=k=>Bt.basePath=k),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[xe,Bt.basePath]])]),_:1}),r("div",Sv,[js.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:ds.value||!ot.available,onClick:gi},S(ds.value?"Saving…":pn.value?"Save organization settings":"Save settings"),9,Tv)),pn.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:fs.value||!ot.available,onClick:Gs},S(fs.value?"Testing…":"Test connection"),9,Pv)),Ai.value?(p(),g("span",Cv,S(Ai.value),1)):R("",!0),mi.value&&!pn.value?(p(),g("span",Lv,"Checked "+S($i()),1)):R("",!0),hn.value&&!pn.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",je(hn.value.status)])},[f[98]||(f[98]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(hn.value.detail||hn.value.status),1)],2)):R("",!0)])])],64)):R("",!0),St("drives-local")?(p(),g("div",Mv,[r("div",Ev,[r("div",Ov,[z(X,{name:"monitor",size:20})]),f[99]||(f[99]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),r("div",{class:"mt-0.5 text-xs text-ink-muted"}," A private folder on the server for your files. Each user has their own; members of an organization share one. ")],-1))]),ce.loaded&&!ce.available?(p(),g("div",zv,[z(X,{name:"lock",size:14,class:"mr-1 inline"}),f[100]||(f[100]=D(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):ce.loaded&&!ce.rootConfigured?(p(),g("div",Av,[z(X,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[101]||(f[101]=D(" No storage root has been configured by your administrator yet. ",-1))])):R("",!0),ce.canEditOrg?(p(),g("div",$v,[f[102]||(f[102]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(bn,{modelValue:zn.value,"onUpdate:modelValue":f[39]||(f[39]=k=>zn.value=k),options:it},null,8,["modelValue"])])):R("",!0),Ut.value?(p(),at(Me,{key:3,title:"Enable local storage (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin local storage folder organization"},{default:Ce(()=>[z(sn,{"model-value":ce.orgEnabled,disabled:!ce.available,"onUpdate:modelValue":ft},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{key:4,title:"Enable local storage",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin local storage folder"},{default:Ce(()=>[z(sn,{"model-value":ce.enabled,disabled:!ce.available||!ce.orgEnabled,"onUpdate:modelValue":ft},null,8,["model-value","disabled"])]),_:1})),!Ut.value&&ce.available&&!ce.orgEnabled?(p(),g("div",Iv,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[104]||(f[104]=D("Local storage is turned off for your organization",-1)),ce.canEditOrg?(p(),g("span",Dv,[...f[103]||(f[103]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[105]||(f[105]=D(". ",-1))])):R("",!0),Ut.value?(p(),g("div",Nv,[z(X,{name:"users",size:13,class:"mr-1 inline"}),f[106]||(f[106]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Rv,S(t.organizationName||"your organization"),1),f[107]||(f[107]=D(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Gn.value?(p(),g("div",Fv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):R("",!0),Ut.value?(p(),at(Me,{key:8,title:"Private folders",desc:"Let members create a private folder inside the organization folder, reachable only by them.",keywords:"private folder members allow policy organization"},{default:Ce(()=>[z(sn,{"model-value":ce.allowPrivate,disabled:!ce.available,"onUpdate:modelValue":Js},null,8,["model-value","disabled"])]),_:1})):R("",!0),Ut.value?R("",!0):(p(),g(re,{key:9},[z(Me,{block:"",title:"Your folders",desc:"Assigned automatically and isolated — no one else can reach your private folder.",keywords:"folder directory path storage location isolated private shared"},{default:Ce(()=>[r("div",Bv,[(p(!0),g(re,null,Be(ce.mounts,k=>(p(),g("div",{key:k.id,class:"flex flex-wrap items-center gap-2"},[r("span",Vv,S(k.path),1),k.kind==="shared"?(p(),g("span",Uv,[z(X,{name:"users",size:10}),f[108]||(f[108]=D("Shared with your organization",-1))])):(p(),g("span",Zv,[z(X,{name:"lock",size:10}),f[109]||(f[109]=D("Private to you",-1))])),rn.value[k.id]?(p(),g("span",{key:2,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",An(rn.value[k.id].status)])},[f[110]||(f[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(rn.value[k.id].status),1)],2)):R("",!0)]))),128)),ce.mounts.length?R("",!0):(p(),g("div",Hv,S(ce.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),ce.isOrgUser&&ce.allowPrivate?(p(),at(Me,{key:0,title:"My private folder",desc:"Add a private folder inside the organization folder, reachable only by you — you keep the shared folder too.",keywords:"private folder personal isolated organization inside"},{default:Ce(()=>[z(sn,{"model-value":ce.privateFolder,disabled:!ce.available||!ce.orgEnabled,"onUpdate:modelValue":Uo},null,8,["model-value","disabled"])]),_:1})):ce.isOrgUser&&!ce.allowPrivate?(p(),g("div",jv,[z(X,{name:"lock",size:13,class:"mr-1 inline"}),f[111]||(f[111]=D("Private folders are turned off by your organization. ",-1))])):R("",!0)],64)),z(Me,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:Ce(()=>[Ni("readOnly")?(p(),g("span",Wv,[D(S(qs(_i("readOnly").effective))+" ",1),vs("readOnly")?(p(),g("span",Kv,[z(X,{name:"lock",size:10}),D(S(vs("readOnly")),1)])):R("",!0)])):(p(),at(bn,{key:1,modelValue:Wn.value,"onUpdate:modelValue":f[40]||(f[40]=k=>Wn.value=k),options:vi},null,8,["modelValue"]))]),_:1}),r("div",Gv,[Gn.value?R("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:gs.value||!ce.available,onClick:Xs},S(gs.value?"Saving…":Ut.value?"Save organization settings":"Save settings"),9,qv)),Ut.value?R("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:Kn.value||!ce.available,onClick:Qs},S(Kn.value?"Testing…":"Test folder"),9,Yv)),zt.value?(p(),g("span",Jv,S(zt.value),1)):R("",!0),pt.value&&!Ut.value?(p(),g("span",Xv,"Checked "+S(Ys()),1)):R("",!0),Nt.value&&!Ut.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",An(Nt.value.status)])},[f[112]||(f[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(Nt.value.detail||Nt.value.status),1)],2)):R("",!0)])])):R("",!0)])):q.id==="profile"?(p(),g("div",Qv,[z(Me,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:Ce(()=>[r("div",e_,[$e(we).avatar?(p(),g("img",{key:0,src:$e(we).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,t_)):(p(),g("div",n_,S(Fi.value),1)),r("div",i_,[r("label",s_,[z(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[113]||(f[113]=D("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Ba},null,32)]),$e(we).avatar?(p(),g("button",{key:0,class:"btn-ghost",onClick:ln},"Remove")):R("",!0)])])]),_:1}),z(Me,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:Ce(()=>[oe(r("input",{"onUpdate:modelValue":f[41]||(f[41]=k=>$e(we).displayName=k),class:"field w-56",placeholder:"Jane O.",onBlur:f[42]||(f[42]=k=>Qe("Saved."))},null,544),[[xe,$e(we).displayName]])]),_:1}),z(Me,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:Ce(()=>[oe(r("textarea",{"onUpdate:modelValue":f[43]||(f[43]=k=>$e(we).bio=k),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[44]||(f[44]=k=>Qe("Saved."))},null,544),[[xe,$e(we).bio]]),r("div",o_,S(($e(we).bio||"").length)+"/240",1)]),_:1}),z(Me,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:Ce(()=>[z(sn,{modelValue:$e(we).showEmail,"onUpdate:modelValue":f[45]||(f[45]=k=>$e(we).showEmail=k)},null,8,["modelValue"])]),_:1})])):q.id==="security"?(p(),g("div",a_,[z(Me,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:Ce(()=>[r("div",r_,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",$e(we).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[114]||(f[114]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S($e(we).twoFactor?"Enabled":"Disabled"),1)],2),!$e(we).twoFactor&&!bi.value?(p(),g("button",{key:0,class:"btn-accent",onClick:Va},"Enable 2FA")):$e(we).twoFactor?(p(),g("button",{key:1,class:"btn-ghost",onClick:Ua},"Disable")):R("",!0)]),bi.value?(p(),g("div",l_,[r("div",u_,[f[116]||(f[116]=r("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[r("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[r("rect",{width:"100",height:"100",fill:"#fff"}),r("g",{fill:"#0F1E3D"},[r("rect",{x:"6",y:"6",width:"24",height:"24"}),r("rect",{x:"70",y:"6",width:"24",height:"24"}),r("rect",{x:"6",y:"70",width:"24",height:"24"}),r("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"40",y:"10",width:"8",height:"8"}),r("rect",{x:"52",y:"20",width:"8",height:"8"}),r("rect",{x:"40",y:"40",width:"8",height:"8"}),r("rect",{x:"60",y:"44",width:"8",height:"8"}),r("rect",{x:"44",y:"60",width:"8",height:"8"}),r("rect",{x:"70",y:"60",width:"8",height:"8"}),r("rect",{x:"80",y:"72",width:"8",height:"8"}),r("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),r("div",c_,[f[115]||(f[115]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",d_,S(Zo.value),1),r("div",f_,[oe(r("input",{"onUpdate:modelValue":f[46]||(f[46]=k=>xi.value=k),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[xe,xi.value]]),r("button",{class:"btn-accent",onClick:no},"Verify & enable")]),Bi.value?(p(),g("p",h_,S(Bi.value),1)):R("",!0)])])])):R("",!0),$e(we).twoFactor&&Vi.value.length?(p(),g("div",p_,[f[117]||(f[117]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[118]||(f[118]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",m_,[(p(!0),g(re,null,Be(Vi.value,k=>(p(),g("span",{key:k,class:"select-all"},S(k),1))),128))])])):R("",!0),f[119]||(f[119]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),z(Me,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:Ce(()=>[r("div",g_,[r("div",v_,[r("div",__,[z(X,{name:"monitor",size:18})]),r("div",y_,[r("div",b_,[D(S(Za())+" on "+S(Ho())+" ",1),f[120]||(f[120]=r("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),r("div",x_,"Signed in "+S($e(cu)($e($n))),1)]),r("button",{class:"btn-ghost",onClick:f[47]||(f[47]=k=>l("logout"))},"Log out")])]),f[121]||(f[121]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[122]||(f[122]=r("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):q.id==="team"?(p(),g("div",w_,[qe.id?(p(),g("div",k_,[z(Me,{block:"",title:`Edit user — ${qe.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:Ce(()=>[r("div",S_,[r("div",T_,[oe(r("input",{"onUpdate:modelValue":f[48]||(f[48]=k=>qe.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[xe,qe.email]]),oe(r("select",{"onUpdate:modelValue":f[49]||(f[49]=k=>qe.role=k),class:"field w-32",disabled:xs.value,title:xs.value?"You cannot change your own role":""},[(p(!0),g(re,null,Be(jo.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,C_))),128))],8,P_),[[Et,qe.role]])]),u.value?oe((p(),g("select",{key:0,"onUpdate:modelValue":f[50]||(f[50]=k=>qe.organization=k),class:"field",title:"Organization"},[(p(!0),g(re,null,Be(io.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,L_))),128))],512)),[[Et,qe.organization]]):R("",!0),oe(r("input",{"onUpdate:modelValue":f[51]||(f[51]=k=>qe.password=k),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[xe,qe.password]]),r("label",M_,[z(sn,{modelValue:qe.verified,"onUpdate:modelValue":f[52]||(f[52]=k=>qe.verified=k)},null,8,["modelValue"]),f[123]||(f[123]=D(" Email verified ",-1))]),r("div",E_,[r("button",{class:"btn-accent",disabled:Wi.value,onClick:so},S(Wi.value?"Saving…":"Save changes"),9,O_),r("button",{class:"btn-ghost",onClick:ws},"Cancel"),Pt.value?(p(),g("span",z_,S(Pt.value),1)):R("",!0),xs.value?(p(),g("span",A_,"Editing your own account — role locked.")):R("",!0)])])]),_:1},8,["title"])])):(p(),g("div",$_,[z(Me,{block:"",title:"Add user",desc:"Create a new account. Admins add users within their organization; superadmins can target any.",keywords:"add user create account role admin organization"},{default:Ce(()=>[r("div",I_,[r("div",D_,[oe(r("input",{"onUpdate:modelValue":f[53]||(f[53]=k=>Ot.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[xe,Ot.email]]),oe(r("select",{"onUpdate:modelValue":f[54]||(f[54]=k=>Ot.role=k),class:"field w-32"},[(p(!0),g(re,null,Be(jo.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,N_))),128))],512),[[Et,Ot.role]])]),u.value?oe((p(),g("select",{key:0,"onUpdate:modelValue":f[55]||(f[55]=k=>Ot.organization=k),class:"field",title:"Organization"},[(p(!0),g(re,null,Be(io.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,R_))),128))],512)),[[Et,Ot.organization]]):(p(),g("div",F_,[f[124]||(f[124]=D(" New users join your organization: ",-1)),r("span",B_,S(t.organizationName||"—"),1)])),oe(r("input",{"onUpdate:modelValue":f[56]||(f[56]=k=>Ot.password=k),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[xe,Ot.password]]),r("div",V_,[r("button",{class:"btn-accent",disabled:Zi.value,onClick:ei},S(Zi.value?"Creating…":"Create user"),9,U_),Jn.value?(p(),g("span",Z_,S(Jn.value),1)):R("",!0)])])]),_:1})])),r("div",H_,[r("div",j_,[f[125]||(f[125]=r("div",null,[r("div",{class:"eyebrow"},"Team"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),r("button",{class:"btn-ghost",disabled:wi.value,onClick:Xn},S(wi.value?"Loading…":"Refresh"),9,W_)]),ki.value?(p(),g("div",K_,S(ki.value),1)):!Ui.value.length&&!wi.value?(p(),g("div",G_,"No users yet.")):(p(),g("div",q_,[r("table",Y_,[r("thead",null,[r("tr",J_,[(p(),g(re,null,Be(["User","Role","Organization","Status",""],k=>r("th",{key:k,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},S(k),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(Ui.value,k=>(p(),g("tr",{key:k.id,class:Ee(["border-b border-line last:border-0",qe.id===k.id?"bg-accent-soft":""])},[r("td",X_,[r("span",Q_,S(k.email),1),k.email===t.email?(p(),g("span",ey,"(you)")):R("",!0)]),r("td",ty,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(k.role||"user")])},[z(X,{name:v(k.role||"user"),size:12},null,8,["name"]),D(S(h(k.role||"user")),1)],2)]),r("td",ny,[r("span",{class:Ee(["text-sm",k.organizationName?"text-ink-secondary":"text-ink-muted"])},S(k.organizationName||"—"),3)]),r("td",iy,[r("span",{class:Ee(["text-xs",k.verified?"text-success-fg":"text-ink-muted"])},S(k.verified?"Verified":"Unverified"),3)]),r("td",sy,[Hi.value===k.id?(p(),g(re,{key:0},[f[126]||(f[126]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[57]||(f[57]=Ke=>Hi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Ke=>Ha(k)}," Remove ",8,oy)],64)):(p(),g("div",ay,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ke=>ja(k)},[z(X,{name:"settings",size:14}),f[127]||(f[127]=D(" Edit ",-1))],8,ry),k.email!==t.email?(p(),g("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ke=>Hi.value=k.id},[z(X,{name:"trash",size:14}),f[128]||(f[128]=D(" Remove ",-1))],8,ly)):R("",!0)]))])],2))),128))])])]))])])):q.id==="organizations"?(p(),g("div",uy,[Ct.id?(p(),g("div",cy,[z(Me,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:Ce(()=>[r("div",dy,[oe(r("input",{"onUpdate:modelValue":f[58]||(f[58]=k=>Ct.name=k),class:"field",placeholder:"Organization name",onKeyup:tu(Wo,["enter"])},null,544),[[xe,Ct.name]]),r("div",fy,[r("button",{class:"btn-accent",onClick:Wo},"Save changes"),r("button",{class:"btn-ghost",onClick:ti},"Cancel"),tn.value?(p(),g("span",hy,S(tn.value),1)):R("",!0)])])]),_:1})])):(p(),g("div",py,[z(Me,{block:"",title:"Add organization",desc:"Create a new organization. Assign admins and users to it from User management.",keywords:"add organization create tenant company"},{default:Ce(()=>[r("div",my,[oe(r("input",{"onUpdate:modelValue":f[59]||(f[59]=k=>ks.name=k),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:tu(vn,["enter"])},null,544),[[xe,ks.name]]),r("div",gy,[r("button",{class:"btn-accent",disabled:Gi.value,onClick:vn},S(Gi.value?"Creating…":"Create organization"),9,vy),Ki.value?(p(),g("span",_y,S(Ki.value),1)):R("",!0)])])]),_:1})])),r("div",yy,[r("div",{class:"flex items-center justify-between px-5 py-4"},[f[129]||(f[129]=r("div",null,[r("div",{class:"eyebrow"},"Tenancy"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),r("button",{class:"btn-ghost",onClick:ji},"Refresh")]),Si.value.length?(p(),g("div",xy,[r("table",wy,[r("thead",null,[r("tr",ky,[(p(),g(re,null,Be(["Organization","Members",""],k=>r("th",{key:k,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},S(k),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(Si.value,k=>(p(),g("tr",{key:k.id,class:Ee(["border-b border-line last:border-0",Ct.id===k.id?"bg-accent-soft":""])},[r("td",Sy,[r("span",Ty,[z(X,{name:"grid",size:14,class:"text-ink-muted"}),D(S(k.name),1)])]),r("td",Py,S(oo.value[k.id]||0),1),r("td",Cy,[qi.value===k.id?(p(),g(re,{key:0},[f[130]||(f[130]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[60]||(f[60]=Ke=>qi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Ke=>Yi(k)}," Delete ",8,Ly)],64)):(p(),g("div",My,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ke=>Wa(k)},[z(X,{name:"settings",size:14}),f[131]||(f[131]=D(" Rename ",-1))],8,Ey),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(oo.value[k.id]||0)>0,title:(oo.value[k.id]||0)>0?"Reassign or remove members first":"",onClick:Ke=>qi.value=k.id},[z(X,{name:"trash",size:14}),f[132]||(f[132]=D(" Delete ",-1))],8,Oy)]))])],2))),128))])])])):(p(),g("div",by,"No organizations yet."))])])):q.id==="advanced"?(p(),g("div",zy,[r("div",Ay,[z(Me,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:Ce(()=>[r("button",{class:"btn-ghost",onClick:Ko},[z(X,{name:"download",size:15,class:"mr-1.5 inline"}),f[133]||(f[133]=D("Export",-1))])]),_:1}),z(Me,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:Ce(()=>[r("label",$y,[z(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[134]||(f[134]=D("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Ka},null,32)]),ni.value?(p(),g("p",Iy,S(ni.value),1)):R("",!0)]),_:1})]),r("div",Dy,[r("div",Ny,[z(X,{name:"alertTriangle",size:18}),f[135]||(f[135]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[140]||(f[140]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",Ry,[f[139]||(f[139]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",Fy,[oe(r("input",{"onUpdate:modelValue":f[61]||(f[61]=k=>st.understand=k),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[ya,st.understand]]),f[136]||(f[136]=D(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",By,[r("label",Vy,[f[137]||(f[137]=D("Type ",-1)),r("span",Uy,S(ao.value),1),f[138]||(f[138]=D(" to confirm",-1))]),oe(r("input",{"onUpdate:modelValue":f[62]||(f[62]=k=>st.typed=k),class:"field w-full max-w-[360px] font-mono",placeholder:ao.value},null,8,Zy),[[xe,st.typed]])]),r("div",Hy,[st.armed?(p(),g("button",{key:1,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50",disabled:st.cooldown>0,onClick:Tn},S(st.cooldown>0?`Confirm in ${st.cooldown}s…`:"Permanently delete account"),9,Wy)):(p(),g("button",{key:0,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40",disabled:!Ji.value,onClick:Ga}," Delete account… ",8,jy)),st.armed&&st.cooldown>0?(p(),g("span",Ky,"Cooling-off period — read once more.")):R("",!0)]),st.msg?(p(),g("p",Gy,S(st.msg),1)):R("",!0)])])])):R("",!0)],64))),128))])]),z(hh,{name:"fade"},{default:Ce(()=>[gn.value?(p(),g("div",qy,[z(X,{name:"check",size:16,class:"text-success-fg"}),D(S(gn.value),1)])):R("",!0)]),_:1})]))}},Jy=dm(Yy,[["__scopeId","data-v-2b0c86a6"]]),Xy={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Qy={class:"flex flex-wrap items-center gap-3"},e1={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},t1=["onClick"],n1={class:"ml-auto flex items-center gap-2"},i1=["href"],s1={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},o1={class:"eyebrow"},a1={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},r1={key:0,class:"panel p-5"},l1={class:"mb-4 flex items-center justify-between"},u1={class:"eyebrow"},c1={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},d1={class:"block"},f1={class:"block"},h1={class:"block"},p1={class:"block"},m1={key:0,value:""},g1=["value"],v1={class:"block"},_1={class:"block"},y1={class:"block"},b1={class:"block"},x1={class:"block"},w1=["value"],k1={class:"block"},S1=["value"],T1={class:"block"},P1=["value"],C1={class:"block"},L1={class:"mt-3 block"},M1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},E1={class:"block"},O1={class:"block"},z1={class:"block"},A1={class:"block"},$1={class:"col-span-2 block max-[760px]:col-span-1"},I1={class:"mt-4 flex items-center gap-3"},D1=["disabled"],N1={key:0,class:"text-sm text-danger-fg"},R1={class:"panel overflow-hidden p-0"},F1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},B1={key:1,class:"grid place-items-center px-5 py-16 text-center"},V1={key:2,class:"overflow-x-auto"},U1={class:"w-full border-collapse text-sm"},Z1={class:"text-left"},H1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},j1={key:0,class:"text-ink-muted"},W1={class:"px-5 py-3 text-ink-secondary"},K1=["title"],G1={class:"px-5 py-3 font-mono text-ink-secondary"},q1={class:"px-5 py-3 text-ink-secondary"},Y1={class:"px-5 py-3"},J1=["onClick"],X1={class:"whitespace-nowrap px-5 py-3 text-right"},Q1=["onClick"],eb=["onClick"],tb=["onClick"],nb={key:0,class:"border-b border-line bg-surface-2"},ib={colspan:"7",class:"px-5 py-3"},sb={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},ob={class:"text-ink-secondary"},ab={class:"text-ink"},rb={class:"text-ink-secondary"},lb={class:"text-ink"},ub={class:"text-ink-secondary"},cb={class:"font-mono text-ink"},db={key:0,class:"text-ink-secondary"},fb={class:"text-ink"},hb={key:0,class:"mt-2 space-y-1"},pb={key:1,class:"mt-2 text-xs text-success-fg"},mb={key:0,class:"panel p-5"},gb={class:"mb-4 flex items-center justify-between"},vb={class:"eyebrow"},_b={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},yb={class:"block"},bb={class:"block"},xb={class:"block"},wb={class:"block"},kb={class:"block"},Sb={class:"block"},Tb=["value"],Pb={class:"mt-3 flex flex-wrap gap-6"},Cb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Lb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Mb={class:"mt-4 flex items-center gap-3"},Eb=["disabled"],Ob={key:0,class:"text-sm text-danger-fg"},zb={class:"panel overflow-hidden p-0"},Ab={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},$b={key:1,class:"grid place-items-center px-5 py-16 text-center"},Ib={key:2,class:"overflow-x-auto"},Db={class:"w-full border-collapse text-sm"},Nb={class:"text-left"},Rb={class:"px-5 py-3 font-semibold text-ink"},Fb={class:"px-5 py-3 text-ink-secondary"},Bb={class:"px-5 py-3 font-mono text-ink-secondary"},Vb={class:"px-5 py-3"},Ub={key:1,class:"text-ink-muted"},Zb={class:"px-5 py-3"},Hb={class:"whitespace-nowrap px-5 py-3 text-right"},jb=["onClick"],Wb=["onClick"],Kb=["onClick"],Gb={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i=t,o={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},l=j("flights"),u=j([]),d=j([]),h=j(!1),v=j("");async function y(){h.value=!0,v.value="";const[W,E]=await Promise.all([Nc(),xp()]);(!W.ok||!E.ok)&&(v.value=W.status===503||E.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=W.drones,d.value=E.flights,h.value=!1}fi(y);function C(W){const E=W.compliance||{};return E.exempt?{tone:"neutral",label:"Exempt"}:(E.redFlags||[]).length?{tone:"danger",label:`${E.redFlags.length} issue${E.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const T=j("");function O(W){T.value=T.value===W?"":W}const B=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],V=[{value:"commercial",label:"Commercial"},{value:"research",label:"Research"},{value:"public",label:"Public-benefit"},{value:"hobby",label:"Private hobby"},{value:"club_area",label:"Model-club area"}],H=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function F(){var W;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((W=u.value[0])==null?void 0:W.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const fe=j(!1),ve=j(""),Y=bt(F()),Pe=j(""),he=j(!1),ye=j(!1);function Ne(){Object.assign(Y,F()),ve.value="",Pe.value="",ye.value=!1,fe.value=!0}function Ie(W){Object.assign(Y,{operationDate:(W.operationDate||"").slice(0,10),startTime:W.startTime||"",endTime:W.endTime||"",drone:W.drone||"",areaRoute:W.areaRoute||"",maxAltitudeAgl:W.maxAltitudeAgl||"",pilotName:W.pilotName||"",certificateRef:W.certificateRef||"",category:W.category||"open",purpose:W.purpose||"commercial",loggingPath:W.loggingPath||"",rawFdrLogUrl:W.rawFdrLogUrl||"",authorisationRef:W.authorisationRef||"",weather:W.weather||"",airspaceRef:W.airspaceRef||"",observer:W.observer||"",incidents:W.incidents||"",notes:W.notes||""}),ve.value=W.id,Pe.value="",ye.value=!!(W.weather||W.airspaceRef||W.observer||W.incidents||W.notes),fe.value=!0}function Ve(){fe.value=!1,ve.value=""}async function pe(){var A;if(Pe.value="",!Y.drone){Pe.value="Select a drone first (add one on the Drones tab).";return}he.value=!0;const W={...Y,maxAltitudeAgl:Number(Y.maxAltitudeAgl)||0},E=ve.value?await kp(ve.value,W):await wp(W);if(he.value=!1,!E.ok){Pe.value=((A=E.body)==null?void 0:A.error)||"Could not save the flight.";return}fe.value=!1,await y()}const ze=j("");async function Te(W){const E=await Sp(W.id);ze.value="",E.ok&&await y()}const te=["","C0","C1","C2","C3","C4","C5","C6"];function de(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const _e=j(!1),be=j(""),ae=bt(de()),le=j(""),ie=j(!1);function rt(){Object.assign(ae,de()),be.value="",le.value="",_e.value=!0}function me(W){Object.assign(ae,{name:W.name||"",model:W.model||"",serial:W.serial||"",operatorNumber:W.operatorNumber||"",mtomGrams:W.mtomGrams||"",isToy:!!W.isToy,autologsFlights:!!W.autologsFlights,cClass:W.cClass||""}),be.value=W.id,le.value="",_e.value=!0}function Oe(){_e.value=!1,be.value=""}async function Xe(){var A;if(le.value="",!ae.name.trim()){le.value="Give the drone a name.";return}ie.value=!0;const W={...ae,mtomGrams:Number(ae.mtomGrams)||0},E=be.value?await yp(be.value,W):await _p(W);if(ie.value=!1,!E.ok){le.value=((A=E.body)==null?void 0:A.error)||"Could not save the drone.";return}_e.value=!1,await y()}const ut=j("");async function et(W){var A;const E=await bp(W.id);ut.value="",E.ok?await y():le.value=((A=E.body)==null?void 0:A.error)||"Could not delete the drone."}const Ue=ke(()=>{const W=d.value.length,E=d.value.filter(it=>{var vt;return(((vt=it.compliance)==null?void 0:vt.redFlags)||[]).length}).length,A=d.value.filter(it=>{var vt;return(vt=it.compliance)==null?void 0:vt.required}).length;return{total:W,flagged:E,required:A,fleet:u.value.length}});return(W,E)=>(p(),g("div",Xy,[r("div",Qy,[r("div",e1,[(p(),g(re,null,Be([["flights","Flights"],["drones","Drones"]],A=>r("button",{key:A[0],class:Ee(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===A[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:it=>l.value=A[0]},S(A[1]),11,t1)),64))]),r("div",n1,[r("a",{href:$e(Tp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[z(X,{name:"download",size:15}),E[29]||(E[29]=D(" Export CSV ",-1))],8,i1),l.value==="flights"?(p(),g("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Ne},[z(X,{name:"plus",size:15}),E[30]||(E[30]=D(" Log flight ",-1))])):(p(),g("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:rt},[z(X,{name:"plus",size:15}),E[31]||(E[31]=D(" Add drone ",-1))]))])]),r("div",s1,[(p(!0),g(re,null,Be([{label:"Flights logged",value:Ue.value.total,tone:"neutral"},{label:"Require logbook",value:Ue.value.required,tone:"neutral"},{label:"Compliance flags",value:Ue.value.flagged,tone:Ue.value.flagged?"danger":"success"},{label:"Registered drones",value:Ue.value.fleet,tone:"neutral"}],A=>(p(),g("div",{key:A.label,class:"panel p-5"},[r("div",o1,S(A.label),1),r("div",{class:Ee(["mt-2 text-[30px] font-bold leading-none tracking-tightest",A.tone==="danger"?"text-danger-fg":A.tone==="success"?"text-success-fg":"text-ink"])},S(A.value),3)]))),128))]),v.value?(p(),g("div",a1,S(v.value),1)):R("",!0),l.value==="flights"?(p(),g(re,{key:1},[fe.value?(p(),g("div",r1,[r("div",l1,[r("div",null,[r("div",u1,S(ve.value?"Edit entry":"New entry"),1),E[32]||(E[32]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),r("button",{class:"btn-icon",onClick:Ve},[z(X,{name:"x",size:16})])]),r("div",c1,[r("label",d1,[E[33]||(E[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),oe(r("input",{"onUpdate:modelValue":E[0]||(E[0]=A=>Y.operationDate=A),type:"date",class:"field"},null,512),[[xe,Y.operationDate]])]),r("label",f1,[E[34]||(E[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),oe(r("input",{"onUpdate:modelValue":E[1]||(E[1]=A=>Y.startTime=A),type:"time",class:"field"},null,512),[[xe,Y.startTime]])]),r("label",h1,[E[35]||(E[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),oe(r("input",{"onUpdate:modelValue":E[2]||(E[2]=A=>Y.endTime=A),type:"time",class:"field"},null,512),[[xe,Y.endTime]])]),r("label",p1,[E[36]||(E[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),oe(r("select",{"onUpdate:modelValue":E[3]||(E[3]=A=>Y.drone=A),class:"field"},[u.value.length?R("",!0):(p(),g("option",m1,"— add a drone first —")),(p(!0),g(re,null,Be(u.value,A=>(p(),g("option",{key:A.id,value:A.id},S(A.name)+S(A.model?` · ${A.model}`:""),9,g1))),128))],512),[[Et,Y.drone]])]),r("label",v1,[E[37]||(E[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),oe(r("input",{"onUpdate:modelValue":E[4]||(E[4]=A=>Y.maxAltitudeAgl=A),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[xe,Y.maxAltitudeAgl]])]),r("label",_1,[E[38]||(E[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),oe(r("input",{"onUpdate:modelValue":E[5]||(E[5]=A=>Y.areaRoute=A),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[xe,Y.areaRoute]])]),r("label",y1,[E[39]||(E[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),oe(r("input",{"onUpdate:modelValue":E[6]||(E[6]=A=>Y.pilotName=A),class:"field",placeholder:"Full name"},null,512),[[xe,Y.pilotName]])]),r("label",b1,[E[40]||(E[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),oe(r("input",{"onUpdate:modelValue":E[7]||(E[7]=A=>Y.certificateRef=A),class:"field",placeholder:"A2 / STS cert no."},null,512),[[xe,Y.certificateRef]])]),r("label",x1,[E[41]||(E[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),oe(r("select",{"onUpdate:modelValue":E[8]||(E[8]=A=>Y.loggingPath=A),class:"field"},[(p(),g(re,null,Be(H,A=>r("option",{key:A.value,value:A.value},S(A.label),9,w1)),64))],512),[[Et,Y.loggingPath]])]),r("label",k1,[E[42]||(E[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),oe(r("select",{"onUpdate:modelValue":E[9]||(E[9]=A=>Y.category=A),class:"field"},[(p(),g(re,null,Be(B,A=>r("option",{key:A.value,value:A.value},S(A.label),9,S1)),64))],512),[[Et,Y.category]])]),r("label",T1,[E[43]||(E[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),oe(r("select",{"onUpdate:modelValue":E[10]||(E[10]=A=>Y.purpose=A),class:"field"},[(p(),g(re,null,Be(V,A=>r("option",{key:A.value,value:A.value},S(A.label),9,P1)),64))],512),[[Et,Y.purpose]])]),r("label",C1,[E[44]||(E[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),oe(r("input",{"onUpdate:modelValue":E[11]||(E[11]=A=>Y.authorisationRef=A),class:"field",placeholder:"Specific-category ref"},null,512),[[xe,Y.authorisationRef]])])]),r("label",L1,[E[45]||(E[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),oe(r("input",{"onUpdate:modelValue":E[12]||(E[12]=A=>Y.rawFdrLogUrl=A),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[xe,Y.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:E[13]||(E[13]=A=>ye.value=!ye.value)},[z(X,{name:ye.value?"x":"plus",size:14},null,8,["name"]),E[46]||(E[46]=D(" Operational details (weather, airspace, incidents) ",-1))]),ye.value?(p(),g("div",M1,[r("label",E1,[E[47]||(E[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),oe(r("input",{"onUpdate:modelValue":E[14]||(E[14]=A=>Y.weather=A),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[xe,Y.weather]])]),r("label",O1,[E[48]||(E[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),oe(r("input",{"onUpdate:modelValue":E[15]||(E[15]=A=>Y.airspaceRef=A),class:"field"},null,512),[[xe,Y.airspaceRef]])]),r("label",z1,[E[49]||(E[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),oe(r("input",{"onUpdate:modelValue":E[16]||(E[16]=A=>Y.observer=A),class:"field"},null,512),[[xe,Y.observer]])]),r("label",A1,[E[50]||(E[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),oe(r("input",{"onUpdate:modelValue":E[17]||(E[17]=A=>Y.incidents=A),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[xe,Y.incidents]])]),r("label",$1,[E[51]||(E[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":E[18]||(E[18]=A=>Y.notes=A),rows:"2",class:"field"},null,512),[[xe,Y.notes]])])])):R("",!0),r("div",I1,[r("button",{class:"btn-accent",disabled:he.value,onClick:pe},S(he.value?"Saving…":ve.value?"Save changes":"Log flight"),9,D1),r("button",{class:"btn-ghost",onClick:Ve},"Cancel"),Pe.value?(p(),g("span",N1,S(Pe.value),1)):R("",!0)])])):R("",!0),r("div",R1,[h.value?(p(),g("div",F1,"Loading…")):d.value.length?(p(),g("div",V1,[r("table",U1,[r("thead",null,[r("tr",Z1,[(p(),g(re,null,Be(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],A=>r("th",{key:A,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},S(A),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(d.value,A=>{var it,vt,Lt,b;return p(),g(re,{key:A.id},[r("tr",{class:Ee(["border-b border-line last:border-0",ve.value===A.id?"bg-accent-soft":""])},[r("td",H1,[D(S((A.operationDate||"").slice(0,10))+" ",1),A.startTime?(p(),g("span",j1,S(A.startTime),1)):R("",!0)]),r("td",W1,S(A.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:A.areaRoute},S(A.areaRoute||"—"),9,K1),r("td",G1,S(A.maxAltitudeAgl?A.maxAltitudeAgl+" m":"—"),1),r("td",q1,S(A.pilotName||"—"),1),r("td",Y1,[r("button",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[C(A).tone]]),onClick:_=>O(A.id)},[C(A).tone==="danger"?(p(),at(X,{key:0,name:"alertTriangle",size:12})):C(A).tone==="success"?(p(),at(X,{key:1,name:"check",size:12})):R("",!0),D(" "+S(C(A).label),1)],10,J1)]),r("td",X1,[ze.value===A.id?(p(),g(re,{key:0},[E[54]||(E[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:E[19]||(E[19]=_=>ze.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:_=>Te(A)},"Delete",8,Q1)],64)):(p(),g(re,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:_=>Ie(A)},[z(X,{name:"sliders",size:13}),E[55]||(E[55]=D(" Edit",-1))],8,eb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:_=>ze.value=A.id},[z(X,{name:"trash",size:13})],8,tb)],64))])],2),T.value===A.id?(p(),g("tr",nb,[r("td",ib,[r("div",sb,[r("span",ob,[E[56]||(E[56]=D("Logging path: ",-1)),r("b",ab,S(((it=A.compliance)==null?void 0:it.loggingPath)||"—"),1)]),r("span",rb,[E[57]||(E[57]=D("Category: ",-1)),r("b",lb,S(A.category||"—"),1)]),r("span",ub,[E[58]||(E[58]=D("Retain until: ",-1)),r("b",cb,S((A.retentionUntil||"").slice(0,10)||"—"),1)]),(vt=A.compliance)!=null&&vt.exempt?(p(),g("span",db,[E[59]||(E[59]=D("Exempt: ",-1)),r("b",fb,S(A.compliance.exemptReason),1)])):R("",!0)]),(((Lt=A.compliance)==null?void 0:Lt.redFlags)||[]).length?(p(),g("ul",hb,[(p(!0),g(re,null,Be(A.compliance.redFlags,(_,w)=>(p(),g("li",{key:w,class:"flex items-start gap-2 text-xs text-danger-fg"},[z(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+S(_),1)]))),128))])):(b=A.compliance)!=null&&b.exempt?R("",!0):(p(),g("div",pb,"No compliance gaps detected."))])])):R("",!0)],64)}),128))])])])):(p(),g("div",B1,[z(X,{name:"book",size:26,class:"text-ink-muted"}),E[52]||(E[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),E[53]||(E[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(p(),g(re,{key:2},[_e.value?(p(),g("div",mb,[r("div",gb,[r("div",null,[r("div",vb,S(be.value?"Edit drone":"New drone"),1),E[60]||(E[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:Oe},[z(X,{name:"x",size:16})])]),r("div",_b,[r("label",yb,[E[61]||(E[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),oe(r("input",{"onUpdate:modelValue":E[20]||(E[20]=A=>ae.name=A),class:"field",placeholder:"Mavic-01"},null,512),[[xe,ae.name]])]),r("label",bb,[E[62]||(E[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),oe(r("input",{"onUpdate:modelValue":E[21]||(E[21]=A=>ae.model=A),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[xe,ae.model]])]),r("label",xb,[E[63]||(E[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),oe(r("input",{"onUpdate:modelValue":E[22]||(E[22]=A=>ae.serial=A),class:"field"},null,512),[[xe,ae.serial]])]),r("label",wb,[E[64]||(E[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),oe(r("input",{"onUpdate:modelValue":E[23]||(E[23]=A=>ae.operatorNumber=A),class:"field",placeholder:"DNK…"},null,512),[[xe,ae.operatorNumber]])]),r("label",kb,[E[65]||(E[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),oe(r("input",{"onUpdate:modelValue":E[24]||(E[24]=A=>ae.mtomGrams=A),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[xe,ae.mtomGrams]])]),r("label",Sb,[E[66]||(E[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),oe(r("select",{"onUpdate:modelValue":E[25]||(E[25]=A=>ae.cClass=A),class:"field"},[(p(),g(re,null,Be(te,A=>r("option",{key:A,value:A},S(A||"— none —"),9,Tb)),64))],512),[[Et,ae.cClass]])])]),r("div",Pb,[r("label",Cb,[oe(r("input",{"onUpdate:modelValue":E[26]||(E[26]=A=>ae.autologsFlights=A),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[ya,ae.autologsFlights]]),E[67]||(E[67]=D(" Auto-logs flights (onboard FDR) ",-1))]),r("label",Lb,[oe(r("input",{"onUpdate:modelValue":E[27]||(E[27]=A=>ae.isToy=A),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[ya,ae.isToy]]),E[68]||(E[68]=D(" Toy drone (logbook-exempt) ",-1))])]),r("div",Mb,[r("button",{class:"btn-accent",disabled:ie.value,onClick:Xe},S(ie.value?"Saving…":be.value?"Save changes":"Add drone"),9,Eb),r("button",{class:"btn-ghost",onClick:Oe},"Cancel"),le.value?(p(),g("span",Ob,S(le.value),1)):R("",!0)])])):R("",!0),r("div",zb,[h.value?(p(),g("div",Ab,"Loading…")):u.value.length?(p(),g("div",Ib,[r("table",Db,[r("thead",null,[r("tr",Nb,[(p(),g(re,null,Be(["Name","Model","MTOM","Class","FDR",""],A=>r("th",{key:A,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},S(A),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(u.value,A=>(p(),g("tr",{key:A.id,class:Ee(["border-b border-line last:border-0",be.value===A.id?"bg-accent-soft":""])},[r("td",Rb,S(A.name),1),r("td",Fb,S(A.model||"—"),1),r("td",Bb,S(A.mtomGrams?A.mtomGrams+" g":"—"),1),r("td",Vb,[A.cClass?(p(),g("span",{key:0,class:Ee(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},S(A.cClass),3)):(p(),g("span",Ub,"—")),A.isToy?(p(),g("span",{key:2,class:Ee(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):R("",!0)]),r("td",Zb,[r("span",{class:Ee(["text-xs",A.autologsFlights?"text-success-fg":"text-ink-muted"])},S(A.autologsFlights?"yes":"no"),3)]),r("td",Hb,[ut.value===A.id?(p(),g(re,{key:0},[E[71]||(E[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:E[28]||(E[28]=it=>ut.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:it=>et(A)},"Delete",8,jb)],64)):(p(),g(re,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:it=>me(A)},[z(X,{name:"sliders",size:13}),E[72]||(E[72]=D(" Edit",-1))],8,Wb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:it=>ut.value=A.id},[z(X,{name:"trash",size:13})],8,Kb)],64))])],2))),128))])])])):(p(),g("div",$b,[z(X,{name:"drone",size:26,class:"text-ink-muted"}),E[69]||(E[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),E[70]||(E[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},qb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Yb={class:"flex flex-wrap items-center gap-3"},Jb={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},Xb=["onClick"],Qb={class:"ml-auto"},ex={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},tx={class:"eyebrow"},nx={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},ix={key:1,class:"panel p-5"},sx={class:"mb-4 flex items-center justify-between"},ox={class:"eyebrow"},ax={class:"mt-0.5 text-base font-semibold text-ink"},rx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},lx={class:"col-span-2 block max-[760px]:col-span-1"},ux={class:"block"},cx=["value"],dx={class:"block"},fx=["value"],hx={class:"block"},px=["value"],mx={class:"block"},gx={class:"block"},vx={class:"block"},_x={class:"block"},yx=["value"],bx={class:"block"},xx={class:"block"},wx={class:"block"},kx=["value"],Sx={class:"mt-3 block"},Tx={key:0,class:"mt-3"},Px={class:"eyebrow mb-1 block"},Cx={key:1,class:"mt-3 text-xs text-ink-muted"},Lx={class:"mt-4 flex items-center gap-3"},Mx=["disabled"],Ex={key:0,class:"text-sm text-danger-fg"},Ox={class:"panel overflow-hidden p-0"},zx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Ax={key:1,class:"grid place-items-center px-5 py-16 text-center"},$x={class:"mt-3 text-sm font-medium text-ink-secondary"},Ix={class:"mt-1 text-xs text-ink-muted"},Dx={key:2,class:"overflow-x-auto"},Nx={class:"w-full border-collapse text-sm"},Rx={class:"text-left"},Fx={class:"px-5 py-3"},Bx={class:"font-semibold text-ink"},Vx={key:0,class:"font-mono text-[11px] text-ink-muted"},Ux={class:"px-5 py-3 text-ink-secondary"},Zx={class:"px-5 py-3 text-ink-secondary"},Hx={class:"px-5 py-3"},jx=["onClick"],Wx={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Kx={class:"px-5 py-3 font-mono text-ink-secondary"},Gx={class:"whitespace-nowrap px-5 py-3 text-right"},qx=["onClick"],Yx=["onClick"],Jx=["href"],Xx=["onClick"],Qx=["onClick"],e0=["onClick"],t0={key:0,class:"border-b border-line bg-surface-2"},n0={colspan:"6",class:"px-5 py-3"},i0={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},s0={class:"text-ink-secondary"},o0={class:"text-ink"},a0={class:"text-ink-secondary"},r0={class:"text-ink"},l0={key:0,class:"text-ink-secondary"},u0={class:"text-ink"},c0={key:1,class:"text-ink-secondary"},d0={class:"font-mono text-ink"},f0={key:2,class:"text-ink-secondary"},h0={class:"font-mono text-ink"},p0={class:"text-ink-secondary"},m0={class:"text-ink"},g0={key:0,class:"mt-2 space-y-1"},v0={key:1,class:"mt-2 text-xs text-success-fg"},_0={key:2,class:"mt-2 text-xs text-ink-secondary"},y0={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},b0={class:"flex items-center gap-3 border-b border-line px-5 py-3"},x0={class:"min-w-0"},w0={class:"truncate text-sm font-semibold text-ink"},k0={class:"truncate font-mono text-[11px] text-ink-muted"},S0={class:"ml-auto flex items-center gap-2"},T0=["href"],P0=["href"],C0={class:"flex-1 overflow-auto bg-surface-2"},L0=["src","alt"],M0=["src","title"],E0={key:2,class:"grid place-items-center px-6 py-16 text-center"},O0={class:"mt-1 text-xs text-ink-muted"},z0=["href"],A0={__name:"Documents",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},o=[{value:"certificate",label:"Pilot certificate"},{value:"medical",label:"Medical / training"},{value:"insurance",label:"Insurance / liability"},{value:"background_check",label:"Background check / waiver"},{value:"registration",label:"Aircraft registration"},{value:"maintenance",label:"Maintenance log"},{value:"conformity",label:"Conformity / compliance"},{value:"firmware",label:"Firmware / software"},{value:"incident",label:"Incident / repair report"},{value:"flight_log",label:"Flight log"},{value:"checklist",label:"Pre-flight checklist"},{value:"airspace_auth",label:"Airspace authorisation"},{value:"mission_plan",label:"Mission plan / flight path"},{value:"risk_assessment",label:"Risk assessment / survey"},{value:"contract",label:"Contract / SOW"},{value:"client_insurance",label:"Client insurance cert"},{value:"delivery_report",label:"Delivery / media handoff"},{value:"other",label:"Other"}],l=Object.fromEntries(o.map(b=>[b.value,b.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],d=[{value:"active",label:"Active"},{value:"pending_review",label:"Pending review"},{value:"archived",label:"Archived"}],h=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],v=j([]),y=j([]),C=j(!1),T=j("");async function O(){C.value=!0,T.value="";const[b,_]=await Promise.all([Pp(),Nc()]);b.ok||(T.value=b.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),v.value=b.documents,y.value=_.drones||[],C.value=!1}fi(O);const B=j("all"),V=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],H=ke(()=>{const b=v.value;switch(B.value){case"expiring":return b.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expiring_soon"&&_.status!=="archived"});case"expired":return b.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expired"&&_.status!=="archived"});case"pending":return b.filter(_=>_.status==="pending_review");case"archived":return b.filter(_=>_.status==="archived");default:return b.filter(_=>_.status!=="archived")}});function F(b){if(b.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const _=b.expiry||{};return _.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:_.state==="expiring_soon"?{tone:"warning",label:`Expires in ${_.daysUntilExpiry}d`,icon:"clock"}:_.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const fe=j("");function ve(b){fe.value=fe.value===b?"":b}function Y(b){return b.ownerDrone?b.ownerDroneName||"Aircraft":b.ownerRef?b.ownerRef:b.ownerType==="pilot"?"Pilot":b.ownerType?b.ownerType.charAt(0).toUpperCase()+b.ownerType.slice(1):"—"}const Pe=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],he=["pdf","txt","csv","log","json","md","html","htm","xml"];function ye(b){const _=(b||"").split(".").pop().toLowerCase();return Pe.includes(_)?"image":he.includes(_)?"frame":"none"}const Ne=j(null),Ie=ke(()=>Ne.value?ye(Ne.value.fileName):"none"),Ve=ke(()=>Ne.value?Ep(Ne.value.id):"");function pe(b){Ne.value=b}function ze(){Ne.value=null}function Te(b){b.key==="Escape"&&Ne.value&&ze()}fi(()=>window.addEventListener("keydown",Te)),Fs(()=>window.removeEventListener("keydown",Te));function te(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const de=j(!1),_e=j(""),be=j(""),ae=j(""),le=bt(te()),ie=j(null),rt=j(null),me=j(""),Oe=j(!1);function Xe(){ie.value=null,rt.value&&(rt.value.value="")}function ut(){Object.assign(le,te()),_e.value="",be.value="",ae.value="",Xe(),me.value="",de.value=!0}function et(b){Object.assign(le,{title:b.title||"",docType:b.docType||"certificate",ownerType:b.ownerType||"pilot",ownerDrone:b.ownerDrone||"",ownerRef:b.ownerRef||"",reference:b.reference||"",jurisdiction:b.jurisdiction||"",issueDate:b.issueDate||"",expiryDate:b.expiryDate||"",status:b.status||"active",accessTier:b.accessTier||"ops",notes:b.notes||""}),_e.value=b.id,be.value="",ae.value="",Xe(),me.value="",de.value=!0}function Ue(b){et(b),_e.value="",be.value=b.id,ae.value=b.title,le.status="active"}function W(){de.value=!1,_e.value="",be.value=""}function E(b){var _;ie.value=((_=b.target.files)==null?void 0:_[0])||null}async function A(){var _;if(me.value="",!le.title.trim()){me.value="Give the document a title.";return}Oe.value=!0;let b;if(_e.value)b=await Lp(_e.value,{...le});else{const w={...le};be.value&&(w.replaces=be.value),b=await Cp(w,ie.value)}if(Oe.value=!1,!b.ok){me.value=((_=b.body)==null?void 0:_.error)||"Could not save the document.";return}de.value=!1,_e.value="",be.value="",await O()}const it=j("");async function vt(b){var w;const _=await Mp(b.id);it.value="",_.ok?await O():me.value=((w=_.body)==null?void 0:w.error)||"Could not delete the document."}const Lt=ke(()=>{const b=v.value.filter(_=>_.status!=="archived");return{total:b.length,expiring:b.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expiring_soon"}).length,expired:b.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expired"}).length,pending:v.value.filter(_=>_.status==="pending_review").length}});return(b,_)=>(p(),g("div",qb,[r("div",Yb,[r("div",Jb,[(p(),g(re,null,Be(V,w=>r("button",{key:w[0],class:Ee(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",B.value===w[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:K=>B.value=w[0]},S(w[1]),11,Xb)),64))]),r("div",Qb,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:ut},[z(X,{name:"upload",size:15}),_[13]||(_[13]=D(" Add document ",-1))])])]),r("div",ex,[(p(!0),g(re,null,Be([{label:"Documents on file",value:Lt.value.total,tone:"neutral"},{label:"Expiring soon",value:Lt.value.expiring,tone:Lt.value.expiring?"warning":"neutral"},{label:"Expired",value:Lt.value.expired,tone:Lt.value.expired?"danger":"success"},{label:"Pending review",value:Lt.value.pending,tone:Lt.value.pending?"accent":"neutral"}],w=>(p(),g("div",{key:w.label,class:"panel p-5"},[r("div",tx,S(w.label),1),r("div",{class:Ee(["mt-2 text-[30px] font-bold leading-none tracking-tightest",w.tone==="danger"?"text-danger-fg":w.tone==="warning"?"text-amber-fg":w.tone==="success"?"text-success-fg":w.tone==="accent"?"text-accent-soft-fg":"text-ink"])},S(w.value),3)]))),128))]),T.value?(p(),g("div",nx,S(T.value),1)):R("",!0),de.value?(p(),g("div",ix,[r("div",sx,[r("div",null,[r("div",ox,S(_e.value?"Edit document":be.value?"New version":"New document"),1),r("div",ax,S(be.value?`Supersedes “${ae.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:W},[z(X,{name:"x",size:16})])]),r("div",rx,[r("label",lx,[_[14]||(_[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),oe(r("input",{"onUpdate:modelValue":_[0]||(_[0]=w=>le.title=w),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[xe,le.title]])]),r("label",ux,[_[15]||(_[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),oe(r("select",{"onUpdate:modelValue":_[1]||(_[1]=w=>le.docType=w),class:"field"},[(p(),g(re,null,Be(o,w=>r("option",{key:w.value,value:w.value},S(w.label),9,cx)),64))],512),[[Et,le.docType]])]),r("label",dx,[_[16]||(_[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),oe(r("select",{"onUpdate:modelValue":_[2]||(_[2]=w=>le.ownerType=w),class:"field"},[(p(),g(re,null,Be(u,w=>r("option",{key:w.value,value:w.value},S(w.label),9,fx)),64))],512),[[Et,le.ownerType]])]),r("label",hx,[_[18]||(_[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),oe(r("select",{"onUpdate:modelValue":_[3]||(_[3]=w=>le.ownerDrone=w),class:"field"},[_[17]||(_[17]=r("option",{value:""},"— none —",-1)),(p(!0),g(re,null,Be(y.value,w=>(p(),g("option",{key:w.id,value:w.id},S(w.name)+S(w.model?` · ${w.model}`:""),9,px))),128))],512),[[Et,le.ownerDrone]])]),r("label",mx,[_[19]||(_[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),oe(r("input",{"onUpdate:modelValue":_[4]||(_[4]=w=>le.ownerRef=w),class:"field",placeholder:"Client name / serial / site"},null,512),[[xe,le.ownerRef]])]),r("label",gx,[_[20]||(_[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),oe(r("input",{"onUpdate:modelValue":_[5]||(_[5]=w=>le.reference=w),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[xe,le.reference]])]),r("label",vx,[_[21]||(_[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),oe(r("input",{"onUpdate:modelValue":_[6]||(_[6]=w=>le.jurisdiction=w),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[xe,le.jurisdiction]])]),r("label",_x,[_[22]||(_[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),oe(r("select",{"onUpdate:modelValue":_[7]||(_[7]=w=>le.accessTier=w),class:"field"},[(p(),g(re,null,Be(h,w=>r("option",{key:w.value,value:w.value},S(w.label),9,yx)),64))],512),[[Et,le.accessTier]])]),r("label",bx,[_[23]||(_[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),oe(r("input",{"onUpdate:modelValue":_[8]||(_[8]=w=>le.issueDate=w),type:"date",class:"field"},null,512),[[xe,le.issueDate]])]),r("label",xx,[_[24]||(_[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),oe(r("input",{"onUpdate:modelValue":_[9]||(_[9]=w=>le.expiryDate=w),type:"date",class:"field"},null,512),[[xe,le.expiryDate]])]),r("label",wx,[_[25]||(_[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),oe(r("select",{"onUpdate:modelValue":_[10]||(_[10]=w=>le.status=w),class:"field"},[(p(),g(re,null,Be(d,w=>r("option",{key:w.value,value:w.value},S(w.label),9,kx)),64))],512),[[Et,le.status]])])]),r("label",Sx,[_[26]||(_[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":_[11]||(_[11]=w=>le.notes=w),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[xe,le.notes]])]),_e.value?(p(),g("div",Cx,[..._[28]||(_[28]=[D(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),D(" on the document — the old version is kept for audit. ",-1)])])):(p(),g("div",Tx,[r("span",Px,"File "+S(be.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:rt,type:"file",class:"field",onChange:E},null,544),_[27]||(_[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",Lx,[r("button",{class:"btn-accent",disabled:Oe.value,onClick:A},S(Oe.value?"Saving…":_e.value?"Save changes":be.value?"Upload new version":"Add document"),9,Mx),r("button",{class:"btn-ghost",onClick:W},"Cancel"),me.value?(p(),g("span",Ex,S(me.value),1)):R("",!0)])])):R("",!0),r("div",Ox,[C.value?(p(),g("div",zx,"Loading…")):H.value.length?(p(),g("div",Dx,[r("table",Nx,[r("thead",null,[r("tr",Rx,[(p(),g(re,null,Be(["Title","Type","Owner","Expiry","Ver",""],w=>r("th",{key:w,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},S(w),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(H.value,w=>{var K,G;return p(),g(re,{key:w.id},[r("tr",{class:Ee(["border-b border-line last:border-0",_e.value===w.id?"bg-accent-soft":""])},[r("td",Fx,[r("div",Bx,S(w.title),1),w.reference?(p(),g("div",Vx,S(w.reference),1)):R("",!0)]),r("td",Ux,S($e(l)[w.docType]||w.docType||"—"),1),r("td",Zx,S(Y(w)),1),r("td",Hx,[r("button",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[F(w).tone]]),onClick:Z=>ve(w.id)},[F(w).icon?(p(),at(X,{key:0,name:F(w).icon,size:12},null,8,["name"])):R("",!0),D(" "+S(F(w).label),1)],10,jx),w.expiryDate?(p(),g("div",Wx,S(w.expiryDate),1)):R("",!0)]),r("td",Kx,"v"+S(w.version||1),1),r("td",Gx,[it.value===w.id?(p(),g(re,{key:0},[_[29]||(_[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:_[12]||(_[12]=Z=>it.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Z=>vt(w)},"Delete",8,qx)],64)):(p(),g(re,{key:1},[w.hasFile?(p(),g("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:Z=>pe(w)},[z(X,{name:"eye",size:13})],8,Yx)):R("",!0),w.hasFile?(p(),g("a",{key:1,href:$e(dr)(w.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[z(X,{name:"download",size:13})],8,Jx)):R("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:Z=>Ue(w)},[z(X,{name:"upload",size:13})],8,Xx),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:Z=>et(w)},[z(X,{name:"sliders",size:13}),_[30]||(_[30]=D(" Edit",-1))],8,Qx),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:Z=>it.value=w.id},[z(X,{name:"trash",size:13})],8,e0)],64))])],2),fe.value===w.id?(p(),g("tr",t0,[r("td",n0,[r("div",i0,[r("span",s0,[_[31]||(_[31]=D("Status: ",-1)),r("b",o0,S(w.status||"—"),1)]),r("span",a0,[_[32]||(_[32]=D("Access: ",-1)),r("b",r0,S(w.accessTier||"—"),1)]),w.jurisdiction?(p(),g("span",l0,[_[33]||(_[33]=D("Jurisdiction: ",-1)),r("b",u0,S(w.jurisdiction),1)])):R("",!0),w.issueDate?(p(),g("span",c0,[_[34]||(_[34]=D("Issued: ",-1)),r("b",d0,S(w.issueDate),1)])):R("",!0),w.expiryDate?(p(),g("span",f0,[_[35]||(_[35]=D("Expires: ",-1)),r("b",h0,S(w.expiryDate),1)])):R("",!0),r("span",p0,[_[36]||(_[36]=D("File: ",-1)),r("b",m0,S(w.hasFile?w.fileName:"none"),1)])]),(((K=w.expiry)==null?void 0:K.flags)||[]).length?(p(),g("ul",g0,[(p(!0),g(re,null,Be(w.expiry.flags,(Z,ne)=>(p(),g("li",{key:ne,class:Ee(["flex items-start gap-2 text-xs",w.expiry.state==="expired"?"text-danger-fg":w.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[z(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+S(Z),1)],2))),128))])):((G=w.expiry)==null?void 0:G.state)==="valid"?(p(),g("div",v0,"In force — no action needed.")):R("",!0),w.notes?(p(),g("div",_0,[_[37]||(_[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),D(" "+S(w.notes),1)])):R("",!0)])])):R("",!0)],64)}),128))])])])):(p(),g("div",Ax,[z(X,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",$x,S(B.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",Ix,S(B.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),at(af,{to:"body"},[Ne.value?(p(),g("div",{key:0,class:"fixed inset-0 z-50 grid place-items-center p-4",style:{background:"color-mix(in srgb, black 60%, transparent)"},onClick:Hr(ze,["self"])},[r("div",y0,[r("div",b0,[r("div",x0,[r("div",w0,S(Ne.value.title),1),r("div",k0,S(Ne.value.fileName),1)]),r("div",S0,[r("a",{href:Ve.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[z(X,{name:"globe",size:14}),_[38]||(_[38]=D(" New tab ",-1))],8,T0),r("a",{href:$e(dr)(Ne.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[z(X,{name:"download",size:14}),_[39]||(_[39]=D(" Download ",-1))],8,P0),r("button",{class:"btn-icon",title:"Close",onClick:ze},[z(X,{name:"x",size:16})])])]),r("div",C0,[Ie.value==="image"?(p(),g("img",{key:0,src:Ve.value,alt:Ne.value.title,class:"mx-auto block max-w-full"},null,8,L0)):Ie.value==="frame"?(p(),g("iframe",{key:1,src:Ve.value,class:"h-[74vh] w-full border-0 bg-white",title:Ne.value.title},null,8,M0)):(p(),g("div",E0,[z(X,{name:"fileText",size:28,class:"text-ink-muted"}),_[41]||(_[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",O0,S(Ne.value.fileName),1),r("a",{href:$e(dr)(Ne.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[z(X,{name:"download",size:15}),_[40]||(_[40]=D(" Download instead ",-1))],8,z0)]))])])])):R("",!0)]))]))}},$0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},I0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},D0={class:"flex items-center gap-2.5 px-2 pb-5"},N0={class:"flex flex-col gap-0.5"},R0=["onClick"],F0={class:"mt-auto flex flex-col gap-2.5"},B0={class:"rounded-lg bg-surface-2 p-3"},V0={class:"flex items-center gap-2"},U0={class:"text-xs font-semibold text-ink"},Z0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},H0={class:"flex items-center gap-2.5 px-2 py-1"},j0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},W0={class:"min-w-0 flex-1"},K0={class:"truncate text-[13px] font-semibold text-ink"},G0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},q0=["title"],Y0={class:"overflow-y-auto"},J0={class:"sticky top-0 z-10 flex items-center gap-4 border-b border-line px-7 py-3.5",style:{background:"color-mix(in srgb, var(--bg-app) 82%, transparent)","backdrop-filter":"blur(10px)"}},X0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},Q0={class:"ml-auto flex items-center gap-3"},ew={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},tw={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},nw={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},iw={class:"flex items-center justify-between"},sw={class:"eyebrow"},ow={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},aw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},rw={class:"panel p-5"},lw={class:"mb-3.5 flex items-center justify-between"},uw={class:"flex items-center gap-2"},cw={class:"relative z-[1200]"},dw={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},fw={class:"flex items-center justify-between gap-3"},hw={class:"mb-1.5 flex items-center justify-between"},pw={class:"font-mono text-[11px] text-ink-muted"},mw=["value"],gw={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},vw={key:0,class:"mt-2.5 text-xs text-ink-muted"},_w={key:1,class:"mt-2.5 text-xs text-ink-muted"},yw={key:2,class:"mt-2.5 text-xs text-ink-muted"},bw={class:"panel p-5"},xw={class:"mb-3.5 flex items-center justify-between"},ww={class:"grid place-items-center py-10 text-center"},kw={class:"panel overflow-hidden p-0"},Sw={class:"flex items-center justify-between px-5 py-4"},Tw={class:"flex gap-2"},Pw={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Cw={key:1,class:"overflow-x-auto"},Lw={class:"w-full border-collapse text-sm"},Mw={class:"text-left"},Ew=["onClick"],Ow={class:"px-5 py-3 font-mono font-bold text-ink"},zw={class:"px-5 py-3 text-ink-secondary"},Aw={class:"px-5 py-3"},$w={class:"px-5 py-3 font-mono text-ink-secondary"},Iw={class:"px-5 py-3"},Dw={key:0,class:"flex items-center gap-2"},Nw={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},Rw={class:"font-mono text-xs text-ink-secondary"},Fw={key:1,class:"font-mono text-xs text-ink-muted"},Bw={class:"px-5 py-3 font-mono text-ink-secondary"},Vw={class:"px-5 py-3 text-right"},Uw=["onClick"],Zw={key:1,class:"p-7"},Hw={class:"mb-4 flex flex-wrap items-center gap-3"},jw={class:"font-mono text-mode font-bold text-ink"},Ww={key:0,class:"rounded-full bg-danger-soft px-2.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-caps text-danger-fg"},Kw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},Gw=["onClick"],qw={key:0,class:"panel grid place-items-center p-16 text-center"},Yw={class:"pill"},Jw={class:"pill"},Xw={class:"pill"},Qw={class:"mt-1 text-sm font-semibold text-ink"},ek={class:"pill"},tk={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},nk={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},ik={class:"panel p-4"},sk={class:"flex items-center gap-4"},ok={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},ak={class:"readout"},rk={class:"panel p-4"},lk={class:"readout"},uk={class:"panel p-4"},ck={class:"space-y-1.5 text-sm"},dk={class:"flex justify-between"},fk={class:"text-ink"},hk={class:"flex justify-between"},pk={class:"text-ink"},mk={class:"flex justify-between"},gk={class:"font-mono tabular text-ink"},vk={class:"flex justify-between"},_k={class:"font-mono tabular text-ink"},yk={class:"panel p-4"},bk={class:"space-y-1.5 text-sm"},xk={class:"flex justify-between"},wk={class:"font-mono tabular text-ink"},kk={class:"flex justify-between"},Sk={class:"font-mono tabular text-ink"},Tk={class:"flex justify-between"},Pk={class:"font-mono tabular text-ink"},Ck={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},Lk={class:"panel p-4"},Mk={class:"flex flex-wrap gap-2"},Ek={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},Ok={class:"panel p-4"},zk={class:"h-[180px] overflow-y-auto font-mono text-xs"},Ak={class:"text-ink-muted"},$k={class:"font-semibold text-accent"},Ik={class:"break-all text-ink"},Dk={key:5,class:"p-7"},Nk={class:"panel grid place-items-center p-16 text-center"},Rk={class:"mt-3 text-sm font-medium text-ink-secondary"},Fk={key:0,class:"mt-1 text-xs text-ink-muted"},Bk={key:1,class:"mt-1 text-xs text-ink-muted"},Vk={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=bt({}),d=bt({}),h=j(null),v=j(!1),y=bt([]),C=j(""),T=j([]),O=bt({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),B=ke(()=>T.value.filter(I=>!I.onGround).length),V=j(!1);let H=null;const F=[{value:"auto",label:"Auto"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],fe=ke(()=>{if(we.airTrafficInterval==="auto")return O.recommendedInterval||30;const I=Number(we.airTrafficInterval);return Number.isFinite(I)&&I>0?I:30});async function ve(){if(!we.showAirTraffic)return;const{states:I,unavailable:M,detail:ee,plan:Re,recommendedInterval:Ze}=await dp();T.value=I,O.unavailable=M,O.detail=ee,O.plan=Re||"",Ze&&(O.recommendedInterval=Ze),O.loaded=!0}function Y(){H&&clearInterval(H),H=setInterval(()=>{ye.value==="Overview"&&we.showAirTraffic&&ve()},fe.value*1e3)}function Pe(){ve(),Y()}function he(){H&&clearInterval(H),H=null}const ye=j("Overview"),Ne=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],Ie=ke(()=>(Ne.find(([,I])=>I===ye.value)||["grid"])[0]),Ve=j(""),pe=j(""),ze=j("");let Te=null,te=null,de=!1;const _e=ke(()=>Object.keys(u).sort((I,M)=>(u[M].online?1:0)-(u[I].online?1:0)||I.localeCompare(M))),be=ke(()=>h.value?u[h.value]:null),ae=ke(()=>be.value&&be.value.telemetry||{}),le=ke(()=>!!(be.value&&be.value.online)),ie=ke(()=>{const I=ae.value;return typeof I.latitude=="number"&&typeof I.longitude=="number"&&(I.latitude||I.longitude)?{lat:I.latitude,lng:I.longitude}:null}),rt=ke(()=>h.value&&d[h.value]||[]),me=ke(()=>{const I=ae.value;return typeof I.velocityX=="number"&&typeof I.velocityY=="number"?Math.hypot(I.velocityX,I.velocityY):null});function Oe(I){return I.online?I.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Xe(I){const M=I&&I.telemetry||{};return typeof M.velocityX=="number"&&typeof M.velocityY=="number"?Math.hypot(M.velocityX,M.velocityY):null}const ut=ke(()=>_e.value.map(I=>{const M=u[I],ee=M.telemetry||{},[Re,Ze]=Oe(M);return{id:I,mission:M.model||(M.connected?"Drone linked":M.online?"App online":"No signal"),status:Re,tone:Ze,alt:typeof ee.altitude=="number"?ee.altitude.toFixed(0)+" m":"—",battery:typeof ee.batteryPercent=="number"?ee.batteryPercent:null,speed:Xe(M)}})),et=ke(()=>_e.value.filter(I=>u[I].online).length),Ue=ke(()=>_e.value.filter(I=>u[I].online&&u[I].connected).length),W=ke(()=>_e.value.filter(I=>!u[I].online).length),E=ke(()=>{const I=_e.value.map(M=>{var ee;return(ee=u[M].telemetry)==null?void 0:ee.batteryPercent}).filter(M=>typeof M=="number");return I.length?Math.round(I.reduce((M,ee)=>M+ee,0)/I.length):null}),A=ke(()=>[{label:"Active flights",value:String(Ue.value),delta:`${et.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:E.value==null?"—":E.value+"%",delta:E.value==null?"no telemetry":E.value<40?"low — watch":"nominal",tone:E.value!=null&&E.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(_e.value.length),delta:`${Ue.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(W.value),delta:W.value?"needs attention":"all reachable",tone:W.value?"warning":"success",icon:"signal"}]),it={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},vt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},Lt=ke(()=>{var ee,Re,Ze;const M=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((ee=M[0])==null?void 0:ee[0])||"P")+(((Re=M[1])==null?void 0:Re[0])||((Ze=M[0])==null?void 0:Ze[1])||"V")).toUpperCase()}),b={superadmin:"Superadmin",admin:"Admin",user:"Operator"},_=ke(()=>b[o.role]||"Operator"),w=ke(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function K(I){var ee;u[I.deviceId]=I;const M=I.telemetry||{};typeof M.latitude=="number"&&typeof M.longitude=="number"&&(M.latitude||M.longitude)&&(d[I.deviceId]||(d[I.deviceId]=[]),d[I.deviceId].push([M.latitude,M.longitude]),d[I.deviceId].length>1e3&&d[I.deviceId].shift()),(!h.value||I.online&&!((ee=u[h.value])!=null&&ee.online))&&(h.value=I.deviceId)}function G(I){delete u[I],delete d[I],h.value===I&&(h.value=_e.value[0]||null)}function Z(I){y.unshift({t:uu(Date.now()),tag:I.type||"?",text:JSON.stringify(ne(I))}),y.length>200&&y.pop()}function ne(I){const M={...I};return delete M.type,M}function se(){const I=location.protocol==="https:"?"wss":"ws";Te=new WebSocket(`${I}://${location.host}/bff/ws`),Te.onopen=()=>v.value=!0,Te.onclose=()=>{v.value=!1,de||(te=setTimeout(se,1500))},Te.onerror=()=>Te&&Te.close(),Te.onmessage=M=>{let ee;try{ee=JSON.parse(M.data)}catch{return}ee.type==="snapshot"?(ee.devices||[]).forEach(K):ee.type==="update"&&ee.device?(K(ee.device),ee.event&&ee.device.deviceId===h.value&&Z(ee.event)):ee.type==="removed"&&ee.deviceId&&G(ee.deviceId)}}async function Q(){if(!h.value)return ze.value="No device selected.";if(!Ve.value.trim())return ze.value="Enter a command name.";let I;if(pe.value.trim())try{I=JSON.parse(pe.value)}catch{return ze.value="Payload is not valid JSON."}const{ok:M,body:ee}=await Op(h.value,Ve.value.trim(),I);ze.value=M?`Sent "${Ve.value.trim()}".`:`Error: ${ee.error||"failed"}`}function U(I,M,ee=""){return typeof I=="number"?I.toFixed(M)+ee:"—"}function Se(I){h.value=I,ye.value="Live flights"}return $t(ye,I=>{I==="Overview"&&ve()}),$t(()=>we.showAirTraffic,I=>{I?ve():T.value=[]}),$t(fe,Y),fi(async()=>{(await Xh()).forEach(K),se(),Pe()}),Fs(()=>{de=!0,te&&clearTimeout(te),Te&&Te.close(),he()}),(I,M)=>{var ee,Re,Ze,Ye,ht;return p(),g("div",$0,[r("aside",I0,[r("div",D0,[z(Uc,{size:26}),M[11]||(M[11]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",N0,[(p(),g(re,null,Be(Ne,([ue,Ae])=>r("button",{key:Ae,class:Ee(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",ye.value===Ae?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:wt=>ye.value=Ae},[z(X,{name:ue,size:18,stroke:ye.value===Ae?2.2:1.8},null,8,["name","stroke"]),D(" "+S(Ae),1)],10,R0)),64))]),r("div",F0,[r("div",B0,[r("div",V0,[r("span",{class:Ee(["h-2 w-2 rounded-full",v.value?"bg-ready":"bg-caution"])},null,2),r("span",U0,S(v.value?"Link healthy":"Reconnecting…"),1)]),r("span",Z0,"API gateway · "+S(v.value?"streaming":"retrying"),1)]),r("div",H0,[r("div",j0,S(Lt.value),1),r("div",W0,[r("div",K0,S(t.email||"Operator"),1),r("div",G0,[z(X,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${_.value} · ${w.value}`},S(_.value)+" · "+S(w.value),9,q0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:M[0]||(M[0]=ue=>l("logout"))},[z(X,{name:"logout",size:16})])])])]),r("main",Y0,[r("header",J0,[r("div",null,[M[12]||(M[12]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",X0,S(ye.value),1)]),r("div",Q0,[r("div",ew,[z(X,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":M[1]||(M[1]=ue=>C.value=ue),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[xe,C.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:M[2]||(M[2]=ue=>ye.value="Live flights")},[z(X,{name:"radio",size:16}),M[13]||(M[13]=D(" Live flights ",-1))])])]),ye.value==="Overview"?(p(),g("div",tw,[r("div",nw,[(p(!0),g(re,null,Be(A.value,ue=>(p(),g("div",{key:ue.label,class:"panel p-5"},[r("div",iw,[r("span",sw,S(ue.label),1),z(X,{name:ue.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",ow,S(ue.value),1),r("span",{class:Ee(["mt-2 block font-mono text-[11px]",vt[ue.tone]])},S(ue.delta),3)]))),128))]),r("div",aw,[r("div",rw,[r("div",lw,[M[18]||(M[18]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),r("div",uw,[$e(we).showAirTraffic&&B.value?(p(),g("span",{key:0,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it.accent]),title:"Live aircraft from OpenSky Network"},[z(X,{name:"radio",size:12}),D(S(B.value)+" aircraft ",1)],2)):R("",!0),Ue.value?(p(),g("span",{key:1,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it.success])},[M[14]||(M[14]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(Ue.value)+" drones ",1)],2)):R("",!0),r("div",cw,[r("button",{type:"button",class:Ee(["grid h-7 w-7 place-items-center rounded-md text-ink-muted transition hover:bg-surface-2 hover:text-ink",V.value?"bg-surface-2 text-ink":""]),title:"Map settings","aria-label":"Map settings",onClick:M[3]||(M[3]=ue=>V.value=!V.value)},[z(X,{name:"settings",size:16})],2),V.value?(p(),g(re,{key:0},[r("div",{class:"fixed inset-0 z-[1190]",onClick:M[4]||(M[4]=ue=>V.value=!1)}),r("div",dw,[M[17]||(M[17]=r("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),r("label",fw,[M[15]||(M[15]=r("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),z(sn,{modelValue:$e(we).showAirTraffic,"onUpdate:modelValue":M[5]||(M[5]=ue=>$e(we).showAirTraffic=ue)},null,8,["modelValue"])]),r("div",{class:Ee(["mt-3.5",$e(we).showAirTraffic?"":"pointer-events-none opacity-40"])},[r("div",hw,[M[16]||(M[16]=r("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),r("span",pw,"every "+S(fe.value)+"s",1)]),oe(r("select",{"onUpdate:modelValue":M[6]||(M[6]=ue=>$e(we).airTrafficInterval=ue),class:"field"},[(p(),g(re,null,Be(F,ue=>r("option",{key:ue.value,value:ue.value},S(ue.label)+S(ue.value==="auto"?` (plan: ${O.recommendedInterval}s)`:""),9,mw)),64))],512),[[Et,$e(we).airTrafficInterval]]),O.plan?(p(),g("p",gw," OpenSky plan: "+S(O.plan),1)):R("",!0)],2)])],64)):R("",!0)])])]),z(hu,{position:ie.value,trail:rt.value,aircraft:$e(we).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),$e(we).showAirTraffic?O.loaded&&O.unavailable?(p(),g("p",_w,S(O.detail||"Live air traffic is unavailable."),1)):(p(),g("p",yw," Live air traffic from OpenSky Network · updates every "+S(fe.value)+"s ",1)):(p(),g("p",vw," Live air traffic hidden · enable it in Map settings "))]),r("div",bw,[r("div",xw,[M[19]||(M[19]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),z(X,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",ww,[z(X,{name:"calendar",size:24,class:"text-ink-muted"}),M[20]||(M[20]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),M[21]||(M[21]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",kw,[r("div",Sw,[M[24]||(M[24]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",Tw,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it.success])},[M[22]||(M[22]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(Ue.value)+" in flight ",1)],2),W.value?(p(),g("span",{key:0,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it.warning])},[M[23]||(M[23]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(W.value)+" offline ",1)],2)):R("",!0)])]),ut.value.length?(p(),g("div",Cw,[r("table",Lw,[r("thead",null,[r("tr",Mw,[(p(),g(re,null,Be(["Aircraft","Mission","Status","Alt","Battery","Speed",""],ue=>r("th",{key:ue,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},S(ue),1)),64))])]),r("tbody",null,[(p(!0),g(re,null,Be(ut.value,(ue,Ae)=>(p(),g("tr",{key:ue.id,class:Ee(["cursor-pointer transition hover:bg-surface-2",AeSe(ue.id)},[r("td",Ow,S(ue.id),1),r("td",zw,S(ue.mission),1),r("td",Aw,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",it[ue.tone]])},[M[25]||(M[25]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(S(ue.status),1)],2)]),r("td",$w,S(ue.alt),1),r("td",Iw,[ue.battery!=null?(p(),g("div",Dw,[r("div",Nw,[r("div",{class:Ee(["h-full",ue.battery<40?"bg-caution":"bg-ready"]),style:Is({width:ue.battery+"%"})},null,6)]),r("span",Rw,S(ue.battery)+"%",1)])):(p(),g("span",Fw,"—"))]),r("td",Bw,[D(S(ue.speed==null?"—":ue.speed.toFixed(1))+" ",1),M[26]||(M[26]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",Vw,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:Hr(wt=>Se(ue.id),["stop"])},[z(X,{name:"play",size:14}),M[27]||(M[27]=D(" Track ",-1))],8,Uw)])],10,Ew))),128))])])])):(p(),g("div",Pw," No aircraft connected yet. Devices appear here as they come online. "))])])):ye.value==="Live flights"?(p(),g("div",Zw,[r("div",Hw,[r("span",jw,S(h.value||"No device selected"),1),be.value&&!le.value?(p(),g("span",Ww,"Offline")):R("",!0),_e.value.length?(p(),g("div",Kw,[(p(!0),g(re,null,Be(_e.value,ue=>(p(),g("button",{key:ue,class:Ee(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",ue===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:Ae=>h.value=ue},[r("span",{class:Ee(["h-2 w-2 rounded-full",u[ue].online?"bg-ready":"bg-ink-muted"])},null,2),D(" "+S(ue),1)],10,Gw))),128))])):R("",!0)]),_e.value.length?(p(),g(re,{key:1},[r("div",{class:Ee(["mb-4 grid gap-3",!le.value&&be.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",Yw,[M[30]||(M[30]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Ee(["mt-1 text-sm font-semibold",le.value?((ee=be.value)==null?void 0:ee.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},S(le.value&&((Re=be.value)!=null&&Re.registration)?be.value.registration:"—"),3)]),r("div",Jw,[M[31]||(M[31]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Ee(["mt-1 text-sm font-semibold",le.value?(Ze=be.value)!=null&&Ze.connected?"text-success-fg":"text-danger-fg":"text-ink"])},S(be.value?le.value?be.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",Xw,[M[32]||(M[32]=r("div",{class:"eyebrow"},"Model",-1)),r("div",Qw,S(((Ye=be.value)==null?void 0:Ye.model)||"—"),1)]),r("div",ek,[M[33]||(M[33]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",tk,S((ht=be.value)!=null&&ht.lastSeenMs?$e(uu)(be.value.lastSeenMs):"—"),1)])],2),r("div",nk,[r("div",ik,[M[35]||(M[35]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",sk,[r("div",ok,[r("div",{class:Ee(["h-full transition-all",typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent<20?"bg-warning":ae.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Is({width:(typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent:0)+"%"})},null,6)]),r("div",ak,[D(S(typeof ae.value.batteryPercent=="number"?ae.value.batteryPercent:"—"),1),M[34]||(M[34]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",rk,[M[37]||(M[37]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",lk,[D(S(U(ae.value.altitude,1)),1),M[36]||(M[36]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",uk,[M[42]||(M[42]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",ck,[r("div",dk,[M[38]||(M[38]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",fk,S(ae.value.flightMode||"—"),1)]),r("div",hk,[M[39]||(M[39]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",pk,S(ae.value.isFlying==null?"—":ae.value.isFlying?"yes":"no"),1)]),r("div",mk,[M[40]||(M[40]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",gk,S(ae.value.satelliteCount==null?"—":ae.value.satelliteCount),1)]),r("div",vk,[M[41]||(M[41]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",_k,S(me.value==null?"—":U(me.value,2," m/s")),1)])])]),r("div",yk,[M[46]||(M[46]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",bk,[r("div",xk,[M[43]||(M[43]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",wk,S(U(ae.value.latitude,6)),1)]),r("div",kk,[M[44]||(M[44]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",Sk,S(U(ae.value.longitude,6)),1)]),r("div",Tk,[M[45]||(M[45]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",Pk,S(U(typeof ae.value.velocityZ=="number"?-ae.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",Ck,[M[47]||(M[47]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),z(hu,{position:ie.value,trail:rt.value},null,8,["position","trail"])]),r("div",Lk,[M[48]||(M[48]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",Mk,[oe(r("input",{"onUpdate:modelValue":M[7]||(M[7]=ue=>Ve.value=ue),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[xe,Ve.value]]),oe(r("input",{"onUpdate:modelValue":M[8]||(M[8]=ue=>pe.value=ue),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[xe,pe.value]]),r("button",{class:"btn-accent",onClick:Q},"Send")]),r("div",Ek,S(ze.value),1)]),r("div",Ok,[M[49]||(M[49]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",zk,[(p(!0),g(re,null,Be(y,(ue,Ae)=>(p(),g("div",{key:Ae,class:"border-b border-line py-1"},[r("span",Ak,S(ue.t),1),r("span",$k,S(ue.tag),1),r("span",Ik,S(ue.text),1)]))),128))])])])],64)):(p(),g("div",qw,[z(X,{name:"radio",size:28,class:"text-ink-muted"}),M[28]||(M[28]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),M[29]||(M[29]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):ye.value==="Logbook"?(p(),at(Gb,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):ye.value==="Documents"?(p(),at(A0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):ye.value==="Settings"?(p(),at(Jy,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:M[9]||(M[9]=ue=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),g("div",Dk,[r("div",Nk,[z(X,{name:Ie.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",Rk,S(ye.value),1),ye.value==="Drives"?(p(),g("div",Fk,[M[50]||(M[50]=D(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:M[10]||(M[10]=ue=>ye.value="Settings")},"Settings → Integrations"),M[51]||(M[51]=D(". ",-1))])):(p(),g("div",Bk,"This section is part of the console shell and has no backend yet."))])]))])])}}},Uk={key:0,class:"h-full"},Zk={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},Hk={__name:"App",setup(t){const i=j(!1),o=j(null),l=j("user"),u=j(""),d=j(""),h=j("");function v(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",d.value=T&&T.organizationName||""}fi(async()=>{h.value=(await qh()).apiBase||"";const T=await ou();T&&(o.value=T.email,v(T),await du()),i.value=!0});async function y(T){o.value=T,v(await ou()),await du()}async function C(){Dp(),await Jh(),o.value=null,l.value="user",u.value="",d.value=""}return(T,O)=>i.value?(p(),g("div",Uk,[o.value?(p(),at(Vk,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(p(),at(Qp,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(p(),g("div",Zk,"Loading…"))}};jh(Hk).mount("#app"); diff --git a/Web App/server/dist/assets/index-D0ghlckk.css b/Web App/server/dist/assets/index-FLz21UuE.css similarity index 76% rename from Web App/server/dist/assets/index-D0ghlckk.css rename to Web App/server/dist/assets/index-FLz21UuE.css index 0053adf..1bdede4 100644 --- a/Web App/server/dist/assets/index-D0ghlckk.css +++ b/Web App/server/dist/assets/index-FLz21UuE.css @@ -1 +1 @@ -:root,[data-theme=light]{--navy-950: #0B1730;--navy-900: #0F1E3D;--navy-800: #1B2E52;--navy-700: #26406E;--blue-50: #EAF1FE;--blue-100: #D6E3FD;--blue-200: #B4CDFA;--blue-300: #8FB4F6;--blue-400: #5B93F5;--blue-500: #3D7BF0;--blue-600: #2B62CC;--blue-700: #1F4CA0;--slate-0: #FFFFFF;--slate-50: #F6F7F9;--slate-100: #EEF0F3;--slate-150: #E6E9EE;--slate-200: #DCE0E7;--slate-300: #C5CCD7;--slate-400: #97A1B0;--slate-500: #6B7688;--slate-600: #4C5566;--slate-700: #333B4A;--slate-800: #1E2635;--slate-900: #131A28;--slate-950: #0B111C;--steel: #5A6B85;--green-500: #1F8A5B;--green-100: #DCF1E7;--green-600:#177049;--amber-500: #D9852B;--amber-100: #FBEBD5;--amber-600:#B86C1B;--red-500: #D64545;--red-100: #FBE0E0;--red-600: #B83232;--bg-app: var(--slate-100);--bg-subtle: var(--slate-50);--surface: var(--slate-0);--surface-2: var(--slate-50);--surface-inset: var(--slate-100);--border: var(--slate-200);--border-strong: var(--slate-300);--border-subtle: var(--slate-150);--text-primary: var(--navy-900);--text-secondary:var(--steel);--text-tertiary: var(--slate-400);--text-inverse: var(--slate-0);--text-on-accent:#FFFFFF;--accent: var(--blue-500);--accent-hover: var(--blue-600);--accent-active: var(--blue-700);--accent-soft: var(--blue-50);--accent-soft-fg:var(--blue-700);--focus-ring: color-mix(in srgb, var(--blue-500) 45%, transparent);--success: var(--green-500);--success-soft: var(--green-100);--success-fg: var(--green-600);--warning: var(--amber-500);--warning-soft: var(--amber-100);--warning-fg: var(--amber-600);--danger: var(--red-500);--danger-soft: var(--red-100);--danger-fg: var(--red-600);--overlay: color-mix(in srgb, var(--navy-950) 55%, transparent);--font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono: "Space Mono", ui-monospace, "SF Mono", "JetBrains Mono", monospace;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--radius-xl: 20px;--radius-pill: 999px;--shadow-xs: 0 1px 2px rgba(15,30,61,.06);--shadow-sm: 0 1px 2px rgba(15,30,61,.06), 0 1px 3px rgba(15,30,61,.04);--shadow-md: 0 2px 4px rgba(15,30,61,.06), 0 6px 16px rgba(15,30,61,.08);--shadow-lg: 0 8px 24px rgba(15,30,61,.1), 0 2px 6px rgba(15,30,61,.06);--ease-standard: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--dur-fast: .12s;--dur-base: .2s;color-scheme:light}[data-theme=dark]{--bg-app: var(--navy-950);--bg-subtle: var(--slate-950);--surface: #10203F;--surface-2: #142748;--surface-inset: var(--navy-950);--border: color-mix(in srgb, #FFFFFF 10%, transparent);--border-strong: color-mix(in srgb, #FFFFFF 18%, transparent);--border-subtle: color-mix(in srgb, #FFFFFF 6%, transparent);--text-primary: #F4F7FC;--text-secondary:#8FA0BE;--text-tertiary: #5E6E8C;--text-inverse: var(--navy-900);--text-on-accent:#FFFFFF;--accent: var(--blue-400);--accent-hover: var(--blue-300);--accent-active: var(--blue-200);--accent-soft: color-mix(in srgb, var(--blue-500) 18%, transparent);--accent-soft-fg:var(--blue-300);--focus-ring: color-mix(in srgb, var(--blue-400) 55%, transparent);--success:var(--green-500);--success-soft: color-mix(in srgb, var(--green-500) 22%, transparent);--success-fg:#5FD3A0;--warning:var(--amber-500);--warning-soft: color-mix(in srgb, var(--amber-500) 22%, transparent);--warning-fg:#F0B26A;--danger: var(--red-500);--danger-soft: color-mix(in srgb, var(--red-500) 22%, transparent);--danger-fg: #F08A8A;--overlay: color-mix(in srgb, #000000 62%, transparent);--shadow-xs: 0 1px 2px rgba(0,0,0,.35);--shadow-sm: 0 1px 3px rgba(0,0,0,.4);--shadow-md: 0 4px 12px rgba(0,0,0,.45);--shadow-lg: 0 12px 32px rgba(0,0,0,.5);color-scheme:dark}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tabular{font-variant-numeric:tabular-nums}.eyebrow{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--text-tertiary)}.readout{font-variant-numeric:tabular-nums;font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:30px;line-height:1;font-weight:500;color:var(--text-primary)}.panel{border-radius:14px;border-width:1px;border-color:var(--border);background-color:var(--surface);--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.pill{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.5rem .75rem}.field{width:100%;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.625rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-primary);outline:2px solid transparent;outline-offset:2px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.field::-moz-placeholder{color:var(--text-tertiary)}.field::placeholder{color:var(--text-tertiary)}.field{transition-duration:var(--dur-fast)}.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}.btn-accent{border-radius:10px;background-color:var(--accent);padding:.625rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-accent:hover{background-color:var(--accent-hover)}.btn-accent:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-accent:disabled{opacity:.5}.btn-accent{transition-duration:var(--dur-fast)}.btn-ghost{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);padding:.375rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-ghost:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-ghost{transition-duration:var(--dur-fast)}.btn-icon{display:grid;height:2.25rem;width:2.25rem;place-items:center;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-icon:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-icon{transition-duration:var(--dur-fast)}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-5{bottom:1.25rem}.right-0{right:0}.right-5{right:1.25rem}.top-0{top:0}.top-5{top:1.25rem}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[1190\]{z-index:1190}.z-\[1200\]{z-index:1200}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-28{height:7rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-\[74vh\]{height:74vh}.h-full{height:100%}.max-h-\[90vh\]{max-height:90vh}.min-h-\[16px\]{min-height:16px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-56{width:14rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[18px\]{width:18px}.w-\[380px\]{width:380px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[1240px\]{max-width:1240px}.max-w-\[1280px\]{max-width:1280px}.max-w-\[220px\]{max-width:220px}.max-w-\[280px\]{max-width:280px}.max-w-\[360px\]{max-width:360px}.max-w-\[420px\]{max-width:420px}.max-w-\[520px\]{max-width:520px}.max-w-\[920px\]{max-width:920px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[1\.6fr_1fr\]{grid-template-columns:1.6fr 1fr}.grid-cols-\[210px_1fr\]{grid-template-columns:210px 1fr}.grid-cols-\[248px_1fr\]{grid-template-columns:248px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1\.5{row-gap:.375rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded,.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:14px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-0{border-width:0px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-accent{border-color:var(--accent)}.border-line{border-color:var(--border)}.border-line-strong{border-color:var(--border-strong)}.border-transparent{border-color:transparent}.bg-\[var\(--navy-800\)\]{background-color:var(--navy-800)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-amber{background-color:var(--warning)}.bg-amber-soft{background-color:var(--warning-soft)}.bg-caution{background-color:var(--warning)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--danger)}.bg-danger-soft{background-color:var(--danger-soft)}.bg-ink-muted{background-color:var(--text-tertiary)}.bg-line{background-color:var(--border)}.bg-ready,.bg-success{background-color:var(--success)}.bg-success-soft{background-color:var(--success-soft)}.bg-surface-1{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--danger)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-7{padding:1.75rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-8{padding-bottom:2rem}.pr-10{padding-right:2.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[19px\]{font-size:19px}.text-\[22px\]{font-size:22px}.text-\[30px\]{font-size:30px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-mode{font-size:18px;line-height:1.2;letter-spacing:-.02em;font-weight:600}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-caps{letter-spacing:.14em}.tracking-tightest{letter-spacing:-.02em}.text-accent{color:var(--accent)}.text-accent-soft-fg{color:var(--accent-soft-fg)}.text-amber-fg{color:var(--warning-fg)}.text-danger-fg{color:var(--danger-fg)}.text-ink{color:var(--text-primary)}.text-ink-muted{color:var(--text-tertiary)}.text-ink-secondary{color:var(--text-secondary)}.text-success-fg{color:var(--success-fg)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.accent-\[var\(--danger\)\]{accent-color:var(--danger)}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xs{--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}html,body,#app{height:100%}html{background-color:var(--bg-app);transition:background-color var(--dur-base) var(--ease-standard)}body{font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{background-color:var(--bg-app);min-height:100vh;transition:background-color var(--dur-base) var(--ease-standard)}html.reduce-motion *,html.reduce-motion *:before,html.reduce-motion *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}.leaflet-container{background:var(--surface-inset);font-family:var(--font-sans)}.leaflet-control-attribution{background:color-mix(in srgb,var(--surface) 82%,transparent)!important;color:var(--text-tertiary)!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.placeholder\:text-ink-muted::-moz-placeholder{color:var(--text-tertiary)}.placeholder\:text-ink-muted::placeholder{color:var(--text-tertiary)}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-danger-soft:hover{background-color:var(--danger-soft)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:text-ink:hover{color:var(--text-primary)}.hover\:text-ink-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.enabled\:hover\:brightness-110:hover:enabled{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(max-width:1100px){.max-\[1100px\]\:hidden{display:none}.max-\[1100px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[1100px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:900px){.max-\[900px\]\:hidden{display:none}.max-\[900px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[900px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.max-\[820px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[820px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(max-width:760px){.max-\[760px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[760px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[760px\]\:flex-row{flex-direction:row}.max-\[760px\]\:overflow-x-auto{overflow-x:auto}}@media(max-width:560px){.max-\[560px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(min-width:640px){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}.fade-enter-active[data-v-2b0c86a6],.fade-leave-active[data-v-2b0c86a6]{transition:opacity .2s}.fade-enter-from[data-v-2b0c86a6],.fade-leave-to[data-v-2b0c86a6]{opacity:0} +:root,[data-theme=light]{--navy-950: #0B1730;--navy-900: #0F1E3D;--navy-800: #1B2E52;--navy-700: #26406E;--blue-50: #EAF1FE;--blue-100: #D6E3FD;--blue-200: #B4CDFA;--blue-300: #8FB4F6;--blue-400: #5B93F5;--blue-500: #3D7BF0;--blue-600: #2B62CC;--blue-700: #1F4CA0;--slate-0: #FFFFFF;--slate-50: #F6F7F9;--slate-100: #EEF0F3;--slate-150: #E6E9EE;--slate-200: #DCE0E7;--slate-300: #C5CCD7;--slate-400: #97A1B0;--slate-500: #6B7688;--slate-600: #4C5566;--slate-700: #333B4A;--slate-800: #1E2635;--slate-900: #131A28;--slate-950: #0B111C;--steel: #5A6B85;--green-500: #1F8A5B;--green-100: #DCF1E7;--green-600:#177049;--amber-500: #D9852B;--amber-100: #FBEBD5;--amber-600:#B86C1B;--red-500: #D64545;--red-100: #FBE0E0;--red-600: #B83232;--bg-app: var(--slate-100);--bg-subtle: var(--slate-50);--surface: var(--slate-0);--surface-2: var(--slate-50);--surface-inset: var(--slate-100);--border: var(--slate-200);--border-strong: var(--slate-300);--border-subtle: var(--slate-150);--text-primary: var(--navy-900);--text-secondary:var(--steel);--text-tertiary: var(--slate-400);--text-inverse: var(--slate-0);--text-on-accent:#FFFFFF;--accent: var(--blue-500);--accent-hover: var(--blue-600);--accent-active: var(--blue-700);--accent-soft: var(--blue-50);--accent-soft-fg:var(--blue-700);--focus-ring: color-mix(in srgb, var(--blue-500) 45%, transparent);--success: var(--green-500);--success-soft: var(--green-100);--success-fg: var(--green-600);--warning: var(--amber-500);--warning-soft: var(--amber-100);--warning-fg: var(--amber-600);--danger: var(--red-500);--danger-soft: var(--red-100);--danger-fg: var(--red-600);--overlay: color-mix(in srgb, var(--navy-950) 55%, transparent);--font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono: "Space Mono", ui-monospace, "SF Mono", "JetBrains Mono", monospace;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--radius-xl: 20px;--radius-pill: 999px;--shadow-xs: 0 1px 2px rgba(15,30,61,.06);--shadow-sm: 0 1px 2px rgba(15,30,61,.06), 0 1px 3px rgba(15,30,61,.04);--shadow-md: 0 2px 4px rgba(15,30,61,.06), 0 6px 16px rgba(15,30,61,.08);--shadow-lg: 0 8px 24px rgba(15,30,61,.1), 0 2px 6px rgba(15,30,61,.06);--ease-standard: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--dur-fast: .12s;--dur-base: .2s;color-scheme:light}[data-theme=dark]{--bg-app: var(--navy-950);--bg-subtle: var(--slate-950);--surface: #10203F;--surface-2: #142748;--surface-inset: var(--navy-950);--border: color-mix(in srgb, #FFFFFF 10%, transparent);--border-strong: color-mix(in srgb, #FFFFFF 18%, transparent);--border-subtle: color-mix(in srgb, #FFFFFF 6%, transparent);--text-primary: #F4F7FC;--text-secondary:#8FA0BE;--text-tertiary: #5E6E8C;--text-inverse: var(--navy-900);--text-on-accent:#FFFFFF;--accent: var(--blue-400);--accent-hover: var(--blue-300);--accent-active: var(--blue-200);--accent-soft: color-mix(in srgb, var(--blue-500) 18%, transparent);--accent-soft-fg:var(--blue-300);--focus-ring: color-mix(in srgb, var(--blue-400) 55%, transparent);--success:var(--green-500);--success-soft: color-mix(in srgb, var(--green-500) 22%, transparent);--success-fg:#5FD3A0;--warning:var(--amber-500);--warning-soft: color-mix(in srgb, var(--amber-500) 22%, transparent);--warning-fg:#F0B26A;--danger: var(--red-500);--danger-soft: color-mix(in srgb, var(--red-500) 22%, transparent);--danger-fg: #F08A8A;--overlay: color-mix(in srgb, #000000 62%, transparent);--shadow-xs: 0 1px 2px rgba(0,0,0,.35);--shadow-sm: 0 1px 3px rgba(0,0,0,.4);--shadow-md: 0 4px 12px rgba(0,0,0,.45);--shadow-lg: 0 12px 32px rgba(0,0,0,.5);color-scheme:dark}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tabular{font-variant-numeric:tabular-nums}.eyebrow{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--text-tertiary)}.readout{font-variant-numeric:tabular-nums;font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:30px;line-height:1;font-weight:500;color:var(--text-primary)}.panel{border-radius:14px;border-width:1px;border-color:var(--border);background-color:var(--surface);--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.pill{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.5rem .75rem}.field{width:100%;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.625rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-primary);outline:2px solid transparent;outline-offset:2px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.field::-moz-placeholder{color:var(--text-tertiary)}.field::placeholder{color:var(--text-tertiary)}.field{transition-duration:var(--dur-fast)}.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}.btn-accent{border-radius:10px;background-color:var(--accent);padding:.625rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-accent:hover{background-color:var(--accent-hover)}.btn-accent:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-accent:disabled{opacity:.5}.btn-accent{transition-duration:var(--dur-fast)}.btn-ghost{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);padding:.375rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-ghost:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-ghost{transition-duration:var(--dur-fast)}.btn-icon{display:grid;height:2.25rem;width:2.25rem;place-items:center;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-icon:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-icon{transition-duration:var(--dur-fast)}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-5{bottom:1.25rem}.right-0{right:0}.right-5{right:1.25rem}.top-0{top:0}.top-5{top:1.25rem}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[1190\]{z-index:1190}.z-\[1200\]{z-index:1200}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-28{height:7rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-\[74vh\]{height:74vh}.h-full{height:100%}.max-h-\[90vh\]{max-height:90vh}.min-h-\[16px\]{min-height:16px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-4{width:1rem}.w-48{width:12rem}.w-56{width:14rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[18px\]{width:18px}.w-\[380px\]{width:380px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[1240px\]{max-width:1240px}.max-w-\[1280px\]{max-width:1280px}.max-w-\[220px\]{max-width:220px}.max-w-\[280px\]{max-width:280px}.max-w-\[360px\]{max-width:360px}.max-w-\[420px\]{max-width:420px}.max-w-\[520px\]{max-width:520px}.max-w-\[920px\]{max-width:920px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[1\.6fr_1fr\]{grid-template-columns:1.6fr 1fr}.grid-cols-\[210px_1fr\]{grid-template-columns:210px 1fr}.grid-cols-\[248px_1fr\]{grid-template-columns:248px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1\.5{row-gap:.375rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded,.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:14px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-0{border-width:0px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-accent{border-color:var(--accent)}.border-line{border-color:var(--border)}.border-line-strong{border-color:var(--border-strong)}.border-transparent{border-color:transparent}.bg-\[var\(--navy-800\)\]{background-color:var(--navy-800)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-amber{background-color:var(--warning)}.bg-amber-soft{background-color:var(--warning-soft)}.bg-caution{background-color:var(--warning)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--danger)}.bg-danger-soft{background-color:var(--danger-soft)}.bg-ink-muted{background-color:var(--text-tertiary)}.bg-line{background-color:var(--border)}.bg-ready,.bg-success{background-color:var(--success)}.bg-success-soft{background-color:var(--success-soft)}.bg-surface-1{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--danger)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-7{padding:1.75rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-8{padding-bottom:2rem}.pr-10{padding-right:2.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[19px\]{font-size:19px}.text-\[22px\]{font-size:22px}.text-\[30px\]{font-size:30px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-mode{font-size:18px;line-height:1.2;letter-spacing:-.02em;font-weight:600}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-caps{letter-spacing:.14em}.tracking-tightest{letter-spacing:-.02em}.text-accent{color:var(--accent)}.text-accent-soft-fg{color:var(--accent-soft-fg)}.text-amber-fg{color:var(--warning-fg)}.text-danger-fg{color:var(--danger-fg)}.text-ink{color:var(--text-primary)}.text-ink-muted{color:var(--text-tertiary)}.text-ink-secondary{color:var(--text-secondary)}.text-success-fg{color:var(--success-fg)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.accent-\[var\(--danger\)\]{accent-color:var(--danger)}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xs{--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}html,body,#app{height:100%}html{background-color:var(--bg-app);transition:background-color var(--dur-base) var(--ease-standard)}body{font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{background-color:var(--bg-app);min-height:100vh;transition:background-color var(--dur-base) var(--ease-standard)}html.reduce-motion *,html.reduce-motion *:before,html.reduce-motion *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}.leaflet-container{background:var(--surface-inset);font-family:var(--font-sans)}.leaflet-control-attribution{background:color-mix(in srgb,var(--surface) 82%,transparent)!important;color:var(--text-tertiary)!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.placeholder\:text-ink-muted::-moz-placeholder{color:var(--text-tertiary)}.placeholder\:text-ink-muted::placeholder{color:var(--text-tertiary)}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-danger-soft:hover{background-color:var(--danger-soft)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:text-ink:hover{color:var(--text-primary)}.hover\:text-ink-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.enabled\:hover\:brightness-110:hover:enabled{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(max-width:1100px){.max-\[1100px\]\:hidden{display:none}.max-\[1100px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[1100px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:900px){.max-\[900px\]\:hidden{display:none}.max-\[900px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[900px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.max-\[820px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[820px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(max-width:760px){.max-\[760px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[760px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[760px\]\:flex-row{flex-direction:row}.max-\[760px\]\:overflow-x-auto{overflow-x:auto}}@media(max-width:560px){.max-\[560px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(min-width:640px){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}.fade-enter-active[data-v-977256e5],.fade-leave-active[data-v-977256e5]{transition:opacity .2s}.fade-enter-from[data-v-977256e5],.fade-leave-to[data-v-977256e5]{opacity:0} diff --git a/Web App/server/dist/index.html b/Web App/server/dist/index.html index 1a5c597..18351bd 100644 --- a/Web App/server/dist/index.html +++ b/Web App/server/dist/index.html @@ -35,8 +35,8 @@ })() PilotVault — Control Panel - - + +
diff --git a/Web App/web/src/api.js b/Web App/web/src/api.js index cfffeac..5c6eb6a 100644 --- a/Web App/web/src/api.js +++ b/Web App/web/src/api.js @@ -166,14 +166,16 @@ export async function testOpenSky() { return { ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) } } -// Live aircraft positions (OpenSky state vectors) within the caller's resolved -// bounding box, for plotting on the Live map. Returns { states, unavailable?, -// detail?, plan, recommendedInterval } — an empty list with `unavailable` when -// OpenSky is off for the caller. `recommendedInterval` (seconds) is derived from -// the resolved plan and drives the "Auto" refresh cadence. -export async function getOpenSkyStates() { +// Live aircraft positions (OpenSky state vectors) for plotting on the Live map. +// Pass an optional `bbox` ("lamin,lomin,lamax,lomax") to override the caller's +// configured area — used by the auto cascade (drone/device/region location). +// Returns { states, unavailable?, detail?, plan, recommendedInterval } — an empty +// list with `unavailable` when OpenSky is off for the caller. `recommendedInterval` +// (seconds) is derived from the resolved plan and drives the "Auto" refresh cadence. +export async function getOpenSkyStates(bbox) { try { - const r = await fetch('/bff/integrations/opensky/states') + const qs = bbox ? `?bbox=${encodeURIComponent(bbox)}` : '' + const r = await fetch(`/bff/integrations/opensky/states${qs}`) if (!r.ok) return { states: [], unavailable: true, detail: 'OpenSky unavailable' } const d = await r.json() return { diff --git a/Web App/web/src/components/Dashboard.vue b/Web App/web/src/components/Dashboard.vue index 590d571..f72599a 100644 --- a/Web App/web/src/components/Dashboard.vue +++ b/Web App/web/src/components/Dashboard.vue @@ -9,6 +9,7 @@ import Documents from './Documents.vue' import Toggle from './settings/Toggle.vue' import { getDevices, sendCommand, getOpenSkyStates } from '../api.js' import { formatTime, prefs } from '../prefs.js' +import { countryForPoint, bboxForCountry } from '../countries.js' const props = defineProps({ email: { type: String, default: '' }, @@ -50,9 +51,72 @@ const airIntervalSeconds = computed(() => { return Number.isFinite(n) && n > 0 ? n : 30 }) +// Europe — the ultimate fallback for the auto cascade (matches the server default). +const EUROPE_BBOX = '34,-25,72,45' + +// Cached browser geolocation: { lat, lng } once granted, false once denied/failed, +// null before we've asked. Requested lazily and at most once per session. +const browserGeo = ref(null) +let browserGeoPending = false +function requestBrowserGeo() { + if (browserGeoPending || browserGeo.value !== null) return + if (typeof navigator === 'undefined' || !navigator.geolocation) { browserGeo.value = false; return } + browserGeoPending = true + navigator.geolocation.getCurrentPosition( + (pos) => { browserGeo.value = { lat: pos.coords.latitude, lng: pos.coords.longitude }; browserGeoPending = false }, + () => { browserGeo.value = false; browserGeoPending = false }, // denied/unavailable — fall through to Region + { timeout: 8000, maximumAge: 600000 }, + ) +} + +// A device's position from telemetry, or null. `key` picks drone vs phone GPS. +function devicePoint(d, latKey, lngKey) { + const t = (d && d.telemetry) || {} + const lat = t[latKey] + const lng = t[lngKey] + return typeof lat === 'number' && typeof lng === 'number' && (lat || lng) ? { lat, lng } : null +} + +// Resolve the live-map bounding box from the location cascade (auto mode): +// 1. drone GPS (selected device, else any device with a fix) +// 2. user location: phone GPS (from the Fly App) else browser geolocation +// 3. Region country from User Settings +// 4. Europe +// Each location step maps a point to its country's bbox via countries.js. +function resolveAutoBbox() { + // 1. Drone telemetry position. + const drone = + devicePoint(sel.value, 'latitude', 'longitude') || + ids.value.map((id) => devicePoint(devices[id], 'latitude', 'longitude')).find(Boolean) + if (drone) { + const c = countryForPoint(drone.lat, drone.lng) + if (c) return c.bbox + } + // 2a. Phone GPS reported by the Fly App (rides on telemetry). + const phone = + devicePoint(sel.value, 'phoneLatitude', 'phoneLongitude') || + ids.value.map((id) => devicePoint(devices[id], 'phoneLatitude', 'phoneLongitude')).find(Boolean) + if (phone) { + const c = countryForPoint(phone.lat, phone.lng) + if (c) return c.bbox + } + // 2b. Browser geolocation (asks once; ignored until granted). + requestBrowserGeo() + if (browserGeo.value) { + const c = countryForPoint(browserGeo.value.lat, browserGeo.value.lng) + if (c) return c.bbox + } + // 3. Region country fallback. + const regionBbox = bboxForCountry(prefs.region) + if (regionBbox) return regionBbox + // 4. Europe. + return EUROPE_BBOX +} + async function refreshAirspace() { if (!prefs.showAirTraffic) return - const { states, unavailable, detail, plan, recommendedInterval } = await getOpenSkyStates() + const bbox = prefs.autoBbox ? resolveAutoBbox() : undefined + const { states, unavailable, detail, plan, recommendedInterval } = await getOpenSkyStates(bbox) aircraft.value = states airspace.unavailable = unavailable airspace.detail = detail diff --git a/Web App/web/src/components/Settings.vue b/Web App/web/src/components/Settings.vue index 0214429..1215862 100644 --- a/Web App/web/src/components/Settings.vue +++ b/Web App/web/src/components/Settings.vue @@ -6,6 +6,7 @@ import Segmented from './settings/Segmented.vue' import Row from './settings/Row.vue' import { themeMode, setThemeMode } from '../theme.js' import { prefs, formatDateTime, importPrefs, applyFontSize, applyReduceMotion } from '../prefs.js' +import { europeanCountries, regionOptions } from '../countries.js' import { getUsers, createUser, updateUser, deleteUser, getOrgs, createOrg, updateOrg, deleteOrg, @@ -112,9 +113,10 @@ const TIME_OPTS = [ const LANGS = [ ['en', 'English'], ['es', 'Español'], ['de', 'Deutsch'], ['fr', 'Français'], ['pl', 'Polski'], ['ja', '日本語'], ] -const REGIONS = [ - ['US', 'United States'], ['GB', 'United Kingdom'], ['EU', 'European Union'], ['CA', 'Canada'], ['AU', 'Australia'], ['JP', 'Japan'], -] +// All countries of the world (also the final fallback for the auto bounding box). +const REGIONS = regionOptions() +// Display name of the currently selected Region (for the auto-bbox helper text). +const regionName = computed(() => (REGIONS.find(([v]) => v === prefs.region) || [null, prefs.region])[1]) const DATE_FMTS = [ ['MDY', 'MM/DD/YYYY'], ['DMY', 'DD/MM/YYYY'], ['YMD', 'YYYY/MM/DD'], ['ISO', 'YYYY-MM-DD'], ] @@ -207,8 +209,8 @@ const OS_SCOPE_OPTS = [ ] // Predefined bounding boxes (lamin,lomin,lamax,lomax). The picker offers these -// plus a "Custom…" option that reveals the free-text field for manual entry. -// Europe is the default (kept in sync with the API Server's defaultBBox). +// plus "Automatic" (the location cascade) and "Custom…" (manual coordinates). +// European countries come from the shared dataset in countries.js. const OS_BBOX_GROUPS = [ { label: 'World', options: [ { value: '-90,-180,90,180', label: 'World' }, @@ -221,15 +223,12 @@ const OS_BBOX_GROUPS = [ { value: '-56,-82,13,-34', label: 'South America' }, { value: '-48,110,-10,180', label: 'Oceania' }, ] }, - { label: 'Countries', options: [ - { value: '49,14.1,54.9,24.2', label: 'Poland' }, - { value: '50.5,3.2,53.7,7.3', label: 'Netherlands' }, - { value: '47.2,5.8,55.1,15.1', label: 'Germany' }, - { value: '41.3,-5.2,51.1,9.6', label: 'France' }, - { value: '49.9,-8.7,59,1.8', label: 'United Kingdom' }, - { value: '35.9,-9.6,43.8,3.4', label: 'Spain' }, - { value: '36.6,6.6,47.1,18.6', label: 'Italy' }, + { label: 'European countries', options: europeanCountries() }, + { label: 'Other countries', options: [ { value: '24,-125,49.5,-66.5', label: 'United States' }, + { value: '41.7,-141,83.1,-52.6', label: 'Canada' }, + { value: '-43.6,113.3,-10.7,153.6', label: 'Australia' }, + { value: '24,122.9,45.5,145.8', label: 'Japan' }, ] }, ] const OS_BBOX_FLAT = OS_BBOX_GROUPS.flatMap((g) => g.options) @@ -253,20 +252,32 @@ function osBboxLabel(v) { // Manual-entry toggle: sticky once the user picks "Custom…", and implied when // the current value doesn't match any preset. const osBboxCustom = ref(false) +// The picker's value. "__auto__" is the location cascade (a personal client +// preference, prefs.autoBbox — not part of the server config, so it's only +// offered in the personal scope). "__custom__" reveals the coordinate field. const osBboxPreset = computed({ get() { + if (!osEditingOrg.value && prefs.autoBbox) return '__auto__' if (osBboxCustom.value) return '__custom__' const norm = osNormBbox(osForm.bbox) const match = norm && OS_BBOX_FLAT.find((o) => osNormBbox(o.value) === norm) return match ? match.value : '__custom__' }, set(v) { + if (v === '__auto__') { + if (!osEditingOrg.value) prefs.autoBbox = true + osBboxCustom.value = false + return + } + // Any explicit choice leaves auto mode (personal scope only). + if (!osEditingOrg.value) prefs.autoBbox = false if (v === '__custom__') { osBboxCustom.value = true; return } osBboxCustom.value = false osForm.bbox = v }, }) const osBboxManual = computed(() => osBboxPreset.value === '__custom__') +const osBboxIsAuto = computed(() => osBboxPreset.value === '__auto__') // Superadmin edits the global layer in the API panel — read-only in the Web App. const osReadOnly = computed(() => os.isSuperadmin) @@ -1497,7 +1508,7 @@ onBeforeUnmount(() => { - +
+

+ Live map follows drone location → your device location → your Region ({{ regionName }}). +

diff --git a/Web App/web/src/countries.js b/Web App/web/src/countries.js new file mode 100644 index 0000000..73b0214 --- /dev/null +++ b/Web App/web/src/countries.js @@ -0,0 +1,257 @@ +// PilotVault country reference data. +// +// One record per country: ISO 3166-1 alpha-2 `code`, display `name`, `continent` +// (EU | AS | AF | NA | SA | OC), and a `bbox` string "lamin,lomin,lamax,lomax" +// (min lat, min lon, max lat, max lon). Bounding boxes are approximate — good +// enough to pick a default map area and to resolve a point to a country offline, +// without any external geocoding call. +// +// Consumed by: +// - the OpenSky "Default bounding box" picker (European presets), +// - the User Settings "Region" list (all countries), +// - the live-map auto cascade (point -> country -> bbox). + +export const COUNTRIES = [ + // ---- Europe ---- + { code: 'AL', name: 'Albania', continent: 'EU', bbox: '39.6,19.3,42.7,21.1' }, + { code: 'AD', name: 'Andorra', continent: 'EU', bbox: '42.4,1.4,42.7,1.8' }, + { code: 'AT', name: 'Austria', continent: 'EU', bbox: '46.4,9.5,49.0,17.2' }, + { code: 'BY', name: 'Belarus', continent: 'EU', bbox: '51.2,23.2,56.2,32.8' }, + { code: 'BE', name: 'Belgium', continent: 'EU', bbox: '49.5,2.5,51.5,6.4' }, + { code: 'BA', name: 'Bosnia and Herzegovina', continent: 'EU', bbox: '42.6,15.7,45.3,19.6' }, + { code: 'BG', name: 'Bulgaria', continent: 'EU', bbox: '41.2,22.4,44.2,28.6' }, + { code: 'HR', name: 'Croatia', continent: 'EU', bbox: '42.4,13.5,46.6,19.4' }, + { code: 'CY', name: 'Cyprus', continent: 'EU', bbox: '34.6,32.3,35.7,34.6' }, + { code: 'CZ', name: 'Czechia', continent: 'EU', bbox: '48.6,12.1,51.1,18.9' }, + { code: 'DK', name: 'Denmark', continent: 'EU', bbox: '54.6,8.1,57.8,12.7' }, + { code: 'EE', name: 'Estonia', continent: 'EU', bbox: '57.5,21.8,59.7,28.2' }, + { code: 'FI', name: 'Finland', continent: 'EU', bbox: '59.8,20.6,70.1,31.6' }, + { code: 'FR', name: 'France', continent: 'EU', bbox: '41.3,-5.2,51.1,9.6' }, + { code: 'DE', name: 'Germany', continent: 'EU', bbox: '47.2,5.8,55.1,15.1' }, + { code: 'GR', name: 'Greece', continent: 'EU', bbox: '34.8,19.4,41.8,28.3' }, + { code: 'HU', name: 'Hungary', continent: 'EU', bbox: '45.7,16.1,48.6,22.9' }, + { code: 'IS', name: 'Iceland', continent: 'EU', bbox: '63.3,-24.6,66.6,-13.5' }, + { code: 'IE', name: 'Ireland', continent: 'EU', bbox: '51.4,-10.6,55.4,-6.0' }, + { code: 'IT', name: 'Italy', continent: 'EU', bbox: '36.6,6.6,47.1,18.6' }, + { code: 'XK', name: 'Kosovo', continent: 'EU', bbox: '41.8,20.0,43.3,21.8' }, + { code: 'LV', name: 'Latvia', continent: 'EU', bbox: '55.7,20.9,58.1,28.2' }, + { code: 'LI', name: 'Liechtenstein', continent: 'EU', bbox: '47.0,9.4,47.3,9.6' }, + { code: 'LT', name: 'Lithuania', continent: 'EU', bbox: '53.9,20.9,56.5,26.9' }, + { code: 'LU', name: 'Luxembourg', continent: 'EU', bbox: '49.4,5.7,50.2,6.5' }, + { code: 'MT', name: 'Malta', continent: 'EU', bbox: '35.8,14.1,36.1,14.6' }, + { code: 'MD', name: 'Moldova', continent: 'EU', bbox: '45.4,26.6,48.5,30.2' }, + { code: 'MC', name: 'Monaco', continent: 'EU', bbox: '43.72,7.40,43.75,7.44' }, + { code: 'ME', name: 'Montenegro', continent: 'EU', bbox: '41.8,18.4,43.6,20.4' }, + { code: 'NL', name: 'Netherlands', continent: 'EU', bbox: '50.7,3.3,53.7,7.2' }, + { code: 'MK', name: 'North Macedonia', continent: 'EU', bbox: '40.8,20.4,42.4,23.0' }, + { code: 'NO', name: 'Norway', continent: 'EU', bbox: '57.9,4.6,71.2,31.1' }, + { code: 'PL', name: 'Poland', continent: 'EU', bbox: '49.0,14.1,54.9,24.2' }, + { code: 'PT', name: 'Portugal', continent: 'EU', bbox: '36.9,-9.5,42.2,-6.2' }, + { code: 'RO', name: 'Romania', continent: 'EU', bbox: '43.6,20.2,48.3,29.7' }, + { code: 'SM', name: 'San Marino', continent: 'EU', bbox: '43.89,12.40,43.99,12.52' }, + { code: 'RS', name: 'Serbia', continent: 'EU', bbox: '42.2,18.8,46.2,23.0' }, + { code: 'SK', name: 'Slovakia', continent: 'EU', bbox: '47.7,16.8,49.6,22.6' }, + { code: 'SI', name: 'Slovenia', continent: 'EU', bbox: '45.4,13.4,46.9,16.6' }, + { code: 'ES', name: 'Spain', continent: 'EU', bbox: '35.9,-9.4,43.8,3.4' }, + { code: 'SE', name: 'Sweden', continent: 'EU', bbox: '55.3,11.1,69.1,24.2' }, + { code: 'CH', name: 'Switzerland', continent: 'EU', bbox: '45.8,5.9,47.8,10.5' }, + { code: 'UA', name: 'Ukraine', continent: 'EU', bbox: '44.4,22.1,52.4,40.2' }, + { code: 'GB', name: 'United Kingdom', continent: 'EU', bbox: '49.9,-8.7,60.9,1.8' }, + { code: 'VA', name: 'Vatican City', continent: 'EU', bbox: '41.900,12.445,41.908,12.458' }, + { code: 'RU', name: 'Russia', continent: 'EU', bbox: '41.2,19.6,81.9,180' }, + { code: 'TR', name: 'Turkey', continent: 'EU', bbox: '35.8,25.7,42.3,44.8' }, + + // ---- Asia ---- + { code: 'AF', name: 'Afghanistan', continent: 'AS', bbox: '29.4,60.5,38.5,74.9' }, + { code: 'AM', name: 'Armenia', continent: 'AS', bbox: '38.8,43.4,41.3,46.6' }, + { code: 'AZ', name: 'Azerbaijan', continent: 'AS', bbox: '38.4,44.8,41.9,50.4' }, + { code: 'BH', name: 'Bahrain', continent: 'AS', bbox: '25.8,50.4,26.3,50.7' }, + { code: 'BD', name: 'Bangladesh', continent: 'AS', bbox: '20.7,88.0,26.6,92.7' }, + { code: 'BT', name: 'Bhutan', continent: 'AS', bbox: '26.7,88.7,28.3,92.1' }, + { code: 'BN', name: 'Brunei', continent: 'AS', bbox: '4.0,114.0,5.1,115.4' }, + { code: 'KH', name: 'Cambodia', continent: 'AS', bbox: '10.4,102.3,14.7,107.6' }, + { code: 'CN', name: 'China', continent: 'AS', bbox: '18.2,73.5,53.6,134.8' }, + { code: 'GE', name: 'Georgia', continent: 'AS', bbox: '41.0,40.0,43.6,46.7' }, + { code: 'IN', name: 'India', continent: 'AS', bbox: '6.7,68.1,35.5,97.4' }, + { code: 'ID', name: 'Indonesia', continent: 'AS', bbox: '-11.0,95.0,6.1,141.0' }, + { code: 'IR', name: 'Iran', continent: 'AS', bbox: '25.0,44.0,39.8,63.3' }, + { code: 'IQ', name: 'Iraq', continent: 'AS', bbox: '29.1,38.8,37.4,48.6' }, + { code: 'IL', name: 'Israel', continent: 'AS', bbox: '29.5,34.2,33.3,35.9' }, + { code: 'JP', name: 'Japan', continent: 'AS', bbox: '24.0,122.9,45.5,145.8' }, + { code: 'JO', name: 'Jordan', continent: 'AS', bbox: '29.2,34.9,33.4,39.3' }, + { code: 'KZ', name: 'Kazakhstan', continent: 'AS', bbox: '40.6,46.5,55.4,87.3' }, + { code: 'KW', name: 'Kuwait', continent: 'AS', bbox: '28.5,46.5,30.1,48.4' }, + { code: 'KG', name: 'Kyrgyzstan', continent: 'AS', bbox: '39.2,69.3,43.3,80.3' }, + { code: 'LA', name: 'Laos', continent: 'AS', bbox: '13.9,100.1,22.5,107.7' }, + { code: 'LB', name: 'Lebanon', continent: 'AS', bbox: '33.0,35.1,34.7,36.6' }, + { code: 'MY', name: 'Malaysia', continent: 'AS', bbox: '0.9,99.6,7.4,119.3' }, + { code: 'MV', name: 'Maldives', continent: 'AS', bbox: '-0.7,72.7,7.1,73.7' }, + { code: 'MN', name: 'Mongolia', continent: 'AS', bbox: '41.6,87.7,52.1,119.9' }, + { code: 'MM', name: 'Myanmar', continent: 'AS', bbox: '9.8,92.2,28.5,101.2' }, + { code: 'NP', name: 'Nepal', continent: 'AS', bbox: '26.3,80.1,30.4,88.2' }, + { code: 'KP', name: 'North Korea', continent: 'AS', bbox: '37.7,124.2,43.0,130.7' }, + { code: 'OM', name: 'Oman', continent: 'AS', bbox: '16.6,52.0,26.4,59.8' }, + { code: 'PK', name: 'Pakistan', continent: 'AS', bbox: '23.7,60.9,37.1,77.8' }, + { code: 'PH', name: 'Philippines', continent: 'AS', bbox: '4.6,116.9,21.1,126.6' }, + { code: 'QA', name: 'Qatar', continent: 'AS', bbox: '24.5,50.7,26.2,51.6' }, + { code: 'SA', name: 'Saudi Arabia', continent: 'AS', bbox: '16.4,34.6,32.2,55.7' }, + { code: 'SG', name: 'Singapore', continent: 'AS', bbox: '1.2,103.6,1.5,104.1' }, + { code: 'KR', name: 'South Korea', continent: 'AS', bbox: '33.1,125.9,38.6,129.6' }, + { code: 'LK', name: 'Sri Lanka', continent: 'AS', bbox: '5.9,79.7,9.8,81.9' }, + { code: 'SY', name: 'Syria', continent: 'AS', bbox: '32.3,35.7,37.3,42.4' }, + { code: 'TW', name: 'Taiwan', continent: 'AS', bbox: '21.9,120.0,25.3,122.0' }, + { code: 'TJ', name: 'Tajikistan', continent: 'AS', bbox: '36.7,67.4,41.0,75.2' }, + { code: 'TH', name: 'Thailand', continent: 'AS', bbox: '5.6,97.3,20.5,105.6' }, + { code: 'TL', name: 'Timor-Leste', continent: 'AS', bbox: '-9.5,124.0,-8.1,127.3' }, + { code: 'TM', name: 'Turkmenistan', continent: 'AS', bbox: '35.1,52.4,42.8,66.7' }, + { code: 'AE', name: 'United Arab Emirates', continent: 'AS', bbox: '22.6,51.5,26.1,56.4' }, + { code: 'UZ', name: 'Uzbekistan', continent: 'AS', bbox: '37.2,55.9,45.6,73.1' }, + { code: 'VN', name: 'Vietnam', continent: 'AS', bbox: '8.2,102.1,23.4,109.5' }, + { code: 'YE', name: 'Yemen', continent: 'AS', bbox: '12.1,42.5,19.0,54.5' }, + + // ---- Africa ---- + { code: 'DZ', name: 'Algeria', continent: 'AF', bbox: '18.9,-8.7,37.1,12.0' }, + { code: 'AO', name: 'Angola', continent: 'AF', bbox: '-18.0,11.6,-4.4,24.1' }, + { code: 'BJ', name: 'Benin', continent: 'AF', bbox: '6.2,0.8,12.4,3.9' }, + { code: 'BW', name: 'Botswana', continent: 'AF', bbox: '-26.9,20.0,-17.8,29.4' }, + { code: 'BF', name: 'Burkina Faso', continent: 'AF', bbox: '9.4,-5.5,15.1,2.4' }, + { code: 'BI', name: 'Burundi', continent: 'AF', bbox: '-4.5,29.0,-2.3,30.8' }, + { code: 'CV', name: 'Cabo Verde', continent: 'AF', bbox: '14.8,-25.4,17.2,-22.7' }, + { code: 'CM', name: 'Cameroon', continent: 'AF', bbox: '1.7,8.5,13.1,16.2' }, + { code: 'CF', name: 'Central African Republic', continent: 'AF', bbox: '2.2,14.4,11.0,27.5' }, + { code: 'TD', name: 'Chad', continent: 'AF', bbox: '7.4,13.5,23.4,24.0' }, + { code: 'KM', name: 'Comoros', continent: 'AF', bbox: '-12.4,43.2,-11.4,44.5' }, + { code: 'CG', name: 'Congo', continent: 'AF', bbox: '-5.0,11.1,3.7,18.6' }, + { code: 'CD', name: 'DR Congo', continent: 'AF', bbox: '-13.5,12.2,5.4,31.3' }, + { code: 'DJ', name: 'Djibouti', continent: 'AF', bbox: '10.9,41.7,12.7,43.4' }, + { code: 'EG', name: 'Egypt', continent: 'AF', bbox: '22.0,25.0,31.7,36.9' }, + { code: 'GQ', name: 'Equatorial Guinea', continent: 'AF', bbox: '0.9,9.3,3.8,11.4' }, + { code: 'ER', name: 'Eritrea', continent: 'AF', bbox: '12.4,36.4,18.0,43.1' }, + { code: 'SZ', name: 'Eswatini', continent: 'AF', bbox: '-27.3,30.8,-25.7,32.1' }, + { code: 'ET', name: 'Ethiopia', continent: 'AF', bbox: '3.4,33.0,14.9,48.0' }, + { code: 'GA', name: 'Gabon', continent: 'AF', bbox: '-4.0,8.7,2.3,14.5' }, + { code: 'GM', name: 'Gambia', continent: 'AF', bbox: '13.1,-16.8,13.8,-13.8' }, + { code: 'GH', name: 'Ghana', continent: 'AF', bbox: '4.7,-3.3,11.2,1.2' }, + { code: 'GN', name: 'Guinea', continent: 'AF', bbox: '7.2,-15.1,12.7,-7.6' }, + { code: 'GW', name: 'Guinea-Bissau', continent: 'AF', bbox: '10.9,-16.7,12.7,-13.6' }, + { code: 'CI', name: 'Ivory Coast', continent: 'AF', bbox: '4.4,-8.6,10.7,-2.5' }, + { code: 'KE', name: 'Kenya', continent: 'AF', bbox: '-4.7,33.9,5.5,41.9' }, + { code: 'LS', name: 'Lesotho', continent: 'AF', bbox: '-30.7,27.0,-28.6,29.5' }, + { code: 'LR', name: 'Liberia', continent: 'AF', bbox: '4.3,-11.5,8.6,-7.4' }, + { code: 'LY', name: 'Libya', continent: 'AF', bbox: '19.5,9.3,33.2,25.2' }, + { code: 'MG', name: 'Madagascar', continent: 'AF', bbox: '-25.6,43.2,-11.9,50.5' }, + { code: 'MW', name: 'Malawi', continent: 'AF', bbox: '-17.1,32.7,-9.4,35.9' }, + { code: 'ML', name: 'Mali', continent: 'AF', bbox: '10.1,-12.3,25.0,4.3' }, + { code: 'MR', name: 'Mauritania', continent: 'AF', bbox: '14.7,-17.1,27.3,-4.8' }, + { code: 'MU', name: 'Mauritius', continent: 'AF', bbox: '-20.5,57.3,-19.9,57.8' }, + { code: 'MA', name: 'Morocco', continent: 'AF', bbox: '27.7,-13.2,35.9,-1.0' }, + { code: 'MZ', name: 'Mozambique', continent: 'AF', bbox: '-26.9,30.2,-10.5,40.8' }, + { code: 'NA', name: 'Namibia', continent: 'AF', bbox: '-28.9,11.7,-16.9,25.3' }, + { code: 'NE', name: 'Niger', continent: 'AF', bbox: '11.7,0.2,23.5,16.0' }, + { code: 'NG', name: 'Nigeria', continent: 'AF', bbox: '4.3,2.7,13.9,14.7' }, + { code: 'RW', name: 'Rwanda', continent: 'AF', bbox: '-2.8,28.9,-1.1,30.9' }, + { code: 'SN', name: 'Senegal', continent: 'AF', bbox: '12.3,-17.5,16.7,-11.4' }, + { code: 'SL', name: 'Sierra Leone', continent: 'AF', bbox: '6.9,-13.3,10.0,-10.3' }, + { code: 'SO', name: 'Somalia', continent: 'AF', bbox: '-1.7,40.9,12.0,51.4' }, + { code: 'ZA', name: 'South Africa', continent: 'AF', bbox: '-34.8,16.5,-22.1,32.9' }, + { code: 'SS', name: 'South Sudan', continent: 'AF', bbox: '3.5,24.1,12.2,35.9' }, + { code: 'SD', name: 'Sudan', continent: 'AF', bbox: '8.7,21.8,22.2,38.6' }, + { code: 'TZ', name: 'Tanzania', continent: 'AF', bbox: '-11.7,29.3,-1.0,40.4' }, + { code: 'TG', name: 'Togo', continent: 'AF', bbox: '6.1,-0.1,11.1,1.8' }, + { code: 'TN', name: 'Tunisia', continent: 'AF', bbox: '30.2,7.5,37.5,11.6' }, + { code: 'UG', name: 'Uganda', continent: 'AF', bbox: '-1.5,29.6,4.2,35.0' }, + { code: 'ZM', name: 'Zambia', continent: 'AF', bbox: '-18.1,21.9,-8.2,33.7' }, + { code: 'ZW', name: 'Zimbabwe', continent: 'AF', bbox: '-22.4,25.2,-15.6,33.1' }, + + // ---- North America ---- + { code: 'CA', name: 'Canada', continent: 'NA', bbox: '41.7,-141.0,83.1,-52.6' }, + { code: 'US', name: 'United States', continent: 'NA', bbox: '24.4,-125.0,49.4,-66.9' }, + { code: 'MX', name: 'Mexico', continent: 'NA', bbox: '14.5,-118.4,32.7,-86.7' }, + { code: 'GT', name: 'Guatemala', continent: 'NA', bbox: '13.7,-92.2,17.8,-88.2' }, + { code: 'BZ', name: 'Belize', continent: 'NA', bbox: '15.9,-89.2,18.5,-87.8' }, + { code: 'SV', name: 'El Salvador', continent: 'NA', bbox: '13.1,-90.1,14.4,-87.7' }, + { code: 'HN', name: 'Honduras', continent: 'NA', bbox: '12.9,-89.4,16.5,-83.1' }, + { code: 'NI', name: 'Nicaragua', continent: 'NA', bbox: '10.7,-87.7,15.0,-83.1' }, + { code: 'CR', name: 'Costa Rica', continent: 'NA', bbox: '8.0,-85.9,11.2,-82.5' }, + { code: 'PA', name: 'Panama', continent: 'NA', bbox: '7.2,-83.1,9.6,-77.2' }, + { code: 'CU', name: 'Cuba', continent: 'NA', bbox: '19.8,-85.0,23.3,-74.1' }, + { code: 'DO', name: 'Dominican Republic', continent: 'NA', bbox: '17.5,-72.0,19.9,-68.3' }, + { code: 'HT', name: 'Haiti', continent: 'NA', bbox: '18.0,-74.5,20.1,-71.6' }, + { code: 'JM', name: 'Jamaica', continent: 'NA', bbox: '17.7,-78.4,18.5,-76.2' }, + { code: 'BS', name: 'Bahamas', continent: 'NA', bbox: '20.9,-79.0,27.3,-72.7' }, + { code: 'TT', name: 'Trinidad and Tobago', continent: 'NA', bbox: '10.0,-61.9,11.4,-60.5' }, + + // ---- South America ---- + { code: 'AR', name: 'Argentina', continent: 'SA', bbox: '-55.1,-73.6,-21.8,-53.6' }, + { code: 'BO', name: 'Bolivia', continent: 'SA', bbox: '-22.9,-69.6,-9.7,-57.5' }, + { code: 'BR', name: 'Brazil', continent: 'SA', bbox: '-33.8,-74.0,5.3,-34.8' }, + { code: 'CL', name: 'Chile', continent: 'SA', bbox: '-55.9,-75.6,-17.5,-66.4' }, + { code: 'CO', name: 'Colombia', continent: 'SA', bbox: '-4.2,-79.0,12.5,-66.9' }, + { code: 'EC', name: 'Ecuador', continent: 'SA', bbox: '-5.0,-81.1,1.4,-75.2' }, + { code: 'GY', name: 'Guyana', continent: 'SA', bbox: '1.2,-61.4,8.6,-56.5' }, + { code: 'PY', name: 'Paraguay', continent: 'SA', bbox: '-27.6,-62.6,-19.3,-54.3' }, + { code: 'PE', name: 'Peru', continent: 'SA', bbox: '-18.4,-81.3,0.0,-68.7' }, + { code: 'SR', name: 'Suriname', continent: 'SA', bbox: '1.8,-58.1,6.0,-54.0' }, + { code: 'UY', name: 'Uruguay', continent: 'SA', bbox: '-35.0,-58.4,-30.1,-53.1' }, + { code: 'VE', name: 'Venezuela', continent: 'SA', bbox: '0.6,-73.4,12.2,-59.8' }, + + // ---- Oceania ---- + { code: 'AU', name: 'Australia', continent: 'OC', bbox: '-43.6,113.3,-10.7,153.6' }, + { code: 'NZ', name: 'New Zealand', continent: 'OC', bbox: '-47.3,166.4,-34.4,178.6' }, + { code: 'PG', name: 'Papua New Guinea', continent: 'OC', bbox: '-11.7,140.8,-1.3,155.9' }, + { code: 'FJ', name: 'Fiji', continent: 'OC', bbox: '-19.2,177.0,-16.0,180.0' }, +] + +// Quick lookups. +const BY_CODE = new Map(COUNTRIES.map((c) => [c.code, c])) + +// Parse a "lamin,lomin,lamax,lomax" bbox into numbers, or null if malformed. +function parseBbox(s) { + const p = String(s || '').split(',').map((x) => Number(x.trim())) + if (p.length !== 4 || p.some((n) => Number.isNaN(n))) return null + return p // [lamin, lomin, lamax, lomax] +} + +// bbox string for an ISO country code, or '' when unknown. +export function bboxForCountry(code) { + const c = BY_CODE.get(code) + return c ? c.bbox : '' +} + +// Resolve a lat/lon point to the country whose bbox contains it with the +// smallest area — this disambiguates overlapping boxes (e.g. Vatican inside +// Italy) by preferring the tighter, more specific one. Returns the record or null. +export function countryForPoint(lat, lon) { + if (typeof lat !== 'number' || typeof lon !== 'number' || Number.isNaN(lat) || Number.isNaN(lon)) { + return null + } + let best = null + let bestArea = Infinity + for (const c of COUNTRIES) { + const b = parseBbox(c.bbox) + if (!b) continue + const [laMin, loMin, laMax, loMax] = b + if (lat < laMin || lat > laMax || lon < loMin || lon > loMax) continue + const area = Math.abs(laMax - laMin) * Math.abs(loMax - loMin) + if (area < bestArea) { + bestArea = area + best = c + } + } + return best +} + +// European countries as picker options ({ value: bbox, label: name }), A→Z. +export function europeanCountries() { + return COUNTRIES.filter((c) => c.continent === 'EU') + .slice() + .sort((a, b) => a.name.localeCompare(b.name)) + .map((c) => ({ value: c.bbox, label: c.name })) +} + +// All countries as [code, name] pairs for the Region