@mappedin/mappedin-js 6.0.0-alpha.9 → 6.0.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/README.md +44 -157
- package/lib/esm/Arrival-7CH7MHGT.js +1 -0
- package/lib/esm/Chalet-HJY2RRWP.js +1 -0
- package/lib/esm/GLTFExporter-6MY3TTW5.js +1 -0
- package/lib/esm/HelveticaNeue-KYLSWWLS.js +1 -0
- package/lib/esm/Helvetiker-INS43MZX.js +1 -0
- package/lib/esm/Lato-ULDR5SED.js +1 -0
- package/lib/esm/MyriadPro-ZAEETUH5.js +1 -0
- package/lib/esm/PerformanceController-VMCH7DPO.js +1 -0
- package/lib/esm/ProximaNova-Q6CVROCO.js +1 -0
- package/lib/esm/SimonCircular-I6ROXOEJ.js +1 -0
- package/lib/esm/browser-G6HNHS3R.js +1 -0
- package/lib/esm/chunk-ISNJUESV.js +1 -0
- package/lib/esm/chunk-J5IUISYU.js +1 -0
- package/lib/esm/chunk-SVP2SCIT.js +1 -0
- package/lib/esm/chunk-VSBVGSLC.js +1 -0
- package/lib/esm/index.css +1 -0
- package/lib/esm/index.d.ts +14657 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/outdoor-context-HUI6WIRE.js +1 -0
- package/lib/index.css +1 -0
- package/package.json +18 -53
- package/lib/esm/get-venue/index.d.ts +0 -2466
- package/lib/esm/get-venue/index.js +0 -1
- package/lib/esm/navigator/index.d.ts +0 -243
- package/lib/esm/navigator/index.js +0 -1
- package/lib/esm/renderer/Arrival-JVXBAUFE.js +0 -1
- package/lib/esm/renderer/Chalet-7VKCGC5R.js +0 -1
- package/lib/esm/renderer/HelveticaNeue-M6HRIIGZ.js +0 -1
- package/lib/esm/renderer/Helvetiker-K2MS62IA.js +0 -1
- package/lib/esm/renderer/Lato-PKBWMAQE.js +0 -1
- package/lib/esm/renderer/MyriadPro-MKDHQECZ.js +0 -1
- package/lib/esm/renderer/ProximaNova-U6AQPIB5.js +0 -1
- package/lib/esm/renderer/SimonCircular-LDXYDCAN.js +0 -1
- package/lib/esm/renderer/browser-BW4IT6LG.js +0 -1
- package/lib/esm/renderer/chunk-GPLIHQI3.js +0 -1
- package/lib/esm/renderer/chunk-MWXS32IR.js +0 -1
- package/lib/esm/renderer/index.css +0 -1
- package/lib/esm/renderer/index.d.ts +0 -5261
- package/lib/esm/renderer/index.js +0 -1
- package/lib/mappedin.css +0 -1
- package/lib/mappedin.js +0 -1
- package/lib/node/index.js +0 -1
package/lib/node/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var F,Jr=Object.create,ia=Object.defineProperty,Xr=Object.defineProperties,Kr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyDescriptors,Qr=Object.getOwnPropertyNames,Ni=Object.getOwnPropertySymbols,es=Object.getPrototypeOf,_i=Object.prototype.hasOwnProperty,ts=Object.prototype.propertyIsEnumerable,Wn=Math.pow,$n=(t,e,n)=>e in t?ia(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ee=(t,e)=>{for(var n in e||(e={}))_i.call(e,n)&&$n(t,n,e[n]);if(Ni)for(var n of Ni(e))ts.call(e,n)&&$n(t,n,e[n]);return t},pe=(t,e)=>Xr(t,Zr(e)),as=(t,e)=>()=>(t&&(e=t(t=0)),e),ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ns=(t,e)=>{for(var n in e)ia(t,n,{get:e[n],enumerable:!0})},Ei=(t,e,n,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of Qr(e))!_i.call(t,r)&&r!==n&&ia(t,r,{get:()=>e[r],enumerable:!(i=Kr(e,r))||i.enumerable});return t},un=(t,e,n)=>(n=null!=t?Jr(es(t)):{},Ei(!e&&t&&t.__esModule?n:ia(n,"default",{value:t,enumerable:!0}),t)),is=t=>Ei(ia({},"__esModule",{value:!0}),t),d=(t,e,n)=>($n(t,"symbol"!=typeof e?e+"":e,n),n),Hn=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},l=(t,e,n)=>(Hn(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(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)},N=(t,e,n,i)=>(Hn(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),Yn=(t,e,n,i)=>({set _(i){N(t,e,i,n)},get _(){return l(t,e,i)}}),it=(t,e,n)=>(Hn(t,e,"access private method"),n),Z=(t,e,n)=>new Promise(((i,r)=>{var a=t=>{try{o(n.next(t))}catch(t){r(t)}},s=t=>{try{o(n.throw(t))}catch(t){r(t)}},o=t=>t.done?i(t.value):Promise.resolve(t.value).then(a,s);o((n=n.apply(t,e)).next())})),T=as((()=>{F={env:{NODE_ENV:"production",npm_package_version:"6.0.0-alpha.9"}}})),Ai=ft(((t,e)=>{T(),function(n){var i="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==i&&e,a="object"==typeof global&&global;(a.global===a||a.window===a)&&(n=a);var s=function(t){this.message=t};(s.prototype=new Error).name="InvalidCharacterError";var o=function(t){throw new s(t)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=/[\t\n\f\r ]/g,u={encode:function(t){t=String(t),/[^\0-\xFF]/.test(t)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var e,n,i,r,a=t.length%3,s="",h=-1,u=t.length-a;++h<u;)e=t.charCodeAt(h)<<16,n=t.charCodeAt(++h)<<8,i=t.charCodeAt(++h),s+=l.charAt((r=e+n+i)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==a?(e=t.charCodeAt(h)<<8,n=t.charCodeAt(++h),s+=l.charAt((r=e+n)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==a&&(r=t.charCodeAt(h),s+=l.charAt(r>>2)+l.charAt(r<<4&63)+"=="),s},decode:function(t){var e=(t=String(t).replace(h,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var n,i,r=0,a="",s=-1;++s<e;)i=l.indexOf(t.charAt(s)),n=r%4?64*n+i:i,r++%4&&(a+=String.fromCharCode(255&n>>(-2*r&6)));return a},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return u}));else if(i&&!i.nodeType)if(r)r.exports=u;else for(var c in u)u.hasOwnProperty(c)&&(i[c]=u[c]);else n.base64=u}(t)})),Si=ft(((t,e)=>{var n,i;T(),n="undefined"!=typeof self?self:t,i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){n.r(e),n.d(e,"computeDestinationPoint",(function(){return R})),n.d(e,"convertArea",(function(){return C})),n.d(e,"convertDistance",(function(){return D})),n.d(e,"convertSpeed",(function(){return z})),n.d(e,"decimalToSexagesimal",(function(){return L})),n.d(e,"findNearest",(function(){return U})),n.d(e,"getAreaOfPolygon",(function(){return q})),n.d(e,"getBounds",(function(){return J})),n.d(e,"getBoundsOfDistance",(function(){return Z})),n.d(e,"getCenter",(function(){return H})),n.d(e,"getCenterOfBounds",(function(){return V})),n.d(e,"getCompassDirection",(function(){return X})),n.d(e,"getCoordinateKey",(function(){return g})),n.d(e,"getCoordinateKeys",(function(){return b})),n.d(e,"getDistance",(function(){return $})),n.d(e,"getDistanceFromLine",(function(){return K})),n.d(e,"getGreatCircleBearing",(function(){return Q})),n.d(e,"getLatitude",(function(){return F})),n.d(e,"getLongitude",(function(){return A})),n.d(e,"getPathLength",(function(){return et})),n.d(e,"getPreciseDistance",(function(){return nt})),n.d(e,"getRhumbLineBearing",(function(){return Y})),n.d(e,"getRoughCompassDirection",(function(){return it})),n.d(e,"getSpeed",(function(){return rt})),n.d(e,"isDecimal",(function(){return y})),n.d(e,"isPointInLine",(function(){return at})),n.d(e,"isPointInPolygon",(function(){return st})),n.d(e,"isPointNearLine",(function(){return ot})),n.d(e,"isPointWithinRadius",(function(){return lt})),n.d(e,"isSexagesimal",(function(){return m})),n.d(e,"isValidCoordinate",(function(){return k})),n.d(e,"isValidLatitude",(function(){return x})),n.d(e,"isValidLongitude",(function(){return N})),n.d(e,"orderByDistance",(function(){return G})),n.d(e,"sexagesimalToDecimal",(function(){return v})),n.d(e,"toDecimal",(function(){return O})),n.d(e,"toRad",(function(){return S})),n.d(e,"toDeg",(function(){return B})),n.d(e,"wktToPolygon",(function(){return ut})),n.d(e,"sexagesimalPattern",(function(){return i})),n.d(e,"earthRadius",(function(){return r})),n.d(e,"MINLAT",(function(){return a})),n.d(e,"MAXLAT",(function(){return s})),n.d(e,"MINLON",(function(){return o})),n.d(e,"MAXLON",(function(){return l})),n.d(e,"longitudeKeys",(function(){return h})),n.d(e,"latitudeKeys",(function(){return u})),n.d(e,"altitudeKeys",(function(){return c})),n.d(e,"distanceConversion",(function(){return d})),n.d(e,"timeConversion",(function(){return p})),n.d(e,"areaConversion",(function(){return f}));var i=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,r=6378137,a=-90,s=90,o=-180,l=180,h=["lng","lon","longitude",0],u=["lat","latitude",1],c=["alt","altitude","elevation","elev",2],d={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},p={m:60,h:3600,d:86400},f={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};f.sqm=f.m2,f.sqkm=f.km2,f.sqft=f.ft2,f.sqyd=f.yd2,f.sqin=f.in2;var g=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)},y=function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)},m=function(t){return i.test(t.toString().trim())},v=function(t){var e=new RegExp(i).exec(t);if(null==e)throw new Error("Given value is not in sexagesimal format");var n=Number(e[2])/60||0,r=Number(e[4])/3600||0,a=parseFloat(e[1])+n+r;return["S","W"].includes(e[7])?-a:a};function w(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function _(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){M(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function M(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:h,latitude:u,altitude:c},n=g(t,e.longitude),i=g(t,e.latitude),r=g(t,e.altitude);return _({latitude:i,longitude:n},r?{altitude:r}:{})},x=function t(e){return y(e)?!(parseFloat(e)>s||e<a):!!m(e)&&t(v(e))},N=function t(e){return y(e)?!(parseFloat(e)>l||e<o):!!m(e)&&t(v(e))},k=function(t){var e=b(t),n=e.latitude,i=e.longitude;if(Array.isArray(t)&&t.length>=2)return N(t[0])&&x(t[1]);if(void 0===n||void 0===i)return!1;var r=t[i],a=t[n];return void 0!==a&&void 0!==r&&!1!==x(a)&&!1!==N(r)};function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){I(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function I(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var O=function t(e){if(y(e))return Number(e);if(m(e))return v(e);if(k(e)){var n=b(e);return Array.isArray(e)?e.map((function(e,n){return[0,1].includes(n)?t(e):e})):E(E(E({},e),n.latitude&&I({},n.latitude,t(e[n.latitude]))),n.longitude&&I({},n.longitude,t(e[n.longitude])))}return Array.isArray(e)?e.map((function(e){return k(e)?t(e):e})):e},F=function(t,e){var n=g(t,u);if(null!=n){var i=t[n];return!0===e?i:O(i)}},A=function(t,e){var n=g(t,h);if(null!=n){var i=t[n];return!0===e?i:O(i)}},S=function(t){return t*Math.PI/180},B=function(t){return 180*t/Math.PI},R=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,r=F(t),a=A(t),s=e/i,h=S(n),u=S(r),c=S(a),d=Math.asin(Math.sin(u)*Math.cos(s)+Math.cos(u)*Math.sin(s)*Math.cos(h)),p=c+Math.atan2(Math.sin(h)*Math.sin(s)*Math.cos(u),Math.cos(s)-Math.sin(u)*Math.sin(d)),f=B(p);return(f<o||f>l)&&(p=(p+3*Math.PI)%(2*Math.PI)-Math.PI,f=B(p)),{latitude:B(d),longitude:f}},C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=f[e];if(n)return t*n;throw new Error("Invalid unit used for area conversion.")},D=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=d[e];if(n)return t*n;throw new Error("Invalid unit used for distance conversion.")},z=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(e){case"kmh":return t*p.h*d.km;case"mph":return t*p.h*d.mi;default:return t}};function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var j=function(t){var e=Math.pow(10,12);return Math.round(t*e)/e},L=function(t){var e=function(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=[],i=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(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.")}()}(t.toString().split("."),2),n=e[0],i=e[1],r=Math.abs(Number(n)),a=j(60*Number("0."+(i||0))),s=Math.floor(a),o=j(60*(a%s||0));return r+"° "+Number(s.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(o.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'},W=function(t){return t>1?1:t<-1?-1:t},$=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var i=F(t),a=A(t),s=F(e),o=A(e),l=Math.acos(W(Math.sin(S(s))*Math.sin(S(i))+Math.cos(S(s))*Math.cos(S(i))*Math.cos(S(a)-S(o))))*r;return Math.round(l/n)*n},G=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$;return n="function"==typeof n?n:$,e.slice().sort((function(e,i){return n(t,e)-n(t,i)}))},U=function(t,e){return G(t,e)[0]},q=function(t){var e=0;if(t.length>2){for(var n,i,a,s=0;s<t.length;s++){s===t.length-2?(n=t.length-2,i=t.length-1,a=0):s===t.length-1?(n=t.length-1,i=0,a=1):(n=s,i=s+1,a=s+2);var o=A(t[n]),l=F(t[i]),h=A(t[a]);e+=(S(h)-S(o))*Math.sin(S(l))}e=e*r*r/2}return Math.abs(e)},J=function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,e){var n=F(e),i=A(e);return{maxLat:Math.max(n,t.maxLat),minLat:Math.min(n,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})},Z=function(t,e){var n,i,h=F(t),u=A(t),c=S(h),d=S(u),p=e/r,f=c-p,g=c+p,y=S(s),m=S(a),v=S(l),w=S(o);if(f>m&&g<y){var _=Math.asin(Math.sin(p)/Math.cos(c));(n=d-_)<w&&(n+=2*Math.PI),(i=d+_)>v&&(i-=2*Math.PI)}else f=Math.max(f,m),g=Math.min(g,y),n=w,i=v;return[{latitude:B(f),longitude:B(n)},{latitude:B(g),longitude:B(i)}]},H=function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var e=t.length,n=t.reduce((function(t,e){var n=S(F(e)),i=S(A(e));return{X:t.X+Math.cos(n)*Math.cos(i),Y:t.Y+Math.cos(n)*Math.sin(i),Z:t.Z+Math.sin(n)}}),{X:0,Y:0,Z:0}),i=n.X/e,r=n.Y/e,a=n.Z/e;return{longitude:B(Math.atan2(r,i)),latitude:B(Math.atan2(a,Math.sqrt(i*i+r*r)))}},V=function(t){var e=J(t),n=e.minLat+(e.maxLat-e.minLat)/2,i=e.minLng+(e.maxLng-e.minLng)/2;return{latitude:parseFloat(n.toFixed(6)),longitude:parseFloat(i.toFixed(6))}},Y=function(t,e){var n=S(A(e))-S(A(t)),i=Math.log(Math.tan(S(F(e))/2+Math.PI/4)/Math.tan(S(F(t))/2+Math.PI/4));return Math.abs(n)>Math.PI&&(n=n>0?-1*(2*Math.PI-n):2*Math.PI+n),(B(Math.atan2(n,i))+360)%360},X=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,i="function"==typeof n?n(t,e):Y(t,e);if(isNaN(i))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(i/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"}},K=function(t,e,n){var i=$(e,t),r=$(t,n),a=$(e,n),s=Math.acos(W((i*i+a*a-r*r)/(2*i*a))),o=Math.acos(W((r*r+a*a-i*i)/(2*r*a)));return s>Math.PI/2?i:o>Math.PI/2?r:Math.sin(s)*i},Q=function(t,e){var n=F(e),i=A(e),r=F(t),a=A(t);return(B(Math.atan2(Math.sin(S(i)-S(a))*Math.cos(S(n)),Math.cos(S(r))*Math.sin(S(n))-Math.sin(S(r))*Math.cos(S(n))*Math.cos(S(i)-S(a))))+360)%360};function tt(t){return(tt="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 et=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$;return t.reduce((function(t,n){return"object"===tt(t)&&null!==t.last&&(t.distance+=e(n,t.last)),t.last=n,t}),{last:null,distance:0}).distance},nt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;n=void 0===n||isNaN(n)?1:n;var i,a,s,o,l,h,u,c=F(t),d=A(t),p=F(e),f=A(e),g=6356752.314245,y=1/298.257223563,m=S(f-d),v=Math.atan((1-y)*Math.tan(S(parseFloat(c)))),w=Math.atan((1-y)*Math.tan(S(parseFloat(p)))),_=Math.sin(v),M=Math.cos(v),b=Math.sin(w),x=Math.cos(w),N=m,k=100;do{var T=Math.sin(N),E=Math.cos(N);if(0===(h=Math.sqrt(x*T*(x*T)+(M*b-_*x*E)*(M*b-_*x*E))))return 0;i=_*b+M*x*E,a=Math.atan2(h,i),l=i-2*_*b/(o=1-(s=M*x*T/h)*s),isNaN(l)&&(l=0);var I=y/16*o*(4+y*(4-3*o));u=N,N=m+(1-I)*y*s*(a+I*h*(l+I*i*(2*l*l-1)))}while(Math.abs(N-u)>1e-12&&--k>0);if(0===k)return NaN;var O=o*(r*r-g*g)/(g*g),B=1+O/16384*(4096+O*(O*(320-175*O)-768)),R=O/1024*(256+O*(O*(74-47*O)-128)),C=R*h*(l+R/4*(i*(2*l*l-1)-R/6*l*(4*h*h-3)*(4*l*l-3))),D=g*B*(a-C);return Math.round(D/n)*n},it=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},rt=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$,i=n(t,e),r=Number(e.time)-Number(t.time),a=i/r*1e3;return a},at=function(t,e,n){return $(e,t)+$(t,n)===$(e,n)},st=function(t,e){for(var n=!1,i=e.length,r=-1,a=i-1;++r<i;a=r)(A(e[r])<=A(t)&&A(t)<A(e[a])||A(e[a])<=A(t)&&A(t)<A(e[r]))&&F(t)<(F(e[a])-F(e[r]))*(A(t)-A(e[r]))/(A(e[a])-A(e[r]))+F(e[r])&&(n=!n);return n},ot=function(t,e,n,i){return K(t,e,n)<i},lt=function(t,e,n){return $(t,e)<n};function ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var ut=function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var e=function(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=[],i=!0,r=!1,a=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return n}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ht(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ht(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.")}()}(t.split(" "),2),n=e[0],i=e[1];return{longitude:parseFloat(n),latitude:parseFloat(i)}}))}}])},"object"==typeof t&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof t?t.geolib=i():n.geolib=i()})),fr=ft(((t,e)=>{T(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),Mr=ft(((t,e)=>{T();var n="%[a-f0-9]{2}",i=new RegExp("("+n+")|([^%]+?)","gi"),r=new RegExp("("+n+")+","gi");function a(t,e){try{return[decodeURIComponent(t.join(""))]}catch(t){}if(1===t.length)return t;e=e||1;var n=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],a(n),a(i))}function s(t){try{return decodeURIComponent(t)}catch(r){for(var e=t.match(i)||[],n=1;n<e.length;n++)e=(t=a(e,n).join("")).match(i)||[];return t}}e.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(t);n;){try{e[n[0]]=decodeURIComponent(n[0])}catch(t){var i=s(n[0]);i!==n[0]&&(e[n[0]]=i)}n=r.exec(t)}e["%C2"]="�";for(var a=Object.keys(e),o=0;o<a.length;o++){var l=a[o];t=t.replace(new RegExp(l,"g"),e[l])}return t}(t)}}})),jr=ft(((t,e)=>{T(),e.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let n=t.indexOf(e);return-1===n?[t]:[t.slice(0,n),t.slice(n+e.length)]}})),Tr=ft(((t,e)=>{T(),e.exports=function(t,e){for(var n={},i=Object.keys(t),r=Array.isArray(e),a=0;a<i.length;a++){var s=i[a],o=t[s];(r?-1!==e.indexOf(s):e(s,o,t))&&(n[s]=o)}return n}})),Sr=ft((t=>{T();var e=fr(),n=Mr(),i=jr(),r=Tr(),a=Symbol("encodeFragmentIdentifier");function s(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(t,n){return n.encode?n.strict?e(t):encodeURIComponent(t):t}function l(t,e){return e.decode?n(t):t}function h(t){return Array.isArray(t)?t.sort():"object"==typeof t?h(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function u(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function c(t){let e=(t=u(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function d(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function p(t,e){s((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let n=function(t){let e;switch(t.arrayFormat){case"index":return(t,n,i)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===i[t]&&(i[t]={}),i[t][e[1]]=n):i[t]=n};case"bracket":return(t,n,i)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],n):i[t]=[n]:i[t]=n};case"comma":case"separator":return(e,n,i)=>{let r="string"==typeof n&&n.includes(t.arrayFormatSeparator),a="string"==typeof n&&!r&&l(n,t).includes(t.arrayFormatSeparator);n=a?l(n,t):n;let s=r||a?n.split(t.arrayFormatSeparator).map((e=>l(e,t))):null===n?n:l(n,t);i[e]=s};case"bracket-separator":return(e,n,i)=>{let r=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!r)return void(i[e]=n&&l(n,t));let a=null===n?[]:n.split(t.arrayFormatSeparator).map((e=>l(e,t)));void 0!==i[e]?i[e]=[].concat(i[e],a):i[e]=a};default:return(t,e,n)=>{void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e),r=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return r;for(let a of t.split("&")){if(""===a)continue;let[t,s]=i(e.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:l(s,e),n(l(t,e),s,r)}for(let t of Object.keys(r)){let n=r[t];if("object"==typeof n&&null!==n)for(let t of Object.keys(n))n[t]=d(n[t],e);else r[t]=d(n,e)}return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{let n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=h(n):t[e]=n,t}),Object.create(null))}t.extract=c,t.parse=p,t.stringify=(t,e)=>{if(!t)return"";s((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let n=n=>e.skipNull&&(t=>null==t)(t[n])||e.skipEmptyString&&""===t[n],i=function(t){switch(t.arrayFormat){case"index":return e=>(n,i)=>{let r=n.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,[o(e,t),"[",r,"]"].join("")]:[...n,[o(e,t),"[",o(r,t),"]=",o(i,t)].join("")]};case"bracket":return e=>(n,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,[o(e,t),"[]"].join("")]:[...n,[o(e,t),"[]=",o(i,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return n=>(i,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?i:(r=null===r?"":r,0===i.length?[[o(n,t),e,o(r,t)].join("")]:[[i,o(r,t)].join(t.arrayFormatSeparator)])}default:return e=>(n,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?n:null===i?[...n,o(e,t)]:[...n,[o(e,t),"=",o(i,t)].join("")]}}(e),r={};for(let e of Object.keys(t))n(e)||(r[e]=t[e]);let a=Object.keys(r);return!1!==e.sort&&a.sort(e.sort),a.map((n=>{let r=t[n];return void 0===r?"":null===r?o(n,e):Array.isArray(r)?0===r.length&&"bracket-separator"===e.arrayFormat?o(n,e)+"[]":r.reduce(i(n),[]).join("&"):o(n,e)+"="+o(r,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[n,r]=i(t,"#");return Object.assign({url:n.split("?")[0]||"",query:p(c(t),e)},e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:l(r,e)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[a]:!0},n);let i=u(e.url).split("?")[0]||"",r=t.extract(e.url),s=t.parse(r,{sort:!1}),l=Object.assign(s,e.query),h=t.stringify(l,n);h&&(h=`?${h}`);let c=function(t){let e="",n=t.indexOf("#");return-1!==n&&(e=t.slice(n)),e}(e.url);return e.fragmentIdentifier&&(c=`#${n[a]?o(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${i}${h}${c}`},t.pick=(e,n,i)=>{i=Object.assign({parseFragmentIdentifier:!0,[a]:!1},i);let{url:s,query:o,fragmentIdentifier:l}=t.parseUrl(e,i);return t.stringifyUrl({url:s,query:r(o,n),fragmentIdentifier:l},i)},t.exclude=(e,n,i)=>{let r=Array.isArray(n)?t=>!n.includes(t):(t,e)=>!n(t,e);return t.pick(e,r,i)}})),Rr=ft(((t,e)=>{var n,i;T(),n=t,i=function(){var t=function(){return t=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},t.apply(this,arguments)};function e(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,a=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)s.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return s}var i,r="KEYS",a="VALUES",s="",o=function(){function t(t,e){var n=t._tree,i=Array.from(n.keys());this.set=t,this._type=e,this._path=i.length>0?[{node:n,keys:i}]:[]}return t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=l(this._path),e=t.node,n=t.keys;if(l(n)===s)return{done:!1,value:this.result()};var i=e.get(l(n));return this._path.push({node:i,keys:Array.from(i.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=l(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return l(e)})).filter((function(t){return t!==s})).join("")},t.prototype.value=function(){return l(this._path).node.get(s)},t.prototype.result=function(){switch(this._type){case a:return this.value();case r:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),l=function(t){return t[t.length-1]},h=function(t,n,i,r,a,o,l,u){var c,d,p=o*l;try{t:for(var f=e(t.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y===s){var m=a[p-1];m<=i&&r.set(u,[t.get(y),m])}else{for(var v=o,w=0;w<y.length;++w,++v){for(var _=y[w],M=l*v,b=M-l,x=a[M],N=Math.max(0,v-i-1),k=Math.min(l-1,v+i),T=N;T<k;++T){var E=_!==n[T],I=a[b+T]+ +E,O=a[b+T+1]+1,F=a[M+T]+1,A=a[M+T+1]=Math.min(I,O,F);A<x&&(x=A)}if(x>i)continue t}h(t.get(y),n,i,r,a,v,l,u+y)}}}catch(t){c={error:t}}finally{try{g&&!g.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}},u=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return t.prototype.atPrefix=function(i){var r,a;if(!i.startsWith(this._prefix))throw new Error("Mismatched prefix");var o=n(c(this._tree,i.slice(this._prefix.length)),2),l=o[0],h=o[1];if(void 0===l){var u=n(m(h),2),d=u[0],p=u[1];try{for(var f=e(d.keys()),g=f.next();!g.done;g=f.next()){var y=g.value;if(y!==s&&y.startsWith(p)){var v=new Map;return v.set(y.slice(p.length),d.get(y)),new t(v,i)}}}catch(t){r={error:t}}finally{try{g&&!g.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}return new t(l,i)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,f(this._tree,t)},t.prototype.entries=function(){return new o(this,"ENTRIES")},t.prototype.forEach=function(t){var i,r;try{for(var a=e(this),s=a.next();!s.done;s=a.next()){var o=n(s.value,2);t(o[0],o[1],this)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},t.prototype.fuzzyGet=function(t,e){return function(t,e,n){var i=new Map;if(void 0===e)return i;for(var r=e.length+1,a=r+n,s=new Uint8Array(a*r).fill(n+1),o=0;o<r;++o)s[o]=o;for(var l=1;l<a;++l)s[l*r]=l;return h(t,e,n,i,s,1,r,""),i}(this._tree,t,e)},t.prototype.get=function(t){var e=d(this._tree,t);return void 0!==e?e.get(s):void 0},t.prototype.has=function(t){var e=d(this._tree,t);return void 0!==e&&e.has(s)},t.prototype.keys=function(){return new o(this,r)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,p(this._tree,t).set(s,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=p(this._tree,t);return n.set(s,e(n.get(s))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var n=p(this._tree,t),i=n.get(s);return void 0===i&&n.set(s,i=e()),i},t.prototype.values=function(){return new o(this,a)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(i){var r,a,s=new t;try{for(var o=e(i),l=o.next();!l.done;l=o.next()){var h=n(l.value,2),u=h[0],c=h[1];s.set(u,c)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return s},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),c=function(t,n,i){var r,a;if(void 0===i&&(i=[]),0===n.length||null==t)return[t,i];try{for(var o=e(t.keys()),l=o.next();!l.done;l=o.next()){var h=l.value;if(h!==s&&n.startsWith(h))return i.push([t,h]),c(t.get(h),n.slice(h.length),i)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}return i.push([t,n]),c(void 0,"",i)},d=function(t,n){var i,r;if(0===n.length||null==t)return t;try{for(var a=e(t.keys()),o=a.next();!o.done;o=a.next()){var l=o.value;if(l!==s&&n.startsWith(l))return d(t.get(l),n.slice(l.length))}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},p=function(t,n){var i,r,a=n.length;t:for(var o=0;t&&o<a;){try{for(var l=(i=void 0,e(t.keys())),h=l.next();!h.done;h=l.next()){var u=h.value;if(u!==s&&n[o]===u[0]){for(var c=Math.min(a-o,u.length),d=1;d<c&&n[o+d]===u[d];)++d;var p=t.get(u);if(d===u.length)t=p;else{var f=new Map;f.set(u.slice(d),p),t.set(n.slice(o,o+d),f),t.delete(u),t=f}o+=d;continue t}}}catch(t){i={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}var g=new Map;return t.set(n.slice(o),g),g}return t},f=function(t,e){var i=n(c(t,e),2),r=i[0],a=i[1];if(void 0!==r)if(r.delete(s),0===r.size)g(a);else if(1===r.size){var o=n(r.entries().next().value,2),l=o[0],h=o[1];y(a,l,h)}},g=function(t){if(0!==t.length){var e=n(m(t),2),i=e[0],r=e[1];if(i.delete(r),0===i.size)g(t.slice(0,-1));else if(1===i.size){var a=n(i.entries().next().value,2),o=a[0],l=a[1];o!==s&&y(t.slice(0,-1),o,l)}}},y=function(t,e,i){if(0!==t.length){var r=n(m(t),2),a=r[0],s=r[1];a.set(s+e,i),a.delete(s)}},m=function(t){return t[t.length-1]},v="or",w=function(){function i(e){if(null==(null==e?void 0:e.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=t(t(t({},N),e),{searchOptions:t(t({},k),e.searchOptions||{})}),this._index=new u,this._documentCount=0,this._documentIds=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this.addFields(this._options.fields)}return i.prototype.add=function(t){var n,i,r,a,s=this._options,o=s.extractField,l=s.tokenize,h=s.processTerm,u=s.fields,c=s.idField,d=o(t,c);if(null==d)throw new Error('MiniSearch: document does not have ID field "'.concat(c,'"'));var p=this.addDocumentId(d);this.saveStoredFields(p,t);try{for(var f=e(u),g=f.next();!g.done;g=f.next()){var y=g.value,m=o(t,y);if(null!=m){var v=l(m.toString(),y),w=this._fieldIds[y],_=new Set(v).size;this.addFieldLength(p,w,this._documentCount-1,_);try{for(var M=(r=void 0,e(v)),b=M.next();!b.done;b=M.next()){var x=h(b.value,y);x&&this.addTerm(w,p,x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(a=M.return)&&a.call(M)}finally{if(r)throw r.error}}}}}catch(t){n={error:t}}finally{try{g&&!g.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}},i.prototype.addAll=function(t){var n,i;try{for(var r=e(t),a=r.next();!a.done;a=r.next()){var s=a.value;this.add(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}},i.prototype.addAllAsync=function(t,e){var n=this;void 0===e&&(e={});var i=e.chunkSize,r=void 0===i?10:i,a={chunk:[],promise:Promise.resolve()},s=t.reduce((function(t,e,i){var a=t.chunk,s=t.promise;return a.push(e),(i+1)%r==0?{chunk:[],promise:s.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return n.addAll(a)}))}:{chunk:a,promise:s}}),a),o=s.chunk;return s.promise.then((function(){return n.addAll(o)}))},i.prototype.remove=function(t){var i,r,a,s,o,l,h=this._options,u=h.tokenize,c=h.processTerm,d=h.extractField,p=h.fields,f=h.idField,g=d(t,f);if(null==g)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));try{for(var y=e(this._documentIds),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),w=v[0];if(g===v[1]){try{for(var _=(a=void 0,e(p)),M=_.next();!M.done;M=_.next()){var b=M.value,x=d(t,b);if(null!=x){var N=u(x.toString(),b),k=this._fieldIds[b],T=new Set(N).size;this.removeFieldLength(w,k,this._documentCount,T);try{for(var E=(o=void 0,e(N)),I=E.next();!I.done;I=E.next()){var O=c(I.value,b);O&&this.removeTerm(k,w,O)}}catch(t){o={error:t}}finally{try{I&&!I.done&&(l=E.return)&&l.call(E)}finally{if(o)throw o.error}}}}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}return this._storedFields.delete(w),this._documentIds.delete(w),this._fieldLength.delete(w),void(this._documentCount-=1)}}}catch(t){i={error:t}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(i)throw i.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(g,": it is not in the index"))},i.prototype.removeAll=function(t){var n,i;if(t)try{for(var r=e(t),a=r.next();!a.done;a=r.next()){var s=a.value;this.remove(s)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new u,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},i.prototype.search=function(t,i){var r,a;void 0===i&&(i={});var s=this.executeQuery(t,i),o=[];try{for(var l=e(s),h=l.next();!h.done;h=l.next()){var u=n(h.value,2),c=u[0],d=u[1],p=d.score,f=d.terms,g=d.match,y=f.length,m={id:this._documentIds.get(c),score:p*y,terms:Object.keys(g),match:g};Object.assign(m,this._storedFields.get(c)),(null==i.filter||i.filter(m))&&o.push(m)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}return o.sort(O),o},i.prototype.autoSuggest=function(i,r){var a,s,o,l;void 0===r&&(r={}),r=t(t({},T),r);var h=new Map;try{for(var u=e(this.search(i,r)),c=u.next();!c.done;c=u.next()){var d=c.value,p=d.score,f=(M=d.terms).join(" ");null!=(w=h.get(f))?(w.score+=p,w.count+=1):h.set(f,{score:p,terms:M,count:1})}}catch(t){a={error:t}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}var g=[];try{for(var y=e(h),m=y.next();!m.done;m=y.next()){var v=n(m.value,2),w=v[0],_=v[1],M=(p=_.score,_.terms),b=_.count;g.push({suggestion:w,terms:M,score:p/b})}}catch(t){o={error:t}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(o)throw o.error}}return g.sort(O),g},Object.defineProperty(i.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),i.loadJSON=function(t,e){if(null==e)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return i.loadJS(JSON.parse(t),e)},i.getDefault=function(t){if(N.hasOwnProperty(t))return _(N,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},i.loadJS=function(t,r){var a,s,o,l,h=t.index,c=t.documentCount,d=t.nextId,p=t.documentIds,f=t.fieldIds,g=t.fieldLength,y=t.averageFieldLength,m=t.storedFields,v=t.serializationVersion;if(1!==v&&2!==v)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new i(r);w._documentCount=c,w._nextId=d,w._documentIds=A(p),w._fieldIds=f,w._fieldLength=A(g),w._avgFieldLength=y,w._storedFields=A(m),w._index=new u;try{for(var _=e(h),M=_.next();!M.done;M=_.next()){var b=n(M.value,2),x=b[0],N=b[1],k=new Map;try{for(var T=(o=void 0,e(Object.keys(N))),E=T.next();!E.done;E=T.next()){var I=E.value,O=N[I];1===v&&(O=O.ds),k.set(parseInt(I,10),A(O))}}catch(t){o={error:t}}finally{try{E&&!E.done&&(l=T.return)&&l.call(T)}finally{if(o)throw o.error}}w._index.set(x,k)}}catch(t){a={error:t}}finally{try{M&&!M.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}return w},i.prototype.executeQuery=function(e,n){var i=this;if(void 0===n&&(n={}),"string"!=typeof e){var r=t(t(t({},n),e),{queries:void 0}),a=e.queries.map((function(t){return i.executeQuery(t,r)}));return this.combineResults(a,e.combineWith)}var s=this._options,o=s.tokenize,l=s.processTerm,h=s.searchOptions,u=t(t({tokenize:o,processTerm:l},h),n),c=u.tokenize,d=u.processTerm,p=c(e).map((function(t){return d(t)})).filter((function(t){return!!t})).map(x(u)).map((function(t){return i.executeQuerySpec(t,u)}));return this.combineResults(p,u.combineWith)},i.prototype.executeQuerySpec=function(i,r){var a,s,o,l,h,u,c=t(t({},this._options.searchOptions),r),d=(c.fields||this._options.fields).reduce((function(e,n){var i;return t(t({},e),((i={})[n]=_(e,n)||1,i))}),c.boost||{}),p=c.boostDocument,f=c.weights,g=c.maxFuzzy,y=t(t({},k.weights),f),m=y.fuzzy,v=y.prefix,w=this._index.get(i.term),M=this.termResults(i.term,i.term,1,w,d,p);if(i.prefix&&(h=this._index.atPrefix(i.term)),i.fuzzy){var b=!0===i.fuzzy?.2:i.fuzzy,x=b<1?Math.min(g,Math.round(i.term.length*b)):b;x&&(u=this._index.fuzzyGet(i.term,x))}if(h)try{for(var N=e(h),T=N.next();!T.done;T=N.next()){var E=n(T.value,2),I=E[0],O=E[1];if(B=I.length-i.term.length){null==u||u.delete(I);var F=v*I.length/(I.length+.3*B);this.termResults(i.term,I,F,O,d,p,M)}}}catch(t){a={error:t}}finally{try{T&&!T.done&&(s=N.return)&&s.call(N)}finally{if(a)throw a.error}}if(u)try{for(var A=e(u.keys()),S=A.next();!S.done;S=A.next()){I=S.value;var B,R=n(u.get(I),2),C=R[0];(B=R[1])&&(F=m*I.length/(I.length+B),this.termResults(i.term,I,F,C,d,p,M))}}catch(t){o={error:t}}finally{try{S&&!S.done&&(l=A.return)&&l.call(A)}finally{if(o)throw o.error}}return M},i.prototype.combineResults=function(t,e){if(void 0===e&&(e=v),0===t.length)return new Map;var n=e.toLowerCase();return t.reduce(M[n])||new Map},i.prototype.toJSON=function(){var t,i,r,a,s=[];try{for(var o=e(this._index),l=o.next();!l.done;l=o.next()){var h=n(l.value,2),u=h[0],c=h[1],d={};try{for(var p=(r=void 0,e(c)),f=p.next();!f.done;f=p.next()){var g=n(f.value,2),y=g[0],m=g[1];d[y]=Object.fromEntries(m)}}catch(t){r={error:t}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}s.push([u,d])}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:s,serializationVersion:2}},i.prototype.termResults=function(t,n,i,r,a,s,o){var l,h,u,c,d;if(void 0===o&&(o=new Map),null==r)return o;try{for(var p=e(Object.keys(a)),f=p.next();!f.done;f=p.next()){var g=f.value,y=a[g],m=this._fieldIds[g],v=r.get(m);if(null!=v){var w=v.size,M=this._avgFieldLength[m];try{for(var x=(u=void 0,e(v.keys())),N=x.next();!N.done;N=x.next()){var k=N.value,T=s?s(this._documentIds.get(k),n):1;if(T){var I=v.get(k),O=this._fieldLength.get(k)[m],F=i*y*T*b(I,w,this._documentCount,O,M),A=o.get(k);if(A){A.score+=F,E(A.terms,t);var S=_(A.match,n);S?S.push(g):A.match[n]=[g]}else o.set(k,{score:F,terms:[t],match:(d={},d[n]=[g],d)})}}}catch(t){u={error:t}}finally{try{N&&!N.done&&(c=x.return)&&c.call(x)}finally{if(u)throw u.error}}}}}catch(t){l={error:t}}finally{try{f&&!f.done&&(h=p.return)&&h.call(p)}finally{if(l)throw l.error}}return o},i.prototype.addTerm=function(t,e,n){var i=this._index.fetch(n,F),r=i.get(t);if(null==r)(r=new Map).set(e,1),i.set(t,r);else{var a=r.get(e);r.set(e,(a||0)+1)}},i.prototype.removeTerm=function(t,e,n){if(this._index.has(n)){var i=this._index.fetch(n,F),r=i.get(t);null==r||null==r.get(e)?this.warnDocumentChanged(e,t,n):r.get(e)<=1?r.size<=1?i.delete(t):r.delete(e):r.set(e,r.get(e)-1),0===this._index.get(n).size&&this._index.delete(n)}else this.warnDocumentChanged(e,t,n)},i.prototype.warnDocumentChanged=function(t,n,i){var r,a;if(null!=console&&null!=console.warn)try{for(var s=e(Object.keys(this._fieldIds)),o=s.next();!o.done;o=s.next()){var l=o.value;if(this._fieldIds[l]===n)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(i,'" was not present in field "').concat(l,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}},i.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},i.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},i.prototype.addFieldLength=function(t,e,n,i){var r=this._fieldLength.get(t);null==r&&this._fieldLength.set(t,r=[]),r[e]=i;var a=(this._avgFieldLength[e]||0)*n+i;this._avgFieldLength[e]=a/(n+1)},i.prototype.removeFieldLength=function(t,e,n,i){var r=this._avgFieldLength[e]*n-i;this._avgFieldLength[e]=r/(n-1)},i.prototype.saveStoredFields=function(t,n){var i,r,a=this._options,s=a.storeFields,o=a.extractField;if(null!=s&&0!==s.length){var l=this._storedFields.get(t);null==l&&this._storedFields.set(t,l={});try{for(var h=e(s),u=h.next();!u.done;u=h.next()){var c=u.value,d=o(n,c);void 0!==d&&(l[c]=d)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(r=h.return)&&r.call(h)}finally{if(i)throw i.error}}}},i}(),_=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},M=((i={}).or=function(t,n){var i,r;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value,l=t.get(o);if(null==l)t.set(o,n.get(o));else{var h=n.get(o),u=h.score,c=h.terms,d=h.match;l.score=l.score+u,l.match=Object.assign(l.match,d),I(l.terms,c)}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return t},i.and=function(t,n){var i,r,a=new Map;try{for(var s=e(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,h=t.get(l);if(null!=h){var u=n.get(l),c=u.score,d=u.terms,p=u.match;I(h.terms,d),a.set(l,{score:h.score+c,terms:h.terms,match:Object.assign(h.match,p)})}}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a},i.and_not=function(t,n){var i,r;try{for(var a=e(n.keys()),s=a.next();!s.done;s=a.next()){var o=s.value;t.delete(o)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return t},i),b=function(t,e,n,i,r){return Math.log(1+(n-e+.5)/(e+.5))*(.5+2.2*t/(t+1.2*(1-.7+.7*i/r)))},x=function(t){return function(e,n,i){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,n,i):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,n,i):!0===t.prefix}}},N={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(S)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},k={combineWith:v,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},T={prefix:function(t,e,n){return e===n.length-1}},E=function(t,e){t.includes(e)||t.push(e)},I=function(t,n){var i,r;try{for(var a=e(n),s=a.next();!s.done;s=a.next()){var o=s.value;t.includes(o)||t.push(o)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},O=function(t,e){var n=t.score;return e.score-n},F=function(){return new Map},A=function(t){var n,i,r=new Map;try{for(var a=e(Object.keys(t)),s=a.next();!s.done;s=a.next()){var o=s.value;r.set(parseInt(o,10),t[o])}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return r},S=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;return w},"object"==typeof t&&void 0!==e?e.exports=i():"function"==typeof define&&define.amd?define(i):(n="undefined"!=typeof globalThis?globalThis:n||self).MiniSearch=i()})),io={};ns(io,{Mappedin:()=>wt,MappedinDestinationSet:()=>Ot,OfflineSearch:()=>Ha,getVenue:()=>ji,getVenueBundle:()=>xi,initialize:()=>no}),module.exports=is(io),T(),T();var Ur=un(Ai(),1);T(),T(),T();var Fi=un(Si(),1);T();var Xn=class{constructor({origin:t,destination:e,vortex:n,elevationDelta:i=0,distance:r=0,angle:a=0}){let s,o;if(d(this,"origin"),d(this,"destination"),d(this,"vortex"),d(this,"distance"),d(this,"angle"),d(this,"weight"),this.origin=t,this.destination=e,this.vortex=n,this.distance=r,this.angle=a,n?(this.distance=0,this.angle=0,s=void 0!==n.weight&&n.weight>0?n.weight:"elevator"===n.type?2e3:1e3,o=n.multiplier&&n.multiplier>=1?n.multiplier:1,this.weight=i*o+s):(s=e.weight&&e.weight>=0?e.weight:0,o=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*o+s),isNaN(this.angle))throw new Error("nan angle")}},dn=Xn;T();var Kn="mi-debug",ss={loggingEnabled(){var t;return"development"===F.env.NODE_ENV||"dev"===F.env.NODE_ENV||"test"===F.env.NODE_ENV||"true"===(null==(t=globalThis.sessionStorage)?void 0:t.getItem(Kn))},log(...t){this.loggingEnabled()&&console.log("[MappedInJS]",...t)},warn(...t){this.loggingEnabled()&&console.warn("[MappedInJS]",...t)},error(...t){this.loggingEnabled()&&console.error("[MappedInJS]",...t)},assert(...t){this.loggingEnabled()&&console.assert(...t)},time(t){this.loggingEnabled()&&console.time(t)},timeEnd(t){this.loggingEnabled()&&console.timeEnd(t)}},R=ss;function os(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],i=(0,Fi.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:n.target.x,longitude:n.target.y}),r=e.control.x-n.control.x,a=e.control.y-n.control.y;return Math.sqrt(r*r+a*a)/i}catch(t){return R.error(t),1}}function ls(t,e){let n=t.x-e.x,i=t.y-e.y;return(Math.atan2(i,n)+2.5*Math.PI)%(2*Math.PI)}var Zn=class{constructor({nodes:t,vortexes:e,maps:n,showVortexNames:i=!1}){d(this,"edges"),d(this,"nodesById"),d(this,"mapsById"),this.edges={},this.mapsById=n.map((t=>pe(ee({},t),{_scale:os(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>pe(ee({},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 a=e.map((t=>pe(ee({},t),{name:i?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 dn({angle:ls(t,n),destination:n,distance:this.getDistance(t,n),origin:t})}))})),a.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 i=e;for(;i<t.nodes.length;){let e=this.nodesById[t.nodes[i]];if(i++,null==e)continue;let r=this.mapsById[n.map].elevation||0,a=this.mapsById[e.map].elevation||0,s=Math.abs(r-a);this.edges[n.id].push(new dn({destination:e,elevationDelta:s,origin:n,vortex:t})),this.edges[e.id].push(new dn({destination:n,elevationDelta:s,origin:e,vortex:t}))}}}))}aStar(t,e,n){let i=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===i.length||0===r.length)return[];let a=[],s={},o={};for(i.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);a.push({origin:t,priority:e}),s[t.id]=null,o[t.id]=0})),a.sort(((t,e)=>t.priority-e.priority));a.length>0;){let t=a[0];if(r.includes(t.origin)){let e=[],n=s[t.origin.id];for(;null!=n;){e.push(n);let t=s[n.origin.id];n=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let i=e.vortex&&!1===e.vortex.accessible;if(n&&(i||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=o[t.origin.id]+e.weight;if(null==o[e.destination.id]||l<o[e.destination.id]){o[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,r);a.push({origin:e.destination,priority:t}),s[e.destination.id]=e}}a.splice(0,1),a.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let n,i=t.x-e.x,r=t.y-e.y,a=i*i+r*r;return n=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(a)/n}getShortestEuclideanDistance(t,e){return e.reduce(((e,n)=>{let i=this.getDistance(t,n);return Math.min(e,i)}),Number.MAX_VALUE)}},Qn=Zn;function us(t){switch(t){case"down":case"up":return`${t} `;default:return""}}T(),T();var ei=class{constructor({origin:t,action:e,distance:n,atLocation:i,instruction:r}){d(this,"node"),d(this,"instruction"),d(this,"action"),d(this,"atLocation"),d(this,"type"),d(this,"distance",0),this.node=t,this.action=e,this.distance=n||0,this.atLocation=i,this.instruction="",r?this.instruction=r:(null!=e&&"Departure"===e.type?this.instruction=null!=i?`Depart from ${i.name}`:"Depart from current location":null!=e&&"Arrival"===e.type?this.instruction=null!=i?`Arrive at ${i.name}`:"Arrive at destination":null!=e&&"TakeVortex"===e.type?this.instruction=`Take ${i&&i.name} ${us(e.direction)}to ${e.toMap.name}`:null!=e&&"ExitVortex"===e.type?this.instruction=`Exit ${i&&i.name} at ${e.toMap.name}`:null!=e&&"Right"===e.bearing?this.instruction="Turn right":null!=e&&"SlightRight"===e.bearing?this.instruction="Turn slightly right":null!=e&&"Straight"===e.bearing?this.instruction="Head straight":null!=e&&"SlightLeft"===e.bearing?this.instruction="Turn slightly left":null!=e&&"Left"===e.bearing&&(this.instruction="Turn left"),null!=e&&"Turn"===e.type&&i&&(this.instruction+=` at ${i.name}`))}},yt=ei,pn=.1*Math.PI;function hn(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var ti=class{constructor({locations:t,nodes:e,vortexes:n,maps:i,showVortexNames:r}){d(this,"graph"),d(this,"locationsByNodeId"),this.graph=new Qn({maps:i,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 i=0,r=0,a=t;for(;Math.abs(i)<e&&r<n;){let t=this.graph.edges[a.destination.id],s=null,o=0;for(let e of t)if(e.distance>0)if(null!=s){let t=-hn(a.angle,e.angle);Math.abs(t)<Math.abs(o)&&(s=e,o=t)}else s=e,o=-hn(a.angle,e.angle);if(null==s)return null;{if(Math.abs(o)>=e||(i+=o,r+=s.distance,Math.abs(i)>=e||r>n))return null;let t=this.locationsByNodeId[s.destination.id];if(null!=t)return t;a=s}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:n,departFrom:i,arriveAt:r}){let a=this.graph.aStar(t,e,n);if(0===a.length)return{distance:0,instructions:[new yt({distance:0,instruction:"No Valid Path Available"})],path:[]};let s=0,o=new Array(a.length+1);for(let t=0;t<a.length;t++)o[t]=a[t].origin;o[a.length]=a[a.length-1].destination;let l=[],h=null,u=null,c=0,d=0;for(let t=0;t<a.length;t++){let e=a[t],n=e.origin,o=e.destination;if(s+=e.distance,c+=(null==u?void 0:u.distance)||0,0===t&&l.push(new yt({action:{type:"Departure"},atLocation:i,distance:0,origin:n})),null!=e.vortex){let t=this.graph.mapsById[n.map],i=this.graph.mapsById[o.map],r="none";if(null!=t.elevation&&null!=i.elevation){let e=t.elevation-i.elevation;e>0?r="down":e<0&&(r="up")}l.push(new yt({action:{direction:r,fromMap:t,toMap:i,type:"TakeVortex"},atLocation:e.vortex,distance:c,origin:n})),d+=c,c=0}else if(null!=h&&null!=u)if(null!=u.vortex){let t=this.graph.mapsById[h.map],e=this.graph.mapsById[u.destination.map];l.push(new yt({action:{fromMap:t,toMap:e,type:"ExitVortex"},atLocation:u.vortex,distance:c,origin:n})),d+=c,c=0}else{let t=this.graph.edges[n.id].filter((t=>t.destination!==h&&t.destination!==e.destination));if(t.length>0){let i=-hn(u.angle,e.angle),r=t.reduce(((t,n)=>{let i=-hn(e.angle,n.angle);return Math.min(t,Math.abs(i))}),Math.PI);if(Math.abs(i)>=pn||Math.abs(r)<=pn){let t;t=i<=-Math.PI/4?"Right":i<=-pn?"SlightRight":i<=pn?"Straight":i<=Math.PI/4?"SlightLeft":"Left";let e=this.locationsByNodeId[n.id];if(e||(e=this.getClosestLocationInRay(u,.5*Math.PI,10)),null!=e){let i=new yt({action:{bearing:t,referencePosition:"At",type:"Turn"},atLocation:e,distance:c,origin:n});i.type=t,l.push(i)}else l.push(new yt({action:{bearing:t,referencePosition:"At",type:"Turn"},distance:c,origin:n}));d+=c,c=0}}}t===a.length-1&&(l.push(new yt({action:{type:"Arrival"},atLocation:r,distance:s-d<0?0:s-d,origin:e.destination})),d+=c,c=0),h=n,u=e}let p=[],f=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:n}=e;n&&"TakeVortex"===n.type?(f=e.node,p.unshift(e)):n&&"Turn"===n.type&&null!=f?this.graph.getDistance(e.node,f)>5&&p.unshift(e):p.unshift(e)}return{distance:s,instructions:p,path:o}}},ai=ti;function Ci(t){let e=+this._x.call(null,t),n=+this._y.call(null,t);return Li(this.cover(e,n),e,n,t)}function Li(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,a,s,o,l,h,u,c,d,p=t._root,f={data:i},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!p)return t._root=f,t;for(;p.length;)if((h=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(s=(y+v)/2))?y=s:v=s,r=p,!(p=p[c=u<<1|h]))return r[c]=f,t;if(o=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===o&&n===l)return f.next=p,r?r[c]=f:t._root=f,t;do{r=r?r[c]=new Array(4):t._root=new Array(4),(h=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(s=(y+v)/2))?y=s:v=s}while((c=u<<1|h)==(d=(l>=s)<<1|o>=a));return r[d]=p,r[c]=f,t}function Ri(t){var e,n,i,r,a=t.length,s=new Array(a),o=new Array(a),l=1/0,h=1/0,u=-1/0,c=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(r=+this._y.call(null,e))||(s[n]=i,o[n]=r,i<l&&(l=i),i>u&&(u=i),r<h&&(h=r),r>c&&(c=r));if(l>u||h>c)return this;for(this.cover(l,h).cover(u,c),n=0;n<a;++n)Li(this,s[n],o[n],t[n]);return this}function Bi(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,i=this._y0,r=this._x1,a=this._y1;if(isNaN(n))r=(n=Math.floor(t))+1,a=(i=Math.floor(e))+1;else{for(var s,o,l=r-n||1,h=this._root;n>t||t>=r||i>e||e>=a;)switch(o=(e<i)<<1|t<n,s=new Array(4),s[o]=h,h=s,l*=2,o){case 0:r=n+l,a=i+l;break;case 1:n=r-l,a=i+l;break;case 2:r=n+l,i=a-l;break;case 3:n=r-l,i=a-l}this._root&&this._root.length&&(this._root=h)}return this._x0=n,this._y0=i,this._x1=r,this._y1=a,this}function Di(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function Gi(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Oe(t,e,n,i,r){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=r}function qi(t,e,n){var i,r,a,s,o,l,h,u=this._x0,c=this._y0,d=this._x1,p=this._y1,f=[],g=this._root;for(g&&f.push(new Oe(g,u,c,d,p)),null==n?n=1/0:(u=t-n,c=e-n,d=t+n,p=e+n,n*=n);l=f.pop();)if(!(!(g=l.node)||(r=l.x0)>d||(a=l.y0)>p||(s=l.x1)<u||(o=l.y1)<c))if(g.length){var y=(r+s)/2,m=(a+o)/2;f.push(new Oe(g[3],y,m,s,o),new Oe(g[2],r,m,y,o),new Oe(g[1],y,a,s,m),new Oe(g[0],r,a,y,m)),(h=(e>=m)<<1|t>=y)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-h],f[f.length-1-h]=l)}else{var v=t-+this._x.call(null,g.data),w=e-+this._y.call(null,g.data),_=v*v+w*w;if(_<n){var M=Math.sqrt(n=_);u=t-M,c=e-M,d=t+M,p=e+M,i=g.data}}return i}function Vi(t){if(isNaN(a=+this._x.call(null,t))||isNaN(s=+this._y.call(null,t)))return this;var e,n,i,r,a,s,o,l,h,u,c,d,p=this._root,f=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((h=a>=(o=(f+y)/2))?f=o:y=o,(u=s>=(l=(g+m)/2))?g=l:m=l,e=p,!(p=p[c=u<<1|h]))return this;if(!p.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(n=e,d=c)}for(;p.data!==t;)if(i=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,i?(r?i.next=r:delete i.next,this):e?(r?e[c]=r:delete e[c],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[d]=p:this._root=p),this):(this._root=r,this)}function Ui(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function $i(){return this._root}function Wi(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function Hi(t){var e,n,i,r,a,s,o=[],l=this._root;for(l&&o.push(new Oe(l,this._x0,this._y0,this._x1,this._y1));e=o.pop();)if(!t(l=e.node,i=e.x0,r=e.y0,a=e.x1,s=e.y1)&&l.length){var h=(i+a)/2,u=(r+s)/2;(n=l[3])&&o.push(new Oe(n,h,u,a,s)),(n=l[2])&&o.push(new Oe(n,i,u,h,s)),(n=l[1])&&o.push(new Oe(n,h,r,a,u)),(n=l[0])&&o.push(new Oe(n,i,r,h,u))}return this}function Yi(t){var e,n=[],i=[];for(this._root&&n.push(new Oe(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var r=e.node;if(r.length){var a,s=e.x0,o=e.y0,l=e.x1,h=e.y1,u=(s+l)/2,c=(o+h)/2;(a=r[0])&&n.push(new Oe(a,s,o,u,c)),(a=r[1])&&n.push(new Oe(a,u,o,l,c)),(a=r[2])&&n.push(new Oe(a,s,c,u,h)),(a=r[3])&&n.push(new Oe(a,u,c,l,h))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function Ji(t){return t[0]}function Xi(t){return arguments.length?(this._x=t,this):this._x}function Ki(t){return t[1]}function Zi(t){return arguments.length?(this._y=t,this):this._y}function oa(t,e,n){var i=new ni(null==e?Ji:e,null==n?Ki:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function ni(t,e,n,i,r,a){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=r,this._y1=a,this._root=void 0}function Qi(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T(),T();var Ce=oa.prototype=ni.prototype;Ce.copy=function(){var t,e,n=new ni(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Qi(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var r=0;r<4;++r)(e=i.source[r])&&(e.length?t.push({source:e,target:i.target[r]=new Array(4)}):i.target[r]=Qi(e));return n},Ce.add=Ci,Ce.addAll=Ri,Ce.cover=Bi,Ce.data=Di,Ce.extent=Gi,Ce.find=qi,Ce.remove=Vi,Ce.removeAll=Ui,Ce.root=$i,Ce.size=Wi,Ce.visit=Hi,Ce.visitAfter=Yi,Ce.x=Xi,Ce.y=Zi;var He,Te,It=class{constructor(t){z(this,He,void 0),d(this,"categories"),d(this,"locations"),d(this,"vortexes"),d(this,"maps"),d(this,"nodes"),d(this,"polygons"),d(this,"events"),d(this,"mapGroups"),d(this,"locationStates"),d(this,"rankings"),z(this,Te,{}),N(this,He,t)}get polygonsByMapId(){if(l(this,Te).polygonsByMapId)return l(this,Te).polygonsByMapId;let t,e={};for(let n=0,i=l(this,He).polygons.length;n<i;++n)t=l(this,He).polygons[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return l(this,Te).polygonsByMapId=n,l(this,Te).polygonsByMapId}get nodesByMapId(){if(l(this,Te).nodesByMapId)return l(this,Te).nodesByMapId;let t,e={};for(let n=0,i=l(this,He).nodes.length;n<i;++n)t=l(this,He).nodes[n],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return l(this,Te).nodesByMapId=n,l(this,Te).nodesByMapId}findNearestNodeOnMap(t,e){var n;if(l(this,Te).nodeTreesByMap||(l(this,Te).nodeTreesByMap=new Map),!l(this,Te).nodeTreesByMap.has(t)){let e=null!=(n=this.nodesByMapId.get(t))?n:[],i=oa();i.x((t=>t.x)),i.y((t=>t.y)),i.addAll(e),l(this,Te).nodeTreesByMap.set(t,i)}return l(this,Te).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(l(this,Te).locationsByMapId)return l(this,Te).locationsByMapId;let t,e={};for(let n=0,i=l(this,He).locations.length;n<i;++n){t=l(this,He).locations[n];for(let n=0,i=t.polygons.length;n<i;++n)e[t.polygons[n].map.id]||(e[t.polygons[n].map.id]=[]),e[t.polygons[n].map.id].push(t)}let n=Object.entries(e).reduce(((t,[e,n])=>(t.set(e,n),t)),new Map);return l(this,Te).locationsByMapId=n,l(this,Te).locationsByMapId}static create(t){return It.instances.has(t)||It.instances.set(t,new It(t)),It.instances.get(t)}static clear(){It.instances.clear()}},mn=It;He=new WeakMap,Te=new WeakMap,d(mn,"instances",new Map);var De=mn;T(),T(),T(),T();var er=" ",Pe=class{static get separator(){return er}static set separator(t){er=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 i=null,r=null,a=null,s=null;switch(e){default:case"d":case"deg":r=t.toFixed(n),r<100&&(r="0"+r),r<10&&(r="0"+r),i=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),a=(60*t%60).toFixed(n),60==a&&(a=(0).toFixed(n),r++),r=("000"+r).slice(-3),a<10&&(a="0"+a),i=r+"°"+Pe.separator+a+"′";break;case"dms":case"deg+min+sec":r=Math.floor(t),a=Math.floor(3600*t/60)%60,s=(3600*t%60).toFixed(n),60==s&&(s=(0).toFixed(n),a++),60==a&&(a=0,r++),r=("000"+r).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),i=r+"°"+Pe.separator+a+"′"+Pe.separator+s+"″"}return i}static toLat(t,e,n){let i=Pe.toDms(Pe.wrap90(t),e,n);return null===i?"–":i.slice(1)+Pe.separator+(t<0?"S":"N")}static toLon(t,e,n){let i=Pe.toDms(Pe.wrap180(t),e,n);return null===i?"–":i+Pe.separator+(t<0?"W":"E")}static toBrng(t,e,n){let i=Pe.toDms(Pe.wrap360(t),e,n);return null===i?"–":i.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=Pe.wrap360(t);let n=4*Wn(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 ae=Pe,ke=Math.PI,B=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=ae.wrap90(Number(t)),this._lon=ae.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?ae.wrap90(ae.parse(t)):ae.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?ae.wrap90(ae.parse(t)):ae.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)?ae.wrap180(ae.parse(t)):ae.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?ae.wrap180(ae.parse(t)):ae.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?ae.wrap180(ae.parse(t)):ae.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=ae.wrap90(ae.parse(e)),n=ae.wrap180(ae.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=ae.wrap90(ae.parse(e)),n=ae.wrap180(ae.parse(n)),isNaN(e)||isNaN(n)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let i=t[0];if("Point"==i.type&&Array.isArray(i.coordinates)?[n,e]=i.coordinates:(null!=i.latitude&&(e=i.latitude),null!=i.lat&&(e=i.lat),null!=i.longitude&&(n=i.longitude),null!=i.lng&&(n=i.lng),null!=i.lon&&(n=i.lon),e=ae.wrap90(ae.parse(e)),n=ae.wrap180(ae.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 B(e,n)}distanceTo(t,e=6371e3){if(t instanceof B||(t=B.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let n=e,i=this.lat.toRadians(),r=this.lon.toRadians(),a=t.lat.toRadians(),s=a-i,o=t.lon.toRadians()-r,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(i)*Math.cos(a)*Math.sin(o/2)*Math.sin(o/2);return n*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof B||(t=B.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(i),a=Math.sin(i)*Math.cos(n),s=Math.atan2(a,r).toDegrees();return ae.wrap360(s)}finalBearingTo(t){t instanceof B||(t=B.parse(t));let e=t.initialBearingTo(this)+180;return ae.wrap360(e)}midpointTo(t){t instanceof B||(t=B.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),a=Math.cos(e),s=0,o=Math.sin(e),l={x:a+Math.cos(i)*Math.cos(r),y:s+Math.cos(i)*Math.sin(r),z:o+Math.sin(i)},h=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),u=n+Math.atan2(l.y,l.x),c=h.toDegrees(),d=u.toDegrees();return new B(c,d)}intermediatePointTo(t,e){if(t instanceof B||(t=B.parse(t)),this.equals(t))return new B(this.lat,this.lon);let n=this.lat.toRadians(),i=this.lon.toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),s=r-n,o=a-i,l=Math.sin(s/2)*Math.sin(s/2)+Math.cos(n)*Math.cos(r)*Math.sin(o/2)*Math.sin(o/2),h=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),u=Math.sin((1-e)*h)/Math.sin(h),c=Math.sin(e*h)/Math.sin(h),d=u*Math.cos(n)*Math.cos(i)+c*Math.cos(r)*Math.cos(a),p=u*Math.cos(n)*Math.sin(i)+c*Math.cos(r)*Math.sin(a),f=u*Math.sin(n)+c*Math.sin(r),g=Math.atan2(f,Math.sqrt(d*d+p*p)),y=Math.atan2(p,d),m=g.toDegrees(),v=y.toDegrees();return new B(m,v)}destinationPoint(t,e,n=6371e3){let i=t/n,r=Number(e).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),o=Math.sin(a)*Math.cos(i)+Math.cos(a)*Math.sin(i)*Math.cos(r),l=Math.asin(o),h=Math.sin(r)*Math.sin(i)*Math.cos(a),u=Math.cos(i)-Math.sin(a)*o,c=s+Math.atan2(h,u),d=l.toDegrees(),p=c.toDegrees();return new B(d,p)}static intersection(t,e,n,i){if(t instanceof B||(t=B.parse(t)),n instanceof B||(n=B.parse(n)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(i))throw new TypeError(`invalid brng2 ‘${i}’`);let r=t.lat.toRadians(),a=t.lon.toRadians(),s=n.lat.toRadians(),o=n.lon.toRadians(),l=Number(e).toRadians(),h=Number(i).toRadians(),u=s-r,c=o-a,d=2*Math.asin(Math.sqrt(Math.sin(u/2)*Math.sin(u/2)+Math.cos(r)*Math.cos(s)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new B(t.lat,t.lon);let p=(Math.sin(s)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),f=(Math.sin(r)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s)),g=Math.acos(Math.min(Math.max(p,-1),1)),y=Math.acos(Math.min(Math.max(f,-1),1)),m=l-(Math.sin(o-a)>0?g:2*ke-g),v=(Math.sin(o-a)>0?2*ke-y:y)-h;if(0==Math.sin(m)&&0==Math.sin(v)||Math.sin(m)*Math.sin(v)<0)return null;let w=-Math.cos(m)*Math.cos(v)+Math.sin(m)*Math.sin(v)*Math.cos(d),_=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(v),Math.cos(v)+Math.cos(m)*w),M=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(_)+Math.cos(r)*Math.sin(_)*Math.cos(l),-1),1)),b=a+Math.atan2(Math.sin(l)*Math.sin(_)*Math.cos(r),Math.cos(_)-Math.sin(r)*Math.sin(M)),x=M.toDegrees(),N=b.toDegrees();return new B(x,N)}crossTrackDistanceTo(t,e,n=6371e3){t instanceof B||(t=B.parse(t)),e instanceof B||(e=B.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(a-s))*i}alongTrackDistanceTo(t,e,n=6371e3){t instanceof B||(t=B.parse(t)),e instanceof B||(e=B.parse(e));let i=n;if(this.equals(t))return 0;let r=t.distanceTo(this,i)/i,a=t.initialBearingTo(this).toRadians(),s=t.initialBearingTo(e).toRadians(),o=Math.asin(Math.sin(r)*Math.sin(a-s));return Math.acos(Math.cos(r)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(s-a))*i}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 i=Number(n).toRadians(),r=t.lat.toRadians(),a=t.lon.toRadians(),s=e.lat.toRadians(),o=e.lon.toRadians()-a,l=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.sin(o),h=Math.sin(r)*Math.cos(s)*Math.cos(i)*Math.cos(o)-Math.cos(r)*Math.sin(s)*Math.cos(i),u=Math.cos(r)*Math.cos(s)*Math.sin(i)*Math.sin(o);if(u*u>l*l+h*h)return null;let c=Math.atan2(-h,l),d=Math.acos(u/Math.sqrt(l*l+h*h)),p=a+c+d,f=(a+c-d).toDegrees(),g=p.toDegrees();return{lon1:ae.wrap180(f),lon2:ae.wrap180(g)}}rhumbDistanceTo(t,e=6371e3){t instanceof B||(t=B.parse(t));let n=e,i=this.lat.toRadians(),r=t.lat.toRadians(),a=r-i,s=Math.abs(t.lon-this.lon).toRadians();Math.abs(s)>ke&&(s=s>0?-(2*ke-s):2*ke+s);let o=Math.log(Math.tan(r/2+ke/4)/Math.tan(i/2+ke/4)),l=Math.abs(o)>1e-11?a/o:Math.cos(i);return Math.sqrt(a*a+l*l*s*s)*n}rhumbBearingTo(t){if(t instanceof B||(t=B.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),n=t.lat.toRadians(),i=(t.lon-this.lon).toRadians();Math.abs(i)>ke&&(i=i>0?-(2*ke-i):2*ke+i);let r=Math.log(Math.tan(n/2+ke/4)/Math.tan(e/2+ke/4)),a=Math.atan2(i,r).toDegrees();return ae.wrap360(a)}rhumbDestinationPoint(t,e,n=6371e3){let i=this.lat.toRadians(),r=this.lon.toRadians(),a=Number(e).toRadians(),s=t/n,o=s*Math.cos(a),l=i+o;Math.abs(l)>ke/2&&(l=l>0?ke-l:-ke-l);let h=Math.log(Math.tan(l/2+ke/4)/Math.tan(i/2+ke/4)),u=Math.abs(h)>1e-11?o/h:Math.cos(i),c=r+s*Math.sin(a)/u,d=l.toDegrees(),p=c.toDegrees();return new B(d,p)}rhumbMidpointTo(t){t instanceof B||(t=B.parse(t));let e=this.lat.toRadians(),n=this.lon.toRadians(),i=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-n)>ke&&(n+=2*ke);let a=(e+i)/2,s=Math.tan(ke/4+e/2),o=Math.tan(ke/4+i/2),l=Math.tan(ke/4+a/2),h=((r-n)*Math.log(l)+n*Math.log(o)-r*Math.log(s))/Math.log(o/s);isFinite(h)||(h=(n+r)/2);let u=a.toDegrees(),c=h.toDegrees();return new B(u,c)}static areaOf(t,e=6371e3){let n=e,i=t[0].equals(t[t.length-1]);i||t.push(t[0]);let r=t.length-1,a=0;for(let e=0;e<r;e++){let n=t[e].lat.toRadians(),i=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();a+=2*Math.atan2(Math.tan(r/2)*(Math.tan(n/2)+Math.tan(i/2)),1+Math.tan(n/2)*Math.tan(i/2))}(function(t){let e=0,n=t[0].initialBearingTo(t[1]);for(let i=0;i<t.length-1;i++){let r=t[i].initialBearingTo(t[i+1]),a=t[i].finalBearingTo(t[i+1]);e+=(r-n+540)%360-180,e+=(a-r+540)%360-180,n=a}let i=t[0].initialBearingTo(t[1]);return e+=(i-n+540)%360-180,Math.abs(e)<90})(t)&&(a=Math.abs(a)-2*ke);let s=Math.abs(a*n*n);return i||t.pop(),s}equals(t){return t instanceof B||(t=B.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`${ae.toLat(this.lat,t,e)}, ${ae.toLon(this.lon,t,e)}`}};T(),T(),T();var Ot=class{constructor(t){d(this,"destinations",[]),this.destinations=t}};T();var la,rt,Ct=class{constructor(t,e){z(this,la,void 0),z(this,rt,void 0),d(this,"distance",0),d(this,"path",[]),d(this,"instructions",[]),N(this,rt,t),N(this,la,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,n,i,r,a,s,o,h,u,c,d,p;let f=pe(ee({},t),{action:ee({},t.action),atLocation:null!=(e=t.atLocation)&&e.id?null==(i=null==(n=l(this,rt))?void 0:n._vortexesById)?void 0:i[t.atLocation.id]:void 0,node:null!=(r=t.node)&&r.id?null==(s=null==(a=l(this,rt))?void 0:a._nodesById)?void 0:s[t.node.id]:void 0});return("TakeVortex"===(null==(o=f.action)?void 0:o.type)||"ExitVortex"===(null==(h=f.action)?void 0:h.type))&&(f.action.fromMap=null==(c=l(this,rt)._mapsById)?void 0:c[null==(u=f.action)?void 0:u.fromMap.id],f.action.toMap=null==(p=l(this,rt)._mapsById)?void 0:p[null==(d=f.action)?void 0:d.toMap.id]),f})),this.path=e.path.map((t=>{var e,n;return null==(n=null==(e=l(this,rt))?void 0:e._nodesById)?void 0:n[t.id]}))}toJSON(){return l(this,la)}};la=new WeakMap,rt=new WeakMap;var kt,st=class{constructor(t){z(this,kt,void 0),N(this,kt,t)}directionsTo(t,e){if(t instanceof Ot){let n=[],i=this;for(let r=0;r<t.destinations.length;r++){let a=t.destinations[r],s=ua(i),o=ua(a),h=l(this,kt).navigator.getDirections({originIds:s,destinationNodeIds:o,accessible:(null==e?void 0:e.accessible)||!1}),u=new Ct(l(this,kt),h);n.push(u),i=a}return n}{let n=ua(this),i=ua(t),r=l(this,kt).navigator.getDirections({originIds:n,destinationNodeIds:i,accessible:(null==e?void 0:e.accessible)||!1});return new Ct(l(this,kt),r)}}distanceTo(t,e){let n=this.directionsTo(t,e);return(null==n?void 0:n.distance)||0}};kt=new WeakMap;var ds=0,ps="9999-12-31T00:00:00.000Z";function hs(t,e,n=new Date){if(!t.states)return;let i=n||new Date,r=t.states.find((t=>{let e=new Date(t.start||ds),n=new Date(t.end||ps);return e<i&&n>i}));return r?e.find((t=>t.value===r.type)):void 0}var Ye,bt,Ge,da,pa,ha,ca=class extends st{constructor(t,e){super(t),z(this,Ye,void 0),z(this,bt,void 0),z(this,Ge,{}),d(this,"states"),d(this,"id",""),d(this,"name",""),d(this,"type",""),d(this,"description"),d(this,"sortOrder"),d(this,"logo"),d(this,"phone"),d(this,"social"),d(this,"color"),d(this,"shortName"),d(this,"detailsUrl"),d(this,"tags"),d(this,"externalId"),d(this,"showLabelWhenImagePresent"),d(this,"picture"),d(this,"operationHours"),d(this,"siblingGroups"),d(this,"gallery"),z(this,da,void 0),z(this,pa,[]),z(this,ha,void 0),N(this,Ye,t),N(this,bt,e);let n=Object.assign({},e);delete n.categories,Object.assign(this,n)}get polygons(){let t=l(this,Ge).polygons;if(void 0!==t)return t;let e=[],n=l(this,da),i=l(this,Ye)._polygonsById;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&r.geometry.visible&&e.push(r)}return l(this,Ge).polygons=e,e}set polygons(t){N(this,da,t)}get nodes(){let t=l(this,Ge).nodes;if(void 0!==t)return t;let e=[],n=l(this,pa),i=l(this,Ye)._nodesById;if(n)for(let t=0,r=n.length;t<r;++t){let r=i[n[t].node];null!=r&&e.push(r)}return l(this,Ge).nodes=e,e}set nodes(t){N(this,pa,t)}get parent(){let t=l(this,Ge).parent;if(void 0!==t)return t;let e,n=l(this,Ye)._locationsById,i=l(this,ha);return void 0!==i&&(e=n[i]),l(this,Ge).parent=e,e}set parent(t){N(this,ha,t)}get categories(){let t=l(this,Ge).categories;if(void 0!==t)return t;let e=[];return l(this,bt).categories.forEach((t=>{let n=l(this,Ye).getCollectionItemById("categories",t);n&&e.push(n)})),l(this,Ge).categories=e,e}get state(){return hs(this,l(this,Ye).locationStates)}clone(){return new ca(l(this,Ye),l(this,bt))}get nodeOperationHours(){let t=l(this,Ge).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=l(this,bt).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return l(this,Ge).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new ca(e,t)))}static fetch(t){return Z(this,null,(function*(){let e=t.options.things.locations.slice();t.options.things.categories&&Me(e,"categories"),t.options.things.nodes&&Me(e,"nodes"),t.options.things.polygons&&Me(e,"polygons"),t.options.things.locationStates&&Me(e,"states");let n={fields:e,venue:t.options.venue};try{let e=yield we(t.options,"location",n);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new ca(t,e)))}catch(t){return R.error("Fetch Locations:",t),[]}}))}toJSON(){let t=l(this,bt);return delete t.color,t}},ot=ca;Ye=new WeakMap,bt=new WeakMap,Ge=new WeakMap,da=new WeakMap,pa=new WeakMap,ha=new WeakMap,T();var vt,Lt,qe,ma,gn=class extends st{constructor(t,e){super(t),z(this,vt,void 0),z(this,Lt,void 0),z(this,qe,{}),d(this,"geometry"),d(this,"perspectives"),d(this,"image"),d(this,"holes"),d(this,"textures"),d(this,"material"),d(this,"label"),d(this,"id",""),d(this,"layer"),d(this,"layerId"),d(this,"name"),d(this,"externalId"),d(this,"vertexes"),d(this,"canvasBounds"),z(this,ma,void 0),N(this,vt,t),N(this,Lt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=l(this,qe).map;if(void 0!==t)return t;let e=l(this,vt).getCollectionItemById("maps",l(this,Lt).map);return l(this,qe).map=e,e}get locations(){var t,e;let n=l(this,qe).locations;if(void 0!==n)return n;let i=[],r=null!=(e=null==(t=De.instances.get(l(this,vt)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:a}=this;for(let t=0,e=r.length;t<e;++t){let e=r[t],n=e.polygons;if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t)if(n[t].id===a){i.push(e);break}}return l(this,qe).locations=i,i}get entrances(){let t=l(this,qe).entrances;if(void 0!==t)return t;let e=[],n=l(this,ma),i=l(this,vt)._nodesById;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;++t){let r=i[n[t].id];null!=r&&e.push(r)}return l(this,qe).entrances=e,e}return[]}set entrances(t){N(this,ma,t)}get rank(){let t=l(this,qe).rank;if(void 0!==t)return t;let{rankings:e}=l(this,vt);if(!e||!e.polygons)return null;let n=e.polygons.find((t=>t.polygonId===this.id));return n?(l(this,qe).rank={score:n.score,node:n.entranceNodeId},{score:n.score,node:n.entranceNodeId}):(l(this,qe).rank=null,null)}static hydrate(t,e){return t.map((t=>new gn(e,t)))}static fetch(t){return Z(this,null,(function*(){let e=t.options.things.polygons.slice();t.options.things.maps&&Me(e,"map"),t.options.things.nodes&&Me(e,"entrances");let n={fields:e,venue:t.options.venue};try{return(yield we(t.options,"polygon",n)).filter((t=>t.geometry.visible)).map((e=>new gn(t,e)))}catch(t){return R.error("Fetch Polygons:",t),[]}}))}toJSON(){return l(this,Lt)}},zt=gn;function ar(t){return/^[\da-f]{24}$/i.test(t)}function tr(t,e=!1){let n="";if(null!=t){let i="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,a=r.length;e<a;++e){let a=r[e],s=t[a];null!=s&&(n+=`${i+encodeURIComponent(a)}=${encodeURIComponent(s)}`,i="&")}}return n}function ms(t,e,n,i=!1){var r,a;return i?`${t.supplementaryUrl}${e}?venue=${n.venue||n.slug}`:null!=(r=t.baseUrl)&&r.includes("gateway")?`${t.baseUrl}${e}/${n.venue||n.slug}${tr(n,null==(a=t.baseUrl)?void 0:a.includes("gateway"))}`:t.baseUrl+e+tr(n)}function we(t,e,n,i=!1){return Z(this,null,(function*(){return ri(t,e,n,i,!0)}))}function ri(t,e,n,i=!1,r=!1){return Z(this,null,(function*(){let a=ms(t,e,n,i),s=yield si(t,a,i);if(!r&&Array.isArray(s)){if(1===s.length)return s[0];throw new Error("Invalid response object")}return s}))}function si(t,e,n=!1){return Z(this,null,(function*(){let i={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};n&&delete i.language,i.language&&(e+=`&lang=${encodeURIComponent(i.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),i.language&&(r["Accept-Language"]=i.language);let a={method:"GET",headers:r},s=yield ga()(e,a);if(!s.ok)throw new Error(`${s.status} ${s.statusText}`);return s.json()}))}function Me(t,e){t.indexOf(e)<0&&t.push(e)}function nr([t,e],[n,i]){let r=new B(t,e),a=new B(n,i);return r.distanceTo(a)}function ir(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let n=t.georeference[0],i=t.georeference[2],r=new B(n.target.x,n.target.y),a=new B(i.target.x,i.target.y),s=r.distanceTo(a),o=n.control.x-i.control.x,l=n.control.y-i.control.y;e=Math.sqrt(o*o+l*l)/s}catch(n){e=1,R.warn(n),R.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function ua(t){var e;return t instanceof zt?t.entrances.map((t=>t.id)):t instanceof ot?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}function rr(t){return Z(this,null,(function*(){let e={},{maps:n,images:i,scenes:r,polygons:a}=t;if(null!=i)try{let t=Object.keys(i).map((t=>fetch(`data:image/png;base64,${i[t]}`).then((t=>t.blob())).then((n=>{e[t]=n})).catch((t=>{R.error(t)}))));yield Promise.all(t)}catch(t){R.error(t)}return n.forEach((t=>{var n;(null!=(n=t.scene)&&n.polygons||r[t.id])&&(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=i&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var n,i;if(null!=(n=null==t?void 0:t.image)&&n.url&&null!=(i=null==t?void 0:t.image)&&i.url){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}}))))})),null!=i&&a.forEach((t=>{var n;if(null!=(n=null==t?void 0:t.image)&&n.url){let n=t.image.url.split("/"),i=e[n[n.length-1]];i&&(t.image.url=i)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}))}function oi(t,e,n){let i;return function(){let r=this,a=arguments,s=function(){i=null,n||t.apply(r,a)},o=n&&!i;clearTimeout(i),i=setTimeout(s,e),o&&t.apply(r,a)}}vt=new WeakMap,Lt=new WeakMap,qe=new WeakMap,ma=new WeakMap;var fa,ya,ka,fn=class{constructor(t,e){z(this,fa,void 0),z(this,ya,{}),z(this,ka,void 0),d(this,"name"),d(this,"externalId"),d(this,"parents"),d(this,"id"),d(this,"icon"),this.id=e.id,N(this,ka,e),N(this,fa,t),Object.assign(this,e)}get locations(){var t;let e=l(this,ya).locations;if(void 0!==e)return e;let n=[],{locations:i}=l(this,fa),{id:r}=this;for(let e=0,a=i.length;e<a;++e){let a=i[e],s=a.categories;if(Array.isArray(s))for(let e=0,i=s.length;e<i;++e)if((null==(t=s[e])?void 0:t.id)===r){n.push(a);break}}return l(this,ya).locations=n,n}static hydrate(t,e){return t.map((t=>new fn(e,t)))}static fetch(t){return Z(this,null,(function*(){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(yield we(t.options,"category",e)).map((e=>new fn(t,e)))}catch(t){return R.error("Fetch Categories:",t),[]}}))}toJSON(){return l(this,ka)}},Nt=fn;fa=new WeakMap,ya=new WeakMap,ka=new WeakMap,T();var va,Rt,Ma,yn=class{constructor(t,e){z(this,va,void 0),z(this,Rt,void 0),z(this,Ma,{}),d(this,"id",""),d(this,"type",""),d(this,"name",""),d(this,"description"),d(this,"image"),d(this,"startDate"),d(this,"endDate"),d(this,"showDate"),N(this,Rt,e),N(this,va,t),Object.assign(this,e)}location(){let t=l(this,Ma).location;if(void 0!==t)return t;let e,n=l(this,va)._locationsById,i=l(this,Rt).location;if(null!=i){let t=n[i];null!=t&&(e=t)}return l(this,Ma).location=e,e}static hydrate(t,e){return t.map((t=>new yn(e,t)))}static fetch(t){return Z(this,null,(function*(){let e=t.options.things.events.slice();t.options.things.locations&&Me(e,"location");let n={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(yield we(t.options,"event",n)).map((e=>new yn(t,e)))}catch(t){return R.error("Fetch Events:",t),[]}}))}toJSON(){return l(this,Rt)}},ba=yn;va=new WeakMap,Rt=new WeakMap,Ma=new WeakMap,T();var wa,bn=class{constructor(t){z(this,wa,void 0),d(this,"id",""),d(this,"name",""),d(this,"value",""),N(this,wa,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new bn(t)))}static fetch(t){return Z(this,null,(function*(){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(yield we(t.options,"location-state",e)).map((t=>new bn(t)))}catch(t){return R.error("Fetch Location States:",t),[]}}))}toJSON(){return l(this,wa)}},kn=bn;wa=new WeakMap,T(),T();var ja,li,xa,ui,Ta,Ia,vn,sr,Mn,or,Je,Xe,Ke,Ze,Bt=class{constructor(t){z(this,ja),z(this,xa),z(this,vn),z(this,Mn),d(this,"map"),z(this,Ta,{}),z(this,Ia,void 0),z(this,Je,void 0),z(this,Xe,void 0),z(this,Ke,void 0),z(this,Ze,void 0);let{map:e,mappedin:n}=t;null!=t.lat&&null!=t.lon&&(N(this,Je,t.lat),N(this,Xe,t.lon)),null!=t.x&&null!=t.y&&(N(this,Ke,t.x),N(this,Ze,t.y)),this.map=e,N(this,Ia,n)}get x(){return it(this,xa,ui).call(this,"x")}get y(){return it(this,xa,ui).call(this,"y")}get lat(){return it(this,ja,li).call(this,"lat")}get lon(){return it(this,ja,li).call(this,"lon")}absoluteDistanceTo(t){return nr([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=l(this,Ta).nearestNode;if(void 0!==t)return t;let e=De.instances.get(l(this,Ia)).findNearestNodeOnMap(this.map.id,this);return l(this,Ta).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};ja=new WeakSet,li=function(t){if(l(this,Je)&&l(this,Xe))return l(this,"lat"===t?Je:Xe);if(null!=l(this,Ke)&&null!=l(this,Ze)){let[e,n]=it(this,Mn,or).call(this,l(this,Ke),l(this,Ze));return N(this,Je,e),N(this,Xe,n),l(this,"lat"===t?Je:Xe)}throw Error("MappedinCoordinate is missing x and y")},xa=new WeakSet,ui=function(t){if(l(this,Ke)&&l(this,Ze))return l(this,"x"===t?Ke:Ze);if(null!=l(this,Je)&&null!=l(this,Xe)){let[e,n]=it(this,vn,sr).call(this,l(this,Je),l(this,Xe));return N(this,Ke,e),N(this,Ze,n),l(this,"x"===t?Ke:Ze)}throw Error("MappedinCoordinate is missing lat and lon")},Ta=new WeakMap,Ia=new WeakMap,vn=new WeakSet,sr=function(t,e){let n=this.map.georeference[0],i=new B(n.target.x,n.target.y),r=new B(t,e),a=i.distanceTo(r),s=(i.finalBearingTo(r)+360)%360*Math.PI/180||0,o=a*(1/this.map.scale),l=s+this.map.getNorth(),h=Math.sin(l)*o,u=Math.cos(l)*o;return[n.control.x+h,n.control.y-u]},Mn=new WeakSet,or=function(t,e){let n,i=this.map.georeference[0],r=new B(i.target.x,i.target.y),a=t-i.control.x,s=i.control.y-e,o=Math.atan2(a,s);n=0===a&&0===s?0:0===a?s:a/Math.sin(o);let l=o-this.map.getNorth(),h=n/this.map._scale,u=r.destinationPoint(h,180*l/Math.PI);return[u.lat,u.lon]},Je=new WeakMap,Xe=new WeakMap,Ke=new WeakMap,Ze=new WeakMap;var Qe,za,Na,wn=class{constructor(t,e){z(this,Qe,void 0),z(this,za,{}),z(this,Na,void 0),d(this,"id",""),d(this,"group",""),d(this,"name",""),d(this,"shortName",""),d(this,"elevation",0),d(this,"scale",0),d(this,"layers"),d(this,"x_scale"),d(this,"perspectiveId"),d(this,"scene"),d(this,"width",0),d(this,"height",0),d(this,"georeference",[]),d(this,"_scale",0),N(this,Qe,t),N(this,Na,e),Object.assign(this,e),this._scale=ir(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,n;return null!=(n=null==(e=null==(t=De.instances.get(l(this,Qe)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?n:[]}get locations(){var t,e,n;return null!=(n=null==(e=null==(t=De.instances.get(l(this,Qe)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?n:[]}get nodes(){var t,e,n;return null!=(n=null==(e=null==(t=De.instances.get(l(this,Qe)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?n:[]}get mapGroup(){let t=l(this,za).mapGroup;if(void 0!==t)return t;let e=this.group,n=e&&l(this,Qe)._mapGroupsById[e]||null;return l(this,za).mapGroup=n,n}createCoordinateByXY(t,e){return new Bt({x:t,y:e,map:this,mappedin:l(this,Qe)})}createCoordinate(t,e){return new Bt({lat:t,lon:e,map:this,mappedin:l(this,Qe)})}getNorth(){let t;try{let e=this.georeference[0],n=this.georeference[2],i=new B(e.target.x,e.target.y),r=new B(n.target.x,n.target.y);t=-((i.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,R.warn(e),R.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 wn(e,t)))}static fetch(t){return Z(this,null,(function*(){let e=t.options.things.maps.slice();t.options.perspective&&Me(e,"perspectives"),t.options.things.mapGroups&&Me(e,"group"),Me(e,"elevation"),Me(e,"x_scale"),Me(e,"scale"),Me(e,"georeference");let n={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=yield we(t.options,"map",n),a=t=>{let e=i.layers.find((e=>e.id===t));e?e.visible=!0:i.layers.push({id:t,visible:!0})};for(let n=0,s=r.length;n<s;++n){var i=r[n];if(i){let t=i.perspective;null!=t&&(i.perspectiveId=t.id,e.indexOf("scene")>-1&&(i.scene=t.scene),t.layers?(i.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(a)):i.layers.forEach((t=>{t.visible=!0}))),delete i.perspective}r[n]=new wn(t,i)}return r}catch(t){return R.error("Fetch Maps:",t),[]}}))}toJSON(){return l(this,Na)}},Oa=wn;Qe=new WeakMap,za=new WeakMap,Na=new WeakMap,T();var Ea,Dt,Aa,jn=class{constructor(t,e){z(this,Ea,void 0),z(this,Dt,void 0),z(this,Aa,{}),d(this,"id",""),d(this,"name",""),N(this,Dt,e),N(this,Ea,t),Object.assign(this,e)}get maps(){let t=l(this,Aa).maps;if(void 0!==t)return t;let e=[],{maps:n}=l(this,Ea),{id:i}=l(this,Dt);for(let t=0,r=n.length;t<r;++t){let r=n[t];r.group===i&&e.push(r)}return l(this,Aa).maps=e,e}static hydrate(t,e){return t.map((t=>new jn(e,t)))}static fetch(t){return Z(this,null,(function*(){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(yield we(t.options,"map-group",e)).map((e=>new jn(t,e)))}catch(t){return R.error("Fetch Map Groups:",t),[]}}))}toJSON(){return l(this,Dt)}},_a=jn;Ea=new WeakMap,Dt=new WeakMap,Aa=new WeakMap,T();var et,Gt,Ee,Fa,xn=class extends st{constructor(t,e){super(t),z(this,et,void 0),z(this,Gt,void 0),z(this,Ee,{}),d(this,"id",""),d(this,"x",0),d(this,"y",0),d(this,"operationHours"),d(this,"externalId"),z(this,Fa,void 0),N(this,et,t),N(this,Gt,e);let n=Object.assign({},e);delete n.map,Object.assign(this,n)}get map(){let t=l(this,Ee).map;if(void 0!==t)return t;let e=l(this,et).getCollectionItemById("maps",l(this,Gt).map);return l(this,Ee).map=e,e}get lat(){var t;let e=l(this,Ee).cachedLatLon;if(null!=e)return e.lat;let n=null==(t=l(this,et)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return l(this,Ee).cachedLatLon=n.createCoordinateByXY(this.x,this.y),l(this,Ee).cachedLatLon.lat}get lon(){var t;let e=l(this,Ee).cachedLatLon;if(null!=e)return e.lon;let n=null==(t=l(this,et)._mapsById)?void 0:t[this.map.id];if(null==n)throw new Error("Map not found");return l(this,Ee).cachedLatLon=n.createCoordinateByXY(this.x,this.y),l(this,Ee).cachedLatLon.lon}get paths(){let t=l(this,Ee).paths;if(void 0!==t)return t;let e=[],n=l(this,et)._nodesById,i=l(this,Fa);if(Array.isArray(i))for(let t=0,r=i.length;t<r;++t){let r=n[i[t].node];null!=r&&e.push(r)}return l(this,Ee).paths=e,e}set paths(t){N(this,Fa,t)}get locations(){var t,e,n;let i=l(this,Ee).locations;if(void 0!==i)return i;let r=[],a=null!=(n=null==(e=null==(t=De.instances.get(l(this,et)))?void 0:t.locationsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t],n=e.nodes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;++t)if(n[t].id===s){r.push(e);break}}return l(this,Ee).locations=r,r}get polygon(){var t,e,n;let i=l(this,Ee).polygon;if(void 0!==i)return i;let r,a=null!=(n=null==(e=null==(t=De.instances.get(l(this,et)))?void 0:t.polygonsByMapId)?void 0:e.get(this.map.id))?n:[],s=this.id;for(let t=0,e=a.length;t<e;++t){let e=a[t];e.entrances.map((t=>t.id)).includes(s)&&(r=e)}return l(this,Ee).polygon=r,r}static hydrate(t,e){return t.map((t=>new xn(e,t)))}static fetch(t){return Z(this,null,(function*(){let e=t.options.things.nodes.slice();t.options.things.maps&&Me(e,"map"),["weight","multiplier","accessible"].forEach((function(t){Me(e,t)}));let n={fields:e,venue:t.options.venue};try{return(yield we(t.options,"node",n)).map((e=>new xn(t,e)))}catch(t){return R.error("Fetch Nodes:",t),[]}}))}toJSON(){return l(this,Gt)}},Sa=xn;et=new WeakMap,Gt=new WeakMap,Ee=new WeakMap,Fa=new WeakMap,T();var Ca,Tn=class{constructor(t){z(this,Ca,void 0),d(this,"polygons",[]),N(this,Ca,t),Object.assign(this,t)}static hydrate(t){return new Tn(t)}static fetch(t){return Z(this,null,(function*(){try{let e=yield ri(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new Tn(e)}catch(t){return R.error("Fetch Rankings:",t),null}}))}toJSON(){return l(this,Ca)}},Pa=Tn;Ca=new WeakMap,T();var La,On=class{constructor(t){d(this,"id",""),z(this,La,void 0),N(this,La,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new On(t)))}static fetch(t){return Z(this,null,(function*(){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(yield we(t.options,"apollo-theme",e)).map((t=>new On(t)))}catch(t){return R.error("Fetch Theme:",t),[]}}))}toJSON(){return l(this,La)}},In=On;La=new WeakMap,T();var Ba,Da,qt,zn=class{constructor(t,e){z(this,Ba,void 0),z(this,Da,void 0),z(this,qt,{}),d(this,"defaultMap",""),d(this,"address",""),d(this,"city",""),d(this,"countrycode",""),d(this,"externalId",""),d(this,"id",""),d(this,"latitude"),d(this,"logo"),d(this,"longitude"),d(this,"metadata"),d(this,"name",""),d(this,"operationHours"),d(this,"postal",""),d(this,"slug",""),d(this,"state",""),d(this,"telephone",""),d(this,"tzid",""),d(this,"tzidOverride",""),d(this,"utcOffset",""),d(this,"website",""),N(this,Da,t),N(this,Ba,e),Object.assign(this,e)}static hydrate(t,e){return new zn(e,t)}static fetch(t){return Z(this,null,(function*(){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let n=yield we(t.options,"venue",e);return new zn(t,n[0])}catch(t){return R.error("Fetch Venue:",t),{}}}))}get isMultiBuilding(){if(null==l(this,qt).isMultiBuilding){let t=l(this,Da).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),n=t.length!==e.size;l(this,qt).isMultiBuilding=n}return l(this,qt).isMultiBuilding}toJSON(){return l(this,Ba)}},Ra=zn;Ba=new WeakMap,Da=new WeakMap,qt=new WeakMap,T();var qa,Nn=class{constructor(t){d(this,"id",""),z(this,qa,void 0),d(this,"name"),d(this,"type"),d(this,"weight"),d(this,"multiplier"),N(this,qa,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Nn(t)))}static fetch(t){return Z(this,null,(function*(){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){Me(e,t)}));let n={fields:e,venue:t.options.venue};try{return(yield we(t.options,"vortex",n)).map((t=>new Nn(t)))}catch(t){return R.error("Fetch Vortexes:",t),[]}}))}toJSON(){return l(this,qa)}},Ga=Nn;function gs(t,e){let n=[];return t.features.forEach((t=>{var i,r;let a=[];null==(i=t.properties.spaces)||i.forEach((t=>{if("id"in t){let n;n=e.get(t.id),n&&a.push(...n)}else null==a||a.push({id:t.node,level:""})}));let s=a.map((t=>({node:"n_"+t.id,map:t.level}))),o=null==(r=t.properties.spaces)?void 0:r.filter((t=>"id"in t)),l=(t.properties.hours||[]).map((t=>pe(ee({},t),{"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),h=pe(ee({},t.properties),{polygons:o||[],nodes:s||[],description:t.properties.description||"",logo:t.properties.logo||{},picture:t.properties.picture||{},phone:t.properties.phone||{},social:t.properties.social||{},externalId:t.properties.externalId||"",states:t.properties.states||[],siblingGroups:t.properties.siblingGroups||[],operationHours:l});delete h.spaces,n.push(h)})),n}function fs(t){let e=new Set;return t.features.forEach((t=>{var n;null==(n=t.properties.states)||n.forEach((t=>{e.add(t.type)}))})),Array.from(e).map((t=>({id:t,name:t,value:t})))}function ys(t){let e=[];return t.features.forEach((t=>{let n=pe(ee({},t.properties),{icon:t.properties.picture});delete n.picture,e.push(n)})),e}function ks(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;return t.features.forEach((t=>{let a;a="MultiPolygon"===t.geometry.type?t.geometry.coordinates[0].flat():t.geometry.coordinates[0],a.forEach((t=>{e=Math.min(e,t[1]),i=Math.max(i,t[1]),n=Math.min(n,t[0]),r=Math.max(r,t[0])}))})),{id:t.features[0].properties.id,minLat:e,minLong:n,maxLat:i,maxLong:r}}function bs(t,e,n){let i=n.createGeoreferences(),r=[];return t.features.forEach((t=>{let a=new Set;e.forEach((t=>{t.layer&&a.add(t.layer)}));let s=[...a].map((t=>({id:t,visible:!0}))),o=1/n.mapScale,l=pe(ee({},t.properties),{georeference:i,shortName:t.properties.abbreviation||"",scene:{polygons:e},scale:o,x_scale:o,group:t.properties.building,layers:s,width:n.widthInMapUnits,height:n.heightInMapUnits});r.push(l)})),r}qa=new WeakMap,T();var ci=class{constructor(t){d(this,"mapExtent"),d(this,"stretchRatio"),d(this,"midLat"),d(this,"midLong"),d(this,"mapUnitRatio",1e6),d(this,"latDistance"),d(this,"longDistance"),d(this,"mapScale"),d(this,"widthInMapUnits"),d(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:n,maxLat:i,maxLong:r}=t,a=(e+i)/2,s=(n+r)/2,o=new B(a,r),l=new B(a,n),h=new B(e,s),u=new B(i,s);this.latDistance=h.distanceTo(u),this.longDistance=o.distanceTo(l);let c=this.latDistance/this.longDistance,p=(i-e)/(r-n);this.stretchRatio=c/p,this.midLat=a,this.midLong=s,this.widthInMapUnits=(r-n)*this.mapUnitRatio,this.heightInMapUnits=(i-e)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(t){let e=t[1];return{x:(t[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-e)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:n,maxLong:i}=this.mapExtent;return[[t,e],[t,i],[n,i],[n,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};function vs(t,e){let n=[];return t.features.forEach((t=>{let i=e.convert(t.geometry.coordinates),r=(t.properties.neighbors||[]).map((e=>({node:e,map:t.properties.level}))),a=t.properties.level,s=pe(ee({},t.properties),{x:i.x,y:i.y,paths:r,map:a,externalId:t.properties.externalId||""});n.push(s)})),n}var lr=(t,e,n,i,r)=>{let a=[];return t.features.forEach((t=>{if(!t.geometry.coordinates[0].forEach)return;let s=[];"entrances"in t.properties&&(s=t.properties.entrances.map((t=>({id:"n_"+t.id,node:"n_"+t.id,map:t.level}))));let o,l=n[t.properties.id],h=e.find((t=>t.id===l)),u=t.geometry.coordinates[0].map((t=>r.convert(t))),c=i.find((e=>e.polygonId===t.properties.id)),d=Math.max(r.widthInMapUnits,r.heightInMapUnits)/1e3;if(c){let t=r.convert([c.position[0],c.position[1]]),e=c.size.x,n=c.size.y,i=r.mapScale,a=n*i,s=e*i/d/c.viewBox.width,l=a/d/c.viewBox.height;o={url:null==h?void 0:h.image,visible:!(null==h||!h.image),viewBox:c.viewBox,scale:{x:s,y:l},position:{x:t.x,y:t.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let p=pe(ee({},t.properties),{entrances:s,map:t.properties.level,externalId:t.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==h?void 0:h.altitude)||0)*r.mapScale/d},scale:{x:1,y:1,z:((null==h?void 0:h.height)||1)*r.mapScale/d}},material:{color:(null==h?void 0:h.color)||"#000000"},image:o,vertexes:u});a.push(p)})),a};function Ms(t,e,n,i,r,a){let s=lr(t,n,i,r,a),o=lr(e,n,i,r,a);return s.concat(o)}function ws(t){let e=new Map;return t.forEach((t=>{t.features.forEach((t=>{let{destinations:n}=t.properties;if(0===n.length)return;let i=n[0].split("-")[0],r=e.get(i),a=n.map((t=>t.split("-")[1])).map((t=>"n_"+t));if(r)r.nodes.push(...a);else{let{name:n,type:r,weight:s,multiplier:o,accessible:l}=t.properties,h={id:i,nodes:a,name:n,type:r,weight:s,multiplier:o,accessible:l};e.set(i,h)}}))})),Array.from(e.values())}function js(t){let e=[];return t.features.forEach((t=>{let n=ee({},t.properties);e.push(n)})),e}function ur(t){let e=Array.from(t.connection.values()),n=Array.from(t.level.values()),i=t.building,r=t.category,a=t.style,s=t.location,o=t.imageInstance,l=t.polygonStyle,h={},u=[],c=new Map;n.forEach((e=>{let n=e.features[0].properties.id,i=ks(e),r=new ci(i);c.set(n,r);let s=t.obstruction.get(n),d=t.space.get(n),p=o.get(n),f=l.get(n);h[n]=Ms(d,s,a,f,p,r);let g=t.node.get(n);u.push(...vs(g,r))}));let d=Object.values(h).flat(),p=ws(e),f=n.map((t=>{let e=t.features[0].properties.id,n=c.get(e);return bs(t,h[e],n)})).flat(),g=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{g.set(t.properties.id,t.properties.entrances)}))}));let y=js(i),m=gs(s,g),v=ys(r),w=fs(s),_=t.manifest.features[0].properties.name,M=t.manifest.features[0].geometry.coordinates[0],b=t.manifest.features[0].geometry.coordinates[1],x=t.imageBinaries;return{locations:m,categories:v,nodes:u,maps:f,polygons:d,vortexes:p,mapGroups:y,locationStates:w,themes:[],venue:{name:_,latitude:b,longitude:M},imageBinaries:x}}T(),T(),T(),T();var _t,$e,We,di=[0,4,6,8,10],lt=()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let n=0;n<t.length;n++)n>0&&!(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;let n=t.map((t=>t.toString(16).padStart(2,"0")));return n[6]="4"+n[6][1],n[8]=["8","9","a","b"].includes(n[7][0])?n[7]:"a"+n[7][1],di.map(((t,e)=>n.slice(t,e===di.length-1?void 0:di[e+1]).join(""))).join("-")},cr="mi-session-data",dr="mi-local-data",pi=class{constructor(){z(this,$e,void 0),z(this,We,void 0);try{let t=sessionStorage.getItem(cr);N(this,$e,t?JSON.parse(t):{id:lt()})}catch(t){N(this,$e,{id:lt()})}try{let t=localStorage.getItem(dr);N(this,We,t?JSON.parse(t):{deviceId:lt()})}catch(t){N(this,We,{deviceId:lt()})}l(this,$e).id||(l(this,$e).id=lt()),l(this,We).deviceId||(l(this,We).deviceId=lt())}static getInstance(){return l(this,_t)||N(this,_t,new pi),l(this,_t)}static ___clearInstance(){N(this,_t,void 0)}saveSessionData(t,e){l(this,$e)[t]=e;try{return sessionStorage.setItem(cr,JSON.stringify(l(this,$e))),!0}catch(t){return!1}}loadSessionData(t){let e=l(this,$e)[t];if(null!=e)return e}saveLocalData(t,e){l(this,We)[t]=e;try{return localStorage.setItem(dr,JSON.stringify(l(this,We))),!0}catch(t){return!1}}loadLocalData(t){let e=l(this,We)[t];if(null!=e)return e}},Vt=pi;function pr(t){return/^[\da-f]{24}$/i.test(t)}function hr(){return Vt.getInstance().loadLocalData("deviceId")}function mr(){return Vt.getInstance().loadSessionData("id")}_t=new WeakMap,$e=new WeakMap,We=new WeakMap,z(Vt,_t,void 0);var Fr,Va,Ut,$t,Ua,Wt,Ht,Yt,Et,$a,Jt,Xt,Wa,Pr=un(Sr(),1),Ss=null==(Fr=null==F?void 0:F.env)?void 0:Fr.npm_package_version,gi=["websdk","web","webv2"],fi="websdk",yi=class{constructor(t){var e;z(this,Va,void 0),z(this,Ut,void 0),z(this,$t,void 0),z(this,Ua,void 0),z(this,Wt,void 0),z(this,Ht,void 0),z(this,Yt,void 0),z(this,Et,void 0),z(this,$a,void 0),z(this,Jt,void 0),z(this,Xt,void 0),z(this,Wa,void 0),N(this,Et,t.clientId),N(this,$a,t.clientSecret),N(this,Jt,t.accessToken),N(this,Yt,t.noAuth||!1);let n="https://api-gateway.mappedin.com/track-analytics/a/";!l(this,Yt)&&l(this,Et)&&!pr(l(this,Et))&&(n="https://web-proxy.mappedin.com/a/"),N(this,$t,n),N(this,$t,l(this,$t)+(t.venue+"/")),N(this,Ut,!1),N(this,Va,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),N(this,Ua,gi.find((e=>e===t.context))||gi[0]),N(this,Wt,hr()),N(this,Ht,mr()),N(this,Xt,new Set),N(this,Wa,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(l(this,Va))return;let n=pe(ee({},e),{g:l(this,Ut)}),i=l(this,$t)+t+"?"+Pr.default.stringify(n),r={"mi-context":fi||l(this,Ua),"mi-session":l(this,Ht),"mi-device":l(this,Wt),"mappedin-sdk-version":Ss,"mappedin-platform-version":l(this,Wa)};l(this,Jt)?r.Authorization=`Bearer ${l(this,Jt)}`:l(this,Yt)||(r.Authorization=`Basic ${btoa(`${l(this,Et)}:${l(this,$a)}`)}`),ga()(i,{method:"GET",mode:"cors",headers:r})}locationSelected(t){let e=t.id||t;this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;this.track("select-category",{id:e})}mapViewLoaded(t,e,n,i){this.track("load-mapview",{type:t,force:e,benchmark:n||-1,reason:i||"success"})}getDirections(t,e){let n={start:t.id,end:e.id,type:"location_to_location"};this.track("query-directions",n)}getSessionID(){return l(this,Ht)}getDeviceID(){return l(this,Wt)}setGeolocationMode(t){N(this,Ut,t)}trackBlueDotEvent(t){t&&Object.values(yi.BLUEDOT_EVENT).includes(t)&&!l(this,Xt).has(t)?(this.track(t),l(this,Xt).add(t)):R.warn(`Ignored unsupported blue dot event: "${t}".`)}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=gi.find((e=>e===t));e&&(fi=e)}static clearContext(){fi=void 0}},_n=yi;Va=new WeakMap,Ut=new WeakMap,$t=new WeakMap,Ua=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,Yt=new WeakMap,Et=new WeakMap,$a=new WeakMap,Jt=new WeakMap,Xt=new WeakMap,Wa=new WeakMap,d(_n,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var Mt,Zt,En=_n,Cr={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""},Kt={categories:Nt,locations:ot,vortexes:Ga,maps:Oa,nodes:Sa,polygons:zt,venue:Ra,events:ba,mapGroups:_a,themes:In,locationStates:kn,rankings:Pa},wt=class{constructor(t){d(this,"perspective"),d(this,"things"),d(this,"options"),z(this,Mt,void 0),z(this,Zt,""),d(this,"updatedAt"),d(this,"categories",[]),d(this,"locations",[]),d(this,"vortexes",[]),d(this,"maps",[]),d(this,"nodes",[]),d(this,"polygons",[]),d(this,"venue",{}),d(this,"events",[]),d(this,"mapGroups",[]),d(this,"themes",[]),d(this,"locationStates",[]),d(this,"rankings"),d(this,"_categoriesById"),d(this,"_locationsById"),d(this,"_vortexesById"),d(this,"_mapsById"),d(this,"_nodesById"),d(this,"_polygonsById"),d(this,"_eventsById"),d(this,"_mapGroupsById"),d(this,"_locationStatesById"),d(this,"_locationRankingsById"),d(this,"_rankingsById"),d(this,"_categoriesByExternalId"),d(this,"_locationsByExternalId"),d(this,"_vortexesByExternalId"),d(this,"_mapsByExternalId"),d(this,"_nodesByExternalId"),d(this,"_polygonsByExternalId"),d(this,"_eventsByExternalId"),d(this,"_mapGroupsByExternalId"),d(this,"_locationStatesByExternalId"),d(this,"_locationRankingsByExternalId"),d(this,"_rankingsByExternalId"),d(this,"images"),d(this,"imageBinaries"),d(this,"scenes"),d(this,"analytics"),d(this,"navigator"),this.options=t,N(this,Mt,De.create(this));let e=new En(pe(ee({},t),{testMode:!(null!=t&&t.emitAnalyticsEvents)}));this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(Kn,"true")}})}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=l(this,Mt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.externalId]=t)),l(this,Mt)[n]=e,e}}),Object.defineProperty(this,`_${n}ById`,{get(){let t=l(this,Mt)[n];if(null!=t)return t;let e={};return this[n].forEach((t=>e[t.id]=t)),l(this,Mt)[n]=e,e}}))}return this}catch(t){throw new Error(t)}}getCollectionItemById(t,e){let n=`_${t}ByExternalId`,i=this[`_${t}ById`];return null!=i&&null!=i[e]||(i=this[n],null!=i&&null!=i[e])?i[e]:null}hydrateFromMVF(t){return Z(this,null,(function*(){let e=ur(t);return this.hydrate(e)}))}hydrate(t,e){return Z(this,null,(function*(){let n;if("string"==typeof t)try{N(this,Zt,t),n=JSON.parse(t)}catch(t){return void R.error("Unable to parse JSON",t)}else n=t,N(this,Zt,JSON.stringify(n));let i=Object.keys(n);for(let t=0,e=i.length;t<e;++t){let e=i[t],r=n[e];null!=Kt[e]&&"function"==typeof Kt[e].hydrate&&(this[e]=Kt[e].hydrate(r,this))}e&&(yield rr(n));let{images:r,scenes:a,imageBinaries:s}=n;this.images=r,this.scenes=a,this.imageBinaries=s,this.generateGetters(i),this.initNavigator()}))}fetch(){return Z(this,null,(function*(){"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"]),ar(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:t}=this.options,e=[],n=Object.keys(t);for(let t=0,i=n.length;t<i;++t){let i=n[t];Kt[i]&&e.push(Kt[i].fetch(this).then((t=>(this[i]=t,Promise.resolve()))))}return this.generateGetters(n),Promise.all(e).then((()=>{this.initNavigator()}))}))}initNavigator(){this.navigator=new ai({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 Kt)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));let n=pe(ee({},e),{venue:this.venue.toJSON()});return null!=this.rankings&&(n.rankings=null==(t=this.rankings)?void 0:t.toJSON()),delete n.locationRankings,n}toString(){return l(this,Zt)||JSON.stringify(this.toJSON())}};Mt=new WeakMap,Zt=new WeakMap,T();var Lr={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"]};T();var At=un(Rr(),1);T();var Fs=["0","1","2","3","4","5","6","7","8","9"],Ps=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Cs=["0","1","2","3","4","5","6","7","8","9"],Ls=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Pd=[...Fs,...Ps,...Cs,...Ls],Br=["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"];T();var St,Ve,jt,tt,Ae,Ya,Ja,ta,Xa,aa,pt,Pn,Cn,xt,Ka,Ln,Rn,Bn,Gr,Za,Qa,Rs=32,Re=!1,Bs=120,vi=0,An=class{constructor(t){d(this,"_callback"),d(this,"_frameCount"),d(this,"_ordering"),d(this,"_supersededBy"),d(this,"name"),d(this,"_remainingFrameCount"),d(this,"_lastFrameTime"),d(this,"userdata"),this._callback=t.callback,this._frameCount=null!=t.frameCount?t.frameCount:1,this._ordering=null!=t.ordering?t.ordering:0,this._supersededBy=null!=t.supersededBy?new Set(t.supersededBy):new Set,this.name=t.name,this.userdata=t.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,Re&&R.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}},ct=class{constructor(t){if(d(this,"_postponed"),d(this,"userdata"),d(this,"_priority"),d(this,"_group"),d(this,"name"),d(this,"_lastFrameTime"),d(this,"_callback"),d(this,"_complete"),d(this,"_scheduled"),d(this,"_cancelled"),null!=t.group&&null!=t.priority)throw new Error("cannot specify task priority individually within group");if(null!=t.group&&null!=t.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=t.callback,this._group=null!=t.group?t.group:null,this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,Re&&R.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},Sn=class{constructor(t){d(this,"_postponed"),d(this,"_onComplete"),d(this,"_priority"),d(this,"userdata"),d(this,"name"),d(this,"_tasks"),d(this,"_scheduledTasks"),d(this,"_scheduled"),d(this,"_cancelled"),this._onComplete=null!=t.onComplete?t.onComplete:()=>{},this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,Re&&R.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}},Mi=class{constructor(t){d(this,"_maxMillisecondsPerFrame"),d(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:Rs,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},Fn=class{constructor(t){var e;d(this,"_raf"),d(this,"_timer"),d(this,"_performance"),d(this,"_scheduledUpdatesByOrdering"),d(this,"_scheduledTasksByPriority"),d(this,"_postponedTasks"),d(this,"_requestAnimationFrameHandle"),d(this,"_updatesToRunThisFrame"),d(this,"_lastFrameTime",0),d(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new Mi,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new Qt,this._scheduledTasksByPriority=new Qt,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),Re&&R.log("task scheduler instantiated"),null!=(e=globalThis.MappedinDebug)&&e.TEST_IOS&&(this._raf=t=>setTimeout(t,16))}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new Qt,this._scheduledTasksByPriority=new Qt,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),Re&&R.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(t){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let n=!1;Re&&(0===vi&&(n=!0),++vi,vi%=Bs);let i=this._scheduledUpdatesByOrdering.keys();for(let t=i.length-1;t>=0;--t){let e=i[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),n&&R.log("update scheduled to run this frame",t.name)}for(let t of this._updatesToRunThisFrame){--t._remainingFrameCount,t._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(t._ordering,t),t._superseded=!1;for(let e of this._updatesToRunThisFrame)t._supersededBy.has(e)&&(t._superseded=!0,n&&R.log("update superseded",t.name,e.name))}for(let t=0;t<this._updatesToRunThisFrame.length;++t)this._updatesToRunThisFrame[t]._superseded&&(this._updatesToRunThisFrame.splice(t,1),--t);for(let e of this._updatesToRunThisFrame){let i;this._performance&&(i=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-i),n&&R.log("update completed",e.name)}this._updatesRunLastFrame.clear();for(let t of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(t);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(t)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-e),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(t){let e,n=this._scheduledTasksByPriority.popFromMaxKey(),i=null;R.assert(void 0!==n),Object.getPrototypeOf(n)===Sn.prototype&&(i=n,n=i._popTask()),R.assert(void 0!==n),R.assert(Object.getPrototypeOf(n)===ct.prototype),this._performance&&(e=performance.now()),n._callback(t),n._complete=!0,this._performance&&(n._lastFrameTime=performance.now()-e),Re&&R.log("task completed",n.name),null!=i&&(i.isComplete()?(i.clear(),i._onComplete(),Re&&R.log("group completed",i.name)):this._scheduledTasksByPriority.insert(i._priority,i))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===Sn)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+t.name);if(t._scheduled)throw new Error("cannot schedule already scheduled task: "+t.name);if(t._cancelled)throw new Error("cannot schedule cancelled task: "+t.name);let e=t;"_group"in t&&null!=t._group&&(t._group._tasks.add(t),t._group._scheduledTasks.add(t),e=t._group),e._postponed?this._postponedTasks.add(e):this._scheduledTasksByPriority.insert(e._priority,e),t._scheduled=!0,e._scheduled=!0,Re&&R.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),Re&&R.log("update cancelled",t.name)}cancelTask(t){if(!t._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+t.name);if(t._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+t.name);if("_group"in t&&null!=t._group){let e=t._group.isComplete();t._group._tasks.delete(t),t._group._scheduledTasks.delete(t),t._group.isComplete()&&(this._scheduledTasksByPriority.delete(t._group._priority,t._group),e||t._group._onComplete())}else this._scheduledTasksByPriority.delete(t._priority,t),this._postponedTasks.delete(t);Object.getPrototypeOf(t)===ct.prototype?t._cancelled=!0:"clear"in t&&t.clear(),Re&&R.log("task cancelled",t.name)}postponeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot postpone individual tasks in group: "+t.name);if(t._cancelled)throw new Error("cannot postpone cancelled task: "+t.name);if(!t._postponed){if(Object.getPrototypeOf(t)===ct.prototype){if("_complete"in t)return;if(!t._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+t.name)}this._scheduledTasksByPriority.delete(t._priority,t),(Object.getPrototypeOf(t)===ct.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,Re&&R.log("task postponed",t.name)}}resumeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot resume individual tasks in groups");if(t._cancelled)throw new Error("cannot resume cancelled task");if(t._postponed){if(Object.getPrototypeOf(t)===ct.prototype){if("_complete"in t&&t._complete)return;if(!t._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(t),(Object.getPrototypeOf(t)===ct.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),Re&&R.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===ct.prototype&&!t._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(t._priority,t)&&(this._scheduledTasksByPriority.delete(t._priority,t),this._scheduledTasksByPriority.insert(e,t)),t._priority=e,Re&&R.log("task priority changed",t.name,e)}},Qt=class{constructor(){d(this,"_map"),d(this,"_size"),d(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(t,e){return null!=this._map.get(t)&&this._map.get(t).has(e)}get(t){return this._map.get(t)}insert(t,e){if(R.assert("number"==typeof t&&Number.isFinite(t)),null==this._map.get(t)){this._map.set(t,new Set);for(let e=0;e<=this._sortedKeys.length;++e)if(e===this._sortedKeys.length||t<this._sortedKeys[e]){this._sortedKeys.splice(e,0,t);break}}this._map.get(t).has(e)||(this._map.get(t).add(e),++this._size)}delete(t,e){null!=this._map.get(t)&&this._map.get(t).has(e)&&(this._map.get(t).delete(e),--this._size,0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)))}pop(t){if(null!=this._map.get(t)){let e;for(e of this._map.get(t).values()){this._map.get(t).delete(e),--this._size;break}return 0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)),e}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let t=this._map.keys(),e=null,n={[Symbol.iterator]:()=>n,next:()=>{if(null==e){let n=t.next();if(n.done)return n;e=this._map.get(n.value).values()}let n=e.next();for(;n.done;){let i=t.next();if(i.done)return i;e=this._map.get(i.value).values(),n=e.next()}return n}};return n}keys(){return this._sortedKeys}get size(){let t=0;for(let e of this._map.values())t+=e.size;return R.assert(t===this._size),t}},dt=t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),ea="",Ds=.09,Gs=1,qs=.025,Vs=.5,Us=5e-4,$s=5e-4,Ws=.01,Hs=.05,Dr=1,Ys=.01,Js=.2,Xs={MappedinCategory:"categories",MappedinLocation:"locations"},Ks={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:Br,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===F.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Ds,PRIMARY_INDEX_WEIGHT:Gs,SECONDARY_INDEX_WEIGHT:qs,CATEGORY_NAME_WEIGHT:Vs,LOCATION_NAME_WEIGHT:Dr,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:Us,CATEGORY_LOCATION_TAGS_WEIGHT:$s,CATEGORY_LOCATION_NAME_WEIGHT:Ws,PRIMARY_INDEX_TAGS_NAME_WEIGHT:Hs,LOCATION_DEFAULT_RANK:Dr,RATIO_OF_FUZZY_TO_EXACT:Ys,RATIO_OF_PREFIX_TO_EXACT:Js}},Ha=class{constructor(t,e){var n,i,r;z(this,Bn),z(this,St,void 0),z(this,Ve,void 0),z(this,jt,void 0),z(this,tt,void 0),z(this,Ae,void 0),z(this,Ya,new Fn({performance:!0})),z(this,Ja,void 0),z(this,ta,void 0),z(this,Xa,new Map),z(this,aa,0),z(this,pt,(t=>{Yn(this,aa)._++,l(this,Ya).scheduleUpdate(new An({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),Yn(this,aa)._--,0===l(this,aa)&&l(this,Ka).call(this)}}))})),z(this,Pn,(t=>{var e,n,i;let{SECONDARY_INDEX_WEIGHT:r,LOCATION_DEFAULT_RANK:a,PRIMARY_INDEX_TAGS_NAME_WEIGHT:s}=l(this,Ae).constants,o=a;null!=(e=l(this,Ae))&&e.useLocationRank&&(o=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,n;return null!=(e=t.rank)&&e.score?null==(n=t.rank)?void 0:n.score:a})),a):a),l(this,pt).call(this,(()=>{l(this,Ve).add({name:dt(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:a,rank:o})})),null!=(n=l(this,Ae))&&n.searchTags&&Array.isArray(t.tags)&&t.tags.forEach((e=>{l(this,Ve).add({name:"",tag:dt(e),id:"MappedinLocation_"+t.id,weight:s,rank:o})})),null!=(i=l(this,Ae))&&i.searchDescriptions&&l(this,pt).call(this,(()=>l(this,jt).add({description:dt(t.description||""),id:"MappedinLocation_"+t.id,weight:r,rank:o})))})),z(this,Cn,(t=>{var e,n;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:i,CATEGORY_LOCATION_TAGS_WEIGHT:r,CATEGORY_LOCATION_NAME_WEIGHT:a,CATEGORY_NAME_WEIGHT:s}=l(this,Ae).constants;l(this,pt).call(this,(()=>l(this,Ve).add({name:dt(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:s})));let o=t.locations.reduce(((t,e)=>t+` ${ea} `+e.name),"")+` ${ea}`;if(null!=(e=l(this,Ae))&&e.searchDescriptionsInCategories&&t.locations.forEach((e=>{null!=e.description&&l(this,pt).call(this,(()=>l(this,tt).add({id:"MappedinCategory_"+t.id,"category.locations.description":dt(e.description),ref:e.name,weight:i})))})),null!=(n=l(this,Ae))&&n.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var n;return t+(null==(n=e.tags)?void 0:n.reduce(((t,e)=>t+` ${ea} `+e),""))+` ${ea}`}),"");l(this,pt).call(this,(()=>l(this,tt).add({"category.locations.tags":dt(e),id:"MappedinCategory_"+t.id,weight:r})))}l(this,pt).call(this,(()=>l(this,tt).add({"category.locations.name":dt(o),id:"MappedinCategory_"+t.id,weight:a})))})),z(this,xt,void 0),z(this,Ka,void 0),z(this,Ln,(t=>{var e;let n=t.score,{object:i,id:r,weight:a,rank:s}=t,[o,h]=r.split("_"),u=i||l(this,St).getCollectionItemById(Xs[o],h);return s&&null!=(e=l(this,Ae))&&e.useLocationRank&&(n+=s),a&&(n*=a),{score:n,type:o,object:u}})),z(this,Rn,((t,e)=>{for(let n in t.match)t.match[n].forEach((i=>{let r=t.ref||t[i]||e.object[i];if("category.locations.tags"===i||"category.locations.name"===i){let e=new RegExp(`[^${ea}]* `+n+` [^${ea}]*`,"ig").exec(t[i]);null!=e&&(r=e[0].slice(1,-1))}e.matches.push({term:n,weight:t.weight,matchesOn:i,value:r})}))})),z(this,Za,void 0),z(this,Qa,void 0),N(this,ta,new En(pe(ee({},t.options),{testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)}))),N(this,Ae,ee(ee({},Ks),e)),N(this,St,t),N(this,Ja,new Set(null==(n=l(this,Ae))?void 0:n.stopWords));let{PRIMARY_INDEX_FUZZYNESS:a,PRIMARY_INDEX_WEIGHT:s,CATEGORY_NAME_WEIGHT:o,RATIO_OF_FUZZY_TO_EXACT:h,RATIO_OF_PREFIX_TO_EXACT:u,PRIMARY_INDEX_TAGS_NAME_WEIGHT:c}=l(this,Ae).constants,d=["object","query","weight","tag","rank"],p={fields:["query","name","tag"],storeFields:d,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:a},boost:{name:s,query:s,tag:c},weights:{fuzzy:h,prefix:u},boostDocument:t=>t.includes("MappedinLocation")?s:t.includes("MappedinCategory")?o:s},f={fields:["description"],storeFields:d,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var n;return null!=(n=l(this,Ja))&&n.has(t.toLowerCase())?null:t.toLowerCase()}},g={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...d,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(N(this,xt,new Promise((t=>{N(this,Ka,t)}))),null!=(i=l(this,Ae))&&i.jsonIndex){let{primary:t,secondary:e,extra:n}=JSON.parse(null==(r=l(this,Ae))?void 0:r.jsonIndex);N(this,Ve,At.default.loadJS(t,p)),N(this,jt,At.default.loadJS(e,f)),N(this,tt,At.default.loadJS(n,g))}else N(this,Ve,new At.default(p)),N(this,jt,new At.default(f)),N(this,tt,new At.default(g)),l(this,St).locations.forEach(l(this,Pn)),l(this,St).categories.forEach(l(this,Cn));l(this,Ya).update(performance.now()),N(this,Za,oi(((t,e)=>{l(this,ta).trackSearchSuggest({query:t,hits:e})}),300)),N(this,Qa,oi(((t,e)=>{l(this,ta).trackSearch({query:t,hits:e})}),300))}suggest(t){return Z(this,null,(function*(){yield l(this,xt);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:n,PRIMARY_INDEX_TAGS_NAME_WEIGHT:i,RATIO_OF_FUZZY_TO_EXACT:r,RATIO_OF_PREFIX_TO_EXACT:a}=l(this,Ae).constants,s=l(this,Ve).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:n,query:n,tag:i},weights:{fuzzy:r,prefix:a}});return l(this,Za).call(this,t,s.length),{total:s.length,hits:s.map((t=>({text:t.suggestion})))}}))}search(t){return Z(this,null,(function*(){yield l(this,xt);let e=it(this,Bn,Gr).call(this,t);return l(this,Qa).call(this,t,e.length),e}))}toJSON(){return Z(this,null,(function*(){return yield l(this,xt),JSON.stringify({primary:l(this,Ve),secondary:l(this,jt),extra:l(this,tt)})}))}addQuery(t){return Z(this,null,(function*(){let e,n,{query:i,object:r,weight:a=1}=t;yield l(this,xt),e=r instanceof ot?"MappedinLocation":r instanceof Nt?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?n=e+"_"+r.id:"string"==typeof r.id?n="Custom_"+r.id:(n=l(this,Xa).get(r),n||(n="Custom_"+lt(),l(this,Xa).set(r,n))),l(this,Ve).add({id:n,weight:a,object:r,query:dt(i)})}))}};St=new WeakMap,Ve=new WeakMap,jt=new WeakMap,tt=new WeakMap,Ae=new WeakMap,Ya=new WeakMap,Ja=new WeakMap,ta=new WeakMap,Xa=new WeakMap,aa=new WeakMap,pt=new WeakMap,Pn=new WeakMap,Cn=new WeakMap,xt=new WeakMap,Ka=new WeakMap,Ln=new WeakMap,Rn=new WeakMap,Bn=new WeakSet,Gr=function(t){let e=[],n=dt(t);e=[...l(this,Ve).search(n),...l(this,jt).search(n),...l(this,tt).search(n)].sort(((t,e)=>e.score-t.score));let i={};for(let t of e){let e=l(this,Ln).call(this,t);i[t.id]?i[t.id].score+=e.score:i[t.id]=pe(ee({},e),{matches:[]}),l(this,Rn).call(this,t,i[t.id])}return Object.keys(i).map((t=>pe(ee({},i[t]),{matches:i[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))},Za=new WeakMap,Qa=new WeakMap,T();var qr=globalThis.fetch;function ga(){if(null==qr)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return qr}var Vr,Zs=null==(Vr=null==F?void 0:F.env)?void 0:Vr.npm_package_version;globalThis.btoa||(globalThis.btoa=Ur.encode);var Qs=["ar"];function wi(t){let e=ee(pe(ee({},Cr),{things:Lr}),t);return e.headers=pe(ee({},e.headers),{"mappedin-sdk-version":Zs}),t.platformString&&(e.headers=pe(ee({},e.headers),{"mappedin-platform-version":t.platformString})),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}function ji(t){return Z(this,null,(function*(){let e=ee(ee({},{emitAnalyticsEvents:!0}),t),n=wi(ee({baseUrl:"https://api-gateway.mappedin.com/"},e)),i="public/1/"+(n.useDraftData?"draft/":""),r=new wt(pe(ee({},n),{baseUrl:n.baseUrl+i}));return yield r.fetch(),r}))}var $r={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};function xi(t){return Z(this,null,(function*(){let e=wi(ee(ee({baseUrl:"https://api-gateway.mappedin.com/"},$r),t)),{url:n,updated_at:i}=yield eo(t),r=yield ga()(n,{mode:"cors"}),{data:a,format:s="jsonstring"}=yield r.json();if("jsonstring"!==s)throw new Error(`Unrecognized format ${s}`);let o=new wt(e);return yield o.hydrate(a,e.shouldPopulateBundledImagesAsBlobs),o.updatedAt=i,o}))}function eo(t){return Z(this,null,(function*(){let e=wi(ee(ee({baseUrl:"https://api-gateway.mappedin.com/"},$r),t)),{version:n,venue:i}=t,r=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&Qs.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${i}&version=1.0.0`;return e.language=void 0,yield si(e,r)}))}var to=!1;function ao(t){t.things=t.things||{},t.things.venue=t.things.venue||[],t.things.venue.push("slug","defaultMap"),t.things.nodes=t.things.nodes||[],t.things.nodes.push("x","y","paths","map"),t.things.polygons=t.things.polygons||[],t.things.locations=t.things.locations||[],t.things.locations.push("sortOrder","parent","showLabelWhenImagePresent","hidden"),t.things.maps=t.things.maps||[],t.things.maps.push("height","width","georeference"),t.perspective=t.perspective3D||t.perspective||void 0,t.things.maps.push("scene","layers"),t.things.polygons.push("canvasBounds","map","image","perspectives","material","holes","label","geometry"),to&&t.things.polygons.push("layer","geometry","vertexes")}var no=function(t){return null==t.mapView&&(t.mapView={}),new Promise((function(e,n){function i(i,r){if(i)n(i);else{let i={};try{t.firstMapSelector&&(t.mapView=t.mapView||{},t.mapView.firstMap=t.firstMapSelector(r))}catch(t){R.error("Failure in firstMapSelector! Loading default map instead."),R.error(t),n(t)}i.venue=r,e(i)}}ao(t.venue),t.venue.useVenueBundle?xi(t.venue).then((t=>i(null,t))).catch((t=>i(t,null))):ji(t.venue).then((t=>i(null,t))).catch((t=>i(t,null)))}))};
|