@signalk/freeboard-sk 3.2.0-beta.0 → 3.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/package.json +16 -14
  2. package/plugin/alarms/alarms.js +68 -8
  3. package/plugin/lib/fetch.js +4 -4
  4. package/plugin/vitest.config.mjs +11 -0
  5. package/public/assets/features/chart-auto-refresh-1.jpg +0 -0
  6. package/public/assets/features/temporal-charts-1.jpg +0 -0
  7. package/public/assets/features/temporal-charts-2.jpg +0 -0
  8. package/public/assets/features-corpus.json +1 -1
  9. package/public/assets/help/index.html +7 -0
  10. package/public/{chunk-WXOWBQXR.js → chunk-2M5JDEPT.js} +1 -1
  11. package/public/{chunk-TVMAD5AZ.js → chunk-2SPW2M6P.js} +1 -1
  12. package/public/{chunk-PSRS6NXJ.js → chunk-2UND4DAL.js} +2 -2
  13. package/public/{chunk-TEKC7VXV.js → chunk-33UDAXN5.js} +1 -1
  14. package/public/chunk-3FOJW6X2.js +1 -0
  15. package/public/{chunk-7Z4ZZM32.js → chunk-ABEPBSQB.js} +1 -1
  16. package/public/{chunk-RU2QXGZX.js → chunk-APXAP2M7.js} +1 -1
  17. package/public/chunk-CJYO3MRU.js +1 -0
  18. package/public/{chunk-SOVFTS2B.js → chunk-FC62PK2U.js} +1 -1
  19. package/public/{chunk-2RJKLB5L.js → chunk-FHFMCRY4.js} +77 -77
  20. package/public/{chunk-7UXFP343.js → chunk-FMYAA5JW.js} +1 -1
  21. package/public/{chunk-OU4PGUT3.js → chunk-FTLLJC55.js} +1 -1
  22. package/public/{chunk-JOTL4UUV.js → chunk-J43UG5Q3.js} +1 -1
  23. package/public/chunk-K2CIRFN7.js +1709 -0
  24. package/public/{chunk-TVVJJZA5.js → chunk-K7PZKJJ7.js} +1 -1
  25. package/public/{chunk-Y5XX3LUA.js → chunk-KNJHWYQ3.js} +1 -1
  26. package/public/{chunk-TGPAYIRR.js → chunk-OGLYW4PJ.js} +1 -1
  27. package/public/chunk-QGRCSFIW.js +1 -0
  28. package/public/{chunk-PGHE7FOF.js → chunk-T5UYZVNA.js} +1 -1
  29. package/public/{chunk-NDDO5DKA.js → chunk-TTKT5FKY.js} +1 -1
  30. package/public/chunk-UYQ6T6PQ.js +1 -0
  31. package/public/{chunk-L3MJOGJ2.js → chunk-WHLON3TU.js} +1 -1
  32. package/public/{chunk-VSWAOYSI.js → chunk-XTQIZ74A.js} +1 -1
  33. package/public/index.html +1 -1
  34. package/public/{main-WYFYYBYG.js → main-WJS4CMGQ.js} +7 -7
  35. package/public/polyfills-LVNOU2XZ.js +2 -0
  36. package/public/{worker-2AV5I4KP.js → worker-JRN7I6EJ.js} +8 -8
  37. package/public/worker-U7H5YFPO.js +3 -0
  38. package/public/chunk-C6Q5GPY7.js +0 -1
  39. package/public/chunk-DDECKPFC.js +0 -1
  40. package/public/chunk-HB342AB6.js +0 -1
  41. package/public/chunk-JH5KSRZ6.js +0 -1709
  42. package/public/chunk-VYN2OBDD.js +0 -1
  43. package/public/polyfills-RV3JTMEC.js +0 -2
  44. package/public/worker-XSMNG74L.js +0 -3
@@ -1 +0,0 @@
1
- import{m as a,n as b,o as c,p as d,q as e,r as f}from"./chunk-WXOWBQXR.js";import"./chunk-TGPAYIRR.js";import"./chunk-7Z4ZZM32.js";import"./chunk-JH5KSRZ6.js";import"./chunk-6H3I7D5M.js";export{d as AboutDialog,b as AlertDialog,c as ConfirmDialog,e as LoginDialog,f as MessageBarComponent,a as MsgBox};
@@ -1,2 +0,0 @@
1
- var Tt=Object.defineProperty,Et=Object.defineProperties,pt=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,Ie=(t,e,c)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[e]=c,Je=(t,e)=>{for(var c in e||(e={}))gt.call(e,c)&&Ie(t,c,e[c]);if($e)for(var c of $e(e))yt.call(e,c)&&Ie(t,c,e[c]);return t},mt=(t,e)=>Et(t,pt(e)),S=(t,e,c)=>(Ie(t,typeof e!="symbol"?e+"":e,c),c),te=globalThis;function ne(t){return(te.__Zone_symbol_prefix||"__zone_symbol__")+t}function kt(){let t=te.performance;function e(x){t&&t.mark&&t.mark(x)}function c(x,r){t&&t.measure&&t.measure(x,r)}e("Zone");let n=class Me{constructor(r,o){S(this,"_parent"),S(this,"_name"),S(this,"_properties"),S(this,"_zoneDelegate"),this._parent=r,this._name=o?o.name||"unnamed":"<root>",this._properties=o&&o.properties||{},this._zoneDelegate=new v(this,this._parent&&this._parent._zoneDelegate,o)}static assertZonePatched(){if(te.Promise!==M.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let r=Me.current;for(;r.parent;)r=r.parent;return r}static get current(){return U.zone}static get currentTask(){return ee}static __load_patch(r,o,i=!1){if(M.hasOwnProperty(r)){let g=te[ne("forceDuplicateZoneCheck")]===!0;if(!i&&g)throw Error("Already loaded patch: "+r)}else if(!te["__Zone_disable_"+r]){let g="Zone:"+r;e(g),M[r]=o(te,Me,C),c(g,g)}}get parent(){return this._parent}get name(){return this._name}get(r){let o=this.getZoneWith(r);if(o)return o._properties[r]}getZoneWith(r){let o=this;for(;o;){if(o._properties.hasOwnProperty(r))return o;o=o._parent}return null}fork(r){if(!r)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,r)}wrap(r,o){if(typeof r!="function")throw new Error("Expecting function got: "+r);let i=this._zoneDelegate.intercept(this,r,o),g=this;return function(){return g.runGuarded(i,this,arguments,o)}}run(r,o,i,g){U={parent:U,zone:this};try{return this._zoneDelegate.invoke(this,r,o,i,g)}finally{U=U.parent}}runGuarded(r,o=null,i,g){U={parent:U,zone:this};try{try{return this._zoneDelegate.invoke(this,r,o,i,g)}catch(k){if(this._zoneDelegate.handleError(this,k))throw k}}finally{U=U.parent}}runTask(r,o,i){if(r.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(r.zone||P).name+"; Execution: "+this.name+")");let g=r,{type:k,data:{isPeriodic:re=!1,isRefreshable:se=!1}={}}=r;if(r.state===_&&(k===w||k===O))return;let ie=r.state!=V;ie&&g._transitionTo(V,F);let pe=ee;ee=g,U={parent:U,zone:this};try{k==O&&r.data&&!re&&!se&&(r.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,g,o,i)}catch(h){if(this._zoneDelegate.handleError(this,h))throw h}}finally{let h=r.state;if(h!==_&&h!==E)if(k==w||re||se&&h===H)ie&&g._transitionTo(F,V,H);else{let l=g._zoneDelegates;this._updateTaskCount(g,-1),ie&&g._transitionTo(_,V,_),se&&(g._zoneDelegates=l)}U=U.parent,ee=pe}}scheduleTask(r){if(r.zone&&r.zone!==this){let i=this;for(;i;){if(i===r.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${r.zone.name}`);i=i.parent}}r._transitionTo(H,_);let o=[];r._zoneDelegates=o,r._zone=this;try{r=this._zoneDelegate.scheduleTask(this,r)}catch(i){throw r._transitionTo(E,H,_),this._zoneDelegate.handleError(this,i),i}return r._zoneDelegates===o&&this._updateTaskCount(r,1),r.state==H&&r._transitionTo(F,H),r}scheduleMicroTask(r,o,i,g){return this.scheduleTask(new d(q,r,o,i,g,void 0))}scheduleMacroTask(r,o,i,g,k){return this.scheduleTask(new d(O,r,o,i,g,k))}scheduleEventTask(r,o,i,g,k){return this.scheduleTask(new d(w,r,o,i,g,k))}cancelTask(r){if(r.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(r.zone||P).name+"; Execution: "+this.name+")");if(!(r.state!==F&&r.state!==V)){r._transitionTo(G,F,V);try{this._zoneDelegate.cancelTask(this,r)}catch(o){throw r._transitionTo(E,G),this._zoneDelegate.handleError(this,o),o}return this._updateTaskCount(r,-1),r._transitionTo(_,G),r.runCount=-1,r}}_updateTaskCount(r,o){let i=r._zoneDelegates;o==-1&&(r._zoneDelegates=null);for(let g=0;g<i.length;g++)i[g]._updateTaskCount(r.type,o)}};S(n,"__symbol__",ne);let a=n,u={name:"",onHasTask:(x,r,o,i)=>x.hasTask(o,i),onScheduleTask:(x,r,o,i)=>x.scheduleTask(o,i),onInvokeTask:(x,r,o,i,g,k)=>x.invokeTask(o,i,g,k),onCancelTask:(x,r,o,i)=>x.cancelTask(o,i)};class v{constructor(r,o,i){S(this,"_zone"),S(this,"_taskCounts",{microTask:0,macroTask:0,eventTask:0}),S(this,"_forkDlgt"),S(this,"_forkZS"),S(this,"_forkCurrZone"),S(this,"_interceptDlgt"),S(this,"_interceptZS"),S(this,"_interceptCurrZone"),S(this,"_invokeDlgt"),S(this,"_invokeZS"),S(this,"_invokeCurrZone"),S(this,"_handleErrorDlgt"),S(this,"_handleErrorZS"),S(this,"_handleErrorCurrZone"),S(this,"_scheduleTaskDlgt"),S(this,"_scheduleTaskZS"),S(this,"_scheduleTaskCurrZone"),S(this,"_invokeTaskDlgt"),S(this,"_invokeTaskZS"),S(this,"_invokeTaskCurrZone"),S(this,"_cancelTaskDlgt"),S(this,"_cancelTaskZS"),S(this,"_cancelTaskCurrZone"),S(this,"_hasTaskDlgt"),S(this,"_hasTaskDlgtOwner"),S(this,"_hasTaskZS"),S(this,"_hasTaskCurrZone"),this._zone=r,this._forkZS=i&&(i&&i.onFork?i:o._forkZS),this._forkDlgt=i&&(i.onFork?o:o._forkDlgt),this._forkCurrZone=i&&(i.onFork?this._zone:o._forkCurrZone),this._interceptZS=i&&(i.onIntercept?i:o._interceptZS),this._interceptDlgt=i&&(i.onIntercept?o:o._interceptDlgt),this._interceptCurrZone=i&&(i.onIntercept?this._zone:o._interceptCurrZone),this._invokeZS=i&&(i.onInvoke?i:o._invokeZS),this._invokeDlgt=i&&(i.onInvoke?o:o._invokeDlgt),this._invokeCurrZone=i&&(i.onInvoke?this._zone:o._invokeCurrZone),this._handleErrorZS=i&&(i.onHandleError?i:o._handleErrorZS),this._handleErrorDlgt=i&&(i.onHandleError?o:o._handleErrorDlgt),this._handleErrorCurrZone=i&&(i.onHandleError?this._zone:o._handleErrorCurrZone),this._scheduleTaskZS=i&&(i.onScheduleTask?i:o._scheduleTaskZS),this._scheduleTaskDlgt=i&&(i.onScheduleTask?o:o._scheduleTaskDlgt),this._scheduleTaskCurrZone=i&&(i.onScheduleTask?this._zone:o._scheduleTaskCurrZone),this._invokeTaskZS=i&&(i.onInvokeTask?i:o._invokeTaskZS),this._invokeTaskDlgt=i&&(i.onInvokeTask?o:o._invokeTaskDlgt),this._invokeTaskCurrZone=i&&(i.onInvokeTask?this._zone:o._invokeTaskCurrZone),this._cancelTaskZS=i&&(i.onCancelTask?i:o._cancelTaskZS),this._cancelTaskDlgt=i&&(i.onCancelTask?o:o._cancelTaskDlgt),this._cancelTaskCurrZone=i&&(i.onCancelTask?this._zone:o._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;let g=i&&i.onHasTask,k=o&&o._hasTaskZS;(g||k)&&(this._hasTaskZS=g?i:u,this._hasTaskDlgt=o,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,i.onScheduleTask||(this._scheduleTaskZS=u,this._scheduleTaskDlgt=o,this._scheduleTaskCurrZone=this._zone),i.onInvokeTask||(this._invokeTaskZS=u,this._invokeTaskDlgt=o,this._invokeTaskCurrZone=this._zone),i.onCancelTask||(this._cancelTaskZS=u,this._cancelTaskDlgt=o,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(r,o){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,r,o):new a(r,o)}intercept(r,o,i){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,r,o,i):o}invoke(r,o,i,g,k){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,r,o,i,g,k):o.apply(i,g)}handleError(r,o){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,r,o):!0}scheduleTask(r,o){let i=o;if(this._scheduleTaskZS)this._hasTaskZS&&i._zoneDelegates.push(this._hasTaskDlgtOwner),i=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,r,o),i||(i=o);else if(o.scheduleFn)o.scheduleFn(o);else if(o.type==q)Q(o);else throw new Error("Task is missing scheduleFn.");return i}invokeTask(r,o,i,g){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,r,o,i,g):o.callback.apply(i,g)}cancelTask(r,o){let i;if(this._cancelTaskZS)i=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,r,o);else{if(!o.cancelFn)throw Error("Task is not cancelable");i=o.cancelFn(o)}return i}hasTask(r,o){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,r,o)}catch(i){this.handleError(r,i)}}_updateTaskCount(r,o){let i=this._taskCounts,g=i[r],k=i[r]=g+o;if(k<0)throw new Error("More tasks executed then were scheduled.");if(g==0||k==0){let re={microTask:i.microTask>0,macroTask:i.macroTask>0,eventTask:i.eventTask>0,change:r};this.hasTask(this._zone,re)}}}class d{constructor(r,o,i,g,k,re){if(S(this,"type"),S(this,"source"),S(this,"invoke"),S(this,"callback"),S(this,"data"),S(this,"scheduleFn"),S(this,"cancelFn"),S(this,"_zone",null),S(this,"runCount",0),S(this,"_zoneDelegates",null),S(this,"_state","notScheduled"),this.type=r,this.source=o,this.data=g,this.scheduleFn=k,this.cancelFn=re,!i)throw new Error("callback is not defined");this.callback=i;let se=this;r===w&&g&&g.useG?this.invoke=d.invokeTask:this.invoke=function(){return d.invokeTask.call(te,se,this,arguments)}}static invokeTask(r,o,i){r||(r=this),K++;try{return r.runCount++,r.zone.runTask(r,o,i)}finally{K===1&&!te[D]&&$(),K--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(_,H)}_transitionTo(r,o,i){if(this._state===o||this._state===i)this._state=r,r==_&&(this._zoneDelegates=null);else throw new Error(`${this.type} '${this.source}': can not transition to '${r}', expecting state '${o}'${i?" or '"+i+"'":""}, was '${this._state}'.`)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}let m=ne("setTimeout"),R=ne("Promise"),p=ne("then"),D=ne("enable_native_microtask_draining"),Z=[],j=!1,Y;function W(x){var r;!Y&&te[R]&&(Y=te[R].resolve(0)),Y?((r=Y[p])!=null?r:Y.then).call(Y,x):te[m](x,0)}function Q(x){let r=te[D],o=r&&Z.length===0&&!j,i=!r&&K===0&&Z.length===0;(o||i)&&W($),x&&Z.push(x)}function $(){if(!j){for(j=!0;Z.length;){let x=Z;Z=[];for(let r of x)try{r.zone.runTask(r,null,null)}catch(o){C.onUnhandledError(o)}}te[D]?(j=!1,C.microtaskDrainDone()):(C.microtaskDrainDone(),j=!1)}}let P={name:"NO ZONE"},_="notScheduled",H="scheduling",F="scheduled",V="running",G="canceling",E="unknown",q="microTask",O="macroTask",w="eventTask",M={},C={symbol:ne,currentZoneFrame:()=>U,onUnhandledError:X,microtaskDrainDone:X,scheduleMicroTask:Q,showUncaughtError:()=>!a[ne("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:X,patchMethod:()=>X,bindArguments:()=>[],patchThen:()=>X,patchMacroTask:()=>X,patchEventPrototype:()=>X,getGlobalObjects:()=>{},ObjectDefineProperty:()=>X,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>X,wrapWithCurrentZone:()=>X,filterProperties:()=>[],attachOriginToPatched:()=>X,_redefineProperty:()=>X,patchCallbacks:()=>X,nativeScheduleMicroTask:W},U={parent:null,zone:new a(null,null)},ee=null,K=0;function X(){}return c("Zone","Zone"),a}function vt(){var t;let e=globalThis,c=e[ne("forceDuplicateZoneCheck")]===!0;if(e.Zone&&(c||typeof e.Zone.__symbol__!="function"))throw new Error("Zone already loaded.");return(t=e.Zone)!=null||(e.Zone=kt()),e.Zone}var ve=Object.getOwnPropertyDescriptor,Ae=Object.defineProperty,He=Object.getPrototypeOf,bt=Object.create,Pt=Array.prototype.slice,Fe="addEventListener",Ve="removeEventListener",Ze=ne(Fe),Le=ne(Ve),he="true",fe="false",be=ne("");function Ge(t,e){return Zone.current.wrap(t,e)}function xe(t,e,c,n,a){return Zone.current.scheduleMacroTask(t,e,c,n,a)}var A=ne,De=typeof window<"u",Se=De?window:void 0,J=De&&Se||globalThis,wt="removeAttribute";function Be(t,e){for(let c=t.length-1;c>=0;c--)typeof t[c]=="function"&&(t[c]=Ge(t[c],e+"_"+c));return t}function Rt(t,e){let c=t.constructor.name;for(let n=0;n<e.length;n++){let a=e[n],u=t[a];if(u){let v=ve(t,a);if(!rt(v))continue;t[a]=(d=>{let m=function(){return d.apply(this,Be(arguments,c+"."+a))};return de(m,d),m})(u)}}}function rt(t){return t?t.writable===!1?!1:!(typeof t.get=="function"&&typeof t.set>"u"):!0}var ot=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Ce=!("nw"in J)&&typeof J.process<"u"&&J.process.toString()==="[object process]",ze=!Ce&&!ot&&!!(De&&Se.HTMLElement),st=typeof J.process<"u"&&J.process.toString()==="[object process]"&&!ot&&!!(De&&Se.HTMLElement),Re={},Dt=A("enable_beforeunload"),Ke=function(t){if(t=t||J.event,!t)return;let e=Re[t.type];e||(e=Re[t.type]=A("ON_PROPERTY"+t.type));let c=this||t.target||J,n=c[e],a;if(ze&&c===Se&&t.type==="error"){let u=t;a=n&&n.call(this,u.message,u.filename,u.lineno,u.colno,u.error),a===!0&&t.preventDefault()}else a=n&&n.apply(this,arguments),t.type==="beforeunload"&&J[Dt]&&typeof a=="string"?t.returnValue=a:a!=null&&!a&&t.preventDefault();return a};function Qe(t,e,c){let n=ve(t,e);if(!n&&c&&ve(c,e)&&(n={enumerable:!0,configurable:!0}),!n||!n.configurable)return;let a=A("on"+e+"patched");if(t.hasOwnProperty(a)&&t[a])return;delete n.writable,delete n.value;let u=n.get,v=n.set,d=e.slice(2),m=Re[d];m||(m=Re[d]=A("ON_PROPERTY"+d)),n.set=function(R){let p=this;if(!p&&t===J&&(p=J),!p)return;typeof p[m]=="function"&&p.removeEventListener(d,Ke),v?.call(p,null),p[m]=R,typeof R=="function"&&p.addEventListener(d,Ke,!1)},n.get=function(){let R=this;if(!R&&t===J&&(R=J),!R)return null;let p=R[m];if(p)return p;if(u){let D=u.call(this);if(D)return n.set.call(this,D),typeof R[wt]=="function"&&R.removeAttribute(e),D}return null},Ae(t,e,n),t[a]=!0}function it(t,e,c){if(e)for(let n=0;n<e.length;n++)Qe(t,"on"+e[n],c);else{let n=[];for(let a in t)a.slice(0,2)=="on"&&n.push(a);for(let a=0;a<n.length;a++)Qe(t,n[a],c)}}var le=A("originalInstance");function ke(t){let e=J[t];if(!e)return;J[A(t)]=e,J[t]=function(){let a=Be(arguments,t);switch(a.length){case 0:this[le]=new e;break;case 1:this[le]=new e(a[0]);break;case 2:this[le]=new e(a[0],a[1]);break;case 3:this[le]=new e(a[0],a[1],a[2]);break;case 4:this[le]=new e(a[0],a[1],a[2],a[3]);break;default:throw new Error("Arg list too long.")}},de(J[t],e);let c=new e(function(){}),n;for(n in c)t==="XMLHttpRequest"&&n==="responseBlob"||(function(a){typeof c[a]=="function"?J[t].prototype[a]=function(){return this[le][a].apply(this[le],arguments)}:Ae(J[t].prototype,a,{set:function(u){typeof u=="function"?(this[le][a]=Ge(u,t+"."+a),de(this[le][a],u)):this[le][a]=u},get:function(){return this[le][a]}})})(n);for(n in e)n!=="prototype"&&e.hasOwnProperty(n)&&(J[t][n]=e[n])}function St(t,e){if(typeof Object.getOwnPropertySymbols!="function")return;Object.getOwnPropertySymbols(t).forEach(n=>{let a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,{get:function(){return t[n]},set:function(u){a&&(!a.writable||typeof a.set!="function")||(t[n]=u)},enumerable:a?a.enumerable:!0,configurable:a?a.configurable:!0})})}var Ct=!1;function _e(t,e,c){let n=t;for(;n&&!n.hasOwnProperty(e);)n=He(n);!n&&t[e]&&(n=t);let a=A(e),u=null;if(n&&(!(u=n[a])||!n.hasOwnProperty(a))){u=n[a]=n[e];let v=n&&ve(n,e);if(rt(v)){let d=c(u,a,e);n[e]=function(){return d(this,arguments)},de(n[e],u),Ct&&St(u,n[e])}}return u}function Ot(t,e,c){let n=null;function a(u){let v=u.data;return v.args[v.cbIdx]=function(){u.invoke.apply(this,arguments)},n.apply(v.target,v.args),u}n=_e(t,e,u=>function(v,d){let m=c(v,d);return m.cbIdx>=0&&typeof d[m.cbIdx]=="function"?xe(m.name,d[m.cbIdx],m,a):u.apply(v,d)})}function de(t,e){t[A("OriginalDelegate")]=e}function et(t){return typeof t=="function"}function tt(t){return typeof t=="number"}var Nt={useG:!0},oe={},at={},ct=new RegExp("^"+be+"(\\w+)(true|false)$"),lt=A("propagationStopped");function ut(t,e){let c=(e?e(t):t)+fe,n=(e?e(t):t)+he,a=be+c,u=be+n;oe[t]={},oe[t][fe]=a,oe[t][he]=u}function Zt(t,e,c,n){let a=n&&n.add||Fe,u=n&&n.rm||Ve,v=n&&n.listeners||"eventListeners",d=n&&n.rmAll||"removeAllListeners",m=A(a),R="."+a+":",p="prependListener",D="."+p+":",Z=function(P,_,H){if(P.isRemoved)return;let F=P.callback;typeof F=="object"&&F.handleEvent&&(P.callback=E=>F.handleEvent(E),P.originalDelegate=F);let V;try{P.invoke(P,_,[H])}catch(E){V=E}let G=P.options;if(G&&typeof G=="object"&&G.once){let E=P.originalDelegate?P.originalDelegate:P.callback;_[u].call(_,H.type,E,G)}return V};function j(P,_,H){if(_=_||t.event,!_)return;let F=P||_.target||t,V=F[oe[_.type][H?he:fe]];if(V){let G=[];if(V.length===1){let E=Z(V[0],F,_);E&&G.push(E)}else{let E=V.slice();for(let q=0;q<E.length&&!(_&&_[lt]===!0);q++){let O=Z(E[q],F,_);O&&G.push(O)}}if(G.length===1)throw G[0];for(let E=0;E<G.length;E++){let q=G[E];e.nativeScheduleMicroTask(()=>{throw q})}}}let Y=function(P){return j(this,P,!1)},W=function(P){return j(this,P,!0)};function Q(P,_){if(!P)return!1;let H=!0;_&&_.useG!==void 0&&(H=_.useG);let F=_&&_.vh,V=!0;_&&_.chkDup!==void 0&&(V=_.chkDup);let G=!1;_&&_.rt!==void 0&&(G=_.rt);let E=P;for(;E&&!E.hasOwnProperty(a);)E=He(E);if(!E&&P[a]&&(E=P),!E||E[m])return!1;let q=_&&_.eventNameToString,O={},w=E[m]=E[a],M=E[A(u)]=E[u],C=E[A(v)]=E[v],U=E[A(d)]=E[d],ee;_&&_.prepend&&(ee=E[A(_.prepend)]=E[_.prepend]);function K(s,f){return f?typeof s=="boolean"?{capture:s,passive:!0}:s?typeof s=="object"&&s.passive!==!1?mt(Je({},s),{passive:!0}):s:{passive:!0}:s}let X=function(s){if(!O.isExisting)return w.call(O.target,O.eventName,O.capture?W:Y,O.options)},x=function(s){if(!s.isRemoved){let f=oe[s.eventName],y;f&&(y=f[s.capture?he:fe]);let b=y&&s.target[y];if(b){for(let T=0;T<b.length;T++)if(b[T]===s){b.splice(T,1),s.isRemoved=!0,s.removeAbortListener&&(s.removeAbortListener(),s.removeAbortListener=null),b.length===0&&(s.allRemoved=!0,s.target[y]=null);break}}}if(s.allRemoved)return M.call(s.target,s.eventName,s.capture?W:Y,s.options)},r=function(s){return w.call(O.target,O.eventName,s.invoke,O.options)},o=function(s){return ee.call(O.target,O.eventName,s.invoke,O.options)},i=function(s){return M.call(s.target,s.eventName,s.invoke,s.options)},g=H?X:r,k=H?x:i,re=function(s,f){let y=typeof f;return y==="function"&&s.callback===f||y==="object"&&s.originalDelegate===f},se=_?.diff||re,ie=Zone[A("UNPATCHED_EVENTS")],pe=t[A("PASSIVE_EVENTS")];function h(s){if(typeof s=="object"&&s!==null){let f=Je({},s);return s.signal&&(f.signal=s.signal),f}return s}let l=function(s,f,y,b,T=!1,N=!1){return function(){let L=this||t,I=arguments[0];_&&_.transferEventName&&(I=_.transferEventName(I));let B=arguments[1];if(!B)return s.apply(this,arguments);if(Ce&&I==="uncaughtException")return s.apply(this,arguments);let z=!1;if(typeof B!="function"){if(!B.handleEvent)return s.apply(this,arguments);z=!0}if(F&&!F(s,B,L,arguments))return;let Te=!!pe&&pe.indexOf(I)!==-1,ae=h(K(arguments[2],Te)),Ee=ae?.signal;if(Ee?.aborted)return;if(ie){for(let ue=0;ue<ie.length;ue++)if(I===ie[ue])return Te?s.call(L,I,B,ae):s.apply(this,arguments)}let Oe=ae?typeof ae=="boolean"?!0:ae.capture:!1,Ue=ae&&typeof ae=="object"?ae.once:!1,dt=Zone.current,Ne=oe[I];Ne||(ut(I,q),Ne=oe[I]);let We=Ne[Oe?he:fe],ge=L[We],qe=!1;if(ge){if(qe=!0,V){for(let ue=0;ue<ge.length;ue++)if(se(ge[ue],B))return}}else ge=L[We]=[];let Pe,Xe=L.constructor.name,Ye=at[Xe];Ye&&(Pe=Ye[I]),Pe||(Pe=Xe+f+(q?q(I):I)),O.options=ae,Ue&&(O.options.once=!1),O.target=L,O.capture=Oe,O.eventName=I,O.isExisting=qe;let me=H?Nt:void 0;me&&(me.taskData=O),Ee&&(O.options.signal=void 0);let ce=dt.scheduleEventTask(Pe,B,me,y,b);if(Ee){O.options.signal=Ee;let ue=()=>ce.zone.cancelTask(ce);s.call(Ee,"abort",ue,{once:!0}),ce.removeAbortListener=()=>Ee.removeEventListener("abort",ue)}if(O.target=null,me&&(me.taskData=null),Ue&&(O.options.once=!0),typeof ce.options!="boolean"&&(ce.options=ae),ce.target=L,ce.capture=Oe,ce.eventName=I,z&&(ce.originalDelegate=B),N?ge.unshift(ce):ge.push(ce),T)return L}};return E[a]=l(w,R,g,k,G),ee&&(E[p]=l(ee,D,o,k,G,!0)),E[u]=function(){let s=this||t,f=arguments[0];_&&_.transferEventName&&(f=_.transferEventName(f));let y=arguments[2],b=y?typeof y=="boolean"?!0:y.capture:!1,T=arguments[1];if(!T)return M.apply(this,arguments);if(F&&!F(M,T,s,arguments))return;let N=oe[f],L;N&&(L=N[b?he:fe]);let I=L&&s[L];if(I)for(let B=0;B<I.length;B++){let z=I[B];if(se(z,T)){if(I.splice(B,1),z.isRemoved=!0,I.length===0&&(z.allRemoved=!0,s[L]=null,!b&&typeof f=="string")){let Te=be+"ON_PROPERTY"+f;s[Te]=null}return z.zone.cancelTask(z),G?s:void 0}}return M.apply(this,arguments)},E[v]=function(){let s=this||t,f=arguments[0];_&&_.transferEventName&&(f=_.transferEventName(f));let y=[],b=ht(s,q?q(f):f);for(let T=0;T<b.length;T++){let N=b[T],L=N.originalDelegate?N.originalDelegate:N.callback;y.push(L)}return y},E[d]=function(){let s=this||t,f=arguments[0];if(f){_&&_.transferEventName&&(f=_.transferEventName(f));let y=oe[f];if(y){let b=y[fe],T=y[he],N=s[b],L=s[T];if(N){let I=N.slice();for(let B=0;B<I.length;B++){let z=I[B],Te=z.originalDelegate?z.originalDelegate:z.callback;this[u].call(this,f,Te,z.options)}}if(L){let I=L.slice();for(let B=0;B<I.length;B++){let z=I[B],Te=z.originalDelegate?z.originalDelegate:z.callback;this[u].call(this,f,Te,z.options)}}}}else{let y=Object.keys(s);for(let b=0;b<y.length;b++){let T=y[b],N=ct.exec(T),L=N&&N[1];L&&L!=="removeListener"&&this[d].call(this,L)}this[d].call(this,"removeListener")}if(G)return this},de(E[a],w),de(E[u],M),U&&de(E[d],U),C&&de(E[v],C),!0}let $=[];for(let P=0;P<c.length;P++)$[P]=Q(c[P],n);return $}function ht(t,e){if(!e){let u=[];for(let v in t){let d=ct.exec(v),m=d&&d[1];if(m&&(!e||m===e)){let R=t[v];if(R)for(let p=0;p<R.length;p++)u.push(R[p])}}return u}let c=oe[e];c||(ut(e),c=oe[e]);let n=t[c[fe]],a=t[c[he]];return n?a?n.concat(a):n.slice():a?a.slice():[]}function Lt(t,e){let c=t.Event;c&&c.prototype&&e.patchMethod(c.prototype,"stopImmediatePropagation",n=>function(a,u){a[lt]=!0,n&&n.apply(a,u)})}function It(t,e){e.patchMethod(t,"queueMicrotask",c=>function(n,a){Zone.current.scheduleMicroTask("queueMicrotask",a[0])})}var we=A("zoneTask");function ye(t,e,c,n){let a=null,u=null;e+=n,c+=n;let v={};function d(R){let p=R.data;p.args[0]=function(){return R.invoke.apply(this,arguments)};let D=a.apply(t,p.args);return tt(D)?p.handleId=D:(p.handle=D,p.isRefreshable=et(D.refresh)),R}function m(R){let{handle:p,handleId:D}=R.data;return u.call(t,p??D)}a=_e(t,e,R=>function(p,D){var Z;if(et(D[0])){let j={isRefreshable:!1,isPeriodic:n==="Interval",delay:n==="Timeout"||n==="Interval"?D[1]||0:void 0,args:D},Y=D[0];D[0]=function(){try{return Y.apply(this,arguments)}finally{let{handle:F,handleId:V,isPeriodic:G,isRefreshable:E}=j;!G&&!E&&(V?delete v[V]:F&&(F[we]=null))}};let W=xe(e,D[0],j,d,m);if(!W)return W;let{handleId:Q,handle:$,isRefreshable:P,isPeriodic:_}=W.data;if(Q)v[Q]=W;else if($&&($[we]=W,P&&!_)){let H=$.refresh;$.refresh=function(){let{zone:F,state:V}=W;return V==="notScheduled"?(W._state="scheduled",F._updateTaskCount(W,1)):V==="running"&&(W._state="scheduling"),H.call(this)}}return(Z=$??Q)!=null?Z:W}else return R.apply(t,D)}),u=_e(t,c,R=>function(p,D){let Z=D[0],j;tt(Z)?(j=v[Z],delete v[Z]):(j=Z?.[we],j?Z[we]=null:j=Z),j?.type?j.cancelFn&&j.zone.cancelTask(j):R.apply(t,D)})}function Mt(t,e){let{isBrowser:c,isMix:n}=e.getGlobalObjects();if(!c&&!n||!t.customElements||!("customElements"in t))return;let a=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"];e.patchCallbacks(e,t.customElements,"customElements","define",a)}function jt(t,e){if(Zone[e.symbol("patchEventTarget")])return;let{eventNames:c,zoneSymbolEventNames:n,TRUE_STR:a,FALSE_STR:u,ZONE_SYMBOL_PREFIX:v}=e.getGlobalObjects();for(let m=0;m<c.length;m++){let R=c[m],p=R+u,D=R+a,Z=v+p,j=v+D;n[R]={},n[R][u]=Z,n[R][a]=j}let d=t.EventTarget;if(!(!d||!d.prototype))return e.patchEventTarget(t,e,[d&&d.prototype]),!0}function At(t,e){e.patchEventPrototype(t,e)}function ft(t,e,c){if(!c||c.length===0)return e;let n=c.filter(u=>u.target===t);if(n.length===0)return e;let a=n[0].ignoreProperties;return e.filter(u=>a.indexOf(u)===-1)}function nt(t,e,c,n){if(!t)return;let a=ft(t,e,c);it(t,a,n)}function je(t){return Object.getOwnPropertyNames(t).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Ht(t,e){if(Ce&&!st||Zone[t.symbol("patchEvents")])return;let c=e.__Zone_ignore_on_properties,n=[];if(ze){let a=window;n=n.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]),nt(a,je(a),c,He(a))}n=n.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let a=0;a<n.length;a++){let u=e[n[a]];u?.prototype&&nt(u.prototype,je(u.prototype),c)}}function Ft(t){t.__load_patch("timers",e=>{let n="clear";ye(e,"set",n,"Timeout"),ye(e,"set",n,"Interval"),ye(e,"set",n,"Immediate")}),t.__load_patch("requestAnimationFrame",e=>{ye(e,"request","cancel","AnimationFrame"),ye(e,"mozRequest","mozCancel","AnimationFrame"),ye(e,"webkitRequest","webkitCancel","AnimationFrame")}),t.__load_patch("blocking",(e,c)=>{let n=["alert","prompt","confirm"];for(let a=0;a<n.length;a++){let u=n[a];_e(e,u,(v,d,m)=>function(R,p){return c.current.run(v,e,p,m)})}}),t.__load_patch("EventTarget",(e,c,n)=>{At(e,n),jt(e,n);let a=e.XMLHttpRequestEventTarget;a&&a.prototype&&n.patchEventTarget(e,n,[a.prototype])}),t.__load_patch("MutationObserver",(e,c,n)=>{ke("MutationObserver"),ke("WebKitMutationObserver")}),t.__load_patch("IntersectionObserver",(e,c,n)=>{ke("IntersectionObserver")}),t.__load_patch("FileReader",(e,c,n)=>{ke("FileReader")}),t.__load_patch("on_property",(e,c,n)=>{Ht(n,e)}),t.__load_patch("customElements",(e,c,n)=>{Mt(e,n)}),t.__load_patch("XHR",(e,c)=>{R(e);let n=A("xhrTask"),a=A("xhrSync"),u=A("xhrListener"),v=A("xhrScheduled"),d=A("xhrURL"),m=A("xhrErrorBeforeScheduled");function R(p){let D=p.XMLHttpRequest;if(!D)return;let Z=D.prototype;function j(w){return w[n]}let Y=Z[Ze],W=Z[Le];if(!Y){let w=p.XMLHttpRequestEventTarget;if(w){let M=w.prototype;Y=M[Ze],W=M[Le]}}let Q="readystatechange",$="scheduled";function P(w){let M=w.data,C=M.target;C[v]=!1,C[m]=!1;let U=C[u];Y||(Y=C[Ze],W=C[Le]),U&&W.call(C,Q,U);let ee=C[u]=()=>{if(C.readyState===C.DONE)if(!M.aborted&&C[v]&&w.state===$){let X=C[c.__symbol__("loadfalse")];if(C.status!==0&&X&&X.length>0){let x=w.invoke;w.invoke=function(){let r=C[c.__symbol__("loadfalse")];for(let o=0;o<r.length;o++)r[o]===w&&r.splice(o,1);!M.aborted&&w.state===$&&x.call(w)},X.push(w)}else w.invoke()}else!M.aborted&&C[v]===!1&&(C[m]=!0)};return Y.call(C,Q,ee),C[n]||(C[n]=w),q.apply(C,M.args),C[v]=!0,w}function _(){}function H(w){let M=w.data;return M.aborted=!0,O.apply(M.target,M.args)}let F=_e(Z,"open",()=>function(w,M){return w[a]=M[2]==!1,w[d]=M[1],F.apply(w,M)}),V="XMLHttpRequest.send",G=A("fetchTaskAborting"),E=A("fetchTaskScheduling"),q=_e(Z,"send",()=>function(w,M){if(c.current[E]===!0||w[a])return q.apply(w,M);{let C={target:w,url:w[d],isPeriodic:!1,args:M,aborted:!1},U=xe(V,_,C,P,H);w&&w[m]===!0&&!C.aborted&&U.state===$&&U.invoke()}}),O=_e(Z,"abort",()=>function(w,M){let C=j(w);if(C&&typeof C.type=="string"){if(C.cancelFn==null||C.data&&C.data.aborted)return;C.zone.cancelTask(C)}else if(c.current[G]===!0)return O.apply(w,M)})}}),t.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&Rt(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),t.__load_patch("PromiseRejectionEvent",(e,c)=>{function n(a){return function(u){ht(e,a).forEach(d=>{let m=e.PromiseRejectionEvent;if(m){let R=new m(a,{promise:u.promise,reason:u.rejection});d.invoke(R)}})}}e.PromiseRejectionEvent&&(c[A("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),c[A("rejectionHandledHandler")]=n("rejectionhandled"))}),t.__load_patch("queueMicrotask",(e,c,n)=>{It(e,n)})}function Vt(t){t.__load_patch("ZoneAwarePromise",(e,c,n)=>{let a=Object.getOwnPropertyDescriptor,u=Object.defineProperty;function v(h){if(h&&h.toString===Object.prototype.toString){let l=h.constructor&&h.constructor.name;return(l||"")+": "+JSON.stringify(h)}return h?h.toString():Object.prototype.toString.call(h)}let d=n.symbol,m=[],R=e[d("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")]!==!1,p=d("Promise"),D=d("then"),Z="__creationTrace__";n.onUnhandledError=h=>{if(n.showUncaughtError()){let l=h&&h.rejection;l?console.error("Unhandled Promise rejection:",l instanceof Error?l.message:l,"; Zone:",h.zone.name,"; Task:",h.task&&h.task.source,"; Value:",l,l instanceof Error?l.stack:void 0):console.error(h)}},n.microtaskDrainDone=()=>{for(;m.length;){let h=m.shift();try{h.zone.runGuarded(()=>{throw h.throwOriginal?h.rejection:h})}catch(l){Y(l)}}};let j=d("unhandledPromiseRejectionHandler");function Y(h){n.onUnhandledError(h);try{let l=c[j];typeof l=="function"&&l.call(this,h)}catch{}}function W(h){return h&&typeof h.then=="function"}function Q(h){return h}function $(h){return k.reject(h)}let P=d("state"),_=d("value"),H=d("finally"),F=d("parentPromiseValue"),V=d("parentPromiseState"),G="Promise.then",E=null,q=!0,O=!1,w=0;function M(h,l){return s=>{try{K(h,l,s)}catch(f){K(h,!1,f)}}}let C=function(){let h=!1;return function(s){return function(){h||(h=!0,s.apply(null,arguments))}}},U="Promise resolved with itself",ee=d("currentTaskTrace");function K(h,l,s){let f=C();if(h===s)throw new TypeError(U);if(h[P]===E){let y=null;try{(typeof s=="object"||typeof s=="function")&&(y=s&&s.then)}catch(b){return f(()=>{K(h,!1,b)})(),h}if(l!==O&&s instanceof k&&s.hasOwnProperty(P)&&s.hasOwnProperty(_)&&s[P]!==E)x(s),K(h,s[P],s[_]);else if(l!==O&&typeof y=="function")try{y.call(s,f(M(h,l)),f(M(h,!1)))}catch(b){f(()=>{K(h,!1,b)})()}else{h[P]=l;let b=h[_];if(h[_]=s,h[H]===H&&l===q&&(h[P]=h[V],h[_]=h[F]),l===O&&s instanceof Error){let T=c.currentTask&&c.currentTask.data&&c.currentTask.data[Z];T&&u(s,ee,{configurable:!0,enumerable:!1,writable:!0,value:T})}for(let T=0;T<b.length;)r(h,b[T++],b[T++],b[T++],b[T++]);if(b.length==0&&l==O){h[P]=w;let T=s;try{throw new Error("Uncaught (in promise): "+v(s)+(s&&s.stack?`
2
- `+s.stack:""))}catch(N){T=N}R&&(T.throwOriginal=!0),T.rejection=s,T.promise=h,T.zone=c.current,T.task=c.currentTask,m.push(T),n.scheduleMicroTask()}}}return h}let X=d("rejectionHandledHandler");function x(h){if(h[P]===w){try{let l=c[X];l&&typeof l=="function"&&l.call(this,{rejection:h[_],promise:h})}catch{}h[P]=O;for(let l=0;l<m.length;l++)h===m[l].promise&&m.splice(l,1)}}function r(h,l,s,f,y){x(h);let b=h[P],T=b?typeof f=="function"?f:Q:typeof y=="function"?y:$;l.scheduleMicroTask(G,()=>{try{let N=h[_],L=!!s&&H===s[H];L&&(s[F]=N,s[V]=b);let I=l.run(T,void 0,L&&T!==$&&T!==Q?[]:[N]);K(s,!0,I)}catch(N){K(s,!1,N)}},s)}let o="function ZoneAwarePromise() { [native code] }",i=function(){},g=e.AggregateError;class k{static toString(){return o}static resolve(l){return l instanceof k?l:K(new this(null),q,l)}static reject(l){return K(new this(null),O,l)}static withResolvers(){let l={};return l.promise=new k((s,f)=>{l.resolve=s,l.reject=f}),l}static any(l){if(!l||typeof l[Symbol.iterator]!="function")return Promise.reject(new g([],"All promises were rejected"));let s=[],f=0;try{for(let T of l)f++,s.push(k.resolve(T))}catch{return Promise.reject(new g([],"All promises were rejected"))}if(f===0)return Promise.reject(new g([],"All promises were rejected"));let y=!1,b=[];return new k((T,N)=>{for(let L=0;L<s.length;L++)s[L].then(I=>{y||(y=!0,T(I))},I=>{b.push(I),f--,f===0&&(y=!0,N(new g(b,"All promises were rejected")))})})}static race(l){let s,f,y=new this((N,L)=>{s=N,f=L});function b(N){s(N)}function T(N){f(N)}for(let N of l)W(N)||(N=this.resolve(N)),N.then(b,T);return y}static all(l){return k.allWithCallback(l)}static allSettled(l){return(this&&this.prototype instanceof k?this:k).allWithCallback(l,{thenCallback:f=>({status:"fulfilled",value:f}),errorCallback:f=>({status:"rejected",reason:f})})}static allWithCallback(l,s){let f,y,b=new this((I,B)=>{f=I,y=B}),T=2,N=0,L=[];for(let I of l){W(I)||(I=this.resolve(I));let B=N;try{I.then(z=>{L[B]=s?s.thenCallback(z):z,T--,T===0&&f(L)},z=>{s?(L[B]=s.errorCallback(z),T--,T===0&&f(L)):y(z)})}catch(z){y(z)}T++,N++}return T-=2,T===0&&f(L),b}constructor(l){let s=this;if(!(s instanceof k))throw new Error("Must be an instanceof Promise.");s[P]=E,s[_]=[];try{let f=C();l&&l(f(M(s,q)),f(M(s,O)))}catch(f){K(s,!1,f)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return k}then(l,s){var f;let y=(f=this.constructor)==null?void 0:f[Symbol.species];(!y||typeof y!="function")&&(y=this.constructor||k);let b=new y(i),T=c.current;return this[P]==E?this[_].push(T,b,l,s):r(this,T,b,l,s),b}catch(l){return this.then(null,l)}finally(l){var s;let f=(s=this.constructor)==null?void 0:s[Symbol.species];(!f||typeof f!="function")&&(f=k);let y=new f(i);y[H]=H;let b=c.current;return this[P]==E?this[_].push(b,y,l,l):r(this,b,y,l,l),y}}k.resolve=k.resolve,k.reject=k.reject,k.race=k.race,k.all=k.all;let re=e[p]=e.Promise;e.Promise=k;let se=d("thenPatched");function ie(h){let l=h.prototype,s=a(l,"then");if(s&&(s.writable===!1||!s.configurable))return;let f=l.then;l[D]=f,h.prototype.then=function(y,b){return new k((N,L)=>{f.call(this,N,L)}).then(y,b)},h[se]=!0}n.patchThen=ie;function pe(h){return function(l,s){let f=h.apply(l,s);if(f instanceof k)return f;let y=f.constructor;return y[se]||ie(y),f}}if(re){ie(re);let h=re.try;h&&typeof h=="function"&&(k.try=h),_e(e,"fetch",l=>pe(l))}return Promise[c.__symbol__("uncaughtPromiseErrors")]=m,k})}function Gt(t){t.__load_patch("toString",e=>{let c=Function.prototype.toString,n=A("OriginalDelegate"),a=A("Promise"),u=A("Error"),v=function(){if(typeof this=="function"){let p=this[n];if(p)return typeof p=="function"?c.call(p):Object.prototype.toString.call(p);if(this===Promise){let D=e[a];if(D)return c.call(D)}if(this===Error){let D=e[u];if(D)return c.call(D)}}return c.call(this)};v[n]=c,Function.prototype.toString=v;let d=Object.prototype.toString,m="[object Promise]";Object.prototype.toString=function(){return typeof Promise=="function"&&this instanceof Promise?m:d.call(this)}})}function xt(t,e,c,n,a){let u=Zone.__symbol__(n);if(e[u])return;let v=e[u]=e[n];e[n]=function(d,m,R){return m&&m.prototype&&a.forEach(function(p){let D=`${c}.${n}::`+p,Z=m.prototype;try{if(Z.hasOwnProperty(p)){let j=t.ObjectGetOwnPropertyDescriptor(Z,p);j&&j.value?(j.value=t.wrapWithCurrentZone(j.value,D),t._redefineProperty(m.prototype,p,j)):Z[p]&&(Z[p]=t.wrapWithCurrentZone(Z[p],D))}else Z[p]&&(Z[p]=t.wrapWithCurrentZone(Z[p],D))}catch{}}),v.call(e,d,m,R)},t.attachOriginToPatched(e[n],v)}function Bt(t){t.__load_patch("util",(e,c,n)=>{let a=je(e);n.patchOnProperties=it,n.patchMethod=_e,n.bindArguments=Be,n.patchMacroTask=Ot;let u=c.__symbol__("BLACK_LISTED_EVENTS"),v=c.__symbol__("UNPATCHED_EVENTS");e[v]&&(e[u]=e[v]),e[u]&&(c[u]=c[v]=e[u]),n.patchEventPrototype=Lt,n.patchEventTarget=Zt,n.ObjectDefineProperty=Ae,n.ObjectGetOwnPropertyDescriptor=ve,n.ObjectCreate=bt,n.ArraySlice=Pt,n.patchClass=ke,n.wrapWithCurrentZone=Ge,n.filterProperties=ft,n.attachOriginToPatched=de,n._redefineProperty=Object.defineProperty,n.patchCallbacks=xt,n.getGlobalObjects=()=>({globalSources:at,zoneSymbolEventNames:oe,eventNames:a,isBrowser:ze,isMix:st,isNode:Ce,TRUE_STR:he,FALSE_STR:fe,ZONE_SYMBOL_PREFIX:be,ADD_EVENT_LISTENER_STR:Fe,REMOVE_EVENT_LISTENER_STR:Ve})})}function zt(t){Vt(t),Gt(t),Bt(t)}var _t=vt();zt(_t);Ft(_t);
@@ -1,3 +0,0 @@
1
- var wi=Object.create;var Wr=Object.defineProperty;var Di=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var Li=Object.getPrototypeOf,Ti=Object.prototype.hasOwnProperty;var u=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var qi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ri(t))!Ti.call(e,i)&&i!==r&&Wr(e,i,{get:()=>t[i],enumerable:!(n=Di(t,i))||n.enumerable});return e};var Br=(e,t,r)=>(r=e!=null?wi(Li(e)):{},qi(t||!e||!e.__esModule?Wr(r,"default",{value:e,enumerable:!0}):r,e));var x=u(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.timeConversion=p.sexagesimalPattern=p.longitudeKeys=p.latitudeKeys=p.earthRadius=p.distanceConversion=p.areaConversion=p.altitudeKeys=p.RAD_TO_DEG=p.MINLON=p.MINLAT=p.MAXLON=p.MAXLAT=p.DEG_TO_RAD=void 0;var Qu=p.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,el=p.earthRadius=6378137,tl=p.MINLAT=-90,rl=p.MAXLAT=90,nl=p.MINLON=-180,il=p.MAXLON=180,al=p.DEG_TO_RAD=Math.PI/180,ol=p.RAD_TO_DEG=180/Math.PI,sl=p.longitudeKeys=["lng","lon","longitude",0],ul=p.latitudeKeys=["lat","latitude",1],ll=p.altitudeKeys=["alt","altitude","elevation","elev",2],cl=p.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144},fl=p.timeConversion={m:60,h:3600,d:86400},I=p.areaConversion={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};I.sqm=I.m2;I.sqkm=I.km2;I.sqft=I.ft2;I.sqyd=I.yd2;I.sqin=I.in2});var fe=u(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.default=void 0;var Ki=(e,t)=>{if(e==null)throw new Error(`'${e}' is no valid coordinate.`);return t.reduce((r,n)=>Object.prototype.hasOwnProperty.call(e,n)&&n!==void 0&&r===void 0?(r=n,n):r,void 0)},ml=Ne.default=Ki});var de=u(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.default=void 0;var Wi=e=>{let t=e.toString().trim();return isNaN(parseFloat(t))?!1:parseFloat(t)===Number(t)},gl=je.default=Wi});var me=u(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.default=void 0;var Bi=x(),$i=e=>Bi.sexagesimalPattern.test(e.toString().trim()),bl=Fe.default=$i});var pe=u(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.default=void 0;var Gi=x(),Hi=e=>{let t=new RegExp(Gi.sexagesimalPattern).exec(e.toString().trim());if(t===null)throw new Error("Given value is not in sexagesimal format");let r=Number(t[2])/60||0,n=Number(t[4])/3600||0,i=parseFloat(t[1])+r+n;return["S","W"].includes(t[7])?-i:i},_l=Ue.default=Hi});var Ke=u(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.default=void 0;var tr=x(),rr=zi(fe());function zi(e){return e&&e.__esModule?e:{default:e}}var Xi=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{longitude:tr.longitudeKeys,latitude:tr.latitudeKeys,altitude:tr.altitudeKeys},r=(0,rr.default)(e,t.longitude),n=(0,rr.default)(e,t.latitude),i=(0,rr.default)(e,t.altitude);return{latitude:n,longitude:r,...i?{altitude:i}:{}}},xl=Ve.default=Xi});var ir=u(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.default=void 0;var Zi=nr(de()),Yi=nr(me()),Ji=nr(pe()),nn=x();function nr(e){return e&&e.__esModule?e:{default:e}}var an=e=>{if((0,Zi.default)(e)){let t=parseFloat(e);return!(t>nn.MAXLAT||t<nn.MINLAT)}return(0,Yi.default)(e)?an((0,Ji.default)(e)):!1},Pl=We.default=an});var or=u(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.default=void 0;var Qi=ar(de()),ea=ar(me()),ta=ar(pe()),on=x();function ar(e){return e&&e.__esModule?e:{default:e}}var sn=e=>{if((0,Qi.default)(e)){let t=parseFloat(e);return!(t>on.MAXLON||t<on.MINLON)}return(0,ea.default)(e)?sn((0,ta.default)(e)):!1},Ol=Be.default=sn});var ur=u($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.default=void 0;var ra=sr(Ke()),un=sr(ir()),ln=sr(or());function sr(e){return e&&e.__esModule?e:{default:e}}var na=e=>{let{latitude:t,longitude:r}=(0,ra.default)(e);if(Array.isArray(e)&&e.length>=2)return(0,ln.default)(e[0])&&(0,un.default)(e[1]);if(t===void 0||r===void 0)return!1;let n=e[r],i=e[t];return i===void 0||n===void 0?!1:(0,un.default)(i)&&(0,ln.default)(n)},wl=$e.default=na});var He=u(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=void 0;var ia=he(de()),aa=he(me()),oa=he(pe()),cn=he(ur()),sa=he(Ke());function he(e){return e&&e.__esModule?e:{default:e}}var ge=e=>{if((0,ia.default)(e))return Number(e);if((0,aa.default)(e))return(0,oa.default)(e);if((0,cn.default)(e)){let t=(0,sa.default)(e);return Array.isArray(e)?e.map((r,n)=>[0,1].includes(n)?ge(r):r):{...e,...t.latitude&&{[t.latitude]:ge(e[t.latitude])},...t.longitude&&{[t.longitude]:ge(e[t.longitude])}}}return Array.isArray(e)?e.map(t=>(0,cn.default)(t)?ge(t):t):e},Rl=Ge.default=ge});var R=u(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.default=void 0;var ua=x(),la=fn(fe()),ca=fn(He());function fn(e){return e&&e.__esModule?e:{default:e}}var fa=(e,t)=>{let r=(0,la.default)(e,ua.latitudeKeys);if(r==null)return;let n=e[r];return t===!0?n:(0,ca.default)(n)},Tl=ze.default=fa});var L=u(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.default=void 0;var da=x(),ma=dn(fe()),pa=dn(He());function dn(e){return e&&e.__esModule?e:{default:e}}var ga=(e,t)=>{let r=(0,ma.default)(e,da.longitudeKeys);if(r==null)return;let n=e[r];return t===!0?n:(0,pa.default)(n)},kl=Xe.default=ga});var N=u(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.default=void 0;var ha=x(),ba=e=>e*ha.DEG_TO_RAD,El=Ze.default=ba});var H=u(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=void 0;var ya=x(),_a=e=>e*ya.RAD_TO_DEG,Nl=Ye.default=_a});var pn=u(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=void 0;var va=Je(R()),xa=Je(L()),lr=Je(N()),cr=Je(H()),mn=x();function Je(e){return e&&e.__esModule?e:{default:e}}var Ma=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:6371e3,i=(0,va.default)(e),a=(0,xa.default)(e),o=t/n,s=(0,lr.default)(r),f=(0,lr.default)(i),v=(0,lr.default)(a),g=Math.asin(Math.sin(f)*Math.cos(o)+Math.cos(f)*Math.sin(o)*Math.cos(s)),h=v+Math.atan2(Math.sin(s)*Math.sin(o)*Math.cos(f),Math.cos(o)-Math.sin(f)*Math.sin(g)),m=(0,cr.default)(h);return(m<mn.MINLON||m>mn.MAXLON)&&(h=(h+3*Math.PI)%(2*Math.PI)-Math.PI,m=(0,cr.default)(h)),{latitude:(0,cr.default)(g),longitude:m}},Fl=Qe.default=Ma});var gn=u(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.default=void 0;var Pa=x(),Sa=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"m",r=Pa.areaConversion[t];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")},Vl=et.default=Sa});var hn=u(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.default=void 0;var Oa=x(),Aa=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"m",r=Oa.distanceConversion[t];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")},Wl=tt.default=Aa});var bn=u(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.default=void 0;var rt=x(),wa=function(e){switch(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"kmh"){case"kmh":return e*rt.timeConversion.h*rt.distanceConversion.km;case"mph":return e*rt.timeConversion.h*rt.distanceConversion.mi;default:return e}},$l=nt.default=wa});var yn=u(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var Da=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4,r=Math.pow(10,t);return Math.round(e*r)/r},Ra=e=>{let[t,r]=e.toString().split("."),n=Math.abs(Number(t)),i=+("0."+(r||0))*60,a=i.toString().split("."),o=Math.floor(i),s=Da(+("0."+(a[1]||0))*60).toString(),[f,v="0"]=s.split(".");return n+"\xB0 "+o.toString().padStart(2,"0")+"' "+f.padStart(2,"0")+"."+v.padEnd(1,"0")+'"'},Hl=it.default=Ra});var fr=u(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.default=void 0;var La=e=>e>1?1:e<-1?-1:e,Xl=at.default=La});var W=u(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.default=void 0;var _n=ot(R()),vn=ot(L()),dr=ot(N()),Ta=ot(fr()),qa=x();function ot(e){return e&&e.__esModule?e:{default:e}}var ka=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;r=isNaN(r)?1:r;let n=(0,dr.default)((0,_n.default)(e)),i=(0,dr.default)((0,_n.default)(t)),a=(0,dr.default)((0,vn.default)(e)-(0,vn.default)(t)),o=Math.acos((0,Ta.default)(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(a)))*qa.earthRadius;return Math.round(o/r)*r},Yl=st.default=ka});var mr=u(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var xn=Ca(W());function Ca(e){return e&&e.__esModule?e:{default:e}}var Ea=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xn.default;return r=typeof r=="function"?r:xn.default,t.slice().sort((n,i)=>r(e,n)-r(e,i))},Ql=ut.default=Ea});var Mn=u(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var Ia=Na(mr());function Na(e){return e&&e.__esModule?e:{default:e}}var ja=(e,t)=>(0,Ia.default)(e,t)[0],tc=lt.default=ja});var On=u(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.default=void 0;var pr=gr(N()),Fa=gr(R()),Pn=gr(L()),Sn=x();function gr(e){return e&&e.__esModule?e:{default:e}}var Ua=e=>{let t=0;if(e.length>2){let r,n,i;for(let a=0;a<e.length;a++){a===e.length-2?(r=e.length-2,n=e.length-1,i=0):a===e.length-1?(r=e.length-1,n=0,i=1):(r=a,n=a+1,i=a+2);let o=(0,Pn.default)(e[r]),s=(0,Fa.default)(e[n]),f=(0,Pn.default)(e[i]);t+=((0,pr.default)(f)-(0,pr.default)(o))*Math.sin((0,pr.default)(s))}t=t*Sn.earthRadius*Sn.earthRadius/2}return Math.abs(t)},nc=ct.default=Ua});var hr=u(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.default=void 0;var Va=An(R()),Ka=An(L());function An(e){return e&&e.__esModule?e:{default:e}}var Wa=e=>{if(Array.isArray(e)===!1||e.length===0)throw new Error("No points were given.");return e.reduce((t,r)=>{let n=(0,Va.default)(r),i=(0,Ka.default)(r);return{maxLat:Math.max(n,t.maxLat),minLat:Math.min(n,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}},{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})},ac=ft.default=Wa});var wn=u(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var Ba=mt(R()),$a=mt(L()),re=mt(N()),dt=mt(H()),be=x();function mt(e){return e&&e.__esModule?e:{default:e}}var Ga=(e,t)=>{let r=(0,Ba.default)(e),n=(0,$a.default)(e),i=(0,re.default)(r),a=(0,re.default)(n),o=t/be.earthRadius,s=i-o,f=i+o,v=(0,re.default)(be.MAXLAT),g=(0,re.default)(be.MINLAT),h=(0,re.default)(be.MAXLON),m=(0,re.default)(be.MINLON),P,y;if(s>g&&f<v){let w=Math.asin(Math.sin(o)/Math.cos(i));P=a-w,P<m&&(P+=Math.PI*2),y=a+w,y>h&&(y-=Math.PI*2)}else s=Math.max(s,g),f=Math.min(f,v),P=m,y=h;return[{latitude:(0,dt.default)(s),longitude:(0,dt.default)(P)},{latitude:(0,dt.default)(f),longitude:(0,dt.default)(y)}]},sc=pt.default=Ga});var Ln=u(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.default=void 0;var Ha=gt(R()),za=gt(L()),Dn=gt(N()),Rn=gt(H());function gt(e){return e&&e.__esModule?e:{default:e}}var Xa=e=>{if(Array.isArray(e)===!1||e.length===0)return!1;let t=e.length,r=e.reduce((o,s)=>{let f=(0,Dn.default)((0,Ha.default)(s)),v=(0,Dn.default)((0,za.default)(s));return{X:o.X+Math.cos(f)*Math.cos(v),Y:o.Y+Math.cos(f)*Math.sin(v),Z:o.Z+Math.sin(f)}},{X:0,Y:0,Z:0}),n=r.X/t,i=r.Y/t,a=r.Z/t;return{longitude:(0,Rn.default)(Math.atan2(i,n)),latitude:(0,Rn.default)(Math.atan2(a,Math.sqrt(n*n+i*i)))}},lc=ht.default=Xa});var Tn=u(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.default=void 0;var Za=Ya(hr());function Ya(e){return e&&e.__esModule?e:{default:e}}var Ja=e=>{let t=(0,Za.default)(e),r=t.minLat+(t.maxLat-t.minLat)/2,n=t.minLng+(t.maxLng-t.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(n.toFixed(6))}},fc=bt.default=Ja});var br=u(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.default=void 0;var qn=_t(R()),kn=_t(L()),yt=_t(N()),Qa=_t(H());function _t(e){return e&&e.__esModule?e:{default:e}}var eo=(e,t)=>{let r=(0,yt.default)((0,kn.default)(t))-(0,yt.default)((0,kn.default)(e)),n=Math.log(Math.tan((0,yt.default)((0,qn.default)(t))/2+Math.PI/4)/Math.tan((0,yt.default)((0,qn.default)(e))/2+Math.PI/4));return Math.abs(r)>Math.PI&&(r>0?r=(Math.PI*2-r)*-1:r=Math.PI*2+r),((0,Qa.default)(Math.atan2(r,n))+360)%360},mc=vt.default=eo});var En=u(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.default=void 0;var Cn=to(br());function to(e){return e&&e.__esModule?e:{default:e}}var ro=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Cn.default,n=typeof r=="function"?r(e,t):(0,Cn.default)(e,t);if(isNaN(n))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(n/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}},gc=xt.default=ro});var _r=u(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.default=void 0;var yr=Nn(W()),In=Nn(fr());function Nn(e){return e&&e.__esModule?e:{default:e}}var no=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,i=(0,yr.default)(t,e,n),a=(0,yr.default)(e,r,n),o=(0,yr.default)(t,r,n),s=Math.acos((0,In.default)((i*i+o*o-a*a)/(2*i*o))),f=Math.acos((0,In.default)((a*a+o*o-i*i)/(2*a*o)));return i===0||a===0?0:o===0||s>Math.PI/2?i:f>Math.PI/2?a:Math.sin(s)*i},bc=Mt.default=no});var Un=u(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.default=void 0;var jn=Pt(R()),Fn=Pt(L()),F=Pt(N()),io=Pt(H());function Pt(e){return e&&e.__esModule?e:{default:e}}var ao=(e,t)=>{let r=(0,jn.default)(t),n=(0,Fn.default)(t),i=(0,jn.default)(e),a=(0,Fn.default)(e);return((0,io.default)(Math.atan2(Math.sin((0,F.default)(n)-(0,F.default)(a))*Math.cos((0,F.default)(r)),Math.cos((0,F.default)(i))*Math.sin((0,F.default)(r))-Math.sin((0,F.default)(i))*Math.cos((0,F.default)(r))*Math.cos((0,F.default)(n)-(0,F.default)(a))))+360)%360},_c=St.default=ao});var Vn=u(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.default=void 0;var oo=so(W());function so(e){return e&&e.__esModule?e:{default:e}}var uo=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oo.default;return e.reduce((r,n)=>(typeof r=="object"&&r.last!==null&&(r.distance+=t(n,r.last)),r.last=n,r),{last:null,distance:0}).distance},xc=Ot.default=uo});var $n=u(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.default=void 0;var Kn=xr(R()),Wn=xr(L()),vr=xr(N()),Bn=x();function xr(e){return e&&e.__esModule?e:{default:e}}var lo=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;r=isNaN(r)?1:r;let n=(0,Kn.default)(e),i=(0,Wn.default)(e),a=(0,Kn.default)(t),o=(0,Wn.default)(t),s=6356752314245e-6,f=1/298.257223563,v=(0,vr.default)(o-i),g,h,m,P,y,w,Fr=Math.atan((1-f)*Math.tan((0,vr.default)(parseFloat(n)))),Ur=Math.atan((1-f)*Math.tan((0,vr.default)(parseFloat(a)))),Se=Math.sin(Fr),Oe=Math.cos(Fr),Ae=Math.sin(Ur),Z=Math.cos(Ur),ae=v,Vr,Kr=100;do{let Wt=Math.sin(ae),Bt=Math.cos(ae);if(w=Math.sqrt(Z*Wt*(Z*Wt)+(Oe*Ae-Se*Z*Bt)*(Oe*Ae-Se*Z*Bt)),w===0)return 0;g=Se*Ae+Oe*Z*Bt,h=Math.atan2(w,g),m=Oe*Z*Wt/w,P=1-m*m,y=g-2*Se*Ae/P,isNaN(y)&&(y=0);let $t=f/16*P*(4+f*(4-3*P));Vr=ae,ae=v+(1-$t)*f*m*(h+$t*w*(y+$t*g*(-1+2*y*y)))}while(Math.abs(ae-Vr)>1e-12&&--Kr>0);if(Kr===0)return NaN;let K=P*(Bn.earthRadius*Bn.earthRadius-s*s)/(s*s),Si=1+K/16384*(4096+K*(-768+K*(320-175*K))),Kt=K/1024*(256+K*(-128+K*(74-47*K))),Oi=Kt*w*(y+Kt/4*(g*(-1+2*y*y)-Kt/6*y*(-3+4*w*w)*(-3+4*y*y))),Ai=s*Si*(h-Oi);return Math.round(Ai/r)*r},Pc=At.default=lo});var Gn=u(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.default=void 0;var co=e=>{if(/^(NNE|NE|NNW|N)$/.test(e))return"N";if(/^(ENE|E|ESE|SE)$/.test(e))return"E";if(/^(SSE|S|SSW|SW)$/.test(e))return"S";if(/^(WSW|W|WNW|NW)$/.test(e))return"W"},Oc=wt.default=co});var Hn=u(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.default=void 0;var fo=mo(W());function mo(e){return e&&e.__esModule?e:{default:e}}var po=function(e,t){let n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo.default)(e,t),i=Number(t.time)-Number(e.time);return n/i*1e3},wc=Dt.default=po});var zn=u(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.default=void 0;var Mr=go(W());function go(e){return e&&e.__esModule?e:{default:e}}var ho=(e,t,r)=>(0,Mr.default)(t,e)+(0,Mr.default)(e,r)===(0,Mr.default)(t,r),Rc=Rt.default=ho});var Zn=u(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.default=void 0;var Lt=Xn(R()),T=Xn(L());function Xn(e){return e&&e.__esModule?e:{default:e}}var bo=(e,t)=>{let r=!1,n=t.length;for(let i=-1,a=n-1;++i<n;a=i)((0,T.default)(t[i])<=(0,T.default)(e)&&(0,T.default)(e)<(0,T.default)(t[a])||(0,T.default)(t[a])<=(0,T.default)(e)&&(0,T.default)(e)<(0,T.default)(t[i]))&&(0,Lt.default)(e)<((0,Lt.default)(t[a])-(0,Lt.default)(t[i]))*((0,T.default)(e)-(0,T.default)(t[i]))/((0,T.default)(t[a])-(0,T.default)(t[i]))+(0,Lt.default)(t[i])&&(r=!r);return r},Tc=Tt.default=bo});var Yn=u(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.default=void 0;var yo=_o(_r());function _o(e){return e&&e.__esModule?e:{default:e}}var vo=(e,t,r,n)=>(0,yo.default)(e,t,r)<n,kc=qt.default=vo});var Jn=u(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.default=void 0;var xo=Mo(W());function Mo(e){return e&&e.__esModule?e:{default:e}}var Po=(e,t,r)=>(0,xo.default)(e,t,.01)<r,Ec=kt.default=Po});var Qn=u(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=void 0;var So=e=>{if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map(n=>{let[i,a]=n.split(" ");return{longitude:parseFloat(i),latitude:parseFloat(a)}})},Nc=Ct.default=So});var ei=u(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var Oo={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(l,"computeDestinationPoint",{enumerable:!0,get:function(){return Ao.default}});Object.defineProperty(l,"convertArea",{enumerable:!0,get:function(){return wo.default}});Object.defineProperty(l,"convertDistance",{enumerable:!0,get:function(){return Do.default}});Object.defineProperty(l,"convertSpeed",{enumerable:!0,get:function(){return Ro.default}});Object.defineProperty(l,"decimalToSexagesimal",{enumerable:!0,get:function(){return Lo.default}});Object.defineProperty(l,"findNearest",{enumerable:!0,get:function(){return To.default}});Object.defineProperty(l,"getAreaOfPolygon",{enumerable:!0,get:function(){return qo.default}});Object.defineProperty(l,"getBounds",{enumerable:!0,get:function(){return ko.default}});Object.defineProperty(l,"getBoundsOfDistance",{enumerable:!0,get:function(){return Co.default}});Object.defineProperty(l,"getCenter",{enumerable:!0,get:function(){return Eo.default}});Object.defineProperty(l,"getCenterOfBounds",{enumerable:!0,get:function(){return Io.default}});Object.defineProperty(l,"getCompassDirection",{enumerable:!0,get:function(){return No.default}});Object.defineProperty(l,"getCoordinateKey",{enumerable:!0,get:function(){return jo.default}});Object.defineProperty(l,"getCoordinateKeys",{enumerable:!0,get:function(){return Fo.default}});Object.defineProperty(l,"getDistance",{enumerable:!0,get:function(){return Uo.default}});Object.defineProperty(l,"getDistanceFromLine",{enumerable:!0,get:function(){return Vo.default}});Object.defineProperty(l,"getGreatCircleBearing",{enumerable:!0,get:function(){return Ko.default}});Object.defineProperty(l,"getLatitude",{enumerable:!0,get:function(){return Wo.default}});Object.defineProperty(l,"getLongitude",{enumerable:!0,get:function(){return Bo.default}});Object.defineProperty(l,"getPathLength",{enumerable:!0,get:function(){return $o.default}});Object.defineProperty(l,"getPreciseDistance",{enumerable:!0,get:function(){return Go.default}});Object.defineProperty(l,"getRhumbLineBearing",{enumerable:!0,get:function(){return Ho.default}});Object.defineProperty(l,"getRoughCompassDirection",{enumerable:!0,get:function(){return zo.default}});Object.defineProperty(l,"getSpeed",{enumerable:!0,get:function(){return Xo.default}});Object.defineProperty(l,"isDecimal",{enumerable:!0,get:function(){return Zo.default}});Object.defineProperty(l,"isPointInLine",{enumerable:!0,get:function(){return Yo.default}});Object.defineProperty(l,"isPointInPolygon",{enumerable:!0,get:function(){return Jo.default}});Object.defineProperty(l,"isPointNearLine",{enumerable:!0,get:function(){return Qo.default}});Object.defineProperty(l,"isPointWithinRadius",{enumerable:!0,get:function(){return es.default}});Object.defineProperty(l,"isSexagesimal",{enumerable:!0,get:function(){return ts.default}});Object.defineProperty(l,"isValidCoordinate",{enumerable:!0,get:function(){return rs.default}});Object.defineProperty(l,"isValidLatitude",{enumerable:!0,get:function(){return ns.default}});Object.defineProperty(l,"isValidLongitude",{enumerable:!0,get:function(){return is.default}});Object.defineProperty(l,"orderByDistance",{enumerable:!0,get:function(){return as.default}});Object.defineProperty(l,"sexagesimalToDecimal",{enumerable:!0,get:function(){return os.default}});Object.defineProperty(l,"toDecimal",{enumerable:!0,get:function(){return ss.default}});Object.defineProperty(l,"toDeg",{enumerable:!0,get:function(){return ls.default}});Object.defineProperty(l,"toRad",{enumerable:!0,get:function(){return us.default}});Object.defineProperty(l,"wktToPolygon",{enumerable:!0,get:function(){return cs.default}});var Ao=d(pn()),wo=d(gn()),Do=d(hn()),Ro=d(bn()),Lo=d(yn()),To=d(Mn()),qo=d(On()),ko=d(hr()),Co=d(wn()),Eo=d(Ln()),Io=d(Tn()),No=d(En()),jo=d(fe()),Fo=d(Ke()),Uo=d(W()),Vo=d(_r()),Ko=d(Un()),Wo=d(R()),Bo=d(L()),$o=d(Vn()),Go=d($n()),Ho=d(br()),zo=d(Gn()),Xo=d(Hn()),Zo=d(de()),Yo=d(zn()),Jo=d(Zn()),Qo=d(Yn()),es=d(Jn()),ts=d(me()),rs=d(ur()),ns=d(ir()),is=d(or()),as=d(mr()),os=d(pe()),ss=d(He()),us=d(N()),ls=d(H()),cs=d(Qn()),Pr=x();Object.keys(Pr).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(Oo,e)||e in l&&l[e]===Pr[e]||Object.defineProperty(l,e,{enumerable:!0,get:function(){return Pr[e]}})});function d(e){return e&&e.__esModule?e:{default:e}}});var ti=u(wr=>{"use strict";wr.__esModule=!0;function Or(e,t){return e*e+t*t}function fs(e,t){return Or(e[0]-t[0],e[1]-t[1])}function ds(e,t,r){var n=t[0],i=t[1],a=r[0]-n,o=r[1]-i;if(a!==0||o!==0){var s=((e[0]-n)*a+(e[1]-i)*o)/Or(a,o);s>1?(n=r[0],i=r[1]):s>0&&(n+=a*s,i+=o*s)}return Or(e[0]-n,e[1]-i)}function ms(e,t){for(var r=e[0],n,i=[r],a=1,o=e.length;a<o;a++)n=e[a],fs(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Ar(e,t,r,n,i){for(var a=n,o,s=t+1;s<r;s++){var f=ds(e[s],e[t],e[r]);f>a&&(o=s,a=f)}a>n&&(o-t>1&&Ar(e,t,o,n,i),i.push(e[o]),r-o>1&&Ar(e,o,r,n,i))}function ps(e,t){var r=e.length-1,n=[e[0]];return Ar(e,0,r,t,n),n.push(e[r]),n}function gs(e,t,r){if(t===void 0&&(t=1),r===void 0&&(r=!1),e.length<=2)return e;var n=t*t;return e=r?e:ms(e,n),e=ps(e,n),e}wr.SimplifyAP=gs});var ri=u(Lr=>{"use strict";Lr.__esModule=!0;function Dr(e,t){return e*e+t*t}function hs(e,t){return Dr(e.longitude-t.longitude,e.latitude-t.latitude)}function bs(e,t,r){var n=t.longitude,i=t.latitude,a=r.longitude-n,o=r.latitude-i;if(a!==0||o!==0){var s=((e.longitude-n)*a+(e.latitude-i)*o)/Dr(a,o);s>1?(n=r.longitude,i=r.latitude):s>0&&(n+=a*s,i+=o*s)}return Dr(e.longitude-n,e.latitude-i)}function ys(e,t){for(var r=e[0],n,i=[r],a=1,o=e.length;a<o;a++)n=e[a],hs(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Rr(e,t,r,n,i){for(var a=n,o,s=t+1;s<r;s++){var f=bs(e[s],e[t],e[r]);f>a&&(o=s,a=f)}a>n&&(o-t>1&&Rr(e,t,o,n,i),i.push(e[o]),r-o>1&&Rr(e,o,r,n,i))}function _s(e,t){var r=e.length-1,n=[e[0]];return Rr(e,0,r,t,n),n.push(e[r]),n}function vs(e,t,r){if(t===void 0&&(t=1),r===void 0&&(r=!1),e.length<=2)return e;var n=t*t;return e=r?e:ys(e,n),e=_s(e,n),e}Lr.SimplifyLL=vs});var ni=u(kr=>{"use strict";kr.__esModule=!0;function Tr(e,t){return e*e+t*t}function xs(e,t){return Tr(e.x-t.x,e.y-t.y)}function Ms(e,t,r){var n=t.x,i=t.y,a=r.x-n,o=r.y-i;if(a!==0||o!==0){var s=((e.x-n)*a+(e.y-i)*o)/Tr(a,o);s>1?(n=r.x,i=r.y):s>0&&(n+=a*s,i+=o*s)}return Tr(e.x-n,e.y-i)}function Ps(e,t){for(var r=e[0],n,i=[r],a=1,o=e.length;a<o;a++)n=e[a],xs(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function qr(e,t,r,n,i){for(var a=n,o,s=t+1;s<r;s++){var f=Ms(e[s],e[t],e[r]);f>a&&(o=s,a=f)}a>n&&(o-t>1&&qr(e,t,o,n,i),i.push(e[o]),r-o>1&&qr(e,o,r,n,i))}function Ss(e,t){var r=e.length-1,n=[e[0]];return qr(e,0,r,t,n),n.push(e[r]),n}function Os(e,t,r){if(t===void 0&&(t=1),r===void 0&&(r=!1),e.length<=2)return e;var n=t*t;return e=r?e:Ps(e,n),e=Ss(e,n),e}kr.Simplify=Os});var ii=u(ye=>{"use strict";ye.__esModule=!0;var As=ti();ye.SimplifyAP=As.SimplifyAP;var ws=ri();ye.SimplifyLL=ws.SimplifyLL;var Ds=ni();ye.Simplify=Ds.Simplify});function D(e){return typeof e=="function"}function we(e){let r=e(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var De=we(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:
2
- ${r.map((n,i)=>`${i+1}) ${n.toString()}`).join(`
3
- `)}`:"",this.name="UnsubscriptionError",this.errors=r});function oe(e,t){if(e){let r=e.indexOf(t);0<=r&&e.splice(r,1)}}var C=class e{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let a of r)a.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(D(n))try{n()}catch(a){t=a instanceof De?a.errors:[a]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let a of i)try{$r(a)}catch(o){t=t??[],o instanceof De?t=[...t,...o.errors]:t.push(o)}}if(t)throw new De(t)}}add(t){var r;if(t&&t!==this)if(this.closed)$r(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}}_hasParent(t){let{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){let{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&oe(r,t)}remove(t){let{_finalizers:r}=this;r&&oe(r,t),t instanceof e&&t._removeParent(this)}};C.EMPTY=(()=>{let e=new C;return e.closed=!0,e})();var Gt=C.EMPTY;function Re(e){return e instanceof C||e&&"closed"in e&&D(e.remove)&&D(e.add)&&D(e.unsubscribe)}function $r(e){D(e)?e():e.unsubscribe()}var q={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Y={setTimeout(e,t,...r){let{delegate:n}=Y;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){let{delegate:t}=Y;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Gr(e){Y.setTimeout(()=>{let{onUnhandledError:t}=q;if(t)t(e);else throw e})}function Ht(){}var Hr=zt("C",void 0,void 0);function zr(e){return zt("E",void 0,e)}function Xr(e){return zt("N",e,void 0)}function zt(e,t,r){return{kind:e,value:t,error:r}}var B=null;function J(e){if(q.useDeprecatedSynchronousErrorHandling){let t=!B;if(t&&(B={errorThrown:!1,error:null}),e(),t){let{errorThrown:r,error:n}=B;if(B=null,r)throw n}}else e()}function Zr(e){q.useDeprecatedSynchronousErrorHandling&&B&&(B.errorThrown=!0,B.error=e)}var se=class extends C{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Re(t)&&t.add(this)):this.destination=Ei}static create(t,r,n){return new Q(t,r,n)}next(t){this.isStopped?Zt(Xr(t),this):this._next(t)}error(t){this.isStopped?Zt(zr(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Zt(Hr,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},ki=Function.prototype.bind;function Xt(e,t){return ki.call(e,t)}var Yt=class{constructor(t){this.partialObserver=t}next(t){let{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(n){Le(n)}}error(t){let{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(n){Le(n)}else Le(t)}complete(){let{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){Le(r)}}},Q=class extends se{constructor(t,r,n){super();let i;if(D(t)||!t)i={next:t??void 0,error:r??void 0,complete:n??void 0};else{let a;this&&q.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&Xt(t.next,a),error:t.error&&Xt(t.error,a),complete:t.complete&&Xt(t.complete,a)}):i=t}this.destination=new Yt(i)}};function Le(e){q.useDeprecatedSynchronousErrorHandling?Zr(e):Gr(e)}function Ci(e){throw e}function Zt(e,t){let{onStoppedNotification:r}=q;r&&Y.setTimeout(()=>r(e,t))}var Ei={closed:!0,next:Ht,error:Ci,complete:Ht};var Yr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Jr(e){return e}function Qr(e){return e.length===0?Jr:e.length===1?e[0]:function(r){return e.reduce((n,i)=>i(n),r)}}var $=class e{constructor(t){t&&(this._subscribe=t)}lift(t){let r=new e;return r.source=this,r.operator=t,r}subscribe(t,r,n){let i=Ni(t)?t:new Q(t,r,n);return J(()=>{let{operator:a,source:o}=this;i.add(a?a.call(i,o):o?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(t){try{return this._subscribe(t)}catch(r){t.error(r)}}forEach(t,r){return r=en(r),new r((n,i)=>{let a=new Q({next:o=>{try{t(o)}catch(s){i(s),a.unsubscribe()}},error:i,complete:n});this.subscribe(a)})}_subscribe(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)}[Yr](){return this}pipe(...t){return Qr(t)(this)}toPromise(t){return t=en(t),new t((r,n)=>{let i;this.subscribe(a=>i=a,a=>n(a),()=>r(i))})}};$.create=e=>new $(e);function en(e){var t;return(t=e??q.Promise)!==null&&t!==void 0?t:Promise}function Ii(e){return e&&D(e.next)&&D(e.error)&&D(e.complete)}function Ni(e){return e&&e instanceof se||Ii(e)&&Re(e)}var tn=we(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var E=class extends ${constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let r=new Te(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new tn}next(t){J(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(t)}})}error(t){J(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;let{observers:r}=this;for(;r.length;)r.shift().error(t)}})}complete(){J(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){let{hasError:r,isStopped:n,observers:i}=this;return r||n?Gt:(this.currentObservers=null,i.push(t),new C(()=>{this.currentObservers=null,oe(i,t)}))}_checkFinalizedStatuses(t){let{hasError:r,thrownError:n,isStopped:i}=this;r?t.error(n):i&&t.complete()}asObservable(){let t=new $;return t.source=this,t}};E.create=(e,t)=>new Te(e,t);var Te=class extends E{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,t)}error(t){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,t)}complete(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)}_subscribe(t){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&n!==void 0?n:Gt}};var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function rn(e,t=0){return(S[e[t+0]]+S[e[t+1]]+S[e[t+2]]+S[e[t+3]]+"-"+S[e[t+4]]+S[e[t+5]]+"-"+S[e[t+6]]+S[e[t+7]]+"-"+S[e[t+8]]+S[e[t+9]]+"-"+S[e[t+10]]+S[e[t+11]]+S[e[t+12]]+S[e[t+13]]+S[e[t+14]]+S[e[t+15]]).toLowerCase()}var ji=new Uint8Array(16);function Jt(){return crypto.getRandomValues(ji)}function Fi(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():Ui(e,t,r)}function Ui(e,t,r){e=e||{};let n=e.random??e.rng?.()??Jt();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return rn(n)}var Qt=Fi;var qe=class{_connect;_close;_error;_message;ws;_filter="";_wsTimeout=2e4;_token="";_playbackMode=!1;onConnect;onClose;onError;onMessage;version=1;endpoint="";selfId="";_source=null;set source(t){this._source||(this._source={}),this._source.label=t}set authToken(t){this._token=t}get connectionTimeout(){return this._wsTimeout}set connectionTimeout(t){this._wsTimeout=t<3e3?3e3:t>6e4?6e4:t}get isOpen(){return!!(this.ws&&this.ws.readyState!=1&&this.ws.readyState!=3)}get filter(){return this._filter}set filter(t){t&&t.indexOf("self")!=-1?this._filter=this.selfId?this.selfId:"":this._filter=t}get playbackMode(){return this._playbackMode}constructor(){this._connect=new E,this.onConnect=this._connect.asObservable(),this._close=new E,this.onClose=this._close.asObservable(),this._error=new E,this.onError=this._error.asObservable(),this._message=new E,this.onMessage=this._message.asObservable()}close(){this.ws&&(this.ws.close(),this.ws=null)}open(t,r,n){if(t=t||this.endpoint,!t)return;let i=t.indexOf("?")==-1?"?":"&";r&&(t+=`${i}subscribe=${r}`),(this._token||n)&&(t+=`${r?"&":"?"}token=${this._token||n}`),this.close(),this.ws=new WebSocket(t),setTimeout(()=>{this.ws&&this.ws.readyState!=1&&this.ws.readyState!=3&&(console.warn(`Connection watchdog expired (${this._wsTimeout/1e3} sec): ${this.ws.readyState}... aborting connection...`),this.close())},this._wsTimeout),this.ws.onopen=a=>{this._connect.next(a)},this.ws.onclose=a=>{this._close.next(a)},this.ws.onerror=a=>{this._error.next(a)},this.ws.onmessage=a=>{this.parseOnMessage(a)}}parseOnMessage(t){let r;if(typeof t.data=="string")try{r=JSON.parse(t.data)}catch{return}this.isHello(r)?(this.selfId=r.self,this._playbackMode=typeof r.startTime<"u",this._message.next(r)):this.isResponse(r)?(typeof r.login<"u"&&typeof r.login.token<"u"&&(this._token=r.login.token),this._message.next(r)):this._filter&&this.isDelta(r)?r.context==this._filter&&this._message.next(r):this._message.next(r)}sendRequest(t){if(typeof t!="object")return"";let r=ee.request();return typeof t.login>"u"&&this._token&&(r.token=this._token),Object.keys(t).forEach(i=>{r[i]=t[i]}),this.send(r),r.requestId}put(t,r,n){let i={context:t=="self"?"vessels.self":t,put:{path:r,value:n}};return this.sendRequest(i)}login(t,r){let n={login:{username:t,password:r}};return this.sendRequest(n)}send(t){this.ws&&(typeof t=="object"&&(t=JSON.stringify(t)),this.ws.send(t))}sendUpdate(t="self",r,n){let i=ee.updates();this._token&&(i.token=this._token),i.context=t=="self"?"vessels.self":t,this._token&&(i.token=this._token);let a=[];typeof r=="string"&&a.push({path:r,value:n}),typeof r=="object"&&Array.isArray(r)&&(a=r);let o={timestamp:new Date().toISOString(),values:a};this._source&&(o.source=this._source),i.updates.push(o),this.send(i)}subscribe(t="*",r="*",n){let i=ee.subscribe();if(this._token&&(i.token=this._token),i.context=t=="self"?"vessels.self":t,this._token&&(i.token=this._token),typeof r=="object"&&Array.isArray(r)&&(i.subscribe=r),typeof r=="string"){let a={};a.path=r,n&&typeof n=="object"&&(n.period&&(a.period=n.period),n.minPeriod&&(a.minPeriod=n.period),n.format&&(n.format=="delta"||n.format=="full")&&(a.format=n.format),n.policy&&(n.policy=="instant"||n.policy=="ideal"||n.policy=="fixed")&&(a.policy=n.policy)),i.subscribe.push(a)}this.send(i)}unsubscribe(t="*",r="*"){let n=ee.unsubscribe();this._token&&(n.token=this._token),n.context=t=="self"?"vessels.self":t,this._token&&(n.token=this._token),typeof r=="object"&&Array.isArray(r)&&(n.unsubscribe=r),typeof r=="string"&&n.unsubscribe.push({path:r}),this.send(n)}raiseAlarm(t="*",r,n){let i;typeof r=="string"?i=r.indexOf("notifications.")==-1?`notifications.${r}`:r:i=r,this.put(t,i,n.value)}clearAlarm(t="*",r){let n=r.indexOf("notifications.")==-1?`notifications.${r}`:r;this.put(t,n,null)}isSelf(t){return t.context==this.selfId}isDelta(t){return typeof t.context<"u"}isHello(t){return typeof t.version<"u"&&typeof t.self<"u"}isResponse(t){return typeof t.requestId<"u"}},ee=class{static updates(){return{context:null,updates:[]}}static subscribe(){return{context:null,subscribe:[]}}static unsubscribe(){return{context:null,unsubscribe:[]}}static request(){return{requestId:Qt()}}},ke=class{_state;_method=[];_message="";constructor(t,r,n,i){this._message=typeof t<"u"?t:"",this._state=typeof r<"u"?r:"alarm",n&&this._method.push("visual"),i&&this._method.push("sound")}get value(){return{message:this._message,state:this._state,method:this._method}}};var te=class{id;name;mmsi;position=[0,0];positionReceived=!1;positionTimestamp="";positionUpdatedAt=0;state;type={id:-1,name:""};properties={};lastUpdated=new Date;callsignVhf;callsignHf;orientation=0;virtual},ue=class extends te{anchor={maxRadius:null,radius:null,position:null};autopilot={state:null,mode:null,target:null,enabled:!1,default:null,availableActions:[]};buddy=!1;closestApproach={distance:null,timeTo:null};cog;cogTrue=null;cogMagnetic=null;courseApi={arrivalCircle:0,activeRoute:{},nextPoint:{},previousPoint:{}};courseCalcs={};distanceToSelf;environment={mode:null,sun:null};heading;headingTrue=null;headingMagnetic=null;headingTrueUpdatedAt=0;headingMagneticUpdatedAt=0;performance={beatAngle:null,gybeAngle:null};racing;radars={};registrations={};resourceUpdates=[];sog;track=[];vectors={cog:[]};wind={direction:null,mwd:null,twd:null,tws:null,speedTrue:null,sog:null,awa:null,aws:null};design={airHeight:null,beam:null,draft:{current:null,maximum:null},length:null};destination={name:null,eta:null};flag;port},Ce=class extends te{constructor(){super()}},Ee=class extends te{sog=0;track=[];constructor(){super()}},le=class extends te{constructor(){super()}},Ie=class extends le{twd;tws;temperature;constructor(){super()}};var er={K:{C:e=>e-273.15,F:e=>(e-273.15)*9/5+32},rad:{degree:e=>e*180/Math.PI},deg:{radian:e=>e*.0174532925199433},ratio:{percent:e=>e*100},"m/s":{kn:e=>e*1.94384,"km/h":e=>e*3.6,mph:e=>e*2.2369362920544025,Bf:e=>e/.836^.6666666666666666,fps:e=>e*3.280839895013124},"rad/s":{"deg/s":e=>e*57.2958,rpm:e=>e*9.549296585513723},Hz:{rpm:e=>e*60},m:{fathom:e=>e*.5467468562055768,league:e=>e*.0002071251035625518,kilometer:e=>e*.001,mile:e=>e*.000621371192237334,"naut-mile":e=>e*.0005399568034557236,foot:e=>e*3.280839895013124,yard:e=>e*1.0936132983377078},s:{hour:e=>e*.0002777777777777778,minute:e=>e*.016666666666666666,day:e=>e*11574074074074073e-21,year:e=>e*3168876461541279e-23},foot:{m:e=>e/3.280839895013124}},ce={degree:{symbol:"\xBA",name:"Degrees"},radian:{symbol:"rad",name:"Radians"},percent:{symbol:"%",name:"Percent"},kilometer:{symbol:"km",name:"Kilometer"},"naut-mile":{symbol:"nmi",name:"Nautical Mile"},foot:{symbol:"ft",name:"Feet"},yard:{symbol:"yd",name:"Yard"},fathom:{symbol:"fm",name:"Fathom"},hour:{symbol:"hr",name:"Hour"},minute:{symbol:"min",name:"Minute"},F:{symbol:"\xBAF",name:"Fahrenheit"},C:{symbol:"\xBAC",name:"Celcius"}},G=class{static transform(t,r,n){if(!Number.isFinite(t))return null;if(r===n)return t;try{return er[r][n](t)}catch{throw new Error("Transformation not found!")}}static setSymbol(t,r){t in ce&&(ce[t].symbol=r??ce[t].symbol)}static getSymbol(t){return t in ce?ce[t].symbol:t}static degreesToRadians(t){return er.deg.radian(t)}static radiansToDegrees(t=0){return er.rad.degree(t)}static nauticalMilesToKm(t=0){return t*1.852}static angleToDirection(t,r){let n=Math.PI*2;if(r||(r=0),t||(t=0),!Number.isFinite(r)||!Number.isFinite(t))return null;let i=r+t;return i>n?i-n:i<0?n+i:i}static directionToAngle(t,r){let n=Math.PI*2;if(r||(r=0),t||(t=0),!Number.isFinite(r)||!Number.isFinite(t))return null;let i=r-t,a;if(i>0)a=i>Math.PI?n-i:0-i;else if(i<0){let o=Math.abs(i);a=o>Math.PI?o-n:o}else a=i;return a}};var A=Br(ei()),j=class e{static R=6371e3;static rhumbDestination(t,r,n){let i=e.R,a=n/i,o=t[1]*Math.PI/180,s=t[0]*Math.PI/180,f=r,v=a*Math.cos(f),g=o+v,h=a,m=89*Math.PI/180;g>m&&o<m?(h=a*(m-o)/v,g=m):g<-m&&o>-m&&(h=a*(-m-o)/v,g=-m);let P=Math.log(Math.tan(Math.PI/4+g/2)/Math.tan(Math.PI/4+o/2)),y=Math.abs(P)>1e-12?(g-o)/P:Math.cos(o),w=h*Math.sin(f)/y;return[(s+w)*180/Math.PI,g*180/Math.PI]}static destCoordinate(t,r,n){let i=(0,A.computeDestinationPoint)(t,n,G.radiansToDegrees(r));return[i.longitude,i.latitude]}static distanceTo(t,r){return(0,A.getDistance)(t,r)}static routeLength(t){return(0,A.getPathLength)(t)}static routeLegs(t,r){if(t.length<2)return[];let n=[];r?n.push({bearing:(0,A.getGreatCircleBearing)(r,t[0]),distance:e.distanceTo(r,t[0])}):n.push({bearing:0,distance:0});for(let i=1;i<t.length;++i){let a={bearing:(0,A.getGreatCircleBearing)(t[i-1],t[i]),distance:e.distanceTo(t[i-1],t[i])};n.push(a)}return n}static closestForwardPoint(t,r,n){if(t.length<2||!r)return-1;let i={index:-1,distance:-1};for(let a=0;a<t.length;++a){let o=(0,A.getGreatCircleBearing)(r,t[a]),s=Sr.difference(n,o);if(s>-90&&s<90){let f=e.distanceTo(r,t[a]);(i.distance===-1||f<i.distance)&&(i.distance=f,i.index=a)}}return i.index}static centreOfPolygon(t){let r=(0,A.getCenter)(t);return[r.longitude,r.latitude]}static inDLCrossingZone(t,r=170){return Math.abs(t[0])>=r}static inBounds(t,r){return(0,A.isPointInPolygon)(t,[[r[0],r[1]],[r[0],r[3]],[r[2],r[3]],[r[2],r[1]],[r[0],r[1]]])}static calcMapifiedExtent(t,r){let i=111111*Math.cos(G.degreesToRadians(t[1])),a=[0,0,0,0];return a[1]=t[1]+(0-Math.abs(r))/111111,a[3]=t[1]+Math.abs(r)/111111,a[0]=t[0]+(0-Math.abs(r))/i,a[2]=t[0]+Math.abs(r)/i,a}static normaliseCoords(t){if(!Array.isArray(t))return[0,0];if(typeof t[0]=="number"){if(t[0]>180)for(;t[0]>180;)t[0]=t[0]-360;else if(t[0]<-180)for(;t[0]<-180;)t[0]=360+t[0];return t}else if(Array.isArray(t[0]))return t.forEach(r=>this.normaliseCoords(r)),t}},Sr=class e{static difference(t,r){let n=360-r,i=t+n,a=e.normalise(i);return a<180?0-a:360-a}static add(t,r){return e.normalise(t+r)}static normalise(t){return t<0?t+360:t>=360?t-360:t}};var Et=class{action="notification";playback=!1;result=null;self=null;timestamp=new Date().toISOString();sourceRef},z=class{action;playback=!1;result=null;timestamp;self=null;watchDogAlarm;constructor(){this.action="update"}},It=class extends z{constructor(){super(),this.action="resource"}},Nt=class extends z{constructor(){super(),this.action="radar"}},jt=class extends z{constructor(){super(),this.action="trail"}};var mi=Br(ii());var oi="auto",ai=1e4,Rs=.2572,si=new Set(["navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.speedOverGround"]);function ui(e){let t=Date.now();if(e.headingTrue!==null&&t-e.headingTrueUpdatedAt<=ai){e.orientation=e.headingTrue;return}if(e.headingMagnetic!==null&&t-e.headingMagneticUpdatedAt<=ai){e.orientation=e.headingMagnetic;return}let r=e.cogTrue??e.cogMagnetic;typeof r=="number"&&(e.sog??0)>=Rs&&(e.orientation=r)}var Ls=["environment.wind.speedTrue","environment.wind.speedOverGround","environment.wind.angleTrueGround","environment.wind.angleTrueWater","environment.wind.directionTrue","environment.wind.directionMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.headingTrue","navigation.headingMagnetic"],b={active:!1,maxMsgIntervals:18,intervalCount:0,msgCount:0,alarm:!1},c,M,pi,Me=[],Ut=[],Cr=!1,Nr,Er=!1,_={signalk:{},aisState:[]},gi=[0,0,0,0],hi=60,_e=0,O,ie={},X=500,k=!1,bi,U={maxAge:54e4,staleAge:36e4,lastTick:new Date().valueOf(),maxTrack:20},Ir={selfLines:{cog:{length:10}},aisCogLine:10},ve={trailDuration:24,trailResolution:{lastHour:"5s",next23:"10s",beyond24:"1m"}},V,yi,ne="freeboard-sk";function Ts(){c={self:new ue,aisTargets:new Map,aisStatus:{updated:[],stale:[],expired:[]},paths:{},atons:new Map,aircraft:new Map,sar:new Map,meteo:new Map},c.self.positionReceived=!1,_i()}function _i(){O={updated:{},stale:{},expired:{}}}function Ft({action:e,msg:t}){switch(e){case"onConnect":postMessage({action:"open",playback:k,result:t.target.readyState}),b.msgCount=0,b.intervalCount=0,b.alarm=!1,b.active=!0;break;case"onClose":vi(!1),li();break;case"onError":postMessage({action:"error",playback:k,result:"Connection error!"}),li();break;case"onMessage":b.msgCount++,Is(t);break}}function li(){b.msgCount=0,b.intervalCount=0,b.active=!0,b.alarm=!0,Vt(!0)}addEventListener("message",({data:e})=>{qs(e)});function qs(e){if(e.cmd)switch(e.cmd){case"open":ci(e.options),Cs(e.options);break;case"close":vi(!0);break;case"subscribe":M.subscribe(e.options.context,e.options.path);break;case"settings":ci(e.options);break;case"alarm":Es(e.options);break;case"vessel":if(e.options){let t;e.options.context==="self"?t=c.self:t=c.aisTargets.get(e.options.context),t&&e.options.name&&(t.name=e.options.name)}break;case"auth":e.options&&typeof e.options.token<"u"&&(pi=e.options.token);break;case"trail":e.options&&(ve.trailDuration=e.options.trailDuration??24,e.options.trailResolution&&(ve.trailResolution.lastHour=e.options.trailResolution.lastHour??"5s",ve.trailResolution.next23=e.options.trailResolution.next23??"1m",ve.trailResolution.beyond24=e.options.trailResolution.beyond24??"5m")),ks(ve);break}}function ci(e={config:{}}){e.interval&&typeof e.interval=="number"&&(X=e.interval,Pi(),Mi(),hi=1/(X/1e3)*60),k=!!e.playback,e.config&&(typeof e.config.units.preferredPaths<"u"&&(ie=e.config.units.preferredPaths),e.config.vessels.aisMaxAge&&typeof e.config.vessels.aisMaxAge=="number"&&(U.maxAge=e.config.vessels.aisMaxAge),e.config.vessels.aisStaleAge&&typeof e.config.vessels.aisStaleAge=="number"&&(U.staleAge=e.config.vessels.aisStaleAge),typeof e.config.signalk.maxRadius=="number"&&(_.signalk=e.config.signalk),typeof e.config.selections.aisState<"u"&&Array.isArray(e.config.selections.aisState)&&(_.aisState=e.config.selections.aisState),Ir=e.config.vessels)}function vi(e=!1){Pi(),Me.forEach(t=>t.unsubscribe()),M&&e&&M.close(),M=null,postMessage({action:"close",result:e,playback:k})}function Pe(e){return fetch(e).then(t=>t.json())}function xi(){let e=_&&_.signalk&&_.signalk.maxRadius?`?radius=${_.signalk.maxRadius}`:"?radius=10000";Pe(Nr+"/tracks"+e).then(t=>{Er=!0,Object.entries(t).forEach(r=>{if(c.aisTargets.has(r[0])){let n=c.aisTargets.get(r[0]);n.track=r[1].coordinates,jr(n)}})}).catch(()=>{Er=!1})}function ks(e){let t=Nr+"/self/track?",r=[],n=5e-4,i=!0;e.trailDuration>24&&(r.push(Pe(`${t}timespan=${e.trailDuration-24}h&resolution=${e.trailResolution.beyond24}&timespanOffset=24`)),r.push(Pe(`${t}timespan=23h&resolution=${e.trailResolution.next23}&timespanOffset=1`))),e.trailDuration>1&&e.trailDuration<25&&r.push(Pe(`${t}timespan=${e.trailDuration-1}h&resolution=${e.trailResolution.next23}&timespanOffset=1`)),r.push(Pe(`${t}timespan=1h&resolution=${e.trailResolution.lastHour}`));let a=[],o=new jt;o.playback=k,Promise.all(r).then(s=>{let f=0,v=r.length-1,g=60;s.forEach(h=>{if(h.type&&h.type==="MultiLineString"&&h.coordinates&&Array.isArray(h.coordinates))if(f!==v){let m=[];for(h.coordinates.forEach(P=>{m=m.concat(P)}),m=(0,mi.SimplifyAP)(m,n,i);m.length>g;){let P=m.slice(0,g);a.push(P),m=m.slice(g-1),m[0]=[m[0][0]+5e-9,m[0][1]+5e-9]}m.length!==0&&a.push(m)}else a=a.concat(h.coordinates);f++}),o.result=a,postMessage(o)}).catch(()=>{o.result=null,postMessage(o)})}function Cs(e){if(M)return;if(!e.url){postMessage({action:"error",result:"Valid options not provided!"});return}let t=e.url.split("/");if(t.pop(),t.push("api"),t[0]=t[0]==="wss:"?"https:":"http:",Nr=t.join("/"),Ts(),M=new qe,Me.push(M.onConnect.subscribe(r=>Ft({action:"onConnect",msg:r}))),Me.push(M.onClose.subscribe(r=>Ft({action:"onClose",msg:r}))),Me.push(M.onError.subscribe(r=>Ft({action:"onError",msg:r}))),Me.push(M.onMessage.subscribe(r=>Ft({action:"onMessage",msg:r}))),M.authToken=pi,e.playback){let r=e.playbackOptions.startTime?`?startTime=${e.playbackOptions.startTime}`:null,n=e.playbackOptions.playbackRate?`playbackRate=${e.playbackOptions.playbackRate}`:null;n=n?r?"&"+n:"?"+n:null;let i=`${e.url}${r||""}${n||""}`;M.open(i,e.playbackOptions.subscribe,e.token)}else M.open(e.url,e.subscribe,e.token),xi()}function Es(e){let t=e.type.indexOf("notifications.")===-1?`notifications.${e.type}`:e.type;e.raise?M.raiseAlarm("self",t,new ke(e.message,e.state,!0,!0)):M.clearAlarm("self",t)}function Is(e){M.isHello(e)?(postMessage({action:"hello",result:e,self:e.self,playback:k}),X&&Mi()):M.isDelta(e)?(Cr=!0,e.updates.forEach(t=>{t.values&&(V=t.$source,yi=t.timestamp,t.values.forEach(r=>{if(bi=t.timestamp,!!e.context)switch(e.context.split(".")[0]){case"shore":case"atons":_?.signalk.atons&&Vs(e.context,r),xe(e.context,c.atons,_?.signalk.atons);break;case"sar":_?.signalk.sar&&Ks(e.context,r),xe(e.context,c.sar,_?.signalk.sar);break;case"aircraft":_?.signalk.aircraft&&Bs(e.context,r),xe(e.context,c.aircraft,_?.signalk.aircraft);break;case"meteo":_?.signalk.meteo&&(Ws(e.context,r),di(r)),xe(e.context,c.meteo,_?.signalk.meteo);break;case"vessels":if(M.isSelf(e))c.self.id||(c.self.id=e.context),fi(c.self,r,!0),di(r);else{if(_?.signalk.vessels){let n=Ns(e.context);fi(n,r)}xe(e.context,c.aisTargets,_?.signalk.vessels,_?.aisState)}break}}))}),Vt()):M.isResponse(e)&&postMessage({action:"response",result:e})}function xe(e,t,r=!0,n=[]){if(r){let i=t.get(e);i&&n.includes(i?.state)&&(O.expired[e]=!0,i=null),i&&_.signalk.maxRadius?i.positionReceived&&j.inBounds(i.position,gi)?O.updated[e]=!0:(t.delete(e),O.expired[e]=!0):O.updated[e]=!0}else t.size!==0&&(t.forEach((i,a)=>{O.expired[a]=!0}),t.clear())}function Vt(e=!1){if(!X||e){let t=new z;t.watchDogAlarm=b.alarm,t.playback=k,c.aisStatus.updated=Object.keys(O.updated),c.aisStatus.stale=Object.keys(O.stale),c.aisStatus.expired=Object.keys(O.expired),t.result=c,t.timestamp=k?bi:c.self.lastUpdated.toISOString(),postMessage(t),_i(),c.self.resourceUpdates=[],Us(),_e===0&&c.self.positionReceived&&_?.signalk.maxRadius&&(gi=j.calcMapifiedExtent(c.self.position,_.signalk.maxRadius),_e++),_e=_e>=hi?0:_e+1}}function Mi(){X&&typeof X=="number"&&Ut.push(setInterval(()=>{b.active&&!b.msgCount?(b.intervalCount=b.intervalCount+1,b.intervalCount>=b.maxMsgIntervals&&(b.intervalCount=0,b.alarm=!0,Vt(!0))):(b.intervalCount=0,b.msgCount=0,b.alarm=!1),Cr&&(Vt(!0),Cr=!1)},X)),Ut.push(setInterval(()=>{Er&&xi()},6e4))}function Pi(){Ut.forEach(e=>clearInterval(e)),Ut=[]}function Ns(e){if(!c.aisTargets.has(e)){let t=new ue;t.id=e,t.position=null,c.aisTargets.set(e,t)}return c.aisTargets.get(e)}function fi(e,t,r=!1){if(r){if(e.lastUpdated=new Date,t.path.startsWith("resources."))e.resourceUpdates.push(t),Fs(t);else if(t.path.startsWith("radars"))js(t);else if(t.path.startsWith("navigation.racing"))e.properties[t.path]=t.value;else if(t.path==="performance.beatAngle")e.performance.beatAngle=t.value;else if(t.path==="performance.gybeAngle")e.performance.gybeAngle=t.value;else if(t.path.startsWith("navigation.course."))if(t.path.startsWith("navigation.course.calcValues.")){let o=t.path.split(".").slice(3).join(".");e.courseCalcs[o]=t.value}else t.path.includes("activeRoute")?e.courseApi.activeRoute=t.value:t.path.includes("nextPoint")?e.courseApi.nextPoint=t.value:t.path.includes("previousPoint")?e.courseApi.previousPoint=t.value:t.path.includes("arrivalCircle")&&(e.courseApi.arrivalCircle=t.value);else if(t.path.startsWith("radars.")){let o=t.path.split("."),s=o.slice(2).join(".");e.radars[o[1]]||(e.radars[o[1]]={}),e.radars[o[1]][s]=t.value}let a=t.path.indexOf("course")!==-1?t.path.split(".").slice(0,2).join("."):t.path;Ls.indexOf(a)!==-1&&(c.paths[a]=null)}else t.path==="navigation.distanceToSelf"&&(e.distanceToSelf=t.value),t.path==="navigation.closestApproach"&&(e.closestApproach=t.value);if(t.path==="")typeof t.value.name<"u"&&(e.name=t.value.name),typeof t.value.mmsi<"u"&&(e.mmsi=t.value.mmsi,e.lastUpdated=new Date),typeof t.value.registrations<"u"&&(e.registrations=t.value.registrations),typeof t.value.buddy<"u"&&(e.buddy=t.value.buddy),typeof t.value.communication<"u"&&(e.callsignVhf=t.value.communication.callsignVhf??"",e.callsignHf=t.value.communication.callsignHf??"");else if(t.path==="communication.callsignVhf")e.callsignVhf=t.value;else if(t.path==="communication.callsignHf")e.callsignHf=t.value;else if(t.path==="design.aisShipType")e.type=t.value;else if(t.path==="navigation.position"&&t.value){if(typeof t.value.latitude>"u"||typeof t.value.longitude>"u")return;e.position=j.normaliseCoords([t.value.longitude,t.value.latitude]),e.positionReceived=!0,e.positionTimestamp=yi??"",e.positionUpdatedAt=Date.now(),e.lastUpdated=new Date,r||jr(e)}else t.path==="navigation.state"?e.state=t.value:t.path==="navigation.speedOverGround"?e.sog=t.value:t.path==="environment.mode"?e.environment.mode=t.value:t.path==="environment.sun"?e.environment.sun=t.value:t.path==="environment.wind.angleApparent"?e.wind.awa=t.value:t.path==="environment.wind.speedApparent"?e.wind.aws=t.value:t.path==="environment.wind.speedTrue"?e.wind.speedTrue=t.value:t.path==="environment.wind.speedOverGround"?e.wind.sog=t.value:t.path==="environment.wind.directionTrue"?e.wind.twd=t.value:t.path==="environment.wind.directionMagnetic"?e.wind.mwd=t.value:t.path==="navigation.anchor.position"?e.anchor.position=t.value:t.path==="navigation.anchor.maxRadius"?e.anchor.maxRadius=t.value:t.path==="navigation.anchor.currentRadius"?e.anchor.radius=t.value:t.path==="steering.autopilot.state"&&V===ne?e.autopilot.state=t.value:t.path==="steering.autopilot.mode"&&V===ne?e.autopilot.mode=t.value:t.path==="steering.autopilot.target"&&V===ne?e.autopilot.target=t.value:t.path==="steering.autopilot.engaged"&&V===ne?e.autopilot.enabled=t.value:t.path==="steering.autopilot.defaultPilot"?(e.autopilot.default=t.value,ne=t.value):t.path==="steering.autopilot.availableActions"&&V===ne?e.autopilot.availableActions=t.value??[]:t.path==="navigation.courseOverGroundTrue"?e.cogTrue=t.value:t.path==="navigation.courseOverGroundMagnetic"?e.cogMagnetic=t.value:t.path==="navigation.headingTrue"?(e.headingTrue=t.value,e.headingTrueUpdatedAt=Date.now()):t.path==="navigation.headingMagnetic"&&(e.headingMagnetic=t.value,e.headingMagneticUpdatedAt=Date.now());let n=ie.heading;typeof n>"u"||n===oi?si.has(t.path)&&ui(e):t.path===n&&(e.orientation=t.value),typeof ie.tws<"u"&&t.path===ie.tws&&(e.wind.tws=t.value),typeof ie.twd<"u"&&t.path===ie.twd&&(e.wind.direction=t.path==="environment.wind.angleTrueGround"||t.path==="environment.wind.angleTrueWater"?G.angleToDirection(t.value,e.orientation??0):t.value);let i=e.cogTrue??e.cogMagnetic??void 0;if(typeof i<"u"&&e.position){let a=r?Ir.selfLines.cog.length:Ir.aisCogLine,o=(e.sog??0)*(a*60);e.vectors.cog=[e.position,j.rhumbDestination(e.position,i,o)]}}function js(e){let t=new Nt;t.playback=k,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}function Fs(e){let t=new It;t.playback=k,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}function di(e){if(e.path.includes("notifications.")){let t=new Et;t.playback=k,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}}function Us(){let e=new Date().valueOf();c.aisTargets.forEach((t,r)=>{t.lastUpdated.valueOf()<e-U.maxAge?(O.expired[r]=!0,c.aisTargets.delete(r)):t.lastUpdated.valueOf()<e-U.staleAge&&(O.stale[r]=!0)}),c.aircraft.forEach((t,r)=>{t.lastUpdated.valueOf()<e-U.maxAge?(O.expired[r]=!0,c.aircraft.delete(r)):t.lastUpdated.valueOf()<e-U.staleAge&&(O.stale[r]=!0)}),c.sar.forEach((t,r)=>{t.lastUpdated.valueOf()<e-U.maxAge?(O.expired[r]=!0,c.sar.delete(r)):t.lastUpdated.valueOf()<e-U.staleAge&&(O.stale[r]=!0)})}function Vs(e,t){let r=!1;if(e.indexOf("shore.basestations")!==-1&&(r=!0),!c.atons.has(e)){let i=new le;i.id=e,i.position=null,i.type.id=null,r&&(i.type.id=-2,i.type.name="Basestation"),c.atons.set(e,i)}let n=c.atons.get(e);return t.path===""?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi),typeof t.value.atonType<"u"&&(n.type=t.value.atonType)):t.path==="atonType"?n.type=t.value:t.path==="virtual"?n.virtual=t.value:t.path==="navigation.position"?(n.position=[t.value.longitude,t.value.latitude],n.positionReceived=!0):n.properties[t.path]=t.value,e}function Ks(e,t){if(!c.sar.has(e)){let n=new Ce;n.id=e,n.position=null,n.type.id=-1,n.type.name="SaR Beacon",c.sar.set(e,n)}let r=c.sar.get(e);t.path===""?(typeof t.value.name<"u"&&(r.name=t.value.name),typeof t.value.mmsi<"u"&&(r.mmsi=t.value.mmsi),typeof t.value.communication<"u"&&(r.callsignVhf=t.value.communication.callsignVhf??"",r.callsignHf=t.value.communication.callsignHf??"")):t.path==="communication.callsignVhf"?r.callsignVhf=t.value:t.path==="communication.callsignHf"?r.callsignHf=t.value:t.path==="navigation.position"&&t.value&&(r.position=j.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0)}function Ws(e,t){if(!c.meteo.has(e)){let n=new Ie;n.id=e,n.position=null,n.type.id=-1,n.type.name="Weather Station",c.meteo.set(e,n)}let r=c.meteo.get(e);if(t.path===""){if(typeof t.value.name<"u"&&(r.name=t.value.name),typeof t.value.mmsi<"u"){let n=e.split(":").slice(-2);r.mmsi=n.length===2?`${n[0]}:${n[1]}`:t.value.mmsi}typeof t.value.communication<"u"&&(r.callsignVhf=t.value.communication.callsignVhf??"",r.callsignHf=t.value.communication.callsignHf??"")}else t.path==="communication.callsignVhf"?r.callsignVhf=t.value:t.path==="communication.callsignHf"?r.callsignHf=t.value:t.path==="environment.outside.temperature"?r.temperature=t.value:t.path==="environment.wind.directionTrue"?r.twd=t.value:t.path==="environment.wind.averageSpeed"?r.tws=t.value:t.path==="navigation.position"&&t.value&&(r.position=j.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0)}function Bs(e,t){if(!c.aircraft.has(e)){let n=new Ee;n.id=e,n.position=null,c.aircraft.set(e,n)}let r=c.aircraft.get(e);t.path===""?(typeof t.value.name<"u"&&(r.name=t.value.name),typeof t.value.mmsi<"u"&&(r.mmsi=t.value.mmsi),typeof t.value.communication<"u"&&(r.callsignVhf=t.value.communication.callsignVhf??"",r.callsignHf=t.value.communication.callsignHf??"")):t.path==="communication.callsignVhf"?r.callsignVhf=t.value:t.path==="communication.callsignHf"?r.callsignHf=t.value:t.path==="navigation.position"&&t.value?(r.position=j.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0,jr(r)):t.path==="navigation.courseOverGroundTrue"?r.orientation=t.value:t.path==="navigation.speedOverGround"&&(r.sog=t.value)}function jr(e){if(e.track&&e.track.length===0)e.track.push([e.position]);else{let t=e.track[e.track.length-1].length,r=e.track[e.track.length-1][t-1];r[0]!==e.position[0]&&r[1]!==e.position[1]&&e.track[e.track.length-1].push(e.position)}e.track[e.track.length-1]=e.track[e.track.length-1].slice(0-U.maxTrack)}export{Pe as apiGet,Ft as handleStreamEvent,Ts as initVessels,fi as processVessel};