Introduces a `documents` collection and full-stack UI for tracking pilot certificates, aircraft registrations, insurance, airspace authorisations, contracts, and other paperwork. - Migration 1720300800_add_documents.js (also provisioned live on remote PB): doc_type/owner/expiry/status/access_tier + file blob, a self-referential `replaces` version chain, audit fields, and a partial index on expiry_date. - API Server (documents.go): role-scoped CRUD, server-computed expiry assessment, ?expiring=N query, versioning (replaces -> version+1, old row auto-archived), and streamed blob download. admin.go gains multipart upload, file tokens, and protected-file streaming. - Web App: BFF passthrough (multipart create + streamed download), api.js client fns, and Documents.vue wired into the Documents nav slot. Blobs live in PocketBase file storage for now; only that backend swaps when S3-compatible object storage lands. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 lines
389 KiB
JavaScript
21 lines
389 KiB
JavaScript
(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 yr(t){const i=Object.create(null);for(const o of t.split(","))i[o]=1;return o=>o in i}const ft={},_s=[],Un=()=>{},su=()=>!1,ua=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ca=t=>t.startsWith("onUpdate:"),Ot=Object.assign,br=(t,i)=>{const o=t.indexOf(i);o>-1&&t.splice(o,1)},ed=Object.prototype.hasOwnProperty,ot=(t,i)=>ed.call(t,i),Ee=Array.isArray,ys=t=>po(t)==="[object Map]",Cs=t=>po(t)==="[object Set]",sl=t=>po(t)==="[object Date]",He=t=>typeof t=="function",xt=t=>typeof t=="string",Ln=t=>typeof t=="symbol",at=t=>t!==null&&typeof t=="object",ou=t=>(at(t)||He(t))&&He(t.then)&&He(t.catch),au=Object.prototype.toString,po=t=>au.call(t),td=t=>po(t).slice(8,-1),ru=t=>po(t)==="[object Object]",xr=t=>xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Xs=yr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),da=t=>{const i=Object.create(null);return(o=>i[o]||(i[o]=t(o)))},nd=/-\w/g,Tn=da(t=>t.replace(nd,i=>i.slice(1).toUpperCase())),id=/\B([A-Z])/g,Ci=da(t=>t.replace(id,"-$1").toLowerCase()),lu=da(t=>t.charAt(0).toUpperCase()+t.slice(1)),Wa=da(t=>t?`on${lu(t)}`:""),Vn=(t,i)=>!Object.is(t,i),qo=(t,...i)=>{for(let o=0;o<t.length;o++)t[o](...i)},uu=(t,i,o,l=!1)=>{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:o})},fa=t=>{const i=parseFloat(t);return isNaN(i)?t:i},sd=t=>{const i=xt(t)?Number(t):NaN;return isNaN(i)?t:i};let ol;const ha=()=>ol||(ol=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ss(t){if(Ee(t)){const i={};for(let o=0;o<t.length;o++){const l=t[o],u=xt(l)?ld(l):Ss(l);if(u)for(const d in u)i[d]=u[d]}return i}else if(xt(t)||at(t))return t}const od=/;(?![^(]*\))/g,ad=/:([^]+)/,rd=/\/\*[^]*?\*\//g;function ld(t){const i={};return t.replace(rd,"").split(od).forEach(o=>{if(o){const l=o.split(ad);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Le(t){let i="";if(xt(t))i=t;else if(Ee(t))for(let o=0;o<t.length;o++){const l=Le(t[o]);l&&(i+=l+" ")}else if(at(t))for(const o in t)t[o]&&(i+=o+" ");return i.trim()}const ud="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",cd=yr(ud);function cu(t){return!!t||t===""}function dd(t,i){if(t.length!==i.length)return!1;let o=!0;for(let l=0;o&&l<t.length;l++)o=Si(t[l],i[l]);return o}function Si(t,i){if(t===i)return!0;let o=sl(t),l=sl(i);if(o||l)return o&&l?t.getTime()===i.getTime():!1;if(o=Ln(t),l=Ln(i),o||l)return t===i;if(o=Ee(t),l=Ee(i),o||l)return o&&l?dd(t,i):!1;if(o=at(t),l=at(i),o||l){if(!o||!l)return!1;const u=Object.keys(t).length,d=Object.keys(i).length;if(u!==d)return!1;for(const h in t){const _=t.hasOwnProperty(h),y=i.hasOwnProperty(h);if(_&&!y||!_&&y||!Si(t[h],i[h]))return!1}}return String(t)===String(i)}function wr(t,i){return t.findIndex(o=>Si(o,i))}const du=t=>!!(t&&t.__v_isRef===!0),k=t=>xt(t)?t:t==null?"":Ee(t)||at(t)&&(t.toString===au||!He(t.toString))?du(t)?k(t.value):JSON.stringify(t,fu,2):String(t),fu=(t,i)=>du(i)?fu(t,i.value):ys(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[l,u],d)=>(o[Ka(l,d)+" =>"]=u,o),{})}:Cs(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>Ka(o))}:Ln(i)?Ka(i):at(i)&&!Ee(i)&&!ru(i)?String(i):i,Ka=(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 fd{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;i<o;i++)this.scopes[i].pause();for(i=0,o=this.effects.length;i<o;i++)this.effects[i].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i<o;i++)this.scopes[i].resume();for(i=0,o=this.effects.length;i<o;i++)this.effects[i].resume()}}run(i){if(this._active){const o=It;try{return It=this,i()}finally{It=o}}}on(){++this._on===1&&(this.prevScope=It,It=this)}off(){if(this._on>0&&--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;o<l;o++)this.effects[o].stop();for(this.effects.length=0,o=0,l=this.cleanups.length;o<l;o++)this.cleanups[o]();if(this.cleanups.length=0,this.scopes){for(o=0,l=this.scopes.length;o<l;o++)this.scopes[o].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!i){const u=this.parent.scopes.pop();u&&u!==this&&(this.parent.scopes[this.index]=u,u.index=this.index)}this.parent=void 0}}}function hd(){return It}let mt;const Ga=new WeakSet;class hu{constructor(i){this.fn=i,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,It&&(It.active?It.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ga.has(this)&&(Ga.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||mu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,al(this),gu(this);const i=mt,o=Cn;mt=this,Cn=!0;try{return this.fn()}finally{vu(this),mt=i,Cn=o,this.flags&=-3}}stop(){if(this.flags&1){for(let i=this.deps;i;i=i.nextDep)Pr(i);this.deps=this.depsTail=void 0,al(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ga.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){sr(this)&&this.run()}get dirty(){return sr(this)}}let pu=0,Qs,eo;function mu(t,i=!1){if(t.flags|=8,i){t.next=eo,eo=t;return}t.next=Qs,Qs=t}function kr(){pu++}function Sr(){if(--pu>0)return;if(eo){let i=eo;for(eo=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let t;for(;Qs;){let i=Qs;for(Qs=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 gu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function vu(t){let i,o=t.depsTail,l=o;for(;l;){const u=l.prevDep;l.version===-1?(l===o&&(o=u),Pr(l),pd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=o}function sr(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(_u(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function _u(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===oo)||(t.globalVersion=oo,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!sr(t))))return;t.flags|=2;const i=t.dep,o=mt,l=Cn;mt=t,Cn=!0;try{gu(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,vu(t),t.flags&=-3}}function Pr(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)Pr(d,!0)}!i&&!--o.sc&&o.map&&o.map.delete(o.key)}function pd(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 yu=[];function Zn(){yu.push(Cn),Cn=!1}function Hn(){const t=yu.pop();Cn=t===void 0?!0:t}function al(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const o=mt;mt=void 0;try{i()}finally{mt=o}}}let oo=0;class md{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 Tr{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 md(mt,this),mt.deps?(o.prevDep=mt.depsTail,mt.depsTail.nextDep=o,mt.depsTail=o):mt.deps=mt.depsTail=o,bu(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++,oo++,this.notify(i)}notify(i){kr();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Sr()}}}function bu(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)bu(l)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const or=new WeakMap,Gi=Symbol(""),ar=Symbol(""),ao=Symbol("");function Nt(t,i,o){if(Cn&&mt){let l=or.get(t);l||or.set(t,l=new Map);let u=l.get(o);u||(l.set(o,u=new Tr),u.map=l,u.key=o),u.track()}}function oi(t,i,o,l,u,d){const h=or.get(t);if(!h){oo++;return}const _=y=>{y&&y.trigger()};if(kr(),i==="clear")h.forEach(_);else{const y=Ee(t),T=y&&xr(o);if(y&&o==="length"){const w=Number(l);h.forEach((z,U)=>{(U==="length"||U===ao||!Ln(U)&&U>=w)&&_(z)})}else switch((o!==void 0||h.has(void 0))&&_(h.get(o)),T&&_(h.get(ao)),i){case"add":y?T&&_(h.get("length")):(_(h.get(Gi)),ys(t)&&_(h.get(ar)));break;case"delete":y||(_(h.get(Gi)),ys(t)&&_(h.get(ar)));break;case"set":ys(t)&&_(h.get(Gi));break}}Sr()}function gs(t){const i=tt(t);return i===t?i:(Nt(i,"iterate",ao),mn(t)?i:i.map(Mn))}function pa(t){return Nt(t=tt(t),"iterate",ao),t}function Fn(t,i){return li(t)?Ps(qi(t)?Mn(i):i):Mn(i)}const gd={__proto__:null,[Symbol.iterator](){return qa(this,Symbol.iterator,t=>Fn(this,t))},concat(...t){return gs(this).concat(...t.map(i=>Ee(i)?gs(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 Ya(this,"includes",t)},indexOf(...t){return Ya(this,"indexOf",t)},join(t){return gs(this).join(t)},lastIndexOf(...t){return Ya(this,"lastIndexOf",t)},map(t,i){return ti(this,"map",t,i,void 0,arguments)},pop(){return js(this,"pop")},push(...t){return js(this,"push",t)},reduce(t,...i){return rl(this,"reduce",t,i)},reduceRight(t,...i){return rl(this,"reduceRight",t,i)},shift(){return js(this,"shift")},some(t,i){return ti(this,"some",t,i,void 0,arguments)},splice(...t){return js(this,"splice",t)},toReversed(){return gs(this).toReversed()},toSorted(t){return gs(this).toSorted(t)},toSpliced(...t){return gs(this).toSpliced(...t)},unshift(...t){return js(this,"unshift",t)},values(){return qa(this,"values",t=>Fn(this,t))}};function qa(t,i,o){const l=pa(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 vd=Array.prototype;function ti(t,i,o,l,u,d){const h=pa(t),_=h!==t&&!mn(t),y=h[i];if(y!==vd[i]){const z=y.apply(t,d);return _?Mn(z):z}let T=o;h!==t&&(_?T=function(z,U){return o.call(this,Fn(t,z),U,t)}:o.length>2&&(T=function(z,U){return o.call(this,z,U,t)}));const w=y.call(h,T,l);return _&&u?u(w):w}function rl(t,i,o,l){const u=pa(t),d=u!==t&&!mn(t);let h=o,_=!1;u!==t&&(d?(_=l.length===0,h=function(T,w,z){return _&&(_=!1,T=Fn(t,T)),o.call(this,T,Fn(t,w),z,t)}):o.length>3&&(h=function(T,w,z){return o.call(this,T,w,z,t)}));const y=u[i](h,...l);return _?Fn(t,y):y}function Ya(t,i,o){const l=tt(t);Nt(l,"iterate",ao);const u=l[i](...o);return(u===-1||u===!1)&&Mr(o[0])?(o[0]=tt(o[0]),l[i](...o)):u}function js(t,i,o=[]){Zn(),kr();const l=tt(t)[i].apply(t,o);return Sr(),Hn(),l}const _d=yr("__proto__,__v_isRef,__isVue"),xu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ln));function yd(t){Ln(t)||(t=String(t));const i=tt(this);return Nt(i,"has",t),i.hasOwnProperty(t)}class wu{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?Md:Tu:d?Pu:Su).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=Ee(i);if(!u){let y;if(h&&(y=gd[o]))return y;if(o==="hasOwnProperty")return yd}const _=Reflect.get(i,o,Bt(i)?i:l);if((Ln(o)?xu.has(o):_d(o))||(u||Nt(i,"get",o),d))return _;if(Bt(_)){const y=h&&xr(o)?_:_.value;return u&&at(y)?lr(y):y}return at(_)?u?lr(_):bt(_):_}}class ku extends wu{constructor(i=!1){super(!1,i)}set(i,o,l,u){let d=i[o];const h=Ee(i)&&xr(o);if(!this._isShallow){const T=li(d);if(!mn(l)&&!li(l)&&(d=tt(d),l=tt(l)),!h&&Bt(d)&&!Bt(l))return T||(d.value=l),!0}const _=h?Number(o)<i.length:ot(i,o),y=Reflect.set(i,o,l,Bt(i)?i:u);return i===tt(u)&&y&&(_?Vn(l,d)&&oi(i,"set",o,l):oi(i,"add",o,l)),y}deleteProperty(i,o){const l=ot(i,o);i[o];const u=Reflect.deleteProperty(i,o);return u&&l&&oi(i,"delete",o,void 0),u}has(i,o){const l=Reflect.has(i,o);return(!Ln(o)||!xu.has(o))&&Nt(i,"has",o),l}ownKeys(i){return Nt(i,"iterate",Ee(i)?"length":Gi),Reflect.ownKeys(i)}}class bd extends wu{constructor(i=!1){super(!0,i)}set(i,o){return!0}deleteProperty(i,o){return!0}}const xd=new ku,wd=new bd,kd=new ku(!0);const rr=t=>t,Zo=t=>Reflect.getPrototypeOf(t);function Sd(t,i,o){return function(...l){const u=this.__v_raw,d=tt(u),h=ys(d),_=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,T=u[t](...l),w=o?rr:i?Ps:Mn;return!i&&Nt(d,"iterate",y?ar:Gi),Ot(Object.create(T),{next(){const{value:z,done:U}=T.next();return U?{value:z,done:U}:{value:_?[w(z[0]),w(z[1])]:w(z),done:U}}})}}function Ho(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Pd(t,i){const o={get(u){const d=this.__v_raw,h=tt(d),_=tt(u);t||(Vn(u,_)&&Nt(h,"get",u),Nt(h,"get",_));const{has:y}=Zo(h),T=i?rr:t?Ps:Mn;if(y.call(h,u))return T(d.get(u));if(y.call(h,_))return T(d.get(_));d!==h&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Nt(tt(u),"iterate",Gi),u.size},has(u){const d=this.__v_raw,h=tt(d),_=tt(u);return t||(Vn(u,_)&&Nt(h,"has",u),Nt(h,"has",_)),u===_?d.has(u):d.has(u)||d.has(_)},forEach(u,d){const h=this,_=h.__v_raw,y=tt(_),T=i?rr:t?Ps:Mn;return!t&&Nt(y,"iterate",Gi),_.forEach((w,z)=>u.call(d,T(w),T(z),h))}};return Ot(o,t?{add:Ho("add"),set:Ho("set"),delete:Ho("delete"),clear:Ho("clear")}:{add(u){const d=tt(this),h=Zo(d),_=tt(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=tt(d));const h=tt(this),{has:_,get:y}=Zo(h);let T=_.call(h,u);T||(u=tt(u),T=_.call(h,u));const w=y.call(h,u);return h.set(u,d),T?Vn(d,w)&&oi(h,"set",u,d):oi(h,"add",u,d),this},delete(u){const d=tt(this),{has:h,get:_}=Zo(d);let y=h.call(d,u);y||(u=tt(u),y=h.call(d,u)),_&&_.call(d,u);const T=d.delete(u);return y&&oi(d,"delete",u,void 0),T},clear(){const u=tt(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]=Sd(u,t,i)}),o}function Cr(t,i){const o=Pd(t,i);return(l,u,d)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ot(o,u)&&u in l?o:l,u,d)}const Td={get:Cr(!1,!1)},Cd={get:Cr(!1,!0)},Ld={get:Cr(!0,!1)};const Su=new WeakMap,Pu=new WeakMap,Tu=new WeakMap,Md=new WeakMap;function Ed(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bt(t){return li(t)?t:Lr(t,!1,xd,Td,Su)}function Od(t){return Lr(t,!1,kd,Cd,Pu)}function lr(t){return Lr(t,!0,wd,Ld,Tu)}function Lr(t,i,o,l,u){if(!at(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=Ed(td(t));if(h===0)return t;const _=new Proxy(t,h===2?l:o);return u.set(t,_),_}function qi(t){return li(t)?qi(t.__v_raw):!!(t&&t.__v_isReactive)}function li(t){return!!(t&&t.__v_isReadonly)}function mn(t){return!!(t&&t.__v_isShallow)}function Mr(t){return t?!!t.__v_raw:!1}function tt(t){const i=t&&t.__v_raw;return i?tt(i):t}function zd(t){return!ot(t,"__v_skip")&&Object.isExtensible(t)&&uu(t,"__v_skip",!0),t}const Mn=t=>at(t)?bt(t):t,Ps=t=>at(t)?lr(t):t;function Bt(t){return t?t.__v_isRef===!0:!1}function K(t){return Ad(t,!1)}function Ad(t,i){return Bt(t)?t:new Id(t,i)}class Id{constructor(i,o){this.dep=new Tr,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 Ue(t){return Bt(t)?t.value:t}const $d={get:(t,i,o)=>i==="__v_raw"?t:Ue(Reflect.get(t,i,o)),set:(t,i,o,l)=>{const u=t[i];return Bt(u)&&!Bt(o)?(u.value=o,!0):Reflect.set(t,i,o,l)}};function Cu(t){return qi(t)?t:new Proxy(t,$d)}class Dd{constructor(i,o,l){this.fn=i,this.setter=o,this._value=void 0,this.dep=new Tr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=oo-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 mu(this,!0),!0}get value(){const i=this.dep.track();return _u(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Nd(t,i,o=!1){let l,u;return He(t)?l=t:(l=t.get,u=t.set),new Dd(l,u,o)}const jo={},Jo=new WeakMap;let Wi;function Rd(t,i=!1,o=Wi){if(o){let l=Jo.get(o);l||Jo.set(o,l=[]),l.push(t)}}function Fd(t,i,o=ft){const{immediate:l,deep:u,once:d,scheduler:h,augmentJob:_,call:y}=o,T=oe=>u?oe:mn(oe)||u===!1||u===0?ai(oe,1):ai(oe);let w,z,U,V,ue=!1,X=!1;if(Bt(t)?(z=()=>t.value,ue=mn(t)):qi(t)?(z=()=>T(t),ue=!0):Ee(t)?(X=!0,ue=t.some(oe=>qi(oe)||mn(oe)),z=()=>t.map(oe=>{if(Bt(oe))return oe.value;if(qi(oe))return T(oe);if(He(oe))return y?y(oe,2):oe()})):He(t)?i?z=y?()=>y(t,2):t:z=()=>{if(U){Zn();try{U()}finally{Hn()}}const oe=Wi;Wi=w;try{return y?y(t,3,[V]):t(V)}finally{Wi=oe}}:z=Un,i&&u){const oe=z,de=u===!0?1/0:u;z=()=>ai(oe(),de)}const Ae=hd(),$e=()=>{w.stop(),Ae&&Ae.active&&br(Ae.effects,w)};if(d&&i){const oe=i;i=(...de)=>{const Ne=oe(...de);return $e(),Ne}}let Q=X?new Array(t.length).fill(jo):jo;const me=oe=>{if(!(!(w.flags&1)||!w.dirty&&!oe))if(i){const de=w.run();if(oe||u||ue||(X?de.some((Ne,nt)=>Vn(Ne,Q[nt])):Vn(de,Q))){U&&U();const Ne=Wi;Wi=w;try{const nt=[de,Q===jo?void 0:X&&Q[0]===jo?[]:Q,V];Q=de,y?y(i,3,nt):i(...nt)}finally{Wi=Ne}}}else w.run()};return _&&_(me),w=new hu(z),w.scheduler=h?()=>h(me,!1):me,V=oe=>Rd(oe,!1,w),U=w.onStop=()=>{const oe=Jo.get(w);if(oe){if(y)y(oe,4);else for(const de of oe)de();Jo.delete(w)}},i?l?me(!0):Q=w.run():h?h(me.bind(null,!0),!0):w.run(),$e.pause=w.pause.bind(w),$e.resume=w.resume.bind(w),$e.stop=$e,$e}function ai(t,i=1/0,o){if(i<=0||!at(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=i))return t;if(o.set(t,i),i--,Bt(t))ai(t.value,i,o);else if(Ee(t))for(let l=0;l<t.length;l++)ai(t[l],i,o);else if(Cs(t)||ys(t))t.forEach(l=>{ai(l,i,o)});else if(ru(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 mo(t,i,o,l){try{return l?t(...l):t()}catch(u){ma(u,i,o)}}function vn(t,i,o,l){if(He(t)){const u=mo(t,i,o,l);return u&&ou(u)&&u.catch(d=>{ma(d,i,o)}),u}if(Ee(t)){const u=[];for(let d=0;d<t.length;d++)u.push(vn(t[d],i,o,l));return u}}function ma(t,i,o,l=!0){const u=i?i.vnode:null,{errorHandler:d,throwUnhandledErrorInProduction:h}=i&&i.appContext.config||ft;if(i){let _=i.parent;const y=i.proxy,T=`https://vuejs.org/error-reference/#runtime-${o}`;for(;_;){const w=_.ec;if(w){for(let z=0;z<w.length;z++)if(w[z](t,y,T)===!1)return}_=_.parent}if(d){Zn(),mo(d,null,10,[t,y,T]),Hn();return}}Bd(t,o,u,l,h)}function Bd(t,i,o,l=!0,u=!1){if(u)throw t;console.error(t)}const Kt=[];let Rn=-1;const bs=[];let ki=null,vs=0;const Lu=Promise.resolve();let Xo=null;function Mu(t){const i=Xo||Lu;return t?i.then(this?t.bind(this):t):i}function Vd(t){let i=Rn+1,o=Kt.length;for(;i<o;){const l=i+o>>>1,u=Kt[l],d=ro(u);d<t||d===t&&u.flags&2?i=l+1:o=l}return i}function Er(t){if(!(t.flags&1)){const i=ro(t),o=Kt[Kt.length-1];!o||!(t.flags&2)&&i>=ro(o)?Kt.push(t):Kt.splice(Vd(i),0,t),t.flags|=1,Eu()}}function Eu(){Xo||(Xo=Lu.then(zu))}function Ud(t){Ee(t)?bs.push(...t):ki&&t.id===-1?ki.splice(vs+1,0,t):t.flags&1||(bs.push(t),t.flags|=1),Eu()}function ll(t,i,o=Rn+1){for(;o<Kt.length;o++){const l=Kt[o];if(l&&l.flags&2){if(t&&l.id!==t.uid)continue;Kt.splice(o,1),o--,l.flags&4&&(l.flags&=-2),l(),l.flags&4||(l.flags&=-2)}}}function Ou(t){if(bs.length){const i=[...new Set(bs)].sort((o,l)=>ro(o)-ro(l));if(bs.length=0,ki){ki.push(...i);return}for(ki=i,vs=0;vs<ki.length;vs++){const o=ki[vs];o.flags&4&&(o.flags&=-2),o.flags&8||o(),o.flags&=-2}ki=null,vs=0}}const ro=t=>t.id==null?t.flags&2?-1:1/0:t.id;function zu(t){try{for(Rn=0;Rn<Kt.length;Rn++){const i=Kt[Rn];i&&!(i.flags&8)&&(i.flags&4&&(i.flags&=-2),mo(i,i.i,i.i?15:14),i.flags&4||(i.flags&=-2))}}finally{for(;Rn<Kt.length;Rn++){const i=Kt[Rn];i&&(i.flags&=-2)}Rn=-1,Kt.length=0,Ou(),Xo=null,(Kt.length||bs.length)&&zu()}}let Ft=null,Au=null;function Qo(t){const i=Ft;return Ft=t,Au=t&&t.type.__scopeId||null,i}function ye(t,i=Ft,o){if(!i||t._n)return t;const l=(...u)=>{l._d&&na(-1);const d=Qo(i);let h;try{h=t(...u)}finally{Qo(d),l._d&&na(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function re(t,i){if(Ft===null)return t;const o=xa(Ft),l=t.dirs||(t.dirs=[]);for(let u=0;u<i.length;u++){let[d,h,_,y=ft]=i[u];d&&(He(d)&&(d={mounted:d,updated:d}),d.deep&&ai(h),l.push({dir:d,instance:o,value:h,oldValue:void 0,arg:_,modifiers:y}))}return t}function Ui(t,i,o,l){const u=t.dirs,d=i&&i.dirs;for(let h=0;h<u.length;h++){const _=u[h];d&&(_.oldValue=d[h].value);let y=_.dir[l];y&&(Zn(),vn(y,o,8,[t.el,_,t,i]),Hn())}}function Iu(t,i){if(Gt){let o=Gt.provides;const l=Gt.parent&&Gt.parent.provides;l===o&&(o=Gt.provides=Object.create(l)),o[t]=i}}function to(t,i,o=!1){const l=fc();if(l||ws){let u=ws?ws._context.provides:l?l.parent==null||l.ce?l.vnode.appContext&&l.vnode.appContext.provides:l.parent.provides:void 0;if(u&&t in u)return u[t];if(arguments.length>1)return o&&He(i)?i.call(l&&l.proxy):i}}const Zd=Symbol.for("v-scx"),Hd=()=>to(Zd);function en(t,i,o){return $u(t,i,o)}function $u(t,i,o=ft){const{immediate:l,deep:u,flush:d,once:h}=o,_=Ot({},o),y=i&&l||!i&&d!=="post";let T;if(fo){if(d==="sync"){const V=Hd();T=V.__watcherHandles||(V.__watcherHandles=[])}else if(!y){const V=()=>{};return V.stop=Un,V.resume=Un,V.pause=Un,V}}const w=Gt;_.call=(V,ue,X)=>vn(V,w,ue,X);let z=!1;d==="post"?_.scheduler=V=>{Qt(V,w&&w.suspense)}:d!=="sync"&&(z=!0,_.scheduler=(V,ue)=>{ue?V():Er(V)}),_.augmentJob=V=>{i&&(V.flags|=4),z&&(V.flags|=2,w&&(V.id=w.uid,V.i=w))};const U=Fd(t,i,_);return fo&&(T?T.push(U):y&&U()),U}function jd(t,i,o){const l=this.proxy,u=xt(t)?t.includes(".")?Du(l,t):()=>l[t]:t.bind(l,l);let d;He(i)?d=i:(d=i.handler,o=i);const h=go(this),_=$u(u,d.bind(l),o);return h(),_}function Du(t,i){const o=i.split(".");return()=>{let l=t;for(let u=0;u<o.length&&l;u++)l=l[o[u]];return l}}const Wd=Symbol("_vte"),Nu=t=>t.__isTeleport,pn=Symbol("_leaveCb"),Ws=Symbol("_enterCb");function Kd(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Li(()=>{t.isMounted=!0}),_a(()=>{t.isUnmounting=!0}),t}const fn=[Function,Array],Ru={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},Fu=t=>{const i=t.subTree;return i.component?Fu(i.component):i},Gd={name:"BaseTransition",props:Ru,setup(t,{slots:i}){const o=fc(),l=Kd();return()=>{const u=i.default&&Uu(i.default(),!0),d=u&&u.length?Bu(u):o.subTree?R():void 0;if(!d)return;const h=tt(t),{mode:_}=h;if(l.isLeaving)return Ja(d);const y=ul(d);if(!y)return Ja(d);let T=ur(y,h,l,o,z=>T=z);y.type!==Rt&&lo(y,T);let w=o.subTree&&ul(o.subTree);if(w&&w.type!==Rt&&!Ki(w,y)&&Fu(o).type!==Rt){let z=ur(w,h,l,o);if(lo(w,z),_==="out-in"&&y.type!==Rt)return l.isLeaving=!0,z.afterLeave=()=>{l.isLeaving=!1,o.job.flags&8||o.update(),delete z.afterLeave,w=void 0},Ja(d);_==="in-out"&&y.type!==Rt?z.delayLeave=(U,V,ue)=>{const X=Vu(l,w);X[String(w.key)]=w,U[pn]=()=>{V(),U[pn]=void 0,delete T.delayedLeave,w=void 0},T.delayedLeave=()=>{ue(),delete T.delayedLeave,w=void 0}}:w=void 0}else w&&(w=void 0);return d}}};function Bu(t){let i=t[0];if(t.length>1){for(const o of t)if(o.type!==Rt){i=o;break}}return i}const qd=Gd;function Vu(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 ur(t,i,o,l,u){const{appear:d,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:T,onAfterEnter:w,onEnterCancelled:z,onBeforeLeave:U,onLeave:V,onAfterLeave:ue,onLeaveCancelled:X,onBeforeAppear:Ae,onAppear:$e,onAfterAppear:Q,onAppearCancelled:me}=i,oe=String(t.key),de=Vu(o,t),Ne=(Te,Be)=>{Te&&vn(Te,l,9,Be)},nt=(Te,Be)=>{const Ce=Be[1];Ne(Te,Be),Ee(Te)?Te.every(ee=>ee.length<=1)&&Ce():Te.length<=1&&Ce()},ke={mode:h,persisted:_,beforeEnter(Te){let Be=y;if(!o.isMounted)if(d)Be=Ae||y;else return;Te[pn]&&Te[pn](!0);const Ce=de[oe];Ce&&Ki(t,Ce)&&Ce.el[pn]&&Ce.el[pn](),Ne(Be,[Te])},enter(Te){if(de[oe]===t)return;let Be=T,Ce=w,ee=z;if(!o.isMounted)if(d)Be=$e||T,Ce=Q||w,ee=me||z;else return;let pe=!1;Te[Ws]=Ze=>{pe||(pe=!0,Ze?Ne(ee,[Te]):Ne(Ce,[Te]),ke.delayedLeave&&ke.delayedLeave(),Te[Ws]=void 0)};const Re=Te[Ws].bind(null,!1);Be?nt(Be,[Te,Re]):Re()},leave(Te,Be){const Ce=String(t.key);if(Te[Ws]&&Te[Ws](!0),o.isUnmounting)return Be();Ne(U,[Te]);let ee=!1;Te[pn]=Re=>{ee||(ee=!0,Be(),Re?Ne(X,[Te]):Ne(ue,[Te]),Te[pn]=void 0,de[Ce]===t&&delete de[Ce])};const pe=Te[pn].bind(null,!1);de[Ce]=t,V?nt(V,[Te,pe]):pe()},clone(Te){const Be=ur(Te,i,o,l,u);return u&&u(Be),Be}};return ke}function Ja(t){if(ga(t))return t=Pi(t),t.children=null,t}function ul(t){if(!ga(t))return Nu(t.type)&&t.children?Bu(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 lo(t,i){t.shapeFlag&6&&t.component?(t.transition=i,lo(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 Uu(t,i=!1,o){let l=[],u=0;for(let d=0;d<t.length;d++){let h=t[d];const _=o==null?h.key:String(o)+String(h.key!=null?h.key:d);h.type===le?(h.patchFlag&128&&u++,l=l.concat(Uu(h.children,i,_))):(i||h.type!==Rt)&&l.push(_!=null?Pi(h,{key:_}):h)}if(u>1)for(let d=0;d<l.length;d++)l[d].patchFlag=-2;return l}function Zu(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function cl(t,i){let o;return!!((o=Object.getOwnPropertyDescriptor(t,i))&&!o.configurable)}const ea=new WeakMap;function no(t,i,o,l,u=!1){if(Ee(t)){t.forEach((X,Ae)=>no(X,i&&(Ee(i)?i[Ae]:i),o,l,u));return}if(xs(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&no(t,i,o,l.component.subTree);return}const d=l.shapeFlag&4?xa(l.component):l.el,h=u?null:d,{i:_,r:y}=t,T=i&&i.r,w=_.refs===ft?_.refs={}:_.refs,z=_.setupState,U=tt(z),V=z===ft?su:X=>cl(w,X)?!1:ot(U,X),ue=(X,Ae)=>!(Ae&&cl(w,Ae));if(T!=null&&T!==y){if(dl(i),xt(T))w[T]=null,V(T)&&(z[T]=null);else if(Bt(T)){const X=i;ue(T,X.k)&&(T.value=null),X.k&&(w[X.k]=null)}}if(He(y)){Zn();try{mo(y,_,12,[h,w])}finally{Hn()}}else{const X=xt(y),Ae=Bt(y);if(X||Ae){const $e=()=>{if(t.f){const Q=X?V(y)?z[y]:w[y]:ue()||!t.k?y.value:w[t.k];if(u)Ee(Q)&&br(Q,d);else if(Ee(Q))Q.includes(d)||Q.push(d);else if(X)w[y]=[d],V(y)&&(z[y]=w[y]);else{const me=[d];ue(y,t.k)&&(y.value=me),t.k&&(w[t.k]=me)}}else X?(w[y]=h,V(y)&&(z[y]=h)):Ae&&(ue(y,t.k)&&(y.value=h),t.k&&(w[t.k]=h))};if(h){const Q=()=>{$e(),ea.delete(t)};Q.id=-1,ea.set(t,Q),Qt(Q,o)}else dl(t),$e()}}}function dl(t){const i=ea.get(t);i&&(i.flags|=8,ea.delete(t))}ha().requestIdleCallback;ha().cancelIdleCallback;const xs=t=>!!t.type.__asyncLoader,ga=t=>t.type.__isKeepAlive;function Yd(t,i){Hu(t,"a",i)}function Jd(t,i){Hu(t,"da",i)}function Hu(t,i,o=Gt){const l=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(va(i,l,o),o){let u=o.parent;for(;u&&u.parent;)ga(u.parent.vnode)&&Xd(l,i,o,u),u=u.parent}}function Xd(t,i,o,l){const u=va(i,t,l,!0);ju(()=>{br(l[i],u)},o)}function va(t,i,o=Gt,l=!1){if(o){const u=o[t]||(o[t]=[]),d=i.__weh||(i.__weh=(...h)=>{Zn();const _=go(o),y=vn(i,o,t,h);return _(),Hn(),y});return l?u.unshift(d):u.push(d),d}}const ui=t=>(i,o=Gt)=>{(!fo||t==="sp")&&va(t,(...l)=>i(...l),o)},Qd=ui("bm"),Li=ui("m"),ef=ui("bu"),tf=ui("u"),_a=ui("bum"),ju=ui("um"),nf=ui("sp"),sf=ui("rtg"),of=ui("rtc");function af(t,i=Gt){va("ec",t,i)}const rf=Symbol.for("v-ndc");function Fe(t,i,o,l){let u;const d=o,h=Ee(t);if(h||xt(t)){const _=h&&qi(t);let y=!1,T=!1;_&&(y=!mn(t),T=li(t),t=pa(t)),u=new Array(t.length);for(let w=0,z=t.length;w<z;w++)u[w]=i(y?T?Ps(Mn(t[w])):Mn(t[w]):t[w],w,void 0,d)}else if(typeof t=="number"){u=new Array(t);for(let _=0;_<t;_++)u[_]=i(_+1,_,void 0,d)}else if(at(t))if(t[Symbol.iterator])u=Array.from(t,(_,y)=>i(_,y,void 0,d));else{const _=Object.keys(t);u=new Array(_.length);for(let y=0,T=_.length;y<T;y++){const w=_[y];u[y]=i(t[w],w,y,d)}}else u=[];return u}function lf(t,i,o={},l,u){if(Ft.ce||Ft.parent&&xs(Ft.parent)&&Ft.parent.ce){const T=Object.keys(o).length>0;return m(),et(le,null,[E("slot",o,l)],T?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),m();const h=d&&Wu(d(o)),_=o.key||h&&h.key,y=et(le,{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 Wu(t){return t.some(i=>co(i)?!(i.type===Rt||i.type===le&&!Wu(i.children)):!0)?t:null}const cr=t=>t?hc(t)?xa(t):cr(t.parent):null,io=Ot(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=>cr(t.parent),$root:t=>cr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Gu(t),$forceUpdate:t=>t.f||(t.f=()=>{Er(t.update)}),$nextTick:t=>t.n||(t.n=Mu.bind(t.proxy)),$watch:t=>jd.bind(t)}),Xa=(t,i)=>t!==ft&&!t.__isScriptSetup&&ot(t,i),uf={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 U=h[i];if(U!==void 0)switch(U){case 1:return l[i];case 2:return u[i];case 4:return o[i];case 3:return d[i]}else{if(Xa(l,i))return h[i]=1,l[i];if(u!==ft&&ot(u,i))return h[i]=2,u[i];if(ot(d,i))return h[i]=3,d[i];if(o!==ft&&ot(o,i))return h[i]=4,o[i];dr&&(h[i]=0)}}const T=io[i];let w,z;if(T)return i==="$attrs"&&Nt(t.attrs,"get",""),T(t);if((w=_.__cssModules)&&(w=w[i]))return w;if(o!==ft&&ot(o,i))return h[i]=4,o[i];if(z=y.config.globalProperties,ot(z,i))return z[i]},set({_:t},i,o){const{data:l,setupState:u,ctx:d}=t;return Xa(u,i)?(u[i]=o,!0):l!==ft&&ot(l,i)?(l[i]=o,!0):ot(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!==ft&&_[0]!=="$"&&ot(t,_)||Xa(i,_)||ot(d,_)||ot(l,_)||ot(io,_)||ot(u.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(t,i,o){return o.get!=null?t._.accessCache[i]=0:ot(o,"value")&&this.set(t,i,o.value,null),Reflect.defineProperty(t,i,o)}};function fl(t){return Ee(t)?t.reduce((i,o)=>(i[o]=null,i),{}):t}let dr=!0;function cf(t){const i=Gu(t),o=t.proxy,l=t.ctx;dr=!1,i.beforeCreate&&hl(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:h,watch:_,provide:y,inject:T,created:w,beforeMount:z,mounted:U,beforeUpdate:V,updated:ue,activated:X,deactivated:Ae,beforeDestroy:$e,beforeUnmount:Q,destroyed:me,unmounted:oe,render:de,renderTracked:Ne,renderTriggered:nt,errorCaptured:ke,serverPrefetch:Te,expose:Be,inheritAttrs:Ce,components:ee,directives:pe,filters:Re}=i;if(T&&df(T,l,null),h)for(const De in h){const ne=h[De];He(ne)&&(l[De]=ne.bind(o))}if(u){const De=u.call(o,o);at(De)&&(t.data=bt(De))}if(dr=!0,d)for(const De in d){const ne=d[De],rt=He(ne)?ne.bind(o,o):He(ne.get)?ne.get.bind(o,o):Un,ge=!He(ne)&&He(ne.set)?ne.set.bind(o):Un,Me=we({get:rt,set:ge});Object.defineProperty(l,De,{enumerable:!0,configurable:!0,get:()=>Me.value,set:je=>Me.value=je})}if(_)for(const De in _)Ku(_[De],l,o,De);if(y){const De=He(y)?y.call(o):y;Reflect.ownKeys(De).forEach(ne=>{Iu(ne,De[ne])})}w&&hl(w,t,"c");function he(De,ne){Ee(ne)?ne.forEach(rt=>De(rt.bind(o))):ne&&De(ne.bind(o))}if(he(Qd,z),he(Li,U),he(ef,V),he(tf,ue),he(Yd,X),he(Jd,Ae),he(af,ke),he(of,Ne),he(sf,nt),he(_a,Q),he(ju,oe),he(nf,Te),Ee(Be))if(Be.length){const De=t.exposed||(t.exposed={});Be.forEach(ne=>{Object.defineProperty(De,ne,{get:()=>o[ne],set:rt=>o[ne]=rt,enumerable:!0})})}else t.exposed||(t.exposed={});de&&t.render===Un&&(t.render=de),Ce!=null&&(t.inheritAttrs=Ce),ee&&(t.components=ee),pe&&(t.directives=pe),Te&&Zu(t)}function df(t,i,o=Un){Ee(t)&&(t=fr(t));for(const l in t){const u=t[l];let d;at(u)?"default"in u?d=to(u.from||l,u.default,!0):d=to(u.from||l):d=to(u),Bt(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[l]=d}}function hl(t,i,o){vn(Ee(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,o)}function Ku(t,i,o,l){let u=l.includes(".")?Du(o,l):()=>o[l];if(xt(t)){const d=i[t];He(d)&&en(u,d)}else if(He(t))en(u,t.bind(o));else if(at(t))if(Ee(t))t.forEach(d=>Ku(d,i,o,l));else{const d=He(t.handler)?t.handler.bind(o):i[t.handler];He(d)&&en(u,d,t)}}function Gu(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(T=>ta(y,T,h,!0)),ta(y,i,h)),at(i)&&d.set(i,y),y}function ta(t,i,o,l=!1){const{mixins:u,extends:d}=i;d&&ta(t,d,o,!0),u&&u.forEach(h=>ta(t,h,o,!0));for(const h in i)if(!(l&&h==="expose")){const _=ff[h]||o&&o[h];t[h]=_?_(t[h],i[h]):i[h]}return t}const ff={data:pl,props:ml,emits:ml,methods:qs,computed:qs,beforeCreate:Wt,created:Wt,beforeMount:Wt,mounted:Wt,beforeUpdate:Wt,updated:Wt,beforeDestroy:Wt,beforeUnmount:Wt,destroyed:Wt,unmounted:Wt,activated:Wt,deactivated:Wt,errorCaptured:Wt,serverPrefetch:Wt,components:qs,directives:qs,watch:pf,provide:pl,inject:hf};function pl(t,i){return i?t?function(){return Ot(He(t)?t.call(this,this):t,He(i)?i.call(this,this):i)}:i:t}function hf(t,i){return qs(fr(t),fr(i))}function fr(t){if(Ee(t)){const i={};for(let o=0;o<t.length;o++)i[t[o]]=t[o];return i}return t}function Wt(t,i){return t?[...new Set([].concat(t,i))]:i}function qs(t,i){return t?Ot(Object.create(null),t,i):i}function ml(t,i){return t?Ee(t)&&Ee(i)?[...new Set([...t,...i])]:Ot(Object.create(null),fl(t),fl(i??{})):i}function pf(t,i){if(!t)return i;if(!i)return t;const o=Ot(Object.create(null),t);for(const l in i)o[l]=Wt(t[l],i[l]);return o}function qu(){return{app:null,config:{isNativeTag:su,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let mf=0;function gf(t,i){return function(l,u=null){He(l)||(l=Ot({},l)),u!=null&&!at(u)&&(u=null);const d=qu(),h=new WeakSet,_=[];let y=!1;const T=d.app={_uid:mf++,_component:l,_props:u,_container:null,_context:d,_instance:null,version:Gf,get config(){return d.config},set config(w){},use(w,...z){return h.has(w)||(w&&He(w.install)?(h.add(w),w.install(T,...z)):He(w)&&(h.add(w),w(T,...z))),T},mixin(w){return d.mixins.includes(w)||d.mixins.push(w),T},component(w,z){return z?(d.components[w]=z,T):d.components[w]},directive(w,z){return z?(d.directives[w]=z,T):d.directives[w]},mount(w,z,U){if(!y){const V=T._ceVNode||E(l,u);return V.appContext=d,U===!0?U="svg":U===!1&&(U=void 0),t(V,w,U),y=!0,T._container=w,w.__vue_app__=T,xa(V.component)}},onUnmount(w){_.push(w)},unmount(){y&&(vn(_,T._instance,16),t(null,T._container),delete T._container.__vue_app__)},provide(w,z){return d.provides[w]=z,T},runWithContext(w){const z=ws;ws=T;try{return w()}finally{ws=z}}};return T}}let ws=null;const vf=(t,i)=>i==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Tn(i)}Modifiers`]||t[`${Ci(i)}Modifiers`];function _f(t,i,...o){if(t.isUnmounted)return;const l=t.vnode.props||ft;let u=o;const d=i.startsWith("update:"),h=d&&vf(l,i.slice(7));h&&(h.trim&&(u=o.map(w=>xt(w)?w.trim():w)),h.number&&(u=o.map(fa)));let _,y=l[_=Wa(i)]||l[_=Wa(Tn(i))];!y&&d&&(y=l[_=Wa(Ci(i))]),y&&vn(y,t,6,u);const T=l[_+"Once"];if(T){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,vn(T,t,6,u)}}const yf=new WeakMap;function Yu(t,i,o=!1){const l=o?yf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const d=t.emits;let h={},_=!1;if(!He(t)){const y=T=>{const w=Yu(T,i,!0);w&&(_=!0,Ot(h,w))};!o&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!d&&!_?(at(t)&&l.set(t,null),null):(Ee(d)?d.forEach(y=>h[y]=null):Ot(h,d),at(t)&&l.set(t,h),h)}function ya(t,i){return!t||!ua(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ot(t,i[0].toLowerCase()+i.slice(1))||ot(t,Ci(i))||ot(t,i))}function gl(t){const{type:i,vnode:o,proxy:l,withProxy:u,propsOptions:[d],slots:h,attrs:_,emit:y,render:T,renderCache:w,props:z,data:U,setupState:V,ctx:ue,inheritAttrs:X}=t,Ae=Qo(t);let $e,Q;try{if(o.shapeFlag&4){const oe=u||l,de=oe;$e=Bn(T.call(de,oe,w,z,V,U,ue)),Q=_}else{const oe=i;$e=Bn(oe.length>1?oe(z,{attrs:_,slots:h,emit:y}):oe(z,null)),Q=i.props?_:bf(_)}}catch(oe){so.length=0,ma(oe,t,1),$e=E(Rt)}let me=$e;if(Q&&X!==!1){const oe=Object.keys(Q),{shapeFlag:de}=me;oe.length&&de&7&&(d&&oe.some(ca)&&(Q=xf(Q,d)),me=Pi(me,Q,!1,!0))}return o.dirs&&(me=Pi(me,null,!1,!0),me.dirs=me.dirs?me.dirs.concat(o.dirs):o.dirs),o.transition&&lo(me,o.transition),$e=me,Qo(Ae),$e}const bf=t=>{let i;for(const o in t)(o==="class"||o==="style"||ua(o))&&((i||(i={}))[o]=t[o]);return i},xf=(t,i)=>{const o={};for(const l in t)(!ca(l)||!(l.slice(9)in i))&&(o[l]=t[l]);return o};function wf(t,i,o){const{props:l,children:u,component:d}=t,{props:h,children:_,patchFlag:y}=i,T=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&y>=0){if(y&1024)return!0;if(y&16)return l?vl(l,h,T):!!h;if(y&8){const w=i.dynamicProps;for(let z=0;z<w.length;z++){const U=w[z];if(Ju(h,l,U)&&!ya(T,U))return!0}}}else return(u||_)&&(!_||!_.$stable)?!0:l===h?!1:l?h?vl(l,h,T):!0:!!h;return!1}function vl(t,i,o){const l=Object.keys(i);if(l.length!==Object.keys(t).length)return!0;for(let u=0;u<l.length;u++){const d=l[u];if(Ju(i,t,d)&&!ya(o,d))return!0}return!1}function Ju(t,i,o){const l=t[o],u=i[o];return o==="style"&&at(l)&&at(u)?!Si(l,u):l!==u}function kf({vnode:t,parent:i,suspense:o},l){for(;i;){const u=i.subTree;if(u.suspense&&u.suspense.activeBranch===t&&(u.suspense.vnode.el=u.el=l,t=u),u===t)(t=i.vnode).el=l,i=i.parent;else break}o&&o.activeBranch===t&&(o.vnode.el=l)}const Xu={},Qu=()=>Object.create(Xu),ec=t=>Object.getPrototypeOf(t)===Xu;function Sf(t,i,o,l=!1){const u={},d=Qu();t.propsDefaults=Object.create(null),tc(t,i,u,d);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);o?t.props=l?u:Od(u):t.type.props?t.props=u:t.props=d,t.attrs=d}function Pf(t,i,o,l){const{props:u,attrs:d,vnode:{patchFlag:h}}=t,_=tt(u),[y]=t.propsOptions;let T=!1;if((l||h>0)&&!(h&16)){if(h&8){const w=t.vnode.dynamicProps;for(let z=0;z<w.length;z++){let U=w[z];if(ya(t.emitsOptions,U))continue;const V=i[U];if(y)if(ot(d,U))V!==d[U]&&(d[U]=V,T=!0);else{const ue=Tn(U);u[ue]=hr(y,_,ue,V,t,!1)}else V!==d[U]&&(d[U]=V,T=!0)}}}else{tc(t,i,u,d)&&(T=!0);let w;for(const z in _)(!i||!ot(i,z)&&((w=Ci(z))===z||!ot(i,w)))&&(y?o&&(o[z]!==void 0||o[w]!==void 0)&&(u[z]=hr(y,_,z,void 0,t,!0)):delete u[z]);if(d!==_)for(const z in d)(!i||!ot(i,z))&&(delete d[z],T=!0)}T&&oi(t.attrs,"set","")}function tc(t,i,o,l){const[u,d]=t.propsOptions;let h=!1,_;if(i)for(let y in i){if(Xs(y))continue;const T=i[y];let w;u&&ot(u,w=Tn(y))?!d||!d.includes(w)?o[w]=T:(_||(_={}))[w]=T:ya(t.emitsOptions,y)||(!(y in l)||T!==l[y])&&(l[y]=T,h=!0)}if(d){const y=tt(o),T=_||ft;for(let w=0;w<d.length;w++){const z=d[w];o[z]=hr(u,y,z,T[z],t,!ot(T,z))}}return h}function hr(t,i,o,l,u,d){const h=t[o];if(h!=null){const _=ot(h,"default");if(_&&l===void 0){const y=h.default;if(h.type!==Function&&!h.skipFactory&&He(y)){const{propsDefaults:T}=u;if(o in T)l=T[o];else{const w=go(u);l=T[o]=y.call(null,i),w()}}else l=y;u.ce&&u.ce._setProp(o,l)}h[0]&&(d&&!_?l=!1:h[1]&&(l===""||l===Ci(o))&&(l=!0))}return l}const Tf=new WeakMap;function nc(t,i,o=!1){const l=o?Tf:i.propsCache,u=l.get(t);if(u)return u;const d=t.props,h={},_=[];let y=!1;if(!He(t)){const w=z=>{y=!0;const[U,V]=nc(z,i,!0);Ot(h,U),V&&_.push(...V)};!o&&i.mixins.length&&i.mixins.forEach(w),t.extends&&w(t.extends),t.mixins&&t.mixins.forEach(w)}if(!d&&!y)return at(t)&&l.set(t,_s),_s;if(Ee(d))for(let w=0;w<d.length;w++){const z=Tn(d[w]);_l(z)&&(h[z]=ft)}else if(d)for(const w in d){const z=Tn(w);if(_l(z)){const U=d[w],V=h[z]=Ee(U)||He(U)?{type:U}:Ot({},U),ue=V.type;let X=!1,Ae=!0;if(Ee(ue))for(let $e=0;$e<ue.length;++$e){const Q=ue[$e],me=He(Q)&&Q.name;if(me==="Boolean"){X=!0;break}else me==="String"&&(Ae=!1)}else X=He(ue)&&ue.name==="Boolean";V[0]=X,V[1]=Ae,(X||ot(V,"default"))&&_.push(z)}}const T=[h,_];return at(t)&&l.set(t,T),T}function _l(t){return t[0]!=="$"&&!Xs(t)}const Or=t=>t==="_"||t==="_ctx"||t==="$stable",zr=t=>Ee(t)?t.map(Bn):[Bn(t)],Cf=(t,i,o)=>{if(i._n)return i;const l=ye((...u)=>zr(i(...u)),o);return l._c=!1,l},ic=(t,i,o)=>{const l=t._ctx;for(const u in t){if(Or(u))continue;const d=t[u];if(He(d))i[u]=Cf(u,d,l);else if(d!=null){const h=zr(d);i[u]=()=>h}}},sc=(t,i)=>{const o=zr(i);t.slots.default=()=>o},oc=(t,i,o)=>{for(const l in i)(o||!Or(l))&&(t[l]=i[l])},Lf=(t,i,o)=>{const l=t.slots=Qu();if(t.vnode.shapeFlag&32){const u=i._;u?(oc(l,i,o),o&&uu(l,"_",u,!0)):ic(i,l)}else i&&sc(t,i)},Mf=(t,i,o)=>{const{vnode:l,slots:u}=t;let d=!0,h=ft;if(l.shapeFlag&32){const _=i._;_?o&&_===1?d=!1:oc(u,i,o):(d=!i.$stable,ic(i,u)),h=i}else i&&(sc(t,i),h={default:1});if(d)for(const _ in u)!Or(_)&&h[_]==null&&delete u[_]},Qt=If;function Ef(t){return Of(t)}function Of(t,i){const o=ha();o.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:h,createText:_,createComment:y,setText:T,setElementText:w,parentNode:z,nextSibling:U,setScopeId:V=Un,insertStaticContent:ue}=t,X=(b,g,M,Z=null,B=null,H=null,ie=void 0,F=null,Y=!!g.dynamicChildren)=>{if(b===g)return;b&&!Ki(b,g)&&(Z=C(b),je(b,B,H,!0),b=null),g.patchFlag===-2&&(Y=!1,g.dynamicChildren=null);const{type:j,ref:Se,shapeFlag:ce}=g;switch(j){case ba:Ae(b,g,M,Z);break;case Rt:$e(b,g,M,Z);break;case er:b==null&&Q(g,M,Z,ie);break;case le:ee(b,g,M,Z,B,H,ie,F,Y);break;default:ce&1?de(b,g,M,Z,B,H,ie,F,Y):ce&6?pe(b,g,M,Z,B,H,ie,F,Y):(ce&64||ce&128)&&j.process(b,g,M,Z,B,H,ie,F,Y,lt)}Se!=null&&B?no(Se,b&&b.ref,H,g||b,!g):Se==null&&b&&b.ref!=null&&no(b.ref,null,H,b,!0)},Ae=(b,g,M,Z)=>{if(b==null)l(g.el=_(g.children),M,Z);else{const B=g.el=b.el;g.children!==b.children&&T(B,g.children)}},$e=(b,g,M,Z)=>{b==null?l(g.el=y(g.children||""),M,Z):g.el=b.el},Q=(b,g,M,Z)=>{[b.el,b.anchor]=ue(b.children,g,M,Z,b.el,b.anchor)},me=({el:b,anchor:g},M,Z)=>{let B;for(;b&&b!==g;)B=U(b),l(b,M,Z),b=B;l(g,M,Z)},oe=({el:b,anchor:g})=>{let M;for(;b&&b!==g;)M=U(b),u(b),b=M;u(g)},de=(b,g,M,Z,B,H,ie,F,Y)=>{if(g.type==="svg"?ie="svg":g.type==="math"&&(ie="mathml"),b==null)Ne(g,M,Z,B,H,ie,F,Y);else{const j=b.el&&b.el._isVueCE?b.el:null;try{j&&j._beginPatch(),Te(b,g,B,H,ie,F,Y)}finally{j&&j._endPatch()}}},Ne=(b,g,M,Z,B,H,ie,F)=>{let Y,j;const{props:Se,shapeFlag:ce,transition:ae,dirs:Pe}=b;if(Y=b.el=h(b.type,H,Se&&Se.is,Se),ce&8?w(Y,b.children):ce&16&&ke(b.children,Y,null,Z,B,Qa(b,H),ie,F),Pe&&Ui(b,null,Z,"created"),nt(Y,b,b.scopeId,ie,Z),Se){for(const be in Se)be!=="value"&&!Xs(be)&&d(Y,be,null,Se[be],H,Z);"value"in Se&&d(Y,"value",null,Se.value,H),(j=Se.onVnodeBeforeMount)&&Nn(j,Z,b)}Pe&&Ui(b,null,Z,"beforeMount");const We=zf(B,ae);We&&ae.beforeEnter(Y),l(Y,g,M),((j=Se&&Se.onVnodeMounted)||We||Pe)&&Qt(()=>{try{j&&Nn(j,Z,b),We&&ae.enter(Y),Pe&&Ui(b,null,Z,"mounted")}finally{}},B)},nt=(b,g,M,Z,B)=>{if(M&&V(b,M),Z)for(let H=0;H<Z.length;H++)V(b,Z[H]);if(B){let H=B.subTree;if(g===H||uc(H.type)&&(H.ssContent===g||H.ssFallback===g)){const ie=B.vnode;nt(b,ie,ie.scopeId,ie.slotScopeIds,B.parent)}}},ke=(b,g,M,Z,B,H,ie,F,Y=0)=>{for(let j=Y;j<b.length;j++){const Se=b[j]=F?si(b[j]):Bn(b[j]);X(null,Se,g,M,Z,B,H,ie,F)}},Te=(b,g,M,Z,B,H,ie)=>{const F=g.el=b.el;let{patchFlag:Y,dynamicChildren:j,dirs:Se}=g;Y|=b.patchFlag&16;const ce=b.props||ft,ae=g.props||ft;let Pe;if(M&&Zi(M,!1),(Pe=ae.onVnodeBeforeUpdate)&&Nn(Pe,M,g,b),Se&&Ui(g,b,M,"beforeUpdate"),M&&Zi(M,!0),j&&(!b.dynamicChildren||b.dynamicChildren.length!==j.length)&&(Y=0,ie=!1,j=null),(ce.innerHTML&&ae.innerHTML==null||ce.textContent&&ae.textContent==null)&&w(F,""),j?Be(b.dynamicChildren,j,F,M,Z,Qa(g,B),H):ie||ne(b,g,F,null,M,Z,Qa(g,B),H,!1),Y>0){if(Y&16)Ce(F,ce,ae,M,B);else if(Y&2&&ce.class!==ae.class&&d(F,"class",null,ae.class,B),Y&4&&d(F,"style",ce.style,ae.style,B),Y&8){const We=g.dynamicProps;for(let be=0;be<We.length;be++){const Ye=We[be],dt=ce[Ye],gt=ae[Ye];(gt!==dt||Ye==="value")&&d(F,Ye,dt,gt,B,M)}}Y&1&&b.children!==g.children&&w(F,g.children)}else!ie&&j==null&&Ce(F,ce,ae,M,B);((Pe=ae.onVnodeUpdated)||Se)&&Qt(()=>{Pe&&Nn(Pe,M,g,b),Se&&Ui(g,b,M,"updated")},Z)},Be=(b,g,M,Z,B,H,ie)=>{for(let F=0;F<g.length;F++){const Y=b[F],j=g[F],Se=Y.el&&(Y.type===le||!Ki(Y,j)||Y.shapeFlag&198)?z(Y.el):M;X(Y,j,Se,null,Z,B,H,ie,!0)}},Ce=(b,g,M,Z,B)=>{if(g!==M){if(g!==ft)for(const H in g)!Xs(H)&&!(H in M)&&d(b,H,g[H],null,B,Z);for(const H in M){if(Xs(H))continue;const ie=M[H],F=g[H];ie!==F&&H!=="value"&&d(b,H,F,ie,B,Z)}"value"in M&&d(b,"value",g.value,M.value,B)}},ee=(b,g,M,Z,B,H,ie,F,Y)=>{const j=g.el=b?b.el:_(""),Se=g.anchor=b?b.anchor:_("");let{patchFlag:ce,dynamicChildren:ae,slotScopeIds:Pe}=g;Pe&&(F=F?F.concat(Pe):Pe),b==null?(l(j,M,Z),l(Se,M,Z),ke(g.children||[],M,Se,B,H,ie,F,Y)):ce>0&&ce&64&&ae&&b.dynamicChildren&&b.dynamicChildren.length===ae.length?(Be(b.dynamicChildren,ae,M,B,H,ie,F),(g.key!=null||B&&g===B.subTree)&&ac(b,g,!0)):ne(b,g,M,Se,B,H,ie,F,Y)},pe=(b,g,M,Z,B,H,ie,F,Y)=>{g.slotScopeIds=F,b==null?g.shapeFlag&512?B.ctx.activate(g,M,Z,ie,Y):Re(g,M,Z,B,H,ie,Y):Ze(b,g,Y)},Re=(b,g,M,Z,B,H,ie)=>{const F=b.component=Vf(b,Z,B);if(ga(b)&&(F.ctx.renderer=lt),Uf(F,!1,ie),F.asyncDep){if(B&&B.registerDep(F,he,ie),!b.el){const Y=F.subTree=E(Rt);$e(null,Y,g,M),b.placeholder=Y.el}}else he(F,b,g,M,B,H,ie)},Ze=(b,g,M)=>{const Z=g.component=b.component;if(wf(b,g,M))if(Z.asyncDep&&!Z.asyncResolved){De(Z,g,M);return}else Z.next=g,Z.update();else g.el=b.el,Z.vnode=g},he=(b,g,M,Z,B,H,ie)=>{const F=()=>{if(b.isMounted){let{next:ce,bu:ae,u:Pe,parent:We,vnode:be}=b;{const Tt=rc(b);if(Tt){ce&&(ce.el=be.el,De(b,ce,ie)),Tt.asyncDep.then(()=>{Qt(()=>{b.isUnmounted||j()},B)});return}}let Ye=ce,dt;Zi(b,!1),ce?(ce.el=be.el,De(b,ce,ie)):ce=be,ae&&qo(ae),(dt=ce.props&&ce.props.onVnodeBeforeUpdate)&&Nn(dt,We,ce,be),Zi(b,!0);const gt=gl(b),_t=b.subTree;b.subTree=gt,X(_t,gt,z(_t.el),C(_t),b,B,H),ce.el=gt.el,Ye===null&&kf(b,gt.el),Pe&&Qt(Pe,B),(dt=ce.props&&ce.props.onVnodeUpdated)&&Qt(()=>Nn(dt,We,ce,be),B)}else{let ce;const{el:ae,props:Pe}=g,{bm:We,m:be,parent:Ye,root:dt,type:gt}=b,_t=xs(g);Zi(b,!1),We&&qo(We),!_t&&(ce=Pe&&Pe.onVnodeBeforeMount)&&Nn(ce,Ye,g),Zi(b,!0);{dt.ce&&dt.ce._hasShadowRoot()&&dt.ce._injectChildStyle(gt,b.parent?b.parent.type:void 0);const Tt=b.subTree=gl(b);X(null,Tt,M,Z,b,B,H),g.el=Tt.el}if(be&&Qt(be,B),!_t&&(ce=Pe&&Pe.onVnodeMounted)){const Tt=g;Qt(()=>Nn(ce,Ye,Tt),B)}(g.shapeFlag&256||Ye&&xs(Ye.vnode)&&Ye.vnode.shapeFlag&256)&&b.a&&Qt(b.a,B),b.isMounted=!0,g=M=Z=null}};b.scope.on();const Y=b.effect=new hu(F);b.scope.off();const j=b.update=Y.run.bind(Y),Se=b.job=Y.runIfDirty.bind(Y);Se.i=b,Se.id=b.uid,Y.scheduler=()=>Er(Se),Zi(b,!0),j()},De=(b,g,M)=>{g.component=b;const Z=b.vnode.props;b.vnode=g,b.next=null,Pf(b,g.props,Z,M),Mf(b,g.children,M),Zn(),ll(b),Hn()},ne=(b,g,M,Z,B,H,ie,F,Y=!1)=>{const j=b&&b.children,Se=b?b.shapeFlag:0,ce=g.children,{patchFlag:ae,shapeFlag:Pe}=g;if(ae>0){if(ae&128){ge(j,ce,M,Z,B,H,ie,F,Y);return}else if(ae&256){rt(j,ce,M,Z,B,H,ie,F,Y);return}}Pe&8?(Se&16&&W(j,B,H),ce!==j&&w(M,ce)):Se&16?Pe&16?ge(j,ce,M,Z,B,H,ie,F,Y):W(j,B,H,!0):(Se&8&&w(M,""),Pe&16&&ke(ce,M,Z,B,H,ie,F,Y))},rt=(b,g,M,Z,B,H,ie,F,Y)=>{b=b||_s,g=g||_s;const j=b.length,Se=g.length,ce=Math.min(j,Se);let ae;for(ae=0;ae<ce;ae++){const Pe=g[ae]=Y?si(g[ae]):Bn(g[ae]);X(b[ae],Pe,M,null,B,H,ie,F,Y)}j>Se?W(b,B,H,!0,!1,ce):ke(g,M,Z,B,H,ie,F,Y,ce)},ge=(b,g,M,Z,B,H,ie,F,Y)=>{let j=0;const Se=g.length;let ce=b.length-1,ae=Se-1;for(;j<=ce&&j<=ae;){const Pe=b[j],We=g[j]=Y?si(g[j]):Bn(g[j]);if(Ki(Pe,We))X(Pe,We,M,null,B,H,ie,F,Y);else break;j++}for(;j<=ce&&j<=ae;){const Pe=b[ce],We=g[ae]=Y?si(g[ae]):Bn(g[ae]);if(Ki(Pe,We))X(Pe,We,M,null,B,H,ie,F,Y);else break;ce--,ae--}if(j>ce){if(j<=ae){const Pe=ae+1,We=Pe<Se?g[Pe].el:Z;for(;j<=ae;)X(null,g[j]=Y?si(g[j]):Bn(g[j]),M,We,B,H,ie,F,Y),j++}}else if(j>ae)for(;j<=ce;)je(b[j],B,H,!0),j++;else{const Pe=j,We=j,be=new Map;for(j=We;j<=ae;j++){const kt=g[j]=Y?si(g[j]):Bn(g[j]);kt.key!=null&&be.set(kt.key,j)}let Ye,dt=0;const gt=ae-We+1;let _t=!1,Tt=0;const _n=new Array(gt);for(j=0;j<gt;j++)_n[j]=0;for(j=Pe;j<=ce;j++){const kt=b[j];if(dt>=gt){je(kt,B,H,!0);continue}let $t;if(kt.key!=null)$t=be.get(kt.key);else for(Ye=We;Ye<=ae;Ye++)if(_n[Ye-We]===0&&Ki(kt,g[Ye])){$t=Ye;break}$t===void 0?je(kt,B,H,!0):(_n[$t-We]=j+1,$t>=Tt?Tt=$t:_t=!0,X(kt,g[$t],M,null,B,H,ie,F,Y),dt++)}const ci=_t?Af(_n):_s;for(Ye=ci.length-1,j=gt-1;j>=0;j--){const kt=We+j,$t=g[kt],En=g[kt+1],Vt=kt+1<Se?En.el||lc(En):Z;_n[j]===0?X(null,$t,M,Vt,B,H,ie,F,Y):_t&&(Ye<0||j!==ci[Ye]?Me($t,M,Vt,2):Ye--)}}},Me=(b,g,M,Z,B=null)=>{const{el:H,type:ie,transition:F,children:Y,shapeFlag:j}=b;if(j&6){Me(b.component.subTree,g,M,Z);return}if(j&128){b.suspense.move(g,M,Z);return}if(j&64){ie.move(b,g,M,lt);return}if(ie===le){l(H,g,M);for(let ce=0;ce<Y.length;ce++)Me(Y[ce],g,M,Z);l(b.anchor,g,M);return}if(ie===er){me(b,g,M);return}if(Z!==2&&j&1&&F)if(Z===0)F.persisted&&!H[pn]?l(H,g,M):(F.beforeEnter(H),l(H,g,M),Qt(()=>F.enter(H),B));else{const{leave:ce,delayLeave:ae,afterLeave:Pe}=F,We=()=>{b.ctx.isUnmounted?u(H):l(H,g,M)},be=()=>{const Ye=H._isLeaving||!!H[pn];H._isLeaving&&H[pn](!0),F.persisted&&!Ye?We():ce(H,()=>{We(),Pe&&Pe()})};ae?ae(H,We,be):be()}else l(H,g,M)},je=(b,g,M,Z=!1,B=!1)=>{const{type:H,props:ie,ref:F,children:Y,dynamicChildren:j,shapeFlag:Se,patchFlag:ce,dirs:ae,cacheIndex:Pe,memo:We}=b;if(ce===-2&&(B=!1),F!=null&&(Zn(),no(F,null,M,b,!0),Hn()),Pe!=null&&(g.renderCache[Pe]=void 0),Se&256){g.ctx.deactivate(b);return}const be=Se&1&&ae,Ye=!xs(b);let dt;if(Ye&&(dt=ie&&ie.onVnodeBeforeUnmount)&&Nn(dt,g,b),Se&6)I(b.component,M,Z);else{if(Se&128){b.suspense.unmount(M,Z);return}be&&Ui(b,null,g,"beforeUnmount"),Se&64?b.type.remove(b,g,M,lt,Z):j&&!j.hasOnce&&(H!==le||ce>0&&ce&64)?W(j,g,M,!1,!0):(H===le&&ce&384||!B&&Se&16)&&W(Y,g,M),Z&&te(b)}const gt=We!=null&&Pe==null;(Ye&&(dt=ie&&ie.onVnodeUnmounted)||be||gt)&&Qt(()=>{dt&&Nn(dt,g,b),be&&Ui(b,null,g,"unmounted"),gt&&(b.el=null)},M)},te=b=>{const{type:g,el:M,anchor:Z,transition:B}=b;if(g===le){$(M,Z);return}if(g===er){oe(b);return}const H=()=>{u(M),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(b.shapeFlag&1&&B&&!B.persisted){const{leave:ie,delayLeave:F}=B,Y=()=>ie(M,H);F?F(b.el,H,Y):Y()}else H()},$=(b,g)=>{let M;for(;b!==g;)M=U(b),u(b),b=M;u(g)},I=(b,g,M)=>{const{bum:Z,scope:B,job:H,subTree:ie,um:F,m:Y,a:j}=b;yl(Y),yl(j),Z&&qo(Z),B.stop(),H&&(H.flags|=8,je(ie,b,g,M)),F&&Qt(F,g),Qt(()=>{b.isUnmounted=!0},g)},W=(b,g,M,Z=!1,B=!1,H=0)=>{for(let ie=H;ie<b.length;ie++)je(b[ie],g,M,Z,B)},C=b=>{if(b.shapeFlag&6)return C(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const g=U(b.anchor||b.el),M=g&&g[Wd];return M?U(M):g};let O=!1;const ht=(b,g,M)=>{let Z;b==null?g._vnode&&(je(g._vnode,null,null,!0),Z=g._vnode.component):X(g._vnode||null,b,g,null,null,null,M),g._vnode=b,O||(O=!0,ll(Z),Ou(),O=!1)},lt={p:X,um:je,m:Me,r:te,mt:Re,mc:ke,pc:ne,pbc:Be,n:C,o:t};return{render:ht,hydrate:void 0,createApp:gf(ht)}}function Qa({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 Zi({effect:t,job:i},o){o?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function zf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function ac(t,i,o=!1){const l=t.children,u=i.children;if(Ee(l)&&Ee(u))for(let d=0;d<l.length;d++){const h=l[d];let _=u[d];_.shapeFlag&1&&!_.dynamicChildren&&((_.patchFlag<=0||_.patchFlag===32)&&(_=u[d]=si(u[d]),_.el=h.el),!o&&_.patchFlag!==-2&&ac(h,_)),_.type===ba&&(_.patchFlag===-1&&(_=u[d]=si(_)),_.el=h.el),_.type===Rt&&!_.el&&(_.el=h.el)}}function Af(t){const i=t.slice(),o=[0];let l,u,d,h,_;const y=t.length;for(l=0;l<y;l++){const T=t[l];if(T!==0){if(u=o[o.length-1],t[u]<T){i[l]=u,o.push(l);continue}for(d=0,h=o.length-1;d<h;)_=d+h>>1,t[o[_]]<T?d=_+1:h=_;T<t[o[d]]&&(d>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 rc(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:rc(i)}function yl(t){if(t)for(let i=0;i<t.length;i++)t[i].flags|=8}function lc(t){if(t.placeholder)return t.placeholder;const i=t.component;return i?lc(i.subTree):null}const uc=t=>t.__isSuspense;function If(t,i){i&&i.pendingBranch?Ee(t)?i.effects.push(...t):i.effects.push(t):Ud(t)}const le=Symbol.for("v-fgt"),ba=Symbol.for("v-txt"),Rt=Symbol.for("v-cmt"),er=Symbol.for("v-stc"),so=[];let on=null;function m(t=!1){so.push(on=t?null:[])}function $f(){so.pop(),on=so[so.length-1]||null}let uo=1;function na(t,i=!1){uo+=t,t<0&&on&&i&&(on.hasOnce=!0)}function cc(t){return t.dynamicChildren=uo>0?on||_s:null,$f(),uo>0&&on&&on.push(t),t}function v(t,i,o,l,u,d){return cc(r(t,i,o,l,u,d,!0))}function et(t,i,o,l,u){return cc(E(t,i,o,l,u,!0))}function co(t){return t?t.__v_isVNode===!0:!1}function Ki(t,i){return t.type===i.type&&t.key===i.key}const dc=({key:t})=>t??null,Yo=({ref:t,ref_key:i,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?xt(t)||Bt(t)||He(t)?{i:Ft,r:t,k:i,f:!!o}:t:null);function r(t,i=null,o=null,l=0,u=null,d=t===le?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&dc(i),ref:i&&Yo(i),scopeId:Au,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:Ft};return _?(ia(y,o),d&128&&t.normalize(y)):o&&(y.shapeFlag|=xt(o)?8:16),uo>0&&!h&&on&&(y.patchFlag>0||d&6)&&y.patchFlag!==32&&on.push(y),y}const E=Df;function Df(t,i=null,o=null,l=0,u=null,d=!1){if((!t||t===rf)&&(t=Rt),co(t)){const _=Pi(t,i,!0);return o&&ia(_,o),uo>0&&!d&&on&&(_.shapeFlag&6?on[on.indexOf(t)]=_:on.push(_)),_.patchFlag=-2,_}if(Wf(t)&&(t=t.__vccOpts),i){i=Nf(i);let{class:_,style:y}=i;_&&!xt(_)&&(i.class=Le(_)),at(y)&&(Mr(y)&&!Ee(y)&&(y=Ot({},y)),i.style=Ss(y))}const h=xt(t)?1:uc(t)?128:Nu(t)?64:at(t)?4:He(t)?2:0;return r(t,i,o,l,u,h,d,!0)}function Nf(t){return t?Mr(t)||ec(t)?Ot({},t):t:null}function Pi(t,i,o=!1,l=!1){const{props:u,ref:d,patchFlag:h,children:_,transition:y}=t,T=i?Rf(u||{},i):u,w={__v_isVNode:!0,__v_skip:!0,type:t.type,props:T,key:T&&dc(T),ref:i&&i.ref?o&&d?Ee(d)?d.concat(Yo(i)):[d,Yo(i)]:Yo(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!==le?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&&Pi(t.ssContent),ssFallback:t.ssFallback&&Pi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&lo(w,y.clone(w)),w}function D(t=" ",i=0){return E(ba,null,t,i)}function R(t="",i=!1){return i?(m(),et(Rt,null,t)):E(Rt,null,t)}function Bn(t){return t==null||typeof t=="boolean"?E(Rt):Ee(t)?E(le,null,t.slice()):co(t)?si(t):E(ba,null,String(t))}function si(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Pi(t)}function ia(t,i){let o=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(Ee(i))o=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),ia(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=i._;!u&&!ec(i)?i._ctx=Ft:u===3&&Ft&&(Ft.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(He(i)){if(l&65){ia(t,{default:i});return}i={default:i,_ctx:Ft},o=32}else i=String(i),l&64?(o=16,i=[D(i)]):o=8;t.children=i,t.shapeFlag|=o}function Rf(...t){const i={};for(let o=0;o<t.length;o++){const l=t[o];for(const u in l)if(u==="class")i.class!==l.class&&(i.class=Le([i.class,l.class]));else if(u==="style")i.style=Ss([i.style,l.style]);else if(ua(u)){const d=i[u],h=l[u];h&&d!==h&&!(Ee(d)&&d.includes(h))?i[u]=d?[].concat(d,h):h:h==null&&d==null&&!ca(u)&&(i[u]=h)}else u!==""&&(i[u]=l[u])}return i}function Nn(t,i,o,l=null){vn(t,i,7,[o,l])}const Ff=qu();let Bf=0;function Vf(t,i,o){const l=t.type,u=(i?i.appContext:t.appContext)||Ff,d={uid:Bf++,vnode:t,type:l,parent:i,appContext:u,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new fd(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:i?i.provides:Object.create(u.provides),ids:i?i.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nc(l,u),emitsOptions:Yu(l,u),emit:null,emitted:null,propsDefaults:ft,inheritAttrs:l.inheritAttrs,ctx:ft,data:ft,props:ft,attrs:ft,slots:ft,refs:ft,setupState:ft,setupContext:null,suspense:o,suspenseId:o?o.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return d.ctx={_:d},d.root=i?i.root:d,d.emit=_f.bind(null,d),t.ce&&t.ce(d),d}let Gt=null;const fc=()=>Gt||Ft;let sa,pr;{const t=ha(),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)}};sa=i("__VUE_INSTANCE_SETTERS__",o=>Gt=o),pr=i("__VUE_SSR_SETTERS__",o=>fo=o)}const go=t=>{const i=Gt;return sa(t),t.scope.on(),()=>{t.scope.off(),sa(i)}},bl=()=>{Gt&&Gt.scope.off(),sa(null)};function hc(t){return t.vnode.shapeFlag&4}let fo=!1;function Uf(t,i=!1,o=!1){i&&pr(i);const{props:l,children:u}=t.vnode,d=hc(t);Sf(t,l,d,i),Lf(t,u,o||i);const h=d?Zf(t,i):void 0;return i&&pr(!1),h}function Zf(t,i){const o=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,uf);const{setup:l}=o;if(l){Zn();const u=t.setupContext=l.length>1?jf(t):null,d=go(t),h=mo(l,t,0,[t.props,u]),_=ou(h);if(Hn(),d(),(_||t.sp)&&!xs(t)&&Zu(t),_){if(h.then(bl,bl),i)return h.then(y=>{xl(t,y)}).catch(y=>{ma(y,t,0)});t.asyncDep=h}else xl(t,h)}else pc(t)}function xl(t,i,o){He(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:at(i)&&(t.setupState=Cu(i)),pc(t)}function pc(t,i,o){const l=t.type;t.render||(t.render=l.render||Un);{const u=go(t);Zn();try{cf(t)}finally{Hn(),u()}}}const Hf={get(t,i){return Nt(t,"get",""),t[i]}};function jf(t){const i=o=>{t.exposed=o||{}};return{attrs:new Proxy(t.attrs,Hf),slots:t.slots,emit:t.emit,expose:i}}function xa(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Cu(zd(t.exposed)),{get(i,o){if(o in i)return i[o];if(o in io)return io[o](t)},has(i,o){return o in i||o in io}})):t.proxy}function Wf(t){return He(t)&&"__vccOpts"in t}const we=(t,i)=>Nd(t,i,fo);function Kf(t,i,o){try{na(-1);const l=arguments.length;return l===2?at(i)&&!Ee(i)?co(i)?E(t,null,[i]):E(t,i):E(t,null,i):(l>3?o=Array.prototype.slice.call(arguments,2):l===3&&co(o)&&(o=[o]),E(t,i,o))}finally{na(1)}}const Gf="3.5.39";/**
|
|
* @vue/runtime-dom v3.5.39
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
* @license MIT
|
|
**/let mr;const wl=typeof window<"u"&&window.trustedTypes;if(wl)try{mr=wl.createPolicy("vue",{createHTML:t=>t})}catch{}const mc=mr?t=>mr.createHTML(t):t=>t,qf="http://www.w3.org/2000/svg",Yf="http://www.w3.org/1998/Math/MathML",ii=typeof document<"u"?document:null,kl=ii&&ii.createElement("template"),Jf={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(qf,t):i==="mathml"?ii.createElementNS(Yf,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{kl.innerHTML=mc(l==="svg"?`<svg>${t}</svg>`:l==="mathml"?`<math>${t}</math>`:t);const _=kl.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]}},wi="transition",Ks="animation",ho=Symbol("_vtc"),gc={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},Xf=Ot({},Ru,gc),Qf=t=>(t.displayName="Transition",t.props=Xf,t),eh=Qf((t,{slots:i})=>Kf(qd,th(t),i)),Hi=(t,i=[])=>{Ee(t)?t.forEach(o=>o(...i)):t&&t(...i)},Sl=t=>t?Ee(t)?t.some(i=>i.length>1):t.length>1:!1;function th(t){const i={};for(const ee in t)ee in gc||(i[ee]=t[ee]);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:T=h,appearToClass:w=_,leaveFromClass:z=`${o}-leave-from`,leaveActiveClass:U=`${o}-leave-active`,leaveToClass:V=`${o}-leave-to`}=t,ue=nh(u),X=ue&&ue[0],Ae=ue&&ue[1],{onBeforeEnter:$e,onEnter:Q,onEnterCancelled:me,onLeave:oe,onLeaveCancelled:de,onBeforeAppear:Ne=$e,onAppear:nt=Q,onAppearCancelled:ke=me}=i,Te=(ee,pe,Re,Ze)=>{ee._enterCancelled=Ze,ji(ee,pe?w:_),ji(ee,pe?T:h),Re&&Re()},Be=(ee,pe)=>{ee._isLeaving=!1,ji(ee,z),ji(ee,V),ji(ee,U),pe&&pe()},Ce=ee=>(pe,Re)=>{const Ze=ee?nt:Q,he=()=>Te(pe,ee,Re);Hi(Ze,[pe,he]),Pl(()=>{ji(pe,ee?y:d),ni(pe,ee?w:_),Sl(Ze)||Tl(pe,l,X,he)})};return Ot(i,{onBeforeEnter(ee){Hi($e,[ee]),ni(ee,d),ni(ee,h)},onBeforeAppear(ee){Hi(Ne,[ee]),ni(ee,y),ni(ee,T)},onEnter:Ce(!1),onAppear:Ce(!0),onLeave(ee,pe){ee._isLeaving=!0;const Re=()=>Be(ee,pe);ni(ee,z),ee._enterCancelled?(ni(ee,U),Ml(ee)):(Ml(ee),ni(ee,U)),Pl(()=>{ee._isLeaving&&(ji(ee,z),ni(ee,V),Sl(oe)||Tl(ee,l,Ae,Re))}),Hi(oe,[ee,Re])},onEnterCancelled(ee){Te(ee,!1,void 0,!0),Hi(me,[ee])},onAppearCancelled(ee){Te(ee,!0,void 0,!0),Hi(ke,[ee])},onLeaveCancelled(ee){Be(ee),Hi(de,[ee])}})}function nh(t){if(t==null)return null;if(at(t))return[tr(t.enter),tr(t.leave)];{const i=tr(t);return[i,i]}}function tr(t){return sd(t)}function ni(t,i){i.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[ho]||(t[ho]=new Set)).add(i)}function ji(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const o=t[ho];o&&(o.delete(i),o.size||(t[ho]=void 0))}function Pl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let ih=0;function Tl(t,i,o,l){const u=t._endId=++ih,d=()=>{u===t._endId&&l()};if(o!=null)return setTimeout(d,o);const{type:h,timeout:_,propCount:y}=sh(t,i);if(!h)return l();const T=h+"end";let w=0;const z=()=>{t.removeEventListener(T,U),d()},U=V=>{V.target===t&&++w>=y&&z()};setTimeout(()=>{w<y&&z()},_+1),t.addEventListener(T,U)}function sh(t,i){const o=window.getComputedStyle(t),l=ue=>(o[ue]||"").split(", "),u=l(`${wi}Delay`),d=l(`${wi}Duration`),h=Cl(u,d),_=l(`${Ks}Delay`),y=l(`${Ks}Duration`),T=Cl(_,y);let w=null,z=0,U=0;i===wi?h>0&&(w=wi,z=h,U=d.length):i===Ks?T>0&&(w=Ks,z=T,U=y.length):(z=Math.max(h,T),w=z>0?h>T?wi:Ks:null,U=w?w===wi?d.length:y.length:0);const V=w===wi&&/\b(?:transform|all)(?:,|$)/.test(l(`${wi}Property`).toString());return{type:w,timeout:z,propCount:U,hasTransform:V}}function Cl(t,i){for(;t.length<i.length;)t=t.concat(t);return Math.max(...i.map((o,l)=>Ll(o)+Ll(t[l])))}function Ll(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Ml(t){return(t?t.ownerDocument:document).body.offsetHeight}function oh(t,i,o){const l=t[ho];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):o?t.setAttribute("class",i):t.className=i}const oa=Symbol("_vod"),vc=Symbol("_vsh"),ah={name:"show",beforeMount(t,{value:i},{transition:o}){t[oa]=t.style.display==="none"?"":t.style.display,o&&i?o.beforeEnter(t):Gs(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),Gs(t,!0),l.enter(t)):l.leave(t,()=>{Gs(t,!1)}):Gs(t,i))},beforeUnmount(t,{value:i}){Gs(t,i)}};function Gs(t,i){t.style.display=i?t[oa]:"none",t[vc]=!i}const rh=Symbol(""),lh=/(?:^|;)\s*display\s*:/;function uh(t,i,o){const l=t.style,u=xt(o);let d=!1;if(o&&!u){if(i)if(xt(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();o[_]==null&&Ys(l,_,"")}else for(const h in i)o[h]==null&&Ys(l,h,"");for(const h in o){h==="display"&&(d=!0);const _=o[h];_!=null?dh(t,h,!xt(i)&&i?i[h]:void 0,_)||Ys(l,h,_):Ys(l,h,"")}}else if(u){if(i!==o){const h=l[rh];h&&(o+=";"+h),l.cssText=o,d=lh.test(o)}}else i&&t.removeAttribute("style");oa in t&&(t[oa]=d?l.display:"",t[vc]&&(l.display="none"))}const El=/\s*!important$/;function Ys(t,i,o){if(Ee(o))o.forEach(l=>Ys(t,i,l));else if(o==null&&(o=""),i.startsWith("--"))t.setProperty(i,o);else{const l=ch(t,i);El.test(o)?t.setProperty(Ci(l),o.replace(El,""),"important"):t[l]=o}}const Ol=["Webkit","Moz","ms"],nr={};function ch(t,i){const o=nr[i];if(o)return o;let l=Tn(i);if(l!=="filter"&&l in t)return nr[i]=l;l=lu(l);for(let u=0;u<Ol.length;u++){const d=Ol[u]+l;if(d in t)return nr[i]=d}return i}function dh(t,i,o,l){return t.tagName==="TEXTAREA"&&(i==="width"||i==="height")&&xt(l)&&o===l}const zl="http://www.w3.org/1999/xlink";function Al(t,i,o,l,u,d=cd(i)){l&&i.startsWith("xlink:")?o==null?t.removeAttributeNS(zl,i.slice(6,i.length)):t.setAttributeNS(zl,i,o):o==null||d&&!cu(o)?t.removeAttribute(i):t.setAttribute(i,d?"":Ln(o)?String(o):o)}function Il(t,i,o,l,u){if(i==="innerHTML"||i==="textContent"){o!=null&&(t[i]=i==="innerHTML"?mc(o):o);return}const d=t.tagName;if(i==="value"&&d!=="PROGRESS"&&!d.includes("-")){const _=d==="OPTION"?t.getAttribute("value")||"":t.value,y=o==null?t.type==="checkbox"?"on":"":String(o);(_!==y||!("_value"in t))&&(t.value=y),o==null&&t.removeAttribute(i),t._value=o;return}let h=!1;if(o===""||o==null){const _=typeof t[i];_==="boolean"?o=cu(o):o==null&&_==="string"?(o="",h=!0):_==="number"&&(o=0,h=!0)}try{t[i]=o}catch{}h&&t.removeAttribute(u||i)}function ri(t,i,o,l){t.addEventListener(i,o,l)}function fh(t,i,o,l){t.removeEventListener(i,o,l)}const $l=Symbol("_vei");function hh(t,i,o,l,u=null){const d=t[$l]||(t[$l]={}),h=d[i];if(l&&h)h.value=l;else{const[_,y]=gh(i);if(l){const T=d[i]=yh(l,u);ri(t,_,T,y)}else h&&(fh(t,_,h,y),d[i]=void 0)}}const ph=/(Once|Passive|Capture)$/,mh=/^on:?(?:Once|Passive|Capture)$/;function gh(t){let i,o;for(;(o=t.match(ph))&&!mh.test(t);)i||(i={}),t=t.slice(0,t.length-o[1].length),i[o[1].toLowerCase()]=!0;return[t[2]===":"?t.slice(3):Ci(t.slice(2)),i]}let ir=0;const vh=Promise.resolve(),_h=()=>ir||(vh.then(()=>ir=0),ir=Date.now());function yh(t,i){const o=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=o.attached)return;const u=o.value;if(Ee(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const h=u.slice(),_=[l];for(let y=0;y<h.length&&!l._stopped;y++){const T=h[y];T&&vn(T,i,5,_)}}else vn(u,i,5,[l])};return o.value=t,o.attached=_h(),o}const Dl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,bh=(t,i,o,l,u,d)=>{const h=u==="svg";i==="class"?oh(t,l,h):i==="style"?uh(t,o,l):ua(i)?ca(i)||hh(t,i,o,l,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):xh(t,i,l,h))?(Il(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Al(t,i,l,h,d,i!=="value")):t._isVueCE&&(wh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!xt(l)))?Il(t,Tn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),Al(t,i,l,h))};function xh(t,i,o,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Dl(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 Dl(i)&&xt(o)?!1:i in t}function wh(t,i){const o=t._def.props;if(!o)return!1;const l=Tn(i);return Array.isArray(o)?o.some(u=>Tn(u)===l):Object.keys(o).some(u=>Tn(u)===l)}const Ti=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Ee(i)?o=>qo(i,o):i};function kh(t){t.target.composing=!0}function Nl(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const gn=Symbol("_assign");function Rl(t,i,o){return i&&(t=t.trim()),o&&(t=fa(t)),t}const ve={created(t,{modifiers:{lazy:i,trim:o,number:l}},u){t[gn]=Ti(u);const d=l||u.props&&u.props.type==="number";ri(t,i?"change":"input",h=>{h.target.composing||t[gn](Rl(t.value,o,d))}),(o||d)&&ri(t,"change",()=>{t.value=Rl(t.value,o,d)}),i||(ri(t,"compositionstart",kh),ri(t,"compositionend",Nl),ri(t,"change",Nl))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:o,modifiers:{lazy:l,trim:u,number:d}},h){if(t[gn]=Ti(h),t.composing)return;const _=(d||t.type==="number")&&!/^0\d/.test(t.value)?fa(t.value):t.value,y=i??"";if(_===y)return;const T=t.getRootNode();(T instanceof Document||T instanceof ShadowRoot)&&T.activeElement===t&&t.type!=="range"&&(l&&i===o||u&&t.value.trim()===y)||(t.value=y)}},aa={deep:!0,created(t,i,o){t[gn]=Ti(o),ri(t,"change",()=>{const l=t._modelValue,u=Ts(t),d=t.checked,h=t[gn];if(Ee(l)){const _=wr(l,u),y=_!==-1;if(d&&!y)h(l.concat(u));else if(!d&&y){const T=[...l];T.splice(_,1),h(T)}}else if(Cs(l)){const _=new Set(l);d?_.add(u):_.delete(u),h(_)}else h(_c(t,d))})},mounted:Fl,beforeUpdate(t,i,o){t[gn]=Ti(o),Fl(t,i,o)}};function Fl(t,{value:i,oldValue:o},l){t._modelValue=i;let u;if(Ee(i))u=wr(i,l.props.value)>-1;else if(Cs(i))u=i.has(l.props.value);else{if(i===o)return;u=Si(i,_c(t,!0))}t.checked!==u&&(t.checked=u)}const Sh={created(t,{value:i},o){t.checked=Si(i,o.props.value),t[gn]=Ti(o),ri(t,"change",()=>{t[gn](Ts(t))})},beforeUpdate(t,{value:i,oldValue:o},l){t[gn]=Ti(l),i!==o&&(t.checked=Si(i,l.props.value))}},Et={deep:!0,created(t,{value:i,modifiers:{number:o}},l){const u=Cs(i);ri(t,"change",()=>{const d=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>o?fa(Ts(h)):Ts(h));t[gn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,Mu(()=>{t._assigning=!1})}),t[gn]=Ti(l)},mounted(t,{value:i}){Bl(t,i)},beforeUpdate(t,i,o){t[gn]=Ti(o)},updated(t,{value:i}){t._assigning||Bl(t,i)}};function Bl(t,i){const o=t.multiple,l=Ee(i);if(!(o&&!l&&!Cs(i))){for(let u=0,d=t.options.length;u<d;u++){const h=t.options[u],_=Ts(h);if(o)if(l){const y=typeof _;y==="string"||y==="number"?h.selected=i.some(T=>String(T)===String(_)):h.selected=wr(i,_)>-1}else h.selected=i.has(_);else if(Si(Ts(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ts(t){return"_value"in t?t._value:t.value}function _c(t,i){const o=i?"_trueValue":"_falseValue";return o in t?t[o]:i}const Ph={created(t,i,o){Wo(t,i,o,null,"created")},mounted(t,i,o){Wo(t,i,o,null,"mounted")},beforeUpdate(t,i,o,l){Wo(t,i,o,l,"beforeUpdate")},updated(t,i,o,l){Wo(t,i,o,l,"updated")}};function Th(t,i){switch(t){case"SELECT":return Et;case"TEXTAREA":return ve;default:switch(i){case"checkbox":return aa;case"radio":return Sh;default:return ve}}}function Wo(t,i,o,l,u){const h=Th(t.tagName,o.props&&o.props.type)[u];h&&h(t,i,o,l)}const Ch=["ctrl","shift","alt","meta"],Lh={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)=>Ch.some(o=>t[`${o}Key`]&&!i.includes(o))},yc=(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<i.length;h++){const _=Lh[i[h]];if(_&&_(u,i))return}return t(u,...d)}))},Mh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Vl=(t,i)=>{const o=t._withKeys||(t._withKeys={}),l=i.join(".");return o[l]||(o[l]=(u=>{if(!("key"in u))return;const d=Ci(u.key);if(i.some(h=>h===d||Mh[h]===d))return t(u)}))},Eh=Ot({patchProp:bh},Jf);let Ul;function Oh(){return Ul||(Ul=Ef(Eh))}const zh=((...t)=>{const i=Oh().createApp(...t),{mount:o}=i;return i.mount=l=>{const u=Ih(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,Ah(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Ah(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Ih(t){return xt(t)?document.querySelector(t):t}const bc="pv_theme",Zl={light:"#EEF0F3",dark:"#0B1730"},ra=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function xc(){return ra&&ra.matches?"dark":"light"}function $h(){try{return localStorage.getItem(bc)||"light"}catch{return"light"}}function wc(t){return t==="system"?xc():t}function kc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=Zl[t]||Zl.light}const Yi=K($h()),ks=K(wc(Yi.value));function la(t){Yi.value=t;const i=wc(t);ks.value=i,kc(i);try{localStorage.setItem(bc,t)}catch{}}function Hl(){la(ks.value==="dark"?"light":"dark")}ra&&ra.addEventListener("change",()=>{if(Yi.value==="system"){const t=xc();ks.value=t,kc(t)}});async function Dh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function jl(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function Nh(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 Rh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function Fh(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function Bh(){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 Vh(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 Uh(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 Zh(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 Hh(){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 jh(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 Wh(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 Kh(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 Gh(){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 qh(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 Yh(){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 Wl(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 Jh(){const t=await fetch("/bff/integrations/opensky/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Xh(){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 Kl(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 Qh(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function ep(){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 Ko(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 tp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function np(){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 Gl(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 ip(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Sc(){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 sp(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 op(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 ap(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 rp(){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 lp(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 up(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 cp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function dp(){return"/bff/logbook/export"}async function fp(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 hp(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 pp(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 gp(t){return`/bff/documents/${encodeURIComponent(t)}/file`}async function vp(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 Pc="pv_prefs",gr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,twoFactor:!1};function _p(){try{return{...gr,...JSON.parse(localStorage.getItem(Pc)||"{}")||{}}}catch{return{...gr}}}const ze=bt(_p());function Tc(){try{localStorage.setItem(Pc,JSON.stringify(ze))}catch{}}function Cc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(gr))i in t&&(ze[i]=t[i]);return!0}const yp={sm:15,md:16,lg:18};function Ar(t){document.documentElement.style.fontSize=(yp[t]||16)+"px"}function Ir(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Lc(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(ze.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 ze.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 ql(t){return Lc(t).time}function Yl(t){const i=Lc(t);return`${i.date} ${i.time}`}let $r=!1,vr=!1,_r=null;function bp(){return{...JSON.parse(JSON.stringify(ze)),themeMode:Yi.value}}function Dr(){!$r||vr||(clearTimeout(_r),_r=setTimeout(()=>{qh(bp())},600))}function xp(t){vr=!0;try{Cc(t),t.themeMode&&la(t.themeMode),Ar(ze.fontSize),Ir(ze.reduceMotion),Tc()}finally{vr=!1}}async function Jl(){$r=!0;const t=await Gh();t&&Object.keys(t).length?xp(t):Dr()}function wp(){$r=!1,clearTimeout(_r)}en(ze,()=>{Tc(),Dr()},{deep:!0});en(Yi,Dr);en(()=>ze.fontSize,Ar,{immediate:!0});en(()=>ze.reduceMotion,Ir,{immediate:!0});const kp=["width","height"],Mc={__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,kp))}},Sp=["title","aria-label"],Pp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Cp={__name:"ThemeToggle",setup(t){return(i,o)=>(m(),v("button",{class:"btn-icon",type:"button",title:Ue(ks)==="dark"?"Switch to light":"Switch to dark","aria-label":Ue(ks)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...l)=>Ue(Hl)&&Ue(Hl)(...l))},[Ue(ks)==="dark"?(m(),v("svg",Pp,[...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",Tp,[...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,Sp))}},Lp={class:"relative grid h-full place-items-center p-5"},Mp={class:"absolute right-5 top-5"},Ep={class:"mb-6 flex items-center gap-3 text-ink"},Op={class:"relative mb-1"},zp=["type"],Ap=["aria-label","title"],Ip={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]"},$p={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]"},Dp={key:0,class:"mt-4"},Np={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Rp=["disabled"],Fp={__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),T=K(!1),w=K("");async function z(){T.value=!0,w.value="",localStorage.setItem("api_url",h.value.trim());const{ok:U,status:V,body:ue}=await Nh(u.value.trim(),d.value,h.value.trim());if(T.value=!1,U){l("signed-in",ue.email);return}w.value=V===400?"Invalid email or password.":V===502?"API server can't reach PocketBase.":ue.message||ue.error||"Cannot reach the API server."}return(U,V)=>(m(),v("div",Lp,[r("div",Mp,[E(Cp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:yc(z,["prevent"])},[r("div",Ep,[E(Mc,{size:34}),V[5]||(V[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),V[9]||(V[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),re(r("input",{"onUpdate:modelValue":V[0]||(V[0]=ue=>u.value=ue),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ve,u.value]]),V[10]||(V[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",Op,[re(r("input",{"onUpdate:modelValue":V[1]||(V[1]=ue=>d.value=ue),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,zp),[[Ph,d.value]]),r("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":y.value?"Hide password":"Show password",title:y.value?"Hide password":"Show password",onClick:V[2]||(V[2]=ue=>y.value=!y.value)},[y.value?(m(),v("svg",Ip,[...V[6]||(V[6]=[r("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),r("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(m(),v("svg",$p,[...V[7]||(V[7]=[r("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),r("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Ap)]),_.value?(m(),v("div",Dp,[V[8]||(V[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),re(r("input",{"onUpdate:modelValue":V[3]||(V[3]=ue=>h.value=ue),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ve,h.value]])])):R("",!0),w.value?(m(),v("p",Np,k(w.value),1)):R("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:T.value},k(T.value?"Signing in…":"Sign in"),9,Rp),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:V[4]||(V[4]=ue=>_.value=!_.value)},k(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function Bp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Js={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 Vp=Js.exports,Xl;function Up(){return Xl||(Xl=1,(function(t,i){(function(o,l){l(i)})(Vp,(function(o){var l="1.9.4";function u(e){var n,s,a,c;for(s=1,a=arguments.length;s<a;s++){c=arguments[s];for(n in c)e[n]=c[n]}return e}var d=Object.create||(function(){function e(){}return function(n){return e.prototype=n,new e}})();function h(e,n){var s=Array.prototype.slice;if(e.bind)return e.bind.apply(e,s.call(arguments,1));var a=s.call(arguments,2);return function(){return e.apply(n,a.length?a.concat(s.call(arguments)):arguments)}}var _=0;function y(e){return"_leaflet_id"in e||(e._leaflet_id=++_),e._leaflet_id}function T(e,n,s){var a,c,p,P;return P=function(){a=!1,c&&(p.apply(s,c),c=!1)},p=function(){a?c=arguments:(e.apply(s,arguments),setTimeout(P,n),a=!0)},p}function w(e,n,s){var a=n[1],c=n[0],p=a-c;return e===a&&s?e:((e-c)%p+p)%p+c}function z(){return!1}function U(e,n){if(n===!1)return e;var s=Math.pow(10,n===void 0?6:n);return Math.round(e*s)/s}function V(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ue(e){return V(e).split(/\s+/)}function X(e,n){Object.prototype.hasOwnProperty.call(e,"options")||(e.options=e.options?d(e.options):{});for(var s in n)e.options[s]=n[s];return e.options}function Ae(e,n,s){var a=[];for(var c in e)a.push(encodeURIComponent(s?c.toUpperCase():c)+"="+encodeURIComponent(e[c]));return(!n||n.indexOf("?")===-1?"?":"&")+a.join("&")}var $e=/\{ *([\w_ -]+) *\}/g;function Q(e,n){return e.replace($e,function(s,a){var c=n[a];if(c===void 0)throw new Error("No value provided for variable "+s);return typeof c=="function"&&(c=c(n)),c})}var me=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function oe(e,n){for(var s=0;s<e.length;s++)if(e[s]===n)return s;return-1}var de="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Ne(e){return window["webkit"+e]||window["moz"+e]||window["ms"+e]}var nt=0;function ke(e){var n=+new Date,s=Math.max(0,16-(n-nt));return nt=n+s,window.setTimeout(e,s)}var Te=window.requestAnimationFrame||Ne("RequestAnimationFrame")||ke,Be=window.cancelAnimationFrame||Ne("CancelAnimationFrame")||Ne("CancelRequestAnimationFrame")||function(e){window.clearTimeout(e)};function Ce(e,n,s){if(s&&Te===ke)e.call(n);else return Te.call(window,h(e,n))}function ee(e){e&&Be.call(window,e)}var pe={__proto__:null,extend:u,create:d,bind:h,get lastId(){return _},stamp:y,throttle:T,wrapNum:w,falseFn:z,formatNum:U,trim:V,splitWords:ue,setOptions:X,getParamString:Ae,template:Q,isArray:me,indexOf:oe,emptyImageUrl:de,requestFn:Te,cancelFn:Be,requestAnimFrame:Ce,cancelAnimFrame:ee};function Re(){}Re.extend=function(e){var n=function(){X(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},s=n.__super__=this.prototype,a=d(s);a.constructor=n,n.prototype=a;for(var c in this)Object.prototype.hasOwnProperty.call(this,c)&&c!=="prototype"&&c!=="__super__"&&(n[c]=this[c]);return e.statics&&u(n,e.statics),e.includes&&(Ze(e.includes),u.apply(null,[a].concat(e.includes))),u(a,e),delete a.statics,delete a.includes,a.options&&(a.options=s.options?d(s.options):{},u(a.options,e.options)),a._initHooks=[],a.callInitHooks=function(){if(!this._initHooksCalled){s.callInitHooks&&s.callInitHooks.call(this),this._initHooksCalled=!0;for(var p=0,P=a._initHooks.length;p<P;p++)a._initHooks[p].call(this)}},n},Re.include=function(e){var n=this.prototype.options;return u(this.prototype,e),e.options&&(this.prototype.options=n,this.mergeOptions(e.options)),this},Re.mergeOptions=function(e){return u(this.prototype.options,e),this},Re.addInitHook=function(e){var n=Array.prototype.slice.call(arguments,1),s=typeof e=="function"?e:function(){this[e].apply(this,n)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(s),this};function Ze(e){if(!(typeof L>"u"||!L||!L.Mixin)){e=me(e)?e:[e];for(var n=0;n<e.length;n++)e[n]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var he={on:function(e,n,s){if(typeof e=="object")for(var a in e)this._on(a,e[a],n);else{e=ue(e);for(var c=0,p=e.length;c<p;c++)this._on(e[c],n,s)}return this},off:function(e,n,s){if(!arguments.length)delete this._events;else if(typeof e=="object")for(var a in e)this._off(a,e[a],n);else{e=ue(e);for(var c=arguments.length===1,p=0,P=e.length;p<P;p++)c?this._off(e[p]):this._off(e[p],n,s)}return this},_on:function(e,n,s,a){if(typeof n!="function"){console.warn("wrong listener type: "+typeof n);return}if(this._listens(e,n,s)===!1){s===this&&(s=void 0);var c={fn:n,ctx:s};a&&(c.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(c)}},_off:function(e,n,s){var a,c,p;if(this._events&&(a=this._events[e],!!a)){if(arguments.length===1){if(this._firingCount)for(c=0,p=a.length;c<p;c++)a[c].fn=z;delete this._events[e];return}if(typeof n!="function"){console.warn("wrong listener type: "+typeof n);return}var P=this._listens(e,n,s);if(P!==!1){var A=a[P];this._firingCount&&(A.fn=z,this._events[e]=a=a.slice()),a.splice(P,1)}}},fire:function(e,n,s){if(!this.listens(e,s))return this;var a=u({},n,{type:e,target:this,sourceTarget:n&&n.sourceTarget||this});if(this._events){var c=this._events[e];if(c){this._firingCount=this._firingCount+1||1;for(var p=0,P=c.length;p<P;p++){var A=c[p],N=A.fn;A.once&&this.off(e,N,A.ctx),N.call(A.ctx||this,a)}this._firingCount--}}return s&&this._propagateEvent(a),this},listens:function(e,n,s,a){typeof e!="string"&&console.warn('"string" type argument expected');var c=n;typeof n!="function"&&(a=!!n,c=void 0,s=void 0);var p=this._events&&this._events[e];if(p&&p.length&&this._listens(e,c,s)!==!1)return!0;if(a){for(var P in this._eventParents)if(this._eventParents[P].listens(e,n,s,a))return!0}return!1},_listens:function(e,n,s){if(!this._events)return!1;var a=this._events[e]||[];if(!n)return!!a.length;s===this&&(s=void 0);for(var c=0,p=a.length;c<p;c++)if(a[c].fn===n&&a[c].ctx===s)return c;return!1},once:function(e,n,s){if(typeof e=="object")for(var a in e)this._on(a,e[a],n,!0);else{e=ue(e);for(var c=0,p=e.length;c<p;c++)this._on(e[c],n,s,!0)}return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[y(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[y(e)],this},_propagateEvent:function(e){for(var n in this._eventParents)this._eventParents[n].fire(e.type,u({layer:e.target,propagatedFrom:e.target},e),!0)}};he.addEventListener=he.on,he.removeEventListener=he.clearAllEventListeners=he.off,he.addOneTimeEventListener=he.once,he.fireEvent=he.fire,he.hasEventListeners=he.listens;var De=Re.extend(he);function ne(e,n,s){this.x=s?Math.round(e):e,this.y=s?Math.round(n):n}var rt=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};ne.prototype={clone:function(){return new ne(this.x,this.y)},add:function(e){return this.clone()._add(ge(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(ge(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 ne(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ne(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=rt(this.x),this.y=rt(this.y),this},distanceTo:function(e){e=ge(e);var n=e.x-this.x,s=e.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(e){return e=ge(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=ge(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+U(this.x)+", "+U(this.y)+")"}};function ge(e,n,s){return e instanceof ne?e:me(e)?new ne(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ne(e.x,e.y):new ne(e,n,s)}function Me(e,n){if(e)for(var s=n?[e,n]:e,a=0,c=s.length;a<c;a++)this.extend(s[a])}Me.prototype={extend:function(e){var n,s;if(!e)return this;if(e instanceof ne||typeof e[0]=="number"||"x"in e)n=s=ge(e);else if(e=je(e),n=e.min,s=e.max,!n||!s)return this;return!this.min&&!this.max?(this.min=n.clone(),this.max=s.clone()):(this.min.x=Math.min(n.x,this.min.x),this.max.x=Math.max(s.x,this.max.x),this.min.y=Math.min(n.y,this.min.y),this.max.y=Math.max(s.y,this.max.y)),this},getCenter:function(e){return ge((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return ge(this.min.x,this.max.y)},getTopRight:function(){return ge(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var n,s;return typeof e[0]=="number"||e instanceof ne?e=ge(e):e=je(e),e instanceof Me?(n=e.min,s=e.max):n=s=e,n.x>=this.min.x&&s.x<=this.max.x&&n.y>=this.min.y&&s.y<=this.max.y},intersects:function(e){e=je(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=je(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},isValid:function(){return!!(this.min&&this.max)},pad:function(e){var n=this.min,s=this.max,a=Math.abs(n.x-s.x)*e,c=Math.abs(n.y-s.y)*e;return je(ge(n.x-a,n.y-c),ge(s.x+a,s.y+c))},equals:function(e){return e?(e=je(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight())):!1}};function je(e,n){return!e||e instanceof Me?e:new Me(e,n)}function te(e,n){if(e)for(var s=n?[e,n]:e,a=0,c=s.length;a<c;a++)this.extend(s[a])}te.prototype={extend:function(e){var n=this._southWest,s=this._northEast,a,c;if(e instanceof I)a=e,c=e;else if(e instanceof te){if(a=e._southWest,c=e._northEast,!a||!c)return this}else return e?this.extend(W(e)||$(e)):this;return!n&&!s?(this._southWest=new I(a.lat,a.lng),this._northEast=new I(c.lat,c.lng)):(n.lat=Math.min(a.lat,n.lat),n.lng=Math.min(a.lng,n.lng),s.lat=Math.max(c.lat,s.lat),s.lng=Math.max(c.lng,s.lng)),this},pad:function(e){var n=this._southWest,s=this._northEast,a=Math.abs(n.lat-s.lat)*e,c=Math.abs(n.lng-s.lng)*e;return new te(new I(n.lat-a,n.lng-c),new I(s.lat+a,s.lng+c))},getCenter:function(){return new I((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new I(this.getNorth(),this.getWest())},getSouthEast:function(){return new I(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){typeof e[0]=="number"||e instanceof I||"lat"in e?e=W(e):e=$(e);var n=this._southWest,s=this._northEast,a,c;return e instanceof te?(a=e.getSouthWest(),c=e.getNorthEast()):a=c=e,a.lat>=n.lat&&c.lat<=s.lat&&a.lng>=n.lng&&c.lng<=s.lng},intersects:function(e){e=$(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=$(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},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e,n){return e?(e=$(e),this._southWest.equals(e.getSouthWest(),n)&&this._northEast.equals(e.getNorthEast(),n)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function $(e,n){return e instanceof te?e:new te(e,n)}function I(e,n,s){if(isNaN(e)||isNaN(n))throw new Error("Invalid LatLng object: ("+e+", "+n+")");this.lat=+e,this.lng=+n,s!==void 0&&(this.alt=+s)}I.prototype={equals:function(e,n){if(!e)return!1;e=W(e);var s=Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng));return s<=(n===void 0?1e-9:n)},toString:function(e){return"LatLng("+U(this.lat,e)+", "+U(this.lng,e)+")"},distanceTo:function(e){return O.distance(this,W(e))},wrap:function(){return O.wrapLatLng(this)},toBounds:function(e){var n=180*e/40075017,s=n/Math.cos(Math.PI/180*this.lat);return $([this.lat-n,this.lng-s],[this.lat+n,this.lng+s])},clone:function(){return new I(this.lat,this.lng,this.alt)}};function W(e,n,s){return e instanceof I?e:me(e)&&typeof e[0]!="object"?e.length===3?new I(e[0],e[1],e[2]):e.length===2?new I(e[0],e[1]):null:e==null?e:typeof e=="object"&&"lat"in e?new I(e.lat,"lng"in e?e.lng:e.lon,e.alt):n===void 0?null:new I(e,n,s)}var C={latLngToPoint:function(e,n){var s=this.projection.project(e),a=this.scale(n);return this.transformation._transform(s,a)},pointToLatLng:function(e,n){var s=this.scale(n),a=this.transformation.untransform(e,s);return this.projection.unproject(a)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*Math.pow(2,e)},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var n=this.projection.bounds,s=this.scale(e),a=this.transformation.transform(n.min,s),c=this.transformation.transform(n.max,s);return new Me(a,c)},infinite:!1,wrapLatLng:function(e){var n=this.wrapLng?w(e.lng,this.wrapLng,!0):e.lng,s=this.wrapLat?w(e.lat,this.wrapLat,!0):e.lat,a=e.alt;return new I(s,n,a)},wrapLatLngBounds:function(e){var n=e.getCenter(),s=this.wrapLatLng(n),a=n.lat-s.lat,c=n.lng-s.lng;if(a===0&&c===0)return e;var p=e.getSouthWest(),P=e.getNorthEast(),A=new I(p.lat-a,p.lng-c),N=new I(P.lat-a,P.lng-c);return new te(A,N)}},O=u({},C,{wrapLng:[-180,180],R:6371e3,distance:function(e,n){var s=Math.PI/180,a=e.lat*s,c=n.lat*s,p=Math.sin((n.lat-e.lat)*s/2),P=Math.sin((n.lng-e.lng)*s/2),A=p*p+Math.cos(a)*Math.cos(c)*P*P,N=2*Math.atan2(Math.sqrt(A),Math.sqrt(1-A));return this.R*N}}),ht=6378137,lt={R:ht,MAX_LATITUDE:85.0511287798,project:function(e){var n=Math.PI/180,s=this.MAX_LATITUDE,a=Math.max(Math.min(s,e.lat),-s),c=Math.sin(a*n);return new ne(this.R*e.lng*n,this.R*Math.log((1+c)/(1-c))/2)},unproject:function(e){var n=180/Math.PI;return new I((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*n,e.x*n/this.R)},bounds:(function(){var e=ht*Math.PI;return new Me([-e,-e],[e,e])})()};function qt(e,n,s,a){if(me(e)){this._a=e[0],this._b=e[1],this._c=e[2],this._d=e[3];return}this._a=e,this._b=n,this._c=s,this._d=a}qt.prototype={transform:function(e,n){return this._transform(e.clone(),n)},_transform:function(e,n){return n=n||1,e.x=n*(this._a*e.x+this._b),e.y=n*(this._c*e.y+this._d),e},untransform:function(e,n){return n=n||1,new ne((e.x/n-this._b)/this._a,(e.y/n-this._d)/this._c)}};function b(e,n,s,a){return new qt(e,n,s,a)}var g=u({},O,{code:"EPSG:3857",projection:lt,transformation:(function(){var e=.5/(Math.PI*lt.R);return b(e,.5,-e,.5)})()}),M=u({},g,{code:"EPSG:900913"});function Z(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function B(e,n){var s="",a,c,p,P,A,N;for(a=0,p=e.length;a<p;a++){for(A=e[a],c=0,P=A.length;c<P;c++)N=A[c],s+=(c?"L":"M")+N.x+" "+N.y;s+=n?_e.svg?"z":"x":""}return s||"M0 0"}var H=document.documentElement.style,ie="ActiveXObject"in window,F=ie&&!document.addEventListener,Y="msLaunchUri"in navigator&&!("documentMode"in document),j=Ke("webkit"),Se=Ke("android"),ce=Ke("android 2")||Ke("android 3"),ae=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Pe=Se&&Ke("Google")&&ae<537&&!("AudioNode"in window),We=!!window.opera,be=!Y&&Ke("chrome"),Ye=Ke("gecko")&&!j&&!We&&!ie,dt=!be&&Ke("safari"),gt=Ke("phantom"),_t="OTransition"in H,Tt=navigator.platform.indexOf("Win")===0,_n=ie&&"transition"in H,ci="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ce,kt="MozPerspective"in H,$t=!window.L_DISABLE_3D&&(_n||ci||kt)&&!_t&&!gt,En=typeof orientation<"u"||Ke("mobile"),Vt=En&&j,Ji=En&&ci,zt=!window.PointerEvent&&window.MSPointerEvent,Ut=!!(window.PointerEvent||zt),yt="ontouchstart"in window||!!window.TouchEvent,wa=!window.L_NO_TOUCH&&(yt||Ut),vo=En&&We,Ls=En&&Ye,ka=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Sa=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",z,n),window.removeEventListener("testPassiveEventSupport",z,n)}catch{}return e})(),Pa=(function(){return!!document.createElement("canvas").getContext})(),Ms=!!(document.createElementNS&&Z("svg").createSVGRect),_o=!!Ms&&(function(){var e=document.createElement("div");return e.innerHTML="<svg/>",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ta=!Ms&&(function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch{return!1}})(),Ca=navigator.platform.indexOf("Mac")===0,La=navigator.platform.indexOf("Linux")===0;function Ke(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var _e={ie,ielt9:F,edge:Y,webkit:j,android:Se,android23:ce,androidStock:Pe,opera:We,chrome:be,gecko:Ye,safari:dt,phantom:gt,opera12:_t,win:Tt,ie3d:_n,webkit3d:ci,gecko3d:kt,any3d:$t,mobile:En,mobileWebkit:Vt,mobileWebkit3d:Ji,msPointer:zt,pointer:Ut,touch:wa,touchNative:yt,mobileOpera:vo,mobileGecko:Ls,retina:ka,passiveEvents:Sa,canvas:Pa,svg:Ms,vml:Ta,inlineSvg:_o,mac:Ca,linux:La},Xi=_e.msPointer?"MSPointerDown":"pointerdown",At=_e.msPointer?"MSPointerMove":"pointermove",di=_e.msPointer?"MSPointerUp":"pointerup",Mi=_e.msPointer?"MSPointerCancel":"pointercancel",fi={touchstart:Xi,touchmove:At,touchend:di,touchcancel:Mi},an={touchstart:bo,touchmove:Zt,touchend:Zt,touchcancel:Zt},tn={},yo=!1;function Es(e,n,s){return n==="touchstart"&&hi(),an[n]?(s=an[n].bind(this,s),e.addEventListener(fi[n],s,!1),s):(console.warn("wrong event specified:",n),z)}function Os(e,n,s){if(!fi[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(fi[n],s,!1)}function Ma(e){tn[e.pointerId]=e}function rn(e){tn[e.pointerId]&&(tn[e.pointerId]=e)}function yn(e){delete tn[e.pointerId]}function hi(){yo||(document.addEventListener(Xi,Ma,!0),document.addEventListener(At,rn,!0),document.addEventListener(di,yn,!0),document.addEventListener(Mi,yn,!0),yo=!0)}function Zt(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 bo(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Ct(n),Zt(e,n)}function zs(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 Ea=200;function Oa(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=So(p);if(!(P.some(function(N){return N instanceof HTMLLabelElement&&N.attributes.for})&&!P.some(function(N){return N instanceof HTMLInputElement||N instanceof HTMLSelectElement}))){var A=Date.now();A-s<=Ea?(a++,a===2&&n(zs(p))):a=1,s=A}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function za(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var As=Qi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),pi=Qi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),xo=pi==="webkitTransition"||pi==="OTransition"?pi+"End":"transitionend";function wo(e){return typeof e=="string"?document.getElementById(e):e}function Ei(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 se(e,n,s){var a=document.createElement(e);return a.className=n||"",s&&s.appendChild(a),a}function it(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 mi(e,n){if(e.classList!==void 0)return e.classList.contains(n);var s=Oi(e);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function Oe(e,n){if(e.classList!==void 0)for(var s=ue(n),a=0,c=s.length;a<c;a++)e.classList.add(s[a]);else if(!mi(e,n)){var p=Oi(e);Wn(e,(p?p+" ":"")+n)}}function ut(e,n){e.classList!==void 0?e.classList.remove(n):Wn(e,V((" "+Oi(e)+" ").replace(" "+n+" "," ")))}function Wn(e,n){e.className.baseVal===void 0?e.className=n:e.className.baseVal=n}function Oi(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}function Dt(e,n){"opacity"in e.style?e.style.opacity=n:"filter"in e.style&&Is(e,n)}function Is(e,n){var s=!1,a="DXImageTransform.Microsoft.Alpha";try{s=e.filters.item(a)}catch{if(n===1)return}n=Math.round(n*100),s?(s.Enabled=n!==100,s.Opacity=n):e.style.filter+=" progid:"+a+"(opacity="+n+")"}function Qi(e){for(var n=document.documentElement.style,s=0;s<e.length;s++)if(e[s]in n)return e[s];return!1}function St(e,n,s){var a=n||new ne(0,0);e.style[As]=(_e.ie3d?"translate("+a.x+"px,"+a.y+"px)":"translate3d("+a.x+"px,"+a.y+"px,0)")+(s?" scale("+s+")":"")}function vt(e,n){e._leaflet_pos=n,_e.any3d?St(e,n):(e.style.left=n.x+"px",e.style.top=n.y+"px")}function On(e){return e._leaflet_pos||new ne(0,0)}var gi,zi,es;if("onselectstart"in document)gi=function(){Ve(window,"selectstart",Ct)},zi=function(){st(window,"selectstart",Ct)};else{var xn=Qi(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);gi=function(){if(xn){var e=document.documentElement.style;es=e[xn],e[xn]="none"}},zi=function(){xn&&(document.documentElement.style[xn]=es,es=void 0)}}function $s(){Ve(window,"dragstart",Ct)}function Ds(){st(window,"dragstart",Ct)}var ts,Ns;function ns(e){for(;e.tabIndex===-1;)e=e.parentNode;e.style&&(is(),ts=e,Ns=e.style.outlineStyle,e.style.outlineStyle="none",Ve(window,"keydown",is))}function is(){ts&&(ts.style.outlineStyle=Ns,ts=void 0,Ns=void 0,st(window,"keydown",is))}function ko(e){do e=e.parentNode;while((!e.offsetWidth||!e.offsetHeight)&&e!==document.body);return e}function Rs(e){var n=e.getBoundingClientRect();return{x:n.width/e.offsetWidth||1,y:n.height/e.offsetHeight||1,boundingClientRect:n}}var Aa={__proto__:null,TRANSFORM:As,TRANSITION:pi,TRANSITION_END:xo,get:wo,getStyle:Ei,create:se,remove:it,empty:jn,toFront:ln,toBack:bn,hasClass:mi,addClass:Oe,removeClass:ut,setClass:Wn,getClass:Oi,setOpacity:Dt,testProp:Qi,setTransform:St,setPosition:vt,getPosition:On,get disableTextSelection(){return gi},get enableTextSelection(){return zi},disableImageDrag:$s,enableImageDrag:Ds,preventOutline:ns,restoreOutline:is,getSizedParentNode:ko,getScale:Rs};function Ve(e,n,s,a){if(n&&typeof n=="object")for(var c in n)Ai(e,c,n[c],s);else{n=ue(n);for(var p=0,P=n.length;p<P;p++)Ai(e,n[p],s,a)}return this}var un="_leaflet_events";function st(e,n,s,a){if(arguments.length===1)ss(e),delete e[un];else if(n&&typeof n=="object")for(var c in n)Je(e,c,n[c],s);else if(n=ue(n),arguments.length===2)ss(e,function(A){return oe(n,A)!==-1});else for(var p=0,P=n.length;p<P;p++)Je(e,n[p],s,a);return this}function ss(e,n){for(var s in e[un]){var a=s.split(/\d/)[0];(!n||n(a))&&Je(e,a,null,null,s)}}var vi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ai(e,n,s,a){var c=n+y(s)+(a?"_"+y(a):"");if(e[un]&&e[un][c])return this;var p=function(A){return s.call(a||e,A||window.event)},P=p;!_e.touchNative&&_e.pointer&&n.indexOf("touch")===0?p=Es(e,n,p):_e.touch&&n==="dblclick"?p=Oa(e,p):"addEventListener"in e?n==="touchstart"||n==="touchmove"||n==="wheel"||n==="mousewheel"?e.addEventListener(vi[n]||n,p,_e.passiveEvents?{passive:!1}:!1):n==="mouseenter"||n==="mouseleave"?(p=function(A){A=A||window.event,Kn(e,A)&&P(A)},e.addEventListener(vi[n],p,!1)):e.addEventListener(n,P,!1):e.attachEvent("on"+n,p),e[un]=e[un]||{},e[un][c]=p}function Je(e,n,s,a,c){c=c||n+y(s)+(a?"_"+y(a):"");var p=e[un]&&e[un][c];if(!p)return this;!_e.touchNative&&_e.pointer&&n.indexOf("touch")===0?Os(e,n,p):_e.touch&&n==="dblclick"?za(e,p):"removeEventListener"in e?e.removeEventListener(vi[n]||n,p,!1):e.detachEvent("on"+n,p),e[un][c]=null}function wt(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function zn(e){return Ai(e,"wheel",wt),this}function _i(e){return Ve(e,"mousedown touchstart dblclick contextmenu",wt),e._leaflet_disable_click=!0,this}function Ct(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function wn(e){return Ct(e),wt(e),this}function So(e){if(e.composedPath)return e.composedPath();for(var n=[],s=e.target;s;)n.push(s),s=s.parentNode;return n}function Po(e,n){if(!n)return new ne(e.clientX,e.clientY);var s=Rs(n),a=s.boundingClientRect;return new ne((e.clientX-a.left)/s.x-n.clientLeft,(e.clientY-a.top)/s.y-n.clientTop)}var Ia=_e.linux&&_e.chrome?window.devicePixelRatio:_e.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function To(e){return _e.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Ia: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 Co={__proto__:null,on:Ve,off:st,stopPropagation:wt,disableScrollPropagation:zn,disableClickPropagation:_i,preventDefault:Ct,stop:wn,getPropagationPath:So,getMousePosition:Po,getWheelDelta:To,isExternalTarget:Kn,addListener:Ve,removeListener:st},Ii=De.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=Ce(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,s=this._duration*1e3;n<s?this._runFrame(this._easeOut(n/s),e):(this._runFrame(1),this._complete())},_runFrame:function(e,n){var s=this._startPos.add(this._offset.multiplyBy(e));n&&s._round(),vt(this._el,s),this.fire("step")},_complete:function(){ee(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),Ge=De.extend({options:{crs:g,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,n){n=X(this,n),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=h(this._onResize,this),this._initEvents(),n.maxBounds&&this.setMaxBounds(n.maxBounds),n.zoom!==void 0&&(this._zoom=this._limitZoom(n.zoom)),n.center&&n.zoom!==void 0&&this.setView(W(n.center),n.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=pi&&_e.any3d&&!_e.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ve(this._proxy,xo,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,n,s){if(n=n===void 0?this._zoom:this._limitZoom(n),e=this._limitCenter(W(e),n,this.options.maxBounds),s=s||{},this._stop(),this._loaded&&!s.reset&&s!==!0){s.animate!==void 0&&(s.zoom=u({animate:s.animate},s.zoom),s.pan=u({animate:s.animate,duration:s.duration},s.pan));var a=this._zoom!==n?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,n,s.zoom):this._tryAnimatedPan(e,s.pan);if(a)return clearTimeout(this._sizeTimer),this}return this._resetView(e,n,s.pan&&s.pan.noMoveStart),this},setZoom:function(e,n){return this._loaded?this.setView(this.getCenter(),e,{zoom:n}):(this._zoom=e,this)},zoomIn:function(e,n){return e=e||(_e.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+e,n)},zoomOut:function(e,n){return e=e||(_e.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-e,n)},setZoomAround:function(e,n,s){var a=this.getZoomScale(n),c=this.getSize().divideBy(2),p=e instanceof ne?e:this.latLngToContainerPoint(e),P=p.subtract(c).multiplyBy(1-1/a),A=this.containerPointToLatLng(c.add(P));return this.setView(A,n,{zoom:s})},_getBoundsCenterZoom:function(e,n){n=n||{},e=e.getBounds?e.getBounds():$(e);var s=ge(n.paddingTopLeft||n.padding||[0,0]),a=ge(n.paddingBottomRight||n.padding||[0,0]),c=this.getBoundsZoom(e,!1,s.add(a));if(c=typeof n.maxZoom=="number"?Math.min(n.maxZoom,c):c,c===1/0)return{center:e.getCenter(),zoom:c};var p=a.subtract(s).divideBy(2),P=this.project(e.getSouthWest(),c),A=this.project(e.getNorthEast(),c),N=this.unproject(P.add(A).divideBy(2).add(p),c);return{center:N,zoom:c}},fitBounds:function(e,n){if(e=$(e),!e.isValid())throw new Error("Bounds are not valid.");var s=this._getBoundsCenterZoom(e,n);return this.setView(s.center,s.zoom,n)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,n){return this.setView(e,this._zoom,{pan:n})},panBy:function(e,n){if(e=ge(e).round(),n=n||{},!e.x&&!e.y)return this.fire("moveend");if(n.animate!==!0&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Ii,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),n.noMoveStart||this.fire("movestart"),n.animate!==!1){Oe(this._mapPane,"leaflet-pan-anim");var s=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,s,n.duration||.25,n.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},flyTo:function(e,n,s){if(s=s||{},s.animate===!1||!_e.any3d)return this.setView(e,n,s);this._stop();var a=this.project(this.getCenter()),c=this.project(e),p=this.getSize(),P=this._zoom;e=W(e),n=n===void 0?P:n;var A=Math.max(p.x,p.y),N=A*this.getZoomScale(P,n),q=c.distanceTo(a)||1,fe=1.42,Ie=fe*fe;function qe(Pt){var Uo=Pt?-1:1,Yc=Pt?N:A,Jc=N*N-A*A+Uo*Ie*Ie*q*q,Xc=2*Yc*Ie*q,ja=Jc/Xc,il=Math.sqrt(ja*ja+1)-ja,Qc=il<1e-9?-18:Math.log(il);return Qc}function jt(Pt){return(Math.exp(Pt)-Math.exp(-Pt))/2}function Mt(Pt){return(Math.exp(Pt)+Math.exp(-Pt))/2}function dn(Pt){return jt(Pt)/Mt(Pt)}var Xt=qe(0);function ms(Pt){return A*(Mt(Xt)/Mt(Xt+fe*Pt))}function Wc(Pt){return A*(Mt(Xt)*dn(Xt+fe*Pt)-jt(Xt))/Ie}function Kc(Pt){return 1-Math.pow(1-Pt,1.5)}var Gc=Date.now(),tl=(qe(1)-Xt)/fe,qc=s.duration?1e3*s.duration:1e3*tl*.8;function nl(){var Pt=(Date.now()-Gc)/qc,Uo=Kc(Pt)*tl;Pt<=1?(this._flyToFrame=Ce(nl,this),this._move(this.unproject(a.add(c.subtract(a).multiplyBy(Wc(Uo)/q)),P),this.getScaleZoom(A/ms(Uo),P),{flyTo:!0})):this._move(e,n)._moveEnd(!0)}return this._moveStart(!0,s.noMoveStart),nl.call(this),this},flyToBounds:function(e,n){var s=this._getBoundsCenterZoom(e,n);return this.flyTo(s.center,s.zoom,n)},setMaxBounds:function(e){return e=$(e),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),e.isValid()?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var n=this.options.minZoom;return this.options.minZoom=e,this._loaded&&n!==e&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(e):this},setMaxZoom:function(e){var n=this.options.maxZoom;return this.options.maxZoom=e,this._loaded&&n!==e&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var s=this.getCenter(),a=this._limitCenter(s,this._zoom,$(e));return s.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var s=ge(n.paddingTopLeft||n.padding||[0,0]),a=ge(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),p=this.project(e),P=this.getPixelBounds(),A=je([P.min.add(s),P.max.subtract(a)]),N=A.getSize();if(!A.contains(p)){this._enforcingBounds=!0;var q=p.subtract(A.getCenter()),fe=A.extend(p).getSize().subtract(N);c.x+=q.x<0?-fe.x:fe.x,c.y+=q.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 I(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 A={latlng:a,bounds:c,timestamp:e.timestamp};for(var N in e.coords)typeof e.coords[N]=="number"&&(A[N]=e.coords[N]);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(),it(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ee(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)it(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=se("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 te(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=$(e),s=ge(s||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),p=this.getMaxZoom(),P=e.getNorthWest(),A=e.getSouthEast(),N=this.getSize().subtract(s),q=je(this.project(A,a),this.project(P,a)).getSize(),fe=_e.any3d?this.options.zoomSnap:1,Ie=N.x/q.x,qe=N.y/q.y,jt=n?Math.max(Ie,qe):Math.min(Ie,qe);return a=this.getScaleZoom(jt,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 ne(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 Me(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,n){var s=this.options.crs;return n=n===void 0?this._zoom:n,s.scale(e)/s.scale(n)},getScaleZoom:function(e,n){var s=this.options.crs;n=n===void 0?this._zoom:n;var a=s.zoom(e*s.scale(n));return isNaN(a)?1/0:a},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(W(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(ge(e),n)},layerPointToLatLng:function(e){var n=ge(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(W(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(W(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds($(e))},distance:function(e,n){return this.options.crs.distance(W(e),W(n))},containerPointToLayerPoint:function(e){return ge(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return ge(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(ge(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(e)))},mouseEventToContainerPoint:function(e){return Po(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=wo(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ve(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&_e.any3d,Oe(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=Ei(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 ne(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Oe(e.markerPane,"leaflet-zoom-hide"),Oe(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,s){vt(this._mapPane,new ne(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 ee(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?st:Ve;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(){ee(this._resizeRequest),this._resizeRequest=Ce(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"&&ns(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;P<s.length;P++)s[P].listens(n,!0)&&p.push(s[P]);c=p.concat(c)}if(c.length){n==="contextmenu"&&Ct(e);var A=c[0],N={originalEvent:e};if(e.type!=="keypress"&&e.type!=="keydown"&&e.type!=="keyup"){var q=A.getLatLng&&(!A._radius||A._radius<=10);N.containerPoint=q?this.latLngToContainerPoint(A.getLatLng()):this.mouseEventToContainerPoint(e),N.layerPoint=this.containerPointToLayerPoint(N.containerPoint),N.latlng=q?A.getLatLng():this.layerPointToLatLng(N.layerPoint)}for(P=0;P<c.length;P++)if(c[P].fire(n,N,!0),N.originalEvent._stopped||c[P].options.bubblingMouseEvents===!1&&oe(this._mouseEvents,n)!==-1)return}},_draggableMoved:function(e){return e=e.dragging&&e.dragging.enabled()?e:this,e.dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,n=this._handlers.length;e<n;e++)this._handlers[e].disable()},whenReady:function(e,n){return this._loaded?e.call(n||this,{target:this}):this.on("load",e,n),this},_getMapPanePos:function(){return On(this._mapPane)||new ne(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,n){var s=e&&n!==void 0?this._getNewPixelOrigin(e,n):this.getPixelOrigin();return s.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,n){var s=this.getSize()._divideBy(2);return this.project(e,n)._subtract(s)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,n,s){var a=this._getNewPixelOrigin(s,n);return this.project(e,n)._subtract(a)},_latLngBoundsToNewLayerBounds:function(e,n,s){var a=this._getNewPixelOrigin(s,n);return je([this.project(e.getSouthWest(),n)._subtract(a),this.project(e.getNorthWest(),n)._subtract(a),this.project(e.getSouthEast(),n)._subtract(a),this.project(e.getNorthEast(),n)._subtract(a)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,n,s){if(!s)return e;var a=this.project(e,n),c=this.getSize().divideBy(2),p=new Me(a.subtract(c),a.add(c)),P=this._getBoundsOffset(p,s,n);return Math.abs(P.x)<=1&&Math.abs(P.y)<=1?e:this.unproject(a.add(P),n)},_limitOffset:function(e,n){if(!n)return e;var s=this.getPixelBounds(),a=new Me(s.min.add(e),s.max.add(e));return e.add(this._getBoundsOffset(a,n))},_getBoundsOffset:function(e,n,s){var a=je(this.project(n.getNorthEast(),s),this.project(n.getSouthWest(),s)),c=a.min.subtract(e.min),p=a.max.subtract(e.max),P=this._rebound(c.x,-p.x),A=this._rebound(c.y,-p.y);return new ne(P,A)},_rebound:function(e,n){return e+n>0?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(){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=se("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var s=As,a=this._proxy.style[s];St(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(){it(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();St(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:(Ce(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,Oe(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 os(e,n){return new Ge(e,n)}var Ht=Re.extend({options:{position:"topright"},initialize:function(e){X(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 Oe(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?(it(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()}}),$i=function(e){return new Ht(e)};Ge.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=se("div",n+"control-container",this._container);function a(c,p){var P=n+c+" "+n+p;e[c+p]=se("div",P,s)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)it(this._controlCorners[e]);it(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Lo=Ht.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,s,a){return s<a?-1:a<s?1:0}},initialize:function(e,n,s){X(this,s),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var a in e)this._addLayer(e[a],a);for(a in n)this._addLayer(n[a],a,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on("zoomend",this._checkDisabledLayers,this);for(var n=0;n<this._layers.length;n++)this._layers[n].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(e){return Ht.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(e,n){return this._addLayer(e,n),this._map?this._update():this},addOverlay:function(e,n){return this._addLayer(e,n,!0),this._map?this._update():this},removeLayer:function(e){e.off("add remove",this._onLayerChange,this);var n=this._getLayer(y(e));return n&&this._layers.splice(this._layers.indexOf(n),1),this._map?this._update():this},expand:function(){Oe(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(Oe(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=e+"px"):ut(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ut(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var e="leaflet-control-layers",n=this._container=se("div",e),s=this.options.collapsed;n.setAttribute("aria-haspopup",!0),_i(n),zn(n);var a=this._section=se("section",e+"-list");s&&(this._map.on("click",this.collapse,this),Ve(n,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var c=this._layersLink=se("a",e+"-toggle",n);c.href="#",c.title="Layers",c.setAttribute("role","button"),Ve(c,{keydown:function(p){p.keyCode===13&&this._expandSafely()},click:function(p){Ct(p),this._expandSafely()}},this),s||this.expand(),this._baseLayersList=se("div",e+"-base",a),this._separator=se("div",e+"-separator",a),this._overlaysList=se("div",e+"-overlays",a),n.appendChild(a)},_getLayer:function(e){for(var n=0;n<this._layers.length;n++)if(this._layers[n]&&y(this._layers[n].layer)===e)return this._layers[n]},_addLayer:function(e,n,s){this._map&&e.on("add remove",this._onLayerChange,this),this._layers.push({layer:e,name:n,overlay:s}),this.options.sortLayers&&this._layers.sort(h(function(a,c){return this.options.sortFunction(a.layer,c.layer,a.name,c.name)},this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;jn(this._baseLayersList),jn(this._overlaysList),this._layerControlInputs=[];var e,n,s,a,c=0;for(s=0;s<this._layers.length;s++)a=this._layers[s],this._addItem(a),n=n||a.overlay,e=e||!a.overlay,c+=a.overlay?0:1;return this.options.hideSingleBase&&(e=e&&c>1,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='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"'+(n?' checked="checked"':"")+"/>",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),Ve(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<c.length;p++)this._map.hasLayer(c[p])&&this._map.removeLayer(c[p]);for(p=0;p<a.length;p++)this._map.hasLayer(a[p])||this._map.addLayer(a[p]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e=this._layerControlInputs,n,s,a=this._map.getZoom(),c=e.length-1;c>=0;c--)n=e[c],s=this._getLayer(n.layerId).layer,n.disabled=s.options.minZoom!==void 0&&a<s.options.minZoom||s.options.maxZoom!==void 0&&a>s.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ve(e,"click",Ct),this.expand();var n=this;setTimeout(function(){st(e,"click",Ct),n._preventClick=!1})}}),$a=function(e,n,s){return new Lo(e,n,s)},Yt=Ht.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",s=se("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._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,s,a,c){var p=se("a",s,a);return p.innerHTML=e,p.href="#",p.title=n,p.setAttribute("role","button"),p.setAttribute("aria-label",n),_i(p),Ve(p,"click",wn),Ve(p,"click",c,this),Ve(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())&&(Oe(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Oe(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ge.mergeOptions({zoomControl:!0}),Ge.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Yt,this.addControl(this.zoomControl))});var Da=function(e){return new Yt(e)},Mo=Ht.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",s=se("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=se("div",n,s)),e.imperial&&(this._iScale=se("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}}),Na=function(e){return new Mo(e)},as='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Gn=Ht.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(_e.inlineSvg?as+" ":"")+"Leaflet</a>"},initialize:function(e){X(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=se("div","leaflet-control-attribution"),_i(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(' <span aria-hidden="true">|</span> ')}}});Ge.mergeOptions({attributionControl:!0}),Ge.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var rs=function(e){return new Gn(e)};Ht.Layers=Lo,Ht.Zoom=Yt,Ht.Scale=Mo,Ht.Attribution=Gn,$i.layers=$a,$i.zoom=Da,$i.scale=Na,$i.attribution=rs;var ct=Re.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 yi={Events:he},Di=_e.touch?"touchstart mousedown":"mousedown",Jt=De.extend({options:{clickTolerance:3},initialize:function(e,n,s,a){X(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=s},enable:function(){this._enabled||(Ve(this._dragStartTarget,Di,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Jt._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,Di,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!mi(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Jt._dragging===this&&this.finishDrag();return}if(!(Jt._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Jt._dragging=this,this._preventOutline&&ns(this._element),$s(),gi(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,s=ko(this._element);this._startPoint=new ne(n.clientX,n.clientY),this._startPos=On(this._element),this._parentScale=Rs(s);var a=e.type==="mousedown";Ve(document,a?"mousemove":"touchmove",this._onMove,this),Ve(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 ne(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)<this.options.clickTolerance||(s.x/=this._parentScale.x,s.y/=this._parentScale.y,Ct(e),this._moved||(this.fire("dragstart"),this._moved=!0,Oe(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Oe(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,this._lastEvent=e,this._updatePosition())}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),vt(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){ut(document.body,"leaflet-dragging"),this._lastTarget&&(ut(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),st(document,"mousemove touchmove",this._onMove,this),st(document,"mouseup touchend touchcancel",this._onUp,this),Ds(),zi();var n=this._moved&&this._moving;this._moving=!1,Jt._dragging=!1,n&&this.fire("dragend",{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function Fs(e,n,s){var a,c=[1,4,2,8],p,P,A,N,q,fe,Ie,qe;for(p=0,fe=e.length;p<fe;p++)e[p]._code=In(e[p],n);for(A=0;A<4;A++){for(Ie=c[A],a=[],p=0,fe=e.length,P=fe-1;p<fe;P=p++)N=e[p],q=e[P],N._code&Ie?q._code&Ie||(qe=us(q,N,Ie,n,s),qe._code=In(qe,n),a.push(qe)):(q._code&Ie&&(qe=us(q,N,Ie,n,s),qe._code=In(qe,n),a.push(qe)),a.push(N));e=a}return e}function Ni(e,n){var s,a,c,p,P,A,N,q,fe;if(!e||e.length===0)throw new Error("latlngs not passed");Lt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var Ie=W([0,0]),qe=$(e),jt=qe.getNorthWest().distanceTo(qe.getSouthWest())*qe.getNorthEast().distanceTo(qe.getNorthWest());jt<1700&&(Ie=qn(e));var Mt=e.length,dn=[];for(s=0;s<Mt;s++){var Xt=W(e[s]);dn.push(n.project(W([Xt.lat-Ie.lat,Xt.lng-Ie.lng])))}for(A=N=q=0,s=0,a=Mt-1;s<Mt;a=s++)c=dn[s],p=dn[a],P=c.y*p.x-p.y*c.x,N+=(c.x+p.x)*P,q+=(c.y+p.y)*P,A+=P*3;A===0?fe=dn[0]:fe=[N/A,q/A];var ms=n.unproject(ge(fe));return W([ms.lat+Ie.lat,ms.lng+Ie.lng])}function qn(e){for(var n=0,s=0,a=0,c=0;c<e.length;c++){var p=W(e[c]);n+=p.lat,s+=p.lng,a++}return W([n/a,s/a])}var Eo={__proto__:null,clipPolygon:Fs,polygonCenter:Ni,centroid:qn};function Yn(e,n){if(!n||!e.length)return e.slice();var s=n*n;return e=An(e,s),e=Fa(e,s),e}function Ri(e,n,s){return Math.sqrt($n(e,n,s,!0))}function Ra(e,n,s){return $n(e,n,s)}function Fa(e,n){var s=e.length,a=typeof Uint8Array<"u"?Uint8Array:Array,c=new a(s);c[0]=c[s-1]=1,Xe(e,c,n,0,s-1);var p,P=[];for(p=0;p<s;p++)c[p]&&P.push(e[p]);return P}function Xe(e,n,s,a,c){var p=0,P,A,N;for(A=a+1;A<=c-1;A++)N=$n(e[A],e[a],e[c],!0),N>p&&(P=A,p=N);p>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,p=e.length;a<p;a++)Ba(e[a],e[c])>n&&(s.push(e[a]),c=a);return c<p-1&&s.push(e[p-1]),s}var Fi;function ls(e,n,s,a,c){var p=a?Fi:In(e,s),P=In(n,s),A,N,q;for(Fi=P;;){if(!(p|P))return[e,n];if(p&P)return!1;A=p||P,N=us(e,n,A,s,c),q=In(N,s),A===p?(e=N,p=q):(n=N,P=q)}}function us(e,n,s,a,c){var p=n.x-e.x,P=n.y-e.y,A=a.min,N=a.max,q,fe;return s&8?(q=e.x+p*(N.y-e.y)/P,fe=N.y):s&4?(q=e.x+p*(A.y-e.y)/P,fe=A.y):s&2?(q=N.x,fe=e.y+P*(N.x-e.x)/p):s&1&&(q=A.x,fe=e.y+P*(A.x-e.x)/p),new ne(q,fe,c)}function In(e,n){var s=0;return e.x<n.min.x?s|=1:e.x>n.max.x&&(s|=2),e.y<n.min.y?s|=4:e.y>n.max.y&&(s|=8),s}function Ba(e,n){var s=n.x-e.x,a=n.y-e.y;return s*s+a*a}function $n(e,n,s,a){var c=n.x,p=n.y,P=s.x-c,A=s.y-p,N=P*P+A*A,q;return N>0&&(q=((e.x-c)*P+(e.y-p)*A)/N,q>1?(c=s.x,p=s.y):q>0&&(c+=P*q,p+=A*q)),P=e.x-c,A=e.y-p,a?P*P+A*A:new ne(c,p)}function Lt(e){return!me(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Bi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Lt(e)}function bi(e,n){var s,a,c,p,P,A,N,q;if(!e||e.length===0)throw new Error("latlngs not passed");Lt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var fe=W([0,0]),Ie=$(e),qe=Ie.getNorthWest().distanceTo(Ie.getSouthWest())*Ie.getNorthEast().distanceTo(Ie.getNorthWest());qe<1700&&(fe=qn(e));var jt=e.length,Mt=[];for(s=0;s<jt;s++){var dn=W(e[s]);Mt.push(n.project(W([dn.lat-fe.lat,dn.lng-fe.lng])))}for(s=0,a=0;s<jt-1;s++)a+=Mt[s].distanceTo(Mt[s+1])/2;if(a===0)q=Mt[0];else for(s=0,p=0;s<jt-1;s++)if(P=Mt[s],A=Mt[s+1],c=P.distanceTo(A),p+=c,p>a){N=(p-a)/c,q=[A.x-N*(A.x-P.x),A.y-N*(A.y-P.y)];break}var Xt=n.unproject(ge(q));return W([Xt.lat+fe.lat,Xt.lng+fe.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Ri,closestPointOnSegment:Ra,clipSegment:ls,_getEdgeIntersection:us,_getBitCode:In,_sqClosestPointOnSegment:$n,isFlat:Lt,_flat:Bi,polylineCenter:bi},Sn={project:function(e){return new ne(e.lng,e.lat)},unproject:function(e){return new I(e.y,e.x)},bounds:new Me([-180,-90],[180,90])},Vi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Me([-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),A=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),p/2);return a=-s*Math.log(Math.max(A,1e-10)),new ne(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),A=0,N=.1,q;A<15&&Math.abs(N)>1e-7;A++)q=c*Math.sin(P),q=Math.pow((1-q)/(1+q),c/2),N=Math.PI/2-2*Math.atan(p*q)-P,P+=N;return new I(P*n,e.x*n/s)}},Oo={__proto__:null,LonLat:Sn,Mercator:Vi,SphericalMercator:lt},Va=u({},O,{code:"EPSG:3395",projection:Vi,transformation:(function(){var e=.5/(Math.PI*Vi.R);return b(e,.5,-e,.5)})()}),Bs=u({},O,{code:"EPSG:4326",projection:Sn,transformation:b(1/180,1,-1/180,.5)}),zo=u({},C,{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});C.Earth=O,C.EPSG3395=Va,C.EPSG3857=g,C.EPSG900913=M,C.EPSG4326=Bs,C.Simple=zo;var nn=De.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})}}});Ge.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?me(e)?e:[e]:[];for(var n=0,s=e.length;n<s;n++)this.addLayer(e[n])},_addZoomLimit:function(e){(!isNaN(e.options.maxZoom)||!isNaN(e.options.minZoom))&&(this._zoomBoundLayers[y(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var n=y(e);this._zoomBoundLayers[n]&&(delete this._zoomBoundLayers[n],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,n=-1/0,s=this._getZoomSpan();for(var a in this._zoomBoundLayers){var c=this._zoomBoundLayers[a].options;e=c.minZoom===void 0?e:Math.min(e,c.minZoom),n=c.maxZoom===void 0?n:Math.max(n,c.maxZoom)}this._layersMaxZoom=n===-1/0?void 0:n,this._layersMinZoom=e===1/0?void 0:e,s!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var xi=nn.extend({initialize:function(e,n){X(this,n),this._layers={};var s,a;if(e)for(s=0,a=e.length;s<a;s++)this.addLayer(e[s])},addLayer:function(e){var n=this.getLayerId(e);return this._layers[n]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var n=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[n]&&this._map.removeLayer(this._layers[n]),delete this._layers[n],this},hasLayer:function(e){var n=typeof e=="number"?e:this.getLayerId(e);return n in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var n=Array.prototype.slice.call(arguments,1),s,a;for(s in this._layers)a=this._layers[s],a[e]&&a[e].apply(a,n);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,n){for(var s in this._layers)e.call(n,this._layers[s]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return y(e)}}),cs=function(e,n){return new xi(e,n)},Pn=xi.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),xi.prototype.addLayer.call(this,e),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),xi.prototype.removeLayer.call(this,e),this.fire("layerremove",{layer:e})):this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new te;for(var n in this._layers){var s=this._layers[n];e.extend(s.getBounds?s.getBounds():s.getLatLng())}return e}}),pt=function(e,n){return new Pn(e,n)},cn=Re.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){X(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,n){var s=this._getIconUrl(e);if(!s){if(e==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var a=this._createImg(s,n&&n.tagName==="IMG"?n:null);return this._setIconStyles(a,e),(this.options.crossOrigin||this.options.crossOrigin==="")&&(a.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),a},_setIconStyles:function(e,n){var s=this.options,a=s[n+"Size"];typeof a=="number"&&(a=[a,a]);var c=ge(a),p=ge(n==="shadow"&&s.shadowAnchor||s.iconAnchor||c&&c.divideBy(2,!0));e.className="leaflet-marker-"+n+" "+(s.className||""),p&&(e.style.marginLeft=-p.x+"px",e.style.marginTop=-p.y+"px"),c&&(e.style.width=c.x+"px",e.style.height=c.y+"px")},_createImg:function(e,n){return n=n||document.createElement("img"),n.src=e,n},_getIconUrl:function(e){return _e.retina&&this.options[e+"RetinaUrl"]||this.options[e+"Url"]}});function Vs(e){return new cn(e)}var Jn=cn.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return typeof Jn.imagePath!="string"&&(Jn.imagePath=this._detectIconPath()),(this.options.imagePath||Jn.imagePath)+cn.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var n=function(s,a,c){var p=a.exec(s);return p&&p[c]};return e=n(e,/^url\((['"])?(.+)\1\)$/,2),e&&n(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=se("div","leaflet-default-icon-path",document.body),n=Ei(e,"background-image")||Ei(e,"backgroundImage");if(document.body.removeChild(e),n=this._stripUrl(n),n)return n;var s=document.querySelector('link[href$="leaflet.css"]');return s?s.href.substring(0,s.href.length-11-1):""}}),Ao=ct.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new Jt(e,e,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Oe(e,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ut(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var n=this._marker,s=n._map,a=this._marker.options.autoPanSpeed,c=this._marker.options.autoPanPadding,p=On(n._icon),P=s.getPixelBounds(),A=s.getPixelOrigin(),N=je(P.min._subtract(A).add(c),P.max._subtract(A).subtract(c));if(!N.contains(p)){var q=ge((Math.max(N.max.x,p.x)-N.max.x)/(P.max.x-N.max.x)-(Math.min(N.min.x,p.x)-N.min.x)/(P.min.x-N.min.x),(Math.max(N.max.y,p.y)-N.max.y)/(P.max.y-N.max.y)-(Math.min(N.min.y,p.y)-N.min.y)/(P.min.y-N.min.y)).multiplyBy(a);s.panBy(q,{animate:!1}),this._draggable._newPos._add(q),this._draggable._startPos._add(q),vt(n._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=Ce(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(ee(this._panRequest),this._panRequest=Ce(this._adjustPan.bind(this,e)))},_onDrag:function(e){var n=this._marker,s=n._shadow,a=On(n._icon),c=n._map.layerPointToLatLng(a);s&&vt(s,a),n._latlng=c,e.latlng=c,e.oldLatLng=this._oldLatLng,n.fire("move",e).fire("drag",e)},_onDragEnd:function(e){ee(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),ds=nn.extend({options:{icon:new Jn,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,n){X(this,n),this._latlng=W(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var n=this._latlng;return this._latlng=W(e),this.update(),this.fire("move",{oldLatLng:n,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,n="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),s=e.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,e.title&&(s.title=e.title),s.tagName==="IMG"&&(s.alt=e.alt||"")),Oe(s,n),e.keyboard&&(s.tabIndex="0",s.setAttribute("role","button")),this._icon=s,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ve(s,"focus",this._panOnFocus,this);var c=e.icon.createShadow(this._shadow),p=!1;c!==this._shadow&&(this._removeShadow(),p=!0),c&&(Oe(c,n),c.alt=""),this._shadow=c,e.opacity<1&&this._updateOpacity(),a&&this.getPane().appendChild(this._icon),this._initInteraction(),c&&p&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&st(this._icon,"focus",this._panOnFocus,this),it(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&it(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&vt(this._icon,e),this._shadow&&vt(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(n)},_initInteraction:function(){if(this.options.interactive&&(Oe(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ao)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ao(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&Dt(this._icon,e),this._shadow&&Dt(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var n=this.options.icon.options,s=n.iconSize?ge(n.iconSize):ge(0,0),a=n.iconAnchor?ge(n.iconAnchor):ge(0,0);e.panInside(this._latlng,{paddingTopLeft:a,paddingBottomRight:s.subtract(a)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function x(e,n){return new ds(e,n)}var f=nn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return X(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),G=f.extend({options:{fill:!0,radius:10},initialize:function(e,n){X(this,n),this._latlng=W(e),this._radius=this.options.radius},setLatLng:function(e){var n=this._latlng;return this._latlng=W(e),this.redraw(),this.fire("move",{oldLatLng:n,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var n=e&&e.radius||this._radius;return f.prototype.setStyle.call(this,e),this.setRadius(n),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,n=this._radiusY||e,s=this._clickTolerance(),a=[e+s,n+s];this._pxBounds=new Me(this._point.subtract(a),this._point.add(a))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function S(e,n){return new G(e,n)}var Qe=G.extend({initialize:function(e,n,s){if(typeof n=="number"&&(n=u({},s,{radius:n})),X(this,n),this._latlng=W(e),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new te(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:f.prototype.setStyle,_project:function(){var e=this._latlng.lng,n=this._latlng.lat,s=this._map,a=s.options.crs;if(a.distance===O.distance){var c=Math.PI/180,p=this._mRadius/O.R/c,P=s.project([n+p,e]),A=s.project([n-p,e]),N=P.add(A).divideBy(2),q=s.unproject(N).lat,fe=Math.acos((Math.cos(p*c)-Math.sin(n*c)*Math.sin(q*c))/(Math.cos(n*c)*Math.cos(q*c)))/c;(isNaN(fe)||fe===0)&&(fe=p/Math.cos(Math.PI/180*n)),this._point=N.subtract(s.getPixelOrigin()),this._radius=isNaN(fe)?0:N.x-s.project([q,e-fe]).x,this._radiusY=N.y-P.y}else{var Ie=a.unproject(a.project(this._latlng).subtract([this._mRadius,0]));this._point=s.latLngToLayerPoint(this._latlng),this._radius=this._point.x-s.latLngToLayerPoint(Ie).x}this._updateBounds()}});function Ec(e,n,s){return new Qe(e,n,s)}var Xn=f.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,n){X(this,n),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var n=1/0,s=null,a=$n,c,p,P=0,A=this._parts.length;P<A;P++)for(var N=this._parts[P],q=1,fe=N.length;q<fe;q++){c=N[q-1],p=N[q];var Ie=a(e,c,p,!0);Ie<n&&(n=Ie,s=a(e,c,p))}return s&&(s.distance=Math.sqrt(n)),s},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return bi(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,n){return n=n||this._defaultShape(),e=W(e),n.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new te,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return Lt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var n=[],s=Lt(e),a=0,c=e.length;a<c;a++)s?(n[a]=W(e[a]),this._bounds.extend(n[a])):n[a]=this._convertLatLngs(e[a]);return n},_project:function(){var e=new Me;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),n=new ne(e,e);this._rawPxBounds&&(this._pxBounds=new Me([this._rawPxBounds.min.subtract(n),this._rawPxBounds.max.add(n)]))},_projectLatlngs:function(e,n,s){var a=e[0]instanceof I,c=e.length,p,P;if(a){for(P=[],p=0;p<c;p++)P[p]=this._map.latLngToLayerPoint(e[p]),s.extend(P[p]);n.push(P)}else for(p=0;p<c;p++)this._projectLatlngs(e[p],n,s)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}var n=this._parts,s,a,c,p,P,A,N;for(s=0,c=0,p=this._rings.length;s<p;s++)for(N=this._rings[s],a=0,P=N.length;a<P-1;a++)A=ls(N[a],N[a+1],e,a,!0),A&&(n[c]=n[c]||[],n[c].push(A[0]),(A[1]!==N[a+1]||a===P-2)&&(n[c].push(A[1]),c++))}},_simplifyPoints:function(){for(var e=this._parts,n=this.options.smoothFactor,s=0,a=e.length;s<a;s++)e[s]=Yn(e[s],n)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,n){var s,a,c,p,P,A,N=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(s=0,p=this._parts.length;s<p;s++)for(A=this._parts[s],a=0,P=A.length,c=P-1;a<P;c=a++)if(!(!n&&a===0)&&Ri(e,A[c],A[a])<=N)return!0;return!1}});function Oc(e,n){return new Xn(e,n)}Xn._flat=Bi;var fs=Xn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Ni(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var n=Xn.prototype._convertLatLngs.call(this,e),s=n.length;return s>=2&&n[0]instanceof I&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(e){Xn.prototype._setLatLngs.call(this,e),Lt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Lt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,s=new ne(n,n);if(e=new Me(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;a<c;a++)p=Fs(this._rings[a],e,!0),p.length&&this._parts.push(p)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var n=!1,s,a,c,p,P,A,N,q;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(p=0,N=this._parts.length;p<N;p++)for(s=this._parts[p],P=0,q=s.length,A=q-1;P<q;A=P++)a=s[P],c=s[A],a.y>e.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 zc(e,n){return new fs(e,n)}var Qn=Pn.extend({initialize:function(e,n){X(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=me(e)?e:e.features,s,a,c;if(n){for(s=0,a=n.length;s<a;s++)c=n[s],(c.geometries||c.geometry||c.features||c.coordinates)&&this.addData(c);return this}var p=this.options;if(p.filter&&!p.filter(e))return this;var P=Io(e,p);return P?(P.feature=No(e),P.defaultOptions=P.options,this.resetStyle(P),p.onEachFeature&&p.onEachFeature(e,P),this.addLayer(P)):this},resetStyle:function(e){return e===void 0?this.eachLayer(this.resetStyle,this):(e.options=u({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(n){this._setLayerStyle(n,e)},this)},_setLayerStyle:function(e,n){e.setStyle&&(typeof n=="function"&&(n=n(e.feature)),e.setStyle(n))}});function Io(e,n){var s=e.type==="Feature"?e.geometry:e,a=s?s.coordinates:null,c=[],p=n&&n.pointToLayer,P=n&&n.coordsToLatLng||Ua,A,N,q,fe;if(!a&&!s)return null;switch(s.type){case"Point":return A=P(a),Nr(p,e,A,n);case"MultiPoint":for(q=0,fe=a.length;q<fe;q++)A=P(a[q]),c.push(Nr(p,e,A,n));return new Pn(c);case"LineString":case"MultiLineString":return N=$o(a,s.type==="LineString"?0:1,P),new Xn(N,n);case"Polygon":case"MultiPolygon":return N=$o(a,s.type==="Polygon"?1:2,P),new fs(N,n);case"GeometryCollection":for(q=0,fe=s.geometries.length;q<fe;q++){var Ie=Io({geometry:s.geometries[q],type:"Feature",properties:e.properties},n);Ie&&c.push(Ie)}return new Pn(c);case"FeatureCollection":for(q=0,fe=s.features.length;q<fe;q++){var qe=Io(s.features[q],n);qe&&c.push(qe)}return new Pn(c);default:throw new Error("Invalid GeoJSON object.")}}function Nr(e,n,s,a){return e?e(n,s):new ds(s,a&&a.markersInheritOptions&&a)}function Ua(e){return new I(e[1],e[0],e[2])}function $o(e,n,s){for(var a=[],c=0,p=e.length,P;c<p;c++)P=n?$o(e[c],n-1,s):(s||Ua)(e[c]),a.push(P);return a}function Za(e,n){return e=W(e),e.alt!==void 0?[U(e.lng,n),U(e.lat,n),U(e.alt,n)]:[U(e.lng,n),U(e.lat,n)]}function Do(e,n,s,a){for(var c=[],p=0,P=e.length;p<P;p++)c.push(n?Do(e[p],Lt(e[p])?0:n-1,s,a):Za(e[p],a));return!n&&s&&c.length>0&&c.push(c[0].slice()),c}function hs(e,n){return e.feature?u({},e.feature,{geometry:n}):No(n)}function No(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ha={toGeoJSON:function(e){return hs(this,{type:"Point",coordinates:Za(this.getLatLng(),e)})}};ds.include(Ha),Qe.include(Ha),G.include(Ha),Xn.include({toGeoJSON:function(e){var n=!Lt(this._latlngs),s=Do(this._latlngs,n?1:0,!1,e);return hs(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),fs.include({toGeoJSON:function(e){var n=!Lt(this._latlngs),s=n&&!Lt(this._latlngs[0]),a=Do(this._latlngs,s?2:n?1:0,!0,e);return n||(a=[a]),hs(this,{type:(s?"Multi":"")+"Polygon",coordinates:a})}}),xi.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(e).geometry.coordinates)}),hs(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=No(p);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),s?hs(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Rr(e,n){return new Qn(e,n)}var Ac=Rr,Ro=nn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,s){this._url=e,this._bounds=$(n),X(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Oe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){it(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=$(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:se("img");if(Oe(n,"leaflet-image-layer"),this._zoomAnimated&&Oe(n,"leaflet-zoom-animated"),this.options.className&&Oe(n,this.options.className),n.onselectstart=z,n.onmousemove=z,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;St(this._image,s,n)},_reset:function(){var e=this._image,n=new Me(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(){Dt(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()}}),Ic=function(e,n,s){return new Ro(e,n,s)},Fr=Ro.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:se("video");if(Oe(n,"leaflet-image-layer"),this._zoomAnimated&&Oe(n,"leaflet-zoom-animated"),this.options.className&&Oe(n,this.options.className),n.onselectstart=z,n.onmousemove=z,n.onloadeddata=h(this.fire,this,"load"),e){for(var s=n.getElementsByTagName("source"),a=[],c=0;c<s.length;c++)a.push(s[c].src);this._url=s.length>0?a:[n.src];return}me(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;p<this._url.length;p++){var P=se("source");P.src=this._url[p],n.appendChild(P)}}});function $c(e,n,s){return new Fr(e,n,s)}var Br=Ro.extend({_initImage:function(){var e=this._image=this._url;Oe(e,"leaflet-image-layer"),this._zoomAnimated&&Oe(e,"leaflet-zoom-animated"),this.options.className&&Oe(e,this.options.className),e.onselectstart=z,e.onmousemove=z}});function Dc(e,n,s){return new Br(e,n,s)}var Dn=nn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(e,n){e&&(e instanceof I||me(e))?(this._latlng=W(e),X(this,n)):(X(this,e),this._source=n),this.options.content&&(this._content=this.options.content)},openOn:function(e){return e=arguments.length?e:this._source._map,e.hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&Dt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&Dt(this._container,1),this.bringToFront(),this.options.interactive&&(Oe(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(Dt(this._container,0),this._removeTimeout=setTimeout(h(it,void 0,this._container),200)):it(this._container),this.options.interactive&&(ut(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=W(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ln(this._container),this},bringToBack:function(){return this._map&&bn(this._container),this},_prepareOpen:function(e){var n=this._source;if(!n._map)return!1;if(n instanceof Pn){n=null;var s=this._source._layers;for(var a in s)if(s[a]._map){n=s[a];break}if(!n)return!1;this._source=n}if(!e)if(n.getCenter)e=n.getCenter();else if(n.getLatLng)e=n.getLatLng();else if(n.getBounds)e=n.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,n=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof n=="string")e.innerHTML=n;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(n)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),n=ge(this.options.offset),s=this._getAnchor();this._zoomAnimated?vt(this._container,e.add(s)):n=n.add(e).add(s);var a=this._containerBottom=-n.y,c=this._containerLeft=-Math.round(this._containerWidth/2)+n.x;this._container.style.bottom=a+"px",this._container.style.left=c+"px"}},_getAnchor:function(){return[0,0]}});Ge.include({_initOverlay:function(e,n,s,a){var c=n;return c instanceof e||(c=new e(a).setContent(n)),s&&c.setLatLng(s),c}}),nn.include({_initOverlay:function(e,n,s,a){var c=s;return c instanceof e?(X(c,a),c._source=this):(c=n&&!a?n:new e(a,this),c.setContent(s)),c}});var Fo=Dn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(e){return e=arguments.length?e:this._source._map,!e.hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,Dn.prototype.openOn.call(this,e)},onAdd:function(e){Dn.prototype.onAdd.call(this,e),e.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof f||this._source.on("preclick",wt))},onRemove:function(e){Dn.prototype.onRemove.call(this,e),e.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof f||this._source.off("preclick",wt))},getEvents:function(){var e=Dn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e="leaflet-popup",n=this._container=se("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),s=this._wrapper=se("div",e+"-content-wrapper",n);if(this._contentNode=se("div",e+"-content",s),_i(n),zn(this._contentNode),Ve(n,"contextmenu",wt),this._tipContainer=se("div",e+"-tip-container",n),this._tip=se("div",e+"-tip",this._tipContainer),this.options.closeButton){var a=this._closeButton=se("a",e+"-close-button",n);a.setAttribute("role","button"),a.setAttribute("aria-label","Close popup"),a.href="#close",a.innerHTML='<span aria-hidden="true">×</span>',Ve(a,"click",function(c){Ct(c),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,n=e.style;n.width="",n.whiteSpace="nowrap";var s=e.offsetWidth;s=Math.min(s,this.options.maxWidth),s=Math.max(s,this.options.minWidth),n.width=s+1+"px",n.whiteSpace="",n.height="";var a=e.offsetHeight,c=this.options.maxHeight,p="leaflet-popup-scrolled";c&&a>c?(n.height=c+"px",Oe(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(Ei(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,a=this._containerWidth,c=new ne(this._containerLeft,-s-this._containerBottom);c._add(On(this._container));var p=e.layerPointToContainerPoint(c),P=ge(this.options.autoPanPadding),A=ge(this.options.autoPanPaddingTopLeft||P),N=ge(this.options.autoPanPaddingBottomRight||P),q=e.getSize(),fe=0,Ie=0;p.x+a+N.x>q.x&&(fe=p.x+a-q.x+N.x),p.x-fe-A.x<0&&(fe=p.x-A.x),p.y+s+N.y>q.y&&(Ie=p.y+s-q.y+N.y),p.y-Ie-A.y<0&&(Ie=p.y-A.y),(fe||Ie)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([fe,Ie]))}},_getAnchor:function(){return ge(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Nc=function(e,n){return new Fo(e,n)};Ge.mergeOptions({closePopupOnClick:!0}),Ge.include({openPopup:function(e,n,s){return this._initOverlay(Fo,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(Fo,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 Pn||(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 Bo=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=se("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),A=this.options.direction,N=c.offsetWidth,q=c.offsetHeight,fe=ge(this.options.offset),Ie=this._getAnchor();A==="top"?(n=N/2,s=q):A==="bottom"?(n=N/2,s=0):A==="center"?(n=N/2,s=q/2):A==="right"?(n=0,s=q/2):A==="left"?(n=N,s=q/2):P.x<p.x?(A="right",n=0,s=q/2):(A="left",n=N+(fe.x+Ie.x)*2,s=q/2),e=e.subtract(ge(n,s,!0)).add(fe).add(Ie),ut(c,"leaflet-tooltip-right"),ut(c,"leaflet-tooltip-left"),ut(c,"leaflet-tooltip-top"),ut(c,"leaflet-tooltip-bottom"),Oe(c,"leaflet-tooltip-"+A),vt(c,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&Dt(this._container,e)},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(n)},_getAnchor:function(){return ge(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Rc=function(e,n){return new Bo(e,n)};Ge.include({openTooltip:function(e,n,s){return this._initOverlay(Bo,e,n,s).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),nn.include({bindTooltip:function(e,n){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Bo,this._tooltip,e,n),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(e){if(!(!e&&this._tooltipHandlersAdded)){var n=e?"off":"on",s={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?s.add=this._openTooltip:(s.mouseover=this._openTooltip,s.mouseout=this.closeTooltip,s.click=this._openTooltip,this._map?this._addFocusListeners():s.add=this._addFocusListeners),this._tooltip.options.sticky&&(s.mousemove=this._moveTooltip),this[n](s),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof Pn||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var n=typeof e.getElement=="function"&&e.getElement();n&&(Ve(n,"focus",function(){this._tooltip._source=e,this.openTooltip()},this),Ve(n,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var n=typeof e.getElement=="function"&&e.getElement();n&&n.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var n=this;this._map.once("moveend",function(){n._openOnceFlag=!1,n._openTooltip(e)});return}this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)}},_moveTooltip:function(e){var n=e.latlng,s,a;this._tooltip.options.sticky&&e.originalEvent&&(s=this._map.mouseEventToContainerPoint(e.originalEvent),a=this._map.containerPointToLayerPoint(s),n=this._map.layerPointToLatLng(a)),this._tooltip.setLatLng(n)}});var Vr=cn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(e){var n=e&&e.tagName==="DIV"?e:document.createElement("div"),s=this.options;if(s.html instanceof Element?(jn(n),n.appendChild(s.html)):n.innerHTML=s.html!==!1?s.html:"",s.bgPos){var a=ge(s.bgPos);n.style.backgroundPosition=-a.x+"px "+-a.y+"px"}return this._setIconStyles(n,"icon"),n},createShadow:function(){return null}});function Fc(e){return new Vr(e)}cn.Default=Jn;var Us=nn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:_e.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(e){X(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),it(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ln(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(bn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=T(this._onMoveEnd,this.options.updateInterval,this)),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement("div")},getTileSize:function(){var e=this.options.tileSize;return e instanceof ne?e:new ne(e,e)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var n=this.getPane().children,s=-e(-1/0,1/0),a=0,c=n.length,p;a<c;a++)p=n[a].style.zIndex,n[a]!==this._container&&p&&(s=e(s,+p));isFinite(s)&&(this.options.zIndex=s+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!_e.ielt9){Dt(this._container,this.options.opacity);var e=+new Date,n=!1,s=!1;for(var a in this._tiles){var c=this._tiles[a];if(!(!c.current||!c.loaded)){var p=Math.min(1,(e-c.loaded)/200);Dt(c.el,p),p<1?n=!0:(c.active?s=!0:this._onOpaqueTile(c),c.active=!0)}}s&&!this._noPrune&&this._pruneTiles(),n&&(ee(this._fadeFrame),this._fadeFrame=Ce(this._updateOpacity,this))}},_onOpaqueTile:z,_initContainer:function(){this._container||(this._container=se("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,n=this.options.maxZoom;if(e!==void 0){for(var s in this._levels)s=Number(s),this._levels[s].el.children.length||s===e?(this._levels[s].el.style.zIndex=n-Math.abs(e-s),this._onUpdateLevel(s)):(it(this._levels[s].el),this._removeTilesAtZoom(s),this._onRemoveLevel(s),delete this._levels[s]);var a=this._levels[e],c=this._map;return a||(a=this._levels[e]={},a.el=se("div","leaflet-tile-container leaflet-zoom-animated",this._container),a.el.style.zIndex=n,a.origin=c.project(c.unproject(c.getPixelOrigin()),e).round(),a.zoom=e,this._setZoomTransform(a,c.getCenter(),c.getZoom()),z(a.el.offsetWidth),this._onCreateLevel(a)),this._level=a,a}},_onUpdateLevel:z,_onRemoveLevel:z,_onCreateLevel:z,_pruneTiles:function(){if(this._map){var e,n,s=this._map.getZoom();if(s>this.options.maxZoom||s<this.options.minZoom){this._removeAllTiles();return}for(e in this._tiles)n=this._tiles[e],n.retain=n.current;for(e in this._tiles)if(n=this._tiles[e],n.current&&!n.active){var a=n.coords;this._retainParent(a.x,a.y,a.z,a.z-5)||this._retainChildren(a.x,a.y,a.z,a.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}},_removeTilesAtZoom:function(e){for(var n in this._tiles)this._tiles[n].coords.z===e&&this._removeTile(n)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)it(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,n,s,a){var c=Math.floor(e/2),p=Math.floor(n/2),P=s-1,A=new ne(+c,+p);A.z=+P;var N=this._tileCoordsToKey(A),q=this._tiles[N];return q&&q.active?(q.retain=!0,!0):(q&&q.loaded&&(q.retain=!0),P>a?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 ne(c,p);P.z=s+1;var A=this._tileCoordsToKey(P),N=this._tiles[A];if(N&&N.active){N.retain=!0;continue}else N&&N.loaded&&(N.retain=!0);s+1<a&&this._retainChildren(c,p,s+1,a)}},_resetView:function(e){var n=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),n,n)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var n=this.options;return n.minNativeZoom!==void 0&&e<n.minNativeZoom?n.minNativeZoom:n.maxNativeZoom!==void 0&&n.maxNativeZoom<e?n.maxNativeZoom:e},_setView:function(e,n,s,a){var c=Math.round(n);this.options.maxZoom!==void 0&&c>this.options.maxZoom||this.options.minZoom!==void 0&&c<this.options.minZoom?c=void 0:c=this._clampZoom(c);var p=this.options.updateWhenZooming&&c!==this._tileZoom;(!a||p)&&(this._tileZoom=c,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),c!==void 0&&this._update(e),s||this._pruneTiles(),this._noPrune=!!s),this._setZoomTransforms(e,n)},_setZoomTransforms:function(e,n){for(var s in this._levels)this._setZoomTransform(this._levels[s],e,n)},_setZoomTransform:function(e,n,s){var a=this._map.getZoomScale(s,e.zoom),c=e.origin.multiplyBy(a).subtract(this._map._getNewPixelOrigin(n,s)).round();_e.any3d?St(e.el,c,a):vt(e.el,c)},_resetGrid:function(){var e=this._map,n=e.options.crs,s=this._tileSize=this.getTileSize(),a=this._tileZoom,c=this._map.getPixelWorldBounds(this._tileZoom);c&&(this._globalTileRange=this._pxBoundsToTileRange(c)),this._wrapX=n.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,n.wrapLng[0]],a).x/s.x),Math.ceil(e.project([0,n.wrapLng[1]],a).x/s.y)],this._wrapY=n.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([n.wrapLat[0],0],a).y/s.x),Math.ceil(e.project([n.wrapLat[1],0],a).y/s.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(e){var n=this._map,s=n._animatingZoom?Math.max(n._animateToZoom,n.getZoom()):n.getZoom(),a=n.getZoomScale(s,this._tileZoom),c=n.project(e,this._tileZoom).floor(),p=n.getSize().divideBy(a*2);return new Me(c.subtract(p),c.add(p))},_update:function(e){var n=this._map;if(n){var s=this._clampZoom(n.getZoom());if(e===void 0&&(e=n.getCenter()),this._tileZoom!==void 0){var a=this._getTiledPixelBounds(e),c=this._pxBoundsToTileRange(a),p=c.getCenter(),P=[],A=this.options.keepBuffer,N=new Me(c.getBottomLeft().subtract([A,-A]),c.getTopRight().add([A,-A]));if(!(isFinite(c.min.x)&&isFinite(c.min.y)&&isFinite(c.max.x)&&isFinite(c.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var q in this._tiles){var fe=this._tiles[q].coords;(fe.z!==this._tileZoom||!N.contains(new ne(fe.x,fe.y)))&&(this._tiles[q].current=!1)}if(Math.abs(s-this._tileZoom)>1){this._setView(e,s);return}for(var Ie=c.min.y;Ie<=c.max.y;Ie++)for(var qe=c.min.x;qe<=c.max.x;qe++){var jt=new ne(qe,Ie);if(jt.z=this._tileZoom,!!this._isValidTile(jt)){var Mt=this._tiles[this._tileCoordsToKey(jt)];Mt?Mt.current=!0:P.push(jt)}}if(P.sort(function(Xt,ms){return Xt.distanceTo(p)-ms.distanceTo(p)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(qe=0;qe<P.length;qe++)this._addTile(P[qe],dn);this._level.el.appendChild(dn)}}}},_isValidTile:function(e){var n=this._map.options.crs;if(!n.infinite){var s=this._globalTileRange;if(!n.wrapLng&&(e.x<s.min.x||e.x>s.max.x)||!n.wrapLat&&(e.y<s.min.y||e.y>s.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return $(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 te(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 ne(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(e){var n=this._tiles[e];n&&(it(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Oe(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=z,e.onmousemove=z,_e.ielt9&&this.options.opacity<1&&Dt(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&&Ce(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?(Dt(s.el,0),ee(this._fadeFrame),this._fadeFrame=Ce(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Oe(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?Ce(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 ne(this._wrapX?w(e.x,this._wrapX):e.x,this._wrapY?w(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Me(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 Bc(e){return new Us(e)}var ps=Us.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=X(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 Ve(s,"load",h(this._tileOnLoad,this,n,s)),Ve(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:_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 Q(this._url,u(n,this.options))},_tileOnLoad:function(e,n){_e.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=z,n.onerror=z,!n.complete)){n.src=de;var s=this._tiles[e].coords;it(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",de),Us.prototype._removeTile.call(this,e)},_tileReady:function(e,n,s){if(!(!this._map||s&&s.getAttribute("src")===de))return Us.prototype._tileReady.call(this,e,n,s)}});function Ur(e,n){return new ps(e,n)}var Zr=ps.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=X(this,n);var c=n.detectRetina&&_e.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,ps.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),s=this._crs,a=je(s.project(n[0]),s.project(n[1])),c=a.min,p=a.max,P=(this._wmsVersion>=1.3&&this._crs===Bs?[c.y,c.x,p.y,p.x]:[c.x,c.y,p.x,p.y]).join(","),A=ps.prototype.getTileUrl.call(this,e);return A+Ae(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 Vc(e,n){return new Zr(e,n)}ps.WMS=Zr,Ur.wms=Vc;var ei=nn.extend({options:{padding:.1},initialize:function(e){X(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Oe(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));_e.any3d?St(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 Me(s,s.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Hr=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");Ve(e,"mousemove",this._onMouseMove,this),Ve(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ve(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ee(this._redrawRequest),delete this._ctx,it(this._container),st(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[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<n.length;c++){if(a=Number(n[c]),isNaN(a))return;s.push(a)}e.options._dashArray=s}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||Ce(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var n=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Me,this._redrawBounds.extend(e._pxBounds.min.subtract([n,n])),this._redrawBounds.extend(e._pxBounds.max.add([n,n]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var n=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,n.x,n.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,n=this._redrawBounds;if(this._ctx.save(),n){var s=n.getSize();this._ctx.beginPath(),this._ctx.rect(n.min.x,n.min.y,s.x,s.y),this._ctx.clip()}this._drawing=!0;for(var a=this._drawFirst;a;a=a.next)e=a.layer,(!n||e._pxBounds&&e._pxBounds.intersects(n))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,n){if(this._drawing){var s,a,c,p,P=e._parts,A=P.length,N=this._ctx;if(A){for(N.beginPath(),s=0;s<A;s++){for(a=0,c=P[s].length;a<c;a++)p=P[s][a],N[a?"lineTo":"moveTo"](p.x,p.y);n&&N.closePath()}this._fillStroke(N,e)}}},_updateCircle:function(e){if(!(!this._drawing||e._empty())){var n=e._point,s=this._ctx,a=Math.max(Math.round(e._radius),1),c=(Math.max(Math.round(e._radiusY),1)||a)/a;c!==1&&(s.save(),s.scale(1,c)),s.beginPath(),s.arc(n.x,n.y/c,a,0,Math.PI*2,!1),c!==1&&s.restore(),this._fillStroke(s,e)}},_fillStroke:function(e,n){var s=n.options;s.fill&&(e.globalAlpha=s.fillOpacity,e.fillStyle=s.fillColor||s.color,e.fill(s.fillRule||"evenodd")),s.stroke&&s.weight!==0&&(e.setLineDash&&e.setLineDash(n.options&&n.options._dashArray||[]),e.globalAlpha=s.opacity,e.lineWidth=s.weight,e.strokeStyle=s.color,e.lineCap=s.lineCap,e.lineJoin=s.lineJoin,e.stroke())},_onClick:function(e){for(var n=this._map.mouseEventToLayerPoint(e),s,a,c=this._drawFirst;c;c=c.next)s=c.layer,s.options.interactive&&s._containsPoint(n)&&(!(e.type==="click"||e.type==="preclick")||!this._map._draggableMoved(s))&&(a=s);this._fireEvent(a?[a]:!1,e)},_onMouseMove:function(e){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var n=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,n)}},_handleMouseOut:function(e){var n=this._hoveredLayer;n&&(ut(this._container,"leaflet-interactive"),this._fireEvent([n],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,n){if(!this._mouseHoverThrottled){for(var s,a,c=this._drawFirst;c;c=c.next)s=c.layer,s.options.interactive&&s._containsPoint(n)&&(a=s);a!==this._hoveredLayer&&(this._handleMouseOut(e),a&&(Oe(this._container,"leaflet-interactive"),this._fireEvent([a],e,"mouseover"),this._hoveredLayer=a)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,e),this._mouseHoverThrottled=!0,setTimeout(h(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(e,n,s){this._map._fireDOMEvent(n,s||n.type,e)},_bringToFront:function(e){var n=e._order;if(n){var s=n.next,a=n.prev;if(s)s.prev=a;else return;a?a.next=s:s&&(this._drawFirst=s),n.prev=this._drawLast,this._drawLast.next=n,n.next=null,this._drawLast=n,this._requestRedraw(e)}},_bringToBack:function(e){var n=e._order;if(n){var s=n.next,a=n.prev;if(a)a.next=s;else return;s?s.prev=a:a&&(this._drawLast=a),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(e)}}});function jr(e){return _e.canvas?new Hr(e):null}var Zs=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Uc={_initContainer:function(){this._container=se("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ei.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=Zs("shape");Oe(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=Zs("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;it(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=Zs("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=me(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=Zs("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)}},Vo=_e.vml?Zs:Z,Hs=ei.extend({_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){it(this._container),st(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=Vo("path");e.options.className&&Oe(n,e.options.className),e.options.interactive&&Oe(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){it(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,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 ",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)}});_e.vml&&Hs.include(Uc);function Wr(e){return _e.svg||_e.vml?new Hs(e):null}Ge.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&&jr(e)||Wr(e)}});var Kr=fs.extend({initialize:function(e,n){fs.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=$(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function Zc(e,n){return new Kr(e,n)}Hs.create=Vo,Hs.pointsToPath=B,Qn.geometryToLayer=Io,Qn.coordsToLatLng=Ua,Qn.coordsToLatLngs=$o,Qn.latLngToCoords=Za,Qn.latLngsToCoords=Do,Qn.getFeature=hs,Qn.asFeature=No,Ge.mergeOptions({boxZoom:!0});var Gr=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(){Ve(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){it(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(),gi(),$s(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ve(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=se("div","leaflet-zoom-box",this._container),Oe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Me(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&&(it(this._box),ut(this._container,"leaflet-crosshair")),zi(),Ds(),st(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 te(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())}});Ge.addInitHook("addHandler","boxZoom",Gr),Ge.mergeOptions({doubleClickZoom:!0});var qr=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)}});Ge.addInitHook("addHandler","doubleClickZoom",qr),Ge.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Yr=ct.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Jt(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))}Oe(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=$(this._map.options.maxBounds);this._offsetLimit=je(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.x<n.min.x&&(e.x=this._viscousLimit(e.x,n.min.x)),e.y<n.min.y&&(e.y=this._viscousLimit(e.y,n.min.y)),e.x>n.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)<Math.abs(p+s)?c:p;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=P},_onDragEnd:function(e){var n=this._map,s=n.options,a=!s.inertia||e.noInertia||this._times.length<2;if(n.fire("dragend",e),a)n.fire("moveend");else{this._prunePositions(+new Date);var c=this._lastPos.subtract(this._positions[0]),p=(this._lastTime-this._times[0])/1e3,P=s.easeLinearity,A=c.multiplyBy(P/p),N=A.distanceTo([0,0]),q=Math.min(s.inertiaMaxSpeed,N),fe=A.multiplyBy(q/N),Ie=q/(s.inertiaDeceleration*P),qe=fe.multiplyBy(-Ie/2).round();!qe.x&&!qe.y?n.fire("moveend"):(qe=n._limitOffset(qe,n.options.maxBounds),Ce(function(){n.panBy(qe,{duration:Ie,easeLinearity:P,noMoveStart:!0,animate:!0})}))}}});Ge.addInitHook("addHandler","dragging",Yr),Ge.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Jr=ct.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex="0"),Ve(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),st(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,n=document.documentElement,s=e.scrollTop||n.scrollTop,a=e.scrollLeft||n.scrollLeft;this._map._container.focus(),window.scrollTo(a,s)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var n=this._panKeys={},s=this.keyCodes,a,c;for(a=0,c=s.left.length;a<c;a++)n[s.left[a]]=[-1*e,0];for(a=0,c=s.right.length;a<c;a++)n[s.right[a]]=[e,0];for(a=0,c=s.down.length;a<c;a++)n[s.down[a]]=[0,e];for(a=0,c=s.up.length;a<c;a++)n[s.up[a]]=[0,-1*e]},_setZoomDelta:function(e){var n=this._zoomKeys={},s=this.keyCodes,a,c;for(a=0,c=s.zoomIn.length;a<c;a++)n[s.zoomIn[a]]=e;for(a=0,c=s.zoomOut.length;a<c;a++)n[s.zoomOut[a]]=-e},_addHooks:function(){Ve(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){st(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var n=e.keyCode,s=this._map,a;if(n in this._panKeys){if(!s._panAnim||!s._panAnim._inProgress)if(a=this._panKeys[n],e.shiftKey&&(a=ge(a).multiplyBy(3)),s.options.maxBounds&&(a=s._limitOffset(ge(a),s.options.maxBounds)),s.options.worldCopyJump){var c=s.wrapLatLng(s.unproject(s.project(s.getCenter()).add(a)));s.panTo(c)}else s.panBy(a)}else if(n in this._zoomKeys)s.setZoom(s.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[n]);else if(n===27&&s._popup&&s._popup.options.closeOnEscapeKey)s.closePopup();else return;wn(e)}}});Ge.addInitHook("addHandler","keyboard",Jr),Ge.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Xr=ct.extend({addHooks:function(){Ve(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){st(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var n=To(e),s=this._map.options.wheelDebounceTime;this._delta+=n,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var a=Math.max(s-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(h(this._performZoom,this),a),wn(e)},_performZoom:function(){var e=this._map,n=e.getZoom(),s=this._map.options.zoomSnap||0;e._stop();var a=this._delta/(this._map.options.wheelPxPerZoomLevel*4),c=4*Math.log(2/(1+Math.exp(-Math.abs(a))))/Math.LN2,p=s?Math.ceil(c/s)*s:c,P=e._limitZoom(n+(this._delta>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))}});Ge.addInitHook("addHandler","scrollWheelZoom",Xr);var Hc=600;Ge.mergeOptions({tapHold:_e.touchNative&&_e.safari&&_e.mobile,tapTolerance:15});var Qr=ct.extend({addHooks:function(){Ve(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(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 ne(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Ve(document,"touchend",Ct),Ve(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),Hc),Ve(document,"touchend touchcancel contextmenu",this._cancel,this),Ve(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){st(document,"touchend",Ct),st(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ne(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)}});Ge.addInitHook("addHandler","tapHold",Qr),Ge.mergeOptions({touchZoom:_e.touch,bounceAtZoomLimits:!0});var el=ct.extend({addHooks:function(){Oe(this._map._container,"leaflet-touch-zoom"),Ve(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ut(this._map._container,"leaflet-touch-zoom"),st(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(),Ve(document,"touchmove",this._onTouchMove,this),Ve(document,"touchend touchcancel",this._onTouchEnd,this),Ct(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._zoom<n.getMinZoom()&&c<1||this._zoom>n.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),ee(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Ce(P,this,!0),Ct(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ee(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(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))}});Ge.addInitHook("addHandler","touchZoom",el),Ge.BoxZoom=Gr,Ge.DoubleClickZoom=qr,Ge.Drag=Yr,Ge.Keyboard=Jr,Ge.ScrollWheelZoom=Xr,Ge.TapHold=Qr,Ge.TouchZoom=el,o.Bounds=Me,o.Browser=_e,o.CRS=C,o.Canvas=Hr,o.Circle=Qe,o.CircleMarker=G,o.Class=Re,o.Control=Ht,o.DivIcon=Vr,o.DivOverlay=Dn,o.DomEvent=Co,o.DomUtil=Aa,o.Draggable=Jt,o.Evented=De,o.FeatureGroup=Pn,o.GeoJSON=Qn,o.GridLayer=Us,o.Handler=ct,o.Icon=cn,o.ImageOverlay=Ro,o.LatLng=I,o.LatLngBounds=te,o.Layer=nn,o.LayerGroup=xi,o.LineUtil=kn,o.Map=Ge,o.Marker=ds,o.Mixin=yi,o.Path=f,o.Point=ne,o.PolyUtil=Eo,o.Polygon=fs,o.Polyline=Xn,o.Popup=Fo,o.PosAnimation=Ii,o.Projection=Oo,o.Rectangle=Kr,o.Renderer=ei,o.SVG=Hs,o.SVGOverlay=Br,o.TileLayer=ps,o.Tooltip=Bo,o.Transformation=qt,o.Util=pe,o.VideoOverlay=Fr,o.bind=h,o.bounds=je,o.canvas=jr,o.circle=Ec,o.circleMarker=S,o.control=$i,o.divIcon=Fc,o.extend=u,o.featureGroup=pt,o.geoJSON=Rr,o.geoJson=Ac,o.gridLayer=Bc,o.icon=Vs,o.imageOverlay=Ic,o.latLng=W,o.latLngBounds=$,o.layerGroup=cs,o.map=os,o.marker=x,o.point=ge,o.polygon=zc,o.polyline=Oc,o.popup=Nc,o.rectangle=Zc,o.setOptions=X,o.stamp=y,o.svg=Wr,o.svgOverlay=Dc,o.tileLayer=Ur,o.tooltip=Rc,o.transformation=b,o.version=l,o.videoOverlay=$c;var jc=window.L;o.noConflict=function(){return window.L=jc,this},window.L=o}))})(Js,Js.exports)),Js.exports}var Zp=Up();const Go=Bp(Zp),Ql={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]}},setup(t){const i=t,o=K(null);let l,u,d;function h(){if(!l)return;const _=i.position;if(_&&(_.lat||_.lng)){const y=[_.lat,_.lng];u?u.setLatLng(y):(u=Go.marker(y).addTo(l),l.setView(y,17))}if(d&&d.remove(),i.trail.length){const y=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Go.polyline(i.trail,{color:y,weight:3}).addTo(l)}}return Li(()=>{l=Go.map(o.value,{zoomControl:!0}).setView([20,0],2),Go.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),h()}),en(()=>i.position,h,{deep:!0}),en(()=>i.trail,h,{deep:!0}),(_,y)=>(m(),v("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},Hp=["width","height","stroke-width"],jp=["d"],J={__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",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(le,null,Fe(Ue(l),(h,_)=>(m(),v("path",{key:_,d:h},null,8,jp))),128))],8,Hp))}},Wp=["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:Le(["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:Le(["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,Wp))}},Kp={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},Gp=["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",Kp,[(m(!0),v(le,null,Fe(t.options,d=>(m(),v("button",{key:d.value,type:"button",class:Le(["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(),et(J,{key:0,name:d.icon,size:15},null,8,["name"])):R("",!0),D(" "+k(d.label),1)],10,Gp))),128))]))}},qp={class:"text-sm font-semibold text-ink"},Yp={key:0,class:"mt-0.5 text-xs text-ink-muted"},xe={__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=to("settingsSearch",{value:""}),l=we(()=>{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:Le(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Le(t.block?"mb-3":"min-w-0")},[r("div",qp,k(t.title),1),t.desc?(m(),v("div",Yp,k(t.desc),1)):R("",!0)],2),r("div",{class:Le(t.block?"":"shrink-0")},[lf(u.$slots,"default")],2)],2)):R("",!0)}},Jp=(t,i)=>{const o=t.__vccOpts||t;for(const[l,u]of i)o[l]=u;return o},Xp={class:"mx-auto max-w-[1280px] p-7"},Qp={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},em={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},tm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},nm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},im=["onClick"],sm={class:"whitespace-nowrap"},om={class:"min-w-0"},am={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},rm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},lm={key:1,class:"panel mb-5 p-5"},um={class:"flex items-center gap-1"},cm={class:"flex items-center gap-2"},dm={class:"font-mono text-sm text-ink"},fm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},hm={key:0,class:"mt-2 text-xs text-ink-muted"},pm={class:"grid max-w-[420px] gap-2"},mm={class:"flex items-center gap-3"},gm={key:2,class:"panel mb-5 p-5"},vm=["value"],_m=["value"],ym=["value"],bm={class:"font-mono text-sm text-ink"},xm={key:3},wm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},km=["onClick"],Sm={key:1,class:"panel mb-5 p-5"},Pm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Tm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Cm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Lm={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"},Mm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Em={key:0},Om={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},zm={class:"font-semibold text-ink-secondary"},Am={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Im={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"},$m={class:"flex items-center justify-between gap-3"},Dm={class:"flex items-center gap-2 text-sm font-semibold text-ink"},Nm={key:0,class:"text-[11px] text-ink-muted"},Rm={class:"mt-2 flex items-baseline gap-1.5"},Fm={class:"font-mono text-2xl font-semibold text-ink"},Bm={class:"text-sm text-ink-muted"},Vm={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},Um={class:"mt-2 text-xs text-ink-muted"},Zm={class:"mt-2 text-sm text-ink"},Hm={class:"font-semibold"},jm={class:"mt-1 text-xs text-ink-muted"},Wm={key:1,class:"mt-2 text-xs text-ink-muted"},Km={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Gm={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"},qm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ym={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"},Jm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Xm={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"},Qm={key:0,class:"inline-flex items-center gap-2 font-mono 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"},tg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},ng={class:"mt-4 flex flex-wrap items-center gap-3"},ig=["disabled"],sg=["disabled"],og={key:2,class:"text-xs text-danger-fg"},ag={class:"panel mb-5 p-5"},rg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},lg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},ug={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},cg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},dg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},fg={key:0},hg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},pg={class:"font-semibold text-ink-secondary"},mg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},gg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},yg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},bg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},xg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},wg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},kg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Sg={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"},Tg={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"},Lg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Mg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Eg={key:0,class:"inline-flex items-center gap-2 font-mono 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 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"},Ig={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"},Dg={class:"mt-4 flex flex-wrap items-center gap-3"},Ng=["disabled"],Rg=["disabled"],Fg={key:2,class:"text-xs text-danger-fg"},Bg={key:3,class:"text-[11px] text-ink-muted"},Vg={class:"panel mb-5 p-5"},Ug={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Zg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Hg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},jg={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"},Wg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Kg={key:0},Gg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},qg={class:"font-semibold text-ink-secondary"},Yg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Jg={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},Xg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Qg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},ev={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},tv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},nv={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"},iv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},sv={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},ov={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},av={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},rv={class:"mt-4 flex flex-wrap items-center gap-3"},lv=["disabled"],uv=["disabled"],cv={key:2,class:"text-xs text-danger-fg"},dv={key:3,class:"text-[11px] text-ink-muted"},fv={key:3,class:"panel mb-5 p-5"},hv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},pv={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"},gv={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},vv={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"},_v={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},yv={key:0},bv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},xv={class:"font-semibold text-ink-secondary"},wv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},kv={class:"flex w-full flex-col gap-2"},Sv={class:"break-all 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"},Tv={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"},Cv={key:0,class:"text-xs text-ink-muted"},Lv={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Mv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Ev={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ov={class:"mt-4 flex flex-wrap items-center gap-3"},zv=["disabled"],Av=["disabled"],Iv={key:2,class:"text-xs text-danger-fg"},$v={key:3,class:"text-[11px] text-ink-muted"},Dv={key:4,class:"panel mb-5 p-5"},Nv={class:"flex items-center gap-4"},Rv=["src"],Fv={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},Bv={class:"flex gap-2"},Vv={class:"btn-ghost cursor-pointer"},Uv={class:"mt-1 text-right text-[11px] text-ink-muted"},Zv={key:5,class:"panel mb-5 p-5"},Hv={class:"flex items-center gap-3"},jv={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},Wv={class:"flex flex-wrap items-center gap-4"},Kv={class:"min-w-0"},Gv={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},qv={class:"mt-3 flex items-center gap-2"},Yv={key:0,class:"mt-2 text-xs text-danger-fg"},Jv={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},Xv={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},Qv={class:"rounded-lg border border-line bg-surface-2 p-3"},e_={class:"flex items-center gap-3"},t_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},n_={class:"min-w-0 flex-1"},i_={class:"text-sm font-semibold text-ink"},s_={class:"font-mono text-[11px] text-ink-muted"},o_={key:6,class:"mb-5"},a_={key:0,class:"panel mb-5 p-5"},r_={class:"grid max-w-[520px] gap-2"},l_={class:"flex flex-wrap gap-2"},u_=["disabled","title"],c_=["value"],d_=["value"],f_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},h_={class:"flex items-center gap-3"},p_=["disabled"],m_={key:0,class:"text-xs text-danger-fg"},g_={key:1,class:"text-xs text-ink-muted"},v_={key:1,class:"panel mb-5 p-5"},__={class:"grid max-w-[520px] gap-2"},y_={class:"flex flex-wrap gap-2"},b_=["value"],x_=["value"],w_={key:1,class:"text-xs text-ink-muted"},k_={class:"font-semibold text-ink-secondary"},S_={class:"flex items-center gap-3"},P_=["disabled"],T_={key:0,class:"text-xs text-danger-fg"},C_={class:"panel overflow-hidden p-0"},L_={class:"flex items-center justify-between px-5 py-4"},M_=["disabled"],E_={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},O_={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},z_={key:2,class:"overflow-x-auto"},A_={class:"w-full border-collapse text-sm"},I_={class:"text-left"},$_={class:"px-5 py-3"},D_={class:"text-ink"},N_={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},R_={class:"px-5 py-3"},F_={class:"px-5 py-3"},B_={class:"px-5 py-3"},V_={class:"px-5 py-3 text-right"},U_=["onClick"],Z_={key:1,class:"inline-flex items-center gap-1.5"},H_=["onClick"],j_=["onClick"],W_={key:7,class:"mb-5"},K_={key:0,class:"panel mb-5 p-5"},G_={class:"grid max-w-[520px] gap-2"},q_={class:"flex items-center gap-3"},Y_={key:0,class:"text-xs text-danger-fg"},J_={key:1,class:"panel mb-5 p-5"},X_={class:"grid max-w-[520px] gap-2"},Q_={class:"flex items-center gap-3"},ey=["disabled"],ty={key:0,class:"text-xs text-danger-fg"},ny={class:"panel overflow-hidden p-0"},iy={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},sy={key:1,class:"overflow-x-auto"},oy={class:"w-full border-collapse text-sm"},ay={class:"text-left"},ry={class:"px-5 py-3"},ly={class:"inline-flex items-center gap-2 text-ink"},uy={class:"px-5 py-3 text-ink-secondary"},cy={class:"px-5 py-3 text-right"},dy=["onClick"],fy={key:1,class:"inline-flex items-center gap-1.5"},hy=["onClick"],py=["disabled","title","onClick"],my={key:8,class:"mb-5"},gy={class:"panel mb-5 p-5"},vy={class:"btn-ghost cursor-pointer"},_y={key:0,class:"mt-2 text-xs text-ink-muted"},yy={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},by={class:"flex items-center gap-2 text-danger-fg"},xy={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},wy={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},ky={class:"mt-3"},Sy={class:"eyebrow mb-1 block"},Py={class:"text-ink"},Ty=["placeholder"],Cy={class:"mt-4 flex flex-wrap items-center gap-3"},Ly=["disabled"],My=["disabled"],Ey={key:2,class:"text-xs text-ink-muted"},Oy={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},zy={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"},eu="pv.opensky.health",tu="pv.filetransfer.health",nu="pv.webdav.health",iu="pv.localstorage.health",Ay={__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=we(()=>o.role==="superadmin"),d=we(()=>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"?T.accent:T.neutral}const T={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"},w=we(()=>{const x=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&x.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&x.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),x.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),x}),z=K("account"),U=K("");Iu("settingsSearch",U);const V=we(()=>U.value.trim().length>0),ue=we(()=>U.value.trim().toLowerCase());function X(x){return ue.value?(x.label+" "+x.kw).toLowerCase().includes(ue.value)||$e(x.id):!0}const Ae={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 $e(x){return ue.value?(Ae[x]||[]).some(f=>f.includes(ue.value)):!0}const Q=we(()=>V.value?w.value.filter(X):w.value.filter(x=>x.id===z.value)),me=we({get:()=>Yi.value,set:x=>la(x)}),oe=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],de=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Ne=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],nt=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],ke=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],Te=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],Be=K(Date.now());let Ce=null;const ee=we(()=>Yl(Be.value)),pe=bt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Re=K("user"),Ze=bt({clientId:"",clientSecret:"",plan:"",bbox:""}),he=K(""),De=K(!1),ne=K(!1),rt=K(null),ge=K(null),Me=we(()=>rt.value&&rt.value.credits||null),je=we(()=>{const x=Me.value;return!x||!x.daily||x.remaining==null?null:Math.max(0,Math.min(100,Math.round(x.remaining/x.daily*100)))}),te=we(()=>{const x=je.value;return x==null?"bg-accent":x<=10?"bg-danger":x<=30?"bg-amber":"bg-success"});function $(x){return typeof x=="number"?x.toLocaleString():x}function I(){if(!ge.value)return"";const x=Math.max(0,Math.round((Date.now()-ge.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function W(){try{rt.value&&localStorage.setItem(eu,JSON.stringify({health:rt.value,ts:ge.value}))}catch{}}function C(){try{const x=localStorage.getItem(eu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(rt.value=f.health,ge.value=f.ts||null)}catch{}}const O=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],ht=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],lt=we(()=>pe.isSuperadmin),qt=we(()=>pe.isSuperadmin?"user":Re.value),b=we(()=>pe.scopes[qt.value]||{editableLayer:"user",fields:{}}),g=we(()=>qt.value==="org");function M(x){return b.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Z(x){return lt.value||M(x).locked}function B(x){const f=M(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function H(){Ze.clientId=M("clientId").own||"",Ze.clientSecret=M("clientSecret").own||"",Ze.plan=M("plan").own||"",Ze.bbox=M("bbox").own||""}function ie(x){pe.available=!!x.available,pe.orgEnabled=x.orgEnabled!==!1,pe.allowAnonymous=!!x.allowAnonymous,pe.enabled=!!x.enabled,pe.canEditOrg=!!x.canEditOrg,pe.isSuperadmin=!!x.isSuperadmin,pe.scopes=x.scopes||{},Re.value==="org"&&!pe.canEditOrg&&(Re.value="user"),H(),pe.loaded=!0}en(Re,()=>{he.value="",H()});async function F(){C();const{ok:x,body:f}=await Yh();x&&ie(f)}async function Y(x){const f=g.value;f?pe.orgEnabled=x:pe.enabled=x;const{ok:G,body:S}=await Wl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(ie(S),Je(f?x?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":x?"OpenSky enabled.":"OpenSky disabled.")):(f?pe.orgEnabled=!x:pe.enabled=!x,Je(S.error||"Could not update."))}async function j(){he.value="",De.value=!0;const x={};for(const Qe of["clientId","clientSecret","plan","bbox"])Z(Qe)||(x[Qe]=Ze[Qe]);const f={scope:qt.value,config:x};g.value||(f.enabled=pe.enabled);const{ok:G,body:S}=await Wl(f);if(De.value=!1,!G){he.value=S.error||"Could not save settings.";return}ie(S),Je(g.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function Se(){ne.value=!0,rt.value=null;const{ok:x,body:f}=await Jh();ne.value=!1,rt.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},ge.value=Date.now(),W()}function ce(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const ae=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Pe=K("user"),We=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],be=bt(Object.fromEntries(We.map(x=>[x,""]))),Ye=K(""),dt=K(!1),gt=K(!1),_t=K(null),Tt=K(null),_n=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],ci=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],kt=we(()=>ae.isSuperadmin),$t=we(()=>ae.isSuperadmin?"user":Pe.value),En=we(()=>ae.scopes[$t.value]||{editableLayer:"user",fields:{}}),Vt=we(()=>$t.value==="org"),Ji=we(()=>(Ut("protocol")?zt("protocol").effective:be.protocol)||"sftp");function zt(x){return En.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function Ut(x){return kt.value||zt(x).locked}function yt(x){const f=zt(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function wa(x){return(_n.find(f=>f.value===x)||{}).label||x||"—"}function vo(){for(const x of We)be[x]=zt(x).own||"";be.protocol||(be.protocol="sftp"),be.insecureSkipVerify||(be.insecureSkipVerify="false")}function Ls(x){ae.available=!!x.available,ae.orgEnabled=x.orgEnabled!==!1,ae.enabled=!!x.enabled,ae.canEditOrg=!!x.canEditOrg,ae.isSuperadmin=!!x.isSuperadmin,ae.scopes=x.scopes||{},Pe.value==="org"&&!ae.canEditOrg&&(Pe.value="user"),vo(),ae.loaded=!0}en(Pe,()=>{Ye.value="",vo()});function ka(){if(!Tt.value)return"";const x=Math.max(0,Math.round((Date.now()-Tt.value)/1e3));if(x<60)return"just now";const f=Math.round(x/60);if(f<60)return`${f} min ago`;const G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Sa(){try{_t.value&&localStorage.setItem(tu,JSON.stringify({health:_t.value,ts:Tt.value}))}catch{}}function Pa(){try{const x=localStorage.getItem(tu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(_t.value=f.health,Tt.value=f.ts||null)}catch{}}async function Ms(){Pa();const{ok:x,body:f}=await Xh();x&&Ls(f)}async function _o(x){const f=Vt.value;f?ae.orgEnabled=x:ae.enabled=x;const{ok:G,body:S}=await Kl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(Ls(S),Je(f?x?"File transfer enabled for your organization.":"File transfer disabled for your organization.":x?"File transfer enabled.":"File transfer disabled.")):(f?ae.orgEnabled=!x:ae.enabled=!x,Je(S.error||"Could not update."))}async function Ta(){Ye.value="",dt.value=!0;const x={};for(const Qe of We)Ut(Qe)||(x[Qe]=be[Qe]);const f={scope:$t.value,config:x};Vt.value||(f.enabled=ae.enabled);const{ok:G,body:S}=await Kl(f);if(dt.value=!1,!G){Ye.value=S.error||"Could not save settings.";return}Ls(S),Je(Vt.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Ca(){gt.value=!0,_t.value=null;const{ok:x,body:f}=await Qh();gt.value=!1,_t.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},Tt.value=Date.now(),Sa()}function La(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const Ke=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),_e=K("user"),Xi=["baseURL","username","password","insecureSkipVerify","basePath"],At=bt(Object.fromEntries(Xi.map(x=>[x,""]))),di=K(""),Mi=K(!1),fi=K(!1),an=K(null),tn=K(null),yo=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Es=we(()=>Ke.isSuperadmin),Os=we(()=>Ke.isSuperadmin?"user":_e.value),Ma=we(()=>Ke.scopes[Os.value]||{editableLayer:"user",fields:{}}),rn=we(()=>Os.value==="org");function yn(x){return Ma.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function hi(x){return Es.value||yn(x).locked}function Zt(x){const f=yn(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function bo(){for(const x of Xi)At[x]=yn(x).own||"";At.insecureSkipVerify||(At.insecureSkipVerify="false")}function zs(x){Ke.available=!!x.available,Ke.orgEnabled=x.orgEnabled!==!1,Ke.enabled=!!x.enabled,Ke.canEditOrg=!!x.canEditOrg,Ke.isSuperadmin=!!x.isSuperadmin,Ke.scopes=x.scopes||{},_e.value==="org"&&!Ke.canEditOrg&&(_e.value="user"),bo(),Ke.loaded=!0}en(_e,()=>{di.value="",bo()});function Ea(){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 G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Oa(){try{an.value&&localStorage.setItem(nu,JSON.stringify({health:an.value,ts:tn.value}))}catch{}}function za(){try{const x=localStorage.getItem(nu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(an.value=f.health,tn.value=f.ts||null)}catch{}}async function As(){za();const{ok:x,body:f}=await np();x&&zs(f)}async function pi(x){const f=rn.value;f?Ke.orgEnabled=x:Ke.enabled=x;const{ok:G,body:S}=await Gl(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(zs(S),Je(f?x?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":x?"WebDAV enabled.":"WebDAV disabled.")):(f?Ke.orgEnabled=!x:Ke.enabled=!x,Je(S.error||"Could not update."))}async function xo(){di.value="",Mi.value=!0;const x={};for(const Qe of Xi)hi(Qe)||(x[Qe]=At[Qe]);const f={scope:Os.value,config:x};rn.value||(f.enabled=Ke.enabled);const{ok:G,body:S}=await Gl(f);if(Mi.value=!1,!G){di.value=S.error||"Could not save settings.";return}zs(S),Je(rn.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function wo(){fi.value=!0,an.value=null;const{ok:x,body:f}=await ip();fi.value=!1,an.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},tn.value=Date.now(),Oa()}function Ei(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.danger}const se=bt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),it=K("user"),jn=K(""),ln=K(""),bn=K(!1),mi=K(!1),Oe=K(null),ut=K(null),Wn=K({}),Oi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Dt=we(()=>se.isSuperadmin),Is=we(()=>se.isSuperadmin?"user":it.value),Qi=we(()=>se.scopes[Is.value]||{editableLayer:"user",fields:{}}),St=we(()=>Is.value==="org");function vt(x){return Qi.value.fields[x]||{effective:"",own:"",source:"unset",locked:!1}}function On(x){return Dt.value||vt(x).locked}function gi(x){const f=vt(x).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function zi(x){return(Oi.find(f=>f.value===x)||{}).label||"Inherit"}function es(){jn.value=vt("readOnly").own||""}function xn(x){se.available=!!x.available,se.orgEnabled=x.orgEnabled!==!1,se.enabled=!!x.enabled,se.canEditOrg=!!x.canEditOrg,se.isSuperadmin=!!x.isSuperadmin,se.isOrgUser=!!x.isOrgUser,se.mounts=Array.isArray(x.mounts)?x.mounts:[],se.privateFolder=!!x.privateFolder,se.privateEnabled=!!x.privateEnabled,se.allowPrivate=x.allowPrivate!==!1,se.rootConfigured=!!x.rootConfigured,se.scopes=x.scopes||{},it.value==="org"&&!se.canEditOrg&&(it.value="user"),es(),se.loaded=!0}en(it,()=>{ln.value="",es()});function $s(){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 G=Math.round(f/60);return G<24?`${G} h ago`:`${Math.round(G/24)} d ago`}function Ds(){try{Oe.value&&localStorage.setItem(iu,JSON.stringify({health:Oe.value,ts:ut.value}))}catch{}}function ts(){try{const x=localStorage.getItem(iu);if(!x)return;const f=JSON.parse(x);f&&f.health&&(Oe.value=f.health,ut.value=f.ts||null)}catch{}}async function Ns(){ts();const{ok:x,body:f}=await ep();x&&xn(f)}async function ns(x){const f=St.value;f?se.orgEnabled=x:se.enabled=x;const{ok:G,body:S}=await Ko(f?{scope:"org",enabled:x}:{scope:"user",enabled:x});G?(xn(S),Je(f?x?"Local storage enabled for your organization.":"Local storage disabled for your organization.":x?"Local storage enabled.":"Local storage disabled.")):(f?se.orgEnabled=!x:se.enabled=!x,Je(S.error||"Could not update."))}async function is(x){se.privateFolder=x;const{ok:f,body:G}=await Ko({scope:"user",privateFolder:x});f?(xn(G),Je(x?"Private folder enabled.":"Private folder disabled.")):(se.privateFolder=!x,Je(G.error||"Could not update."))}async function ko(x){se.allowPrivate=x;const{ok:f,body:G}=await Ko({scope:"org",allowPrivate:x});f?(xn(G),Je(x?"Members may now create private folders.":"Private folders disabled for your organization.")):(se.allowPrivate=!x,Je(G.error||"Could not update."))}async function Rs(){ln.value="",bn.value=!0;const x={};On("readOnly")||(x.readOnly=jn.value);const f={scope:Is.value,config:x};St.value||(f.enabled=se.enabled);const{ok:G,body:S}=await Ko(f);if(bn.value=!1,!G){ln.value=S.error||"Could not save settings.";return}xn(S),Je(St.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Aa(){mi.value=!0,Oe.value=null,Wn.value={};const{ok:x,body:f}=await tp();mi.value=!1,Oe.value=x&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const G={};if(Array.isArray(f.mounts))for(const S of f.mounts)G[S.id]={status:S.status,detail:S.detail};Wn.value=G,ut.value=Date.now(),Ds()}function Ve(x){return x==="ok"?T.success:x==="degraded"?T.warning:T.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"}],st=K("apis-external");function ss(x){return V.value||st.value===x}const vi=K("");let Ai=null;function Je(x){vi.value=x,clearTimeout(Ai),Ai=setTimeout(()=>vi.value="",2200)}const wt=bt({current:"",next:"",confirm:""}),zn=K(""),_i=K(!1);function Ct(){if(_i.value=!1,!wt.current)return zn.value="Enter your current password.";if(wt.next.length<8)return zn.value="New password must be at least 8 characters.";if(wt.next!==wt.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",wt.current=wt.next=wt.confirm=""}const wn=K("");function So(){wn.value="Verification link would be sent once the account service is wired up."}function Po(x){const f=x.target.files&&x.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){Je("Image too large (max ~1.5 MB).");return}const G=new FileReader;G.onload=()=>{ze.avatar=String(G.result),Je("Photo updated.")},G.readAsDataURL(f)}function Ia(){ze.avatar="",Je("Photo removed.")}const To=we(()=>{var G,S,Qe;const f=(ze.displayName||ze.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((G=f[0])==null?void 0:G[0])||"P")+(((S=f[1])==null?void 0:S[0])||((Qe=f[0])==null?void 0:Qe[1])||"V")).toUpperCase()}),Kn=K(!1),Co=K(""),Ii=K(""),Ge=K(""),os=K([]);function Ht(x){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let G="";for(let S=0;S<x;S++)G+=f[Math.floor(Math.random()*f.length)];return G}function $i(){Co.value=Ht(16).replace(/(.{4})/g,"$1 ").trim(),Ii.value="",Ge.value="",Kn.value=!0}function Lo(){if(!/^\d{6}$/.test(Ii.value)){Ge.value="Enter the 6-digit code from your authenticator app.";return}ze.twoFactor=!0,Kn.value=!1,os.value=Array.from({length:8},()=>Ht(4).toLowerCase()+"-"+Ht(4).toLowerCase()),Ge.value=""}function $a(){ze.twoFactor=!1,os.value=[],Kn.value=!1}const Yt=navigator.userAgent;function Da(){return/Edg\//.test(Yt)?"Edge":/OPR\//.test(Yt)?"Opera":/Chrome\//.test(Yt)?"Chrome":/Firefox\//.test(Yt)?"Firefox":/Safari\//.test(Yt)?"Safari":"Browser"}function Mo(){return/Windows/.test(Yt)?"Windows":/Mac OS X/.test(Yt)?"macOS":/Android/.test(Yt)?"Android":/iPhone|iPad/.test(Yt)?"iOS":/Linux/.test(Yt)?"Linux":"Unknown OS"}const Na=Date.now(),as=K([]),Gn=K(!1),rs=K(""),ct=bt({email:"",password:"",role:"user",organization:""}),yi=K(""),Di=K(!1),Jt=K(""),Fs=we(()=>{const x=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&x.push({value:"superadmin",label:"Superadmin"}),x}),Ni=K([]);async function qn(){if(!d.value)return;const x=await Hh();x.ok&&(Ni.value=x.organizations.slice().sort((f,G)=>f.name.localeCompare(G.name)))}const Eo=we(()=>{const x=Ni.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,rs.value="";const x=await Bh();if(Gn.value=!1,!x.ok){rs.value=x.status===403?"Manager role required.":"Could not load users.";return}as.value=x.users.slice().sort((f,G)=>f.email.localeCompare(G.email))}function Ri(x){try{const f=x.data||{},G=Object.keys(f)[0];return G&&f[G]&&f[G].message||x.message||x.error||"Invalid input."}catch{return x.error||"Could not create user."}}async function Ra(){yi.value="";const x=ct.email.trim().toLowerCase();if(!x.includes("@"))return yi.value="Enter a valid email.";if(ct.password.length<8)return yi.value="Password must be at least 8 characters.";Di.value=!0;const f=u.value?ct.organization:o.organization,{ok:G,body:S}=await Vh(x,ct.password,ct.role,f);if(Di.value=!1,!G)return yi.value=Ri(S);ct.email="",ct.password="",ct.role="user",ct.organization="",Je("User created."),Yn()}async function Fa(x){const{ok:f,body:G}=await Zh(x.id);if(Jt.value="",!f)return Je(G.error||"Could not remove user.");Je("User removed."),Yn()}const Xe=bt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=K(""),Fi=K(!1),ls=we(()=>!!Xe.id&&Xe.email===o.email);function us(x){Jt.value="",Xe.id=x.id,Xe.email=x.email,Xe.role=x.role||"user",Xe.verified=!!x.verified,Xe.password="",Xe.organization=x.organization||"",An.value=""}function In(){Xe.id="",An.value=""}async function Ba(){An.value="";const x=Xe.email.trim().toLowerCase();if(!x.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 f={email:x,role:Xe.role,verified:Xe.verified};u.value&&(f.organization=Xe.organization),Xe.password&&(f.password=Xe.password),Fi.value=!0;const{ok:G,body:S}=await Uh(Xe.id,f);if(Fi.value=!1,!G)return An.value=Ri(S);Je("User updated."),In(),Yn()}const $n=bt({name:""}),Lt=K(""),Bi=K(!1),bi=K(""),kn=bt({id:"",name:""}),Sn=K(""),Vi=we(()=>{const x={};for(const f of as.value)f.organization&&(x[f.organization]=(x[f.organization]||0)+1);return x});async function Oo(){Lt.value="";const x=$n.name.trim();if(!x)return Lt.value="Enter an organization name.";Bi.value=!0;const{ok:f,body:G}=await jh(x);if(Bi.value=!1,!f)return Lt.value=Ri(G);$n.name="",Je("Organization created."),qn()}function Va(x){bi.value="",kn.id=x.id,kn.name=x.name,Sn.value=""}function Bs(){kn.id="",Sn.value=""}async function zo(){Sn.value="";const x=kn.name.trim();if(!x)return Sn.value="Enter an organization name.";const{ok:f,body:G}=await Wh(kn.id,x);if(!f)return Sn.value=Ri(G);Je("Organization renamed."),Bs(),qn(),Yn()}async function nn(x){const{ok:f,body:G}=await Kh(x.id);if(bi.value="",!f)return Je(G.error||"Could not delete organization.");Je("Organization deleted."),qn()}function xi(){const x={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...ze},themeMode:Yi.value},f=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),G=URL.createObjectURL(f),S=document.createElement("a");S.href=G,S.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(S),S.click(),S.remove(),URL.revokeObjectURL(G),Je("Settings exported.")}const cs=K("");function Pn(x){const f=x.target.files&&x.target.files[0];if(!f)return;const G=new FileReader;G.onload=()=>{try{const S=JSON.parse(String(G.result)),Qe=S.prefs||S;if(!Cc(Qe))throw new Error("bad shape");S.themeMode&&la(S.themeMode),Ar(ze.fontSize),Ir(ze.reduceMotion),cs.value="Settings imported and applied."}catch{cs.value="That file is not a valid PilotVault settings export."}},G.readAsText(f),x.target.value=""}const pt=bt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const Vs=we(()=>o.email||"DELETE MY ACCOUNT"),Jn=we(()=>pt.understand&&pt.typed===Vs.value);function Ao(){Jn.value&&(pt.armed=!0,pt.cooldown=5,clearInterval(cn),cn=setInterval(()=>{pt.cooldown--,pt.cooldown<=0&&clearInterval(cn)},1e3))}en(Jn,x=>{!x&&pt.armed&&(pt.armed=!1,pt.cooldown=0,clearInterval(cn))});function ds(){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 Li(()=>{Ce=setInterval(()=>Be.value=Date.now(),1e3),qn(),Yn(),F(),Ms(),As(),Ns()}),_a(()=>{clearInterval(Ce),clearInterval(cn),clearTimeout(Ai)}),(x,f)=>(m(),v("div",Xp,[r("div",Qp,[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",em,[E(J,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":f[0]||(f[0]=G=>U.value=G),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,U.value]]),U.value?(m(),v("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=G=>U.value="")},[E(J,{name:"x",size:15})])):R("",!0)])]),r("div",tm,[re(r("nav",nm,[(m(!0),v(le,null,Fe(w.value,G=>(m(),v("button",{key:G.id,class:Le(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[z.value===G.id?G.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":G.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:S=>z.value=G.id},[E(J,{name:G.icon,size:17},null,8,["name"]),r("span",sm,k(G.label),1)],10,im))),128))],512),[[ah,!V.value]]),r("div",om,[V.value&&!Q.value.length?(m(),v("div",am," No settings match “"+k(U.value)+"”. ",1)):R("",!0),(m(!0),v(le,null,Fe(Q.value,G=>(m(),v(le,{key:G.id},[V.value?(m(),v("div",rm,[E(J,{name:G.icon,size:14},null,8,["name"]),D(" "+k(G.label),1)])):R("",!0),G.id==="account"?(m(),v("div",lm,[E(xe,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:ye(()=>[re(r("input",{"onUpdate:modelValue":f[2]||(f[2]=S=>Ue(ze).name=S),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).name]])]),_:1}),E(xe,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:ye(()=>[r("div",um,[f[63]||(f[63]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),re(r("input",{"onUpdate:modelValue":f[4]||(f[4]=S=>Ue(ze).username=S),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).username]])])]),_:1}),E(xe,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:ye(()=>[r("div",cm,[r("span",dm,k(t.email||"—"),1),r("span",fm,[E(J,{name:"mail",size:12}),f[64]||(f[64]=D(" Unverified ",-1))])])]),_:1}),E(xe,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:ye(()=>[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[E(J,{name:_(t.role),size:12},null,8,["name"]),D(k(h(t.role)),1)],2)]),_:1}),E(xe,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:ye(()=>[r("span",{class:Le(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},k(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),E(xe,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:ye(()=>[r("button",{class:"btn-ghost",onClick:So},"Send verification link"),wn.value?(m(),v("p",hm,k(wn.value),1)):R("",!0)]),_:1}),E(xe,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:ye(()=>[r("div",pm,[re(r("input",{"onUpdate:modelValue":f[6]||(f[6]=S=>wt.current=S),type:"password",class:"field",placeholder:"Current password"},null,512),[[ve,wt.current]]),re(r("input",{"onUpdate:modelValue":f[7]||(f[7]=S=>wt.next=S),type:"password",class:"field",placeholder:"New password"},null,512),[[ve,wt.next]]),re(r("input",{"onUpdate:modelValue":f[8]||(f[8]=S=>wt.confirm=S),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ve,wt.confirm]]),r("div",mm,[r("button",{class:"btn-accent",onClick:Ct},"Update password"),zn.value?(m(),v("span",{key:0,class:Le(["text-xs",_i.value?"text-success-fg":"text-ink-muted"])},k(zn.value),3)):R("",!0)])])]),_:1})])):G.id==="appearance"?(m(),v("div",gm,[E(xe,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:ye(()=>[E(hn,{modelValue:me.value,"onUpdate:modelValue":f[9]||(f[9]=S=>me.value=S),options:oe},null,8,["modelValue"])]),_:1}),E(xe,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:ye(()=>[E(hn,{modelValue:Ue(ze).fontSize,"onUpdate:modelValue":f[10]||(f[10]=S=>Ue(ze).fontSize=S),options:de},null,8,["modelValue"])]),_:1}),E(xe,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:ye(()=>[E(sn,{modelValue:Ue(ze).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=S=>Ue(ze).reduceMotion=S)},null,8,["modelValue"])]),_:1}),E(xe,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[12]||(f[12]=S=>Ue(ze).language=S),class:"field w-48"},[(m(),v(le,null,Fe(nt,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,vm)),64))],512),[[Et,Ue(ze).language]])]),_:1}),E(xe,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[13]||(f[13]=S=>Ue(ze).region=S),class:"field w-48"},[(m(),v(le,null,Fe(ke,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,_m)),64))],512),[[Et,Ue(ze).region]])]),_:1}),E(xe,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:ye(()=>[re(r("select",{"onUpdate:modelValue":f[14]||(f[14]=S=>Ue(ze).dateFormat=S),class:"field w-48"},[(m(),v(le,null,Fe(Te,([S,Qe])=>r("option",{key:S,value:S},k(Qe),9,ym)),64))],512),[[Et,Ue(ze).dateFormat]])]),_:1}),E(xe,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:ye(()=>[E(hn,{modelValue:Ue(ze).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=S=>Ue(ze).timeFormat=S),options:Ne},null,8,["modelValue"])]),_:1}),E(xe,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:ye(()=>[r("span",bm,k(ee.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))])):G.id==="integrations"?(m(),v("div",xm,[V.value?R("",!0):(m(),v("div",wm,[(m(),v(le,null,Fe(un,S=>r("button",{key:S.id,type:"button",class:Le(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",st.value===S.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Qe=>st.value=S.id},[E(J,{name:S.icon,size:16},null,8,["name"]),D(k(S.label),1)],10,km)),64))])),ss("apis-external")?(m(),v("div",Sm,[r("div",Pm,[r("div",Tm,[E(J,{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))]),pe.loaded&&!pe.available?(m(),v("div",Cm,[E(J,{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))])):R("",!0),pe.canEditOrg?(m(),v("div",Lm,[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)),E(hn,{modelValue:Re.value,"onUpdate:modelValue":f[16]||(f[16]=S=>Re.value=S),options:ht},null,8,["modelValue"])])):R("",!0),g.value?(m(),et(xe,{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:ye(()=>[E(sn,{"model-value":pe.orgEnabled,disabled:!pe.available,"onUpdate:modelValue":Y},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:ye(()=>[E(sn,{"model-value":pe.enabled,disabled:!pe.available||!pe.orgEnabled,"onUpdate:modelValue":Y},null,8,["model-value","disabled"])]),_:1})),!g.value&&pe.available&&!pe.orgEnabled?(m(),v("div",Mm,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[70]||(f[70]=D("OpenSky is turned off for your organization",-1)),pe.canEditOrg?(m(),v("span",Em,[...f[69]||(f[69]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[71]||(f[71]=D(". ",-1))])):R("",!0),g.value?(m(),v("div",Om,[E(J,{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",zm,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))])):lt.value?(m(),v("div",Am," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),pe.available&&!g.value?(m(),v("div",Im,[r("div",$m,[r("div",Dm,[E(J,{name:"signal",size:15}),f[74]||(f[74]=D("Credit usage ",-1))]),ge.value?(m(),v("span",Nm,"Checked "+k(I()),1)):R("",!0)]),Me.value?(m(),v(le,{key:0},[Me.value.remaining!=null?(m(),v(le,{key:0},[r("div",Rm,[r("span",Fm,k($(Me.value.remaining)),1),r("span",Bm,"/ "+k($(Me.value.daily))+" credits left today",1)]),r("div",Vm,[r("div",{class:Le(["h-full rounded-full transition-all",te.value]),style:Ss({width:je.value+"%"})},null,6)]),r("div",Um," Used "+k($(Me.value.daily-Me.value.remaining))+" today · "+k(Me.value.probeCost)+" credit"+k(Me.value.probeCost===1?"":"s")+" per query · "+k(Me.value.mode),1)],64)):(m(),v(le,{key:1},[r("div",Zm,[f[75]||(f[75]=D("Daily allowance: ",-1)),r("span",Hm,k($(Me.value.daily)),1),f[76]||(f[76]=D(" credits",-1))]),r("div",jm,k(Me.value.probeCost)+" credit"+k(Me.value.probeCost===1?"":"s")+" per query · "+k(Me.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(m(),v("div",Wm,[...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)])]))])):R("",!0),E(xe,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:ye(()=>[Z("plan")?(m(),v("span",Km,[D(k((O.find(S=>S.value===M("plan").effective)||{}).label||M("plan").effective||"—")+" ",1),B("plan")?(m(),v("span",Gm,[E(J,{name:"lock",size:10}),D(k(B("plan")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:Ze.plan,"onUpdate:modelValue":f[17]||(f[17]=S=>Ze.plan=S),options:O},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:ye(()=>[Z("bbox")?(m(),v("span",qm,[D(k(M("bbox").effective||"—")+" ",1),B("bbox")?(m(),v("span",Ym,[E(J,{name:"lock",size:10}),D(k(B("bbox")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[18]||(f[18]=S=>Ze.bbox=S),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ve,Ze.bbox]])]),_:1}),E(xe,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:ye(()=>[Z("clientId")?(m(),v("span",Jm,[D(k(M("clientId").effective||"—")+" ",1),B("clientId")?(m(),v("span",Xm,[E(J,{name:"lock",size:10}),D(k(B("clientId")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=S=>Ze.clientId=S),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ve,Ze.clientId]])]),_:1}),E(xe,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:ye(()=>[Z("clientSecret")?(m(),v("span",Qm,[D(k(M("clientSecret").effective||"—")+" ",1),B("clientSecret")?(m(),v("span",eg,[E(J,{name:"lock",size:10}),D(k(B("clientSecret")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=S=>Ze.clientSecret=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,Ze.clientSecret]])]),_:1}),pe.available&&!pe.allowAnonymous?(m(),v("div",tg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):R("",!0),r("div",ng,[lt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:De.value||!pe.available,onClick:j},k(De.value?"Saving…":g.value?"Save organization settings":"Save settings"),9,ig)),g.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:ne.value||!pe.available,onClick:Se},k(ne.value?"Testing…":"Test connection"),9,sg)),he.value?(m(),v("span",og,k(he.value),1)):R("",!0),rt.value&&!g.value?(m(),v("span",{key:3,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ce(rt.value.status)])},[f[78]||(f[78]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(rt.value.detail||rt.value.status),1)],2)):R("",!0)])])):R("",!0),ss("drives-external")?(m(),v(le,{key:2},[r("div",ag,[r("div",rg,[r("div",lg,[E(J,{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))]),ae.loaded&&!ae.available?(m(),v("div",ug,[E(J,{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))])):R("",!0),ae.canEditOrg?(m(),v("div",cg,[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)),E(hn,{modelValue:Pe.value,"onUpdate:modelValue":f[21]||(f[21]=S=>Pe.value=S),options:ht},null,8,["modelValue"])])):R("",!0),Vt.value?(m(),et(xe,{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:ye(()=>[E(sn,{"model-value":ae.orgEnabled,disabled:!ae.available,"onUpdate:modelValue":_o},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{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:ye(()=>[E(sn,{"model-value":ae.enabled,disabled:!ae.available||!ae.orgEnabled,"onUpdate:modelValue":_o},null,8,["model-value","disabled"])]),_:1})),!Vt.value&&ae.available&&!ae.orgEnabled?(m(),v("div",dg,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[83]||(f[83]=D("File transfer is turned off for your organization",-1)),ae.canEditOrg?(m(),v("span",fg,[...f[82]||(f[82]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[84]||(f[84]=D(". ",-1))])):R("",!0),Vt.value?(m(),v("div",hg,[E(J,{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",pg,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))])):kt.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. ")):R("",!0),E(xe,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:ye(()=>[Ut("protocol")?(m(),v("span",gg,[D(k(wa(zt("protocol").effective))+" ",1),yt("protocol")?(m(),v("span",vg,[E(J,{name:"lock",size:10}),D(k(yt("protocol")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:be.protocol,"onUpdate:modelValue":f[22]||(f[22]=S=>be.protocol=S),options:_n},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:ye(()=>[Ut("host")?(m(),v("span",_g,[D(k(zt("host").effective||"—")+" ",1),yt("host")?(m(),v("span",yg,[E(J,{name:"lock",size:10}),D(k(yt("host")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[23]||(f[23]=S=>be.host=S),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ve,be.host]])]),_:1}),E(xe,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:ye(()=>[Ut("port")?(m(),v("span",bg,[D(k(zt("port").effective||"default")+" ",1),yt("port")?(m(),v("span",xg,[E(J,{name:"lock",size:10}),D(k(yt("port")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=S=>be.port=S),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ve,be.port]])]),_:1}),E(xe,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:ye(()=>[Ut("username")?(m(),v("span",wg,[D(k(zt("username").effective||"—")+" ",1),yt("username")?(m(),v("span",kg,[E(J,{name:"lock",size:10}),D(k(yt("username")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=S=>be.username=S),class:"field w-64",placeholder:"user"},null,512)),[[ve,be.username]])]),_:1}),E(xe,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:ye(()=>[Ut("password")?(m(),v("span",Sg,[D(k(zt("password").effective||"—")+" ",1),yt("password")?(m(),v("span",Pg,[E(J,{name:"lock",size:10}),D(k(yt("password")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=S=>be.password=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,be.password]])]),_:1}),Ji.value==="sftp"?(m(),et(xe,{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:ye(()=>[Ut("privateKey")?(m(),v("span",Tg,[D(k(zt("privateKey").effective||"—")+" ",1),yt("privateKey")?(m(),v("span",Cg,[E(J,{name:"lock",size:10}),D(k(yt("privateKey")),1)])):R("",!0)])):re((m(),v("textarea",{key:1,"onUpdate:modelValue":f[27]||(f[27]=S=>be.privateKey=S),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ve,be.privateKey]])]),_:1})):R("",!0),Ji.value==="sftp"?(m(),et(xe,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:ye(()=>[Ut("keyPassphrase")?(m(),v("span",Lg,[D(k(zt("keyPassphrase").effective||"—")+" ",1),yt("keyPassphrase")?(m(),v("span",Mg,[E(J,{name:"lock",size:10}),D(k(yt("keyPassphrase")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[28]||(f[28]=S=>be.keyPassphrase=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,be.keyPassphrase]])]),_:1})):R("",!0),Ji.value==="sftp"?(m(),et(xe,{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:ye(()=>[Ut("hostKeyFingerprint")?(m(),v("span",Eg,[D(k(zt("hostKeyFingerprint").effective||"—")+" ",1),yt("hostKeyFingerprint")?(m(),v("span",Og,[E(J,{name:"lock",size:10}),D(k(yt("hostKeyFingerprint")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=S=>be.hostKeyFingerprint=S),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ve,be.hostKeyFingerprint]])]),_:1})):R("",!0),Ji.value==="ftps"?(m(),et(xe,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:ye(()=>[Ut("insecureSkipVerify")?(m(),v("span",zg,[D(k(zt("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),yt("insecureSkipVerify")?(m(),v("span",Ag,[E(J,{name:"lock",size:10}),D(k(yt("insecureSkipVerify")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:be.insecureSkipVerify,"onUpdate:modelValue":f[30]||(f[30]=S=>be.insecureSkipVerify=S),options:ci},null,8,["modelValue"]))]),_:1})):R("",!0),E(xe,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:ye(()=>[Ut("basePath")?(m(),v("span",Ig,[D(k(zt("basePath").effective||"—")+" ",1),yt("basePath")?(m(),v("span",$g,[E(J,{name:"lock",size:10}),D(k(yt("basePath")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[31]||(f[31]=S=>be.basePath=S),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ve,be.basePath]])]),_:1}),r("div",Dg,[kt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:dt.value||!ae.available,onClick:Ta},k(dt.value?"Saving…":Vt.value?"Save organization settings":"Save settings"),9,Ng)),Vt.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:gt.value||!ae.available,onClick:Ca},k(gt.value?"Testing…":"Test connection"),9,Rg)),Ye.value?(m(),v("span",Fg,k(Ye.value),1)):R("",!0),Tt.value&&!Vt.value?(m(),v("span",Bg,"Checked "+k(ka()),1)):R("",!0),_t.value&&!Vt.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",La(_t.value.status)])},[f[87]||(f[87]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(_t.value.detail||_t.value.status),1)],2)):R("",!0)])]),r("div",Vg,[r("div",Ug,[r("div",Zg,[E(J,{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))]),Ke.loaded&&!Ke.available?(m(),v("div",Hg,[E(J,{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))])):R("",!0),Ke.canEditOrg?(m(),v("div",jg,[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)),E(hn,{modelValue:_e.value,"onUpdate:modelValue":f[32]||(f[32]=S=>_e.value=S),options:ht},null,8,["modelValue"])])):R("",!0),rn.value?(m(),et(xe,{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:ye(()=>[E(sn,{"model-value":Ke.orgEnabled,disabled:!Ke.available,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:ye(()=>[E(sn,{"model-value":Ke.enabled,disabled:!Ke.available||!Ke.orgEnabled,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})),!rn.value&&Ke.available&&!Ke.orgEnabled?(m(),v("div",Wg,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[92]||(f[92]=D("WebDAV is turned off for your organization",-1)),Ke.canEditOrg?(m(),v("span",Kg,[...f[91]||(f[91]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[93]||(f[93]=D(". ",-1))])):R("",!0),rn.value?(m(),v("div",Gg,[E(J,{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",qg,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))])):Es.value?(m(),v("div",Yg," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):R("",!0),E(xe,{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:ye(()=>[hi("baseURL")?(m(),v("span",Jg,[D(k(yn("baseURL").effective||"—")+" ",1),Zt("baseURL")?(m(),v("span",Xg,[E(J,{name:"lock",size:10}),D(k(Zt("baseURL")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[33]||(f[33]=S=>At.baseURL=S),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ve,At.baseURL]])]),_:1}),E(xe,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:ye(()=>[hi("username")?(m(),v("span",Qg,[D(k(yn("username").effective||"—")+" ",1),Zt("username")?(m(),v("span",ev,[E(J,{name:"lock",size:10}),D(k(Zt("username")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=S=>At.username=S),class:"field w-64",placeholder:"user"},null,512)),[[ve,At.username]])]),_:1}),E(xe,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:ye(()=>[hi("password")?(m(),v("span",tv,[D(k(yn("password").effective||"—")+" ",1),Zt("password")?(m(),v("span",nv,[E(J,{name:"lock",size:10}),D(k(Zt("password")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=S=>At.password=S),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ve,At.password]])]),_:1}),E(xe,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:ye(()=>[hi("insecureSkipVerify")?(m(),v("span",iv,[D(k(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Zt("insecureSkipVerify")?(m(),v("span",sv,[E(J,{name:"lock",size:10}),D(k(Zt("insecureSkipVerify")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:At.insecureSkipVerify,"onUpdate:modelValue":f[36]||(f[36]=S=>At.insecureSkipVerify=S),options:yo},null,8,["modelValue"]))]),_:1}),E(xe,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:ye(()=>[hi("basePath")?(m(),v("span",ov,[D(k(yn("basePath").effective||"—")+" ",1),Zt("basePath")?(m(),v("span",av,[E(J,{name:"lock",size:10}),D(k(Zt("basePath")),1)])):R("",!0)])):re((m(),v("input",{key:1,"onUpdate:modelValue":f[37]||(f[37]=S=>At.basePath=S),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ve,At.basePath]])]),_:1}),r("div",rv,[Es.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:Mi.value||!Ke.available,onClick:xo},k(Mi.value?"Saving…":rn.value?"Save organization settings":"Save settings"),9,lv)),rn.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:fi.value||!Ke.available,onClick:wo},k(fi.value?"Testing…":"Test connection"),9,uv)),di.value?(m(),v("span",cv,k(di.value),1)):R("",!0),tn.value&&!rn.value?(m(),v("span",dv,"Checked "+k(Ea()),1)):R("",!0),an.value&&!rn.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ei(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)):R("",!0)])])],64)):R("",!0),ss("drives-local")?(m(),v("div",fv,[r("div",hv,[r("div",pv,[E(J,{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))]),se.loaded&&!se.available?(m(),v("div",mv,[E(J,{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))])):se.loaded&&!se.rootConfigured?(m(),v("div",gv,[E(J,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[99]||(f[99]=D(" No storage root has been configured by your administrator yet. ",-1))])):R("",!0),se.canEditOrg?(m(),v("div",vv,[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)),E(hn,{modelValue:it.value,"onUpdate:modelValue":f[38]||(f[38]=S=>it.value=S),options:ht},null,8,["modelValue"])])):R("",!0),St.value?(m(),et(xe,{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:ye(()=>[E(sn,{"model-value":se.orgEnabled,disabled:!se.available,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})):(m(),et(xe,{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:ye(()=>[E(sn,{"model-value":se.enabled,disabled:!se.available||!se.orgEnabled,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})),!St.value&&se.available&&!se.orgEnabled?(m(),v("div",_v,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[102]||(f[102]=D("Local storage is turned off for your organization",-1)),se.canEditOrg?(m(),v("span",yv,[...f[101]||(f[101]=[D(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),D(" to turn it back on",-1)])])):R("",!0),f[103]||(f[103]=D(". ",-1))])):R("",!0),St.value?(m(),v("div",bv,[E(J,{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",xv,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))])):Dt.value?(m(),v("div",wv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):R("",!0),St.value?(m(),et(xe,{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:ye(()=>[E(sn,{"model-value":se.allowPrivate,disabled:!se.available,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})):R("",!0),St.value?R("",!0):(m(),v(le,{key:9},[E(xe,{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:ye(()=>[r("div",kv,[(m(!0),v(le,null,Fe(se.mounts,S=>(m(),v("div",{key:S.id,class:"flex flex-wrap items-center gap-2"},[r("span",Sv,k(S.path),1),S.kind==="shared"?(m(),v("span",Pv,[E(J,{name:"users",size:10}),f[106]||(f[106]=D("Shared with your organization",-1))])):(m(),v("span",Tv,[E(J,{name:"lock",size:10}),f[107]||(f[107]=D("Private to you",-1))])),Wn.value[S.id]?(m(),v("span",{key:2,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",Ve(Wn.value[S.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[S.id].status),1)],2)):R("",!0)]))),128)),se.mounts.length?R("",!0):(m(),v("div",Cv,k(se.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),se.isOrgUser&&se.allowPrivate?(m(),et(xe,{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:ye(()=>[E(sn,{"model-value":se.privateFolder,disabled:!se.available||!se.orgEnabled,"onUpdate:modelValue":is},null,8,["model-value","disabled"])]),_:1})):se.isOrgUser&&!se.allowPrivate?(m(),v("div",Lv,[E(J,{name:"lock",size:13,class:"mr-1 inline"}),f[109]||(f[109]=D("Private folders are turned off by your organization. ",-1))])):R("",!0)],64)),E(xe,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:ye(()=>[On("readOnly")?(m(),v("span",Mv,[D(k(zi(vt("readOnly").effective))+" ",1),gi("readOnly")?(m(),v("span",Ev,[E(J,{name:"lock",size:10}),D(k(gi("readOnly")),1)])):R("",!0)])):(m(),et(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":f[39]||(f[39]=S=>jn.value=S),options:Oi},null,8,["modelValue"]))]),_:1}),r("div",Ov,[Dt.value?R("",!0):(m(),v("button",{key:0,class:"btn-accent",disabled:bn.value||!se.available,onClick:Rs},k(bn.value?"Saving…":St.value?"Save organization settings":"Save settings"),9,zv)),St.value?R("",!0):(m(),v("button",{key:1,class:"btn-ghost",disabled:mi.value||!se.available,onClick:Aa},k(mi.value?"Testing…":"Test folder"),9,Av)),ln.value?(m(),v("span",Iv,k(ln.value),1)):R("",!0),ut.value&&!St.value?(m(),v("span",$v,"Checked "+k($s()),1)):R("",!0),Oe.value&&!St.value?(m(),v("span",{key:4,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ve(Oe.value.status)])},[f[110]||(f[110]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Oe.value.detail||Oe.value.status),1)],2)):R("",!0)])])):R("",!0)])):G.id==="profile"?(m(),v("div",Dv,[E(xe,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:ye(()=>[r("div",Nv,[Ue(ze).avatar?(m(),v("img",{key:0,src:Ue(ze).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,Rv)):(m(),v("div",Fv,k(To.value),1)),r("div",Bv,[r("label",Vv,[E(J,{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:Po},null,32)]),Ue(ze).avatar?(m(),v("button",{key:0,class:"btn-ghost",onClick:Ia},"Remove")):R("",!0)])])]),_:1}),E(xe,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:ye(()=>[re(r("input",{"onUpdate:modelValue":f[40]||(f[40]=S=>Ue(ze).displayName=S),class:"field w-56",placeholder:"Jane O.",onBlur:f[41]||(f[41]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).displayName]])]),_:1}),E(xe,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:ye(()=>[re(r("textarea",{"onUpdate:modelValue":f[42]||(f[42]=S=>Ue(ze).bio=S),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[43]||(f[43]=S=>Je("Saved."))},null,544),[[ve,Ue(ze).bio]]),r("div",Uv,k((Ue(ze).bio||"").length)+"/240",1)]),_:1}),E(xe,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:ye(()=>[E(sn,{modelValue:Ue(ze).showEmail,"onUpdate:modelValue":f[44]||(f[44]=S=>Ue(ze).showEmail=S)},null,8,["modelValue"])]),_:1})])):G.id==="security"?(m(),v("div",Zv,[E(xe,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:ye(()=>[r("div",Hv,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ue(ze).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(Ue(ze).twoFactor?"Enabled":"Disabled"),1)],2),!Ue(ze).twoFactor&&!Kn.value?(m(),v("button",{key:0,class:"btn-accent",onClick:$i},"Enable 2FA")):Ue(ze).twoFactor?(m(),v("button",{key:1,class:"btn-ghost",onClick:$a},"Disable")):R("",!0)]),Kn.value?(m(),v("div",jv,[r("div",Wv,[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",Kv,[f[113]||(f[113]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",Gv,k(Co.value),1),r("div",qv,[re(r("input",{"onUpdate:modelValue":f[45]||(f[45]=S=>Ii.value=S),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:Lo},"Verify & enable")]),Ge.value?(m(),v("p",Yv,k(Ge.value),1)):R("",!0)])])])):R("",!0),Ue(ze).twoFactor&&os.value.length?(m(),v("div",Jv,[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",Xv,[(m(!0),v(le,null,Fe(os.value,S=>(m(),v("span",{key:S,class:"select-all"},k(S),1))),128))])])):R("",!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}),E(xe,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:ye(()=>[r("div",Qv,[r("div",e_,[r("div",t_,[E(J,{name:"monitor",size:18})]),r("div",n_,[r("div",i_,[D(k(Da())+" on "+k(Mo())+" ",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",s_,"Signed in "+k(Ue(Yl)(Ue(Na))),1)]),r("button",{class:"btn-ghost",onClick:f[46]||(f[46]=S=>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})])):G.id==="team"?(m(),v("div",o_,[Xe.id?(m(),v("div",a_,[E(xe,{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:ye(()=>[r("div",r_,[r("div",l_,[re(r("input",{"onUpdate:modelValue":f[47]||(f[47]=S=>Xe.email=S),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,Xe.email]]),re(r("select",{"onUpdate:modelValue":f[48]||(f[48]=S=>Xe.role=S),class:"field w-32",disabled:ls.value,title:ls.value?"You cannot change your own role":""},[(m(!0),v(le,null,Fe(Fs.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,c_))),128))],8,u_),[[Et,Xe.role]])]),u.value?re((m(),v("select",{key:0,"onUpdate:modelValue":f[49]||(f[49]=S=>Xe.organization=S),class:"field",title:"Organization"},[(m(!0),v(le,null,Fe(Eo.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,d_))),128))],512)),[[Et,Xe.organization]]):R("",!0),re(r("input",{"onUpdate:modelValue":f[50]||(f[50]=S=>Xe.password=S),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ve,Xe.password]]),r("label",f_,[E(sn,{modelValue:Xe.verified,"onUpdate:modelValue":f[51]||(f[51]=S=>Xe.verified=S)},null,8,["modelValue"]),f[121]||(f[121]=D(" Email verified ",-1))]),r("div",h_,[r("button",{class:"btn-accent",disabled:Fi.value,onClick:Ba},k(Fi.value?"Saving…":"Save changes"),9,p_),r("button",{class:"btn-ghost",onClick:In},"Cancel"),An.value?(m(),v("span",m_,k(An.value),1)):R("",!0),ls.value?(m(),v("span",g_,"Editing your own account — role locked.")):R("",!0)])])]),_:1},8,["title"])])):(m(),v("div",v_,[E(xe,{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:ye(()=>[r("div",__,[r("div",y_,[re(r("input",{"onUpdate:modelValue":f[52]||(f[52]=S=>ct.email=S),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ve,ct.email]]),re(r("select",{"onUpdate:modelValue":f[53]||(f[53]=S=>ct.role=S),class:"field w-32"},[(m(!0),v(le,null,Fe(Fs.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,b_))),128))],512),[[Et,ct.role]])]),u.value?re((m(),v("select",{key:0,"onUpdate:modelValue":f[54]||(f[54]=S=>ct.organization=S),class:"field",title:"Organization"},[(m(!0),v(le,null,Fe(Eo.value,S=>(m(),v("option",{key:S.value,value:S.value},k(S.label),9,x_))),128))],512)),[[Et,ct.organization]]):(m(),v("div",w_,[f[122]||(f[122]=D(" New users join your organization: ",-1)),r("span",k_,k(t.organizationName||"—"),1)])),re(r("input",{"onUpdate:modelValue":f[55]||(f[55]=S=>ct.password=S),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ve,ct.password]]),r("div",S_,[r("button",{class:"btn-accent",disabled:Di.value,onClick:Ra},k(Di.value?"Creating…":"Create user"),9,P_),yi.value?(m(),v("span",T_,k(yi.value),1)):R("",!0)])])]),_:1})])),r("div",C_,[r("div",L_,[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,M_)]),rs.value?(m(),v("div",E_,k(rs.value),1)):!as.value.length&&!Gn.value?(m(),v("div",O_,"No users yet.")):(m(),v("div",z_,[r("table",A_,[r("thead",null,[r("tr",I_,[(m(),v(le,null,Fe(["User","Role","Organization","Status",""],S=>r("th",{key:S,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(S),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(as.value,S=>(m(),v("tr",{key:S.id,class:Le(["border-b border-line last:border-0",Xe.id===S.id?"bg-accent-soft":""])},[r("td",$_,[r("span",D_,k(S.email),1),S.email===t.email?(m(),v("span",N_,"(you)")):R("",!0)]),r("td",R_,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(S.role||"user")])},[E(J,{name:_(S.role||"user"),size:12},null,8,["name"]),D(k(h(S.role||"user")),1)],2)]),r("td",F_,[r("span",{class:Le(["text-sm",S.organizationName?"text-ink-secondary":"text-ink-muted"])},k(S.organizationName||"—"),3)]),r("td",B_,[r("span",{class:Le(["text-xs",S.verified?"text-success-fg":"text-ink-muted"])},k(S.verified?"Verified":"Unverified"),3)]),r("td",V_,[Jt.value===S.id?(m(),v(le,{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]=Qe=>Jt.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=>Fa(S)}," Remove ",8,U_)],64)):(m(),v("div",Z_,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>us(S)},[E(J,{name:"settings",size:14}),f[125]||(f[125]=D(" Edit ",-1))],8,H_),S.email!==t.email?(m(),v("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Jt.value=S.id},[E(J,{name:"trash",size:14}),f[126]||(f[126]=D(" Remove ",-1))],8,j_)):R("",!0)]))])],2))),128))])])]))])])):G.id==="organizations"?(m(),v("div",W_,[kn.id?(m(),v("div",K_,[E(xe,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:ye(()=>[r("div",G_,[re(r("input",{"onUpdate:modelValue":f[57]||(f[57]=S=>kn.name=S),class:"field",placeholder:"Organization name",onKeyup:Vl(zo,["enter"])},null,544),[[ve,kn.name]]),r("div",q_,[r("button",{class:"btn-accent",onClick:zo},"Save changes"),r("button",{class:"btn-ghost",onClick:Bs},"Cancel"),Sn.value?(m(),v("span",Y_,k(Sn.value),1)):R("",!0)])])]),_:1})])):(m(),v("div",J_,[E(xe,{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:ye(()=>[r("div",X_,[re(r("input",{"onUpdate:modelValue":f[58]||(f[58]=S=>$n.name=S),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Vl(Oo,["enter"])},null,544),[[ve,$n.name]]),r("div",Q_,[r("button",{class:"btn-accent",disabled:Bi.value,onClick:Oo},k(Bi.value?"Creating…":"Create organization"),9,ey),Lt.value?(m(),v("span",ty,k(Lt.value),1)):R("",!0)])])]),_:1})])),r("div",ny,[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")]),Ni.value.length?(m(),v("div",sy,[r("table",oy,[r("thead",null,[r("tr",ay,[(m(),v(le,null,Fe(["Organization","Members",""],S=>r("th",{key:S,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},k(S),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(Ni.value,S=>(m(),v("tr",{key:S.id,class:Le(["border-b border-line last:border-0",kn.id===S.id?"bg-accent-soft":""])},[r("td",ry,[r("span",ly,[E(J,{name:"grid",size:14,class:"text-ink-muted"}),D(k(S.name),1)])]),r("td",uy,k(Vi.value[S.id]||0),1),r("td",cy,[bi.value===S.id?(m(),v(le,{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]=Qe=>bi.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(S)}," Delete ",8,dy)],64)):(m(),v("div",fy,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Qe=>Va(S)},[E(J,{name:"settings",size:14}),f[129]||(f[129]=D(" Rename ",-1))],8,hy),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Vi.value[S.id]||0)>0,title:(Vi.value[S.id]||0)>0?"Reassign or remove members first":"",onClick:Qe=>bi.value=S.id},[E(J,{name:"trash",size:14}),f[130]||(f[130]=D(" Delete ",-1))],8,py)]))])],2))),128))])])])):(m(),v("div",iy,"No organizations yet."))])])):G.id==="advanced"?(m(),v("div",my,[r("div",gy,[E(xe,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:ye(()=>[r("button",{class:"btn-ghost",onClick:xi},[E(J,{name:"download",size:15,class:"mr-1.5 inline"}),f[131]||(f[131]=D("Export",-1))])]),_:1}),E(xe,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:ye(()=>[r("label",vy,[E(J,{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:Pn},null,32)]),cs.value?(m(),v("p",_y,k(cs.value),1)):R("",!0)]),_:1})]),r("div",yy,[r("div",by,[E(J,{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",xy,[f[137]||(f[137]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",wy,[re(r("input",{"onUpdate:modelValue":f[60]||(f[60]=S=>pt.understand=S),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[aa,pt.understand]]),f[134]||(f[134]=D(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",ky,[r("label",Sy,[f[135]||(f[135]=D("Type ",-1)),r("span",Py,k(Vs.value),1),f[136]||(f[136]=D(" to confirm",-1))]),re(r("input",{"onUpdate:modelValue":f[61]||(f[61]=S=>pt.typed=S),class:"field w-full max-w-[360px] font-mono",placeholder:Vs.value},null,8,Ty),[[ve,pt.typed]])]),r("div",Cy,[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:ds},k(pt.cooldown>0?`Confirm in ${pt.cooldown}s…`:"Permanently delete account"),9,My)):(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:Ao}," Delete account… ",8,Ly)),pt.armed&&pt.cooldown>0?(m(),v("span",Ey,"Cooling-off period — read once more.")):R("",!0)]),pt.msg?(m(),v("p",Oy,k(pt.msg),1)):R("",!0)])])])):R("",!0)],64))),128))])]),E(eh,{name:"fade"},{default:ye(()=>[vi.value?(m(),v("div",zy,[E(J,{name:"check",size:16,class:"text-success-fg"}),D(k(vi.value),1)])):R("",!0)]),_:1})]))}},Iy=Jp(Ay,[["__scopeId","data-v-4fe25eb7"]]),$y={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Dy={class:"flex flex-wrap items-center gap-3"},Ny={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Ry=["onClick"],Fy={class:"ml-auto flex items-center gap-2"},By=["href"],Vy={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Uy={class:"eyebrow"},Zy={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Hy={key:0,class:"panel p-5"},jy={class:"mb-4 flex items-center justify-between"},Wy={class:"eyebrow"},Ky={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Gy={class:"block"},qy={class:"block"},Yy={class:"block"},Jy={class:"block"},Xy={key:0,value:""},Qy=["value"],e1={class:"block"},t1={class:"block"},n1={class:"block"},i1={class:"block"},s1={class:"block"},o1=["value"],a1={class:"block"},r1=["value"],l1={class:"block"},u1=["value"],c1={class:"block"},d1={class:"mt-3 block"},f1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},h1={class:"block"},p1={class:"block"},m1={class:"block"},g1={class:"block"},v1={class:"col-span-2 block max-[760px]:col-span-1"},_1={class:"mt-4 flex items-center gap-3"},y1=["disabled"],b1={key:0,class:"text-sm text-danger-fg"},x1={class:"panel overflow-hidden p-0"},w1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},k1={key:1,class:"grid place-items-center px-5 py-16 text-center"},S1={key:2,class:"overflow-x-auto"},P1={class:"w-full border-collapse text-sm"},T1={class:"text-left"},C1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},L1={key:0,class:"text-ink-muted"},M1={class:"px-5 py-3 text-ink-secondary"},E1=["title"],O1={class:"px-5 py-3 font-mono text-ink-secondary"},z1={class:"px-5 py-3 text-ink-secondary"},A1={class:"px-5 py-3"},I1=["onClick"],$1={class:"whitespace-nowrap px-5 py-3 text-right"},D1=["onClick"],N1=["onClick"],R1=["onClick"],F1={key:0,class:"border-b border-line bg-surface-2"},B1={colspan:"7",class:"px-5 py-3"},V1={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},U1={class:"text-ink-secondary"},Z1={class:"text-ink"},H1={class:"text-ink-secondary"},j1={class:"text-ink"},W1={class:"text-ink-secondary"},K1={class:"font-mono text-ink"},G1={key:0,class:"text-ink-secondary"},q1={class:"text-ink"},Y1={key:0,class:"mt-2 space-y-1"},J1={key:1,class:"mt-2 text-xs text-success-fg"},X1={key:0,class:"panel p-5"},Q1={class:"mb-4 flex items-center justify-between"},eb={class:"eyebrow"},tb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},nb={class:"block"},ib={class:"block"},sb={class:"block"},ob={class:"block"},ab={class:"block"},rb={class:"block"},lb=["value"],ub={class:"mt-3 flex flex-wrap gap-6"},cb={class:"flex items-center gap-2 text-sm text-ink-secondary"},db={class:"flex items-center gap-2 text-sm text-ink-secondary"},fb={class:"mt-4 flex items-center gap-3"},hb=["disabled"],pb={key:0,class:"text-sm text-danger-fg"},mb={class:"panel overflow-hidden p-0"},gb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},vb={key:1,class:"grid place-items-center px-5 py-16 text-center"},_b={key:2,class:"overflow-x-auto"},yb={class:"w-full border-collapse text-sm"},bb={class:"text-left"},xb={class:"px-5 py-3 font-semibold text-ink"},wb={class:"px-5 py-3 text-ink-secondary"},kb={class:"px-5 py-3 font-mono text-ink-secondary"},Sb={class:"px-5 py-3"},Pb={key:1,class:"text-ink-muted"},Tb={class:"px-5 py-3"},Cb={class:"whitespace-nowrap px-5 py-3 text-right"},Lb=["onClick"],Mb=["onClick"],Eb=["onClick"],Ob={__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[W,C]=await Promise.all([Sc(),rp()]);(!W.ok||!C.ok)&&(_.value=W.status===503||C.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=W.drones,d.value=C.flights,h.value=!1}Li(y);function T(W){const C=W.compliance||{};return C.exempt?{tone:"neutral",label:"Exempt"}:(C.redFlags||[]).length?{tone:"danger",label:`${C.redFlags.length} issue${C.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const w=K("");function z(W){w.value=w.value===W?"":W}const U=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],V=[{value:"commercial",label:"Commercial"},{value:"research",label:"Research"},{value:"public",label:"Public-benefit"},{value:"hobby",label:"Private hobby"},{value:"club_area",label:"Model-club area"}],ue=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function X(){var W;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((W=u.value[0])==null?void 0:W.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const Ae=K(!1),$e=K(""),Q=bt(X()),me=K(""),oe=K(!1),de=K(!1);function Ne(){Object.assign(Q,X()),$e.value="",me.value="",de.value=!1,Ae.value=!0}function nt(W){Object.assign(Q,{operationDate:(W.operationDate||"").slice(0,10),startTime:W.startTime||"",endTime:W.endTime||"",drone:W.drone||"",areaRoute:W.areaRoute||"",maxAltitudeAgl:W.maxAltitudeAgl||"",pilotName:W.pilotName||"",certificateRef:W.certificateRef||"",category:W.category||"open",purpose:W.purpose||"commercial",loggingPath:W.loggingPath||"",rawFdrLogUrl:W.rawFdrLogUrl||"",authorisationRef:W.authorisationRef||"",weather:W.weather||"",airspaceRef:W.airspaceRef||"",observer:W.observer||"",incidents:W.incidents||"",notes:W.notes||""}),$e.value=W.id,me.value="",de.value=!!(W.weather||W.airspaceRef||W.observer||W.incidents||W.notes),Ae.value=!0}function ke(){Ae.value=!1,$e.value=""}async function Te(){var O;if(me.value="",!Q.drone){me.value="Select a drone first (add one on the Drones tab).";return}oe.value=!0;const W={...Q,maxAltitudeAgl:Number(Q.maxAltitudeAgl)||0},C=$e.value?await up($e.value,W):await lp(W);if(oe.value=!1,!C.ok){me.value=((O=C.body)==null?void 0:O.error)||"Could not save the flight.";return}Ae.value=!1,await y()}const Be=K("");async function Ce(W){const C=await cp(W.id);Be.value="",C.ok&&await y()}const ee=["","C0","C1","C2","C3","C4","C5","C6"];function pe(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const Re=K(!1),Ze=K(""),he=bt(pe()),De=K(""),ne=K(!1);function rt(){Object.assign(he,pe()),Ze.value="",De.value="",Re.value=!0}function ge(W){Object.assign(he,{name:W.name||"",model:W.model||"",serial:W.serial||"",operatorNumber:W.operatorNumber||"",mtomGrams:W.mtomGrams||"",isToy:!!W.isToy,autologsFlights:!!W.autologsFlights,cClass:W.cClass||""}),Ze.value=W.id,De.value="",Re.value=!0}function Me(){Re.value=!1,Ze.value=""}async function je(){var O;if(De.value="",!he.name.trim()){De.value="Give the drone a name.";return}ne.value=!0;const W={...he,mtomGrams:Number(he.mtomGrams)||0},C=Ze.value?await op(Ze.value,W):await sp(W);if(ne.value=!1,!C.ok){De.value=((O=C.body)==null?void 0:O.error)||"Could not save the drone.";return}Re.value=!1,await y()}const te=K("");async function $(W){var O;const C=await ap(W.id);te.value="",C.ok?await y():De.value=((O=C.body)==null?void 0:O.error)||"Could not delete the drone."}const I=we(()=>{const W=d.value.length,C=d.value.filter(ht=>{var lt;return(((lt=ht.compliance)==null?void 0:lt.redFlags)||[]).length}).length,O=d.value.filter(ht=>{var lt;return(lt=ht.compliance)==null?void 0:lt.required}).length;return{total:W,flagged:C,required:O,fleet:u.value.length}});return(W,C)=>(m(),v("div",$y,[r("div",Dy,[r("div",Ny,[(m(),v(le,null,Fe([["flights","Flights"],["drones","Drones"]],O=>r("button",{key:O[0],class:Le(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===O[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:ht=>l.value=O[0]},k(O[1]),11,Ry)),64))]),r("div",Fy,[r("a",{href:Ue(dp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[E(J,{name:"download",size:15}),C[29]||(C[29]=D(" Export CSV ",-1))],8,By),l.value==="flights"?(m(),v("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Ne},[E(J,{name:"plus",size:15}),C[30]||(C[30]=D(" Log flight ",-1))])):(m(),v("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:rt},[E(J,{name:"plus",size:15}),C[31]||(C[31]=D(" Add drone ",-1))]))])]),r("div",Vy,[(m(!0),v(le,null,Fe([{label:"Flights logged",value:I.value.total,tone:"neutral"},{label:"Require logbook",value:I.value.required,tone:"neutral"},{label:"Compliance flags",value:I.value.flagged,tone:I.value.flagged?"danger":"success"},{label:"Registered drones",value:I.value.fleet,tone:"neutral"}],O=>(m(),v("div",{key:O.label,class:"panel p-5"},[r("div",Uy,k(O.label),1),r("div",{class:Le(["mt-2 text-[30px] font-bold leading-none tracking-tightest",O.tone==="danger"?"text-danger-fg":O.tone==="success"?"text-success-fg":"text-ink"])},k(O.value),3)]))),128))]),_.value?(m(),v("div",Zy,k(_.value),1)):R("",!0),l.value==="flights"?(m(),v(le,{key:1},[Ae.value?(m(),v("div",Hy,[r("div",jy,[r("div",null,[r("div",Wy,k($e.value?"Edit entry":"New entry"),1),C[32]||(C[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:ke},[E(J,{name:"x",size:16})])]),r("div",Ky,[r("label",Gy,[C[33]||(C[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),re(r("input",{"onUpdate:modelValue":C[0]||(C[0]=O=>Q.operationDate=O),type:"date",class:"field"},null,512),[[ve,Q.operationDate]])]),r("label",qy,[C[34]||(C[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),re(r("input",{"onUpdate:modelValue":C[1]||(C[1]=O=>Q.startTime=O),type:"time",class:"field"},null,512),[[ve,Q.startTime]])]),r("label",Yy,[C[35]||(C[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),re(r("input",{"onUpdate:modelValue":C[2]||(C[2]=O=>Q.endTime=O),type:"time",class:"field"},null,512),[[ve,Q.endTime]])]),r("label",Jy,[C[36]||(C[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),re(r("select",{"onUpdate:modelValue":C[3]||(C[3]=O=>Q.drone=O),class:"field"},[u.value.length?R("",!0):(m(),v("option",Xy,"— add a drone first —")),(m(!0),v(le,null,Fe(u.value,O=>(m(),v("option",{key:O.id,value:O.id},k(O.name)+k(O.model?` · ${O.model}`:""),9,Qy))),128))],512),[[Et,Q.drone]])]),r("label",e1,[C[37]||(C[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),re(r("input",{"onUpdate:modelValue":C[4]||(C[4]=O=>Q.maxAltitudeAgl=O),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ve,Q.maxAltitudeAgl]])]),r("label",t1,[C[38]||(C[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),re(r("input",{"onUpdate:modelValue":C[5]||(C[5]=O=>Q.areaRoute=O),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ve,Q.areaRoute]])]),r("label",n1,[C[39]||(C[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),re(r("input",{"onUpdate:modelValue":C[6]||(C[6]=O=>Q.pilotName=O),class:"field",placeholder:"Full name"},null,512),[[ve,Q.pilotName]])]),r("label",i1,[C[40]||(C[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),re(r("input",{"onUpdate:modelValue":C[7]||(C[7]=O=>Q.certificateRef=O),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ve,Q.certificateRef]])]),r("label",s1,[C[41]||(C[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),re(r("select",{"onUpdate:modelValue":C[8]||(C[8]=O=>Q.loggingPath=O),class:"field"},[(m(),v(le,null,Fe(ue,O=>r("option",{key:O.value,value:O.value},k(O.label),9,o1)),64))],512),[[Et,Q.loggingPath]])]),r("label",a1,[C[42]||(C[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),re(r("select",{"onUpdate:modelValue":C[9]||(C[9]=O=>Q.category=O),class:"field"},[(m(),v(le,null,Fe(U,O=>r("option",{key:O.value,value:O.value},k(O.label),9,r1)),64))],512),[[Et,Q.category]])]),r("label",l1,[C[43]||(C[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),re(r("select",{"onUpdate:modelValue":C[10]||(C[10]=O=>Q.purpose=O),class:"field"},[(m(),v(le,null,Fe(V,O=>r("option",{key:O.value,value:O.value},k(O.label),9,u1)),64))],512),[[Et,Q.purpose]])]),r("label",c1,[C[44]||(C[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),re(r("input",{"onUpdate:modelValue":C[11]||(C[11]=O=>Q.authorisationRef=O),class:"field",placeholder:"Specific-category ref"},null,512),[[ve,Q.authorisationRef]])])]),r("label",d1,[C[45]||(C[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),re(r("input",{"onUpdate:modelValue":C[12]||(C[12]=O=>Q.rawFdrLogUrl=O),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ve,Q.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:C[13]||(C[13]=O=>de.value=!de.value)},[E(J,{name:de.value?"x":"plus",size:14},null,8,["name"]),C[46]||(C[46]=D(" Operational details (weather, airspace, incidents) ",-1))]),de.value?(m(),v("div",f1,[r("label",h1,[C[47]||(C[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),re(r("input",{"onUpdate:modelValue":C[14]||(C[14]=O=>Q.weather=O),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ve,Q.weather]])]),r("label",p1,[C[48]||(C[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),re(r("input",{"onUpdate:modelValue":C[15]||(C[15]=O=>Q.airspaceRef=O),class:"field"},null,512),[[ve,Q.airspaceRef]])]),r("label",m1,[C[49]||(C[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),re(r("input",{"onUpdate:modelValue":C[16]||(C[16]=O=>Q.observer=O),class:"field"},null,512),[[ve,Q.observer]])]),r("label",g1,[C[50]||(C[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),re(r("input",{"onUpdate:modelValue":C[17]||(C[17]=O=>Q.incidents=O),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ve,Q.incidents]])]),r("label",v1,[C[51]||(C[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":C[18]||(C[18]=O=>Q.notes=O),rows:"2",class:"field"},null,512),[[ve,Q.notes]])])])):R("",!0),r("div",_1,[r("button",{class:"btn-accent",disabled:oe.value,onClick:Te},k(oe.value?"Saving…":$e.value?"Save changes":"Log flight"),9,y1),r("button",{class:"btn-ghost",onClick:ke},"Cancel"),me.value?(m(),v("span",b1,k(me.value),1)):R("",!0)])])):R("",!0),r("div",x1,[h.value?(m(),v("div",w1,"Loading…")):d.value.length?(m(),v("div",S1,[r("table",P1,[r("thead",null,[r("tr",T1,[(m(),v(le,null,Fe(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],O=>r("th",{key:O,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(O),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(d.value,O=>{var ht,lt,qt,b;return m(),v(le,{key:O.id},[r("tr",{class:Le(["border-b border-line last:border-0",$e.value===O.id?"bg-accent-soft":""])},[r("td",C1,[D(k((O.operationDate||"").slice(0,10))+" ",1),O.startTime?(m(),v("span",L1,k(O.startTime),1)):R("",!0)]),r("td",M1,k(O.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:O.areaRoute},k(O.areaRoute||"—"),9,E1),r("td",O1,k(O.maxAltitudeAgl?O.maxAltitudeAgl+" m":"—"),1),r("td",z1,k(O.pilotName||"—"),1),r("td",A1,[r("button",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[T(O).tone]]),onClick:g=>z(O.id)},[T(O).tone==="danger"?(m(),et(J,{key:0,name:"alertTriangle",size:12})):T(O).tone==="success"?(m(),et(J,{key:1,name:"check",size:12})):R("",!0),D(" "+k(T(O).label),1)],10,I1)]),r("td",$1,[Be.value===O.id?(m(),v(le,{key:0},[C[54]||(C[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:C[19]||(C[19]=g=>Be.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=>Ce(O)},"Delete",8,D1)],64)):(m(),v(le,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:g=>nt(O)},[E(J,{name:"sliders",size:13}),C[55]||(C[55]=D(" Edit",-1))],8,N1),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:g=>Be.value=O.id},[E(J,{name:"trash",size:13})],8,R1)],64))])],2),w.value===O.id?(m(),v("tr",F1,[r("td",B1,[r("div",V1,[r("span",U1,[C[56]||(C[56]=D("Logging path: ",-1)),r("b",Z1,k(((ht=O.compliance)==null?void 0:ht.loggingPath)||"—"),1)]),r("span",H1,[C[57]||(C[57]=D("Category: ",-1)),r("b",j1,k(O.category||"—"),1)]),r("span",W1,[C[58]||(C[58]=D("Retain until: ",-1)),r("b",K1,k((O.retentionUntil||"").slice(0,10)||"—"),1)]),(lt=O.compliance)!=null&<.exempt?(m(),v("span",G1,[C[59]||(C[59]=D("Exempt: ",-1)),r("b",q1,k(O.compliance.exemptReason),1)])):R("",!0)]),(((qt=O.compliance)==null?void 0:qt.redFlags)||[]).length?(m(),v("ul",Y1,[(m(!0),v(le,null,Fe(O.compliance.redFlags,(g,M)=>(m(),v("li",{key:M,class:"flex items-start gap-2 text-xs text-danger-fg"},[E(J,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(g),1)]))),128))])):(b=O.compliance)!=null&&b.exempt?R("",!0):(m(),v("div",J1,"No compliance gaps detected."))])])):R("",!0)],64)}),128))])])])):(m(),v("div",k1,[E(J,{name:"book",size:26,class:"text-ink-muted"}),C[52]||(C[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),C[53]||(C[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(le,{key:2},[Re.value?(m(),v("div",X1,[r("div",Q1,[r("div",null,[r("div",eb,k(Ze.value?"Edit drone":"New drone"),1),C[60]||(C[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:Me},[E(J,{name:"x",size:16})])]),r("div",tb,[r("label",nb,[C[61]||(C[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),re(r("input",{"onUpdate:modelValue":C[20]||(C[20]=O=>he.name=O),class:"field",placeholder:"Mavic-01"},null,512),[[ve,he.name]])]),r("label",ib,[C[62]||(C[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),re(r("input",{"onUpdate:modelValue":C[21]||(C[21]=O=>he.model=O),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ve,he.model]])]),r("label",sb,[C[63]||(C[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),re(r("input",{"onUpdate:modelValue":C[22]||(C[22]=O=>he.serial=O),class:"field"},null,512),[[ve,he.serial]])]),r("label",ob,[C[64]||(C[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),re(r("input",{"onUpdate:modelValue":C[23]||(C[23]=O=>he.operatorNumber=O),class:"field",placeholder:"DNK…"},null,512),[[ve,he.operatorNumber]])]),r("label",ab,[C[65]||(C[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),re(r("input",{"onUpdate:modelValue":C[24]||(C[24]=O=>he.mtomGrams=O),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ve,he.mtomGrams]])]),r("label",rb,[C[66]||(C[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),re(r("select",{"onUpdate:modelValue":C[25]||(C[25]=O=>he.cClass=O),class:"field"},[(m(),v(le,null,Fe(ee,O=>r("option",{key:O,value:O},k(O||"— none —"),9,lb)),64))],512),[[Et,he.cClass]])])]),r("div",ub,[r("label",cb,[re(r("input",{"onUpdate:modelValue":C[26]||(C[26]=O=>he.autologsFlights=O),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[aa,he.autologsFlights]]),C[67]||(C[67]=D(" Auto-logs flights (onboard FDR) ",-1))]),r("label",db,[re(r("input",{"onUpdate:modelValue":C[27]||(C[27]=O=>he.isToy=O),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[aa,he.isToy]]),C[68]||(C[68]=D(" Toy drone (logbook-exempt) ",-1))])]),r("div",fb,[r("button",{class:"btn-accent",disabled:ne.value,onClick:je},k(ne.value?"Saving…":Ze.value?"Save changes":"Add drone"),9,hb),r("button",{class:"btn-ghost",onClick:Me},"Cancel"),De.value?(m(),v("span",pb,k(De.value),1)):R("",!0)])])):R("",!0),r("div",mb,[h.value?(m(),v("div",gb,"Loading…")):u.value.length?(m(),v("div",_b,[r("table",yb,[r("thead",null,[r("tr",bb,[(m(),v(le,null,Fe(["Name","Model","MTOM","Class","FDR",""],O=>r("th",{key:O,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(O),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(u.value,O=>(m(),v("tr",{key:O.id,class:Le(["border-b border-line last:border-0",Ze.value===O.id?"bg-accent-soft":""])},[r("td",xb,k(O.name),1),r("td",wb,k(O.model||"—"),1),r("td",kb,k(O.mtomGrams?O.mtomGrams+" g":"—"),1),r("td",Sb,[O.cClass?(m(),v("span",{key:0,class:Le(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},k(O.cClass),3)):(m(),v("span",Pb,"—")),O.isToy?(m(),v("span",{key:2,class:Le(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):R("",!0)]),r("td",Tb,[r("span",{class:Le(["text-xs",O.autologsFlights?"text-success-fg":"text-ink-muted"])},k(O.autologsFlights?"yes":"no"),3)]),r("td",Cb,[te.value===O.id?(m(),v(le,{key:0},[C[71]||(C[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:C[28]||(C[28]=ht=>te.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:ht=>$(O)},"Delete",8,Lb)],64)):(m(),v(le,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:ht=>ge(O)},[E(J,{name:"sliders",size:13}),C[72]||(C[72]=D(" Edit",-1))],8,Mb),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:ht=>te.value=O.id},[E(J,{name:"trash",size:13})],8,Eb)],64))])],2))),128))])])])):(m(),v("div",vb,[E(J,{name:"drone",size:26,class:"text-ink-muted"}),C[69]||(C[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),C[70]||(C[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},zb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Ab={class:"flex flex-wrap items-center gap-3"},Ib={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},$b=["onClick"],Db={class:"ml-auto"},Nb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Rb={class:"eyebrow"},Fb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Bb={key:1,class:"panel p-5"},Vb={class:"mb-4 flex items-center justify-between"},Ub={class:"eyebrow"},Zb={class:"mt-0.5 text-base font-semibold text-ink"},Hb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},jb={class:"col-span-2 block max-[760px]:col-span-1"},Wb={class:"block"},Kb=["value"],Gb={class:"block"},qb=["value"],Yb={class:"block"},Jb=["value"],Xb={class:"block"},Qb={class:"block"},ex={class:"block"},tx={class:"block"},nx=["value"],ix={class:"block"},sx={class:"block"},ox={class:"block"},ax=["value"],rx={class:"mt-3 block"},lx={key:0,class:"mt-3"},ux={class:"eyebrow mb-1 block"},cx={key:1,class:"mt-3 text-xs text-ink-muted"},dx={class:"mt-4 flex items-center gap-3"},fx=["disabled"],hx={key:0,class:"text-sm text-danger-fg"},px={class:"panel overflow-hidden p-0"},mx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},gx={key:1,class:"grid place-items-center px-5 py-16 text-center"},vx={class:"mt-3 text-sm font-medium text-ink-secondary"},_x={class:"mt-1 text-xs text-ink-muted"},yx={key:2,class:"overflow-x-auto"},bx={class:"w-full border-collapse text-sm"},xx={class:"text-left"},wx={class:"px-5 py-3"},kx={class:"font-semibold text-ink"},Sx={key:0,class:"font-mono text-[11px] text-ink-muted"},Px={class:"px-5 py-3 text-ink-secondary"},Tx={class:"px-5 py-3 text-ink-secondary"},Cx={class:"px-5 py-3"},Lx=["onClick"],Mx={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},Ex={class:"px-5 py-3 font-mono text-ink-secondary"},Ox={class:"whitespace-nowrap px-5 py-3 text-right"},zx=["onClick"],Ax=["href"],Ix=["onClick"],$x=["onClick"],Dx=["onClick"],Nx={key:0,class:"border-b border-line bg-surface-2"},Rx={colspan:"6",class:"px-5 py-3"},Fx={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},Bx={class:"text-ink-secondary"},Vx={class:"text-ink"},Ux={class:"text-ink-secondary"},Zx={class:"text-ink"},Hx={key:0,class:"text-ink-secondary"},jx={class:"text-ink"},Wx={key:1,class:"text-ink-secondary"},Kx={class:"font-mono text-ink"},Gx={key:2,class:"text-ink-secondary"},qx={class:"font-mono text-ink"},Yx={class:"text-ink-secondary"},Jx={class:"text-ink"},Xx={key:0,class:"mt-2 space-y-1"},Qx={key:1,class:"mt-2 text-xs text-success-fg"},e0={key:2,class:"mt-2 text-xs text-ink-secondary"},t0={__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(te=>[te.value,te.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([]),T=K(!1),w=K("");async function z(){T.value=!0,w.value="";const[te,$]=await Promise.all([fp(),Sc()]);te.ok||(w.value=te.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=te.documents,y.value=$.drones||[],T.value=!1}Li(z);const U=K("all"),V=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],ue=we(()=>{const te=_.value;switch(U.value){case"expiring":return te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expiring_soon"&&$.status!=="archived"});case"expired":return te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expired"&&$.status!=="archived"});case"pending":return te.filter($=>$.status==="pending_review");case"archived":return te.filter($=>$.status==="archived");default:return te.filter($=>$.status!=="archived")}});function X(te){if(te.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const $=te.expiry||{};return $.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:$.state==="expiring_soon"?{tone:"warning",label:`Expires in ${$.daysUntilExpiry}d`,icon:"clock"}:$.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const Ae=K("");function $e(te){Ae.value=Ae.value===te?"":te}function Q(te){return te.ownerDrone?te.ownerDroneName||"Aircraft":te.ownerRef?te.ownerRef:te.ownerType==="pilot"?"Pilot":te.ownerType?te.ownerType.charAt(0).toUpperCase()+te.ownerType.slice(1):"—"}function me(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const oe=K(!1),de=K(""),Ne=K(""),nt=K(""),ke=bt(me()),Te=K(null),Be=K(null),Ce=K(""),ee=K(!1);function pe(){Te.value=null,Be.value&&(Be.value.value="")}function Re(){Object.assign(ke,me()),de.value="",Ne.value="",nt.value="",pe(),Ce.value="",oe.value=!0}function Ze(te){Object.assign(ke,{title:te.title||"",docType:te.docType||"certificate",ownerType:te.ownerType||"pilot",ownerDrone:te.ownerDrone||"",ownerRef:te.ownerRef||"",reference:te.reference||"",jurisdiction:te.jurisdiction||"",issueDate:te.issueDate||"",expiryDate:te.expiryDate||"",status:te.status||"active",accessTier:te.accessTier||"ops",notes:te.notes||""}),de.value=te.id,Ne.value="",nt.value="",pe(),Ce.value="",oe.value=!0}function he(te){Ze(te),de.value="",Ne.value=te.id,nt.value=te.title,ke.status="active"}function De(){oe.value=!1,de.value="",Ne.value=""}function ne(te){var $;Te.value=(($=te.target.files)==null?void 0:$[0])||null}async function rt(){var $;if(Ce.value="",!ke.title.trim()){Ce.value="Give the document a title.";return}ee.value=!0;let te;if(de.value)te=await pp(de.value,{...ke});else{const I={...ke};Ne.value&&(I.replaces=Ne.value),te=await hp(I,Te.value)}if(ee.value=!1,!te.ok){Ce.value=(($=te.body)==null?void 0:$.error)||"Could not save the document.";return}oe.value=!1,de.value="",Ne.value="",await z()}const ge=K("");async function Me(te){var I;const $=await mp(te.id);ge.value="",$.ok?await z():Ce.value=((I=$.body)==null?void 0:I.error)||"Could not delete the document."}const je=we(()=>{const te=_.value.filter($=>$.status!=="archived");return{total:te.length,expiring:te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expiring_soon"}).length,expired:te.filter($=>{var I;return((I=$.expiry)==null?void 0:I.state)==="expired"}).length,pending:_.value.filter($=>$.status==="pending_review").length}});return(te,$)=>(m(),v("div",zb,[r("div",Ab,[r("div",Ib,[(m(),v(le,null,Fe(V,I=>r("button",{key:I[0],class:Le(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",U.value===I[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:W=>U.value=I[0]},k(I[1]),11,$b)),64))]),r("div",Db,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:Re},[E(J,{name:"upload",size:15}),$[13]||($[13]=D(" Add document ",-1))])])]),r("div",Nb,[(m(!0),v(le,null,Fe([{label:"Documents on file",value:je.value.total,tone:"neutral"},{label:"Expiring soon",value:je.value.expiring,tone:je.value.expiring?"warning":"neutral"},{label:"Expired",value:je.value.expired,tone:je.value.expired?"danger":"success"},{label:"Pending review",value:je.value.pending,tone:je.value.pending?"accent":"neutral"}],I=>(m(),v("div",{key:I.label,class:"panel p-5"},[r("div",Rb,k(I.label),1),r("div",{class:Le(["mt-2 text-[30px] font-bold leading-none tracking-tightest",I.tone==="danger"?"text-danger-fg":I.tone==="warning"?"text-amber-fg":I.tone==="success"?"text-success-fg":I.tone==="accent"?"text-accent-soft-fg":"text-ink"])},k(I.value),3)]))),128))]),w.value?(m(),v("div",Fb,k(w.value),1)):R("",!0),oe.value?(m(),v("div",Bb,[r("div",Vb,[r("div",null,[r("div",Ub,k(de.value?"Edit document":Ne.value?"New version":"New document"),1),r("div",Zb,k(Ne.value?`Supersedes “${nt.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:De},[E(J,{name:"x",size:16})])]),r("div",Hb,[r("label",jb,[$[14]||($[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),re(r("input",{"onUpdate:modelValue":$[0]||($[0]=I=>ke.title=I),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ve,ke.title]])]),r("label",Wb,[$[15]||($[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),re(r("select",{"onUpdate:modelValue":$[1]||($[1]=I=>ke.docType=I),class:"field"},[(m(),v(le,null,Fe(o,I=>r("option",{key:I.value,value:I.value},k(I.label),9,Kb)),64))],512),[[Et,ke.docType]])]),r("label",Gb,[$[16]||($[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),re(r("select",{"onUpdate:modelValue":$[2]||($[2]=I=>ke.ownerType=I),class:"field"},[(m(),v(le,null,Fe(u,I=>r("option",{key:I.value,value:I.value},k(I.label),9,qb)),64))],512),[[Et,ke.ownerType]])]),r("label",Yb,[$[18]||($[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),re(r("select",{"onUpdate:modelValue":$[3]||($[3]=I=>ke.ownerDrone=I),class:"field"},[$[17]||($[17]=r("option",{value:""},"— none —",-1)),(m(!0),v(le,null,Fe(y.value,I=>(m(),v("option",{key:I.id,value:I.id},k(I.name)+k(I.model?` · ${I.model}`:""),9,Jb))),128))],512),[[Et,ke.ownerDrone]])]),r("label",Xb,[$[19]||($[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),re(r("input",{"onUpdate:modelValue":$[4]||($[4]=I=>ke.ownerRef=I),class:"field",placeholder:"Client name / serial / site"},null,512),[[ve,ke.ownerRef]])]),r("label",Qb,[$[20]||($[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),re(r("input",{"onUpdate:modelValue":$[5]||($[5]=I=>ke.reference=I),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ve,ke.reference]])]),r("label",ex,[$[21]||($[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),re(r("input",{"onUpdate:modelValue":$[6]||($[6]=I=>ke.jurisdiction=I),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ve,ke.jurisdiction]])]),r("label",tx,[$[22]||($[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),re(r("select",{"onUpdate:modelValue":$[7]||($[7]=I=>ke.accessTier=I),class:"field"},[(m(),v(le,null,Fe(h,I=>r("option",{key:I.value,value:I.value},k(I.label),9,nx)),64))],512),[[Et,ke.accessTier]])]),r("label",ix,[$[23]||($[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),re(r("input",{"onUpdate:modelValue":$[8]||($[8]=I=>ke.issueDate=I),type:"date",class:"field"},null,512),[[ve,ke.issueDate]])]),r("label",sx,[$[24]||($[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),re(r("input",{"onUpdate:modelValue":$[9]||($[9]=I=>ke.expiryDate=I),type:"date",class:"field"},null,512),[[ve,ke.expiryDate]])]),r("label",ox,[$[25]||($[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),re(r("select",{"onUpdate:modelValue":$[10]||($[10]=I=>ke.status=I),class:"field"},[(m(),v(le,null,Fe(d,I=>r("option",{key:I.value,value:I.value},k(I.label),9,ax)),64))],512),[[Et,ke.status]])])]),r("label",rx,[$[26]||($[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),re(r("textarea",{"onUpdate:modelValue":$[11]||($[11]=I=>ke.notes=I),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ve,ke.notes]])]),de.value?(m(),v("div",cx,[...$[28]||($[28]=[D(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),D(" on the document — the old version is kept for audit. ",-1)])])):(m(),v("div",lx,[r("span",ux,"File "+k(Ne.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:Be,type:"file",class:"field",onChange:ne},null,544),$[27]||($[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",dx,[r("button",{class:"btn-accent",disabled:ee.value,onClick:rt},k(ee.value?"Saving…":de.value?"Save changes":Ne.value?"Upload new version":"Add document"),9,fx),r("button",{class:"btn-ghost",onClick:De},"Cancel"),Ce.value?(m(),v("span",hx,k(Ce.value),1)):R("",!0)])])):R("",!0),r("div",px,[T.value?(m(),v("div",mx,"Loading…")):ue.value.length?(m(),v("div",yx,[r("table",bx,[r("thead",null,[r("tr",xx,[(m(),v(le,null,Fe(["Title","Type","Owner","Expiry","Ver",""],I=>r("th",{key:I,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(I),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(ue.value,I=>{var W,C;return m(),v(le,{key:I.id},[r("tr",{class:Le(["border-b border-line last:border-0",de.value===I.id?"bg-accent-soft":""])},[r("td",wx,[r("div",kx,k(I.title),1),I.reference?(m(),v("div",Sx,k(I.reference),1)):R("",!0)]),r("td",Px,k(Ue(l)[I.docType]||I.docType||"—"),1),r("td",Tx,k(Q(I)),1),r("td",Cx,[r("button",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[X(I).tone]]),onClick:O=>$e(I.id)},[X(I).icon?(m(),et(J,{key:0,name:X(I).icon,size:12},null,8,["name"])):R("",!0),D(" "+k(X(I).label),1)],10,Lx),I.expiryDate?(m(),v("div",Mx,k(I.expiryDate),1)):R("",!0)]),r("td",Ex,"v"+k(I.version||1),1),r("td",Ox,[ge.value===I.id?(m(),v(le,{key:0},[$[29]||($[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:$[12]||($[12]=O=>ge.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:O=>Me(I)},"Delete",8,zx)],64)):(m(),v(le,{key:1},[I.hasFile?(m(),v("a",{key:0,href:Ue(gp)(I.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[E(J,{name:"download",size:13})],8,Ax)):R("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:O=>he(I)},[E(J,{name:"upload",size:13})],8,Ix),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:O=>Ze(I)},[E(J,{name:"sliders",size:13}),$[30]||($[30]=D(" Edit",-1))],8,$x),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:O=>ge.value=I.id},[E(J,{name:"trash",size:13})],8,Dx)],64))])],2),Ae.value===I.id?(m(),v("tr",Nx,[r("td",Rx,[r("div",Fx,[r("span",Bx,[$[31]||($[31]=D("Status: ",-1)),r("b",Vx,k(I.status||"—"),1)]),r("span",Ux,[$[32]||($[32]=D("Access: ",-1)),r("b",Zx,k(I.accessTier||"—"),1)]),I.jurisdiction?(m(),v("span",Hx,[$[33]||($[33]=D("Jurisdiction: ",-1)),r("b",jx,k(I.jurisdiction),1)])):R("",!0),I.issueDate?(m(),v("span",Wx,[$[34]||($[34]=D("Issued: ",-1)),r("b",Kx,k(I.issueDate),1)])):R("",!0),I.expiryDate?(m(),v("span",Gx,[$[35]||($[35]=D("Expires: ",-1)),r("b",qx,k(I.expiryDate),1)])):R("",!0),r("span",Yx,[$[36]||($[36]=D("File: ",-1)),r("b",Jx,k(I.hasFile?I.fileName:"none"),1)])]),(((W=I.expiry)==null?void 0:W.flags)||[]).length?(m(),v("ul",Xx,[(m(!0),v(le,null,Fe(I.expiry.flags,(O,ht)=>(m(),v("li",{key:ht,class:Le(["flex items-start gap-2 text-xs",I.expiry.state==="expired"?"text-danger-fg":I.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[E(J,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),D(" "+k(O),1)],2))),128))])):((C=I.expiry)==null?void 0:C.state)==="valid"?(m(),v("div",Qx,"In force — no action needed.")):R("",!0),I.notes?(m(),v("div",e0,[$[37]||($[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),D(" "+k(I.notes),1)])):R("",!0)])])):R("",!0)],64)}),128))])])])):(m(),v("div",gx,[E(J,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",vx,k(U.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",_x,k(U.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))])]))}},n0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},i0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},s0={class:"flex items-center gap-2.5 px-2 pb-5"},o0={class:"flex flex-col gap-0.5"},a0=["onClick"],r0={class:"mt-auto flex flex-col gap-2.5"},l0={class:"rounded-lg bg-surface-2 p-3"},u0={class:"flex items-center gap-2"},c0={class:"text-xs font-semibold text-ink"},d0={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},f0={class:"flex items-center gap-2.5 px-2 py-1"},h0={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},p0={class:"min-w-0 flex-1"},m0={class:"truncate text-[13px] font-semibold text-ink"},g0={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},v0=["title"],_0={class:"overflow-y-auto"},y0={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)"}},b0={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},x0={class:"ml-auto flex items-center gap-3"},w0={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},k0={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},S0={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},P0={class:"flex items-center justify-between"},T0={class:"eyebrow"},C0={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},L0={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},M0={class:"panel p-5"},E0={class:"mb-3.5 flex items-center justify-between"},O0={class:"panel p-5"},z0={class:"mb-3.5 flex items-center justify-between"},A0={class:"grid place-items-center py-10 text-center"},I0={class:"panel overflow-hidden p-0"},$0={class:"flex items-center justify-between px-5 py-4"},D0={class:"flex gap-2"},N0={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},R0={key:1,class:"overflow-x-auto"},F0={class:"w-full border-collapse text-sm"},B0={class:"text-left"},V0=["onClick"],U0={class:"px-5 py-3 font-mono font-bold text-ink"},Z0={class:"px-5 py-3 text-ink-secondary"},H0={class:"px-5 py-3"},j0={class:"px-5 py-3 font-mono text-ink-secondary"},W0={class:"px-5 py-3"},K0={key:0,class:"flex items-center gap-2"},G0={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},q0={class:"font-mono text-xs text-ink-secondary"},Y0={key:1,class:"font-mono text-xs text-ink-muted"},J0={class:"px-5 py-3 font-mono text-ink-secondary"},X0={class:"px-5 py-3 text-right"},Q0=["onClick"],ew={key:1,class:"p-7"},tw={class:"mb-4 flex flex-wrap items-center gap-3"},nw={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"},sw={key:1,class:"ml-auto flex flex-wrap gap-1.5"},ow=["onClick"],aw={key:0,class:"panel grid place-items-center p-16 text-center"},rw={class:"pill"},lw={class:"pill"},uw={class:"pill"},cw={class:"mt-1 text-sm font-semibold text-ink"},dw={class:"pill"},fw={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},hw={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},pw={class:"panel p-4"},mw={class:"flex items-center gap-4"},gw={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},vw={class:"readout"},_w={class:"panel p-4"},yw={class:"readout"},bw={class:"panel p-4"},xw={class:"space-y-1.5 text-sm"},ww={class:"flex justify-between"},kw={class:"text-ink"},Sw={class:"flex justify-between"},Pw={class:"text-ink"},Tw={class:"flex justify-between"},Cw={class:"font-mono tabular text-ink"},Lw={class:"flex justify-between"},Mw={class:"font-mono tabular text-ink"},Ew={class:"panel p-4"},Ow={class:"space-y-1.5 text-sm"},zw={class:"flex justify-between"},Aw={class:"font-mono tabular text-ink"},Iw={class:"flex justify-between"},$w={class:"font-mono tabular text-ink"},Dw={class:"flex justify-between"},Nw={class:"font-mono tabular text-ink"},Rw={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},Fw={class:"panel p-4"},Bw={class:"flex flex-wrap gap-2"},Vw={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},Uw={class:"panel p-4"},Zw={class:"h-[180px] overflow-y-auto font-mono text-xs"},Hw={class:"text-ink-muted"},jw={class:"font-semibold text-accent"},Ww={class:"break-all text-ink"},Kw={key:5,class:"p-7"},Gw={class:"panel grid place-items-center p-16 text-center"},qw={class:"mt-3 text-sm font-medium text-ink-secondary"},Yw={key:0,class:"mt-1 text-xs text-ink-muted"},Jw={key:1,class:"mt-1 text-xs text-ink-muted"},Xw={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const o=t,l=i,u=bt({}),d=bt({}),h=K(null),_=K(!1),y=bt([]),T=K(""),w=K("Overview"),z=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],U=we(()=>(z.find(([,b])=>b===w.value)||["grid"])[0]),V=K(""),ue=K(""),X=K("");let Ae=null,$e=null,Q=!1;const me=we(()=>Object.keys(u).sort((b,g)=>(u[g].online?1:0)-(u[b].online?1:0)||b.localeCompare(g))),oe=we(()=>h.value?u[h.value]:null),de=we(()=>oe.value&&oe.value.telemetry||{}),Ne=we(()=>!!(oe.value&&oe.value.online)),nt=we(()=>{const b=de.value;return typeof b.latitude=="number"&&typeof b.longitude=="number"&&(b.latitude||b.longitude)?{lat:b.latitude,lng:b.longitude}:null}),ke=we(()=>h.value&&d[h.value]||[]),Te=we(()=>{const b=de.value;return typeof b.velocityX=="number"&&typeof b.velocityY=="number"?Math.hypot(b.velocityX,b.velocityY):null});function Be(b){return b.online?b.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Ce(b){const g=b&&b.telemetry||{};return typeof g.velocityX=="number"&&typeof g.velocityY=="number"?Math.hypot(g.velocityX,g.velocityY):null}const ee=we(()=>me.value.map(b=>{const g=u[b],M=g.telemetry||{},[Z,B]=Be(g);return{id:b,mission:g.model||(g.connected?"Drone linked":g.online?"App online":"No signal"),status:Z,tone:B,alt:typeof M.altitude=="number"?M.altitude.toFixed(0)+" m":"—",battery:typeof M.batteryPercent=="number"?M.batteryPercent:null,speed:Ce(g)}})),pe=we(()=>me.value.filter(b=>u[b].online).length),Re=we(()=>me.value.filter(b=>u[b].online&&u[b].connected).length),Ze=we(()=>me.value.filter(b=>!u[b].online).length),he=we(()=>{const b=me.value.map(g=>{var M;return(M=u[g].telemetry)==null?void 0:M.batteryPercent}).filter(g=>typeof g=="number");return b.length?Math.round(b.reduce((g,M)=>g+M,0)/b.length):null}),De=we(()=>[{label:"Active flights",value:String(Re.value),delta:`${pe.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:he.value==null?"—":he.value+"%",delta:he.value==null?"no telemetry":he.value<40?"low — watch":"nominal",tone:he.value!=null&&he.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(me.value.length),delta:`${Re.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"}]),ne={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"},rt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},ge=we(()=>{var M,Z,B;const g=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((M=g[0])==null?void 0:M[0])||"P")+(((Z=g[1])==null?void 0:Z[0])||((B=g[0])==null?void 0:B[1])||"V")).toUpperCase()}),Me={superadmin:"Superadmin",admin:"Admin",user:"Operator"},je=we(()=>Me[o.role]||"Operator"),te=we(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function $(b){var M;u[b.deviceId]=b;const g=b.telemetry||{};typeof g.latitude=="number"&&typeof g.longitude=="number"&&(g.latitude||g.longitude)&&(d[b.deviceId]||(d[b.deviceId]=[]),d[b.deviceId].push([g.latitude,g.longitude]),d[b.deviceId].length>1e3&&d[b.deviceId].shift()),(!h.value||b.online&&!((M=u[h.value])!=null&&M.online))&&(h.value=b.deviceId)}function I(b){delete u[b],delete d[b],h.value===b&&(h.value=me.value[0]||null)}function W(b){y.unshift({t:ql(Date.now()),tag:b.type||"?",text:JSON.stringify(C(b))}),y.length>200&&y.pop()}function C(b){const g={...b};return delete g.type,g}function O(){const b=location.protocol==="https:"?"wss":"ws";Ae=new WebSocket(`${b}://${location.host}/bff/ws`),Ae.onopen=()=>_.value=!0,Ae.onclose=()=>{_.value=!1,Q||($e=setTimeout(O,1500))},Ae.onerror=()=>Ae&&Ae.close(),Ae.onmessage=g=>{let M;try{M=JSON.parse(g.data)}catch{return}M.type==="snapshot"?(M.devices||[]).forEach($):M.type==="update"&&M.device?($(M.device),M.event&&M.device.deviceId===h.value&&W(M.event)):M.type==="removed"&&M.deviceId&&I(M.deviceId)}}async function ht(){if(!h.value)return X.value="No device selected.";if(!V.value.trim())return X.value="Enter a command name.";let b;if(ue.value.trim())try{b=JSON.parse(ue.value)}catch{return X.value="Payload is not valid JSON."}const{ok:g,body:M}=await vp(h.value,V.value.trim(),b);X.value=g?`Sent "${V.value.trim()}".`:`Error: ${M.error||"failed"}`}function lt(b,g,M=""){return typeof b=="number"?b.toFixed(g)+M:"—"}function qt(b){h.value=b,w.value="Live flights"}return Li(async()=>{(await Fh()).forEach($),O()}),_a(()=>{Q=!0,$e&&clearTimeout($e),Ae&&Ae.close()}),(b,g)=>{var M,Z,B,H,ie;return m(),v("div",n0,[r("aside",i0,[r("div",s0,[E(Mc,{size:26}),g[7]||(g[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",o0,[(m(),v(le,null,Fe(z,([F,Y])=>r("button",{key:Y,class:Le(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",w.value===Y?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:j=>w.value=Y},[E(J,{name:F,size:18,stroke:w.value===Y?2.2:1.8},null,8,["name","stroke"]),D(" "+k(Y),1)],10,a0)),64))]),r("div",r0,[r("div",l0,[r("div",u0,[r("span",{class:Le(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),r("span",c0,k(_.value?"Link healthy":"Reconnecting…"),1)]),r("span",d0,"API gateway · "+k(_.value?"streaming":"retrying"),1)]),r("div",f0,[r("div",h0,k(ge.value),1),r("div",p0,[r("div",m0,k(t.email||"Operator"),1),r("div",g0,[E(J,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${je.value} · ${te.value}`},k(je.value)+" · "+k(te.value),9,v0)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:g[0]||(g[0]=F=>l("logout"))},[E(J,{name:"logout",size:16})])])])]),r("main",_0,[r("header",y0,[r("div",null,[g[8]||(g[8]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",b0,k(w.value),1)]),r("div",x0,[r("div",w0,[E(J,{name:"search",size:16,class:"text-ink-muted"}),re(r("input",{"onUpdate:modelValue":g[1]||(g[1]=F=>T.value=F),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ve,T.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:g[2]||(g[2]=F=>w.value="Live flights")},[E(J,{name:"radio",size:16}),g[9]||(g[9]=D(" Live flights ",-1))])])]),w.value==="Overview"?(m(),v("div",k0,[r("div",S0,[(m(!0),v(le,null,Fe(De.value,F=>(m(),v("div",{key:F.label,class:"panel p-5"},[r("div",P0,[r("span",T0,k(F.label),1),E(J,{name:F.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",C0,k(F.value),1),r("span",{class:Le(["mt-2 block font-mono text-[11px]",rt[F.tone]])},k(F.delta),3)]))),128))]),r("div",L0,[r("div",M0,[r("div",E0,[g[11]||(g[11]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),Re.value?(m(),v("span",{key:0,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.success])},[g[10]||(g[10]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Re.value)+" airborne ",1)],2)):R("",!0)]),E(Ql,{position:nt.value,trail:ke.value},null,8,["position","trail"])]),r("div",O0,[r("div",z0,[g[12]||(g[12]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),E(J,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",A0,[E(J,{name:"calendar",size:24,class:"text-ink-muted"}),g[13]||(g[13]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),g[14]||(g[14]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",I0,[r("div",$0,[g[17]||(g[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",D0,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.success])},[g[15]||(g[15]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Re.value)+" in flight ",1)],2),Ze.value?(m(),v("span",{key:0,class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne.warning])},[g[16]||(g[16]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(Ze.value)+" offline ",1)],2)):R("",!0)])]),ee.value.length?(m(),v("div",R0,[r("table",F0,[r("thead",null,[r("tr",B0,[(m(),v(le,null,Fe(["Aircraft","Mission","Status","Alt","Battery","Speed",""],F=>r("th",{key:F,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(F),1)),64))])]),r("tbody",null,[(m(!0),v(le,null,Fe(ee.value,(F,Y)=>(m(),v("tr",{key:F.id,class:Le(["cursor-pointer transition hover:bg-surface-2",Y<ee.value.length-1?"border-b border-line":""]),onClick:j=>qt(F.id)},[r("td",U0,k(F.id),1),r("td",Z0,k(F.mission),1),r("td",H0,[r("span",{class:Le(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ne[F.tone]])},[g[18]||(g[18]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),D(k(F.status),1)],2)]),r("td",j0,k(F.alt),1),r("td",W0,[F.battery!=null?(m(),v("div",K0,[r("div",G0,[r("div",{class:Le(["h-full",F.battery<40?"bg-caution":"bg-ready"]),style:Ss({width:F.battery+"%"})},null,6)]),r("span",q0,k(F.battery)+"%",1)])):(m(),v("span",Y0,"—"))]),r("td",J0,[D(k(F.speed==null?"—":F.speed.toFixed(1))+" ",1),g[19]||(g[19]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",X0,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:yc(j=>qt(F.id),["stop"])},[E(J,{name:"play",size:14}),g[20]||(g[20]=D(" Track ",-1))],8,Q0)])],10,V0))),128))])])])):(m(),v("div",N0," No aircraft connected yet. Devices appear here as they come online. "))])])):w.value==="Live flights"?(m(),v("div",ew,[r("div",tw,[r("span",nw,k(h.value||"No device selected"),1),oe.value&&!Ne.value?(m(),v("span",iw,"Offline")):R("",!0),me.value.length?(m(),v("div",sw,[(m(!0),v(le,null,Fe(me.value,F=>(m(),v("button",{key:F,class:Le(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",F===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:Y=>h.value=F},[r("span",{class:Le(["h-2 w-2 rounded-full",u[F].online?"bg-ready":"bg-ink-muted"])},null,2),D(" "+k(F),1)],10,ow))),128))])):R("",!0)]),me.value.length?(m(),v(le,{key:1},[r("div",{class:Le(["mb-4 grid gap-3",!Ne.value&&oe.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",rw,[g[23]||(g[23]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Le(["mt-1 text-sm font-semibold",Ne.value?((M=oe.value)==null?void 0:M.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},k(Ne.value&&((Z=oe.value)!=null&&Z.registration)?oe.value.registration:"—"),3)]),r("div",lw,[g[24]||(g[24]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Le(["mt-1 text-sm font-semibold",Ne.value?(B=oe.value)!=null&&B.connected?"text-success-fg":"text-danger-fg":"text-ink"])},k(oe.value?Ne.value?oe.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",uw,[g[25]||(g[25]=r("div",{class:"eyebrow"},"Model",-1)),r("div",cw,k(((H=oe.value)==null?void 0:H.model)||"—"),1)]),r("div",dw,[g[26]||(g[26]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",fw,k((ie=oe.value)!=null&&ie.lastSeenMs?Ue(ql)(oe.value.lastSeenMs):"—"),1)])],2),r("div",hw,[r("div",pw,[g[28]||(g[28]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",mw,[r("div",gw,[r("div",{class:Le(["h-full transition-all",typeof de.value.batteryPercent=="number"?de.value.batteryPercent<20?"bg-warning":de.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Ss({width:(typeof de.value.batteryPercent=="number"?de.value.batteryPercent:0)+"%"})},null,6)]),r("div",vw,[D(k(typeof de.value.batteryPercent=="number"?de.value.batteryPercent:"—"),1),g[27]||(g[27]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",_w,[g[30]||(g[30]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",yw,[D(k(lt(de.value.altitude,1)),1),g[29]||(g[29]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",bw,[g[35]||(g[35]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",xw,[r("div",ww,[g[31]||(g[31]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",kw,k(de.value.flightMode||"—"),1)]),r("div",Sw,[g[32]||(g[32]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",Pw,k(de.value.isFlying==null?"—":de.value.isFlying?"yes":"no"),1)]),r("div",Tw,[g[33]||(g[33]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",Cw,k(de.value.satelliteCount==null?"—":de.value.satelliteCount),1)]),r("div",Lw,[g[34]||(g[34]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",Mw,k(Te.value==null?"—":lt(Te.value,2," m/s")),1)])])]),r("div",Ew,[g[39]||(g[39]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",Ow,[r("div",zw,[g[36]||(g[36]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",Aw,k(lt(de.value.latitude,6)),1)]),r("div",Iw,[g[37]||(g[37]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",$w,k(lt(de.value.longitude,6)),1)]),r("div",Dw,[g[38]||(g[38]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",Nw,k(lt(typeof de.value.velocityZ=="number"?-de.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",Rw,[g[40]||(g[40]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),E(Ql,{position:nt.value,trail:ke.value},null,8,["position","trail"])]),r("div",Fw,[g[41]||(g[41]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",Bw,[re(r("input",{"onUpdate:modelValue":g[3]||(g[3]=F=>V.value=F),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ve,V.value]]),re(r("input",{"onUpdate:modelValue":g[4]||(g[4]=F=>ue.value=F),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ve,ue.value]]),r("button",{class:"btn-accent",onClick:ht},"Send")]),r("div",Vw,k(X.value),1)]),r("div",Uw,[g[42]||(g[42]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",Zw,[(m(!0),v(le,null,Fe(y,(F,Y)=>(m(),v("div",{key:Y,class:"border-b border-line py-1"},[r("span",Hw,k(F.t),1),r("span",jw,k(F.tag),1),r("span",Ww,k(F.text),1)]))),128))])])])],64)):(m(),v("div",aw,[E(J,{name:"radio",size:28,class:"text-ink-muted"}),g[21]||(g[21]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),g[22]||(g[22]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):w.value==="Logbook"?(m(),et(Ob,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):w.value==="Documents"?(m(),et(t0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):w.value==="Settings"?(m(),et(Iy,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:g[5]||(g[5]=F=>l("logout"))},null,8,["email","role","organization","organization-name"])):(m(),v("div",Kw,[r("div",Gw,[E(J,{name:U.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",qw,k(w.value),1),w.value==="Drives"?(m(),v("div",Yw,[g[43]||(g[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:g[6]||(g[6]=F=>w.value="Settings")},"Settings → Integrations"),g[44]||(g[44]=D(". ",-1))])):(m(),v("div",Jw,"This section is part of the console shell and has no backend yet."))])]))])])}}},Qw={key:0,class:"h-full"},ek={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},tk={__name:"App",setup(t){const i=K(!1),o=K(null),l=K("user"),u=K(""),d=K(""),h=K("");function _(w){l.value=w&&w.role||"user",u.value=w&&w.organization||"",d.value=w&&w.organizationName||""}Li(async()=>{h.value=(await Dh()).apiBase||"";const w=await jl();w&&(o.value=w.email,_(w),await Jl()),i.value=!0});async function y(w){o.value=w,_(await jl()),await Jl()}async function T(){wp(),await Rh(),o.value=null,l.value="user",u.value="",d.value=""}return(w,z)=>i.value?(m(),v("div",Qw,[o.value?(m(),et(Xw,{key:0,email:o.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:T},null,8,["email","role","organization","organization-name"])):(m(),et(Fp,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(m(),v("div",ek,"Loading…"))}};zh(tk).mount("#app");
|