@signalk/freeboard-sk 2.8.2 → 2.8.3
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.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/public/{327.237df92a43b40d40.js → 327.5ce49c514e0ff255.js} +1 -1
- package/public/assets/img/ais_self.png +0 -0
- package/public/index.html +1 -1
- package/public/main.da1dd55692cd6aab.js +1 -0
- package/public/{runtime.5633b29a06dd408a.js → runtime.508cb88749fb25ea.js} +1 -1
- package/public/main.3b8989448ca5f179.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# CHANGELOG: Freeboard
|
|
2
2
|
|
|
3
|
+
### v2.8.3
|
|
4
|
+
|
|
5
|
+
- **Fixed**: Laylines being shown when vessel is upwind (#149).
|
|
6
|
+
- **Fixed**: True wind vector display when using `angleTrueGround` or `angleTrueWater`.
|
|
7
|
+
- **Fixed**: Focussed AIS target hidden behind other vessels.
|
|
8
|
+
- **Updated**: Display position in preferred format in properties modals.
|
|
9
|
+
- **Updated**: Meteo popover to display wind & temperature values.
|
|
10
|
+
|
|
3
11
|
### v2.8.2
|
|
4
12
|
|
|
5
13
|
- **Updated**: Show laylines only when destination is upwind (#149).
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var qy={2222:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=T(y(7029)),P=T(y(3100)),_=T(y(5705)),O=T(y(942)),M=y(7636);function T(h){return h&&h.__esModule?h:{default:h}}f.default=function(I,D,w){var S=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,R=(0,N.default)(I),F=(0,P.default)(I),ee=D/S,ce=(0,_.default)(w),we=(0,_.default)(R),He=(0,_.default)(F),We=Math.asin(Math.sin(we)*Math.cos(ee)+Math.cos(we)*Math.sin(ee)*Math.cos(ce)),Ve=He+Math.atan2(Math.sin(ce)*Math.sin(ee)*Math.cos(we),Math.cos(ee)-Math.sin(we)*Math.sin(We)),ye=(0,O.default)(Ve);return(ye<M.MINLON||ye>M.MAXLON)&&(Ve=(Ve+3*Math.PI)%(2*Math.PI)-Math.PI,ye=(0,O.default)(Ve)),{latitude:(0,O.default)(We),longitude:ye}}},7636:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.areaConversion=f.timeConversion=f.distanceConversion=f.altitudeKeys=f.latitudeKeys=f.longitudeKeys=f.MAXLON=f.MINLON=f.MAXLAT=f.MINLAT=f.earthRadius=f.sexagesimalPattern=void 0,f.sexagesimalPattern=/^([0-9]{1,3})\xb0\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['\u2032]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["\u2033]\s*)?([NEOSW]?)$/,f.earthRadius=6378137,f.MINLAT=-90,f.MAXLAT=90,f.MINLON=-180,f.MAXLON=180,f.longitudeKeys=["lng","lon","longitude",0],f.latitudeKeys=["lat","latitude",1],f.altitudeKeys=["alt","altitude","elevation","elev",2],f.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},f.timeConversion={m:60,h:3600,d:86400};var D={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};f.areaConversion=D,D.sqm=D.m2,D.sqkm=D.km2,D.sqft=D.ft2,D.sqyd=D.yd2,D.sqin=D.in2},179:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){var g=N.areaConversion[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m"];if(g)return M*g;throw new Error("Invalid unit used for area conversion.")}},917:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){var g=N.distanceConversion[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m"];if(g)return M*g;throw new Error("Invalid unit used for distance conversion.")}},1167:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh"){case"kmh":return M*N.timeConversion.h*N.distanceConversion.km;case"mph":return M*N.timeConversion.h*N.distanceConversion.mi;default:return M}}},8948:($,f)=>{function y(h,I){return function M(h){if(Array.isArray(h))return h}(h)||function O(h,I){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(h)){var D=[],w=!0,S=!1,R=void 0;try{for(var ee,F=h[Symbol.iterator]();!(w=(ee=F.next()).done)&&(D.push(ee.value),!I||D.length!==I);w=!0);}catch(ce){S=!0,R=ce}finally{try{!w&&null!=F.return&&F.return()}finally{if(S)throw R}}return D}}(h,I)||function P(h,I){if(h){if("string"==typeof h)return _(h,I);var D=Object.prototype.toString.call(h).slice(8,-1);if("Object"===D&&h.constructor&&(D=h.constructor.name),"Map"===D||"Set"===D)return Array.from(h);if("Arguments"===D||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D))return _(h,I)}}(h,I)||function N(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(h,I){(null==I||I>h.length)&&(I=h.length);for(var D=0,w=new Array(I);D<I;D++)w[D]=h[D];return w}Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(I){var w=y(I.toString().split("."),2),R=w[1],F=Math.abs(Number(w[0])),ee=60*+("0."+(R||0)),ce=ee.toString().split("."),we=Math.floor(ee),He=function(I){var w=Math.pow(10,arguments.length>1&&void 0!==arguments[1]?arguments[1]:4);return Math.round(I*w)/w}(60*+("0."+(ce[1]||0))).toString(),Ve=y(He.split("."),2),ye=Ve[0],ve=Ve[1],xe=void 0===ve?"0":ve;return F+"\xb0 "+we.toString().padStart(2,"0")+"' "+ye.padStart(2,"0")+"."+xe.padEnd(1,"0")+'"'}},1118:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(2447));f.default=function(T,g){return(0,N.default)(T,g)[0]}},1691:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(5705)),P=M(y(7029)),_=M(y(3100)),O=y(7636);function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h){var I=0;if(h.length>2){for(var D,w,S,R=0;R<h.length;R++){R===h.length-2?(D=h.length-2,w=h.length-1,S=0):R===h.length-1?(D=h.length-1,w=0,S=1):(D=R,w=R+1,S=R+2);var F=(0,_.default)(h[D]),ee=(0,P.default)(h[w]),ce=(0,_.default)(h[S]);I+=((0,N.default)(ce)-(0,N.default)(F))*Math.sin((0,N.default)(ee))}I=I*O.earthRadius*O.earthRadius/2}return Math.abs(I)}},9144:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=_(y(7029)),P=_(y(3100));function _(T){return T&&T.__esModule?T:{default:T}}f.default=function(g){if(!1===Array.isArray(g)||0===g.length)throw new Error("No points were given.");return g.reduce(function(m,h){var I=(0,N.default)(h),D=(0,P.default)(h);return{maxLat:Math.max(I,m.maxLat),minLat:Math.min(I,m.minLat),maxLng:Math.max(D,m.maxLng),minLng:Math.min(D,m.minLng)}},{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}},190:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=T(y(7029)),P=T(y(3100)),_=T(y(5705)),O=T(y(942)),M=y(7636);function T(h){return h&&h.__esModule?h:{default:h}}f.default=function(I,D){var ve,xe,w=(0,N.default)(I),S=(0,P.default)(I),R=(0,_.default)(w),F=(0,_.default)(S),ee=D/M.earthRadius,ce=R-ee,we=R+ee,He=(0,_.default)(M.MAXLAT),We=(0,_.default)(M.MINLAT),Ve=(0,_.default)(M.MAXLON),ye=(0,_.default)(M.MINLON);if(ce>We&&we<He){var Me=Math.asin(Math.sin(ee)/Math.cos(R));(ve=F-Me)<ye&&(ve+=2*Math.PI),(xe=F+Me)>Ve&&(xe-=2*Math.PI)}else ce=Math.max(ce,We),we=Math.min(we,He),ve=ye,xe=Ve;return[{latitude:(0,O.default)(ce),longitude:(0,O.default)(ve)},{latitude:(0,O.default)(we),longitude:(0,O.default)(xe)}]}},5524:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(7029)),P=M(y(3100)),_=M(y(5705)),O=M(y(942));function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h){if(!1===Array.isArray(h)||0===h.length)return!1;var I=h.length,D=h.reduce(function(F,ee){var ce=(0,_.default)((0,N.default)(ee)),we=(0,_.default)((0,P.default)(ee));return{X:F.X+Math.cos(ce)*Math.cos(we),Y:F.Y+Math.cos(ce)*Math.sin(we),Z:F.Z+Math.sin(ce)}},{X:0,Y:0,Z:0}),w=D.X/I,S=D.Y/I,R=D.Z/I;return{longitude:(0,O.default)(Math.atan2(S,w)),latitude:(0,O.default)(Math.atan2(R,Math.sqrt(w*w+S*S)))}}},7088:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(9144));f.default=function(T){var g=(0,N.default)(T),h=g.minLng+(g.maxLng-g.minLng)/2;return{latitude:parseFloat((g.minLat+(g.maxLat-g.minLat)/2).toFixed(6)),longitude:parseFloat(h.toFixed(6))}}},9952:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(939));f.default=function(T,g){var m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.default,h="function"==typeof m?m(T,g):(0,N.default)(T,g);if(isNaN(h))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(h/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"}}},8744:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_,O){return O.reduce(function(M,T){if(typeof _>"u"||null===_)throw new Error("'".concat(_,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(_,T)&&typeof T<"u"&&typeof M>"u"?(M=T,T):M},void 0)}},4695:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636),P=function _(h){return h&&h.__esModule?h:{default:h}}(y(8744));function O(h,I){var D=Object.keys(h);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);I&&(w=w.filter(function(S){return Object.getOwnPropertyDescriptor(h,S).enumerable})),D.push.apply(D,w)}return D}function T(h,I,D){return I in h?Object.defineProperty(h,I,{value:D,enumerable:!0,configurable:!0,writable:!0}):h[I]=D,h}f.default=function(I){var D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:N.longitudeKeys,latitude:N.latitudeKeys,altitude:N.altitudeKeys},w=(0,P.default)(I,D.longitude),S=(0,P.default)(I,D.latitude),R=(0,P.default)(I,D.altitude);return function M(h){for(var I=1;I<arguments.length;I++){var D=null!=arguments[I]?arguments[I]:{};I%2?O(Object(D),!0).forEach(function(w){T(h,w,D[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(D)):O(Object(D)).forEach(function(w){Object.defineProperty(h,w,Object.getOwnPropertyDescriptor(D,w))})}return h}({latitude:S,longitude:w},R?{altitude:R}:{})}},8674:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=T(y(7029)),P=T(y(3100)),_=T(y(5705)),O=T(y(6522)),M=y(7636);function T(h){return h&&h.__esModule?h:{default:h}}f.default=function(I,D){var w=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;w=typeof w<"u"&&!isNaN(w)?w:1;var S=(0,N.default)(I),R=(0,P.default)(I),F=(0,N.default)(D),ee=(0,P.default)(D),ce=Math.acos((0,O.default)(Math.sin((0,_.default)(F))*Math.sin((0,_.default)(S))+Math.cos((0,_.default)(F))*Math.cos((0,_.default)(S))*Math.cos((0,_.default)(R)-(0,_.default)(ee))))*M.earthRadius;return Math.round(ce/w)*w}},7504:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=_(y(8674)),P=_(y(6522));function _(T){return T&&T.__esModule?T:{default:T}}f.default=function(g,m,h){var I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,D=(0,N.default)(m,g,I),w=(0,N.default)(g,h,I),S=(0,N.default)(m,h,I),R=Math.acos((0,P.default)((D*D+S*S-w*w)/(2*D*S))),F=Math.acos((0,P.default)((w*w+S*S-D*D)/(2*w*S)));return R>Math.PI/2?D:F>Math.PI/2?w:Math.sin(R)*D}},884:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(7029)),P=M(y(3100)),_=M(y(5705)),O=M(y(942));function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h,I){var D=(0,N.default)(I),w=(0,P.default)(I),S=(0,N.default)(h),R=(0,P.default)(h);return((0,O.default)(Math.atan2(Math.sin((0,_.default)(w)-(0,_.default)(R))*Math.cos((0,_.default)(D)),Math.cos((0,_.default)(S))*Math.sin((0,_.default)(D))-Math.sin((0,_.default)(S))*Math.cos((0,_.default)(D))*Math.cos((0,_.default)(w)-(0,_.default)(R))))+360)%360}},7029:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636),P=O(y(8744)),_=O(y(5101));function O(g){return g&&g.__esModule?g:{default:g}}f.default=function(m,h){var I=(0,P.default)(m,N.latitudeKeys);if(!(typeof I>"u"||null===I)){var D=m[I];return!0===h?D:(0,_.default)(D)}}},3100:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636),P=O(y(8744)),_=O(y(5101));function O(g){return g&&g.__esModule?g:{default:g}}f.default=function(m,h){var I=(0,P.default)(m,N.longitudeKeys);if(!(typeof I>"u"||null===I)){var D=m[I];return!0===h?D:(0,_.default)(D)}}},5378:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(T){return T&&T.__esModule?T:{default:T}}(y(8674));function _(T){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(m){return typeof m}:function(m){return m&&"function"==typeof Symbol&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(T)}f.default=function(g){var m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.default;return g.reduce(function(h,I){return"object"===_(h)&&null!==h.last&&(h.distance+=m(I,h.last)),h.last=I,h},{last:null,distance:0}).distance}},2671:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(7029)),P=M(y(3100)),_=M(y(5705)),O=y(7636);function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h,I){var D=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;D=typeof D<"u"&&!isNaN(D)?D:1;var He,We,Ve,ye,ve,xe,Ht,w=(0,N.default)(h),S=(0,P.default)(h),R=(0,N.default)(I),F=(0,P.default)(I),ee=6356752.314245,ce=1/298.257223563,we=(0,_.default)(F-S),Me=Math.atan((1-ce)*Math.tan((0,_.default)(parseFloat(w)))),fn=Math.atan((1-ce)*Math.tan((0,_.default)(parseFloat(R)))),$t=Math.sin(Me),Xt=Math.cos(Me),pn=Math.sin(fn),de=Math.cos(fn),lt=we,mt=100;do{var K=Math.sin(lt),hn=Math.cos(lt);if(0===(xe=Math.sqrt(de*K*(de*K)+(Xt*pn-$t*de*hn)*(Xt*pn-$t*de*hn))))return 0;He=$t*pn+Xt*de*hn,We=Math.atan2(xe,He),ve=He-2*$t*pn/(ye=1-(Ve=Xt*de*K/xe)*Ve),isNaN(ve)&&(ve=0);var gn=ce/16*ye*(4+ce*(4-3*ye));Ht=lt,lt=we+(1-gn)*ce*Ve*(We+gn*xe*(ve+gn*He*(2*ve*ve-1)))}while(Math.abs(lt-Ht)>1e-12&&--mt>0);if(0===mt)return NaN;var It=ye*(O.earthRadius*O.earthRadius-ee*ee)/(ee*ee),Ut=It/1024*(256+It*(It*(74-47*It)-128));return Math.round(ee*(1+It/16384*(4096+It*(It*(320-175*It)-768)))*(We-Ut*xe*(ve+Ut/4*(He*(2*ve*ve-1)-Ut/6*ve*(4*xe*xe-3)*(4*ve*ve-3))))/D)*D}},939:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(7029)),P=M(y(3100)),_=M(y(5705)),O=M(y(942));function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h,I){var D=(0,_.default)((0,P.default)(I))-(0,_.default)((0,P.default)(h)),w=Math.log(Math.tan((0,_.default)((0,N.default)(I))/2+Math.PI/4)/Math.tan((0,_.default)((0,N.default)(h))/2+Math.PI/4));return Math.abs(D)>Math.PI&&(D=D>0?-1*(2*Math.PI-D):2*Math.PI+D),((0,O.default)(Math.atan2(D,w))+360)%360}},2845:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){return/^(NNE|NE|NNW|N)$/.test(_)?"N":/^(ENE|E|ESE|SE)$/.test(_)?"E":/^(SSE|S|SSW|SW)$/.test(_)?"S":/^(WSW|W|WNW|NW)$/.test(_)?"W":void 0}},8950:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(8674));f.default=function(T,g){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.default)(T,g)/(Number(g.time)-Number(T.time))*1e3}},2541:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0});var N={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(f,"computeDestinationPoint",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(f,"convertArea",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(f,"convertDistance",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(f,"convertSpeed",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(f,"decimalToSexagesimal",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(f,"findNearest",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(f,"getAreaOfPolygon",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(f,"getBounds",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(f,"getBoundsOfDistance",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(f,"getCenter",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(f,"getCenterOfBounds",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(f,"getCompassDirection",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(f,"getCoordinateKey",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(f,"getCoordinateKeys",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(f,"getDistance",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(f,"getDistanceFromLine",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(f,"getGreatCircleBearing",{enumerable:!0,get:function(){return we.default}}),Object.defineProperty(f,"getLatitude",{enumerable:!0,get:function(){return He.default}}),Object.defineProperty(f,"getLongitude",{enumerable:!0,get:function(){return We.default}}),Object.defineProperty(f,"getPathLength",{enumerable:!0,get:function(){return Ve.default}}),Object.defineProperty(f,"getPreciseDistance",{enumerable:!0,get:function(){return ye.default}}),Object.defineProperty(f,"getRhumbLineBearing",{enumerable:!0,get:function(){return ve.default}}),Object.defineProperty(f,"getRoughCompassDirection",{enumerable:!0,get:function(){return xe.default}}),Object.defineProperty(f,"getSpeed",{enumerable:!0,get:function(){return Me.default}}),Object.defineProperty(f,"isDecimal",{enumerable:!0,get:function(){return fn.default}}),Object.defineProperty(f,"isPointInLine",{enumerable:!0,get:function(){return $t.default}}),Object.defineProperty(f,"isPointInPolygon",{enumerable:!0,get:function(){return Xt.default}}),Object.defineProperty(f,"isPointNearLine",{enumerable:!0,get:function(){return pn.default}}),Object.defineProperty(f,"isPointWithinRadius",{enumerable:!0,get:function(){return de.default}}),Object.defineProperty(f,"isSexagesimal",{enumerable:!0,get:function(){return lt.default}}),Object.defineProperty(f,"isValidCoordinate",{enumerable:!0,get:function(){return Ht.default}}),Object.defineProperty(f,"isValidLatitude",{enumerable:!0,get:function(){return mt.default}}),Object.defineProperty(f,"isValidLongitude",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(f,"orderByDistance",{enumerable:!0,get:function(){return hn.default}}),Object.defineProperty(f,"sexagesimalToDecimal",{enumerable:!0,get:function(){return gn.default}}),Object.defineProperty(f,"toDecimal",{enumerable:!0,get:function(){return It.default}}),Object.defineProperty(f,"toRad",{enumerable:!0,get:function(){return Br.default}}),Object.defineProperty(f,"toDeg",{enumerable:!0,get:function(){return Ut.default}}),Object.defineProperty(f,"wktToPolygon",{enumerable:!0,get:function(){return Wr.default}});var P=J(y(2222)),_=J(y(179)),O=J(y(917)),M=J(y(1167)),T=J(y(8948)),g=J(y(1118)),m=J(y(1691)),h=J(y(9144)),I=J(y(190)),D=J(y(5524)),w=J(y(7088)),S=J(y(9952)),R=J(y(8744)),F=J(y(4695)),ee=J(y(8674)),ce=J(y(7504)),we=J(y(884)),He=J(y(7029)),We=J(y(3100)),Ve=J(y(5378)),ye=J(y(2671)),ve=J(y(939)),xe=J(y(2845)),Me=J(y(8950)),fn=J(y(3026)),$t=J(y(4194)),Xt=J(y(3536)),pn=J(y(2787)),de=J(y(202)),lt=J(y(4902)),Ht=J(y(7637)),mt=J(y(6563)),K=J(y(266)),hn=J(y(2447)),gn=J(y(1532)),It=J(y(5101)),Br=J(y(5705)),Ut=J(y(942)),Wr=J(y(354)),mn=y(7636);function J(H){return H&&H.__esModule?H:{default:H}}Object.keys(mn).forEach(function(H){"default"===H||"__esModule"===H||Object.prototype.hasOwnProperty.call(N,H)||Object.defineProperty(f,H,{enumerable:!0,get:function(){return mn[H]}})})},3026:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){var O=_.toString().trim();return!isNaN(parseFloat(O))&&parseFloat(O)===Number(O)}},4194:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(8674));f.default=function(T,g,m){return(0,N.default)(g,T)+(0,N.default)(T,m)===(0,N.default)(g,m)}},3536:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=_(y(7029)),P=_(y(3100));function _(T){return T&&T.__esModule?T:{default:T}}f.default=function(g,m){for(var h=!1,I=m.length,D=-1,w=I-1;++D<I;w=D)((0,P.default)(m[D])<=(0,P.default)(g)&&(0,P.default)(g)<(0,P.default)(m[w])||(0,P.default)(m[w])<=(0,P.default)(g)&&(0,P.default)(g)<(0,P.default)(m[D]))&&(0,N.default)(g)<((0,N.default)(m[w])-(0,N.default)(m[D]))*((0,P.default)(g)-(0,P.default)(m[D]))/((0,P.default)(m[w])-(0,P.default)(m[D]))+(0,N.default)(m[D])&&(h=!h);return h}},2787:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(7504));f.default=function(T,g,m,h){return(0,N.default)(T,g,m)<h}},202:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(8674));f.default=function(T,g,m){return(0,N.default)(T,g,.01)<m}},4902:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){return N.sexagesimalPattern.test(M.toString().trim())}},7637:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=O(y(4695)),P=O(y(6563)),_=O(y(266));function O(g){return g&&g.__esModule?g:{default:g}}f.default=function(m){var h=(0,N.default)(m),I=h.latitude,D=h.longitude;if(Array.isArray(m)&&m.length>=2)return(0,_.default)(m[0])&&(0,P.default)(m[1]);if(typeof I>"u"||typeof D>"u")return!1;var w=m[D],S=m[I];return!(typeof S>"u"||typeof w>"u"||!1===(0,P.default)(S)||!1===(0,_.default)(w))}},6563:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(3026)),P=M(y(4902)),_=M(y(1532)),O=y(7636);function M(m){return m&&m.__esModule?m:{default:m}}f.default=function m(h){return(0,N.default)(h)?!(parseFloat(h)>O.MAXLAT||h<O.MINLAT):!!(0,P.default)(h)&&m((0,_.default)(h))}},266:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(3026)),P=M(y(4902)),_=M(y(1532)),O=y(7636);function M(m){return m&&m.__esModule?m:{default:m}}f.default=function m(h){return(0,N.default)(h)?!(parseFloat(h)>O.MAXLON||h<O.MINLON):!!(0,P.default)(h)&&m((0,_.default)(h))}},2447:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(8674));f.default=function(T,g){var m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.default;return m="function"==typeof m?m:N.default,g.slice().sort(function(h,I){return m(T,h)-m(T,I)})}},6522:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){return _>1?1:_<-1?-1:_}},1532:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){var T=new RegExp(N.sexagesimalPattern).exec(M.toString().trim());if(typeof T>"u"||null===T)throw new Error("Given value is not in sexagesimal format");var g=Number(T[2])/60||0,m=Number(T[4])/3600||0,h=parseFloat(T[1])+g+m;return["S","W"].includes(T[7])?-h:h}},5101:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=T(y(3026)),P=T(y(4902)),_=T(y(1532)),O=T(y(7637)),M=T(y(4695));function T(w){return w&&w.__esModule?w:{default:w}}function g(w,S){var R=Object.keys(w);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(w);S&&(F=F.filter(function(ee){return Object.getOwnPropertyDescriptor(w,ee).enumerable})),R.push.apply(R,F)}return R}function m(w){for(var S=1;S<arguments.length;S++){var R=null!=arguments[S]?arguments[S]:{};S%2?g(Object(R),!0).forEach(function(F){h(w,F,R[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(R)):g(Object(R)).forEach(function(F){Object.defineProperty(w,F,Object.getOwnPropertyDescriptor(R,F))})}return w}function h(w,S,R){return S in w?Object.defineProperty(w,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[S]=R,w}f.default=function w(S){if((0,N.default)(S))return Number(S);if((0,P.default)(S))return(0,_.default)(S);if((0,O.default)(S)){var R=(0,M.default)(S);return Array.isArray(S)?S.map(function(F,ee){return[0,1].includes(ee)?w(F):F}):m(m(m({},S),R.latitude&&h({},R.latitude,w(S[R.latitude]))),R.longitude&&h({},R.longitude,w(S[R.longitude])))}return Array.isArray(S)?S.map(function(F){return(0,O.default)(F)?w(F):F}):S}},942:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){return 180*_/Math.PI}},5705:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){return _*Math.PI/180}},354:($,f)=>{function _(m,h){(null==h||h>m.length)&&(h=m.length);for(var I=0,D=new Array(h);I<h;I++)D[I]=m[I];return D}Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(h){if(!h.startsWith("POLYGON"))throw new Error("Invalid wkt.");return h.slice(h.indexOf("(")+2,h.indexOf(")")).split(", ").map(function(w){var R=function y(m,h){return function M(m){if(Array.isArray(m))return m}(m)||function O(m,h){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(m)){var I=[],D=!0,w=!1,S=void 0;try{for(var F,R=m[Symbol.iterator]();!(D=(F=R.next()).done)&&(I.push(F.value),!h||I.length!==h);D=!0);}catch(ee){w=!0,S=ee}finally{try{!D&&null!=R.return&&R.return()}finally{if(w)throw S}}return I}}(m,h)||function P(m,h){if(m){if("string"==typeof m)return _(m,h);var I=Object.prototype.toString.call(m).slice(8,-1);if("Object"===I&&m.constructor&&(I=m.constructor.name),"Map"===I||"Set"===I)return Array.from(m);if("Arguments"===I||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return _(m,h)}}(m,h)||function N(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(w.split(" "),2),ee=R[1];return{longitude:parseFloat(R[0]),latitude:parseFloat(ee)}})}},6729:($,f)=>{function y(g,m){return g*g+m*m}function N(g,m){return y(g[0]-m[0],g[1]-m[1])}function P(g,m,h){var I=m[0],D=m[1],w=h[0]-I,S=h[1]-D;if(0!==w||0!==S){var R=((g[0]-I)*w+(g[1]-D)*S)/y(w,S);R>1?(I=h[0],D=h[1]):R>0&&(I+=w*R,D+=S*R)}return y(g[0]-I,g[1]-D)}function O(g,m,h,I,D){for(var S,w=I,R=m+1;R<h;R++){var F=P(g[R],g[m],g[h]);F>w&&(S=R,w=F)}w>I&&(S-m>1&&O(g,m,S,I,D),D.push(g[S]),h-S>1&&O(g,S,h,I,D))}function M(g,m){var h=g.length-1,I=[g[0]];return O(g,0,h,m,I),I.push(g[h]),I}f.__esModule=!0,f.SimplifyAP=function T(g,m,h){if(void 0===m&&(m=1),void 0===h&&(h=!1),g.length<=2)return g;var I=m*m;return M(g=h?g:function _(g,m){for(var I,h=g[0],D=[h],w=1,S=g.length;w<S;w++)N(I=g[w],h)>m&&(D.push(I),h=I);return h!==I&&D.push(I),D}(g,I),I)}},6380:($,f,y)=>{var P=y(6729);f.p$=P.SimplifyAP,y(5551),y(6413)},5551:($,f)=>{function y(g,m){return g*g+m*m}function N(g,m){return y(g.longitude-m.longitude,g.latitude-m.latitude)}function P(g,m,h){var I=m.longitude,D=m.latitude,w=h.longitude-I,S=h.latitude-D;if(0!==w||0!==S){var R=((g.longitude-I)*w+(g.latitude-D)*S)/y(w,S);R>1?(I=h.longitude,D=h.latitude):R>0&&(I+=w*R,D+=S*R)}return y(g.longitude-I,g.latitude-D)}function O(g,m,h,I,D){for(var S,w=I,R=m+1;R<h;R++){var F=P(g[R],g[m],g[h]);F>w&&(S=R,w=F)}w>I&&(S-m>1&&O(g,m,S,I,D),D.push(g[S]),h-S>1&&O(g,S,h,I,D))}function M(g,m){var h=g.length-1,I=[g[0]];return O(g,0,h,m,I),I.push(g[h]),I}f.__esModule=!0,f.SimplifyLL=function T(g,m,h){if(void 0===m&&(m=1),void 0===h&&(h=!1),g.length<=2)return g;var I=m*m;return M(g=h?g:function _(g,m){for(var I,h=g[0],D=[h],w=1,S=g.length;w<S;w++)N(I=g[w],h)>m&&(D.push(I),h=I);return h!==I&&D.push(I),D}(g,I),I)}},6413:($,f)=>{function y(g,m){return g*g+m*m}function N(g,m){return y(g.x-m.x,g.y-m.y)}function P(g,m,h){var I=m.x,D=m.y,w=h.x-I,S=h.y-D;if(0!==w||0!==S){var R=((g.x-I)*w+(g.y-D)*S)/y(w,S);R>1?(I=h.x,D=h.y):R>0&&(I+=w*R,D+=S*R)}return y(g.x-I,g.y-D)}function O(g,m,h,I,D){for(var S,w=I,R=m+1;R<h;R++){var F=P(g[R],g[m],g[h]);F>w&&(S=R,w=F)}w>I&&(S-m>1&&O(g,m,S,I,D),D.push(g[S]),h-S>1&&O(g,S,h,I,D))}function M(g,m){var h=g.length-1,I=[g[0]];return O(g,0,h,m,I),I.push(g[h]),I}f.__esModule=!0,f.Simplify=function T(g,m,h){if(void 0===m&&(m=1),void 0===h&&(h=!1),g.length<=2)return g;var I=m*m;return M(g=h?g:function _(g,m){for(var I,h=g[0],D=[h],w=1,S=g.length;w<S;w++)N(I=g[w],h)>m&&(D.push(I),h=I);return h!==I&&D.push(I),D}(g,I),I)}}},Rc={};function ta($){var f=Rc[$];if(void 0!==f)return f.exports;var y=Rc[$]={exports:{}};return qy[$](y,y.exports,ta),y.exports}(()=>{function $(e){return"function"==typeof e}let f=!1;const y={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else f&&console.log("RxJS: Back to a better error behavior. Thank you. <3");f=e},get useDeprecatedSynchronousErrorHandling(){return f}};function N(e){setTimeout(()=>{throw e},0)}const P={closed:!0,next(e){},error(e){if(y.useDeprecatedSynchronousErrorHandling)throw e;N(e)},complete(){}},_=Array.isArray||(e=>e&&"number"==typeof e.length),T=(()=>{function e(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((n,r)=>`${r+1}) ${n.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return e.prototype=Object.create(Error.prototype),e})();class g{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:o,_subscriptions:i}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof g)n.remove(this);else if(null!==n)for(let s=0;s<n.length;++s)n[s].remove(this);if($(o)){r&&(this._unsubscribe=void 0);try{o.call(this)}catch(s){t=s instanceof T?m(s.errors):[s]}}if(_(i)){let s=-1,a=i.length;for(;++s<a;){const l=i[s];if(null!==(e=l)&&"object"==typeof e)try{l.unsubscribe()}catch(u){t=t||[],u instanceof T?t=t.concat(m(u.errors)):t.push(u)}}}var e;if(t)throw new T(t)}add(t){let n=t;if(!t)return g.EMPTY;switch(typeof t){case"function":n=new g(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof g)){const i=n;n=new g,n._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:r}=n;if(null===r)n._parentOrParents=this;else if(r instanceof g){if(r===this)return n;n._parentOrParents=[r,this]}else{if(-1!==r.indexOf(this))return n;r.push(this)}const o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n}remove(t){const n=this._subscriptions;if(n){const r=n.indexOf(t);-1!==r&&n.splice(r,1)}}}var e;function m(e){return e.reduce((t,n)=>t.concat(n instanceof T?n.errors:n),[])}g.EMPTY=((e=new g).closed=!0,e);const h="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class D extends g{constructor(t,n,r){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=P;break;case 1:if(!t){this.destination=P;break}if("object"==typeof t){t instanceof D?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,t,n,r)}}[h](){return this}static create(t,n,r){const o=new D(t,n,r);return o.syncErrorThrowable=!1,o}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class w extends D{constructor(t,n,r,o){super(),this._parentSubscriber=t;let i,s=this;$(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==P&&(s=Object.create(n),$(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=i,this._error=r,this._complete=o}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:n}=this;y.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:n}=this,{useDeprecatedSynchronousErrorHandling:r}=y;if(this._error)r&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(n.syncErrorThrowable)r?(n.syncErrorValue=t,n.syncErrorThrown=!0):N(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;N(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const n=()=>this._complete.call(this._context);y.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,n){try{t.call(this._context,n)}catch(r){if(this.unsubscribe(),y.useDeprecatedSynchronousErrorHandling)throw r;N(r)}}__tryOrSetError(t,n,r){if(!y.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,r)}catch(o){return y.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=o,t.syncErrorThrown=!0,!0):(N(o),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const F="function"==typeof Symbol&&Symbol.observable||"@@observable";function ee(e){return e}let He=(()=>{class e{constructor(n){this._isScalar=!1,n&&(this._subscribe=n)}lift(n){const r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,o){const{operator:i}=this,s=function R(e,t,n){if(e){if(e instanceof D)return e;if(e[h])return e[h]()}return e||t||n?new D(e,t,n):new D(P)}(n,r,o);if(s.add(i?i.call(s,this.source):this.source||y.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),y.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s}_trySubscribe(n){try{return this._subscribe(n)}catch(r){y.useDeprecatedSynchronousErrorHandling&&(n.syncErrorThrown=!0,n.syncErrorValue=r),function S(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof D?n:null}return!0}(n)?n.error(r):console.warn(r)}}forEach(n,r){return new(r=We(r))((o,i)=>{let s;s=this.subscribe(a=>{try{n(a)}catch(l){i(l),s&&s.unsubscribe()}},i,o)})}_subscribe(n){const{source:r}=this;return r&&r.subscribe(n)}[F](){return this}pipe(...n){return 0===n.length?this:function we(e){return 0===e.length?ee:1===e.length?e[0]:function(n){return e.reduce((r,o)=>o(r),n)}}(n)(this)}toPromise(n){return new(n=We(n))((r,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>r(i))})}}return e.create=t=>new e(t),e})();function We(e){if(e||(e=y.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const ye=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})();class ve extends g{constructor(t,n){super(),this.subject=t,this.subscriber=n,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,n=t.observers;if(this.subject=null,!n||0===n.length||t.isStopped||t.closed)return;const r=n.indexOf(this.subscriber);-1!==r&&n.splice(r,1)}}class xe extends D{constructor(t){super(t),this.destination=t}}let Me=(()=>{class e extends He{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[h](){return new xe(this)}lift(n){const r=new fn(this,this);return r.operator=n,r}next(n){if(this.closed)throw new ye;if(!this.isStopped){const{observers:r}=this,o=r.length,i=r.slice();for(let s=0;s<o;s++)i[s].next(n)}}error(n){if(this.closed)throw new ye;this.hasError=!0,this.thrownError=n,this.isStopped=!0;const{observers:r}=this,o=r.length,i=r.slice();for(let s=0;s<o;s++)i[s].error(n);this.observers.length=0}complete(){if(this.closed)throw new ye;this.isStopped=!0;const{observers:n}=this,r=n.length,o=n.slice();for(let i=0;i<r;i++)o[i].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(n){if(this.closed)throw new ye;return super._trySubscribe(n)}_subscribe(n){if(this.closed)throw new ye;return this.hasError?(n.error(this.thrownError),g.EMPTY):this.isStopped?(n.complete(),g.EMPTY):(this.observers.push(n),new ve(this,n))}asObservable(){const n=new He;return n.source=this,n}}return e.create=(t,n)=>new fn(t,n),e})();class fn extends Me{constructor(t,n){super(),this.destination=t,this.source=n}next(t){const{destination:n}=this;n&&n.next&&n.next(t)}error(t){const{destination:n}=this;n&&n.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:n}=this;return n?this.source.subscribe(t):g.EMPTY}}function he(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}Error,globalThis;Symbol;class ex{constructor(){this.limitUI04=this.maxFromBits(4),this.limitUI06=this.maxFromBits(6),this.limitUI08=this.maxFromBits(8),this.limitUI12=this.maxFromBits(12),this.limitUI14=this.maxFromBits(14),this.limitUI16=this.maxFromBits(16),this.limitUI32=this.maxFromBits(32),this.limitUI40=this.maxFromBits(40),this.limitUI48=this.maxFromBits(48),this.create()}toString(){return this.hex}toURN(){return"urn:uuid:"+this.hex}toSignalK(){return`urn:mrn:signalk:uuid:${this.hex}`}toBytes(){let t=this.hex.split("-"),n=[],r=0;for(let o=0;o<t.length;o++)for(let i=0;i<t[o].length;i+=2)n[r++]=parseInt(t[o].substr(i,2),16);return n}maxFromBits(t){return Math.pow(2,t)}getRandomInt(t,n){return Math.floor(Math.random()*(n-t+1))+t}randomUI04(){return this.getRandomInt(0,this.limitUI04-1)}randomUI06(){return this.getRandomInt(0,this.limitUI06-1)}randomUI08(){return this.getRandomInt(0,this.limitUI08-1)}randomUI12(){return this.getRandomInt(0,this.limitUI12-1)}randomUI14(){return this.getRandomInt(0,this.limitUI14-1)}randomUI16(){return this.getRandomInt(0,this.limitUI16-1)}randomUI32(){return this.getRandomInt(0,this.limitUI32-1)}randomUI40(){return(0|Math.random()*(1<<30))+(0|1024*Math.random())*(1<<30)}randomUI48(){return(0|Math.random()*(1<<30))+(0|Math.random()*(1<<18))*(1<<30)}create(){this.fromParts(this.randomUI32(),this.randomUI16(),16384|this.randomUI12(),128|this.randomUI06(),this.randomUI08(),this.randomUI48())}paddedString(t,n,r=null){r=r||"0";let o=n-(t=String(t)).length;for(;o>0;o>>>=1,r+=r)1&o&&(t=r+t);return t}fromParts(t,n,r,o,i,s){return this.version=r>>12&15,this.hex=this.paddedString(t.toString(16),8)+"-"+this.paddedString(n.toString(16),4)+"-"+this.paddedString(r.toString(16),4)+"-"+this.paddedString(o.toString(16),2)+this.paddedString(i.toString(16),2)+"-"+this.paddedString(s.toString(16),12),this}}class Ys{static updates(){return{context:null,updates:[]}}static subscribe(){return{context:null,subscribe:[]}}static unsubscribe(){return{context:null,unsubscribe:[]}}static request(){return{requestId:(new ex).toString()}}}let nx=(()=>{class e{constructor(){this._filter="",this._wsTimeout=2e4,this._token="",this._playbackMode=!1,this.version=1,this.endpoint="",this.selfId="",this._source=null,this._connect=new Me,this.onConnect=this._connect.asObservable(),this._close=new Me,this.onClose=this._close.asObservable(),this._error=new Me,this.onError=this._error.asObservable(),this._message=new Me,this.onMessage=this._message.asObservable()}set source(n){this._source||(this._source={}),this._source.label=n}set authToken(n){this._token=n}get connectionTimeout(){return this._wsTimeout}set connectionTimeout(n){this._wsTimeout=n<3e3?3e3:n>6e4?6e4:n}get isOpen(){return!(!this.ws||1==this.ws.readyState||3==this.ws.readyState)}get filter(){return this._filter}set filter(n){this._filter=n&&-1!=n.indexOf("self")?this.selfId?this.selfId:"":n}get playbackMode(){return this._playbackMode}close(){this.ws&&(this.ws.close(),this.ws=null)}open(n,r,o){if(!(n=n||this.endpoint))return;let i=-1==n.indexOf("?")?"?":"&";r&&(n+=`${i}subscribe=${r}`),(this._token||o)&&(n+=`${r?"&":"?"}token=${this._token||o}`),this.close(),this.ws=new WebSocket(n),setTimeout(()=>{this.ws&&1!=this.ws.readyState&&3!=this.ws.readyState&&(console.warn(`Connection watchdog expired (${this._wsTimeout/1e3} sec): ${this.ws.readyState}... aborting connection...`),this.close())},this._wsTimeout),this.ws.onopen=s=>{this._connect.next(s)},this.ws.onclose=s=>{this._close.next(s)},this.ws.onerror=s=>{this._error.next(s)},this.ws.onmessage=s=>{this.parseOnMessage(s)}}parseOnMessage(n){let r;if("string"==typeof n.data)try{r=JSON.parse(n.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(n){if("object"!=typeof n)return"";let r=Ys.request();return typeof n.login>"u"&&this._token&&(r.token=this._token),Object.keys(n).forEach(i=>{r[i]=n[i]}),this.send(r),r.requestId}put(n,r,o){return this.sendRequest({context:"self"==n?"vessels.self":n,put:{path:r,value:o}})}login(n,r){return this.sendRequest({login:{username:n,password:r}})}send(n){this.ws&&("object"==typeof n&&(n=JSON.stringify(n)),this.ws.send(n))}sendUpdate(n="self",r,o){let i=Ys.updates();this._token&&(i.token=this._token),i.context="self"==n?"vessels.self":n,this._token&&(i.token=this._token);let s=[];"string"==typeof r&&s.push({path:r,value:o}),"object"==typeof r&&Array.isArray(r)&&(s=r);let a={timestamp:(new Date).toISOString(),values:s};this._source&&(a.source=this._source),i.updates.push(a),this.send(i)}subscribe(n="*",r="*",o){let i=Ys.subscribe();if(this._token&&(i.token=this._token),i.context="self"==n?"vessels.self":n,this._token&&(i.token=this._token),"object"==typeof r&&Array.isArray(r)&&(i.subscribe=r),"string"==typeof r){let s={};s.path=r,o&&"object"==typeof o&&(o.period&&(s.period=o.period),o.minPeriod&&(s.minPeriod=o.period),o.format&&("delta"==o.format||"full"==o.format)&&(s.format=o.format),o.policy&&("instant"==o.policy||"ideal"==o.policy||"fixed"==o.policy)&&(s.policy=o.policy)),i.subscribe.push(s)}this.send(i)}unsubscribe(n="*",r="*"){let o=Ys.unsubscribe();this._token&&(o.token=this._token),o.context="self"==n?"vessels.self":n,this._token&&(o.token=this._token),"object"==typeof r&&Array.isArray(r)&&(o.unsubscribe=r),"string"==typeof r&&o.unsubscribe.push({path:r}),this.send(o)}raiseAlarm(n="*",r,o){let i;i="string"==typeof r&&-1==r.indexOf("notifications.")?`notifications.${r}`:r,this.put(n,i,o.value)}clearAlarm(n="*",r){let o=-1==r.indexOf("notifications.")?`notifications.${r}`:r;this.put(n,o,null)}isSelf(n){return n.context==this.selfId}isDelta(n){return typeof n.context<"u"}isHello(n){return typeof n.version<"u"&&typeof n.self<"u"}isResponse(n){return typeof n.requestId<"u"}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=he({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class ox{constructor(t,n,r,o){this._method=[],this._message="",this._message=typeof t<"u"?t:"",this._state=typeof n<"u"?n:Ty.alarm,r&&this._method.push(Tc.visual),o&&this._method.push(Tc.sound)}get value(){return{message:this._message,state:this._state,method:this._method}}}var Ty=function(e){return e.normal="normal",e.alert="alert",e.warn="warn",e.alarm="alarm",e.emergency="emergency",e}(Ty||{}),Tc=function(e){return e.visual="visual",e.sound="sound",e}(Tc||{});class sx{constructor(){this.obsList=[],this.stream=new nx,this._connect=new Me,this.onConnect=this._connect.asObservable(),this._close=new Me,this.onClose=this._close.asObservable(),this._error=new Me,this.onError=this._error.asObservable(),this._message=new Me,this.onMessage=this._message.asObservable()}get endpoint(){return this.stream.endpoint}set endpoint(t){this.stream.endpoint=t}get selfId(){return this.stream.selfId}set selfId(t){this.stream.selfId=t}get _source(){return this.stream._source}set _source(t){this.stream._source=t}set source(t){this.stream.source=t}set authToken(t){this.stream.authToken=t}get connectionTimeout(){return this.stream.connectionTimeout}set connectionTimeout(t){this.stream.connectionTimeout=t}get isOpen(){return this.stream.isOpen}get filter(){return this.stream.filter}set filter(t){this.stream.filter=t}get playbackMode(){return this.stream.playbackMode}open(t,n="none",r){this.obsList.push(this.stream.onConnect.subscribe(o=>this._connect.next(o))),this.obsList.push(this.stream.onClose.subscribe(o=>this._close.next(o))),this.obsList.push(this.stream.onError.subscribe(o=>this._error.next(o))),this.obsList.push(this.stream.onMessage.subscribe(o=>this._message.next(o))),this.stream.open(t,n,r)}close(){this.stream.close(),this.obsList.forEach(t=>t.unsubscribe()),this.obsList=[]}sendRequest(t){return this.stream.sendRequest(t)}put(t,n,r){return this.stream.put(t,n,r)}login(t,n){return this.stream.login(t,n)}send(t){this.stream.send(t)}sendUpdate(t="self",n,r){this.stream.sendUpdate(t,n,r)}subscribe(t="*",n="*",r){this.stream.subscribe(t,n,r)}unsubscribe(t="*",n="*"){this.stream.unsubscribe(t,n)}raiseAlarm(t="*",n,r){this.stream.raiseAlarm(t,n,r)}clearAlarm(t="*",n){this.stream.clearAlarm(t,n)}isSelf(t){return this.stream.isSelf(t)}isDelta(t){return this.stream.isDelta(t)}isHello(t){return this.stream.isHello(t)}isResponse(t){return this.stream.isResponse(t)}}class Ny{id;position=[0,0];heading;headingTrue=null;headingMagnetic=null;cog;cogTrue=null;cogMagnetic=null;sog;name;mmsi;callsign;state;wind={direction:null,mwd:null,twd:null,tws:null,speedTrue:null,sog:null,awa:null,aws:null};lastUpdated=new Date;orientation=0;buddy=!1;closestApproach=null;mode="day";anchor={maxRadius:null,radius:null,position:null};resourceUpdates=[];autopilot={};track=[];courseApi={arrivalCircle:0,activeRoute:{},nextPoint:{},previousPoint:{}};properties={}}class Sy{id;lastUpdated=new Date;name;mmsi;position=[0,0];properties={};state}class Nc extends Sy{type={id:-1,name:""};constructor(){super()}}class ax extends Nc{callsign;constructor(){super()}}class lx extends Sy{orientation=0;sog=0;callsign;track=[];constructor(){super()}}class ux extends Nc{callsign;constructor(){super()}}class Sc{static celciusToKelvin(t=0){return t+273.15}static kelvinToCelcius(t=0){return t-273.15}static kelvinToFarenheit(t=0){return 1.8*t-459.67}static degreesToRadians(t=0){return t*Math.PI/180}static radiansToDegrees(t=0){return 180*t/Math.PI}static angleToDirection(t,n){const r=2*Math.PI;if(n||(n=0),t||(t=0),isNaN(n)||isNaN(t))return null;const o=n+t;return o>r?o-r:o<0?r+o:o}static directionToAngle(t,n){const r=2*Math.PI;if(n||(n=0),t||(t=0),isNaN(n)||isNaN(t))return null;const o=n-t;let i;if(o>0)i=o>Math.PI?r-o:0-o;else if(o<0){const s=Math.abs(o);i=s>Math.PI?s-r:s}else i=o;return i}static knotsToKm(t){return 1.852*t}static nauticalMilesToKm(t){return 1.852*t}static knotsToMSec(t){return.51444325460445*t}static kmToKnots(t){return.539957*t}static kmToNauticalMiles(t){return.539957*t}static kmToMiles(t){return.621371*t}static metersToFeet(t){return 3.28084*t}static msecToKnots(t){return 1.94384*t}static msecToKmh(t){return 3.6*t}static msecToMph(t){return 2.23694*t}static nauticalMilesToMiles(t){return 1.15078*t}static milesToKm(t){return 1.60934*t}static milesToNauticalMiles(t){return.868976*t}static rpmToHertz(t){return t/60}}var ii=ta(2541);class Hr{static destCoordinate(t,n,r){const o=(0,ii.computeDestinationPoint)(t,r,Sc.radiansToDegrees(n));return[o.longitude,o.latitude]}static distanceTo(t,n){return(0,ii.getDistance)(t,n)}static routeLength(t){return(0,ii.getPathLength)(t)}static centreOfPolygon(t){const n=(0,ii.getCenter)(t);return[n.longitude,n.latitude]}static inDLCrossingZone(t,n=170){return Math.abs(t[0])>=n}static inBounds(t,n){return(0,ii.isPointInPolygon)(t,[[n[0],n[1]],[n[0],n[3]],[n[2],n[3]],[n[2],n[1]],[n[0],n[1]]])}static calcMapifiedExtent(t,n){const o=111111*Math.cos(Sc.degreesToRadians(t[1])),i=[0,0,0,0];return i[1]=t[1]+(0-Math.abs(n))/111111,i[3]=t[1]+Math.abs(n)/111111,i[0]=t[0]+(0-Math.abs(n))/o,i[2]=t[0]+Math.abs(n)/o,i}static normaliseCoords(t){if(!Array.isArray(t))return[0,0];if("number"==typeof t[0]){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}return Array.isArray(t[0])?(t.forEach(n=>this.normaliseCoords(n)),t):void 0}}class cx{action;playback=!1;result=null;type;self=null;timestamp;constructor(t){this.action="notification",this.type=t}}class xy{action;playback=!1;result=null;timestamp;self=null;constructor(){this.action="update"}}class dx extends xy{constructor(){super(),this.action="trail"}}var fx=ta(6380);const px=["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"];let X,je,Py;const si=[];let Oc,Js=[],Pc=!1,Xs=!1;const Se={signalk:{},aisState:[]};let tt,Ry,Oy=[0,0,0,0],Ay=60,ai=0,Ln={},jn=500,Yt=!1;const Jt={maxAge:54e4,staleAge:36e4,lastTick:(new Date).valueOf(),maxTrack:20},li={trailDuration:24,trailResolution:{lastHour:"5s",next23:"10s",beyond24:"1m"}};let ui,ci="freeboard-sk";function ky(){tt={updated:{},stale:{},expired:{}}}function ea({action:e,msg:t}){switch(e){case"onConnect":postMessage({action:"open",playback:Yt,result:t.target.readyState});break;case"onClose":console.warn("streamEvent: ",t),jy(!1);break;case"onError":console.warn("streamEvent: ",t),postMessage({action:"error",playback:Yt,result:"Connection error!"});break;case"onMessage":!function Ix(e){je.isHello(e)?(postMessage({action:"hello",result:e,self:e.self,playback:Yt}),jn&&$y()):je.isDelta(e)?(Pc=!0,e.updates.forEach(t=>{t.values&&(ui=t.$source,t.values.forEach(n=>{if(Ry=t.timestamp,e.context)switch(e.context.split(".")[0]){case"shore":case"atons":Se?.signalk.atons&&function wx(e,t){let n=!1;if(-1!==e.indexOf("shore.basestations")&&(n=!0),!X.atons.has(e)){const o=new Nc;o.id=e,o.position=null,n&&(o.type.id=-1,o.type.name="Basestation"),X.atons.set(e,o)}const r=X.atons.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.atonType<"u"&&(r.type=t.value.atonType)):"atonType"===t.path?r.type=t.value:"navigation.position"===t.path?(r.position=[t.value.longitude,t.value.latitude],r.positionReceived=!0):r.properties[t.path]=t.value}(e.context,n),fi(e.context,X.atons,Se?.signalk.atons);break;case"sar":Se?.signalk.sar&&function Mx(e,t){if(!X.sar.has(e)){const r=new ax;r.id=e,r.position=null,r.type.id=-1,r.type.name="SaR Beacon",X.sar.set(e,r)}const n=X.sar.get(e);""===t.path?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi)):"communication.callsignVhf"===t.path?n.callsign=t.value:"navigation.position"===t.path&&t.value&&(n.position=Hr.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0)}(e.context,n),fi(e.context,X.sar,Se?.signalk.sar);break;case"aircraft":Se?.signalk.aircraft&&function Ex(e,t){if(!X.aircraft.has(e)){const r=new lx;r.id=e,r.position=null,X.aircraft.set(e,r)}const n=X.aircraft.get(e);""===t.path?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi)):"communication.callsignVhf"===t.path?n.callsign=t.value:"navigation.position"===t.path&&t.value?(n.position=Hr.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0,Ac(n)):"navigation.courseOverGroundTrue"===t.path?n.orientation=t.value:"navigation.speedOverGround"===t.path&&(n.sog=t.value)}(e.context,n),fi(e.context,X.aircraft,Se?.signalk.aircraft);break;case"meteo":Se?.signalk.meteo&&(function _x(e,t){if(!X.meteo.has(e)){const r=new ux;r.id=e,r.position=null,r.type.id=-1,r.type.name="Weather Station",X.meteo.set(e,r)}const n=X.meteo.get(e);if(""===t.path){if(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"){const r=e.split(":").slice(-2);n.mmsi=2===r.length?`${r[0]}:${r[1]}`:t.value.mmsi}}else"communication.callsignVhf"===t.path?n.callsign=t.value:"navigation.position"===t.path&&t.value&&(n.position=Hr.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0)}(e.context,n),By(n)),fi(e.context,X.meteo,Se?.signalk.meteo);break;case"vessels":if(je.isSelf(e))Uy(X.self,n,!0),By(n);else{if(Se?.signalk.vessels){const r=function Dx(e){if(!X.aisTargets.has(e)){const t=new Ny;t.position=null,X.aisTargets.set(e,t)}return X.aisTargets.get(e)}(e.context);Uy(r,n)}fi(e.context,X.aisTargets,Se?.signalk.vessels,Se?.aisState)}}}))}),Vy()):je.isResponse(e)&&postMessage({action:"response",result:e})}(t)}}function Ly(e={}){e.interval&&"number"==typeof e.interval&&(jn=e.interval,Hy(),$y(),Ay=1/(jn/1e3)*60),Yt=!!e.playback,e.selections&&(typeof e.selections.preferredPaths<"u"&&(Ln=e.selections.preferredPaths),e.selections.aisMaxAge&&"number"==typeof e.selections.aisMaxAge&&(Jt.maxAge=e.selections.aisMaxAge),e.selections.aisStaleAge&&"number"==typeof e.selections.aisStaleAge&&(Jt.staleAge=e.selections.aisStaleAge),"number"==typeof e.selections.signalk.maxRadius&&(Se.signalk=e.selections.signalk),typeof e.selections.aisState<"u"&&Array.isArray(e.selections.aisState)&&(Se.aisState=e.selections.aisState),console.log("Worker: AIS Filter...",Se))}function jy(e=!1){Hy(),si.forEach(t=>t.unsubscribe()),je&&e&&je.close(),je=null,postMessage({action:"close",result:e,playback:Yt})}function di(e){return new Promise((t,n)=>{fetch(`${e}`).then(r=>{r.json().then(o=>t(o)).catch(o=>n(o))}).catch(r=>{n(r)})})}function Fy(){di(Oc+"/tracks"+(Se&&Se.signalk&&Se.signalk.maxRadius?`?radius=${Se.signalk.maxRadius}`:"?radius=10000")).then(t=>{Xs=!0,Object.entries(t).forEach(n=>{if(X.aisTargets.has(n[0])){const r=X.aisTargets.get(n[0]);r.track=n[1].coordinates,Ac(r)}})}).catch(()=>{Xs=!1,console.warn("Unable to fetch AIS tracks!")})}function fi(e,t,n=!0,r=[]){if(n){let o=t.get(e);o&&r.includes(o?.state)&&(console.log(`state match => ${r}, ${e}`),tt.expired[e]=!0,o=null),o&&Se.signalk.maxRadius?o.positionReceived&&Hr.inBounds(o.position,Oy)?tt.updated[e]=!0:(t.delete(e),tt.expired[e]=!0):tt.updated[e]=!0}else 0!==t.size&&(t.forEach((o,i)=>{tt.expired[i]=!0}),t.clear())}function Vy(e=!1){if(!jn||e){const t=new xy;t.playback=Yt,X.aisStatus.updated=Object.keys(tt.updated),X.aisStatus.stale=Object.keys(tt.stale),X.aisStatus.expired=Object.keys(tt.expired),t.result=X,t.timestamp=Yt?Ry:X.self.lastUpdated.toISOString(),postMessage(t),ky(),X.self.resourceUpdates=[],0===ai&&(function bx(){const e=(new Date).valueOf();X.aisTargets.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Jt.maxAge?(tt.expired[n]=!0,X.aisTargets.delete(n)):t.lastUpdated.valueOf()<e-Jt.staleAge&&(tt.stale[n]=!0)}),X.aircraft.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Jt.maxAge?(tt.expired[n]=!0,X.aircraft.delete(n)):t.lastUpdated.valueOf()<e-Jt.staleAge&&(tt.stale[n]=!0)}),X.sar.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Jt.maxAge?(tt.expired[n]=!0,X.sar.delete(n)):t.lastUpdated.valueOf()<e-Jt.staleAge&&(tt.stale[n]=!0)})}(),X.self.positionReceived&&Se?.signalk.maxRadius&&(Oy=Hr.calcMapifiedExtent(X.self.position,Se.signalk.maxRadius),ai++)),ai=ai>=Ay?0:ai+1}}function $y(){jn&&"number"==typeof jn&&Js.push(setInterval(()=>{Pc&&(Vy(!0),Pc=!1)},jn)),Js.push(setInterval(()=>{console.warn("hasTrackPlugin",Xs),Xs&&Fy()},6e4))}function Hy(){Js.forEach(e=>clearInterval(e)),Js=[]}function Uy(e,t,n=!1){if(e.lastUpdated=new Date,n){const r=-1!==t.path.indexOf("course")?t.path.split(".").slice(0,2).join("."):t.path;-1!==px.indexOf(r)&&(X.paths[r]=null)}if(""===t.path)typeof t.value.name<"u"&&(e.name=t.value.name),typeof t.value.mmsi<"u"&&(e.mmsi=t.value.mmsi),typeof t.value.buddy<"u"&&(e.buddy=t.value.buddy);else if("communication.callsignVhf"===t.path)e.callsign=t.value;else if("navigation.position"===t.path&&t.value){if(typeof t.value.latitude>"u"||typeof t.value.longitude>"u")return;e.position=Hr.normaliseCoords([t.value.longitude,t.value.latitude]),e.positionReceived=!0,n||Ac(e)}else"navigation.state"===t.path?e.state=t.value:"navigation.speedOverGround"===t.path?e.sog=t.value:"navigation.courseOverGroundTrue"===t.path?e.cogTrue=t.value:"navigation.courseOverGroundMagnetic"===t.path?e.cogMagnetic=t.value:"navigation.headingTrue"===t.path?e.headingTrue=t.value:"navigation.headingMagnetic"===t.path?e.headingMagnetic=t.value:"environment.wind.angleApparent"===t.path?e.wind.awa=t.value:"environment.wind.speedApparent"===t.path?e.wind.aws=t.value:"environment.wind.speedTrue"===t.path?e.wind.speedTrue=t.value:"environment.wind.speedOverGround"===t.path?e.wind.sog=t.value:"environment.wind.directionTrue"===t.path?e.wind.twd=t.value:"environment.wind.directionMagnetic"===t.path?e.wind.mwd=t.value:"environment.mode"===t.path?e.mode=t.value:-1!==t.path.indexOf("navigation.course.")?-1!==t.path.indexOf("navigation.course.calcValues")?-1===t.path.indexOf("navigation.course.calcValues.previousPoint")&&(e[`course.${t.path.split(".").slice(-1)[0]}`]=t.value):-1!==t.path.indexOf("navigation.course.activeRoute")?e.courseApi.activeRoute=t.value:-1!==t.path.indexOf("navigation.course.nextPoint")?e.courseApi.nextPoint=t.value:-1!==t.path.indexOf("navigation.course.previousPoint")?e.courseApi.previousPoint=t.value:"navigation.course.arrivalCircle"===t.path&&(e.courseApi.arrivalCircle=t.value):-1!==t.path.indexOf("navigation.closestApproach")?e.closestApproach=t.value:"navigation.anchor.position"===t.path?e.anchor.position=t.value:"navigation.anchor.maxRadius"===t.path?e.anchor.maxRadius=t.value:"navigation.anchor.currentRadius"===t.path?e.anchor.radius=t.value:-1!==t.path.indexOf("resources.")?e.resourceUpdates.push(t):"steering.autopilot.state"===t.path&&ui===ci?e.autopilot.state=t.value:"steering.autopilot.mode"===t.path&&ui===ci?e.autopilot.mode=t.value:"steering.autopilot.target"===t.path&&ui===ci?e.autopilot.target=t.value:"steering.autopilot.engaged"===t.path&&ui===ci?e.autopilot.enabled=t.value:"steering.autopilot.defaultPilot"===t.path&&(ci=t.value);e.heading=null===e.heading&&null!==e.cog?e.cog:e.heading,typeof Ln.heading<"u"&&t.path===Ln.heading&&(e.orientation=t.value),typeof Ln.tws<"u"&&t.path===Ln.tws&&(e.wind.tws=t.value),typeof Ln.twd<"u"&&t.path===Ln.twd&&(e.wind.direction="environment.wind.angleTrueGround"===t.path||"environment.wind.angleTrueWater"===t.path?Sc.angleToDirection(t.value,e.heading):t.value)}function By(e,t){const n={path:e.path,value:e.value,context:t||null};let r;const o=e.path.split(".");if(("notifications.environment.depth.belowTransducer"===e.path||"notifications.environment.depth.belowSurface"===e.path||"notifications.environment.depth.belowKeel"===e.path)&&(r=o[2]),"notifications.navigation.anchor"===e.path&&(r=o[2]),-1!==["mob","sinking","fire","piracy","flooding","collision","grounding","listing","adrift","abandon"].indexOf(o[o.length-1])&&(r=o[o.length-1]),-1!==e.path.indexOf("notifications.navigation.closestApproach")&&(r=o[2],n.context=o[3]),-1!==e.path.indexOf("notifications.buddy")&&(r=o[1],n.context=o[2]),-1!==e.path.indexOf("notifications.navigation.course.arrivalCircleEntered")&&(r=o[3]),-1!==e.path.indexOf("notifications.navigation.course.perpendicularPassed")&&(r=o[3]),-1!==e.path.indexOf("notifications.meteo.warning")&&(r=o[1]),r){const i=new cx(r);i.playback=Yt,i.result=n,postMessage(i)}}function Ac(e){if(e.track&&0===e.track.length)e.track.push([e.position]);else{const n=e.track[e.track.length-1][e.track[e.track.length-1].length-1];n[0]!==e.position[0]&&n[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-Jt.maxTrack)}addEventListener("message",({data:e})=>{!function gx(e){if(e.cmd)switch(e.cmd){case"open":console.log("Worker control: opening stream..."),Ly(e.options),function vx(e){if(je)return;if(!e.url)return void postMessage({action:"error",result:"Valid options not provided!"});const t=e.url.split("/");if(t.pop(),t.push("api"),t[0]="wss:"===t[0]?"https:":"http:",Oc=t.join("/"),function hx(){X={self:new Ny,aisTargets:new Map,aisStatus:{updated:[],stale:[],expired:[]},paths:{},atons:new Map,aircraft:new Map,sar:new Map,meteo:new Map},X.self.positionReceived=!1,ky()}(),je=new sx,si.push(je.onConnect.subscribe(n=>ea({action:"onConnect",msg:n}))),si.push(je.onClose.subscribe(n=>ea({action:"onClose",msg:n}))),si.push(je.onError.subscribe(n=>ea({action:"onError",msg:n}))),si.push(je.onMessage.subscribe(n=>ea({action:"onMessage",msg:n}))),je.authToken=Py,e.playback){const n=e.playbackOptions.startTime?`?startTime=${e.playbackOptions.startTime}`:null;let r=e.playbackOptions.playbackRate?`playbackRate=${e.playbackOptions.playbackRate}`:null;r=r?n?"&"+r:"?"+r:null,je.open(`${e.url}${n||""}${r||""}`,e.playbackOptions.subscribe,e.token)}else je.open(e.url,e.subscribe,e.token),Fy()}(e.options);break;case"close":console.log("Worker control: closing stream..."),jy(!0);break;case"subscribe":console.log("Worker control: subscribing to paths..."),je.subscribe(e.options.context,e.options.path);break;case"settings":console.log("Worker control: settings..."),Ly(e.options);break;case"alarm":console.log("Worker control: alarm action..."),function yx(e){const t=-1===e.type.indexOf("notifications.")?`notifications.${e.type}`:e.type;e.raise?je.raiseAlarm("self",t,new ox(e.message,e.state,!0,!0)):je.clearAlarm("self",t)}(e.options);break;case"vessel":if(console.log("Worker control: vessel setting..."),e.options){let t;t="self"===e.options.context?X.self:X.aisTargets.get(e.options.context),t&&e.options.name&&(t.name=e.options.name)}break;case"auth":console.log("Worker control: auth token..."),e.options&&typeof e.options.token<"u"&&(Py=e.options.token);break;case"trail":console.log("Worker control: Fetch vessel trail from server..."),e.options&&(li.trailDuration=e.options.trailDuration??24,e.options.trailResolution&&(li.trailResolution.lastHour=e.options.trailResolution.lastHour??"5s",li.trailResolution.next23=e.options.trailResolution.next23??"1m",li.trailResolution.beyond24=e.options.trailResolution.beyond24??"5m")),function mx(e){console.info("Worker: Fetching vessel trail from server",e);const t=Oc+"/self/track?",n=[];e.trailDuration>24&&(n.push(di(`${t}timespan=${e.trailDuration-24}h&resolution=${e.trailResolution.beyond24}×panOffset=24`)),n.push(di(`${t}timespan=23h&resolution=${e.trailResolution.next23}×panOffset=1`))),e.trailDuration>1&&e.trailDuration<25&&n.push(di(`${t}timespan=${e.trailDuration-1}h&resolution=${e.trailResolution.next23}×panOffset=1`)),n.push(di(`${t}timespan=1h&resolution=${e.trailResolution.lastHour}`));let i=[];const s=new dx;s.playback=Yt,Promise.all(n).then(a=>{let l=0;const u=n.length-1;a.forEach(d=>{if(d.type&&"MultiLineString"===d.type&&d.coordinates&&Array.isArray(d.coordinates))if(l!==u){let p=[];for(d.coordinates.forEach(v=>{p=p.concat(v)}),p=(0,fx.p$)(p,5e-4,true);p.length>60;){const v=p.slice(0,60);i.push(v),p=p.slice(59),p[0]=[p[0][0]+5e-9,p[0][1]+5e-9]}0!==p.length&&i.push(p)}else i=i.concat(d.coordinates);l++}),s.result=i,postMessage(s)}).catch(()=>{s.result=null,postMessage(s)})}(li)}}(e)})})()})();
|
|
1
|
+
(()=>{"use strict";var qy={2222:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=T(y(7029)),P=T(y(3100)),_=T(y(5705)),O=T(y(942)),M=y(7636);function T(h){return h&&h.__esModule?h:{default:h}}f.default=function(I,D,w){var S=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,R=(0,N.default)(I),F=(0,P.default)(I),ee=D/S,ce=(0,_.default)(w),we=(0,_.default)(R),He=(0,_.default)(F),We=Math.asin(Math.sin(we)*Math.cos(ee)+Math.cos(we)*Math.sin(ee)*Math.cos(ce)),Ve=He+Math.atan2(Math.sin(ce)*Math.sin(ee)*Math.cos(we),Math.cos(ee)-Math.sin(we)*Math.sin(We)),ye=(0,O.default)(Ve);return(ye<M.MINLON||ye>M.MAXLON)&&(Ve=(Ve+3*Math.PI)%(2*Math.PI)-Math.PI,ye=(0,O.default)(Ve)),{latitude:(0,O.default)(We),longitude:ye}}},7636:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.areaConversion=f.timeConversion=f.distanceConversion=f.altitudeKeys=f.latitudeKeys=f.longitudeKeys=f.MAXLON=f.MINLON=f.MAXLAT=f.MINLAT=f.earthRadius=f.sexagesimalPattern=void 0,f.sexagesimalPattern=/^([0-9]{1,3})\xb0\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['\u2032]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["\u2033]\s*)?([NEOSW]?)$/,f.earthRadius=6378137,f.MINLAT=-90,f.MAXLAT=90,f.MINLON=-180,f.MAXLON=180,f.longitudeKeys=["lng","lon","longitude",0],f.latitudeKeys=["lat","latitude",1],f.altitudeKeys=["alt","altitude","elevation","elev",2],f.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},f.timeConversion={m:60,h:3600,d:86400};var D={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};f.areaConversion=D,D.sqm=D.m2,D.sqkm=D.km2,D.sqft=D.ft2,D.sqyd=D.yd2,D.sqin=D.in2},179:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){var g=N.areaConversion[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m"];if(g)return M*g;throw new Error("Invalid unit used for area conversion.")}},917:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){var g=N.distanceConversion[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m"];if(g)return M*g;throw new Error("Invalid unit used for distance conversion.")}},1167:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh"){case"kmh":return M*N.timeConversion.h*N.distanceConversion.km;case"mph":return M*N.timeConversion.h*N.distanceConversion.mi;default:return M}}},8948:($,f)=>{function y(h,I){return function M(h){if(Array.isArray(h))return h}(h)||function O(h,I){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(h)){var D=[],w=!0,S=!1,R=void 0;try{for(var ee,F=h[Symbol.iterator]();!(w=(ee=F.next()).done)&&(D.push(ee.value),!I||D.length!==I);w=!0);}catch(ce){S=!0,R=ce}finally{try{!w&&null!=F.return&&F.return()}finally{if(S)throw R}}return D}}(h,I)||function P(h,I){if(h){if("string"==typeof h)return _(h,I);var D=Object.prototype.toString.call(h).slice(8,-1);if("Object"===D&&h.constructor&&(D=h.constructor.name),"Map"===D||"Set"===D)return Array.from(h);if("Arguments"===D||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D))return _(h,I)}}(h,I)||function N(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(h,I){(null==I||I>h.length)&&(I=h.length);for(var D=0,w=new Array(I);D<I;D++)w[D]=h[D];return w}Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(I){var w=y(I.toString().split("."),2),R=w[1],F=Math.abs(Number(w[0])),ee=60*+("0."+(R||0)),ce=ee.toString().split("."),we=Math.floor(ee),He=function(I){var w=Math.pow(10,arguments.length>1&&void 0!==arguments[1]?arguments[1]:4);return Math.round(I*w)/w}(60*+("0."+(ce[1]||0))).toString(),Ve=y(He.split("."),2),ye=Ve[0],ve=Ve[1],xe=void 0===ve?"0":ve;return F+"\xb0 "+we.toString().padStart(2,"0")+"' "+ye.padStart(2,"0")+"."+xe.padEnd(1,"0")+'"'}},1118:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(2447));f.default=function(T,g){return(0,N.default)(T,g)[0]}},1691:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(5705)),P=M(y(7029)),_=M(y(3100)),O=y(7636);function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h){var I=0;if(h.length>2){for(var D,w,S,R=0;R<h.length;R++){R===h.length-2?(D=h.length-2,w=h.length-1,S=0):R===h.length-1?(D=h.length-1,w=0,S=1):(D=R,w=R+1,S=R+2);var F=(0,_.default)(h[D]),ee=(0,P.default)(h[w]),ce=(0,_.default)(h[S]);I+=((0,N.default)(ce)-(0,N.default)(F))*Math.sin((0,N.default)(ee))}I=I*O.earthRadius*O.earthRadius/2}return Math.abs(I)}},9144:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=_(y(7029)),P=_(y(3100));function _(T){return T&&T.__esModule?T:{default:T}}f.default=function(g){if(!1===Array.isArray(g)||0===g.length)throw new Error("No points were given.");return g.reduce(function(m,h){var I=(0,N.default)(h),D=(0,P.default)(h);return{maxLat:Math.max(I,m.maxLat),minLat:Math.min(I,m.minLat),maxLng:Math.max(D,m.maxLng),minLng:Math.min(D,m.minLng)}},{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}},190:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=T(y(7029)),P=T(y(3100)),_=T(y(5705)),O=T(y(942)),M=y(7636);function T(h){return h&&h.__esModule?h:{default:h}}f.default=function(I,D){var ve,xe,w=(0,N.default)(I),S=(0,P.default)(I),R=(0,_.default)(w),F=(0,_.default)(S),ee=D/M.earthRadius,ce=R-ee,we=R+ee,He=(0,_.default)(M.MAXLAT),We=(0,_.default)(M.MINLAT),Ve=(0,_.default)(M.MAXLON),ye=(0,_.default)(M.MINLON);if(ce>We&&we<He){var Me=Math.asin(Math.sin(ee)/Math.cos(R));(ve=F-Me)<ye&&(ve+=2*Math.PI),(xe=F+Me)>Ve&&(xe-=2*Math.PI)}else ce=Math.max(ce,We),we=Math.min(we,He),ve=ye,xe=Ve;return[{latitude:(0,O.default)(ce),longitude:(0,O.default)(ve)},{latitude:(0,O.default)(we),longitude:(0,O.default)(xe)}]}},5524:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(7029)),P=M(y(3100)),_=M(y(5705)),O=M(y(942));function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h){if(!1===Array.isArray(h)||0===h.length)return!1;var I=h.length,D=h.reduce(function(F,ee){var ce=(0,_.default)((0,N.default)(ee)),we=(0,_.default)((0,P.default)(ee));return{X:F.X+Math.cos(ce)*Math.cos(we),Y:F.Y+Math.cos(ce)*Math.sin(we),Z:F.Z+Math.sin(ce)}},{X:0,Y:0,Z:0}),w=D.X/I,S=D.Y/I,R=D.Z/I;return{longitude:(0,O.default)(Math.atan2(S,w)),latitude:(0,O.default)(Math.atan2(R,Math.sqrt(w*w+S*S)))}}},7088:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(9144));f.default=function(T){var g=(0,N.default)(T),h=g.minLng+(g.maxLng-g.minLng)/2;return{latitude:parseFloat((g.minLat+(g.maxLat-g.minLat)/2).toFixed(6)),longitude:parseFloat(h.toFixed(6))}}},9952:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(939));f.default=function(T,g){var m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.default,h="function"==typeof m?m(T,g):(0,N.default)(T,g);if(isNaN(h))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(h/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"}}},8744:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_,O){return O.reduce(function(M,T){if(typeof _>"u"||null===_)throw new Error("'".concat(_,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(_,T)&&typeof T<"u"&&typeof M>"u"?(M=T,T):M},void 0)}},4695:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636),P=function _(h){return h&&h.__esModule?h:{default:h}}(y(8744));function O(h,I){var D=Object.keys(h);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);I&&(w=w.filter(function(S){return Object.getOwnPropertyDescriptor(h,S).enumerable})),D.push.apply(D,w)}return D}function T(h,I,D){return I in h?Object.defineProperty(h,I,{value:D,enumerable:!0,configurable:!0,writable:!0}):h[I]=D,h}f.default=function(I){var D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:N.longitudeKeys,latitude:N.latitudeKeys,altitude:N.altitudeKeys},w=(0,P.default)(I,D.longitude),S=(0,P.default)(I,D.latitude),R=(0,P.default)(I,D.altitude);return function M(h){for(var I=1;I<arguments.length;I++){var D=null!=arguments[I]?arguments[I]:{};I%2?O(Object(D),!0).forEach(function(w){T(h,w,D[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(D)):O(Object(D)).forEach(function(w){Object.defineProperty(h,w,Object.getOwnPropertyDescriptor(D,w))})}return h}({latitude:S,longitude:w},R?{altitude:R}:{})}},8674:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=T(y(7029)),P=T(y(3100)),_=T(y(5705)),O=T(y(6522)),M=y(7636);function T(h){return h&&h.__esModule?h:{default:h}}f.default=function(I,D){var w=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;w=typeof w<"u"&&!isNaN(w)?w:1;var S=(0,N.default)(I),R=(0,P.default)(I),F=(0,N.default)(D),ee=(0,P.default)(D),ce=Math.acos((0,O.default)(Math.sin((0,_.default)(F))*Math.sin((0,_.default)(S))+Math.cos((0,_.default)(F))*Math.cos((0,_.default)(S))*Math.cos((0,_.default)(R)-(0,_.default)(ee))))*M.earthRadius;return Math.round(ce/w)*w}},7504:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=_(y(8674)),P=_(y(6522));function _(T){return T&&T.__esModule?T:{default:T}}f.default=function(g,m,h){var I=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,D=(0,N.default)(m,g,I),w=(0,N.default)(g,h,I),S=(0,N.default)(m,h,I),R=Math.acos((0,P.default)((D*D+S*S-w*w)/(2*D*S))),F=Math.acos((0,P.default)((w*w+S*S-D*D)/(2*w*S)));return R>Math.PI/2?D:F>Math.PI/2?w:Math.sin(R)*D}},884:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(7029)),P=M(y(3100)),_=M(y(5705)),O=M(y(942));function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h,I){var D=(0,N.default)(I),w=(0,P.default)(I),S=(0,N.default)(h),R=(0,P.default)(h);return((0,O.default)(Math.atan2(Math.sin((0,_.default)(w)-(0,_.default)(R))*Math.cos((0,_.default)(D)),Math.cos((0,_.default)(S))*Math.sin((0,_.default)(D))-Math.sin((0,_.default)(S))*Math.cos((0,_.default)(D))*Math.cos((0,_.default)(w)-(0,_.default)(R))))+360)%360}},7029:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636),P=O(y(8744)),_=O(y(5101));function O(g){return g&&g.__esModule?g:{default:g}}f.default=function(m,h){var I=(0,P.default)(m,N.latitudeKeys);if(!(typeof I>"u"||null===I)){var D=m[I];return!0===h?D:(0,_.default)(D)}}},3100:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636),P=O(y(8744)),_=O(y(5101));function O(g){return g&&g.__esModule?g:{default:g}}f.default=function(m,h){var I=(0,P.default)(m,N.longitudeKeys);if(!(typeof I>"u"||null===I)){var D=m[I];return!0===h?D:(0,_.default)(D)}}},5378:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(T){return T&&T.__esModule?T:{default:T}}(y(8674));function _(T){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(m){return typeof m}:function(m){return m&&"function"==typeof Symbol&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(T)}f.default=function(g){var m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.default;return g.reduce(function(h,I){return"object"===_(h)&&null!==h.last&&(h.distance+=m(I,h.last)),h.last=I,h},{last:null,distance:0}).distance}},2671:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(7029)),P=M(y(3100)),_=M(y(5705)),O=y(7636);function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h,I){var D=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;D=typeof D<"u"&&!isNaN(D)?D:1;var He,We,Ve,ye,ve,xe,Ht,w=(0,N.default)(h),S=(0,P.default)(h),R=(0,N.default)(I),F=(0,P.default)(I),ee=6356752.314245,ce=1/298.257223563,we=(0,_.default)(F-S),Me=Math.atan((1-ce)*Math.tan((0,_.default)(parseFloat(w)))),pn=Math.atan((1-ce)*Math.tan((0,_.default)(parseFloat(R)))),$t=Math.sin(Me),en=Math.cos(Me),hn=Math.sin(pn),de=Math.cos(pn),lt=we,mt=100;do{var K=Math.sin(lt),gn=Math.cos(lt);if(0===(xe=Math.sqrt(de*K*(de*K)+(en*hn-$t*de*gn)*(en*hn-$t*de*gn))))return 0;He=$t*hn+en*de*gn,We=Math.atan2(xe,He),ve=He-2*$t*hn/(ye=1-(Ve=en*de*K/xe)*Ve),isNaN(ve)&&(ve=0);var mn=ce/16*ye*(4+ce*(4-3*ye));Ht=lt,lt=we+(1-mn)*ce*Ve*(We+mn*xe*(ve+mn*He*(2*ve*ve-1)))}while(Math.abs(lt-Ht)>1e-12&&--mt>0);if(0===mt)return NaN;var It=ye*(O.earthRadius*O.earthRadius-ee*ee)/(ee*ee),Ut=It/1024*(256+It*(It*(74-47*It)-128));return Math.round(ee*(1+It/16384*(4096+It*(It*(320-175*It)-768)))*(We-Ut*xe*(ve+Ut/4*(He*(2*ve*ve-1)-Ut/6*ve*(4*xe*xe-3)*(4*ve*ve-3))))/D)*D}},939:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(7029)),P=M(y(3100)),_=M(y(5705)),O=M(y(942));function M(m){return m&&m.__esModule?m:{default:m}}f.default=function(h,I){var D=(0,_.default)((0,P.default)(I))-(0,_.default)((0,P.default)(h)),w=Math.log(Math.tan((0,_.default)((0,N.default)(I))/2+Math.PI/4)/Math.tan((0,_.default)((0,N.default)(h))/2+Math.PI/4));return Math.abs(D)>Math.PI&&(D=D>0?-1*(2*Math.PI-D):2*Math.PI+D),((0,O.default)(Math.atan2(D,w))+360)%360}},2845:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){return/^(NNE|NE|NNW|N)$/.test(_)?"N":/^(ENE|E|ESE|SE)$/.test(_)?"E":/^(SSE|S|SSW|SW)$/.test(_)?"S":/^(WSW|W|WNW|NW)$/.test(_)?"W":void 0}},8950:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(8674));f.default=function(T,g){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.default)(T,g)/(Number(g.time)-Number(T.time))*1e3}},2541:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0});var N={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(f,"computeDestinationPoint",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(f,"convertArea",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(f,"convertDistance",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(f,"convertSpeed",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(f,"decimalToSexagesimal",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(f,"findNearest",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(f,"getAreaOfPolygon",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(f,"getBounds",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(f,"getBoundsOfDistance",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(f,"getCenter",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(f,"getCenterOfBounds",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(f,"getCompassDirection",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(f,"getCoordinateKey",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(f,"getCoordinateKeys",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(f,"getDistance",{enumerable:!0,get:function(){return ee.default}}),Object.defineProperty(f,"getDistanceFromLine",{enumerable:!0,get:function(){return ce.default}}),Object.defineProperty(f,"getGreatCircleBearing",{enumerable:!0,get:function(){return we.default}}),Object.defineProperty(f,"getLatitude",{enumerable:!0,get:function(){return He.default}}),Object.defineProperty(f,"getLongitude",{enumerable:!0,get:function(){return We.default}}),Object.defineProperty(f,"getPathLength",{enumerable:!0,get:function(){return Ve.default}}),Object.defineProperty(f,"getPreciseDistance",{enumerable:!0,get:function(){return ye.default}}),Object.defineProperty(f,"getRhumbLineBearing",{enumerable:!0,get:function(){return ve.default}}),Object.defineProperty(f,"getRoughCompassDirection",{enumerable:!0,get:function(){return xe.default}}),Object.defineProperty(f,"getSpeed",{enumerable:!0,get:function(){return Me.default}}),Object.defineProperty(f,"isDecimal",{enumerable:!0,get:function(){return pn.default}}),Object.defineProperty(f,"isPointInLine",{enumerable:!0,get:function(){return $t.default}}),Object.defineProperty(f,"isPointInPolygon",{enumerable:!0,get:function(){return en.default}}),Object.defineProperty(f,"isPointNearLine",{enumerable:!0,get:function(){return hn.default}}),Object.defineProperty(f,"isPointWithinRadius",{enumerable:!0,get:function(){return de.default}}),Object.defineProperty(f,"isSexagesimal",{enumerable:!0,get:function(){return lt.default}}),Object.defineProperty(f,"isValidCoordinate",{enumerable:!0,get:function(){return Ht.default}}),Object.defineProperty(f,"isValidLatitude",{enumerable:!0,get:function(){return mt.default}}),Object.defineProperty(f,"isValidLongitude",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(f,"orderByDistance",{enumerable:!0,get:function(){return gn.default}}),Object.defineProperty(f,"sexagesimalToDecimal",{enumerable:!0,get:function(){return mn.default}}),Object.defineProperty(f,"toDecimal",{enumerable:!0,get:function(){return It.default}}),Object.defineProperty(f,"toRad",{enumerable:!0,get:function(){return Wr.default}}),Object.defineProperty(f,"toDeg",{enumerable:!0,get:function(){return Ut.default}}),Object.defineProperty(f,"wktToPolygon",{enumerable:!0,get:function(){return qr.default}});var P=J(y(2222)),_=J(y(179)),O=J(y(917)),M=J(y(1167)),T=J(y(8948)),g=J(y(1118)),m=J(y(1691)),h=J(y(9144)),I=J(y(190)),D=J(y(5524)),w=J(y(7088)),S=J(y(9952)),R=J(y(8744)),F=J(y(4695)),ee=J(y(8674)),ce=J(y(7504)),we=J(y(884)),He=J(y(7029)),We=J(y(3100)),Ve=J(y(5378)),ye=J(y(2671)),ve=J(y(939)),xe=J(y(2845)),Me=J(y(8950)),pn=J(y(3026)),$t=J(y(4194)),en=J(y(3536)),hn=J(y(2787)),de=J(y(202)),lt=J(y(4902)),Ht=J(y(7637)),mt=J(y(6563)),K=J(y(266)),gn=J(y(2447)),mn=J(y(1532)),It=J(y(5101)),Wr=J(y(5705)),Ut=J(y(942)),qr=J(y(354)),vn=y(7636);function J(H){return H&&H.__esModule?H:{default:H}}Object.keys(vn).forEach(function(H){"default"===H||"__esModule"===H||Object.prototype.hasOwnProperty.call(N,H)||Object.defineProperty(f,H,{enumerable:!0,get:function(){return vn[H]}})})},3026:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){var O=_.toString().trim();return!isNaN(parseFloat(O))&&parseFloat(O)===Number(O)}},4194:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(8674));f.default=function(T,g,m){return(0,N.default)(g,T)+(0,N.default)(T,m)===(0,N.default)(g,m)}},3536:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=_(y(7029)),P=_(y(3100));function _(T){return T&&T.__esModule?T:{default:T}}f.default=function(g,m){for(var h=!1,I=m.length,D=-1,w=I-1;++D<I;w=D)((0,P.default)(m[D])<=(0,P.default)(g)&&(0,P.default)(g)<(0,P.default)(m[w])||(0,P.default)(m[w])<=(0,P.default)(g)&&(0,P.default)(g)<(0,P.default)(m[D]))&&(0,N.default)(g)<((0,N.default)(m[w])-(0,N.default)(m[D]))*((0,P.default)(g)-(0,P.default)(m[D]))/((0,P.default)(m[w])-(0,P.default)(m[D]))+(0,N.default)(m[D])&&(h=!h);return h}},2787:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(7504));f.default=function(T,g,m,h){return(0,N.default)(T,g,m)<h}},202:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(8674));f.default=function(T,g,m){return(0,N.default)(T,g,.01)<m}},4902:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){return N.sexagesimalPattern.test(M.toString().trim())}},7637:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=O(y(4695)),P=O(y(6563)),_=O(y(266));function O(g){return g&&g.__esModule?g:{default:g}}f.default=function(m){var h=(0,N.default)(m),I=h.latitude,D=h.longitude;if(Array.isArray(m)&&m.length>=2)return(0,_.default)(m[0])&&(0,P.default)(m[1]);if(typeof I>"u"||typeof D>"u")return!1;var w=m[D],S=m[I];return!(typeof S>"u"||typeof w>"u"||!1===(0,P.default)(S)||!1===(0,_.default)(w))}},6563:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(3026)),P=M(y(4902)),_=M(y(1532)),O=y(7636);function M(m){return m&&m.__esModule?m:{default:m}}f.default=function m(h){return(0,N.default)(h)?!(parseFloat(h)>O.MAXLAT||h<O.MINLAT):!!(0,P.default)(h)&&m((0,_.default)(h))}},266:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=M(y(3026)),P=M(y(4902)),_=M(y(1532)),O=y(7636);function M(m){return m&&m.__esModule?m:{default:m}}f.default=function m(h){return(0,N.default)(h)?!(parseFloat(h)>O.MAXLON||h<O.MINLON):!!(0,P.default)(h)&&m((0,_.default)(h))}},2447:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=function P(M){return M&&M.__esModule?M:{default:M}}(y(8674));f.default=function(T,g){var m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:N.default;return m="function"==typeof m?m:N.default,g.slice().sort(function(h,I){return m(T,h)-m(T,I)})}},6522:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){return _>1?1:_<-1?-1:_}},1532:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=y(7636);f.default=function(M){var T=new RegExp(N.sexagesimalPattern).exec(M.toString().trim());if(typeof T>"u"||null===T)throw new Error("Given value is not in sexagesimal format");var g=Number(T[2])/60||0,m=Number(T[4])/3600||0,h=parseFloat(T[1])+g+m;return["S","W"].includes(T[7])?-h:h}},5101:($,f,y)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var N=T(y(3026)),P=T(y(4902)),_=T(y(1532)),O=T(y(7637)),M=T(y(4695));function T(w){return w&&w.__esModule?w:{default:w}}function g(w,S){var R=Object.keys(w);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(w);S&&(F=F.filter(function(ee){return Object.getOwnPropertyDescriptor(w,ee).enumerable})),R.push.apply(R,F)}return R}function m(w){for(var S=1;S<arguments.length;S++){var R=null!=arguments[S]?arguments[S]:{};S%2?g(Object(R),!0).forEach(function(F){h(w,F,R[F])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(R)):g(Object(R)).forEach(function(F){Object.defineProperty(w,F,Object.getOwnPropertyDescriptor(R,F))})}return w}function h(w,S,R){return S in w?Object.defineProperty(w,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[S]=R,w}f.default=function w(S){if((0,N.default)(S))return Number(S);if((0,P.default)(S))return(0,_.default)(S);if((0,O.default)(S)){var R=(0,M.default)(S);return Array.isArray(S)?S.map(function(F,ee){return[0,1].includes(ee)?w(F):F}):m(m(m({},S),R.latitude&&h({},R.latitude,w(S[R.latitude]))),R.longitude&&h({},R.longitude,w(S[R.longitude])))}return Array.isArray(S)?S.map(function(F){return(0,O.default)(F)?w(F):F}):S}},942:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){return 180*_/Math.PI}},5705:($,f)=>{Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(_){return _*Math.PI/180}},354:($,f)=>{function _(m,h){(null==h||h>m.length)&&(h=m.length);for(var I=0,D=new Array(h);I<h;I++)D[I]=m[I];return D}Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0,f.default=function(h){if(!h.startsWith("POLYGON"))throw new Error("Invalid wkt.");return h.slice(h.indexOf("(")+2,h.indexOf(")")).split(", ").map(function(w){var R=function y(m,h){return function M(m){if(Array.isArray(m))return m}(m)||function O(m,h){if(!(typeof Symbol>"u")&&Symbol.iterator in Object(m)){var I=[],D=!0,w=!1,S=void 0;try{for(var F,R=m[Symbol.iterator]();!(D=(F=R.next()).done)&&(I.push(F.value),!h||I.length!==h);D=!0);}catch(ee){w=!0,S=ee}finally{try{!D&&null!=R.return&&R.return()}finally{if(w)throw S}}return I}}(m,h)||function P(m,h){if(m){if("string"==typeof m)return _(m,h);var I=Object.prototype.toString.call(m).slice(8,-1);if("Object"===I&&m.constructor&&(I=m.constructor.name),"Map"===I||"Set"===I)return Array.from(m);if("Arguments"===I||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return _(m,h)}}(m,h)||function N(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(w.split(" "),2),ee=R[1];return{longitude:parseFloat(R[0]),latitude:parseFloat(ee)}})}},6729:($,f)=>{function y(g,m){return g*g+m*m}function N(g,m){return y(g[0]-m[0],g[1]-m[1])}function P(g,m,h){var I=m[0],D=m[1],w=h[0]-I,S=h[1]-D;if(0!==w||0!==S){var R=((g[0]-I)*w+(g[1]-D)*S)/y(w,S);R>1?(I=h[0],D=h[1]):R>0&&(I+=w*R,D+=S*R)}return y(g[0]-I,g[1]-D)}function O(g,m,h,I,D){for(var S,w=I,R=m+1;R<h;R++){var F=P(g[R],g[m],g[h]);F>w&&(S=R,w=F)}w>I&&(S-m>1&&O(g,m,S,I,D),D.push(g[S]),h-S>1&&O(g,S,h,I,D))}function M(g,m){var h=g.length-1,I=[g[0]];return O(g,0,h,m,I),I.push(g[h]),I}f.__esModule=!0,f.SimplifyAP=function T(g,m,h){if(void 0===m&&(m=1),void 0===h&&(h=!1),g.length<=2)return g;var I=m*m;return M(g=h?g:function _(g,m){for(var I,h=g[0],D=[h],w=1,S=g.length;w<S;w++)N(I=g[w],h)>m&&(D.push(I),h=I);return h!==I&&D.push(I),D}(g,I),I)}},6380:($,f,y)=>{var P=y(6729);f.p$=P.SimplifyAP,y(5551),y(6413)},5551:($,f)=>{function y(g,m){return g*g+m*m}function N(g,m){return y(g.longitude-m.longitude,g.latitude-m.latitude)}function P(g,m,h){var I=m.longitude,D=m.latitude,w=h.longitude-I,S=h.latitude-D;if(0!==w||0!==S){var R=((g.longitude-I)*w+(g.latitude-D)*S)/y(w,S);R>1?(I=h.longitude,D=h.latitude):R>0&&(I+=w*R,D+=S*R)}return y(g.longitude-I,g.latitude-D)}function O(g,m,h,I,D){for(var S,w=I,R=m+1;R<h;R++){var F=P(g[R],g[m],g[h]);F>w&&(S=R,w=F)}w>I&&(S-m>1&&O(g,m,S,I,D),D.push(g[S]),h-S>1&&O(g,S,h,I,D))}function M(g,m){var h=g.length-1,I=[g[0]];return O(g,0,h,m,I),I.push(g[h]),I}f.__esModule=!0,f.SimplifyLL=function T(g,m,h){if(void 0===m&&(m=1),void 0===h&&(h=!1),g.length<=2)return g;var I=m*m;return M(g=h?g:function _(g,m){for(var I,h=g[0],D=[h],w=1,S=g.length;w<S;w++)N(I=g[w],h)>m&&(D.push(I),h=I);return h!==I&&D.push(I),D}(g,I),I)}},6413:($,f)=>{function y(g,m){return g*g+m*m}function N(g,m){return y(g.x-m.x,g.y-m.y)}function P(g,m,h){var I=m.x,D=m.y,w=h.x-I,S=h.y-D;if(0!==w||0!==S){var R=((g.x-I)*w+(g.y-D)*S)/y(w,S);R>1?(I=h.x,D=h.y):R>0&&(I+=w*R,D+=S*R)}return y(g.x-I,g.y-D)}function O(g,m,h,I,D){for(var S,w=I,R=m+1;R<h;R++){var F=P(g[R],g[m],g[h]);F>w&&(S=R,w=F)}w>I&&(S-m>1&&O(g,m,S,I,D),D.push(g[S]),h-S>1&&O(g,S,h,I,D))}function M(g,m){var h=g.length-1,I=[g[0]];return O(g,0,h,m,I),I.push(g[h]),I}f.__esModule=!0,f.Simplify=function T(g,m,h){if(void 0===m&&(m=1),void 0===h&&(h=!1),g.length<=2)return g;var I=m*m;return M(g=h?g:function _(g,m){for(var I,h=g[0],D=[h],w=1,S=g.length;w<S;w++)N(I=g[w],h)>m&&(D.push(I),h=I);return h!==I&&D.push(I),D}(g,I),I)}}},Rc={};function ta($){var f=Rc[$];if(void 0!==f)return f.exports;var y=Rc[$]={exports:{}};return qy[$](y,y.exports,ta),y.exports}(()=>{function $(e){return"function"==typeof e}let f=!1;const y={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){if(e){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else f&&console.log("RxJS: Back to a better error behavior. Thank you. <3");f=e},get useDeprecatedSynchronousErrorHandling(){return f}};function N(e){setTimeout(()=>{throw e},0)}const P={closed:!0,next(e){},error(e){if(y.useDeprecatedSynchronousErrorHandling)throw e;N(e)},complete(){}},_=Array.isArray||(e=>e&&"number"==typeof e.length),T=(()=>{function e(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((n,r)=>`${r+1}) ${n.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return e.prototype=Object.create(Error.prototype),e})();class g{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let t;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:o,_subscriptions:i}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof g)n.remove(this);else if(null!==n)for(let s=0;s<n.length;++s)n[s].remove(this);if($(o)){r&&(this._unsubscribe=void 0);try{o.call(this)}catch(s){t=s instanceof T?m(s.errors):[s]}}if(_(i)){let s=-1,a=i.length;for(;++s<a;){const l=i[s];if(null!==(e=l)&&"object"==typeof e)try{l.unsubscribe()}catch(u){t=t||[],u instanceof T?t=t.concat(m(u.errors)):t.push(u)}}}var e;if(t)throw new T(t)}add(t){let n=t;if(!t)return g.EMPTY;switch(typeof t){case"function":n=new g(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof g)){const i=n;n=new g,n._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}let{_parentOrParents:r}=n;if(null===r)n._parentOrParents=this;else if(r instanceof g){if(r===this)return n;n._parentOrParents=[r,this]}else{if(-1!==r.indexOf(this))return n;r.push(this)}const o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n}remove(t){const n=this._subscriptions;if(n){const r=n.indexOf(t);-1!==r&&n.splice(r,1)}}}var e;function m(e){return e.reduce((t,n)=>t.concat(n instanceof T?n.errors:n),[])}g.EMPTY=((e=new g).closed=!0,e);const h="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class D extends g{constructor(t,n,r){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=P;break;case 1:if(!t){this.destination=P;break}if("object"==typeof t){t instanceof D?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new w(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new w(this,t,n,r)}}[h](){return this}static create(t,n,r){const o=new D(t,n,r);return o.syncErrorThrowable=!1,o}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class w extends D{constructor(t,n,r,o){super(),this._parentSubscriber=t;let i,s=this;$(n)?i=n:n&&(i=n.next,r=n.error,o=n.complete,n!==P&&(s=Object.create(n),$(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=i,this._error=r,this._complete=o}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:n}=this;y.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:n}=this,{useDeprecatedSynchronousErrorHandling:r}=y;if(this._error)r&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(n.syncErrorThrowable)r?(n.syncErrorValue=t,n.syncErrorThrown=!0):N(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;N(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const n=()=>this._complete.call(this._context);y.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,n){try{t.call(this._context,n)}catch(r){if(this.unsubscribe(),y.useDeprecatedSynchronousErrorHandling)throw r;N(r)}}__tryOrSetError(t,n,r){if(!y.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,r)}catch(o){return y.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=o,t.syncErrorThrown=!0,!0):(N(o),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const F="function"==typeof Symbol&&Symbol.observable||"@@observable";function ee(e){return e}let He=(()=>{class e{constructor(n){this._isScalar=!1,n&&(this._subscribe=n)}lift(n){const r=new e;return r.source=this,r.operator=n,r}subscribe(n,r,o){const{operator:i}=this,s=function R(e,t,n){if(e){if(e instanceof D)return e;if(e[h])return e[h]()}return e||t||n?new D(e,t,n):new D(P)}(n,r,o);if(s.add(i?i.call(s,this.source):this.source||y.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),y.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s}_trySubscribe(n){try{return this._subscribe(n)}catch(r){y.useDeprecatedSynchronousErrorHandling&&(n.syncErrorThrown=!0,n.syncErrorValue=r),function S(e){for(;e;){const{closed:t,destination:n,isStopped:r}=e;if(t||r)return!1;e=n&&n instanceof D?n:null}return!0}(n)?n.error(r):console.warn(r)}}forEach(n,r){return new(r=We(r))((o,i)=>{let s;s=this.subscribe(a=>{try{n(a)}catch(l){i(l),s&&s.unsubscribe()}},i,o)})}_subscribe(n){const{source:r}=this;return r&&r.subscribe(n)}[F](){return this}pipe(...n){return 0===n.length?this:function we(e){return 0===e.length?ee:1===e.length?e[0]:function(n){return e.reduce((r,o)=>o(r),n)}}(n)(this)}toPromise(n){return new(n=We(n))((r,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>r(i))})}}return e.create=t=>new e(t),e})();function We(e){if(e||(e=y.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const ye=(()=>{function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e})();class ve extends g{constructor(t,n){super(),this.subject=t,this.subscriber=n,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,n=t.observers;if(this.subject=null,!n||0===n.length||t.isStopped||t.closed)return;const r=n.indexOf(this.subscriber);-1!==r&&n.splice(r,1)}}class xe extends D{constructor(t){super(t),this.destination=t}}let Me=(()=>{class e extends He{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[h](){return new xe(this)}lift(n){const r=new pn(this,this);return r.operator=n,r}next(n){if(this.closed)throw new ye;if(!this.isStopped){const{observers:r}=this,o=r.length,i=r.slice();for(let s=0;s<o;s++)i[s].next(n)}}error(n){if(this.closed)throw new ye;this.hasError=!0,this.thrownError=n,this.isStopped=!0;const{observers:r}=this,o=r.length,i=r.slice();for(let s=0;s<o;s++)i[s].error(n);this.observers.length=0}complete(){if(this.closed)throw new ye;this.isStopped=!0;const{observers:n}=this,r=n.length,o=n.slice();for(let i=0;i<r;i++)o[i].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(n){if(this.closed)throw new ye;return super._trySubscribe(n)}_subscribe(n){if(this.closed)throw new ye;return this.hasError?(n.error(this.thrownError),g.EMPTY):this.isStopped?(n.complete(),g.EMPTY):(this.observers.push(n),new ve(this,n))}asObservable(){const n=new He;return n.source=this,n}}return e.create=(t,n)=>new pn(t,n),e})();class pn extends Me{constructor(t,n){super(),this.destination=t,this.source=n}next(t){const{destination:n}=this;n&&n.next&&n.next(t)}error(t){const{destination:n}=this;n&&n.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:n}=this;return n?this.source.subscribe(t):g.EMPTY}}function he(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}Error,globalThis;Symbol;class ex{constructor(){this.limitUI04=this.maxFromBits(4),this.limitUI06=this.maxFromBits(6),this.limitUI08=this.maxFromBits(8),this.limitUI12=this.maxFromBits(12),this.limitUI14=this.maxFromBits(14),this.limitUI16=this.maxFromBits(16),this.limitUI32=this.maxFromBits(32),this.limitUI40=this.maxFromBits(40),this.limitUI48=this.maxFromBits(48),this.create()}toString(){return this.hex}toURN(){return"urn:uuid:"+this.hex}toSignalK(){return`urn:mrn:signalk:uuid:${this.hex}`}toBytes(){let t=this.hex.split("-"),n=[],r=0;for(let o=0;o<t.length;o++)for(let i=0;i<t[o].length;i+=2)n[r++]=parseInt(t[o].substr(i,2),16);return n}maxFromBits(t){return Math.pow(2,t)}getRandomInt(t,n){return Math.floor(Math.random()*(n-t+1))+t}randomUI04(){return this.getRandomInt(0,this.limitUI04-1)}randomUI06(){return this.getRandomInt(0,this.limitUI06-1)}randomUI08(){return this.getRandomInt(0,this.limitUI08-1)}randomUI12(){return this.getRandomInt(0,this.limitUI12-1)}randomUI14(){return this.getRandomInt(0,this.limitUI14-1)}randomUI16(){return this.getRandomInt(0,this.limitUI16-1)}randomUI32(){return this.getRandomInt(0,this.limitUI32-1)}randomUI40(){return(0|Math.random()*(1<<30))+(0|1024*Math.random())*(1<<30)}randomUI48(){return(0|Math.random()*(1<<30))+(0|Math.random()*(1<<18))*(1<<30)}create(){this.fromParts(this.randomUI32(),this.randomUI16(),16384|this.randomUI12(),128|this.randomUI06(),this.randomUI08(),this.randomUI48())}paddedString(t,n,r=null){r=r||"0";let o=n-(t=String(t)).length;for(;o>0;o>>>=1,r+=r)1&o&&(t=r+t);return t}fromParts(t,n,r,o,i,s){return this.version=r>>12&15,this.hex=this.paddedString(t.toString(16),8)+"-"+this.paddedString(n.toString(16),4)+"-"+this.paddedString(r.toString(16),4)+"-"+this.paddedString(o.toString(16),2)+this.paddedString(i.toString(16),2)+"-"+this.paddedString(s.toString(16),12),this}}class Ys{static updates(){return{context:null,updates:[]}}static subscribe(){return{context:null,subscribe:[]}}static unsubscribe(){return{context:null,unsubscribe:[]}}static request(){return{requestId:(new ex).toString()}}}let nx=(()=>{class e{constructor(){this._filter="",this._wsTimeout=2e4,this._token="",this._playbackMode=!1,this.version=1,this.endpoint="",this.selfId="",this._source=null,this._connect=new Me,this.onConnect=this._connect.asObservable(),this._close=new Me,this.onClose=this._close.asObservable(),this._error=new Me,this.onError=this._error.asObservable(),this._message=new Me,this.onMessage=this._message.asObservable()}set source(n){this._source||(this._source={}),this._source.label=n}set authToken(n){this._token=n}get connectionTimeout(){return this._wsTimeout}set connectionTimeout(n){this._wsTimeout=n<3e3?3e3:n>6e4?6e4:n}get isOpen(){return!(!this.ws||1==this.ws.readyState||3==this.ws.readyState)}get filter(){return this._filter}set filter(n){this._filter=n&&-1!=n.indexOf("self")?this.selfId?this.selfId:"":n}get playbackMode(){return this._playbackMode}close(){this.ws&&(this.ws.close(),this.ws=null)}open(n,r,o){if(!(n=n||this.endpoint))return;let i=-1==n.indexOf("?")?"?":"&";r&&(n+=`${i}subscribe=${r}`),(this._token||o)&&(n+=`${r?"&":"?"}token=${this._token||o}`),this.close(),this.ws=new WebSocket(n),setTimeout(()=>{this.ws&&1!=this.ws.readyState&&3!=this.ws.readyState&&(console.warn(`Connection watchdog expired (${this._wsTimeout/1e3} sec): ${this.ws.readyState}... aborting connection...`),this.close())},this._wsTimeout),this.ws.onopen=s=>{this._connect.next(s)},this.ws.onclose=s=>{this._close.next(s)},this.ws.onerror=s=>{this._error.next(s)},this.ws.onmessage=s=>{this.parseOnMessage(s)}}parseOnMessage(n){let r;if("string"==typeof n.data)try{r=JSON.parse(n.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(n){if("object"!=typeof n)return"";let r=Ys.request();return typeof n.login>"u"&&this._token&&(r.token=this._token),Object.keys(n).forEach(i=>{r[i]=n[i]}),this.send(r),r.requestId}put(n,r,o){return this.sendRequest({context:"self"==n?"vessels.self":n,put:{path:r,value:o}})}login(n,r){return this.sendRequest({login:{username:n,password:r}})}send(n){this.ws&&("object"==typeof n&&(n=JSON.stringify(n)),this.ws.send(n))}sendUpdate(n="self",r,o){let i=Ys.updates();this._token&&(i.token=this._token),i.context="self"==n?"vessels.self":n,this._token&&(i.token=this._token);let s=[];"string"==typeof r&&s.push({path:r,value:o}),"object"==typeof r&&Array.isArray(r)&&(s=r);let a={timestamp:(new Date).toISOString(),values:s};this._source&&(a.source=this._source),i.updates.push(a),this.send(i)}subscribe(n="*",r="*",o){let i=Ys.subscribe();if(this._token&&(i.token=this._token),i.context="self"==n?"vessels.self":n,this._token&&(i.token=this._token),"object"==typeof r&&Array.isArray(r)&&(i.subscribe=r),"string"==typeof r){let s={};s.path=r,o&&"object"==typeof o&&(o.period&&(s.period=o.period),o.minPeriod&&(s.minPeriod=o.period),o.format&&("delta"==o.format||"full"==o.format)&&(s.format=o.format),o.policy&&("instant"==o.policy||"ideal"==o.policy||"fixed"==o.policy)&&(s.policy=o.policy)),i.subscribe.push(s)}this.send(i)}unsubscribe(n="*",r="*"){let o=Ys.unsubscribe();this._token&&(o.token=this._token),o.context="self"==n?"vessels.self":n,this._token&&(o.token=this._token),"object"==typeof r&&Array.isArray(r)&&(o.unsubscribe=r),"string"==typeof r&&o.unsubscribe.push({path:r}),this.send(o)}raiseAlarm(n="*",r,o){let i;i="string"==typeof r&&-1==r.indexOf("notifications.")?`notifications.${r}`:r,this.put(n,i,o.value)}clearAlarm(n="*",r){let o=-1==r.indexOf("notifications.")?`notifications.${r}`:r;this.put(n,o,null)}isSelf(n){return n.context==this.selfId}isDelta(n){return typeof n.context<"u"}isHello(n){return typeof n.version<"u"&&typeof n.self<"u"}isResponse(n){return typeof n.requestId<"u"}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=he({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();class ox{constructor(t,n,r,o){this._method=[],this._message="",this._message=typeof t<"u"?t:"",this._state=typeof n<"u"?n:Ty.alarm,r&&this._method.push(Tc.visual),o&&this._method.push(Tc.sound)}get value(){return{message:this._message,state:this._state,method:this._method}}}var Ty=function(e){return e.normal="normal",e.alert="alert",e.warn="warn",e.alarm="alarm",e.emergency="emergency",e}(Ty||{}),Tc=function(e){return e.visual="visual",e.sound="sound",e}(Tc||{});class sx{constructor(){this.obsList=[],this.stream=new nx,this._connect=new Me,this.onConnect=this._connect.asObservable(),this._close=new Me,this.onClose=this._close.asObservable(),this._error=new Me,this.onError=this._error.asObservable(),this._message=new Me,this.onMessage=this._message.asObservable()}get endpoint(){return this.stream.endpoint}set endpoint(t){this.stream.endpoint=t}get selfId(){return this.stream.selfId}set selfId(t){this.stream.selfId=t}get _source(){return this.stream._source}set _source(t){this.stream._source=t}set source(t){this.stream.source=t}set authToken(t){this.stream.authToken=t}get connectionTimeout(){return this.stream.connectionTimeout}set connectionTimeout(t){this.stream.connectionTimeout=t}get isOpen(){return this.stream.isOpen}get filter(){return this.stream.filter}set filter(t){this.stream.filter=t}get playbackMode(){return this.stream.playbackMode}open(t,n="none",r){this.obsList.push(this.stream.onConnect.subscribe(o=>this._connect.next(o))),this.obsList.push(this.stream.onClose.subscribe(o=>this._close.next(o))),this.obsList.push(this.stream.onError.subscribe(o=>this._error.next(o))),this.obsList.push(this.stream.onMessage.subscribe(o=>this._message.next(o))),this.stream.open(t,n,r)}close(){this.stream.close(),this.obsList.forEach(t=>t.unsubscribe()),this.obsList=[]}sendRequest(t){return this.stream.sendRequest(t)}put(t,n,r){return this.stream.put(t,n,r)}login(t,n){return this.stream.login(t,n)}send(t){this.stream.send(t)}sendUpdate(t="self",n,r){this.stream.sendUpdate(t,n,r)}subscribe(t="*",n="*",r){this.stream.subscribe(t,n,r)}unsubscribe(t="*",n="*"){this.stream.unsubscribe(t,n)}raiseAlarm(t="*",n,r){this.stream.raiseAlarm(t,n,r)}clearAlarm(t="*",n){this.stream.clearAlarm(t,n)}isSelf(t){return this.stream.isSelf(t)}isDelta(t){return this.stream.isDelta(t)}isHello(t){return this.stream.isHello(t)}isResponse(t){return this.stream.isResponse(t)}}class Ny{id;position=[0,0];heading;headingTrue=null;headingMagnetic=null;cog;cogTrue=null;cogMagnetic=null;sog;name;mmsi;callsign;state;wind={direction:null,mwd:null,twd:null,tws:null,speedTrue:null,sog:null,awa:null,aws:null};lastUpdated=new Date;orientation=0;buddy=!1;closestApproach=null;mode="day";anchor={maxRadius:null,radius:null,position:null};resourceUpdates=[];autopilot={};track=[];courseApi={arrivalCircle:0,activeRoute:{},nextPoint:{},previousPoint:{}};properties={}}class Sy{id;lastUpdated=new Date;name;mmsi;position=[0,0];properties={};state}class Nc extends Sy{type={id:-1,name:""};constructor(){super()}}class ax extends Nc{callsign;constructor(){super()}}class lx extends Sy{orientation=0;sog=0;callsign;track=[];constructor(){super()}}class ux extends Nc{callsign;twd;tws;temperature;constructor(){super()}}class Sc{static celciusToKelvin(t=0){return t+273.15}static kelvinToCelcius(t=0){return t-273.15}static kelvinToFarenheit(t=0){return 1.8*t-459.67}static degreesToRadians(t=0){return t*Math.PI/180}static radiansToDegrees(t=0){return 180*t/Math.PI}static angleToDirection(t,n){const r=2*Math.PI;if(n||(n=0),t||(t=0),isNaN(n)||isNaN(t))return null;const o=n+t;return o>r?o-r:o<0?r+o:o}static directionToAngle(t,n){const r=2*Math.PI;if(n||(n=0),t||(t=0),isNaN(n)||isNaN(t))return null;const o=n-t;let i;if(o>0)i=o>Math.PI?r-o:0-o;else if(o<0){const s=Math.abs(o);i=s>Math.PI?s-r:s}else i=o;return i}static knotsToKm(t){return 1.852*t}static nauticalMilesToKm(t){return 1.852*t}static knotsToMSec(t){return.51444325460445*t}static kmToKnots(t){return.539957*t}static kmToNauticalMiles(t){return.539957*t}static kmToMiles(t){return.621371*t}static metersToFeet(t){return 3.28084*t}static msecToKnots(t){return 1.94384*t}static msecToKmh(t){return 3.6*t}static msecToMph(t){return 2.23694*t}static nauticalMilesToMiles(t){return 1.15078*t}static milesToKm(t){return 1.60934*t}static milesToNauticalMiles(t){return.868976*t}static rpmToHertz(t){return t/60}}var jn=ta(2541);class Yt{static destCoordinate(t,n,r){const o=(0,jn.computeDestinationPoint)(t,r,Sc.radiansToDegrees(n));return[o.longitude,o.latitude]}static distanceTo(t,n){return(0,jn.getDistance)(t,n)}static routeLength(t){return(0,jn.getPathLength)(t)}static routeLegs(t,n){if(t.length<2)return[];const r=[];r.push(n?{bearing:(0,jn.getGreatCircleBearing)(n,t[0]),distance:Yt.distanceTo(n,t[0])}:{bearing:0,distance:0});for(let o=1;o<t.length;++o){const i={bearing:(0,jn.getGreatCircleBearing)(t[o-1],t[o]),distance:Yt.distanceTo(t[o-1],t[o])};r.push(i)}return r}static centreOfPolygon(t){const n=(0,jn.getCenter)(t);return[n.longitude,n.latitude]}static inDLCrossingZone(t,n=170){return Math.abs(t[0])>=n}static inBounds(t,n){return(0,jn.isPointInPolygon)(t,[[n[0],n[1]],[n[0],n[3]],[n[2],n[3]],[n[2],n[1]],[n[0],n[1]]])}static calcMapifiedExtent(t,n){const o=111111*Math.cos(Sc.degreesToRadians(t[1])),i=[0,0,0,0];return i[1]=t[1]+(0-Math.abs(n))/111111,i[3]=t[1]+Math.abs(n)/111111,i[0]=t[0]+(0-Math.abs(n))/o,i[2]=t[0]+Math.abs(n)/o,i}static normaliseCoords(t){if(!Array.isArray(t))return[0,0];if("number"==typeof t[0]){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}return Array.isArray(t[0])?(t.forEach(n=>this.normaliseCoords(n)),t):void 0}}class cx{action;playback=!1;result=null;type;self=null;timestamp;constructor(t){this.action="notification",this.type=t}}class xy{action;playback=!1;result=null;timestamp;self=null;constructor(){this.action="update"}}class dx extends xy{constructor(){super(),this.action="trail"}}var fx=ta(6380);const px=["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"];let X,je,Py;const si=[];let Oc,Js=[],Pc=!1,Xs=!1;const Se={signalk:{},aisState:[]};let tt,Ry,Oy=[0,0,0,0],Ay=60,ai=0,Fn={},Vn=500,Jt=!1;const Xt={maxAge:54e4,staleAge:36e4,lastTick:(new Date).valueOf(),maxTrack:20},li={trailDuration:24,trailResolution:{lastHour:"5s",next23:"10s",beyond24:"1m"}};let ui,ci="freeboard-sk";function ky(){tt={updated:{},stale:{},expired:{}}}function ea({action:e,msg:t}){switch(e){case"onConnect":postMessage({action:"open",playback:Jt,result:t.target.readyState});break;case"onClose":console.warn("streamEvent: ",t),jy(!1);break;case"onError":console.warn("streamEvent: ",t),postMessage({action:"error",playback:Jt,result:"Connection error!"});break;case"onMessage":!function Ix(e){je.isHello(e)?(postMessage({action:"hello",result:e,self:e.self,playback:Jt}),Vn&&$y()):je.isDelta(e)?(Pc=!0,e.updates.forEach(t=>{t.values&&(ui=t.$source,t.values.forEach(n=>{if(Ry=t.timestamp,e.context)switch(e.context.split(".")[0]){case"shore":case"atons":Se?.signalk.atons&&function wx(e,t){let n=!1;if(-1!==e.indexOf("shore.basestations")&&(n=!0),!X.atons.has(e)){const o=new Nc;o.id=e,o.position=null,n&&(o.type.id=-1,o.type.name="Basestation"),X.atons.set(e,o)}const r=X.atons.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.atonType<"u"&&(r.type=t.value.atonType)):"atonType"===t.path?r.type=t.value:"navigation.position"===t.path?(r.position=[t.value.longitude,t.value.latitude],r.positionReceived=!0):r.properties[t.path]=t.value}(e.context,n),fi(e.context,X.atons,Se?.signalk.atons);break;case"sar":Se?.signalk.sar&&function Mx(e,t){if(!X.sar.has(e)){const r=new ax;r.id=e,r.position=null,r.type.id=-1,r.type.name="SaR Beacon",X.sar.set(e,r)}const n=X.sar.get(e);""===t.path?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi)):"communication.callsignVhf"===t.path?n.callsign=t.value:"navigation.position"===t.path&&t.value&&(n.position=Yt.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0)}(e.context,n),fi(e.context,X.sar,Se?.signalk.sar);break;case"aircraft":Se?.signalk.aircraft&&function Ex(e,t){if(!X.aircraft.has(e)){const r=new lx;r.id=e,r.position=null,X.aircraft.set(e,r)}const n=X.aircraft.get(e);""===t.path?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi)):"communication.callsignVhf"===t.path?n.callsign=t.value:"navigation.position"===t.path&&t.value?(n.position=Yt.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0,Ac(n)):"navigation.courseOverGroundTrue"===t.path?n.orientation=t.value:"navigation.speedOverGround"===t.path&&(n.sog=t.value)}(e.context,n),fi(e.context,X.aircraft,Se?.signalk.aircraft);break;case"meteo":Se?.signalk.meteo&&(function _x(e,t){if(!X.meteo.has(e)){const r=new ux;r.id=e,r.position=null,r.type.id=-1,r.type.name="Weather Station",X.meteo.set(e,r)}const n=X.meteo.get(e);if(""===t.path){if(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"){const r=e.split(":").slice(-2);n.mmsi=2===r.length?`${r[0]}:${r[1]}`:t.value.mmsi}}else"communication.callsignVhf"===t.path?n.callsign=t.value:"environment.outside.temperature"===t.path?n.temperature=t.value:"environment.wind.directionTrue"===t.path?n.twd=t.value:"environment.wind.averageSpeed"===t.path?n.tws=t.value:"navigation.position"===t.path&&t.value&&(n.position=Yt.normaliseCoords([t.value.longitude,t.value.latitude]),n.positionReceived=!0)}(e.context,n),By(n)),fi(e.context,X.meteo,Se?.signalk.meteo);break;case"vessels":if(je.isSelf(e))Uy(X.self,n,!0),By(n);else{if(Se?.signalk.vessels){const r=function Dx(e){if(!X.aisTargets.has(e)){const t=new Ny;t.position=null,X.aisTargets.set(e,t)}return X.aisTargets.get(e)}(e.context);Uy(r,n)}fi(e.context,X.aisTargets,Se?.signalk.vessels,Se?.aisState)}}}))}),Vy()):je.isResponse(e)&&postMessage({action:"response",result:e})}(t)}}function Ly(e={}){e.interval&&"number"==typeof e.interval&&(Vn=e.interval,Hy(),$y(),Ay=1/(Vn/1e3)*60),Jt=!!e.playback,e.selections&&(typeof e.selections.preferredPaths<"u"&&(Fn=e.selections.preferredPaths),e.selections.aisMaxAge&&"number"==typeof e.selections.aisMaxAge&&(Xt.maxAge=e.selections.aisMaxAge),e.selections.aisStaleAge&&"number"==typeof e.selections.aisStaleAge&&(Xt.staleAge=e.selections.aisStaleAge),"number"==typeof e.selections.signalk.maxRadius&&(Se.signalk=e.selections.signalk),typeof e.selections.aisState<"u"&&Array.isArray(e.selections.aisState)&&(Se.aisState=e.selections.aisState),console.log("Worker: AIS Filter...",Se))}function jy(e=!1){Hy(),si.forEach(t=>t.unsubscribe()),je&&e&&je.close(),je=null,postMessage({action:"close",result:e,playback:Jt})}function di(e){return new Promise((t,n)=>{fetch(`${e}`).then(r=>{r.json().then(o=>t(o)).catch(o=>n(o))}).catch(r=>{n(r)})})}function Fy(){di(Oc+"/tracks"+(Se&&Se.signalk&&Se.signalk.maxRadius?`?radius=${Se.signalk.maxRadius}`:"?radius=10000")).then(t=>{Xs=!0,Object.entries(t).forEach(n=>{if(X.aisTargets.has(n[0])){const r=X.aisTargets.get(n[0]);r.track=n[1].coordinates,Ac(r)}})}).catch(()=>{Xs=!1,console.warn("Unable to fetch AIS tracks!")})}function fi(e,t,n=!0,r=[]){if(n){let o=t.get(e);o&&r.includes(o?.state)&&(console.log(`state match => ${r}, ${e}`),tt.expired[e]=!0,o=null),o&&Se.signalk.maxRadius?o.positionReceived&&Yt.inBounds(o.position,Oy)?tt.updated[e]=!0:(t.delete(e),tt.expired[e]=!0):tt.updated[e]=!0}else 0!==t.size&&(t.forEach((o,i)=>{tt.expired[i]=!0}),t.clear())}function Vy(e=!1){if(!Vn||e){const t=new xy;t.playback=Jt,X.aisStatus.updated=Object.keys(tt.updated),X.aisStatus.stale=Object.keys(tt.stale),X.aisStatus.expired=Object.keys(tt.expired),t.result=X,t.timestamp=Jt?Ry:X.self.lastUpdated.toISOString(),postMessage(t),ky(),X.self.resourceUpdates=[],0===ai&&(function bx(){const e=(new Date).valueOf();X.aisTargets.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Xt.maxAge?(tt.expired[n]=!0,X.aisTargets.delete(n)):t.lastUpdated.valueOf()<e-Xt.staleAge&&(tt.stale[n]=!0)}),X.aircraft.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Xt.maxAge?(tt.expired[n]=!0,X.aircraft.delete(n)):t.lastUpdated.valueOf()<e-Xt.staleAge&&(tt.stale[n]=!0)}),X.sar.forEach((t,n)=>{t.lastUpdated.valueOf()<e-Xt.maxAge?(tt.expired[n]=!0,X.sar.delete(n)):t.lastUpdated.valueOf()<e-Xt.staleAge&&(tt.stale[n]=!0)})}(),X.self.positionReceived&&Se?.signalk.maxRadius&&(Oy=Yt.calcMapifiedExtent(X.self.position,Se.signalk.maxRadius),ai++)),ai=ai>=Ay?0:ai+1}}function $y(){Vn&&"number"==typeof Vn&&Js.push(setInterval(()=>{Pc&&(Vy(!0),Pc=!1)},Vn)),Js.push(setInterval(()=>{console.warn("hasTrackPlugin",Xs),Xs&&Fy()},6e4))}function Hy(){Js.forEach(e=>clearInterval(e)),Js=[]}function Uy(e,t,n=!1){if(e.lastUpdated=new Date,n){const r=-1!==t.path.indexOf("course")?t.path.split(".").slice(0,2).join("."):t.path;-1!==px.indexOf(r)&&(X.paths[r]=null)}if(""===t.path)typeof t.value.name<"u"&&(e.name=t.value.name),typeof t.value.mmsi<"u"&&(e.mmsi=t.value.mmsi),typeof t.value.buddy<"u"&&(e.buddy=t.value.buddy);else if("communication.callsignVhf"===t.path)e.callsign=t.value;else if("navigation.position"===t.path&&t.value){if(typeof t.value.latitude>"u"||typeof t.value.longitude>"u")return;e.position=Yt.normaliseCoords([t.value.longitude,t.value.latitude]),e.positionReceived=!0,n||Ac(e)}else"navigation.state"===t.path?e.state=t.value:"navigation.speedOverGround"===t.path?e.sog=t.value:"navigation.courseOverGroundTrue"===t.path?e.cogTrue=t.value:"navigation.courseOverGroundMagnetic"===t.path?e.cogMagnetic=t.value:"navigation.headingTrue"===t.path?e.headingTrue=t.value:"navigation.headingMagnetic"===t.path?e.headingMagnetic=t.value:"environment.wind.angleApparent"===t.path?e.wind.awa=t.value:"environment.wind.speedApparent"===t.path?e.wind.aws=t.value:"environment.wind.speedTrue"===t.path?e.wind.speedTrue=t.value:"environment.wind.speedOverGround"===t.path?e.wind.sog=t.value:"environment.wind.directionTrue"===t.path?e.wind.twd=t.value:"environment.wind.directionMagnetic"===t.path?e.wind.mwd=t.value:"environment.mode"===t.path?e.mode=t.value:-1!==t.path.indexOf("navigation.course.")?-1!==t.path.indexOf("navigation.course.calcValues")?-1===t.path.indexOf("navigation.course.calcValues.previousPoint")&&(e[`course.${t.path.split(".").slice(-1)[0]}`]=t.value):-1!==t.path.indexOf("navigation.course.activeRoute")?e.courseApi.activeRoute=t.value:-1!==t.path.indexOf("navigation.course.nextPoint")?e.courseApi.nextPoint=t.value:-1!==t.path.indexOf("navigation.course.previousPoint")?e.courseApi.previousPoint=t.value:"navigation.course.arrivalCircle"===t.path&&(e.courseApi.arrivalCircle=t.value):-1!==t.path.indexOf("navigation.closestApproach")?e.closestApproach=t.value:"navigation.anchor.position"===t.path?e.anchor.position=t.value:"navigation.anchor.maxRadius"===t.path?e.anchor.maxRadius=t.value:"navigation.anchor.currentRadius"===t.path?e.anchor.radius=t.value:-1!==t.path.indexOf("resources.")?e.resourceUpdates.push(t):"steering.autopilot.state"===t.path&&ui===ci?e.autopilot.state=t.value:"steering.autopilot.mode"===t.path&&ui===ci?e.autopilot.mode=t.value:"steering.autopilot.target"===t.path&&ui===ci?e.autopilot.target=t.value:"steering.autopilot.engaged"===t.path&&ui===ci?e.autopilot.enabled=t.value:"steering.autopilot.defaultPilot"===t.path&&(ci=t.value);typeof Fn.heading<"u"&&t.path===Fn.heading&&(e.orientation=t.value),typeof Fn.tws<"u"&&t.path===Fn.tws&&(e.wind.tws=t.value),typeof Fn.twd<"u"&&t.path===Fn.twd&&(e.wind.direction="environment.wind.angleTrueGround"===t.path||"environment.wind.angleTrueWater"===t.path?Sc.angleToDirection(t.value,e.orientation??0):t.value)}function By(e,t){const n={path:e.path,value:e.value,context:t||null};let r;const o=e.path.split(".");if(("notifications.environment.depth.belowTransducer"===e.path||"notifications.environment.depth.belowSurface"===e.path||"notifications.environment.depth.belowKeel"===e.path)&&(r=o[2]),"notifications.navigation.anchor"===e.path&&(r=o[2]),-1!==["mob","sinking","fire","piracy","flooding","collision","grounding","listing","adrift","abandon"].indexOf(o[o.length-1])&&(r=o[o.length-1]),-1!==e.path.indexOf("notifications.navigation.closestApproach")&&(r=o[2],n.context=o[3]),-1!==e.path.indexOf("notifications.buddy")&&(r=o[1],n.context=o[2]),-1!==e.path.indexOf("notifications.navigation.course.arrivalCircleEntered")&&(r=o[3]),-1!==e.path.indexOf("notifications.navigation.course.perpendicularPassed")&&(r=o[3]),-1!==e.path.indexOf("notifications.meteo.warning")&&(r=o[1]),r){const i=new cx(r);i.playback=Jt,i.result=n,postMessage(i)}}function Ac(e){if(e.track&&0===e.track.length)e.track.push([e.position]);else{const n=e.track[e.track.length-1][e.track[e.track.length-1].length-1];n[0]!==e.position[0]&&n[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-Xt.maxTrack)}addEventListener("message",({data:e})=>{!function gx(e){if(e.cmd)switch(e.cmd){case"open":console.log("Worker control: opening stream..."),Ly(e.options),function vx(e){if(je)return;if(!e.url)return void postMessage({action:"error",result:"Valid options not provided!"});const t=e.url.split("/");if(t.pop(),t.push("api"),t[0]="wss:"===t[0]?"https:":"http:",Oc=t.join("/"),function hx(){X={self:new Ny,aisTargets:new Map,aisStatus:{updated:[],stale:[],expired:[]},paths:{},atons:new Map,aircraft:new Map,sar:new Map,meteo:new Map},X.self.positionReceived=!1,ky()}(),je=new sx,si.push(je.onConnect.subscribe(n=>ea({action:"onConnect",msg:n}))),si.push(je.onClose.subscribe(n=>ea({action:"onClose",msg:n}))),si.push(je.onError.subscribe(n=>ea({action:"onError",msg:n}))),si.push(je.onMessage.subscribe(n=>ea({action:"onMessage",msg:n}))),je.authToken=Py,e.playback){const n=e.playbackOptions.startTime?`?startTime=${e.playbackOptions.startTime}`:null;let r=e.playbackOptions.playbackRate?`playbackRate=${e.playbackOptions.playbackRate}`:null;r=r?n?"&"+r:"?"+r:null,je.open(`${e.url}${n||""}${r||""}`,e.playbackOptions.subscribe,e.token)}else je.open(e.url,e.subscribe,e.token),Fy()}(e.options);break;case"close":console.log("Worker control: closing stream..."),jy(!0);break;case"subscribe":console.log("Worker control: subscribing to paths..."),je.subscribe(e.options.context,e.options.path);break;case"settings":console.log("Worker control: settings..."),Ly(e.options);break;case"alarm":console.log("Worker control: alarm action..."),function yx(e){const t=-1===e.type.indexOf("notifications.")?`notifications.${e.type}`:e.type;e.raise?je.raiseAlarm("self",t,new ox(e.message,e.state,!0,!0)):je.clearAlarm("self",t)}(e.options);break;case"vessel":if(console.log("Worker control: vessel setting..."),e.options){let t;t="self"===e.options.context?X.self:X.aisTargets.get(e.options.context),t&&e.options.name&&(t.name=e.options.name)}break;case"auth":console.log("Worker control: auth token..."),e.options&&typeof e.options.token<"u"&&(Py=e.options.token);break;case"trail":console.log("Worker control: Fetch vessel trail from server..."),e.options&&(li.trailDuration=e.options.trailDuration??24,e.options.trailResolution&&(li.trailResolution.lastHour=e.options.trailResolution.lastHour??"5s",li.trailResolution.next23=e.options.trailResolution.next23??"1m",li.trailResolution.beyond24=e.options.trailResolution.beyond24??"5m")),function mx(e){console.info("Worker: Fetching vessel trail from server",e);const t=Oc+"/self/track?",n=[];e.trailDuration>24&&(n.push(di(`${t}timespan=${e.trailDuration-24}h&resolution=${e.trailResolution.beyond24}×panOffset=24`)),n.push(di(`${t}timespan=23h&resolution=${e.trailResolution.next23}×panOffset=1`))),e.trailDuration>1&&e.trailDuration<25&&n.push(di(`${t}timespan=${e.trailDuration-1}h&resolution=${e.trailResolution.next23}×panOffset=1`)),n.push(di(`${t}timespan=1h&resolution=${e.trailResolution.lastHour}`));let i=[];const s=new dx;s.playback=Jt,Promise.all(n).then(a=>{let l=0;const u=n.length-1;a.forEach(d=>{if(d.type&&"MultiLineString"===d.type&&d.coordinates&&Array.isArray(d.coordinates))if(l!==u){let p=[];for(d.coordinates.forEach(v=>{p=p.concat(v)}),p=(0,fx.p$)(p,5e-4,true);p.length>60;){const v=p.slice(0,60);i.push(v),p=p.slice(59),p[0]=[p[0][0]+5e-9,p[0][1]+5e-9]}0!==p.length&&i.push(p)}else i=i.concat(d.coordinates);l++}),s.result=i,postMessage(s)}).catch(()=>{s.result=null,postMessage(s)})}(li)}}(e)})})()})();
|
|
Binary file
|
package/public/index.html
CHANGED
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
</div>
|
|
75
75
|
</div>
|
|
76
76
|
</app-root>
|
|
77
|
-
<script src="runtime.
|
|
77
|
+
<script src="runtime.508cb88749fb25ea.js" type="module"></script><script src="polyfills.a2573337c4e88a2c.js" type="module"></script><script src="main.da1dd55692cd6aab.js" type="module"></script></body>
|
|
78
78
|
</html>
|