From a578555b439d8570e07ef8b6adc018996c027756 Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Mon, 13 Jul 2026 22:15:18 +0200 Subject: [PATCH] Show live OpenSky air traffic on the Overview Live map Add GET /api/integrations/opensky/states: resolves the caller's OpenSky cascade and returns trimmed aircraft state vectors (icao24, callsign, country, lat/lng, heading, velocity, altitude, onGround) for their bbox. Reuses the settings gates (global master / org / personal opt-in) and is backed by a new Manager.InvokeWith that runs the plugin's states.bbox action on a transient instance. Proxied through the Web App BFF. DeviceMap now overlays these as rotatable plane markers (accent when airborne, grey on ground) with tooltips; Dashboard polls every 30s while Overview is visible and shows an aircraft count badge. Co-Authored-By: Claude Opus 4.8 --- API Server/internal/api/integrations.go | 172 +++++++++++++++++-- API Server/internal/api/server.go | 1 + API Server/internal/plugins/manager.go | 18 ++ Web App/server/bff.go | 8 + Web App/server/dist/assets/index-By3vEu-b.js | 20 --- Web App/server/dist/assets/index-uk1cBykG.js | 20 +++ Web App/server/dist/index.html | 2 +- Web App/server/main.go | 1 + Web App/web/src/api.js | 14 ++ Web App/web/src/components/Dashboard.vue | 72 ++++++-- Web App/web/src/components/DeviceMap.vue | 95 +++++++++- 11 files changed, 377 insertions(+), 46 deletions(-) delete mode 100644 Web App/server/dist/assets/index-By3vEu-b.js create mode 100644 Web App/server/dist/assets/index-uk1cBykG.js diff --git a/API Server/internal/api/integrations.go b/API Server/internal/api/integrations.go index b8ce1ec..8c90859 100644 --- a/API Server/internal/api/integrations.go +++ b/API Server/internal/api/integrations.go @@ -70,16 +70,16 @@ type osFieldView struct { // admin can manage each independently — their own settings as a user, and the // organization-wide settings that override every user's. type osResolution struct { - eff osConfig // effective (unmasked) — used only server-side (probes) - userOwn osConfig // caller's personal (L3) values (unmasked) - orgOwn osConfig // organization (L2) values (unmasked) - source map[string]string // field -> layer name (global|org|user|unset) - isSuper bool // superadmin: manages the global layer in the panel - canOrg bool // caller may edit the organization layer (org admin) - available bool // global master switch - orgEnabled bool // org master switch (default true; gates the org's users) - allowAnon bool // global anonymous policy - enabled bool // caller's personal enable flag + eff osConfig // effective (unmasked) — used only server-side (probes) + userOwn osConfig // caller's personal (L3) values (unmasked) + orgOwn osConfig // organization (L2) values (unmasked) + source map[string]string // field -> layer name (global|org|user|unset) + isSuper bool // superadmin: manages the global layer in the panel + canOrg bool // caller may edit the organization layer (org admin) + available bool // global master switch + orgEnabled bool // org master switch (default true; gates the org's users) + allowAnon bool // global anonymous policy + enabled bool // caller's personal enable flag } // resolveOpenSky computes the cascade for a caller. userRaw is the caller's @@ -104,10 +104,10 @@ func (s *Server) resolveOpenSky(ctx context.Context, who *callerIdentity, userRa uc := uStored.Config res := osResolution{ - source: map[string]string{}, - userOwn: uc, - orgOwn: oc, - isSuper: who.isSuperadmin(), + source: map[string]string{}, + userOwn: uc, + orgOwn: oc, + isSuper: who.isSuperadmin(), // An org admin may edit the organization layer in addition to their own // personal layer. Requires the service account (org writes go through it); // without it the org layer is invisible to the cascade anyway. @@ -526,6 +526,150 @@ func (s *Server) handleOpenSkyHealth(w http.ResponseWriter, r *http.Request) { writeJSON(w, http.StatusOK, map[string]any{"health": h}) } +// osAircraft is one trimmed aircraft state vector for the Live map. It flattens the +// positional fields the UI actually plots out of OpenSky's raw index-addressed array. +type osAircraft struct { + Icao24 string `json:"icao24"` + Callsign string `json:"callsign"` + Country string `json:"country"` + Lat float64 `json:"lat"` + Lng float64 `json:"lng"` + Heading *float64 `json:"heading,omitempty"` // true track, degrees + Velocity *float64 `json:"velocity,omitempty"` // m/s over ground + Altitude *float64 `json:"altitude,omitempty"` // barometric, metres + OnGround bool `json:"onGround"` +} + +// GET /api/integrations/opensky/states — live aircraft positions for the caller's +// resolved bounding box, for plotting on the Web App Live map. Runs server-side +// against the resolved cascade config (never returns credentials). Gated by the +// same switches as the settings view: global master, org gate, and the caller's +// personal opt-in. When any gate is off it returns 200 with an empty list plus a +// reason, so the map can degrade quietly rather than error. +func (s *Server) handleOpenSkyStates(w http.ResponseWriter, r *http.Request) { + token := r.Header.Get("Authorization") + if token == "" { + writeError(w, http.StatusUnauthorized, "missing token") + return + } + rec, status, err := s.pbAuthRefresh(r.Context(), token) + if err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": "cannot reach PocketBase", "detail": err.Error()}) + return + } + if status != http.StatusOK || rec == nil { + writeError(w, http.StatusUnauthorized, "invalid or expired token") + return + } + who := callerFromRecord(rec) + res := s.resolveOpenSky(r.Context(), who, rec.Record["pluginSettings"]) + + disabled := func(detail string) { + writeJSON(w, http.StatusOK, map[string]any{"states": []osAircraft{}, "unavailable": true, "detail": detail}) + } + switch { + case !res.available: + disabled("OpenSky is disabled by the administrator") + return + case !res.orgEnabled: + disabled("OpenSky is disabled for your organization") + return + case !res.enabled: + disabled("Enable OpenSky in Settings → Integrations to show live air traffic") + return + } + + cfg := map[string]string{ + "clientId": res.eff.ClientID, + "clientSecret": res.eff.ClientSecret, + "plan": res.eff.Plan, + "bbox": res.eff.Bbox, + "allowAnonymous": boolStr(res.allowAnon), + } + raw, err := s.plugins.InvokeWith(r.Context(), openSkyPlugin, cfg, "states.bbox", nil) + if err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": err.Error()}) + return + } + + // OpenSky /states/all shape: {time, states: [[icao24, callsign, country, + // time_position, last_contact, lon, lat, baro_altitude, on_ground, velocity, + // true_track, ...], ...]}. states may be null when nothing is in the box. + var osResp struct { + Time int64 `json:"time"` + States [][]json.RawMessage `json:"states"` + } + if err := json.Unmarshal(raw, &osResp); err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": "unexpected OpenSky response"}) + return + } + + aircraft := make([]osAircraft, 0, len(osResp.States)) + for _, st := range osResp.States { + lng, okLng := rawFloat(st, 5) + lat, okLat := rawFloat(st, 6) + if !okLat || !okLng { + continue // no position fix — nothing to plot + } + a := osAircraft{ + Icao24: strings.TrimSpace(rawString(st, 0)), + Callsign: strings.TrimSpace(rawString(st, 1)), + Country: strings.TrimSpace(rawString(st, 2)), + Lat: lat, + Lng: lng, + OnGround: rawBool(st, 8), + } + if v, ok := rawFloat(st, 7); ok { + a.Altitude = &v + } + if v, ok := rawFloat(st, 9); ok { + a.Velocity = &v + } + if v, ok := rawFloat(st, 10); ok { + a.Heading = &v + } + aircraft = append(aircraft, a) + } + writeJSON(w, http.StatusOK, map[string]any{"time": osResp.Time, "states": aircraft}) +} + +// rawFloat reads element i of an OpenSky state array as a float, reporting ok=false +// for a missing index or a JSON null (OpenSky uses null for unknown fields). +func rawFloat(st []json.RawMessage, i int) (float64, bool) { + if i >= len(st) { + return 0, false + } + var f float64 + if err := json.Unmarshal(st[i], &f); err != nil { + return 0, false + } + return f, true +} + +// rawString reads element i as a string ("" for missing/null/non-string). +func rawString(st []json.RawMessage, i int) string { + if i >= len(st) { + return "" + } + var s string + if err := json.Unmarshal(st[i], &s); err != nil { + return "" + } + return s +} + +// rawBool reads element i as a bool (false for missing/null/non-bool). +func rawBool(st []json.RawMessage, i int) bool { + if i >= len(st) { + return false + } + var b bool + if err := json.Unmarshal(st[i], &b); err != nil { + return false + } + return b +} + func boolStr(b bool) string { if b { return "true" diff --git a/API Server/internal/api/server.go b/API Server/internal/api/server.go index 46e0eb0..5621c1f 100644 --- a/API Server/internal/api/server.go +++ b/API Server/internal/api/server.go @@ -102,6 +102,7 @@ func (s *Server) Handler() http.Handler { mux.HandleFunc("GET /api/integrations/opensky", s.handleGetOpenSky) mux.HandleFunc("PUT /api/integrations/opensky", s.handlePutOpenSky) mux.HandleFunc("POST /api/integrations/opensky/health", s.handleOpenSkyHealth) + mux.HandleFunc("GET /api/integrations/opensky/states", s.handleOpenSkyStates) mux.HandleFunc("GET /api/integrations/filetransfer", s.handleGetFileTransfer) mux.HandleFunc("PUT /api/integrations/filetransfer", s.handlePutFileTransfer) mux.HandleFunc("POST /api/integrations/filetransfer/health", s.handleFileTransferHealth) diff --git a/API Server/internal/plugins/manager.go b/API Server/internal/plugins/manager.go index 00167a0..557659a 100644 --- a/API Server/internal/plugins/manager.go +++ b/API Server/internal/plugins/manager.go @@ -339,6 +339,24 @@ func (m *Manager) HealthCheckWith(ctx context.Context, name string, cfg map[stri return p.HealthCheck(ctx), nil } +// InvokeWith calls a plugin action using a caller-supplied config instead of the +// stored record. Like HealthCheckWith it always builds a transient instance, so it +// never disturbs the live instance. Used by per-user integration flows that resolve +// their own effective config (e.g. the OpenSky live-map states query). +func (m *Manager) InvokeWith(ctx context.Context, name string, cfg map[string]string, action string, payload json.RawMessage) (json.RawMessage, error) { + m.mu.Lock() + rec := m.records[name] + p := construct(name, m.factories[name], rec) + m.mu.Unlock() + + if p == nil { + return nil, errUnknown + } + _ = p.Init(ctx, cfg) + defer func() { _ = p.Shutdown(context.Background()) }() + return p.Invoke(ctx, action, payload) +} + // RawConfig returns a plugin's stored config UNMASKED, together with its enabled // flag and whether the plugin is known. Server-side callers use it to resolve a // layered effective config (which needs the real secret values); it must never be diff --git a/Web App/server/bff.go b/Web App/server/bff.go index 5ea94c8..b02ca94 100644 --- a/Web App/server/bff.go +++ b/Web App/server/bff.go @@ -234,6 +234,14 @@ func (a *App) handleOpenSkyHealth(w http.ResponseWriter, r *http.Request) { a.doRelay(w, req) } +// 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) + req.Header.Set("Authorization", tokenOf(r)) + a.doRelay(w, req) +} + // GET /bff/integrations/filetransfer → API Server /api/integrations/filetransfer func (a *App) handleGetFileTransfer(w http.ResponseWriter, r *http.Request) { req, _ := http.NewRequest(http.MethodGet, a.apiBaseFor(r)+"/api/integrations/filetransfer", nil) diff --git a/Web App/server/dist/assets/index-By3vEu-b.js b/Web App/server/dist/assets/index-By3vEu-b.js deleted file mode 100644 index 4c620d1..0000000 --- a/Web App/server/dist/assets/index-By3vEu-b.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 p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&l(p)}).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 Pr(t){const i=Object.create(null);for(const o of t.split(","))i[o]=1;return o=>o in i}const ht={},bs=[],Un=()=>{},mu=()=>!1,pa=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ma=t=>t.startsWith("onUpdate:"),zt=Object.assign,Cr=(t,i)=>{const o=t.indexOf(i);o>-1&&t.splice(o,1)},cd=Object.prototype.hasOwnProperty,at=(t,i)=>cd.call(t,i),Ae=Array.isArray,xs=t=>vo(t)==="[object Map]",Ms=t=>vo(t)==="[object Set]",hl=t=>vo(t)==="[object Date]",Ze=t=>typeof t=="function",_t=t=>typeof t=="string",Ln=t=>typeof t=="symbol",rt=t=>t!==null&&typeof t=="object",gu=t=>(rt(t)||Ze(t))&&Ze(t.then)&&Ze(t.catch),vu=Object.prototype.toString,vo=t=>vu.call(t),dd=t=>vo(t).slice(8,-1),_u=t=>vo(t)==="[object Object]",Lr=t=>_t(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,to=Pr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ga=t=>{const i=Object.create(null);return(o=>i[o]||(i[o]=t(o)))},fd=/-\w/g,Pn=ga(t=>t.replace(fd,i=>i.slice(1).toUpperCase())),hd=/\B([A-Z])/g,Mi=ga(t=>t.replace(hd,"-$1").toLowerCase()),yu=ga(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ya=ga(t=>t?`on${yu(t)}`:""),Vn=(t,i)=>!Object.is(t,i),ea=(t,...i)=>{for(let o=0;o{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:o})},va=t=>{const i=parseFloat(t);return isNaN(i)?t:i},pd=t=>{const i=_t(t)?Number(t):NaN;return isNaN(i)?t:i};let pl;const _a=()=>pl||(pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ps(t){if(Ae(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 Me(t){let i="";if(_t(t))i=t;else if(Ae(t))for(let o=0;oPi(o,i))}const wu=t=>!!(t&&t.__v_isRef===!0),S=t=>_t(t)?t:t==null?"":Ae(t)||rt(t)&&(t.toString===vu||!Ze(t.toString))?wu(t)?S(t.value):JSON.stringify(t,ku,2):String(t),ku=(t,i)=>wu(i)?ku(t,i.value):xs(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[l,u],d)=>(o[Ja(l,d)+" =>"]=u,o),{})}:Ms(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>Ja(o))}:Ln(i)?Ja(i):rt(i)&&!Ae(i)&&!_u(i)?String(i):i,Ja=(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 It;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&&It&&(It.active?(this.parent=It,this.index=(It.scopes||(It.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(It===this)It=this.prevScope;else{let i=It;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(io){let i=io;for(io=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let t;for(;no;){let i=no;for(no=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 Cu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function Lu(t){let i,o=t.depsTail,l=o;for(;l;){const u=l.prevDep;l.version===-1?(l===o&&(o=u),zr(l),Sd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=o}function ur(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Mu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Mu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===lo)||(t.globalVersion=lo,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!ur(t))))return;t.flags|=2;const i=t.dep,o=mt,l=Cn;mt=t,Cn=!0;try{Cu(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{mt=o,Cn=l,Lu(t),t.flags&=-3}}function zr(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)zr(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 Eu=[];function Zn(){Eu.push(Cn),Cn=!1}function Hn(){const t=Eu.pop();Cn=t===void 0?!0:t}function ml(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const o=mt;mt=void 0;try{i()}finally{mt=o}}}let lo=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 Ar{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(!mt||!Cn||mt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==mt)o=this.activeLink=new Td(mt,this),mt.deps?(o.prevDep=mt.depsTail,mt.depsTail.nextDep=o,mt.depsTail=o):mt.deps=mt.depsTail=o,Ou(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=mt.depsTail,o.nextDep=void 0,mt.depsTail.nextDep=o,mt.depsTail=o,mt.deps===o&&(mt.deps=l)}return o}trigger(i){this.version++,lo++,this.notify(i)}notify(i){Er();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Or()}}}function Ou(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)Ou(l)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const cr=new WeakMap,Yi=Symbol(""),dr=Symbol(""),uo=Symbol("");function Rt(t,i,o){if(Cn&&mt){let l=cr.get(t);l||cr.set(t,l=new Map);let u=l.get(o);u||(l.set(o,u=new Ar),u.map=l,u.key=o),u.track()}}function oi(t,i,o,l,u,d){const p=cr.get(t);if(!p){lo++;return}const _=b=>{b&&b.trigger()};if(Er(),i==="clear")p.forEach(_);else{const b=Ae(t),C=b&&Lr(o);if(b&&o==="length"){const k=Number(l);p.forEach((O,R)=>{(R==="length"||R===uo||!Ln(R)&&R>=k)&&_(O)})}else switch((o!==void 0||p.has(void 0))&&_(p.get(o)),C&&_(p.get(uo)),i){case"add":b?C&&_(p.get("length")):(_(p.get(Yi)),xs(t)&&_(p.get(dr)));break;case"delete":b||(_(p.get(Yi)),xs(t)&&_(p.get(dr)));break;case"set":xs(t)&&_(p.get(Yi));break}}Or()}function _s(t){const i=tt(t);return i===t?i:(Rt(i,"iterate",uo),mn(t)?i:i.map(Mn))}function ya(t){return Rt(t=tt(t),"iterate",uo),t}function Fn(t,i){return li(t)?Cs(Ji(t)?Mn(i):i):Mn(i)}const Pd={__proto__:null,[Symbol.iterator](){return Qa(this,Symbol.iterator,t=>Fn(this,t))},concat(...t){return _s(this).concat(...t.map(i=>Ae(i)?_s(i):i))},entries(){return Qa(this,"entries",t=>(t[1]=Fn(this,t[1]),t))},every(t,i){return ti(this,"every",t,i,void 0,arguments)},filter(t,i){return ti(this,"filter",t,i,o=>o.map(l=>Fn(this,l)),arguments)},find(t,i){return ti(this,"find",t,i,o=>Fn(this,o),arguments)},findIndex(t,i){return ti(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return ti(this,"findLast",t,i,o=>Fn(this,o),arguments)},findLastIndex(t,i){return ti(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return ti(this,"forEach",t,i,void 0,arguments)},includes(...t){return er(this,"includes",t)},indexOf(...t){return er(this,"indexOf",t)},join(t){return _s(this).join(t)},lastIndexOf(...t){return er(this,"lastIndexOf",t)},map(t,i){return ti(this,"map",t,i,void 0,arguments)},pop(){return Ks(this,"pop")},push(...t){return Ks(this,"push",t)},reduce(t,...i){return gl(this,"reduce",t,i)},reduceRight(t,...i){return gl(this,"reduceRight",t,i)},shift(){return Ks(this,"shift")},some(t,i){return ti(this,"some",t,i,void 0,arguments)},splice(...t){return Ks(this,"splice",t)},toReversed(){return _s(this).toReversed()},toSorted(t){return _s(this).toSorted(t)},toSpliced(...t){return _s(this).toSpliced(...t)},unshift(...t){return Ks(this,"unshift",t)},values(){return Qa(this,"values",t=>Fn(this,t))}};function Qa(t,i,o){const l=ya(t),u=l[i]();return l!==t&&!mn(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 ti(t,i,o,l,u,d){const p=ya(t),_=p!==t&&!mn(t),b=p[i];if(b!==Cd[i]){const O=b.apply(t,d);return _?Mn(O):O}let C=o;p!==t&&(_?C=function(O,R){return o.call(this,Fn(t,O),R,t)}:o.length>2&&(C=function(O,R){return o.call(this,O,R,t)}));const k=b.call(p,C,l);return _&&u?u(k):k}function gl(t,i,o,l){const u=ya(t),d=u!==t&&!mn(t);let p=o,_=!1;u!==t&&(d?(_=l.length===0,p=function(C,k,O){return _&&(_=!1,C=Fn(t,C)),o.call(this,C,Fn(t,k),O,t)}):o.length>3&&(p=function(C,k,O){return o.call(this,C,k,O,t)}));const b=u[i](p,...l);return _?Fn(t,b):b}function er(t,i,o){const l=tt(t);Rt(l,"iterate",uo);const u=l[i](...o);return(u===-1||u===!1)&&Dr(o[0])?(o[0]=tt(o[0]),l[i](...o)):u}function Ks(t,i,o=[]){Zn(),Er();const l=tt(t)[i].apply(t,o);return Or(),Hn(),l}const Ld=Pr("__proto__,__v_isRef,__isVue"),zu=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=tt(this);return Rt(i,"has",t),i.hasOwnProperty(t)}class Au{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:Nu:d?Du:Iu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const p=Ae(i);if(!u){let b;if(p&&(b=Pd[o]))return b;if(o==="hasOwnProperty")return Md}const _=Reflect.get(i,o,Vt(i)?i:l);if((Ln(o)?zu.has(o):Ld(o))||(u||Rt(i,"get",o),d))return _;if(Vt(_)){const b=p&&Lr(o)?_:_.value;return u&&rt(b)?hr(b):b}return rt(_)?u?hr(_):xt(_):_}}class $u extends Au{constructor(i=!1){super(!1,i)}set(i,o,l,u){let d=i[o];const p=Ae(i)&&Lr(o);if(!this._isShallow){const C=li(d);if(!mn(l)&&!li(l)&&(d=tt(d),l=tt(l)),!p&&Vt(d)&&!Vt(l))return C||(d.value=l),!0}const _=p?Number(o)t,Ko=t=>Reflect.getPrototypeOf(t);function $d(t,i,o){return function(...l){const u=this.__v_raw,d=tt(u),p=xs(d),_=t==="entries"||t===Symbol.iterator&&p,b=t==="keys"&&p,C=u[t](...l),k=o?fr:i?Cs:Mn;return!i&&Rt(d,"iterate",b?dr:Yi),zt(Object.create(C),{next(){const{value:O,done:R}=C.next();return R?{value:O,done:R}:{value:_?[k(O[0]),k(O[1])]:k(O),done:R}}})}}function Go(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,p=tt(d),_=tt(u);t||(Vn(u,_)&&Rt(p,"get",u),Rt(p,"get",_));const{has:b}=Ko(p),C=i?fr:t?Cs:Mn;if(b.call(p,u))return C(d.get(u));if(b.call(p,_))return C(d.get(_));d!==p&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Rt(tt(u),"iterate",Yi),u.size},has(u){const d=this.__v_raw,p=tt(d),_=tt(u);return t||(Vn(u,_)&&Rt(p,"has",u),Rt(p,"has",_)),u===_?d.has(u):d.has(u)||d.has(_)},forEach(u,d){const p=this,_=p.__v_raw,b=tt(_),C=i?fr:t?Cs:Mn;return!t&&Rt(b,"iterate",Yi),_.forEach((k,O)=>u.call(d,C(k),C(O),p))}};return zt(o,t?{add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear")}:{add(u){const d=tt(this),p=Ko(d),_=tt(u),b=!i&&!mn(u)&&!li(u)?_:u;return p.has.call(d,b)||Vn(u,b)&&p.has.call(d,u)||Vn(_,b)&&p.has.call(d,_)||(d.add(b),oi(d,"add",b,b)),this},set(u,d){!i&&!mn(d)&&!li(d)&&(d=tt(d));const p=tt(this),{has:_,get:b}=Ko(p);let C=_.call(p,u);C||(u=tt(u),C=_.call(p,u));const k=b.call(p,u);return p.set(u,d),C?Vn(d,k)&&oi(p,"set",u,d):oi(p,"add",u,d),this},delete(u){const d=tt(this),{has:p,get:_}=Ko(d);let b=p.call(d,u);b||(u=tt(u),b=p.call(d,u)),_&&_.call(d,u);const C=d.delete(u);return b&&oi(d,"delete",u,void 0),C},clear(){const u=tt(this),d=u.size!==0,p=u.clear();return d&&oi(u,"clear",void 0,void 0),p}}),["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=$d(u,t,i)}),o}function $r(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(at(o,u)&&u in l?o:l,u,d)}const Dd={get:$r(!1,!1)},Nd={get:$r(!1,!0)},Rd={get:$r(!0,!1)};const Iu=new WeakMap,Du=new WeakMap,Nu=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 xt(t){return li(t)?t:Ir(t,!1,Od,Dd,Iu)}function Vd(t){return Ir(t,!1,Ad,Nd,Du)}function hr(t){return Ir(t,!0,zd,Rd,Nu)}function Ir(t,i,o,l,u){if(!rt(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 p=Bd(dd(t));if(p===0)return t;const _=new Proxy(t,p===2?l:o);return u.set(t,_),_}function Ji(t){return li(t)?Ji(t.__v_raw):!!(t&&t.__v_isReactive)}function li(t){return!!(t&&t.__v_isReadonly)}function mn(t){return!!(t&&t.__v_isShallow)}function Dr(t){return t?!!t.__v_raw:!1}function tt(t){const i=t&&t.__v_raw;return i?tt(i):t}function Ud(t){return!at(t,"__v_skip")&&Object.isExtensible(t)&&bu(t,"__v_skip",!0),t}const Mn=t=>rt(t)?xt(t):t,Cs=t=>rt(t)?hr(t):t;function Vt(t){return t?t.__v_isRef===!0:!1}function H(t){return Zd(t,!1)}function Zd(t,i){return Vt(t)?t:new Hd(t,i)}class Hd{constructor(i,o){this.dep=new Ar,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?i:tt(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||mn(i)||li(i);i=l?i:tt(i),Vn(i,o)&&(this._rawValue=i,this._value=l?i:Mn(i),this.dep.trigger())}}function Re(t){return Vt(t)?t.value:t}const jd={get:(t,i,o)=>i==="__v_raw"?t:Re(Reflect.get(t,i,o)),set:(t,i,o,l)=>{const u=t[i];return Vt(u)&&!Vt(o)?(u.value=o,!0):Reflect.set(t,i,o,l)}};function Ru(t){return Ji(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 Ar(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=lo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&mt!==this)return Pu(this,!0),!0}get value(){const i=this.dep.track();return Mu(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 Ze(t)?l=t:(l=t.get,u=t.set),new Wd(l,u,o)}const qo={},na=new WeakMap;let Ki;function Gd(t,i=!1,o=Ki){if(o){let l=na.get(o);l||na.set(o,l=[]),l.push(t)}}function qd(t,i,o=ht){const{immediate:l,deep:u,once:d,scheduler:p,augmentJob:_,call:b}=o,C=ie=>u?ie:mn(ie)||u===!1||u===0?ai(ie,1):ai(ie);let k,O,R,F,X=!1,q=!1;if(Vt(t)?(O=()=>t.value,X=mn(t)):Ji(t)?(O=()=>C(t),X=!0):Ae(t)?(q=!0,X=t.some(ie=>Ji(ie)||mn(ie)),O=()=>t.map(ie=>{if(Vt(ie))return ie.value;if(Ji(ie))return C(ie);if(Ze(ie))return b?b(ie,2):ie()})):Ze(t)?i?O=b?()=>b(t,2):t:O=()=>{if(R){Zn();try{R()}finally{Hn()}}const ie=Ki;Ki=k;try{return b?b(t,3,[F]):t(F)}finally{Ki=ie}}:O=Un,i&&u){const ie=O,me=u===!0?1/0:u;O=()=>ai(ie(),me)}const ge=kd(),we=()=>{k.stop(),ge&&ge.active&&Cr(ge.effects,k)};if(d&&i){const ie=i;i=(...me)=>{const Le=ie(...me);return we(),Le}}let K=q?new Array(t.length).fill(qo):qo;const fe=ie=>{if(!(!(k.flags&1)||!k.dirty&&!ie))if(i){const me=k.run();if(ie||u||X||(q?me.some((Le,Ee)=>Vn(Le,K[Ee])):Vn(me,K))){R&&R();const Le=Ki;Ki=k;try{const Ee=[me,K===qo?void 0:q&&K[0]===qo?[]:K,F];K=me,b?b(i,3,Ee):i(...Ee)}finally{Ki=Le}}}else k.run()};return _&&_(fe),k=new Su(O),k.scheduler=p?()=>p(fe,!1):fe,F=ie=>Gd(ie,!1,k),R=k.onStop=()=>{const ie=na.get(k);if(ie){if(b)b(ie,4);else for(const me of ie)me();na.delete(k)}},i?l?fe(!0):K=k.run():p?p(fe.bind(null,!0),!0):k.run(),we.pause=k.pause.bind(k),we.resume=k.resume.bind(k),we.stop=we,we}function ai(t,i=1/0,o){if(i<=0||!rt(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=i))return t;if(o.set(t,i),i--,Vt(t))ai(t.value,i,o);else if(Ae(t))for(let l=0;l{ai(l,i,o)});else if(_u(t)){for(const l in t)ai(t[l],i,o);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&ai(t[l],i,o)}return t}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function _o(t,i,o,l){try{return l?t(...l):t()}catch(u){ba(u,i,o)}}function vn(t,i,o,l){if(Ze(t)){const u=_o(t,i,o,l);return u&&gu(u)&&u.catch(d=>{ba(d,i,o)}),u}if(Ae(t)){const u=[];for(let d=0;d>>1,u=qt[l],d=co(u);d=co(o)?qt.push(t):qt.splice(Jd(i),0,t),t.flags|=1,Vu()}}function Vu(){ia||(ia=Fu.then(Zu))}function Xd(t){Ae(t)?ws.push(...t):Ti&&t.id===-1?Ti.splice(ys+1,0,t):t.flags&1||(ws.push(t),t.flags|=1),Vu()}function vl(t,i,o=Rn+1){for(;oco(o)-co(l));if(ws.length=0,Ti){Ti.push(...i);return}for(Ti=i,ys=0;yst.id==null?t.flags&2?-1:1/0:t.id;function Zu(t){try{for(Rn=0;Rn{l._d&&ra(-1);const d=sa(i);let p;try{p=t(...u)}finally{sa(d),l._d&&ra(1)}return p};return l._n=!0,l._c=!0,l._d=!0,l}function oe(t,i){if(Bt===null)return t;const o=Ta(Bt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return o&&Ze(i)?i.call(l&&l.proxy):i}}const Qd=Symbol.for("v-scx"),ef=()=>so(Qd);function en(t,i,o){return Wu(t,i,o)}function Wu(t,i,o=ht){const{immediate:l,deep:u,flush:d,once:p}=o,_=zt({},o),b=i&&l||!i&&d!=="post";let C;if(mo){if(d==="sync"){const F=ef();C=F.__watcherHandles||(F.__watcherHandles=[])}else if(!b){const F=()=>{};return F.stop=Un,F.resume=Un,F.pause=Un,F}}const k=Yt;_.call=(F,X,q)=>vn(F,k,X,q);let O=!1;d==="post"?_.scheduler=F=>{Gt(F,k&&k.suspense)}:d!=="sync"&&(O=!0,_.scheduler=(F,X)=>{X?F():Nr(F)}),_.augmentJob=F=>{i&&(F.flags|=4),O&&(F.flags|=2,k&&(F.id=k.uid,F.i=k))};const R=qd(t,i,_);return mo&&(C?C.push(R):b&&R()),R}function tf(t,i,o){const l=this.proxy,u=_t(t)?t.includes(".")?Ku(l,t):()=>l[t]:t.bind(l,l);let d;Ze(i)?d=i:(d=i.handler,o=i);const p=bo(this),_=Wu(u,d.bind(l),o);return p(),_}function Ku(t,i){const o=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,Gi=t=>t&&(t.disabled||t.disabled===""),nf=t=>t&&(t.defer||t.defer===""),_l=t=>typeof SVGElement<"u"&&t instanceof SVGElement,yl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,pr=(t,i)=>{const o=t&&t.to;return _t(o)?i?i(o):null:o},sf={name:"Teleport",__isTeleport:!0,process(t,i,o,l,u,d,p,_,b,C){const{mc:k,pc:O,pbc:R,o:{insert:F,querySelector:X,createText:q,createComment:ge,parentNode:we}}=C,K=Gi(i.props);let{dynamicChildren:fe}=i;const ie=(Ee,Ve,pe)=>{Ee.shapeFlag&16&&k(Ee.children,Ve,pe,u,d,p,_,b)},me=(Ee=i)=>{const Ve=Gi(Ee.props),pe=Ee.target=pr(Ee.props,X),$e=mr(pe,Ee,q,F);pe&&(p!=="svg"&&_l(pe)?p="svg":p!=="mathml"&&yl(pe)&&(p="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(pe),Ve||(ie(Ee,pe,$e),Js(Ee,!1)))},Le=Ee=>{const Ve=()=>{if(Si.get(Ee)===Ve){if(Si.delete(Ee),Gi(Ee.props)){const pe=we(Ee.el)||o;ie(Ee,pe,Ee.anchor),Js(Ee,!0)}me(Ee)}};Si.set(Ee,Ve),Gt(Ve,d)};if(t==null){const Ee=i.el=q(""),Ve=i.anchor=q("");if(F(Ee,o,l),F(Ve,o,l),nf(i.props)||d&&d.pendingBranch){Le(i);return}K&&(ie(i,o,Ve),Js(i,!0)),me()}else{i.el=t.el;const Ee=i.anchor=t.anchor,Ve=Si.get(t);if(Ve){Ve.flags|=8,Si.delete(t),Le(i);return}i.targetStart=t.targetStart;const pe=i.target=t.target,$e=i.targetAnchor=t.targetAnchor,Oe=Gi(t.props),Q=Oe?o:pe,ue=Oe?Ee:$e;if(p==="svg"||_l(pe)?p="svg":(p==="mathml"||yl(pe))&&(p="mathml"),fe?(R(t.dynamicChildren,fe,Q,u,d,p,_),Br(t,i,!0)):b||O(t,i,Q,ue,u,d,p,_,!1),K)Oe?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):Yo(i,o,Ee,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const ye=pr(i.props,X);ye&&(i.target=ye,Yo(i,ye,null,C,0))}else Oe&&Yo(i,pe,$e,C,1);Js(i,K)}},remove(t,i,o,{um:l,o:{remove:u}},d){const{shapeFlag:p,children:_,anchor:b,targetStart:C,targetAnchor:k,target:O,props:R}=t,F=Gi(R),X=d||!F,q=Si.get(t);if(q&&(q.flags|=8,Si.delete(t)),O&&(u(C),u(k)),d&&u(b),!q&&(F||O)&&p&16)for(let ge=0;ge<_.length;ge++){const we=_[ge];l(we,i,o,X,!!we.dynamicChildren)}},move:Yo,hydrate:of};function Yo(t,i,o,{o:{insert:l},m:u},d=2){d===0&&l(t.targetAnchor,i,o);const{el:p,anchor:_,shapeFlag:b,children:C,props:k}=t,O=d===2;if(O&&l(p,i,o),!Si.has(t)&&(!O||Gi(k))&&b&16)for(let R=0;R{t.isMounted=!0}),yo(()=>{t.isUnmounting=!0}),t}const fn=[Function,Array],Yu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fn,onEnter:fn,onAfterEnter:fn,onEnterCancelled:fn,onBeforeLeave:fn,onLeave:fn,onAfterLeave:fn,onLeaveCancelled:fn,onBeforeAppear:fn,onAppear:fn,onAfterAppear:fn,onAppearCancelled:fn},Ju=t=>{const i=t.subTree;return i.component?Ju(i.component):i},lf={name:"BaseTransition",props:Yu,setup(t,{slots:i}){const o=kc(),l=rf();return()=>{const u=i.default&&ec(i.default(),!0),d=u&&u.length?Xu(u):o.subTree?D():void 0;if(!d)return;const p=tt(t),{mode:_}=p;if(l.isLeaving)return tr(d);const b=bl(d);if(!b)return tr(d);let C=gr(b,p,l,o,O=>C=O);b.type!==Ft&&fo(b,C);let k=o.subTree&&bl(o.subTree);if(k&&k.type!==Ft&&!qi(k,b)&&Ju(o).type!==Ft){let O=gr(k,p,l,o);if(fo(k,O),_==="out-in"&&b.type!==Ft)return l.isLeaving=!0,O.afterLeave=()=>{l.isLeaving=!1,o.job.flags&8||o.update(),delete O.afterLeave,k=void 0},tr(d);_==="in-out"&&b.type!==Ft?O.delayLeave=(R,F,X)=>{const q=Qu(l,k);q[String(k.key)]=k,R[pn]=()=>{F(),R[pn]=void 0,delete C.delayedLeave,k=void 0},C.delayedLeave=()=>{X(),delete C.delayedLeave,k=void 0}}:k=void 0}else k&&(k=void 0);return d}}};function Xu(t){let i=t[0];if(t.length>1){for(const o of t)if(o.type!==Ft){i=o;break}}return i}const uf=lf;function Qu(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 gr(t,i,o,l,u){const{appear:d,mode:p,persisted:_=!1,onBeforeEnter:b,onEnter:C,onAfterEnter:k,onEnterCancelled:O,onBeforeLeave:R,onLeave:F,onAfterLeave:X,onLeaveCancelled:q,onBeforeAppear:ge,onAppear:we,onAfterAppear:K,onAppearCancelled:fe}=i,ie=String(t.key),me=Qu(o,t),Le=(pe,$e)=>{pe&&vn(pe,l,9,$e)},Ee=(pe,$e)=>{const Oe=$e[1];Le(pe,$e),Ae(pe)?pe.every(Q=>Q.length<=1)&&Oe():pe.length<=1&&Oe()},Ve={mode:p,persisted:_,beforeEnter(pe){let $e=b;if(!o.isMounted)if(d)$e=ge||b;else return;pe[pn]&&pe[pn](!0);const Oe=me[ie];Oe&&qi(t,Oe)&&Oe.el[pn]&&Oe.el[pn](),Le($e,[pe])},enter(pe){if(me[ie]===t)return;let $e=C,Oe=k,Q=O;if(!o.isMounted)if(d)$e=we||C,Oe=K||k,Q=fe||O;else return;let ue=!1;pe[Gs]=ze=>{ue||(ue=!0,ze?Le(Q,[pe]):Le(Oe,[pe]),Ve.delayedLeave&&Ve.delayedLeave(),pe[Gs]=void 0)};const ye=pe[Gs].bind(null,!1);$e?Ee($e,[pe,ye]):ye()},leave(pe,$e){const Oe=String(t.key);if(pe[Gs]&&pe[Gs](!0),o.isUnmounting)return $e();Le(R,[pe]);let Q=!1;pe[pn]=ye=>{Q||(Q=!0,$e(),ye?Le(q,[pe]):Le(X,[pe]),pe[pn]=void 0,me[Oe]===t&&delete me[Oe])};const ue=pe[pn].bind(null,!1);me[Oe]=t,F?Ee(F,[pe,ue]):ue()},clone(pe){const $e=gr(pe,i,o,l,u);return u&&u($e),$e}};return Ve}function tr(t){if(xa(t))return t=Ci(t),t.children=null,t}function bl(t){if(!xa(t))return qu(t.type)&&t.children?Xu(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&&Ze(o.default))return o.default()}}function fo(t,i){t.shapeFlag&6&&t.component?(t.transition=i,fo(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 ec(t,i=!1,o){let l=[],u=0;for(let d=0;d1)for(let d=0;doo(q,i&&(Ae(i)?i[ge]:i),o,l,u));return}if(ks(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&oo(t,i,o,l.component.subTree);return}const d=l.shapeFlag&4?Ta(l.component):l.el,p=u?null:d,{i:_,r:b}=t,C=i&&i.r,k=_.refs===ht?_.refs={}:_.refs,O=_.setupState,R=tt(O),F=O===ht?mu:q=>xl(k,q)?!1:at(R,q),X=(q,ge)=>!(ge&&xl(k,ge));if(C!=null&&C!==b){if(wl(i),_t(C))k[C]=null,F(C)&&(O[C]=null);else if(Vt(C)){const q=i;X(C,q.k)&&(C.value=null),q.k&&(k[q.k]=null)}}if(Ze(b)){Zn();try{_o(b,_,12,[p,k])}finally{Hn()}}else{const q=_t(b),ge=Vt(b);if(q||ge){const we=()=>{if(t.f){const K=q?F(b)?O[b]:k[b]:X()||!t.k?b.value:k[t.k];if(u)Ae(K)&&Cr(K,d);else if(Ae(K))K.includes(d)||K.push(d);else if(q)k[b]=[d],F(b)&&(O[b]=k[b]);else{const fe=[d];X(b,t.k)&&(b.value=fe),t.k&&(k[t.k]=fe)}}else q?(k[b]=p,F(b)&&(O[b]=p)):ge&&(X(b,t.k)&&(b.value=p),t.k&&(k[t.k]=p))};if(p){const K=()=>{we(),oa.delete(t)};K.id=-1,oa.set(t,K),Gt(K,o)}else wl(t),we()}}}function wl(t){const i=oa.get(t);i&&(i.flags|=8,oa.delete(t))}_a().requestIdleCallback;_a().cancelIdleCallback;const ks=t=>!!t.type.__asyncLoader,xa=t=>t.type.__isKeepAlive;function cf(t,i){nc(t,"a",i)}function df(t,i){nc(t,"da",i)}function nc(t,i,o=Yt){const l=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(wa(i,l,o),o){let u=o.parent;for(;u&&u.parent;)xa(u.parent.vnode)&&ff(l,i,o,u),u=u.parent}}function ff(t,i,o,l){const u=wa(i,t,l,!0);ic(()=>{Cr(l[i],u)},o)}function wa(t,i,o=Yt,l=!1){if(o){const u=o[t]||(o[t]=[]),d=i.__weh||(i.__weh=(...p)=>{Zn();const _=bo(o),b=vn(i,o,t,p);return _(),Hn(),b});return l?u.unshift(d):u.push(d),d}}const ci=t=>(i,o=Yt)=>{(!mo||t==="sp")&&wa(t,(...l)=>i(...l),o)},hf=ci("bm"),ui=ci("m"),pf=ci("bu"),mf=ci("u"),yo=ci("bum"),ic=ci("um"),gf=ci("sp"),vf=ci("rtg"),_f=ci("rtc");function yf(t,i=Yt){wa("ec",t,i)}const bf=Symbol.for("v-ndc");function Fe(t,i,o,l){let u;const d=o,p=Ae(t);if(p||_t(t)){const _=p&&Ji(t);let b=!1,C=!1;_&&(b=!mn(t),C=li(t),t=ya(t)),u=new Array(t.length);for(let k=0,O=t.length;ki(_,b,void 0,d));else{const _=Object.keys(t);u=new Array(_.length);for(let b=0,C=_.length;b0;return v(),et(ae,null,[E("slot",o,l)],C?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),v();const p=d&&sc(d(o)),_=o.key||p&&p.key,b=et(ae,{key:(_&&!Ln(_)?_:`_${i}`)+(!p&&l?"_fb":"")},p||[],p&&t._===1?64:-2);return b.scopeId&&(b.slotScopeIds=[b.scopeId+"-s"]),d&&d._c&&(d._d=!0),b}function sc(t){return t.some(i=>po(i)?!(i.type===Ft||i.type===ae&&!sc(i.children)):!0)?t:null}const vr=t=>t?Sc(t)?Ta(t):vr(t.parent):null,ao=zt(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=>vr(t.parent),$root:t=>vr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>ac(t),$forceUpdate:t=>t.f||(t.f=()=>{Nr(t.update)}),$nextTick:t=>t.n||(t.n=Bu.bind(t.proxy)),$watch:t=>tf.bind(t)}),nr=(t,i)=>t!==ht&&!t.__isScriptSetup&&at(t,i),wf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:l,data:u,props:d,accessCache:p,type:_,appContext:b}=t;if(i[0]!=="$"){const R=p[i];if(R!==void 0)switch(R){case 1:return l[i];case 2:return u[i];case 4:return o[i];case 3:return d[i]}else{if(nr(l,i))return p[i]=1,l[i];if(u!==ht&&at(u,i))return p[i]=2,u[i];if(at(d,i))return p[i]=3,d[i];if(o!==ht&&at(o,i))return p[i]=4,o[i];_r&&(p[i]=0)}}const C=ao[i];let k,O;if(C)return i==="$attrs"&&Rt(t.attrs,"get",""),C(t);if((k=_.__cssModules)&&(k=k[i]))return k;if(o!==ht&&at(o,i))return p[i]=4,o[i];if(O=b.config.globalProperties,at(O,i))return O[i]},set({_:t},i,o){const{data:l,setupState:u,ctx:d}=t;return nr(u,i)?(u[i]=o,!0):l!==ht&&at(l,i)?(l[i]=o,!0):at(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:p}},_){let b;return!!(o[_]||t!==ht&&_[0]!=="$"&&at(t,_)||nr(i,_)||at(d,_)||at(l,_)||at(ao,_)||at(u.config.globalProperties,_)||(b=p.__cssModules)&&b[_])},defineProperty(t,i,o){return o.get!=null?t._.accessCache[i]=0:at(o,"value")&&this.set(t,i,o.value,null),Reflect.defineProperty(t,i,o)}};function kl(t){return Ae(t)?t.reduce((i,o)=>(i[o]=null,i),{}):t}let _r=!0;function kf(t){const i=ac(t),o=t.proxy,l=t.ctx;_r=!1,i.beforeCreate&&Sl(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:p,watch:_,provide:b,inject:C,created:k,beforeMount:O,mounted:R,beforeUpdate:F,updated:X,activated:q,deactivated:ge,beforeDestroy:we,beforeUnmount:K,destroyed:fe,unmounted:ie,render:me,renderTracked:Le,renderTriggered:Ee,errorCaptured:Ve,serverPrefetch:pe,expose:$e,inheritAttrs:Oe,components:Q,directives:ue,filters:ye}=i;if(C&&Sf(C,l,null),p)for(const re in p){const ee=p[re];Ze(ee)&&(l[re]=ee.bind(o))}if(u){const re=u.call(o,o);rt(re)&&(t.data=xt(re))}if(_r=!0,d)for(const re in d){const ee=d[re],nt=Ze(ee)?ee.bind(o,o):Ze(ee.get)?ee.get.bind(o,o):Un,he=!Ze(ee)&&Ze(ee.set)?ee.set.bind(o):Un,Te=xe({get:nt,set:he});Object.defineProperty(l,re,{enumerable:!0,configurable:!0,get:()=>Te.value,set:qe=>Te.value=qe})}if(_)for(const re in _)oc(_[re],l,o,re);if(b){const re=Ze(b)?b.call(o):b;Reflect.ownKeys(re).forEach(ee=>{ju(ee,re[ee])})}k&&Sl(k,t,"c");function ce(re,ee){Ae(ee)?ee.forEach(nt=>re(nt.bind(o))):ee&&re(ee.bind(o))}if(ce(hf,O),ce(ui,R),ce(pf,F),ce(mf,X),ce(cf,q),ce(df,ge),ce(yf,Ve),ce(_f,Le),ce(vf,Ee),ce(yo,K),ce(ic,ie),ce(gf,pe),Ae($e))if($e.length){const re=t.exposed||(t.exposed={});$e.forEach(ee=>{Object.defineProperty(re,ee,{get:()=>o[ee],set:nt=>o[ee]=nt,enumerable:!0})})}else t.exposed||(t.exposed={});me&&t.render===Un&&(t.render=me),Oe!=null&&(t.inheritAttrs=Oe),Q&&(t.components=Q),ue&&(t.directives=ue),pe&&tc(t)}function Sf(t,i,o=Un){Ae(t)&&(t=yr(t));for(const l in t){const u=t[l];let d;rt(u)?"default"in u?d=so(u.from||l,u.default,!0):d=so(u.from||l):d=so(u),Vt(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:p=>d.value=p}):i[l]=d}}function Sl(t,i,o){vn(Ae(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,o)}function oc(t,i,o,l){let u=l.includes(".")?Ku(o,l):()=>o[l];if(_t(t)){const d=i[t];Ze(d)&&en(u,d)}else if(Ze(t))en(u,t.bind(o));else if(rt(t))if(Ae(t))t.forEach(d=>oc(d,i,o,l));else{const d=Ze(t.handler)?t.handler.bind(o):i[t.handler];Ze(d)&&en(u,d,t)}}function ac(t){const i=t.type,{mixins:o,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:p}}=t.appContext,_=d.get(i);let b;return _?b=_:!u.length&&!o&&!l?b=i:(b={},u.length&&u.forEach(C=>aa(b,C,p,!0)),aa(b,i,p)),rt(i)&&d.set(i,b),b}function aa(t,i,o,l=!1){const{mixins:u,extends:d}=i;d&&aa(t,d,o,!0),u&&u.forEach(p=>aa(t,p,o,!0));for(const p in i)if(!(l&&p==="expose")){const _=Tf[p]||o&&o[p];t[p]=_?_(t[p],i[p]):i[p]}return t}const Tf={data:Tl,props:Pl,emits:Pl,methods:Xs,computed:Xs,beforeCreate:Kt,created:Kt,beforeMount:Kt,mounted:Kt,beforeUpdate:Kt,updated:Kt,beforeDestroy:Kt,beforeUnmount:Kt,destroyed:Kt,unmounted:Kt,activated:Kt,deactivated:Kt,errorCaptured:Kt,serverPrefetch:Kt,components:Xs,directives:Xs,watch:Cf,provide:Tl,inject:Pf};function Tl(t,i){return i?t?function(){return zt(Ze(t)?t.call(this,this):t,Ze(i)?i.call(this,this):i)}:i:t}function Pf(t,i){return Xs(yr(t),yr(i))}function yr(t){if(Ae(t)){const i={};for(let o=0;oi==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Pn(i)}Modifiers`]||t[`${Mi(i)}Modifiers`];function Of(t,i,...o){if(t.isUnmounted)return;const l=t.vnode.props||ht;let u=o;const d=i.startsWith("update:"),p=d&&Ef(l,i.slice(7));p&&(p.trim&&(u=o.map(k=>_t(k)?k.trim():k)),p.number&&(u=o.map(va)));let _,b=l[_=Ya(i)]||l[_=Ya(Pn(i))];!b&&d&&(b=l[_=Ya(Mi(i))]),b&&vn(b,t,6,u);const C=l[_+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,vn(C,t,6,u)}}const zf=new WeakMap;function lc(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 p={},_=!1;if(!Ze(t)){const b=C=>{const k=lc(C,i,!0);k&&(_=!0,zt(p,k))};!o&&i.mixins.length&&i.mixins.forEach(b),t.extends&&b(t.extends),t.mixins&&t.mixins.forEach(b)}return!d&&!_?(rt(t)&&l.set(t,null),null):(Ae(d)?d.forEach(b=>p[b]=null):zt(p,d),rt(t)&&l.set(t,p),p)}function ka(t,i){return!t||!pa(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),at(t,i[0].toLowerCase()+i.slice(1))||at(t,Mi(i))||at(t,i))}function Cl(t){const{type:i,vnode:o,proxy:l,withProxy:u,propsOptions:[d],slots:p,attrs:_,emit:b,render:C,renderCache:k,props:O,data:R,setupState:F,ctx:X,inheritAttrs:q}=t,ge=sa(t);let we,K;try{if(o.shapeFlag&4){const ie=u||l,me=ie;we=Bn(C.call(me,ie,k,O,F,R,X)),K=_}else{const ie=i;we=Bn(ie.length>1?ie(O,{attrs:_,slots:p,emit:b}):ie(O,null)),K=i.props?_:Af(_)}}catch(ie){ro.length=0,ba(ie,t,1),we=E(Ft)}let fe=we;if(K&&q!==!1){const ie=Object.keys(K),{shapeFlag:me}=fe;ie.length&&me&7&&(d&&ie.some(ma)&&(K=$f(K,d)),fe=Ci(fe,K,!1,!0))}return o.dirs&&(fe=Ci(fe,null,!1,!0),fe.dirs=fe.dirs?fe.dirs.concat(o.dirs):o.dirs),o.transition&&fo(fe,o.transition),we=fe,sa(ge),we}const Af=t=>{let i;for(const o in t)(o==="class"||o==="style"||pa(o))&&((i||(i={}))[o]=t[o]);return i},$f=(t,i)=>{const o={};for(const l in t)(!ma(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:p,children:_,patchFlag:b}=i,C=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&b>=0){if(b&1024)return!0;if(b&16)return l?Ll(l,p,C):!!p;if(b&8){const k=i.dynamicProps;for(let O=0;OObject.create(cc),fc=t=>Object.getPrototypeOf(t)===cc;function Nf(t,i,o,l=!1){const u={},d=dc();t.propsDefaults=Object.create(null),hc(t,i,u,d);for(const p in t.propsOptions[0])p in u||(u[p]=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:p}}=t,_=tt(u),[b]=t.propsOptions;let C=!1;if((l||p>0)&&!(p&16)){if(p&8){const k=t.vnode.dynamicProps;for(let O=0;O{b=!0;const[R,F]=pc(O,i,!0);zt(p,R),F&&_.push(...F)};!o&&i.mixins.length&&i.mixins.forEach(k),t.extends&&k(t.extends),t.mixins&&t.mixins.forEach(k)}if(!d&&!b)return rt(t)&&l.set(t,bs),bs;if(Ae(d))for(let k=0;kt==="_"||t==="_ctx"||t==="$stable",Fr=t=>Ae(t)?t.map(Bn):[Bn(t)],Bf=(t,i,o)=>{if(i._n)return i;const l=be((...u)=>Fr(i(...u)),o);return l._c=!1,l},mc=(t,i,o)=>{const l=t._ctx;for(const u in t){if(Rr(u))continue;const d=t[u];if(Ze(d))i[u]=Bf(u,d,l);else if(d!=null){const p=Fr(d);i[u]=()=>p}}},gc=(t,i)=>{const o=Fr(i);t.slots.default=()=>o},vc=(t,i,o)=>{for(const l in i)(o||!Rr(l))&&(t[l]=i[l])},Vf=(t,i,o)=>{const l=t.slots=dc();if(t.vnode.shapeFlag&32){const u=i._;u?(vc(l,i,o),o&&bu(l,"_",u,!0)):mc(i,l)}else i&&gc(t,i)},Uf=(t,i,o)=>{const{vnode:l,slots:u}=t;let d=!0,p=ht;if(l.shapeFlag&32){const _=i._;_?o&&_===1?d=!1:vc(u,i,o):(d=!i.$stable,mc(i,u)),p=i}else i&&(gc(t,i),p={default:1});if(d)for(const _ in u)!Rr(_)&&p[_]==null&&delete u[_]},Gt=Kf;function Zf(t){return Hf(t)}function Hf(t,i){const o=_a();o.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:p,createText:_,createComment:b,setText:C,setElementText:k,parentNode:O,nextSibling:R,setScopeId:F=Un,insertStaticContent:X}=t,q=(m,f,x,U=null,B=null,V=null,te=void 0,N=null,J=!!f.dynamicChildren)=>{if(m===f)return;m&&!qi(m,f)&&(U=M(m),qe(m,B,V,!0),m=null),f.patchFlag===-2&&(J=!1,f.dynamicChildren=null);const{type:Z,ref:Pe,shapeFlag:le}=f;switch(Z){case Sa:ge(m,f,x,U);break;case Ft:we(m,f,x,U);break;case sr:m==null&&K(f,x,U,te);break;case ae:Q(m,f,x,U,B,V,te,N,J);break;default:le&1?me(m,f,x,U,B,V,te,N,J):le&6?ue(m,f,x,U,B,V,te,N,J):(le&64||le&128)&&Z.process(m,f,x,U,B,V,te,N,J,it)}Pe!=null&&B?oo(Pe,m&&m.ref,V,f||m,!f):Pe==null&&m&&m.ref!=null&&oo(m.ref,null,V,m,!0)},ge=(m,f,x,U)=>{if(m==null)l(f.el=_(f.children),x,U);else{const B=f.el=m.el;f.children!==m.children&&C(B,f.children)}},we=(m,f,x,U)=>{m==null?l(f.el=b(f.children||""),x,U):f.el=m.el},K=(m,f,x,U)=>{[m.el,m.anchor]=X(m.children,f,x,U,m.el,m.anchor)},fe=({el:m,anchor:f},x,U)=>{let B;for(;m&&m!==f;)B=R(m),l(m,x,U),m=B;l(f,x,U)},ie=({el:m,anchor:f})=>{let x;for(;m&&m!==f;)x=R(m),u(m),m=x;u(f)},me=(m,f,x,U,B,V,te,N,J)=>{if(f.type==="svg"?te="svg":f.type==="math"&&(te="mathml"),m==null)Le(f,x,U,B,V,te,N,J);else{const Z=m.el&&m.el._isVueCE?m.el:null;try{Z&&Z._beginPatch(),pe(m,f,B,V,te,N,J)}finally{Z&&Z._endPatch()}}},Le=(m,f,x,U,B,V,te,N)=>{let J,Z;const{props:Pe,shapeFlag:le,transition:se,dirs:Ce}=m;if(J=m.el=p(m.type,V,Pe&&Pe.is,Pe),le&8?k(J,m.children):le&16&&Ve(m.children,J,null,U,B,ir(m,V),te,N),Ce&&Zi(m,null,U,"created"),Ee(J,m,m.scopeId,te,U),Pe){for(const ke in Pe)ke!=="value"&&!to(ke)&&d(J,ke,null,Pe[ke],V,U);"value"in Pe&&d(J,"value",null,Pe.value,V),(Z=Pe.onVnodeBeforeMount)&&Nn(Z,U,m)}Ce&&Zi(m,null,U,"beforeMount");const He=jf(B,se);He&&se.beforeEnter(J),l(J,f,x),((Z=Pe&&Pe.onVnodeMounted)||He||Ce)&&Gt(()=>{try{Z&&Nn(Z,U,m),He&&se.enter(J),Ce&&Zi(m,null,U,"mounted")}finally{}},B)},Ee=(m,f,x,U,B)=>{if(x&&F(m,x),U)for(let V=0;V{for(let Z=J;Z{const N=f.el=m.el;let{patchFlag:J,dynamicChildren:Z,dirs:Pe}=f;J|=m.patchFlag&16;const le=m.props||ht,se=f.props||ht;let Ce;if(x&&Hi(x,!1),(Ce=se.onVnodeBeforeUpdate)&&Nn(Ce,x,f,m),Pe&&Zi(f,m,x,"beforeUpdate"),x&&Hi(x,!0),Z&&(!m.dynamicChildren||m.dynamicChildren.length!==Z.length)&&(J=0,te=!1,Z=null),(le.innerHTML&&se.innerHTML==null||le.textContent&&se.textContent==null)&&k(N,""),Z?$e(m.dynamicChildren,Z,N,x,U,ir(f,B),V):te||ee(m,f,N,null,x,U,ir(f,B),V,!1),J>0){if(J&16)Oe(N,le,se,x,B);else if(J&2&&le.class!==se.class&&d(N,"class",null,se.class,B),J&4&&d(N,"style",le.style,se.style,B),J&8){const He=f.dynamicProps;for(let ke=0;ke{Ce&&Nn(Ce,x,f,m),Pe&&Zi(f,m,x,"updated")},U)},$e=(m,f,x,U,B,V,te)=>{for(let N=0;N{if(f!==x){if(f!==ht)for(const V in f)!to(V)&&!(V in x)&&d(m,V,f[V],null,B,U);for(const V in x){if(to(V))continue;const te=x[V],N=f[V];te!==N&&V!=="value"&&d(m,V,N,te,B,U)}"value"in x&&d(m,"value",f.value,x.value,B)}},Q=(m,f,x,U,B,V,te,N,J)=>{const Z=f.el=m?m.el:_(""),Pe=f.anchor=m?m.anchor:_("");let{patchFlag:le,dynamicChildren:se,slotScopeIds:Ce}=f;Ce&&(N=N?N.concat(Ce):Ce),m==null?(l(Z,x,U),l(Pe,x,U),Ve(f.children||[],x,Pe,B,V,te,N,J)):le>0&&le&64&&se&&m.dynamicChildren&&m.dynamicChildren.length===se.length?($e(m.dynamicChildren,se,x,B,V,te,N),(f.key!=null||B&&f===B.subTree)&&Br(m,f,!0)):ee(m,f,x,Pe,B,V,te,N,J)},ue=(m,f,x,U,B,V,te,N,J)=>{f.slotScopeIds=N,m==null?f.shapeFlag&512?B.ctx.activate(f,x,U,te,J):ye(f,x,U,B,V,te,J):ze(m,f,J)},ye=(m,f,x,U,B,V,te)=>{const N=m.component=eh(m,U,B);if(xa(m)&&(N.ctx.renderer=it),th(N,!1,te),N.asyncDep){if(B&&B.registerDep(N,ce,te),!m.el){const J=N.subTree=E(Ft);we(null,J,f,x),m.placeholder=J.el}}else ce(N,m,f,x,B,V,te)},ze=(m,f,x)=>{const U=f.component=m.component;if(If(m,f,x))if(U.asyncDep&&!U.asyncResolved){re(U,f,x);return}else U.next=f,U.update();else f.el=m.el,U.vnode=f},ce=(m,f,x,U,B,V,te)=>{const N=()=>{if(m.isMounted){let{next:le,bu:se,u:Ce,parent:He,vnode:ke}=m;{const Ct=_c(m);if(Ct){le&&(le.el=ke.el,re(m,le,te)),Ct.asyncDep.then(()=>{Gt(()=>{m.isUnmounted||Z()},B)});return}}let Ge=le,ft;Hi(m,!1),le?(le.el=ke.el,re(m,le,te)):le=ke,se&&ea(se),(ft=le.props&&le.props.onVnodeBeforeUpdate)&&Nn(ft,He,le,ke),Hi(m,!0);const gt=Cl(m),yt=m.subTree;m.subTree=gt,q(yt,gt,O(yt.el),M(yt),m,B,V),le.el=gt.el,Ge===null&&Df(m,gt.el),Ce&&Gt(Ce,B),(ft=le.props&&le.props.onVnodeUpdated)&&Gt(()=>Nn(ft,He,le,ke),B)}else{let le;const{el:se,props:Ce}=f,{bm:He,m:ke,parent:Ge,root:ft,type:gt}=m,yt=ks(f);Hi(m,!1),He&&ea(He),!yt&&(le=Ce&&Ce.onVnodeBeforeMount)&&Nn(le,Ge,f),Hi(m,!0);{ft.ce&&ft.ce._hasShadowRoot()&&ft.ce._injectChildStyle(gt,m.parent?m.parent.type:void 0);const Ct=m.subTree=Cl(m);q(null,Ct,x,U,m,B,V),f.el=Ct.el}if(ke&&Gt(ke,B),!yt&&(le=Ce&&Ce.onVnodeMounted)){const Ct=f;Gt(()=>Nn(le,Ge,Ct),B)}(f.shapeFlag&256||Ge&&ks(Ge.vnode)&&Ge.vnode.shapeFlag&256)&&m.a&&Gt(m.a,B),m.isMounted=!0,f=x=U=null}};m.scope.on();const J=m.effect=new Su(N);m.scope.off();const Z=m.update=J.run.bind(J),Pe=m.job=J.runIfDirty.bind(J);Pe.i=m,Pe.id=m.uid,J.scheduler=()=>Nr(Pe),Hi(m,!0),Z()},re=(m,f,x)=>{f.component=m;const U=m.vnode.props;m.vnode=f,m.next=null,Rf(m,f.props,U,x),Uf(m,f.children,x),Zn(),vl(m),Hn()},ee=(m,f,x,U,B,V,te,N,J=!1)=>{const Z=m&&m.children,Pe=m?m.shapeFlag:0,le=f.children,{patchFlag:se,shapeFlag:Ce}=f;if(se>0){if(se&128){he(Z,le,x,U,B,V,te,N,J);return}else if(se&256){nt(Z,le,x,U,B,V,te,N,J);return}}Ce&8?(Pe&16&&j(Z,B,V),le!==Z&&k(x,le)):Pe&16?Ce&16?he(Z,le,x,U,B,V,te,N,J):j(Z,B,V,!0):(Pe&8&&k(x,""),Ce&16&&Ve(le,x,U,B,V,te,N,J))},nt=(m,f,x,U,B,V,te,N,J)=>{m=m||bs,f=f||bs;const Z=m.length,Pe=f.length,le=Math.min(Z,Pe);let se;for(se=0;sePe?j(m,B,V,!0,!1,le):Ve(f,x,U,B,V,te,N,J,le)},he=(m,f,x,U,B,V,te,N,J)=>{let Z=0;const Pe=f.length;let le=m.length-1,se=Pe-1;for(;Z<=le&&Z<=se;){const Ce=m[Z],He=f[Z]=J?si(f[Z]):Bn(f[Z]);if(qi(Ce,He))q(Ce,He,x,null,B,V,te,N,J);else break;Z++}for(;Z<=le&&Z<=se;){const Ce=m[le],He=f[se]=J?si(f[se]):Bn(f[se]);if(qi(Ce,He))q(Ce,He,x,null,B,V,te,N,J);else break;le--,se--}if(Z>le){if(Z<=se){const Ce=se+1,He=Cese)for(;Z<=le;)qe(m[Z],B,V,!0),Z++;else{const Ce=Z,He=Z,ke=new Map;for(Z=He;Z<=se;Z++){const St=f[Z]=J?si(f[Z]):Bn(f[Z]);St.key!=null&&ke.set(St.key,Z)}let Ge,ft=0;const gt=se-He+1;let yt=!1,Ct=0;const _n=new Array(gt);for(Z=0;Z=gt){qe(St,B,V,!0);continue}let Dt;if(St.key!=null)Dt=ke.get(St.key);else for(Ge=He;Ge<=se;Ge++)if(_n[Ge-He]===0&&qi(St,f[Ge])){Dt=Ge;break}Dt===void 0?qe(St,B,V,!0):(_n[Dt-He]=Z+1,Dt>=Ct?Ct=Dt:yt=!0,q(St,f[Dt],x,null,B,V,te,N,J),ft++)}const di=yt?Wf(_n):bs;for(Ge=di.length-1,Z=gt-1;Z>=0;Z--){const St=He+Z,Dt=f[St],En=f[St+1],Ut=St+1{const{el:V,type:te,transition:N,children:J,shapeFlag:Z}=m;if(Z&6){Te(m.component.subTree,f,x,U);return}if(Z&128){m.suspense.move(f,x,U);return}if(Z&64){te.move(m,f,x,it);return}if(te===ae){l(V,f,x);for(let le=0;leN.enter(V),B));else{const{leave:le,delayLeave:se,afterLeave:Ce}=N,He=()=>{m.ctx.isUnmounted?u(V):l(V,f,x)},ke=()=>{const Ge=V._isLeaving||!!V[pn];V._isLeaving&&V[pn](!0),N.persisted&&!Ge?He():le(V,()=>{He(),Ce&&Ce()})};se?se(V,He,ke):ke()}else l(V,f,x)},qe=(m,f,x,U=!1,B=!1)=>{const{type:V,props:te,ref:N,children:J,dynamicChildren:Z,shapeFlag:Pe,patchFlag:le,dirs:se,cacheIndex:Ce,memo:He}=m;if(le===-2&&(B=!1),N!=null&&(Zn(),oo(N,null,x,m,!0),Hn()),Ce!=null&&(f.renderCache[Ce]=void 0),Pe&256){f.ctx.deactivate(m);return}const ke=Pe&1&&se,Ge=!ks(m);let ft;if(Ge&&(ft=te&&te.onVnodeBeforeUnmount)&&Nn(ft,f,m),Pe&6)Ue(m.component,x,U);else{if(Pe&128){m.suspense.unmount(x,U);return}ke&&Zi(m,null,f,"beforeUnmount"),Pe&64?m.type.remove(m,f,x,it,U):Z&&!Z.hasOnce&&(V!==ae||le>0&&le&64)?j(Z,f,x,!1,!0):(V===ae&&le&384||!B&&Pe&16)&&j(J,f,x),U&<(m)}const gt=He!=null&&Ce==null;(Ge&&(ft=te&&te.onVnodeUnmounted)||ke||gt)&&Gt(()=>{ft&&Nn(ft,f,m),ke&&Zi(m,null,f,"unmounted"),gt&&(m.el=null)},x)},lt=m=>{const{type:f,el:x,anchor:U,transition:B}=m;if(f===ae){Ye(x,U);return}if(f===sr){ie(m);return}const V=()=>{u(x),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(m.shapeFlag&1&&B&&!B.persisted){const{leave:te,delayLeave:N}=B,J=()=>te(x,V);N?N(m.el,V,J):J()}else V()},Ye=(m,f)=>{let x;for(;m!==f;)x=R(m),u(m),m=x;u(f)},Ue=(m,f,x)=>{const{bum:U,scope:B,job:V,subTree:te,um:N,m:J,a:Z}=m;El(J),El(Z),U&&ea(U),B.stop(),V&&(V.flags|=8,qe(te,m,f,x)),N&&Gt(N,f),Gt(()=>{m.isUnmounted=!0},f)},j=(m,f,x,U=!1,B=!1,V=0)=>{for(let te=V;te{if(m.shapeFlag&6)return M(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const f=R(m.anchor||m.el),x=f&&f[Gu];return x?R(x):f};let z=!1;const ut=(m,f,x)=>{let U;m==null?f._vnode&&(qe(f._vnode,null,null,!0),U=f._vnode.component):q(f._vnode||null,m,f,null,null,null,x),f._vnode=m,z||(z=!0,vl(U),Uu(),z=!1)},it={p:q,um:qe,m:Te,r:lt,mt:ye,mc:Ve,pc:ee,pbc:$e,n:M,o:t};return{render:ut,hydrate:void 0,createApp:Mf(ut)}}function ir({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 Hi({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 Br(t,i,o=!1){const l=t.children,u=i.children;if(Ae(l)&&Ae(u))for(let d=0;d>1,t[o[_]]0&&(i[l]=o[d-1]),o[d]=l)}}for(d=o.length,p=o[d-1];d-- >0;)o[d]=p,p=i[p];return o}function _c(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:_c(i)}function El(t){if(t)for(let i=0;it.__isSuspense;function Kf(t,i){i&&i.pendingBranch?Ae(t)?i.effects.push(...t):i.effects.push(t):Xd(t)}const ae=Symbol.for("v-fgt"),Sa=Symbol.for("v-txt"),Ft=Symbol.for("v-cmt"),sr=Symbol.for("v-stc"),ro=[];let on=null;function v(t=!1){ro.push(on=t?null:[])}function Gf(){ro.pop(),on=ro[ro.length-1]||null}let ho=1;function ra(t,i=!1){ho+=t,t<0&&on&&i&&(on.hasOnce=!0)}function xc(t){return t.dynamicChildren=ho>0?on||bs:null,Gf(),ho>0&&on&&on.push(t),t}function y(t,i,o,l,u,d){return xc(r(t,i,o,l,u,d,!0))}function et(t,i,o,l,u){return xc(E(t,i,o,l,u,!0))}function po(t){return t?t.__v_isVNode===!0:!1}function qi(t,i){return t.type===i.type&&t.key===i.key}const wc=({key:t})=>t??null,ta=({ref:t,ref_key:i,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?_t(t)||Vt(t)||Ze(t)?{i:Bt,r:t,k:i,f:!!o}:t:null);function r(t,i=null,o=null,l=0,u=null,d=t===ae?0:1,p=!1,_=!1){const b={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&wc(i),ref:i&&ta(i),scopeId:Hu,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:Bt};return _?(la(b,o),d&128&&t.normalize(b)):o&&(b.shapeFlag|=_t(o)?8:16),ho>0&&!p&&on&&(b.patchFlag>0||d&6)&&b.patchFlag!==32&&on.push(b),b}const E=qf;function qf(t,i=null,o=null,l=0,u=null,d=!1){if((!t||t===bf)&&(t=Ft),po(t)){const _=Ci(t,i,!0);return o&&la(_,o),ho>0&&!d&&on&&(_.shapeFlag&6?on[on.indexOf(t)]=_:on.push(_)),_.patchFlag=-2,_}if(oh(t)&&(t=t.__vccOpts),i){i=Yf(i);let{class:_,style:b}=i;_&&!_t(_)&&(i.class=Me(_)),rt(b)&&(Dr(b)&&!Ae(b)&&(b=zt({},b)),i.style=Ps(b))}const p=_t(t)?1:bc(t)?128:qu(t)?64:rt(t)?4:Ze(t)?2:0;return r(t,i,o,l,u,p,d,!0)}function Yf(t){return t?Dr(t)||fc(t)?zt({},t):t:null}function Ci(t,i,o=!1,l=!1){const{props:u,ref:d,patchFlag:p,children:_,transition:b}=t,C=i?Jf(u||{},i):u,k={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&wc(C),ref:i&&i.ref?o&&d?Ae(d)?d.concat(ta(i)):[d,ta(i)]:ta(i):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:_,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==ae?p===-1?16:p|16:p,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:b,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ci(t.ssContent),ssFallback:t.ssFallback&&Ci(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return b&&l&&fo(k,b.clone(k)),k}function $(t=" ",i=0){return E(Sa,null,t,i)}function D(t="",i=!1){return i?(v(),et(Ft,null,t)):E(Ft,null,t)}function Bn(t){return t==null||typeof t=="boolean"?E(Ft):Ae(t)?E(ae,null,t.slice()):po(t)?si(t):E(Sa,null,String(t))}function si(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ci(t)}function la(t,i){let o=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(Ae(i))o=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),la(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=i._;!u&&!fc(i)?i._ctx=Bt:u===3&&Bt&&(Bt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(Ze(i)){if(l&65){la(t,{default:i});return}i={default:i,_ctx:Bt},o=32}else i=String(i),l&64?(o=16,i=[$(i)]):o=8;t.children=i,t.shapeFlag|=o}function Jf(...t){const i={};for(let o=0;oYt||Bt;let ua,xr;{const t=_a(),i=(o,l)=>{let u;return(u=t[o])||(u=t[o]=[]),u.push(l),d=>{u.length>1?u.forEach(p=>p(d)):u[0](d)}};ua=i("__VUE_INSTANCE_SETTERS__",o=>Yt=o),xr=i("__VUE_SSR_SETTERS__",o=>mo=o)}const bo=t=>{const i=Yt;return ua(t),t.scope.on(),()=>{t.scope.off(),ua(i)}},Ol=()=>{Yt&&Yt.scope.off(),ua(null)};function Sc(t){return t.vnode.shapeFlag&4}let mo=!1;function th(t,i=!1,o=!1){i&&xr(i);const{props:l,children:u}=t.vnode,d=Sc(t);Nf(t,l,d,i),Vf(t,u,o||i);const p=d?nh(t,i):void 0;return i&&xr(!1),p}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=bo(t),p=_o(l,t,0,[t.props,u]),_=gu(p);if(Hn(),d(),(_||t.sp)&&!ks(t)&&tc(t),_){if(p.then(Ol,Ol),i)return p.then(b=>{zl(t,b)}).catch(b=>{ba(b,t,0)});t.asyncDep=p}else zl(t,p)}else Tc(t)}function zl(t,i,o){Ze(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:rt(i)&&(t.setupState=Ru(i)),Tc(t)}function Tc(t,i,o){const l=t.type;t.render||(t.render=l.render||Un);{const u=bo(t);Zn();try{kf(t)}finally{Hn(),u()}}}const ih={get(t,i){return Rt(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 Ta(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Ru(Ud(t.exposed)),{get(i,o){if(o in i)return i[o];if(o in ao)return ao[o](t)},has(i,o){return o in i||o in ao}})):t.proxy}function oh(t){return Ze(t)&&"__vccOpts"in t}const xe=(t,i)=>Kd(t,i,mo);function ah(t,i,o){try{ra(-1);const l=arguments.length;return l===2?rt(i)&&!Ae(i)?po(i)?E(t,null,[i]):E(t,i):E(t,null,i):(l>3?o=Array.prototype.slice.call(arguments,2):l===3&&po(o)&&(o=[o]),E(t,i,o))}finally{ra(1)}}const rh="3.5.39";/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let wr;const Al=typeof window<"u"&&window.trustedTypes;if(Al)try{wr=Al.createPolicy("vue",{createHTML:t=>t})}catch{}const Pc=wr?t=>wr.createHTML(t):t=>t,lh="http://www.w3.org/2000/svg",uh="http://www.w3.org/1998/Math/MathML",ii=typeof document<"u"?document:null,$l=ii&&ii.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"?ii.createElementNS(lh,t):i==="mathml"?ii.createElementNS(uh,t):o?ii.createElement(t,{is:o}):ii.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>ii.createTextNode(t),createComment:t=>ii.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ii.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,o,l,u,d){const p=o?o.previousSibling:i.lastChild;if(u&&(u===d||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),o),!(u===d||!(u=u.nextSibling)););else{$l.innerHTML=Pc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=$l.content;if(l==="svg"||l==="mathml"){const b=_.firstChild;for(;b.firstChild;)_.appendChild(b.firstChild);_.removeChild(b)}i.insertBefore(_,o)}return[p?p.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},ki="transition",qs="animation",go=Symbol("_vtc"),Cc={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=zt({},Yu,Cc),fh=t=>(t.displayName="Transition",t.props=dh,t),hh=fh((t,{slots:i})=>ah(uf,ph(t),i)),ji=(t,i=[])=>{Ae(t)?t.forEach(o=>o(...i)):t&&t(...i)},Il=t=>t?Ae(t)?t.some(i=>i.length>1):t.length>1:!1;function ph(t){const i={};for(const Q in t)Q in Cc||(i[Q]=t[Q]);if(t.css===!1)return i;const{name:o="v",type:l,duration:u,enterFromClass:d=`${o}-enter-from`,enterActiveClass:p=`${o}-enter-active`,enterToClass:_=`${o}-enter-to`,appearFromClass:b=d,appearActiveClass:C=p,appearToClass:k=_,leaveFromClass:O=`${o}-leave-from`,leaveActiveClass:R=`${o}-leave-active`,leaveToClass:F=`${o}-leave-to`}=t,X=mh(u),q=X&&X[0],ge=X&&X[1],{onBeforeEnter:we,onEnter:K,onEnterCancelled:fe,onLeave:ie,onLeaveCancelled:me,onBeforeAppear:Le=we,onAppear:Ee=K,onAppearCancelled:Ve=fe}=i,pe=(Q,ue,ye,ze)=>{Q._enterCancelled=ze,Wi(Q,ue?k:_),Wi(Q,ue?C:p),ye&&ye()},$e=(Q,ue)=>{Q._isLeaving=!1,Wi(Q,O),Wi(Q,F),Wi(Q,R),ue&&ue()},Oe=Q=>(ue,ye)=>{const ze=Q?Ee:K,ce=()=>pe(ue,Q,ye);ji(ze,[ue,ce]),Dl(()=>{Wi(ue,Q?b:d),ni(ue,Q?k:_),Il(ze)||Nl(ue,l,q,ce)})};return zt(i,{onBeforeEnter(Q){ji(we,[Q]),ni(Q,d),ni(Q,p)},onBeforeAppear(Q){ji(Le,[Q]),ni(Q,b),ni(Q,C)},onEnter:Oe(!1),onAppear:Oe(!0),onLeave(Q,ue){Q._isLeaving=!0;const ye=()=>$e(Q,ue);ni(Q,O),Q._enterCancelled?(ni(Q,R),Bl(Q)):(Bl(Q),ni(Q,R)),Dl(()=>{Q._isLeaving&&(Wi(Q,O),ni(Q,F),Il(ie)||Nl(Q,l,ge,ye))}),ji(ie,[Q,ye])},onEnterCancelled(Q){pe(Q,!1,void 0,!0),ji(fe,[Q])},onAppearCancelled(Q){pe(Q,!0,void 0,!0),ji(Ve,[Q])},onLeaveCancelled(Q){$e(Q),ji(me,[Q])}})}function mh(t){if(t==null)return null;if(rt(t))return[or(t.enter),or(t.leave)];{const i=or(t);return[i,i]}}function or(t){return pd(t)}function ni(t,i){i.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[go]||(t[go]=new Set)).add(i)}function Wi(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const o=t[go];o&&(o.delete(i),o.size||(t[go]=void 0))}function Dl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let gh=0;function Nl(t,i,o,l){const u=t._endId=++gh,d=()=>{u===t._endId&&l()};if(o!=null)return setTimeout(d,o);const{type:p,timeout:_,propCount:b}=vh(t,i);if(!p)return l();const C=p+"end";let k=0;const O=()=>{t.removeEventListener(C,R),d()},R=F=>{F.target===t&&++k>=b&&O()};setTimeout(()=>{k(o[X]||"").split(", "),u=l(`${ki}Delay`),d=l(`${ki}Duration`),p=Rl(u,d),_=l(`${qs}Delay`),b=l(`${qs}Duration`),C=Rl(_,b);let k=null,O=0,R=0;i===ki?p>0&&(k=ki,O=p,R=d.length):i===qs?C>0&&(k=qs,O=C,R=b.length):(O=Math.max(p,C),k=O>0?p>C?ki:qs:null,R=k?k===ki?d.length:b.length:0);const F=k===ki&&/\b(?:transform|all)(?:,|$)/.test(l(`${ki}Property`).toString());return{type:k,timeout:O,propCount:R,hasTransform:F}}function Rl(t,i){for(;t.lengthFl(o)+Fl(t[l])))}function Fl(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Bl(t){return(t?t.ownerDocument:document).body.offsetHeight}function _h(t,i,o){const l=t[go];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):o?t.setAttribute("class",i):t.className=i}const ca=Symbol("_vod"),Lc=Symbol("_vsh"),yh={name:"show",beforeMount(t,{value:i},{transition:o}){t[ca]=t.style.display==="none"?"":t.style.display,o&&i?o.beforeEnter(t):Ys(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),Ys(t,!0),l.enter(t)):l.leave(t,()=>{Ys(t,!1)}):Ys(t,i))},beforeUnmount(t,{value:i}){Ys(t,i)}};function Ys(t,i){t.style.display=i?t[ca]:"none",t[Lc]=!i}const bh=Symbol(""),xh=/(?:^|;)\s*display\s*:/;function wh(t,i,o){const l=t.style,u=_t(o);let d=!1;if(o&&!u){if(i)if(_t(i))for(const p of i.split(";")){const _=p.slice(0,p.indexOf(":")).trim();o[_]==null&&Qs(l,_,"")}else for(const p in i)o[p]==null&&Qs(l,p,"");for(const p in o){p==="display"&&(d=!0);const _=o[p];_!=null?Sh(t,p,!_t(i)&&i?i[p]:void 0,_)||Qs(l,p,_):Qs(l,p,"")}}else if(u){if(i!==o){const p=l[bh];p&&(o+=";"+p),l.cssText=o,d=xh.test(o)}}else i&&t.removeAttribute("style");ca in t&&(t[ca]=d?l.display:"",t[Lc]&&(l.display="none"))}const Vl=/\s*!important$/;function Qs(t,i,o){if(Ae(o))o.forEach(l=>Qs(t,i,l));else if(o==null&&(o=""),i.startsWith("--"))t.setProperty(i,o);else{const l=kh(t,i);Vl.test(o)?t.setProperty(Mi(l),o.replace(Vl,""),"important"):t[l]=o}}const Ul=["Webkit","Moz","ms"],ar={};function kh(t,i){const o=ar[i];if(o)return o;let l=Pn(i);if(l!=="filter"&&l in t)return ar[i]=l;l=yu(l);for(let u=0;urr||(Eh.then(()=>rr=0),rr=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(Ae(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const p=u.slice(),_=[l];for(let b=0;bt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Ah=(t,i,o,l,u,d)=>{const p=u==="svg";i==="class"?_h(t,l,p):i==="style"?wh(t,o,l):pa(i)?ma(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,p))?(jl(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Hl(t,i,l,p,d,i!=="value")):t._isVueCE&&(Ih(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!_t(l)))?jl(t,Pn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),Hl(t,i,l,p))};function $h(t,i,o,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Kl(i)&&Ze(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 Kl(i)&&_t(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 Li=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Ae(i)?o=>ea(i,o):i};function Dh(t){t.target.composing=!0}function Gl(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const gn=Symbol("_assign");function ql(t,i,o){return i&&(t=t.trim()),o&&(t=va(t)),t}const ve={created(t,{modifiers:{lazy:i,trim:o,number:l}},u){t[gn]=Li(u);const d=l||u.props&&u.props.type==="number";ri(t,i?"change":"input",p=>{p.target.composing||t[gn](ql(t.value,o,d))}),(o||d)&&ri(t,"change",()=>{t.value=ql(t.value,o,d)}),i||(ri(t,"compositionstart",Dh),ri(t,"compositionend",Gl),ri(t,"change",Gl))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:o,modifiers:{lazy:l,trim:u,number:d}},p){if(t[gn]=Li(p),t.composing)return;const _=(d||t.type==="number")&&!/^0\d/.test(t.value)?va(t.value):t.value,b=i??"";if(_===b)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===o||u&&t.value.trim()===b)||(t.value=b)}},da={deep:!0,created(t,i,o){t[gn]=Li(o),ri(t,"change",()=>{const l=t._modelValue,u=Ls(t),d=t.checked,p=t[gn];if(Ae(l)){const _=Mr(l,u),b=_!==-1;if(d&&!b)p(l.concat(u));else if(!d&&b){const C=[...l];C.splice(_,1),p(C)}}else if(Ms(l)){const _=new Set(l);d?_.add(u):_.delete(u),p(_)}else p(Mc(t,d))})},mounted:Yl,beforeUpdate(t,i,o){t[gn]=Li(o),Yl(t,i,o)}};function Yl(t,{value:i,oldValue:o},l){t._modelValue=i;let u;if(Ae(i))u=Mr(i,l.props.value)>-1;else if(Ms(i))u=i.has(l.props.value);else{if(i===o)return;u=Pi(i,Mc(t,!0))}t.checked!==u&&(t.checked=u)}const Nh={created(t,{value:i},o){t.checked=Pi(i,o.props.value),t[gn]=Li(o),ri(t,"change",()=>{t[gn](Ls(t))})},beforeUpdate(t,{value:i,oldValue:o},l){t[gn]=Li(l),i!==o&&(t.checked=Pi(i,l.props.value))}},Ot={deep:!0,created(t,{value:i,modifiers:{number:o}},l){const u=Ms(i);ri(t,"change",()=>{const d=Array.prototype.filter.call(t.options,p=>p.selected).map(p=>o?va(Ls(p)):Ls(p));t[gn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,Bu(()=>{t._assigning=!1})}),t[gn]=Li(l)},mounted(t,{value:i}){Jl(t,i)},beforeUpdate(t,i,o){t[gn]=Li(o)},updated(t,{value:i}){t._assigning||Jl(t,i)}};function Jl(t,i){const o=t.multiple,l=Ae(i);if(!(o&&!l&&!Ms(i))){for(let u=0,d=t.options.length;uString(C)===String(_)):p.selected=Mr(i,_)>-1}else p.selected=i.has(_);else if(Pi(Ls(p),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ls(t){return"_value"in t?t._value:t.value}function Mc(t,i){const o=i?"_trueValue":"_falseValue";return o in t?t[o]:i}const Rh={created(t,i,o){Jo(t,i,o,null,"created")},mounted(t,i,o){Jo(t,i,o,null,"mounted")},beforeUpdate(t,i,o,l){Jo(t,i,o,l,"beforeUpdate")},updated(t,i,o,l){Jo(t,i,o,l,"updated")}};function Fh(t,i){switch(t){case"SELECT":return Ot;case"TEXTAREA":return ve;default:switch(i){case"checkbox":return da;case"radio":return Nh;default:return ve}}}function Jo(t,i,o,l,u){const p=Fh(t.tagName,o.props&&o.props.type)[u];p&&p(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))},Vr=(t,i)=>{if(!t)return t;const o=t._withMods||(t._withMods={}),l=i.join(".");return o[l]||(o[l]=((u,...d)=>{for(let p=0;p{const o=t._withKeys||(t._withKeys={}),l=i.join(".");return o[l]||(o[l]=(u=>{if(!("key"in u))return;const d=Mi(u.key);if(i.some(p=>p===d||Uh[p]===d))return t(u)}))},Zh=zt({patchProp:Ah},ch);let Ql;function Hh(){return Ql||(Ql=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;!Ze(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const p=o(u,!1,Wh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),p},i});function Wh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Kh(t){return _t(t)?document.querySelector(t):t}const Ec="pv_theme",eu={light:"#EEF0F3",dark:"#0B1730"},fa=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function Oc(){return fa&&fa.matches?"dark":"light"}function Gh(){try{return localStorage.getItem(Ec)||"light"}catch{return"light"}}function zc(t){return t==="system"?Oc():t}function Ac(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=eu[t]||eu.light}const Xi=H(Gh()),Ts=H(zc(Xi.value));function ha(t){Xi.value=t;const i=zc(t);Ts.value=i,Ac(i);try{localStorage.setItem(Ec,t)}catch{}}function tu(){ha(Ts.value==="dark"?"light":"dark")}fa&&fa.addEventListener("change",()=>{if(Xi.value==="system"){const t=Oc();Ts.value=t,Ac(t)}});async function qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function nu(){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 iu(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/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 su(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 fp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function hp(){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 Xo(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 pp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function mp(){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 ou(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 gp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function $c(){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 vp(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 _p(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 yp(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 bp(){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 xp(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 wp(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 kp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Sp(){return"/bff/logbook/export"}async function Tp(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 Pp(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 Cp(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 Lp(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function lr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Mp(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Ep(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 Ic="pv_prefs",kr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,twoFactor:!1};function Op(){try{return{...kr,...JSON.parse(localStorage.getItem(Ic)||"{}")||{}}}catch{return{...kr}}}const De=xt(Op());function Dc(){try{localStorage.setItem(Ic,JSON.stringify(De))}catch{}}function Nc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(kr))i in t&&(De[i]=t[i]);return!0}const zp={sm:15,md:16,lg:18};function Ur(t){document.documentElement.style.fontSize=(zp[t]||16)+"px"}function Zr(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Rc(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(De.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 p;return De.timeFormat==="12"?p=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):p=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:p}}function au(t){return Rc(t).time}function ru(t){const i=Rc(t);return`${i.date} ${i.time}`}let Hr=!1,Sr=!1,Tr=null;function Ap(){return{...JSON.parse(JSON.stringify(De)),themeMode:Xi.value}}function jr(){!Hr||Sr||(clearTimeout(Tr),Tr=setTimeout(()=>{lp(Ap())},600))}function $p(t){Sr=!0;try{Nc(t),t.themeMode&&ha(t.themeMode),Ur(De.fontSize),Zr(De.reduceMotion),Dc()}finally{Sr=!1}}async function lu(){Hr=!0;const t=await rp();t&&Object.keys(t).length?$p(t):jr()}function Ip(){Hr=!1,clearTimeout(Tr)}en(De,()=>{Dc(),jr()},{deep:!0});en(Xi,jr);en(()=>De.fontSize,Ur,{immediate:!0});en(()=>De.reduceMotion,Zr,{immediate:!0});const Dp=["width","height"],Fc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,o)=>(v(),y("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,Dp))}},Np=["title","aria-label"],Rp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Fp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Bp={__name:"ThemeToggle",setup(t){return(i,o)=>(v(),y("button",{class:"btn-icon",type:"button",title:Re(Ts)==="dark"?"Switch to light":"Switch to dark","aria-label":Re(Ts)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...l)=>Re(tu)&&Re(tu)(...l))},[Re(Ts)==="dark"?(v(),y("svg",Rp,[...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)])])):(v(),y("svg",Fp,[...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,Np))}},Vp={class:"relative grid h-full place-items-center p-5"},Up={class:"absolute right-5 top-5"},Zp={class:"mb-6 flex items-center gap-3 text-ink"},Hp={class:"relative mb-1"},jp=["type"],Wp=["aria-label","title"],Kp={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]"},Gp={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]"},qp={key:0,class:"mt-4"},Yp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Jp=["disabled"],Xp={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const o=t,l=i,u=H(""),d=H(""),p=H(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),_=H(!1),b=H(!1),C=H(!1),k=H("");async function O(){C.value=!0,k.value="",localStorage.setItem("api_url",p.value.trim());const{ok:R,status:F,body:X}=await Yh(u.value.trim(),d.value,p.value.trim());if(C.value=!1,R){l("signed-in",X.email);return}k.value=F===400?"Invalid email or password.":F===502?"API server can't reach PocketBase.":X.message||X.error||"Cannot reach the API server."}return(R,F)=>(v(),y("div",Vp,[r("div",Up,[E(Bp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:Vr(O,["prevent"])},[r("div",Zp,[E(Fc,{size:34}),F[5]||(F[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),F[9]||(F[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),oe(r("input",{"onUpdate:modelValue":F[0]||(F[0]=X=>u.value=X),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ve,u.value]]),F[10]||(F[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",Hp,[oe(r("input",{"onUpdate:modelValue":F[1]||(F[1]=X=>d.value=X),type:b.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,jp),[[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":b.value?"Hide password":"Show password",title:b.value?"Hide password":"Show password",onClick:F[2]||(F[2]=X=>b.value=!b.value)},[b.value?(v(),y("svg",Kp,[...F[6]||(F[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)])])):(v(),y("svg",Gp,[...F[7]||(F[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,Wp)]),_.value?(v(),y("div",qp,[F[8]||(F[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),oe(r("input",{"onUpdate:modelValue":F[3]||(F[3]=X=>p.value=X),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ve,p.value]])])):D("",!0),k.value?(v(),y("p",Yp,S(k.value),1)):D("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},S(C.value?"Signing in…":"Sign in"),9,Jp),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:F[4]||(F[4]=X=>_.value=!_.value)},S(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function Qp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var eo={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 em=eo.exports,uu;function tm(){return uu||(uu=1,(function(t,i){(function(o,l){l(i)})(em,(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=fe(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ee.prototype={clone:function(){return new ee(this.x,this.y)},add:function(e){return this.clone()._add(he(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(he(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 ee(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ee(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=nt(this.x),this.y=nt(this.y),this},distanceTo:function(e){e=he(e);var n=e.x-this.x,s=e.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(e){return e=he(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=he(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 he(e,n,s){return e instanceof ee?e:fe(e)?new ee(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ee(e.x,e.y):new ee(e,n,s)}function Te(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=qe(e);var n=this.min,s=this.max,a=e.min,c=e.max,g=c.x>=n.x&&a.x<=s.x,P=c.y>=n.y&&a.y<=s.y;return g&&P},overlaps:function(e){e=qe(e);var n=this.min,s=this.max,a=e.min,c=e.max,g=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=Ye(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),g=c.lat>=n.lat&&a.lat<=s.lat,P=c.lng>=n.lng&&a.lng<=s.lng;return g&&P},overlaps:function(e){e=Ye(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),g=c.lat>n.lat&&a.latn.lng&&a.lng1,La=(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})(),Ma=(function(){return!!document.createElement("canvas").getContext})(),Os=!!(document.createElementNS&&U("svg").createSVGRect),wo=!!Os&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ea=!Os&&(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}})(),Oa=navigator.platform.indexOf("Mac")===0,za=navigator.platform.indexOf("Linux")===0;function je(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var _e={ie:te,ielt9:N,edge:J,webkit:Z,android:Pe,android23:le,androidStock:Ce,opera:He,chrome:ke,gecko:Ge,safari:ft,phantom:gt,opera12:yt,win:Ct,ie3d:_n,webkit3d:di,gecko3d:St,any3d:Dt,mobile:En,mobileWebkit:Ut,mobileWebkit3d:Qi,msPointer:At,pointer:Zt,touch:Pa,touchNative:bt,mobileOpera:xo,mobileGecko:Es,retina:Ca,passiveEvents:La,canvas:Ma,svg:Os,vml:Ea,inlineSvg:wo,mac:Oa,linux:za},es=_e.msPointer?"MSPointerDown":"pointerdown",$t=_e.msPointer?"MSPointerMove":"pointermove",fi=_e.msPointer?"MSPointerUp":"pointerup",Ei=_e.msPointer?"MSPointerCancel":"pointercancel",hi={touchstart:es,touchmove:$t,touchend:fi,touchcancel:Ei},an={touchstart:So,touchmove:Ht,touchend:Ht,touchcancel:Ht},tn={},ko=!1;function zs(e,n,s){return n==="touchstart"&&pi(),an[n]?(s=an[n].bind(this,s),e.addEventListener(hi[n],s,!1),s):(console.warn("wrong event specified:",n),O)}function As(e,n,s){if(!hi[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(hi[n],s,!1)}function Aa(e){tn[e.pointerId]=e}function rn(e){tn[e.pointerId]&&(tn[e.pointerId]=e)}function yn(e){delete tn[e.pointerId]}function pi(){ko||(document.addEventListener(es,Aa,!0),document.addEventListener($t,rn,!0),document.addEventListener(fi,yn,!0),document.addEventListener(Ei,yn,!0),ko=!0)}function Ht(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in tn)n.touches.push(tn[s]);n.changedTouches=[n],e(n)}}function So(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Lt(n),Ht(e,n)}function $s(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 $a=200;function Ia(e,n){e.addEventListener("dblclick",n);var s=0,a;function c(g){if(g.detail!==1){a=g.detail;return}if(!(g.pointerType==="mouse"||g.sourceCapabilities&&!g.sourceCapabilities.firesTouchEvents)){var P=Lo(g);if(!(P.some(function(I){return I instanceof HTMLLabelElement&&I.attributes.for})&&!P.some(function(I){return I instanceof HTMLInputElement||I instanceof HTMLSelectElement}))){var A=Date.now();A-s<=$a?(a++,a===2&&n($s(g))):a=1,s=A}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function Da(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var Is=ts(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),mi=ts(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),To=mi==="webkitTransition"||mi==="OTransition"?mi+"End":"transitionend";function Po(e){return typeof e=="string"?document.getElementById(e):e}function Oi(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 ne(e,n,s){var a=document.createElement(e);return a.className=n||"",s&&s.appendChild(a),a}function st(e){var n=e.parentNode;n&&n.removeChild(e)}function jn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ln(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function bn(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function gi(e,n){if(e.classList!==void 0)return e.classList.contains(n);var s=zi(e);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function Ie(e,n){if(e.classList!==void 0)for(var s=X(n),a=0,c=s.length;a0?2*window.devicePixelRatio:1;function Eo(e){return _e.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Ra: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 Kn(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 Oo={__proto__:null,on:Be,off:ot,stopPropagation:kt,disableScrollPropagation:zn,disableClickPropagation:yi,preventDefault:Lt,stop:wn,getPropagationPath:Lo,getMousePosition:Mo,getWheelDelta:Eo,isExternalTarget:Kn,addListener:Be,removeListener:ot},Ii=re.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=On(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=Oe(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,Ye(e));return s.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var s=he(n.paddingTopLeft||n.padding||[0,0]),a=he(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),g=this.project(e),P=this.getPixelBounds(),A=qe([P.min.add(s),P.max.subtract(a)]),I=A.getSize();if(!A.contains(g)){this._enforcingBounds=!0;var G=g.subtract(A.getCenter()),de=A.extend(g).getSize().subtract(I);c.x+=G.x<0?-de.x:de.x,c.y+=G.y<0?-de.y:de.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(),g=a.subtract(c);return!g.x&&!g.y?this:(e.animate&&e.pan?this.panBy(g):(e.pan&&this._rawPanBy(g),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(p(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=p(this._handleGeolocationResponse,this),s=p(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),g=this._locateOptions;if(g.setView){var P=this.getBoundsZoom(c);this.setView(a,g.maxZoom?Math.min(P,g.maxZoom):P)}var A={latlng:a,bounds:c,timestamp:e.timestamp};for(var I in e.coords)typeof e.coords[I]=="number"&&(A[I]=e.coords[I]);this.fire("locationfound",A)}},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(),st(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Q(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)st(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=ne("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 lt(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=Ye(e),s=he(s||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),g=this.getMaxZoom(),P=e.getNorthWest(),A=e.getSouthEast(),I=this.getSize().subtract(s),G=qe(this.project(A,a),this.project(P,a)).getSize(),de=_e.any3d?this.options.zoomSnap:1,Ne=I.x/G.x,Ke=I.y/G.y,Wt=n?Math.max(Ne,Ke):Math.min(Ne,Ke);return a=this.getScaleZoom(Wt,a),de&&(a=Math.round(a/(de/100))*(de/100),a=n?Math.ceil(a/de)*de:Math.floor(a/de)*de),Math.max(c,Math.min(g,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ee(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 Te(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(j(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(he(e),n)},layerPointToLatLng:function(e){var n=he(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(j(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(j(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(Ye(e))},distance:function(e,n){return this.options.crs.distance(j(e),j(n))},containerPointToLayerPoint:function(e){return he(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return he(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(he(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(e)))},mouseEventToContainerPoint:function(e){return Mo(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=Po(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Be(n,"scroll",this._onScroll,this),this._containerId=b(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&_e.any3d,Ie(e,"leaflet-container"+(_e.touch?" leaflet-touch":"")+(_e.retina?" leaflet-retina":"")+(_e.ielt9?" leaflet-oldie":"")+(_e.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=Oi(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),vt(this._mapPane,new ee(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ie(e.markerPane,"leaflet-zoom-hide"),Ie(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,s){vt(this._mapPane,new ee(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 Q(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){vt(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?ot:Be;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),_e.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Q(this._resizeRequest),this._resizeRequest=Oe(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",g=e.target||e.srcElement,P=!1;g;){if(a=this._targets[b(g)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!Kn(g,e)||(s.push(a),c))||g===this._container)break;g=g.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"&&ss(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 g=[],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=_e.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(){ct(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=ne("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var s=Is,a=this._proxy.style[s];Tt(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(){st(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();Tt(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:(Oe(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,Ie(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(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ct(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 rs(e,n){return new We(e,n)}var jt=ye.extend({options:{position:"topright"},initialize:function(e){q(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 Ie(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?(st(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()}}),Di=function(e){return new jt(e)};We.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=ne("div",n+"control-container",this._container);function a(c,g){var P=n+c+" "+n+g;e[c+g]=ne("div",P,s)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)st(this._controlCorners[e]);st(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var zo=jt.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(b(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_"+b(this),s),this._layerControlInputs.push(a),a.layerId=b(e.layer),Be(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var g=document.createElement("span");n.appendChild(g),g.appendChild(a),g.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 g=e.length-1;g>=0;g--)n=e[g],s=this._getLayer(n.layerId).layer,n.checked?a.push(s):n.checked||c.push(s);for(g=0;g=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,Be(e,"click",Lt),this.expand();var n=this;setTimeout(function(){ot(e,"click",Lt),n._preventClick=!1})}}),Fa=function(e,n,s){return new zo(e,n,s)},Jt=jt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",s=ne("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 g=ne("a",s,a);return g.innerHTML=e,g.href="#",g.title=n,g.setAttribute("role","button"),g.setAttribute("aria-label",n),yi(g),Be(g,"click",wn),Be(g,"click",c,this),Be(g,"click",this._refocusOnMap,this),g},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";ct(this._zoomInButton,n),ct(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(Ie(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Ie(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});We.mergeOptions({zoomControl:!0}),We.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Jt,this.addControl(this.zoomControl))});var Ba=function(e){return new Jt(e)},Ao=jt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=ne("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=ne("div",n,s)),e.imperial&&(this._iScale=ne("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}}),Va=function(e){return new Ao(e)},ls='',Gn=jt.extend({options:{position:"bottomright",prefix:''+(_e.inlineSvg?ls+" ":"")+"Leaflet"},initialize:function(e){q(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=ne("div","leaflet-control-attribution"),yi(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(' ')}}});We.mergeOptions({attributionControl:!0}),We.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var us=function(e){return new Gn(e)};jt.Layers=zo,jt.Zoom=Jt,jt.Scale=Ao,jt.Attribution=Gn,Di.layers=Fa,Di.zoom=Ba,Di.scale=Va,Di.attribution=us;var dt=ye.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}});dt.addTo=function(e,n){return e.addHandler(n,this),this};var bi={Events:ce},Ni=_e.touch?"touchstart mousedown":"mousedown",Xt=re.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){q(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(Be(this._dragStartTarget,Ni,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xt._dragging===this&&this.finishDrag(!0),ot(this._dragStartTarget,Ni,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!gi(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Xt._dragging===this&&this.finishDrag();return}if(!(Xt._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Xt._dragging=this,this._preventOutline&&ss(this._element),Ns(),vi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=Co(this._element);this._startPoint=new ee(n.clientX,n.clientY),this._startPos=On(this._element),this._parentScale=Bs(s);var a=e.type==="mousedown";Be(document,a?"mousemove":"touchmove",this._onMove,this),Be(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 ee(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)g&&(P=A,g=I);g>s&&(n[P]=1,Xe(e,n,s,a,P),Xe(e,n,s,P,c))}function An(e,n){for(var s=[e[0]],a=1,c=0,g=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 In(e,n,s,a){var c=n.x,g=n.y,P=s.x-c,A=s.y-g,I=P*P+A*A,G;return I>0&&(G=((e.x-c)*P+(e.y-g)*A)/I,G>1?(c=s.x,g=s.y):G>0&&(c+=P*G,g+=A*G)),P=e.x-c,A=e.y-g,a?P*P+A*A:new ee(c,g)}function Mt(e){return!fe(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Vi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Mt(e)}function xi(e,n){var s,a,c,g,P,A,I,G;if(!e||e.length===0)throw new Error("latlngs not passed");Mt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var de=j([0,0]),Ne=Ye(e),Ke=Ne.getNorthWest().distanceTo(Ne.getSouthWest())*Ne.getNorthEast().distanceTo(Ne.getNorthWest());Ke<1700&&(de=qn(e));var Wt=e.length,Et=[];for(s=0;sa){I=(g-a)/c,G=[A.x-I*(A.x-P.x),A.y-I*(A.y-P.y)];break}var Qt=n.unproject(he(G));return j([Qt.lat+de.lat,Qt.lng+de.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Fi,closestPointOnSegment:Ua,clipSegment:cs,_getEdgeIntersection:ds,_getBitCode:$n,_sqClosestPointOnSegment:In,isFlat:Mt,_flat:Vi,polylineCenter:xi},Sn={project:function(e){return new ee(e.lng,e.lat)},unproject:function(e){return new Ue(e.y,e.x)},bounds:new Te([-180,-90],[180,90])},Ui={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Te([-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,g=Math.sqrt(1-c*c),P=g*Math.sin(a),A=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),g/2);return a=-s*Math.log(Math.max(A,1e-10)),new ee(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),g=Math.exp(-e.y/s),P=Math.PI/2-2*Math.atan(g),A=0,I=.1,G;A<15&&Math.abs(I)>1e-7;A++)G=c*Math.sin(P),G=Math.pow((1-G)/(1+G),c/2),I=Math.PI/2-2*Math.atan(g*G)-P,P+=I;return new Ue(P*n,e.x*n/s)}},Io={__proto__:null,LonLat:Sn,Mercator:Ui,SphericalMercator:it},ja=u({},z,{code:"EPSG:3395",projection:Ui,transformation:(function(){var e=.5/(Math.PI*Ui.R);return m(e,.5,-e,.5)})()}),Us=u({},z,{code:"EPSG:4326",projection:Sn,transformation:m(1/180,1,-1/180,.5)}),Do=u({},M,{projection:Sn,transformation:m(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});M.Earth=z,M.EPSG3395=ja,M.EPSG3857=f,M.EPSG900913=x,M.EPSG4326=Us,M.Simple=Do;var nn=re.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 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})}}});We.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 s in this._layers)e.call(n,this._layers[s]);return this},_addLayers:function(e){e=e?fe(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){Xn.prototype._setLatLngs.call(this,e),Mt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Mt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new ee(n,n);if(e=new Te(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,g;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||Xn.prototype._containsPoint.call(this,e,!0)}});function Uc(e,n){return new ps(e,n)}var Qn=Tn.extend({initialize:function(e,n){q(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=fe(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s0&&c.push(c[0].slice()),c}function ms(e,n){return e.feature?u({},e.feature,{geometry:n}):Vo(n)}function Vo(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ga={toGeoJSON:function(e){return ms(this,{type:"Point",coordinates:Ka(this.getLatLng(),e)})}};hs.include(Ga),Qe.include(Ga),W.include(Ga),Xn.include({toGeoJSON:function(e){var n=!Mt(this._latlngs),s=Bo(this._latlngs,n?1:0,!1,e);return ms(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),ps.include({toGeoJSON:function(e){var n=!Mt(this._latlngs),s=n&&!Mt(this._latlngs[0]),a=Bo(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),ms(this,{type:(s?"Multi":"")+"Polygon",coordinates:a})}}),wi.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(e).geometry.coordinates)}),ms(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 g=c.toGeoJSON(e);if(s)a.push(g.geometry);else{var P=Vo(g);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),s?ms(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Kr(e,n){return new Qn(e,n)}var Zc=Kr,Uo=nn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=Ye(n),q(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ie(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){st(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&&ln(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=Ye(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:ne("img");if(Ie(n,"leaflet-image-layer"),this._zoomAnimated&&Ie(n,"leaflet-zoom-animated"),this.options.className&&Ie(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onload=p(this.fire,this,"load"),n.onerror=p(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;Tt(this._image,s,n)},_reset:function(){var e=this._image,n=new Te(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();vt(e,n.min),e.style.width=s.x+"px",e.style.height=s.y+"px"},_updateOpacity:function(){Nt(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 Uo(e,n,s)},Gr=Uo.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:ne("video");if(Ie(n,"leaflet-image-layer"),this._zoomAnimated&&Ie(n,"leaflet-zoom-animated"),this.options.className&&Ie(n,this.options.className),n.onselectstart=O,n.onmousemove=O,n.onloadeddata=p(this.fire,this,"load"),e){for(var s=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}fe(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 g=0;gc?(n.height=c+"px",Ie(e,g)):ct(e,g),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),s=this._getAnchor();vt(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(Oi(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new ee(this._containerLeft,-s-this._containerBottom);c._add(On(this._container));var g=e.layerPointToContainerPoint(c),P=he(this.options.autoPanPadding),A=he(this.options.autoPanPaddingTopLeft||P),I=he(this.options.autoPanPaddingBottomRight||P),G=e.getSize(),de=0,Ne=0;g.x+a+I.x>G.x&&(de=g.x+a-G.x+I.x),g.x-de-A.x<0&&(de=g.x-A.x),g.y+s+I.y>G.y&&(Ne=g.y+s-G.y+I.y),g.y-Ne-A.y<0&&(Ne=g.y-A.y),(de||Ne)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([de,Ne]))}},_getAnchor:function(){return he(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Kc=function(e,n){return new Zo(e,n)};We.mergeOptions({closePopupOnClick:!0}),We.include({openPopup:function(e,n,s){return this._initOverlay(Zo,e,n,s).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),nn.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Zo,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 Tn||(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)){wn(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof h)){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 Ho=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=ne("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+b(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,s,a=this._map,c=this._container,g=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),A=this.options.direction,I=c.offsetWidth,G=c.offsetHeight,de=he(this.options.offset),Ne=this._getAnchor();A==="top"?(n=I/2,s=G):A==="bottom"?(n=I/2,s=0):A==="center"?(n=I/2,s=G/2):A==="right"?(n=0,s=G/2):A==="left"?(n=I,s=G/2):P.xthis.options.maxZoom||sa?this._retainParent(c,g,P,a):!1)},_retainChildren:function(e,n,s,a){for(var c=2*e;c<2*e+2;c++)for(var g=2*n;g<2*n+2;g++){var P=new ee(c,g);P.z=s+1;var A=this._tileCoordsToKey(P),I=this._tiles[A];if(I&&I.active){I.retain=!0;continue}else I&&I.loaded&&(I.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,s);return}for(var Ne=c.min.y;Ne<=c.max.y;Ne++)for(var Ke=c.min.x;Ke<=c.max.x;Ke++){var Wt=new ee(Ke,Ne);if(Wt.z=this._tileZoom,!!this._isValidTile(Wt)){var Et=this._tiles[this._tileCoordsToKey(Wt)];Et?Et.current=!0:P.push(Wt)}}if(P.sort(function(Qt,vs){return Qt.distanceTo(g)-vs.distanceTo(g)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(Ke=0;Kes.max.x)||!n.wrapLat&&(e.ys.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return Ye(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),g=n.unproject(a,e.z),P=n.unproject(c,e.z);return[g,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),s=new lt(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 ee(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(st(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Ie(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,_e.ielt9&&this.options.opacity<1&&Nt(e,this.options.opacity)},_addTile:function(e,n){var s=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),p(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&Oe(p(this._tileReady,this,e,null,c)),vt(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?(Nt(s.el,0),Q(this._fadeFrame),this._fadeFrame=Oe(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Ie(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),_e.ielt9||!this._map._fadeAnimated?Oe(this._pruneTiles,this):setTimeout(p(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var n=new ee(this._wrapX?k(e.x,this._wrapX):e.x,this._wrapY?k(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Te(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 Hs(e)}var gs=Hs.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=q(this,n),n.detectRetina&&_e.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 Be(s,"load",p(this._tileOnLoad,this,n,s)),Be(s,"error",p(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:_e.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 K(this._url,u(n,this.options))},_tileOnLoad:function(e,n){_e.ielt9?setTimeout(p(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=me;var s=this._tiles[e].coords;st(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",me),Hs.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===me))return Hs.prototype._tileReady.call(this,e,n,s)}});function Jr(e,n){return new gs(e,n)}var Xr=gs.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=q(this,n);var c=n.detectRetina&&_e.retina?2:1,g=this.getTileSize();s.width=g.x*c,s.height=g.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,gs.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=qe(s.project(n[0]),s.project(n[1])),c=a.min,g=a.max,P=(this._wmsVersion>=1.3&&this._crs===Us?[c.y,c.x,g.y,g.x]:[c.x,c.y,g.x,g.y]).join(","),A=gs.prototype.getTileUrl.call(this,e);return A+ge(this.wmsParams,A,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 Xr(e,n)}gs.WMS=Xr,Jr.wms=Jc;var ei=nn.extend({options:{padding:.1},initialize:function(e){q(this,e),b(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ie(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),g=a.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(e,n));_e.any3d?Tt(this._container,g,s):vt(this._container,g)},_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 Te(s,s.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Qr=ei.extend({options:{tolerance:0},getEvents:function(){var e=ei.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ei.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Be(e,"mousemove",this._onMouseMove,this),Be(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Be(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){Q(this._redrawRequest),delete this._ctx,st(this._container),ot(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)){ei.prototype._update.call(this);var e=this._bounds,n=this._container,s=e.getSize(),a=_e.retina?2:1;vt(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",_e.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ei.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,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[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(/[, ]+/),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=ne("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ei.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=js("shape");Ie(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=js("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;st(n),e.removeInteractiveTarget(n),delete this._layers[b(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=js("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=fe(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=js("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){ln(e._container)},_bringToBack:function(e){bn(e._container)}},jo=_e.vml?js:U,Ws=ei.extend({_initContainer:function(){this._container=jo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=jo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){st(this._container),ot(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.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)),vt(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=jo("path");e.options.className&&Ie(n,e.options.className),e.options.interactive&&Ie(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){st(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,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,B(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 ",g=e._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(e,g)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){ln(e._path)},_bringToBack:function(e){bn(e._path)}});_e.vml&&Ws.include(Xc);function tl(e){return _e.svg||_e.vml?new Ws(e):null}We.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&&el(e)||tl(e)}});var nl=ps.extend({initialize:function(e,n){ps.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=Ye(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Qc(e,n){return new nl(e,n)}Ws.create=jo,Ws.pointsToPath=B,Qn.geometryToLayer=Ro,Qn.coordsToLatLng=Wa,Qn.coordsToLatLngs=Fo,Qn.latLngToCoords=Ka,Qn.latLngsToCoords=Bo,Qn.getFeature=ms,Qn.asFeature=Vo,We.mergeOptions({boxZoom:!0});var il=dt.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(){Be(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){ot(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){st(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(),Ns(),this._startPoint=this._map.mouseEventToContainerPoint(e),Be(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=ne("div","leaflet-zoom-box",this._container),Ie(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Te(this._point,this._startPoint),s=n.getSize();vt(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(st(this._box),ct(this._container,"leaflet-crosshair")),Ai(),Rs(),ot(document,{contextmenu:wn,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(p(this._resetState,this),0);var n=new lt(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())}});We.addInitHook("addHandler","boxZoom",il),We.mergeOptions({doubleClickZoom:!0});var sl=dt.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)}});We.addInitHook("addHandler","doubleClickZoom",sl),We.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ol=dt.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Xt(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))}Ie(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ct(this._map._container,"leaflet-grab"),ct(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=Ye(this._map.options.maxBounds);this._offsetLimit=qe(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,g=(a+n+s)%e-n-s,P=Math.abs(c+s)0?g:-g))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});We.addInitHook("addHandler","scrollWheelZoom",rl);var ed=600;We.mergeOptions({tapHold:_e.touchNative&&_e.safari&&_e.mobile,tapTolerance:15});var ll=dt.extend({addHooks:function(){Be(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ot(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 ee(n.clientX,n.clientY),this._holdTimeout=setTimeout(p(function(){this._cancel(),this._isTapValid()&&(Be(document,"touchend",Lt),Be(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),ed),Be(document,"touchend touchcancel contextmenu",this._cancel,this),Be(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){ot(document,"touchend",Lt),ot(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),ot(document,"touchend touchcancel contextmenu",this._cancel,this),ot(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ee(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)}});We.addInitHook("addHandler","tapHold",ll),We.mergeOptions({touchZoom:_e.touch,bounceAtZoomLimits:!0});var ul=dt.extend({addHooks:function(){Ie(this._map._container,"leaflet-touch-zoom"),Be(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ct(this._map._container,"leaflet-touch-zoom"),ot(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(),Be(document,"touchmove",this._onTouchMove,this),Be(document,"touchend touchcancel",this._onTouchEnd,this),Lt(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 g=s._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&g.x===0&&g.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(g),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),Q(this._animRequest);var P=p(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Oe(P,this,!0),Lt(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Q(this._animRequest),ot(document,"touchmove",this._onTouchMove,this),ot(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))}});We.addInitHook("addHandler","touchZoom",ul),We.BoxZoom=il,We.DoubleClickZoom=sl,We.Drag=ol,We.Keyboard=al,We.ScrollWheelZoom=rl,We.TapHold=ll,We.TouchZoom=ul,o.Bounds=Te,o.Browser=_e,o.CRS=M,o.Canvas=Qr,o.Circle=Qe,o.CircleMarker=W,o.Class=ye,o.Control=jt,o.DivIcon=Yr,o.DivOverlay=Dn,o.DomEvent=Oo,o.DomUtil=Na,o.Draggable=Xt,o.Evented=re,o.FeatureGroup=Tn,o.GeoJSON=Qn,o.GridLayer=Hs,o.Handler=dt,o.Icon=cn,o.ImageOverlay=Uo,o.LatLng=Ue,o.LatLngBounds=lt,o.Layer=nn,o.LayerGroup=wi,o.LineUtil=kn,o.Map=We,o.Marker=hs,o.Mixin=bi,o.Path=h,o.Point=ee,o.PolyUtil=$o,o.Polygon=ps,o.Polyline=Xn,o.Popup=Zo,o.PosAnimation=Ii,o.Projection=Io,o.Rectangle=nl,o.Renderer=ei,o.SVG=Ws,o.SVGOverlay=qr,o.TileLayer=gs,o.Tooltip=Ho,o.Transformation=wt,o.Util=ue,o.VideoOverlay=Gr,o.bind=p,o.bounds=qe,o.canvas=el,o.circle=Bc,o.circleMarker=T,o.control=Di,o.divIcon=qc,o.extend=u,o.featureGroup=pt,o.geoJSON=Kr,o.geoJson=Zc,o.gridLayer=Yc,o.icon=Zs,o.imageOverlay=Hc,o.latLng=j,o.latLngBounds=Ye,o.layerGroup=fs,o.map=rs,o.marker=w,o.point=he,o.polygon=Uc,o.polyline=Vc,o.popup=Kc,o.rectangle=Qc,o.setOptions=q,o.stamp=b,o.svg=tl,o.svgOverlay=Wc,o.tileLayer=Jr,o.tooltip=Gc,o.transformation=m,o.version=l,o.videoOverlay=jc;var td=window.L;o.noConflict=function(){return window.L=td,this},window.L=o}))})(eo,eo.exports)),eo.exports}var nm=tm();const Qo=Qp(nm),cu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]}},setup(t){const i=t,o=H(null);let l,u,d;function p(){if(!l)return;const _=i.position;if(_&&(_.lat||_.lng)){const b=[_.lat,_.lng];u?u.setLatLng(b):(u=Qo.marker(b).addTo(l),l.setView(b,17))}if(d&&d.remove(),i.trail.length){const b=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Qo.polyline(i.trail,{color:b,weight:3}).addTo(l)}}return ui(()=>{l=Qo.map(o.value,{zoomControl:!0}).setView([20,0],2),Qo.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),p()}),en(()=>i.position,p,{deep:!0}),en(()=>i.trail,p,{deep:!0}),(_,b)=>(v(),y("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},im=["width","height","stroke-width"],sm=["d"],Y={__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)=>(v(),y("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"},[(v(!0),y(ae,null,Fe(Re(l),(p,_)=>(v(),y("path",{key:_,d:p},null,8,sm))),128))],8,im))}},om=["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)=>(v(),y("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Me(["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:Me(["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,om))}},am={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},rm=["onClick"],hn={__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)=>(v(),y("div",am,[(v(!0),y(ae,null,Fe(t.options,d=>(v(),y("button",{key:d.value,type:"button",class:Me(["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:p=>o("update:modelValue",d.value)},[d.icon?(v(),et(Y,{key:0,name:d.icon,size:15},null,8,["name"])):D("",!0),$(" "+S(d.label),1)],10,rm))),128))]))}},lm={class:"text-sm font-semibold text-ink"},um={key:0,class:"mt-0.5 text-xs text-ink-muted"},Se={__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=so("settingsSearch",{value:""}),l=xe(()=>{const u=(o.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(v(),y("div",{key:0,class:Me(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Me(t.block?"mb-3":"min-w-0")},[r("div",lm,S(t.title),1),t.desc?(v(),y("div",um,S(t.desc),1)):D("",!0)],2),r("div",{class:Me(t.block?"":"shrink-0")},[xf(u.$slots,"default")],2)],2)):D("",!0)}},cm=(t,i)=>{const o=t.__vccOpts||t;for(const[l,u]of i)o[l]=u;return o},dm={class:"mx-auto max-w-[1280px] p-7"},fm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},hm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},pm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},mm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},gm=["onClick"],vm={class:"whitespace-nowrap"},_m={class:"min-w-0"},ym={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},bm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},xm={key:1,class:"panel mb-5 p-5"},wm={class:"flex items-center gap-1"},km={class:"flex items-center gap-2"},Sm={class:"font-mono text-sm text-ink"},Tm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Pm={key:0,class:"mt-2 text-xs text-ink-muted"},Cm={class:"grid max-w-[420px] gap-2"},Lm={class:"flex items-center gap-3"},Mm={key:2,class:"panel mb-5 p-5"},Em=["value"],Om=["value"],zm=["value"],Am={class:"font-mono text-sm text-ink"},$m={key:3},Im={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Dm=["onClick"],Nm={key:1,class:"panel mb-5 p-5"},Rm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Fm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Bm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Vm={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"},Um={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Zm={key:0},Hm={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},jm={class:"font-semibold text-ink-secondary"},Wm={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Km={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"},Gm={class:"flex items-center justify-between gap-3"},qm={class:"flex items-center gap-2 text-sm font-semibold text-ink"},Ym={key:0,class:"text-[11px] text-ink-muted"},Jm={class:"mt-2 flex items-baseline gap-1.5"},Xm={class:"font-mono text-2xl font-semibold text-ink"},Qm={class:"text-sm text-ink-muted"},eg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},tg={class:"mt-2 text-xs text-ink-muted"},ng={class:"mt-2 text-sm text-ink"},ig={class:"font-semibold"},sg={class:"mt-1 text-xs text-ink-muted"},og={key:1,class:"mt-2 text-xs text-ink-muted"},ag={key:0,class:"inline-flex items-center gap-2 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"},lg={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"},cg={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"},fg={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"},pg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},mg={class:"mt-4 flex flex-wrap items-center gap-3"},gg=["disabled"],vg=["disabled"],_g={key:2,class:"text-xs text-danger-fg"},yg={class:"panel mb-5 p-5"},bg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},xg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},wg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},kg={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"},Sg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Tg={key:0},Pg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Cg={class:"font-semibold text-ink-secondary"},Lg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Mg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Eg={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"},Og={key:0,class:"inline-flex items-center gap-2 font-mono 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"},Ag={key:0,class:"inline-flex items-center gap-2 font-mono 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 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={class:"mt-4 flex flex-wrap items-center gap-3"},Yg=["disabled"],Jg=["disabled"],Xg={key:2,class:"text-xs text-danger-fg"},Qg={key:3,class:"text-[11px] text-ink-muted"},ev={class:"panel mb-5 p-5"},tv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},nv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},iv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},sv={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"},ov={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},av={key:0},rv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},lv={class:"font-semibold text-ink-secondary"},uv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},cv={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},dv={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"},fv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},hv={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"},pv={key:0,class:"inline-flex items-center gap-2 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 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={class:"mt-4 flex flex-wrap items-center gap-3"},xv=["disabled"],wv=["disabled"],kv={key:2,class:"text-xs text-danger-fg"},Sv={key:3,class:"text-[11px] text-ink-muted"},Tv={key:3,class:"panel mb-5 p-5"},Pv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Cv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Lv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Mv={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ev={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"},Ov={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},zv={key:0},Av={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},$v={class:"font-semibold text-ink-secondary"},Iv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},Dv={class:"flex w-full flex-col gap-2"},Nv={class:"break-all 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"},Fv={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"},Bv={key:0,class:"text-xs text-ink-muted"},Vv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Uv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Zv={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"},Hv={class:"mt-4 flex flex-wrap items-center gap-3"},jv=["disabled"],Wv=["disabled"],Kv={key:2,class:"text-xs text-danger-fg"},Gv={key:3,class:"text-[11px] text-ink-muted"},qv={key:4,class:"panel mb-5 p-5"},Yv={class:"flex items-center gap-4"},Jv=["src"],Xv={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},Qv={class:"flex gap-2"},e_={class:"btn-ghost cursor-pointer"},t_={class:"mt-1 text-right text-[11px] text-ink-muted"},n_={key:5,class:"panel mb-5 p-5"},i_={class:"flex items-center gap-3"},s_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},o_={class:"flex flex-wrap items-center gap-4"},a_={class:"min-w-0"},r_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},l_={class:"mt-3 flex items-center gap-2"},u_={key:0,class:"mt-2 text-xs text-danger-fg"},c_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},d_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},f_={class:"rounded-lg border border-line bg-surface-2 p-3"},h_={class:"flex items-center gap-3"},p_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},m_={class:"min-w-0 flex-1"},g_={class:"text-sm font-semibold text-ink"},v_={class:"font-mono text-[11px] text-ink-muted"},__={key:6,class:"mb-5"},y_={key:0,class:"panel mb-5 p-5"},b_={class:"grid max-w-[520px] gap-2"},x_={class:"flex flex-wrap gap-2"},w_=["disabled","title"],k_=["value"],S_=["value"],T_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},P_={class:"flex items-center gap-3"},C_=["disabled"],L_={key:0,class:"text-xs text-danger-fg"},M_={key:1,class:"text-xs text-ink-muted"},E_={key:1,class:"panel mb-5 p-5"},O_={class:"grid max-w-[520px] gap-2"},z_={class:"flex flex-wrap gap-2"},A_=["value"],$_=["value"],I_={key:1,class:"text-xs text-ink-muted"},D_={class:"font-semibold text-ink-secondary"},N_={class:"flex items-center gap-3"},R_=["disabled"],F_={key:0,class:"text-xs text-danger-fg"},B_={class:"panel overflow-hidden p-0"},V_={class:"flex items-center justify-between px-5 py-4"},U_=["disabled"],Z_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},H_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},j_={key:2,class:"overflow-x-auto"},W_={class:"w-full border-collapse text-sm"},K_={class:"text-left"},G_={class:"px-5 py-3"},q_={class:"text-ink"},Y_={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},J_={class:"px-5 py-3"},X_={class:"px-5 py-3"},Q_={class:"px-5 py-3"},ey={class:"px-5 py-3 text-right"},ty=["onClick"],ny={key:1,class:"inline-flex items-center gap-1.5"},iy=["onClick"],sy=["onClick"],oy={key:7,class:"mb-5"},ay={key:0,class:"panel mb-5 p-5"},ry={class:"grid max-w-[520px] gap-2"},ly={class:"flex items-center gap-3"},uy={key:0,class:"text-xs text-danger-fg"},cy={key:1,class:"panel mb-5 p-5"},dy={class:"grid max-w-[520px] gap-2"},fy={class:"flex items-center gap-3"},hy=["disabled"],py={key:0,class:"text-xs text-danger-fg"},my={class:"panel overflow-hidden p-0"},gy={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},vy={key:1,class:"overflow-x-auto"},_y={class:"w-full border-collapse text-sm"},yy={class:"text-left"},by={class:"px-5 py-3"},xy={class:"inline-flex items-center gap-2 text-ink"},wy={class:"px-5 py-3 text-ink-secondary"},ky={class:"px-5 py-3 text-right"},Sy=["onClick"],Ty={key:1,class:"inline-flex items-center gap-1.5"},Py=["onClick"],Cy=["disabled","title","onClick"],Ly={key:8,class:"mb-5"},My={class:"panel mb-5 p-5"},Ey={class:"btn-ghost cursor-pointer"},Oy={key:0,class:"mt-2 text-xs text-ink-muted"},zy={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Ay={class:"flex items-center gap-2 text-danger-fg"},$y={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Iy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Dy={class:"mt-3"},Ny={class:"eyebrow mb-1 block"},Ry={class:"text-ink"},Fy=["placeholder"],By={class:"mt-4 flex flex-wrap items-center gap-3"},Vy=["disabled"],Uy=["disabled"],Zy={key:2,class:"text-xs text-ink-muted"},Hy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},jy={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"},du="pv.opensky.health",fu="pv.filetransfer.health",hu="pv.webdav.health",pu="pv.localstorage.health",Wy={__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=xe(()=>o.role==="superadmin"),d=xe(()=>o.role==="admin"||o.role==="superadmin");function p(w){return w==="superadmin"?"Superadmin":w==="admin"?"Admin":"User"}function _(w){return w==="superadmin"||w==="admin"?"shield":"user"}function b(w){return w==="superadmin"||w==="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"},k=xe(()=>{const w=[{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&&w.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&w.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),w.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),w}),O=H("account"),R=H("");ju("settingsSearch",R);const F=xe(()=>R.value.trim().length>0),X=xe(()=>R.value.trim().toLowerCase());function q(w){return X.value?(w.label+" "+w.kw).toLowerCase().includes(X.value)||we(w.id):!0}const ge={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 we(w){return X.value?(ge[w]||[]).some(h=>h.includes(X.value)):!0}const K=xe(()=>F.value?k.value.filter(q):k.value.filter(w=>w.id===O.value)),fe=xe({get:()=>Xi.value,set:w=>ha(w)}),ie=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],me=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Le=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Ee=[["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"]],$e=H(Date.now());let Oe=null;const Q=xe(()=>ru($e.value)),ue=xt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),ye=H("user"),ze=xt({clientId:"",clientSecret:"",plan:"",bbox:""}),ce=H(""),re=H(!1),ee=H(!1),nt=H(null),he=H(null),Te=xe(()=>nt.value&&nt.value.credits||null),qe=xe(()=>{const w=Te.value;return!w||!w.daily||w.remaining==null?null:Math.max(0,Math.min(100,Math.round(w.remaining/w.daily*100)))}),lt=xe(()=>{const w=qe.value;return w==null?"bg-accent":w<=10?"bg-danger":w<=30?"bg-amber":"bg-success"});function Ye(w){return typeof w=="number"?w.toLocaleString():w}function Ue(){if(!he.value)return"";const w=Math.max(0,Math.round((Date.now()-he.value)/1e3));if(w<60)return"just now";const h=Math.round(w/60);if(h<60)return`${h} min ago`;const W=Math.round(h/60);return W<24?`${W} h ago`:`${Math.round(W/24)} d ago`}function j(){try{nt.value&&localStorage.setItem(du,JSON.stringify({health:nt.value,ts:he.value}))}catch{}}function M(){try{const w=localStorage.getItem(du);if(!w)return;const h=JSON.parse(w);h&&h.health&&(nt.value=h.health,he.value=h.ts||null)}catch{}}const z=[{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"}],it=xe(()=>ue.isSuperadmin),wt=xe(()=>ue.isSuperadmin?"user":ye.value),m=xe(()=>ue.scopes[wt.value]||{editableLayer:"user",fields:{}}),f=xe(()=>wt.value==="org");function x(w){return m.value.fields[w]||{effective:"",own:"",source:"unset",locked:!1}}function U(w){return it.value||x(w).locked}function B(w){const h=x(w).source;return h==="global"?"Set by administrator":h==="org"?"Set by your organization":""}function V(){ze.clientId=x("clientId").own||"",ze.clientSecret=x("clientSecret").own||"",ze.plan=x("plan").own||"",ze.bbox=x("bbox").own||""}function te(w){ue.available=!!w.available,ue.orgEnabled=w.orgEnabled!==!1,ue.allowAnonymous=!!w.allowAnonymous,ue.enabled=!!w.enabled,ue.canEditOrg=!!w.canEditOrg,ue.isSuperadmin=!!w.isSuperadmin,ue.scopes=w.scopes||{},ye.value==="org"&&!ue.canEditOrg&&(ye.value="user"),V(),ue.loaded=!0}en(ye,()=>{ce.value="",V()});async function N(){M();const{ok:w,body:h}=await up();w&&te(h)}async function J(w){const h=f.value;h?ue.orgEnabled=w:ue.enabled=w;const{ok:W,body:T}=await iu(h?{scope:"org",enabled:w}:{scope:"user",enabled:w});W?(te(T),Je(h?w?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":w?"OpenSky enabled.":"OpenSky disabled.")):(h?ue.orgEnabled=!w:ue.enabled=!w,Je(T.error||"Could not update."))}async function Z(){ce.value="",re.value=!0;const w={};for(const Qe of["clientId","clientSecret","plan","bbox"])U(Qe)||(w[Qe]=ze[Qe]);const h={scope:wt.value,config:w};f.value||(h.enabled=ue.enabled);const{ok:W,body:T}=await iu(h);if(re.value=!1,!W){ce.value=T.error||"Could not save settings.";return}te(T),Je(f.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function Pe(){ee.value=!0,nt.value=null;const{ok:w,body:h}=await cp();ee.value=!1,nt.value=w&&h.health?h.health:{status:"down",detail:h.error||"Probe failed."},he.value=Date.now(),j()}function le(w){return w==="ok"?C.success:w==="degraded"?C.warning:C.danger}const se=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Ce=H("user"),He=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],ke=xt(Object.fromEntries(He.map(w=>[w,""]))),Ge=H(""),ft=H(!1),gt=H(!1),yt=H(null),Ct=H(null),_n=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],di=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],St=xe(()=>se.isSuperadmin),Dt=xe(()=>se.isSuperadmin?"user":Ce.value),En=xe(()=>se.scopes[Dt.value]||{editableLayer:"user",fields:{}}),Ut=xe(()=>Dt.value==="org"),Qi=xe(()=>(Zt("protocol")?At("protocol").effective:ke.protocol)||"sftp");function At(w){return En.value.fields[w]||{effective:"",own:"",source:"unset",locked:!1}}function Zt(w){return St.value||At(w).locked}function bt(w){const h=At(w).source;return h==="global"?"Set by administrator":h==="org"?"Set by your organization":""}function Pa(w){return(_n.find(h=>h.value===w)||{}).label||w||"—"}function xo(){for(const w of He)ke[w]=At(w).own||"";ke.protocol||(ke.protocol="sftp"),ke.insecureSkipVerify||(ke.insecureSkipVerify="false")}function Es(w){se.available=!!w.available,se.orgEnabled=w.orgEnabled!==!1,se.enabled=!!w.enabled,se.canEditOrg=!!w.canEditOrg,se.isSuperadmin=!!w.isSuperadmin,se.scopes=w.scopes||{},Ce.value==="org"&&!se.canEditOrg&&(Ce.value="user"),xo(),se.loaded=!0}en(Ce,()=>{Ge.value="",xo()});function Ca(){if(!Ct.value)return"";const w=Math.max(0,Math.round((Date.now()-Ct.value)/1e3));if(w<60)return"just now";const h=Math.round(w/60);if(h<60)return`${h} min ago`;const W=Math.round(h/60);return W<24?`${W} h ago`:`${Math.round(W/24)} d ago`}function La(){try{yt.value&&localStorage.setItem(fu,JSON.stringify({health:yt.value,ts:Ct.value}))}catch{}}function Ma(){try{const w=localStorage.getItem(fu);if(!w)return;const h=JSON.parse(w);h&&h.health&&(yt.value=h.health,Ct.value=h.ts||null)}catch{}}async function Os(){Ma();const{ok:w,body:h}=await dp();w&&Es(h)}async function wo(w){const h=Ut.value;h?se.orgEnabled=w:se.enabled=w;const{ok:W,body:T}=await su(h?{scope:"org",enabled:w}:{scope:"user",enabled:w});W?(Es(T),Je(h?w?"File transfer enabled for your organization.":"File transfer disabled for your organization.":w?"File transfer enabled.":"File transfer disabled.")):(h?se.orgEnabled=!w:se.enabled=!w,Je(T.error||"Could not update."))}async function Ea(){Ge.value="",ft.value=!0;const w={};for(const Qe of He)Zt(Qe)||(w[Qe]=ke[Qe]);const h={scope:Dt.value,config:w};Ut.value||(h.enabled=se.enabled);const{ok:W,body:T}=await su(h);if(ft.value=!1,!W){Ge.value=T.error||"Could not save settings.";return}Es(T),Je(Ut.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Oa(){gt.value=!0,yt.value=null;const{ok:w,body:h}=await fp();gt.value=!1,yt.value=w&&h.health?h.health:{status:"down",detail:h.error||"Probe failed."},Ct.value=Date.now(),La()}function za(w){return w==="ok"?C.success:w==="degraded"?C.warning:C.danger}const je=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),_e=H("user"),es=["baseURL","username","password","insecureSkipVerify","basePath"],$t=xt(Object.fromEntries(es.map(w=>[w,""]))),fi=H(""),Ei=H(!1),hi=H(!1),an=H(null),tn=H(null),ko=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],zs=xe(()=>je.isSuperadmin),As=xe(()=>je.isSuperadmin?"user":_e.value),Aa=xe(()=>je.scopes[As.value]||{editableLayer:"user",fields:{}}),rn=xe(()=>As.value==="org");function yn(w){return Aa.value.fields[w]||{effective:"",own:"",source:"unset",locked:!1}}function pi(w){return zs.value||yn(w).locked}function Ht(w){const h=yn(w).source;return h==="global"?"Set by administrator":h==="org"?"Set by your organization":""}function So(){for(const w of es)$t[w]=yn(w).own||"";$t.insecureSkipVerify||($t.insecureSkipVerify="false")}function $s(w){je.available=!!w.available,je.orgEnabled=w.orgEnabled!==!1,je.enabled=!!w.enabled,je.canEditOrg=!!w.canEditOrg,je.isSuperadmin=!!w.isSuperadmin,je.scopes=w.scopes||{},_e.value==="org"&&!je.canEditOrg&&(_e.value="user"),So(),je.loaded=!0}en(_e,()=>{fi.value="",So()});function $a(){if(!tn.value)return"";const w=Math.max(0,Math.round((Date.now()-tn.value)/1e3));if(w<60)return"just now";const h=Math.round(w/60);if(h<60)return`${h} min ago`;const W=Math.round(h/60);return W<24?`${W} h ago`:`${Math.round(W/24)} d ago`}function Ia(){try{an.value&&localStorage.setItem(hu,JSON.stringify({health:an.value,ts:tn.value}))}catch{}}function Da(){try{const w=localStorage.getItem(hu);if(!w)return;const h=JSON.parse(w);h&&h.health&&(an.value=h.health,tn.value=h.ts||null)}catch{}}async function Is(){Da();const{ok:w,body:h}=await mp();w&&$s(h)}async function mi(w){const h=rn.value;h?je.orgEnabled=w:je.enabled=w;const{ok:W,body:T}=await ou(h?{scope:"org",enabled:w}:{scope:"user",enabled:w});W?($s(T),Je(h?w?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":w?"WebDAV enabled.":"WebDAV disabled.")):(h?je.orgEnabled=!w:je.enabled=!w,Je(T.error||"Could not update."))}async function To(){fi.value="",Ei.value=!0;const w={};for(const Qe of es)pi(Qe)||(w[Qe]=$t[Qe]);const h={scope:As.value,config:w};rn.value||(h.enabled=je.enabled);const{ok:W,body:T}=await ou(h);if(Ei.value=!1,!W){fi.value=T.error||"Could not save settings.";return}$s(T),Je(rn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function Po(){hi.value=!0,an.value=null;const{ok:w,body:h}=await gp();hi.value=!1,an.value=w&&h.health?h.health:{status:"down",detail:h.error||"Probe failed."},tn.value=Date.now(),Ia()}function Oi(w){return w==="ok"?C.success:w==="degraded"?C.warning:C.danger}const ne=xt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),st=H("user"),jn=H(""),ln=H(""),bn=H(!1),gi=H(!1),Ie=H(null),ct=H(null),Wn=H({}),zi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Nt=xe(()=>ne.isSuperadmin),Ds=xe(()=>ne.isSuperadmin?"user":st.value),ts=xe(()=>ne.scopes[Ds.value]||{editableLayer:"user",fields:{}}),Tt=xe(()=>Ds.value==="org");function vt(w){return ts.value.fields[w]||{effective:"",own:"",source:"unset",locked:!1}}function On(w){return Nt.value||vt(w).locked}function vi(w){const h=vt(w).source;return h==="global"?"Set by administrator":h==="org"?"Set by your organization":""}function Ai(w){return(zi.find(h=>h.value===w)||{}).label||"Inherit"}function ns(){jn.value=vt("readOnly").own||""}function xn(w){ne.available=!!w.available,ne.orgEnabled=w.orgEnabled!==!1,ne.enabled=!!w.enabled,ne.canEditOrg=!!w.canEditOrg,ne.isSuperadmin=!!w.isSuperadmin,ne.isOrgUser=!!w.isOrgUser,ne.mounts=Array.isArray(w.mounts)?w.mounts:[],ne.privateFolder=!!w.privateFolder,ne.privateEnabled=!!w.privateEnabled,ne.allowPrivate=w.allowPrivate!==!1,ne.rootConfigured=!!w.rootConfigured,ne.scopes=w.scopes||{},st.value==="org"&&!ne.canEditOrg&&(st.value="user"),ns(),ne.loaded=!0}en(st,()=>{ln.value="",ns()});function Ns(){if(!ct.value)return"";const w=Math.max(0,Math.round((Date.now()-ct.value)/1e3));if(w<60)return"just now";const h=Math.round(w/60);if(h<60)return`${h} min ago`;const W=Math.round(h/60);return W<24?`${W} h ago`:`${Math.round(W/24)} d ago`}function Rs(){try{Ie.value&&localStorage.setItem(pu,JSON.stringify({health:Ie.value,ts:ct.value}))}catch{}}function is(){try{const w=localStorage.getItem(pu);if(!w)return;const h=JSON.parse(w);h&&h.health&&(Ie.value=h.health,ct.value=h.ts||null)}catch{}}async function Fs(){is();const{ok:w,body:h}=await hp();w&&xn(h)}async function ss(w){const h=Tt.value;h?ne.orgEnabled=w:ne.enabled=w;const{ok:W,body:T}=await Xo(h?{scope:"org",enabled:w}:{scope:"user",enabled:w});W?(xn(T),Je(h?w?"Local storage enabled for your organization.":"Local storage disabled for your organization.":w?"Local storage enabled.":"Local storage disabled.")):(h?ne.orgEnabled=!w:ne.enabled=!w,Je(T.error||"Could not update."))}async function os(w){ne.privateFolder=w;const{ok:h,body:W}=await Xo({scope:"user",privateFolder:w});h?(xn(W),Je(w?"Private folder enabled.":"Private folder disabled.")):(ne.privateFolder=!w,Je(W.error||"Could not update."))}async function Co(w){ne.allowPrivate=w;const{ok:h,body:W}=await Xo({scope:"org",allowPrivate:w});h?(xn(W),Je(w?"Members may now create private folders.":"Private folders disabled for your organization.")):(ne.allowPrivate=!w,Je(W.error||"Could not update."))}async function Bs(){ln.value="",bn.value=!0;const w={};On("readOnly")||(w.readOnly=jn.value);const h={scope:Ds.value,config:w};Tt.value||(h.enabled=ne.enabled);const{ok:W,body:T}=await Xo(h);if(bn.value=!1,!W){ln.value=T.error||"Could not save settings.";return}xn(T),Je(Tt.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Na(){gi.value=!0,Ie.value=null,Wn.value={};const{ok:w,body:h}=await pp();gi.value=!1,Ie.value=w&&h.health?h.health:{status:"down",detail:h.error||"Probe failed."};const W={};if(Array.isArray(h.mounts))for(const T of h.mounts)W[T.id]={status:T.status,detail:T.detail};Wn.value=W,ct.value=Date.now(),Rs()}function Be(w){return w==="ok"?C.success:w==="degraded"?C.warning:C.danger}const un=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],ot=H("apis-external");function as(w){return F.value||ot.value===w}const _i=H("");let $i=null;function Je(w){_i.value=w,clearTimeout($i),$i=setTimeout(()=>_i.value="",2200)}const kt=xt({current:"",next:"",confirm:""}),zn=H(""),yi=H(!1);function Lt(){if(yi.value=!1,!kt.current)return zn.value="Enter your current password.";if(kt.next.length<8)return zn.value="New password must be at least 8 characters.";if(kt.next!==kt.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",kt.current=kt.next=kt.confirm=""}const wn=H("");function Lo(){wn.value="Verification link would be sent once the account service is wired up."}function Mo(w){const h=w.target.files&&w.target.files[0];if(!h)return;if(h.size>1.5*1024*1024){Je("Image too large (max ~1.5 MB).");return}const W=new FileReader;W.onload=()=>{De.avatar=String(W.result),Je("Photo updated.")},W.readAsDataURL(h)}function Ra(){De.avatar="",Je("Photo removed.")}const Eo=xe(()=>{var W,T,Qe;const h=(De.displayName||De.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((W=h[0])==null?void 0:W[0])||"P")+(((T=h[1])==null?void 0:T[0])||((Qe=h[0])==null?void 0:Qe[1])||"V")).toUpperCase()}),Kn=H(!1),Oo=H(""),Ii=H(""),We=H(""),rs=H([]);function jt(w){const h="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let W="";for(let T=0;Tjt(4).toLowerCase()+"-"+jt(4).toLowerCase()),We.value=""}function Fa(){De.twoFactor=!1,rs.value=[],Kn.value=!1}const Jt=navigator.userAgent;function Ba(){return/Edg\//.test(Jt)?"Edge":/OPR\//.test(Jt)?"Opera":/Chrome\//.test(Jt)?"Chrome":/Firefox\//.test(Jt)?"Firefox":/Safari\//.test(Jt)?"Safari":"Browser"}function Ao(){return/Windows/.test(Jt)?"Windows":/Mac OS X/.test(Jt)?"macOS":/Android/.test(Jt)?"Android":/iPhone|iPad/.test(Jt)?"iOS":/Linux/.test(Jt)?"Linux":"Unknown OS"}const Va=Date.now(),ls=H([]),Gn=H(!1),us=H(""),dt=xt({email:"",password:"",role:"user",organization:""}),bi=H(""),Ni=H(!1),Xt=H(""),Vs=xe(()=>{const w=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&w.push({value:"superadmin",label:"Superadmin"}),w}),Ri=H([]);async function qn(){if(!d.value)return;const w=await ip();w.ok&&(Ri.value=w.organizations.slice().sort((h,W)=>h.name.localeCompare(W.name)))}const $o=xe(()=>{const w=Ri.value.map(h=>({value:h.id,label:h.name}));return u.value&&w.unshift({value:"",label:"No organization"}),w});async function Yn(){if(!d.value)return;Gn.value=!0,us.value="";const w=await Qh();if(Gn.value=!1,!w.ok){us.value=w.status===403?"Manager role required.":"Could not load users.";return}ls.value=w.users.slice().sort((h,W)=>h.email.localeCompare(W.email))}function Fi(w){try{const h=w.data||{},W=Object.keys(h)[0];return W&&h[W]&&h[W].message||w.message||w.error||"Invalid input."}catch{return w.error||"Could not create user."}}async function Ua(){bi.value="";const w=dt.email.trim().toLowerCase();if(!w.includes("@"))return bi.value="Enter a valid email.";if(dt.password.length<8)return bi.value="Password must be at least 8 characters.";Ni.value=!0;const h=u.value?dt.organization:o.organization,{ok:W,body:T}=await ep(w,dt.password,dt.role,h);if(Ni.value=!1,!W)return bi.value=Fi(T);dt.email="",dt.password="",dt.role="user",dt.organization="",Je("User created."),Yn()}async function Za(w){const{ok:h,body:W}=await np(w.id);if(Xt.value="",!h)return Je(W.error||"Could not remove user.");Je("User removed."),Yn()}const Xe=xt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=H(""),Bi=H(!1),cs=xe(()=>!!Xe.id&&Xe.email===o.email);function ds(w){Xt.value="",Xe.id=w.id,Xe.email=w.email,Xe.role=w.role||"user",Xe.verified=!!w.verified,Xe.password="",Xe.organization=w.organization||"",An.value=""}function $n(){Xe.id="",An.value=""}async function Ha(){An.value="";const w=Xe.email.trim().toLowerCase();if(!w.includes("@"))return An.value="Enter a valid email.";if(Xe.password&&Xe.password.length<8)return An.value="New password must be at least 8 characters (or leave blank).";const h={email:w,role:Xe.role,verified:Xe.verified};u.value&&(h.organization=Xe.organization),Xe.password&&(h.password=Xe.password),Bi.value=!0;const{ok:W,body:T}=await tp(Xe.id,h);if(Bi.value=!1,!W)return An.value=Fi(T);Je("User updated."),$n(),Yn()}const In=xt({name:""}),Mt=H(""),Vi=H(!1),xi=H(""),kn=xt({id:"",name:""}),Sn=H(""),Ui=xe(()=>{const w={};for(const h of ls.value)h.organization&&(w[h.organization]=(w[h.organization]||0)+1);return w});async function Io(){Mt.value="";const w=In.name.trim();if(!w)return Mt.value="Enter an organization name.";Vi.value=!0;const{ok:h,body:W}=await sp(w);if(Vi.value=!1,!h)return Mt.value=Fi(W);In.name="",Je("Organization created."),qn()}function ja(w){xi.value="",kn.id=w.id,kn.name=w.name,Sn.value=""}function Us(){kn.id="",Sn.value=""}async function Do(){Sn.value="";const w=kn.name.trim();if(!w)return Sn.value="Enter an organization name.";const{ok:h,body:W}=await op(kn.id,w);if(!h)return Sn.value=Fi(W);Je("Organization renamed."),Us(),qn(),Yn()}async function nn(w){const{ok:h,body:W}=await ap(w.id);if(xi.value="",!h)return Je(W.error||"Could not delete organization.");Je("Organization deleted."),qn()}function wi(){const w={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...De},themeMode:Xi.value},h=new Blob([JSON.stringify(w,null,2)],{type:"application/json"}),W=URL.createObjectURL(h),T=document.createElement("a");T.href=W,T.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(T),T.click(),T.remove(),URL.revokeObjectURL(W),Je("Settings exported.")}const fs=H("");function Tn(w){const h=w.target.files&&w.target.files[0];if(!h)return;const W=new FileReader;W.onload=()=>{try{const T=JSON.parse(String(W.result)),Qe=T.prefs||T;if(!Nc(Qe))throw new Error("bad shape");T.themeMode&&ha(T.themeMode),Ur(De.fontSize),Zr(De.reduceMotion),fs.value="Settings imported and applied."}catch{fs.value="That file is not a valid PilotVault settings export."}},W.readAsText(h),w.target.value=""}const pt=xt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const Zs=xe(()=>o.email||"DELETE MY ACCOUNT"),Jn=xe(()=>pt.understand&&pt.typed===Zs.value);function No(){Jn.value&&(pt.armed=!0,pt.cooldown=5,clearInterval(cn),cn=setInterval(()=>{pt.cooldown--,pt.cooldown<=0&&clearInterval(cn)},1e3))}en(Jn,w=>{!w&&pt.armed&&(pt.armed=!1,pt.cooldown=0,clearInterval(cn))});function hs(){if(!(!pt.armed||pt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}pt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return ui(()=>{Oe=setInterval(()=>$e.value=Date.now(),1e3),qn(),Yn(),N(),Os(),Is(),Fs()}),yo(()=>{clearInterval(Oe),clearInterval(cn),clearTimeout($i)}),(w,h)=>(v(),y("div",dm,[r("div",fm,[h[62]||(h[62]=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",hm,[E(Y,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":h[0]||(h[0]=W=>R.value=W),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,R.value]]),R.value?(v(),y("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:h[1]||(h[1]=W=>R.value="")},[E(Y,{name:"x",size:15})])):D("",!0)])]),r("div",pm,[oe(r("nav",mm,[(v(!0),y(ae,null,Fe(k.value,W=>(v(),y("button",{key:W.id,class:Me(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[O.value===W.id?W.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":W.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:T=>O.value=W.id},[E(Y,{name:W.icon,size:17},null,8,["name"]),r("span",vm,S(W.label),1)],10,gm))),128))],512),[[yh,!F.value]]),r("div",_m,[F.value&&!K.value.length?(v(),y("div",ym," No settings match “"+S(R.value)+"”. ",1)):D("",!0),(v(!0),y(ae,null,Fe(K.value,W=>(v(),y(ae,{key:W.id},[F.value?(v(),y("div",bm,[E(Y,{name:W.icon,size:14},null,8,["name"]),$(" "+S(W.label),1)])):D("",!0),W.id==="account"?(v(),y("div",xm,[E(Se,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:be(()=>[oe(r("input",{"onUpdate:modelValue":h[2]||(h[2]=T=>Re(De).name=T),class:"field w-56",placeholder:"Jane Operator",onBlur:h[3]||(h[3]=T=>Je("Saved."))},null,544),[[ve,Re(De).name]])]),_:1}),E(Se,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:be(()=>[r("div",wm,[h[63]||(h[63]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),oe(r("input",{"onUpdate:modelValue":h[4]||(h[4]=T=>Re(De).username=T),class:"field w-48",placeholder:"jane",onBlur:h[5]||(h[5]=T=>Je("Saved."))},null,544),[[ve,Re(De).username]])])]),_:1}),E(Se,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:be(()=>[r("div",km,[r("span",Sm,S(t.email||"—"),1),r("span",Tm,[E(Y,{name:"mail",size:12}),h[64]||(h[64]=$(" Unverified ",-1))])])]),_:1}),E(Se,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:be(()=>[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(t.role)])},[E(Y,{name:_(t.role),size:12},null,8,["name"]),$(S(p(t.role)),1)],2)]),_:1}),E(Se,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:be(()=>[r("span",{class:Me(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},S(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),E(Se,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:be(()=>[r("button",{class:"btn-ghost",onClick:Lo},"Send verification link"),wn.value?(v(),y("p",Pm,S(wn.value),1)):D("",!0)]),_:1}),E(Se,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:be(()=>[r("div",Cm,[oe(r("input",{"onUpdate:modelValue":h[6]||(h[6]=T=>kt.current=T),type:"password",class:"field",placeholder:"Current password"},null,512),[[ve,kt.current]]),oe(r("input",{"onUpdate:modelValue":h[7]||(h[7]=T=>kt.next=T),type:"password",class:"field",placeholder:"New password"},null,512),[[ve,kt.next]]),oe(r("input",{"onUpdate:modelValue":h[8]||(h[8]=T=>kt.confirm=T),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ve,kt.confirm]]),r("div",Lm,[r("button",{class:"btn-accent",onClick:Lt},"Update password"),zn.value?(v(),y("span",{key:0,class:Me(["text-xs",yi.value?"text-success-fg":"text-ink-muted"])},S(zn.value),3)):D("",!0)])])]),_:1})])):W.id==="appearance"?(v(),y("div",Mm,[E(Se,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:be(()=>[E(hn,{modelValue:fe.value,"onUpdate:modelValue":h[9]||(h[9]=T=>fe.value=T),options:ie},null,8,["modelValue"])]),_:1}),E(Se,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:be(()=>[E(hn,{modelValue:Re(De).fontSize,"onUpdate:modelValue":h[10]||(h[10]=T=>Re(De).fontSize=T),options:me},null,8,["modelValue"])]),_:1}),E(Se,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:be(()=>[E(sn,{modelValue:Re(De).reduceMotion,"onUpdate:modelValue":h[11]||(h[11]=T=>Re(De).reduceMotion=T)},null,8,["modelValue"])]),_:1}),E(Se,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:be(()=>[oe(r("select",{"onUpdate:modelValue":h[12]||(h[12]=T=>Re(De).language=T),class:"field w-48"},[(v(),y(ae,null,Fe(Ee,([T,Qe])=>r("option",{key:T,value:T},S(Qe),9,Em)),64))],512),[[Ot,Re(De).language]])]),_:1}),E(Se,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:be(()=>[oe(r("select",{"onUpdate:modelValue":h[13]||(h[13]=T=>Re(De).region=T),class:"field w-48"},[(v(),y(ae,null,Fe(Ve,([T,Qe])=>r("option",{key:T,value:T},S(Qe),9,Om)),64))],512),[[Ot,Re(De).region]])]),_:1}),E(Se,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:be(()=>[oe(r("select",{"onUpdate:modelValue":h[14]||(h[14]=T=>Re(De).dateFormat=T),class:"field w-48"},[(v(),y(ae,null,Fe(pe,([T,Qe])=>r("option",{key:T,value:T},S(Qe),9,zm)),64))],512),[[Ot,Re(De).dateFormat]])]),_:1}),E(Se,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:be(()=>[E(hn,{modelValue:Re(De).timeFormat,"onUpdate:modelValue":h[15]||(h[15]=T=>Re(De).timeFormat=T),options:Le},null,8,["modelValue"])]),_:1}),E(Se,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:be(()=>[r("span",Am,S(Q.value),1)]),_:1}),h[65]||(h[65]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):W.id==="integrations"?(v(),y("div",$m,[F.value?D("",!0):(v(),y("div",Im,[(v(),y(ae,null,Fe(un,T=>r("button",{key:T.id,type:"button",class:Me(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",ot.value===T.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Qe=>ot.value=T.id},[E(Y,{name:T.icon,size:16},null,8,["name"]),$(S(T.label),1)],10,Dm)),64))])),as("apis-external")?(v(),y("div",Nm,[r("div",Rm,[r("div",Fm,[E(Y,{name:"radio",size:20})]),h[66]||(h[66]=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))]),ue.loaded&&!ue.available?(v(),y("div",Bm,[E(Y,{name:"lock",size:14,class:"mr-1 inline"}),h[67]||(h[67]=$(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),ue.canEditOrg?(v(),y("div",Vm,[h[68]||(h[68]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:ye.value,"onUpdate:modelValue":h[16]||(h[16]=T=>ye.value=T),options:ut},null,8,["modelValue"])])):D("",!0),f.value?(v(),et(Se,{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:be(()=>[E(sn,{"model-value":ue.orgEnabled,disabled:!ue.available,"onUpdate:modelValue":J},null,8,["model-value","disabled"])]),_:1})):(v(),et(Se,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:be(()=>[E(sn,{"model-value":ue.enabled,disabled:!ue.available||!ue.orgEnabled,"onUpdate:modelValue":J},null,8,["model-value","disabled"])]),_:1})),!f.value&&ue.available&&!ue.orgEnabled?(v(),y("div",Um,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[70]||(h[70]=$("OpenSky is turned off for your organization",-1)),ue.canEditOrg?(v(),y("span",Zm,[...h[69]||(h[69]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),h[71]||(h[71]=$(". ",-1))])):D("",!0),f.value?(v(),y("div",Hm,[E(Y,{name:"users",size:13,class:"mr-1 inline"}),h[72]||(h[72]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",jm,S(t.organizationName||"your organization"),1),h[73]||(h[73]=$(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):it.value?(v(),y("div",Wm," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),ue.available&&!f.value?(v(),y("div",Km,[r("div",Gm,[r("div",qm,[E(Y,{name:"signal",size:15}),h[74]||(h[74]=$("Credit usage ",-1))]),he.value?(v(),y("span",Ym,"Checked "+S(Ue()),1)):D("",!0)]),Te.value?(v(),y(ae,{key:0},[Te.value.remaining!=null?(v(),y(ae,{key:0},[r("div",Jm,[r("span",Xm,S(Ye(Te.value.remaining)),1),r("span",Qm,"/ "+S(Ye(Te.value.daily))+" credits left today",1)]),r("div",eg,[r("div",{class:Me(["h-full rounded-full transition-all",lt.value]),style:Ps({width:qe.value+"%"})},null,6)]),r("div",tg," Used "+S(Ye(Te.value.daily-Te.value.remaining))+" today · "+S(Te.value.probeCost)+" credit"+S(Te.value.probeCost===1?"":"s")+" per query · "+S(Te.value.mode),1)],64)):(v(),y(ae,{key:1},[r("div",ng,[h[75]||(h[75]=$("Daily allowance: ",-1)),r("span",ig,S(Ye(Te.value.daily)),1),h[76]||(h[76]=$(" credits",-1))]),r("div",sg,S(Te.value.probeCost)+" credit"+S(Te.value.probeCost===1?"":"s")+" per query · "+S(Te.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(v(),y("div",og,[...h[77]||(h[77]=[$(" 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(Se,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:be(()=>[U("plan")?(v(),y("span",ag,[$(S((z.find(T=>T.value===x("plan").effective)||{}).label||x("plan").effective||"—")+" ",1),B("plan")?(v(),y("span",rg,[E(Y,{name:"lock",size:10}),$(S(B("plan")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:ze.plan,"onUpdate:modelValue":h[17]||(h[17]=T=>ze.plan=T),options:z},null,8,["modelValue"]))]),_:1}),E(Se,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:be(()=>[U("bbox")?(v(),y("span",lg,[$(S(x("bbox").effective||"—")+" ",1),B("bbox")?(v(),y("span",ug,[E(Y,{name:"lock",size:10}),$(S(B("bbox")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[18]||(h[18]=T=>ze.bbox=T),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ve,ze.bbox]])]),_:1}),E(Se,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:be(()=>[U("clientId")?(v(),y("span",cg,[$(S(x("clientId").effective||"—")+" ",1),B("clientId")?(v(),y("span",dg,[E(Y,{name:"lock",size:10}),$(S(B("clientId")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[19]||(h[19]=T=>ze.clientId=T),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ve,ze.clientId]])]),_:1}),E(Se,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:be(()=>[U("clientSecret")?(v(),y("span",fg,[$(S(x("clientSecret").effective||"—")+" ",1),B("clientSecret")?(v(),y("span",hg,[E(Y,{name:"lock",size:10}),$(S(B("clientSecret")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[20]||(h[20]=T=>ze.clientSecret=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,ze.clientSecret]])]),_:1}),ue.available&&!ue.allowAnonymous?(v(),y("div",pg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):D("",!0),r("div",mg,[it.value?D("",!0):(v(),y("button",{key:0,class:"btn-accent",disabled:re.value||!ue.available,onClick:Z},S(re.value?"Saving…":f.value?"Save organization settings":"Save settings"),9,gg)),f.value?D("",!0):(v(),y("button",{key:1,class:"btn-ghost",disabled:ee.value||!ue.available,onClick:Pe},S(ee.value?"Testing…":"Test connection"),9,vg)),ce.value?(v(),y("span",_g,S(ce.value),1)):D("",!0),nt.value&&!f.value?(v(),y("span",{key:3,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",le(nt.value.status)])},[h[78]||(h[78]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(nt.value.detail||nt.value.status),1)],2)):D("",!0)])])):D("",!0),as("drives-external")?(v(),y(ae,{key:2},[r("div",yg,[r("div",bg,[r("div",xg,[E(Y,{name:"server",size:20})]),h[79]||(h[79]=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))]),se.loaded&&!se.available?(v(),y("div",wg,[E(Y,{name:"lock",size:14,class:"mr-1 inline"}),h[80]||(h[80]=$(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),se.canEditOrg?(v(),y("div",kg,[h[81]||(h[81]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:Ce.value,"onUpdate:modelValue":h[21]||(h[21]=T=>Ce.value=T),options:ut},null,8,["modelValue"])])):D("",!0),Ut.value?(v(),et(Se,{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:be(()=>[E(sn,{"model-value":se.orgEnabled,disabled:!se.available,"onUpdate:modelValue":wo},null,8,["model-value","disabled"])]),_:1})):(v(),et(Se,{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:be(()=>[E(sn,{"model-value":se.enabled,disabled:!se.available||!se.orgEnabled,"onUpdate:modelValue":wo},null,8,["model-value","disabled"])]),_:1})),!Ut.value&&se.available&&!se.orgEnabled?(v(),y("div",Sg,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[83]||(h[83]=$("File transfer is turned off for your organization",-1)),se.canEditOrg?(v(),y("span",Tg,[...h[82]||(h[82]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),h[84]||(h[84]=$(". ",-1))])):D("",!0),Ut.value?(v(),y("div",Pg,[E(Y,{name:"users",size:13,class:"mr-1 inline"}),h[85]||(h[85]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Cg,S(t.organizationName||"your organization"),1),h[86]||(h[86]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):St.value?(v(),y("div",Lg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),E(Se,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:be(()=>[Zt("protocol")?(v(),y("span",Mg,[$(S(Pa(At("protocol").effective))+" ",1),bt("protocol")?(v(),y("span",Eg,[E(Y,{name:"lock",size:10}),$(S(bt("protocol")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:ke.protocol,"onUpdate:modelValue":h[22]||(h[22]=T=>ke.protocol=T),options:_n},null,8,["modelValue"]))]),_:1}),E(Se,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:be(()=>[Zt("host")?(v(),y("span",Og,[$(S(At("host").effective||"—")+" ",1),bt("host")?(v(),y("span",zg,[E(Y,{name:"lock",size:10}),$(S(bt("host")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[23]||(h[23]=T=>ke.host=T),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ve,ke.host]])]),_:1}),E(Se,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:be(()=>[Zt("port")?(v(),y("span",Ag,[$(S(At("port").effective||"default")+" ",1),bt("port")?(v(),y("span",$g,[E(Y,{name:"lock",size:10}),$(S(bt("port")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[24]||(h[24]=T=>ke.port=T),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ve,ke.port]])]),_:1}),E(Se,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:be(()=>[Zt("username")?(v(),y("span",Ig,[$(S(At("username").effective||"—")+" ",1),bt("username")?(v(),y("span",Dg,[E(Y,{name:"lock",size:10}),$(S(bt("username")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[25]||(h[25]=T=>ke.username=T),class:"field w-64",placeholder:"user"},null,512)),[[ve,ke.username]])]),_:1}),E(Se,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:be(()=>[Zt("password")?(v(),y("span",Ng,[$(S(At("password").effective||"—")+" ",1),bt("password")?(v(),y("span",Rg,[E(Y,{name:"lock",size:10}),$(S(bt("password")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[26]||(h[26]=T=>ke.password=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,ke.password]])]),_:1}),Qi.value==="sftp"?(v(),et(Se,{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:be(()=>[Zt("privateKey")?(v(),y("span",Fg,[$(S(At("privateKey").effective||"—")+" ",1),bt("privateKey")?(v(),y("span",Bg,[E(Y,{name:"lock",size:10}),$(S(bt("privateKey")),1)])):D("",!0)])):oe((v(),y("textarea",{key:1,"onUpdate:modelValue":h[27]||(h[27]=T=>ke.privateKey=T),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ve,ke.privateKey]])]),_:1})):D("",!0),Qi.value==="sftp"?(v(),et(Se,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:be(()=>[Zt("keyPassphrase")?(v(),y("span",Vg,[$(S(At("keyPassphrase").effective||"—")+" ",1),bt("keyPassphrase")?(v(),y("span",Ug,[E(Y,{name:"lock",size:10}),$(S(bt("keyPassphrase")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[28]||(h[28]=T=>ke.keyPassphrase=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,ke.keyPassphrase]])]),_:1})):D("",!0),Qi.value==="sftp"?(v(),et(Se,{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:be(()=>[Zt("hostKeyFingerprint")?(v(),y("span",Zg,[$(S(At("hostKeyFingerprint").effective||"—")+" ",1),bt("hostKeyFingerprint")?(v(),y("span",Hg,[E(Y,{name:"lock",size:10}),$(S(bt("hostKeyFingerprint")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[29]||(h[29]=T=>ke.hostKeyFingerprint=T),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ve,ke.hostKeyFingerprint]])]),_:1})):D("",!0),Qi.value==="ftps"?(v(),et(Se,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:be(()=>[Zt("insecureSkipVerify")?(v(),y("span",jg,[$(S(At("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),bt("insecureSkipVerify")?(v(),y("span",Wg,[E(Y,{name:"lock",size:10}),$(S(bt("insecureSkipVerify")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:ke.insecureSkipVerify,"onUpdate:modelValue":h[30]||(h[30]=T=>ke.insecureSkipVerify=T),options:di},null,8,["modelValue"]))]),_:1})):D("",!0),E(Se,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:be(()=>[Zt("basePath")?(v(),y("span",Kg,[$(S(At("basePath").effective||"—")+" ",1),bt("basePath")?(v(),y("span",Gg,[E(Y,{name:"lock",size:10}),$(S(bt("basePath")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[31]||(h[31]=T=>ke.basePath=T),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ve,ke.basePath]])]),_:1}),r("div",qg,[St.value?D("",!0):(v(),y("button",{key:0,class:"btn-accent",disabled:ft.value||!se.available,onClick:Ea},S(ft.value?"Saving…":Ut.value?"Save organization settings":"Save settings"),9,Yg)),Ut.value?D("",!0):(v(),y("button",{key:1,class:"btn-ghost",disabled:gt.value||!se.available,onClick:Oa},S(gt.value?"Testing…":"Test connection"),9,Jg)),Ge.value?(v(),y("span",Xg,S(Ge.value),1)):D("",!0),Ct.value&&!Ut.value?(v(),y("span",Qg,"Checked "+S(Ca()),1)):D("",!0),yt.value&&!Ut.value?(v(),y("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",za(yt.value.status)])},[h[87]||(h[87]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(yt.value.detail||yt.value.status),1)],2)):D("",!0)])]),r("div",ev,[r("div",tv,[r("div",nv,[E(Y,{name:"cloud",size:20})]),h[88]||(h[88]=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))]),je.loaded&&!je.available?(v(),y("div",iv,[E(Y,{name:"lock",size:14,class:"mr-1 inline"}),h[89]||(h[89]=$(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):D("",!0),je.canEditOrg?(v(),y("div",sv,[h[90]||(h[90]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:_e.value,"onUpdate:modelValue":h[32]||(h[32]=T=>_e.value=T),options:ut},null,8,["modelValue"])])):D("",!0),rn.value?(v(),et(Se,{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:be(()=>[E(sn,{"model-value":je.orgEnabled,disabled:!je.available,"onUpdate:modelValue":mi},null,8,["model-value","disabled"])]),_:1})):(v(),et(Se,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:be(()=>[E(sn,{"model-value":je.enabled,disabled:!je.available||!je.orgEnabled,"onUpdate:modelValue":mi},null,8,["model-value","disabled"])]),_:1})),!rn.value&&je.available&&!je.orgEnabled?(v(),y("div",ov,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[92]||(h[92]=$("WebDAV is turned off for your organization",-1)),je.canEditOrg?(v(),y("span",av,[...h[91]||(h[91]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),h[93]||(h[93]=$(". ",-1))])):D("",!0),rn.value?(v(),y("div",rv,[E(Y,{name:"users",size:13,class:"mr-1 inline"}),h[94]||(h[94]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",lv,S(t.organizationName||"your organization"),1),h[95]||(h[95]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):zs.value?(v(),y("div",uv," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):D("",!0),E(Se,{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:be(()=>[pi("baseURL")?(v(),y("span",cv,[$(S(yn("baseURL").effective||"—")+" ",1),Ht("baseURL")?(v(),y("span",dv,[E(Y,{name:"lock",size:10}),$(S(Ht("baseURL")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[33]||(h[33]=T=>$t.baseURL=T),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ve,$t.baseURL]])]),_:1}),E(Se,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:be(()=>[pi("username")?(v(),y("span",fv,[$(S(yn("username").effective||"—")+" ",1),Ht("username")?(v(),y("span",hv,[E(Y,{name:"lock",size:10}),$(S(Ht("username")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[34]||(h[34]=T=>$t.username=T),class:"field w-64",placeholder:"user"},null,512)),[[ve,$t.username]])]),_:1}),E(Se,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:be(()=>[pi("password")?(v(),y("span",pv,[$(S(yn("password").effective||"—")+" ",1),Ht("password")?(v(),y("span",mv,[E(Y,{name:"lock",size:10}),$(S(Ht("password")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[35]||(h[35]=T=>$t.password=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,$t.password]])]),_:1}),E(Se,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:be(()=>[pi("insecureSkipVerify")?(v(),y("span",gv,[$(S(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Ht("insecureSkipVerify")?(v(),y("span",vv,[E(Y,{name:"lock",size:10}),$(S(Ht("insecureSkipVerify")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:$t.insecureSkipVerify,"onUpdate:modelValue":h[36]||(h[36]=T=>$t.insecureSkipVerify=T),options:ko},null,8,["modelValue"]))]),_:1}),E(Se,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:be(()=>[pi("basePath")?(v(),y("span",_v,[$(S(yn("basePath").effective||"—")+" ",1),Ht("basePath")?(v(),y("span",yv,[E(Y,{name:"lock",size:10}),$(S(Ht("basePath")),1)])):D("",!0)])):oe((v(),y("input",{key:1,"onUpdate:modelValue":h[37]||(h[37]=T=>$t.basePath=T),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ve,$t.basePath]])]),_:1}),r("div",bv,[zs.value?D("",!0):(v(),y("button",{key:0,class:"btn-accent",disabled:Ei.value||!je.available,onClick:To},S(Ei.value?"Saving…":rn.value?"Save organization settings":"Save settings"),9,xv)),rn.value?D("",!0):(v(),y("button",{key:1,class:"btn-ghost",disabled:hi.value||!je.available,onClick:Po},S(hi.value?"Testing…":"Test connection"),9,wv)),fi.value?(v(),y("span",kv,S(fi.value),1)):D("",!0),tn.value&&!rn.value?(v(),y("span",Sv,"Checked "+S($a()),1)):D("",!0),an.value&&!rn.value?(v(),y("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Oi(an.value.status)])},[h[96]||(h[96]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(an.value.detail||an.value.status),1)],2)):D("",!0)])])],64)):D("",!0),as("drives-local")?(v(),y("div",Tv,[r("div",Pv,[r("div",Cv,[E(Y,{name:"monitor",size:20})]),h[97]||(h[97]=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))]),ne.loaded&&!ne.available?(v(),y("div",Lv,[E(Y,{name:"lock",size:14,class:"mr-1 inline"}),h[98]||(h[98]=$(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):ne.loaded&&!ne.rootConfigured?(v(),y("div",Mv,[E(Y,{name:"alertTriangle",size:14,class:"mr-1 inline"}),h[99]||(h[99]=$(" No storage root has been configured by your administrator yet. ",-1))])):D("",!0),ne.canEditOrg?(v(),y("div",Ev,[h[100]||(h[100]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(hn,{modelValue:st.value,"onUpdate:modelValue":h[38]||(h[38]=T=>st.value=T),options:ut},null,8,["modelValue"])])):D("",!0),Tt.value?(v(),et(Se,{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:be(()=>[E(sn,{"model-value":ne.orgEnabled,disabled:!ne.available,"onUpdate:modelValue":ss},null,8,["model-value","disabled"])]),_:1})):(v(),et(Se,{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:be(()=>[E(sn,{"model-value":ne.enabled,disabled:!ne.available||!ne.orgEnabled,"onUpdate:modelValue":ss},null,8,["model-value","disabled"])]),_:1})),!Tt.value&&ne.available&&!ne.orgEnabled?(v(),y("div",Ov,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[102]||(h[102]=$("Local storage is turned off for your organization",-1)),ne.canEditOrg?(v(),y("span",zv,[...h[101]||(h[101]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):D("",!0),h[103]||(h[103]=$(". ",-1))])):D("",!0),Tt.value?(v(),y("div",Av,[E(Y,{name:"users",size:13,class:"mr-1 inline"}),h[104]||(h[104]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",$v,S(t.organizationName||"your organization"),1),h[105]||(h[105]=$(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Nt.value?(v(),y("div",Iv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):D("",!0),Tt.value?(v(),et(Se,{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:be(()=>[E(sn,{"model-value":ne.allowPrivate,disabled:!ne.available,"onUpdate:modelValue":Co},null,8,["model-value","disabled"])]),_:1})):D("",!0),Tt.value?D("",!0):(v(),y(ae,{key:9},[E(Se,{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:be(()=>[r("div",Dv,[(v(!0),y(ae,null,Fe(ne.mounts,T=>(v(),y("div",{key:T.id,class:"flex flex-wrap items-center gap-2"},[r("span",Nv,S(T.path),1),T.kind==="shared"?(v(),y("span",Rv,[E(Y,{name:"users",size:10}),h[106]||(h[106]=$("Shared with your organization",-1))])):(v(),y("span",Fv,[E(Y,{name:"lock",size:10}),h[107]||(h[107]=$("Private to you",-1))])),Wn.value[T.id]?(v(),y("span",{key:2,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",Be(Wn.value[T.id].status)])},[h[108]||(h[108]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(Wn.value[T.id].status),1)],2)):D("",!0)]))),128)),ne.mounts.length?D("",!0):(v(),y("div",Bv,S(ne.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),ne.isOrgUser&&ne.allowPrivate?(v(),et(Se,{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:be(()=>[E(sn,{"model-value":ne.privateFolder,disabled:!ne.available||!ne.orgEnabled,"onUpdate:modelValue":os},null,8,["model-value","disabled"])]),_:1})):ne.isOrgUser&&!ne.allowPrivate?(v(),y("div",Vv,[E(Y,{name:"lock",size:13,class:"mr-1 inline"}),h[109]||(h[109]=$("Private folders are turned off by your organization. ",-1))])):D("",!0)],64)),E(Se,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:be(()=>[On("readOnly")?(v(),y("span",Uv,[$(S(Ai(vt("readOnly").effective))+" ",1),vi("readOnly")?(v(),y("span",Zv,[E(Y,{name:"lock",size:10}),$(S(vi("readOnly")),1)])):D("",!0)])):(v(),et(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":h[39]||(h[39]=T=>jn.value=T),options:zi},null,8,["modelValue"]))]),_:1}),r("div",Hv,[Nt.value?D("",!0):(v(),y("button",{key:0,class:"btn-accent",disabled:bn.value||!ne.available,onClick:Bs},S(bn.value?"Saving…":Tt.value?"Save organization settings":"Save settings"),9,jv)),Tt.value?D("",!0):(v(),y("button",{key:1,class:"btn-ghost",disabled:gi.value||!ne.available,onClick:Na},S(gi.value?"Testing…":"Test folder"),9,Wv)),ln.value?(v(),y("span",Kv,S(ln.value),1)):D("",!0),ct.value&&!Tt.value?(v(),y("span",Gv,"Checked "+S(Ns()),1)):D("",!0),Ie.value&&!Tt.value?(v(),y("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Be(Ie.value.status)])},[h[110]||(h[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(Ie.value.detail||Ie.value.status),1)],2)):D("",!0)])])):D("",!0)])):W.id==="profile"?(v(),y("div",qv,[E(Se,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:be(()=>[r("div",Yv,[Re(De).avatar?(v(),y("img",{key:0,src:Re(De).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,Jv)):(v(),y("div",Xv,S(Eo.value),1)),r("div",Qv,[r("label",e_,[E(Y,{name:"upload",size:15,class:"mr-1.5 inline"}),h[111]||(h[111]=$("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Mo},null,32)]),Re(De).avatar?(v(),y("button",{key:0,class:"btn-ghost",onClick:Ra},"Remove")):D("",!0)])])]),_:1}),E(Se,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:be(()=>[oe(r("input",{"onUpdate:modelValue":h[40]||(h[40]=T=>Re(De).displayName=T),class:"field w-56",placeholder:"Jane O.",onBlur:h[41]||(h[41]=T=>Je("Saved."))},null,544),[[ve,Re(De).displayName]])]),_:1}),E(Se,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:be(()=>[oe(r("textarea",{"onUpdate:modelValue":h[42]||(h[42]=T=>Re(De).bio=T),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:h[43]||(h[43]=T=>Je("Saved."))},null,544),[[ve,Re(De).bio]]),r("div",t_,S((Re(De).bio||"").length)+"/240",1)]),_:1}),E(Se,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:be(()=>[E(sn,{modelValue:Re(De).showEmail,"onUpdate:modelValue":h[44]||(h[44]=T=>Re(De).showEmail=T)},null,8,["modelValue"])]),_:1})])):W.id==="security"?(v(),y("div",n_,[E(Se,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:be(()=>[r("div",i_,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Re(De).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[h[112]||(h[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(Re(De).twoFactor?"Enabled":"Disabled"),1)],2),!Re(De).twoFactor&&!Kn.value?(v(),y("button",{key:0,class:"btn-accent",onClick:Di},"Enable 2FA")):Re(De).twoFactor?(v(),y("button",{key:1,class:"btn-ghost",onClick:Fa},"Disable")):D("",!0)]),Kn.value?(v(),y("div",s_,[r("div",o_,[h[114]||(h[114]=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",a_,[h[113]||(h[113]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",r_,S(Oo.value),1),r("div",l_,[oe(r("input",{"onUpdate:modelValue":h[45]||(h[45]=T=>Ii.value=T),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ve,Ii.value]]),r("button",{class:"btn-accent",onClick:zo},"Verify & enable")]),We.value?(v(),y("p",u_,S(We.value),1)):D("",!0)])])])):D("",!0),Re(De).twoFactor&&rs.value.length?(v(),y("div",c_,[h[115]||(h[115]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),h[116]||(h[116]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",d_,[(v(!0),y(ae,null,Fe(rs.value,T=>(v(),y("span",{key:T,class:"select-all"},S(T),1))),128))])])):D("",!0),h[117]||(h[117]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),E(Se,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:be(()=>[r("div",f_,[r("div",h_,[r("div",p_,[E(Y,{name:"monitor",size:18})]),r("div",m_,[r("div",g_,[$(S(Ba())+" on "+S(Ao())+" ",1),h[118]||(h[118]=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",v_,"Signed in "+S(Re(ru)(Re(Va))),1)]),r("button",{class:"btn-ghost",onClick:h[46]||(h[46]=T=>l("logout"))},"Log out")])]),h[119]||(h[119]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),h[120]||(h[120]=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})])):W.id==="team"?(v(),y("div",__,[Xe.id?(v(),y("div",y_,[E(Se,{block:"",title:`Edit user — ${Xe.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:be(()=>[r("div",b_,[r("div",x_,[oe(r("input",{"onUpdate:modelValue":h[47]||(h[47]=T=>Xe.email=T),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,Xe.email]]),oe(r("select",{"onUpdate:modelValue":h[48]||(h[48]=T=>Xe.role=T),class:"field w-32",disabled:cs.value,title:cs.value?"You cannot change your own role":""},[(v(!0),y(ae,null,Fe(Vs.value,T=>(v(),y("option",{key:T.value,value:T.value},S(T.label),9,k_))),128))],8,w_),[[Ot,Xe.role]])]),u.value?oe((v(),y("select",{key:0,"onUpdate:modelValue":h[49]||(h[49]=T=>Xe.organization=T),class:"field",title:"Organization"},[(v(!0),y(ae,null,Fe($o.value,T=>(v(),y("option",{key:T.value,value:T.value},S(T.label),9,S_))),128))],512)),[[Ot,Xe.organization]]):D("",!0),oe(r("input",{"onUpdate:modelValue":h[50]||(h[50]=T=>Xe.password=T),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ve,Xe.password]]),r("label",T_,[E(sn,{modelValue:Xe.verified,"onUpdate:modelValue":h[51]||(h[51]=T=>Xe.verified=T)},null,8,["modelValue"]),h[121]||(h[121]=$(" Email verified ",-1))]),r("div",P_,[r("button",{class:"btn-accent",disabled:Bi.value,onClick:Ha},S(Bi.value?"Saving…":"Save changes"),9,C_),r("button",{class:"btn-ghost",onClick:$n},"Cancel"),An.value?(v(),y("span",L_,S(An.value),1)):D("",!0),cs.value?(v(),y("span",M_,"Editing your own account — role locked.")):D("",!0)])])]),_:1},8,["title"])])):(v(),y("div",E_,[E(Se,{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:be(()=>[r("div",O_,[r("div",z_,[oe(r("input",{"onUpdate:modelValue":h[52]||(h[52]=T=>dt.email=T),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,dt.email]]),oe(r("select",{"onUpdate:modelValue":h[53]||(h[53]=T=>dt.role=T),class:"field w-32"},[(v(!0),y(ae,null,Fe(Vs.value,T=>(v(),y("option",{key:T.value,value:T.value},S(T.label),9,A_))),128))],512),[[Ot,dt.role]])]),u.value?oe((v(),y("select",{key:0,"onUpdate:modelValue":h[54]||(h[54]=T=>dt.organization=T),class:"field",title:"Organization"},[(v(!0),y(ae,null,Fe($o.value,T=>(v(),y("option",{key:T.value,value:T.value},S(T.label),9,$_))),128))],512)),[[Ot,dt.organization]]):(v(),y("div",I_,[h[122]||(h[122]=$(" New users join your organization: ",-1)),r("span",D_,S(t.organizationName||"—"),1)])),oe(r("input",{"onUpdate:modelValue":h[55]||(h[55]=T=>dt.password=T),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ve,dt.password]]),r("div",N_,[r("button",{class:"btn-accent",disabled:Ni.value,onClick:Ua},S(Ni.value?"Creating…":"Create user"),9,R_),bi.value?(v(),y("span",F_,S(bi.value),1)):D("",!0)])])]),_:1})])),r("div",B_,[r("div",V_,[h[123]||(h[123]=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:Gn.value,onClick:Yn},S(Gn.value?"Loading…":"Refresh"),9,U_)]),us.value?(v(),y("div",Z_,S(us.value),1)):!ls.value.length&&!Gn.value?(v(),y("div",H_,"No users yet.")):(v(),y("div",j_,[r("table",W_,[r("thead",null,[r("tr",K_,[(v(),y(ae,null,Fe(["User","Role","Organization","Status",""],T=>r("th",{key:T,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(T),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(ls.value,T=>(v(),y("tr",{key:T.id,class:Me(["border-b border-line last:border-0",Xe.id===T.id?"bg-accent-soft":""])},[r("td",G_,[r("span",q_,S(T.email),1),T.email===t.email?(v(),y("span",Y_,"(you)")):D("",!0)]),r("td",J_,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(T.role||"user")])},[E(Y,{name:_(T.role||"user"),size:12},null,8,["name"]),$(S(p(T.role||"user")),1)],2)]),r("td",X_,[r("span",{class:Me(["text-sm",T.organizationName?"text-ink-secondary":"text-ink-muted"])},S(T.organizationName||"—"),3)]),r("td",Q_,[r("span",{class:Me(["text-xs",T.verified?"text-success-fg":"text-ink-muted"])},S(T.verified?"Verified":"Unverified"),3)]),r("td",ey,[Xt.value===T.id?(v(),y(ae,{key:0},[h[124]||(h[124]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:h[56]||(h[56]=Qe=>Xt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Qe=>Za(T)}," Remove ",8,ty)],64)):(v(),y("div",ny,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>ds(T)},[E(Y,{name:"settings",size:14}),h[125]||(h[125]=$(" Edit ",-1))],8,iy),T.email!==t.email?(v(),y("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Xt.value=T.id},[E(Y,{name:"trash",size:14}),h[126]||(h[126]=$(" Remove ",-1))],8,sy)):D("",!0)]))])],2))),128))])])]))])])):W.id==="organizations"?(v(),y("div",oy,[kn.id?(v(),y("div",ay,[E(Se,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:be(()=>[r("div",ry,[oe(r("input",{"onUpdate:modelValue":h[57]||(h[57]=T=>kn.name=T),class:"field",placeholder:"Organization name",onKeyup:Xl(Do,["enter"])},null,544),[[ve,kn.name]]),r("div",ly,[r("button",{class:"btn-accent",onClick:Do},"Save changes"),r("button",{class:"btn-ghost",onClick:Us},"Cancel"),Sn.value?(v(),y("span",uy,S(Sn.value),1)):D("",!0)])])]),_:1})])):(v(),y("div",cy,[E(Se,{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:be(()=>[r("div",dy,[oe(r("input",{"onUpdate:modelValue":h[58]||(h[58]=T=>In.name=T),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Xl(Io,["enter"])},null,544),[[ve,In.name]]),r("div",fy,[r("button",{class:"btn-accent",disabled:Vi.value,onClick:Io},S(Vi.value?"Creating…":"Create organization"),9,hy),Mt.value?(v(),y("span",py,S(Mt.value),1)):D("",!0)])])]),_:1})])),r("div",my,[r("div",{class:"flex items-center justify-between px-5 py-4"},[h[127]||(h[127]=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:qn},"Refresh")]),Ri.value.length?(v(),y("div",vy,[r("table",_y,[r("thead",null,[r("tr",yy,[(v(),y(ae,null,Fe(["Organization","Members",""],T=>r("th",{key:T,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(T),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(Ri.value,T=>(v(),y("tr",{key:T.id,class:Me(["border-b border-line last:border-0",kn.id===T.id?"bg-accent-soft":""])},[r("td",by,[r("span",xy,[E(Y,{name:"grid",size:14,class:"text-ink-muted"}),$(S(T.name),1)])]),r("td",wy,S(Ui.value[T.id]||0),1),r("td",ky,[xi.value===T.id?(v(),y(ae,{key:0},[h[128]||(h[128]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:h[59]||(h[59]=Qe=>xi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Qe=>nn(T)}," Delete ",8,Sy)],64)):(v(),y("div",Ty,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>ja(T)},[E(Y,{name:"settings",size:14}),h[129]||(h[129]=$(" Rename ",-1))],8,Py),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Ui.value[T.id]||0)>0,title:(Ui.value[T.id]||0)>0?"Reassign or remove members first":"",onClick:Qe=>xi.value=T.id},[E(Y,{name:"trash",size:14}),h[130]||(h[130]=$(" Delete ",-1))],8,Cy)]))])],2))),128))])])])):(v(),y("div",gy,"No organizations yet."))])])):W.id==="advanced"?(v(),y("div",Ly,[r("div",My,[E(Se,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:be(()=>[r("button",{class:"btn-ghost",onClick:wi},[E(Y,{name:"download",size:15,class:"mr-1.5 inline"}),h[131]||(h[131]=$("Export",-1))])]),_:1}),E(Se,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:be(()=>[r("label",Ey,[E(Y,{name:"upload",size:15,class:"mr-1.5 inline"}),h[132]||(h[132]=$("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Tn},null,32)]),fs.value?(v(),y("p",Oy,S(fs.value),1)):D("",!0)]),_:1})]),r("div",zy,[r("div",Ay,[E(Y,{name:"alertTriangle",size:18}),h[133]||(h[133]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),h[138]||(h[138]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",$y,[h[137]||(h[137]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",Iy,[oe(r("input",{"onUpdate:modelValue":h[60]||(h[60]=T=>pt.understand=T),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[da,pt.understand]]),h[134]||(h[134]=$(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",Dy,[r("label",Ny,[h[135]||(h[135]=$("Type ",-1)),r("span",Ry,S(Zs.value),1),h[136]||(h[136]=$(" to confirm",-1))]),oe(r("input",{"onUpdate:modelValue":h[61]||(h[61]=T=>pt.typed=T),class:"field w-full max-w-[360px] font-mono",placeholder:Zs.value},null,8,Fy),[[ve,pt.typed]])]),r("div",By,[pt.armed?(v(),y("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:pt.cooldown>0,onClick:hs},S(pt.cooldown>0?`Confirm in ${pt.cooldown}s…`:"Permanently delete account"),9,Uy)):(v(),y("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:!Jn.value,onClick:No}," Delete account… ",8,Vy)),pt.armed&&pt.cooldown>0?(v(),y("span",Zy,"Cooling-off period — read once more.")):D("",!0)]),pt.msg?(v(),y("p",Hy,S(pt.msg),1)):D("",!0)])])])):D("",!0)],64))),128))])]),E(hh,{name:"fade"},{default:be(()=>[_i.value?(v(),y("div",jy,[E(Y,{name:"check",size:16,class:"text-success-fg"}),$(S(_i.value),1)])):D("",!0)]),_:1})]))}},Ky=cm(Wy,[["__scopeId","data-v-4fe25eb7"]]),Gy={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},qy={class:"flex flex-wrap items-center gap-3"},Yy={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Jy=["onClick"],Xy={class:"ml-auto flex items-center gap-2"},Qy=["href"],e1={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},t1={class:"eyebrow"},n1={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},i1={key:0,class:"panel p-5"},s1={class:"mb-4 flex items-center justify-between"},o1={class:"eyebrow"},a1={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},r1={class:"block"},l1={class:"block"},u1={class:"block"},c1={class:"block"},d1={key:0,value:""},f1=["value"],h1={class:"block"},p1={class:"block"},m1={class:"block"},g1={class:"block"},v1={class:"block"},_1=["value"],y1={class:"block"},b1=["value"],x1={class:"block"},w1=["value"],k1={class:"block"},S1={class:"mt-3 block"},T1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},P1={class:"block"},C1={class:"block"},L1={class:"block"},M1={class:"block"},E1={class:"col-span-2 block max-[760px]:col-span-1"},O1={class:"mt-4 flex items-center gap-3"},z1=["disabled"],A1={key:0,class:"text-sm text-danger-fg"},$1={class:"panel overflow-hidden p-0"},I1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},D1={key:1,class:"grid place-items-center px-5 py-16 text-center"},N1={key:2,class:"overflow-x-auto"},R1={class:"w-full border-collapse text-sm"},F1={class:"text-left"},B1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},V1={key:0,class:"text-ink-muted"},U1={class:"px-5 py-3 text-ink-secondary"},Z1=["title"],H1={class:"px-5 py-3 font-mono text-ink-secondary"},j1={class:"px-5 py-3 text-ink-secondary"},W1={class:"px-5 py-3"},K1=["onClick"],G1={class:"whitespace-nowrap px-5 py-3 text-right"},q1=["onClick"],Y1=["onClick"],J1=["onClick"],X1={key:0,class:"border-b border-line bg-surface-2"},Q1={colspan:"7",class:"px-5 py-3"},eb={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},tb={class:"text-ink-secondary"},nb={class:"text-ink"},ib={class:"text-ink-secondary"},sb={class:"text-ink"},ob={class:"text-ink-secondary"},ab={class:"font-mono text-ink"},rb={key:0,class:"text-ink-secondary"},lb={class:"text-ink"},ub={key:0,class:"mt-2 space-y-1"},cb={key:1,class:"mt-2 text-xs text-success-fg"},db={key:0,class:"panel p-5"},fb={class:"mb-4 flex items-center justify-between"},hb={class:"eyebrow"},pb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},mb={class:"block"},gb={class:"block"},vb={class:"block"},_b={class:"block"},yb={class:"block"},bb={class:"block"},xb=["value"],wb={class:"mt-3 flex flex-wrap gap-6"},kb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Sb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Tb={class:"mt-4 flex items-center gap-3"},Pb=["disabled"],Cb={key:0,class:"text-sm text-danger-fg"},Lb={class:"panel overflow-hidden p-0"},Mb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Eb={key:1,class:"grid place-items-center px-5 py-16 text-center"},Ob={key:2,class:"overflow-x-auto"},zb={class:"w-full border-collapse text-sm"},Ab={class:"text-left"},$b={class:"px-5 py-3 font-semibold text-ink"},Ib={class:"px-5 py-3 text-ink-secondary"},Db={class:"px-5 py-3 font-mono text-ink-secondary"},Nb={class:"px-5 py-3"},Rb={key:1,class:"text-ink-muted"},Fb={class:"px-5 py-3"},Bb={class:"whitespace-nowrap px-5 py-3 text-right"},Vb=["onClick"],Ub=["onClick"],Zb=["onClick"],Hb={__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=H("flights"),u=H([]),d=H([]),p=H(!1),_=H("");async function b(){p.value=!0,_.value="";const[j,M]=await Promise.all([$c(),bp()]);(!j.ok||!M.ok)&&(_.value=j.status===503||M.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=j.drones,d.value=M.flights,p.value=!1}ui(b);function C(j){const M=j.compliance||{};return M.exempt?{tone:"neutral",label:"Exempt"}:(M.redFlags||[]).length?{tone:"danger",label:`${M.redFlags.length} issue${M.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const k=H("");function O(j){k.value=k.value===j?"":j}const R=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],F=[{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"}],X=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function q(){var j;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((j=u.value[0])==null?void 0:j.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const ge=H(!1),we=H(""),K=xt(q()),fe=H(""),ie=H(!1),me=H(!1);function Le(){Object.assign(K,q()),we.value="",fe.value="",me.value=!1,ge.value=!0}function Ee(j){Object.assign(K,{operationDate:(j.operationDate||"").slice(0,10),startTime:j.startTime||"",endTime:j.endTime||"",drone:j.drone||"",areaRoute:j.areaRoute||"",maxAltitudeAgl:j.maxAltitudeAgl||"",pilotName:j.pilotName||"",certificateRef:j.certificateRef||"",category:j.category||"open",purpose:j.purpose||"commercial",loggingPath:j.loggingPath||"",rawFdrLogUrl:j.rawFdrLogUrl||"",authorisationRef:j.authorisationRef||"",weather:j.weather||"",airspaceRef:j.airspaceRef||"",observer:j.observer||"",incidents:j.incidents||"",notes:j.notes||""}),we.value=j.id,fe.value="",me.value=!!(j.weather||j.airspaceRef||j.observer||j.incidents||j.notes),ge.value=!0}function Ve(){ge.value=!1,we.value=""}async function pe(){var z;if(fe.value="",!K.drone){fe.value="Select a drone first (add one on the Drones tab).";return}ie.value=!0;const j={...K,maxAltitudeAgl:Number(K.maxAltitudeAgl)||0},M=we.value?await wp(we.value,j):await xp(j);if(ie.value=!1,!M.ok){fe.value=((z=M.body)==null?void 0:z.error)||"Could not save the flight.";return}ge.value=!1,await b()}const $e=H("");async function Oe(j){const M=await kp(j.id);$e.value="",M.ok&&await b()}const Q=["","C0","C1","C2","C3","C4","C5","C6"];function ue(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const ye=H(!1),ze=H(""),ce=xt(ue()),re=H(""),ee=H(!1);function nt(){Object.assign(ce,ue()),ze.value="",re.value="",ye.value=!0}function he(j){Object.assign(ce,{name:j.name||"",model:j.model||"",serial:j.serial||"",operatorNumber:j.operatorNumber||"",mtomGrams:j.mtomGrams||"",isToy:!!j.isToy,autologsFlights:!!j.autologsFlights,cClass:j.cClass||""}),ze.value=j.id,re.value="",ye.value=!0}function Te(){ye.value=!1,ze.value=""}async function qe(){var z;if(re.value="",!ce.name.trim()){re.value="Give the drone a name.";return}ee.value=!0;const j={...ce,mtomGrams:Number(ce.mtomGrams)||0},M=ze.value?await _p(ze.value,j):await vp(j);if(ee.value=!1,!M.ok){re.value=((z=M.body)==null?void 0:z.error)||"Could not save the drone.";return}ye.value=!1,await b()}const lt=H("");async function Ye(j){var z;const M=await yp(j.id);lt.value="",M.ok?await b():re.value=((z=M.body)==null?void 0:z.error)||"Could not delete the drone."}const Ue=xe(()=>{const j=d.value.length,M=d.value.filter(ut=>{var it;return(((it=ut.compliance)==null?void 0:it.redFlags)||[]).length}).length,z=d.value.filter(ut=>{var it;return(it=ut.compliance)==null?void 0:it.required}).length;return{total:j,flagged:M,required:z,fleet:u.value.length}});return(j,M)=>(v(),y("div",Gy,[r("div",qy,[r("div",Yy,[(v(),y(ae,null,Fe([["flights","Flights"],["drones","Drones"]],z=>r("button",{key:z[0],class:Me(["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:ut=>l.value=z[0]},S(z[1]),11,Jy)),64))]),r("div",Xy,[r("a",{href:Re(Sp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[E(Y,{name:"download",size:15}),M[29]||(M[29]=$(" Export CSV ",-1))],8,Qy),l.value==="flights"?(v(),y("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Le},[E(Y,{name:"plus",size:15}),M[30]||(M[30]=$(" Log flight ",-1))])):(v(),y("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:nt},[E(Y,{name:"plus",size:15}),M[31]||(M[31]=$(" Add drone ",-1))]))])]),r("div",e1,[(v(!0),y(ae,null,Fe([{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"}],z=>(v(),y("div",{key:z.label,class:"panel p-5"},[r("div",t1,S(z.label),1),r("div",{class:Me(["mt-2 text-[30px] font-bold leading-none tracking-tightest",z.tone==="danger"?"text-danger-fg":z.tone==="success"?"text-success-fg":"text-ink"])},S(z.value),3)]))),128))]),_.value?(v(),y("div",n1,S(_.value),1)):D("",!0),l.value==="flights"?(v(),y(ae,{key:1},[ge.value?(v(),y("div",i1,[r("div",s1,[r("div",null,[r("div",o1,S(we.value?"Edit entry":"New entry"),1),M[32]||(M[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},[E(Y,{name:"x",size:16})])]),r("div",a1,[r("label",r1,[M[33]||(M[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),oe(r("input",{"onUpdate:modelValue":M[0]||(M[0]=z=>K.operationDate=z),type:"date",class:"field"},null,512),[[ve,K.operationDate]])]),r("label",l1,[M[34]||(M[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),oe(r("input",{"onUpdate:modelValue":M[1]||(M[1]=z=>K.startTime=z),type:"time",class:"field"},null,512),[[ve,K.startTime]])]),r("label",u1,[M[35]||(M[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),oe(r("input",{"onUpdate:modelValue":M[2]||(M[2]=z=>K.endTime=z),type:"time",class:"field"},null,512),[[ve,K.endTime]])]),r("label",c1,[M[36]||(M[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),oe(r("select",{"onUpdate:modelValue":M[3]||(M[3]=z=>K.drone=z),class:"field"},[u.value.length?D("",!0):(v(),y("option",d1,"— add a drone first —")),(v(!0),y(ae,null,Fe(u.value,z=>(v(),y("option",{key:z.id,value:z.id},S(z.name)+S(z.model?` · ${z.model}`:""),9,f1))),128))],512),[[Ot,K.drone]])]),r("label",h1,[M[37]||(M[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),oe(r("input",{"onUpdate:modelValue":M[4]||(M[4]=z=>K.maxAltitudeAgl=z),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ve,K.maxAltitudeAgl]])]),r("label",p1,[M[38]||(M[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),oe(r("input",{"onUpdate:modelValue":M[5]||(M[5]=z=>K.areaRoute=z),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ve,K.areaRoute]])]),r("label",m1,[M[39]||(M[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),oe(r("input",{"onUpdate:modelValue":M[6]||(M[6]=z=>K.pilotName=z),class:"field",placeholder:"Full name"},null,512),[[ve,K.pilotName]])]),r("label",g1,[M[40]||(M[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),oe(r("input",{"onUpdate:modelValue":M[7]||(M[7]=z=>K.certificateRef=z),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ve,K.certificateRef]])]),r("label",v1,[M[41]||(M[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),oe(r("select",{"onUpdate:modelValue":M[8]||(M[8]=z=>K.loggingPath=z),class:"field"},[(v(),y(ae,null,Fe(X,z=>r("option",{key:z.value,value:z.value},S(z.label),9,_1)),64))],512),[[Ot,K.loggingPath]])]),r("label",y1,[M[42]||(M[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),oe(r("select",{"onUpdate:modelValue":M[9]||(M[9]=z=>K.category=z),class:"field"},[(v(),y(ae,null,Fe(R,z=>r("option",{key:z.value,value:z.value},S(z.label),9,b1)),64))],512),[[Ot,K.category]])]),r("label",x1,[M[43]||(M[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),oe(r("select",{"onUpdate:modelValue":M[10]||(M[10]=z=>K.purpose=z),class:"field"},[(v(),y(ae,null,Fe(F,z=>r("option",{key:z.value,value:z.value},S(z.label),9,w1)),64))],512),[[Ot,K.purpose]])]),r("label",k1,[M[44]||(M[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),oe(r("input",{"onUpdate:modelValue":M[11]||(M[11]=z=>K.authorisationRef=z),class:"field",placeholder:"Specific-category ref"},null,512),[[ve,K.authorisationRef]])])]),r("label",S1,[M[45]||(M[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),oe(r("input",{"onUpdate:modelValue":M[12]||(M[12]=z=>K.rawFdrLogUrl=z),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ve,K.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:M[13]||(M[13]=z=>me.value=!me.value)},[E(Y,{name:me.value?"x":"plus",size:14},null,8,["name"]),M[46]||(M[46]=$(" Operational details (weather, airspace, incidents) ",-1))]),me.value?(v(),y("div",T1,[r("label",P1,[M[47]||(M[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),oe(r("input",{"onUpdate:modelValue":M[14]||(M[14]=z=>K.weather=z),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ve,K.weather]])]),r("label",C1,[M[48]||(M[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),oe(r("input",{"onUpdate:modelValue":M[15]||(M[15]=z=>K.airspaceRef=z),class:"field"},null,512),[[ve,K.airspaceRef]])]),r("label",L1,[M[49]||(M[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),oe(r("input",{"onUpdate:modelValue":M[16]||(M[16]=z=>K.observer=z),class:"field"},null,512),[[ve,K.observer]])]),r("label",M1,[M[50]||(M[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),oe(r("input",{"onUpdate:modelValue":M[17]||(M[17]=z=>K.incidents=z),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ve,K.incidents]])]),r("label",E1,[M[51]||(M[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":M[18]||(M[18]=z=>K.notes=z),rows:"2",class:"field"},null,512),[[ve,K.notes]])])])):D("",!0),r("div",O1,[r("button",{class:"btn-accent",disabled:ie.value,onClick:pe},S(ie.value?"Saving…":we.value?"Save changes":"Log flight"),9,z1),r("button",{class:"btn-ghost",onClick:Ve},"Cancel"),fe.value?(v(),y("span",A1,S(fe.value),1)):D("",!0)])])):D("",!0),r("div",$1,[p.value?(v(),y("div",I1,"Loading…")):d.value.length?(v(),y("div",N1,[r("table",R1,[r("thead",null,[r("tr",F1,[(v(),y(ae,null,Fe(["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"},S(z),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(d.value,z=>{var ut,it,wt,m;return v(),y(ae,{key:z.id},[r("tr",{class:Me(["border-b border-line last:border-0",we.value===z.id?"bg-accent-soft":""])},[r("td",B1,[$(S((z.operationDate||"").slice(0,10))+" ",1),z.startTime?(v(),y("span",V1,S(z.startTime),1)):D("",!0)]),r("td",U1,S(z.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:z.areaRoute},S(z.areaRoute||"—"),9,Z1),r("td",H1,S(z.maxAltitudeAgl?z.maxAltitudeAgl+" m":"—"),1),r("td",j1,S(z.pilotName||"—"),1),r("td",W1,[r("button",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[C(z).tone]]),onClick:f=>O(z.id)},[C(z).tone==="danger"?(v(),et(Y,{key:0,name:"alertTriangle",size:12})):C(z).tone==="success"?(v(),et(Y,{key:1,name:"check",size:12})):D("",!0),$(" "+S(C(z).label),1)],10,K1)]),r("td",G1,[$e.value===z.id?(v(),y(ae,{key:0},[M[54]||(M[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:M[19]||(M[19]=f=>$e.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:f=>Oe(z)},"Delete",8,q1)],64)):(v(),y(ae,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:f=>Ee(z)},[E(Y,{name:"sliders",size:13}),M[55]||(M[55]=$(" Edit",-1))],8,Y1),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:f=>$e.value=z.id},[E(Y,{name:"trash",size:13})],8,J1)],64))])],2),k.value===z.id?(v(),y("tr",X1,[r("td",Q1,[r("div",eb,[r("span",tb,[M[56]||(M[56]=$("Logging path: ",-1)),r("b",nb,S(((ut=z.compliance)==null?void 0:ut.loggingPath)||"—"),1)]),r("span",ib,[M[57]||(M[57]=$("Category: ",-1)),r("b",sb,S(z.category||"—"),1)]),r("span",ob,[M[58]||(M[58]=$("Retain until: ",-1)),r("b",ab,S((z.retentionUntil||"").slice(0,10)||"—"),1)]),(it=z.compliance)!=null&&it.exempt?(v(),y("span",rb,[M[59]||(M[59]=$("Exempt: ",-1)),r("b",lb,S(z.compliance.exemptReason),1)])):D("",!0)]),(((wt=z.compliance)==null?void 0:wt.redFlags)||[]).length?(v(),y("ul",ub,[(v(!0),y(ae,null,Fe(z.compliance.redFlags,(f,x)=>(v(),y("li",{key:x,class:"flex items-start gap-2 text-xs text-danger-fg"},[E(Y,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+S(f),1)]))),128))])):(m=z.compliance)!=null&&m.exempt?D("",!0):(v(),y("div",cb,"No compliance gaps detected."))])])):D("",!0)],64)}),128))])])])):(v(),y("div",D1,[E(Y,{name:"book",size:26,class:"text-ink-muted"}),M[52]||(M[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),M[53]||(M[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(v(),y(ae,{key:2},[ye.value?(v(),y("div",db,[r("div",fb,[r("div",null,[r("div",hb,S(ze.value?"Edit drone":"New drone"),1),M[60]||(M[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:Te},[E(Y,{name:"x",size:16})])]),r("div",pb,[r("label",mb,[M[61]||(M[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),oe(r("input",{"onUpdate:modelValue":M[20]||(M[20]=z=>ce.name=z),class:"field",placeholder:"Mavic-01"},null,512),[[ve,ce.name]])]),r("label",gb,[M[62]||(M[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),oe(r("input",{"onUpdate:modelValue":M[21]||(M[21]=z=>ce.model=z),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ve,ce.model]])]),r("label",vb,[M[63]||(M[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),oe(r("input",{"onUpdate:modelValue":M[22]||(M[22]=z=>ce.serial=z),class:"field"},null,512),[[ve,ce.serial]])]),r("label",_b,[M[64]||(M[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),oe(r("input",{"onUpdate:modelValue":M[23]||(M[23]=z=>ce.operatorNumber=z),class:"field",placeholder:"DNK…"},null,512),[[ve,ce.operatorNumber]])]),r("label",yb,[M[65]||(M[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),oe(r("input",{"onUpdate:modelValue":M[24]||(M[24]=z=>ce.mtomGrams=z),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ve,ce.mtomGrams]])]),r("label",bb,[M[66]||(M[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),oe(r("select",{"onUpdate:modelValue":M[25]||(M[25]=z=>ce.cClass=z),class:"field"},[(v(),y(ae,null,Fe(Q,z=>r("option",{key:z,value:z},S(z||"— none —"),9,xb)),64))],512),[[Ot,ce.cClass]])])]),r("div",wb,[r("label",kb,[oe(r("input",{"onUpdate:modelValue":M[26]||(M[26]=z=>ce.autologsFlights=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[da,ce.autologsFlights]]),M[67]||(M[67]=$(" Auto-logs flights (onboard FDR) ",-1))]),r("label",Sb,[oe(r("input",{"onUpdate:modelValue":M[27]||(M[27]=z=>ce.isToy=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[da,ce.isToy]]),M[68]||(M[68]=$(" Toy drone (logbook-exempt) ",-1))])]),r("div",Tb,[r("button",{class:"btn-accent",disabled:ee.value,onClick:qe},S(ee.value?"Saving…":ze.value?"Save changes":"Add drone"),9,Pb),r("button",{class:"btn-ghost",onClick:Te},"Cancel"),re.value?(v(),y("span",Cb,S(re.value),1)):D("",!0)])])):D("",!0),r("div",Lb,[p.value?(v(),y("div",Mb,"Loading…")):u.value.length?(v(),y("div",Ob,[r("table",zb,[r("thead",null,[r("tr",Ab,[(v(),y(ae,null,Fe(["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"},S(z),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(u.value,z=>(v(),y("tr",{key:z.id,class:Me(["border-b border-line last:border-0",ze.value===z.id?"bg-accent-soft":""])},[r("td",$b,S(z.name),1),r("td",Ib,S(z.model||"—"),1),r("td",Db,S(z.mtomGrams?z.mtomGrams+" g":"—"),1),r("td",Nb,[z.cClass?(v(),y("span",{key:0,class:Me(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},S(z.cClass),3)):(v(),y("span",Rb,"—")),z.isToy?(v(),y("span",{key:2,class:Me(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):D("",!0)]),r("td",Fb,[r("span",{class:Me(["text-xs",z.autologsFlights?"text-success-fg":"text-ink-muted"])},S(z.autologsFlights?"yes":"no"),3)]),r("td",Bb,[lt.value===z.id?(v(),y(ae,{key:0},[M[71]||(M[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:M[28]||(M[28]=ut=>lt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:ut=>Ye(z)},"Delete",8,Vb)],64)):(v(),y(ae,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:ut=>he(z)},[E(Y,{name:"sliders",size:13}),M[72]||(M[72]=$(" Edit",-1))],8,Ub),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:ut=>lt.value=z.id},[E(Y,{name:"trash",size:13})],8,Zb)],64))])],2))),128))])])])):(v(),y("div",Eb,[E(Y,{name:"drone",size:26,class:"text-ink-muted"}),M[69]||(M[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),M[70]||(M[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},jb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Wb={class:"flex flex-wrap items-center gap-3"},Kb={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},Gb=["onClick"],qb={class:"ml-auto"},Yb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Jb={class:"eyebrow"},Xb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Qb={key:1,class:"panel p-5"},ex={class:"mb-4 flex items-center justify-between"},tx={class:"eyebrow"},nx={class:"mt-0.5 text-base font-semibold text-ink"},ix={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},sx={class:"col-span-2 block max-[760px]:col-span-1"},ox={class:"block"},ax=["value"],rx={class:"block"},lx=["value"],ux={class:"block"},cx=["value"],dx={class:"block"},fx={class:"block"},hx={class:"block"},px={class:"block"},mx=["value"],gx={class:"block"},vx={class:"block"},_x={class:"block"},yx=["value"],bx={class:"mt-3 block"},xx={key:0,class:"mt-3"},wx={class:"eyebrow mb-1 block"},kx={key:1,class:"mt-3 text-xs text-ink-muted"},Sx={class:"mt-4 flex items-center gap-3"},Tx=["disabled"],Px={key:0,class:"text-sm text-danger-fg"},Cx={class:"panel overflow-hidden p-0"},Lx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Mx={key:1,class:"grid place-items-center px-5 py-16 text-center"},Ex={class:"mt-3 text-sm font-medium text-ink-secondary"},Ox={class:"mt-1 text-xs text-ink-muted"},zx={key:2,class:"overflow-x-auto"},Ax={class:"w-full border-collapse text-sm"},$x={class:"text-left"},Ix={class:"px-5 py-3"},Dx={class:"font-semibold text-ink"},Nx={key:0,class:"font-mono text-[11px] text-ink-muted"},Rx={class:"px-5 py-3 text-ink-secondary"},Fx={class:"px-5 py-3 text-ink-secondary"},Bx={class:"px-5 py-3"},Vx=["onClick"],Ux={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Zx={class:"px-5 py-3 font-mono text-ink-secondary"},Hx={class:"whitespace-nowrap px-5 py-3 text-right"},jx=["onClick"],Wx=["onClick"],Kx=["href"],Gx=["onClick"],qx=["onClick"],Yx=["onClick"],Jx={key:0,class:"border-b border-line bg-surface-2"},Xx={colspan:"6",class:"px-5 py-3"},Qx={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},e0={class:"text-ink-secondary"},t0={class:"text-ink"},n0={class:"text-ink-secondary"},i0={class:"text-ink"},s0={key:0,class:"text-ink-secondary"},o0={class:"text-ink"},a0={key:1,class:"text-ink-secondary"},r0={class:"font-mono text-ink"},l0={key:2,class:"text-ink-secondary"},u0={class:"font-mono text-ink"},c0={class:"text-ink-secondary"},d0={class:"text-ink"},f0={key:0,class:"mt-2 space-y-1"},h0={key:1,class:"mt-2 text-xs text-success-fg"},p0={key:2,class:"mt-2 text-xs text-ink-secondary"},m0={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},g0={class:"flex items-center gap-3 border-b border-line px-5 py-3"},v0={class:"min-w-0"},_0={class:"truncate text-sm font-semibold text-ink"},y0={class:"truncate font-mono text-[11px] text-ink-muted"},b0={class:"ml-auto flex items-center gap-2"},x0=["href"],w0=["href"],k0={class:"flex-1 overflow-auto bg-surface-2"},S0=["src","alt"],T0=["src","title"],P0={key:2,class:"grid place-items-center px-6 py-16 text-center"},C0={class:"mt-1 text-xs text-ink-muted"},L0=["href"],M0={__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(m=>[m.value,m.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"}],p=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],_=H([]),b=H([]),C=H(!1),k=H("");async function O(){C.value=!0,k.value="";const[m,f]=await Promise.all([Tp(),$c()]);m.ok||(k.value=m.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=m.documents,b.value=f.drones||[],C.value=!1}ui(O);const R=H("all"),F=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],X=xe(()=>{const m=_.value;switch(R.value){case"expiring":return m.filter(f=>{var x;return((x=f.expiry)==null?void 0:x.state)==="expiring_soon"&&f.status!=="archived"});case"expired":return m.filter(f=>{var x;return((x=f.expiry)==null?void 0:x.state)==="expired"&&f.status!=="archived"});case"pending":return m.filter(f=>f.status==="pending_review");case"archived":return m.filter(f=>f.status==="archived");default:return m.filter(f=>f.status!=="archived")}});function q(m){if(m.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const f=m.expiry||{};return f.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:f.state==="expiring_soon"?{tone:"warning",label:`Expires in ${f.daysUntilExpiry}d`,icon:"clock"}:f.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const ge=H("");function we(m){ge.value=ge.value===m?"":m}function K(m){return m.ownerDrone?m.ownerDroneName||"Aircraft":m.ownerRef?m.ownerRef:m.ownerType==="pilot"?"Pilot":m.ownerType?m.ownerType.charAt(0).toUpperCase()+m.ownerType.slice(1):"—"}const fe=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],ie=["pdf","txt","csv","log","json","md","html","htm","xml"];function me(m){const f=(m||"").split(".").pop().toLowerCase();return fe.includes(f)?"image":ie.includes(f)?"frame":"none"}const Le=H(null),Ee=xe(()=>Le.value?me(Le.value.fileName):"none"),Ve=xe(()=>Le.value?Mp(Le.value.id):"");function pe(m){Le.value=m}function $e(){Le.value=null}function Oe(m){m.key==="Escape"&&Le.value&&$e()}ui(()=>window.addEventListener("keydown",Oe)),yo(()=>window.removeEventListener("keydown",Oe));function Q(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const ue=H(!1),ye=H(""),ze=H(""),ce=H(""),re=xt(Q()),ee=H(null),nt=H(null),he=H(""),Te=H(!1);function qe(){ee.value=null,nt.value&&(nt.value.value="")}function lt(){Object.assign(re,Q()),ye.value="",ze.value="",ce.value="",qe(),he.value="",ue.value=!0}function Ye(m){Object.assign(re,{title:m.title||"",docType:m.docType||"certificate",ownerType:m.ownerType||"pilot",ownerDrone:m.ownerDrone||"",ownerRef:m.ownerRef||"",reference:m.reference||"",jurisdiction:m.jurisdiction||"",issueDate:m.issueDate||"",expiryDate:m.expiryDate||"",status:m.status||"active",accessTier:m.accessTier||"ops",notes:m.notes||""}),ye.value=m.id,ze.value="",ce.value="",qe(),he.value="",ue.value=!0}function Ue(m){Ye(m),ye.value="",ze.value=m.id,ce.value=m.title,re.status="active"}function j(){ue.value=!1,ye.value="",ze.value=""}function M(m){var f;ee.value=((f=m.target.files)==null?void 0:f[0])||null}async function z(){var f;if(he.value="",!re.title.trim()){he.value="Give the document a title.";return}Te.value=!0;let m;if(ye.value)m=await Cp(ye.value,{...re});else{const x={...re};ze.value&&(x.replaces=ze.value),m=await Pp(x,ee.value)}if(Te.value=!1,!m.ok){he.value=((f=m.body)==null?void 0:f.error)||"Could not save the document.";return}ue.value=!1,ye.value="",ze.value="",await O()}const ut=H("");async function it(m){var x;const f=await Lp(m.id);ut.value="",f.ok?await O():he.value=((x=f.body)==null?void 0:x.error)||"Could not delete the document."}const wt=xe(()=>{const m=_.value.filter(f=>f.status!=="archived");return{total:m.length,expiring:m.filter(f=>{var x;return((x=f.expiry)==null?void 0:x.state)==="expiring_soon"}).length,expired:m.filter(f=>{var x;return((x=f.expiry)==null?void 0:x.state)==="expired"}).length,pending:_.value.filter(f=>f.status==="pending_review").length}});return(m,f)=>(v(),y("div",jb,[r("div",Wb,[r("div",Kb,[(v(),y(ae,null,Fe(F,x=>r("button",{key:x[0],class:Me(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",R.value===x[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:U=>R.value=x[0]},S(x[1]),11,Gb)),64))]),r("div",qb,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:lt},[E(Y,{name:"upload",size:15}),f[13]||(f[13]=$(" Add document ",-1))])])]),r("div",Yb,[(v(!0),y(ae,null,Fe([{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"}],x=>(v(),y("div",{key:x.label,class:"panel p-5"},[r("div",Jb,S(x.label),1),r("div",{class:Me(["mt-2 text-[30px] font-bold leading-none tracking-tightest",x.tone==="danger"?"text-danger-fg":x.tone==="warning"?"text-amber-fg":x.tone==="success"?"text-success-fg":x.tone==="accent"?"text-accent-soft-fg":"text-ink"])},S(x.value),3)]))),128))]),k.value?(v(),y("div",Xb,S(k.value),1)):D("",!0),ue.value?(v(),y("div",Qb,[r("div",ex,[r("div",null,[r("div",tx,S(ye.value?"Edit document":ze.value?"New version":"New document"),1),r("div",nx,S(ze.value?`Supersedes “${ce.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:j},[E(Y,{name:"x",size:16})])]),r("div",ix,[r("label",sx,[f[14]||(f[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),oe(r("input",{"onUpdate:modelValue":f[0]||(f[0]=x=>re.title=x),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ve,re.title]])]),r("label",ox,[f[15]||(f[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),oe(r("select",{"onUpdate:modelValue":f[1]||(f[1]=x=>re.docType=x),class:"field"},[(v(),y(ae,null,Fe(o,x=>r("option",{key:x.value,value:x.value},S(x.label),9,ax)),64))],512),[[Ot,re.docType]])]),r("label",rx,[f[16]||(f[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),oe(r("select",{"onUpdate:modelValue":f[2]||(f[2]=x=>re.ownerType=x),class:"field"},[(v(),y(ae,null,Fe(u,x=>r("option",{key:x.value,value:x.value},S(x.label),9,lx)),64))],512),[[Ot,re.ownerType]])]),r("label",ux,[f[18]||(f[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),oe(r("select",{"onUpdate:modelValue":f[3]||(f[3]=x=>re.ownerDrone=x),class:"field"},[f[17]||(f[17]=r("option",{value:""},"— none —",-1)),(v(!0),y(ae,null,Fe(b.value,x=>(v(),y("option",{key:x.id,value:x.id},S(x.name)+S(x.model?` · ${x.model}`:""),9,cx))),128))],512),[[Ot,re.ownerDrone]])]),r("label",dx,[f[19]||(f[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),oe(r("input",{"onUpdate:modelValue":f[4]||(f[4]=x=>re.ownerRef=x),class:"field",placeholder:"Client name / serial / site"},null,512),[[ve,re.ownerRef]])]),r("label",fx,[f[20]||(f[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),oe(r("input",{"onUpdate:modelValue":f[5]||(f[5]=x=>re.reference=x),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ve,re.reference]])]),r("label",hx,[f[21]||(f[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),oe(r("input",{"onUpdate:modelValue":f[6]||(f[6]=x=>re.jurisdiction=x),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ve,re.jurisdiction]])]),r("label",px,[f[22]||(f[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),oe(r("select",{"onUpdate:modelValue":f[7]||(f[7]=x=>re.accessTier=x),class:"field"},[(v(),y(ae,null,Fe(p,x=>r("option",{key:x.value,value:x.value},S(x.label),9,mx)),64))],512),[[Ot,re.accessTier]])]),r("label",gx,[f[23]||(f[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),oe(r("input",{"onUpdate:modelValue":f[8]||(f[8]=x=>re.issueDate=x),type:"date",class:"field"},null,512),[[ve,re.issueDate]])]),r("label",vx,[f[24]||(f[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),oe(r("input",{"onUpdate:modelValue":f[9]||(f[9]=x=>re.expiryDate=x),type:"date",class:"field"},null,512),[[ve,re.expiryDate]])]),r("label",_x,[f[25]||(f[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),oe(r("select",{"onUpdate:modelValue":f[10]||(f[10]=x=>re.status=x),class:"field"},[(v(),y(ae,null,Fe(d,x=>r("option",{key:x.value,value:x.value},S(x.label),9,yx)),64))],512),[[Ot,re.status]])])]),r("label",bx,[f[26]||(f[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":f[11]||(f[11]=x=>re.notes=x),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ve,re.notes]])]),ye.value?(v(),y("div",kx,[...f[28]||(f[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)])])):(v(),y("div",xx,[r("span",wx,"File "+S(ze.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:nt,type:"file",class:"field",onChange:M},null,544),f[27]||(f[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",Sx,[r("button",{class:"btn-accent",disabled:Te.value,onClick:z},S(Te.value?"Saving…":ye.value?"Save changes":ze.value?"Upload new version":"Add document"),9,Tx),r("button",{class:"btn-ghost",onClick:j},"Cancel"),he.value?(v(),y("span",Px,S(he.value),1)):D("",!0)])])):D("",!0),r("div",Cx,[C.value?(v(),y("div",Lx,"Loading…")):X.value.length?(v(),y("div",zx,[r("table",Ax,[r("thead",null,[r("tr",$x,[(v(),y(ae,null,Fe(["Title","Type","Owner","Expiry","Ver",""],x=>r("th",{key:x,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(x),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(X.value,x=>{var U,B;return v(),y(ae,{key:x.id},[r("tr",{class:Me(["border-b border-line last:border-0",ye.value===x.id?"bg-accent-soft":""])},[r("td",Ix,[r("div",Dx,S(x.title),1),x.reference?(v(),y("div",Nx,S(x.reference),1)):D("",!0)]),r("td",Rx,S(Re(l)[x.docType]||x.docType||"—"),1),r("td",Fx,S(K(x)),1),r("td",Bx,[r("button",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[q(x).tone]]),onClick:V=>we(x.id)},[q(x).icon?(v(),et(Y,{key:0,name:q(x).icon,size:12},null,8,["name"])):D("",!0),$(" "+S(q(x).label),1)],10,Vx),x.expiryDate?(v(),y("div",Ux,S(x.expiryDate),1)):D("",!0)]),r("td",Zx,"v"+S(x.version||1),1),r("td",Hx,[ut.value===x.id?(v(),y(ae,{key:0},[f[29]||(f[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[12]||(f[12]=V=>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:V=>it(x)},"Delete",8,jx)],64)):(v(),y(ae,{key:1},[x.hasFile?(v(),y("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:V=>pe(x)},[E(Y,{name:"eye",size:13})],8,Wx)):D("",!0),x.hasFile?(v(),y("a",{key:1,href:Re(lr)(x.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[E(Y,{name:"download",size:13})],8,Kx)):D("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:V=>Ue(x)},[E(Y,{name:"upload",size:13})],8,Gx),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:V=>Ye(x)},[E(Y,{name:"sliders",size:13}),f[30]||(f[30]=$(" Edit",-1))],8,qx),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:V=>ut.value=x.id},[E(Y,{name:"trash",size:13})],8,Yx)],64))])],2),ge.value===x.id?(v(),y("tr",Jx,[r("td",Xx,[r("div",Qx,[r("span",e0,[f[31]||(f[31]=$("Status: ",-1)),r("b",t0,S(x.status||"—"),1)]),r("span",n0,[f[32]||(f[32]=$("Access: ",-1)),r("b",i0,S(x.accessTier||"—"),1)]),x.jurisdiction?(v(),y("span",s0,[f[33]||(f[33]=$("Jurisdiction: ",-1)),r("b",o0,S(x.jurisdiction),1)])):D("",!0),x.issueDate?(v(),y("span",a0,[f[34]||(f[34]=$("Issued: ",-1)),r("b",r0,S(x.issueDate),1)])):D("",!0),x.expiryDate?(v(),y("span",l0,[f[35]||(f[35]=$("Expires: ",-1)),r("b",u0,S(x.expiryDate),1)])):D("",!0),r("span",c0,[f[36]||(f[36]=$("File: ",-1)),r("b",d0,S(x.hasFile?x.fileName:"none"),1)])]),(((U=x.expiry)==null?void 0:U.flags)||[]).length?(v(),y("ul",f0,[(v(!0),y(ae,null,Fe(x.expiry.flags,(V,te)=>(v(),y("li",{key:te,class:Me(["flex items-start gap-2 text-xs",x.expiry.state==="expired"?"text-danger-fg":x.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[E(Y,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+S(V),1)],2))),128))])):((B=x.expiry)==null?void 0:B.state)==="valid"?(v(),y("div",h0,"In force — no action needed.")):D("",!0),x.notes?(v(),y("div",p0,[f[37]||(f[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),$(" "+S(x.notes),1)])):D("",!0)])])):D("",!0)],64)}),128))])])])):(v(),y("div",Mx,[E(Y,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",Ex,S(R.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",Ox,S(R.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(v(),et(af,{to:"body"},[Le.value?(v(),y("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:Vr($e,["self"])},[r("div",m0,[r("div",g0,[r("div",v0,[r("div",_0,S(Le.value.title),1),r("div",y0,S(Le.value.fileName),1)]),r("div",b0,[r("a",{href:Ve.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[E(Y,{name:"globe",size:14}),f[38]||(f[38]=$(" New tab ",-1))],8,x0),r("a",{href:Re(lr)(Le.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[E(Y,{name:"download",size:14}),f[39]||(f[39]=$(" Download ",-1))],8,w0),r("button",{class:"btn-icon",title:"Close",onClick:$e},[E(Y,{name:"x",size:16})])])]),r("div",k0,[Ee.value==="image"?(v(),y("img",{key:0,src:Ve.value,alt:Le.value.title,class:"mx-auto block max-w-full"},null,8,S0)):Ee.value==="frame"?(v(),y("iframe",{key:1,src:Ve.value,class:"h-[74vh] w-full border-0 bg-white",title:Le.value.title},null,8,T0)):(v(),y("div",P0,[E(Y,{name:"fileText",size:28,class:"text-ink-muted"}),f[41]||(f[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",C0,S(Le.value.fileName),1),r("a",{href:Re(lr)(Le.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[E(Y,{name:"download",size:15}),f[40]||(f[40]=$(" Download instead ",-1))],8,L0)]))])])])):D("",!0)]))]))}},E0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},O0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},z0={class:"flex items-center gap-2.5 px-2 pb-5"},A0={class:"flex flex-col gap-0.5"},$0=["onClick"],I0={class:"mt-auto flex flex-col gap-2.5"},D0={class:"rounded-lg bg-surface-2 p-3"},N0={class:"flex items-center gap-2"},R0={class:"text-xs font-semibold text-ink"},F0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},B0={class:"flex items-center gap-2.5 px-2 py-1"},V0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},U0={class:"min-w-0 flex-1"},Z0={class:"truncate text-[13px] font-semibold text-ink"},H0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},j0=["title"],W0={class:"overflow-y-auto"},K0={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)"}},G0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},q0={class:"ml-auto flex items-center gap-3"},Y0={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},J0={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},X0={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},Q0={class:"flex items-center justify-between"},ew={class:"eyebrow"},tw={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},nw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},iw={class:"panel p-5"},sw={class:"mb-3.5 flex items-center justify-between"},ow={class:"panel p-5"},aw={class:"mb-3.5 flex items-center justify-between"},rw={class:"grid place-items-center py-10 text-center"},lw={class:"panel overflow-hidden p-0"},uw={class:"flex items-center justify-between px-5 py-4"},cw={class:"flex gap-2"},dw={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},fw={key:1,class:"overflow-x-auto"},hw={class:"w-full border-collapse text-sm"},pw={class:"text-left"},mw=["onClick"],gw={class:"px-5 py-3 font-mono font-bold text-ink"},vw={class:"px-5 py-3 text-ink-secondary"},_w={class:"px-5 py-3"},yw={class:"px-5 py-3 font-mono text-ink-secondary"},bw={class:"px-5 py-3"},xw={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"},Sw={key:1,class:"font-mono text-xs text-ink-muted"},Tw={class:"px-5 py-3 font-mono text-ink-secondary"},Pw={class:"px-5 py-3 text-right"},Cw=["onClick"],Lw={key:1,class:"p-7"},Mw={class:"mb-4 flex flex-wrap items-center gap-3"},Ew={class:"font-mono text-mode font-bold text-ink"},Ow={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"},zw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},Aw=["onClick"],$w={key:0,class:"panel grid place-items-center p-16 text-center"},Iw={class:"pill"},Dw={class:"pill"},Nw={class:"pill"},Rw={class:"mt-1 text-sm font-semibold text-ink"},Fw={class:"pill"},Bw={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},Vw={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},Uw={class:"panel p-4"},Zw={class:"flex items-center gap-4"},Hw={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},jw={class:"readout"},Ww={class:"panel p-4"},Kw={class:"readout"},Gw={class:"panel p-4"},qw={class:"space-y-1.5 text-sm"},Yw={class:"flex justify-between"},Jw={class:"text-ink"},Xw={class:"flex justify-between"},Qw={class:"text-ink"},ek={class:"flex justify-between"},tk={class:"font-mono tabular text-ink"},nk={class:"flex justify-between"},ik={class:"font-mono tabular text-ink"},sk={class:"panel p-4"},ok={class:"space-y-1.5 text-sm"},ak={class:"flex justify-between"},rk={class:"font-mono tabular text-ink"},lk={class:"flex justify-between"},uk={class:"font-mono tabular text-ink"},ck={class:"flex justify-between"},dk={class:"font-mono tabular text-ink"},fk={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},hk={class:"panel p-4"},pk={class:"flex flex-wrap gap-2"},mk={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},gk={class:"panel p-4"},vk={class:"h-[180px] overflow-y-auto font-mono text-xs"},_k={class:"text-ink-muted"},yk={class:"font-semibold text-accent"},bk={class:"break-all text-ink"},xk={key:5,class:"p-7"},wk={class:"panel grid place-items-center p-16 text-center"},kk={class:"mt-3 text-sm font-medium text-ink-secondary"},Sk={key:0,class:"mt-1 text-xs text-ink-muted"},Tk={key:1,class:"mt-1 text-xs text-ink-muted"},Pk={__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=xt({}),d=xt({}),p=H(null),_=H(!1),b=xt([]),C=H(""),k=H("Overview"),O=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],R=xe(()=>(O.find(([,m])=>m===k.value)||["grid"])[0]),F=H(""),X=H(""),q=H("");let ge=null,we=null,K=!1;const fe=xe(()=>Object.keys(u).sort((m,f)=>(u[f].online?1:0)-(u[m].online?1:0)||m.localeCompare(f))),ie=xe(()=>p.value?u[p.value]:null),me=xe(()=>ie.value&&ie.value.telemetry||{}),Le=xe(()=>!!(ie.value&&ie.value.online)),Ee=xe(()=>{const m=me.value;return typeof m.latitude=="number"&&typeof m.longitude=="number"&&(m.latitude||m.longitude)?{lat:m.latitude,lng:m.longitude}:null}),Ve=xe(()=>p.value&&d[p.value]||[]),pe=xe(()=>{const m=me.value;return typeof m.velocityX=="number"&&typeof m.velocityY=="number"?Math.hypot(m.velocityX,m.velocityY):null});function $e(m){return m.online?m.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Oe(m){const f=m&&m.telemetry||{};return typeof f.velocityX=="number"&&typeof f.velocityY=="number"?Math.hypot(f.velocityX,f.velocityY):null}const Q=xe(()=>fe.value.map(m=>{const f=u[m],x=f.telemetry||{},[U,B]=$e(f);return{id:m,mission:f.model||(f.connected?"Drone linked":f.online?"App online":"No signal"),status:U,tone:B,alt:typeof x.altitude=="number"?x.altitude.toFixed(0)+" m":"—",battery:typeof x.batteryPercent=="number"?x.batteryPercent:null,speed:Oe(f)}})),ue=xe(()=>fe.value.filter(m=>u[m].online).length),ye=xe(()=>fe.value.filter(m=>u[m].online&&u[m].connected).length),ze=xe(()=>fe.value.filter(m=>!u[m].online).length),ce=xe(()=>{const m=fe.value.map(f=>{var x;return(x=u[f].telemetry)==null?void 0:x.batteryPercent}).filter(f=>typeof f=="number");return m.length?Math.round(m.reduce((f,x)=>f+x,0)/m.length):null}),re=xe(()=>[{label:"Active flights",value:String(ye.value),delta:`${ue.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:ce.value==null?"—":ce.value+"%",delta:ce.value==null?"no telemetry":ce.value<40?"low — watch":"nominal",tone:ce.value!=null&&ce.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(fe.value.length),delta:`${ye.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(ze.value),delta:ze.value?"needs attention":"all reachable",tone:ze.value?"warning":"success",icon:"signal"}]),ee={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"},nt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},he=xe(()=>{var x,U,B;const f=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((x=f[0])==null?void 0:x[0])||"P")+(((U=f[1])==null?void 0:U[0])||((B=f[0])==null?void 0:B[1])||"V")).toUpperCase()}),Te={superadmin:"Superadmin",admin:"Admin",user:"Operator"},qe=xe(()=>Te[o.role]||"Operator"),lt=xe(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function Ye(m){var x;u[m.deviceId]=m;const f=m.telemetry||{};typeof f.latitude=="number"&&typeof f.longitude=="number"&&(f.latitude||f.longitude)&&(d[m.deviceId]||(d[m.deviceId]=[]),d[m.deviceId].push([f.latitude,f.longitude]),d[m.deviceId].length>1e3&&d[m.deviceId].shift()),(!p.value||m.online&&!((x=u[p.value])!=null&&x.online))&&(p.value=m.deviceId)}function Ue(m){delete u[m],delete d[m],p.value===m&&(p.value=fe.value[0]||null)}function j(m){b.unshift({t:au(Date.now()),tag:m.type||"?",text:JSON.stringify(M(m))}),b.length>200&&b.pop()}function M(m){const f={...m};return delete f.type,f}function z(){const m=location.protocol==="https:"?"wss":"ws";ge=new WebSocket(`${m}://${location.host}/bff/ws`),ge.onopen=()=>_.value=!0,ge.onclose=()=>{_.value=!1,K||(we=setTimeout(z,1500))},ge.onerror=()=>ge&&ge.close(),ge.onmessage=f=>{let x;try{x=JSON.parse(f.data)}catch{return}x.type==="snapshot"?(x.devices||[]).forEach(Ye):x.type==="update"&&x.device?(Ye(x.device),x.event&&x.device.deviceId===p.value&&j(x.event)):x.type==="removed"&&x.deviceId&&Ue(x.deviceId)}}async function ut(){if(!p.value)return q.value="No device selected.";if(!F.value.trim())return q.value="Enter a command name.";let m;if(X.value.trim())try{m=JSON.parse(X.value)}catch{return q.value="Payload is not valid JSON."}const{ok:f,body:x}=await Ep(p.value,F.value.trim(),m);q.value=f?`Sent "${F.value.trim()}".`:`Error: ${x.error||"failed"}`}function it(m,f,x=""){return typeof m=="number"?m.toFixed(f)+x:"—"}function wt(m){p.value=m,k.value="Live flights"}return ui(async()=>{(await Xh()).forEach(Ye),z()}),yo(()=>{K=!0,we&&clearTimeout(we),ge&&ge.close()}),(m,f)=>{var x,U,B,V,te;return v(),y("div",E0,[r("aside",O0,[r("div",z0,[E(Fc,{size:26}),f[7]||(f[7]=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",A0,[(v(),y(ae,null,Fe(O,([N,J])=>r("button",{key:J,class:Me(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",k.value===J?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:Z=>k.value=J},[E(Y,{name:N,size:18,stroke:k.value===J?2.2:1.8},null,8,["name","stroke"]),$(" "+S(J),1)],10,$0)),64))]),r("div",I0,[r("div",D0,[r("div",N0,[r("span",{class:Me(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),r("span",R0,S(_.value?"Link healthy":"Reconnecting…"),1)]),r("span",F0,"API gateway · "+S(_.value?"streaming":"retrying"),1)]),r("div",B0,[r("div",V0,S(he.value),1),r("div",U0,[r("div",Z0,S(t.email||"Operator"),1),r("div",H0,[E(Y,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${qe.value} · ${lt.value}`},S(qe.value)+" · "+S(lt.value),9,j0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:f[0]||(f[0]=N=>l("logout"))},[E(Y,{name:"logout",size:16})])])])]),r("main",W0,[r("header",K0,[r("div",null,[f[8]||(f[8]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",G0,S(k.value),1)]),r("div",q0,[r("div",Y0,[E(Y,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":f[1]||(f[1]=N=>C.value=N),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,C.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:f[2]||(f[2]=N=>k.value="Live flights")},[E(Y,{name:"radio",size:16}),f[9]||(f[9]=$(" Live flights ",-1))])])]),k.value==="Overview"?(v(),y("div",J0,[r("div",X0,[(v(!0),y(ae,null,Fe(re.value,N=>(v(),y("div",{key:N.label,class:"panel p-5"},[r("div",Q0,[r("span",ew,S(N.label),1),E(Y,{name:N.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",tw,S(N.value),1),r("span",{class:Me(["mt-2 block font-mono text-[11px]",nt[N.tone]])},S(N.delta),3)]))),128))]),r("div",nw,[r("div",iw,[r("div",sw,[f[11]||(f[11]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),ye.value?(v(),y("span",{key:0,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ee.success])},[f[10]||(f[10]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(ye.value)+" airborne ",1)],2)):D("",!0)]),E(cu,{position:Ee.value,trail:Ve.value},null,8,["position","trail"])]),r("div",ow,[r("div",aw,[f[12]||(f[12]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),E(Y,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",rw,[E(Y,{name:"calendar",size:24,class:"text-ink-muted"}),f[13]||(f[13]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),f[14]||(f[14]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",lw,[r("div",uw,[f[17]||(f[17]=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",cw,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ee.success])},[f[15]||(f[15]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(ye.value)+" in flight ",1)],2),ze.value?(v(),y("span",{key:0,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ee.warning])},[f[16]||(f[16]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(ze.value)+" offline ",1)],2)):D("",!0)])]),Q.value.length?(v(),y("div",fw,[r("table",hw,[r("thead",null,[r("tr",pw,[(v(),y(ae,null,Fe(["Aircraft","Mission","Status","Alt","Battery","Speed",""],N=>r("th",{key:N,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(N),1)),64))])]),r("tbody",null,[(v(!0),y(ae,null,Fe(Q.value,(N,J)=>(v(),y("tr",{key:N.id,class:Me(["cursor-pointer transition hover:bg-surface-2",Jwt(N.id)},[r("td",gw,S(N.id),1),r("td",vw,S(N.mission),1),r("td",_w,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ee[N.tone]])},[f[18]||(f[18]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(N.status),1)],2)]),r("td",yw,S(N.alt),1),r("td",bw,[N.battery!=null?(v(),y("div",xw,[r("div",ww,[r("div",{class:Me(["h-full",N.battery<40?"bg-caution":"bg-ready"]),style:Ps({width:N.battery+"%"})},null,6)]),r("span",kw,S(N.battery)+"%",1)])):(v(),y("span",Sw,"—"))]),r("td",Tw,[$(S(N.speed==null?"—":N.speed.toFixed(1))+" ",1),f[19]||(f[19]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",Pw,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:Vr(Z=>wt(N.id),["stop"])},[E(Y,{name:"play",size:14}),f[20]||(f[20]=$(" Track ",-1))],8,Cw)])],10,mw))),128))])])])):(v(),y("div",dw," No aircraft connected yet. Devices appear here as they come online. "))])])):k.value==="Live flights"?(v(),y("div",Lw,[r("div",Mw,[r("span",Ew,S(p.value||"No device selected"),1),ie.value&&!Le.value?(v(),y("span",Ow,"Offline")):D("",!0),fe.value.length?(v(),y("div",zw,[(v(!0),y(ae,null,Fe(fe.value,N=>(v(),y("button",{key:N,class:Me(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",N===p.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:J=>p.value=N},[r("span",{class:Me(["h-2 w-2 rounded-full",u[N].online?"bg-ready":"bg-ink-muted"])},null,2),$(" "+S(N),1)],10,Aw))),128))])):D("",!0)]),fe.value.length?(v(),y(ae,{key:1},[r("div",{class:Me(["mb-4 grid gap-3",!Le.value&&ie.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",Iw,[f[23]||(f[23]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Me(["mt-1 text-sm font-semibold",Le.value?((x=ie.value)==null?void 0:x.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},S(Le.value&&((U=ie.value)!=null&&U.registration)?ie.value.registration:"—"),3)]),r("div",Dw,[f[24]||(f[24]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Me(["mt-1 text-sm font-semibold",Le.value?(B=ie.value)!=null&&B.connected?"text-success-fg":"text-danger-fg":"text-ink"])},S(ie.value?Le.value?ie.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",Nw,[f[25]||(f[25]=r("div",{class:"eyebrow"},"Model",-1)),r("div",Rw,S(((V=ie.value)==null?void 0:V.model)||"—"),1)]),r("div",Fw,[f[26]||(f[26]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",Bw,S((te=ie.value)!=null&&te.lastSeenMs?Re(au)(ie.value.lastSeenMs):"—"),1)])],2),r("div",Vw,[r("div",Uw,[f[28]||(f[28]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",Zw,[r("div",Hw,[r("div",{class:Me(["h-full transition-all",typeof me.value.batteryPercent=="number"?me.value.batteryPercent<20?"bg-warning":me.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Ps({width:(typeof me.value.batteryPercent=="number"?me.value.batteryPercent:0)+"%"})},null,6)]),r("div",jw,[$(S(typeof me.value.batteryPercent=="number"?me.value.batteryPercent:"—"),1),f[27]||(f[27]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",Ww,[f[30]||(f[30]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",Kw,[$(S(it(me.value.altitude,1)),1),f[29]||(f[29]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",Gw,[f[35]||(f[35]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",qw,[r("div",Yw,[f[31]||(f[31]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",Jw,S(me.value.flightMode||"—"),1)]),r("div",Xw,[f[32]||(f[32]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",Qw,S(me.value.isFlying==null?"—":me.value.isFlying?"yes":"no"),1)]),r("div",ek,[f[33]||(f[33]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",tk,S(me.value.satelliteCount==null?"—":me.value.satelliteCount),1)]),r("div",nk,[f[34]||(f[34]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",ik,S(pe.value==null?"—":it(pe.value,2," m/s")),1)])])]),r("div",sk,[f[39]||(f[39]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",ok,[r("div",ak,[f[36]||(f[36]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",rk,S(it(me.value.latitude,6)),1)]),r("div",lk,[f[37]||(f[37]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",uk,S(it(me.value.longitude,6)),1)]),r("div",ck,[f[38]||(f[38]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",dk,S(it(typeof me.value.velocityZ=="number"?-me.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",fk,[f[40]||(f[40]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),E(cu,{position:Ee.value,trail:Ve.value},null,8,["position","trail"])]),r("div",hk,[f[41]||(f[41]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",pk,[oe(r("input",{"onUpdate:modelValue":f[3]||(f[3]=N=>F.value=N),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ve,F.value]]),oe(r("input",{"onUpdate:modelValue":f[4]||(f[4]=N=>X.value=N),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ve,X.value]]),r("button",{class:"btn-accent",onClick:ut},"Send")]),r("div",mk,S(q.value),1)]),r("div",gk,[f[42]||(f[42]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",vk,[(v(!0),y(ae,null,Fe(b,(N,J)=>(v(),y("div",{key:J,class:"border-b border-line py-1"},[r("span",_k,S(N.t),1),r("span",yk,S(N.tag),1),r("span",bk,S(N.text),1)]))),128))])])])],64)):(v(),y("div",$w,[E(Y,{name:"radio",size:28,class:"text-ink-muted"}),f[21]||(f[21]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),f[22]||(f[22]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):k.value==="Logbook"?(v(),et(Hb,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):k.value==="Documents"?(v(),et(M0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):k.value==="Settings"?(v(),et(Ky,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:f[5]||(f[5]=N=>l("logout"))},null,8,["email","role","organization","organization-name"])):(v(),y("div",xk,[r("div",wk,[E(Y,{name:R.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",kk,S(k.value),1),k.value==="Drives"?(v(),y("div",Sk,[f[43]||(f[43]=$(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:f[6]||(f[6]=N=>k.value="Settings")},"Settings → Integrations"),f[44]||(f[44]=$(". ",-1))])):(v(),y("div",Tk,"This section is part of the console shell and has no backend yet."))])]))])])}}},Ck={key:0,class:"h-full"},Lk={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},Mk={__name:"App",setup(t){const i=H(!1),o=H(null),l=H("user"),u=H(""),d=H(""),p=H("");function _(k){l.value=k&&k.role||"user",u.value=k&&k.organization||"",d.value=k&&k.organizationName||""}ui(async()=>{p.value=(await qh()).apiBase||"";const k=await nu();k&&(o.value=k.email,_(k),await lu()),i.value=!0});async function b(k){o.value=k,_(await nu()),await lu()}async function C(){Ip(),await Jh(),o.value=null,l.value="user",u.value="",d.value=""}return(k,O)=>i.value?(v(),y("div",Ck,[o.value?(v(),et(Pk,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(v(),et(Xp,{key:1,"default-api-base":p.value,onSignedIn:b},null,8,["default-api-base"]))])):(v(),y("div",Lk,"Loading…"))}};jh(Mk).mount("#app"); diff --git a/Web App/server/dist/assets/index-uk1cBykG.js b/Web App/server/dist/assets/index-uk1cBykG.js new file mode 100644 index 0000000..abc44ee --- /dev/null +++ b/Web App/server/dist/assets/index-uk1cBykG.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 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 Pr(t){const i=Object.create(null);for(const o of t.split(","))i[o]=1;return o=>o in i}const ht={},xs=[],Un=()=>{},mu=()=>!1,pa=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ma=t=>t.startsWith("onUpdate:"),zt=Object.assign,Cr=(t,i)=>{const o=t.indexOf(i);o>-1&&t.splice(o,1)},cd=Object.prototype.hasOwnProperty,rt=(t,i)=>cd.call(t,i),Ae=Array.isArray,ws=t=>yo(t)==="[object Map]",Es=t=>yo(t)==="[object Set]",hl=t=>yo(t)==="[object Date]",He=t=>typeof t=="function",yt=t=>typeof t=="string",Ln=t=>typeof t=="symbol",lt=t=>t!==null&&typeof t=="object",gu=t=>(lt(t)||He(t))&&He(t.then)&&He(t.catch),vu=Object.prototype.toString,yo=t=>vu.call(t),dd=t=>yo(t).slice(8,-1),_u=t=>yo(t)==="[object Object]",Lr=t=>yt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,io=Pr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ga=t=>{const i=Object.create(null);return(o=>i[o]||(i[o]=t(o)))},fd=/-\w/g,Pn=ga(t=>t.replace(fd,i=>i.slice(1).toUpperCase())),hd=/\B([A-Z])/g,Ei=ga(t=>t.replace(hd,"-$1").toLowerCase()),yu=ga(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ya=ga(t=>t?`on${yu(t)}`:""),Vn=(t,i)=>!Object.is(t,i),ea=(t,...i)=>{for(let o=0;o{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:o})},va=t=>{const i=parseFloat(t);return isNaN(i)?t:i},pd=t=>{const i=yt(t)?Number(t):NaN;return isNaN(i)?t:i};let pl;const _a=()=>pl||(pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Cs(t){if(Ae(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 Oe(t){let i="";if(yt(t))i=t;else if(Ae(t))for(let o=0;oCi(o,i))}const wu=t=>!!(t&&t.__v_isRef===!0),k=t=>yt(t)?t:t==null?"":Ae(t)||lt(t)&&(t.toString===vu||!He(t.toString))?wu(t)?k(t.value):JSON.stringify(t,ku,2):String(t),ku=(t,i)=>wu(i)?ku(t,i.value):ws(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[l,u],d)=>(o[Ja(l,d)+" =>"]=u,o),{})}:Es(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>Ja(o))}:Ln(i)?Ja(i):lt(i)&&!Ae(i)&&!_u(i)?String(i):i,Ja=(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 It;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&&It&&(It.active?(this.parent=It,this.index=(It.scopes||(It.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(It===this)It=this.prevScope;else{let i=It;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(oo){let i=oo;for(oo=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let t;for(;so;){let i=so;for(so=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 Cu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function Lu(t){let i,o=t.depsTail,l=o;for(;l;){const u=l.prevDep;l.version===-1?(l===o&&(o=u),zr(l),Sd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=o}function ur(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Mu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Mu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===co)||(t.globalVersion=co,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!ur(t))))return;t.flags|=2;const i=t.dep,o=mt,l=Cn;mt=t,Cn=!0;try{Cu(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{mt=o,Cn=l,Lu(t),t.flags&=-3}}function zr(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)zr(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 Eu=[];function Zn(){Eu.push(Cn),Cn=!1}function Hn(){const t=Eu.pop();Cn=t===void 0?!0:t}function ml(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const o=mt;mt=void 0;try{i()}finally{mt=o}}}let co=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 Ar{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(!mt||!Cn||mt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==mt)o=this.activeLink=new Td(mt,this),mt.deps?(o.prevDep=mt.depsTail,mt.depsTail.nextDep=o,mt.depsTail=o):mt.deps=mt.depsTail=o,Ou(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=mt.depsTail,o.nextDep=void 0,mt.depsTail.nextDep=o,mt.depsTail=o,mt.deps===o&&(mt.deps=l)}return o}trigger(i){this.version++,co++,this.notify(i)}notify(i){Er();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Or()}}}function Ou(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)Ou(l)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const cr=new WeakMap,Ji=Symbol(""),dr=Symbol(""),fo=Symbol("");function Rt(t,i,o){if(Cn&&mt){let l=cr.get(t);l||cr.set(t,l=new Map);let u=l.get(o);u||(l.set(o,u=new Ar),u.map=l,u.key=o),u.track()}}function oi(t,i,o,l,u,d){const h=cr.get(t);if(!h){co++;return}const _=y=>{y&&y.trigger()};if(Er(),i==="clear")h.forEach(_);else{const y=Ae(t),M=y&&Lr(o);if(y&&o==="length"){const S=Number(l);h.forEach((O,V)=>{(V==="length"||V===fo||!Ln(V)&&V>=S)&&_(O)})}else switch((o!==void 0||h.has(void 0))&&_(h.get(o)),M&&_(h.get(fo)),i){case"add":y?M&&_(h.get("length")):(_(h.get(Ji)),ws(t)&&_(h.get(dr)));break;case"delete":y||(_(h.get(Ji)),ws(t)&&_(h.get(dr)));break;case"set":ws(t)&&_(h.get(Ji));break}}Or()}function ys(t){const i=it(t);return i===t?i:(Rt(i,"iterate",fo),mn(t)?i:i.map(Mn))}function ya(t){return Rt(t=it(t),"iterate",fo),t}function Fn(t,i){return li(t)?Ls(Xi(t)?Mn(i):i):Mn(i)}const Pd={__proto__:null,[Symbol.iterator](){return Qa(this,Symbol.iterator,t=>Fn(this,t))},concat(...t){return ys(this).concat(...t.map(i=>Ae(i)?ys(i):i))},entries(){return Qa(this,"entries",t=>(t[1]=Fn(this,t[1]),t))},every(t,i){return ti(this,"every",t,i,void 0,arguments)},filter(t,i){return ti(this,"filter",t,i,o=>o.map(l=>Fn(this,l)),arguments)},find(t,i){return ti(this,"find",t,i,o=>Fn(this,o),arguments)},findIndex(t,i){return ti(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return ti(this,"findLast",t,i,o=>Fn(this,o),arguments)},findLastIndex(t,i){return ti(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return ti(this,"forEach",t,i,void 0,arguments)},includes(...t){return er(this,"includes",t)},indexOf(...t){return er(this,"indexOf",t)},join(t){return ys(this).join(t)},lastIndexOf(...t){return er(this,"lastIndexOf",t)},map(t,i){return ti(this,"map",t,i,void 0,arguments)},pop(){return qs(this,"pop")},push(...t){return qs(this,"push",t)},reduce(t,...i){return gl(this,"reduce",t,i)},reduceRight(t,...i){return gl(this,"reduceRight",t,i)},shift(){return qs(this,"shift")},some(t,i){return ti(this,"some",t,i,void 0,arguments)},splice(...t){return qs(this,"splice",t)},toReversed(){return ys(this).toReversed()},toSorted(t){return ys(this).toSorted(t)},toSpliced(...t){return ys(this).toSpliced(...t)},unshift(...t){return qs(this,"unshift",t)},values(){return Qa(this,"values",t=>Fn(this,t))}};function Qa(t,i,o){const l=ya(t),u=l[i]();return l!==t&&!mn(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 ti(t,i,o,l,u,d){const h=ya(t),_=h!==t&&!mn(t),y=h[i];if(y!==Cd[i]){const O=y.apply(t,d);return _?Mn(O):O}let M=o;h!==t&&(_?M=function(O,V){return o.call(this,Fn(t,O),V,t)}:o.length>2&&(M=function(O,V){return o.call(this,O,V,t)}));const S=y.call(h,M,l);return _&&u?u(S):S}function gl(t,i,o,l){const u=ya(t),d=u!==t&&!mn(t);let h=o,_=!1;u!==t&&(d?(_=l.length===0,h=function(M,S,O){return _&&(_=!1,M=Fn(t,M)),o.call(this,M,Fn(t,S),O,t)}):o.length>3&&(h=function(M,S,O){return o.call(this,M,S,O,t)}));const y=u[i](h,...l);return _?Fn(t,y):y}function er(t,i,o){const l=it(t);Rt(l,"iterate",fo);const u=l[i](...o);return(u===-1||u===!1)&&Dr(o[0])?(o[0]=it(o[0]),l[i](...o)):u}function qs(t,i,o=[]){Zn(),Er();const l=it(t)[i].apply(t,o);return Or(),Hn(),l}const Ld=Pr("__proto__,__v_isRef,__isVue"),zu=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=it(this);return Rt(i,"has",t),i.hasOwnProperty(t)}class Au{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:Nu:d?Du:Iu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=Ae(i);if(!u){let y;if(h&&(y=Pd[o]))return y;if(o==="hasOwnProperty")return Md}const _=Reflect.get(i,o,Ut(i)?i:l);if((Ln(o)?zu.has(o):Ld(o))||(u||Rt(i,"get",o),d))return _;if(Ut(_)){const y=h&&Lr(o)?_:_.value;return u&<(y)?hr(y):y}return lt(_)?u?hr(_):_t(_):_}}class $u extends Au{constructor(i=!1){super(!1,i)}set(i,o,l,u){let d=i[o];const h=Ae(i)&&Lr(o);if(!this._isShallow){const M=li(d);if(!mn(l)&&!li(l)&&(d=it(d),l=it(l)),!h&&Ut(d)&&!Ut(l))return M||(d.value=l),!0}const _=h?Number(o)t,Go=t=>Reflect.getPrototypeOf(t);function $d(t,i,o){return function(...l){const u=this.__v_raw,d=it(u),h=ws(d),_=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,M=u[t](...l),S=o?fr:i?Ls:Mn;return!i&&Rt(d,"iterate",y?dr:Ji),zt(Object.create(M),{next(){const{value:O,done:V}=M.next();return V?{value:O,done:V}:{value:_?[S(O[0]),S(O[1])]:S(O),done:V}}})}}function qo(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=it(d),_=it(u);t||(Vn(u,_)&&Rt(h,"get",u),Rt(h,"get",_));const{has:y}=Go(h),M=i?fr:t?Ls:Mn;if(y.call(h,u))return M(d.get(u));if(y.call(h,_))return M(d.get(_));d!==h&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Rt(it(u),"iterate",Ji),u.size},has(u){const d=this.__v_raw,h=it(d),_=it(u);return t||(Vn(u,_)&&Rt(h,"has",u),Rt(h,"has",_)),u===_?d.has(u):d.has(u)||d.has(_)},forEach(u,d){const h=this,_=h.__v_raw,y=it(_),M=i?fr:t?Ls:Mn;return!t&&Rt(y,"iterate",Ji),_.forEach((S,O)=>u.call(d,M(S),M(O),h))}};return zt(o,t?{add:qo("add"),set:qo("set"),delete:qo("delete"),clear:qo("clear")}:{add(u){const d=it(this),h=Go(d),_=it(u),y=!i&&!mn(u)&&!li(u)?_:u;return h.has.call(d,y)||Vn(u,y)&&h.has.call(d,u)||Vn(_,y)&&h.has.call(d,_)||(d.add(y),oi(d,"add",y,y)),this},set(u,d){!i&&!mn(d)&&!li(d)&&(d=it(d));const h=it(this),{has:_,get:y}=Go(h);let M=_.call(h,u);M||(u=it(u),M=_.call(h,u));const S=y.call(h,u);return h.set(u,d),M?Vn(d,S)&&oi(h,"set",u,d):oi(h,"add",u,d),this},delete(u){const d=it(this),{has:h,get:_}=Go(d);let y=h.call(d,u);y||(u=it(u),y=h.call(d,u)),_&&_.call(d,u);const M=d.delete(u);return y&&oi(d,"delete",u,void 0),M},clear(){const u=it(this),d=u.size!==0,h=u.clear();return d&&oi(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=$d(u,t,i)}),o}function $r(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(rt(o,u)&&u in l?o:l,u,d)}const Dd={get:$r(!1,!1)},Nd={get:$r(!1,!0)},Rd={get:$r(!0,!1)};const Iu=new WeakMap,Du=new WeakMap,Nu=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 _t(t){return li(t)?t:Ir(t,!1,Od,Dd,Iu)}function Vd(t){return Ir(t,!1,Ad,Nd,Du)}function hr(t){return Ir(t,!0,zd,Rd,Nu)}function Ir(t,i,o,l,u){if(!lt(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 _=new Proxy(t,h===2?l:o);return u.set(t,_),_}function Xi(t){return li(t)?Xi(t.__v_raw):!!(t&&t.__v_isReactive)}function li(t){return!!(t&&t.__v_isReadonly)}function mn(t){return!!(t&&t.__v_isShallow)}function Dr(t){return t?!!t.__v_raw:!1}function it(t){const i=t&&t.__v_raw;return i?it(i):t}function Ud(t){return!rt(t,"__v_skip")&&Object.isExtensible(t)&&bu(t,"__v_skip",!0),t}const Mn=t=>lt(t)?_t(t):t,Ls=t=>lt(t)?hr(t):t;function Ut(t){return t?t.__v_isRef===!0:!1}function K(t){return Zd(t,!1)}function Zd(t,i){return Ut(t)?t:new Hd(t,i)}class Hd{constructor(i,o){this.dep=new Ar,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?i:it(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||mn(i)||li(i);i=l?i:it(i),Vn(i,o)&&(this._rawValue=i,this._value=l?i:Mn(i),this.dep.trigger())}}function Be(t){return Ut(t)?t.value:t}const jd={get:(t,i,o)=>i==="__v_raw"?t:Be(Reflect.get(t,i,o)),set:(t,i,o,l)=>{const u=t[i];return Ut(u)&&!Ut(o)?(u.value=o,!0):Reflect.set(t,i,o,l)}};function Ru(t){return Xi(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 Ar(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=co-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&mt!==this)return Pu(this,!0),!0}get value(){const i=this.dep.track();return Mu(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 He(t)?l=t:(l=t.get,u=t.set),new Wd(l,u,o)}const Yo={},na=new WeakMap;let Gi;function Gd(t,i=!1,o=Gi){if(o){let l=na.get(o);l||na.set(o,l=[]),l.push(t)}}function qd(t,i,o=ht){const{immediate:l,deep:u,once:d,scheduler:h,augmentJob:_,call:y}=o,M=de=>u?de:mn(de)||u===!1||u===0?ai(de,1):ai(de);let S,O,V,U,j=!1,B=!1;if(Ut(t)?(O=()=>t.value,j=mn(t)):Xi(t)?(O=()=>M(t),j=!0):Ae(t)?(B=!0,j=t.some(de=>Xi(de)||mn(de)),O=()=>t.map(de=>{if(Ut(de))return de.value;if(Xi(de))return M(de);if(He(de))return y?y(de,2):de()})):He(t)?i?O=y?()=>y(t,2):t:O=()=>{if(V){Zn();try{V()}finally{Hn()}}const de=Gi;Gi=S;try{return y?y(t,3,[U]):t(U)}finally{Gi=de}}:O=Un,i&&u){const de=O,$e=u===!0?1/0:u;O=()=>ai(de(),$e)}const he=kd(),ae=()=>{S.stop(),he&&he.active&&Cr(he.effects,S)};if(d&&i){const de=i;i=(...$e)=>{const ze=de(...$e);return ae(),ze}}let q=B?new Array(t.length).fill(Yo):Yo;const we=de=>{if(!(!(S.flags&1)||!S.dirty&&!de))if(i){const $e=S.run();if(de||u||j||(B?$e.some((ze,ke)=>Vn(ze,q[ke])):Vn($e,q))){V&&V();const ze=Gi;Gi=S;try{const ke=[$e,q===Yo?void 0:B&&q[0]===Yo?[]:q,U];q=$e,y?y(i,3,ke):i(...ke)}finally{Gi=ze}}}else S.run()};return _&&_(we),S=new Su(O),S.scheduler=h?()=>h(we,!1):we,U=de=>Gd(de,!1,S),V=S.onStop=()=>{const de=na.get(S);if(de){if(y)y(de,4);else for(const $e of de)$e();na.delete(S)}},i?l?we(!0):q=S.run():h?h(we.bind(null,!0),!0):S.run(),ae.pause=S.pause.bind(S),ae.resume=S.resume.bind(S),ae.stop=ae,ae}function ai(t,i=1/0,o){if(i<=0||!lt(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=i))return t;if(o.set(t,i),i--,Ut(t))ai(t.value,i,o);else if(Ae(t))for(let l=0;l{ai(l,i,o)});else if(_u(t)){for(const l in t)ai(t[l],i,o);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&ai(t[l],i,o)}return t}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function bo(t,i,o,l){try{return l?t(...l):t()}catch(u){ba(u,i,o)}}function vn(t,i,o,l){if(He(t)){const u=bo(t,i,o,l);return u&&gu(u)&&u.catch(d=>{ba(d,i,o)}),u}if(Ae(t)){const u=[];for(let d=0;d>>1,u=Yt[l],d=ho(u);d=ho(o)?Yt.push(t):Yt.splice(Jd(i),0,t),t.flags|=1,Vu()}}function Vu(){ia||(ia=Fu.then(Zu))}function Xd(t){Ae(t)?ks.push(...t):Pi&&t.id===-1?Pi.splice(bs+1,0,t):t.flags&1||(ks.push(t),t.flags|=1),Vu()}function vl(t,i,o=Rn+1){for(;oho(o)-ho(l));if(ks.length=0,Pi){Pi.push(...i);return}for(Pi=i,bs=0;bst.id==null?t.flags&2?-1:1/0:t.id;function Zu(t){try{for(Rn=0;Rn{l._d&&ra(-1);const d=sa(i);let h;try{h=t(...u)}finally{sa(d),l._d&&ra(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function oe(t,i){if(Vt===null)return t;const o=Ta(Vt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return o&&He(i)?i.call(l&&l.proxy):i}}const Qd=Symbol.for("v-scx"),ef=()=>ao(Qd);function Ft(t,i,o){return Wu(t,i,o)}function Wu(t,i,o=ht){const{immediate:l,deep:u,flush:d,once:h}=o,_=zt({},o),y=i&&l||!i&&d!=="post";let M;if(vo){if(d==="sync"){const U=ef();M=U.__watcherHandles||(U.__watcherHandles=[])}else if(!y){const U=()=>{};return U.stop=Un,U.resume=Un,U.pause=Un,U}}const S=Jt;_.call=(U,j,B)=>vn(U,S,j,B);let O=!1;d==="post"?_.scheduler=U=>{qt(U,S&&S.suspense)}:d!=="sync"&&(O=!0,_.scheduler=(U,j)=>{j?U():Nr(U)}),_.augmentJob=U=>{i&&(U.flags|=4),O&&(U.flags|=2,S&&(U.id=S.uid,U.i=S))};const V=qd(t,i,_);return vo&&(M?M.push(V):y&&V()),V}function tf(t,i,o){const l=this.proxy,u=yt(t)?t.includes(".")?Ku(l,t):()=>l[t]:t.bind(l,l);let d;He(i)?d=i:(d=i.handler,o=i);const h=xo(this),_=Wu(u,d.bind(l),o);return h(),_}function Ku(t,i){const o=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,qi=t=>t&&(t.disabled||t.disabled===""),nf=t=>t&&(t.defer||t.defer===""),_l=t=>typeof SVGElement<"u"&&t instanceof SVGElement,yl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,pr=(t,i)=>{const o=t&&t.to;return yt(o)?i?i(o):null:o},sf={name:"Teleport",__isTeleport:!0,process(t,i,o,l,u,d,h,_,y,M){const{mc:S,pc:O,pbc:V,o:{insert:U,querySelector:j,createText:B,createComment:he,parentNode:ae}}=M,q=qi(i.props);let{dynamicChildren:we}=i;const de=(ke,Ze,ge)=>{ke.shapeFlag&16&&S(ke.children,Ze,ge,u,d,h,_,y)},$e=(ke=i)=>{const Ze=qi(ke.props),ge=ke.target=pr(ke.props,j),Ce=mr(ge,ke,B,U);ge&&(h!=="svg"&&_l(ge)?h="svg":h!=="mathml"&&yl(ge)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(ge),Ze||(de(ke,ge,Ce),Qs(ke,!1)))},ze=ke=>{const Ze=()=>{if(Ti.get(ke)===Ze){if(Ti.delete(ke),qi(ke.props)){const ge=ae(ke.el)||o;de(ke,ge,ke.anchor),Qs(ke,!0)}$e(ke)}};Ti.set(ke,Ze),qt(Ze,d)};if(t==null){const ke=i.el=B(""),Ze=i.anchor=B("");if(U(ke,o,l),U(Ze,o,l),nf(i.props)||d&&d.pendingBranch){ze(i);return}q&&(de(i,o,Ze),Qs(i,!0)),$e()}else{i.el=t.el;const ke=i.anchor=t.anchor,Ze=Ti.get(t);if(Ze){Ze.flags|=8,Ti.delete(t),ze(i);return}i.targetStart=t.targetStart;const ge=i.target=t.target,Ce=i.targetAnchor=t.targetAnchor,_e=qi(t.props),J=_e?o:ge,le=_e?ke:Ce;if(h==="svg"||_l(ge)?h="svg":(h==="mathml"||yl(ge))&&(h="mathml"),we?(V(t.dynamicChildren,we,J,u,d,h,_),Br(t,i,!0)):y||O(t,i,J,le,u,d,h,_,!1),q)_e?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):Jo(i,o,ke,M,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const Le=pr(i.props,j);Le&&(i.target=Le,Jo(i,Le,null,M,0))}else _e&&Jo(i,ge,Ce,M,1);Qs(i,q)}},remove(t,i,o,{um:l,o:{remove:u}},d){const{shapeFlag:h,children:_,anchor:y,targetStart:M,targetAnchor:S,target:O,props:V}=t,U=qi(V),j=d||!U,B=Ti.get(t);if(B&&(B.flags|=8,Ti.delete(t)),O&&(u(M),u(S)),d&&u(y),!B&&(U||O)&&h&16)for(let he=0;he<_.length;he++){const ae=_[he];l(ae,i,o,j,!!ae.dynamicChildren)}},move:Jo,hydrate:of};function Jo(t,i,o,{o:{insert:l},m:u},d=2){d===0&&l(t.targetAnchor,i,o);const{el:h,anchor:_,shapeFlag:y,children:M,props:S}=t,O=d===2;if(O&&l(h,i,o),!Ti.has(t)&&(!O||qi(S))&&y&16)for(let V=0;V{t.isMounted=!0}),Os(()=>{t.isUnmounting=!0}),t}const fn=[Function,Array],Yu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fn,onEnter:fn,onAfterEnter:fn,onEnterCancelled:fn,onBeforeLeave:fn,onLeave:fn,onAfterLeave:fn,onLeaveCancelled:fn,onBeforeAppear:fn,onAppear:fn,onAfterAppear:fn,onAppearCancelled:fn},Ju=t=>{const i=t.subTree;return i.component?Ju(i.component):i},lf={name:"BaseTransition",props:Yu,setup(t,{slots:i}){const o=kc(),l=rf();return()=>{const u=i.default&&ec(i.default(),!0),d=u&&u.length?Xu(u):o.subTree?F():void 0;if(!d)return;const h=it(t),{mode:_}=h;if(l.isLeaving)return tr(d);const y=bl(d);if(!y)return tr(d);let M=gr(y,h,l,o,O=>M=O);y.type!==Bt&&po(y,M);let S=o.subTree&&bl(o.subTree);if(S&&S.type!==Bt&&!Yi(S,y)&&Ju(o).type!==Bt){let O=gr(S,h,l,o);if(po(S,O),_==="out-in"&&y.type!==Bt)return l.isLeaving=!0,O.afterLeave=()=>{l.isLeaving=!1,o.job.flags&8||o.update(),delete O.afterLeave,S=void 0},tr(d);_==="in-out"&&y.type!==Bt?O.delayLeave=(V,U,j)=>{const B=Qu(l,S);B[String(S.key)]=S,V[pn]=()=>{U(),V[pn]=void 0,delete M.delayedLeave,S=void 0},M.delayedLeave=()=>{j(),delete M.delayedLeave,S=void 0}}:S=void 0}else S&&(S=void 0);return d}}};function Xu(t){let i=t[0];if(t.length>1){for(const o of t)if(o.type!==Bt){i=o;break}}return i}const uf=lf;function Qu(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 gr(t,i,o,l,u){const{appear:d,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:M,onAfterEnter:S,onEnterCancelled:O,onBeforeLeave:V,onLeave:U,onAfterLeave:j,onLeaveCancelled:B,onBeforeAppear:he,onAppear:ae,onAfterAppear:q,onAppearCancelled:we}=i,de=String(t.key),$e=Qu(o,t),ze=(ge,Ce)=>{ge&&vn(ge,l,9,Ce)},ke=(ge,Ce)=>{const _e=Ce[1];ze(ge,Ce),Ae(ge)?ge.every(J=>J.length<=1)&&_e():ge.length<=1&&_e()},Ze={mode:h,persisted:_,beforeEnter(ge){let Ce=y;if(!o.isMounted)if(d)Ce=he||y;else return;ge[pn]&&ge[pn](!0);const _e=$e[de];_e&&Yi(t,_e)&&_e.el[pn]&&_e.el[pn](),ze(Ce,[ge])},enter(ge){if($e[de]===t)return;let Ce=M,_e=S,J=O;if(!o.isMounted)if(d)Ce=ae||M,_e=q||S,J=we||O;else return;let le=!1;ge[Ys]=Ne=>{le||(le=!0,Ne?ze(J,[ge]):ze(_e,[ge]),Ze.delayedLeave&&Ze.delayedLeave(),ge[Ys]=void 0)};const Le=ge[Ys].bind(null,!1);Ce?ke(Ce,[ge,Le]):Le()},leave(ge,Ce){const _e=String(t.key);if(ge[Ys]&&ge[Ys](!0),o.isUnmounting)return Ce();ze(V,[ge]);let J=!1;ge[pn]=Le=>{J||(J=!0,Ce(),Le?ze(B,[ge]):ze(j,[ge]),ge[pn]=void 0,$e[_e]===t&&delete $e[_e])};const le=ge[pn].bind(null,!1);$e[_e]=t,U?ke(U,[ge,le]):le()},clone(ge){const Ce=gr(ge,i,o,l,u);return u&&u(Ce),Ce}};return Ze}function tr(t){if(xa(t))return t=Li(t),t.children=null,t}function bl(t){if(!xa(t))return qu(t.type)&&t.children?Xu(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&&He(o.default))return o.default()}}function po(t,i){t.shapeFlag&6&&t.component?(t.transition=i,po(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 ec(t,i=!1,o){let l=[],u=0;for(let d=0;d1)for(let d=0;dro(B,i&&(Ae(i)?i[he]:i),o,l,u));return}if(Ss(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&ro(t,i,o,l.component.subTree);return}const d=l.shapeFlag&4?Ta(l.component):l.el,h=u?null:d,{i:_,r:y}=t,M=i&&i.r,S=_.refs===ht?_.refs={}:_.refs,O=_.setupState,V=it(O),U=O===ht?mu:B=>xl(S,B)?!1:rt(V,B),j=(B,he)=>!(he&&xl(S,he));if(M!=null&&M!==y){if(wl(i),yt(M))S[M]=null,U(M)&&(O[M]=null);else if(Ut(M)){const B=i;j(M,B.k)&&(M.value=null),B.k&&(S[B.k]=null)}}if(He(y)){Zn();try{bo(y,_,12,[h,S])}finally{Hn()}}else{const B=yt(y),he=Ut(y);if(B||he){const ae=()=>{if(t.f){const q=B?U(y)?O[y]:S[y]:j()||!t.k?y.value:S[t.k];if(u)Ae(q)&&Cr(q,d);else if(Ae(q))q.includes(d)||q.push(d);else if(B)S[y]=[d],U(y)&&(O[y]=S[y]);else{const we=[d];j(y,t.k)&&(y.value=we),t.k&&(S[t.k]=we)}}else B?(S[y]=h,U(y)&&(O[y]=h)):he&&(j(y,t.k)&&(y.value=h),t.k&&(S[t.k]=h))};if(h){const q=()=>{ae(),oa.delete(t)};q.id=-1,oa.set(t,q),qt(q,o)}else wl(t),ae()}}}function wl(t){const i=oa.get(t);i&&(i.flags|=8,oa.delete(t))}_a().requestIdleCallback;_a().cancelIdleCallback;const Ss=t=>!!t.type.__asyncLoader,xa=t=>t.type.__isKeepAlive;function cf(t,i){nc(t,"a",i)}function df(t,i){nc(t,"da",i)}function nc(t,i,o=Jt){const l=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(wa(i,l,o),o){let u=o.parent;for(;u&&u.parent;)xa(u.parent.vnode)&&ff(l,i,o,u),u=u.parent}}function ff(t,i,o,l){const u=wa(i,t,l,!0);ic(()=>{Cr(l[i],u)},o)}function wa(t,i,o=Jt,l=!1){if(o){const u=o[t]||(o[t]=[]),d=i.__weh||(i.__weh=(...h)=>{Zn();const _=xo(o),y=vn(i,o,t,h);return _(),Hn(),y});return l?u.unshift(d):u.push(d),d}}const ci=t=>(i,o=Jt)=>{(!vo||t==="sp")&&wa(t,(...l)=>i(...l),o)},hf=ci("bm"),ui=ci("m"),pf=ci("bu"),mf=ci("u"),Os=ci("bum"),ic=ci("um"),gf=ci("sp"),vf=ci("rtg"),_f=ci("rtc");function yf(t,i=Jt){wa("ec",t,i)}const bf=Symbol.for("v-ndc");function Ve(t,i,o,l){let u;const d=o,h=Ae(t);if(h||yt(t)){const _=h&&Xi(t);let y=!1,M=!1;_&&(y=!mn(t),M=li(t),t=ya(t)),u=new Array(t.length);for(let S=0,O=t.length;Si(_,y,void 0,d));else{const _=Object.keys(t);u=new Array(_.length);for(let y=0,M=_.length;y0;return m(),nt(ue,null,[z("slot",o,l)],M?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),m();const h=d&&sc(d(o)),_=o.key||h&&h.key,y=nt(ue,{key:(_&&!Ln(_)?_:`_${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 sc(t){return t.some(i=>go(i)?!(i.type===Bt||i.type===ue&&!sc(i.children)):!0)?t:null}const vr=t=>t?Sc(t)?Ta(t):vr(t.parent):null,lo=zt(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=>vr(t.parent),$root:t=>vr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>ac(t),$forceUpdate:t=>t.f||(t.f=()=>{Nr(t.update)}),$nextTick:t=>t.n||(t.n=Bu.bind(t.proxy)),$watch:t=>tf.bind(t)}),nr=(t,i)=>t!==ht&&!t.__isScriptSetup&&rt(t,i),wf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:l,data:u,props:d,accessCache:h,type:_,appContext:y}=t;if(i[0]!=="$"){const V=h[i];if(V!==void 0)switch(V){case 1:return l[i];case 2:return u[i];case 4:return o[i];case 3:return d[i]}else{if(nr(l,i))return h[i]=1,l[i];if(u!==ht&&rt(u,i))return h[i]=2,u[i];if(rt(d,i))return h[i]=3,d[i];if(o!==ht&&rt(o,i))return h[i]=4,o[i];_r&&(h[i]=0)}}const M=lo[i];let S,O;if(M)return i==="$attrs"&&Rt(t.attrs,"get",""),M(t);if((S=_.__cssModules)&&(S=S[i]))return S;if(o!==ht&&rt(o,i))return h[i]=4,o[i];if(O=y.config.globalProperties,rt(O,i))return O[i]},set({_:t},i,o){const{data:l,setupState:u,ctx:d}=t;return nr(u,i)?(u[i]=o,!0):l!==ht&&rt(l,i)?(l[i]=o,!0):rt(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}},_){let y;return!!(o[_]||t!==ht&&_[0]!=="$"&&rt(t,_)||nr(i,_)||rt(d,_)||rt(l,_)||rt(lo,_)||rt(u.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(t,i,o){return o.get!=null?t._.accessCache[i]=0:rt(o,"value")&&this.set(t,i,o.value,null),Reflect.defineProperty(t,i,o)}};function kl(t){return Ae(t)?t.reduce((i,o)=>(i[o]=null,i),{}):t}let _r=!0;function kf(t){const i=ac(t),o=t.proxy,l=t.ctx;_r=!1,i.beforeCreate&&Sl(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:h,watch:_,provide:y,inject:M,created:S,beforeMount:O,mounted:V,beforeUpdate:U,updated:j,activated:B,deactivated:he,beforeDestroy:ae,beforeUnmount:q,destroyed:we,unmounted:de,render:$e,renderTracked:ze,renderTriggered:ke,errorCaptured:Ze,serverPrefetch:ge,expose:Ce,inheritAttrs:_e,components:J,directives:le,filters:Le}=i;if(M&&Sf(M,l,null),h)for(const ce in h){const se=h[ce];He(se)&&(l[ce]=se.bind(o))}if(u){const ce=u.call(o,o);lt(ce)&&(t.data=_t(ce))}if(_r=!0,d)for(const ce in d){const se=d[ce],tt=He(se)?se.bind(o,o):He(se.get)?se.get.bind(o,o):Un,pe=!He(se)&&He(se.set)?se.set.bind(o):Un,Se=Pe({get:tt,set:pe});Object.defineProperty(l,ce,{enumerable:!0,configurable:!0,get:()=>Se.value,set:Ge=>Se.value=Ge})}if(_)for(const ce in _)oc(_[ce],l,o,ce);if(y){const ce=He(y)?y.call(o):y;Reflect.ownKeys(ce).forEach(se=>{ju(se,ce[se])})}S&&Sl(S,t,"c");function ve(ce,se){Ae(se)?se.forEach(tt=>ce(tt.bind(o))):se&&ce(se.bind(o))}if(ve(hf,O),ve(ui,V),ve(pf,U),ve(mf,j),ve(cf,B),ve(df,he),ve(yf,Ze),ve(_f,ze),ve(vf,ke),ve(Os,q),ve(ic,de),ve(gf,ge),Ae(Ce))if(Ce.length){const ce=t.exposed||(t.exposed={});Ce.forEach(se=>{Object.defineProperty(ce,se,{get:()=>o[se],set:tt=>o[se]=tt,enumerable:!0})})}else t.exposed||(t.exposed={});$e&&t.render===Un&&(t.render=$e),_e!=null&&(t.inheritAttrs=_e),J&&(t.components=J),le&&(t.directives=le),ge&&tc(t)}function Sf(t,i,o=Un){Ae(t)&&(t=yr(t));for(const l in t){const u=t[l];let d;lt(u)?"default"in u?d=ao(u.from||l,u.default,!0):d=ao(u.from||l):d=ao(u),Ut(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[l]=d}}function Sl(t,i,o){vn(Ae(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,o)}function oc(t,i,o,l){let u=l.includes(".")?Ku(o,l):()=>o[l];if(yt(t)){const d=i[t];He(d)&&Ft(u,d)}else if(He(t))Ft(u,t.bind(o));else if(lt(t))if(Ae(t))t.forEach(d=>oc(d,i,o,l));else{const d=He(t.handler)?t.handler.bind(o):i[t.handler];He(d)&&Ft(u,d,t)}}function ac(t){const i=t.type,{mixins:o,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:h}}=t.appContext,_=d.get(i);let y;return _?y=_:!u.length&&!o&&!l?y=i:(y={},u.length&&u.forEach(M=>aa(y,M,h,!0)),aa(y,i,h)),lt(i)&&d.set(i,y),y}function aa(t,i,o,l=!1){const{mixins:u,extends:d}=i;d&&aa(t,d,o,!0),u&&u.forEach(h=>aa(t,h,o,!0));for(const h in i)if(!(l&&h==="expose")){const _=Tf[h]||o&&o[h];t[h]=_?_(t[h],i[h]):i[h]}return t}const Tf={data:Tl,props:Pl,emits:Pl,methods:eo,computed:eo,beforeCreate:Gt,created:Gt,beforeMount:Gt,mounted:Gt,beforeUpdate:Gt,updated:Gt,beforeDestroy:Gt,beforeUnmount:Gt,destroyed:Gt,unmounted:Gt,activated:Gt,deactivated:Gt,errorCaptured:Gt,serverPrefetch:Gt,components:eo,directives:eo,watch:Cf,provide:Tl,inject:Pf};function Tl(t,i){return i?t?function(){return zt(He(t)?t.call(this,this):t,He(i)?i.call(this,this):i)}:i:t}function Pf(t,i){return eo(yr(t),yr(i))}function yr(t){if(Ae(t)){const i={};for(let o=0;oi==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Pn(i)}Modifiers`]||t[`${Ei(i)}Modifiers`];function Of(t,i,...o){if(t.isUnmounted)return;const l=t.vnode.props||ht;let u=o;const d=i.startsWith("update:"),h=d&&Ef(l,i.slice(7));h&&(h.trim&&(u=o.map(S=>yt(S)?S.trim():S)),h.number&&(u=o.map(va)));let _,y=l[_=Ya(i)]||l[_=Ya(Pn(i))];!y&&d&&(y=l[_=Ya(Ei(i))]),y&&vn(y,t,6,u);const M=l[_+"Once"];if(M){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,vn(M,t,6,u)}}const zf=new WeakMap;function lc(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={},_=!1;if(!He(t)){const y=M=>{const S=lc(M,i,!0);S&&(_=!0,zt(h,S))};!o&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!d&&!_?(lt(t)&&l.set(t,null),null):(Ae(d)?d.forEach(y=>h[y]=null):zt(h,d),lt(t)&&l.set(t,h),h)}function ka(t,i){return!t||!pa(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),rt(t,i[0].toLowerCase()+i.slice(1))||rt(t,Ei(i))||rt(t,i))}function Cl(t){const{type:i,vnode:o,proxy:l,withProxy:u,propsOptions:[d],slots:h,attrs:_,emit:y,render:M,renderCache:S,props:O,data:V,setupState:U,ctx:j,inheritAttrs:B}=t,he=sa(t);let ae,q;try{if(o.shapeFlag&4){const de=u||l,$e=de;ae=Bn(M.call($e,de,S,O,U,V,j)),q=_}else{const de=i;ae=Bn(de.length>1?de(O,{attrs:_,slots:h,emit:y}):de(O,null)),q=i.props?_:Af(_)}}catch(de){uo.length=0,ba(de,t,1),ae=z(Bt)}let we=ae;if(q&&B!==!1){const de=Object.keys(q),{shapeFlag:$e}=we;de.length&&$e&7&&(d&&de.some(ma)&&(q=$f(q,d)),we=Li(we,q,!1,!0))}return o.dirs&&(we=Li(we,null,!1,!0),we.dirs=we.dirs?we.dirs.concat(o.dirs):o.dirs),o.transition&&po(we,o.transition),ae=we,sa(he),ae}const Af=t=>{let i;for(const o in t)(o==="class"||o==="style"||pa(o))&&((i||(i={}))[o]=t[o]);return i},$f=(t,i)=>{const o={};for(const l in t)(!ma(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:_,patchFlag:y}=i,M=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&y>=0){if(y&1024)return!0;if(y&16)return l?Ll(l,h,M):!!h;if(y&8){const S=i.dynamicProps;for(let O=0;OObject.create(cc),fc=t=>Object.getPrototypeOf(t)===cc;function Nf(t,i,o,l=!1){const u={},d=dc();t.propsDefaults=Object.create(null),hc(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,_=it(u),[y]=t.propsOptions;let M=!1;if((l||h>0)&&!(h&16)){if(h&8){const S=t.vnode.dynamicProps;for(let O=0;O{y=!0;const[V,U]=pc(O,i,!0);zt(h,V),U&&_.push(...U)};!o&&i.mixins.length&&i.mixins.forEach(S),t.extends&&S(t.extends),t.mixins&&t.mixins.forEach(S)}if(!d&&!y)return lt(t)&&l.set(t,xs),xs;if(Ae(d))for(let S=0;St==="_"||t==="_ctx"||t==="$stable",Fr=t=>Ae(t)?t.map(Bn):[Bn(t)],Bf=(t,i,o)=>{if(i._n)return i;const l=Te((...u)=>Fr(i(...u)),o);return l._c=!1,l},mc=(t,i,o)=>{const l=t._ctx;for(const u in t){if(Rr(u))continue;const d=t[u];if(He(d))i[u]=Bf(u,d,l);else if(d!=null){const h=Fr(d);i[u]=()=>h}}},gc=(t,i)=>{const o=Fr(i);t.slots.default=()=>o},vc=(t,i,o)=>{for(const l in i)(o||!Rr(l))&&(t[l]=i[l])},Vf=(t,i,o)=>{const l=t.slots=dc();if(t.vnode.shapeFlag&32){const u=i._;u?(vc(l,i,o),o&&bu(l,"_",u,!0)):mc(i,l)}else i&&gc(t,i)},Uf=(t,i,o)=>{const{vnode:l,slots:u}=t;let d=!0,h=ht;if(l.shapeFlag&32){const _=i._;_?o&&_===1?d=!1:vc(u,i,o):(d=!i.$stable,mc(i,u)),h=i}else i&&(gc(t,i),h={default:1});if(d)for(const _ in u)!Rr(_)&&h[_]==null&&delete u[_]},qt=Kf;function Zf(t){return Hf(t)}function Hf(t,i){const o=_a();o.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:h,createText:_,createComment:y,setText:M,setElementText:S,parentNode:O,nextSibling:V,setScopeId:U=Un,insertStaticContent:j}=t,B=(b,g,w,W=null,H=null,Z=null,ee=void 0,I=null,C=!!g.dynamicChildren)=>{if(b===g)return;b&&!Yi(b,g)&&(W=E(b),Ge(b,H,Z,!0),b=null),g.patchFlag===-2&&(C=!1,g.dynamicChildren=null);const{type:N,ref:be,shapeFlag:re}=g;switch(N){case Sa:he(b,g,w,W);break;case Bt:ae(b,g,w,W);break;case sr:b==null&&q(g,w,W,ee);break;case ue:J(b,g,w,W,H,Z,ee,I,C);break;default:re&1?$e(b,g,w,W,H,Z,ee,I,C):re&6?le(b,g,w,W,H,Z,ee,I,C):(re&64||re&128)&&N.process(b,g,w,W,H,Z,ee,I,C,dt)}be!=null&&H?ro(be,b&&b.ref,Z,g||b,!g):be==null&&b&&b.ref!=null&&ro(b.ref,null,Z,b,!0)},he=(b,g,w,W)=>{if(b==null)l(g.el=_(g.children),w,W);else{const H=g.el=b.el;g.children!==b.children&&M(H,g.children)}},ae=(b,g,w,W)=>{b==null?l(g.el=y(g.children||""),w,W):g.el=b.el},q=(b,g,w,W)=>{[b.el,b.anchor]=j(b.children,g,w,W,b.el,b.anchor)},we=({el:b,anchor:g},w,W)=>{let H;for(;b&&b!==g;)H=V(b),l(b,w,W),b=H;l(g,w,W)},de=({el:b,anchor:g})=>{let w;for(;b&&b!==g;)w=V(b),u(b),b=w;u(g)},$e=(b,g,w,W,H,Z,ee,I,C)=>{if(g.type==="svg"?ee="svg":g.type==="math"&&(ee="mathml"),b==null)ze(g,w,W,H,Z,ee,I,C);else{const N=b.el&&b.el._isVueCE?b.el:null;try{N&&N._beginPatch(),ge(b,g,H,Z,ee,I,C)}finally{N&&N._endPatch()}}},ze=(b,g,w,W,H,Z,ee,I)=>{let C,N;const{props:be,shapeFlag:re,transition:te,dirs:Me}=b;if(C=b.el=h(b.type,Z,be&&be.is,be),re&8?S(C,b.children):re&16&&Ze(b.children,C,null,W,H,ir(b,Z),ee,I),Me&&Hi(b,null,W,"created"),ke(C,b,b.scopeId,ee,W),be){for(const me in be)me!=="value"&&!io(me)&&d(C,me,null,be[me],Z,W);"value"in be&&d(C,"value",null,be.value,Z),(N=be.onVnodeBeforeMount)&&Nn(N,W,b)}Me&&Hi(b,null,W,"beforeMount");const ne=jf(H,te);ne&&te.beforeEnter(C),l(C,g,w),((N=be&&be.onVnodeMounted)||ne||Me)&&qt(()=>{try{N&&Nn(N,W,b),ne&&te.enter(C),Me&&Hi(b,null,W,"mounted")}finally{}},H)},ke=(b,g,w,W,H)=>{if(w&&U(b,w),W)for(let Z=0;Z{for(let N=C;N{const I=g.el=b.el;let{patchFlag:C,dynamicChildren:N,dirs:be}=g;C|=b.patchFlag&16;const re=b.props||ht,te=g.props||ht;let Me;if(w&&ji(w,!1),(Me=te.onVnodeBeforeUpdate)&&Nn(Me,w,g,b),be&&Hi(g,b,w,"beforeUpdate"),w&&ji(w,!0),N&&(!b.dynamicChildren||b.dynamicChildren.length!==N.length)&&(C=0,ee=!1,N=null),(re.innerHTML&&te.innerHTML==null||re.textContent&&te.textContent==null)&&S(I,""),N?Ce(b.dynamicChildren,N,I,w,W,ir(g,H),Z):ee||se(b,g,I,null,w,W,ir(g,H),Z,!1),C>0){if(C&16)_e(I,re,te,w,H);else if(C&2&&re.class!==te.class&&d(I,"class",null,te.class,H),C&4&&d(I,"style",re.style,te.style,H),C&8){const ne=g.dynamicProps;for(let me=0;me{Me&&Nn(Me,w,g,b),be&&Hi(g,b,w,"updated")},W)},Ce=(b,g,w,W,H,Z,ee)=>{for(let I=0;I{if(g!==w){if(g!==ht)for(const Z in g)!io(Z)&&!(Z in w)&&d(b,Z,g[Z],null,H,W);for(const Z in w){if(io(Z))continue;const ee=w[Z],I=g[Z];ee!==I&&Z!=="value"&&d(b,Z,I,ee,H,W)}"value"in w&&d(b,"value",g.value,w.value,H)}},J=(b,g,w,W,H,Z,ee,I,C)=>{const N=g.el=b?b.el:_(""),be=g.anchor=b?b.anchor:_("");let{patchFlag:re,dynamicChildren:te,slotScopeIds:Me}=g;Me&&(I=I?I.concat(Me):Me),b==null?(l(N,w,W),l(be,w,W),Ze(g.children||[],w,be,H,Z,ee,I,C)):re>0&&re&64&&te&&b.dynamicChildren&&b.dynamicChildren.length===te.length?(Ce(b.dynamicChildren,te,w,H,Z,ee,I),(g.key!=null||H&&g===H.subTree)&&Br(b,g,!0)):se(b,g,w,be,H,Z,ee,I,C)},le=(b,g,w,W,H,Z,ee,I,C)=>{g.slotScopeIds=I,b==null?g.shapeFlag&512?H.ctx.activate(g,w,W,ee,C):Le(g,w,W,H,Z,ee,C):Ne(b,g,C)},Le=(b,g,w,W,H,Z,ee)=>{const I=b.component=eh(b,W,H);if(xa(b)&&(I.ctx.renderer=dt),th(I,!1,ee),I.asyncDep){if(H&&H.registerDep(I,ve,ee),!b.el){const C=I.subTree=z(Bt);ae(null,C,g,w),b.placeholder=C.el}}else ve(I,b,g,w,H,Z,ee)},Ne=(b,g,w)=>{const W=g.component=b.component;if(If(b,g,w))if(W.asyncDep&&!W.asyncResolved){ce(W,g,w);return}else W.next=g,W.update();else g.el=b.el,W.vnode=g},ve=(b,g,w,W,H,Z,ee)=>{const I=()=>{if(b.isMounted){let{next:re,bu:te,u:Me,parent:ne,vnode:me}=b;{const Ct=_c(b);if(Ct){re&&(re.el=me.el,ce(b,re,ee)),Ct.asyncDep.then(()=>{qt(()=>{b.isUnmounted||N()},H)});return}}let je=re,ft;ji(b,!1),re?(re.el=me.el,ce(b,re,ee)):re=me,te&&ea(te),(ft=re.props&&re.props.onVnodeBeforeUpdate)&&Nn(ft,ne,re,me),ji(b,!0);const gt=Cl(b),xt=b.subTree;b.subTree=gt,B(xt,gt,O(xt.el),E(xt),b,H,Z),re.el=gt.el,je===null&&Df(b,gt.el),Me&&qt(Me,H),(ft=re.props&&re.props.onVnodeUpdated)&&qt(()=>Nn(ft,ne,re,me),H)}else{let re;const{el:te,props:Me}=g,{bm:ne,m:me,parent:je,root:ft,type:gt}=b,xt=Ss(g);ji(b,!1),ne&&ea(ne),!xt&&(re=Me&&Me.onVnodeBeforeMount)&&Nn(re,je,g),ji(b,!0);{ft.ce&&ft.ce._hasShadowRoot()&&ft.ce._injectChildStyle(gt,b.parent?b.parent.type:void 0);const Ct=b.subTree=Cl(b);B(null,Ct,w,W,b,H,Z),g.el=Ct.el}if(me&&qt(me,H),!xt&&(re=Me&&Me.onVnodeMounted)){const Ct=g;qt(()=>Nn(re,je,Ct),H)}(g.shapeFlag&256||je&&Ss(je.vnode)&&je.vnode.shapeFlag&256)&&b.a&&qt(b.a,H),b.isMounted=!0,g=w=W=null}};b.scope.on();const C=b.effect=new Su(I);b.scope.off();const N=b.update=C.run.bind(C),be=b.job=C.runIfDirty.bind(C);be.i=b,be.id=b.uid,C.scheduler=()=>Nr(be),ji(b,!0),N()},ce=(b,g,w)=>{g.component=b;const W=b.vnode.props;b.vnode=g,b.next=null,Rf(b,g.props,W,w),Uf(b,g.children,w),Zn(),vl(b),Hn()},se=(b,g,w,W,H,Z,ee,I,C=!1)=>{const N=b&&b.children,be=b?b.shapeFlag:0,re=g.children,{patchFlag:te,shapeFlag:Me}=g;if(te>0){if(te&128){pe(N,re,w,W,H,Z,ee,I,C);return}else if(te&256){tt(N,re,w,W,H,Z,ee,I,C);return}}Me&8?(be&16&&G(N,H,Z),re!==N&&S(w,re)):be&16?Me&16?pe(N,re,w,W,H,Z,ee,I,C):G(N,H,Z,!0):(be&8&&S(w,""),Me&16&&Ze(re,w,W,H,Z,ee,I,C))},tt=(b,g,w,W,H,Z,ee,I,C)=>{b=b||xs,g=g||xs;const N=b.length,be=g.length,re=Math.min(N,be);let te;for(te=0;tebe?G(b,H,Z,!0,!1,re):Ze(g,w,W,H,Z,ee,I,C,re)},pe=(b,g,w,W,H,Z,ee,I,C)=>{let N=0;const be=g.length;let re=b.length-1,te=be-1;for(;N<=re&&N<=te;){const Me=b[N],ne=g[N]=C?si(g[N]):Bn(g[N]);if(Yi(Me,ne))B(Me,ne,w,null,H,Z,ee,I,C);else break;N++}for(;N<=re&&N<=te;){const Me=b[re],ne=g[te]=C?si(g[te]):Bn(g[te]);if(Yi(Me,ne))B(Me,ne,w,null,H,Z,ee,I,C);else break;re--,te--}if(N>re){if(N<=te){const Me=te+1,ne=Mete)for(;N<=re;)Ge(b[N],H,Z,!0),N++;else{const Me=N,ne=N,me=new Map;for(N=ne;N<=te;N++){const St=g[N]=C?si(g[N]):Bn(g[N]);St.key!=null&&me.set(St.key,N)}let je,ft=0;const gt=te-ne+1;let xt=!1,Ct=0;const _n=new Array(gt);for(N=0;N=gt){Ge(St,H,Z,!0);continue}let Dt;if(St.key!=null)Dt=me.get(St.key);else for(je=ne;je<=te;je++)if(_n[je-ne]===0&&Yi(St,g[je])){Dt=je;break}Dt===void 0?Ge(St,H,Z,!0):(_n[Dt-ne]=N+1,Dt>=Ct?Ct=Dt:xt=!0,B(St,g[Dt],w,null,H,Z,ee,I,C),ft++)}const di=xt?Wf(_n):xs;for(je=di.length-1,N=gt-1;N>=0;N--){const St=ne+N,Dt=g[St],En=g[St+1],Zt=St+1{const{el:Z,type:ee,transition:I,children:C,shapeFlag:N}=b;if(N&6){Se(b.component.subTree,g,w,W);return}if(N&128){b.suspense.move(g,w,W);return}if(N&64){ee.move(b,g,w,dt);return}if(ee===ue){l(Z,g,w);for(let re=0;reI.enter(Z),H));else{const{leave:re,delayLeave:te,afterLeave:Me}=I,ne=()=>{b.ctx.isUnmounted?u(Z):l(Z,g,w)},me=()=>{const je=Z._isLeaving||!!Z[pn];Z._isLeaving&&Z[pn](!0),I.persisted&&!je?ne():re(Z,()=>{ne(),Me&&Me()})};te?te(Z,ne,me):me()}else l(Z,g,w)},Ge=(b,g,w,W=!1,H=!1)=>{const{type:Z,props:ee,ref:I,children:C,dynamicChildren:N,shapeFlag:be,patchFlag:re,dirs:te,cacheIndex:Me,memo:ne}=b;if(re===-2&&(H=!1),I!=null&&(Zn(),ro(I,null,w,b,!0),Hn()),Me!=null&&(g.renderCache[Me]=void 0),be&256){g.ctx.deactivate(b);return}const me=be&1&&te,je=!Ss(b);let ft;if(je&&(ft=ee&&ee.onVnodeBeforeUnmount)&&Nn(ft,g,b),be&6)Fe(b.component,w,W);else{if(be&128){b.suspense.unmount(w,W);return}me&&Hi(b,null,g,"beforeUnmount"),be&64?b.type.remove(b,g,w,dt,W):N&&!N.hasOnce&&(Z!==ue||re>0&&re&64)?G(N,g,w,!1,!0):(Z===ue&&re&384||!H&&be&16)&&G(C,g,w),W&&et(b)}const gt=ne!=null&&Me==null;(je&&(ft=ee&&ee.onVnodeUnmounted)||me||gt)&&qt(()=>{ft&&Nn(ft,g,b),me&&Hi(b,null,g,"unmounted"),gt&&(b.el=null)},w)},et=b=>{const{type:g,el:w,anchor:W,transition:H}=b;if(g===ue){Qe(w,W);return}if(g===sr){de(b);return}const Z=()=>{u(w),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(b.shapeFlag&1&&H&&!H.persisted){const{leave:ee,delayLeave:I}=H,C=()=>ee(w,Z);I?I(b.el,Z,C):C()}else Z()},Qe=(b,g)=>{let w;for(;b!==g;)w=V(b),u(b),b=w;u(g)},Fe=(b,g,w)=>{const{bum:W,scope:H,job:Z,subTree:ee,um:I,m:C,a:N}=b;El(C),El(N),W&&ea(W),H.stop(),Z&&(Z.flags|=8,Ge(ee,b,g,w)),I&&qt(I,g),qt(()=>{b.isUnmounted=!0},g)},G=(b,g,w,W=!1,H=!1,Z=0)=>{for(let ee=Z;ee{if(b.shapeFlag&6)return E(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const g=V(b.anchor||b.el),w=g&&g[Gu];return w?V(w):g};let A=!1;const st=(b,g,w)=>{let W;b==null?g._vnode&&(Ge(g._vnode,null,null,!0),W=g._vnode.component):B(g._vnode||null,b,g,null,null,null,w),g._vnode=b,A||(A=!0,vl(W),Uu(),A=!1)},dt={p:B,um:Ge,m:Se,r:et,mt:Le,mc:Ze,pc:se,pbc:Ce,n:E,o:t};return{render:st,hydrate:void 0,createApp:Mf(st)}}function ir({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 ji({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 Br(t,i,o=!1){const l=t.children,u=i.children;if(Ae(l)&&Ae(u))for(let d=0;d>1,t[o[_]]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 _c(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:_c(i)}function El(t){if(t)for(let i=0;it.__isSuspense;function Kf(t,i){i&&i.pendingBranch?Ae(t)?i.effects.push(...t):i.effects.push(t):Xd(t)}const ue=Symbol.for("v-fgt"),Sa=Symbol.for("v-txt"),Bt=Symbol.for("v-cmt"),sr=Symbol.for("v-stc"),uo=[];let on=null;function m(t=!1){uo.push(on=t?null:[])}function Gf(){uo.pop(),on=uo[uo.length-1]||null}let mo=1;function ra(t,i=!1){mo+=t,t<0&&on&&i&&(on.hasOnce=!0)}function xc(t){return t.dynamicChildren=mo>0?on||xs:null,Gf(),mo>0&&on&&on.push(t),t}function v(t,i,o,l,u,d){return xc(r(t,i,o,l,u,d,!0))}function nt(t,i,o,l,u){return xc(z(t,i,o,l,u,!0))}function go(t){return t?t.__v_isVNode===!0:!1}function Yi(t,i){return t.type===i.type&&t.key===i.key}const wc=({key:t})=>t??null,ta=({ref:t,ref_key:i,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?yt(t)||Ut(t)||He(t)?{i:Vt,r:t,k:i,f:!!o}:t:null);function r(t,i=null,o=null,l=0,u=null,d=t===ue?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&wc(i),ref:i&&ta(i),scopeId:Hu,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:Vt};return _?(la(y,o),d&128&&t.normalize(y)):o&&(y.shapeFlag|=yt(o)?8:16),mo>0&&!h&&on&&(y.patchFlag>0||d&6)&&y.patchFlag!==32&&on.push(y),y}const z=qf;function qf(t,i=null,o=null,l=0,u=null,d=!1){if((!t||t===bf)&&(t=Bt),go(t)){const _=Li(t,i,!0);return o&&la(_,o),mo>0&&!d&&on&&(_.shapeFlag&6?on[on.indexOf(t)]=_:on.push(_)),_.patchFlag=-2,_}if(oh(t)&&(t=t.__vccOpts),i){i=Yf(i);let{class:_,style:y}=i;_&&!yt(_)&&(i.class=Oe(_)),lt(y)&&(Dr(y)&&!Ae(y)&&(y=zt({},y)),i.style=Cs(y))}const h=yt(t)?1:bc(t)?128:qu(t)?64:lt(t)?4:He(t)?2:0;return r(t,i,o,l,u,h,d,!0)}function Yf(t){return t?Dr(t)||fc(t)?zt({},t):t:null}function Li(t,i,o=!1,l=!1){const{props:u,ref:d,patchFlag:h,children:_,transition:y}=t,M=i?Jf(u||{},i):u,S={__v_isVNode:!0,__v_skip:!0,type:t.type,props:M,key:M&&wc(M),ref:i&&i.ref?o&&d?Ae(d)?d.concat(ta(i)):[d,ta(i)]:ta(i):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:_,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:y,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Li(t.ssContent),ssFallback:t.ssFallback&&Li(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&po(S,y.clone(S)),S}function D(t=" ",i=0){return z(Sa,null,t,i)}function F(t="",i=!1){return i?(m(),nt(Bt,null,t)):z(Bt,null,t)}function Bn(t){return t==null||typeof t=="boolean"?z(Bt):Ae(t)?z(ue,null,t.slice()):go(t)?si(t):z(Sa,null,String(t))}function si(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Li(t)}function la(t,i){let o=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(Ae(i))o=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),la(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=i._;!u&&!fc(i)?i._ctx=Vt:u===3&&Vt&&(Vt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(He(i)){if(l&65){la(t,{default:i});return}i={default:i,_ctx:Vt},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;oJt||Vt;let ua,xr;{const t=_a(),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)}};ua=i("__VUE_INSTANCE_SETTERS__",o=>Jt=o),xr=i("__VUE_SSR_SETTERS__",o=>vo=o)}const xo=t=>{const i=Jt;return ua(t),t.scope.on(),()=>{t.scope.off(),ua(i)}},Ol=()=>{Jt&&Jt.scope.off(),ua(null)};function Sc(t){return t.vnode.shapeFlag&4}let vo=!1;function th(t,i=!1,o=!1){i&&xr(i);const{props:l,children:u}=t.vnode,d=Sc(t);Nf(t,l,d,i),Vf(t,u,o||i);const h=d?nh(t,i):void 0;return i&&xr(!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=xo(t),h=bo(l,t,0,[t.props,u]),_=gu(h);if(Hn(),d(),(_||t.sp)&&!Ss(t)&&tc(t),_){if(h.then(Ol,Ol),i)return h.then(y=>{zl(t,y)}).catch(y=>{ba(y,t,0)});t.asyncDep=h}else zl(t,h)}else Tc(t)}function zl(t,i,o){He(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:lt(i)&&(t.setupState=Ru(i)),Tc(t)}function Tc(t,i,o){const l=t.type;t.render||(t.render=l.render||Un);{const u=xo(t);Zn();try{kf(t)}finally{Hn(),u()}}}const ih={get(t,i){return Rt(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 Ta(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Ru(Ud(t.exposed)),{get(i,o){if(o in i)return i[o];if(o in lo)return lo[o](t)},has(i,o){return o in i||o in lo}})):t.proxy}function oh(t){return He(t)&&"__vccOpts"in t}const Pe=(t,i)=>Kd(t,i,vo);function ah(t,i,o){try{ra(-1);const l=arguments.length;return l===2?lt(i)&&!Ae(i)?go(i)?z(t,null,[i]):z(t,i):z(t,null,i):(l>3?o=Array.prototype.slice.call(arguments,2):l===3&&go(o)&&(o=[o]),z(t,i,o))}finally{ra(1)}}const rh="3.5.39";/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let wr;const Al=typeof window<"u"&&window.trustedTypes;if(Al)try{wr=Al.createPolicy("vue",{createHTML:t=>t})}catch{}const Pc=wr?t=>wr.createHTML(t):t=>t,lh="http://www.w3.org/2000/svg",uh="http://www.w3.org/1998/Math/MathML",ii=typeof document<"u"?document:null,$l=ii&&ii.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"?ii.createElementNS(lh,t):i==="mathml"?ii.createElementNS(uh,t):o?ii.createElement(t,{is:o}):ii.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>ii.createTextNode(t),createComment:t=>ii.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ii.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{$l.innerHTML=Pc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=$l.content;if(l==="svg"||l==="mathml"){const y=_.firstChild;for(;y.firstChild;)_.appendChild(y.firstChild);_.removeChild(y)}i.insertBefore(_,o)}return[h?h.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},ki="transition",Js="animation",_o=Symbol("_vtc"),Cc={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=zt({},Yu,Cc),fh=t=>(t.displayName="Transition",t.props=dh,t),hh=fh((t,{slots:i})=>ah(uf,ph(t),i)),Wi=(t,i=[])=>{Ae(t)?t.forEach(o=>o(...i)):t&&t(...i)},Il=t=>t?Ae(t)?t.some(i=>i.length>1):t.length>1:!1;function ph(t){const i={};for(const J in t)J in Cc||(i[J]=t[J]);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:_=`${o}-enter-to`,appearFromClass:y=d,appearActiveClass:M=h,appearToClass:S=_,leaveFromClass:O=`${o}-leave-from`,leaveActiveClass:V=`${o}-leave-active`,leaveToClass:U=`${o}-leave-to`}=t,j=mh(u),B=j&&j[0],he=j&&j[1],{onBeforeEnter:ae,onEnter:q,onEnterCancelled:we,onLeave:de,onLeaveCancelled:$e,onBeforeAppear:ze=ae,onAppear:ke=q,onAppearCancelled:Ze=we}=i,ge=(J,le,Le,Ne)=>{J._enterCancelled=Ne,Ki(J,le?S:_),Ki(J,le?M:h),Le&&Le()},Ce=(J,le)=>{J._isLeaving=!1,Ki(J,O),Ki(J,U),Ki(J,V),le&&le()},_e=J=>(le,Le)=>{const Ne=J?ke:q,ve=()=>ge(le,J,Le);Wi(Ne,[le,ve]),Dl(()=>{Ki(le,J?y:d),ni(le,J?S:_),Il(Ne)||Nl(le,l,B,ve)})};return zt(i,{onBeforeEnter(J){Wi(ae,[J]),ni(J,d),ni(J,h)},onBeforeAppear(J){Wi(ze,[J]),ni(J,y),ni(J,M)},onEnter:_e(!1),onAppear:_e(!0),onLeave(J,le){J._isLeaving=!0;const Le=()=>Ce(J,le);ni(J,O),J._enterCancelled?(ni(J,V),Bl(J)):(Bl(J),ni(J,V)),Dl(()=>{J._isLeaving&&(Ki(J,O),ni(J,U),Il(de)||Nl(J,l,he,Le))}),Wi(de,[J,Le])},onEnterCancelled(J){ge(J,!1,void 0,!0),Wi(we,[J])},onAppearCancelled(J){ge(J,!0,void 0,!0),Wi(Ze,[J])},onLeaveCancelled(J){Ce(J),Wi($e,[J])}})}function mh(t){if(t==null)return null;if(lt(t))return[or(t.enter),or(t.leave)];{const i=or(t);return[i,i]}}function or(t){return pd(t)}function ni(t,i){i.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[_o]||(t[_o]=new Set)).add(i)}function Ki(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const o=t[_o];o&&(o.delete(i),o.size||(t[_o]=void 0))}function Dl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let gh=0;function Nl(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:_,propCount:y}=vh(t,i);if(!h)return l();const M=h+"end";let S=0;const O=()=>{t.removeEventListener(M,V),d()},V=U=>{U.target===t&&++S>=y&&O()};setTimeout(()=>{S(o[j]||"").split(", "),u=l(`${ki}Delay`),d=l(`${ki}Duration`),h=Rl(u,d),_=l(`${Js}Delay`),y=l(`${Js}Duration`),M=Rl(_,y);let S=null,O=0,V=0;i===ki?h>0&&(S=ki,O=h,V=d.length):i===Js?M>0&&(S=Js,O=M,V=y.length):(O=Math.max(h,M),S=O>0?h>M?ki:Js:null,V=S?S===ki?d.length:y.length:0);const U=S===ki&&/\b(?:transform|all)(?:,|$)/.test(l(`${ki}Property`).toString());return{type:S,timeout:O,propCount:V,hasTransform:U}}function Rl(t,i){for(;t.lengthFl(o)+Fl(t[l])))}function Fl(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Bl(t){return(t?t.ownerDocument:document).body.offsetHeight}function _h(t,i,o){const l=t[_o];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):o?t.setAttribute("class",i):t.className=i}const ca=Symbol("_vod"),Lc=Symbol("_vsh"),yh={name:"show",beforeMount(t,{value:i},{transition:o}){t[ca]=t.style.display==="none"?"":t.style.display,o&&i?o.beforeEnter(t):Xs(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),Xs(t,!0),l.enter(t)):l.leave(t,()=>{Xs(t,!1)}):Xs(t,i))},beforeUnmount(t,{value:i}){Xs(t,i)}};function Xs(t,i){t.style.display=i?t[ca]:"none",t[Lc]=!i}const bh=Symbol(""),xh=/(?:^|;)\s*display\s*:/;function wh(t,i,o){const l=t.style,u=yt(o);let d=!1;if(o&&!u){if(i)if(yt(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();o[_]==null&&to(l,_,"")}else for(const h in i)o[h]==null&&to(l,h,"");for(const h in o){h==="display"&&(d=!0);const _=o[h];_!=null?Sh(t,h,!yt(i)&&i?i[h]:void 0,_)||to(l,h,_):to(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");ca in t&&(t[ca]=d?l.display:"",t[Lc]&&(l.display="none"))}const Vl=/\s*!important$/;function to(t,i,o){if(Ae(o))o.forEach(l=>to(t,i,l));else if(o==null&&(o=""),i.startsWith("--"))t.setProperty(i,o);else{const l=kh(t,i);Vl.test(o)?t.setProperty(Ei(l),o.replace(Vl,""),"important"):t[l]=o}}const Ul=["Webkit","Moz","ms"],ar={};function kh(t,i){const o=ar[i];if(o)return o;let l=Pn(i);if(l!=="filter"&&l in t)return ar[i]=l;l=yu(l);for(let u=0;urr||(Eh.then(()=>rr=0),rr=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(Ae(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const h=u.slice(),_=[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):pa(i)?ma(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))?(jl(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Hl(t,i,l,h,d,i!=="value")):t._isVueCE&&(Ih(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!yt(l)))?jl(t,Pn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),Hl(t,i,l,h))};function $h(t,i,o,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Kl(i)&&He(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 Kl(i)&&yt(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 Mi=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Ae(i)?o=>ea(i,o):i};function Dh(t){t.target.composing=!0}function Gl(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const gn=Symbol("_assign");function ql(t,i,o){return i&&(t=t.trim()),o&&(t=va(t)),t}const ye={created(t,{modifiers:{lazy:i,trim:o,number:l}},u){t[gn]=Mi(u);const d=l||u.props&&u.props.type==="number";ri(t,i?"change":"input",h=>{h.target.composing||t[gn](ql(t.value,o,d))}),(o||d)&&ri(t,"change",()=>{t.value=ql(t.value,o,d)}),i||(ri(t,"compositionstart",Dh),ri(t,"compositionend",Gl),ri(t,"change",Gl))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:o,modifiers:{lazy:l,trim:u,number:d}},h){if(t[gn]=Mi(h),t.composing)return;const _=(d||t.type==="number")&&!/^0\d/.test(t.value)?va(t.value):t.value,y=i??"";if(_===y)return;const M=t.getRootNode();(M instanceof Document||M instanceof ShadowRoot)&&M.activeElement===t&&t.type!=="range"&&(l&&i===o||u&&t.value.trim()===y)||(t.value=y)}},da={deep:!0,created(t,i,o){t[gn]=Mi(o),ri(t,"change",()=>{const l=t._modelValue,u=Ms(t),d=t.checked,h=t[gn];if(Ae(l)){const _=Mr(l,u),y=_!==-1;if(d&&!y)h(l.concat(u));else if(!d&&y){const M=[...l];M.splice(_,1),h(M)}}else if(Es(l)){const _=new Set(l);d?_.add(u):_.delete(u),h(_)}else h(Mc(t,d))})},mounted:Yl,beforeUpdate(t,i,o){t[gn]=Mi(o),Yl(t,i,o)}};function Yl(t,{value:i,oldValue:o},l){t._modelValue=i;let u;if(Ae(i))u=Mr(i,l.props.value)>-1;else if(Es(i))u=i.has(l.props.value);else{if(i===o)return;u=Ci(i,Mc(t,!0))}t.checked!==u&&(t.checked=u)}const Nh={created(t,{value:i},o){t.checked=Ci(i,o.props.value),t[gn]=Mi(o),ri(t,"change",()=>{t[gn](Ms(t))})},beforeUpdate(t,{value:i,oldValue:o},l){t[gn]=Mi(l),i!==o&&(t.checked=Ci(i,l.props.value))}},Ot={deep:!0,created(t,{value:i,modifiers:{number:o}},l){const u=Es(i);ri(t,"change",()=>{const d=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>o?va(Ms(h)):Ms(h));t[gn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,Bu(()=>{t._assigning=!1})}),t[gn]=Mi(l)},mounted(t,{value:i}){Jl(t,i)},beforeUpdate(t,i,o){t[gn]=Mi(o)},updated(t,{value:i}){t._assigning||Jl(t,i)}};function Jl(t,i){const o=t.multiple,l=Ae(i);if(!(o&&!l&&!Es(i))){for(let u=0,d=t.options.length;uString(M)===String(_)):h.selected=Mr(i,_)>-1}else h.selected=i.has(_);else if(Ci(Ms(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ms(t){return"_value"in t?t._value:t.value}function Mc(t,i){const o=i?"_trueValue":"_falseValue";return o in t?t[o]:i}const Rh={created(t,i,o){Xo(t,i,o,null,"created")},mounted(t,i,o){Xo(t,i,o,null,"mounted")},beforeUpdate(t,i,o,l){Xo(t,i,o,l,"beforeUpdate")},updated(t,i,o,l){Xo(t,i,o,l,"updated")}};function Fh(t,i){switch(t){case"SELECT":return Ot;case"TEXTAREA":return ye;default:switch(i){case"checkbox":return da;case"radio":return Nh;default:return ye}}}function Xo(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))},Vr=(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=Ei(u.key);if(i.some(h=>h===d||Uh[h]===d))return t(u)}))},Zh=zt({patchProp:Ah},ch);let Ql;function Hh(){return Ql||(Ql=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;!He(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 yt(t)?document.querySelector(t):t}const Ec="pv_theme",eu={light:"#EEF0F3",dark:"#0B1730"},fa=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function Oc(){return fa&&fa.matches?"dark":"light"}function Gh(){try{return localStorage.getItem(Ec)||"light"}catch{return"light"}}function zc(t){return t==="system"?Oc():t}function Ac(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=eu[t]||eu.light}const Qi=K(Gh()),Ps=K(zc(Qi.value));function ha(t){Qi.value=t;const i=zc(t);Ps.value=i,Ac(i);try{localStorage.setItem(Ec,t)}catch{}}function tu(){ha(Ps.value==="dark"?"light":"dark")}fa&&fa.addEventListener("change",()=>{if(Qi.value==="system"){const t=Oc();Ps.value=t,Ac(t)}});async function qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function nu(){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 iu(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||""}}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 su(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 Qo(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 ou(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 $c(){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 lr(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 Ic="pv_prefs",kr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,twoFactor:!1};function zp(){try{return{...kr,...JSON.parse(localStorage.getItem(Ic)||"{}")||{}}}catch{return{...kr}}}const De=_t(zp());function Dc(){try{localStorage.setItem(Ic,JSON.stringify(De))}catch{}}function Nc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(kr))i in t&&(De[i]=t[i]);return!0}const Ap={sm:15,md:16,lg:18};function Ur(t){document.documentElement.style.fontSize=(Ap[t]||16)+"px"}function Zr(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Rc(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(De.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 De.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 au(t){return Rc(t).time}function ru(t){const i=Rc(t);return`${i.date} ${i.time}`}let Hr=!1,Sr=!1,Tr=null;function $p(){return{...JSON.parse(JSON.stringify(De)),themeMode:Qi.value}}function jr(){!Hr||Sr||(clearTimeout(Tr),Tr=setTimeout(()=>{lp($p())},600))}function Ip(t){Sr=!0;try{Nc(t),t.themeMode&&ha(t.themeMode),Ur(De.fontSize),Zr(De.reduceMotion),Dc()}finally{Sr=!1}}async function lu(){Hr=!0;const t=await rp();t&&Object.keys(t).length?Ip(t):jr()}function Dp(){Hr=!1,clearTimeout(Tr)}Ft(De,()=>{Dc(),jr()},{deep:!0});Ft(Qi,jr);Ft(()=>De.fontSize,Ur,{immediate:!0});Ft(()=>De.reduceMotion,Zr,{immediate:!0});const Np=["width","height"],Fc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,o)=>(m(),v("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)=>(m(),v("button",{class:"btn-icon",type:"button",title:Be(Ps)==="dark"?"Switch to light":"Switch to dark","aria-label":Be(Ps)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...l)=>Be(tu)&&Be(tu)(...l))},[Be(Ps)==="dark"?(m(),v("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)])])):(m(),v("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=K(""),d=K(""),h=K(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),_=K(!1),y=K(!1),M=K(!1),S=K("");async function O(){M.value=!0,S.value="",localStorage.setItem("api_url",h.value.trim());const{ok:V,status:U,body:j}=await Yh(u.value.trim(),d.value,h.value.trim());if(M.value=!1,V){l("signed-in",j.email);return}S.value=U===400?"Invalid email or password.":U===502?"API server can't reach PocketBase.":j.message||j.error||"Cannot reach the API server."}return(V,U)=>(m(),v("div",Up,[r("div",Zp,[z(Vp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:Vr(O,["prevent"])},[r("div",Hp,[z(Fc,{size:34}),U[5]||(U[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),U[9]||(U[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),oe(r("input",{"onUpdate:modelValue":U[0]||(U[0]=j=>u.value=j),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ye,u.value]]),U[10]||(U[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",jp,[oe(r("input",{"onUpdate:modelValue":U[1]||(U[1]=j=>d.value=j),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:U[2]||(U[2]=j=>y.value=!y.value)},[y.value?(m(),v("svg",Gp,[...U[6]||(U[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)])])):(m(),v("svg",qp,[...U[7]||(U[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)]),_.value?(m(),v("div",Yp,[U[8]||(U[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),oe(r("input",{"onUpdate:modelValue":U[3]||(U[3]=j=>h.value=j),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ye,h.value]])])):F("",!0),S.value?(m(),v("p",Jp,k(S.value),1)):F("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:M.value},k(M.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:U[4]||(U[4]=j=>_.value=!_.value)},k(_.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 no={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=no.exports,uu;function nm(){return uu||(uu=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=we(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(pe(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(pe(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=tt(this.x),this.y=tt(this.y),this},distanceTo:function(e){e=pe(e);var n=e.x-this.x,s=e.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(e){return e=pe(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=pe(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+V(this.x)+", "+V(this.y)+")"}};function pe(e,n,s){return e instanceof se?e:we(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,s)}function Se(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=Ge(e);var n=this.min,s=this.max,a=e.min,c=e.max,p=c.x>=n.x&&a.x<=s.x,P=c.y>=n.y&&a.y<=s.y;return p&&P},overlaps:function(e){e=Ge(e);var n=this.min,s=this.max,a=e.min,c=e.max,p=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=Qe(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),p=c.lat>=n.lat&&a.lat<=s.lat,P=c.lng>=n.lng&&a.lng<=s.lng;return p&&P},overlaps:function(e){e=Qe(e);var n=this._southWest,s=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),p=c.lat>n.lat&&a.latn.lng&&a.lng1,La=(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})(),Ma=(function(){return!!document.createElement("canvas").getContext})(),As=!!(document.createElementNS&&W("svg").createSVGRect),ko=!!As&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ea=!As&&(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}})(),Oa=navigator.platform.indexOf("Mac")===0,za=navigator.platform.indexOf("Linux")===0;function We(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var xe={ie:ee,ielt9:I,edge:C,webkit:N,android:be,android23:re,androidStock:Me,opera:ne,chrome:me,gecko:je,safari:ft,phantom:gt,opera12:xt,win:Ct,ie3d:_n,webkit3d:di,gecko3d:St,any3d:Dt,mobile:En,mobileWebkit:Zt,mobileWebkit3d:es,msPointer:At,pointer:Ht,touch:Pa,touchNative:wt,mobileOpera:wo,mobileGecko:zs,retina:Ca,passiveEvents:La,canvas:Ma,svg:As,vml:Ea,inlineSvg:ko,mac:Oa,linux:za},ts=xe.msPointer?"MSPointerDown":"pointerdown",$t=xe.msPointer?"MSPointerMove":"pointermove",fi=xe.msPointer?"MSPointerUp":"pointerup",Oi=xe.msPointer?"MSPointerCancel":"pointercancel",hi={touchstart:ts,touchmove:$t,touchend:fi,touchcancel:Oi},an={touchstart:To,touchmove:jt,touchend:jt,touchcancel:jt},tn={},So=!1;function $s(e,n,s){return n==="touchstart"&&pi(),an[n]?(s=an[n].bind(this,s),e.addEventListener(hi[n],s,!1),s):(console.warn("wrong event specified:",n),O)}function Is(e,n,s){if(!hi[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(hi[n],s,!1)}function Aa(e){tn[e.pointerId]=e}function rn(e){tn[e.pointerId]&&(tn[e.pointerId]=e)}function yn(e){delete tn[e.pointerId]}function pi(){So||(document.addEventListener(ts,Aa,!0),document.addEventListener($t,rn,!0),document.addEventListener(fi,yn,!0),document.addEventListener(Oi,yn,!0),So=!0)}function jt(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in tn)n.touches.push(tn[s]);n.changedTouches=[n],e(n)}}function To(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Lt(n),jt(e,n)}function Ds(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 $a=200;function Ia(e,n){e.addEventListener("dblclick",n);var s=0,a;function c(p){if(p.detail!==1){a=p.detail;return}if(!(p.pointerType==="mouse"||p.sourceCapabilities&&!p.sourceCapabilities.firesTouchEvents)){var P=Mo(p);if(!(P.some(function(R){return R instanceof HTMLLabelElement&&R.attributes.for})&&!P.some(function(R){return R instanceof HTMLInputElement||R instanceof HTMLSelectElement}))){var $=Date.now();$-s<=$a?(a++,a===2&&n(Ds(p))):a=1,s=$}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function Da(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var Ns=ns(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),mi=ns(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Po=mi==="webkitTransition"||mi==="OTransition"?mi+"End":"transitionend";function Co(e){return typeof e=="string"?document.getElementById(e):e}function zi(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 ie(e,n,s){var a=document.createElement(e);return a.className=n||"",s&&s.appendChild(a),a}function ot(e){var n=e.parentNode;n&&n.removeChild(e)}function jn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ln(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function bn(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function gi(e,n){if(e.classList!==void 0)return e.classList.contains(n);var s=Ai(e);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function Ie(e,n){if(e.classList!==void 0)for(var s=j(n),a=0,c=s.length;a0?2*window.devicePixelRatio:1;function Oo(e){return xe.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Ra: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 Kn(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 zo={__proto__:null,on:Ue,off:at,stopPropagation:kt,disableScrollPropagation:zn,disableClickPropagation:yi,preventDefault:Lt,stop:wn,getPropagationPath:Mo,getMousePosition:Eo,getWheelDelta:Oo,isExternalTarget:Kn,addListener:Ue,removeListener:at},Di=ce.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=On(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=_e(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,Qe(e));return s.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var s=pe(n.paddingTopLeft||n.padding||[0,0]),a=pe(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),p=this.project(e),P=this.getPixelBounds(),$=Ge([P.min.add(s),P.max.subtract(a)]),R=$.getSize();if(!$.contains(p)){this._enforcingBounds=!0;var X=p.subtract($.getCenter()),fe=$.extend(p).getSize().subtract(R);c.x+=X.x<0?-fe.x:fe.x,c.y+=X.y<0?-fe.y:fe.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(),p=a.subtract(c);return!p.x&&!p.y?this:(e.animate&&e.pan?this.panBy(p):(e.pan&&this._rawPanBy(p),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 Fe(n,s),c=a.toBounds(e.coords.accuracy*2),p=this._locateOptions;if(p.setView){var P=this.getBoundsZoom(c);this.setView(a,p.maxZoom?Math.min(P,p.maxZoom):P)}var $={latlng:a,bounds:c,timestamp:e.timestamp};for(var R in e.coords)typeof e.coords[R]=="number"&&($[R]=e.coords[R]);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(),ot(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(J(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)ot(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=ie("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 et(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=Qe(e),s=pe(s||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),p=this.getMaxZoom(),P=e.getNorthWest(),$=e.getSouthEast(),R=this.getSize().subtract(s),X=Ge(this.project($,a),this.project(P,a)).getSize(),fe=xe.any3d?this.options.zoomSnap:1,Re=R.x/X.x,qe=R.y/X.y,Kt=n?Math.max(Re,qe):Math.min(Re,qe);return a=this.getScaleZoom(Kt,a),fe&&(a=Math.round(a/(fe/100))*(fe/100),a=n?Math.ceil(a/fe)*fe:Math.floor(a/fe)*fe),Math.max(c,Math.min(p,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 s=this._getTopLeftPoint(e,n);return new Se(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(G(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(pe(e),n)},layerPointToLatLng:function(e){var n=pe(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(G(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(G(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(Qe(e))},distance:function(e,n){return this.options.crs.distance(G(e),G(n))},containerPointToLayerPoint:function(e){return pe(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return pe(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(pe(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(G(e)))},mouseEventToContainerPoint:function(e){return Eo(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=Co(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ue(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&xe.any3d,Ie(e,"leaflet-container"+(xe.touch?" leaflet-touch":"")+(xe.retina?" leaflet-retina":"")+(xe.ielt9?" leaflet-oldie":"")+(xe.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=zi(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),vt(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||(Ie(e.markerPane,"leaflet-zoom-hide"),Ie(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,s){vt(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,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 J(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){vt(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?at:Ue;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),xe.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){J(this._resizeRequest),this._resizeRequest=_e(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",p=e.target||e.srcElement,P=!1;p;){if(a=this._targets[y(p)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!Kn(p,e)||(s.push(a),c))||p===this._container)break;p=p.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"&&os(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 p=[],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=xe.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(){ut(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=ie("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var s=Ns,a=this._proxy.style[s];Tt(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(){ot(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();Tt(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:(_e(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,Ie(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&&ut(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 ls(e,n){return new Ke(e,n)}var Wt=Le.extend({options:{position:"topright"},initialize:function(e){B(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 Ie(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?(ot(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()}}),Ni=function(e){return new Wt(e)};Ke.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=ie("div",n+"control-container",this._container);function a(c,p){var P=n+c+" "+n+p;e[c+p]=ie("div",P,s)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)ot(this._controlCorners[e]);ot(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ao=Wt.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),Ue(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var p=document.createElement("span");n.appendChild(p),p.appendChild(a),p.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 p=e.length-1;p>=0;p--)n=e[p],s=this._getLayer(n.layerId).layer,n.checked?a.push(s):n.checked||c.push(s);for(p=0;p=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,Ue(e,"click",Lt),this.expand();var n=this;setTimeout(function(){at(e,"click",Lt),n._preventClick=!1})}}),Fa=function(e,n,s){return new Ao(e,n,s)},Xt=Wt.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",s=ie("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 p=ie("a",s,a);return p.innerHTML=e,p.href="#",p.title=n,p.setAttribute("role","button"),p.setAttribute("aria-label",n),yi(p),Ue(p,"click",wn),Ue(p,"click",c,this),Ue(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";ut(this._zoomInButton,n),ut(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(Ie(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Ie(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ke.mergeOptions({zoomControl:!0}),Ke.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Xt,this.addControl(this.zoomControl))});var Ba=function(e){return new Xt(e)},$o=Wt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=ie("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=ie("div",n,s)),e.imperial&&(this._iScale=ie("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}}),Va=function(e){return new $o(e)},us='',Gn=Wt.extend({options:{position:"bottomright",prefix:''+(xe.inlineSvg?us+" ":"")+"Leaflet"},initialize:function(e){B(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=ie("div","leaflet-control-attribution"),yi(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(' ')}}});Ke.mergeOptions({attributionControl:!0}),Ke.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var cs=function(e){return new Gn(e)};Wt.Layers=Ao,Wt.Zoom=Xt,Wt.Scale=$o,Wt.Attribution=Gn,Ni.layers=Fa,Ni.zoom=Ba,Ni.scale=Va,Ni.attribution=cs;var ct=Le.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}});ct.addTo=function(e,n){return e.addHandler(n,this),this};var bi={Events:ve},Ri=xe.touch?"touchstart mousedown":"mousedown",Qt=ce.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){B(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(Ue(this._dragStartTarget,Ri,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Qt._dragging===this&&this.finishDrag(!0),at(this._dragStartTarget,Ri,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!gi(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Qt._dragging===this&&this.finishDrag();return}if(!(Qt._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Qt._dragging=this,this._preventOutline&&os(this._element),Fs(),vi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=Lo(this._element);this._startPoint=new se(n.clientX,n.clientY),this._startPos=On(this._element),this._parentScale=Us(s);var a=e.type==="mousedown";Ue(document,a?"mousemove":"touchmove",this._onMove,this),Ue(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 se(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)p&&(P=$,p=R);p>s&&(n[P]=1,Je(e,n,s,a,P),Je(e,n,s,P,c))}function An(e,n){for(var s=[e[0]],a=1,c=0,p=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 In(e,n,s,a){var c=n.x,p=n.y,P=s.x-c,$=s.y-p,R=P*P+$*$,X;return R>0&&(X=((e.x-c)*P+(e.y-p)*$)/R,X>1?(c=s.x,p=s.y):X>0&&(c+=P*X,p+=$*X)),P=e.x-c,$=e.y-p,a?P*P+$*$:new se(c,p)}function Mt(e){return!we(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Ui(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Mt(e)}function xi(e,n){var s,a,c,p,P,$,R,X;if(!e||e.length===0)throw new Error("latlngs not passed");Mt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var fe=G([0,0]),Re=Qe(e),qe=Re.getNorthWest().distanceTo(Re.getSouthWest())*Re.getNorthEast().distanceTo(Re.getNorthWest());qe<1700&&(fe=qn(e));var Kt=e.length,Et=[];for(s=0;sa){R=(p-a)/c,X=[$.x-R*($.x-P.x),$.y-R*($.y-P.y)];break}var en=n.unproject(pe(X));return G([en.lat+fe.lat,en.lng+fe.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Bi,closestPointOnSegment:Ua,clipSegment:ds,_getEdgeIntersection:fs,_getBitCode:$n,_sqClosestPointOnSegment:In,isFlat:Mt,_flat:Ui,polylineCenter:xi},Sn={project:function(e){return new se(e.lng,e.lat)},unproject:function(e){return new Fe(e.y,e.x)},bounds:new Se([-180,-90],[180,90])},Zi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Se([-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,p=Math.sqrt(1-c*c),P=p*Math.sin(a),$=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),p/2);return a=-s*Math.log(Math.max($,1e-10)),new se(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),p=Math.exp(-e.y/s),P=Math.PI/2-2*Math.atan(p),$=0,R=.1,X;$<15&&Math.abs(R)>1e-7;$++)X=c*Math.sin(P),X=Math.pow((1-X)/(1+X),c/2),R=Math.PI/2-2*Math.atan(p*X)-P,P+=R;return new Fe(P*n,e.x*n/s)}},Do={__proto__:null,LonLat:Sn,Mercator:Zi,SphericalMercator:dt},ja=u({},A,{code:"EPSG:3395",projection:Zi,transformation:(function(){var e=.5/(Math.PI*Zi.R);return b(e,.5,-e,.5)})()}),Hs=u({},A,{code:"EPSG:4326",projection:Sn,transformation:b(1/180,1,-1/180,.5)}),No=u({},E,{projection:Sn,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=ja,E.EPSG3857=g,E.EPSG900913=w,E.EPSG4326=Hs,E.Simple=No;var nn=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[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})}}});Ke.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?we(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 Fe&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(e){Xn.prototype._setLatLngs.call(this,e),Mt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Mt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new se(n,n);if(e=new Se(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,p;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||Xn.prototype._containsPoint.call(this,e,!0)}});function Uc(e,n){return new ms(e,n)}var Qn=Tn.extend({initialize:function(e,n){B(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=we(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s0&&c.push(c[0].slice()),c}function gs(e,n){return e.feature?u({},e.feature,{geometry:n}):Uo(n)}function Uo(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ga={toGeoJSON:function(e){return gs(this,{type:"Point",coordinates:Ka(this.getLatLng(),e)})}};ps.include(Ga),Xe.include(Ga),Y.include(Ga),Xn.include({toGeoJSON:function(e){var n=!Mt(this._latlngs),s=Vo(this._latlngs,n?1:0,!1,e);return gs(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),ms.include({toGeoJSON:function(e){var n=!Mt(this._latlngs),s=n&&!Mt(this._latlngs[0]),a=Vo(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),gs(this,{type:(s?"Multi":"")+"Polygon",coordinates:a})}}),wi.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(e).geometry.coordinates)}),gs(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 p=c.toGeoJSON(e);if(s)a.push(p.geometry);else{var P=Uo(p);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),s?gs(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Kr(e,n){return new Qn(e,n)}var Zc=Kr,Zo=nn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=Qe(n),B(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ie(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ot(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&&ln(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=Qe(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:ie("img");if(Ie(n,"leaflet-image-layer"),this._zoomAnimated&&Ie(n,"leaflet-zoom-animated"),this.options.className&&Ie(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;Tt(this._image,s,n)},_reset:function(){var e=this._image,n=new Se(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();vt(e,n.min),e.style.width=s.x+"px",e.style.height=s.y+"px"},_updateOpacity:function(){Nt(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 Zo(e,n,s)},Gr=Zo.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:ie("video");if(Ie(n,"leaflet-image-layer"),this._zoomAnimated&&Ie(n,"leaflet-zoom-animated"),this.options.className&&Ie(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}we(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 p=0;pc?(n.height=c+"px",Ie(e,p)):ut(e,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),s=this._getAnchor();vt(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(zi(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new se(this._containerLeft,-s-this._containerBottom);c._add(On(this._container));var p=e.layerPointToContainerPoint(c),P=pe(this.options.autoPanPadding),$=pe(this.options.autoPanPaddingTopLeft||P),R=pe(this.options.autoPanPaddingBottomRight||P),X=e.getSize(),fe=0,Re=0;p.x+a+R.x>X.x&&(fe=p.x+a-X.x+R.x),p.x-fe-$.x<0&&(fe=p.x-$.x),p.y+s+R.y>X.y&&(Re=p.y+s-X.y+R.y),p.y-Re-$.y<0&&(Re=p.y-$.y),(fe||Re)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([fe,Re]))}},_getAnchor:function(){return pe(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Kc=function(e,n){return new Ho(e,n)};Ke.mergeOptions({closePopupOnClick:!0}),Ke.include({openPopup:function(e,n,s){return this._initOverlay(Ho,e,n,s).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),nn.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Ho,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 Tn||(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)){wn(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof f)){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 jo=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=ie("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,p=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),$=this.options.direction,R=c.offsetWidth,X=c.offsetHeight,fe=pe(this.options.offset),Re=this._getAnchor();$==="top"?(n=R/2,s=X):$==="bottom"?(n=R/2,s=0):$==="center"?(n=R/2,s=X/2):$==="right"?(n=0,s=X/2):$==="left"?(n=R,s=X/2):P.xthis.options.maxZoom||sa?this._retainParent(c,p,P,a):!1)},_retainChildren:function(e,n,s,a){for(var c=2*e;c<2*e+2;c++)for(var p=2*n;p<2*n+2;p++){var P=new se(c,p);P.z=s+1;var $=this._tileCoordsToKey(P),R=this._tiles[$];if(R&&R.active){R.retain=!0;continue}else R&&R.loaded&&(R.retain=!0);s+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,s);return}for(var Re=c.min.y;Re<=c.max.y;Re++)for(var qe=c.min.x;qe<=c.max.x;qe++){var Kt=new se(qe,Re);if(Kt.z=this._tileZoom,!!this._isValidTile(Kt)){var Et=this._tiles[this._tileCoordsToKey(Kt)];Et?Et.current=!0:P.push(Kt)}}if(P.sort(function(en,_s){return en.distanceTo(p)-_s.distanceTo(p)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(qe=0;qes.max.x)||!n.wrapLat&&(e.ys.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return Qe(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),p=n.unproject(a,e.z),P=n.unproject(c,e.z);return[p,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),s=new et(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 se(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(ot(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Ie(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,xe.ielt9&&this.options.opacity<1&&Nt(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&&_e(h(this._tileReady,this,e,null,c)),vt(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?(Nt(s.el,0),J(this._fadeFrame),this._fadeFrame=_e(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Ie(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),xe.ielt9||!this._map._fadeAnimated?_e(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?S(e.x,this._wrapX):e.x,this._wrapY?S(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Se(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 Ws(e)}var vs=Ws.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=B(this,n),n.detectRetina&&xe.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 Ue(s,"load",h(this._tileOnLoad,this,n,s)),Ue(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:xe.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 q(this._url,u(n,this.options))},_tileOnLoad:function(e,n){xe.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=$e;var s=this._tiles[e].coords;ot(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",$e),Ws.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===$e))return Ws.prototype._tileReady.call(this,e,n,s)}});function Jr(e,n){return new vs(e,n)}var Xr=vs.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=B(this,n);var c=n.detectRetina&&xe.retina?2:1,p=this.getTileSize();s.width=p.x*c,s.height=p.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,vs.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=Ge(s.project(n[0]),s.project(n[1])),c=a.min,p=a.max,P=(this._wmsVersion>=1.3&&this._crs===Hs?[c.y,c.x,p.y,p.x]:[c.x,c.y,p.x,p.y]).join(","),$=vs.prototype.getTileUrl.call(this,e);return $+he(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 Xr(e,n)}vs.WMS=Xr,Jr.wms=Jc;var ei=nn.extend({options:{padding:.1},initialize:function(e){B(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ie(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),p=a.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(e,n));xe.any3d?Tt(this._container,p,s):vt(this._container,p)},_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 Se(s,s.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Qr=ei.extend({options:{tolerance:0},getEvents:function(){var e=ei.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ei.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ue(e,"mousemove",this._onMouseMove,this),Ue(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ue(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){J(this._redrawRequest),delete this._ctx,ot(this._container),at(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)){ei.prototype._update.call(this);var e=this._bounds,n=this._container,s=e.getSize(),a=xe.retina?2:1;vt(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",xe.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ei.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=ie("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ei.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=Ks("shape");Ie(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=Ks("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;ot(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=Ks("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=we(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=Ks("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){ln(e._container)},_bringToBack:function(e){bn(e._container)}},Wo=xe.vml?Ks:W,Gs=ei.extend({_initContainer:function(){this._container=Wo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Wo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ot(this._container),at(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ei.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)),vt(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=Wo("path");e.options.className&&Ie(n,e.options.className),e.options.interactive&&Ie(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){ot(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,H(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 ",p=e._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(e,p)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){ln(e._path)},_bringToBack:function(e){bn(e._path)}});xe.vml&&Gs.include(Xc);function tl(e){return xe.svg||xe.vml?new Gs(e):null}Ke.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&&el(e)||tl(e)}});var nl=ms.extend({initialize:function(e,n){ms.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=Qe(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Qc(e,n){return new nl(e,n)}Gs.create=Wo,Gs.pointsToPath=H,Qn.geometryToLayer=Fo,Qn.coordsToLatLng=Wa,Qn.coordsToLatLngs=Bo,Qn.latLngToCoords=Ka,Qn.latLngsToCoords=Vo,Qn.getFeature=gs,Qn.asFeature=Uo,Ke.mergeOptions({boxZoom:!0});var il=ct.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(){Ue(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){at(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ot(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(),Fs(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ue(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=ie("div","leaflet-zoom-box",this._container),Ie(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Se(this._point,this._startPoint),s=n.getSize();vt(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(ot(this._box),ut(this._container,"leaflet-crosshair")),$i(),Bs(),at(document,{contextmenu:wn,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 et(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())}});Ke.addInitHook("addHandler","boxZoom",il),Ke.mergeOptions({doubleClickZoom:!0});var sl=ct.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)}});Ke.addInitHook("addHandler","doubleClickZoom",sl),Ke.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var ol=ct.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Qt(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))}Ie(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ut(this._map._container,"leaflet-grab"),ut(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=Qe(this._map.options.maxBounds);this._offsetLimit=Ge(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,p=(a+n+s)%e-n-s,P=Math.abs(c+s)0?p:-p))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Ke.addInitHook("addHandler","scrollWheelZoom",rl);var ed=600;Ke.mergeOptions({tapHold:xe.touchNative&&xe.safari&&xe.mobile,tapTolerance:15});var ll=ct.extend({addHooks:function(){Ue(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){at(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()&&(Ue(document,"touchend",Lt),Ue(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),ed),Ue(document,"touchend touchcancel contextmenu",this._cancel,this),Ue(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){at(document,"touchend",Lt),at(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),at(document,"touchend touchcancel contextmenu",this._cancel,this),at(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 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)}});Ke.addInitHook("addHandler","tapHold",ll),Ke.mergeOptions({touchZoom:xe.touch,bounceAtZoomLimits:!0});var ul=ct.extend({addHooks:function(){Ie(this._map._container,"leaflet-touch-zoom"),Ue(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),at(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(),Ue(document,"touchmove",this._onTouchMove,this),Ue(document,"touchend touchcancel",this._onTouchEnd,this),Lt(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 p=s._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&p.x===0&&p.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),J(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=_e(P,this,!0),Lt(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,J(this._animRequest),at(document,"touchmove",this._onTouchMove,this),at(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))}});Ke.addInitHook("addHandler","touchZoom",ul),Ke.BoxZoom=il,Ke.DoubleClickZoom=sl,Ke.Drag=ol,Ke.Keyboard=al,Ke.ScrollWheelZoom=rl,Ke.TapHold=ll,Ke.TouchZoom=ul,o.Bounds=Se,o.Browser=xe,o.CRS=E,o.Canvas=Qr,o.Circle=Xe,o.CircleMarker=Y,o.Class=Le,o.Control=Wt,o.DivIcon=Yr,o.DivOverlay=Dn,o.DomEvent=zo,o.DomUtil=Na,o.Draggable=Qt,o.Evented=ce,o.FeatureGroup=Tn,o.GeoJSON=Qn,o.GridLayer=Ws,o.Handler=ct,o.Icon=cn,o.ImageOverlay=Zo,o.LatLng=Fe,o.LatLngBounds=et,o.Layer=nn,o.LayerGroup=wi,o.LineUtil=kn,o.Map=Ke,o.Marker=ps,o.Mixin=bi,o.Path=f,o.Point=se,o.PolyUtil=Io,o.Polygon=ms,o.Polyline=Xn,o.Popup=Ho,o.PosAnimation=Di,o.Projection=Do,o.Rectangle=nl,o.Renderer=ei,o.SVG=Gs,o.SVGOverlay=qr,o.TileLayer=vs,o.Tooltip=jo,o.Transformation=bt,o.Util=le,o.VideoOverlay=Gr,o.bind=h,o.bounds=Ge,o.canvas=el,o.circle=Bc,o.circleMarker=T,o.control=Ni,o.divIcon=qc,o.extend=u,o.featureGroup=pt,o.geoJSON=Kr,o.geoJson=Zc,o.gridLayer=Yc,o.icon=js,o.imageOverlay=Hc,o.latLng=G,o.latLngBounds=Qe,o.layerGroup=hs,o.map=ls,o.marker=x,o.point=pe,o.polygon=Uc,o.polyline=Vc,o.popup=Kc,o.rectangle=Qc,o.setOptions=B,o.stamp=y,o.svg=tl,o.svgOverlay=Wc,o.tileLayer=Jr,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}))})(no,no.exports)),no.exports}var im=nm();const Si=em(im),cu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,o=K(null);let l,u,d,h;const _=new Map;function y(j,B){const he=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",ae=B?"#8a94a6":he,q=typeof j=="number"?j:0;return Si.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function M(j){const he=[`${j.callsign||j.icao24||"aircraft"}`];return j.country&&he.push(j.country),typeof j.altitude=="number"&&he.push(`${Math.round(j.altitude)} m`),typeof j.velocity=="number"&&he.push(`${Math.round(j.velocity*3.6)} km/h`),j.onGround&&he.push("on ground"),he.join(" · ")}function S(){if(!l)return;h||(h=Si.layerGroup().addTo(l));const j=new Set;for(const B of i.aircraft){if(typeof B.lat!="number"||typeof B.lng!="number")continue;j.add(B.icao24);const he=[B.lat,B.lng];let ae=_.get(B.icao24);ae?(ae.setLatLng(he),ae.setIcon(y(B.heading,B.onGround)),ae.setTooltipContent(M(B))):(ae=Si.marker(he,{icon:y(B.heading,B.onGround)}).bindTooltip(M(B)),ae.addTo(h),_.set(B.icao24,ae))}for(const[B,he]of _)j.has(B)||(h.removeLayer(he),_.delete(B))}function O(){if(!l)return;const j=i.position;if(j&&(j.lat||j.lng)){const B=[j.lat,j.lng];u?u.setLatLng(B):(u=Si.marker(B).addTo(l),l.setView(B,17))}if(d&&d.remove(),i.trail.length){const B=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Si.polyline(i.trail,{color:B,weight:3}).addTo(l)}}ui(()=>{l=Si.map(o.value,{zoomControl:!0}).setView([20,0],2),Si.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),O(),S(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&U()});let V=!1;function U(){if(V||!l||!i.aircraft.length)return;const j=i.aircraft.filter(B=>typeof B.lat=="number"&&typeof B.lng=="number").map(B=>[B.lat,B.lng]);j.length&&(l.fitBounds(Si.latLngBounds(j).pad(.2)),V=!0)}return Os(()=>{l&&l.remove(),l=null}),Ft(()=>i.position,O,{deep:!0}),Ft(()=>i.trail,O,{deep:!0}),Ft(()=>i.aircraft,()=>{S(),(!i.position||!i.position.lat&&!i.position.lng)&&U()},{deep:!0}),(j,B)=>(m(),v("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},sm=["width","height","stroke-width"],om=["d"],Q={__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)=>(m(),v("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"},[(m(!0),v(ue,null,Ve(Be(l),(h,_)=>(m(),v("path",{key:_,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)=>(m(),v("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Oe(["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:Oe(["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"],hn={__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)=>(m(),v("div",rm,[(m(!0),v(ue,null,Ve(t.options,d=>(m(),v("button",{key:d.value,type:"button",class:Oe(["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?(m(),nt(Q,{key:0,name:d.icon,size:15},null,8,["name"])):F("",!0),D(" "+k(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"},Ee={__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=ao("settingsSearch",{value:""}),l=Pe(()=>{const u=(o.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(m(),v("div",{key:0,class:Oe(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Oe(t.block?"mb-3":"min-w-0")},[r("div",um,k(t.title),1),t.desc?(m(),v("div",cm,k(t.desc),1)):F("",!0)],2),r("div",{class:Oe(t.block?"":"shrink-0")},[xf(u.$slots,"default")],2)],2)):F("",!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:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},fg={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"},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"},mg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},gg={class:"mt-4 flex flex-wrap items-center gap-3"},vg=["disabled"],_g=["disabled"],yg={key:2,class:"text-xs text-danger-fg"},bg={class:"panel mb-5 p-5"},xg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},wg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},kg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Sg={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"},Tg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Pg={key:0},Cg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Lg={class:"font-semibold text-ink-secondary"},Mg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Eg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Og={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"},Ag={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:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ig={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:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ng={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"},Rg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Fg={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"},Bg={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"},Ug={key:0,class:"inline-flex items-center gap-2 font-mono 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 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={class:"mt-4 flex flex-wrap items-center gap-3"},Jg=["disabled"],Xg=["disabled"],Qg={key:2,class:"text-xs text-danger-fg"},ev={key:3,class:"text-[11px] text-ink-muted"},tv={class:"panel mb-5 p-5"},nv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},iv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},sv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},ov={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"},av={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},rv={key:0},lv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},uv={class:"font-semibold text-ink-secondary"},cv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},dv={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},fv={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"},hv={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"},mv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},gv={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"},vv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},_v={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"},yv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},bv={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={class:"mt-4 flex flex-wrap items-center gap-3"},wv=["disabled"],kv=["disabled"],Sv={key:2,class:"text-xs text-danger-fg"},Tv={key:3,class:"text-[11px] text-ink-muted"},Pv={key:3,class:"panel mb-5 p-5"},Cv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Lv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Mv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ev={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ov={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"},zv={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},Av={key:0},$v={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Iv={class:"font-semibold text-ink-secondary"},Dv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},Nv={class:"flex w-full flex-col gap-2"},Rv={class:"break-all font-mono text-sm text-ink"},Fv={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: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"},Vv={key:0,class:"text-xs text-ink-muted"},Uv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Zv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Hv={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"},jv={class:"mt-4 flex flex-wrap items-center gap-3"},Wv=["disabled"],Kv=["disabled"],Gv={key:2,class:"text-xs text-danger-fg"},qv={key:3,class:"text-[11px] text-ink-muted"},Yv={key:4,class:"panel mb-5 p-5"},Jv={class:"flex items-center gap-4"},Xv=["src"],Qv={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},e_={class:"flex gap-2"},t_={class:"btn-ghost cursor-pointer"},n_={class:"mt-1 text-right text-[11px] text-ink-muted"},i_={key:5,class:"panel mb-5 p-5"},s_={class:"flex items-center gap-3"},o_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},a_={class:"flex flex-wrap items-center gap-4"},r_={class:"min-w-0"},l_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},u_={class:"mt-3 flex items-center gap-2"},c_={key:0,class:"mt-2 text-xs text-danger-fg"},d_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},f_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},h_={class:"rounded-lg border border-line bg-surface-2 p-3"},p_={class:"flex items-center gap-3"},m_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},g_={class:"min-w-0 flex-1"},v_={class:"text-sm font-semibold text-ink"},__={class:"font-mono text-[11px] text-ink-muted"},y_={key:6,class:"mb-5"},b_={key:0,class:"panel mb-5 p-5"},x_={class:"grid max-w-[520px] gap-2"},w_={class:"flex flex-wrap gap-2"},k_=["disabled","title"],S_=["value"],T_=["value"],P_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},C_={class:"flex items-center gap-3"},L_=["disabled"],M_={key:0,class:"text-xs text-danger-fg"},E_={key:1,class:"text-xs text-ink-muted"},O_={key:1,class:"panel mb-5 p-5"},z_={class:"grid max-w-[520px] gap-2"},A_={class:"flex flex-wrap gap-2"},$_=["value"],I_=["value"],D_={key:1,class:"text-xs text-ink-muted"},N_={class:"font-semibold text-ink-secondary"},R_={class:"flex items-center gap-3"},F_=["disabled"],B_={key:0,class:"text-xs text-danger-fg"},V_={class:"panel overflow-hidden p-0"},U_={class:"flex items-center justify-between px-5 py-4"},Z_=["disabled"],H_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},j_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},W_={key:2,class:"overflow-x-auto"},K_={class:"w-full border-collapse text-sm"},G_={class:"text-left"},q_={class:"px-5 py-3"},Y_={class:"text-ink"},J_={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},X_={class:"px-5 py-3"},Q_={class:"px-5 py-3"},ey={class:"px-5 py-3"},ty={class:"px-5 py-3 text-right"},ny=["onClick"],iy={key:1,class:"inline-flex items-center gap-1.5"},sy=["onClick"],oy=["onClick"],ay={key:7,class:"mb-5"},ry={key:0,class:"panel mb-5 p-5"},ly={class:"grid max-w-[520px] gap-2"},uy={class:"flex items-center gap-3"},cy={key:0,class:"text-xs text-danger-fg"},dy={key:1,class:"panel mb-5 p-5"},fy={class:"grid max-w-[520px] gap-2"},hy={class:"flex items-center gap-3"},py=["disabled"],my={key:0,class:"text-xs text-danger-fg"},gy={class:"panel overflow-hidden p-0"},vy={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},_y={key:1,class:"overflow-x-auto"},yy={class:"w-full border-collapse text-sm"},by={class:"text-left"},xy={class:"px-5 py-3"},wy={class:"inline-flex items-center gap-2 text-ink"},ky={class:"px-5 py-3 text-ink-secondary"},Sy={class:"px-5 py-3 text-right"},Ty=["onClick"],Py={key:1,class:"inline-flex items-center gap-1.5"},Cy=["onClick"],Ly=["disabled","title","onClick"],My={key:8,class:"mb-5"},Ey={class:"panel mb-5 p-5"},Oy={class:"btn-ghost cursor-pointer"},zy={key:0,class:"mt-2 text-xs text-ink-muted"},Ay={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},$y={class:"flex items-center gap-2 text-danger-fg"},Iy={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Dy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Ny={class:"mt-3"},Ry={class:"eyebrow mb-1 block"},Fy={class:"text-ink"},By=["placeholder"],Vy={class:"mt-4 flex flex-wrap items-center gap-3"},Uy=["disabled"],Zy=["disabled"],Hy={key:2,class:"text-xs text-ink-muted"},jy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Wy={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"},du="pv.opensky.health",fu="pv.filetransfer.health",hu="pv.webdav.health",pu="pv.localstorage.health",Ky={__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=Pe(()=>o.role==="superadmin"),d=Pe(()=>o.role==="admin"||o.role==="superadmin");function h(x){return x==="superadmin"?"Superadmin":x==="admin"?"Admin":"User"}function _(x){return x==="superadmin"||x==="admin"?"shield":"user"}function y(x){return x==="superadmin"||x==="admin"?M.accent:M.neutral}const M={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=Pe(()=>{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=K("account"),V=K("");ju("settingsSearch",V);const U=Pe(()=>V.value.trim().length>0),j=Pe(()=>V.value.trim().toLowerCase());function B(x){return j.value?(x.label+" "+x.kw).toLowerCase().includes(j.value)||ae(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 ae(x){return j.value?(he[x]||[]).some(f=>f.includes(j.value)):!0}const q=Pe(()=>U.value?S.value.filter(B):S.value.filter(x=>x.id===O.value)),we=Pe({get:()=>Qi.value,set:x=>ha(x)}),de=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],$e=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],ze=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],ke=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],Ze=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],ge=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],Ce=K(Date.now());let _e=null;const J=Pe(()=>ru(Ce.value)),le=_t({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Le=K("user"),Ne=_t({clientId:"",clientSecret:"",plan:"",bbox:""}),ve=K(""),ce=K(!1),se=K(!1),tt=K(null),pe=K(null),Se=Pe(()=>tt.value&&tt.value.credits||null),Ge=Pe(()=>{const x=Se.value;return!x||!x.daily||x.remaining==null?null:Math.max(0,Math.min(100,Math.round(x.remaining/x.daily*100)))}),et=Pe(()=>{const x=Ge.value;return x==null?"bg-accent":x<=10?"bg-danger":x<=30?"bg-amber":"bg-success"});function Qe(x){return typeof x=="number"?x.toLocaleString():x}function Fe(){if(!pe.value)return"";const x=Math.max(0,Math.round((Date.now()-pe.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const Y=Math.round(f/60);return Y<24?`${Y} h ago`:`${Math.round(Y/24)} d ago`}function G(){try{tt.value&&localStorage.setItem(du,JSON.stringify({health:tt.value,ts:pe.value}))}catch{}}function E(){try{const x=localStorage.getItem(du);if(!x)return;const f=JSON.parse(x);f&&f.health&&(tt.value=f.health,pe.value=f.ts||null)}catch{}}const A=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],st=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],dt=Pe(()=>le.isSuperadmin),bt=Pe(()=>le.isSuperadmin?"user":Le.value),b=Pe(()=>le.scopes[bt.value]||{editableLayer:"user",fields:{}}),g=Pe(()=>bt.value==="org");function w(x){return b.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function W(x){return dt.value||w(x).locked}function H(x){const f=w(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Z(){Ne.clientId=w("clientId").own||"",Ne.clientSecret=w("clientSecret").own||"",Ne.plan=w("plan").own||"",Ne.bbox=w("bbox").own||""}function ee(x){le.available=!!x.available,le.orgEnabled=x.orgEnabled!==!1,le.allowAnonymous=!!x.allowAnonymous,le.enabled=!!x.enabled,le.canEditOrg=!!x.canEditOrg,le.isSuperadmin=!!x.isSuperadmin,le.scopes=x.scopes||{},Le.value==="org"&&!le.canEditOrg&&(Le.value="user"),Z(),le.loaded=!0}Ft(Le,()=>{ve.value="",Z()});async function I(){E();const{ok:x,body:f}=await up();x&&ee(f)}async function C(x){const f=g.value;f?le.orgEnabled=x:le.enabled=x;const{ok:Y,body:T}=await iu(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});Y?(ee(T),Ye(f?x?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":x?"OpenSky enabled.":"OpenSky disabled.")):(f?le.orgEnabled=!x:le.enabled=!x,Ye(T.error||"Could not update."))}async function N(){ve.value="",ce.value=!0;const x={};for(const Xe of["clientId","clientSecret","plan","bbox"])W(Xe)||(x[Xe]=Ne[Xe]);const f={scope:bt.value,config:x};g.value||(f.enabled=le.enabled);const{ok:Y,body:T}=await iu(f);if(ce.value=!1,!Y){ve.value=T.error||"Could not save settings.";return}ee(T),Ye(g.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function be(){se.value=!0,tt.value=null;const{ok:x,body:f}=await cp();se.value=!1,tt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},pe.value=Date.now(),G()}function re(x){return x==="ok"?M.success:x==="degraded"?M.warning:M.danger}const te=_t({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Me=K("user"),ne=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],me=_t(Object.fromEntries(ne.map(x=>[x,""]))),je=K(""),ft=K(!1),gt=K(!1),xt=K(null),Ct=K(null),_n=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],di=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],St=Pe(()=>te.isSuperadmin),Dt=Pe(()=>te.isSuperadmin?"user":Me.value),En=Pe(()=>te.scopes[Dt.value]||{editableLayer:"user",fields:{}}),Zt=Pe(()=>Dt.value==="org"),es=Pe(()=>(Ht("protocol")?At("protocol").effective:me.protocol)||"sftp");function At(x){return En.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Ht(x){return St.value||At(x).locked}function wt(x){const f=At(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Pa(x){return(_n.find(f=>f.value===x)||{}).label||x||"—"}function wo(){for(const x of ne)me[x]=At(x).own||"";me.protocol||(me.protocol="sftp"),me.insecureSkipVerify||(me.insecureSkipVerify="false")}function zs(x){te.available=!!x.available,te.orgEnabled=x.orgEnabled!==!1,te.enabled=!!x.enabled,te.canEditOrg=!!x.canEditOrg,te.isSuperadmin=!!x.isSuperadmin,te.scopes=x.scopes||{},Me.value==="org"&&!te.canEditOrg&&(Me.value="user"),wo(),te.loaded=!0}Ft(Me,()=>{je.value="",wo()});function Ca(){if(!Ct.value)return"";const x=Math.max(0,Math.round((Date.now()-Ct.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const Y=Math.round(f/60);return Y<24?`${Y} h ago`:`${Math.round(Y/24)} d ago`}function La(){try{xt.value&&localStorage.setItem(fu,JSON.stringify({health:xt.value,ts:Ct.value}))}catch{}}function Ma(){try{const x=localStorage.getItem(fu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(xt.value=f.health,Ct.value=f.ts||null)}catch{}}async function As(){Ma();const{ok:x,body:f}=await fp();x&&zs(f)}async function ko(x){const f=Zt.value;f?te.orgEnabled=x:te.enabled=x;const{ok:Y,body:T}=await su(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});Y?(zs(T),Ye(f?x?"File transfer enabled for your organization.":"File transfer disabled for your organization.":x?"File transfer enabled.":"File transfer disabled.")):(f?te.orgEnabled=!x:te.enabled=!x,Ye(T.error||"Could not update."))}async function Ea(){je.value="",ft.value=!0;const x={};for(const Xe of ne)Ht(Xe)||(x[Xe]=me[Xe]);const f={scope:Dt.value,config:x};Zt.value||(f.enabled=te.enabled);const{ok:Y,body:T}=await su(f);if(ft.value=!1,!Y){je.value=T.error||"Could not save settings.";return}zs(T),Ye(Zt.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Oa(){gt.value=!0,xt.value=null;const{ok:x,body:f}=await hp();gt.value=!1,xt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},Ct.value=Date.now(),La()}function za(x){return x==="ok"?M.success:x==="degraded"?M.warning:M.danger}const We=_t({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),xe=K("user"),ts=["baseURL","username","password","insecureSkipVerify","basePath"],$t=_t(Object.fromEntries(ts.map(x=>[x,""]))),fi=K(""),Oi=K(!1),hi=K(!1),an=K(null),tn=K(null),So=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],$s=Pe(()=>We.isSuperadmin),Is=Pe(()=>We.isSuperadmin?"user":xe.value),Aa=Pe(()=>We.scopes[Is.value]||{editableLayer:"user",fields:{}}),rn=Pe(()=>Is.value==="org");function yn(x){return Aa.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function pi(x){return $s.value||yn(x).locked}function jt(x){const f=yn(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function To(){for(const x of ts)$t[x]=yn(x).own||"";$t.insecureSkipVerify||($t.insecureSkipVerify="false")}function Ds(x){We.available=!!x.available,We.orgEnabled=x.orgEnabled!==!1,We.enabled=!!x.enabled,We.canEditOrg=!!x.canEditOrg,We.isSuperadmin=!!x.isSuperadmin,We.scopes=x.scopes||{},xe.value==="org"&&!We.canEditOrg&&(xe.value="user"),To(),We.loaded=!0}Ft(xe,()=>{fi.value="",To()});function $a(){if(!tn.value)return"";const x=Math.max(0,Math.round((Date.now()-tn.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const Y=Math.round(f/60);return Y<24?`${Y} h ago`:`${Math.round(Y/24)} d ago`}function Ia(){try{an.value&&localStorage.setItem(hu,JSON.stringify({health:an.value,ts:tn.value}))}catch{}}function Da(){try{const x=localStorage.getItem(hu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(an.value=f.health,tn.value=f.ts||null)}catch{}}async function Ns(){Da();const{ok:x,body:f}=await gp();x&&Ds(f)}async function mi(x){const f=rn.value;f?We.orgEnabled=x:We.enabled=x;const{ok:Y,body:T}=await ou(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});Y?(Ds(T),Ye(f?x?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":x?"WebDAV enabled.":"WebDAV disabled.")):(f?We.orgEnabled=!x:We.enabled=!x,Ye(T.error||"Could not update."))}async function Po(){fi.value="",Oi.value=!0;const x={};for(const Xe of ts)pi(Xe)||(x[Xe]=$t[Xe]);const f={scope:Is.value,config:x};rn.value||(f.enabled=We.enabled);const{ok:Y,body:T}=await ou(f);if(Oi.value=!1,!Y){fi.value=T.error||"Could not save settings.";return}Ds(T),Ye(rn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function Co(){hi.value=!0,an.value=null;const{ok:x,body:f}=await vp();hi.value=!1,an.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},tn.value=Date.now(),Ia()}function zi(x){return x==="ok"?M.success:x==="degraded"?M.warning:M.danger}const ie=_t({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),ot=K("user"),jn=K(""),ln=K(""),bn=K(!1),gi=K(!1),Ie=K(null),ut=K(null),Wn=K({}),Ai=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Nt=Pe(()=>ie.isSuperadmin),Rs=Pe(()=>ie.isSuperadmin?"user":ot.value),ns=Pe(()=>ie.scopes[Rs.value]||{editableLayer:"user",fields:{}}),Tt=Pe(()=>Rs.value==="org");function vt(x){return ns.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function On(x){return Nt.value||vt(x).locked}function vi(x){const f=vt(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function $i(x){return(Ai.find(f=>f.value===x)||{}).label||"Inherit"}function is(){jn.value=vt("readOnly").own||""}function xn(x){ie.available=!!x.available,ie.orgEnabled=x.orgEnabled!==!1,ie.enabled=!!x.enabled,ie.canEditOrg=!!x.canEditOrg,ie.isSuperadmin=!!x.isSuperadmin,ie.isOrgUser=!!x.isOrgUser,ie.mounts=Array.isArray(x.mounts)?x.mounts:[],ie.privateFolder=!!x.privateFolder,ie.privateEnabled=!!x.privateEnabled,ie.allowPrivate=x.allowPrivate!==!1,ie.rootConfigured=!!x.rootConfigured,ie.scopes=x.scopes||{},ot.value==="org"&&!ie.canEditOrg&&(ot.value="user"),is(),ie.loaded=!0}Ft(ot,()=>{ln.value="",is()});function Fs(){if(!ut.value)return"";const x=Math.max(0,Math.round((Date.now()-ut.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const Y=Math.round(f/60);return Y<24?`${Y} h ago`:`${Math.round(Y/24)} d ago`}function Bs(){try{Ie.value&&localStorage.setItem(pu,JSON.stringify({health:Ie.value,ts:ut.value}))}catch{}}function ss(){try{const x=localStorage.getItem(pu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Ie.value=f.health,ut.value=f.ts||null)}catch{}}async function Vs(){ss();const{ok:x,body:f}=await pp();x&&xn(f)}async function os(x){const f=Tt.value;f?ie.orgEnabled=x:ie.enabled=x;const{ok:Y,body:T}=await Qo(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});Y?(xn(T),Ye(f?x?"Local storage enabled for your organization.":"Local storage disabled for your organization.":x?"Local storage enabled.":"Local storage disabled.")):(f?ie.orgEnabled=!x:ie.enabled=!x,Ye(T.error||"Could not update."))}async function as(x){ie.privateFolder=x;const{ok:f,body:Y}=await Qo({scope:"user",privateFolder:x});f?(xn(Y),Ye(x?"Private folder enabled.":"Private folder disabled.")):(ie.privateFolder=!x,Ye(Y.error||"Could not update."))}async function Lo(x){ie.allowPrivate=x;const{ok:f,body:Y}=await Qo({scope:"org",allowPrivate:x});f?(xn(Y),Ye(x?"Members may now create private folders.":"Private folders disabled for your organization.")):(ie.allowPrivate=!x,Ye(Y.error||"Could not update."))}async function Us(){ln.value="",bn.value=!0;const x={};On("readOnly")||(x.readOnly=jn.value);const f={scope:Rs.value,config:x};Tt.value||(f.enabled=ie.enabled);const{ok:Y,body:T}=await Qo(f);if(bn.value=!1,!Y){ln.value=T.error||"Could not save settings.";return}xn(T),Ye(Tt.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Na(){gi.value=!0,Ie.value=null,Wn.value={};const{ok:x,body:f}=await mp();gi.value=!1,Ie.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const Y={};if(Array.isArray(f.mounts))for(const T of f.mounts)Y[T.id]={status:T.status,detail:T.detail};Wn.value=Y,ut.value=Date.now(),Bs()}function Ue(x){return x==="ok"?M.success:x==="degraded"?M.warning:M.danger}const un=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],at=K("apis-external");function rs(x){return U.value||at.value===x}const _i=K("");let Ii=null;function Ye(x){_i.value=x,clearTimeout(Ii),Ii=setTimeout(()=>_i.value="",2200)}const kt=_t({current:"",next:"",confirm:""}),zn=K(""),yi=K(!1);function Lt(){if(yi.value=!1,!kt.current)return zn.value="Enter your current password.";if(kt.next.length<8)return zn.value="New password must be at least 8 characters.";if(kt.next!==kt.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",kt.current=kt.next=kt.confirm=""}const wn=K("");function Mo(){wn.value="Verification link would be sent once the account service is wired up."}function Eo(x){const f=x.target.files&&x.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){Ye("Image too large (max ~1.5 MB).");return}const Y=new FileReader;Y.onload=()=>{De.avatar=String(Y.result),Ye("Photo updated.")},Y.readAsDataURL(f)}function Ra(){De.avatar="",Ye("Photo removed.")}const Oo=Pe(()=>{var Y,T,Xe;const f=(De.displayName||De.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((Y=f[0])==null?void 0:Y[0])||"P")+(((T=f[1])==null?void 0:T[0])||((Xe=f[0])==null?void 0:Xe[1])||"V")).toUpperCase()}),Kn=K(!1),zo=K(""),Di=K(""),Ke=K(""),ls=K([]);function Wt(x){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let Y="";for(let T=0;TWt(4).toLowerCase()+"-"+Wt(4).toLowerCase()),Ke.value=""}function Fa(){De.twoFactor=!1,ls.value=[],Kn.value=!1}const Xt=navigator.userAgent;function Ba(){return/Edg\//.test(Xt)?"Edge":/OPR\//.test(Xt)?"Opera":/Chrome\//.test(Xt)?"Chrome":/Firefox\//.test(Xt)?"Firefox":/Safari\//.test(Xt)?"Safari":"Browser"}function $o(){return/Windows/.test(Xt)?"Windows":/Mac OS X/.test(Xt)?"macOS":/Android/.test(Xt)?"Android":/iPhone|iPad/.test(Xt)?"iOS":/Linux/.test(Xt)?"Linux":"Unknown OS"}const Va=Date.now(),us=K([]),Gn=K(!1),cs=K(""),ct=_t({email:"",password:"",role:"user",organization:""}),bi=K(""),Ri=K(!1),Qt=K(""),Zs=Pe(()=>{const x=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&x.push({value:"superadmin",label:"Superadmin"}),x}),Fi=K([]);async function qn(){if(!d.value)return;const x=await ip();x.ok&&(Fi.value=x.organizations.slice().sort((f,Y)=>f.name.localeCompare(Y.name)))}const Io=Pe(()=>{const x=Fi.value.map(f=>({value:f.id,label:f.name}));return u.value&&x.unshift({value:"",label:"No organization"}),x});async function Yn(){if(!d.value)return;Gn.value=!0,cs.value="";const x=await Qh();if(Gn.value=!1,!x.ok){cs.value=x.status===403?"Manager role required.":"Could not load users.";return}us.value=x.users.slice().sort((f,Y)=>f.email.localeCompare(Y.email))}function Bi(x){try{const f=x.data||{},Y=Object.keys(f)[0];return Y&&f[Y]&&f[Y].message||x.message||x.error||"Invalid input."}catch{return x.error||"Could not create user."}}async function Ua(){bi.value="";const x=ct.email.trim().toLowerCase();if(!x.includes("@"))return bi.value="Enter a valid email.";if(ct.password.length<8)return bi.value="Password must be at least 8 characters.";Ri.value=!0;const f=u.value?ct.organization:o.organization,{ok:Y,body:T}=await ep(x,ct.password,ct.role,f);if(Ri.value=!1,!Y)return bi.value=Bi(T);ct.email="",ct.password="",ct.role="user",ct.organization="",Ye("User created."),Yn()}async function Za(x){const{ok:f,body:Y}=await np(x.id);if(Qt.value="",!f)return Ye(Y.error||"Could not remove user.");Ye("User removed."),Yn()}const Je=_t({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=K(""),Vi=K(!1),ds=Pe(()=>!!Je.id&&Je.email===o.email);function fs(x){Qt.value="",Je.id=x.id,Je.email=x.email,Je.role=x.role||"user",Je.verified=!!x.verified,Je.password="",Je.organization=x.organization||"",An.value=""}function $n(){Je.id="",An.value=""}async function Ha(){An.value="";const x=Je.email.trim().toLowerCase();if(!x.includes("@"))return An.value="Enter a valid email.";if(Je.password&&Je.password.length<8)return An.value="New password must be at least 8 characters (or leave blank).";const f={email:x,role:Je.role,verified:Je.verified};u.value&&(f.organization=Je.organization),Je.password&&(f.password=Je.password),Vi.value=!0;const{ok:Y,body:T}=await tp(Je.id,f);if(Vi.value=!1,!Y)return An.value=Bi(T);Ye("User updated."),$n(),Yn()}const In=_t({name:""}),Mt=K(""),Ui=K(!1),xi=K(""),kn=_t({id:"",name:""}),Sn=K(""),Zi=Pe(()=>{const x={};for(const f of us.value)f.organization&&(x[f.organization]=(x[f.organization]||0)+1);return x});async function Do(){Mt.value="";const x=In.name.trim();if(!x)return Mt.value="Enter an organization name.";Ui.value=!0;const{ok:f,body:Y}=await sp(x);if(Ui.value=!1,!f)return Mt.value=Bi(Y);In.name="",Ye("Organization created."),qn()}function ja(x){xi.value="",kn.id=x.id,kn.name=x.name,Sn.value=""}function Hs(){kn.id="",Sn.value=""}async function No(){Sn.value="";const x=kn.name.trim();if(!x)return Sn.value="Enter an organization name.";const{ok:f,body:Y}=await op(kn.id,x);if(!f)return Sn.value=Bi(Y);Ye("Organization renamed."),Hs(),qn(),Yn()}async function nn(x){const{ok:f,body:Y}=await ap(x.id);if(xi.value="",!f)return Ye(Y.error||"Could not delete organization.");Ye("Organization deleted."),qn()}function wi(){const x={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...De},themeMode:Qi.value},f=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),Y=URL.createObjectURL(f),T=document.createElement("a");T.href=Y,T.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(T),T.click(),T.remove(),URL.revokeObjectURL(Y),Ye("Settings exported.")}const hs=K("");function Tn(x){const f=x.target.files&&x.target.files[0];if(!f)return;const Y=new FileReader;Y.onload=()=>{try{const T=JSON.parse(String(Y.result)),Xe=T.prefs||T;if(!Nc(Xe))throw new Error("bad shape");T.themeMode&&ha(T.themeMode),Ur(De.fontSize),Zr(De.reduceMotion),hs.value="Settings imported and applied."}catch{hs.value="That file is not a valid PilotVault settings export."}},Y.readAsText(f),x.target.value=""}const pt=_t({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const js=Pe(()=>o.email||"DELETE MY ACCOUNT"),Jn=Pe(()=>pt.understand&&pt.typed===js.value);function Ro(){Jn.value&&(pt.armed=!0,pt.cooldown=5,clearInterval(cn),cn=setInterval(()=>{pt.cooldown--,pt.cooldown<=0&&clearInterval(cn)},1e3))}Ft(Jn,x=>{!x&&pt.armed&&(pt.armed=!1,pt.cooldown=0,clearInterval(cn))});function ps(){if(!(!pt.armed||pt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}pt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return ui(()=>{_e=setInterval(()=>Ce.value=Date.now(),1e3),qn(),Yn(),I(),As(),Ns(),Vs()}),Os(()=>{clearInterval(_e),clearInterval(cn),clearTimeout(Ii)}),(x,f)=>(m(),v("div",fm,[r("div",hm,[f[62]||(f[62]=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(Q,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":f[0]||(f[0]=Y=>V.value=Y),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ye,V.value]]),V.value?(m(),v("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=Y=>V.value="")},[z(Q,{name:"x",size:15})])):F("",!0)])]),r("div",mm,[oe(r("nav",gm,[(m(!0),v(ue,null,Ve(S.value,Y=>(m(),v("button",{key:Y.id,class:Oe(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[O.value===Y.id?Y.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":Y.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:T=>O.value=Y.id},[z(Q,{name:Y.icon,size:17},null,8,["name"]),r("span",_m,k(Y.label),1)],10,vm))),128))],512),[[yh,!U.value]]),r("div",ym,[U.value&&!q.value.length?(m(),v("div",bm," No settings match “"+k(V.value)+"”. ",1)):F("",!0),(m(!0),v(ue,null,Ve(q.value,Y=>(m(),v(ue,{key:Y.id},[U.value?(m(),v("div",xm,[z(Q,{name:Y.icon,size:14},null,8,["name"]),D(" "+k(Y.label),1)])):F("",!0),Y.id==="account"?(m(),v("div",wm,[z(Ee,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:Te(()=>[oe(r("input",{"onUpdate:modelValue":f[2]||(f[2]=T=>Be(De).name=T),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=T=>Ye("Saved."))},null,544),[[ye,Be(De).name]])]),_:1}),z(Ee,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:Te(()=>[r("div",km,[f[63]||(f[63]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),oe(r("input",{"onUpdate:modelValue":f[4]||(f[4]=T=>Be(De).username=T),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=T=>Ye("Saved."))},null,544),[[ye,Be(De).username]])])]),_:1}),z(Ee,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:Te(()=>[r("div",Sm,[r("span",Tm,k(t.email||"—"),1),r("span",Pm,[z(Q,{name:"mail",size:12}),f[64]||(f[64]=D(" Unverified ",-1))])])]),_:1}),z(Ee,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:Te(()=>[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[z(Q,{name:_(t.role),size:12},null,8,["name"]),D(k(h(t.role)),1)],2)]),_:1}),z(Ee,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:Te(()=>[r("span",{class:Oe(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},k(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),z(Ee,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:Te(()=>[r("button",{class:"btn-ghost",onClick:Mo},"Send verification link"),wn.value?(m(),v("p",Cm,k(wn.value),1)):F("",!0)]),_:1}),z(Ee,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:Te(()=>[r("div",Lm,[oe(r("input",{"onUpdate:modelValue":f[6]||(f[6]=T=>kt.current=T),type:"password",class:"field",placeholder:"Current password"},null,512),[[ye,kt.current]]),oe(r("input",{"onUpdate:modelValue":f[7]||(f[7]=T=>kt.next=T),type:"password",class:"field",placeholder:"New password"},null,512),[[ye,kt.next]]),oe(r("input",{"onUpdate:modelValue":f[8]||(f[8]=T=>kt.confirm=T),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ye,kt.confirm]]),r("div",Mm,[r("button",{class:"btn-accent",onClick:Lt},"Update password"),zn.value?(m(),v("span",{key:0,class:Oe(["text-xs",yi.value?"text-success-fg":"text-ink-muted"])},k(zn.value),3)):F("",!0)])])]),_:1})])):Y.id==="appearance"?(m(),v("div",Em,[z(Ee,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:Te(()=>[z(hn,{modelValue:we.value,"onUpdate:modelValue":f[9]||(f[9]=T=>we.value=T),options:de},null,8,["modelValue"])]),_:1}),z(Ee,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:Te(()=>[z(hn,{modelValue:Be(De).fontSize,"onUpdate:modelValue":f[10]||(f[10]=T=>Be(De).fontSize=T),options:$e},null,8,["modelValue"])]),_:1}),z(Ee,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:Te(()=>[z(sn,{modelValue:Be(De).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=T=>Be(De).reduceMotion=T)},null,8,["modelValue"])]),_:1}),z(Ee,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:Te(()=>[oe(r("select",{"onUpdate:modelValue":f[12]||(f[12]=T=>Be(De).language=T),class:"field w-48"},[(m(),v(ue,null,Ve(ke,([T,Xe])=>r("option",{key:T,value:T},k(Xe),9,Om)),64))],512),[[Ot,Be(De).language]])]),_:1}),z(Ee,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:Te(()=>[oe(r("select",{"onUpdate:modelValue":f[13]||(f[13]=T=>Be(De).region=T),class:"field w-48"},[(m(),v(ue,null,Ve(Ze,([T,Xe])=>r("option",{key:T,value:T},k(Xe),9,zm)),64))],512),[[Ot,Be(De).region]])]),_:1}),z(Ee,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:Te(()=>[oe(r("select",{"onUpdate:modelValue":f[14]||(f[14]=T=>Be(De).dateFormat=T),class:"field w-48"},[(m(),v(ue,null,Ve(ge,([T,Xe])=>r("option",{key:T,value:T},k(Xe),9,Am)),64))],512),[[Ot,Be(De).dateFormat]])]),_:1}),z(Ee,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:Te(()=>[z(hn,{modelValue:Be(De).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=T=>Be(De).timeFormat=T),options:ze},null,8,["modelValue"])]),_:1}),z(Ee,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:Te(()=>[r("span",$m,k(J.value),1)]),_:1}),f[65]||(f[65]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):Y.id==="integrations"?(m(),v("div",Im,[U.value?F("",!0):(m(),v("div",Dm,[(m(),v(ue,null,Ve(un,T=>r("button",{key:T.id,type:"button",class:Oe(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",at.value===T.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Xe=>at.value=T.id},[z(Q,{name:T.icon,size:16},null,8,["name"]),D(k(T.label),1)],10,Nm)),64))])),rs("apis-external")?(m(),v("div",Rm,[r("div",Fm,[r("div",Bm,[z(Q,{name:"radio",size:20})]),f[66]||(f[66]=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))]),le.loaded&&!le.available?(m(),v("div",Vm,[z(Q,{name:"lock",size:14,class:"mr-1 inline"}),f[67]||(f[67]=D(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):F("",!0),le.canEditOrg?(m(),v("div",Um,[f[68]||(f[68]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(hn,{modelValue:Le.value,"onUpdate:modelValue":f[16]||(f[16]=T=>Le.value=T),options:st},null,8,["modelValue"])])):F("",!0),g.value?(m(),nt(Ee,{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:Te(()=>[z(sn,{"model-value":le.orgEnabled,disabled:!le.available,"onUpdate:modelValue":C},null,8,["model-value","disabled"])]),_:1})):(m(),nt(Ee,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:Te(()=>[z(sn,{"model-value":le.enabled,disabled:!le.available||!le.orgEnabled,"onUpdate:modelValue":C},null,8,["model-value","disabled"])]),_:1})),!g.value&&le.available&&!le.orgEnabled?(m(),v("div",Zm,[z(Q,{name:"lock",size:13,class:"mr-1 inline"}),f[70]||(f[70]=D("OpenSky is turned off for your organization",-1)),le.canEditOrg?(m(),v("span",Hm,[...f[69]||(f[69]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):F("",!0),f[71]||(f[71]=D(". ",-1))])):F("",!0),g.value?(m(),v("div",jm,[z(Q,{name:"users",size:13,class:"mr-1 inline"}),f[72]||(f[72]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Wm,k(t.organizationName||"your organization"),1),f[73]||(f[73]=D(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):dt.value?(m(),v("div",Km," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):F("",!0),le.available&&!g.value?(m(),v("div",Gm,[r("div",qm,[r("div",Ym,[z(Q,{name:"signal",size:15}),f[74]||(f[74]=D("Credit usage ",-1))]),pe.value?(m(),v("span",Jm,"Checked "+k(Fe()),1)):F("",!0)]),Se.value?(m(),v(ue,{key:0},[Se.value.remaining!=null?(m(),v(ue,{key:0},[r("div",Xm,[r("span",Qm,k(Qe(Se.value.remaining)),1),r("span",eg,"/ "+k(Qe(Se.value.daily))+" credits left today",1)]),r("div",tg,[r("div",{class:Oe(["h-full rounded-full transition-all",et.value]),style:Cs({width:Ge.value+"%"})},null,6)]),r("div",ng," Used "+k(Qe(Se.value.daily-Se.value.remaining))+" today · "+k(Se.value.probeCost)+" credit"+k(Se.value.probeCost===1?"":"s")+" per query · "+k(Se.value.mode),1)],64)):(m(),v(ue,{key:1},[r("div",ig,[f[75]||(f[75]=D("Daily allowance: ",-1)),r("span",sg,k(Qe(Se.value.daily)),1),f[76]||(f[76]=D(" credits",-1))]),r("div",og,k(Se.value.probeCost)+" credit"+k(Se.value.probeCost===1?"":"s")+" per query · "+k(Se.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(m(),v("div",ag,[...f[77]||(f[77]=[D(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),D(" below to fetch your live OpenSky credit balance. ",-1)])]))])):F("",!0),z(Ee,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:Te(()=>[W("plan")?(m(),v("span",rg,[D(k((A.find(T=>T.value===w("plan").effective)||{}).label||w("plan").effective||"—")+" ",1),H("plan")?(m(),v("span",lg,[z(Q,{name:"lock",size:10}),D(k(H("plan")),1)])):F("",!0)])):(m(),nt(hn,{key:1,modelValue:Ne.plan,"onUpdate:modelValue":f[17]||(f[17]=T=>Ne.plan=T),options:A},null,8,["modelValue"]))]),_:1}),z(Ee,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:Te(()=>[W("bbox")?(m(),v("span",ug,[D(k(w("bbox").effective||"—")+" ",1),H("bbox")?(m(),v("span",cg,[z(Q,{name:"lock",size:10}),D(k(H("bbox")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[18]||(f[18]=T=>Ne.bbox=T),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ye,Ne.bbox]])]),_:1}),z(Ee,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:Te(()=>[W("clientId")?(m(),v("span",dg,[D(k(w("clientId").effective||"—")+" ",1),H("clientId")?(m(),v("span",fg,[z(Q,{name:"lock",size:10}),D(k(H("clientId")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=T=>Ne.clientId=T),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ye,Ne.clientId]])]),_:1}),z(Ee,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:Te(()=>[W("clientSecret")?(m(),v("span",hg,[D(k(w("clientSecret").effective||"—")+" ",1),H("clientSecret")?(m(),v("span",pg,[z(Q,{name:"lock",size:10}),D(k(H("clientSecret")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=T=>Ne.clientSecret=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,Ne.clientSecret]])]),_:1}),le.available&&!le.allowAnonymous?(m(),v("div",mg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):F("",!0),r("div",gg,[dt.value?F("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:ce.value||!le.available,onClick:N},k(ce.value?"Saving…":g.value?"Save organization settings":"Save settings"),9,vg)),g.value?F("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:se.value||!le.available,onClick:be},k(se.value?"Testing…":"Test connection"),9,_g)),ve.value?(m(),v("span",yg,k(ve.value),1)):F("",!0),tt.value&&!g.value?(m(),v("span",{key:3,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",re(tt.value.status)])},[f[78]||(f[78]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(tt.value.detail||tt.value.status),1)],2)):F("",!0)])])):F("",!0),rs("drives-external")?(m(),v(ue,{key:2},[r("div",bg,[r("div",xg,[r("div",wg,[z(Q,{name:"server",size:20})]),f[79]||(f[79]=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))]),te.loaded&&!te.available?(m(),v("div",kg,[z(Q,{name:"lock",size:14,class:"mr-1 inline"}),f[80]||(f[80]=D(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):F("",!0),te.canEditOrg?(m(),v("div",Sg,[f[81]||(f[81]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(hn,{modelValue:Me.value,"onUpdate:modelValue":f[21]||(f[21]=T=>Me.value=T),options:st},null,8,["modelValue"])])):F("",!0),Zt.value?(m(),nt(Ee,{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:Te(()=>[z(sn,{"model-value":te.orgEnabled,disabled:!te.available,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})):(m(),nt(Ee,{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:Te(()=>[z(sn,{"model-value":te.enabled,disabled:!te.available||!te.orgEnabled,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})),!Zt.value&&te.available&&!te.orgEnabled?(m(),v("div",Tg,[z(Q,{name:"lock",size:13,class:"mr-1 inline"}),f[83]||(f[83]=D("File transfer is turned off for your organization",-1)),te.canEditOrg?(m(),v("span",Pg,[...f[82]||(f[82]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):F("",!0),f[84]||(f[84]=D(". ",-1))])):F("",!0),Zt.value?(m(),v("div",Cg,[z(Q,{name:"users",size:13,class:"mr-1 inline"}),f[85]||(f[85]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Lg,k(t.organizationName||"your organization"),1),f[86]||(f[86]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):St.value?(m(),v("div",Mg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):F("",!0),z(Ee,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:Te(()=>[Ht("protocol")?(m(),v("span",Eg,[D(k(Pa(At("protocol").effective))+" ",1),wt("protocol")?(m(),v("span",Og,[z(Q,{name:"lock",size:10}),D(k(wt("protocol")),1)])):F("",!0)])):(m(),nt(hn,{key:1,modelValue:me.protocol,"onUpdate:modelValue":f[22]||(f[22]=T=>me.protocol=T),options:_n},null,8,["modelValue"]))]),_:1}),z(Ee,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:Te(()=>[Ht("host")?(m(),v("span",zg,[D(k(At("host").effective||"—")+" ",1),wt("host")?(m(),v("span",Ag,[z(Q,{name:"lock",size:10}),D(k(wt("host")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[23]||(f[23]=T=>me.host=T),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ye,me.host]])]),_:1}),z(Ee,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:Te(()=>[Ht("port")?(m(),v("span",$g,[D(k(At("port").effective||"default")+" ",1),wt("port")?(m(),v("span",Ig,[z(Q,{name:"lock",size:10}),D(k(wt("port")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=T=>me.port=T),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ye,me.port]])]),_:1}),z(Ee,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:Te(()=>[Ht("username")?(m(),v("span",Dg,[D(k(At("username").effective||"—")+" ",1),wt("username")?(m(),v("span",Ng,[z(Q,{name:"lock",size:10}),D(k(wt("username")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=T=>me.username=T),class:"field w-64",placeholder:"user"},null,512)),[[ye,me.username]])]),_:1}),z(Ee,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:Te(()=>[Ht("password")?(m(),v("span",Rg,[D(k(At("password").effective||"—")+" ",1),wt("password")?(m(),v("span",Fg,[z(Q,{name:"lock",size:10}),D(k(wt("password")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=T=>me.password=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,me.password]])]),_:1}),es.value==="sftp"?(m(),nt(Ee,{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:Te(()=>[Ht("privateKey")?(m(),v("span",Bg,[D(k(At("privateKey").effective||"—")+" ",1),wt("privateKey")?(m(),v("span",Vg,[z(Q,{name:"lock",size:10}),D(k(wt("privateKey")),1)])):F("",!0)])):oe((m(),v("textarea",{key:1,"onUpdate:modelValue":f[27]||(f[27]=T=>me.privateKey=T),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ye,me.privateKey]])]),_:1})):F("",!0),es.value==="sftp"?(m(),nt(Ee,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:Te(()=>[Ht("keyPassphrase")?(m(),v("span",Ug,[D(k(At("keyPassphrase").effective||"—")+" ",1),wt("keyPassphrase")?(m(),v("span",Zg,[z(Q,{name:"lock",size:10}),D(k(wt("keyPassphrase")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[28]||(f[28]=T=>me.keyPassphrase=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,me.keyPassphrase]])]),_:1})):F("",!0),es.value==="sftp"?(m(),nt(Ee,{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:Te(()=>[Ht("hostKeyFingerprint")?(m(),v("span",Hg,[D(k(At("hostKeyFingerprint").effective||"—")+" ",1),wt("hostKeyFingerprint")?(m(),v("span",jg,[z(Q,{name:"lock",size:10}),D(k(wt("hostKeyFingerprint")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=T=>me.hostKeyFingerprint=T),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ye,me.hostKeyFingerprint]])]),_:1})):F("",!0),es.value==="ftps"?(m(),nt(Ee,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:Te(()=>[Ht("insecureSkipVerify")?(m(),v("span",Wg,[D(k(At("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),wt("insecureSkipVerify")?(m(),v("span",Kg,[z(Q,{name:"lock",size:10}),D(k(wt("insecureSkipVerify")),1)])):F("",!0)])):(m(),nt(hn,{key:1,modelValue:me.insecureSkipVerify,"onUpdate:modelValue":f[30]||(f[30]=T=>me.insecureSkipVerify=T),options:di},null,8,["modelValue"]))]),_:1})):F("",!0),z(Ee,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:Te(()=>[Ht("basePath")?(m(),v("span",Gg,[D(k(At("basePath").effective||"—")+" ",1),wt("basePath")?(m(),v("span",qg,[z(Q,{name:"lock",size:10}),D(k(wt("basePath")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[31]||(f[31]=T=>me.basePath=T),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ye,me.basePath]])]),_:1}),r("div",Yg,[St.value?F("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:ft.value||!te.available,onClick:Ea},k(ft.value?"Saving…":Zt.value?"Save organization settings":"Save settings"),9,Jg)),Zt.value?F("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:gt.value||!te.available,onClick:Oa},k(gt.value?"Testing…":"Test connection"),9,Xg)),je.value?(m(),v("span",Qg,k(je.value),1)):F("",!0),Ct.value&&!Zt.value?(m(),v("span",ev,"Checked "+k(Ca()),1)):F("",!0),xt.value&&!Zt.value?(m(),v("span",{key:4,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",za(xt.value.status)])},[f[87]||(f[87]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(xt.value.detail||xt.value.status),1)],2)):F("",!0)])]),r("div",tv,[r("div",nv,[r("div",iv,[z(Q,{name:"cloud",size:20})]),f[88]||(f[88]=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))]),We.loaded&&!We.available?(m(),v("div",sv,[z(Q,{name:"lock",size:14,class:"mr-1 inline"}),f[89]||(f[89]=D(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):F("",!0),We.canEditOrg?(m(),v("div",ov,[f[90]||(f[90]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(hn,{modelValue:xe.value,"onUpdate:modelValue":f[32]||(f[32]=T=>xe.value=T),options:st},null,8,["modelValue"])])):F("",!0),rn.value?(m(),nt(Ee,{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:Te(()=>[z(sn,{"model-value":We.orgEnabled,disabled:!We.available,"onUpdate:modelValue":mi},null,8,["model-value","disabled"])]),_:1})):(m(),nt(Ee,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:Te(()=>[z(sn,{"model-value":We.enabled,disabled:!We.available||!We.orgEnabled,"onUpdate:modelValue":mi},null,8,["model-value","disabled"])]),_:1})),!rn.value&&We.available&&!We.orgEnabled?(m(),v("div",av,[z(Q,{name:"lock",size:13,class:"mr-1 inline"}),f[92]||(f[92]=D("WebDAV is turned off for your organization",-1)),We.canEditOrg?(m(),v("span",rv,[...f[91]||(f[91]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):F("",!0),f[93]||(f[93]=D(". ",-1))])):F("",!0),rn.value?(m(),v("div",lv,[z(Q,{name:"users",size:13,class:"mr-1 inline"}),f[94]||(f[94]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",uv,k(t.organizationName||"your organization"),1),f[95]||(f[95]=D(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):$s.value?(m(),v("div",cv," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):F("",!0),z(Ee,{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:Te(()=>[pi("baseURL")?(m(),v("span",dv,[D(k(yn("baseURL").effective||"—")+" ",1),jt("baseURL")?(m(),v("span",fv,[z(Q,{name:"lock",size:10}),D(k(jt("baseURL")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[33]||(f[33]=T=>$t.baseURL=T),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ye,$t.baseURL]])]),_:1}),z(Ee,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:Te(()=>[pi("username")?(m(),v("span",hv,[D(k(yn("username").effective||"—")+" ",1),jt("username")?(m(),v("span",pv,[z(Q,{name:"lock",size:10}),D(k(jt("username")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=T=>$t.username=T),class:"field w-64",placeholder:"user"},null,512)),[[ye,$t.username]])]),_:1}),z(Ee,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:Te(()=>[pi("password")?(m(),v("span",mv,[D(k(yn("password").effective||"—")+" ",1),jt("password")?(m(),v("span",gv,[z(Q,{name:"lock",size:10}),D(k(jt("password")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=T=>$t.password=T),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,$t.password]])]),_:1}),z(Ee,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:Te(()=>[pi("insecureSkipVerify")?(m(),v("span",vv,[D(k(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),jt("insecureSkipVerify")?(m(),v("span",_v,[z(Q,{name:"lock",size:10}),D(k(jt("insecureSkipVerify")),1)])):F("",!0)])):(m(),nt(hn,{key:1,modelValue:$t.insecureSkipVerify,"onUpdate:modelValue":f[36]||(f[36]=T=>$t.insecureSkipVerify=T),options:So},null,8,["modelValue"]))]),_:1}),z(Ee,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:Te(()=>[pi("basePath")?(m(),v("span",yv,[D(k(yn("basePath").effective||"—")+" ",1),jt("basePath")?(m(),v("span",bv,[z(Q,{name:"lock",size:10}),D(k(jt("basePath")),1)])):F("",!0)])):oe((m(),v("input",{key:1,"onUpdate:modelValue":f[37]||(f[37]=T=>$t.basePath=T),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ye,$t.basePath]])]),_:1}),r("div",xv,[$s.value?F("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:Oi.value||!We.available,onClick:Po},k(Oi.value?"Saving…":rn.value?"Save organization settings":"Save settings"),9,wv)),rn.value?F("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:hi.value||!We.available,onClick:Co},k(hi.value?"Testing…":"Test connection"),9,kv)),fi.value?(m(),v("span",Sv,k(fi.value),1)):F("",!0),tn.value&&!rn.value?(m(),v("span",Tv,"Checked "+k($a()),1)):F("",!0),an.value&&!rn.value?(m(),v("span",{key:4,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",zi(an.value.status)])},[f[96]||(f[96]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(an.value.detail||an.value.status),1)],2)):F("",!0)])])],64)):F("",!0),rs("drives-local")?(m(),v("div",Pv,[r("div",Cv,[r("div",Lv,[z(Q,{name:"monitor",size:20})]),f[97]||(f[97]=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))]),ie.loaded&&!ie.available?(m(),v("div",Mv,[z(Q,{name:"lock",size:14,class:"mr-1 inline"}),f[98]||(f[98]=D(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):ie.loaded&&!ie.rootConfigured?(m(),v("div",Ev,[z(Q,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[99]||(f[99]=D(" No storage root has been configured by your administrator yet. ",-1))])):F("",!0),ie.canEditOrg?(m(),v("div",Ov,[f[100]||(f[100]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),z(hn,{modelValue:ot.value,"onUpdate:modelValue":f[38]||(f[38]=T=>ot.value=T),options:st},null,8,["modelValue"])])):F("",!0),Tt.value?(m(),nt(Ee,{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:Te(()=>[z(sn,{"model-value":ie.orgEnabled,disabled:!ie.available,"onUpdate:modelValue":os},null,8,["model-value","disabled"])]),_:1})):(m(),nt(Ee,{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:Te(()=>[z(sn,{"model-value":ie.enabled,disabled:!ie.available||!ie.orgEnabled,"onUpdate:modelValue":os},null,8,["model-value","disabled"])]),_:1})),!Tt.value&&ie.available&&!ie.orgEnabled?(m(),v("div",zv,[z(Q,{name:"lock",size:13,class:"mr-1 inline"}),f[102]||(f[102]=D("Local storage is turned off for your organization",-1)),ie.canEditOrg?(m(),v("span",Av,[...f[101]||(f[101]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):F("",!0),f[103]||(f[103]=D(". ",-1))])):F("",!0),Tt.value?(m(),v("div",$v,[z(Q,{name:"users",size:13,class:"mr-1 inline"}),f[104]||(f[104]=D("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Iv,k(t.organizationName||"your organization"),1),f[105]||(f[105]=D(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Nt.value?(m(),v("div",Dv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):F("",!0),Tt.value?(m(),nt(Ee,{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:Te(()=>[z(sn,{"model-value":ie.allowPrivate,disabled:!ie.available,"onUpdate:modelValue":Lo},null,8,["model-value","disabled"])]),_:1})):F("",!0),Tt.value?F("",!0):(m(),v(ue,{key:9},[z(Ee,{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:Te(()=>[r("div",Nv,[(m(!0),v(ue,null,Ve(ie.mounts,T=>(m(),v("div",{key:T.id,class:"flex flex-wrap items-center gap-2"},[r("span",Rv,k(T.path),1),T.kind==="shared"?(m(),v("span",Fv,[z(Q,{name:"users",size:10}),f[106]||(f[106]=D("Shared with your organization",-1))])):(m(),v("span",Bv,[z(Q,{name:"lock",size:10}),f[107]||(f[107]=D("Private to you",-1))])),Wn.value[T.id]?(m(),v("span",{key:2,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",Ue(Wn.value[T.id].status)])},[f[108]||(f[108]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Wn.value[T.id].status),1)],2)):F("",!0)]))),128)),ie.mounts.length?F("",!0):(m(),v("div",Vv,k(ie.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),ie.isOrgUser&&ie.allowPrivate?(m(),nt(Ee,{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:Te(()=>[z(sn,{"model-value":ie.privateFolder,disabled:!ie.available||!ie.orgEnabled,"onUpdate:modelValue":as},null,8,["model-value","disabled"])]),_:1})):ie.isOrgUser&&!ie.allowPrivate?(m(),v("div",Uv,[z(Q,{name:"lock",size:13,class:"mr-1 inline"}),f[109]||(f[109]=D("Private folders are turned off by your organization. ",-1))])):F("",!0)],64)),z(Ee,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:Te(()=>[On("readOnly")?(m(),v("span",Zv,[D(k($i(vt("readOnly").effective))+" ",1),vi("readOnly")?(m(),v("span",Hv,[z(Q,{name:"lock",size:10}),D(k(vi("readOnly")),1)])):F("",!0)])):(m(),nt(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":f[39]||(f[39]=T=>jn.value=T),options:Ai},null,8,["modelValue"]))]),_:1}),r("div",jv,[Nt.value?F("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:bn.value||!ie.available,onClick:Us},k(bn.value?"Saving…":Tt.value?"Save organization settings":"Save settings"),9,Wv)),Tt.value?F("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:gi.value||!ie.available,onClick:Na},k(gi.value?"Testing…":"Test folder"),9,Kv)),ln.value?(m(),v("span",Gv,k(ln.value),1)):F("",!0),ut.value&&!Tt.value?(m(),v("span",qv,"Checked "+k(Fs()),1)):F("",!0),Ie.value&&!Tt.value?(m(),v("span",{key:4,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ue(Ie.value.status)])},[f[110]||(f[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ie.value.detail||Ie.value.status),1)],2)):F("",!0)])])):F("",!0)])):Y.id==="profile"?(m(),v("div",Yv,[z(Ee,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:Te(()=>[r("div",Jv,[Be(De).avatar?(m(),v("img",{key:0,src:Be(De).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,Xv)):(m(),v("div",Qv,k(Oo.value),1)),r("div",e_,[r("label",t_,[z(Q,{name:"upload",size:15,class:"mr-1.5 inline"}),f[111]||(f[111]=D("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Eo},null,32)]),Be(De).avatar?(m(),v("button",{key:0,class:"btn-ghost",onClick:Ra},"Remove")):F("",!0)])])]),_:1}),z(Ee,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:Te(()=>[oe(r("input",{"onUpdate:modelValue":f[40]||(f[40]=T=>Be(De).displayName=T),class:"field w-56",placeholder:"Jane O.",onBlur:f[41]||(f[41]=T=>Ye("Saved."))},null,544),[[ye,Be(De).displayName]])]),_:1}),z(Ee,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:Te(()=>[oe(r("textarea",{"onUpdate:modelValue":f[42]||(f[42]=T=>Be(De).bio=T),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[43]||(f[43]=T=>Ye("Saved."))},null,544),[[ye,Be(De).bio]]),r("div",n_,k((Be(De).bio||"").length)+"/240",1)]),_:1}),z(Ee,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:Te(()=>[z(sn,{modelValue:Be(De).showEmail,"onUpdate:modelValue":f[44]||(f[44]=T=>Be(De).showEmail=T)},null,8,["modelValue"])]),_:1})])):Y.id==="security"?(m(),v("div",i_,[z(Ee,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:Te(()=>[r("div",s_,[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Be(De).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[112]||(f[112]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Be(De).twoFactor?"Enabled":"Disabled"),1)],2),!Be(De).twoFactor&&!Kn.value?(m(),v("button",{key:0,class:"btn-accent",onClick:Ni},"Enable 2FA")):Be(De).twoFactor?(m(),v("button",{key:1,class:"btn-ghost",onClick:Fa},"Disable")):F("",!0)]),Kn.value?(m(),v("div",o_,[r("div",a_,[f[114]||(f[114]=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",r_,[f[113]||(f[113]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",l_,k(zo.value),1),r("div",u_,[oe(r("input",{"onUpdate:modelValue":f[45]||(f[45]=T=>Di.value=T),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ye,Di.value]]),r("button",{class:"btn-accent",onClick:Ao},"Verify & enable")]),Ke.value?(m(),v("p",c_,k(Ke.value),1)):F("",!0)])])])):F("",!0),Be(De).twoFactor&&ls.value.length?(m(),v("div",d_,[f[115]||(f[115]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[116]||(f[116]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",f_,[(m(!0),v(ue,null,Ve(ls.value,T=>(m(),v("span",{key:T,class:"select-all"},k(T),1))),128))])])):F("",!0),f[117]||(f[117]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),z(Ee,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:Te(()=>[r("div",h_,[r("div",p_,[r("div",m_,[z(Q,{name:"monitor",size:18})]),r("div",g_,[r("div",v_,[D(k(Ba())+" on "+k($o())+" ",1),f[118]||(f[118]=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",__,"Signed in "+k(Be(ru)(Be(Va))),1)]),r("button",{class:"btn-ghost",onClick:f[46]||(f[46]=T=>l("logout"))},"Log out")])]),f[119]||(f[119]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[120]||(f[120]=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})])):Y.id==="team"?(m(),v("div",y_,[Je.id?(m(),v("div",b_,[z(Ee,{block:"",title:`Edit user — ${Je.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:Te(()=>[r("div",x_,[r("div",w_,[oe(r("input",{"onUpdate:modelValue":f[47]||(f[47]=T=>Je.email=T),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ye,Je.email]]),oe(r("select",{"onUpdate:modelValue":f[48]||(f[48]=T=>Je.role=T),class:"field w-32",disabled:ds.value,title:ds.value?"You cannot change your own role":""},[(m(!0),v(ue,null,Ve(Zs.value,T=>(m(),v("option",{key:T.value,value:T.value},k(T.label),9,S_))),128))],8,k_),[[Ot,Je.role]])]),u.value?oe((m(),v("select",{key:0,"onUpdate:modelValue":f[49]||(f[49]=T=>Je.organization=T),class:"field",title:"Organization"},[(m(!0),v(ue,null,Ve(Io.value,T=>(m(),v("option",{key:T.value,value:T.value},k(T.label),9,T_))),128))],512)),[[Ot,Je.organization]]):F("",!0),oe(r("input",{"onUpdate:modelValue":f[50]||(f[50]=T=>Je.password=T),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ye,Je.password]]),r("label",P_,[z(sn,{modelValue:Je.verified,"onUpdate:modelValue":f[51]||(f[51]=T=>Je.verified=T)},null,8,["modelValue"]),f[121]||(f[121]=D(" Email verified ",-1))]),r("div",C_,[r("button",{class:"btn-accent",disabled:Vi.value,onClick:Ha},k(Vi.value?"Saving…":"Save changes"),9,L_),r("button",{class:"btn-ghost",onClick:$n},"Cancel"),An.value?(m(),v("span",M_,k(An.value),1)):F("",!0),ds.value?(m(),v("span",E_,"Editing your own account — role locked.")):F("",!0)])])]),_:1},8,["title"])])):(m(),v("div",O_,[z(Ee,{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:Te(()=>[r("div",z_,[r("div",A_,[oe(r("input",{"onUpdate:modelValue":f[52]||(f[52]=T=>ct.email=T),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ye,ct.email]]),oe(r("select",{"onUpdate:modelValue":f[53]||(f[53]=T=>ct.role=T),class:"field w-32"},[(m(!0),v(ue,null,Ve(Zs.value,T=>(m(),v("option",{key:T.value,value:T.value},k(T.label),9,$_))),128))],512),[[Ot,ct.role]])]),u.value?oe((m(),v("select",{key:0,"onUpdate:modelValue":f[54]||(f[54]=T=>ct.organization=T),class:"field",title:"Organization"},[(m(!0),v(ue,null,Ve(Io.value,T=>(m(),v("option",{key:T.value,value:T.value},k(T.label),9,I_))),128))],512)),[[Ot,ct.organization]]):(m(),v("div",D_,[f[122]||(f[122]=D(" New users join your organization: ",-1)),r("span",N_,k(t.organizationName||"—"),1)])),oe(r("input",{"onUpdate:modelValue":f[55]||(f[55]=T=>ct.password=T),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ye,ct.password]]),r("div",R_,[r("button",{class:"btn-accent",disabled:Ri.value,onClick:Ua},k(Ri.value?"Creating…":"Create user"),9,F_),bi.value?(m(),v("span",B_,k(bi.value),1)):F("",!0)])])]),_:1})])),r("div",V_,[r("div",U_,[f[123]||(f[123]=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:Gn.value,onClick:Yn},k(Gn.value?"Loading…":"Refresh"),9,Z_)]),cs.value?(m(),v("div",H_,k(cs.value),1)):!us.value.length&&!Gn.value?(m(),v("div",j_,"No users yet.")):(m(),v("div",W_,[r("table",K_,[r("thead",null,[r("tr",G_,[(m(),v(ue,null,Ve(["User","Role","Organization","Status",""],T=>r("th",{key:T,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(T),1)),64))])]),r("tbody",null,[(m(!0),v(ue,null,Ve(us.value,T=>(m(),v("tr",{key:T.id,class:Oe(["border-b border-line last:border-0",Je.id===T.id?"bg-accent-soft":""])},[r("td",q_,[r("span",Y_,k(T.email),1),T.email===t.email?(m(),v("span",J_,"(you)")):F("",!0)]),r("td",X_,[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(T.role||"user")])},[z(Q,{name:_(T.role||"user"),size:12},null,8,["name"]),D(k(h(T.role||"user")),1)],2)]),r("td",Q_,[r("span",{class:Oe(["text-sm",T.organizationName?"text-ink-secondary":"text-ink-muted"])},k(T.organizationName||"—"),3)]),r("td",ey,[r("span",{class:Oe(["text-xs",T.verified?"text-success-fg":"text-ink-muted"])},k(T.verified?"Verified":"Unverified"),3)]),r("td",ty,[Qt.value===T.id?(m(),v(ue,{key:0},[f[124]||(f[124]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[56]||(f[56]=Xe=>Qt.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=>Za(T)}," Remove ",8,ny)],64)):(m(),v("div",iy,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Xe=>fs(T)},[z(Q,{name:"settings",size:14}),f[125]||(f[125]=D(" Edit ",-1))],8,sy),T.email!==t.email?(m(),v("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Xe=>Qt.value=T.id},[z(Q,{name:"trash",size:14}),f[126]||(f[126]=D(" Remove ",-1))],8,oy)):F("",!0)]))])],2))),128))])])]))])])):Y.id==="organizations"?(m(),v("div",ay,[kn.id?(m(),v("div",ry,[z(Ee,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:Te(()=>[r("div",ly,[oe(r("input",{"onUpdate:modelValue":f[57]||(f[57]=T=>kn.name=T),class:"field",placeholder:"Organization name",onKeyup:Xl(No,["enter"])},null,544),[[ye,kn.name]]),r("div",uy,[r("button",{class:"btn-accent",onClick:No},"Save changes"),r("button",{class:"btn-ghost",onClick:Hs},"Cancel"),Sn.value?(m(),v("span",cy,k(Sn.value),1)):F("",!0)])])]),_:1})])):(m(),v("div",dy,[z(Ee,{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:Te(()=>[r("div",fy,[oe(r("input",{"onUpdate:modelValue":f[58]||(f[58]=T=>In.name=T),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Xl(Do,["enter"])},null,544),[[ye,In.name]]),r("div",hy,[r("button",{class:"btn-accent",disabled:Ui.value,onClick:Do},k(Ui.value?"Creating…":"Create organization"),9,py),Mt.value?(m(),v("span",my,k(Mt.value),1)):F("",!0)])])]),_:1})])),r("div",gy,[r("div",{class:"flex items-center justify-between px-5 py-4"},[f[127]||(f[127]=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:qn},"Refresh")]),Fi.value.length?(m(),v("div",_y,[r("table",yy,[r("thead",null,[r("tr",by,[(m(),v(ue,null,Ve(["Organization","Members",""],T=>r("th",{key:T,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(T),1)),64))])]),r("tbody",null,[(m(!0),v(ue,null,Ve(Fi.value,T=>(m(),v("tr",{key:T.id,class:Oe(["border-b border-line last:border-0",kn.id===T.id?"bg-accent-soft":""])},[r("td",xy,[r("span",wy,[z(Q,{name:"grid",size:14,class:"text-ink-muted"}),D(k(T.name),1)])]),r("td",ky,k(Zi.value[T.id]||0),1),r("td",Sy,[xi.value===T.id?(m(),v(ue,{key:0},[f[128]||(f[128]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[59]||(f[59]=Xe=>xi.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=>nn(T)}," Delete ",8,Ty)],64)):(m(),v("div",Py,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Xe=>ja(T)},[z(Q,{name:"settings",size:14}),f[129]||(f[129]=D(" Rename ",-1))],8,Cy),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Zi.value[T.id]||0)>0,title:(Zi.value[T.id]||0)>0?"Reassign or remove members first":"",onClick:Xe=>xi.value=T.id},[z(Q,{name:"trash",size:14}),f[130]||(f[130]=D(" Delete ",-1))],8,Ly)]))])],2))),128))])])])):(m(),v("div",vy,"No organizations yet."))])])):Y.id==="advanced"?(m(),v("div",My,[r("div",Ey,[z(Ee,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:Te(()=>[r("button",{class:"btn-ghost",onClick:wi},[z(Q,{name:"download",size:15,class:"mr-1.5 inline"}),f[131]||(f[131]=D("Export",-1))])]),_:1}),z(Ee,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:Te(()=>[r("label",Oy,[z(Q,{name:"upload",size:15,class:"mr-1.5 inline"}),f[132]||(f[132]=D("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Tn},null,32)]),hs.value?(m(),v("p",zy,k(hs.value),1)):F("",!0)]),_:1})]),r("div",Ay,[r("div",$y,[z(Q,{name:"alertTriangle",size:18}),f[133]||(f[133]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[138]||(f[138]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",Iy,[f[137]||(f[137]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",Dy,[oe(r("input",{"onUpdate:modelValue":f[60]||(f[60]=T=>pt.understand=T),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[da,pt.understand]]),f[134]||(f[134]=D(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",Ny,[r("label",Ry,[f[135]||(f[135]=D("Type ",-1)),r("span",Fy,k(js.value),1),f[136]||(f[136]=D(" to confirm",-1))]),oe(r("input",{"onUpdate:modelValue":f[61]||(f[61]=T=>pt.typed=T),class:"field w-full max-w-[360px] font-mono",placeholder:js.value},null,8,By),[[ye,pt.typed]])]),r("div",Vy,[pt.armed?(m(),v("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:pt.cooldown>0,onClick:ps},k(pt.cooldown>0?`Confirm in ${pt.cooldown}s…`:"Permanently delete account"),9,Zy)):(m(),v("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:!Jn.value,onClick:Ro}," Delete account… ",8,Uy)),pt.armed&&pt.cooldown>0?(m(),v("span",Hy,"Cooling-off period — read once more.")):F("",!0)]),pt.msg?(m(),v("p",jy,k(pt.msg),1)):F("",!0)])])])):F("",!0)],64))),128))])]),z(hh,{name:"fade"},{default:Te(()=>[_i.value?(m(),v("div",Wy,[z(Q,{name:"check",size:16,class:"text-success-fg"}),D(k(_i.value),1)])):F("",!0)]),_:1})]))}},Gy=dm(Ky,[["__scopeId","data-v-4fe25eb7"]]),qy={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Yy={class:"flex flex-wrap items-center gap-3"},Jy={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Xy=["onClick"],Qy={class:"ml-auto flex items-center gap-2"},e1=["href"],t1={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},n1={class:"eyebrow"},i1={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},s1={key:0,class:"panel p-5"},o1={class:"mb-4 flex items-center justify-between"},a1={class:"eyebrow"},r1={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},l1={class:"block"},u1={class:"block"},c1={class:"block"},d1={class:"block"},f1={key:0,value:""},h1=["value"],p1={class:"block"},m1={class:"block"},g1={class:"block"},v1={class:"block"},_1={class:"block"},y1=["value"],b1={class:"block"},x1=["value"],w1={class:"block"},k1=["value"],S1={class:"block"},T1={class:"mt-3 block"},P1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},C1={class:"block"},L1={class:"block"},M1={class:"block"},E1={class:"block"},O1={class:"col-span-2 block max-[760px]:col-span-1"},z1={class:"mt-4 flex items-center gap-3"},A1=["disabled"],$1={key:0,class:"text-sm text-danger-fg"},I1={class:"panel overflow-hidden p-0"},D1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},N1={key:1,class:"grid place-items-center px-5 py-16 text-center"},R1={key:2,class:"overflow-x-auto"},F1={class:"w-full border-collapse text-sm"},B1={class:"text-left"},V1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},U1={key:0,class:"text-ink-muted"},Z1={class:"px-5 py-3 text-ink-secondary"},H1=["title"],j1={class:"px-5 py-3 font-mono text-ink-secondary"},W1={class:"px-5 py-3 text-ink-secondary"},K1={class:"px-5 py-3"},G1=["onClick"],q1={class:"whitespace-nowrap px-5 py-3 text-right"},Y1=["onClick"],J1=["onClick"],X1=["onClick"],Q1={key:0,class:"border-b border-line bg-surface-2"},eb={colspan:"7",class:"px-5 py-3"},tb={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},nb={class:"text-ink-secondary"},ib={class:"text-ink"},sb={class:"text-ink-secondary"},ob={class:"text-ink"},ab={class:"text-ink-secondary"},rb={class:"font-mono text-ink"},lb={key:0,class:"text-ink-secondary"},ub={class:"text-ink"},cb={key:0,class:"mt-2 space-y-1"},db={key:1,class:"mt-2 text-xs text-success-fg"},fb={key:0,class:"panel p-5"},hb={class:"mb-4 flex items-center justify-between"},pb={class:"eyebrow"},mb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},gb={class:"block"},vb={class:"block"},_b={class:"block"},yb={class:"block"},bb={class:"block"},xb={class:"block"},wb=["value"],kb={class:"mt-3 flex flex-wrap gap-6"},Sb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Tb={class:"flex items-center gap-2 text-sm text-ink-secondary"},Pb={class:"mt-4 flex items-center gap-3"},Cb=["disabled"],Lb={key:0,class:"text-sm text-danger-fg"},Mb={class:"panel overflow-hidden p-0"},Eb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Ob={key:1,class:"grid place-items-center px-5 py-16 text-center"},zb={key:2,class:"overflow-x-auto"},Ab={class:"w-full border-collapse text-sm"},$b={class:"text-left"},Ib={class:"px-5 py-3 font-semibold text-ink"},Db={class:"px-5 py-3 text-ink-secondary"},Nb={class:"px-5 py-3 font-mono text-ink-secondary"},Rb={class:"px-5 py-3"},Fb={key:1,class:"text-ink-muted"},Bb={class:"px-5 py-3"},Vb={class:"whitespace-nowrap px-5 py-3 text-right"},Ub=["onClick"],Zb=["onClick"],Hb=["onClick"],jb={__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=K("flights"),u=K([]),d=K([]),h=K(!1),_=K("");async function y(){h.value=!0,_.value="";const[G,E]=await Promise.all([$c(),xp()]);(!G.ok||!E.ok)&&(_.value=G.status===503||E.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=G.drones,d.value=E.flights,h.value=!1}ui(y);function M(G){const E=G.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 S=K("");function O(G){S.value=S.value===G?"":G}const V=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],U=[{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"}],j=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function B(){var G;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((G=u.value[0])==null?void 0:G.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const he=K(!1),ae=K(""),q=_t(B()),we=K(""),de=K(!1),$e=K(!1);function ze(){Object.assign(q,B()),ae.value="",we.value="",$e.value=!1,he.value=!0}function ke(G){Object.assign(q,{operationDate:(G.operationDate||"").slice(0,10),startTime:G.startTime||"",endTime:G.endTime||"",drone:G.drone||"",areaRoute:G.areaRoute||"",maxAltitudeAgl:G.maxAltitudeAgl||"",pilotName:G.pilotName||"",certificateRef:G.certificateRef||"",category:G.category||"open",purpose:G.purpose||"commercial",loggingPath:G.loggingPath||"",rawFdrLogUrl:G.rawFdrLogUrl||"",authorisationRef:G.authorisationRef||"",weather:G.weather||"",airspaceRef:G.airspaceRef||"",observer:G.observer||"",incidents:G.incidents||"",notes:G.notes||""}),ae.value=G.id,we.value="",$e.value=!!(G.weather||G.airspaceRef||G.observer||G.incidents||G.notes),he.value=!0}function Ze(){he.value=!1,ae.value=""}async function ge(){var A;if(we.value="",!q.drone){we.value="Select a drone first (add one on the Drones tab).";return}de.value=!0;const G={...q,maxAltitudeAgl:Number(q.maxAltitudeAgl)||0},E=ae.value?await kp(ae.value,G):await wp(G);if(de.value=!1,!E.ok){we.value=((A=E.body)==null?void 0:A.error)||"Could not save the flight.";return}he.value=!1,await y()}const Ce=K("");async function _e(G){const E=await Sp(G.id);Ce.value="",E.ok&&await y()}const J=["","C0","C1","C2","C3","C4","C5","C6"];function le(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const Le=K(!1),Ne=K(""),ve=_t(le()),ce=K(""),se=K(!1);function tt(){Object.assign(ve,le()),Ne.value="",ce.value="",Le.value=!0}function pe(G){Object.assign(ve,{name:G.name||"",model:G.model||"",serial:G.serial||"",operatorNumber:G.operatorNumber||"",mtomGrams:G.mtomGrams||"",isToy:!!G.isToy,autologsFlights:!!G.autologsFlights,cClass:G.cClass||""}),Ne.value=G.id,ce.value="",Le.value=!0}function Se(){Le.value=!1,Ne.value=""}async function Ge(){var A;if(ce.value="",!ve.name.trim()){ce.value="Give the drone a name.";return}se.value=!0;const G={...ve,mtomGrams:Number(ve.mtomGrams)||0},E=Ne.value?await yp(Ne.value,G):await _p(G);if(se.value=!1,!E.ok){ce.value=((A=E.body)==null?void 0:A.error)||"Could not save the drone.";return}Le.value=!1,await y()}const et=K("");async function Qe(G){var A;const E=await bp(G.id);et.value="",E.ok?await y():ce.value=((A=E.body)==null?void 0:A.error)||"Could not delete the drone."}const Fe=Pe(()=>{const G=d.value.length,E=d.value.filter(st=>{var dt;return(((dt=st.compliance)==null?void 0:dt.redFlags)||[]).length}).length,A=d.value.filter(st=>{var dt;return(dt=st.compliance)==null?void 0:dt.required}).length;return{total:G,flagged:E,required:A,fleet:u.value.length}});return(G,E)=>(m(),v("div",qy,[r("div",Yy,[r("div",Jy,[(m(),v(ue,null,Ve([["flights","Flights"],["drones","Drones"]],A=>r("button",{key:A[0],class:Oe(["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:st=>l.value=A[0]},k(A[1]),11,Xy)),64))]),r("div",Qy,[r("a",{href:Be(Tp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[z(Q,{name:"download",size:15}),E[29]||(E[29]=D(" Export CSV ",-1))],8,e1),l.value==="flights"?(m(),v("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:ze},[z(Q,{name:"plus",size:15}),E[30]||(E[30]=D(" Log flight ",-1))])):(m(),v("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:tt},[z(Q,{name:"plus",size:15}),E[31]||(E[31]=D(" Add drone ",-1))]))])]),r("div",t1,[(m(!0),v(ue,null,Ve([{label:"Flights logged",value:Fe.value.total,tone:"neutral"},{label:"Require logbook",value:Fe.value.required,tone:"neutral"},{label:"Compliance flags",value:Fe.value.flagged,tone:Fe.value.flagged?"danger":"success"},{label:"Registered drones",value:Fe.value.fleet,tone:"neutral"}],A=>(m(),v("div",{key:A.label,class:"panel p-5"},[r("div",n1,k(A.label),1),r("div",{class:Oe(["mt-2 text-[30px] font-bold leading-none tracking-tightest",A.tone==="danger"?"text-danger-fg":A.tone==="success"?"text-success-fg":"text-ink"])},k(A.value),3)]))),128))]),_.value?(m(),v("div",i1,k(_.value),1)):F("",!0),l.value==="flights"?(m(),v(ue,{key:1},[he.value?(m(),v("div",s1,[r("div",o1,[r("div",null,[r("div",a1,k(ae.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:Ze},[z(Q,{name:"x",size:16})])]),r("div",r1,[r("label",l1,[E[33]||(E[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),oe(r("input",{"onUpdate:modelValue":E[0]||(E[0]=A=>q.operationDate=A),type:"date",class:"field"},null,512),[[ye,q.operationDate]])]),r("label",u1,[E[34]||(E[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),oe(r("input",{"onUpdate:modelValue":E[1]||(E[1]=A=>q.startTime=A),type:"time",class:"field"},null,512),[[ye,q.startTime]])]),r("label",c1,[E[35]||(E[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),oe(r("input",{"onUpdate:modelValue":E[2]||(E[2]=A=>q.endTime=A),type:"time",class:"field"},null,512),[[ye,q.endTime]])]),r("label",d1,[E[36]||(E[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),oe(r("select",{"onUpdate:modelValue":E[3]||(E[3]=A=>q.drone=A),class:"field"},[u.value.length?F("",!0):(m(),v("option",f1,"— add a drone first —")),(m(!0),v(ue,null,Ve(u.value,A=>(m(),v("option",{key:A.id,value:A.id},k(A.name)+k(A.model?` · ${A.model}`:""),9,h1))),128))],512),[[Ot,q.drone]])]),r("label",p1,[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=>q.maxAltitudeAgl=A),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ye,q.maxAltitudeAgl]])]),r("label",m1,[E[38]||(E[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),oe(r("input",{"onUpdate:modelValue":E[5]||(E[5]=A=>q.areaRoute=A),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ye,q.areaRoute]])]),r("label",g1,[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=>q.pilotName=A),class:"field",placeholder:"Full name"},null,512),[[ye,q.pilotName]])]),r("label",v1,[E[40]||(E[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),oe(r("input",{"onUpdate:modelValue":E[7]||(E[7]=A=>q.certificateRef=A),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ye,q.certificateRef]])]),r("label",_1,[E[41]||(E[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),oe(r("select",{"onUpdate:modelValue":E[8]||(E[8]=A=>q.loggingPath=A),class:"field"},[(m(),v(ue,null,Ve(j,A=>r("option",{key:A.value,value:A.value},k(A.label),9,y1)),64))],512),[[Ot,q.loggingPath]])]),r("label",b1,[E[42]||(E[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),oe(r("select",{"onUpdate:modelValue":E[9]||(E[9]=A=>q.category=A),class:"field"},[(m(),v(ue,null,Ve(V,A=>r("option",{key:A.value,value:A.value},k(A.label),9,x1)),64))],512),[[Ot,q.category]])]),r("label",w1,[E[43]||(E[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),oe(r("select",{"onUpdate:modelValue":E[10]||(E[10]=A=>q.purpose=A),class:"field"},[(m(),v(ue,null,Ve(U,A=>r("option",{key:A.value,value:A.value},k(A.label),9,k1)),64))],512),[[Ot,q.purpose]])]),r("label",S1,[E[44]||(E[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),oe(r("input",{"onUpdate:modelValue":E[11]||(E[11]=A=>q.authorisationRef=A),class:"field",placeholder:"Specific-category ref"},null,512),[[ye,q.authorisationRef]])])]),r("label",T1,[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=>q.rawFdrLogUrl=A),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ye,q.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:E[13]||(E[13]=A=>$e.value=!$e.value)},[z(Q,{name:$e.value?"x":"plus",size:14},null,8,["name"]),E[46]||(E[46]=D(" Operational details (weather, airspace, incidents) ",-1))]),$e.value?(m(),v("div",P1,[r("label",C1,[E[47]||(E[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),oe(r("input",{"onUpdate:modelValue":E[14]||(E[14]=A=>q.weather=A),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ye,q.weather]])]),r("label",L1,[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=>q.airspaceRef=A),class:"field"},null,512),[[ye,q.airspaceRef]])]),r("label",M1,[E[49]||(E[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),oe(r("input",{"onUpdate:modelValue":E[16]||(E[16]=A=>q.observer=A),class:"field"},null,512),[[ye,q.observer]])]),r("label",E1,[E[50]||(E[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),oe(r("input",{"onUpdate:modelValue":E[17]||(E[17]=A=>q.incidents=A),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ye,q.incidents]])]),r("label",O1,[E[51]||(E[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":E[18]||(E[18]=A=>q.notes=A),rows:"2",class:"field"},null,512),[[ye,q.notes]])])])):F("",!0),r("div",z1,[r("button",{class:"btn-accent",disabled:de.value,onClick:ge},k(de.value?"Saving…":ae.value?"Save changes":"Log flight"),9,A1),r("button",{class:"btn-ghost",onClick:Ze},"Cancel"),we.value?(m(),v("span",$1,k(we.value),1)):F("",!0)])])):F("",!0),r("div",I1,[h.value?(m(),v("div",D1,"Loading…")):d.value.length?(m(),v("div",R1,[r("table",F1,[r("thead",null,[r("tr",B1,[(m(),v(ue,null,Ve(["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"},k(A),1)),64))])]),r("tbody",null,[(m(!0),v(ue,null,Ve(d.value,A=>{var st,dt,bt,b;return m(),v(ue,{key:A.id},[r("tr",{class:Oe(["border-b border-line last:border-0",ae.value===A.id?"bg-accent-soft":""])},[r("td",V1,[D(k((A.operationDate||"").slice(0,10))+" ",1),A.startTime?(m(),v("span",U1,k(A.startTime),1)):F("",!0)]),r("td",Z1,k(A.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:A.areaRoute},k(A.areaRoute||"—"),9,H1),r("td",j1,k(A.maxAltitudeAgl?A.maxAltitudeAgl+" m":"—"),1),r("td",W1,k(A.pilotName||"—"),1),r("td",K1,[r("button",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[M(A).tone]]),onClick:g=>O(A.id)},[M(A).tone==="danger"?(m(),nt(Q,{key:0,name:"alertTriangle",size:12})):M(A).tone==="success"?(m(),nt(Q,{key:1,name:"check",size:12})):F("",!0),D(" "+k(M(A).label),1)],10,G1)]),r("td",q1,[Ce.value===A.id?(m(),v(ue,{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]=g=>Ce.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:g=>_e(A)},"Delete",8,Y1)],64)):(m(),v(ue,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:g=>ke(A)},[z(Q,{name:"sliders",size:13}),E[55]||(E[55]=D(" Edit",-1))],8,J1),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:g=>Ce.value=A.id},[z(Q,{name:"trash",size:13})],8,X1)],64))])],2),S.value===A.id?(m(),v("tr",Q1,[r("td",eb,[r("div",tb,[r("span",nb,[E[56]||(E[56]=D("Logging path: ",-1)),r("b",ib,k(((st=A.compliance)==null?void 0:st.loggingPath)||"—"),1)]),r("span",sb,[E[57]||(E[57]=D("Category: ",-1)),r("b",ob,k(A.category||"—"),1)]),r("span",ab,[E[58]||(E[58]=D("Retain until: ",-1)),r("b",rb,k((A.retentionUntil||"").slice(0,10)||"—"),1)]),(dt=A.compliance)!=null&&dt.exempt?(m(),v("span",lb,[E[59]||(E[59]=D("Exempt: ",-1)),r("b",ub,k(A.compliance.exemptReason),1)])):F("",!0)]),(((bt=A.compliance)==null?void 0:bt.redFlags)||[]).length?(m(),v("ul",cb,[(m(!0),v(ue,null,Ve(A.compliance.redFlags,(g,w)=>(m(),v("li",{key:w,class:"flex items-start gap-2 text-xs text-danger-fg"},[z(Q,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(g),1)]))),128))])):(b=A.compliance)!=null&&b.exempt?F("",!0):(m(),v("div",db,"No compliance gaps detected."))])])):F("",!0)],64)}),128))])])])):(m(),v("div",N1,[z(Q,{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)):(m(),v(ue,{key:2},[Le.value?(m(),v("div",fb,[r("div",hb,[r("div",null,[r("div",pb,k(Ne.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:Se},[z(Q,{name:"x",size:16})])]),r("div",mb,[r("label",gb,[E[61]||(E[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),oe(r("input",{"onUpdate:modelValue":E[20]||(E[20]=A=>ve.name=A),class:"field",placeholder:"Mavic-01"},null,512),[[ye,ve.name]])]),r("label",vb,[E[62]||(E[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),oe(r("input",{"onUpdate:modelValue":E[21]||(E[21]=A=>ve.model=A),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ye,ve.model]])]),r("label",_b,[E[63]||(E[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),oe(r("input",{"onUpdate:modelValue":E[22]||(E[22]=A=>ve.serial=A),class:"field"},null,512),[[ye,ve.serial]])]),r("label",yb,[E[64]||(E[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),oe(r("input",{"onUpdate:modelValue":E[23]||(E[23]=A=>ve.operatorNumber=A),class:"field",placeholder:"DNK…"},null,512),[[ye,ve.operatorNumber]])]),r("label",bb,[E[65]||(E[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),oe(r("input",{"onUpdate:modelValue":E[24]||(E[24]=A=>ve.mtomGrams=A),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ye,ve.mtomGrams]])]),r("label",xb,[E[66]||(E[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),oe(r("select",{"onUpdate:modelValue":E[25]||(E[25]=A=>ve.cClass=A),class:"field"},[(m(),v(ue,null,Ve(J,A=>r("option",{key:A,value:A},k(A||"— none —"),9,wb)),64))],512),[[Ot,ve.cClass]])])]),r("div",kb,[r("label",Sb,[oe(r("input",{"onUpdate:modelValue":E[26]||(E[26]=A=>ve.autologsFlights=A),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[da,ve.autologsFlights]]),E[67]||(E[67]=D(" Auto-logs flights (onboard FDR) ",-1))]),r("label",Tb,[oe(r("input",{"onUpdate:modelValue":E[27]||(E[27]=A=>ve.isToy=A),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[da,ve.isToy]]),E[68]||(E[68]=D(" Toy drone (logbook-exempt) ",-1))])]),r("div",Pb,[r("button",{class:"btn-accent",disabled:se.value,onClick:Ge},k(se.value?"Saving…":Ne.value?"Save changes":"Add drone"),9,Cb),r("button",{class:"btn-ghost",onClick:Se},"Cancel"),ce.value?(m(),v("span",Lb,k(ce.value),1)):F("",!0)])])):F("",!0),r("div",Mb,[h.value?(m(),v("div",Eb,"Loading…")):u.value.length?(m(),v("div",zb,[r("table",Ab,[r("thead",null,[r("tr",$b,[(m(),v(ue,null,Ve(["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"},k(A),1)),64))])]),r("tbody",null,[(m(!0),v(ue,null,Ve(u.value,A=>(m(),v("tr",{key:A.id,class:Oe(["border-b border-line last:border-0",Ne.value===A.id?"bg-accent-soft":""])},[r("td",Ib,k(A.name),1),r("td",Db,k(A.model||"—"),1),r("td",Nb,k(A.mtomGrams?A.mtomGrams+" g":"—"),1),r("td",Rb,[A.cClass?(m(),v("span",{key:0,class:Oe(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},k(A.cClass),3)):(m(),v("span",Fb,"—")),A.isToy?(m(),v("span",{key:2,class:Oe(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):F("",!0)]),r("td",Bb,[r("span",{class:Oe(["text-xs",A.autologsFlights?"text-success-fg":"text-ink-muted"])},k(A.autologsFlights?"yes":"no"),3)]),r("td",Vb,[et.value===A.id?(m(),v(ue,{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]=st=>et.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:st=>Qe(A)},"Delete",8,Ub)],64)):(m(),v(ue,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:st=>pe(A)},[z(Q,{name:"sliders",size:13}),E[72]||(E[72]=D(" Edit",-1))],8,Zb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:st=>et.value=A.id},[z(Q,{name:"trash",size:13})],8,Hb)],64))])],2))),128))])])])):(m(),v("div",Ob,[z(Q,{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))]))}},Wb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Kb={class:"flex flex-wrap items-center gap-3"},Gb={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},qb=["onClick"],Yb={class:"ml-auto"},Jb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Xb={class:"eyebrow"},Qb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},ex={key:1,class:"panel p-5"},tx={class:"mb-4 flex items-center justify-between"},nx={class:"eyebrow"},ix={class:"mt-0.5 text-base font-semibold text-ink"},sx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},ox={class:"col-span-2 block max-[760px]:col-span-1"},ax={class:"block"},rx=["value"],lx={class:"block"},ux=["value"],cx={class:"block"},dx=["value"],fx={class:"block"},hx={class:"block"},px={class:"block"},mx={class:"block"},gx=["value"],vx={class:"block"},_x={class:"block"},yx={class:"block"},bx=["value"],xx={class:"mt-3 block"},wx={key:0,class:"mt-3"},kx={class:"eyebrow mb-1 block"},Sx={key:1,class:"mt-3 text-xs text-ink-muted"},Tx={class:"mt-4 flex items-center gap-3"},Px=["disabled"],Cx={key:0,class:"text-sm text-danger-fg"},Lx={class:"panel overflow-hidden p-0"},Mx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Ex={key:1,class:"grid place-items-center px-5 py-16 text-center"},Ox={class:"mt-3 text-sm font-medium text-ink-secondary"},zx={class:"mt-1 text-xs text-ink-muted"},Ax={key:2,class:"overflow-x-auto"},$x={class:"w-full border-collapse text-sm"},Ix={class:"text-left"},Dx={class:"px-5 py-3"},Nx={class:"font-semibold text-ink"},Rx={key:0,class:"font-mono text-[11px] text-ink-muted"},Fx={class:"px-5 py-3 text-ink-secondary"},Bx={class:"px-5 py-3 text-ink-secondary"},Vx={class:"px-5 py-3"},Ux=["onClick"],Zx={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Hx={class:"px-5 py-3 font-mono text-ink-secondary"},jx={class:"whitespace-nowrap px-5 py-3 text-right"},Wx=["onClick"],Kx=["onClick"],Gx=["href"],qx=["onClick"],Yx=["onClick"],Jx=["onClick"],Xx={key:0,class:"border-b border-line bg-surface-2"},Qx={colspan:"6",class:"px-5 py-3"},e0={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},t0={class:"text-ink-secondary"},n0={class:"text-ink"},i0={class:"text-ink-secondary"},s0={class:"text-ink"},o0={key:0,class:"text-ink-secondary"},a0={class:"text-ink"},r0={key:1,class:"text-ink-secondary"},l0={class:"font-mono text-ink"},u0={key:2,class:"text-ink-secondary"},c0={class:"font-mono text-ink"},d0={class:"text-ink-secondary"},f0={class:"text-ink"},h0={key:0,class:"mt-2 space-y-1"},p0={key:1,class:"mt-2 text-xs text-success-fg"},m0={key:2,class:"mt-2 text-xs text-ink-secondary"},g0={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},v0={class:"flex items-center gap-3 border-b border-line px-5 py-3"},_0={class:"min-w-0"},y0={class:"truncate text-sm font-semibold text-ink"},b0={class:"truncate font-mono text-[11px] text-ink-muted"},x0={class:"ml-auto flex items-center gap-2"},w0=["href"],k0=["href"],S0={class:"flex-1 overflow-auto bg-surface-2"},T0=["src","alt"],P0=["src","title"],C0={key:2,class:"grid place-items-center px-6 py-16 text-center"},L0={class:"mt-1 text-xs text-ink-muted"},M0=["href"],E0={__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"}],_=K([]),y=K([]),M=K(!1),S=K("");async function O(){M.value=!0,S.value="";const[b,g]=await Promise.all([Pp(),$c()]);b.ok||(S.value=b.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=b.documents,y.value=g.drones||[],M.value=!1}ui(O);const V=K("all"),U=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],j=Pe(()=>{const b=_.value;switch(V.value){case"expiring":return b.filter(g=>{var w;return((w=g.expiry)==null?void 0:w.state)==="expiring_soon"&&g.status!=="archived"});case"expired":return b.filter(g=>{var w;return((w=g.expiry)==null?void 0:w.state)==="expired"&&g.status!=="archived"});case"pending":return b.filter(g=>g.status==="pending_review");case"archived":return b.filter(g=>g.status==="archived");default:return b.filter(g=>g.status!=="archived")}});function B(b){if(b.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const g=b.expiry||{};return g.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:g.state==="expiring_soon"?{tone:"warning",label:`Expires in ${g.daysUntilExpiry}d`,icon:"clock"}:g.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const he=K("");function ae(b){he.value=he.value===b?"":b}function q(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 we=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],de=["pdf","txt","csv","log","json","md","html","htm","xml"];function $e(b){const g=(b||"").split(".").pop().toLowerCase();return we.includes(g)?"image":de.includes(g)?"frame":"none"}const ze=K(null),ke=Pe(()=>ze.value?$e(ze.value.fileName):"none"),Ze=Pe(()=>ze.value?Ep(ze.value.id):"");function ge(b){ze.value=b}function Ce(){ze.value=null}function _e(b){b.key==="Escape"&&ze.value&&Ce()}ui(()=>window.addEventListener("keydown",_e)),Os(()=>window.removeEventListener("keydown",_e));function J(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const le=K(!1),Le=K(""),Ne=K(""),ve=K(""),ce=_t(J()),se=K(null),tt=K(null),pe=K(""),Se=K(!1);function Ge(){se.value=null,tt.value&&(tt.value.value="")}function et(){Object.assign(ce,J()),Le.value="",Ne.value="",ve.value="",Ge(),pe.value="",le.value=!0}function Qe(b){Object.assign(ce,{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||""}),Le.value=b.id,Ne.value="",ve.value="",Ge(),pe.value="",le.value=!0}function Fe(b){Qe(b),Le.value="",Ne.value=b.id,ve.value=b.title,ce.status="active"}function G(){le.value=!1,Le.value="",Ne.value=""}function E(b){var g;se.value=((g=b.target.files)==null?void 0:g[0])||null}async function A(){var g;if(pe.value="",!ce.title.trim()){pe.value="Give the document a title.";return}Se.value=!0;let b;if(Le.value)b=await Lp(Le.value,{...ce});else{const w={...ce};Ne.value&&(w.replaces=Ne.value),b=await Cp(w,se.value)}if(Se.value=!1,!b.ok){pe.value=((g=b.body)==null?void 0:g.error)||"Could not save the document.";return}le.value=!1,Le.value="",Ne.value="",await O()}const st=K("");async function dt(b){var w;const g=await Mp(b.id);st.value="",g.ok?await O():pe.value=((w=g.body)==null?void 0:w.error)||"Could not delete the document."}const bt=Pe(()=>{const b=_.value.filter(g=>g.status!=="archived");return{total:b.length,expiring:b.filter(g=>{var w;return((w=g.expiry)==null?void 0:w.state)==="expiring_soon"}).length,expired:b.filter(g=>{var w;return((w=g.expiry)==null?void 0:w.state)==="expired"}).length,pending:_.value.filter(g=>g.status==="pending_review").length}});return(b,g)=>(m(),v("div",Wb,[r("div",Kb,[r("div",Gb,[(m(),v(ue,null,Ve(U,w=>r("button",{key:w[0],class:Oe(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",V.value===w[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:W=>V.value=w[0]},k(w[1]),11,qb)),64))]),r("div",Yb,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:et},[z(Q,{name:"upload",size:15}),g[13]||(g[13]=D(" Add document ",-1))])])]),r("div",Jb,[(m(!0),v(ue,null,Ve([{label:"Documents on file",value:bt.value.total,tone:"neutral"},{label:"Expiring soon",value:bt.value.expiring,tone:bt.value.expiring?"warning":"neutral"},{label:"Expired",value:bt.value.expired,tone:bt.value.expired?"danger":"success"},{label:"Pending review",value:bt.value.pending,tone:bt.value.pending?"accent":"neutral"}],w=>(m(),v("div",{key:w.label,class:"panel p-5"},[r("div",Xb,k(w.label),1),r("div",{class:Oe(["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))]),S.value?(m(),v("div",Qb,k(S.value),1)):F("",!0),le.value?(m(),v("div",ex,[r("div",tx,[r("div",null,[r("div",nx,k(Le.value?"Edit document":Ne.value?"New version":"New document"),1),r("div",ix,k(Ne.value?`Supersedes “${ve.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:G},[z(Q,{name:"x",size:16})])]),r("div",sx,[r("label",ox,[g[14]||(g[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),oe(r("input",{"onUpdate:modelValue":g[0]||(g[0]=w=>ce.title=w),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ye,ce.title]])]),r("label",ax,[g[15]||(g[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),oe(r("select",{"onUpdate:modelValue":g[1]||(g[1]=w=>ce.docType=w),class:"field"},[(m(),v(ue,null,Ve(o,w=>r("option",{key:w.value,value:w.value},k(w.label),9,rx)),64))],512),[[Ot,ce.docType]])]),r("label",lx,[g[16]||(g[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),oe(r("select",{"onUpdate:modelValue":g[2]||(g[2]=w=>ce.ownerType=w),class:"field"},[(m(),v(ue,null,Ve(u,w=>r("option",{key:w.value,value:w.value},k(w.label),9,ux)),64))],512),[[Ot,ce.ownerType]])]),r("label",cx,[g[18]||(g[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),oe(r("select",{"onUpdate:modelValue":g[3]||(g[3]=w=>ce.ownerDrone=w),class:"field"},[g[17]||(g[17]=r("option",{value:""},"— none —",-1)),(m(!0),v(ue,null,Ve(y.value,w=>(m(),v("option",{key:w.id,value:w.id},k(w.name)+k(w.model?` · ${w.model}`:""),9,dx))),128))],512),[[Ot,ce.ownerDrone]])]),r("label",fx,[g[19]||(g[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),oe(r("input",{"onUpdate:modelValue":g[4]||(g[4]=w=>ce.ownerRef=w),class:"field",placeholder:"Client name / serial / site"},null,512),[[ye,ce.ownerRef]])]),r("label",hx,[g[20]||(g[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),oe(r("input",{"onUpdate:modelValue":g[5]||(g[5]=w=>ce.reference=w),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ye,ce.reference]])]),r("label",px,[g[21]||(g[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),oe(r("input",{"onUpdate:modelValue":g[6]||(g[6]=w=>ce.jurisdiction=w),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ye,ce.jurisdiction]])]),r("label",mx,[g[22]||(g[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),oe(r("select",{"onUpdate:modelValue":g[7]||(g[7]=w=>ce.accessTier=w),class:"field"},[(m(),v(ue,null,Ve(h,w=>r("option",{key:w.value,value:w.value},k(w.label),9,gx)),64))],512),[[Ot,ce.accessTier]])]),r("label",vx,[g[23]||(g[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),oe(r("input",{"onUpdate:modelValue":g[8]||(g[8]=w=>ce.issueDate=w),type:"date",class:"field"},null,512),[[ye,ce.issueDate]])]),r("label",_x,[g[24]||(g[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),oe(r("input",{"onUpdate:modelValue":g[9]||(g[9]=w=>ce.expiryDate=w),type:"date",class:"field"},null,512),[[ye,ce.expiryDate]])]),r("label",yx,[g[25]||(g[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),oe(r("select",{"onUpdate:modelValue":g[10]||(g[10]=w=>ce.status=w),class:"field"},[(m(),v(ue,null,Ve(d,w=>r("option",{key:w.value,value:w.value},k(w.label),9,bx)),64))],512),[[Ot,ce.status]])])]),r("label",xx,[g[26]||(g[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(r("textarea",{"onUpdate:modelValue":g[11]||(g[11]=w=>ce.notes=w),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ye,ce.notes]])]),Le.value?(m(),v("div",Sx,[...g[28]||(g[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)])])):(m(),v("div",wx,[r("span",kx,"File "+k(Ne.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:tt,type:"file",class:"field",onChange:E},null,544),g[27]||(g[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",Tx,[r("button",{class:"btn-accent",disabled:Se.value,onClick:A},k(Se.value?"Saving…":Le.value?"Save changes":Ne.value?"Upload new version":"Add document"),9,Px),r("button",{class:"btn-ghost",onClick:G},"Cancel"),pe.value?(m(),v("span",Cx,k(pe.value),1)):F("",!0)])])):F("",!0),r("div",Lx,[M.value?(m(),v("div",Mx,"Loading…")):j.value.length?(m(),v("div",Ax,[r("table",$x,[r("thead",null,[r("tr",Ix,[(m(),v(ue,null,Ve(["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,[(m(!0),v(ue,null,Ve(j.value,w=>{var W,H;return m(),v(ue,{key:w.id},[r("tr",{class:Oe(["border-b border-line last:border-0",Le.value===w.id?"bg-accent-soft":""])},[r("td",Dx,[r("div",Nx,k(w.title),1),w.reference?(m(),v("div",Rx,k(w.reference),1)):F("",!0)]),r("td",Fx,k(Be(l)[w.docType]||w.docType||"—"),1),r("td",Bx,k(q(w)),1),r("td",Vx,[r("button",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[B(w).tone]]),onClick:Z=>ae(w.id)},[B(w).icon?(m(),nt(Q,{key:0,name:B(w).icon,size:12},null,8,["name"])):F("",!0),D(" "+k(B(w).label),1)],10,Ux),w.expiryDate?(m(),v("div",Zx,k(w.expiryDate),1)):F("",!0)]),r("td",Hx,"v"+k(w.version||1),1),r("td",jx,[st.value===w.id?(m(),v(ue,{key:0},[g[29]||(g[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:g[12]||(g[12]=Z=>st.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=>dt(w)},"Delete",8,Wx)],64)):(m(),v(ue,{key:1},[w.hasFile?(m(),v("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:Z=>ge(w)},[z(Q,{name:"eye",size:13})],8,Kx)):F("",!0),w.hasFile?(m(),v("a",{key:1,href:Be(lr)(w.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[z(Q,{name:"download",size:13})],8,Gx)):F("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:Z=>Fe(w)},[z(Q,{name:"upload",size:13})],8,qx),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:Z=>Qe(w)},[z(Q,{name:"sliders",size:13}),g[30]||(g[30]=D(" Edit",-1))],8,Yx),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:Z=>st.value=w.id},[z(Q,{name:"trash",size:13})],8,Jx)],64))])],2),he.value===w.id?(m(),v("tr",Xx,[r("td",Qx,[r("div",e0,[r("span",t0,[g[31]||(g[31]=D("Status: ",-1)),r("b",n0,k(w.status||"—"),1)]),r("span",i0,[g[32]||(g[32]=D("Access: ",-1)),r("b",s0,k(w.accessTier||"—"),1)]),w.jurisdiction?(m(),v("span",o0,[g[33]||(g[33]=D("Jurisdiction: ",-1)),r("b",a0,k(w.jurisdiction),1)])):F("",!0),w.issueDate?(m(),v("span",r0,[g[34]||(g[34]=D("Issued: ",-1)),r("b",l0,k(w.issueDate),1)])):F("",!0),w.expiryDate?(m(),v("span",u0,[g[35]||(g[35]=D("Expires: ",-1)),r("b",c0,k(w.expiryDate),1)])):F("",!0),r("span",d0,[g[36]||(g[36]=D("File: ",-1)),r("b",f0,k(w.hasFile?w.fileName:"none"),1)])]),(((W=w.expiry)==null?void 0:W.flags)||[]).length?(m(),v("ul",h0,[(m(!0),v(ue,null,Ve(w.expiry.flags,(Z,ee)=>(m(),v("li",{key:ee,class:Oe(["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(Q,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(Z),1)],2))),128))])):((H=w.expiry)==null?void 0:H.state)==="valid"?(m(),v("div",p0,"In force — no action needed.")):F("",!0),w.notes?(m(),v("div",m0,[g[37]||(g[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),D(" "+k(w.notes),1)])):F("",!0)])])):F("",!0)],64)}),128))])])])):(m(),v("div",Ex,[z(Q,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",Ox,k(V.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",zx,k(V.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(m(),nt(af,{to:"body"},[ze.value?(m(),v("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:Vr(Ce,["self"])},[r("div",g0,[r("div",v0,[r("div",_0,[r("div",y0,k(ze.value.title),1),r("div",b0,k(ze.value.fileName),1)]),r("div",x0,[r("a",{href:Ze.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[z(Q,{name:"globe",size:14}),g[38]||(g[38]=D(" New tab ",-1))],8,w0),r("a",{href:Be(lr)(ze.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[z(Q,{name:"download",size:14}),g[39]||(g[39]=D(" Download ",-1))],8,k0),r("button",{class:"btn-icon",title:"Close",onClick:Ce},[z(Q,{name:"x",size:16})])])]),r("div",S0,[ke.value==="image"?(m(),v("img",{key:0,src:Ze.value,alt:ze.value.title,class:"mx-auto block max-w-full"},null,8,T0)):ke.value==="frame"?(m(),v("iframe",{key:1,src:Ze.value,class:"h-[74vh] w-full border-0 bg-white",title:ze.value.title},null,8,P0)):(m(),v("div",C0,[z(Q,{name:"fileText",size:28,class:"text-ink-muted"}),g[41]||(g[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",L0,k(ze.value.fileName),1),r("a",{href:Be(lr)(ze.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[z(Q,{name:"download",size:15}),g[40]||(g[40]=D(" Download instead ",-1))],8,M0)]))])])])):F("",!0)]))]))}},O0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},z0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},A0={class:"flex items-center gap-2.5 px-2 pb-5"},$0={class:"flex flex-col gap-0.5"},I0=["onClick"],D0={class:"mt-auto flex flex-col gap-2.5"},N0={class:"rounded-lg bg-surface-2 p-3"},R0={class:"flex items-center gap-2"},F0={class:"text-xs font-semibold text-ink"},B0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},V0={class:"flex items-center gap-2.5 px-2 py-1"},U0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},Z0={class:"min-w-0 flex-1"},H0={class:"truncate text-[13px] font-semibold text-ink"},j0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},W0=["title"],K0={class:"overflow-y-auto"},G0={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)"}},q0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},Y0={class:"ml-auto flex items-center gap-3"},J0={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},X0={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Q0={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},ew={class:"flex items-center justify-between"},tw={class:"eyebrow"},nw={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},iw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},sw={class:"panel p-5"},ow={class:"mb-3.5 flex items-center justify-between"},aw={class:"flex items-center gap-2"},rw={key:0,class:"mt-2.5 text-xs text-ink-muted"},lw={key:1,class:"mt-2.5 text-xs text-ink-muted"},uw={class:"panel p-5"},cw={class:"mb-3.5 flex items-center justify-between"},dw={class:"grid place-items-center py-10 text-center"},fw={class:"panel overflow-hidden p-0"},hw={class:"flex items-center justify-between px-5 py-4"},pw={class:"flex gap-2"},mw={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},gw={key:1,class:"overflow-x-auto"},vw={class:"w-full border-collapse text-sm"},_w={class:"text-left"},yw=["onClick"],bw={class:"px-5 py-3 font-mono font-bold text-ink"},xw={class:"px-5 py-3 text-ink-secondary"},ww={class:"px-5 py-3"},kw={class:"px-5 py-3 font-mono text-ink-secondary"},Sw={class:"px-5 py-3"},Tw={key:0,class:"flex items-center gap-2"},Pw={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},Cw={class:"font-mono text-xs text-ink-secondary"},Lw={key:1,class:"font-mono text-xs text-ink-muted"},Mw={class:"px-5 py-3 font-mono text-ink-secondary"},Ew={class:"px-5 py-3 text-right"},Ow=["onClick"],zw={key:1,class:"p-7"},Aw={class:"mb-4 flex flex-wrap items-center gap-3"},$w={class:"font-mono text-mode font-bold text-ink"},Iw={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"},Dw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},Nw=["onClick"],Rw={key:0,class:"panel grid place-items-center p-16 text-center"},Fw={class:"pill"},Bw={class:"pill"},Vw={class:"pill"},Uw={class:"mt-1 text-sm font-semibold text-ink"},Zw={class:"pill"},Hw={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},jw={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},Ww={class:"panel p-4"},Kw={class:"flex items-center gap-4"},Gw={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},qw={class:"readout"},Yw={class:"panel p-4"},Jw={class:"readout"},Xw={class:"panel p-4"},Qw={class:"space-y-1.5 text-sm"},ek={class:"flex justify-between"},tk={class:"text-ink"},nk={class:"flex justify-between"},ik={class:"text-ink"},sk={class:"flex justify-between"},ok={class:"font-mono tabular text-ink"},ak={class:"flex justify-between"},rk={class:"font-mono tabular text-ink"},lk={class:"panel p-4"},uk={class:"space-y-1.5 text-sm"},ck={class:"flex justify-between"},dk={class:"font-mono tabular text-ink"},fk={class:"flex justify-between"},hk={class:"font-mono tabular text-ink"},pk={class:"flex justify-between"},mk={class:"font-mono tabular text-ink"},gk={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},vk={class:"panel p-4"},_k={class:"flex flex-wrap gap-2"},yk={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},bk={class:"panel p-4"},xk={class:"h-[180px] overflow-y-auto font-mono text-xs"},wk={class:"text-ink-muted"},kk={class:"font-semibold text-accent"},Sk={class:"break-all text-ink"},Tk={key:5,class:"p-7"},Pk={class:"panel grid place-items-center p-16 text-center"},Ck={class:"mt-3 text-sm font-medium text-ink-secondary"},Lk={key:0,class:"mt-1 text-xs text-ink-muted"},Mk={key:1,class:"mt-1 text-xs text-ink-muted"},Ek={__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=_t({}),d=_t({}),h=K(null),_=K(!1),y=_t([]),M=K(""),S=K([]),O=_t({unavailable:!1,detail:"",loaded:!1}),V=Pe(()=>S.value.filter(I=>!I.onGround).length);let U=null;async function j(){const{states:I,unavailable:C,detail:N}=await dp();S.value=I,O.unavailable=C,O.detail=N,O.loaded=!0}function B(){U||(j(),U=setInterval(()=>{ae.value==="Overview"&&j()},3e4))}function he(){U&&clearInterval(U),U=null}const ae=K("Overview"),q=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],we=Pe(()=>(q.find(([,I])=>I===ae.value)||["grid"])[0]),de=K(""),$e=K(""),ze=K("");let ke=null,Ze=null,ge=!1;const Ce=Pe(()=>Object.keys(u).sort((I,C)=>(u[C].online?1:0)-(u[I].online?1:0)||I.localeCompare(C))),_e=Pe(()=>h.value?u[h.value]:null),J=Pe(()=>_e.value&&_e.value.telemetry||{}),le=Pe(()=>!!(_e.value&&_e.value.online)),Le=Pe(()=>{const I=J.value;return typeof I.latitude=="number"&&typeof I.longitude=="number"&&(I.latitude||I.longitude)?{lat:I.latitude,lng:I.longitude}:null}),Ne=Pe(()=>h.value&&d[h.value]||[]),ve=Pe(()=>{const I=J.value;return typeof I.velocityX=="number"&&typeof I.velocityY=="number"?Math.hypot(I.velocityX,I.velocityY):null});function ce(I){return I.online?I.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function se(I){const C=I&&I.telemetry||{};return typeof C.velocityX=="number"&&typeof C.velocityY=="number"?Math.hypot(C.velocityX,C.velocityY):null}const tt=Pe(()=>Ce.value.map(I=>{const C=u[I],N=C.telemetry||{},[be,re]=ce(C);return{id:I,mission:C.model||(C.connected?"Drone linked":C.online?"App online":"No signal"),status:be,tone:re,alt:typeof N.altitude=="number"?N.altitude.toFixed(0)+" m":"—",battery:typeof N.batteryPercent=="number"?N.batteryPercent:null,speed:se(C)}})),pe=Pe(()=>Ce.value.filter(I=>u[I].online).length),Se=Pe(()=>Ce.value.filter(I=>u[I].online&&u[I].connected).length),Ge=Pe(()=>Ce.value.filter(I=>!u[I].online).length),et=Pe(()=>{const I=Ce.value.map(C=>{var N;return(N=u[C].telemetry)==null?void 0:N.batteryPercent}).filter(C=>typeof C=="number");return I.length?Math.round(I.reduce((C,N)=>C+N,0)/I.length):null}),Qe=Pe(()=>[{label:"Active flights",value:String(Se.value),delta:`${pe.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:et.value==null?"—":et.value+"%",delta:et.value==null?"no telemetry":et.value<40?"low — watch":"nominal",tone:et.value!=null&&et.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(Ce.value.length),delta:`${Se.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Ge.value),delta:Ge.value?"needs attention":"all reachable",tone:Ge.value?"warning":"success",icon:"signal"}]),Fe={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"},G={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},E=Pe(()=>{var N,be,re;const C=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((N=C[0])==null?void 0:N[0])||"P")+(((be=C[1])==null?void 0:be[0])||((re=C[0])==null?void 0:re[1])||"V")).toUpperCase()}),A={superadmin:"Superadmin",admin:"Admin",user:"Operator"},st=Pe(()=>A[o.role]||"Operator"),dt=Pe(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function bt(I){var N;u[I.deviceId]=I;const C=I.telemetry||{};typeof C.latitude=="number"&&typeof C.longitude=="number"&&(C.latitude||C.longitude)&&(d[I.deviceId]||(d[I.deviceId]=[]),d[I.deviceId].push([C.latitude,C.longitude]),d[I.deviceId].length>1e3&&d[I.deviceId].shift()),(!h.value||I.online&&!((N=u[h.value])!=null&&N.online))&&(h.value=I.deviceId)}function b(I){delete u[I],delete d[I],h.value===I&&(h.value=Ce.value[0]||null)}function g(I){y.unshift({t:au(Date.now()),tag:I.type||"?",text:JSON.stringify(w(I))}),y.length>200&&y.pop()}function w(I){const C={...I};return delete C.type,C}function W(){const I=location.protocol==="https:"?"wss":"ws";ke=new WebSocket(`${I}://${location.host}/bff/ws`),ke.onopen=()=>_.value=!0,ke.onclose=()=>{_.value=!1,ge||(Ze=setTimeout(W,1500))},ke.onerror=()=>ke&&ke.close(),ke.onmessage=C=>{let N;try{N=JSON.parse(C.data)}catch{return}N.type==="snapshot"?(N.devices||[]).forEach(bt):N.type==="update"&&N.device?(bt(N.device),N.event&&N.device.deviceId===h.value&&g(N.event)):N.type==="removed"&&N.deviceId&&b(N.deviceId)}}async function H(){if(!h.value)return ze.value="No device selected.";if(!de.value.trim())return ze.value="Enter a command name.";let I;if($e.value.trim())try{I=JSON.parse($e.value)}catch{return ze.value="Payload is not valid JSON."}const{ok:C,body:N}=await Op(h.value,de.value.trim(),I);ze.value=C?`Sent "${de.value.trim()}".`:`Error: ${N.error||"failed"}`}function Z(I,C,N=""){return typeof I=="number"?I.toFixed(C)+N:"—"}function ee(I){h.value=I,ae.value="Live flights"}return Ft(ae,I=>{I==="Overview"&&j()}),ui(async()=>{(await Xh()).forEach(bt),W(),B()}),Os(()=>{ge=!0,Ze&&clearTimeout(Ze),ke&&ke.close(),he()}),(I,C)=>{var N,be,re,te,Me;return m(),v("div",O0,[r("aside",z0,[r("div",A0,[z(Fc,{size:26}),C[7]||(C[7]=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",$0,[(m(),v(ue,null,Ve(q,([ne,me])=>r("button",{key:me,class:Oe(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",ae.value===me?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:je=>ae.value=me},[z(Q,{name:ne,size:18,stroke:ae.value===me?2.2:1.8},null,8,["name","stroke"]),D(" "+k(me),1)],10,I0)),64))]),r("div",D0,[r("div",N0,[r("div",R0,[r("span",{class:Oe(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),r("span",F0,k(_.value?"Link healthy":"Reconnecting…"),1)]),r("span",B0,"API gateway · "+k(_.value?"streaming":"retrying"),1)]),r("div",V0,[r("div",U0,k(E.value),1),r("div",Z0,[r("div",H0,k(t.email||"Operator"),1),r("div",j0,[z(Q,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${st.value} · ${dt.value}`},k(st.value)+" · "+k(dt.value),9,W0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:C[0]||(C[0]=ne=>l("logout"))},[z(Q,{name:"logout",size:16})])])])]),r("main",K0,[r("header",G0,[r("div",null,[C[8]||(C[8]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",q0,k(ae.value),1)]),r("div",Y0,[r("div",J0,[z(Q,{name:"search",size:16,class:"text-ink-muted"}),oe(r("input",{"onUpdate:modelValue":C[1]||(C[1]=ne=>M.value=ne),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ye,M.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:C[2]||(C[2]=ne=>ae.value="Live flights")},[z(Q,{name:"radio",size:16}),C[9]||(C[9]=D(" Live flights ",-1))])])]),ae.value==="Overview"?(m(),v("div",X0,[r("div",Q0,[(m(!0),v(ue,null,Ve(Qe.value,ne=>(m(),v("div",{key:ne.label,class:"panel p-5"},[r("div",ew,[r("span",tw,k(ne.label),1),z(Q,{name:ne.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",nw,k(ne.value),1),r("span",{class:Oe(["mt-2 block font-mono text-[11px]",G[ne.tone]])},k(ne.delta),3)]))),128))]),r("div",iw,[r("div",sw,[r("div",ow,[C[11]||(C[11]=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",aw,[V.value?(m(),v("span",{key:0,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Fe.accent]),title:"Live aircraft from OpenSky Network"},[z(Q,{name:"radio",size:12}),D(k(V.value)+" aircraft ",1)],2)):F("",!0),Se.value?(m(),v("span",{key:1,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Fe.success])},[C[10]||(C[10]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Se.value)+" drones ",1)],2)):F("",!0)])]),z(cu,{position:Le.value,trail:Ne.value,aircraft:S.value},null,8,["position","trail","aircraft"]),O.loaded&&O.unavailable?(m(),v("p",rw,k(O.detail||"Live air traffic is unavailable."),1)):(m(),v("p",lw," Live air traffic from OpenSky Network · updates every 30s "))]),r("div",uw,[r("div",cw,[C[12]||(C[12]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),z(Q,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",dw,[z(Q,{name:"calendar",size:24,class:"text-ink-muted"}),C[13]||(C[13]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),C[14]||(C[14]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",fw,[r("div",hw,[C[17]||(C[17]=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",pw,[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Fe.success])},[C[15]||(C[15]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Se.value)+" in flight ",1)],2),Ge.value?(m(),v("span",{key:0,class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Fe.warning])},[C[16]||(C[16]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ge.value)+" offline ",1)],2)):F("",!0)])]),tt.value.length?(m(),v("div",gw,[r("table",vw,[r("thead",null,[r("tr",_w,[(m(),v(ue,null,Ve(["Aircraft","Mission","Status","Alt","Battery","Speed",""],ne=>r("th",{key:ne,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(ne),1)),64))])]),r("tbody",null,[(m(!0),v(ue,null,Ve(tt.value,(ne,me)=>(m(),v("tr",{key:ne.id,class:Oe(["cursor-pointer transition hover:bg-surface-2",meee(ne.id)},[r("td",bw,k(ne.id),1),r("td",xw,k(ne.mission),1),r("td",ww,[r("span",{class:Oe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Fe[ne.tone]])},[C[18]||(C[18]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(ne.status),1)],2)]),r("td",kw,k(ne.alt),1),r("td",Sw,[ne.battery!=null?(m(),v("div",Tw,[r("div",Pw,[r("div",{class:Oe(["h-full",ne.battery<40?"bg-caution":"bg-ready"]),style:Cs({width:ne.battery+"%"})},null,6)]),r("span",Cw,k(ne.battery)+"%",1)])):(m(),v("span",Lw,"—"))]),r("td",Mw,[D(k(ne.speed==null?"—":ne.speed.toFixed(1))+" ",1),C[19]||(C[19]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",Ew,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:Vr(je=>ee(ne.id),["stop"])},[z(Q,{name:"play",size:14}),C[20]||(C[20]=D(" Track ",-1))],8,Ow)])],10,yw))),128))])])])):(m(),v("div",mw," No aircraft connected yet. Devices appear here as they come online. "))])])):ae.value==="Live flights"?(m(),v("div",zw,[r("div",Aw,[r("span",$w,k(h.value||"No device selected"),1),_e.value&&!le.value?(m(),v("span",Iw,"Offline")):F("",!0),Ce.value.length?(m(),v("div",Dw,[(m(!0),v(ue,null,Ve(Ce.value,ne=>(m(),v("button",{key:ne,class:Oe(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",ne===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:me=>h.value=ne},[r("span",{class:Oe(["h-2 w-2 rounded-full",u[ne].online?"bg-ready":"bg-ink-muted"])},null,2),D(" "+k(ne),1)],10,Nw))),128))])):F("",!0)]),Ce.value.length?(m(),v(ue,{key:1},[r("div",{class:Oe(["mb-4 grid gap-3",!le.value&&_e.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",Fw,[C[23]||(C[23]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Oe(["mt-1 text-sm font-semibold",le.value?((N=_e.value)==null?void 0:N.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},k(le.value&&((be=_e.value)!=null&&be.registration)?_e.value.registration:"—"),3)]),r("div",Bw,[C[24]||(C[24]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Oe(["mt-1 text-sm font-semibold",le.value?(re=_e.value)!=null&&re.connected?"text-success-fg":"text-danger-fg":"text-ink"])},k(_e.value?le.value?_e.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",Vw,[C[25]||(C[25]=r("div",{class:"eyebrow"},"Model",-1)),r("div",Uw,k(((te=_e.value)==null?void 0:te.model)||"—"),1)]),r("div",Zw,[C[26]||(C[26]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",Hw,k((Me=_e.value)!=null&&Me.lastSeenMs?Be(au)(_e.value.lastSeenMs):"—"),1)])],2),r("div",jw,[r("div",Ww,[C[28]||(C[28]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",Kw,[r("div",Gw,[r("div",{class:Oe(["h-full transition-all",typeof J.value.batteryPercent=="number"?J.value.batteryPercent<20?"bg-warning":J.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Cs({width:(typeof J.value.batteryPercent=="number"?J.value.batteryPercent:0)+"%"})},null,6)]),r("div",qw,[D(k(typeof J.value.batteryPercent=="number"?J.value.batteryPercent:"—"),1),C[27]||(C[27]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",Yw,[C[30]||(C[30]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",Jw,[D(k(Z(J.value.altitude,1)),1),C[29]||(C[29]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",Xw,[C[35]||(C[35]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",Qw,[r("div",ek,[C[31]||(C[31]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",tk,k(J.value.flightMode||"—"),1)]),r("div",nk,[C[32]||(C[32]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",ik,k(J.value.isFlying==null?"—":J.value.isFlying?"yes":"no"),1)]),r("div",sk,[C[33]||(C[33]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",ok,k(J.value.satelliteCount==null?"—":J.value.satelliteCount),1)]),r("div",ak,[C[34]||(C[34]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",rk,k(ve.value==null?"—":Z(ve.value,2," m/s")),1)])])]),r("div",lk,[C[39]||(C[39]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",uk,[r("div",ck,[C[36]||(C[36]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",dk,k(Z(J.value.latitude,6)),1)]),r("div",fk,[C[37]||(C[37]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",hk,k(Z(J.value.longitude,6)),1)]),r("div",pk,[C[38]||(C[38]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",mk,k(Z(typeof J.value.velocityZ=="number"?-J.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",gk,[C[40]||(C[40]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),z(cu,{position:Le.value,trail:Ne.value},null,8,["position","trail"])]),r("div",vk,[C[41]||(C[41]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",_k,[oe(r("input",{"onUpdate:modelValue":C[3]||(C[3]=ne=>de.value=ne),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ye,de.value]]),oe(r("input",{"onUpdate:modelValue":C[4]||(C[4]=ne=>$e.value=ne),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ye,$e.value]]),r("button",{class:"btn-accent",onClick:H},"Send")]),r("div",yk,k(ze.value),1)]),r("div",bk,[C[42]||(C[42]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",xk,[(m(!0),v(ue,null,Ve(y,(ne,me)=>(m(),v("div",{key:me,class:"border-b border-line py-1"},[r("span",wk,k(ne.t),1),r("span",kk,k(ne.tag),1),r("span",Sk,k(ne.text),1)]))),128))])])])],64)):(m(),v("div",Rw,[z(Q,{name:"radio",size:28,class:"text-ink-muted"}),C[21]||(C[21]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),C[22]||(C[22]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):ae.value==="Logbook"?(m(),nt(jb,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):ae.value==="Documents"?(m(),nt(E0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):ae.value==="Settings"?(m(),nt(Gy,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:C[5]||(C[5]=ne=>l("logout"))},null,8,["email","role","organization","organization-name"])):(m(),v("div",Tk,[r("div",Pk,[z(Q,{name:we.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",Ck,k(ae.value),1),ae.value==="Drives"?(m(),v("div",Lk,[C[43]||(C[43]=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:C[6]||(C[6]=ne=>ae.value="Settings")},"Settings → Integrations"),C[44]||(C[44]=D(". ",-1))])):(m(),v("div",Mk,"This section is part of the console shell and has no backend yet."))])]))])])}}},Ok={key:0,class:"h-full"},zk={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},Ak={__name:"App",setup(t){const i=K(!1),o=K(null),l=K("user"),u=K(""),d=K(""),h=K("");function _(S){l.value=S&&S.role||"user",u.value=S&&S.organization||"",d.value=S&&S.organizationName||""}ui(async()=>{h.value=(await qh()).apiBase||"";const S=await nu();S&&(o.value=S.email,_(S),await lu()),i.value=!0});async function y(S){o.value=S,_(await nu()),await lu()}async function M(){Dp(),await Jh(),o.value=null,l.value="user",u.value="",d.value=""}return(S,O)=>i.value?(m(),v("div",Ok,[o.value?(m(),nt(Ek,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:M},null,8,["email","role","organization","organization-name"])):(m(),nt(Qp,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(m(),v("div",zk,"Loading…"))}};jh(Ak).mount("#app"); diff --git a/Web App/server/dist/index.html b/Web App/server/dist/index.html index 2a83f98..ddc2eca 100644 --- a/Web App/server/dist/index.html +++ b/Web App/server/dist/index.html @@ -35,7 +35,7 @@ })() PilotVault — Control Panel - + diff --git a/Web App/server/main.go b/Web App/server/main.go index 38d9b6a..94854aa 100644 --- a/Web App/server/main.go +++ b/Web App/server/main.go @@ -50,6 +50,7 @@ func main() { mux.HandleFunc("GET /bff/integrations/opensky", app.requireAuth(app.handleGetOpenSky)) mux.HandleFunc("PUT /bff/integrations/opensky", app.requireAuth(app.handlePutOpenSky)) mux.HandleFunc("POST /bff/integrations/opensky/health", app.requireAuth(app.handleOpenSkyHealth)) + mux.HandleFunc("GET /bff/integrations/opensky/states", app.requireAuth(app.handleOpenSkyStates)) // Plugin integrations (File transfer: FTP/SFTP) — per-user/per-org settings mux.HandleFunc("GET /bff/integrations/filetransfer", app.requireAuth(app.handleGetFileTransfer)) mux.HandleFunc("PUT /bff/integrations/filetransfer", app.requireAuth(app.handlePutFileTransfer)) diff --git a/Web App/web/src/api.js b/Web App/web/src/api.js index 63d1df6..26f5fa9 100644 --- a/Web App/web/src/api.js +++ b/Web App/web/src/api.js @@ -166,6 +166,20 @@ 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? } — an empty list with `unavailable` when OpenSky is off for the caller. +export async function getOpenSkyStates() { + try { + const r = await fetch('/bff/integrations/opensky/states') + if (!r.ok) return { states: [], unavailable: true, detail: 'OpenSky unavailable' } + const d = await r.json() + return { states: d.states || [], time: d.time, unavailable: !!d.unavailable, detail: d.detail || '' } + } catch { + return { states: [], unavailable: true, detail: 'OpenSky unavailable' } + } +} + /* ---------- Plugin integrations: File transfer (FTP/SFTP) ---------- */ // Resolved file-transfer settings for the current user (cascade + masked secrets). diff --git a/Web App/web/src/components/Dashboard.vue b/Web App/web/src/components/Dashboard.vue index cea67f8..a93d4cb 100644 --- a/Web App/web/src/components/Dashboard.vue +++ b/Web App/web/src/components/Dashboard.vue @@ -1,12 +1,12 @@ @@ -370,15 +406,31 @@ onBeforeUnmount(() => {
Airspace
Live map
- - {{ flyingCount }} airborne - +
+ + {{ airborneCount }} aircraft + + + {{ flyingCount }} drones + +
- + +

+ {{ airspace.detail || 'Live air traffic is unavailable.' }} +

+

+ Live air traffic from OpenSky Network · updates every 30s +

diff --git a/Web App/web/src/components/DeviceMap.vue b/Web App/web/src/components/DeviceMap.vue index 1afbb1d..7b63d40 100644 --- a/Web App/web/src/components/DeviceMap.vue +++ b/Web App/web/src/components/DeviceMap.vue @@ -1,14 +1,76 @@