@mappedin/mappedin-js 4.0.4-alpha.18 → 4.0.5
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/README.md +2 -1
- package/lib/esm/get-venue/index.d.ts +27 -7
- package/lib/esm/get-venue/index.js +1 -1
- package/lib/esm/renderer/index.css +1 -1
- package/lib/esm/renderer/index.d.ts +60 -50
- package/lib/esm/renderer/index.js +1 -1
- package/lib/mappedin.css +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +3 -6
package/README.md
CHANGED
|
@@ -27,7 +27,8 @@ async function init() {
|
|
|
27
27
|
|
|
28
28
|
const mapView = await showVenue(document.getElementById('mappedin-map'), venueData);
|
|
29
29
|
mapView.labelAllLocations();
|
|
30
|
-
mapView.
|
|
30
|
+
mapView.addInteractivePolygonsForAllLocations();
|
|
31
|
+
mapView.on(E_SDK_EVENT.POLYGON_CLICKED, (polygon) => {
|
|
31
32
|
console.log(`Polygon with id ${polygon.id} clicked!`);
|
|
32
33
|
});
|
|
33
34
|
}
|
|
@@ -54,9 +54,10 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue' {
|
|
|
54
54
|
bundleBaseUri?: string;
|
|
55
55
|
version?: string;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Parse bundle and convert images to blobs. Disabled in React Native
|
|
58
|
+
* @private
|
|
58
59
|
*/
|
|
59
|
-
|
|
60
|
+
shouldPopulateBundledImagesAsBlobs?: boolean;
|
|
60
61
|
};
|
|
61
62
|
/**
|
|
62
63
|
* [experimental] Fetching an offline Venue bundle
|
|
@@ -333,8 +334,10 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin' {
|
|
|
333
334
|
/**
|
|
334
335
|
*
|
|
335
336
|
* [experimental] Hydrate the Mappedin instance using a response from either {@link IMappedin.toString()}, {@link getVenueBundle} or by downloading the bundle manually
|
|
337
|
+
* @param mappedinSerializableData Mappedin data that was serialized or exported as JSON
|
|
338
|
+
* @param shouldPopulateBundledImagesAsBlobs Takes the scenes and images from a bundle and maps them as blobs to where they exist as URLs in the bundle. False by default
|
|
336
339
|
*/
|
|
337
|
-
hydrate(mappedinSerializableData: string | object): Promise<undefined>;
|
|
340
|
+
hydrate(mappedinSerializableData: string | object, shouldPopulateBundledImagesAsBlobs?: boolean): Promise<undefined>;
|
|
338
341
|
images: any;
|
|
339
342
|
scenes: any;
|
|
340
343
|
fetch(): Promise<void>;
|
|
@@ -409,7 +412,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinLocati
|
|
|
409
412
|
siblingGroups?: TSiblingGroup[] | undefined;
|
|
410
413
|
gallery?: TGalleryImage[] | undefined;
|
|
411
414
|
constructor(mappedin: Mappedin, data: any);
|
|
412
|
-
categories: TCategory[];
|
|
415
|
+
categories: TCategory['id'][];
|
|
413
416
|
/**
|
|
414
417
|
* Polygons this Location is attached to.
|
|
415
418
|
*
|
|
@@ -559,6 +562,14 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNode'
|
|
|
559
562
|
operationHours?: TOpeningHours[];
|
|
560
563
|
externalId?: string;
|
|
561
564
|
constructor(mappedin: Mappedin, data: any);
|
|
565
|
+
/**
|
|
566
|
+
* Latitude of node. This is expensive, especially if doing it for many/all nodes
|
|
567
|
+
*/
|
|
568
|
+
get lat(): number;
|
|
569
|
+
/**
|
|
570
|
+
* Longitude of node. This is expensive, especially if doing it for many/all nodes
|
|
571
|
+
*/
|
|
572
|
+
get lon(): number;
|
|
562
573
|
/**
|
|
563
574
|
* Adjacent Nodes.
|
|
564
575
|
*
|
|
@@ -641,7 +652,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinMap' {
|
|
|
641
652
|
import type { MappedinMapGroup } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinMapGroup';
|
|
642
653
|
import { MappedinCoordinate } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinCoordinate';
|
|
643
654
|
/**
|
|
644
|
-
* A {@link MappedinMap} belonging to a specific {@link MappedinVenue}. Typically represents a certain floor. Give this to a {@link
|
|
655
|
+
* A {@link MappedinMap} belonging to a specific {@link MappedinVenue}. Typically represents a certain floor. Give this to a {@link MapView} to display to the user.
|
|
645
656
|
*
|
|
646
657
|
* A Map can have more properties such as 'elevation', 'name' (e.g. Level 1), and 'shortName' (e.g. L1). The elevation property can be used to determine the order of the floors (first, second, etc). Elevation is 0 based, going up and down in integers representing the number of floors above or below 0, which is ground level.
|
|
647
658
|
*
|
|
@@ -685,6 +696,14 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinMap' {
|
|
|
685
696
|
* @property mapGroup {MappedinMapGroup}
|
|
686
697
|
*/
|
|
687
698
|
get mapGroup(): MappedinMapGroup | null;
|
|
699
|
+
/**
|
|
700
|
+
* Create coordinate using mappedin units
|
|
701
|
+
* @internal
|
|
702
|
+
*
|
|
703
|
+
* @param x x of coordinate
|
|
704
|
+
* @param y y of coordinate
|
|
705
|
+
*/
|
|
706
|
+
createCoordinateByXY(x: number, y: number): MappedinCoordinate;
|
|
688
707
|
/**
|
|
689
708
|
* Create coordinate using lat/lon
|
|
690
709
|
*
|
|
@@ -1402,9 +1421,10 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue' {
|
|
|
1402
1421
|
bundleBaseUri?: string;
|
|
1403
1422
|
version?: string;
|
|
1404
1423
|
/**
|
|
1405
|
-
*
|
|
1424
|
+
* Parse bundle and convert images to blobs. Disabled in React Native
|
|
1425
|
+
* @private
|
|
1406
1426
|
*/
|
|
1407
|
-
|
|
1427
|
+
shouldPopulateBundledImagesAsBlobs?: boolean;
|
|
1408
1428
|
};
|
|
1409
1429
|
/**
|
|
1410
1430
|
* [experimental] Fetching an offline Venue bundle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Ka=Object.create,ht=Object.defineProperty,Xa=Object.defineProperties,Ja=Object.getOwnPropertyDescriptor,za=Object.getOwnPropertyDescriptors,Za=Object.getOwnPropertyNames,br=Object.getOwnPropertySymbols,Ya=Object.getPrototypeOf,_r=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Un=(e,t,n)=>t in e?ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K=(e,t)=>{for(var n in t||(t={}))_r.call(t,n)&&Un(e,n,t[n]);if(br)for(var n of br(t))Qa.call(t,n)&&Un(e,n,t[n]);return e},ne=(e,t)=>Xa(e,za(t)),ei=e=>ht(e,"__esModule",{value:!0}),ti=(e,t)=>()=>(e&&(t=e(e=0)),t),w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ni=(e,t,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of Za(t))!_r.call(e,a)&&"default"!==a&&ht(e,a,{get:()=>t[a],enumerable:!(n=Ja(t,a))||n.enumerable});return e},Nr=e=>ni(ei(ht(null!=e?Ka(Ya(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),c=(e,t,n)=>(Un(e,"symbol"!=typeof t?t+"":t,n),n),Tr=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},h=(e,t,n)=>(Tr(e,t,"read from private field"),n?n.call(e):t.get(e)),b=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},O=(e,t,n,a)=>(Tr(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),f=ti((()=>{})),Ir=w(((e,t)=>{f(),function(n){var a="object"==typeof e&&e,r="object"==typeof t&&t&&t.exports==a&&t,i="object"==typeof global&&global;(i.global===i||i.window===i)&&(n=i);var o=function(e){this.message=e};(o.prototype=new Error).name="InvalidCharacterError";var s=function(e){throw new o(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,a,r,i=e.length%3,o="",u=-1,h=e.length-i;++u<h;)t=e.charCodeAt(u)<<16,n=e.charCodeAt(++u)<<8,a=e.charCodeAt(++u),o+=l.charAt((r=t+n+a)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==i?(t=e.charCodeAt(u)<<8,n=e.charCodeAt(++u),o+=l.charAt((r=t+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==i&&(r=e.charCodeAt(u),o+=l.charAt(r>>2)+l.charAt(r<<4&63)+"=="),o},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,a,r=0,i="",o=-1;++o<t;)a=l.indexOf(e.charAt(o)),n=r%4?64*n+a:a,r++%4&&(i+=String.fromCharCode(255&n>>(-2*r&6)));return i},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(a&&!a.nodeType)if(r)r.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(a[c]=h[c]);else n.base64=h}(e)})),W=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.areaConversion=e.timeConversion=e.distanceConversion=e.altitudeKeys=e.latitudeKeys=e.longitudeKeys=e.MAXLON=e.MINLON=e.MAXLAT=e.MINLAT=e.earthRadius=e.sexagesimalPattern=void 0;e.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;e.earthRadius=6378137;e.MINLAT=-90;e.MAXLAT=90;e.MINLON=-180;e.MAXLON=180;e.longitudeKeys=["lng","lon","longitude",0];e.latitudeKeys=["lat","latitude",1];e.altitudeKeys=["alt","altitude","elevation","elev",2];e.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};e.timeConversion={m:60,h:3600,d:86400};var t={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};e.areaConversion=t,t.sqm=t.m2,t.sqkm=t.km2,t.sqft=t.ft2,t.sqyd=t.yd2,t.sqin=t.in2})),Le=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e,t){return t.reduce((function(t,n){if(null==e)throw new Error("'".concat(e,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(e,n)&&void 0!==n&&void 0===t?(t=n,n):t}),void 0)};e.default=t})),Ee=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){var t=e.toString().trim();return!isNaN(parseFloat(t))&&parseFloat(t)===Number(t)};e.default=t})),Be=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=W(),n=function(e){return t.sexagesimalPattern.test(e.toString().trim())};e.default=n})),qe=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=W(),n=function(e){var n=new RegExp(t.sexagesimalPattern).exec(e);if(null==n)throw new Error("Given value is not in sexagesimal format");var a=Number(n[2])/60||0,r=Number(n[4])/3600||0,i=parseFloat(n[1])+a+r;return["S","W"].includes(n[7])?-i:i};e.default=n})),_t=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=W(),a=(t=Le())&&t.__esModule?t:{default:t};function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:n.longitudeKeys,latitude:n.latitudeKeys,altitude:n.altitudeKeys},r=(0,a.default)(e,t.longitude),o=(0,a.default)(e,t.latitude),s=(0,a.default)(e,t.altitude);return i({latitude:o,longitude:r},s?{altitude:s}:{})};e.default=s})),Xn=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Ee()),n=i(Be()),a=i(qe()),r=W();function i(e){return e&&e.__esModule?e:{default:e}}var o=function e(i){return(0,t.default)(i)?!(parseFloat(i)>r.MAXLAT||i<r.MINLAT):!!(0,n.default)(i)&&e((0,a.default)(i))};e.default=o})),zn=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Ee()),n=i(Be()),a=i(qe()),r=W();function i(e){return e&&e.__esModule?e:{default:e}}var o=function e(i){return(0,t.default)(i)?!(parseFloat(i)>r.MAXLON||i<r.MINLON):!!(0,n.default)(i)&&e((0,a.default)(i))};e.default=o})),Yn=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(_t()),n=r(Xn()),a=r(zn());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e){var r=(0,t.default)(e),i=r.latitude,o=r.longitude;if(Array.isArray(e)&&e.length>=2)return(0,a.default)(e[0])&&(0,n.default)(e[1]);if(void 0===i||void 0===o)return!1;var s=e[o],l=e[i];return!(void 0===l||void 0===s||!1===(0,n.default)(l)||!1===(0,a.default)(s))};e.default=i})),xt=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(Ee()),n=o(Be()),a=o(qe()),r=o(Yn()),i=o(_t());function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=function e(o){if((0,t.default)(o))return Number(o);if((0,n.default)(o))return(0,a.default)(o);if((0,r.default)(o)){var s=(0,i.default)(o);return Array.isArray(o)?o.map((function(t,n){return[0,1].includes(n)?e(t):t})):l(l(l({},o),s.latitude&&u({},s.latitude,e(o[s.latitude]))),s.longitude&&u({},s.longitude,e(o[s.longitude])))}return Array.isArray(o)?o.map((function(t){return(0,r.default)(t)?e(t):t})):o};e.default=h})),Q=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=W(),n=r(Le()),a=r(xt());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e,r){var i=(0,n.default)(e,t.latitudeKeys);if(null!=i){var o=e[i];return!0===r?o:(0,a.default)(o)}};e.default=i})),ee=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=W(),n=r(Le()),a=r(xt());function r(e){return e&&e.__esModule?e:{default:e}}var i=function(e,r){var i=(0,n.default)(e,t.longitudeKeys);if(null!=i){var o=e[i];return!0===r?o:(0,a.default)(o)}};e.default=i})),ae=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return e*Math.PI/180};e.default=t})),ye=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return 180*e/Math.PI};e.default=t})),qr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(Q()),n=o(ee()),a=o(ae()),r=o(ye()),i=W();function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,o,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,t.default)(e),h=(0,n.default)(e),c=o/l,d=(0,a.default)(s),f=(0,a.default)(u),p=(0,a.default)(h),g=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),y=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),v=(0,r.default)(y);return(v<i.MINLON||v>i.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,v=(0,r.default)(y)),{latitude:(0,r.default)(g),longitude:v}};e.default=s})),Sr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=W(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",a=t.areaConversion[n];if(a)return e*a;throw new Error("Invalid unit used for area conversion.")};e.default=n})),Cr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=W(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",a=t.distanceConversion[n];if(a)return e*a;throw new Error("Invalid unit used for distance conversion.")};e.default=n})),Vr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=W(),n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return e*t.timeConversion.h*t.distanceConversion.km;case"mph":return e*t.timeConversion.h*t.distanceConversion.mi;default:return e}};e.default=n})),Fr=w((e=>{function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{!a&&null!=s.return&&s.return()}finally{if(r)throw i}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if("Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(e,t)}}(e,t)||function(){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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=function(e){var t=Math.pow(10,12);return Math.round(e*t)/t},r=function(e){var n=t(e.toString().split("."),2),r=n[0],i=n[1],o=Math.abs(Number(r)),s=a(60*Number("0."+(i||0))),l=Math.floor(s),u=a(60*(s%l||0));return o+"° "+Number(l.toFixed(6)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+'"'};e.default=r})),rr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return e>1?1:e<-1?-1:e};e.default=t})),le=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(Q()),n=o(ee()),a=o(ae()),r=o(rr()),i=W();function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=void 0===s||isNaN(s)?1:s;var l=(0,t.default)(e),u=(0,n.default)(e),h=(0,t.default)(o),c=(0,n.default)(o),d=Math.acos((0,r.default)(Math.sin((0,a.default)(h))*Math.sin((0,a.default)(l))+Math.cos((0,a.default)(h))*Math.cos((0,a.default)(l))*Math.cos((0,a.default)(u)-(0,a.default)(c))))*i.earthRadius;return Math.round(d/s)*s};e.default=s})),ar=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=le())&&t.__esModule?t:{default:t};var a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return a="function"==typeof a?a:n.default,t.slice().sort((function(t,n){return a(e,t)-a(e,n)}))};e.default=a})),Hr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=ar())&&t.__esModule?t:{default:t};var a=function(e,t){return(0,n.default)(e,t)[0]};e.default=a})),Xr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(ae()),n=i(Q()),a=i(ee()),r=W();function i(e){return e&&e.__esModule?e:{default:e}}var o=function(e){var i=0;if(e.length>2){for(var o,s,l,u=0;u<e.length;u++){u===e.length-2?(o=e.length-2,s=e.length-1,l=0):u===e.length-1?(o=e.length-1,s=0,l=1):(o=u,s=u+1,l=u+2);var h=(0,a.default)(e[o]),c=(0,n.default)(e[s]),d=(0,a.default)(e[l]);i+=((0,t.default)(d)-(0,t.default)(h))*Math.sin((0,t.default)(c))}i=i*r.earthRadius*r.earthRadius/2}return Math.abs(i)};e.default=o})),sr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Q()),n=a(ee());function a(e){return e&&e.__esModule?e:{default:e}}var r=function(e){if(!1===Array.isArray(e)||0===e.length)throw new Error("No points were given.");return e.reduce((function(e,a){var r=(0,t.default)(a),i=(0,n.default)(a);return{maxLat:Math.max(r,e.maxLat),minLat:Math.min(r,e.minLat),maxLng:Math.max(i,e.maxLng),minLng:Math.min(i,e.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};e.default=r})),zr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(Q()),n=o(ee()),a=o(ae()),r=o(ye()),i=W();function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,o){var s,l,u=(0,t.default)(e),h=(0,n.default)(e),c=(0,a.default)(u),d=(0,a.default)(h),f=o/i.earthRadius,p=c-f,g=c+f,y=(0,a.default)(i.MAXLAT),v=(0,a.default)(i.MINLAT),m=(0,a.default)(i.MAXLON),b=(0,a.default)(i.MINLON);if(p>v&&g<y){var M=Math.asin(Math.sin(f)/Math.cos(c));(s=d-M)<b&&(s+=2*Math.PI),(l=d+M)>m&&(l-=2*Math.PI)}else p=Math.max(p,v),g=Math.min(g,y),s=b,l=m;return[{latitude:(0,r.default)(p),longitude:(0,r.default)(s)},{latitude:(0,r.default)(g),longitude:(0,r.default)(l)}]};e.default=s})),Qr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Q()),n=i(ee()),a=i(ae()),r=i(ye());function i(e){return e&&e.__esModule?e:{default:e}}var o=function(e){if(!1===Array.isArray(e)||0===e.length)return!1;var i=e.length,o=e.reduce((function(e,r){var i=(0,a.default)((0,t.default)(r)),o=(0,a.default)((0,n.default)(r));return{X:e.X+Math.cos(i)*Math.cos(o),Y:e.Y+Math.cos(i)*Math.sin(o),Z:e.Z+Math.sin(i)}}),{X:0,Y:0,Z:0}),s=o.X/i,l=o.Y/i,u=o.Z/i;return{longitude:(0,r.default)(Math.atan2(l,s)),latitude:(0,r.default)(Math.atan2(u,Math.sqrt(s*s+l*l)))}};e.default=o})),ea=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=sr())&&t.__esModule?t:{default:t};var a=function(e){var t=(0,n.default)(e),a=t.minLat+(t.maxLat-t.minLat)/2,r=t.minLng+(t.maxLng-t.minLng)/2;return{latitude:parseFloat(a.toFixed(6)),longitude:parseFloat(r.toFixed(6))}};e.default=a})),ur=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Q()),n=i(ee()),a=i(ae()),r=i(ye());function i(e){return e&&e.__esModule?e:{default:e}}var o=function(e,i){var o=(0,a.default)((0,n.default)(i))-(0,a.default)((0,n.default)(e)),s=Math.log(Math.tan((0,a.default)((0,t.default)(i))/2+Math.PI/4)/Math.tan((0,a.default)((0,t.default)(e))/2+Math.PI/4));return Math.abs(o)>Math.PI&&(o=o>0?-1*(2*Math.PI-o):2*Math.PI+o),((0,r.default)(Math.atan2(o,s))+360)%360};e.default=o})),aa=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=ur())&&t.__esModule?t:{default:t};var a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r="function"==typeof a?a(e,t):(0,n.default)(e,t);if(isNaN(r))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(r/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"}};e.default=a})),cr=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(le()),n=a(rr());function a(e){return e&&e.__esModule?e:{default:e}}var r=function(e,a,r){var i=(0,t.default)(a,e),o=(0,t.default)(e,r),s=(0,t.default)(a,r),l=Math.acos((0,n.default)((i*i+s*s-o*o)/(2*i*s))),u=Math.acos((0,n.default)((o*o+s*s-i*i)/(2*o*s)));return l>Math.PI/2?i:u>Math.PI/2?o:Math.sin(l)*i};e.default=r})),da=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Q()),n=i(ee()),a=i(ae()),r=i(ye());function i(e){return e&&e.__esModule?e:{default:e}}var o=function(e,i){var o=(0,t.default)(i),s=(0,n.default)(i),l=(0,t.default)(e),u=(0,n.default)(e);return((0,r.default)(Math.atan2(Math.sin((0,a.default)(s)-(0,a.default)(u))*Math.cos((0,a.default)(o)),Math.cos((0,a.default)(l))*Math.sin((0,a.default)(o))-Math.sin((0,a.default)(l))*Math.cos((0,a.default)(o))*Math.cos((0,a.default)(s)-(0,a.default)(u))))+360)%360};e.default=o})),ca=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=le())&&t.__esModule?t:{default:t};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return e.reduce((function(e,n){return"object"===a(e)&&null!==e.last&&(e.distance+=t(n,e.last)),e.last=n,e}),{last:null,distance:0}).distance};e.default=r})),ha=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=i(Q()),n=i(ee()),a=i(ae()),r=W();function i(e){return e&&e.__esModule?e:{default:e}}var o=function(e,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=void 0===o||isNaN(o)?1:o;var s,l,u,h,c,d,f,p=(0,t.default)(e),g=(0,n.default)(e),y=(0,t.default)(i),v=(0,n.default)(i),m=6356752.314245,b=1/298.257223563,M=(0,a.default)(v-g),w=Math.atan((1-b)*Math.tan((0,a.default)(parseFloat(p)))),O=Math.atan((1-b)*Math.tan((0,a.default)(parseFloat(y)))),_=Math.sin(w),N=Math.cos(w),T=Math.sin(O),P=Math.cos(O),E=M,x=100;do{var j=Math.sin(E),I=Math.cos(E);if(0===(d=Math.sqrt(P*j*(P*j)+(N*T-_*P*I)*(N*T-_*P*I))))return 0;s=_*T+N*P*I,l=Math.atan2(d,s),c=s-2*_*T/(h=1-(u=N*P*j/d)*u),isNaN(c)&&(c=0);var R=b/16*h*(4+b*(4-3*h));f=E,E=M+(1-R)*b*u*(l+R*d*(c+R*s*(2*c*c-1)))}while(Math.abs(E-f)>1e-12&&--x>0);if(0===x)return NaN;var A=h*(r.earthRadius*r.earthRadius-m*m)/(m*m),S=1+A/16384*(4096+A*(A*(320-175*A)-768)),k=A/1024*(256+A*(A*(74-47*A)-128)),B=k*d*(c+k/4*(s*(2*c*c-1)-k/6*c*(4*d*d-3)*(4*c*c-3))),D=m*S*(l-B);return Math.round(D/o)*o};e.default=o})),ga=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(e){return/^NNE|NE|NNW|N$/.test(e)?"N":/^ENE|E|ESE|SE$/.test(e)?"E":/^SSE|S|SSW|SW$/.test(e)?"S":/^WSW|W|WNW|NW$/.test(e)?"W":void 0};e.default=t})),ya=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=le())&&t.__esModule?t:{default:t};var a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r=a(e,t),i=Number(t.time)-Number(e.time),o=r/i*1e3;return o};e.default=a})),ma=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=le())&&t.__esModule?t:{default:t};var a=function(e,t,a){return(0,n.default)(t,e)+(0,n.default)(e,a)===(0,n.default)(t,a)};e.default=a})),va=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=a(Q()),n=a(ee());function a(e){return e&&e.__esModule?e:{default:e}}var r=function(e,a){for(var r=!1,i=a.length,o=-1,s=i-1;++o<i;s=o)((0,n.default)(a[o])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(a[s])||(0,n.default)(a[s])<=(0,n.default)(e)&&(0,n.default)(e)<(0,n.default)(a[o]))&&(0,t.default)(e)<((0,t.default)(a[s])-(0,t.default)(a[o]))*((0,n.default)(e)-(0,n.default)(a[o]))/((0,n.default)(a[s])-(0,n.default)(a[o]))+(0,t.default)(a[o])&&(r=!r);return r};e.default=r})),ba=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=cr())&&t.__esModule?t:{default:t};var a=function(e,t,a,r){return(0,n.default)(e,t,a)<r};e.default=a})),_a=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t,n=(t=le())&&t.__esModule?t:{default:t};var a=function(e,t,a){return(0,n.default)(e,t)<a};e.default=a})),Ta=w((e=>{function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{!a&&null!=s.return&&s.return()}finally{if(r)throw i}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);if("Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(e,t)}}(e,t)||function(){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 n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}f(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=function(e){if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map((function(e){var n=t(e.split(" "),2),a=n[0],r=n[1];return{longitude:parseFloat(a),latitude:parseFloat(r)}}))};e.default=a})),Oa=w((e=>{f(),Object.defineProperty(e,"__esModule",{value:!0});var t={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(e,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"convertArea",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"convertDistance",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"convertSpeed",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"decimalToSexagesimal",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"findNearest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"getBoundsOfDistance",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"getCenter",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"getCenterOfBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"getCoordinateKey",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"getDistance",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"getDistanceFromLine",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"getGreatCircleBearing",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"getLatitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"getLongitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(e,"getPathLength",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(e,"getPreciseDistance",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(e,"getRhumbLineBearing",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(e,"getRoughCompassDirection",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(e,"getSpeed",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(e,"isDecimal",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(e,"isPointInLine",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(e,"isPointInPolygon",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(e,"isPointNearLine",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(e,"isPointWithinRadius",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"isSexagesimal",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"isValidCoordinate",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"isValidLatitude",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(e,"isValidLongitude",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(e,"orderByDistance",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(e,"sexagesimalToDecimal",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(e,"toDecimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"toRad",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(e,"toDeg",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(e,"wktToPolygon",{enumerable:!0,get:function(){return $.default}});var n=X(qr()),a=X(Sr()),r=X(Cr()),i=X(Vr()),o=X(Fr()),s=X(Hr()),l=X(Xr()),u=X(sr()),h=X(zr()),c=X(Qr()),d=X(ea()),p=X(aa()),g=X(Le()),y=X(_t()),v=X(le()),m=X(cr()),b=X(da()),M=X(Q()),w=X(ee()),O=X(ca()),_=X(ha()),N=X(ur()),T=X(ga()),P=X(ya()),E=X(Ee()),x=X(ma()),j=X(va()),I=X(ba()),R=X(_a()),A=X(Be()),S=X(Yn()),k=X(Xn()),B=X(zn()),D=X(ar()),L=X(qe()),F=X(xt()),U=X(ae()),C=X(ye()),$=X(Ta()),G=W();function X(e){return e&&e.__esModule?e:{default:e}}Object.keys(G).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return G[n]}})}))})),ja=w(((e,t)=>{var n,a;f(),n=e,a=function(e){"use strict";var t="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t&&t,n="URLSearchParams"in t,a="Symbol"in t&&"iterator"in Symbol,r="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in t,o="ArrayBuffer"in t;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function g(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&r&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=p(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),a=0;a<t.length;a++)n[a]=String.fromCharCode(t[a]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(M)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=u(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},d.prototype.delete=function(e){delete this.map[u(e)]},d.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},d.prototype.set=function(e,t){this.map[u(e)]=h(t)},d.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),c(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),c(e)},a&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&null!=e._bodyInit&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new d(t.headers)),this.method=function(e){var t=e.toUpperCase();return m.indexOf(t)>-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function M(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),a=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(a),decodeURIComponent(r))}})),t}function w(e){var t=new d;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),a=n.shift().trim();if(a){var r=n.join(":").trim();t.append(a,r)}})),t}function O(e,t){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];O.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function N(n,a){return new Promise((function(i,s){var l=new b(n,a);if(l.signal&&l.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}u.onload=function(){var e={status:u.status,statusText:u.statusText,headers:w(u.getAllResponseHeaders()||"")};e.url="responseURL"in u?u.responseURL:e.headers.get("X-Request-URL");var t="response"in u?u.response:u.responseText;setTimeout((function(){i(new O(t,e))}),0)},u.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){s(new e.DOMException("Aborted","AbortError"))}),0)},u.open(l.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(t){return e}}(l.url),!0),"include"===l.credentials?u.withCredentials=!0:"omit"===l.credentials&&(u.withCredentials=!1),"responseType"in u&&(r?u.responseType="blob":o&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!a||"object"!=typeof a.headers||a.headers instanceof d?l.headers.forEach((function(e,t){u.setRequestHeader(t,e)})):Object.getOwnPropertyNames(a.headers).forEach((function(e){u.setRequestHeader(e,h(a.headers[e]))})),l.signal&&(l.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&l.signal.removeEventListener("abort",c)}),u.send(void 0===l._bodyInit?null:l._bodyInit)}))}N.polyfill=!0,t.fetch||(t.fetch=N,t.Headers=d,t.Request=b,t.Response=O),e.Headers=d,e.Request=b,e.Response=O,e.fetch=N,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?a(e):"function"==typeof define&&define.amd?define(["exports"],a):a(n.WHATWGFetch={})})),Ua=w(((e,t)=>{f(),ja(),t.exports=self.fetch.bind(self)}));f();var Ha=Nr(Ir());f(),f(),f();var wa=Nr(Oa());f();var xa=class{constructor({origin:e,destination:t,vortex:n,elevationDelta:a=0,distance:r=0,angle:i=0}){let o,s;if(c(this,"origin"),c(this,"destination"),c(this,"vortex"),c(this,"distance"),c(this,"angle"),c(this,"weight"),this.origin=e,this.destination=t,this.vortex=n,this.distance=r,this.angle=i,n?(this.distance=0,this.angle=0,o=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,s=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=a*s+o):(o=t.weight&&t.weight>=0?t.weight:0,s=t.multiplier&&t.multiplier>=1?t.multiplier:1,this.weight=this.distance*s+o),isNaN(this.angle))throw new Error("nan angle")}},yn=xa;function qu(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale||1);try{if(!e.georeference)throw new Error(`map ${e.name||e.shortName||e.id} does not have a georeference field`);if(e.georeference.length<3)throw new Error(`map ${e.name||e.shortName||e.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let t=e.georeference[0],n=e.georeference[2],a=(0,wa.getDistance)({latitude:t.target.x,longitude:t.target.y},{latitude:n.target.x,longitude:n.target.y}),r=t.control.x-n.control.x,i=t.control.y-n.control.y;return Math.sqrt(r*r+i*i)/a}catch(e){return console.error(e),1}}function Su(e,t){let n=e.x-t.x,a=e.y-t.y;return(Math.atan2(a,n)+2.5*Math.PI)%(2*Math.PI)}var U,Z,fe,Pa=class{constructor({nodes:e,vortexes:t,maps:n,showVortexNames:a=!1}){c(this,"edges"),c(this,"nodesById"),c(this,"mapsById"),this.edges={},this.mapsById=n.map((e=>ne(K({},e),{_scale:qu(e)}))).reduce(((e,t)=>(e[t.id]=t,e)),{});let r=e.filter((e=>!!this.mapsById[e.map])).map((e=>ne(K({},e),{paths:e.paths?e.paths.filter((({map:t})=>t===e.map)):[]})));this.nodesById=r.reduce(((e,t)=>(e[t.id]=t,e)),{});for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].paths=this.nodesById[e].paths.filter((({node:e})=>!!this.nodesById[e])));let i=t.map((e=>ne(K({},e),{name:a?e.name:e.type,nodes:e.nodes?e.nodes.filter((e=>!!this.nodesById[e])):[]})));r.forEach((e=>{this.edges[e.id]=e.paths.map((({node:t})=>{let n=this.nodesById[t];return new yn({angle:Su(e,n),destination:n,distance:this.getDistance(e,n),origin:e})}))})),i.forEach((e=>{if(null==e.nodes||0===e.nodes.length)return;let t=0;for(;t<e.nodes.length-1;){let n=this.nodesById[e.nodes[t]];if(t++,null==n)continue;let a=t;for(;a<e.nodes.length;){let t=this.nodesById[e.nodes[a]];if(a++,null==t)continue;let r=this.mapsById[n.map].elevation||0,i=this.mapsById[t.map].elevation||0,o=Math.abs(r-i);this.edges[n.id].push(new yn({destination:t,elevationDelta:o,origin:n,vortex:e})),this.edges[t.id].push(new yn({destination:n,elevationDelta:o,origin:t,vortex:e}))}}}))}aStar(e,t,n){let a=e.map((e=>this.nodesById[e])).filter((e=>e)),r=t.map((e=>this.nodesById[e])).filter((e=>e));if(0===a.length||0===r.length)return[];let i=[],o={},s={};for(a.forEach((e=>{let t=this.getShortestEuclideanDistance(e,r);i.push({origin:e,priority:t}),o[e.id]=null,s[e.id]=0})),i.sort(((e,t)=>e.priority-t.priority));i.length>0;){let e=i[0];if(r.includes(e.origin)){let t=[],n=o[e.origin.id];for(;null!=n;){t.push(n);let e=o[n.origin.id];n=null!=e?e:null}return t.reverse()}for(let t of this.edges[e.origin.id]){let a=t.vortex&&!1===t.vortex.accessible;if(n&&(a||!1===t.origin.accessible||!1===t.destination.accessible))continue;let l=s[e.origin.id]+t.weight;if(null==s[t.destination.id]||l<s[t.destination.id]){s[t.destination.id]=l;let e=l+this.getShortestEuclideanDistance(t.destination,r);i.push({origin:t.destination,priority:e}),o[t.destination.id]=t}}i.splice(0,1),i.sort(((e,t)=>e.priority-t.priority))}return[]}getDistance(e,t){let n,a=e.x-t.x,r=e.y-t.y,i=a*a+r*r;return n=null==this.mapsById[e.map]?1:this.mapsById[e.map]._scale,Math.sqrt(i)/n}getShortestEuclideanDistance(e,t){return t.reduce(((t,n)=>{let a=this.getDistance(e,n);return Math.min(t,a)}),Number.MAX_VALUE)}},hr=Pa;function Cu(e){switch(e){case fe.DOWN:case fe.UP:return`${e} `;default:return""}}f(),f(),function(e){e.DEPARTURE="Departure",e.TAKEVORTEX="TakeVortex",e.EXITVORTEX="ExitVortex",e.TURN="Turn",e.ARRIVAL="Arrival"}(U||(U={})),function(e){e.STRAIGHT="Straight",e.RIGHT="Right",e.SLIGHTRIGHT="SlightRight",e.LEFT="Left",e.SLIGHTLEFT="SlightLeft"}(Z||(Z={})),function(e){e.UP="up",e.DOWN="down",e.NONE="none"}(fe||(fe={}));var mn,Da=class{constructor({origin:e,action:t,distance:n,atLocation:a,instruction:r}){c(this,"node"),c(this,"instruction"),c(this,"action"),c(this,"atLocation"),c(this,"type"),c(this,"distance",0),this.node=e,this.action=t,this.distance=n||0,this.atLocation=a,this.instruction="",r?this.instruction=r:(null!=t&&t.type===U.DEPARTURE?this.instruction=null!=a?`Depart from ${a.name}`:"Depart from current location":null!=t&&t.type===U.ARRIVAL?this.instruction=null!=a?`Arrive at ${a.name}`:"Arrive at destination":null!=t&&t.type===U.TAKEVORTEX?this.instruction=`Take ${a&&a.name} ${Cu(t.direction)}to ${t.toMap.name}`:null!=t&&t.type===U.EXITVORTEX?this.instruction=`Exit ${a&&a.name} at ${t.toMap.name}`:null!=t&&t.bearing===Z.RIGHT?this.instruction="Turn right":null!=t&&t.bearing===Z.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=t&&t.bearing===Z.STRAIGHT?this.instruction="Head straight":null!=t&&t.bearing===Z.SLIGHTLEFT?this.instruction="Turn slightly left":null!=t&&t.bearing===Z.LEFT&&(this.instruction="Turn left"),null!=t&&t.type===U.TURN&&a&&(this.instruction+=` at ${a.name}`))}},pe=Da;(mn||(mn={})).NO_VALID_PATH="No Valid Path Available";var Mn=.1*Math.PI;function vn(e,t){return((t-e+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var Aa=class{constructor({locations:e,nodes:t,vortexes:n,maps:a,showVortexNames:r}){c(this,"graph"),c(this,"locationsByNodeId"),this.graph=new hr({maps:a,nodes:t,showVortexNames:r,vortexes:n}),this.locationsByNodeId=e.reduce(((e,t)=>(t.nodes&&t.nodes.forEach((n=>{e[n.node]=t})),t.polygons&&t.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{e[n]=t}))})),e)),{})}getClosestLocationInRay(e,t=.5*Math.PI,n=10){let a=0,r=0,i=e;for(;Math.abs(a)<t&&r<n;){let e=this.graph.edges[i.destination.id],o=null,s=0;for(let t of e)if(t.distance>0)if(null!=o){let e=-vn(i.angle,t.angle);Math.abs(e)<Math.abs(s)&&(o=t,s=e)}else o=t,s=-vn(i.angle,t.angle);if(null==o)return null;{if(Math.abs(s)>=t||(a+=s,r+=o.distance,Math.abs(a)>=t||r>n))return null;let e=this.locationsByNodeId[o.destination.id];if(null!=e)return e;i=o}}return null}getDirections({originIds:e,destinationNodeIds:t,accessible:n,departFrom:a,arriveAt:r}){let i=this.graph.aStar(e,t,n);if(0===i.length)return{distance:0,instructions:[new pe({distance:0,instruction:mn.NO_VALID_PATH})],path:[]};let o=0,s=new Array(i.length+1);for(let e=0;e<i.length;e++)s[e]=i[e].origin;s[i.length]=i[i.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let e=0;e<i.length;e++){let t=i[e],n=t.origin,s=t.destination;if(o+=t.distance,c+=(null==h?void 0:h.distance)||0,0===e&&l.push(new pe({action:{type:U.DEPARTURE},atLocation:a,distance:0,origin:n})),null!=t.vortex){let e=this.graph.mapsById[n.map],a=this.graph.mapsById[s.map],r=fe.NONE;if(null!=e.elevation&&null!=a.elevation){let t=e.elevation-a.elevation;t>0?r=fe.DOWN:t<0&&(r=fe.UP)}l.push(new pe({action:{direction:r,fromMap:e,toMap:a,type:U.TAKEVORTEX},atLocation:t.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let e=this.graph.mapsById[u.map],t=this.graph.mapsById[h.destination.map];l.push(new pe({action:{fromMap:e,toMap:t,type:U.EXITVORTEX},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let e=this.graph.edges[n.id].filter((e=>e.destination!==u&&e.destination!==t.destination));if(e.length>0){let a=-vn(h.angle,t.angle),r=e.reduce(((e,n)=>{let a=-vn(t.angle,n.angle);return Math.min(e,Math.abs(a))}),Math.PI);if(Math.abs(a)>=Mn||Math.abs(r)<=Mn){let e;e=a<=-Math.PI/4?Z.RIGHT:a<=-Mn?Z.SLIGHTRIGHT:a<=Mn?Z.STRAIGHT:a<=Math.PI/4?Z.SLIGHTLEFT:Z.LEFT;let t=this.locationsByNodeId[n.id];if(t||(t=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=t){let a=new pe({action:{bearing:e,referencePosition:"At",type:U.TURN},atLocation:t,distance:c,origin:n});a.type=e,l.push(a)}else l.push(new pe({action:{bearing:e,referencePosition:"At",type:U.TURN},distance:c,origin:n}));d+=c,c=0}}}e===i.length-1&&(l.push(new pe({action:{type:U.ARRIVAL},atLocation:r,distance:o-d<0?0:o-d,origin:t.destination})),d+=c,c=0),u=n,h=t}let f=[],p=null;for(let e=l.length-1;e>=0;e--){let t=l[e],{action:n}=t;n&&n.type===U.TAKEVORTEX?(p=t.node,f.unshift(t)):n&&n.type===U.TURN&&null!=p?this.graph.getDistance(t.node,p)>5&&f.unshift(t):f.unshift(t)}return{distance:o,instructions:f,path:s}}},gr=Aa;f(),f(),f(),f();var Ra=" ",X=class{static get separator(){return Ra}static set separator(e){Ra=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);let t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let n=null;switch(t.length){case 3:n=t[0]/1+t[1]/60+t[2]/3600;break;case 2:n=t[0]/1+t[1]/60;break;case 1:n=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(n=-n),Number(n)}static toDms(e,t="d",n){if(isNaN(e)||"string"==typeof e&&""==e.trim()||"boolean"==typeof e||e==1/0||null==e)return null;if(void 0===n)switch(t){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:t="d",n=4}e=Math.abs(e);let a=null,r=null,i=null,o=null;switch(t){default:case"d":case"deg":r=e.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),a=r+"°";break;case"dm":case"deg+min":r=Math.floor(e),i=(60*e%60).toFixed(n),60==i&&(i=(0).toFixed(n),r++),r=("000"+r).slice(-3),i<10&&(i="0"+i),a=r+"°"+X.separator+i+"′";break;case"dms":case"deg+min+sec":r=Math.floor(e),i=Math.floor(3600*e/60)%60,o=(3600*e%60).toFixed(n),60==o&&(o=(0).toFixed(n),i++),60==i&&(i=0,r++),r=("000"+r).slice(-3),i=("00"+i).slice(-2),o<10&&(o="0"+o),a=r+"°"+X.separator+i+"′"+X.separator+o+"″"}return a}static toLat(e,t,n){let a=X.toDms(X.wrap90(e),t,n);return null===a?"–":a.slice(1)+X.separator+(e<0?"S":"N")}static toLon(e,t,n){let a=X.toDms(X.wrap180(e),t,n);return null===a?"–":a+X.separator+(e<0?"W":"E")}static toBrng(e,t,n){let a=X.toDms(X.wrap360(e),t,n);return null===a?"–":a.replace("360","0")}static fromLocale(e){let t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(e){let t=123456.789.toLocaleString(),n={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=X.wrap360(e);let n=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*n/360)%n*16/n]}static wrap360(e){return 0<=e&&e<360?e:(e%360+360)%360}static wrap180(e){return-180<e&&e<=180?e:(e+540)%360-180}static wrap90(e){return-90<=e&&e<=90?e:Math.abs((e%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var R=X,k=Math.PI,T=class{constructor(e,t){if(isNaN(e))throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t))throw new TypeError(`invalid lon ‘${t}’`);this._lat=R.wrap90(Number(e)),this._lon=R.wrap180(Number(t))}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?R.wrap90(R.parse(e)):R.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?R.wrap90(R.parse(e)):R.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?R.wrap180(R.parse(e)):R.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?R.wrap180(R.parse(e)):R.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?R.wrap180(R.parse(e)):R.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");if(null===e[0]||null===e[1])throw new TypeError("invalid (null) point");let t,n;if(2==e.length&&([t,n]=e,t=R.wrap90(R.parse(t)),n=R.wrap180(R.parse(n)),isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e.toString()}’`);if(1==e.length&&"string"==typeof e[0]&&([t,n]=e[0].split(","),t=R.wrap90(R.parse(t)),n=R.wrap180(R.parse(n)),isNaN(t)||isNaN(n)))throw new TypeError(`invalid point ‘${e[0]}’`);if(1==e.length&&"object"==typeof e[0]){let a=e[0];if("Point"==a.type&&Array.isArray(a.coordinates)?[n,t]=a.coordinates:(null!=a.latitude&&(t=a.latitude),null!=a.lat&&(t=a.lat),null!=a.longitude&&(n=a.longitude),null!=a.lng&&(n=a.lng),null!=a.lon&&(n=a.lon),t=R.wrap90(R.parse(t)),n=R.wrap180(R.parse(n))),isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if(isNaN(t)||isNaN(n))throw new TypeError(`invalid point ‘${e.toString()}’`);return new T(t,n)}distanceTo(e,t=6371e3){if(e instanceof T||(e=T.parse(e)),isNaN(t))throw new TypeError(`invalid radius ‘${t}’`);let n=t,a=this.lat.toRadians(),r=this.lon.toRadians(),i=e.lat.toRadians(),o=i-a,s=e.lon.toRadians()-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(a)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(e){if(e instanceof T||(e=T.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),n=e.lat.toRadians(),a=(e.lon-this.lon).toRadians(),r=Math.cos(t)*Math.sin(n)-Math.sin(t)*Math.cos(n)*Math.cos(a),i=Math.sin(a)*Math.cos(n),o=Math.atan2(i,r).toDegrees();return R.wrap360(o)}finalBearingTo(e){e instanceof T||(e=T.parse(e));let t=e.initialBearingTo(this)+180;return R.wrap360(t)}midpointTo(e){e instanceof T||(e=T.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),a=e.lat.toRadians(),r=(e.lon-this.lon).toRadians(),i=Math.cos(t),o=0,s=Math.sin(t),l={x:i+Math.cos(a)*Math.cos(r),y:o+Math.cos(a)*Math.sin(r),z:s+Math.sin(a)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=n+Math.atan2(l.y,l.x),c=u.toDegrees(),d=h.toDegrees();return new T(c,d)}intermediatePointTo(e,t){if(e instanceof T||(e=T.parse(e)),this.equals(e))return new T(this.lat,this.lon);let n=this.lat.toRadians(),a=this.lon.toRadians(),r=e.lat.toRadians(),i=e.lon.toRadians(),o=r-n,s=i-a,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n)*Math.cos(r)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-t)*u)/Math.sin(u),c=Math.sin(t*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(a)+c*Math.cos(r)*Math.cos(i),f=h*Math.cos(n)*Math.sin(a)+c*Math.cos(r)*Math.sin(i),p=h*Math.sin(n)+c*Math.sin(r),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),v=g.toDegrees(),m=y.toDegrees();return new T(v,m)}destinationPoint(e,t,n=6371e3){let a=e/n,r=Number(t).toRadians(),i=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(i)*Math.cos(a)+Math.cos(i)*Math.sin(a)*Math.cos(r),l=Math.asin(s),u=Math.sin(r)*Math.sin(a)*Math.cos(i),h=Math.cos(a)-Math.sin(i)*s,c=o+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new T(d,f)}static intersection(e,t,n,a){if(e instanceof T||(e=T.parse(e)),n instanceof T||(n=T.parse(n)),isNaN(t))throw new TypeError(`invalid brng1 ‘${t}’`);if(isNaN(a))throw new TypeError(`invalid brng2 ‘${a}’`);let r=e.lat.toRadians(),i=e.lon.toRadians(),o=n.lat.toRadians(),s=n.lon.toRadians(),l=Number(t).toRadians(),u=Number(a).toRadians(),h=o-r,c=s-i,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(r)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new T(e.lat,e.lon);let f=(Math.sin(o)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),p=(Math.sin(r)-Math.sin(o)*Math.cos(d))/(Math.sin(d)*Math.cos(o)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(p,-1),1)),v=l-(Math.sin(s-i)>0?g:2*k-g),m=(Math.sin(s-i)>0?2*k-y:y)-u;if(0==Math.sin(v)&&0==Math.sin(m)||Math.sin(v)*Math.sin(m)<0)return null;let b=-Math.cos(v)*Math.cos(m)+Math.sin(v)*Math.sin(m)*Math.cos(d),M=Math.atan2(Math.sin(d)*Math.sin(v)*Math.sin(m),Math.cos(m)+Math.cos(v)*b),w=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(M)+Math.cos(r)*Math.sin(M)*Math.cos(l),-1),1)),O=i+Math.atan2(Math.sin(l)*Math.sin(M)*Math.cos(r),Math.cos(M)-Math.sin(r)*Math.sin(w)),_=w.toDegrees(),N=O.toDegrees();return new T(_,N)}crossTrackDistanceTo(e,t,n=6371e3){e instanceof T||(e=T.parse(e)),t instanceof T||(t=T.parse(t));let a=n;if(this.equals(e))return 0;let r=e.distanceTo(this,a)/a,i=e.initialBearingTo(this).toRadians(),o=e.initialBearingTo(t).toRadians();return Math.asin(Math.sin(r)*Math.sin(i-o))*a}alongTrackDistanceTo(e,t,n=6371e3){e instanceof T||(e=T.parse(e)),t instanceof T||(t=T.parse(t));let a=n;if(this.equals(e))return 0;let r=e.distanceTo(this,a)/a,i=e.initialBearingTo(this).toRadians(),o=e.initialBearingTo(t).toRadians(),s=Math.asin(Math.sin(r)*Math.sin(i-o));return Math.acos(Math.cos(r)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-i))*a}maxLatitude(e){let t=Number(e).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(t)*Math.cos(n))).toDegrees()}static crossingParallels(e,t,n){if(e.equals(t))return null;let a=Number(n).toRadians(),r=e.lat.toRadians(),i=e.lon.toRadians(),o=t.lat.toRadians(),s=t.lon.toRadians()-i,l=Math.sin(r)*Math.cos(o)*Math.cos(a)*Math.sin(s),u=Math.sin(r)*Math.cos(o)*Math.cos(a)*Math.cos(s)-Math.cos(r)*Math.sin(o)*Math.cos(a),h=Math.cos(r)*Math.cos(o)*Math.sin(a)*Math.sin(s);if(h*h>l*l+u*u)return null;let c=Math.atan2(-u,l),d=Math.acos(h/Math.sqrt(l*l+u*u)),f=i+c+d,p=(i+c-d).toDegrees(),g=f.toDegrees();return{lon1:R.wrap180(p),lon2:R.wrap180(g)}}rhumbDistanceTo(e,t=6371e3){e instanceof T||(e=T.parse(e));let n=t,a=this.lat.toRadians(),r=e.lat.toRadians(),i=r-a,o=Math.abs(e.lon-this.lon).toRadians();Math.abs(o)>k&&(o=o>0?-(2*k-o):2*k+o);let s=Math.log(Math.tan(r/2+k/4)/Math.tan(a/2+k/4)),l=Math.abs(s)>1e-11?i/s:Math.cos(a);return Math.sqrt(i*i+l*l*o*o)*n}rhumbBearingTo(e){if(e instanceof T||(e=T.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),n=e.lat.toRadians(),a=(e.lon-this.lon).toRadians();Math.abs(a)>k&&(a=a>0?-(2*k-a):2*k+a);let r=Math.log(Math.tan(n/2+k/4)/Math.tan(t/2+k/4)),i=Math.atan2(a,r).toDegrees();return R.wrap360(i)}rhumbDestinationPoint(e,t,n=6371e3){let a=this.lat.toRadians(),r=this.lon.toRadians(),i=Number(t).toRadians(),o=e/n,s=o*Math.cos(i),l=a+s;Math.abs(l)>k/2&&(l=l>0?k-l:-k-l);let u=Math.log(Math.tan(l/2+k/4)/Math.tan(a/2+k/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(a),c=r+o*Math.sin(i)/h,d=l.toDegrees(),f=c.toDegrees();return new T(d,f)}rhumbMidpointTo(e){e instanceof T||(e=T.parse(e));let t=this.lat.toRadians(),n=this.lon.toRadians(),a=e.lat.toRadians(),r=e.lon.toRadians();Math.abs(r-n)>k&&(n+=2*k);let i=(t+a)/2,o=Math.tan(k/4+t/2),s=Math.tan(k/4+a/2),l=Math.tan(k/4+i/2),u=((r-n)*Math.log(l)+n*Math.log(s)-r*Math.log(o))/Math.log(s/o);isFinite(u)||(u=(n+r)/2);let h=i.toDegrees(),c=u.toDegrees();return new T(h,c)}static areaOf(e,t=6371e3){let n=t,a=e[0].equals(e[e.length-1]);a||e.push(e[0]);let r=e.length-1,i=0;for(let t=0;t<r;t++){let n=e[t].lat.toRadians(),a=e[t+1].lat.toRadians(),r=(e[t+1].lon-e[t].lon).toRadians();i+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(a/2)),1+Math.tan(n/2)*Math.tan(a/2))}(function(e){let t=0,n=e[0].initialBearingTo(e[1]);for(let a=0;a<e.length-1;a++){let r=e[a].initialBearingTo(e[a+1]),i=e[a].finalBearingTo(e[a+1]);t+=(r-n+540)%360-180,t+=(i-r+540)%360-180,n=i}return t+=(e[0].initialBearingTo(e[1])-n+540)%360-180,Math.abs(t)<90})(e)&&(i=Math.abs(i)-2*k);let o=Math.abs(i*n*n);return a||e.pop(),o}equals(e){return e instanceof T||(e=T.parse(e)),!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(e="d",t){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);if("n"==e)return null==t&&(t=4),`${this.lat.toFixed(t)},${this.lon.toFixed(t)}`;return`${R.toLat(this.lat,e,t)}, ${R.toLon(this.lon,e,t)}`}};f(),f(),f();var bn=class{constructor(e){c(this,"destinations",[]),this.destinations=e}};f();var Ge,ue,Ve=class{constructor(e,t){b(this,Ge,void 0),b(this,ue,void 0),c(this,"distance",0),c(this,"path",[]),c(this,"instructions",[]),O(this,ue,e),O(this,Ge,t),this.distance=t.distance,this.instructions=t.instructions.map((e=>{var t,n,a,r,i,o,s,l,u,c,d,f;let p=ne(K({},e),{action:K({},e.action),atLocation:(null==(t=e.atLocation)?void 0:t.id)?null==(a=null==(n=h(this,ue))?void 0:n._vortexesById)?void 0:a[e.atLocation.id]:void 0,node:(null==(r=e.node)?void 0:r.id)?null==(o=null==(i=h(this,ue))?void 0:i._nodesById)?void 0:o[e.node.id]:void 0});return((null==(s=p.action)?void 0:s.type)===U.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===U.EXITVORTEX)&&(p.action.fromMap=null==(c=h(this,ue)._mapsById)?void 0:c[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(f=h(this,ue)._mapsById)?void 0:f[null==(d=p.action)?void 0:d.toMap.id]),p})),this.path=t.path.map((e=>{var t,n;return null==(n=null==(t=h(this,ue))?void 0:t._nodesById)?void 0:n[e.id]}))}toJSON(){return h(this,Ge)}};Ge=new WeakMap,ue=new WeakMap;var ge,he=class{constructor(e){b(this,ge,void 0),O(this,ge,e)}directionsTo(e,t){if(e instanceof bn){let n=[],a=this;for(let r=0;r<e.destinations.length;r++){let i=e.destinations[r],o=ke(a),s=ke(i),l=h(this,ge).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==t?void 0:t.accessible)||!1}),u=new Ve(h(this,ge),l);n.push(u),a=i}return n}{let n=ke(this),a=ke(e),r=h(this,ge).navigator.getDirections({originIds:n,destinationNodeIds:a,accessible:(null==t?void 0:t.accessible)||!1});return new Ve(h(this,ge),r)}}distanceTo(e,t){let n=this.directionsTo(e,t);return(null==n?void 0:n.distance)||0}directionsToCallback(e,t){return this.directionsTo(e,t)}};ge=new WeakMap;var Vu=0,Gu="9999-12-31T00:00:00.000Z";function ku(e,t,n=new Date){if(!e.states)return;let a=n||new Date,r=e.states.find((e=>{let t=new Date(e.start||Vu),n=new Date(e.end||Gu);return t<a&&n>a}));return r?t.find((e=>e.value===r.type)):void 0}var ie,me,Y,Fe,je,$e,Ue=class extends he{constructor(e,t){super(e),b(this,ie,void 0),b(this,me,void 0),b(this,Y,{}),c(this,"states"),c(this,"id",""),c(this,"name",""),c(this,"type",""),c(this,"description"),c(this,"sortOrder"),c(this,"logo"),c(this,"phone"),c(this,"social"),c(this,"color"),c(this,"shortName"),c(this,"detailsUrl"),c(this,"tags"),c(this,"externalId"),c(this,"showLabelWhenImagePresent"),c(this,"picture"),c(this,"operationHours"),c(this,"siblingGroups"),c(this,"gallery"),c(this,"categories",[]),b(this,Fe,void 0),b(this,je,[]),b(this,$e,void 0),O(this,ie,e),O(this,me,t),Object.assign(this,t)}get polygons(){let e=h(this,Y).polygons;if(void 0!==e)return e;let t=[],n=h(this,Fe),a=h(this,ie)._polygonsById;if(Array.isArray(n))for(let e=0,r=n.length;e<r;++e){let r=a[n[e].id];null!=r&&r.geometry.visible&&t.push(r)}return h(this,Y).polygons=t,t}set polygons(e){O(this,Fe,e)}get rank(){let e=h(this,Y).rank;if(void 0!==e)return e;let t=h(this,ie).locationRankings;if(!t||!t.locations)return null;let n=t.locations.find((e=>e.ids.find((e=>e===this.id))));return n?(h(this,Y).rank=n.score,n.score):null}get nodes(){let e=h(this,Y).nodes;if(void 0!==e)return e;let t=[],n=h(this,je),a=h(this,ie)._nodesById;if(n)for(let e=0,r=n.length;e<r;++e){let r=a[n[e].node];null!=r&&t.push(r)}return h(this,Y).nodes=t,t}set nodes(e){O(this,je,e)}get parent(){let e=h(this,Y).parent;if(void 0!==e)return e;let t,n=h(this,ie)._locationsById,a=h(this,$e);return void 0!==a&&(t=n[a]),h(this,Y).parent=t,t}set parent(e){O(this,$e,e)}get state(){return ku(this,h(this,ie).locationStates)}clone(){return new Ue(h(this,ie),h(this,me))}get nodeOperationHours(){let e=h(this,Y).nodeOperationHours;if(void 0!==e)return e;if(null==this.nodes)return{};let t=h(this,me).nodes.reduce(((e,t)=>(null!=t.operationHours&&(e[t.node]=t.operationHours),e)),{});return h(this,Y).nodeOperationHours=t,t}static hydrate(e,t){return e.map((e=>new Ue(t,e)))}static async fetch(e){let t=e.options.things.locations.slice();e.options.things.categories&&j(t,"categories"),e.options.things.nodes&&j(t,"nodes"),e.options.things.polygons&&j(t,"polygons"),e.options.things.locationStates&&j(t,"states");let n={fields:t,venue:e.options.venue};try{let t=await F(e.options,"location",n);return e.options.includeHidden||(t=t.filter((e=>!e.hidden))),t.map((t=>new Ue(e,t)))}catch(e){return console.error("Fetch Locations:",e),[]}}toJSON(){return h(this,me)}},xe=Ue;ie=new WeakMap,me=new WeakMap,Y=new WeakMap,Fe=new WeakMap,je=new WeakMap,$e=new WeakMap,f();var Me,He,oe,We,_n=class extends he{constructor(e,t){super(e),b(this,Me,void 0),b(this,He,void 0),b(this,oe,{}),c(this,"geometry"),c(this,"id",""),c(this,"map",""),c(this,"layer"),c(this,"layerId"),c(this,"name"),c(this,"externalId"),c(this,"vertexes"),c(this,"canvasBounds"),b(this,We,void 0),O(this,Me,e),O(this,He,t),Object.assign(this,t)}get locations(){let e=h(this,oe).locations;if(void 0!==e)return e;let t=[],{locations:n}=h(this,Me),{id:a}=this;for(let e=0,r=n.length;e<r;++e){let r=n[e],i=r.polygons;if(Array.isArray(i))for(let e=0,n=i.length;e<n;++e)if(i[e].id===a){t.push(r);break}}return h(this,oe).locations=t,t}get entrances(){let e=h(this,oe).entrances;if(void 0!==e)return e;let t=[],n=h(this,We),a=h(this,Me)._nodesById;if(Array.isArray(n)){for(let e=0,r=n.length;e<r;++e){let r=a[n[e].id];null!=r&&t.push(r)}return h(this,oe).entrances=t,t}return[]}set entrances(e){O(this,We,e)}get rank(){let e=h(this,oe).rank;if(void 0!==e)return e;let{rankings:t}=h(this,Me);if(!t||!t.polygons)return null;let n=t.polygons.find((e=>e.polygonId===this.id));return n?(h(this,oe).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(h(this,oe).rank=null,null)}static hydrate(e,t){return e.map((e=>new _n(t,e)))}static async fetch(e){let t=e.options.things.polygons.slice();e.options.things.maps&&j(t,"map"),e.options.things.nodes&&j(t,"entrances");let n={fields:t,perspective:e.options.do2D&&e.options.perspective||void 0,venue:e.options.venue};try{return(await F(e.options,"polygon",n)).filter((e=>e.geometry.visible)).map((t=>new _n(e,t)))}catch(e){return console.error("Fetch Polygons:",e),[]}}toJSON(){return h(this,He)}},we=_n;function La(e){return/^[\da-f]{24}$/i.test(e)}function Ea(e,t=!1){let n="";if(null!=e){let a="?",r=t?Object.keys(e).filter((e=>!["slug","venue"].includes(e))):Object.keys(e);for(let t=0,i=r.length;t<i;++t){let i=r[t],o=e[i];null!=o&&(n+=`${a+encodeURIComponent(i)}=${encodeURIComponent(o)}`,a="&")}}return n}function Fu(e,t,n,a=!1){var r,i;return a?`${e.supplementaryUrl}${t}?venue=${n.venue||n.slug}`:(null==(r=e.baseUrl)?void 0:r.includes("gateway"))?`${e.baseUrl}${t}/${n.venue||n.slug}${Ea(n,null==(i=e.baseUrl)?void 0:i.includes("gateway"))}`:e.baseUrl+t+Ea(n)}async function F(e,t,n,a=!1){return Ke(e,t,n,a,!0)}async function Ke(e,t,n,a=!1,r=!1){let i=Fu(e,t,n,a),o=await yr(e,i,a);if(!r&&Array.isArray(o)){if(1===o.length)return o[0];throw new Error("Invalid response object")}return o}async function yr(e,t,n=!1){let a={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};n&&delete a.language,a.language&&(t+=`&lang=${encodeURIComponent(a.language)}`);let{headers:r}=e;r["Content-Type"]="text/json",e.authorization&&(r.Authorization=e.authorization),a.language&&(r["Accept-Language"]=a.language);let i=await fetch(t,{method:"GET",headers:r});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return i.json()}function j(e,t){e.indexOf(t)<0&&e.push(t)}function Ba([e,t],[n,a]){let r=new T(e,t),i=new T(n,a);return r.distanceTo(i)}function qa(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale);let t;try{let n=e.georeference[0],a=e.georeference[2],r=new T(n.target.x,n.target.y),i=new T(a.target.x,a.target.y),o=r.distanceTo(i),s=n.control.x-a.control.x,l=n.control.y-a.control.y;t=Math.sqrt(s*s+l*l)/o}catch(n){t=1,console.warn(n),console.warn(`Couldn't georeference ${e.name||e.shortName||e.id}. Probably not enough geocoordinates.`)}return t}function ke(e){var t;return e instanceof we?e.entrances.map((e=>e.id)):e instanceof xe?(null==(t=e.nodes)?void 0:t.map((e=>e.id)))||[]:[e.id]}async function Sa(e){let t={},{maps:n,images:a,scenes:r,polygons:i}=e;if(null!=a)try{let e=Object.keys(a).map((e=>fetch(`data:image/png;base64,${a[e]}`).then((e=>e.blob())).then((n=>{t[e]=n})).catch((e=>{console.error(e)}))));await Promise.all(e)}catch(e){console.error(e)}return n.forEach((e=>{var n;!(null==(n=e.scene)?void 0:n.polygons)&&!r[e.id]||(null!=r&&r[e.id]&&(e.scene||(e.scene={}),e.scene.polygons=r[e.id]),null!=a&&(e.scene.images=e.scene.images.map((({filename:e})=>({filename:e,url:t[e]}))),e.scene.polygons.forEach((e=>{var n;if(null==(n=null==e?void 0:e.image)?void 0:n.url){let n=e.image.url.split("/"),a=t[n[n.length-1]];a&&(e.image.url=a)}}))))})),null!=a&&i.forEach((e=>{var n;if(null==(n=null==e?void 0:e.image)?void 0:n.url){let n=e.image.url.split("/"),a=t[n[n.length-1]];a&&(e.image.url=a)}})),null!=e.images&&delete e.images,null!=e.scenes&&delete e.scenes,e}function Ca(e,t){let n,a,r,i=t.x,o=t.y,s=Number.MAX_SAFE_INTEGER;return e.forEach((e=>{a=e.x,r=e.y;let t=(i-a)**2+(o-r)**2;t<s&&(s=t,n=e)})),n}Me=new WeakMap,He=new WeakMap,oe=new WeakMap,We=new WeakMap;var Xe,Je,ze,Tn=class{constructor(e,t){b(this,Xe,void 0),b(this,Je,{}),b(this,ze,void 0),c(this,"name"),c(this,"externalId"),c(this,"parents"),c(this,"id"),c(this,"icon"),this.id=t.id,O(this,ze,t),O(this,Xe,e),Object.assign(this,t)}get locations(){let e=h(this,Je).locations;if(void 0!==e)return e;let t=[],{locations:n}=h(this,Xe),{id:a}=this;for(let e=0,r=n.length;e<r;++e){let r=n[e],i=r.categories;if(Array.isArray(i))for(let e=0,n=i.length;e<n;++e)if(i[e]===a){t.push(r);break}}return h(this,Je).locations=t,t}static hydrate(e,t){return e.map((e=>new Tn(t,e)))}static async fetch(e){let t={fields:e.options.things.categories,venue:e.options.venue};try{return(await F(e.options,"category",t)).map((t=>new Tn(e,t)))}catch(e){return console.error("Fetch Categories:",e),[]}}toJSON(){return h(this,ze)}},Nn=Tn;Xe=new WeakMap,Je=new WeakMap,ze=new WeakMap,f();var Ze,Pe,Ye,On=class{constructor(e,t){b(this,Ze,void 0),b(this,Pe,void 0),b(this,Ye,{}),c(this,"id",""),c(this,"type",""),c(this,"name",""),c(this,"description"),c(this,"image"),c(this,"startDate"),c(this,"endDate"),c(this,"showDate"),O(this,Pe,t),O(this,Ze,e),Object.assign(this,t)}location(){let e=h(this,Ye).location;if(void 0!==e)return e;let t,n=h(this,Ze)._locationsById,a=h(this,Pe).location;if(null!=a){let e=n[a];null!=e&&(t=e)}return h(this,Ye).location=t,t}static hydrate(e,t){return e.map((e=>new On(t,e)))}static async fetch(e){let t=e.options.things.events.slice();e.options.things.locations&&j(t,"location");let n={fields:t,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await F(e.options,"event",n)).map((t=>new On(e,t)))}catch(e){return console.error("Fetch Events:",e),[]}}toJSON(){return h(this,Pe)}},In=On;Ze=new WeakMap,Pe=new WeakMap,Ye=new WeakMap,f();var Qe,xn=class{constructor(e){b(this,Qe,void 0),c(this,"locations",[]),O(this,Qe,e),Object.assign(this,e)}static hydrate(e){return new xn(e)}static async fetch(e){try{let t=await Ke(e.options,"smart-labels/location-label-ranking",{venue:e.options.venue},!0);return new xn(t)}catch(e){return console.error("Fetch Location Rankings:",e),{}}}toJSON(){return h(this,Qe)}},mr=xn;Qe=new WeakMap,f();var et,wn=class{constructor(e){b(this,et,void 0),c(this,"id",""),c(this,"name",""),c(this,"value",""),O(this,et,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new wn(e)))}static async fetch(e){let t={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await F(e.options,"location-state",t)).map((e=>new wn(e)))}catch(e){return console.error("Fetch Location States:",e),[]}}toJSON(){return h(this,et)}},Mr=wn;et=new WeakMap,f(),f();var tt,nt,Pn=class{constructor(e,t,n,a,r,i){c(this,"map"),c(this,"x",0),c(this,"y",0),c(this,"lat",0),c(this,"lon",0),b(this,tt,{}),b(this,nt,void 0),this.lat=e,this.lon=t,this.map="string"==typeof r?r:r.id,this.x=n,this.y=a,O(this,nt,i)}absoluteDistanceTo(e){return Ba([e.lat,e.lon],[this.lat,this.lon])}get nearestNode(){let e=h(this,tt).nearestNode;if(void 0!==e)return e;let t=Ca(h(this,nt).nodes.filter((e=>e.map===this.map)),this);return h(this,tt).nearestNode=t,t}};tt=new WeakMap,nt=new WeakMap;var ve,be,rt,An=class{constructor(e,t){b(this,ve,void 0),b(this,be,{}),b(this,rt,void 0),c(this,"id",""),c(this,"group",""),c(this,"name",""),c(this,"shortName",""),c(this,"elevation",0),c(this,"scale",0),c(this,"x_scale"),c(this,"perspectiveId"),c(this,"width",0),c(this,"height",0),c(this,"georeference",[]),c(this,"_scale",0),O(this,ve,e),O(this,rt,t),Object.assign(this,t),this._scale=qa(this),this.scale=this.x_scale}get polygons(){let e=h(this,be).polygons;if(void 0!==e)return e;let t=[],{polygons:n}=h(this,ve),{id:a}=this;for(let e=0,r=n.length;e<r;++e){let r=n[e];r.map===a&&t.push(r)}return h(this,be).polygons=t,t}get mapGroup(){let e=h(this,be).mapGroup;if(void 0!==e)return e;let t=this.group,n=t&&h(this,ve)._mapGroupsById[t]||null;return h(this,be).mapGroup=n,n}createCoordinate(e,t){let n=this.georeference[0],a=new T(n.target.x,n.target.y),r=new T(e,t),i=a.distanceTo(r),o=(a.finalBearingTo(r)+360)%360*Math.PI/180,s=i*(1/this.scale),l=o+this.getNorth(),u=Math.sin(l)*s,c=Math.cos(l)*s;return new Pn(e,t,n.control.x+u,n.control.y-c,this.id,h(this,ve))}getNorth(){let e;try{let t=this.georeference[0],n=this.georeference[2],a=new T(t.target.x,t.target.y),r=new T(n.target.x,n.target.y);e=-((a.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(n.control.y-t.control.y,n.control.x-t.control.x)-Math.PI/2)}catch(t){e=0,console.warn(t),console.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return e}static hydrate(e,t){return e.map((e=>{let n=new An(t,e);return Object.defineProperty(n.scene,"polygons",{get:()=>n.polygons}),n}))}static async fetch(e){let t=e.options.things.maps.slice();e.options.perspective&&j(t,"perspectives"),e.options.things.mapGroups&&j(t,"group"),j(t,"elevation"),j(t,"x_scale"),j(t,"scale"),j(t,"georeference");let n={fields:t,perspective:e.options.perspective,venue:e.options.venue};try{let r=await F(e.options,"map",n),i=e=>{let t=a.layers.find((t=>t.id===e));t?t.visible=!0:a.layers.push({id:e,visible:!0})};for(let n=0,o=r.length;n<o;++n){var a=r[n];if(a){let n=a.perspective;null!=n&&(a.perspectiveId=n.id,e.options.do2D?(t.indexOf("width")>-1&&(a.width=n.size&&n.size.width||n.width),t.indexOf("height")>-1&&(a.height=n.size&&n.size.height||n.height),t.indexOf("tiles")>-1&&(a.tiles=n.tiles),t.indexOf("original")>-1&&(a.original=n.original)):(t.indexOf("scene")>-1&&(a.scene=n.scene),n.layers?(a.layers.forEach((e=>{e.visible=!1})),n.layers.forEach(i)):a.layers.forEach((e=>{e.visible=!0})))),delete a.perspective}r[n]=new An(e,a)}return r}catch(e){return console.error("Fetch Maps:",e),[]}}toJSON(){return h(this,rt)}},Dn=An;ve=new WeakMap,be=new WeakMap,rt=new WeakMap,f();var at,De,it,Ln=class{constructor(e,t){b(this,at,void 0),b(this,De,void 0),b(this,it,{}),c(this,"id",""),c(this,"name",""),O(this,De,t),O(this,at,e),Object.assign(this,t)}get maps(){let e=h(this,it).maps;if(void 0!==e)return e;let t=[],{maps:n}=h(this,at),{id:a}=h(this,De);for(let e=0,r=n.length;e<r;++e){let r=n[e];r.group===a&&t.push(r)}return h(this,it).maps=t,t}static hydrate(e,t){return e.map((e=>new Ln(t,e)))}static async fetch(e){let t={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await F(e.options,"map-group",t)).map((t=>new Ln(e,t)))}catch(e){return console.error("Fetch Map Groups:",e),[]}}toJSON(){return h(this,De)}},Rn=Ln;at=new WeakMap,De=new WeakMap,it=new WeakMap,f();var _e,ot,de,st,Bn=class extends he{constructor(e,t){super(e),b(this,_e,void 0),b(this,ot,void 0),b(this,de,{}),c(this,"id",""),c(this,"map",""),c(this,"x",0),c(this,"y",0),c(this,"operationHours"),c(this,"externalId"),b(this,st,void 0),O(this,_e,e),O(this,ot,t),Object.assign(this,t)}get paths(){let e=h(this,de).paths;if(void 0!==e)return e;let t=[],n=h(this,_e)._nodesById,a=h(this,st);if(Array.isArray(a))for(let e=0,r=a.length;e<r;++e){let r=n[a[e].node];null!=r&&t.push(r)}return h(this,de).paths=t,t}set paths(e){O(this,st,e)}get locations(){let e=h(this,de).locations;if(void 0!==e)return e;let t=[],{locations:n}=h(this,_e),a=this.id;for(let e=0,r=n.length;e<r;++e){let r=n[e],i=r.nodes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;++e)if(i[e].id===a){t.push(r);break}}return h(this,de).locations=t,t}get polygon(){let e=h(this,de).polygon;if(void 0!==e)return e;let t,{polygons:n}=h(this,_e),a=this.id;for(let e=0,r=n.length;e<r;++e){let r=n[e];r.entrances.map((e=>e.id)).includes(a)&&(t=r)}return h(this,de).polygon=t,t}static hydrate(e,t){return e.map((e=>new Bn(t,e)))}static async fetch(e){let t=e.options.things.nodes.slice();e.options.things.maps&&j(t,"map"),["weight","multiplier","accessible"].forEach((function(e){j(t,e)}));let n={fields:t,perspective:e.options.do2D&&e.options.perspective||void 0,venue:e.options.venue};try{return(await F(e.options,"node",n)).map((t=>new Bn(e,t)))}catch(e){return console.error("Fetch Nodes:",e),[]}}toJSON(){return h(this,ot)}},En=Bn;_e=new WeakMap,ot=new WeakMap,de=new WeakMap,st=new WeakMap,f();var ut,Sn=class{constructor(e){b(this,ut,void 0),c(this,"polygons",[]),O(this,ut,e),Object.assign(this,e)}static hydrate(e){return new Sn(e)}static async fetch(e){try{let t=await Ke(e.options,"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new Sn(t)}catch(e){return console.error("Fetch Rankings:",e),null}}toJSON(){return h(this,ut)}},qn=Sn;ut=new WeakMap,f();var dt,Cn=class{constructor(e){c(this,"id",""),b(this,dt,void 0),O(this,dt,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new Cn(e)))}static async fetch(e){let t={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await F(e.options,"apollo-theme",t)).map((e=>new Cn(e)))}catch(e){return console.error("Fetch Theme:",e),[]}}toJSON(){return h(this,dt)}},vr=Cn;dt=new WeakMap,f();var ct,Gn=class{constructor(e){b(this,ct,void 0),c(this,"defaultMap",""),c(this,"address",""),c(this,"city",""),c(this,"countrycode",""),c(this,"externalId",""),c(this,"id",""),c(this,"latitude"),c(this,"logo"),c(this,"longitude"),c(this,"metadata"),c(this,"name",""),c(this,"operationHours"),c(this,"postal",""),c(this,"slug",""),c(this,"state",""),c(this,"telephone",""),c(this,"tzid",""),c(this,"tzidOverride",""),c(this,"utcOffset",""),c(this,"website",""),O(this,ct,e),Object.assign(this,e)}static hydrate(e){return new Gn(e)}static async fetch(e){let t={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let n=await F(e.options,"venue",t);return new Gn(n[0])}catch(e){return console.error("Fetch Venue:",e),{}}}toJSON(){return h(this,ct)}},Vn=Gn;ct=new WeakMap,f();var lt,Fn=class{constructor(e){c(this,"id",""),b(this,lt,void 0),c(this,"name"),c(this,"type"),c(this,"weight"),c(this,"multiplier"),O(this,lt,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new Fn(e)))}static async fetch(e){let t=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(e){j(t,e)}));let n={fields:t,venue:e.options.venue};try{return(await F(e.options,"vortex",n)).map((e=>new Fn(e)))}catch(e){return console.error("Fetch Vortexes:",e),[]}}toJSON(){return h(this,lt)}},kn=Fn;lt=new WeakMap;var Ga,Va={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,do2D:!1,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(e){e.CATEGORY="categories",e.EVENT="events",e.LOCATION="locations",e.MAPGROUP="mapGroups",e.MAP="maps",e.NODE="nodes",e.POLYGON="polygons",e.VORTEX="vortexes"}(Ga||(Ga={}));var Ne,Te,Ae={categories:Nn,locations:xe,vortexes:kn,maps:Dn,nodes:En,polygons:we,venue:Vn,events:In,mapGroups:Rn,themes:vr,locationStates:Mr,locationRankings:mr,rankings:qn},ft=class{constructor(e){c(this,"perspective"),c(this,"things"),c(this,"options"),b(this,Ne,{}),b(this,Te,""),c(this,"updatedAt"),c(this,"categories",[]),c(this,"locations",[]),c(this,"vortexes",[]),c(this,"maps",[]),c(this,"nodes",[]),c(this,"polygons",[]),c(this,"venue",{}),c(this,"events",[]),c(this,"mapGroups",[]),c(this,"themes",[]),c(this,"locationStates",[]),c(this,"locationRankings",[]),c(this,"rankings"),c(this,"_categoriesById"),c(this,"_locationsById"),c(this,"_vortexesById"),c(this,"_mapsById"),c(this,"_nodesById"),c(this,"_polygonsById"),c(this,"_eventsById"),c(this,"_mapGroupsById"),c(this,"_locationStatesById"),c(this,"_locationRankingsById"),c(this,"_rankingsById"),c(this,"_categoriesByExternalId"),c(this,"_locationsByExternalId"),c(this,"_vortexesByExternalId"),c(this,"_mapsByExternalId"),c(this,"_nodesByExternalId"),c(this,"_polygonsByExternalId"),c(this,"_eventsByExternalId"),c(this,"_mapGroupsByExternalId"),c(this,"_locationStatesByExternalId"),c(this,"_locationRankingsByExternalId"),c(this,"_rankingsByExternalId"),c(this,"images"),c(this,"scenes"),c(this,"navigator"),this.options=e}generateGetters(e){try{for(let t=0,n=e.length;t<n;++t){let n=e[t];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let e=h(this,Ne)[n];if(void 0!==e)return e;let t={};return this[n].forEach((e=>t[e.externalId]=e)),h(this,Ne)[n]=t,t}}),Object.defineProperty(this,`_${n}ById`,{get(){let e=h(this,Ne)[n];if(void 0!==e)return e;let t={};return this[n].forEach((e=>t[e.id]=e)),h(this,Ne)[n]=t,t}}))}return this}catch(e){throw new Error("Unable to generate getters, "+e)}}getCollectionItemById(e,t){let n=`_${e}ByExternalId`,a=this[`_${e}ById`];return null!=a&&null!=a[t]||(a=this[n],null!=a&&null!=a[t])?a[t]:null}async hydrate(e){let t;if("string"==typeof e){try{O(this,Te,e),t=JSON.parse(e)}catch(e){return void console.error("Unable to parse JSON",e)}!0===this.options.useBundleAssets&&await Sa(t)}else t=e,O(this,Te,JSON.stringify(t));let n=Object.keys(t);for(let e=0,a=n.length;e<a;++e){let a=n[e],r=t[a];null!=Ae[a]&&"function"==typeof Ae[a].hydrate&&(this[a]=Ae[a].hydrate(r,this))}let{images:a,scenes:r}=t;this.images=a,this.scenes=r,this.generateGetters(n),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),La(this.options.clientId)||(this.options.things.rankings&&delete this.options.things.rankings,this.options.things.locationRankings&&delete this.options.things.locationRankings);let{things:e}=this.options,t=[],n=Object.keys(e);for(let e=0,a=n.length;e<a;++e){let a=n[e];Ae[a]&&t.push(Ae[a].fetch(this).then((e=>(this[a]=e,Promise.resolve()))))}return this.generateGetters(n),Promise.all(t).then((()=>{this.initNavigator(),O(this,Te,JSON.stringify(this.toJSON()))}))}initNavigator(){this.navigator=new gr({locations:this.locations.map((e=>e.toJSON())),nodes:this.nodes.map((e=>e.toJSON())),vortexes:this.vortexes.map((e=>e.toJSON())),maps:this.maps.map((e=>e.toJSON()))})}toJSON(){var e;let t={};for(let e in Ae)Array.isArray(this[e])&&(t[e]=this[e].map((e=>e.toJSON())));return ne(K({},t),{venue:this.venue.toJSON(),rankings:null==(e=this.rankings)?void 0:e.toJSON()})}toString(){return h(this,Te)}};Ne=new WeakMap,Te=new WeakMap,f();var ka={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"],locationRankings:[]};function Wa(e){let t=K(ne(K({},Va),{things:ka}),e);return t.noAuth||(t.accessToken?t.authorization=`Bearer ${t.accessToken}`:t.clientId&&t.clientSecret&&(t.authorization=`Basic ${globalThis.btoa(`${t.clientId}:${t.clientSecret}`)}`)),t}async function sl(e){let t=Wa(K({baseUrl:"https://api-gateway.mappedin.com/"},e)),n=new ft(ne(K({},t),{baseUrl:t.baseUrl+"public/1/"}));return await n.fetch(),n}Ua(),globalThis.btoa||(globalThis.btoa=Ha.encode);var ju={useBundleAssets:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function ul(e){let t=Wa(K(K({baseUrl:"https://api-gateway.mappedin.com/"},ju),e)),{version:n,venue:a}=e,r=`${e.bundleBaseUri||t.baseUrl+"exports/legacy/1/bundle"}?venue=${a}&version=1.0.0`,i=await yr(t,r),{url:o,updated_at:s}=i,l=await fetch(o,{mode:"cors"}),{data:u,format:h="jsonstring"}=await l.json();if("jsonstring"!==h)throw new Error(`Unrecognized format${h}`);let c=new ft(t);return await c.hydrate(u),c.updatedAt=s,c}export{ft as Mappedin,Nn as MappedinCategory,Pn as MappedinCoordinate,bn as MappedinDestinationSet,Ve as MappedinDirections,In as MappedinEvent,xe as MappedinLocation,Dn as MappedinMap,Rn as MappedinMapGroup,he as MappedinNavigatable,En as MappedinNode,we as MappedinPolygon,qn as MappedinRankings,Vn as MappedinVenue,kn as MappedinVortex,sl as getVenue,ul as getVenueBundle};
|
|
1
|
+
var Ka=Object.create,gt=Object.defineProperty,Xa=Object.defineProperties,Ja=Object.getOwnPropertyDescriptor,za=Object.getOwnPropertyDescriptors,Ya=Object.getOwnPropertyNames,br=Object.getOwnPropertySymbols,Za=Object.getPrototypeOf,_r=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Un=(t,e,n)=>e in t?gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,K=(t,e)=>{for(var n in e||(e={}))_r.call(e,n)&&Un(t,n,e[n]);if(br)for(var n of br(e))Qa.call(e,n)&&Un(t,n,e[n]);return t},re=(t,e)=>Xa(t,za(e)),ei=t=>gt(t,"__esModule",{value:!0}),ti=(t,e)=>()=>(t&&(e=t(t=0)),e),P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ni=(t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let a of Ya(e))!_r.call(t,a)&&"default"!==a&>(t,a,{get:()=>e[a],enumerable:!(n=Ja(e,a))||n.enumerable});return t},Nr=t=>ni(ei(gt(null!=t?Ka(Za(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),c=(t,e,n)=>(Un(t,"symbol"!=typeof e?e+"":e,n),n),Tr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},h=(t,e,n)=>(Tr(t,e,"read from private field"),n?n.call(t):e.get(t)),b=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},O=(t,e,n,a)=>(Tr(t,e,"write to private field"),a?a.call(t,n):e.set(t,n),n),f=ti((()=>{})),Ir=P(((t,e)=>{f(),function(n){var a="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==a&&e,i="object"==typeof global&&global;(i.global===i||i.window===i)&&(n=i);var o=function(t){this.message=t};(o.prototype=new Error).name="InvalidCharacterError";var s=function(t){throw new o(t)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,a,r,i=t.length%3,o="",u=-1,h=t.length-i;++u<h;)e=t.charCodeAt(u)<<16,n=t.charCodeAt(++u)<<8,a=t.charCodeAt(++u),o+=l.charAt((r=e+n+a)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==i?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),o+=l.charAt((r=e+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==i&&(r=t.charCodeAt(u),o+=l.charAt(r>>2)+l.charAt(r<<4&63)+"=="),o},decode:function(t){var e=(t=String(t).replace(u,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var n,a,r=0,i="",o=-1;++o<e;)a=l.indexOf(t.charAt(o)),n=r%4?64*n+a:a,r++%4&&(i+=String.fromCharCode(255&n>>(-2*r&6)));return i},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(a&&!a.nodeType)if(r)r.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(a[c]=h[c]);else n.base64=h}(t)})),W=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.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};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),Re=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t,e){return e.reduce((function(e,n){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,n)&&void 0!==n&&void 0===e?(e=n,n):e}),void 0)};t.default=e})),Ee=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)};t.default=e})),Be=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){return e.sexagesimalPattern.test(t.toString().trim())};t.default=n})),qe=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){var n=new RegExp(e.sexagesimalPattern).exec(t);if(null==n)throw new Error("Given value is not in sexagesimal format");var a=Number(n[2])/60||0,r=Number(n[4])/3600||0,i=parseFloat(n[1])+a+r;return["S","W"].includes(n[7])?-i:i};t.default=n})),Nt=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=W(),a=(e=Re())&&e.__esModule?e:{default:e};function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:n.longitudeKeys,latitude:n.latitudeKeys,altitude:n.altitudeKeys},r=(0,a.default)(t,e.longitude),o=(0,a.default)(t,e.latitude),s=(0,a.default)(t,e.altitude);return i({latitude:o,longitude:r},s?{altitude:s}:{})};t.default=s})),Xn=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Ee()),n=i(Be()),a=i(qe()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function t(i){return(0,e.default)(i)?!(parseFloat(i)>r.MAXLAT||i<r.MINLAT):!!(0,n.default)(i)&&t((0,a.default)(i))};t.default=o})),zn=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Ee()),n=i(Be()),a=i(qe()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function t(i){return(0,e.default)(i)?!(parseFloat(i)>r.MAXLON||i<r.MINLON):!!(0,n.default)(i)&&t((0,a.default)(i))};t.default=o})),Zn=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Nt()),n=r(Xn()),a=r(zn());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t){var r=(0,e.default)(t),i=r.latitude,o=r.longitude;if(Array.isArray(t)&&t.length>=2)return(0,a.default)(t[0])&&(0,n.default)(t[1]);if(void 0===i||void 0===o)return!1;var s=t[o],l=t[i];return!(void 0===l||void 0===s||!1===(0,n.default)(l)||!1===(0,a.default)(s))};t.default=i})),Pt=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(Ee()),n=o(Be()),a=o(qe()),r=o(Zn()),i=o(Nt());function o(t){return t&&t.__esModule?t:{default:t}}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h=function t(o){if((0,e.default)(o))return Number(o);if((0,n.default)(o))return(0,a.default)(o);if((0,r.default)(o)){var s=(0,i.default)(o);return Array.isArray(o)?o.map((function(e,n){return[0,1].includes(n)?t(e):e})):l(l(l({},o),s.latitude&&u({},s.latitude,t(o[s.latitude]))),s.longitude&&u({},s.longitude,t(o[s.longitude])))}return Array.isArray(o)?o.map((function(e){return(0,r.default)(e)?t(e):e})):o};t.default=h})),ee=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=r(Re()),a=r(Pt());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){var i=(0,n.default)(t,e.latitudeKeys);if(null!=i){var o=t[i];return!0===r?o:(0,a.default)(o)}};t.default=i})),te=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=r(Re()),a=r(Pt());function r(t){return t&&t.__esModule?t:{default:t}}var i=function(t,r){var i=(0,n.default)(t,e.longitudeKeys);if(null!=i){var o=t[i];return!0===r?o:(0,a.default)(o)}};t.default=i})),ie=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t*Math.PI/180};t.default=e})),Me=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return 180*t/Math.PI};t.default=e})),qr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(ee()),n=o(te()),a=o(ie()),r=o(Me()),i=W();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o,s){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,u=(0,e.default)(t),h=(0,n.default)(t),c=o/l,d=(0,a.default)(s),f=(0,a.default)(u),p=(0,a.default)(h),g=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(d)),y=p+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(g)),v=(0,r.default)(y);return(v<i.MINLON||v>i.MAXLON)&&(y=(y+3*Math.PI)%(2*Math.PI)-Math.PI,v=(0,r.default)(y)),{latitude:(0,r.default)(g),longitude:v}};t.default=s})),Sr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",a=e.areaConversion[n];if(a)return t*a;throw new Error("Invalid unit used for area conversion.")};t.default=n})),Cr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",a=e.distanceConversion[n];if(a)return t*a;throw new Error("Invalid unit used for distance conversion.")};t.default=n})),Vr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=W(),n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(n){case"kmh":return t*e.timeConversion.h*e.distanceConversion.km;case"mph":return t*e.timeConversion.h*e.distanceConversion.mi;default:return t}};t.default=n})),Fr=P((t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{!a&&null!=s.return&&s.return()}finally{if(r)throw i}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if("Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(t,e)}}(t,e)||function(){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 n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},r=function(t){var n=e(t.toString().split("."),2),r=n[0],i=n[1],o=Math.abs(Number(r)),s=a(60*Number("0."+(i||0))),l=Math.floor(s),u=a(60*(s%l||0));return o+"° "+Number(l.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(u.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'};t.default=r})),rr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return t>1?1:t<-1?-1:t};t.default=e})),fe=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(ee()),n=o(te()),a=o(ie()),r=o(rr()),i=W();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=void 0===s||isNaN(s)?1:s;var l=(0,e.default)(t),u=(0,n.default)(t),h=(0,e.default)(o),c=(0,n.default)(o),d=Math.acos((0,r.default)(Math.sin((0,a.default)(h))*Math.sin((0,a.default)(l))+Math.cos((0,a.default)(h))*Math.cos((0,a.default)(l))*Math.cos((0,a.default)(u)-(0,a.default)(c))))*i.earthRadius;return Math.round(d/s)*s};t.default=s})),ar=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=fe())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default;return a="function"==typeof a?a:n.default,e.slice().sort((function(e,n){return a(t,e)-a(t,n)}))};t.default=a})),Hr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ar())&&e.__esModule?e:{default:e};var a=function(t,e){return(0,n.default)(t,e)[0]};t.default=a})),Xr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(ie()),n=i(ee()),a=i(te()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t){var i=0;if(t.length>2){for(var o,s,l,u=0;u<t.length;u++){u===t.length-2?(o=t.length-2,s=t.length-1,l=0):u===t.length-1?(o=t.length-1,s=0,l=1):(o=u,s=u+1,l=u+2);var h=(0,a.default)(t[o]),c=(0,n.default)(t[s]),d=(0,a.default)(t[l]);i+=((0,e.default)(d)-(0,e.default)(h))*Math.sin((0,e.default)(c))}i=i*r.earthRadius*r.earthRadius/2}return Math.abs(i)};t.default=o})),sr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(ee()),n=a(te());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,a){var r=(0,e.default)(a),i=(0,n.default)(a);return{maxLat:Math.max(r,t.maxLat),minLat:Math.min(r,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})};t.default=r})),zr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=o(ee()),n=o(te()),a=o(ie()),r=o(Me()),i=W();function o(t){return t&&t.__esModule?t:{default:t}}var s=function(t,o){var s,l,u=(0,e.default)(t),h=(0,n.default)(t),c=(0,a.default)(u),d=(0,a.default)(h),f=o/i.earthRadius,p=c-f,g=c+f,y=(0,a.default)(i.MAXLAT),v=(0,a.default)(i.MINLAT),m=(0,a.default)(i.MAXLON),b=(0,a.default)(i.MINLON);if(p>v&&g<y){var M=Math.asin(Math.sin(f)/Math.cos(c));(s=d-M)<b&&(s+=2*Math.PI),(l=d+M)>m&&(l-=2*Math.PI)}else p=Math.max(p,v),g=Math.min(g,y),s=b,l=m;return[{latitude:(0,r.default)(p),longitude:(0,r.default)(s)},{latitude:(0,r.default)(g),longitude:(0,r.default)(l)}]};t.default=s})),Qr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(ee()),n=i(te()),a=i(ie()),r=i(Me());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var i=t.length,o=t.reduce((function(t,r){var i=(0,a.default)((0,e.default)(r)),o=(0,a.default)((0,n.default)(r));return{X:t.X+Math.cos(i)*Math.cos(o),Y:t.Y+Math.cos(i)*Math.sin(o),Z:t.Z+Math.sin(i)}}),{X:0,Y:0,Z:0}),s=o.X/i,l=o.Y/i,u=o.Z/i;return{longitude:(0,r.default)(Math.atan2(l,s)),latitude:(0,r.default)(Math.atan2(u,Math.sqrt(s*s+l*l)))}};t.default=o})),ea=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=sr())&&e.__esModule?e:{default:e};var a=function(t){var e=(0,n.default)(t),a=e.minLat+(e.maxLat-e.minLat)/2,r=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(a.toFixed(6)),longitude:parseFloat(r.toFixed(6))}};t.default=a})),ur=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(ee()),n=i(te()),a=i(ie()),r=i(Me());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){var o=(0,a.default)((0,n.default)(i))-(0,a.default)((0,n.default)(t)),s=Math.log(Math.tan((0,a.default)((0,e.default)(i))/2+Math.PI/4)/Math.tan((0,a.default)((0,e.default)(t))/2+Math.PI/4));return Math.abs(o)>Math.PI&&(o=o>0?-1*(2*Math.PI-o):2*Math.PI+o),((0,r.default)(Math.atan2(o,s))+360)%360};t.default=o})),aa=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=ur())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r="function"==typeof a?a(t,e):(0,n.default)(t,e);if(isNaN(r))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(r/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"}};t.default=a})),cr=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(fe()),n=a(rr());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t,a,r){var i=(0,e.default)(a,t),o=(0,e.default)(t,r),s=(0,e.default)(a,r),l=Math.acos((0,n.default)((i*i+s*s-o*o)/(2*i*s))),u=Math.acos((0,n.default)((o*o+s*s-i*i)/(2*o*s)));return l>Math.PI/2?i:u>Math.PI/2?o:Math.sin(l)*i};t.default=r})),da=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(ee()),n=i(te()),a=i(ie()),r=i(Me());function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){var o=(0,e.default)(i),s=(0,n.default)(i),l=(0,e.default)(t),u=(0,n.default)(t);return((0,r.default)(Math.atan2(Math.sin((0,a.default)(s)-(0,a.default)(u))*Math.cos((0,a.default)(o)),Math.cos((0,a.default)(l))*Math.sin((0,a.default)(o))-Math.sin((0,a.default)(l))*Math.cos((0,a.default)(o))*Math.cos((0,a.default)(s)-(0,a.default)(u))))+360)%360};t.default=o})),ca=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=fe())&&e.__esModule?e:{default:e};function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.default;return t.reduce((function(t,n){return"object"===a(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance};t.default=r})),ha=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(ee()),n=i(te()),a=i(ie()),r=W();function i(t){return t&&t.__esModule?t:{default:t}}var o=function(t,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=void 0===o||isNaN(o)?1:o;var s,l,u,h,c,d,f,p=(0,e.default)(t),g=(0,n.default)(t),y=(0,e.default)(i),v=(0,n.default)(i),m=6356752.314245,b=1/298.257223563,M=(0,a.default)(v-g),w=Math.atan((1-b)*Math.tan((0,a.default)(parseFloat(p)))),O=Math.atan((1-b)*Math.tan((0,a.default)(parseFloat(y)))),N=Math.sin(w),P=Math.cos(w),_=Math.sin(O),E=Math.cos(O),I=M,x=100;do{var T=Math.sin(I),j=Math.cos(I);if(0===(d=Math.sqrt(E*T*(E*T)+(P*_-N*E*j)*(P*_-N*E*j))))return 0;s=N*_+P*E*j,l=Math.atan2(d,s),c=s-2*N*_/(h=1-(u=P*E*T/d)*u),isNaN(c)&&(c=0);var A=b/16*h*(4+b*(4-3*h));f=I,I=M+(1-A)*b*u*(l+A*d*(c+A*s*(2*c*c-1)))}while(Math.abs(I-f)>1e-12&&--x>0);if(0===x)return NaN;var L=h*(r.earthRadius*r.earthRadius-m*m)/(m*m),S=1+L/16384*(4096+L*(L*(320-175*L)-768)),R=L/1024*(256+L*(L*(74-47*L)-128)),B=R*d*(c+R/4*(s*(2*c*c-1)-R/6*c*(4*d*d-3)*(4*c*c-3))),k=m*S*(l-B);return Math.round(k/o)*o};t.default=o})),ga=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0};t.default=e})),ya=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=fe())&&e.__esModule?e:{default:e};var a=function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.default,r=a(t,e),i=Number(e.time)-Number(t.time),o=r/i*1e3;return o};t.default=a})),ma=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=fe())&&e.__esModule?e:{default:e};var a=function(t,e,a){return(0,n.default)(e,t)+(0,n.default)(t,a)===(0,n.default)(e,a)};t.default=a})),va=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(ee()),n=a(te());function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t,a){for(var r=!1,i=a.length,o=-1,s=i-1;++o<i;s=o)((0,n.default)(a[o])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(a[s])||(0,n.default)(a[s])<=(0,n.default)(t)&&(0,n.default)(t)<(0,n.default)(a[o]))&&(0,e.default)(t)<((0,e.default)(a[s])-(0,e.default)(a[o]))*((0,n.default)(t)-(0,n.default)(a[o]))/((0,n.default)(a[s])-(0,n.default)(a[o]))+(0,e.default)(a[o])&&(r=!r);return r};t.default=r})),ba=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=cr())&&e.__esModule?e:{default:e};var a=function(t,e,a,r){return(0,n.default)(t,e,a)<r};t.default=a})),_a=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e,n=(e=fe())&&e.__esModule?e:{default:e};var a=function(t,e,a){return(0,n.default)(t,e)<a};t.default=a})),Ta=P((t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var n=[],a=!0,r=!1,i=void 0;try{for(var o,s=t[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);a=!0);}catch(t){r=!0,i=t}finally{try{!a&&null!=s.return&&s.return()}finally{if(r)throw i}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if("Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(t,e)}}(t,e)||function(){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 n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}f(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var n=e(t.split(" "),2),a=n[0],r=n[1];return{longitude:parseFloat(a),latitude:parseFloat(r)}}))};t.default=a})),Oa=P((t=>{f(),Object.defineProperty(t,"__esModule",{value:!0});var e={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(t,"computeDestinationPoint",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(t,"toRad",{enumerable:!0,get:function(){return U.default}}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:function(){return $.default}});var n=X(qr()),a=X(Sr()),r=X(Cr()),i=X(Vr()),o=X(Fr()),s=X(Hr()),l=X(Xr()),u=X(sr()),h=X(zr()),c=X(Qr()),d=X(ea()),p=X(aa()),g=X(Re()),y=X(Nt()),v=X(fe()),m=X(cr()),b=X(da()),M=X(ee()),w=X(te()),O=X(ca()),N=X(ha()),P=X(ur()),_=X(ga()),E=X(ya()),I=X(Ee()),x=X(ma()),T=X(va()),j=X(ba()),A=X(_a()),L=X(Be()),S=X(Zn()),R=X(Xn()),B=X(zn()),k=X(ar()),D=X(qe()),F=X(Pt()),U=X(ie()),C=X(Me()),$=X(Ta()),G=W();function X(t){return t&&t.__esModule?t:{default:t}}Object.keys(G).forEach((function(n){"default"===n||"__esModule"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(t,n,{enumerable:!0,get:function(){return G[n]}})}))})),ja=P(((t,e)=>{var n,a;f(),n=t,a=function(t){"use strict";var e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e,n="URLSearchParams"in e,a="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return a&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function f(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function g(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&r&&function(t){return t&&DataView.prototype.isPrototypeOf(t)}(t)?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var t=f(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,n=p(e);return e.readAsText(t),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),a=0;a<e.length;a++)n[a]=String.fromCharCode(e[a]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(M)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=h(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=h(e)},d.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),c(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),c(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),c(t)},a&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!n&&null!=t._bodyInit&&(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new d(e.headers)),this.method=function(t){var e=t.toUpperCase();return m.indexOf(e)>-1?e:t}(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function M(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),a=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(a),decodeURIComponent(r))}})),e}function w(t){var e=new d;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),a=n.shift().trim();if(a){var r=n.join(":").trim();e.append(a,r)}})),e}function O(t,e){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},O.error=function(){var t=new O(null,{status:0,statusText:""});return t.type="error",t};var N=[301,302,303,307,308];O.redirect=function(t,e){if(-1===N.indexOf(e))throw new RangeError("Invalid status code");return new O(null,{status:e,headers:{location:t}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function P(n,a){return new Promise((function(i,s){var l=new b(n,a);if(l.signal&&l.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function c(){u.abort()}u.onload=function(){var t={status:u.status,statusText:u.statusText,headers:w(u.getAllResponseHeaders()||"")};t.url="responseURL"in u?u.responseURL:t.headers.get("X-Request-URL");var e="response"in u?u.response:u.responseText;setTimeout((function(){i(new O(e,t))}),0)},u.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},u.open(l.method,function(t){try{return""===t&&e.location.href?e.location.href:t}catch(e){return t}}(l.url),!0),"include"===l.credentials?u.withCredentials=!0:"omit"===l.credentials&&(u.withCredentials=!1),"responseType"in u&&(r?u.responseType="blob":o&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!a||"object"!=typeof a.headers||a.headers instanceof d?l.headers.forEach((function(t,e){u.setRequestHeader(e,t)})):Object.getOwnPropertyNames(a.headers).forEach((function(t){u.setRequestHeader(t,h(a.headers[t]))})),l.signal&&(l.signal.addEventListener("abort",c),u.onreadystatechange=function(){4===u.readyState&&l.signal.removeEventListener("abort",c)}),u.send(void 0===l._bodyInit?null:l._bodyInit)}))}P.polyfill=!0,e.fetch||(e.fetch=P,e.Headers=d,e.Request=b,e.Response=O),t.Headers=d,t.Request=b,t.Response=O,t.fetch=P,Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof t&&void 0!==e?a(t):"function"==typeof define&&define.amd?define(["exports"],a):a(n.WHATWGFetch={})})),Ua=P(((t,e)=>{f(),ja(),e.exports=self.fetch.bind(self)}));f();var Ha=Nr(Ir());f(),f(),f();var Pa=Nr(Oa());f();var wa=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:a=0,distance:r=0,angle:i=0}){let o,s;if(c(this,"origin"),c(this,"destination"),c(this,"vortex"),c(this,"distance"),c(this,"angle"),c(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=r,this.angle=i,n?(this.distance=0,this.angle=0,o=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,s=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=a*s+o):(o=e.weight&&e.weight>=0?e.weight:0,s=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*s+o),isNaN(this.angle))throw new Error("nan angle")}},mn=wa;function qu(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${t.name||t.shortName||t.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let e=t.georeference[0],n=t.georeference[2],a=(0,Pa.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),r=e.control.x-n.control.x,i=e.control.y-n.control.y;return Math.sqrt(r*r+i*i)/a}catch(t){return console.error(t),1}}function Su(t,e){let n=t.x-e.x,a=t.y-e.y;return(Math.atan2(a,n)+2.5*Math.PI)%(2*Math.PI)}var U,Z,pe,xa=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:a=!1}){c(this,"edges"),c(this,"nodesById"),c(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>re(K({},t),{_scale:qu(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>re(K({},t),{paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=r.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let i=e.map((t=>re(K({},t),{name:a?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));r.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let n=this.nodesById[e];return new mn({angle:Su(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),i.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let n=this.nodesById[t.nodes[e]];if(e++,null==n)continue;let a=e;for(;a<t.nodes.length;){let e=this.nodesById[t.nodes[a]];if(a++,null==e)continue;let r=this.mapsById[n.map].elevation||0,i=this.mapsById[e.map].elevation||0,o=Math.abs(r-i);this.edges[n.id].push(new mn({destination:e,elevationDelta:o,origin:n,vortex:t})),this.edges[e.id].push(new mn({destination:n,elevationDelta:o,origin:e,vortex:t}))}}}))}aStar(t,e,n){let a=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===a.length||0===r.length)return[];let i=[],o={},s={};for(a.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);i.push({origin:t,priority:e}),o[t.id]=null,s[t.id]=0})),i.sort(((t,e)=>t.priority-e.priority));i.length>0;){let t=i[0];if(r.includes(t.origin)){let e=[],n=o[t.origin.id];for(;null!=n;){e.push(n);let t=o[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let a=e.vortex&&!1===e.vortex.accessible;if(n&&(a||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=s[t.origin.id]+e.weight;if(null==s[e.destination.id]||l<s[e.destination.id]){s[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,r);i.push({origin:e.destination,priority:t}),o[e.destination.id]=e}}i.splice(0,1),i.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,a=t.x-e.x,r=t.y-e.y,i=a*a+r*r;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(i)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let a=this.getDistance(t,n);return Math.min(e,a)}),Number.MAX_VALUE)}},hr=xa;function Cu(t){switch(t){case pe.DOWN:case pe.UP:return`${t} `;default:return""}}f(),f(),function(t){t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival"}(U||(U={})),function(t){t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft"}(Z||(Z={})),function(t){t.UP="up",t.DOWN="down",t.NONE="none"}(pe||(pe={}));var Mn,Da=class{constructor({origin:t,action:e,distance:n,atLocation:a,instruction:r}){c(this,"node"),c(this,"instruction"),c(this,"action"),c(this,"atLocation"),c(this,"type"),c(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=a,this.instruction="",r?this.instruction=r:(null!=e&&e.type===U.DEPARTURE?this.instruction=null!=a?`Depart from ${a.name}`:"Depart from current location":null!=e&&e.type===U.ARRIVAL?this.instruction=null!=a?`Arrive at ${a.name}`:"Arrive at destination":null!=e&&e.type===U.TAKEVORTEX?this.instruction=`Take ${a&&a.name} ${Cu(e.direction)}to ${e.toMap.name}`:null!=e&&e.type===U.EXITVORTEX?this.instruction=`Exit ${a&&a.name} at ${e.toMap.name}`:null!=e&&e.bearing===Z.RIGHT?this.instruction="Turn right":null!=e&&e.bearing===Z.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=e&&e.bearing===Z.STRAIGHT?this.instruction="Head straight":null!=e&&e.bearing===Z.SLIGHTLEFT?this.instruction="Turn slightly left":null!=e&&e.bearing===Z.LEFT&&(this.instruction="Turn left"),null!=e&&e.type===U.TURN&&a&&(this.instruction+=` at ${a.name}`))}},he=Da;(Mn||(Mn={})).NO_VALID_PATH="No Valid Path Available";var vn=.1*Math.PI;function bn(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var Aa=class{constructor({locations:t,nodes:e,vortexes:n,maps:a,showVortexNames:r}){c(this,"graph"),c(this,"locationsByNodeId"),this.graph=new hr({maps:a,nodes:e,showVortexNames:r,vortexes:n}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((n=>{t[n.node]=e})),e.polygons&&e.polygons.forEach((n=>{n.entrances&&n.entrances.forEach((n=>{t[n]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,n=10){let a=0,r=0,i=t;for(;Math.abs(a)<e&&r<n;){let t=this.graph.edges[i.destination.id],o=null,s=0;for(let e of t)if(e.distance>0)if(null!=o){let t=-bn(i.angle,e.angle);Math.abs(t)<Math.abs(s)&&(o=e,s=t)}else o=e,s=-bn(i.angle,e.angle);if(null==o)return null;{if(Math.abs(s)>=e||(a+=s,r+=o.distance,Math.abs(a)>=e||r>n))return null;let t=this.locationsByNodeId[o.destination.id];if(null!=t)return t;i=o}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:a,arriveAt:r}){let i=this.graph.aStar(t,e,n);if(0===i.length)return{distance:0,instructions:[new he({distance:0,instruction:Mn.NO_VALID_PATH})],path:[]};let o=0,s=new Array(i.length+1);for(let t=0;t<i.length;t++)s[t]=i[t].origin;s[i.length]=i[i.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let t=0;t<i.length;t++){let e=i[t],n=e.origin,s=e.destination;if(o+=e.distance,c+=(null==h?void 0:h.distance)||0,0===t&&l.push(new he({action:{type:U.DEPARTURE},atLocation:a,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],a=this.graph.mapsById[s.map],r=pe.NONE;if(null!=t.elevation&&null!=a.elevation){let e=t.elevation-a.elevation;e>0?r=pe.DOWN:e<0&&(r=pe.UP)}l.push(new he({action:{direction:r,fromMap:t,toMap:a,type:U.TAKEVORTEX},atLocation:e.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let t=this.graph.mapsById[u.map],e=this.graph.mapsById[h.destination.map];l.push(new he({action:{fromMap:t,toMap:e,type:U.EXITVORTEX},atLocation:h.vortex,distance:c,origin:n})),d+=c,c=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==u&&t.destination!==e.destination));if(t.length>0){let a=-bn(h.angle,e.angle),r=t.reduce(((t,n)=>{let a=-bn(e.angle,n.angle);return Math.min(t,Math.abs(a))}),Math.PI);if(Math.abs(a)>=vn||Math.abs(r)<=vn){let t;t=a<=-Math.PI/4?Z.RIGHT:a<=-vn?Z.SLIGHTRIGHT:a<=vn?Z.STRAIGHT:a<=Math.PI/4?Z.SLIGHTLEFT:Z.LEFT;let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=e){let a=new he({action:{bearing:t,referencePosition:"At",type:U.TURN},atLocation:e,distance:c,origin:n});a.type=t,l.push(a)}else l.push(new he({action:{bearing:t,referencePosition:"At",type:U.TURN},distance:c,origin:n}));d+=c,c=0}}}t===i.length-1&&(l.push(new he({action:{type:U.ARRIVAL},atLocation:r,distance:o-d<0?0:o-d,origin:e.destination})),d+=c,c=0),u=n,h=e}let f=[],p=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&n.type===U.TAKEVORTEX?(p=e.node,f.unshift(e)):n&&n.type===U.TURN&&null!=p?this.graph.getDistance(e.node,p)>5&&f.unshift(e):f.unshift(e)}return{distance:o,instructions:f,path:s}}},gr=Aa;f(),f(),f(),f();var La=" ",X=class{static get separator(){return La}static set separator(t){La=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let n=null;switch(e.length){case 3:n=e[0]/1+e[1]/60+e[2]/3600;break;case 2:n=e[0]/1+e[1]/60;break;case 1:n=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(n=-n),Number(n)}static toDms(t,e="d",n){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="d",n=4}t=Math.abs(t);let a=null,r=null,i=null,o=null;switch(e){default:case"d":case"deg":r=t.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),a=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),i=(60*t%60).toFixed(n),60==i&&(i=(0).toFixed(n),r++),r=("000"+r).slice(-3),i<10&&(i="0"+i),a=r+"°"+X.separator+i+"′";break;case"dms":case"deg+min+sec":r=Math.floor(t),i=Math.floor(3600*t/60)%60,o=(3600*t%60).toFixed(n),60==o&&(o=(0).toFixed(n),i++),60==i&&(i=0,r++),r=("000"+r).slice(-3),i=("00"+i).slice(-2),o<10&&(o="0"+o),a=r+"°"+X.separator+i+"′"+X.separator+o+"″"}return a}static toLat(t,e,n){let a=X.toDms(X.wrap90(t),e,n);return null===a?"–":a.slice(1)+X.separator+(t<0?"S":"N")}static toLon(t,e,n){let a=X.toDms(X.wrap180(t),e,n);return null===a?"–":a+X.separator+(t<0?"W":"E")}static toBrng(t,e,n){let a=X.toDms(X.wrap360(t),e,n);return null===a?"–":a.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(n.thousands,"⁜").replace(n.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),n={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",n.decimal).replace("⁜",n.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=X.wrap360(t);let n=4*2**(e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var L=X,k=Math.PI,N=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=L.wrap90(Number(t)),this._lon=L.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?L.wrap90(L.parse(t)):L.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?L.wrap90(L.parse(t)):L.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?L.wrap180(L.parse(t)):L.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?L.wrap180(L.parse(t)):L.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?L.wrap180(L.parse(t)):L.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,n;if(2==t.length&&([e,n]=t,e=L.wrap90(L.parse(e)),n=L.wrap180(L.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,n]=t[0].split(","),e=L.wrap90(L.parse(e)),n=L.wrap180(L.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let a=t[0];if("Point"==a.type&&Array.isArray(a.coordinates)?[n,e]=a.coordinates:(null!=a.latitude&&(e=a.latitude),null!=a.lat&&(e=a.lat),null!=a.longitude&&(n=a.longitude),null!=a.lng&&(n=a.lng),null!=a.lon&&(n=a.lon),e=L.wrap90(L.parse(e)),n=L.wrap180(L.parse(n))),isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(n))throw new TypeError(`invalid point ‘${t.toString()}’`);return new N(e,n)}distanceTo(t,e=6371e3){if(t instanceof N||(t=N.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,a=this.lat.toRadians(),r=this.lon.toRadians(),i=t.lat.toRadians(),o=i-a,s=t.lon.toRadians()-r,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(a)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof N||(t=N.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),a=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(a),i=Math.sin(a)*Math.cos(n),o=Math.atan2(i,r).toDegrees();return L.wrap360(o)}finalBearingTo(t){t instanceof N||(t=N.parse(t));let e=t.initialBearingTo(this)+180;return L.wrap360(e)}midpointTo(t){t instanceof N||(t=N.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),a=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),i=Math.cos(e),o=0,s=Math.sin(e),l={x:i+Math.cos(a)*Math.cos(r),y:o+Math.cos(a)*Math.sin(r),z:s+Math.sin(a)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=n+Math.atan2(l.y,l.x),c=u.toDegrees(),d=h.toDegrees();return new N(c,d)}intermediatePointTo(t,e){if(t instanceof N||(t=N.parse(t)),this.equals(t))return new N(this.lat,this.lon);let n=this.lat.toRadians(),a=this.lon.toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians(),o=r-n,s=i-a,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(n)*Math.cos(r)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-e)*u)/Math.sin(u),c=Math.sin(e*u)/Math.sin(u),d=h*Math.cos(n)*Math.cos(a)+c*Math.cos(r)*Math.cos(i),f=h*Math.cos(n)*Math.sin(a)+c*Math.cos(r)*Math.sin(i),p=h*Math.sin(n)+c*Math.sin(r),g=Math.atan2(p,Math.sqrt(d*d+f*f)),y=Math.atan2(f,d),v=g.toDegrees(),m=y.toDegrees();return new N(v,m)}destinationPoint(t,e,n=6371e3){let a=t/n,r=Number(e).toRadians(),i=this.lat.toRadians(),o=this.lon.toRadians(),s=Math.sin(i)*Math.cos(a)+Math.cos(i)*Math.sin(a)*Math.cos(r),l=Math.asin(s),u=Math.sin(r)*Math.sin(a)*Math.cos(i),h=Math.cos(a)-Math.sin(i)*s,c=o+Math.atan2(u,h),d=l.toDegrees(),f=c.toDegrees();return new N(d,f)}static intersection(t,e,n,a){if(t instanceof N||(t=N.parse(t)),n instanceof N||(n=N.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(a))throw new TypeError(`invalid brng2 ‘${a}’`);let r=t.lat.toRadians(),i=t.lon.toRadians(),o=n.lat.toRadians(),s=n.lon.toRadians(),l=Number(e).toRadians(),u=Number(a).toRadians(),h=o-r,c=s-i,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(r)*Math.cos(o)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new N(t.lat,t.lon);let f=(Math.sin(o)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),p=(Math.sin(r)-Math.sin(o)*Math.cos(d))/(Math.sin(d)*Math.cos(o)),g=Math.acos(Math.min(Math.max(f,-1),1)),y=Math.acos(Math.min(Math.max(p,-1),1)),v=l-(Math.sin(s-i)>0?g:2*k-g),m=(Math.sin(s-i)>0?2*k-y:y)-u;if(0==Math.sin(v)&&0==Math.sin(m)||Math.sin(v)*Math.sin(m)<0)return null;let b=-Math.cos(v)*Math.cos(m)+Math.sin(v)*Math.sin(m)*Math.cos(d),M=Math.atan2(Math.sin(d)*Math.sin(v)*Math.sin(m),Math.cos(m)+Math.cos(v)*b),w=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(M)+Math.cos(r)*Math.sin(M)*Math.cos(l),-1),1)),O=i+Math.atan2(Math.sin(l)*Math.sin(M)*Math.cos(r),Math.cos(M)-Math.sin(r)*Math.sin(w)),P=w.toDegrees(),_=O.toDegrees();return new N(P,_)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof N||(t=N.parse(t)),e instanceof N||(e=N.parse(e));let a=n;if(this.equals(t))return 0;let r=t.distanceTo(this,a)/a,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(i-o))*a}alongTrackDistanceTo(t,e,n=6371e3){t instanceof N||(t=N.parse(t)),e instanceof N||(e=N.parse(e));let a=n;if(this.equals(t))return 0;let r=t.distanceTo(this,a)/a,i=t.initialBearingTo(this).toRadians(),o=t.initialBearingTo(e).toRadians(),s=Math.asin(Math.sin(r)*Math.sin(i-o));return Math.acos(Math.cos(r)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-i))*a}maxLatitude(t){let e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()}static crossingParallels(t,e,n){if(t.equals(e))return null;let a=Number(n).toRadians(),r=t.lat.toRadians(),i=t.lon.toRadians(),o=e.lat.toRadians(),s=e.lon.toRadians()-i,l=Math.sin(r)*Math.cos(o)*Math.cos(a)*Math.sin(s),u=Math.sin(r)*Math.cos(o)*Math.cos(a)*Math.cos(s)-Math.cos(r)*Math.sin(o)*Math.cos(a),h=Math.cos(r)*Math.cos(o)*Math.sin(a)*Math.sin(s);if(h*h>l*l+u*u)return null;let c=Math.atan2(-u,l),d=Math.acos(h/Math.sqrt(l*l+u*u)),f=i+c+d,p=(i+c-d).toDegrees(),g=f.toDegrees();return{lon1:L.wrap180(p),lon2:L.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof N||(t=N.parse(t));let n=e,a=this.lat.toRadians(),r=t.lat.toRadians(),i=r-a,o=Math.abs(t.lon-this.lon).toRadians();Math.abs(o)>k&&(o=o>0?-(2*k-o):2*k+o);let s=Math.log(Math.tan(r/2+k/4)/Math.tan(a/2+k/4)),l=Math.abs(s)>1e-11?i/s:Math.cos(a);return Math.sqrt(i*i+l*l*o*o)*n}rhumbBearingTo(t){if(t instanceof N||(t=N.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),a=(t.lon-this.lon).toRadians();Math.abs(a)>k&&(a=a>0?-(2*k-a):2*k+a);let r=Math.log(Math.tan(n/2+k/4)/Math.tan(e/2+k/4)),i=Math.atan2(a,r).toDegrees();return L.wrap360(i)}rhumbDestinationPoint(t,e,n=6371e3){let a=this.lat.toRadians(),r=this.lon.toRadians(),i=Number(e).toRadians(),o=t/n,s=o*Math.cos(i),l=a+s;Math.abs(l)>k/2&&(l=l>0?k-l:-k-l);let u=Math.log(Math.tan(l/2+k/4)/Math.tan(a/2+k/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(a),c=r+o*Math.sin(i)/h,d=l.toDegrees(),f=c.toDegrees();return new N(d,f)}rhumbMidpointTo(t){t instanceof N||(t=N.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),a=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-n)>k&&(n+=2*k);let i=(e+a)/2,o=Math.tan(k/4+e/2),s=Math.tan(k/4+a/2),l=Math.tan(k/4+i/2),u=((r-n)*Math.log(l)+n*Math.log(s)-r*Math.log(o))/Math.log(s/o);isFinite(u)||(u=(n+r)/2);let h=i.toDegrees(),c=u.toDegrees();return new N(h,c)}static areaOf(t,e=6371e3){let n=e,a=t[0].equals(t[t.length-1]);a||t.push(t[0]);let r=t.length-1,i=0;for(let e=0;e<r;e++){let n=t[e].lat.toRadians(),a=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();i+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(a/2)),1+Math.tan(n/2)*Math.tan(a/2))}(function(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let a=0;a<t.length-1;a++){let r=t[a].initialBearingTo(t[a+1]),i=t[a].finalBearingTo(t[a+1]);e+=(r-n+540)%360-180,e+=(i-r+540)%360-180,n=i}return e+=(t[0].initialBearingTo(t[1])-n+540)%360-180,Math.abs(e)<90})(t)&&(i=Math.abs(i)-2*k);let o=Math.abs(i*n*n);return a||t.pop(),o}equals(t){return t instanceof N||(t=N.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${L.toLat(this.lat,t,e)}, ${L.toLon(this.lon,t,e)}`}};f(),f(),f();var _n=class{constructor(t){c(this,"destinations",[]),this.destinations=t}};f();var Ge,de,Ve=class{constructor(t,e){b(this,Ge,void 0),b(this,de,void 0),c(this,"distance",0),c(this,"path",[]),c(this,"instructions",[]),O(this,de,t),O(this,Ge,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,a,r,i,o,s,l,u,c,d,f;let p=re(K({},t),{action:K({},t.action),atLocation:(null==(e=t.atLocation)?void 0:e.id)?null==(a=null==(n=h(this,de))?void 0:n._vortexesById)?void 0:a[t.atLocation.id]:void 0,node:(null==(r=t.node)?void 0:r.id)?null==(o=null==(i=h(this,de))?void 0:i._nodesById)?void 0:o[t.node.id]:void 0});return((null==(s=p.action)?void 0:s.type)===U.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===U.EXITVORTEX)&&(p.action.fromMap=null==(c=h(this,de)._mapsById)?void 0:c[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(f=h(this,de)._mapsById)?void 0:f[null==(d=p.action)?void 0:d.toMap.id]),p})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=h(this,de))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return h(this,Ge)}};Ge=new WeakMap,de=new WeakMap;var ye,ge=class{constructor(t){b(this,ye,void 0),O(this,ye,t)}directionsTo(t,e){if(t instanceof _n){let n=[],a=this;for(let r=0;r<t.destinations.length;r++){let i=t.destinations[r],o=ke(a),s=ke(i),l=h(this,ye).navigator.getDirections({originIds:o,destinationNodeIds:s,accessible:(null==e?void 0:e.accessible)||!1}),u=new Ve(h(this,ye),l);n.push(u),a=i}return n}{let n=ke(this),a=ke(t),r=h(this,ye).navigator.getDirections({originIds:n,destinationNodeIds:a,accessible:(null==e?void 0:e.accessible)||!1});return new Ve(h(this,ye),r)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}directionsToCallback(t,e){return this.directionsTo(t,e)}};ye=new WeakMap;var Vu=0,Gu="9999-12-31T00:00:00.000Z";function ku(t,e,n=new Date){if(!t.states)return;let a=n||new Date,r=t.states.find((t=>{let e=new Date(t.start||Vu),n=new Date(t.end||Gu);return e<a&&n>a}));return r?e.find((t=>t.value===r.type)):void 0}var oe,ve,Q,Fe,je,$e,Ue=class extends ge{constructor(t,e){super(t),b(this,oe,void 0),b(this,ve,void 0),b(this,Q,{}),c(this,"states"),c(this,"id",""),c(this,"name",""),c(this,"type",""),c(this,"description"),c(this,"sortOrder"),c(this,"logo"),c(this,"phone"),c(this,"social"),c(this,"color"),c(this,"shortName"),c(this,"detailsUrl"),c(this,"tags"),c(this,"externalId"),c(this,"showLabelWhenImagePresent"),c(this,"picture"),c(this,"operationHours"),c(this,"siblingGroups"),c(this,"gallery"),c(this,"categories",[]),b(this,Fe,void 0),b(this,je,[]),b(this,$e,void 0),O(this,oe,t),O(this,ve,e),Object.assign(this,e)}get polygons(){let t=h(this,Q).polygons;if(void 0!==t)return t;let e=[],n=h(this,Fe),a=h(this,oe)._polygonsById;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=a[n[t].id];null!=r&&r.geometry.visible&&e.push(r)}return h(this,Q).polygons=e,e}set polygons(t){O(this,Fe,t)}get rank(){let t=h(this,Q).rank;if(void 0!==t)return t;let e=h(this,oe).locationRankings;if(!e||!e.locations)return null;let n=e.locations.find((t=>t.ids.find((t=>t===this.id))));return n?(h(this,Q).rank=n.score,n.score):null}get nodes(){let t=h(this,Q).nodes;if(void 0!==t)return t;let e=[],n=h(this,je),a=h(this,oe)._nodesById;if(n)for(let t=0,r=n.length;t<r;++t){let r=a[n[t].node];null!=r&&e.push(r)}return h(this,Q).nodes=e,e}set nodes(t){O(this,je,t)}get parent(){let t=h(this,Q).parent;if(void 0!==t)return t;let e,n=h(this,oe)._locationsById,a=h(this,$e);return void 0!==a&&(e=n[a]),h(this,Q).parent=e,e}set parent(t){O(this,$e,t)}get state(){return ku(this,h(this,oe).locationStates)}clone(){return new Ue(h(this,oe),h(this,ve))}get nodeOperationHours(){let t=h(this,Q).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=h(this,ve).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return h(this,Q).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Ue(e,t)))}static async fetch(t){let e=t.options.things.locations.slice();t.options.things.categories&&j(e,"categories"),t.options.things.nodes&&j(e,"nodes"),t.options.things.polygons&&j(e,"polygons"),t.options.things.locationStates&&j(e,"states");let n={fields:e,venue:t.options.venue};try{let e=await F(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Ue(t,e)))}catch(t){return console.error("Fetch Locations:",t),[]}}toJSON(){return h(this,ve)}},we=Ue;oe=new WeakMap,ve=new WeakMap,Q=new WeakMap,Fe=new WeakMap,je=new WeakMap,$e=new WeakMap,f();var be,He,se,We,Nn=class extends ge{constructor(t,e){super(t),b(this,be,void 0),b(this,He,void 0),b(this,se,{}),c(this,"geometry"),c(this,"id",""),c(this,"map",""),c(this,"layer"),c(this,"layerId"),c(this,"name"),c(this,"externalId"),c(this,"vertexes"),c(this,"canvasBounds"),b(this,We,void 0),O(this,be,t),O(this,He,e),Object.assign(this,e)}get locations(){let t=h(this,se).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,be),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.polygons;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t].id===a){e.push(r);break}}return h(this,se).locations=e,e}get entrances(){let t=h(this,se).entrances;if(void 0!==t)return t;let e=[],n=h(this,We),a=h(this,be)._nodesById;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;++t){let r=a[n[t].id];null!=r&&e.push(r)}return h(this,se).entrances=e,e}return[]}set entrances(t){O(this,We,t)}get rank(){let t=h(this,se).rank;if(void 0!==t)return t;let{rankings:e}=h(this,be);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(h(this,se).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(h(this,se).rank=null,null)}static hydrate(t,e){return t.map((t=>new Nn(e,t)))}static async fetch(t){let e=t.options.things.polygons.slice();t.options.things.maps&&j(e,"map"),t.options.things.nodes&&j(e,"entrances");let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await F(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new Nn(t,e)))}catch(t){return console.error("Fetch Polygons:",t),[]}}toJSON(){return h(this,He)}},Pe=Nn;function Ra(t){return/^[\da-f]{24}$/i.test(t)}function Ea(t,e=!1){let n="";if(null!=t){let a="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,i=r.length;e<i;++e){let i=r[e],o=t[i];null!=o&&(n+=`${a+encodeURIComponent(i)}=${encodeURIComponent(o)}`,a="&")}}return n}function Fu(t,e,n,a=!1){var r,i;return a?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:(null==(r=t.baseUrl)?void 0:r.includes("gateway"))?`${t.baseUrl}${e}/${n.venue||n.slug}${Ea(n,null==(i=t.baseUrl)?void 0:i.includes("gateway"))}`:t.baseUrl+e+Ea(n)}async function F(t,e,n,a=!1){return Ke(t,e,n,a,!0)}async function Ke(t,e,n,a=!1,r=!1){let i=Fu(t,e,n,a),o=await yr(t,i,a);if(!r&&Array.isArray(o)){if(1===o.length)return o[0];throw new Error("Invalid response object")}return o}async function yr(t,e,n=!1){let a={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete a.language,a.language&&(e+=`&lang=${encodeURIComponent(a.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),a.language&&(r["Accept-Language"]=a.language);let i=await fetch(e,{method:"GET",headers:r});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return i.json()}function j(t,e){t.indexOf(e)<0&&t.push(e)}function Ba([t,e],[n,a]){let r=new N(t,e),i=new N(n,a);return r.distanceTo(i)}function qa(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],a=t.georeference[2],r=new N(n.target.x,n.target.y),i=new N(a.target.x,a.target.y),o=r.distanceTo(i),s=n.control.x-a.control.x,l=n.control.y-a.control.y;e=Math.sqrt(s*s+l*l)/o}catch(n){e=1,console.warn(n),console.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function ke(t){var e;return t instanceof Pe?t.entrances.map((t=>t.id)):t instanceof we?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}async function Sa(t){let e={},{maps:n,images:a,scenes:r,polygons:i}=t;if(null!=a)try{let t=Object.keys(a).map((t=>fetch(`data:image/png;base64,${a[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{console.error(t)}))));await Promise.all(t)}catch(t){console.error(t)}return n.forEach((t=>{var n;!(null==(n=t.scene)?void 0:n.polygons)&&!r[t.id]||(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=a&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,a;if((null==(n=null==t?void 0:t.image)?void 0:n.url)&&(null==(a=null==t?void 0:t.image)?void 0:a.url)){let n=t.image.url.split("/"),a=e[n[n.length-1]];a&&(t.image.url=a)}}))))})),null!=a&&i.forEach((t=>{var n;if(null==(n=null==t?void 0:t.image)?void 0:n.url){let n=t.image.url.split("/"),a=e[n[n.length-1]];a&&(t.image.url=a)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}function Ca(t,e){let n,a,r,i=e.x,o=e.y,s=Number.MAX_SAFE_INTEGER;return t.forEach((t=>{a=t.x,r=t.y;let e=(i-a)**2+(o-r)**2;e<s&&(s=e,n=t)})),n}be=new WeakMap,He=new WeakMap,se=new WeakMap,We=new WeakMap;var Xe,Je,ze,In=class{constructor(t,e){b(this,Xe,void 0),b(this,Je,{}),b(this,ze,void 0),c(this,"name"),c(this,"externalId"),c(this,"parents"),c(this,"id"),c(this,"icon"),this.id=e.id,O(this,ze,e),O(this,Xe,t),Object.assign(this,e)}get locations(){let t=h(this,Je).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,Xe),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.categories;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t]===a){e.push(r);break}}return h(this,Je).locations=e,e}static hydrate(t,e){return t.map((t=>new In(e,t)))}static async fetch(t){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(await F(t.options,"category",e)).map((e=>new In(t,e)))}catch(t){return console.error("Fetch Categories:",t),[]}}toJSON(){return h(this,ze)}},Tn=In;Xe=new WeakMap,Je=new WeakMap,ze=new WeakMap,f();var Ye,xe,Ze,wn=class{constructor(t,e){b(this,Ye,void 0),b(this,xe,void 0),b(this,Ze,{}),c(this,"id",""),c(this,"type",""),c(this,"name",""),c(this,"description"),c(this,"image"),c(this,"startDate"),c(this,"endDate"),c(this,"showDate"),O(this,xe,e),O(this,Ye,t),Object.assign(this,e)}location(){let t=h(this,Ze).location;if(void 0!==t)return t;let e,n=h(this,Ye)._locationsById,a=h(this,xe).location;if(null!=a){let t=n[a];null!=t&&(e=t)}return h(this,Ze).location=e,e}static hydrate(t,e){return t.map((t=>new wn(e,t)))}static async fetch(t){let e=t.options.things.events.slice();t.options.things.locations&&j(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(await F(t.options,"event",n)).map((e=>new wn(t,e)))}catch(t){return console.error("Fetch Events:",t),[]}}toJSON(){return h(this,xe)}},On=wn;Ye=new WeakMap,xe=new WeakMap,Ze=new WeakMap,f();var Qe,Pn=class{constructor(t){b(this,Qe,void 0),c(this,"locations",[]),O(this,Qe,t),Object.assign(this,t)}static hydrate(t){return new Pn(t)}static async fetch(t){try{let e=await Ke(t.options,"smart-labels/location-label-ranking",{venue:t.options.venue},!0);return new Pn(e)}catch(t){return console.error("Fetch Location Rankings:",t),{}}}toJSON(){return h(this,Qe)}},mr=Pn;Qe=new WeakMap,f();var et,xn=class{constructor(t){b(this,et,void 0),c(this,"id",""),c(this,"name",""),c(this,"value",""),O(this,et,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new xn(t)))}static async fetch(t){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(await F(t.options,"location-state",e)).map((t=>new xn(t)))}catch(t){return console.error("Fetch Location States:",t),[]}}toJSON(){return h(this,et)}},Mr=xn;et=new WeakMap,f(),f();var nt,rt,tt=class{constructor(t,e,n,a,r,i){c(this,"map"),c(this,"x",0),c(this,"y",0),c(this,"lat",0),c(this,"lon",0),b(this,nt,{}),b(this,rt,void 0),this.lat=t,this.lon=e,this.map="string"==typeof r?r:r.id,this.x=n,this.y=a,O(this,rt,i)}absoluteDistanceTo(t){return Ba([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=h(this,nt).nearestNode;if(void 0!==t)return t;let e=Ca(h(this,rt).nodes.filter((t=>t.map===this.map)),this);return h(this,nt).nearestNode=e,e}};nt=new WeakMap,rt=new WeakMap;var me,_e,at,An=class{constructor(t,e){b(this,me,void 0),b(this,_e,{}),b(this,at,void 0),c(this,"id",""),c(this,"group",""),c(this,"name",""),c(this,"shortName",""),c(this,"elevation",0),c(this,"scale",0),c(this,"x_scale"),c(this,"perspectiveId"),c(this,"width",0),c(this,"height",0),c(this,"georeference",[]),c(this,"_scale",0),O(this,me,t),O(this,at,e),Object.assign(this,e),this._scale=qa(this),this.scale=this.x_scale}get polygons(){let t=h(this,_e).polygons;if(void 0!==t)return t;let e=[],{polygons:n}=h(this,me),{id:a}=this;for(let t=0,r=n.length;t<r;++t){let r=n[t];r.map===a&&e.push(r)}return h(this,_e).polygons=e,e}get mapGroup(){let t=h(this,_e).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&h(this,me)._mapGroupsById[e]||null;return h(this,_e).mapGroup=n,n}createCoordinateByXY(t,e){let n=this.georeference[0],a=new N(n.target.x,n.target.y),r=t-n.control.x,i=n.control.y-e,o=Math.atan2(r,i),s=r/Math.sin(o),l=o-this.getNorth(),u=s/this._scale,c=a.destinationPoint(u,180*l/Math.PI);return new tt(c.lat,c.lon,t,e,this.id,h(this,me))}createCoordinate(t,e){let n=this.georeference[0],a=new N(n.target.x,n.target.y),r=new N(t,e),i=a.distanceTo(r),o=(a.finalBearingTo(r)+360)%360*Math.PI/180,s=i*(1/this.scale),l=o+this.getNorth(),u=Math.sin(l)*s,c=Math.cos(l)*s;return new tt(t,e,n.control.x+u,n.control.y-c,this.id,h(this,me))}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],a=new N(e.target.x,e.target.y),r=new N(n.target.x,n.target.y);t=-((a.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(n.control.y-e.control.y,n.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,console.warn(e),console.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new An(e,t)))}static async fetch(t){let e=t.options.things.maps.slice();t.options.perspective&&j(e,"perspectives"),t.options.things.mapGroups&&j(e,"group"),j(e,"elevation"),j(e,"x_scale"),j(e,"scale"),j(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=await F(t.options,"map",n),i=t=>{let e=a.layers.find((e=>e.id===t));e?e.visible=!0:a.layers.push({id:t,visible:!0})};for(let n=0,o=r.length;n<o;++n){var a=r[n];if(a){let n=a.perspective;null!=n&&(a.perspectiveId=n.id,t.options.do2D?(e.indexOf("width")>-1&&(a.width=n.size&&n.size.width||n.width),e.indexOf("height")>-1&&(a.height=n.size&&n.size.height||n.height),e.indexOf("tiles")>-1&&(a.tiles=n.tiles),e.indexOf("original")>-1&&(a.original=n.original)):(e.indexOf("scene")>-1&&(a.scene=n.scene),n.layers?(a.layers.forEach((t=>{t.visible=!1})),n.layers.forEach(i)):a.layers.forEach((t=>{t.visible=!0})))),delete a.perspective}r[n]=new An(t,a)}return r}catch(t){return console.error("Fetch Maps:",t),[]}}toJSON(){return h(this,at)}},Dn=An;me=new WeakMap,_e=new WeakMap,at=new WeakMap,f();var it,De,ot,Rn=class{constructor(t,e){b(this,it,void 0),b(this,De,void 0),b(this,ot,{}),c(this,"id",""),c(this,"name",""),O(this,De,e),O(this,it,t),Object.assign(this,e)}get maps(){let t=h(this,ot).maps;if(void 0!==t)return t;let e=[],{maps:n}=h(this,it),{id:a}=h(this,De);for(let t=0,r=n.length;t<r;++t){let r=n[t];r.group===a&&e.push(r)}return h(this,ot).maps=e,e}static hydrate(t,e){return t.map((t=>new Rn(e,t)))}static async fetch(t){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(await F(t.options,"map-group",e)).map((e=>new Rn(t,e)))}catch(t){return console.error("Fetch Map Groups:",t),[]}}toJSON(){return h(this,De)}},Ln=Rn;it=new WeakMap,De=new WeakMap,ot=new WeakMap,f();var ce,st,J,ut,Bn=class extends ge{constructor(t,e){super(t),b(this,ce,void 0),b(this,st,void 0),b(this,J,{}),c(this,"id",""),c(this,"map",""),c(this,"x",0),c(this,"y",0),c(this,"operationHours"),c(this,"externalId"),b(this,ut,void 0),O(this,ce,t),O(this,st,e),Object.assign(this,e)}get lat(){var t;let e=h(this,J).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=h(this,ce)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return h(this,J).cachedLatLon=n.createCoordinateByXY(this.x,this.y),h(this,J).cachedLatLon.lat}get lon(){var t;let e=h(this,J).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=h(this,ce)._mapsById)?void 0:t[this.map];if(null==n)throw new Error("Map not found");return h(this,J).cachedLatLon=n.createCoordinateByXY(this.x,this.y),h(this,J).cachedLatLon.lon}get paths(){let t=h(this,J).paths;if(void 0!==t)return t;let e=[],n=h(this,ce)._nodesById,a=h(this,ut);if(Array.isArray(a))for(let t=0,r=a.length;t<r;++t){let r=n[a[t].node];null!=r&&e.push(r)}return h(this,J).paths=e,e}set paths(t){O(this,ut,t)}get locations(){let t=h(this,J).locations;if(void 0!==t)return t;let e=[],{locations:n}=h(this,ce),a=this.id;for(let t=0,r=n.length;t<r;++t){let r=n[t],i=r.nodes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t].id===a){e.push(r);break}}return h(this,J).locations=e,e}get polygon(){let t=h(this,J).polygon;if(void 0!==t)return t;let e,{polygons:n}=h(this,ce),a=this.id;for(let t=0,r=n.length;t<r;++t){let r=n[t];r.entrances.map((t=>t.id)).includes(a)&&(e=r)}return h(this,J).polygon=e,e}static hydrate(t,e){return t.map((t=>new Bn(e,t)))}static async fetch(t){let e=t.options.things.nodes.slice();t.options.things.maps&&j(e,"map"),["weight","multiplier","accessible"].forEach((function(t){j(e,t)}));let n={fields:e,perspective:t.options.do2D&&t.options.perspective||void 0,venue:t.options.venue};try{return(await F(t.options,"node",n)).map((e=>new Bn(t,e)))}catch(t){return console.error("Fetch Nodes:",t),[]}}toJSON(){return h(this,st)}},En=Bn;ce=new WeakMap,st=new WeakMap,J=new WeakMap,ut=new WeakMap,f();var dt,Sn=class{constructor(t){b(this,dt,void 0),c(this,"polygons",[]),O(this,dt,t),Object.assign(this,t)}static hydrate(t){return new Sn(t)}static async fetch(t){try{let e=await Ke(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new Sn(e)}catch(t){return console.error("Fetch Rankings:",t),null}}toJSON(){return h(this,dt)}},qn=Sn;dt=new WeakMap,f();var ct,Cn=class{constructor(t){c(this,"id",""),b(this,ct,void 0),O(this,ct,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Cn(t)))}static async fetch(t){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(await F(t.options,"apollo-theme",e)).map((t=>new Cn(t)))}catch(t){return console.error("Fetch Theme:",t),[]}}toJSON(){return h(this,ct)}},vr=Cn;ct=new WeakMap,f();var lt,Gn=class{constructor(t){b(this,lt,void 0),c(this,"defaultMap",""),c(this,"address",""),c(this,"city",""),c(this,"countrycode",""),c(this,"externalId",""),c(this,"id",""),c(this,"latitude"),c(this,"logo"),c(this,"longitude"),c(this,"metadata"),c(this,"name",""),c(this,"operationHours"),c(this,"postal",""),c(this,"slug",""),c(this,"state",""),c(this,"telephone",""),c(this,"tzid",""),c(this,"tzidOverride",""),c(this,"utcOffset",""),c(this,"website",""),O(this,lt,t),Object.assign(this,t)}static hydrate(t){return new Gn(t)}static async fetch(t){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=await F(t.options,"venue",e);return new Gn(n[0])}catch(t){return console.error("Fetch Venue:",t),{}}}toJSON(){return h(this,lt)}},Vn=Gn;lt=new WeakMap,f();var ft,Fn=class{constructor(t){c(this,"id",""),b(this,ft,void 0),c(this,"name"),c(this,"type"),c(this,"weight"),c(this,"multiplier"),O(this,ft,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Fn(t)))}static async fetch(t){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){j(e,t)}));let n={fields:e,venue:t.options.venue};try{return(await F(t.options,"vortex",n)).map((t=>new Fn(t)))}catch(t){return console.error("Fetch Vortexes:",t),[]}}toJSON(){return h(this,ft)}},kn=Fn;ft=new WeakMap;var Ga,Va={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,do2D:!1,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(t){t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes"}(Ga||(Ga={}));var Ne,Te,Ae={categories:Tn,locations:we,vortexes:kn,maps:Dn,nodes:En,polygons:Pe,venue:Vn,events:On,mapGroups:Ln,themes:vr,locationStates:Mr,locationRankings:mr,rankings:qn},pt=class{constructor(t){c(this,"perspective"),c(this,"things"),c(this,"options"),b(this,Ne,{}),b(this,Te,""),c(this,"updatedAt"),c(this,"categories",[]),c(this,"locations",[]),c(this,"vortexes",[]),c(this,"maps",[]),c(this,"nodes",[]),c(this,"polygons",[]),c(this,"venue",{}),c(this,"events",[]),c(this,"mapGroups",[]),c(this,"themes",[]),c(this,"locationStates",[]),c(this,"locationRankings",[]),c(this,"rankings"),c(this,"_categoriesById"),c(this,"_locationsById"),c(this,"_vortexesById"),c(this,"_mapsById"),c(this,"_nodesById"),c(this,"_polygonsById"),c(this,"_eventsById"),c(this,"_mapGroupsById"),c(this,"_locationStatesById"),c(this,"_locationRankingsById"),c(this,"_rankingsById"),c(this,"_categoriesByExternalId"),c(this,"_locationsByExternalId"),c(this,"_vortexesByExternalId"),c(this,"_mapsByExternalId"),c(this,"_nodesByExternalId"),c(this,"_polygonsByExternalId"),c(this,"_eventsByExternalId"),c(this,"_mapGroupsByExternalId"),c(this,"_locationStatesByExternalId"),c(this,"_locationRankingsByExternalId"),c(this,"_rankingsByExternalId"),c(this,"images"),c(this,"scenes"),c(this,"navigator"),this.options=t}generateGetters(t){try{for(let e=0,n=t.length;e<n;++e){let n=t[e];Array.isArray(this[n])&&(Object.defineProperty(this,`_${n}ByExternalId`,{get(){let t=h(this,Ne)[n];if(void 0!==t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),h(this,Ne)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=h(this,Ne)[n];if(void 0!==t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),h(this,Ne)[n]=e,e}}))}return this}catch(t){throw new Error("Unable to generate getters, "+t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,a=this[`_${t}ById`];return null!=a&&null!=a[e]||(a=this[n],null!=a&&null!=a[e])?a[e]:null}async hydrate(t,e){let n;if("string"==typeof t)try{O(this,Te,t),n=JSON.parse(t)}catch(t){return void console.error("Unable to parse JSON",t)}else n=t,O(this,Te,JSON.stringify(n));let a=Object.keys(n);for(let t=0,e=a.length;t<e;++t){let e=a[t],r=n[e];null!=Ae[e]&&"function"==typeof Ae[e].hydrate&&(this[e]=Ae[e].hydrate(r,this))}e&&await Sa(n);let{images:r,scenes:i}=n;this.images=r,this.scenes=i,this.generateGetters(a),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),Ra(this.options.clientId)||(this.options.things.rankings&&delete this.options.things.rankings,this.options.things.locationRankings&&delete this.options.things.locationRankings);let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,a=n.length;t<a;++t){let a=n[t];Ae[a]&&e.push(Ae[a].fetch(this).then((t=>(this[a]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator(),O(this,Te,JSON.stringify(this.toJSON()))}))}initNavigator(){this.navigator=new gr({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in Ae)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));return re(K({},e),{venue:this.venue.toJSON(),rankings:null==(t=this.rankings)?void 0:t.toJSON()})}toString(){return h(this,Te)}};Ne=new WeakMap,Te=new WeakMap,f();var ka={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"],locationRankings:[]};function Wa(t){let e=K(re(K({},Va),{things:ka}),t);return e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}async function sl(t){let e=Wa(K({baseUrl:"https://api-gateway.mappedin.com/"},t)),n=new pt(re(K({},e),{baseUrl:e.baseUrl+"public/1/"}));return await n.fetch(),n}Ua(),globalThis.btoa||(globalThis.btoa=Ha.encode);var ju={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function ul(t){let e=Wa(K(K({baseUrl:"https://api-gateway.mappedin.com/"},ju),t)),{version:n,venue:a}=t,r=`${t.bundleBaseUri||e.baseUrl+"exports/legacy/1/bundle"}?venue=${a}&version=1.0.0`,i=await yr(e,r),{url:o,updated_at:s}=i,l=await fetch(o,{mode:"cors"}),{data:u,format:h="jsonstring"}=await l.json();if("jsonstring"!==h)throw new Error(`Unrecognized format${h}`);let c=new pt(e);return await c.hydrate(u,e.shouldPopulateBundledImagesAsBlobs),c.updatedAt=s,c}export{pt as Mappedin,Tn as MappedinCategory,tt as MappedinCoordinate,_n as MappedinDestinationSet,Ve as MappedinDirections,On as MappedinEvent,we as MappedinLocation,Dn as MappedinMap,Ln as MappedinMapGroup,ge as MappedinNavigatable,En as MappedinNode,Pe as MappedinPolygon,qn as MappedinRankings,Vn as MappedinVenue,kn as MappedinVortex,sl as getVenue,ul as getVenueBundle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.mappedin__floating-label{position:absolute;top:0px;left:0px;opacity:0;width:200px;height:200px;will-change:transform;transition:opacity .3s linear}.mappedin__floating-label__icon{position:absolute;top:0;left:0;width:16px;height:16px}.mappedin__floating-label__icon>svg{position:absolute;top:-50%;left:-50%}.mappedin__floating-label__text_holder{font-family:"InterUI-Regular",Helvetica,Arial,sans-serif;font-weight:normal;font-weight:500;position:absolute;pointer-events:none;word-break:keep-all}.mappedin__floating-label__text_legacy{text-shadow:1px 1px 0px #ffffff,-1px -1px 0px #ffffff,1px -1px 0px #ffffff,-1px 1px 0px #ffffff}.mappedin__floating-label__text_back{-webkit-text-stroke:4px white;color:#fff}.mappedin__floating-label__text_front{color:#000;position:absolute;display:block;width:100%;height:100%;top:0;left:0}.mappedin__smart-collision-engine__container{position:absolute;left:0px;top:0px;bottom:0px;right:0px;pointer-events:none;font-family:"InterUI-Regular",Helvetica,Arial,sans-serif}.mappedin__smart-collision-engine-debug__container{position:absolute;left:0px;top:0px;bottom:0px;right:0px;pointer-events:none}.mappedin-marker{font-family:"InterUI-Regular",Helvetica,Arial,sans-serif;font-weight:normal;pointer-events:none;top:0;transition:transform .3s linear;position:absolute;font-weight:bold;color:#000;z-index:1;transition:opacity .3s;display:flex;flex-direction:row;will-change:opacity;justify-content:center}.mappedin-tooltip__wrapper{display:flex;width:1px;height:1px;align-items:center;justify-content:center;z-index:1}.mappedin-tooltip{font-family:"InterUI-Regular",Helvetica,Arial,sans-serif;font-weight:normal;pointer-events:all;top:0;transition:transform .3s linear;font-weight:bold;color:#000;position:absolute;z-index:1;transition:opacity .3s;display:flex;flex-direction:row;will-change:opacity;justify-content:center}.mappedin-tooltip>div{z-index:2;flex-shrink:0;max-width:500px;background:white;border-radius:20px;box-shadow:0 2px 11px #0003}.mappedin-tooltip:before{content:"";width:0;height:0;top:calc(50% - 10px);left:-10px;z-index:1;position:absolute;border-bottom:10px solid transparent;border-top:10px solid transparent}.mappedin-tooltip.tooltip--anchor-top{left:0px;top:0px}.mappedin-tooltip.tooltip--anchor-top:before{left:calc(50% - 10px);top:calc(100% - 5px);right:auto;border-bottom:10px solid transparent;border-top:10px solid white;border-left:10px solid transparent;border-right:10px solid transparent}.mappedin-tooltip.tooltip--anchor-bottom{left:0px;top:0px}.mappedin-tooltip.tooltip--anchor-bottom:before{left:calc(50% - 10px);top:-15px;right:auto;border-bottom:10px solid white;border-top:10px solid transparent;border-left:10px solid transparent;border-right:10px solid transparent}.mappedin-tooltip.tooltip--anchor-right{justify-content:flex-start;left:0px;top:0px}.mappedin-tooltip.tooltip--anchor-right:before{left:-5px;right:auto;border-right:10px solid white}.mappedin-tooltip.tooltip--anchor-left{left:0px;top:0px}.mappedin-tooltip.tooltip--anchor-left:before{left:auto;right:-5px;border-left:10px solid white}.mappedin-tooltip.tooltip--anchor-top-left{left:7px;top:7px}.mappedin-tooltip.tooltip--anchor-top-left:before{left:auto;right:-7px;top:calc(100% - 13px);border-bottom:10px solid transparent;border-top:10px solid white;border-left:10px solid transparent;border-right:10px solid transparent;transform:rotate(-45deg)}.mappedin-tooltip.tooltip--anchor-top-right{left:-6px;top:7px}.mappedin-tooltip.tooltip--anchor-top-right:before{left:-7px;right:auto;top:calc(100% - 13px);border-bottom:10px solid transparent;border-top:10px solid white;border-left:10px solid transparent;border-right:10px solid transparent;transform:rotate(45deg)}.mappedin-tooltip.tooltip--anchor-bottom-left{left:7px;top:-6px}.mappedin-tooltip.tooltip--anchor-bottom-left:before{left:auto;right:-7px;top:-7px;border-bottom:10px solid white;border-top:10px solid transparent;border-left:10px solid transparent;border-right:10px solid transparent;transform:rotate(45deg)}.mappedin-tooltip.tooltip--anchor-bottom-right{left:-6px;top:-6px}.mappedin-tooltip.tooltip--anchor-bottom-right:before{left:-7px;right:auto;top:-7px;border-bottom:10px solid white;border-top:10px solid transparent;border-left:10px solid transparent;border-right:10px solid transparent;transform:rotate(-45deg)}.mappedin-tooltip.tooltip--visible{opacity:1}
|
|
1
|
+
.mMapviewHoverLabel{background:rgba(255,255,255,.9);color:#333;padding:10px;font-size:14px;font-weight:bold;transition:opacity .3s;font-family:sans-serif}.mappedin__floating-label{position:absolute;top:0px;left:0px;opacity:0;width:200px;height:200px;will-change:transform;transition:opacity .3s linear}.mappedin__floating-label__icon{position:absolute;top:0;left:0;width:16px;height:16px}.mappedin__floating-label__icon>svg{position:absolute;top:-50%;left:-50%}.mappedin__floating-label__text_holder{font-family:"InterUI-Regular",Helvetica,Arial,sans-serif;font-weight:normal;font-weight:500;position:absolute;pointer-events:none;word-break:keep-all}.mappedin__floating-label__text_legacy{text-shadow:1px 1px 0px #ffffff,-1px -1px 0px #ffffff,1px -1px 0px #ffffff,-1px 1px 0px #ffffff}.mappedin__floating-label__text_back{-webkit-text-stroke:4px white;color:#fff}.mappedin__floating-label__text_front{color:#000;position:absolute;display:block;width:100%;height:100%;top:0;left:0}.mappedin__smart-collision-engine__container{position:absolute;left:0px;top:0px;bottom:0px;right:0px;pointer-events:none;font-family:"InterUI-Regular",Helvetica,Arial,sans-serif}.mappedin__smart-collision-engine-debug__container{position:absolute;left:0px;top:0px;bottom:0px;right:0px;pointer-events:none}.mappedin-marker{font-family:"InterUI-Regular",Helvetica,Arial,sans-serif;font-weight:normal;pointer-events:none;top:0;transition:transform .3s linear;position:absolute;font-weight:bold;color:#000;z-index:1;transition:opacity .3s;display:flex;flex-direction:row;will-change:opacity;justify-content:center}.mappedin-tooltip__wrapper{display:flex;width:1px;height:1px;align-items:center;justify-content:center;z-index:1}.mappedin-tooltip{font-family:"InterUI-Regular",Helvetica,Arial,sans-serif;font-weight:normal;pointer-events:all;top:0;transition:transform .3s linear;font-weight:bold;color:#000;position:absolute;z-index:1;transition:opacity .3s;display:flex;flex-direction:row;will-change:opacity;justify-content:center}.mappedin-tooltip>div{z-index:2;flex-shrink:0;max-width:500px;background:white;border-radius:20px;box-shadow:0 2px 11px #0003}.mappedin-tooltip:before{content:"";width:0;height:0;top:calc(50% - 10px);left:-10px;z-index:1;position:absolute;border-bottom:10px solid transparent;border-top:10px solid transparent}.mappedin-tooltip.tooltip--anchor-top{left:0px;top:0px}.mappedin-tooltip.tooltip--anchor-top:before{left:calc(50% - 10px);top:calc(100% - 5px);right:auto;border-bottom:10px solid transparent;border-top:10px solid white;border-left:10px solid transparent;border-right:10px solid transparent}.mappedin-tooltip.tooltip--anchor-bottom{left:0px;top:0px}.mappedin-tooltip.tooltip--anchor-bottom:before{left:calc(50% - 10px);top:-15px;right:auto;border-bottom:10px solid white;border-top:10px solid transparent;border-left:10px solid transparent;border-right:10px solid transparent}.mappedin-tooltip.tooltip--anchor-right{justify-content:flex-start;left:0px;top:0px}.mappedin-tooltip.tooltip--anchor-right:before{left:-5px;right:auto;border-right:10px solid white}.mappedin-tooltip.tooltip--anchor-left{left:0px;top:0px}.mappedin-tooltip.tooltip--anchor-left:before{left:auto;right:-5px;border-left:10px solid white}.mappedin-tooltip.tooltip--anchor-top-left{left:7px;top:7px}.mappedin-tooltip.tooltip--anchor-top-left:before{left:auto;right:-7px;top:calc(100% - 13px);border-bottom:10px solid transparent;border-top:10px solid white;border-left:10px solid transparent;border-right:10px solid transparent;transform:rotate(-45deg)}.mappedin-tooltip.tooltip--anchor-top-right{left:-6px;top:7px}.mappedin-tooltip.tooltip--anchor-top-right:before{left:-7px;right:auto;top:calc(100% - 13px);border-bottom:10px solid transparent;border-top:10px solid white;border-left:10px solid transparent;border-right:10px solid transparent;transform:rotate(45deg)}.mappedin-tooltip.tooltip--anchor-bottom-left{left:7px;top:-6px}.mappedin-tooltip.tooltip--anchor-bottom-left:before{left:auto;right:-7px;top:-7px;border-bottom:10px solid white;border-top:10px solid transparent;border-left:10px solid transparent;border-right:10px solid transparent;transform:rotate(45deg)}.mappedin-tooltip.tooltip--anchor-bottom-right{left:-6px;top:-6px}.mappedin-tooltip.tooltip--anchor-bottom-right:before{left:-7px;right:auto;top:-7px;border-bottom:10px solid white;border-top:10px solid transparent;border-left:10px solid transparent;border-right:10px solid transparent;transform:rotate(-45deg)}.mappedin-tooltip.tooltip--visible{opacity:1}
|