@mappedin/mappedin-js 4.1.4 → 4.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/get-venue/index.js +1 -1
- package/lib/esm/renderer/{browser-Q7ZMPAJO.js → browser-2TLWQ6YW.js} +1 -1
- package/lib/esm/renderer/chunk-AON4ZHYU.js +1 -0
- package/lib/esm/renderer/index.js +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +2 -2
- package/lib/esm/renderer/chunk-TAXB3OOG.js +0 -1
package/lib/node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Qd,G,Ud=Object.create,Va=Object.defineProperty,Vd=Object.getOwnPropertyDescriptor,$d=Object.getOwnPropertyNames,Hd=Object.getPrototypeOf,Yd=Object.prototype.hasOwnProperty,Jd=(e,t,r)=>t in e?Va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hl=e=>Va(e,"__esModule",{value:!0}),Ve=(e,t)=>()=>(e&&(t=e(e=0)),t),vt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Po=(e,t)=>{for(var r in hl(e),t)Va(e,r,{get:t[r],enumerable:!0})},Xd=(e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of $d(t))!Yd.call(e,n)&&"default"!==n&&Va(e,n,{get:()=>t[n],enumerable:!(r=Vd(t,n))||r.enumerable});return e},Ne=e=>Xd(hl(Va(null!=e?Ud(Hd(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),p=(e,t,r)=>(Jd(e,"symbol"!=typeof t?t+"":t,r),r),Fo=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},f=(e,t,r)=>(Fo(e,t,"read from private field"),r?r.call(e):t.get(e)),F=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},D=(e,t,r,n)=>(Fo(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),pl=(e,t,r)=>(Fo(e,t,"access private method"),r),j=Ve((()=>{G={env:Qd={NODE_ENV:"production",npm_package_version:"4.1.4"}}})),ml=vt(((e,t)=>{j(),function(r){var n="object"==typeof e&&e,i="object"==typeof t&&t&&t.exports==n&&t,o="object"==typeof global&&global;(o.global===o||o.window===o)&&(r=o);var a=function(e){this.message=e};(a.prototype=new Error).name="InvalidCharacterError";var s=function(e){throw new a(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var t,r,n,i,o=e.length%3,a="",u=-1,h=e.length-o;++u<h;)t=e.charCodeAt(u)<<16,r=e.charCodeAt(++u)<<8,n=e.charCodeAt(++u),a+=l.charAt((i=t+r+n)>>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==o?(t=e.charCodeAt(u)<<8,r=e.charCodeAt(++u),a+=l.charAt((i=t+r)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==o&&(i=e.charCodeAt(u),a+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),a},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var r,n,i=0,o="",a=-1;++a<t;)n=l.indexOf(e.charAt(a)),r=i%4?64*r+n:n,i++%4&&(o+=String.fromCharCode(255&r>>(-2*i&6)));return o},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(n&&!n.nodeType)if(i)i.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(n[c]=h[c]);else r.base64=h}(e)})),gl=vt(((e,t)=>{var r,n;j(),r="undefined"!=typeof self?self:e,n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t),r.d(t,"computeDestinationPoint",(function(){return P})),r.d(t,"convertArea",(function(){return D})),r.d(t,"convertDistance",(function(){return C})),r.d(t,"convertSpeed",(function(){return B})),r.d(t,"decimalToSexagesimal",(function(){return W})),r.d(t,"findNearest",(function(){return U})),r.d(t,"getAreaOfPolygon",(function(){return H})),r.d(t,"getBounds",(function(){return G})),r.d(t,"getBoundsOfDistance",(function(){return V})),r.d(t,"getCenter",(function(){return Q})),r.d(t,"getCenterOfBounds",(function(){return Y})),r.d(t,"getCompassDirection",(function(){return X})),r.d(t,"getCoordinateKey",(function(){return y})),r.d(t,"getCoordinateKeys",(function(){return S})),r.d(t,"getDistance",(function(){return z})),r.d(t,"getDistanceFromLine",(function(){return Z})),r.d(t,"getGreatCircleBearing",(function(){return K})),r.d(t,"getLatitude",(function(){return x})),r.d(t,"getLongitude",(function(){return O})),r.d(t,"getPathLength",(function(){return te})),r.d(t,"getPreciseDistance",(function(){return re})),r.d(t,"getRhumbLineBearing",(function(){return J})),r.d(t,"getRoughCompassDirection",(function(){return ne})),r.d(t,"getSpeed",(function(){return ie})),r.d(t,"isDecimal",(function(){return g})),r.d(t,"isPointInLine",(function(){return oe})),r.d(t,"isPointInPolygon",(function(){return ae})),r.d(t,"isPointNearLine",(function(){return se})),r.d(t,"isPointWithinRadius",(function(){return le})),r.d(t,"isSexagesimal",(function(){return m})),r.d(t,"isValidCoordinate",(function(){return E})),r.d(t,"isValidLatitude",(function(){return M})),r.d(t,"isValidLongitude",(function(){return T})),r.d(t,"orderByDistance",(function(){return $})),r.d(t,"sexagesimalToDecimal",(function(){return b})),r.d(t,"toDecimal",(function(){return k})),r.d(t,"toRad",(function(){return I})),r.d(t,"toDeg",(function(){return N})),r.d(t,"wktToPolygon",(function(){return he})),r.d(t,"sexagesimalPattern",(function(){return n})),r.d(t,"earthRadius",(function(){return i})),r.d(t,"MINLAT",(function(){return o})),r.d(t,"MAXLAT",(function(){return a})),r.d(t,"MINLON",(function(){return s})),r.d(t,"MAXLON",(function(){return l})),r.d(t,"longitudeKeys",(function(){return u})),r.d(t,"latitudeKeys",(function(){return h})),r.d(t,"altitudeKeys",(function(){return c})),r.d(t,"distanceConversion",(function(){return d})),r.d(t,"timeConversion",(function(){return p})),r.d(t,"areaConversion",(function(){return f}));var n=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,i=6378137,o=-90,a=90,s=-180,l=180,u=["lng","lon","longitude",0],h=["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 y=function(e,t){return t.reduce((function(t,r){if(null==e)throw new Error("'".concat(e,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(e,r)&&void 0!==r&&void 0===t?(t=r,r):t}),void 0)},g=function(e){var t=e.toString().trim();return!isNaN(parseFloat(t))&&parseFloat(t)===Number(t)},m=function(e){return n.test(e.toString().trim())},b=function(e){var t=new RegExp(n).exec(e);if(null==t)throw new Error("Given value is not in sexagesimal format");var r=Number(t[2])/60||0,i=Number(t[4])/3600||0,o=parseFloat(t[1])+r+i;return["S","W"].includes(t[7])?-o:o};function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:u,latitude:h,altitude:c},r=y(e,t.longitude),n=y(e,t.latitude),i=y(e,t.altitude);return v({latitude:n,longitude:r},i?{altitude:i}:{})},M=function e(t){return g(t)?!(parseFloat(t)>a||t<o):!!m(t)&&e(b(t))},T=function e(t){return g(t)?!(parseFloat(t)>l||t<s):!!m(t)&&e(b(t))},E=function(e){var t=S(e),r=t.latitude,n=t.longitude;if(Array.isArray(e)&&e.length>=2)return T(e[0])&&M(e[1]);if(void 0===r||void 0===n)return!1;var i=e[n],o=e[r];return void 0!==o&&void 0!==i&&!1!==M(o)&&!1!==T(i)};function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){F(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var k=function e(t){if(g(t))return Number(t);if(m(t))return b(t);if(E(t)){var r=S(t);return Array.isArray(t)?t.map((function(t,r){return[0,1].includes(r)?e(t):t})):A(A(A({},t),r.latitude&&F({},r.latitude,e(t[r.latitude]))),r.longitude&&F({},r.longitude,e(t[r.longitude])))}return Array.isArray(t)?t.map((function(t){return E(t)?e(t):t})):t},x=function(e,t){var r=y(e,h);if(null!=r){var n=e[r];return!0===t?n:k(n)}},O=function(e,t){var r=y(e,u);if(null!=r){var n=e[r];return!0===t?n:k(n)}},I=function(e){return e*Math.PI/180},N=function(e){return 180*e/Math.PI},P=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,i=x(e),o=O(e),a=t/n,u=I(r),h=I(i),c=I(o),d=Math.asin(Math.sin(h)*Math.cos(a)+Math.cos(h)*Math.sin(a)*Math.cos(u)),p=c+Math.atan2(Math.sin(u)*Math.sin(a)*Math.cos(h),Math.cos(a)-Math.sin(h)*Math.sin(d)),f=N(p);return(f<s||f>l)&&(p=(p+3*Math.PI)%(2*Math.PI)-Math.PI,f=N(p)),{latitude:N(d),longitude:f}},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=f[t];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=d[t];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")},B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(t){case"kmh":return e*p.h*d.km;case"mph":return e*p.h*d.mi;default:return e}};function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var L=function(e){var t=Math.pow(10,12);return Math.round(e*t)/t},W=function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.toString().split("."),2),r=t[0],n=t[1],i=Math.abs(Number(r)),o=L(60*Number("0."+(n||0))),a=Math.floor(o),s=L(60*(o%a||0));return i+"° "+Number(a.toFixed(6)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+"' "+Number(s.toFixed(4)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+'"'},q=function(e){return e>1?1:e<-1?-1:e},z=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;r=void 0===r||isNaN(r)?1:r;var n=x(e),o=O(e),a=x(t),s=O(t),l=Math.acos(q(Math.sin(I(a))*Math.sin(I(n))+Math.cos(I(a))*Math.cos(I(n))*Math.cos(I(o)-I(s))))*i;return Math.round(l/r)*r},$=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z;return r="function"==typeof r?r:z,t.slice().sort((function(t,n){return r(e,t)-r(e,n)}))},U=function(e,t){return $(e,t)[0]},H=function(e){var t=0;if(e.length>2){for(var r,n,o,a=0;a<e.length;a++){a===e.length-2?(r=e.length-2,n=e.length-1,o=0):a===e.length-1?(r=e.length-1,n=0,o=1):(r=a,n=a+1,o=a+2);var s=O(e[r]),l=x(e[n]),u=O(e[o]);t+=(I(u)-I(s))*Math.sin(I(l))}t=t*i*i/2}return Math.abs(t)},G=function(e){if(!1===Array.isArray(e)||0===e.length)throw new Error("No points were given.");return e.reduce((function(e,t){var r=x(t),n=O(t);return{maxLat:Math.max(r,e.maxLat),minLat:Math.min(r,e.minLat),maxLng:Math.max(n,e.maxLng),minLng:Math.min(n,e.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})},V=function(e,t){var r,n,u=x(e),h=O(e),c=I(u),d=I(h),p=t/i,f=c-p,y=c+p,g=I(a),m=I(o),b=I(l),_=I(s);if(f>m&&y<g){var v=Math.asin(Math.sin(p)/Math.cos(c));(r=d-v)<_&&(r+=2*Math.PI),(n=d+v)>b&&(n-=2*Math.PI)}else f=Math.max(f,m),y=Math.min(y,g),r=_,n=b;return[{latitude:N(f),longitude:N(r)},{latitude:N(y),longitude:N(n)}]},Q=function(e){if(!1===Array.isArray(e)||0===e.length)return!1;var t=e.length,r=e.reduce((function(e,t){var r=I(x(t)),n=I(O(t));return{X:e.X+Math.cos(r)*Math.cos(n),Y:e.Y+Math.cos(r)*Math.sin(n),Z:e.Z+Math.sin(r)}}),{X:0,Y:0,Z:0}),n=r.X/t,i=r.Y/t,o=r.Z/t;return{longitude:N(Math.atan2(i,n)),latitude:N(Math.atan2(o,Math.sqrt(n*n+i*i)))}},Y=function(e){var t=G(e),r=t.minLat+(t.maxLat-t.minLat)/2,n=t.minLng+(t.maxLng-t.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(n.toFixed(6))}},J=function(e,t){var r=I(O(t))-I(O(e)),n=Math.log(Math.tan(I(x(t))/2+Math.PI/4)/Math.tan(I(x(e))/2+Math.PI/4));return Math.abs(r)>Math.PI&&(r=r>0?-1*(2*Math.PI-r):2*Math.PI+r),(N(Math.atan2(r,n))+360)%360},X=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J,n="function"==typeof r?r(e,t):J(e,t);if(isNaN(n))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(n/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}},Z=function(e,t,r){var n=z(t,e),i=z(e,r),o=z(t,r),a=Math.acos(q((n*n+o*o-i*i)/(2*n*o))),s=Math.acos(q((i*i+o*o-n*n)/(2*i*o)));return a>Math.PI/2?n:s>Math.PI/2?i:Math.sin(a)*n},K=function(e,t){var r=x(t),n=O(t),i=x(e),o=O(e);return(N(Math.atan2(Math.sin(I(n)-I(o))*Math.cos(I(r)),Math.cos(I(i))*Math.sin(I(r))-Math.sin(I(i))*Math.cos(I(r))*Math.cos(I(n)-I(o))))+360)%360};function ee(e){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;return e.reduce((function(e,r){return"object"===ee(e)&&null!==e.last&&(e.distance+=t(r,e.last)),e.last=r,e}),{last:null,distance:0}).distance},re=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;r=void 0===r||isNaN(r)?1:r;var n,o,a,s,l,u,h,c=x(e),d=O(e),p=x(t),f=O(t),y=6356752.314245,g=1/298.257223563,m=I(f-d),b=Math.atan((1-g)*Math.tan(I(parseFloat(c)))),_=Math.atan((1-g)*Math.tan(I(parseFloat(p)))),v=Math.sin(b),w=Math.cos(b),S=Math.sin(_),M=Math.cos(_),T=m,E=100;do{var R=Math.sin(T),A=Math.cos(T);if(0===(u=Math.sqrt(M*R*(M*R)+(w*S-v*M*A)*(w*S-v*M*A))))return 0;n=v*S+w*M*A,o=Math.atan2(u,n),l=n-2*v*S/(s=1-(a=w*M*R/u)*a),isNaN(l)&&(l=0);var F=g/16*s*(4+g*(4-3*s));h=T,T=m+(1-F)*g*a*(o+F*u*(l+F*n*(2*l*l-1)))}while(Math.abs(T-h)>1e-12&&--E>0);if(0===E)return NaN;var k=s*(i*i-y*y)/(y*y),N=1+k/16384*(4096+k*(k*(320-175*k)-768)),P=k/1024*(256+k*(k*(74-47*k)-128)),D=P*u*(l+P/4*(n*(2*l*l-1)-P/6*l*(4*u*u-3)*(4*l*l-3))),C=y*N*(o-D);return Math.round(C/r)*r},ne=function(e){return/^NNE|NE|NNW|N$/.test(e)?"N":/^ENE|E|ESE|SE$/.test(e)?"E":/^SSE|S|SSW|SW$/.test(e)?"S":/^WSW|W|WNW|NW$/.test(e)?"W":void 0},ie=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z,n=r(e,t),i=Number(t.time)-Number(e.time),o=n/i*1e3;return o},oe=function(e,t,r){return z(t,e)+z(e,r)===z(t,r)},ae=function(e,t){for(var r=!1,n=t.length,i=-1,o=n-1;++i<n;o=i)(O(t[i])<=O(e)&&O(e)<O(t[o])||O(t[o])<=O(e)&&O(e)<O(t[i]))&&x(e)<(x(t[o])-x(t[i]))*(O(e)-O(t[i]))/(O(t[o])-O(t[i]))+x(t[i])&&(r=!r);return r},se=function(e,t,r,n){return Z(e,t,r)<n},le=function(e,t,r){return z(e,t)<r};function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var he=function(e){if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ue(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ue(e,t)}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(" "),2),r=t[0],n=t[1];return{longitude:parseFloat(r),latitude:parseFloat(n)}}))}}])},"object"==typeof e&&"object"==typeof t?t.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof e?e.geolib=n():r.geolib=n()})),Zl=vt(((e,t)=>{j(),t.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))})),ru=vt(((e,t)=>{j();var r="%[a-f0-9]{2}",n=new RegExp(r,"gi"),i=new RegExp("("+r+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],o(r),o(n))}function a(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=i.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=a(r[0]);n!==r[0]&&(t[r[0]]=n)}r=i.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}})),ou=vt(((e,t)=>{j(),t.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}})),lu=vt(((e,t)=>{j(),t.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),o=0;o<n.length;o++){var a=n[o],s=e[a];(i?-1!==t.indexOf(a):t(a,s,e))&&(r[a]=s)}return r}})),gu=vt((e=>{j();var t=Zl(),r=ru(),n=ou(),i=lu(),o=Symbol("encodeFragmentIdentifier");function a(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(e,r){return r.encode?r.strict?t(e):encodeURIComponent(e):e}function l(e,t){return t.decode?r(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function h(e){let t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function c(e){let t=(e=h(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function p(e,t){a((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{let i="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!i&&l(r,e).includes(e.arrayFormatSeparator);r=o?l(r,e):r;let a=i||o?r.split(e.arrayFormatSeparator).map((t=>l(t,e))):null===r?r:l(r,e);n[t]=a};case"bracket-separator":return(t,r,n)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(n[t]=r&&l(r,e));let o=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>l(t,e)));void 0!==n[t]?n[t]=[].concat(n[t],o):n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(let o of e.split("&")){if(""===o)continue;let[e,a]=n(t.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:l(a,t),r(l(e,t),a,i)}for(let e of Object.keys(i)){let r=i[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=d(r[e],t);else i[e]=d(r,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{let r=i[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=u(r):e[t]=r,e}),Object.create(null))}e.extract=c,e.parse=p,e.stringify=(e,t)=>{if(!e)return"";a((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&(e=>null==e)(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[s(t,e),"[",i,"]"].join("")]:[...r,[s(t,e),"[",s(i,e),"]=",s(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[s(t,e),"[]"].join("")]:[...r,[s(t,e),"[]=",s(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[s(r,e),t,s(i,e)].join("")]:[[n,s(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,s(t,e)]:[...r,[s(t,e),"=",s(n,e)].join("")]}}(t),i={};for(let t of Object.keys(e))r(t)||(i[t]=e[t]);let o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((r=>{let i=e[r];return void 0===i?"":null===i?s(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?s(r,t)+"[]":i.reduce(n(r),[]).join("&"):s(r,t)+"="+s(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[r,i]=n(e,"#");return Object.assign({url:r.split("?")[0]||"",query:p(c(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:l(i,t)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0,[o]:!0},r);let n=h(t.url).split("?")[0]||"",i=e.extract(t.url),a=e.parse(i,{sort:!1}),l=Object.assign(a,t.query),u=e.stringify(l,r);u&&(u=`?${u}`);let c=function(e){let t="",r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(t.url);return t.fragmentIdentifier&&(c=`#${r[o]?s(t.fragmentIdentifier,r):t.fragmentIdentifier}`),`${n}${u}${c}`},e.pick=(t,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[o]:!1},n);let{url:a,query:s,fragmentIdentifier:l}=e.parseUrl(t,n);return e.stringifyUrl({url:a,query:i(s,r),fragmentIdentifier:l},n)},e.exclude=(t,r,n)=>{let i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return e.pick(t,i,n)}}));function Sh(e){if(!/^data:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');let t=(e=e.replace(/\r?\n/g,"")).indexOf(",");if(-1===t||t<=4)throw new TypeError("malformed data: URI");let r=e.substring(5,t).split(";"),n="",i=!1,o=r[0]||"text/plain",a=o;for(let e=1;e<r.length;e++)"base64"===r[e]?i=!0:(a+=`;${r[e]}`,0===r[e].indexOf("charset=")&&(n=r[e].substring(8)));!r[0]&&!n.length&&(a+=";charset=US-ASCII",n="US-ASCII");let s=i?"base64":"ascii",l=unescape(e.substring(t+1)),u=Buffer.from(l,s);return u.type=o,u.typeFull=a,u.charset=n,u}var _u,Su=Ve((()=>{j(),_u=Sh})),ju=vt(((e,t)=>{var r,n;j(),r=e,n=function(e){"use strict";let t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`;function r(){}let n="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function i(e){return"object"==typeof e&&null!==e||"function"==typeof e}let o=r,a=Promise,s=Promise.prototype.then,l=Promise.resolve.bind(a),u=Promise.reject.bind(a);function h(e){return new a(e)}function c(e){return l(e)}function d(e){return u(e)}function p(e,t,r){return s.call(e,t,r)}function f(e,t,r){p(p(e,t,r),void 0,o)}function y(e,t){f(e,t)}function g(e,t){f(e,void 0,t)}function m(e,t,r){return p(e,t,r)}function b(e){p(e,void 0,o)}let _=(()=>{let e=n&&n.queueMicrotask;if("function"==typeof e)return e;let t=c(void 0);return e=>p(t,e)})();function v(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function w(e,t,r){try{return c(v(e,t,r))}catch(e){return d(e)}}class S{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let t=this._back,r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){let e=this._front,t=e,r=this._cursor,n=r+1,i=e._elements,o=i[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,o}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&void 0===r._next||t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length));)e(n[t]),++t}peek(){let e=this._front,t=this._cursor;return e._elements[t]}}function M(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?A(e):"closed"===t._state?function(e){A(e),x(e)}(e):F(e,t._storedError)}function T(e,t){return Sr(e._ownerReadableStream,t)}function E(e){"readable"===e._ownerReadableStream._state?k(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){F(e,t)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function R(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function A(e){e._closedPromise=h(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function F(e,t){A(e),k(e,t)}function k(e,t){void 0!==e._closedPromise_reject&&(b(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function x(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}let O=t("[[AbortSteps]]"),I=t("[[ErrorSteps]]"),N=t("[[CancelSteps]]"),P=t("[[PullSteps]]"),D=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},C=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function B(e,t){if(void 0!==e&&!function(e){return"object"==typeof e||"function"==typeof e}(e))throw new TypeError(`${t} is not an object.`)}function j(e,t){if("function"!=typeof e)throw new TypeError(`${t} is not a function.`)}function L(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(`${t} is not an object.`)}function W(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function q(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function z(e){return Number(e)}function $(e){return 0===e?0:e}function U(e,t){let r=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=$(n),!D(n))throw new TypeError(`${t} is not a finite number`);if(n=function(e){return $(C(e))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return D(n)&&0!==n?n:0}function H(e,t){if(!vr(e))throw new TypeError(`${t} is not a ReadableStream.`)}function G(e){return new X(e)}function V(e,t){e._reader._readRequests.push(t)}function Q(e,t,r){let n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function Y(e){return e._reader._readRequests.length}function J(e){let t=e._reader;return!(void 0===t||!Z(t))}class X{constructor(e){if(W(e,1,"ReadableStreamDefaultReader"),H(e,"First parameter"),wr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");M(this,e),this._readRequests=new S}get closed(){return Z(this)?this._closedPromise:d(ee("closed"))}cancel(e){return Z(this)?void 0===this._ownerReadableStream?d(R("cancel")):T(this,e):d(ee("cancel"))}read(){if(!Z(this))return d(ee("read"));if(void 0===this._ownerReadableStream)return d(R("read from"));let e,t,r=h(((r,n)=>{e=r,t=n}));return K(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!Z(this))throw ee("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");E(this)}}}function Z(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_readRequests"))&&e instanceof X}function K(e,t){let r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[P](t)}function ee(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(X.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(X.prototype,t.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});let te=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class re{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){let e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?m(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let t=()=>this._returnSteps(e);return this._ongoingPromise?m(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let e=this._reader;if(void 0===e._ownerReadableStream)return d(R("iterate"));let t,r,n=h(((e,n)=>{t=e,r=n}));return K(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,_((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,E(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,E(e),r(t)}}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let t=this._reader;if(void 0===t._ownerReadableStream)return d(R("finish iterating"));if(!this._preventCancel){let r=T(t,e);return E(t),m(r,(()=>({value:e,done:!0})))}return E(t),c({value:e,done:!0})}}let ne={next(){return ie(this)?this._asyncIteratorImpl.next():d(oe("next"))},return(e){return ie(this)?this._asyncIteratorImpl.return(e):d(oe("return"))}};function ie(e){if(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof re}catch(e){return!1}}function oe(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}void 0!==te&&Object.setPrototypeOf(ne,te);let ae=Number.isNaN||function(e){return e!=e};function se(e){return e.slice()}function le(e,t,r,n,i){new Uint8Array(e).set(new Uint8Array(r,n,i),t)}function ue(e,t,r){if(e.slice)return e.slice(t,r);let n=r-t,i=new ArrayBuffer(n);return le(i,0,e,t,n),i}function he(e){let t=ue(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function ce(e){let t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function de(e,t,r){if(!function(e){return!("number"!=typeof e||ae(e)||e<0)}(r)||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function pe(e){e._queue=new S,e._queueTotalSize=0}class fe{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!me(this))throw Le("view");return this._view}respond(e){if(!me(this))throw Le("respond");if(W(e,1,"respond"),e=U(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,Ce(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!me(this))throw Le("respondWithNewView");if(W(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");e.buffer,Be(this._associatedReadableByteStreamController,e)}}Object.defineProperties(fe.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(fe.prototype,t.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class ye{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ge(this))throw We("byobRequest");return Pe(this)}get desiredSize(){if(!ge(this))throw We("desiredSize");return De(this)}close(){if(!ge(this))throw We("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);Oe(this)}enqueue(e){if(!ge(this))throw We("enqueue");if(W(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);Ie(this,e)}error(e){if(!ge(this))throw We("error");Ne(this,e)}[N](e){_e(this),pe(this);let t=this._cancelAlgorithm(e);return xe(this),t}[P](e){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0){let t=this._queue.shift();this._queueTotalSize-=t.byteLength,Ee(this);let r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return void e._chunkSteps(r)}let r=this._autoAllocateChunkSize;if(void 0!==r){let t;try{t=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}let n={buffer:t,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}V(t,e),be(this)}}function ge(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream"))&&e instanceof ye}function me(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController"))&&e instanceof fe}function be(e){(function(e){let t=e._controlledReadableByteStream;return!("readable"!==t._state||e._closeRequested||!e._started||!(J(t)&&Y(t)>0||Ue(t)&&$e(t)>0||De(e)>0))})(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,f(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,be(e))}),(t=>{Ne(e,t)}))))}function _e(e){Re(e),e._pendingPullIntos=new S}function ve(e,t){let r=!1;"closed"===e._state&&(r=!0);let n=we(t);"default"===t.readerType?Q(e,n,r):function(e,t,r){let n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function we(e){let t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Se(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Me(e,t){let r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),o=t.bytesFilled+i,a=o-o%r,s=i,l=!1;a>n&&(s=a-t.bytesFilled,l=!0);let u=e._queue;for(;s>0;){let r=u.peek(),n=Math.min(s,r.byteLength),i=t.byteOffset+t.bytesFilled;le(t.buffer,i,r.buffer,r.byteOffset,n),r.byteLength===n?u.shift():(r.byteOffset+=n,r.byteLength-=n),e._queueTotalSize-=n,Te(0,n,t),s-=n}return l}function Te(e,t,r){r.bytesFilled+=t}function Ee(e){0===e._queueTotalSize&&e._closeRequested?(xe(e),Mr(e._controlledReadableByteStream)):be(e)}function Re(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Ae(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;let t=e._pendingPullIntos.peek();Me(e,t)&&(ke(e),ve(e._controlledReadableByteStream,t))}}function Fe(e,t){let r=e._pendingPullIntos.peek();Re(e),"closed"===e._controlledReadableByteStream._state?function(e,t){let r=e._controlledReadableByteStream;if(Ue(r))for(;$e(r)>0;)ve(r,ke(e))}(e):function(e,t,r){if(Te(0,t,r),r.bytesFilled<r.elementSize)return;ke(e);let n=r.bytesFilled%r.elementSize;if(n>0){let t=r.byteOffset+r.bytesFilled,i=ue(r.buffer,t-n,t);Se(e,i,0,i.byteLength)}r.bytesFilled-=n,ve(e._controlledReadableByteStream,r),Ae(e)}(e,t,r),be(e)}function ke(e){return e._pendingPullIntos.shift()}function xe(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Oe(e){let t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state){if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){let t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ne(e,t),t}xe(e),Mr(t)}}function Ie(e,t){let r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;let n=t.buffer,i=t.byteOffset,o=t.byteLength,a=n;if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();t.buffer,t.buffer=t.buffer}Re(e),J(r)?0===Y(r)?Se(e,a,i,o):(e._pendingPullIntos.length>0&&ke(e),Q(r,new Uint8Array(a,i,o),!1)):Ue(r)?(Se(e,a,i,o),Ae(e)):Se(e,a,i,o),be(e)}function Ne(e,t){let r=e._controlledReadableByteStream;"readable"===r._state&&(_e(e),pe(e),xe(e),Tr(r,t))}function Pe(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=Object.create(fe.prototype);(function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r})(n,e,r),e._byobRequest=n}return e._byobRequest}function De(e){let t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Ce(e,t){let r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===t)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=r.buffer,Fe(e,t)}function Be(e,t){let r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t.byteLength)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===t.byteLength)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let n=t.byteLength;r.buffer=t.buffer,Fe(e,n)}function je(e,t,r,n,i,o,a){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,pe(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=o,t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=a,t._pendingPullIntos=new S,e._readableStreamController=t,f(c(r()),(()=>{t._started=!0,be(t)}),(e=>{Ne(t,e)}))}function Le(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function We(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function qe(e){return new He(e)}function ze(e,t){e._reader._readIntoRequests.push(t)}function $e(e){return e._reader._readIntoRequests.length}function Ue(e){let t=e._reader;return!(void 0===t||!Ge(t))}Object.defineProperties(ye.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ye.prototype,t.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class He{constructor(e){if(W(e,1,"ReadableStreamBYOBReader"),H(e,"First parameter"),wr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ge(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");M(this,e),this._readIntoRequests=new S}get closed(){return Ge(this)?this._closedPromise:d(Qe("closed"))}cancel(e){return Ge(this)?void 0===this._ownerReadableStream?d(R("cancel")):T(this,e):d(Qe("cancel"))}read(e){if(!Ge(this))return d(Qe("read"));if(!ArrayBuffer.isView(e))return d(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return d(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return d(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,void 0===this._ownerReadableStream)return d(R("read from"));let t,r,n=h(((e,n)=>{t=e,r=n}));return Ve(this,e,{_chunkSteps:e=>t({value:e,done:!1}),_closeSteps:e=>t({value:e,done:!0}),_errorSteps:e=>r(e)}),n}releaseLock(){if(!Ge(this))throw Qe("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");E(this)}}}function Ge(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests"))&&e instanceof He}function Ve(e,t,r){let n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){let n=e._controlledReadableByteStream,i=1;t.constructor!==DataView&&(i=t.constructor.BYTES_PER_ELEMENT);let o=t.constructor,a=t.buffer,s={buffer:a,bufferByteLength:a.byteLength,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:i,viewConstructor:o,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(s),void ze(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Me(e,s)){let t=we(s);return Ee(e),void r._chunkSteps(t)}if(e._closeRequested){let t=new TypeError("Insufficient bytes to fill elements in the given buffer");return Ne(e,t),void r._errorSteps(t)}}e._pendingPullIntos.push(s),ze(n,r),be(e)}else{let e=new o(s.buffer,s.byteOffset,0);r._closeSteps(e)}}(n._readableStreamController,t,r)}function Qe(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Ye(e,t){let{highWaterMark:r}=e;if(void 0===r)return t;if(ae(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function Je(e){let{size:t}=e;return t||(()=>1)}function Xe(e,t){B(e,t);let r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:z(r),size:void 0===n?void 0:Ze(n,`${t} has member 'size' that`)}}function Ze(e,t){return j(e,t),t=>z(e(t))}function Ke(e,t,r){return j(e,r),r=>w(e,t,[r])}function et(e,t,r){return j(e,r),()=>w(e,t,[])}function tt(e,t,r){return j(e,r),r=>v(e,t,[r])}function rt(e,t,r){return j(e,r),(r,n)=>w(e,t,[r,n])}function nt(e,t){if(!lt(e))throw new TypeError(`${t} is not a WritableStream.`)}Object.defineProperties(He.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(He.prototype,t.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});let it="function"==typeof AbortController;class ot{constructor(e={},t={}){void 0===e?e=null:L(e,"First parameter");let r=Xe(t,"Second parameter"),n=function(e,t){B(e,t);let r=null==e?void 0:e.abort,n=null==e?void 0:e.close,i=null==e?void 0:e.start,o=null==e?void 0:e.type,a=null==e?void 0:e.write;return{abort:void 0===r?void 0:Ke(r,e,`${t} has member 'abort' that`),close:void 0===n?void 0:et(n,e,`${t} has member 'close' that`),start:void 0===i?void 0:tt(i,e,`${t} has member 'start' that`),write:void 0===a?void 0:rt(a,e,`${t} has member 'write' that`),type:o}}(e,"First parameter");if(st(this),void 0!==n.type)throw new RangeError("Invalid type is specified");let i=Je(r);!function(e,t,r,n){let i=Object.create(Rt.prototype),o=()=>{},a=()=>c(void 0),s=()=>c(void 0),l=()=>c(void 0);void 0!==t.start&&(o=()=>t.start(i)),void 0!==t.write&&(a=e=>t.write(e,i)),void 0!==t.close&&(s=()=>t.close()),void 0!==t.abort&&(l=e=>t.abort(e)),Ft(e,i,o,a,s,l,r,n)}(this,n,Ye(r,1),i)}get locked(){if(!lt(this))throw Dt("locked");return ut(this)}abort(e){return lt(this)?ut(this)?d(new TypeError("Cannot abort a stream that already has a writer")):ht(this,e):d(Dt("abort"))}close(){return lt(this)?ut(this)?d(new TypeError("Cannot close a stream that already has a writer")):yt(this)?d(new TypeError("Cannot close an already-closing stream")):ct(this):d(Dt("close"))}getWriter(){if(!lt(this))throw Dt("getWriter");return at(this)}}function at(e){return new bt(e)}function st(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new S,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function lt(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_writableStreamController"))&&e instanceof ot}function ut(e){return void 0!==e._writer}function ht(e,t){var r;if("closed"===e._state||"errored"===e._state)return c(void 0);e._writableStreamController._abortReason=t,null===(r=e._writableStreamController._abortController)||void 0===r||r.abort();let n=e._state;if("closed"===n||"errored"===n)return c(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let i=!1;"erroring"===n&&(i=!0,t=void 0);let o=h(((r,n)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:n,_reason:t,_wasAlreadyErroring:i}}));return e._pendingAbortRequest._promise=o,i||pt(e,t),o}function ct(e){let t=e._state;if("closed"===t||"errored"===t)return d(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));let r=h(((t,r)=>{let n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;return void 0!==n&&e._backpressure&&"writable"===t&&Vt(n),function(e){de(e,Et,0),Ot(e)}(e._writableStreamController),r}function dt(e,t){"writable"!==e._state?ft(e):pt(e,t)}function pt(e,t){let r=e._writableStreamController;e._state="erroring",e._storedError=t;let n=e._writer;void 0!==n&&St(n,t),!function(e){return!(void 0===e._inFlightWriteRequest&&void 0===e._inFlightCloseRequest)}(e)&&r._started&&ft(e)}function ft(e){e._state="errored",e._writableStreamController[I]();let t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new S,void 0===e._pendingAbortRequest)return void gt(e);let r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void gt(e);f(e._writableStreamController[O](r._reason),(()=>{r._resolve(),gt(e)}),(t=>{r._reject(t),gt(e)}))}function yt(e){return!(void 0===e._closeRequest&&void 0===e._inFlightCloseRequest)}function gt(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let t=e._writer;void 0!==t&&qt(t,e._storedError)}function mt(e,t){let r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){$t(e)}(r):Vt(r)),e._backpressure=t}Object.defineProperties(ot.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ot.prototype,t.toStringTag,{value:"WritableStream",configurable:!0});class bt{constructor(e){if(W(e,1,"WritableStreamDefaultWriter"),nt(e,"First parameter"),ut(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;let t=e._state;if("writable"===t)!yt(e)&&e._backpressure?$t(this):Ht(this),Lt(this);else if("erroring"===t)Ut(this,e._storedError),Lt(this);else if("closed"===t)Ht(this),Lt(r=this),zt(r);else{let t=e._storedError;Ut(this,t),Wt(this,t)}var r}get closed(){return _t(this)?this._closedPromise:d(Bt("closed"))}get desiredSize(){if(!_t(this))throw Bt("desiredSize");if(void 0===this._ownerWritableStream)throw jt("desiredSize");return function(e){let t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:xt(t._writableStreamController)}(this)}get ready(){return _t(this)?this._readyPromise:d(Bt("ready"))}abort(e){return _t(this)?void 0===this._ownerWritableStream?d(jt("abort")):function(e,t){return ht(e._ownerWritableStream,t)}(this,e):d(Bt("abort"))}close(){if(!_t(this))return d(Bt("close"));let e=this._ownerWritableStream;return void 0===e?d(jt("close")):yt(e)?d(new TypeError("Cannot close an already-closing stream")):vt(this)}releaseLock(){if(!_t(this))throw Bt("releaseLock");void 0!==this._ownerWritableStream&&Mt(this)}write(e){return _t(this)?void 0===this._ownerWritableStream?d(jt("write to")):Tt(this,e):d(Bt("write"))}}function _t(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream"))&&e instanceof bt}function vt(e){return ct(e._ownerWritableStream)}function wt(e,t){"pending"===e._closedPromiseState?qt(e,t):function(e,t){Wt(e,t)}(e,t)}function St(e,t){"pending"===e._readyPromiseState?Gt(e,t):function(e,t){Ut(e,t)}(e,t)}function Mt(e){let t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");St(e,r),wt(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function Tt(e,t){let r=e._ownerWritableStream,n=r._writableStreamController,i=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return It(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return d(jt("write to"));let o=r._state;if("errored"===o)return d(r._storedError);if(yt(r)||"closed"===o)return d(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===o)return d(r._storedError);let a=function(e){return h(((t,r)=>{let n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{de(e,t,r)}catch(t){return void It(e,t)}let n=e._controlledWritableStream;yt(n)||"writable"!==n._state||mt(n,Nt(e)),Ot(e)}(n,t,i),a}Object.defineProperties(bt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(bt.prototype,t.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});let Et={};class Rt{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!At(this))throw Ct("abortReason");return this._abortReason}get signal(){if(!At(this))throw Ct("signal");if(void 0===this._abortController)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!At(this))throw Ct("error");"writable"===this._controlledWritableStream._state&&Pt(this,e)}[O](e){let t=this._abortAlgorithm(e);return kt(this),t}[I](){pe(this)}}function At(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream"))&&e instanceof Rt}function Ft(e,t,r,n,i,o,a,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,pe(t),t._abortReason=void 0,t._abortController=function(){if(it)return new AbortController}(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=a,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=o;let l=Nt(t);mt(e,l),f(c(r()),(()=>{t._started=!0,Ot(t)}),(r=>{t._started=!0,dt(e,r)}))}function kt(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function xt(e){return e._strategyHWM-e._queueTotalSize}function Ot(e){let t=e._controlledWritableStream;if(!e._started||void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void ft(t);if(0===e._queue.length)return;let r=function(e){return e._queue.peek().value}(e);r===Et?function(e){let t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),ce(e);let r=e._closeAlgorithm();kt(e),f(r,(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";let t=e._writer;void 0!==t&&zt(t)}(t)}),(e=>{!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),dt(e,t)}(t,e)}))}(e):function(e,t){let r=e._controlledWritableStream;(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(r),f(e._writeAlgorithm(t),(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);let t=r._state;if(ce(e),!yt(r)&&"writable"===t){let t=Nt(e);mt(r,t)}Ot(e)}),(t=>{"writable"===r._state&&kt(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,dt(e,t)}(r,t)}))}(e,r)}function It(e,t){"writable"===e._controlledWritableStream._state&&Pt(e,t)}function Nt(e){return xt(e)<=0}function Pt(e,t){let r=e._controlledWritableStream;kt(e),pt(r,t)}function Dt(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Ct(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Bt(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function jt(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Lt(e){e._closedPromise=h(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function Wt(e,t){Lt(e),qt(e,t)}function qt(e,t){void 0!==e._closedPromise_reject&&(b(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function zt(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function $t(e){e._readyPromise=h(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function Ut(e,t){$t(e),Gt(e,t)}function Ht(e){$t(e),Vt(e)}function Gt(e,t){void 0!==e._readyPromise_reject&&(b(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Vt(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Rt.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Rt.prototype,t.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});let Qt="undefined"!=typeof DOMException?DOMException:void 0,Yt=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(Qt)?Qt:function(){let e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Jt(e,t,n,i,o,a){let s=G(e),l=at(t);e._disturbed=!0;let u=!1,m=c(void 0);return h(((_,v)=>{let w;if(void 0!==a){if(w=()=>{let r=new Yt("Aborted","AbortError"),n=[];i||n.push((()=>"writable"===t._state?ht(t,r):c(void 0))),o||n.push((()=>"readable"===e._state?Sr(e,r):c(void 0))),F((()=>Promise.all(n.map((e=>e())))),!0,r)},a.aborted)return void w();a.addEventListener("abort",w)}if(A(e,s._closedPromise,(e=>{i?k(!0,e):F((()=>ht(t,e)),!0,e)})),A(t,l._closedPromise,(t=>{o?k(!0,t):F((()=>Sr(e,t)),!0,t)})),S=e,M=s._closedPromise,T=()=>{n?k():F((()=>function(e){let t=e._ownerWritableStream,r=t._state;return yt(t)||"closed"===r?c(void 0):"errored"===r?d(t._storedError):vt(e)}(l)))},"closed"===S._state?T():y(M,T),yt(t)||"closed"===t._state){let t=new TypeError("the destination writable stream closed before all data could be piped to it");o?k(!0,t):F((()=>Sr(e,t)),!0,t)}var S,M,T;function R(){let e=m;return p(m,(()=>e!==m?R():void 0))}function A(e,t,r){"errored"===e._state?r(e._storedError):g(t,r)}function F(e,r,n){function i(){f(e(),(()=>x(r,n)),(e=>x(!0,e)))}u||(u=!0,"writable"!==t._state||yt(t)?i():y(R(),i))}function k(e,r){u||(u=!0,"writable"!==t._state||yt(t)?x(e,r):y(R(),(()=>x(e,r))))}function x(e,t){Mt(l),E(s),void 0!==a&&a.removeEventListener("abort",w),e?v(t):_(void 0)}b(h(((e,t)=>{!function n(i){i?e():p(u?c(!0):p(l._readyPromise,(()=>h(((e,t)=>{K(s,{_chunkSteps:t=>{m=p(Tt(l,t),void 0,r),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),n,t)}(!1)})))}))}class Xt{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Zt(this))throw lr("desiredSize");return or(this)}close(){if(!Zt(this))throw lr("close");if(!ar(this))throw new TypeError("The stream is not in a state that permits close");rr(this)}enqueue(e){if(!Zt(this))throw lr("enqueue");if(!ar(this))throw new TypeError("The stream is not in a state that permits enqueue");return nr(this,e)}error(e){if(!Zt(this))throw lr("error");ir(this,e)}[N](e){pe(this);let t=this._cancelAlgorithm(e);return tr(this),t}[P](e){let t=this._controlledReadableStream;if(this._queue.length>0){let r=ce(this);this._closeRequested&&0===this._queue.length?(tr(this),Mr(t)):Kt(this),e._chunkSteps(r)}else V(t,e),Kt(this)}}function Zt(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream"))&&e instanceof Xt}function Kt(e){er(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,f(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Kt(e))}),(t=>{ir(e,t)}))))}function er(e){let t=e._controlledReadableStream;return!(!ar(e)||!e._started||!(wr(t)&&Y(t)>0||or(e)>0))}function tr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function rr(e){if(!ar(e))return;let t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(tr(e),Mr(t))}function nr(e,t){if(!ar(e))return;let r=e._controlledReadableStream;if(wr(r)&&Y(r)>0)Q(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw ir(e,t),t}try{de(e,t,r)}catch(t){throw ir(e,t),t}}Kt(e)}function ir(e,t){let r=e._controlledReadableStream;"readable"===r._state&&(pe(e),tr(e),Tr(r,t))}function or(e){let t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function ar(e){let t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function sr(e,t,r,n,i,o,a){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,pe(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=a,t._strategyHWM=o,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t,f(c(r()),(()=>{t._started=!0,Kt(t)}),(e=>{ir(t,e)}))}function lr(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function ur(e,t){return ge(e._readableStreamController)?function(e){let t,r,n,i,o,a=G(e),s=!1,l=!1,u=!1,d=!1,p=!1,f=h((e=>{o=e}));function y(e){g(e._closedPromise,(t=>{e===a&&(Ne(n._readableStreamController,t),Ne(i._readableStreamController,t),(!d||!p)&&o(void 0))}))}function m(){Ge(a)&&(E(a),a=G(e),y(a)),K(a,{_chunkSteps:t=>{_((()=>{l=!1,u=!1;let r=t,a=t;if(!d&&!p)try{a=he(t)}catch(t){return Ne(n._readableStreamController,t),Ne(i._readableStreamController,t),void o(Sr(e,t))}d||Ie(n._readableStreamController,r),p||Ie(i._readableStreamController,a),s=!1,l?v():u&&w()}))},_closeSteps:()=>{s=!1,d||Oe(n._readableStreamController),p||Oe(i._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&Ce(n._readableStreamController,0),i._readableStreamController._pendingPullIntos.length>0&&Ce(i._readableStreamController,0),(!d||!p)&&o(void 0)},_errorSteps:()=>{s=!1}})}function b(t,r){Z(a)&&(E(a),a=qe(e),y(a));let h=r?i:n,c=r?n:i;Ve(a,t,{_chunkSteps:t=>{_((()=>{l=!1,u=!1;let n=r?p:d;if(r?d:p)n||Be(h._readableStreamController,t);else{let r;try{r=he(t)}catch(t){return Ne(h._readableStreamController,t),Ne(c._readableStreamController,t),void o(Sr(e,t))}n||Be(h._readableStreamController,t),Ie(c._readableStreamController,r)}s=!1,l?v():u&&w()}))},_closeSteps:e=>{s=!1;let t=r?p:d,n=r?d:p;t||Oe(h._readableStreamController),n||Oe(c._readableStreamController),void 0!==e&&(t||Be(h._readableStreamController,e),!n&&c._readableStreamController._pendingPullIntos.length>0&&Ce(c._readableStreamController,0)),(!t||!n)&&o(void 0)},_errorSteps:()=>{s=!1}})}function v(){if(s)return l=!0,c(void 0);s=!0;let e=Pe(n._readableStreamController);return null===e?m():b(e._view,!1),c(void 0)}function w(){if(s)return u=!0,c(void 0);s=!0;let e=Pe(i._readableStreamController);return null===e?m():b(e._view,!0),c(void 0)}function S(n){if(d=!0,t=n,p){let n=se([t,r]),i=Sr(e,n);o(i)}return f}function M(n){if(p=!0,r=n,d){let n=se([t,r]),i=Sr(e,n);o(i)}return f}function T(){}return n=br(T,v,S),i=br(T,w,M),y(a),[n,i]}(e):function(e,t){let r,n,i,o,a,s=G(e),l=!1,u=!1,d=!1,p=!1,f=h((e=>{a=e}));function y(){return l?(u=!0,c(void 0)):(l=!0,K(s,{_chunkSteps:e=>{_((()=>{u=!1;let t=e,r=e;d||nr(i._readableStreamController,t),p||nr(o._readableStreamController,r),l=!1,u&&y()}))},_closeSteps:()=>{l=!1,d||rr(i._readableStreamController),p||rr(o._readableStreamController),(!d||!p)&&a(void 0)},_errorSteps:()=>{l=!1}}),c(void 0))}function m(t){if(d=!0,r=t,p){let t=se([r,n]),i=Sr(e,t);a(i)}return f}function b(t){if(p=!0,n=t,d){let t=se([r,n]),i=Sr(e,t);a(i)}return f}function v(){}return i=mr(v,y,m),o=mr(v,y,b),g(s._closedPromise,(e=>{ir(i._readableStreamController,e),ir(o._readableStreamController,e),(!d||!p)&&a(void 0)})),[i,o]}(e)}function hr(e,t,r){return j(e,r),r=>w(e,t,[r])}function cr(e,t,r){return j(e,r),r=>w(e,t,[r])}function dr(e,t,r){return j(e,r),r=>v(e,t,[r])}function pr(e,t){if("bytes"!=(e=`${e}`))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function fr(e,t){if("byob"!=(e=`${e}`))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function yr(e,t){B(e,t);let r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,i=null==e?void 0:e.preventClose,o=null==e?void 0:e.signal;return void 0!==o&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(`${t} is not an AbortSignal.`)}(o,`${t} has member 'signal' that`),{preventAbort:Boolean(r),preventCancel:Boolean(n),preventClose:Boolean(i),signal:o}}Object.defineProperties(Xt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Xt.prototype,t.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class gr{constructor(e={},t={}){void 0===e?e=null:L(e,"First parameter");let r=Xe(t,"Second parameter"),n=function(e,t){B(e,t);let r=e,n=null==r?void 0:r.autoAllocateChunkSize,i=null==r?void 0:r.cancel,o=null==r?void 0:r.pull,a=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:U(n,`${t} has member 'autoAllocateChunkSize' that`),cancel:void 0===i?void 0:hr(i,r,`${t} has member 'cancel' that`),pull:void 0===o?void 0:cr(o,r,`${t} has member 'pull' that`),start:void 0===a?void 0:dr(a,r,`${t} has member 'start' that`),type:void 0===s?void 0:pr(s,`${t} has member 'type' that`)}}(e,"First parameter");if(_r(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){let n=Object.create(ye.prototype),i=()=>{},o=()=>c(void 0),a=()=>c(void 0);void 0!==t.start&&(i=()=>t.start(n)),void 0!==t.pull&&(o=()=>t.pull(n)),void 0!==t.cancel&&(a=e=>t.cancel(e));let s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");je(e,n,i,o,a,r,s)}(this,n,Ye(r,0))}else{let e=Je(r);!function(e,t,r,n){let i=Object.create(Xt.prototype),o=()=>{},a=()=>c(void 0),s=()=>c(void 0);void 0!==t.start&&(o=()=>t.start(i)),void 0!==t.pull&&(a=()=>t.pull(i)),void 0!==t.cancel&&(s=e=>t.cancel(e)),sr(e,i,o,a,s,r,n)}(this,n,Ye(r,1),e)}}get locked(){if(!vr(this))throw Er("locked");return wr(this)}cancel(e){return vr(this)?wr(this)?d(new TypeError("Cannot cancel a stream that already has a reader")):Sr(this,e):d(Er("cancel"))}getReader(e){if(!vr(this))throw Er("getReader");return void 0===function(e,t){B(e,t);let r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:fr(r,`${t} has member 'mode' that`)}}(e,"First parameter").mode?G(this):qe(this)}pipeThrough(e,t={}){if(!vr(this))throw Er("pipeThrough");W(e,1,"pipeThrough");let r=function(e,t){B(e,t);let r=null==e?void 0:e.readable;q(r,"readable","ReadableWritablePair"),H(r,`${t} has member 'readable' that`);let n=null==e?void 0:e.writable;return q(n,"writable","ReadableWritablePair"),nt(n,`${t} has member 'writable' that`),{readable:r,writable:n}}(e,"First parameter"),n=yr(t,"Second parameter");if(wr(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(ut(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return b(Jt(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!vr(this))return d(Er("pipeTo"));if(void 0===e)return d("Parameter 1 is required in 'pipeTo'.");if(!lt(e))return d(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=yr(t,"Second parameter")}catch(e){return d(e)}return wr(this)?d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):ut(e)?d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Jt(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!vr(this))throw Er("tee");return se(ur(this))}values(e){if(!vr(this))throw Er("values");let t=function(e,t){B(e,t);let r=null==e?void 0:e.preventCancel;return{preventCancel:Boolean(r)}}(e,"First parameter");return function(e,t){let r=G(e),n=new re(r,t),i=Object.create(ne);return i._asyncIteratorImpl=n,i}(this,t.preventCancel)}}function mr(e,t,r,n=1,i=(()=>1)){let o=Object.create(gr.prototype);return _r(o),sr(o,Object.create(Xt.prototype),e,t,r,n,i),o}function br(e,t,r){let n=Object.create(gr.prototype);return _r(n),je(n,Object.create(ye.prototype),e,t,r,0,void 0),n}function _r(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function vr(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_readableStreamController"))&&e instanceof gr}function wr(e){return void 0!==e._reader}function Sr(e,t){if(e._disturbed=!0,"closed"===e._state)return c(void 0);if("errored"===e._state)return d(e._storedError);Mr(e);let n=e._reader;return void 0!==n&&Ge(n)&&(n._readIntoRequests.forEach((e=>{e._closeSteps(void 0)})),n._readIntoRequests=new S),m(e._readableStreamController[N](t),r)}function Mr(e){e._state="closed";let t=e._reader;void 0!==t&&(x(t),Z(t)&&(t._readRequests.forEach((e=>{e._closeSteps()})),t._readRequests=new S))}function Tr(e,t){e._state="errored",e._storedError=t;let r=e._reader;void 0!==r&&(k(r,t),Z(r)?(r._readRequests.forEach((e=>{e._errorSteps(t)})),r._readRequests=new S):(r._readIntoRequests.forEach((e=>{e._errorSteps(t)})),r._readIntoRequests=new S))}function Er(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Rr(e,t){B(e,t);let r=null==e?void 0:e.highWaterMark;return q(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:z(r)}}Object.defineProperties(gr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(gr.prototype,t.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof t.asyncIterator&&Object.defineProperty(gr.prototype,t.asyncIterator,{value:gr.prototype.values,writable:!0,configurable:!0});let Ar=e=>e.byteLength;try{Object.defineProperty(Ar,"name",{value:"size",configurable:!0})}catch(e){}class Fr{constructor(e){W(e,1,"ByteLengthQueuingStrategy"),e=Rr(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!xr(this))throw kr("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!xr(this))throw kr("size");return Ar}}function kr(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function xr(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark"))&&e instanceof Fr}Object.defineProperties(Fr.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Fr.prototype,t.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});let Or=()=>1;try{Object.defineProperty(Or,"name",{value:"size",configurable:!0})}catch(e){}class Ir{constructor(e){W(e,1,"CountQueuingStrategy"),e=Rr(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Pr(this))throw Nr("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Pr(this))throw Nr("size");return Or}}function Nr(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Pr(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark"))&&e instanceof Ir}function Dr(e,t,r){return j(e,r),r=>w(e,t,[r])}function Cr(e,t,r){return j(e,r),r=>v(e,t,[r])}function Br(e,t,r){return j(e,r),(r,n)=>w(e,t,[r,n])}Object.defineProperties(Ir.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Ir.prototype,t.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class jr{constructor(e={},t={},r={}){void 0===e&&(e=null);let n=Xe(t,"Second parameter"),i=Xe(r,"Third parameter"),o=function(e,t){B(e,t);let r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,o=null==e?void 0:e.transform,a=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Dr(r,e,`${t} has member 'flush' that`),readableType:n,start:void 0===i?void 0:Cr(i,e,`${t} has member 'start' that`),transform:void 0===o?void 0:Br(o,e,`${t} has member 'transform' that`),writableType:a}}(e,"First parameter");if(void 0!==o.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==o.writableType)throw new RangeError("Invalid writableType specified");let a,s=Ye(i,0),l=Je(i),u=Ye(n,1),p=Je(n);(function(e,t,r,n,i,o){function a(){return t}function s(t){return function(e,t){let r=e._transformStreamController;return e._backpressure?m(e._backpressureChangePromise,(()=>{let n=e._writable;if("erroring"===n._state)throw n._storedError;return Vr(r,t)})):Vr(r,t)}(e,t)}function l(t){return function(e,t){return Wr(e,t),c(void 0)}(e,t)}function u(){return function(e){let t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return Hr(r),m(n,(()=>{if("errored"===t._state)throw t._storedError;rr(t._readableStreamController)}),(r=>{throw Wr(e,r),t._storedError}))}(e)}function h(){return function(e){return zr(e,!1),e._backpressureChangePromise}(e)}function d(t){return qr(e,t),c(void 0)}e._writable=function(e,t,r,n,i=1,o=(()=>1)){let a=Object.create(ot.prototype);return st(a),Ft(a,Object.create(Rt.prototype),e,t,r,n,i,o),a}(a,s,u,l,r,n),e._readable=mr(a,h,d,i,o),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,zr(e,!0),e._transformStreamController=void 0})(this,h((e=>{a=e})),u,p,s,l),function(e,t){let r=Object.create($r.prototype),n=e=>{try{return Gr(r,e),c(void 0)}catch(e){return d(e)}},i=()=>c(void 0);void 0!==t.transform&&(n=e=>t.transform(e,r)),void 0!==t.flush&&(i=()=>t.flush(r)),function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,o),void 0!==o.start?a(o.start(this._transformStreamController)):a(void 0)}get readable(){if(!Lr(this))throw Yr("readable");return this._readable}get writable(){if(!Lr(this))throw Yr("writable");return this._writable}}function Lr(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_transformStreamController"))&&e instanceof jr}function Wr(e,t){ir(e._readable._readableStreamController,t),qr(e,t)}function qr(e,t){Hr(e._transformStreamController),It(e._writable._writableStreamController,t),e._backpressure&&zr(e,!1)}function zr(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=h((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(jr.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(jr.prototype,t.toStringTag,{value:"TransformStream",configurable:!0});class $r{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ur(this))throw Qr("desiredSize");return or(this._controlledTransformStream._readable._readableStreamController)}enqueue(e){if(!Ur(this))throw Qr("enqueue");Gr(this,e)}error(e){if(!Ur(this))throw Qr("error");!function(e,t){Wr(e._controlledTransformStream,t)}(this,e)}terminate(){if(!Ur(this))throw Qr("terminate");!function(e){let t=e._controlledTransformStream;rr(t._readable._readableStreamController);let r=new TypeError("TransformStream terminated");qr(t,r)}(this)}}function Ur(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream"))&&e instanceof $r}function Hr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Gr(e,t){let r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!ar(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{nr(n,t)}catch(e){throw qr(r,e),r._readable._storedError}(function(e){return!er(e)})(n)!==r._backpressure&&zr(r,!0)}function Vr(e,t){return m(e._transformAlgorithm(t),void 0,(t=>{throw Wr(e._controlledTransformStream,t),t}))}function Qr(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Yr(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties($r.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty($r.prototype,t.toStringTag,{value:"TransformStreamDefaultController",configurable:!0}),e.ByteLengthQueuingStrategy=Fr,e.CountQueuingStrategy=Ir,e.ReadableByteStreamController=ye,e.ReadableStream=gr,e.ReadableStreamBYOBReader=He,e.ReadableStreamBYOBRequest=fe,e.ReadableStreamDefaultController=Xt,e.ReadableStreamDefaultReader=X,e.TransformStream=jr,e.TransformStreamDefaultController=$r,e.WritableStream=ot,e.WritableStreamDefaultController=Rt,e.WritableStreamDefaultWriter=bt,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?n(e):"function"==typeof define&&define.amd?define(["exports"],n):n((r="undefined"!=typeof globalThis?globalThis:r||self).WebStreamsPolyfill={})})),Ru=vt((()=>{j();if(!globalThis.ReadableStream)try{let e=require("node:process"),{emitWarning:t}=e;try{e.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),e.emitWarning=t}catch(r){throw e.emitWarning=t,r}}catch(e){Object.assign(globalThis,ju())}try{let{Blob:e}=require("buffer");e&&!e.prototype.stream&&(e.prototype.stream=function(e){let t=0,r=this;return new ReadableStream({type:"bytes",async pull(e){let n=await r.slice(t,Math.min(r.size,t+65536)).arrayBuffer();t+=n.byteLength,e.enqueue(new Uint8Array(n)),t===r.size&&e.close()}})})}catch(e){}}));async function*Zo(e,t=!0){for(let r of e)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(t){let e=r.byteOffset,t=r.byteOffset+r.byteLength;for(;e!==t;){let n=Math.min(t-e,xu),i=r.buffer.slice(e,e+n);e+=i.byteLength,yield new Uint8Array(i)}}else yield r;else{let e=0,t=r;for(;e!==t.size;){let r=await t.slice(e,Math.min(t.size,e+xu)).arrayBuffer();e+=r.byteLength,yield new Uint8Array(r)}}}var Xm,xu,Jt,Ir,Sa,Ji,Ta,Eu,jh,Et,zr,Cr,Au,Rh,xh,gn,Or=Ve((()=>{j(),Xm=Ne(Ru()),xu=65536,Ta=class{constructor(e=[],t={}){if(F(this,Jt,[]),F(this,Ir,""),F(this,Sa,0),F(this,Ji,"transparent"),"object"!=typeof e||null===e)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if("function"!=typeof e[Symbol.iterator])throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");null===t&&(t={});let r=new TextEncoder;for(let t of e){let e;e=ArrayBuffer.isView(t)?new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)):t instanceof ArrayBuffer?new Uint8Array(t.slice(0)):t instanceof Ta?t:r.encode(`${t}`),D(this,Sa,f(this,Sa)+(ArrayBuffer.isView(e)?e.byteLength:e.size)),f(this,Jt).push(e)}D(this,Ji,`${void 0===t.endings?"transparent":t.endings}`);let n=void 0===t.type?"":String(t.type);D(this,Ir,/^[\x20-\x7E]*$/.test(n)?n:"")}get size(){return f(this,Sa)}get type(){return f(this,Ir)}async text(){let e=new TextDecoder,t="";for await(let r of Zo(f(this,Jt),!1))t+=e.decode(r,{stream:!0});return t+=e.decode(),t}async arrayBuffer(){let e=new Uint8Array(this.size),t=0;for await(let r of Zo(f(this,Jt),!1))e.set(r,t),t+=r.length;return e.buffer}stream(){let e=Zo(f(this,Jt),!0);return new globalThis.ReadableStream({type:"bytes",async pull(t){let r=await e.next();r.done?t.close():t.enqueue(r.value)},async cancel(){await e.return()}})}slice(e=0,t=this.size,r=""){let{size:n}=this,i=e<0?Math.max(n+e,0):Math.min(e,n),o=t<0?Math.max(n+t,0):Math.min(t,n),a=Math.max(o-i,0),s=f(this,Jt),l=[],u=0;for(let e of s){if(u>=a)break;let t=ArrayBuffer.isView(e)?e.byteLength:e.size;if(i&&t<=i)i-=t,o-=t;else{let r;ArrayBuffer.isView(e)?(r=e.subarray(i,Math.min(t,o)),u+=r.byteLength):(r=e.slice(i,Math.min(t,o)),u+=r.size),o-=t,l.push(r),i=0}}let h=new Ta([],{type:String(r).toLowerCase()});return D(h,Sa,a),D(h,Jt,l),h}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&"object"==typeof e&&"function"==typeof e.constructor&&("function"==typeof e.stream||"function"==typeof e.arrayBuffer)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}},Jt=new WeakMap,Ir=new WeakMap,Sa=new WeakMap,Ji=new WeakMap,Eu=Ta,Object.defineProperties(Eu.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Et=jh=Eu})),es=Ve((()=>{j(),Or(),Au=class extends Et{constructor(e,t,r={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,r),F(this,zr,0),F(this,Cr,""),null===r&&(r={});let n=void 0===r.lastModified?Date.now():Number(r.lastModified);Number.isNaN(n)||D(this,zr,n),D(this,Cr,String(t))}get name(){return f(this,Cr)}get lastModified(){return f(this,zr)}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof Et&&/^(File)$/.test(e[Symbol.toStringTag])}},zr=new WeakMap,Cr=new WeakMap,gn=xh=Rh=Au}));function zu(e,t=Et){var r=`${Iu()}${Iu()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r\nContent-Disposition: form-data; name="`;return e.forEach(((e,t)=>"string"==typeof e?n.push(i+ts(t)+`"\r\n\r\n${e.replace(/\r(?!\n)|(?<!\r)\n/g,"\r\n")}\r\n`):n.push(i+ts(t)+`"; filename="${ts(e.name,1)}"\r\nContent-Type: ${e.type||"application/octet-stream"}\r\n\r\n`,e,"\r\n"))),n.push(`--${r}--`),new t(n,{type:"multipart/form-data; boundary="+r})}var Pr,Eh,Ah,Iu,Ih,Ou,ts,Dn,wt,Cu,yn,bn,ct,Ki,as,Fr,Pu,Fu,Nu,qn,Du,qu,rs,Wu,Gu,Uu,Vu,$u,Hu,Wn,Gn,os,is,Xi=Ve((()=>{j(),Or(),es(),({toStringTag:Pr,iterator:Eh,hasInstance:Ah}=Symbol),Iu=Math.random,Ih="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),Ou=(e,t,r)=>(e+="",/^(Blob|File)$/.test(t&&t[Pr])?[(r=void 0!==r?r+"":"File"==t[Pr]?t.name:"blob",e),t.name!==r||"blob"==t[Pr]?new gn([t],r,t):t]:[e,t+""]),ts=(e,t)=>(t?e:e.replace(/\r?\n|\r/g,"\r\n")).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Dn=(e,t,r)=>{if(t.length<r)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${r} arguments required, but only ${t.length} present.`)},Cu=class{constructor(...e){if(F(this,wt,[]),e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Pr](){return"FormData"}[Eh](){return this.entries()}static[Ah](e){return e&&"object"==typeof e&&"FormData"===e[Pr]&&!Ih.some((t=>"function"!=typeof e[t]))}append(...e){Dn("append",arguments,2),f(this,wt).push(Ou(...e))}delete(e){Dn("delete",arguments,1),e+="",D(this,wt,f(this,wt).filter((([t])=>t!==e)))}get(e){Dn("get",arguments,1),e+="";for(var t=f(this,wt),r=t.length,n=0;n<r;n++)if(t[n][0]===e)return t[n][1];return null}getAll(e,t){return Dn("getAll",arguments,1),t=[],e+="",f(this,wt).forEach((r=>r[0]===e&&t.push(r[1]))),t}has(e){return Dn("has",arguments,1),e+="",f(this,wt).some((t=>t[0]===e))}forEach(e,t){for(var[r,n]of(Dn("forEach",arguments,1),this))e.call(t,n,r,this)}set(...e){Dn("set",arguments,2);var t=[],r=!0;e=Ou(...e),f(this,wt).forEach((n=>{n[0]===e[0]?r&&(r=!t.push(e)):t.push(n)})),r&&t.push(e),D(this,wt,t)}*entries(){yield*f(this,wt)}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}},wt=new WeakMap,yn=Cu})),Qi=Ve((()=>{j(),bn=class extends Error{constructor(e,t){super(e),Error.captureStackTrace(this,this.constructor),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}})),ns=Ve((()=>{j(),Qi(),ct=class extends bn{constructor(e,t,r){super(e,t),r&&(this.code=this.errno=r.code,this.erroredSysCall=r.syscall)}}})),Zi=Ve((()=>{j(),Ki=Symbol.toStringTag,as=e=>"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&"function"==typeof e.sort&&"URLSearchParams"===e[Ki],Fr=e=>e&&"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&/^(Blob|File)$/.test(e[Ki]),Pu=e=>"object"==typeof e&&("AbortSignal"===e[Ki]||"EventTarget"===e[Ki]),Fu=(e,t)=>{let r=new URL(t).hostname,n=new URL(e).hostname;return r===n||r.endsWith(`.${n}`)},Nu=(e,t)=>new URL(t).protocol===new URL(e).protocol})),Lu=vt(((e,t)=>{if(j(),!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),t=(new e).port1,r=new ArrayBuffer;t.postMessage(r,[r,r])}catch(e){"DOMException"===e.constructor.name&&(globalThis.DOMException=e.constructor)}t.exports=globalThis.DOMException})),ss=Ve((()=>{j(),qn=Ne(require("node:fs")),Du=Ne(require("node:path")),qu=Ne(Lu()),es(),Or(),({stat:rs}=qn.promises),Wu=(e,t)=>$u((0,qn.statSync)(e),e,t),Gu=(e,t)=>rs(e).then((r=>$u(r,e,t))),Uu=(e,t)=>rs(e).then((r=>Hu(r,e,t))),Vu=(e,t)=>Hu((0,qn.statSync)(e),e,t),$u=(e,t,r="")=>new Et([new is({path:t,size:e.size,lastModified:e.mtimeMs,start:0})],{type:r}),Hu=(e,t,r="")=>new gn([new is({path:t,size:e.size,lastModified:e.mtimeMs,start:0})],(0,Du.basename)(t),{type:r,lastModified:e.mtimeMs}),os=class{constructor(e){F(this,Wn,void 0),F(this,Gn,void 0),D(this,Wn,e.path),D(this,Gn,e.start),this.size=e.size,this.lastModified=e.lastModified}slice(e,t){return new os({path:f(this,Wn),lastModified:this.lastModified,size:t-e,start:f(this,Gn)+e})}async*stream(){let{mtimeMs:e}=await rs(f(this,Wn));if(e>this.lastModified)throw new qu.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,qn.createReadStream)(f(this,Wn),{start:f(this,Gn),end:f(this,Gn)+this.size-1})}get[Symbol.toStringTag](){return"Blob"}},is=os,Wn=new WeakMap,Gn=new WeakMap})),Xu={};function Nh(e){let t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let r=t[2]||t[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,((e,t)=>String.fromCharCode(t))),n}async function Bh(e,t){if(!/multipart/i.test(t))throw new TypeError("Failed to fetch");let r=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let n,i,o,a,s,l,u=new Ju(r[1]||r[2]),h=[],c=new yn,d=e=>{o+=g.decode(e,{stream:!0})},p=e=>{h.push(e)},f=()=>{let e=new gn(h,l,{type:s});c.append(a,e)},y=()=>{c.append(a,o)},g=new TextDecoder("utf-8");g.decode(),u.onPartBegin=function(){u.onPartData=d,u.onPartEnd=y,n="",i="",o="",a="",s="",l=null,h.length=0},u.onHeaderField=function(e){n+=g.decode(e,{stream:!0})},u.onHeaderValue=function(e){i+=g.decode(e,{stream:!0})},u.onHeaderEnd=function(){if(i+=g.decode(),n=n.toLowerCase(),"content-disposition"===n){let e=i.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);e&&(a=e[2]||e[3]||""),l=Nh(i),l&&(u.onPartData=p,u.onPartEnd=f)}else"content-type"===n&&(s=i);i="",n=""};for await(let t of e)u.write(t);return u.end(),c}Po(Xu,{toFormData:()=>Bh});var Dt,Ce,Yu,kn,eo,to,Oh,Nr,zh,Ch,Ph,Fh,Un,Ju,Qu=Ve((()=>{j(),ss(),Xi(),Dt=0,Ce={START_BOUNDARY:Dt++,HEADER_FIELD_START:Dt++,HEADER_FIELD:Dt++,HEADER_VALUE_START:Dt++,HEADER_VALUE:Dt++,HEADER_VALUE_ALMOST_DONE:Dt++,HEADERS_ALMOST_DONE:Dt++,PART_DATA_START:Dt++,PART_DATA:Dt++,END:Dt++},kn={PART_BOUNDARY:Yu=1,LAST_BOUNDARY:Yu*=2},eo=10,to=13,Oh=32,Nr=45,zh=58,Ch=97,Ph=122,Fh=e=>32|e,Un=()=>{},Ju=class{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=Un,this.onHeaderField=Un,this.onHeadersEnd=Un,this.onHeaderValue=Un,this.onPartBegin=Un,this.onPartData=Un,this.onPartEnd=Un,this.boundaryChars={},e="\r\n--"+e;let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r),this.boundaryChars[t[r]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Ce.START_BOUNDARY}write(e){let t,r,n=0,i=e.length,o=this.index,{lookbehind:a,boundary:s,boundaryChars:l,index:u,state:h,flags:c}=this,d=this.boundary.length,p=d-1,f=e.length,y=e=>{this[e+"Mark"]=n},g=e=>{delete this[e+"Mark"]},m=(e,t,r,n)=>{(void 0===t||t!==r)&&this[e](n&&n.subarray(t,r))},b=(t,r)=>{let i=t+"Mark";i in this&&(r?(m(t,this[i],n,e),delete this[i]):(m(t,this[i],e.length,e),this[i]=0))};for(n=0;n<i;n++)switch(t=e[n],h){case Ce.START_BOUNDARY:if(u===s.length-2){if(t===Nr)c|=kn.LAST_BOUNDARY;else if(t!==to)return;u++;break}if(u-1==s.length-2){if(c&kn.LAST_BOUNDARY&&t===Nr)h=Ce.END,c=0;else{if(c&kn.LAST_BOUNDARY||t!==eo)return;u=0,m("onPartBegin"),h=Ce.HEADER_FIELD_START}break}t!==s[u+2]&&(u=-2),t===s[u+2]&&u++;break;case Ce.HEADER_FIELD_START:h=Ce.HEADER_FIELD,y("onHeaderField"),u=0;case Ce.HEADER_FIELD:if(t===to){g("onHeaderField"),h=Ce.HEADERS_ALMOST_DONE;break}if(u++,t===Nr)break;if(t===zh){if(1===u)return;b("onHeaderField",!0),h=Ce.HEADER_VALUE_START;break}if(r=Fh(t),r<Ch||r>Ph)return;break;case Ce.HEADER_VALUE_START:if(t===Oh)break;y("onHeaderValue"),h=Ce.HEADER_VALUE;case Ce.HEADER_VALUE:t===to&&(b("onHeaderValue",!0),m("onHeaderEnd"),h=Ce.HEADER_VALUE_ALMOST_DONE);break;case Ce.HEADER_VALUE_ALMOST_DONE:if(t!==eo)return;h=Ce.HEADER_FIELD_START;break;case Ce.HEADERS_ALMOST_DONE:if(t!==eo)return;m("onHeadersEnd"),h=Ce.PART_DATA_START;break;case Ce.PART_DATA_START:h=Ce.PART_DATA,y("onPartData");case Ce.PART_DATA:if(o=u,0===u){for(n+=p;n<f&&!(e[n]in l);)n+=d;n-=p,t=e[n]}if(u<s.length)s[u]===t?(0===u&&b("onPartData",!0),u++):u=0;else if(u===s.length)u++,t===to?c|=kn.PART_BOUNDARY:t===Nr?c|=kn.LAST_BOUNDARY:u=0;else if(u-1===s.length)if(c&kn.PART_BOUNDARY){if(u=0,t===eo){c&=~kn.PART_BOUNDARY,m("onPartEnd"),m("onPartBegin"),h=Ce.HEADER_FIELD_START;break}}else c&kn.LAST_BOUNDARY&&t===Nr?(m("onPartEnd"),h=Ce.END,c=0):u=0;if(u>0)a[u-1]=t;else if(o>0){let e=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);m("onPartData",0,o,e),o=0,y("onPartData"),n--}break;case Ce.END:break;default:throw new Error(`Unexpected state entered: ${h}`)}b("onHeaderField"),b("onHeaderValue"),b("onPartData"),this.index=u,this.state=h,this.flags=c}end(){if(this.state===Ce.HEADER_FIELD_START&&0===this.index||this.state===Ce.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Ce.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}}));async function ls(e){if(e[dt].disturbed)throw new TypeError(`body used already for: ${e.url}`);if(e[dt].disturbed=!0,e[dt].error)throw e[dt].error;let{body:t}=e;if(null===t)return yt.Buffer.alloc(0);if(!(t instanceof Mt.default))return yt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of t){if(e.size>0&&n+i.length>e.size){let r=new ct(`content size at ${e.url} over limit: ${e.size}`,"max-size");throw t.destroy(r),r}n+=i.length,r.push(i)}}catch(t){throw t instanceof bn?t:new ct(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t)}if(!0!==t.readableEnded&&!0!==t._readableState.ended)throw new ct(`Premature close of server response while trying to fetch ${e.url}`);try{return r.every((e=>"string"==typeof e))?yt.Buffer.from(r.join("")):yt.Buffer.concat(r,n)}catch(t){throw new ct(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t)}}var Mt,Xt,yt,Lh,dt,Qt,ja,Dh,no,Ku,Zu,ao=Ve((()=>{j(),Mt=Ne(require("node:stream")),Xt=Ne(require("node:util")),yt=Ne(require("node:buffer")),Or(),Xi(),ns(),Qi(),Zi(),Lh=(0,Xt.promisify)(Mt.default.pipeline),dt=Symbol("Body internals"),(Qt=class{constructor(e,{size:t=0}={}){let r=null;null===e?e=null:as(e)?e=yt.Buffer.from(e.toString()):Fr(e)||yt.Buffer.isBuffer(e)||(Xt.types.isAnyArrayBuffer(e)?e=yt.Buffer.from(e):ArrayBuffer.isView(e)?e=yt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof Mt.default||(e instanceof yn?r=(e=zu(e)).type.split("=")[1]:e=yt.Buffer.from(String(e))));let n=e;yt.Buffer.isBuffer(e)?n=Mt.default.Readable.from(e):Fr(e)&&(n=Mt.default.Readable.from(e.stream())),this[dt]={body:e,stream:n,boundary:r,disturbed:!1,error:null},this.size=t,e instanceof Mt.default&&e.on("error",(e=>{let t=e instanceof bn?e:new ct(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,"system",e);this[dt].error=t}))}get body(){return this[dt].stream}get bodyUsed(){return this[dt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:t,byteLength:r}=await ls(this);return e.slice(t,t+r)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let e=new yn,t=new URLSearchParams(await this.text());for(let[r,n]of t)e.append(r,n);return e}let{toFormData:t}=await Promise.resolve().then((()=>(Qu(),Xu)));return t(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[dt].body&&this[dt].body.type||"",t=await this.arrayBuffer();return new Et([t],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await ls(this);return(new TextDecoder).decode(e)}buffer(){return ls(this)}}).prototype.buffer=(0,Xt.deprecate)(Qt.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(Qt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Xt.deprecate)((()=>{}),"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}}),ja=(e,t)=>{let r,n,{body:i}=e[dt];if(e.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof Mt.default&&"function"!=typeof i.getBoundary&&(r=new Mt.PassThrough({highWaterMark:t}),n=new Mt.PassThrough({highWaterMark:t}),i.pipe(r),i.pipe(n),e[dt].stream=r,i=n),i},Dh=(0,Xt.deprecate)((e=>e.getBoundary()),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),no=(e,t)=>null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":as(e)?"application/x-www-form-urlencoded;charset=UTF-8":Fr(e)?e.type||null:yt.Buffer.isBuffer(e)||Xt.types.isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof yn?`multipart/form-data; boundary=${t[dt].boundary}`:e&&"function"==typeof e.getBoundary?`multipart/form-data;boundary=${Dh(e)}`:e instanceof Mt.default?null:"text/plain;charset=UTF-8",Ku=e=>{let{body:t}=e[dt];return null===t?0:Fr(t)?t.size:yt.Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},Zu=async(e,{body:t})=>{null===t?e.end():await Lh(t,e)}}));function ec(e=[]){return new ht(e.reduce(((e,t,r,n)=>(r%2==0&&e.push(n.slice(r,r+2)),e)),[]).filter((([e,t])=>{try{return ro(e),cs(e,String(t)),!0}catch{return!1}})))}var us,Br,ro,cs,ht,qh,Lr,At,tt,nc,io=Ve((()=>{j(),us=Ne(require("node:util")),Br=Ne(require("node:http")),ro="function"==typeof Br.default.validateHeaderName?Br.default.validateHeaderName:e=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),t}},cs="function"==typeof Br.default.validateHeaderValue?Br.default.validateHeaderValue:(e,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let t=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_CHAR"}),t}},ht=class extends URLSearchParams{constructor(e){let t=[];if(e instanceof ht){let r=e.raw();for(let[e,n]of Object.entries(r))t.push(...n.map((t=>[e,t])))}else if(null!=e){if("object"!=typeof e||us.types.isBoxedPrimitive(e))throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");{let r=e[Symbol.iterator];if(null==r)t.push(...Object.entries(e));else{if("function"!=typeof r)throw new TypeError("Header pairs must be iterable");t=[...e].map((e=>{if("object"!=typeof e||us.types.isBoxedPrimitive(e))throw new TypeError("Each header pair must be an iterable object");return[...e]})).map((e=>{if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");return[...e]}))}}}return t=t.length>0?t.map((([e,t])=>(ro(e),cs(e,String(t)),[String(e).toLowerCase(),String(t)]))):void 0,super(t),new Proxy(this,{get(e,t,r){switch(t){case"append":case"set":return(r,n)=>(ro(r),cs(r,String(n)),URLSearchParams.prototype[t].call(e,String(r).toLowerCase(),String(n)));case"delete":case"has":case"getAll":return r=>(ro(r),URLSearchParams.prototype[t].call(e,String(r).toLowerCase()));case"keys":return()=>(e.sort(),new Set(URLSearchParams.prototype.keys.call(e)).keys());default:return Reflect.get(e,t,r)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let t=this.getAll(e);if(0===t.length)return null;let r=t.join(", ");return/^content-encoding$/i.test(e)&&(r=r.toLowerCase()),r}forEach(e,t){for(let r of this.keys())Reflect.apply(e,t,[this.get(r),r,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce(((e,t)=>(e[t]=this.getAll(t),e)),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce(((e,t)=>{let r=this.getAll(t);return e[t]="host"===t?r[0]:r.length>1?r:r[0],e}),{})}},Object.defineProperties(ht.prototype,["get","entries","forEach","values"].reduce(((e,t)=>(e[t]={enumerable:!0},e)),{}))})),ds=Ve((()=>{j(),qh=new Set([301,302,303,307,308]),Lr=e=>qh.has(e)})),tc=Ve((()=>{j(),io(),ao(),ds(),At=Symbol("Response internals"),tt=class extends Qt{constructor(e=null,t={}){super(e,t);let r=null!=t.status?t.status:200,n=new ht(t.headers);if(null!==e&&!n.has("Content-Type")){let t=no(e,this);t&&n.append("Content-Type",t)}this[At]={type:"default",url:t.url,status:r,statusText:t.statusText||"",headers:n,counter:t.counter,highWaterMark:t.highWaterMark}}get type(){return this[At].type}get url(){return this[At].url||""}get status(){return this[At].status}get ok(){return this[At].status>=200&&this[At].status<300}get redirected(){return this[At].counter>0}get statusText(){return this[At].statusText}get headers(){return this[At].headers}get highWaterMark(){return this[At].highWaterMark}clone(){return new tt(ja(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,t=302){if(!Lr(t))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new tt(null,{headers:{location:new URL(e).toString()},status:t})}static error(){let e=new tt(null,{status:0,statusText:""});return e[At].type="error",e}get[Symbol.toStringTag](){return"Response"}},Object.defineProperties(tt.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})})),ac=Ve((()=>{j(),nc=e=>{if(e.search)return e.search;let t=e.href.length-1,r=e.hash||("#"===e.href[t]?"#":"");return"?"===e.href[t-r.length]?"?":""}}));function ic(e,t=!1){return null==e||(e=new URL(e),/^(about|blob|data):$/.test(e.protocol))?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}function lc(e){if(!oc.has(e))throw new TypeError(`Invalid referrerPolicy: ${e}`);return e}function Wh(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,""),r=(0,rc.isIP)(t);return!!(4===r&&/^127\./.test(t)||6===r&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t))||"localhost"!==e.host&&!e.host.endsWith(".localhost")&&"file:"===e.protocol}function Ra(e){return!(!/^about:(blank|srcdoc)$/.test(e)&&"data:"!==e.protocol&&!/^(blob|filesystem):$/.test(e.protocol))||Wh(e)}function uc(e,{referrerURLCallback:t,referrerOriginCallback:r}={}){if("no-referrer"===e.referrer||""===e.referrerPolicy)return null;let n=e.referrerPolicy;if("about:client"===e.referrer)return"no-referrer";let i=e.referrer,o=ic(i),a=ic(i,!0);o.toString().length>4096&&(o=a),t&&(o=t(o)),r&&(a=r(a));let s=new URL(e.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return a;case"unsafe-url":return o;case"strict-origin":return Ra(o)&&!Ra(s)?"no-referrer":a.toString();case"strict-origin-when-cross-origin":return o.origin===s.origin?o:Ra(o)&&!Ra(s)?"no-referrer":a;case"same-origin":return o.origin===s.origin?o:"no-referrer";case"origin-when-cross-origin":return o.origin===s.origin?o:a;case"no-referrer-when-downgrade":return Ra(o)&&!Ra(s)?"no-referrer":o;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function cc(e){let t=(e.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let e of t)e&&oc.has(e)&&(r=e);return r}var rc,oc,sc,dc,hc,Qe,Dr,Gh,Kt,pc,oo,hs=Ve((()=>{j(),rc=Ne(require("node:net")),oc=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),sc="strict-origin-when-cross-origin"})),fc=Ve((()=>{j(),dc=Ne(require("node:url")),hc=Ne(require("node:util")),io(),ao(),Zi(),ac(),hs(),Qe=Symbol("Request internals"),Dr=e=>"object"==typeof e&&"object"==typeof e[Qe],Gh=(0,hc.deprecate)((()=>{}),".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Kt=class extends Qt{constructor(e,t={}){let r;if(Dr(e)?r=new URL(e.url):(r=new URL(e),e={}),""!==r.username||""!==r.password)throw new TypeError(`${r} is an url with embedded credentials.`);let n=t.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(n)&&(n=n.toUpperCase()),!Dr(t)&&"data"in t&&Gh(),(null!=t.body||Dr(e)&&null!==e.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let i=t.body?t.body:Dr(e)&&null!==e.body?ja(e):null;super(i,{size:t.size||e.size||0});let o=new ht(t.headers||e.headers||{});if(null!==i&&!o.has("Content-Type")){let e=no(i,this);e&&o.set("Content-Type",e)}let a=Dr(e)?e.signal:null;if("signal"in t&&(a=t.signal),null!=a&&!Pu(a))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let s=null==t.referrer?e.referrer:t.referrer;if(""===s)s="no-referrer";else if(s){let e=new URL(s);s=/^about:(\/\/)?client$/.test(e)?"client":e}else s=void 0;this[Qe]={method:n,redirect:t.redirect||e.redirect||"follow",headers:o,parsedURL:r,signal:a,referrer:s},this.follow=void 0===t.follow?void 0===e.follow?20:e.follow:t.follow,this.compress=void 0===t.compress?void 0===e.compress||e.compress:t.compress,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent,this.highWaterMark=t.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=t.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=t.referrerPolicy||e.referrerPolicy||""}get method(){return this[Qe].method}get url(){return(0,dc.format)(this[Qe].parsedURL)}get headers(){return this[Qe].headers}get redirect(){return this[Qe].redirect}get signal(){return this[Qe].signal}get referrer(){return"no-referrer"===this[Qe].referrer?"":"client"===this[Qe].referrer?"about:client":this[Qe].referrer?this[Qe].referrer.toString():void 0}get referrerPolicy(){return this[Qe].referrerPolicy}set referrerPolicy(e){this[Qe].referrerPolicy=lc(e)}clone(){return new Kt(this)}get[Symbol.toStringTag](){return"Request"}},Object.defineProperties(Kt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}}),pc=e=>{let{parsedURL:t}=e[Qe],r=new ht(e[Qe].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(null===e.body&&/^(post|put)$/i.test(e.method)&&(n="0"),null!==e.body){let t=Ku(e);"number"==typeof t&&!Number.isNaN(t)&&(n=String(t))}n&&r.set("Content-Length",n),""===e.referrerPolicy&&(e.referrerPolicy=sc),e.referrer&&"no-referrer"!==e.referrer?e[Qe].referrer=uc(e):e[Qe].referrer="no-referrer",e[Qe].referrer instanceof URL&&r.set("Referer",e.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=e;"function"==typeof i&&(i=i(t)),!r.has("Connection")&&!i&&r.set("Connection","close");let o=nc(t);return{parsedURL:t,options:{path:t.pathname+o,method:e.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:e.insecureHTTPParser,agent:i}}}})),mc=Ve((()=>{j(),Qi(),oo=class extends bn{constructor(e,t="aborted"){super(e,t)}}})),bc={};async function ps(e,t){return new Promise(((r,n)=>{let i=new Kt(e,t),{parsedURL:o,options:a}=pc(i);if(!Uh.has(o.protocol))throw new TypeError(`node-fetch cannot load ${e}. URL scheme "${o.protocol.replace(/:$/,"")}" is not supported.`);if("data:"===o.protocol){let e=_u(i.url),t=new tt(e,{headers:{"Content-Type":e.typeFull}});return void r(t)}let s=("https:"===o.protocol?yc.default:gc.default).request,{signal:l}=i,u=null,h=()=>{let e=new oo("The operation was aborted.");n(e),i.body&&i.body instanceof bt.default.Readable&&i.body.destroy(e),u&&u.body&&u.body.emit("error",e)};if(l&&l.aborted)return void h();let c=()=>{h(),p()},d=s(o.toString(),a);l&&l.addEventListener("abort",c);let p=()=>{d.abort(),l&&l.removeEventListener("abort",c)};d.on("error",(e=>{n(new ct(`request to ${i.url} failed, reason: ${e.message}`,"system",e)),p()})),Vh(d,(e=>{u&&u.body&&u.body.destroy(e)})),G.version<"v14"&&d.on("socket",(e=>{let t;e.prependListener("end",(()=>{t=e._eventsCount})),e.prependListener("close",(r=>{if(u&&t<e._eventsCount&&!r){let e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",u.body.emit("error",e)}}))})),d.on("response",(e=>{d.setTimeout(0);let o=ec(e.rawHeaders);if(Lr(e.statusCode)){let a=o.get("Location"),s=null;try{s=null===a?null:new URL(a,i.url)}catch{if("manual"!==i.redirect)return n(new ct(`uri requested responds with an invalid redirect URL: ${a}`,"invalid-redirect")),void p()}switch(i.redirect){case"error":return n(new ct(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),void p();case"manual":break;case"follow":{if(null===s)break;if(i.counter>=i.follow)return n(new ct(`maximum redirect reached at: ${i.url}`,"max-redirect")),void p();let a={headers:new ht(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:ja(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!Fu(i.url,s)||!Nu(i.url,s))for(let e of["authorization","www-authenticate","cookie","cookie2"])a.headers.delete(e);if(303!==e.statusCode&&i.body&&t.body instanceof bt.default.Readable)return n(new ct("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void p();(303===e.statusCode||(301===e.statusCode||302===e.statusCode)&&"POST"===i.method)&&(a.method="GET",a.body=void 0,a.headers.delete("content-length"));let l=cc(o);return l&&(a.referrerPolicy=l),r(ps(new Kt(s,a))),void p()}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}l&&e.once("end",(()=>{l.removeEventListener("abort",c)}));let a=(0,bt.pipeline)(e,new bt.PassThrough,(e=>{e&&n(e)}));G.version<"v12.10"&&e.on("aborted",c);let s={url:i.url,status:e.statusCode,statusText:e.statusMessage,headers:o,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},h=o.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===h||204===e.statusCode||304===e.statusCode)return u=new tt(a,s),void r(u);let f={flush:Vn.default.Z_SYNC_FLUSH,finishFlush:Vn.default.Z_SYNC_FLUSH};if("gzip"===h||"x-gzip"===h)return a=(0,bt.pipeline)(a,Vn.default.createGunzip(f),(e=>{e&&n(e)})),u=new tt(a,s),void r(u);if("deflate"===h||"x-deflate"===h){let t=(0,bt.pipeline)(e,new bt.PassThrough,(e=>{e&&n(e)}));return t.once("data",(e=>{a=8==(15&e[0])?(0,bt.pipeline)(a,Vn.default.createInflate(),(e=>{e&&n(e)})):(0,bt.pipeline)(a,Vn.default.createInflateRaw(),(e=>{e&&n(e)})),u=new tt(a,s),r(u)})),void t.once("end",(()=>{u||(u=new tt(a,s),r(u))}))}if("br"===h)return a=(0,bt.pipeline)(a,Vn.default.createBrotliDecompress(),(e=>{e&&n(e)})),u=new tt(a,s),void r(u);u=new tt(a,s),r(u)})),Zu(d,i).catch(n)}))}function Vh(e,t){let r,n=qr.Buffer.from("0\r\n\r\n"),i=!1,o=!1;e.on("response",(e=>{let{headers:t}=e;i="chunked"===t["transfer-encoding"]&&!t["content-length"]})),e.on("socket",(a=>{let s=()=>{if(i&&!o){let e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}},l=e=>{o=0===qr.Buffer.compare(e.slice(-5),n),!o&&r&&(o=0===qr.Buffer.compare(r.slice(-3),n.slice(0,3))&&0===qr.Buffer.compare(e.slice(-2),n.slice(3))),r=e};a.prependListener("close",s),a.on("data",l),e.on("close",(()=>{a.removeListener("close",s),a.removeListener("data",l)}))}))}Po(bc,{AbortError:()=>oo,Blob:()=>Et,FetchError:()=>ct,File:()=>gn,FormData:()=>yn,Headers:()=>ht,Request:()=>Kt,Response:()=>tt,blobFrom:()=>Gu,blobFromSync:()=>Wu,default:()=>ps,fileFrom:()=>Uu,fileFromSync:()=>Vu,isRedirect:()=>Lr});var gc,yc,Vn,bt,qr,Uh,kc=Ve((()=>{j(),gc=Ne(require("node:http")),yc=Ne(require("node:https")),Vn=Ne(require("node:zlib")),bt=Ne(require("node:stream")),qr=Ne(require("node:buffer")),Su(),ao(),tc(),io(),fc(),ns(),mc(),ds(),Xi(),Zi(),hs(),ss(),Uh=new Set(["data:","http:","https:"])})),wc=vt(((e,t)=>{j();var r=(kc(),bc),n=r.default||r,i=function(e,t){return/^\/\//.test(e)&&(e="https:"+e),n.call(this,e,t)};i.ponyfill=!0,t.exports=e=i,e.fetch=i,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,e.default=i})),Mc=vt(((e,t)=>{var r,n;j(),r=e,n=function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};function t(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}var n,i="KEYS",o="VALUES",a="",s=function(){function e(e,t){var r=e._tree,n=Array.from(r.keys());this.set=e,this._type=t,this._path=n.length>0?[{node:r,keys:n}]:[]}return e.prototype.next=function(){var e=this.dive();return this.backtrack(),e},e.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var e=l(this._path),t=e.node,r=e.keys;if(l(r)===a)return{done:!1,value:this.result()};var n=t.get(l(r));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},e.prototype.backtrack=function(){if(0!==this._path.length){var e=l(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},e.prototype.key=function(){return this.set._prefix+this._path.map((function(e){var t=e.keys;return l(t)})).filter((function(e){return e!==a})).join("")},e.prototype.value=function(){return l(this._path).node.get(a)},e.prototype.result=function(){switch(this._type){case o:return this.value();case i:return this.key();default:return[this.key(),this.value()]}},e.prototype[Symbol.iterator]=function(){return this},e}(),l=function(e){return e[e.length-1]},u=function(e,r,n,i,o,s,l,h){var c,d,p=s*l;try{e:for(var f=t(e.keys()),y=f.next();!y.done;y=f.next()){var g=y.value;if(g===a){var m=o[p-1];m<=n&&i.set(h,[e.get(g),m])}else{for(var b=s,_=0;_<g.length;++_,++b){for(var v=g[_],w=l*b,S=w-l,M=o[w],T=Math.max(0,b-n-1),E=Math.min(l-1,b+n),R=T;R<E;++R){var A=v!==r[R],F=o[S+R]+ +A,k=o[S+R+1]+1,x=o[w+R]+1,O=o[w+R+1]=Math.min(F,k,x);O<M&&(M=O)}if(M>n)continue e}u(e.get(g),r,n,i,o,b,l,h+g)}}}catch(e){c={error:e}}finally{try{y&&!y.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}},h=function(){function e(e,t){void 0===e&&(e=new Map),void 0===t&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return e.prototype.atPrefix=function(n){var i,o;if(!n.startsWith(this._prefix))throw new Error("Mismatched prefix");var s=r(c(this._tree,n.slice(this._prefix.length)),2),l=s[0],u=s[1];if(void 0===l){var h=r(m(u),2),d=h[0],p=h[1];try{for(var f=t(d.keys()),y=f.next();!y.done;y=f.next()){var g=y.value;if(g!==a&&g.startsWith(p)){var b=new Map;return b.set(g.slice(p.length),d.get(g)),new e(b,n)}}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}return new e(l,n)},e.prototype.clear=function(){this._size=void 0,this._tree.clear()},e.prototype.delete=function(e){return this._size=void 0,f(this._tree,e)},e.prototype.entries=function(){return new s(this,"ENTRIES")},e.prototype.forEach=function(e){var n,i;try{for(var o=t(this),a=o.next();!a.done;a=o.next()){var s=r(a.value,2);e(s[0],s[1],this)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.fuzzyGet=function(e,t){return function(e,t,r){var n=new Map;if(void 0===t)return n;for(var i=t.length+1,o=i+r,a=new Uint8Array(o*i).fill(r+1),s=0;s<i;++s)a[s]=s;for(var l=1;l<o;++l)a[l*i]=l;return u(e,t,r,n,a,1,i,""),n}(this._tree,e,t)},e.prototype.get=function(e){var t=d(this._tree,e);return void 0!==t?t.get(a):void 0},e.prototype.has=function(e){var t=d(this._tree,e);return void 0!==t&&t.has(a)},e.prototype.keys=function(){return new s(this,i)},e.prototype.set=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");return this._size=void 0,p(this._tree,e).set(a,t),this},Object.defineProperty(e.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var r=p(this._tree,e);return r.set(a,t(r.get(a))),this},e.prototype.fetch=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var r=p(this._tree,e),n=r.get(a);return void 0===n&&r.set(a,n=t()),n},e.prototype.values=function(){return new s(this,o)},e.prototype[Symbol.iterator]=function(){return this.entries()},e.from=function(n){var i,o,a=new e;try{for(var s=t(n),l=s.next();!l.done;l=s.next()){var u=r(l.value,2),h=u[0],c=u[1];a.set(h,c)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a},e.fromObject=function(t){return e.from(Object.entries(t))},e}(),c=function(e,r,n){var i,o;if(void 0===n&&(n=[]),0===r.length||null==e)return[e,n];try{for(var s=t(e.keys()),l=s.next();!l.done;l=s.next()){var u=l.value;if(u!==a&&r.startsWith(u))return n.push([e,u]),c(e.get(u),r.slice(u.length),n)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return n.push([e,r]),c(void 0,"",n)},d=function(e,r){var n,i;if(0===r.length||null==e)return e;try{for(var o=t(e.keys()),s=o.next();!s.done;s=o.next()){var l=s.value;if(l!==a&&r.startsWith(l))return d(e.get(l),r.slice(l.length))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},p=function(e,r){var n,i,o=r.length;e:for(var s=0;e&&s<o;){try{for(var l=(n=void 0,t(e.keys())),u=l.next();!u.done;u=l.next()){var h=u.value;if(h!==a&&r[s]===h[0]){for(var c=Math.min(o-s,h.length),d=1;d<c&&r[s+d]===h[d];)++d;var p=e.get(h);if(d===h.length)e=p;else{var f=new Map;f.set(h.slice(d),p),e.set(r.slice(s,s+d),f),e.delete(h),e=f}s+=d;continue e}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}var y=new Map;return e.set(r.slice(s),y),y}return e},f=function(e,t){var n=r(c(e,t),2),i=n[0],o=n[1];if(void 0!==i)if(i.delete(a),0===i.size)y(o);else if(1===i.size){var s=r(i.entries().next().value,2),l=s[0],u=s[1];g(o,l,u)}},y=function(e){if(0!==e.length){var t=r(m(e),2),n=t[0],i=t[1];if(n.delete(i),0===n.size)y(e.slice(0,-1));else if(1===n.size){var o=r(n.entries().next().value,2),s=o[0],l=o[1];s!==a&&g(e.slice(0,-1),s,l)}}},g=function(e,t,n){if(0!==e.length){var i=r(m(e),2),o=i[0],a=i[1];o.set(a+t,n),o.delete(a)}},m=function(e){return e[e.length-1]},b="or",_=function(){function n(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=e(e(e({},T),t),{searchOptions:e(e({},E),t.searchOptions||{})}),this._index=new h,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 n.prototype.add=function(e){var r,n,i,o,a=this._options,s=a.extractField,l=a.tokenize,u=a.processTerm,h=a.fields,c=a.idField,d=s(e,c);if(null==d)throw new Error('MiniSearch: document does not have ID field "'.concat(c,'"'));var p=this.addDocumentId(d);this.saveStoredFields(p,e);try{for(var f=t(h),y=f.next();!y.done;y=f.next()){var g=y.value,m=s(e,g);if(null!=m){var b=l(m.toString(),g),_=this._fieldIds[g],v=new Set(b).size;this.addFieldLength(p,_,this._documentCount-1,v);try{for(var w=(i=void 0,t(b)),S=w.next();!S.done;S=w.next()){var M=u(S.value,g);M&&this.addTerm(_,p,M)}}catch(e){i={error:e}}finally{try{S&&!S.done&&(o=w.return)&&o.call(w)}finally{if(i)throw i.error}}}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}},n.prototype.addAll=function(e){var r,n;try{for(var i=t(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.add(a)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},n.prototype.addAllAsync=function(e,t){var r=this;void 0===t&&(t={});var n=t.chunkSize,i=void 0===n?10:n,o={chunk:[],promise:Promise.resolve()},a=e.reduce((function(e,t,n){var o=e.chunk,a=e.promise;return o.push(t),(n+1)%i==0?{chunk:[],promise:a.then((function(){return new Promise((function(e){return setTimeout(e,0)}))})).then((function(){return r.addAll(o)}))}:{chunk:o,promise:a}}),o),s=a.chunk;return a.promise.then((function(){return r.addAll(s)}))},n.prototype.remove=function(e){var n,i,o,a,s,l,u=this._options,h=u.tokenize,c=u.processTerm,d=u.extractField,p=u.fields,f=u.idField,y=d(e,f);if(null==y)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));try{for(var g=t(this._documentIds),m=g.next();!m.done;m=g.next()){var b=r(m.value,2),_=b[0];if(y===b[1]){try{for(var v=(o=void 0,t(p)),w=v.next();!w.done;w=v.next()){var S=w.value,M=d(e,S);if(null!=M){var T=h(M.toString(),S),E=this._fieldIds[S],R=new Set(T).size;this.removeFieldLength(_,E,this._documentCount,R);try{for(var A=(s=void 0,t(T)),F=A.next();!F.done;F=A.next()){var k=c(F.value,S);k&&this.removeTerm(E,_,k)}}catch(e){s={error:e}}finally{try{F&&!F.done&&(l=A.return)&&l.call(A)}finally{if(s)throw s.error}}}}}catch(e){o={error:e}}finally{try{w&&!w.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}return this._storedFields.delete(_),this._documentIds.delete(_),this._fieldLength.delete(_),void(this._documentCount-=1)}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(n)throw n.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(y,": it is not in the index"))},n.prototype.removeAll=function(e){var r,n;if(e)try{for(var i=t(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.remove(a)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new h,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.search=function(e,n){var i,o;void 0===n&&(n={});var a=this.executeQuery(e,n),s=[];try{for(var l=t(a),u=l.next();!u.done;u=l.next()){var h=r(u.value,2),c=h[0],d=h[1],p=d.score,f=d.terms,y=d.match,g=f.length,m={id:this._documentIds.get(c),score:p*g,terms:Object.keys(y),match:y};Object.assign(m,this._storedFields.get(c)),(null==n.filter||n.filter(m))&&s.push(m)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return s.sort(k),s},n.prototype.autoSuggest=function(n,i){var o,a,s,l;void 0===i&&(i={}),i=e(e({},R),i);var u=new Map;try{for(var h=t(this.search(n,i)),c=h.next();!c.done;c=h.next()){var d=c.value,p=d.score,f=(w=d.terms).join(" ");null!=(_=u.get(f))?(_.score+=p,_.count+=1):u.set(f,{score:p,terms:w,count:1})}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}var y=[];try{for(var g=t(u),m=g.next();!m.done;m=g.next()){var b=r(m.value,2),_=b[0],v=b[1],w=(p=v.score,v.terms),S=v.count;y.push({suggestion:_,terms:w,score:p/S})}}catch(e){s={error:e}}finally{try{m&&!m.done&&(l=g.return)&&l.call(g)}finally{if(s)throw s.error}}return y.sort(k),y},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(null==t)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return n.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(T.hasOwnProperty(e))return v(T,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,i){var o,a,s,l,u=e.index,c=e.documentCount,d=e.nextId,p=e.documentIds,f=e.fieldIds,y=e.fieldLength,g=e.averageFieldLength,m=e.storedFields,b=e.serializationVersion;if(1!==b&&2!==b)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var _=new n(i);_._documentCount=c,_._nextId=d,_._documentIds=O(p),_._fieldIds=f,_._fieldLength=O(y),_._avgFieldLength=g,_._storedFields=O(m),_._index=new h;try{for(var v=t(u),w=v.next();!w.done;w=v.next()){var S=r(w.value,2),M=S[0],T=S[1],E=new Map;try{for(var R=(s=void 0,t(Object.keys(T))),A=R.next();!A.done;A=R.next()){var F=A.value,k=T[F];1===b&&(k=k.ds),E.set(parseInt(F,10),O(k))}}catch(e){s={error:e}}finally{try{A&&!A.done&&(l=R.return)&&l.call(R)}finally{if(s)throw s.error}}_._index.set(M,E)}}catch(e){o={error:e}}finally{try{w&&!w.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}return _},n.prototype.executeQuery=function(t,r){var n=this;if(void 0===r&&(r={}),"string"!=typeof t){var i=e(e(e({},r),t),{queries:void 0}),o=t.queries.map((function(e){return n.executeQuery(e,i)}));return this.combineResults(o,t.combineWith)}var a=this._options,s=a.tokenize,l=a.processTerm,u=a.searchOptions,h=e(e({tokenize:s,processTerm:l},u),r),c=h.tokenize,d=h.processTerm,p=c(t).map((function(e){return d(e)})).filter((function(e){return!!e})).map(M(h)).map((function(e){return n.executeQuerySpec(e,h)}));return this.combineResults(p,h.combineWith)},n.prototype.executeQuerySpec=function(n,i){var o,a,s,l,u,h,c=e(e({},this._options.searchOptions),i),d=(c.fields||this._options.fields).reduce((function(t,r){var n;return e(e({},t),((n={})[r]=v(t,r)||1,n))}),c.boost||{}),p=c.boostDocument,f=c.weights,y=c.maxFuzzy,g=e(e({},E.weights),f),m=g.fuzzy,b=g.prefix,_=this._index.get(n.term),w=this.termResults(n.term,n.term,1,_,d,p);if(n.prefix&&(u=this._index.atPrefix(n.term)),n.fuzzy){var S=!0===n.fuzzy?.2:n.fuzzy,M=S<1?Math.min(y,Math.round(n.term.length*S)):S;M&&(h=this._index.fuzzyGet(n.term,M))}if(u)try{for(var T=t(u),R=T.next();!R.done;R=T.next()){var A=r(R.value,2),F=A[0],k=A[1];if(N=F.length-n.term.length){null==h||h.delete(F);var x=b*F.length/(F.length+.3*N);this.termResults(n.term,F,x,k,d,p,w)}}}catch(e){o={error:e}}finally{try{R&&!R.done&&(a=T.return)&&a.call(T)}finally{if(o)throw o.error}}if(h)try{for(var O=t(h.keys()),I=O.next();!I.done;I=O.next()){F=I.value;var N,P=r(h.get(F),2),D=P[0];(N=P[1])&&(x=m*F.length/(F.length+N),this.termResults(n.term,F,x,D,d,p,w))}}catch(e){s={error:e}}finally{try{I&&!I.done&&(l=O.return)&&l.call(O)}finally{if(s)throw s.error}}return w},n.prototype.combineResults=function(e,t){if(void 0===t&&(t=b),0===e.length)return new Map;var r=t.toLowerCase();return e.reduce(w[r])||new Map},n.prototype.toJSON=function(){var e,n,i,o,a=[];try{for(var s=t(this._index),l=s.next();!l.done;l=s.next()){var u=r(l.value,2),h=u[0],c=u[1],d={};try{for(var p=(i=void 0,t(c)),f=p.next();!f.done;f=p.next()){var y=r(f.value,2),g=y[0],m=y[1];d[g]=Object.fromEntries(m)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}a.push([h,d])}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.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:a,serializationVersion:2}},n.prototype.termResults=function(e,r,n,i,o,a,s){var l,u,h,c,d;if(void 0===s&&(s=new Map),null==i)return s;try{for(var p=t(Object.keys(o)),f=p.next();!f.done;f=p.next()){var y=f.value,g=o[y],m=this._fieldIds[y],b=i.get(m);if(null!=b){var _=b.size,w=this._avgFieldLength[m];try{for(var M=(h=void 0,t(b.keys())),T=M.next();!T.done;T=M.next()){var E=T.value,R=a?a(this._documentIds.get(E),r):1;if(R){var F=b.get(E),k=this._fieldLength.get(E)[m],x=n*g*R*S(F,_,this._documentCount,k,w),O=s.get(E);if(O){O.score+=x,A(O.terms,e);var I=v(O.match,r);I?I.push(y):O.match[r]=[y]}else s.set(E,{score:x,terms:[e],match:(d={},d[r]=[y],d)})}}}catch(e){h={error:e}}finally{try{T&&!T.done&&(c=M.return)&&c.call(M)}finally{if(h)throw h.error}}}}}catch(e){l={error:e}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}return s},n.prototype.addTerm=function(e,t,r){var n=this._index.fetch(r,x),i=n.get(e);if(null==i)(i=new Map).set(t,1),n.set(e,i);else{var o=i.get(t);i.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,r){if(this._index.has(r)){var n=this._index.fetch(r,x),i=n.get(e);null==i||null==i.get(t)?this.warnDocumentChanged(t,e,r):i.get(t)<=1?i.size<=1?n.delete(e):i.delete(t):i.set(t,i.get(t)-1),0===this._index.get(r).size&&this._index.delete(r)}else this.warnDocumentChanged(t,e,r)},n.prototype.warnDocumentChanged=function(e,r,n){var i,o;if(null!=console&&null!=console.warn)try{for(var a=t(Object.keys(this._fieldIds)),s=a.next();!s.done;s=a.next()){var l=s.value;if(this._fieldIds[l]===r)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(n,'" was not present in field "').concat(l,'". Removing a document after it has changed can corrupt the index!'))}}catch(e){i={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,r,n){var i=this._fieldLength.get(e);null==i&&this._fieldLength.set(e,i=[]),i[t]=n;var o=(this._avgFieldLength[t]||0)*r+n;this._avgFieldLength[t]=o/(r+1)},n.prototype.removeFieldLength=function(e,t,r,n){var i=this._avgFieldLength[t]*r-n;this._avgFieldLength[t]=i/(r-1)},n.prototype.saveStoredFields=function(e,r){var n,i,o=this._options,a=o.storeFields,s=o.extractField;if(null!=a&&0!==a.length){var l=this._storedFields.get(e);null==l&&this._storedFields.set(e,l={});try{for(var u=t(a),h=u.next();!h.done;h=u.next()){var c=h.value,d=s(r,c);void 0!==d&&(l[c]=d)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}},n}(),v=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},w=((n={}).or=function(e,r){var n,i;try{for(var o=t(r.keys()),a=o.next();!a.done;a=o.next()){var s=a.value,l=e.get(s);if(null==l)e.set(s,r.get(s));else{var u=r.get(s),h=u.score,c=u.terms,d=u.match;l.score=l.score+h,l.match=Object.assign(l.match,d),F(l.terms,c)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e},n.and=function(e,r){var n,i,o=new Map;try{for(var a=t(r.keys()),s=a.next();!s.done;s=a.next()){var l=s.value,u=e.get(l);if(null!=u){var h=r.get(l),c=h.score,d=h.terms,p=h.match;F(u.terms,d),o.set(l,{score:u.score+c,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o},n.and_not=function(e,r){var n,i;try{for(var o=t(r.keys()),a=o.next();!a.done;a=o.next()){var s=a.value;e.delete(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e},n),S=function(e,t,r,n,i){return Math.log(1+(r-t+.5)/(t+.5))*(.5+2.2*e/(e+1.2*(1-.7+.7*n/i)))},M=function(e){return function(t,r,n){return{term:t,fuzzy:"function"==typeof e.fuzzy?e.fuzzy(t,r,n):e.fuzzy||!1,prefix:"function"==typeof e.prefix?e.prefix(t,r,n):!0===e.prefix}}},T={idField:"id",extractField:function(e,t){return e[t]},tokenize:function(e,t){return e.split(I)},processTerm:function(e,t){return e.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},E={combineWith:b,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},R={prefix:function(e,t,r){return t===r.length-1}},A=function(e,t){e.includes(t)||e.push(t)},F=function(e,r){var n,i;try{for(var o=t(r),a=o.next();!a.done;a=o.next()){var s=a.value;e.includes(s)||e.push(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},k=function(e,t){var r=e.score;return t.score-r},x=function(){return new Map},O=function(e){var r,n,i=new Map;try{for(var o=t(Object.keys(e)),a=o.next();!a.done;a=o.next()){var s=a.value;i.set(parseInt(s,10),e[s])}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},I=/[\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 _},"object"==typeof e&&void 0!==t?t.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).MiniSearch=n()}));Po(exports,{Mappedin:()=>Ln,MappedinDestinationSet:()=>ua,OfflineSearch:()=>lo,getVenue:()=>Ms,getVenueBundle:()=>_s,initialize:()=>yp}),j(),j();var jc=Ne(ml());j(),j(),j();var bl=Ne(gl());j();var yl=class{constructor({origin:e,destination:t,vortex:r,elevationDelta:n=0,distance:i=0,angle:o=0}){let a,s;if(p(this,"origin"),p(this,"destination"),p(this,"vortex"),p(this,"distance"),p(this,"angle"),p(this,"weight"),this.origin=e,this.destination=t,this.vortex=r,this.distance=i,this.angle=o,r?(this.distance=0,this.angle=0,a=void 0!==r.weight&&r.weight>0?r.weight:"elevator"===r.type?2e3:1e3,s=r.multiplier&&r.multiplier>=1?r.multiplier:1,this.weight=n*s+a):(a=t.weight&&t.weight>=0?t.weight:0,s=t.multiplier&&t.multiplier>=1?t.multiplier:1,this.weight=this.distance*s+a),isNaN(this.angle))throw new Error("nan angle")}},Si=yl;function Kd(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale||1);try{if(!e.georeference)throw new Error(`map ${e.name||e.shortName||e.id} does not have a georeference field`);if(e.georeference.length<3)throw new Error(`map ${e.name||e.shortName||e.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let t=e.georeference[0],r=e.georeference[2],n=(0,bl.getDistance)({latitude:t.target.x,longitude:t.target.y},{latitude:r.target.x,longitude:r.target.y}),i=t.control.x-r.control.x,o=t.control.y-r.control.y;return Math.sqrt(i*i+o*o)/n}catch(e){return console.error(e),1}}function Zd(e,t){let r=e.x-t.x,n=e.y-t.y;return(Math.atan2(n,r)+2.5*Math.PI)%(2*Math.PI)}var Ge,lt,cn,kl=class{constructor({nodes:e,vortexes:t,maps:r,showVortexNames:n=!1}){p(this,"edges"),p(this,"nodesById"),p(this,"mapsById"),this.edges={},this.mapsById=r.map((e=>({...e,_scale:Kd(e)}))).reduce(((e,t)=>(e[t.id]=t,e)),{});let i=e.filter((e=>!!this.mapsById[e.map])).map((e=>({...e,paths:e.paths?e.paths.filter((({map:t})=>t===e.map)):[]})));this.nodesById=i.reduce(((e,t)=>(e[t.id]=t,e)),{});for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].paths=this.nodesById[e].paths.filter((({node:e})=>!!this.nodesById[e])));let o=t.map((e=>({...e,name:n?e.name:e.type,nodes:e.nodes?e.nodes.filter((e=>!!this.nodesById[e])):[]})));i.forEach((e=>{this.edges[e.id]=e.paths.map((({node:t})=>{let r=this.nodesById[t];return new Si({angle:Zd(e,r),destination:r,distance:this.getDistance(e,r),origin:e})}))})),o.forEach((e=>{if(null==e.nodes||0===e.nodes.length)return;let t=0;for(;t<e.nodes.length-1;){let r=this.nodesById[e.nodes[t]];if(t++,null==r)continue;let n=t;for(;n<e.nodes.length;){let t=this.nodesById[e.nodes[n]];if(n++,null==t)continue;let i=this.mapsById[r.map].elevation||0,o=this.mapsById[t.map].elevation||0,a=Math.abs(i-o);this.edges[r.id].push(new Si({destination:t,elevationDelta:a,origin:r,vortex:e})),this.edges[t.id].push(new Si({destination:r,elevationDelta:a,origin:t,vortex:e}))}}}))}aStar(e,t,r){let n=e.map((e=>this.nodesById[e])).filter((e=>e)),i=t.map((e=>this.nodesById[e])).filter((e=>e));if(0===n.length||0===i.length)return[];let o=[],a={},s={};for(n.forEach((e=>{let t=this.getShortestEuclideanDistance(e,i);o.push({origin:e,priority:t}),a[e.id]=null,s[e.id]=0})),o.sort(((e,t)=>e.priority-t.priority));o.length>0;){let e=o[0];if(i.includes(e.origin)){let t=[],r=a[e.origin.id];for(;null!=r;){t.push(r);let e=a[r.origin.id];r=null!=e?e:null}return t.reverse()}for(let t of this.edges[e.origin.id]){let n=t.vortex&&!1===t.vortex.accessible;if(r&&(n||!1===t.origin.accessible||!1===t.destination.accessible))continue;let l=s[e.origin.id]+t.weight;if(null==s[t.destination.id]||l<s[t.destination.id]){s[t.destination.id]=l;let e=l+this.getShortestEuclideanDistance(t.destination,i);o.push({origin:t.destination,priority:e}),a[t.destination.id]=t}}o.splice(0,1),o.sort(((e,t)=>e.priority-t.priority))}return[]}getDistance(e,t){let r,n=e.x-t.x,i=e.y-t.y,o=n*n+i*i;return r=null==this.mapsById[e.map]?1:this.mapsById[e.map]._scale,Math.sqrt(o)/r}getShortestEuclideanDistance(e,t){return t.reduce(((t,r)=>{let n=this.getDistance(e,r);return Math.min(t,n)}),Number.MAX_VALUE)}},Bo=kl;function eh(e){switch(e){case cn.DOWN:case cn.UP:return`${e} `;default:return""}}j(),j(),function(e){e.DEPARTURE="Departure",e.TAKEVORTEX="TakeVortex",e.EXITVORTEX="ExitVortex",e.TURN="Turn",e.ARRIVAL="Arrival"}(Ge||(Ge={})),function(e){e.STRAIGHT="Straight",e.RIGHT="Right",e.SLIGHTRIGHT="SlightRight",e.LEFT="Left",e.SLIGHTLEFT="SlightLeft"}(lt||(lt={})),function(e){e.UP="up",e.DOWN="down",e.NONE="none"}(cn||(cn={}));var Ti,vl=class{constructor({origin:e,action:t,distance:r,atLocation:n,instruction:i}){p(this,"node"),p(this,"instruction"),p(this,"action"),p(this,"atLocation"),p(this,"type"),p(this,"distance",0),this.node=e,this.action=t,this.distance=r||0,this.atLocation=n,this.instruction="",i?this.instruction=i:(null!=t&&t.type===Ge.DEPARTURE?this.instruction=null!=n?`Depart from ${n.name}`:"Depart from current location":null!=t&&t.type===Ge.ARRIVAL?this.instruction=null!=n?`Arrive at ${n.name}`:"Arrive at destination":null!=t&&t.type===Ge.TAKEVORTEX?this.instruction=`Take ${n&&n.name} ${eh(t.direction)}to ${t.toMap.name}`:null!=t&&t.type===Ge.EXITVORTEX?this.instruction=`Exit ${n&&n.name} at ${t.toMap.name}`:null!=t&&t.bearing===lt.RIGHT?this.instruction="Turn right":null!=t&&t.bearing===lt.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=t&&t.bearing===lt.STRAIGHT?this.instruction="Head straight":null!=t&&t.bearing===lt.SLIGHTLEFT?this.instruction="Turn slightly left":null!=t&&t.bearing===lt.LEFT&&(this.instruction="Turn left"),null!=t&&t.type===Ge.TURN&&n&&(this.instruction+=` at ${n.name}`))}},dn=vl;(Ti||(Ti={})).NO_VALID_PATH="No Valid Path Available";var ji=.1*Math.PI;function Ri(e,t){return((t-e+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var wl=class{constructor({locations:e,nodes:t,vortexes:r,maps:n,showVortexNames:i}){p(this,"graph"),p(this,"locationsByNodeId"),this.graph=new Bo({maps:n,nodes:t,showVortexNames:i,vortexes:r}),this.locationsByNodeId=e.reduce(((e,t)=>(t.nodes&&t.nodes.forEach((r=>{e[r.node]=t})),t.polygons&&t.polygons.forEach((r=>{r.entrances&&r.entrances.forEach((r=>{e[r]=t}))})),e)),{})}getClosestLocationInRay(e,t=.5*Math.PI,r=10){let n=0,i=0,o=e;for(;Math.abs(n)<t&&i<r;){let e=this.graph.edges[o.destination.id],a=null,s=0;for(let t of e)if(t.distance>0)if(null!=a){let e=-Ri(o.angle,t.angle);Math.abs(e)<Math.abs(s)&&(a=t,s=e)}else a=t,s=-Ri(o.angle,t.angle);if(null==a)return null;{if(Math.abs(s)>=t||(n+=s,i+=a.distance,Math.abs(n)>=t||i>r))return null;let e=this.locationsByNodeId[a.destination.id];if(null!=e)return e;o=a}}return null}getDirections({originIds:e,destinationNodeIds:t,accessible:r,departFrom:n,arriveAt:i}){let o=this.graph.aStar(e,t,r);if(0===o.length)return{distance:0,instructions:[new dn({distance:0,instruction:Ti.NO_VALID_PATH})],path:[]};let a=0,s=new Array(o.length+1);for(let e=0;e<o.length;e++)s[e]=o[e].origin;s[o.length]=o[o.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let e=0;e<o.length;e++){let t=o[e],r=t.origin,s=t.destination;if(a+=t.distance,c+=(null==h?void 0:h.distance)||0,0===e&&l.push(new dn({action:{type:Ge.DEPARTURE},atLocation:n,distance:0,origin:r})),null!=t.vortex){let e=this.graph.mapsById[r.map],n=this.graph.mapsById[s.map],i=cn.NONE;if(null!=e.elevation&&null!=n.elevation){let t=e.elevation-n.elevation;t>0?i=cn.DOWN:t<0&&(i=cn.UP)}l.push(new dn({action:{direction:i,fromMap:e,toMap:n,type:Ge.TAKEVORTEX},atLocation:t.vortex,distance:c,origin:r})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let e=this.graph.mapsById[u.map],t=this.graph.mapsById[h.destination.map];l.push(new dn({action:{fromMap:e,toMap:t,type:Ge.EXITVORTEX},atLocation:h.vortex,distance:c,origin:r})),d+=c,c=0}else{let e=this.graph.edges[r.id].filter((e=>e.destination!==u&&e.destination!==t.destination));if(e.length>0){let n=-Ri(h.angle,t.angle),i=e.reduce(((e,r)=>{let n=-Ri(t.angle,r.angle);return Math.min(e,Math.abs(n))}),Math.PI);if(Math.abs(n)>=ji||Math.abs(i)<=ji){let e;e=n<=-Math.PI/4?lt.RIGHT:n<=-ji?lt.SLIGHTRIGHT:n<=ji?lt.STRAIGHT:n<=Math.PI/4?lt.SLIGHTLEFT:lt.LEFT;let t=this.locationsByNodeId[r.id];if(t||(t=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=t){let n=new dn({action:{bearing:e,referencePosition:"At",type:Ge.TURN},atLocation:t,distance:c,origin:r});n.type=e,l.push(n)}else l.push(new dn({action:{bearing:e,referencePosition:"At",type:Ge.TURN},distance:c,origin:r}));d+=c,c=0}}}e===o.length-1&&(l.push(new dn({action:{type:Ge.ARRIVAL},atLocation:i,distance:a-d<0?0:a-d,origin:t.destination})),d+=c,c=0),u=r,h=t}let p=[],f=null;for(let e=l.length-1;e>=0;e--){let t=l[e],{action:r}=t;r&&r.type===Ge.TAKEVORTEX?(f=t.node,p.unshift(t)):r&&r.type===Ge.TURN&&null!=f?this.graph.getDistance(t.node,f)>5&&p.unshift(t):p.unshift(t)}return{distance:a,instructions:p,path:s}}},Lo=wl;function Ml(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return _l(this.cover(t,r),t,r,e)}function _l(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,o,a,s,l,u,h,c,d,p=e._root,f={data:n},y=e._x0,g=e._y0,m=e._x1,b=e._y1;if(!p)return e._root=f,e;for(;p.length;)if((u=t>=(o=(y+m)/2))?y=o:m=o,(h=r>=(a=(g+b)/2))?g=a:b=a,i=p,!(p=p[c=h<<1|u]))return i[c]=f,e;if(s=+e._x.call(null,p.data),l=+e._y.call(null,p.data),t===s&&r===l)return f.next=p,i?i[c]=f:e._root=f,e;do{i=i?i[c]=new Array(4):e._root=new Array(4),(u=t>=(o=(y+m)/2))?y=o:m=o,(h=r>=(a=(g+b)/2))?g=a:b=a}while((c=h<<1|u)==(d=(l>=a)<<1|s>=o));return i[d]=p,i[c]=f,e}function Sl(e){var t,r,n,i,o=e.length,a=new Array(o),s=new Array(o),l=1/0,u=1/0,h=-1/0,c=-1/0;for(r=0;r<o;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(i=+this._y.call(null,t))||(a[r]=n,s[r]=i,n<l&&(l=n),n>h&&(h=n),i<u&&(u=i),i>c&&(c=i));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),r=0;r<o;++r)_l(this,a[r],s[r],e[r]);return this}function Tl(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,o=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,o=(n=Math.floor(t))+1;else{for(var a,s,l=i-r||1,u=this._root;r>e||e>=i||n>t||t>=o;)switch(s=(t<n)<<1|e<r,a=new Array(4),a[s]=u,u=a,l*=2,s){case 0:i=r+l,o=n+l;break;case 1:r=i-l,o=n+l;break;case 2:i=r+l,n=o-l;break;case 3:r=i-l,n=o-l}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=o,this}function jl(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e}function Rl(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Je(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function xl(e,t,r){var n,i,o,a,s,l,u,h=this._x0,c=this._y0,d=this._x1,p=this._y1,f=[],y=this._root;for(y&&f.push(new Je(y,h,c,d,p)),null==r?r=1/0:(h=e-r,c=t-r,d=e+r,p=t+r,r*=r);l=f.pop();)if(!(!(y=l.node)||(i=l.x0)>d||(o=l.y0)>p||(a=l.x1)<h||(s=l.y1)<c))if(y.length){var g=(i+a)/2,m=(o+s)/2;f.push(new Je(y[3],g,m,a,s),new Je(y[2],i,m,g,s),new Je(y[1],g,o,a,m),new Je(y[0],i,o,g,m)),(u=(t>=m)<<1|e>=g)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=l)}else{var b=e-+this._x.call(null,y.data),_=t-+this._y.call(null,y.data),v=b*b+_*_;if(v<r){var w=Math.sqrt(r=v);h=e-w,c=t-w,d=e+w,p=t+w,n=y.data}}return n}function El(e){if(isNaN(o=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,r,n,i,o,a,s,l,u,h,c,d,p=this._root,f=this._x0,y=this._y0,g=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((u=o>=(s=(f+g)/2))?f=s:g=s,(h=a>=(l=(y+m)/2))?y=l:m=l,t=p,!(p=p[c=h<<1|u]))return this;if(!p.length)break;(t[c+1&3]||t[c+2&3]||t[c+3&3])&&(r=t,d=c)}for(;p.data!==e;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):t?(i?t[c]=i:delete t[c],(p=t[0]||t[1]||t[2]||t[3])&&p===(t[3]||t[2]||t[1]||t[0])&&!p.length&&(r?r[d]=p:this._root=p),this):(this._root=i,this)}function Al(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}function Il(){return this._root}function Ol(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e}function zl(e){var t,r,n,i,o,a,s=[],l=this._root;for(l&&s.push(new Je(l,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(l=t.node,n=t.x0,i=t.y0,o=t.x1,a=t.y1)&&l.length){var u=(n+o)/2,h=(i+a)/2;(r=l[3])&&s.push(new Je(r,u,h,o,a)),(r=l[2])&&s.push(new Je(r,n,h,u,a)),(r=l[1])&&s.push(new Je(r,u,i,o,h)),(r=l[0])&&s.push(new Je(r,n,i,u,h))}return this}function Cl(e){var t,r=[],n=[];for(this._root&&r.push(new Je(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var i=t.node;if(i.length){var o,a=t.x0,s=t.y0,l=t.x1,u=t.y1,h=(a+l)/2,c=(s+u)/2;(o=i[0])&&r.push(new Je(o,a,s,h,c)),(o=i[1])&&r.push(new Je(o,h,s,l,c)),(o=i[2])&&r.push(new Je(o,a,c,h,u)),(o=i[3])&&r.push(new Je(o,h,c,l,u))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this}function Pl(e){return e[0]}function Fl(e){return arguments.length?(this._x=e,this):this._x}function Nl(e){return e[1]}function Bl(e){return arguments.length?(this._y=e,this):this._y}function Ya(e,t,r){var n=new Do(null==t?Pl:t,null==r?Nl:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function Do(e,t,r,n,i,o){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=o,this._root=void 0}function Ll(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j();var rt=Ya.prototype=Do.prototype;rt.copy=function(){var e,t,r=new Do(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=Ll(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(t=n.source[i])&&(t.length?e.push({source:t,target:n.target[i]=new Array(4)}):n.target[i]=Ll(t));return r},rt.add=Ml,rt.addAll=Sl,rt.cover=Tl,rt.data=jl,rt.extent=Rl,rt.find=xl,rt.remove=El,rt.removeAll=Al,rt.root=Il,rt.size=Ol,rt.visit=zl,rt.visitAfter=Cl,rt.x=Fl,rt.y=Bl;var Ft,Ue,On=class{constructor(e){F(this,Ft,void 0),p(this,"categories"),p(this,"locations"),p(this,"vortexes"),p(this,"maps"),p(this,"nodes"),p(this,"polygons"),p(this,"events"),p(this,"mapGroups"),p(this,"locationStates"),p(this,"locationRankings"),p(this,"rankings"),F(this,Ue,{}),D(this,Ft,e)}get polygonsByMapId(){if(f(this,Ue).polygonsByMapId)return f(this,Ue).polygonsByMapId;let e,t={};for(let r=0,n=f(this,Ft).polygons.length;r<n;++r)e=f(this,Ft).polygons[r],t[e.map]||(t[e.map]=[]),t[e.map].push(e);return f(this,Ue).polygonsByMapId=t,f(this,Ue).polygonsByMapId}get nodesByMapId(){if(f(this,Ue).nodesByMapId)return f(this,Ue).nodesByMapId;let e,t={};for(let r=0,n=f(this,Ft).nodes.length;r<n;++r)e=f(this,Ft).nodes[r],t[e.map]||(t[e.map]=[]),t[e.map].push(e);return f(this,Ue).nodesByMapId=t,f(this,Ue).nodesByMapId}findNearestNodeOnMap(e,t){if(f(this,Ue).nodeTreesByMap||(f(this,Ue).nodeTreesByMap=new Map),!f(this,Ue).nodeTreesByMap.has(e)){let t=this.nodesByMapId[e],r=Ya();r.x((e=>e.x)),r.y((e=>e.y)),r.addAll(t),f(this,Ue).nodeTreesByMap.set(e,r)}return f(this,Ue).nodeTreesByMap.get(e).find(t.x,t.y)}get locationsByMapId(){if(f(this,Ue).locationsByMapId)return f(this,Ue).locationsByMapId;let e,t={};for(let r=0,n=f(this,Ft).locations.length;r<n;++r){e=f(this,Ft).locations[r];for(let r=0,n=e.polygons.length;r<n;++r)t[e.polygons[r].map]||(t[e.polygons[r].map]=[]),t[e.polygons[r].map].push(e)}return f(this,Ue).locationsByMapId=t,f(this,Ue).locationsByMapId}static create(e){return On.instances.has(e)||On.instances.set(e,new On(e)),On.instances.get(e)}static clear(){On.instances.clear()}},qo=On;Ft=new WeakMap,Ue=new WeakMap,p(qo,"instances",new Map);var mt=qo;j(),j(),j(),j();var Dl=" ",it=class{static get separator(){return Dl}static set separator(e){Dl=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);let t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let r=null;switch(t.length){case 3:r=t[0]/1+t[1]/60+t[2]/3600;break;case 2:r=t[0]/1+t[1]/60;break;case 1:r=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(r=-r),Number(r)}static toDms(e,t="d",r){if(isNaN(e)||"string"==typeof e&&""==e.trim()||"boolean"==typeof e||e==1/0||null==e)return null;if(void 0===r)switch(t){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:t="d",r=4}e=Math.abs(e);let n=null,i=null,o=null,a=null;switch(t){default:case"d":case"deg":i=e.toFixed(r),i<100&&(i="0"+i),i<10&&(i="0"+i),n=i+"°";break;case"dm":case"deg+min":i=Math.floor(e),o=(60*e%60).toFixed(r),60==o&&(o=(0).toFixed(r),i++),i=("000"+i).slice(-3),o<10&&(o="0"+o),n=i+"°"+it.separator+o+"′";break;case"dms":case"deg+min+sec":i=Math.floor(e),o=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),60==o&&(o=0,i++),i=("000"+i).slice(-3),o=("00"+o).slice(-2),a<10&&(a="0"+a),n=i+"°"+it.separator+o+"′"+it.separator+a+"″"}return n}static toLat(e,t,r){let n=it.toDms(it.wrap90(e),t,r);return null===n?"–":n.slice(1)+it.separator+(e<0?"S":"N")}static toLon(e,t,r){let n=it.toDms(it.wrap180(e),t,r);return null===n?"–":n+it.separator+(e<0?"W":"E")}static toBrng(e,t,r){let n=it.toDms(it.wrap360(e),t,r);return null===n?"–":n.replace("360","0")}static fromLocale(e){let t=123456.789.toLocaleString(),r={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(e){let t=123456.789.toLocaleString(),r={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=it.wrap360(e);let r=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*r/360)%r*16/r]}static wrap360(e){return 0<=e&&e<360?e:(e%360+360)%360}static wrap180(e){return-180<e&&e<=180?e:(e+540)%360-180}static wrap90(e){return-90<=e&&e<=90?e:Math.abs((e%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var me=it,Fe=Math.PI,Q=class{constructor(e,t){if(isNaN(e))throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t))throw new TypeError(`invalid lon ‘${t}’`);this._lat=me.wrap90(Number(e)),this._lon=me.wrap180(Number(t))}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?me.wrap90(me.parse(e)):me.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?me.wrap90(me.parse(e)):me.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?me.wrap180(me.parse(e)):me.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?me.wrap180(me.parse(e)):me.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?me.wrap180(me.parse(e)):me.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");if(null===e[0]||null===e[1])throw new TypeError("invalid (null) point");let t,r;if(2==e.length&&([t,r]=e,t=me.wrap90(me.parse(t)),r=me.wrap180(me.parse(r)),isNaN(t)||isNaN(r)))throw new TypeError(`invalid point ‘${e.toString()}’`);if(1==e.length&&"string"==typeof e[0]&&([t,r]=e[0].split(","),t=me.wrap90(me.parse(t)),r=me.wrap180(me.parse(r)),isNaN(t)||isNaN(r)))throw new TypeError(`invalid point ‘${e[0]}’`);if(1==e.length&&"object"==typeof e[0]){let n=e[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[r,t]=n.coordinates:(null!=n.latitude&&(t=n.latitude),null!=n.lat&&(t=n.lat),null!=n.longitude&&(r=n.longitude),null!=n.lng&&(r=n.lng),null!=n.lon&&(r=n.lon),t=me.wrap90(me.parse(t)),r=me.wrap180(me.parse(r))),isNaN(t)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if(isNaN(t)||isNaN(r))throw new TypeError(`invalid point ‘${e.toString()}’`);return new Q(t,r)}distanceTo(e,t=6371e3){if(e instanceof Q||(e=Q.parse(e)),isNaN(t))throw new TypeError(`invalid radius ‘${t}’`);let r=t,n=this.lat.toRadians(),i=this.lon.toRadians(),o=e.lat.toRadians(),a=o-n,s=e.lon.toRadians()-i,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(n)*Math.cos(o)*Math.sin(s/2)*Math.sin(s/2);return r*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(e){if(e instanceof Q||(e=Q.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),r=e.lat.toRadians(),n=(e.lon-this.lon).toRadians(),i=Math.cos(t)*Math.sin(r)-Math.sin(t)*Math.cos(r)*Math.cos(n),o=Math.sin(n)*Math.cos(r),a=Math.atan2(o,i).toDegrees();return me.wrap360(a)}finalBearingTo(e){e instanceof Q||(e=Q.parse(e));let t=e.initialBearingTo(this)+180;return me.wrap360(t)}midpointTo(e){e instanceof Q||(e=Q.parse(e));let t=this.lat.toRadians(),r=this.lon.toRadians(),n=e.lat.toRadians(),i=(e.lon-this.lon).toRadians(),o=Math.cos(t),a=0,s=Math.sin(t),l={x:o+Math.cos(n)*Math.cos(i),y:a+Math.cos(n)*Math.sin(i),z:s+Math.sin(n)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=r+Math.atan2(l.y,l.x),c=u.toDegrees(),d=h.toDegrees();return new Q(c,d)}intermediatePointTo(e,t){if(e instanceof Q||(e=Q.parse(e)),this.equals(e))return new Q(this.lat,this.lon);let r=this.lat.toRadians(),n=this.lon.toRadians(),i=e.lat.toRadians(),o=e.lon.toRadians(),a=i-r,s=o-n,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-t)*u)/Math.sin(u),c=Math.sin(t*u)/Math.sin(u),d=h*Math.cos(r)*Math.cos(n)+c*Math.cos(i)*Math.cos(o),p=h*Math.cos(r)*Math.sin(n)+c*Math.cos(i)*Math.sin(o),f=h*Math.sin(r)+c*Math.sin(i),y=Math.atan2(f,Math.sqrt(d*d+p*p)),g=Math.atan2(p,d),m=y.toDegrees(),b=g.toDegrees();return new Q(m,b)}destinationPoint(e,t,r=6371e3){let n=e/r,i=Number(t).toRadians(),o=this.lat.toRadians(),a=this.lon.toRadians(),s=Math.sin(o)*Math.cos(n)+Math.cos(o)*Math.sin(n)*Math.cos(i),l=Math.asin(s),u=Math.sin(i)*Math.sin(n)*Math.cos(o),h=Math.cos(n)-Math.sin(o)*s,c=a+Math.atan2(u,h),d=l.toDegrees(),p=c.toDegrees();return new Q(d,p)}static intersection(e,t,r,n){if(e instanceof Q||(e=Q.parse(e)),r instanceof Q||(r=Q.parse(r)),isNaN(t))throw new TypeError(`invalid brng1 ‘${t}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);let i=e.lat.toRadians(),o=e.lon.toRadians(),a=r.lat.toRadians(),s=r.lon.toRadians(),l=Number(t).toRadians(),u=Number(n).toRadians(),h=a-i,c=s-o,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(a)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new Q(e.lat,e.lon);let p=(Math.sin(a)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),f=(Math.sin(i)-Math.sin(a)*Math.cos(d))/(Math.sin(d)*Math.cos(a)),y=Math.acos(Math.min(Math.max(p,-1),1)),g=Math.acos(Math.min(Math.max(f,-1),1)),m=l-(Math.sin(s-o)>0?y:2*Fe-y),b=(Math.sin(s-o)>0?2*Fe-g:g)-u;if(0==Math.sin(m)&&0==Math.sin(b)||Math.sin(m)*Math.sin(b)<0)return null;let _=-Math.cos(m)*Math.cos(b)+Math.sin(m)*Math.sin(b)*Math.cos(d),v=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(b),Math.cos(b)+Math.cos(m)*_),w=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(v)+Math.cos(i)*Math.sin(v)*Math.cos(l),-1),1)),S=o+Math.atan2(Math.sin(l)*Math.sin(v)*Math.cos(i),Math.cos(v)-Math.sin(i)*Math.sin(w)),M=w.toDegrees(),T=S.toDegrees();return new Q(M,T)}crossTrackDistanceTo(e,t,r=6371e3){e instanceof Q||(e=Q.parse(e)),t instanceof Q||(t=Q.parse(t));let n=r;if(this.equals(e))return 0;let i=e.distanceTo(this,n)/n,o=e.initialBearingTo(this).toRadians(),a=e.initialBearingTo(t).toRadians();return Math.asin(Math.sin(i)*Math.sin(o-a))*n}alongTrackDistanceTo(e,t,r=6371e3){e instanceof Q||(e=Q.parse(e)),t instanceof Q||(t=Q.parse(t));let n=r;if(this.equals(e))return 0;let i=e.distanceTo(this,n)/n,o=e.initialBearingTo(this).toRadians(),a=e.initialBearingTo(t).toRadians(),s=Math.asin(Math.sin(i)*Math.sin(o-a));return Math.acos(Math.cos(i)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(a-o))*n}maxLatitude(e){let t=Number(e).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(t)*Math.cos(r))).toDegrees()}static crossingParallels(e,t,r){if(e.equals(t))return null;let n=Number(r).toRadians(),i=e.lat.toRadians(),o=e.lon.toRadians(),a=t.lat.toRadians(),s=t.lon.toRadians()-o,l=Math.sin(i)*Math.cos(a)*Math.cos(n)*Math.sin(s),u=Math.sin(i)*Math.cos(a)*Math.cos(n)*Math.cos(s)-Math.cos(i)*Math.sin(a)*Math.cos(n),h=Math.cos(i)*Math.cos(a)*Math.sin(n)*Math.sin(s);if(h*h>l*l+u*u)return null;let c=Math.atan2(-u,l),d=Math.acos(h/Math.sqrt(l*l+u*u)),p=o+c+d,f=(o+c-d).toDegrees(),y=p.toDegrees();return{lon1:me.wrap180(f),lon2:me.wrap180(y)}}rhumbDistanceTo(e,t=6371e3){e instanceof Q||(e=Q.parse(e));let r=t,n=this.lat.toRadians(),i=e.lat.toRadians(),o=i-n,a=Math.abs(e.lon-this.lon).toRadians();Math.abs(a)>Fe&&(a=a>0?-(2*Fe-a):2*Fe+a);let s=Math.log(Math.tan(i/2+Fe/4)/Math.tan(n/2+Fe/4)),l=Math.abs(s)>1e-11?o/s:Math.cos(n);return Math.sqrt(o*o+l*l*a*a)*r}rhumbBearingTo(e){if(e instanceof Q||(e=Q.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),r=e.lat.toRadians(),n=(e.lon-this.lon).toRadians();Math.abs(n)>Fe&&(n=n>0?-(2*Fe-n):2*Fe+n);let i=Math.log(Math.tan(r/2+Fe/4)/Math.tan(t/2+Fe/4)),o=Math.atan2(n,i).toDegrees();return me.wrap360(o)}rhumbDestinationPoint(e,t,r=6371e3){let n=this.lat.toRadians(),i=this.lon.toRadians(),o=Number(t).toRadians(),a=e/r,s=a*Math.cos(o),l=n+s;Math.abs(l)>Fe/2&&(l=l>0?Fe-l:-Fe-l);let u=Math.log(Math.tan(l/2+Fe/4)/Math.tan(n/2+Fe/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(n),c=i+a*Math.sin(o)/h,d=l.toDegrees(),p=c.toDegrees();return new Q(d,p)}rhumbMidpointTo(e){e instanceof Q||(e=Q.parse(e));let t=this.lat.toRadians(),r=this.lon.toRadians(),n=e.lat.toRadians(),i=e.lon.toRadians();Math.abs(i-r)>Fe&&(r+=2*Fe);let o=(t+n)/2,a=Math.tan(Fe/4+t/2),s=Math.tan(Fe/4+n/2),l=Math.tan(Fe/4+o/2),u=((i-r)*Math.log(l)+r*Math.log(s)-i*Math.log(a))/Math.log(s/a);isFinite(u)||(u=(r+i)/2);let h=o.toDegrees(),c=u.toDegrees();return new Q(h,c)}static areaOf(e,t=6371e3){let r=t,n=e[0].equals(e[e.length-1]);n||e.push(e[0]);let i=e.length-1,o=0;for(let t=0;t<i;t++){let r=e[t].lat.toRadians(),n=e[t+1].lat.toRadians(),i=(e[t+1].lon-e[t].lon).toRadians();o+=2*Math.atan2(Math.tan(i/2)*(Math.tan(r/2)+Math.tan(n/2)),1+Math.tan(r/2)*Math.tan(n/2))}(function(e){let t=0,r=e[0].initialBearingTo(e[1]);for(let n=0;n<e.length-1;n++){let i=e[n].initialBearingTo(e[n+1]),o=e[n].finalBearingTo(e[n+1]);t+=(i-r+540)%360-180,t+=(o-i+540)%360-180,r=o}return t+=(e[0].initialBearingTo(e[1])-r+540)%360-180,Math.abs(t)<90})(e)&&(o=Math.abs(o)-2*Fe);let a=Math.abs(o*r*r);return n||e.pop(),a}equals(e){return e instanceof Q||(e=Q.parse(e)),!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(e="d",t){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);if("n"==e)return null==t&&(t=4),`${this.lat.toFixed(t)},${this.lon.toFixed(t)}`;return`${me.toLat(this.lat,e,t)}, ${me.toLon(this.lon,e,t)}`}};j(),j(),j();var ua=class{constructor(e){p(this,"destinations",[]),this.destinations=e}};j();var Xa,$t,Ja=class{constructor(e,t){F(this,Xa,void 0),F(this,$t,void 0),p(this,"distance",0),p(this,"path",[]),p(this,"instructions",[]),D(this,$t,e),D(this,Xa,t),this.distance=t.distance,this.instructions=t.instructions.map((e=>{var t,r,n,i,o,a,s,l,u,h,c,d;let p={...e,action:{...e.action},atLocation:(null==(t=e.atLocation)?void 0:t.id)?null==(n=null==(r=f(this,$t))?void 0:r._vortexesById)?void 0:n[e.atLocation.id]:void 0,node:(null==(i=e.node)?void 0:i.id)?null==(a=null==(o=f(this,$t))?void 0:o._nodesById)?void 0:a[e.node.id]:void 0};return((null==(s=p.action)?void 0:s.type)===Ge.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===Ge.EXITVORTEX)&&(p.action.fromMap=null==(h=f(this,$t)._mapsById)?void 0:h[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(d=f(this,$t)._mapsById)?void 0:d[null==(c=p.action)?void 0:c.toMap.id]),p})),this.path=t.path.map((e=>{var t,r;return null==(r=null==(t=f(this,$t))?void 0:t._nodesById)?void 0:r[e.id]}))}toJSON(){return f(this,Xa)}};Xa=new WeakMap,$t=new WeakMap;var pn,hn=class{constructor(e){F(this,pn,void 0),D(this,pn,e)}directionsTo(e,t){if(e instanceof ua){let r=[],n=this;for(let i=0;i<e.destinations.length;i++){let o=e.destinations[i],a=Qa(n),s=Qa(o),l=f(this,pn).navigator.getDirections({originIds:a,destinationNodeIds:s,accessible:(null==t?void 0:t.accessible)||!1}),u=new Ja(f(this,pn),l);r.push(u),n=o}return r}{let r=Qa(this),n=Qa(e),i=f(this,pn).navigator.getDirections({originIds:r,destinationNodeIds:n,accessible:(null==t?void 0:t.accessible)||!1});return new Ja(f(this,pn),i)}}distanceTo(e,t){let r=this.directionsTo(e,t);return(null==r?void 0:r.distance)||0}directionsToCallback(e,t){return this.directionsTo(e,t)}};pn=new WeakMap;var th=0,nh="9999-12-31T00:00:00.000Z";function ah(e,t,r=new Date){if(!e.states)return;let n=r||new Date,i=e.states.find((e=>{let t=new Date(e.start||th),r=new Date(e.end||nh);return t<n&&r>n}));return i?t.find((e=>e.value===i.type)):void 0}var Nt,zn,gt,Ka,Za,er,tr=class extends hn{constructor(e,t){super(e),F(this,Nt,void 0),F(this,zn,void 0),F(this,gt,{}),p(this,"states"),p(this,"id",""),p(this,"name",""),p(this,"type",""),p(this,"description"),p(this,"sortOrder"),p(this,"logo"),p(this,"phone"),p(this,"social"),p(this,"color"),p(this,"shortName"),p(this,"detailsUrl"),p(this,"tags"),p(this,"externalId"),p(this,"showLabelWhenImagePresent"),p(this,"picture"),p(this,"operationHours"),p(this,"siblingGroups"),p(this,"gallery"),p(this,"categories",[]),F(this,Ka,void 0),F(this,Za,[]),F(this,er,void 0),D(this,Nt,e),D(this,zn,t),Object.assign(this,t)}get polygons(){let e=f(this,gt).polygons;if(void 0!==e)return e;let t=[],r=f(this,Ka),n=f(this,Nt)._polygonsById;if(Array.isArray(r))for(let e=0,i=r.length;e<i;++e){let i=n[r[e].id];null!=i&&i.geometry.visible&&t.push(i)}return f(this,gt).polygons=t,t}set polygons(e){D(this,Ka,e)}get rank(){let e=f(this,gt).rank;if(void 0!==e)return e;let t=f(this,Nt).locationRankings;if(!t||!t.locations)return null;let r=t.locations.find((e=>e.ids.find((e=>e===this.id))));return r?(f(this,gt).rank=r.score,r.score):null}get nodes(){let e=f(this,gt).nodes;if(void 0!==e)return e;let t=[],r=f(this,Za),n=f(this,Nt)._nodesById;if(r)for(let e=0,i=r.length;e<i;++e){let i=n[r[e].node];null!=i&&t.push(i)}return f(this,gt).nodes=t,t}set nodes(e){D(this,Za,e)}get parent(){let e=f(this,gt).parent;if(void 0!==e)return e;let t,r=f(this,Nt)._locationsById,n=f(this,er);return void 0!==n&&(t=r[n]),f(this,gt).parent=t,t}set parent(e){D(this,er,e)}get state(){return ah(this,f(this,Nt).locationStates)}clone(){return new tr(f(this,Nt),f(this,zn))}get nodeOperationHours(){let e=f(this,gt).nodeOperationHours;if(void 0!==e)return e;if(null==this.nodes)return{};let t=f(this,zn).nodes.reduce(((e,t)=>(null!=t.operationHours&&(e[t.node]=t.operationHours),e)),{});return f(this,gt).nodeOperationHours=t,t}static hydrate(e,t){return e.map((e=>new tr(t,e)))}static async fetch(e){let t=e.options.things.locations.slice();e.options.things.categories&&Le(t,"categories"),e.options.things.nodes&&Le(t,"nodes"),e.options.things.polygons&&Le(t,"polygons"),e.options.things.locationStates&&Le(t,"states");let r={fields:t,venue:e.options.venue};try{let t=await Be(e.options,"location",r);return e.options.includeHidden||(t=t.filter((e=>!e.hidden))),t.map((t=>new tr(e,t)))}catch(e){return console.error("Fetch Locations:",e),[]}}toJSON(){let e=f(this,zn);return delete e.color,e}},fn=tr;Nt=new WeakMap,zn=new WeakMap,gt=new WeakMap,Ka=new WeakMap,Za=new WeakMap,er=new WeakMap,j();var Cn,nr,Bt,ar,xi=class extends hn{constructor(e,t){super(e),F(this,Cn,void 0),F(this,nr,void 0),F(this,Bt,{}),p(this,"geometry"),p(this,"image"),p(this,"holes"),p(this,"textures"),p(this,"material"),p(this,"label"),p(this,"id",""),p(this,"map",""),p(this,"layer"),p(this,"layerId"),p(this,"name"),p(this,"externalId"),p(this,"vertexes"),p(this,"canvasBounds"),F(this,ar,void 0),D(this,Cn,e),D(this,nr,t),Object.assign(this,t)}get locations(){let e=f(this,Bt).locations;if(void 0!==e)return e;let t=[],r=mt.instances.get(f(this,Cn)).locationsByMapId[this.map],{id:n}=this;for(let e=0,i=r.length;e<i;++e){let i=r[e],o=i.polygons;if(Array.isArray(o))for(let e=0,r=o.length;e<r;++e)if(o[e].id===n){t.push(i);break}}return f(this,Bt).locations=t,t}get entrances(){let e=f(this,Bt).entrances;if(void 0!==e)return e;let t=[],r=f(this,ar),n=f(this,Cn)._nodesById;if(Array.isArray(r)){for(let e=0,i=r.length;e<i;++e){let i=n[r[e].id];null!=i&&t.push(i)}return f(this,Bt).entrances=t,t}return[]}set entrances(e){D(this,ar,e)}get rank(){let e=f(this,Bt).rank;if(void 0!==e)return e;let{rankings:t}=f(this,Cn);if(!t||!t.polygons)return null;let r=t.polygons.find((e=>e.polygonId===this.id));return r?(f(this,Bt).rank={score:r.score,node:r.entranceNodeId},{score:r.score,node:r.entranceNodeId}):(f(this,Bt).rank=null,null)}static hydrate(e,t){return e.map((e=>new xi(t,e)))}static async fetch(e){let t=e.options.things.polygons.slice();e.options.things.maps&&Le(t,"map"),e.options.things.nodes&&Le(t,"entrances");let r={fields:t,perspective:e.options.do2D&&e.options.perspective||void 0,venue:e.options.venue};try{return(await Be(e.options,"polygon",r)).filter((e=>e.geometry.visible)).map((t=>new xi(e,t)))}catch(e){return console.error("Fetch Polygons:",e),[]}}toJSON(){return f(this,nr)}},ca=xi;function ql(e){return/^[\da-f]{24}$/i.test(e)}function Wl(e,t=!1){let r="";if(null!=e){let n="?",i=t?Object.keys(e).filter((e=>!["slug","venue"].includes(e))):Object.keys(e);for(let t=0,o=i.length;t<o;++t){let o=i[t],a=e[o];null!=a&&(r+=`${n+encodeURIComponent(o)}=${encodeURIComponent(a)}`,n="&")}}return r}function rh(e,t,r,n=!1){var i,o;return n?`${e.supplementaryUrl}${t}?venue=${r.venue||r.slug}`:(null==(i=e.baseUrl)?void 0:i.includes("gateway"))?`${e.baseUrl}${t}/${r.venue||r.slug}${Wl(r,null==(o=e.baseUrl)?void 0:o.includes("gateway"))}`:e.baseUrl+t+Wl(r)}async function Be(e,t,r,n=!1){return rr(e,t,r,n,!0)}async function rr(e,t,r,n=!1,i=!1){let o=rh(e,t,r,n),a=await Wo(e,o,n);if(!i&&Array.isArray(a)){if(1===a.length)return a[0];throw new Error("Invalid response object")}return a}async function Wo(e,t,r=!1){let n={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};r&&delete n.language,n.language&&(t+=`&lang=${encodeURIComponent(n.language)}`);let{headers:i}=e;i["Content-Type"]="text/json",e.authorization&&(i.Authorization=e.authorization),n.language&&(i["Accept-Language"]=n.language);let o={method:"GET",headers:i},a=await ir()(t,o);if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()}function Le(e,t){e.indexOf(t)<0&&e.push(t)}function Gl([e,t],[r,n]){let i=new Q(e,t),o=new Q(r,n);return i.distanceTo(o)}function Ul(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale);let t;try{let r=e.georeference[0],n=e.georeference[2],i=new Q(r.target.x,r.target.y),o=new Q(n.target.x,n.target.y),a=i.distanceTo(o),s=r.control.x-n.control.x,l=r.control.y-n.control.y;t=Math.sqrt(s*s+l*l)/a}catch(r){t=1,console.warn(r),console.warn(`Couldn't georeference ${e.name||e.shortName||e.id}. Probably not enough geocoordinates.`)}return t}function Qa(e){var t;return e instanceof ca?e.entrances.map((e=>e.id)):e instanceof fn?(null==(t=e.nodes)?void 0:t.map((e=>e.id)))||[]:[e.id]}async function Vl(e){let t={},{maps:r,images:n,scenes:i,polygons:o}=e;if(null!=n)try{let e=Object.keys(n).map((e=>fetch(`data:image/png;base64,${n[e]}`).then((e=>e.blob())).then((r=>{t[e]=r})).catch((e=>{console.error(e)}))));await Promise.all(e)}catch(e){console.error(e)}return r.forEach((e=>{var r;!(null==(r=e.scene)?void 0:r.polygons)&&!i[e.id]||(null!=i&&i[e.id]&&(e.scene||(e.scene={}),Object.defineProperty(e.scene,"polygons",{get:()=>i[e.id]})),null!=n&&(e.scene.images=e.scene.images.map((({filename:e})=>({filename:e,url:t[e]}))),e.scene.polygons.forEach((e=>{var r,n;if((null==(r=null==e?void 0:e.image)?void 0:r.url)&&(null==(n=null==e?void 0:e.image)?void 0:n.url)){let r=e.image.url.split("/"),n=t[r[r.length-1]];n&&(e.image.url=n)}}))))})),null!=n&&o.forEach((e=>{var r;if(null==(r=null==e?void 0:e.image)?void 0:r.url){let r=e.image.url.split("/"),n=t[r[r.length-1]];n&&(e.image.url=n)}})),null!=e.images&&delete e.images,null!=e.scenes&&delete e.scenes,e}function Go(e,t,r){let n;return function(){let i=this,o=arguments,a=function(){n=null,r||e.apply(i,o)},s=r&&!n;clearTimeout(n),n=setTimeout(a,t),s&&e.apply(i,o)}}Cn=new WeakMap,nr=new WeakMap,Bt=new WeakMap,ar=new WeakMap;var or,sr,lr,Ei=class{constructor(e,t){F(this,or,void 0),F(this,sr,{}),F(this,lr,void 0),p(this,"name"),p(this,"externalId"),p(this,"parents"),p(this,"id"),p(this,"icon"),this.id=t.id,D(this,lr,t),D(this,or,e),Object.assign(this,t)}get locations(){let e=f(this,sr).locations;if(void 0!==e)return e;let t=[],{locations:r}=f(this,or),{id:n}=this;for(let e=0,i=r.length;e<i;++e){let i=r[e],o=i.categories;if(Array.isArray(o))for(let e=0,r=o.length;e<r;++e)if(o[e]===n){t.push(i);break}}return f(this,sr).locations=t,t}static hydrate(e,t){return e.map((e=>new Ei(t,e)))}static async fetch(e){let t={fields:e.options.things.categories,venue:e.options.venue};try{return(await Be(e.options,"category",t)).map((t=>new Ei(e,t)))}catch(e){return console.error("Fetch Categories:",e),[]}}toJSON(){return f(this,lr)}},da=Ei;or=new WeakMap,sr=new WeakMap,lr=new WeakMap,j();var ur,ha,cr,Ii=class{constructor(e,t){F(this,ur,void 0),F(this,ha,void 0),F(this,cr,{}),p(this,"id",""),p(this,"type",""),p(this,"name",""),p(this,"description"),p(this,"image"),p(this,"startDate"),p(this,"endDate"),p(this,"showDate"),D(this,ha,t),D(this,ur,e),Object.assign(this,t)}location(){let e=f(this,cr).location;if(void 0!==e)return e;let t,r=f(this,ur)._locationsById,n=f(this,ha).location;if(null!=n){let e=r[n];null!=e&&(t=e)}return f(this,cr).location=t,t}static hydrate(e,t){return e.map((e=>new Ii(t,e)))}static async fetch(e){let t=e.options.things.events.slice();e.options.things.locations&&Le(t,"location");let r={fields:t,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await Be(e.options,"event",r)).map((t=>new Ii(e,t)))}catch(e){return console.error("Fetch Events:",e),[]}}toJSON(){return f(this,ha)}},Ai=Ii;ur=new WeakMap,ha=new WeakMap,cr=new WeakMap,j();var dr,Oi=class{constructor(e){F(this,dr,void 0),p(this,"locations",[]),D(this,dr,e),Object.assign(this,e)}static hydrate(e){return new Oi(e)}static async fetch(e){try{let t=await rr(e.options,"smart-labels/location-label-ranking",{venue:e.options.venue},!0);return new Oi(t)}catch(e){return console.error("Fetch Location Rankings:",e),{}}}toJSON(){return f(this,dr)}},Uo=Oi;dr=new WeakMap,j();var hr,zi=class{constructor(e){F(this,hr,void 0),p(this,"id",""),p(this,"name",""),p(this,"value",""),D(this,hr,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new zi(e)))}static async fetch(e){let t={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await Be(e.options,"location-state",t)).map((e=>new zi(e)))}catch(e){return console.error("Fetch Location States:",e),[]}}toJSON(){return f(this,hr)}},Vo=zi;hr=new WeakMap,j(),j();var fr,mr,pr=class{constructor(e,t,r,n,i,o){p(this,"map"),p(this,"x",0),p(this,"y",0),p(this,"lat",0),p(this,"lon",0),F(this,fr,{}),F(this,mr,void 0),this.lat=e,this.lon=t,this.map="string"==typeof i?i:i.id,this.x=r,this.y=n,D(this,mr,o)}absoluteDistanceTo(e){return Gl([e.lat,e.lon],[this.lat,this.lon])}get nearestNode(){let e=f(this,fr).nearestNode;if(void 0!==e)return e;let t=mt.instances.get(f(this,mr)).findNearestNodeOnMap(this.map,this);return f(this,fr).nearestNode=t,t}};fr=new WeakMap,mr=new WeakMap;var Lt,gr,yr,Pi=class{constructor(e,t){F(this,Lt,void 0),F(this,gr,{}),F(this,yr,void 0),p(this,"id",""),p(this,"group",""),p(this,"name",""),p(this,"shortName",""),p(this,"elevation",0),p(this,"scale",0),p(this,"layers"),p(this,"x_scale"),p(this,"perspectiveId"),p(this,"scene"),p(this,"width",0),p(this,"height",0),p(this,"georeference",[]),p(this,"_scale",0),D(this,Lt,e),D(this,yr,t),Object.assign(this,t),this._scale=Ul(this),this.scale=this.x_scale||1/this._scale}get polygons(){var e;return(null==(e=mt.instances.get(f(this,Lt)))?void 0:e.polygonsByMapId[this.id])||[]}get locations(){var e;return(null==(e=mt.instances.get(f(this,Lt)))?void 0:e.locationsByMapId[this.id])||[]}get nodes(){var e;return(null==(e=mt.instances.get(f(this,Lt)))?void 0:e.nodesByMapId[this.id])||[]}get mapGroup(){let e=f(this,gr).mapGroup;if(void 0!==e)return e;let t=this.group,r=t&&f(this,Lt)._mapGroupsById[t]||null;return f(this,gr).mapGroup=r,r}createCoordinateByXY(e,t){let r,n=this.georeference[0],i=new Q(n.target.x,n.target.y),o=e-n.control.x,a=n.control.y-t,s=Math.atan2(o,a);r=0===o&&0===a?0:0===o?a:o/Math.sin(s);let l=s-this.getNorth(),u=r/this._scale,h=i.destinationPoint(u,180*l/Math.PI);return new pr(h.lat,h.lon,e,t,this.id,f(this,Lt))}createCoordinate(e,t){let r=this.georeference[0],n=new Q(r.target.x,r.target.y),i=new Q(e,t),o=n.distanceTo(i),a=(n.finalBearingTo(i)+360)%360*Math.PI/180||0,s=o*(1/this.scale),l=a+this.getNorth(),u=Math.sin(l)*s,h=Math.cos(l)*s;return new pr(e,t,r.control.x+u,r.control.y-h,this.id,f(this,Lt))}getNorth(){let e;try{let t=this.georeference[0],r=this.georeference[2],n=new Q(t.target.x,t.target.y),i=new Q(r.target.x,r.target.y);e=-((n.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(r.control.y-t.control.y,r.control.x-t.control.x)-Math.PI/2)}catch(t){e=0,console.warn(t),console.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return e}static hydrate(e,t){return e.map((e=>new Pi(t,e)))}static async fetch(e){let t=e.options.things.maps.slice();e.options.perspective&&Le(t,"perspectives"),e.options.things.mapGroups&&Le(t,"group"),Le(t,"elevation"),Le(t,"x_scale"),Le(t,"scale"),Le(t,"georeference");let r={fields:t,perspective:e.options.perspective,venue:e.options.venue};try{let i=await Be(e.options,"map",r),o=e=>{let t=n.layers.find((t=>t.id===e));t?t.visible=!0:n.layers.push({id:e,visible:!0})};for(let r=0,a=i.length;r<a;++r){var n=i[r];if(n){let r=n.perspective;null!=r&&(n.perspectiveId=r.id,e.options.do2D?(t.indexOf("width")>-1&&(n.width=r.size&&r.size.width||r.width),t.indexOf("height")>-1&&(n.height=r.size&&r.size.height||r.height),t.indexOf("tiles")>-1&&(n.tiles=r.tiles),t.indexOf("original")>-1&&(n.original=r.original)):(t.indexOf("scene")>-1&&(n.scene=r.scene),r.layers?(n.layers.forEach((e=>{e.visible=!1})),r.layers.forEach(o)):n.layers.forEach((e=>{e.visible=!0})))),delete n.perspective}i[r]=new Pi(e,n)}return i}catch(e){return console.error("Fetch Maps:",e),[]}}toJSON(){return f(this,yr)}},Ci=Pi;Lt=new WeakMap,gr=new WeakMap,yr=new WeakMap,j();var br,pa,kr,Ni=class{constructor(e,t){F(this,br,void 0),F(this,pa,void 0),F(this,kr,{}),p(this,"id",""),p(this,"name",""),D(this,pa,t),D(this,br,e),Object.assign(this,t)}get maps(){let e=f(this,kr).maps;if(void 0!==e)return e;let t=[],{maps:r}=f(this,br),{id:n}=f(this,pa);for(let e=0,i=r.length;e<i;++e){let i=r[e];i.group===n&&t.push(i)}return f(this,kr).maps=t,t}static hydrate(e,t){return e.map((e=>new Ni(t,e)))}static async fetch(e){let t={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await Be(e.options,"map-group",t)).map((t=>new Ni(e,t)))}catch(e){return console.error("Fetch Map Groups:",e),[]}}toJSON(){return f(this,pa)}},Fi=Ni;br=new WeakMap,pa=new WeakMap,kr=new WeakMap,j();var Ht,vr,ot,wr,Li=class extends hn{constructor(e,t){super(e),F(this,Ht,void 0),F(this,vr,void 0),F(this,ot,{}),p(this,"id",""),p(this,"map",""),p(this,"x",0),p(this,"y",0),p(this,"operationHours"),p(this,"externalId"),F(this,wr,void 0),D(this,Ht,e),D(this,vr,t),Object.assign(this,t)}get lat(){var e;let t=f(this,ot).cachedLatLon;if(null!=t)return t.lat;let r=null==(e=f(this,Ht)._mapsById)?void 0:e[this.map];if(null==r)throw new Error("Map not found");return f(this,ot).cachedLatLon=r.createCoordinateByXY(this.x,this.y),f(this,ot).cachedLatLon.lat}get lon(){var e;let t=f(this,ot).cachedLatLon;if(null!=t)return t.lon;let r=null==(e=f(this,Ht)._mapsById)?void 0:e[this.map];if(null==r)throw new Error("Map not found");return f(this,ot).cachedLatLon=r.createCoordinateByXY(this.x,this.y),f(this,ot).cachedLatLon.lon}get paths(){let e=f(this,ot).paths;if(void 0!==e)return e;let t=[],r=f(this,Ht)._nodesById,n=f(this,wr);if(Array.isArray(n))for(let e=0,i=n.length;e<i;++e){let i=r[n[e].node];null!=i&&t.push(i)}return f(this,ot).paths=t,t}set paths(e){D(this,wr,e)}get locations(){var e;let t=f(this,ot).locations;if(void 0!==t)return t;let r=[],n=null==(e=mt.instances.get(f(this,Ht)))?void 0:e.locationsByMapId[this.map],i=this.id;for(let e=0,t=n.length;e<t;++e){let t=n[e],o=t.nodes;if(Array.isArray(o))for(let e=0,n=o.length;e<n;++e)if(o[e].id===i){r.push(t);break}}return f(this,ot).locations=r,r}get polygon(){let e=f(this,ot).polygon;if(void 0!==e)return e;let t,r=mt.instances.get(f(this,Ht)).polygonsByMapId[this.map],n=this.id;for(let e=0,i=r.length;e<i;++e){let i=r[e];i.entrances.map((e=>e.id)).includes(n)&&(t=i)}return f(this,ot).polygon=t,t}static hydrate(e,t){return e.map((e=>new Li(t,e)))}static async fetch(e){let t=e.options.things.nodes.slice();e.options.things.maps&&Le(t,"map"),["weight","multiplier","accessible"].forEach((function(e){Le(t,e)}));let r={fields:t,perspective:e.options.do2D&&e.options.perspective||void 0,venue:e.options.venue};try{return(await Be(e.options,"node",r)).map((t=>new Li(e,t)))}catch(e){return console.error("Fetch Nodes:",e),[]}}toJSON(){return f(this,vr)}},Bi=Li;Ht=new WeakMap,vr=new WeakMap,ot=new WeakMap,wr=new WeakMap,j();var Mr,qi=class{constructor(e){F(this,Mr,void 0),p(this,"polygons",[]),D(this,Mr,e),Object.assign(this,e)}static hydrate(e){return new qi(e)}static async fetch(e){try{let t=await rr(e.options,"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new qi(t)}catch(e){return console.error("Fetch Rankings:",e),null}}toJSON(){return f(this,Mr)}},Di=qi;Mr=new WeakMap,j();var _r,Wi=class{constructor(e){p(this,"id",""),F(this,_r,void 0),D(this,_r,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new Wi(e)))}static async fetch(e){let t={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await Be(e.options,"apollo-theme",t)).map((e=>new Wi(e)))}catch(e){return console.error("Fetch Theme:",e),[]}}toJSON(){return f(this,_r)}},$o=Wi;_r=new WeakMap,j();var Sr,Tr,fa,Ui=class{constructor(e,t){F(this,Sr,void 0),F(this,Tr,void 0),F(this,fa,{}),p(this,"defaultMap",""),p(this,"address",""),p(this,"city",""),p(this,"countrycode",""),p(this,"externalId",""),p(this,"id",""),p(this,"latitude"),p(this,"logo"),p(this,"longitude"),p(this,"metadata"),p(this,"name",""),p(this,"operationHours"),p(this,"postal",""),p(this,"slug",""),p(this,"state",""),p(this,"telephone",""),p(this,"tzid",""),p(this,"tzidOverride",""),p(this,"utcOffset",""),p(this,"website",""),D(this,Tr,e),D(this,Sr,t),Object.assign(this,t)}static hydrate(e,t){return new Ui(t,e)}static async fetch(e){let t={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let r=await Be(e.options,"venue",t);return new Ui(e,r[0])}catch(e){return console.error("Fetch Venue:",e),{}}}get isMultiBuilding(){if(null==f(this,fa).isMultiBuilding){let e=f(this,Tr).maps,t=e.reduce(((e,t)=>e.add(t.elevation)),new Set),r=e.length!==t.size;f(this,fa).isMultiBuilding=r}return f(this,fa).isMultiBuilding}toJSON(){return f(this,Sr)}},Gi=Ui;Sr=new WeakMap,Tr=new WeakMap,fa=new WeakMap,j();var jr,$i=class{constructor(e){p(this,"id",""),F(this,jr,void 0),p(this,"name"),p(this,"type"),p(this,"weight"),p(this,"multiplier"),D(this,jr,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new $i(e)))}static async fetch(e){let t=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(e){Le(t,e)}));let r={fields:t,venue:e.options.venue};try{return(await Be(e.options,"vortex",r)).map((e=>new $i(e)))}catch(e){return console.error("Fetch Vortexes:",e),[]}}toJSON(){return f(this,jr)}},Vi=$i;function ih(e,t){let r=[];return e.features.forEach((e=>{var n,i;let o=[];null==(n=e.properties.spaces)||n.forEach((e=>{if("id"in e){let r;r=t.get(e.id),r&&o.push(...r)}else null==o||o.push({id:e.node,level:""})}));let a=o.map((e=>({node:"n_"+e.id,map:e.level}))),s=null==(i=e.properties.spaces)?void 0:i.filter((e=>"id"in e)),l=(e.properties.hours||[]).map((e=>({...e,"@type":"OpeningHoursSpecification",dayOfWeek:[e.dayOfWeek.replace("http://schema.org/","")]}))),u={...e.properties,polygons:s||[],nodes:a||[],description:e.properties.description||"",logo:e.properties.logo||{},picture:e.properties.picture||{},phone:e.properties.phone||{},social:e.properties.social||{},externalId:e.properties.externalId||"",states:e.properties.states||[],siblingGroups:e.properties.siblingGroups||[],operationHours:l};delete u.spaces,r.push(u)})),r}function oh(e){let t=new Set;return e.features.forEach((e=>{var r;null==(r=e.properties.states)||r.forEach((e=>{t.add(e.type)}))})),Array.from(t).map((e=>({id:e,name:e,value:e})))}function sh(e){let t=[];return e.features.forEach((e=>{let r={...e.properties,icon:e.properties.picture};delete r.picture,t.push(r)})),t}function lh(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;return e.features.forEach((e=>{let o;o="MultiPolygon"===e.geometry.type?e.geometry.coordinates[0].flat():e.geometry.coordinates[0],o.forEach((e=>{t=Math.min(t,e[1]),n=Math.max(n,e[1]),r=Math.min(r,e[0]),i=Math.max(i,e[0])}))})),{id:e.features[0].properties.id,minLat:t,minLong:r,maxLat:n,maxLong:i}}function uh(e,t,r){let n=r.createGeoreferences(),i=[];return e.features.forEach((e=>{let o=new Set;t.forEach((e=>{e.layer&&o.add(e.layer)}));let a=[...o].map((e=>({id:e,visible:!0}))),s=1/r.mapScale,l={...e.properties,georeference:n,shortName:e.properties.abbreviation||"",scene:{polygons:t},scale:s,x_scale:s,group:e.properties.building,layers:a,width:r.widthInMapUnits,height:r.heightInMapUnits};i.push(l)})),i}jr=new WeakMap,j();var $l=class{constructor(e){p(this,"mapExtent"),p(this,"stretchRatio"),p(this,"midLat"),p(this,"midLong"),p(this,"mapUnitRatio",1e6),p(this,"latDistance"),p(this,"longDistance"),p(this,"mapScale"),p(this,"widthInMapUnits"),p(this,"heightInMapUnits"),this.mapExtent=e;let{minLat:t,minLong:r,maxLat:n,maxLong:i}=e,o=(t+n)/2,a=(r+i)/2,s=new Q(o,i),l=new Q(o,r),u=new Q(t,a),h=new Q(n,a);this.latDistance=u.distanceTo(h),this.longDistance=s.distanceTo(l);let c=this.latDistance/this.longDistance,d=(n-t)/(i-r);this.stretchRatio=c/d,this.midLat=o,this.midLong=a,this.widthInMapUnits=(i-r)*this.mapUnitRatio,this.heightInMapUnits=(n-t)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(e){let t=e[1];return{x:(e[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-t)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:e,minLong:t,maxLat:r,maxLong:n}=this.mapExtent;return[[e,t],[e,n],[r,n],[r,t]].map((e=>({target:{x:e[0],y:e[1]},control:this.convert([e[1],e[0]])})))}};function ch(e,t){let r=[];return e.features.forEach((e=>{let n=t.convert(e.geometry.coordinates),i=(e.properties.neighbors||[]).map((t=>({node:t,map:e.properties.level}))),o=e.properties.level,a={...e.properties,x:n.x,y:n.y,paths:i,map:o,externalId:e.properties.externalId||""};r.push(a)})),r}var Hl=(e,t,r,n,i)=>{let o=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let a=[];"entrances"in e.properties&&(a=e.properties.entrances.map((e=>({id:"n_"+e.id,node:"n_"+e.id,map:e.level}))));let s,l=r[e.properties.id],u=t.find((e=>e.id===l)),h=e.geometry.coordinates[0].map((e=>i.convert(e))),c=n.find((t=>t.polygonId===e.properties.id)),d=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3;if(c){let e=i.convert([c.position[0],c.position[1]]),t=c.size.x,r=c.size.y,n=i.mapScale,o=r*n,a=t*n/d/c.viewBox.width,l=o/d/c.viewBox.height;s={url:null==u?void 0:u.image,visible:!!(null==u?void 0:u.image),viewBox:c.viewBox,scale:{x:a,y:l},position:{x:e.x,y:e.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let p={...e.properties,entrances:a,map:e.properties.level,externalId:e.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==u?void 0:u.altitude)||0)*i.mapScale/d},scale:{x:1,y:1,z:((null==u?void 0:u.height)||1)*i.mapScale/d}},material:{color:(null==u?void 0:u.color)||"#000000"},image:s,vertexes:h};o.push(p)})),o};function dh(e,t,r,n,i,o){let a=Hl(e,r,n,i,o),s=Hl(t,r,n,i,o);return a.concat(s)}function hh(e){let t=new Map;return e.forEach((e=>{e.features.forEach((e=>{let{destinations:r}=e.properties;if(0===r.length)return;let n=r[0].split("-")[0],i=t.get(n),o=r.map((e=>e.split("-")[1])).map((e=>"n_"+e));if(i)i.nodes.push(...o);else{let{name:r,type:i,weight:a,multiplier:s,accessible:l}=e.properties,u={id:n,nodes:o,name:r,type:i,weight:a,multiplier:s,accessible:l};t.set(n,u)}}))})),Array.from(t.values())}function ph(e){let t=[];return e.features.forEach((e=>{let r={...e.properties};t.push(r)})),t}function Yl(e){let t=Array.from(e.connection.values()),r=Array.from(e.level.values()),n=e.building,i=e.category,o=e.style,a=e.location,s=e.imageInstance,l=e.polygonStyle,u={},h=[],c=new Map;r.forEach((t=>{let r=t.features[0].properties.id,n=lh(t),i=new $l(n);c.set(r,i);let a=e.obstruction.get(r),d=e.space.get(r),p=s.get(r),f=l.get(r);u[r]=dh(d,a,o,f,p,i);let y=e.node.get(r);h.push(...ch(y,i))}));let d=Object.values(u).flat(),p=hh(t),f=r.map((e=>{let t=e.features[0].properties.id,r=c.get(t);return uh(e,u[t],r)})).flat(),y=new Map;Array.from(e.space.values()).forEach((e=>{e.features.forEach((e=>{y.set(e.properties.id,e.properties.entrances)}))}));let g=ph(n),m=ih(a,y),b=sh(i),_=oh(a),v=e.manifest.features[0].properties.name,w=e.manifest.features[0].geometry.coordinates[0],S=e.manifest.features[0].geometry.coordinates[1],M=e.imageBinaries;return{locations:m,categories:b,nodes:h,maps:f,polygons:d,vortexes:p,mapGroups:g,locationStates:_,themes:[],venue:{name:v,latitude:S,longitude:w},imageBinaries:M}}j(),j(),j();var Fn,Nn,Ho=[0,4,6,8,10],Pn=()=>{let e=new Array(16).fill(0),t=4294967296*Math.random();for(let r=0;r<e.length;r++)r>0&&0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;let r=e.map((e=>e.toString(16).padStart(2,"0")));return r[6]="4"+r[6][1],r[8]=["8","9","a","b"].includes(r[7][0])?r[7]:"a"+r[7][1],Ho.map(((e,t)=>r.slice(e,t===Ho.length-1?void 0:Ho[t+1]).join(""))).join("-")};function Jl(e){return/^[\da-f]{24}$/i.test(e)}function Xl(){if(!Fn)try{let e="mi-uuid";(Fn=localStorage.getItem(e))||(Fn=Pn(),localStorage.setItem(e,Fn))}catch(e){Fn="NLS-"+Pn()}return Fn}function Ql(){if(!Nn)try{let e="mi-session";(Nn=sessionStorage.getItem(e))||(Nn=Pn(),sessionStorage.setItem(e,Nn))}catch(e){Nn="NSS-"+Pn()}return Nn}var ku,vu,Rr,ma,ga,xr,ya,ba,ka,Bn,Er,va,wa,Ar,yu=Ne(gu()),_h=null==(vu=null==(ku=G)?void 0:ku.env)?void 0:vu.npm_package_version,bu=["websdk","web","webv2"],Qo=class{constructor(e){var t;F(this,Rr,void 0),F(this,ma,void 0),F(this,ga,void 0),F(this,xr,void 0),F(this,ya,void 0),F(this,ba,void 0),F(this,ka,void 0),F(this,Bn,void 0),F(this,Er,void 0),F(this,va,void 0),F(this,wa,void 0),F(this,Ar,void 0),D(this,Bn,e.clientId),D(this,Er,e.clientSecret),D(this,va,e.accessToken),D(this,ka,e.noAuth||!1);let r="https://api-gateway.mappedin.com/track-analytics/a/";!f(this,ka)&&f(this,Bn)&&!Jl(f(this,Bn))&&(r="https://web-proxy.mappedin.com/a/"),D(this,ga,r),D(this,ga,f(this,ga)+(e.venue+"/")),D(this,ma,!1),D(this,Rr,"boolean"==typeof e.testMode?e.testMode:"true"===(null==(t=e.testMode)?void 0:t.toLowerCase())),D(this,xr,bu.find((t=>t===e.context))||bu[0]),D(this,ya,Xl()),D(this,ba,Ql()),D(this,wa,new Set),D(this,Ar,e.platformString||"")}track(e,t){if(f(this,Rr))return;let r={...t,g:f(this,ma)},n=f(this,ga)+e+"?"+yu.default.stringify(r),i={"mi-context":f(this,xr),"mi-session":f(this,ba),"mi-device":f(this,ya),"mappedin-sdk-version":_h,"mappedin-platform-version":f(this,Ar)};f(this,va)?i.Authorization=`Bearer ${f(this,va)}`:f(this,ka)||(i.Authorization=`Basic ${btoa(`${f(this,Bn)}:${f(this,Er)}`)}`),ir()(n,{method:"GET",mode:"cors",headers:i})}locationSelected(e){let t=e.id||e;this.track("select-location",{id:t})}categorySelected(e){let t=e.id||e;this.track("select-category",{id:t})}mapViewLoaded(e,t,r,n){this.track("load-mapview",{type:e,force:t,benchmark:r||-1,reason:n||"success"})}getDirections(e,t){let r={start:e,end:t,type:"location_to_location"};this.track("query-directions",r)}getSessionID(){return f(this,ba)}getDeviceID(){return f(this,ya)}setGeolocationMode(e){D(this,ma,e)}trackBlueDotEvent(e){e&&Object.values(Qo.BLUEDOT_EVENT).includes(e)&&!f(this,wa).has(e)?(this.track(e),f(this,wa).add(e)):console.warn(`Ignored unsupported blue dot event: "${e}".`)}trackSearch(e){null!=e&&this.track("query-search",e)}trackSearchSuggest(e){null!=e&&this.track("query-suggest",e)}},Xo=Qo;Rr=new WeakMap,ma=new WeakMap,ga=new WeakMap,xr=new WeakMap,ya=new WeakMap,ba=new WeakMap,ka=new WeakMap,Bn=new WeakMap,Er=new WeakMap,va=new WeakMap,wa=new WeakMap,Ar=new WeakMap,p(Xo,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var Ko,Hi=Xo,wu={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,do2D:!1,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(e){e.CATEGORY="categories",e.EVENT="events",e.LOCATION="locations",e.MAPGROUP="mapGroups",e.MAP="maps",e.NODE="nodes",e.POLYGON="polygons",e.VORTEX="vortexes"}(Ko||(Ko={}));var mn,_a,Ma={categories:da,locations:fn,vortexes:Vi,maps:Ci,nodes:Bi,polygons:ca,venue:Gi,events:Ai,mapGroups:Fi,themes:$o,locationStates:Vo,locationRankings:Uo,rankings:Di},Ln=class{constructor(e){p(this,"perspective"),p(this,"things"),p(this,"options"),F(this,mn,void 0),F(this,_a,""),p(this,"updatedAt"),p(this,"categories",[]),p(this,"locations",[]),p(this,"vortexes",[]),p(this,"maps",[]),p(this,"nodes",[]),p(this,"polygons",[]),p(this,"venue",{}),p(this,"events",[]),p(this,"mapGroups",[]),p(this,"themes",[]),p(this,"locationStates",[]),p(this,"locationRankings",[]),p(this,"rankings"),p(this,"_categoriesById"),p(this,"_locationsById"),p(this,"_vortexesById"),p(this,"_mapsById"),p(this,"_nodesById"),p(this,"_polygonsById"),p(this,"_eventsById"),p(this,"_mapGroupsById"),p(this,"_locationStatesById"),p(this,"_locationRankingsById"),p(this,"_rankingsById"),p(this,"_categoriesByExternalId"),p(this,"_locationsByExternalId"),p(this,"_vortexesByExternalId"),p(this,"_mapsByExternalId"),p(this,"_nodesByExternalId"),p(this,"_polygonsByExternalId"),p(this,"_eventsByExternalId"),p(this,"_mapGroupsByExternalId"),p(this,"_locationStatesByExternalId"),p(this,"_locationRankingsByExternalId"),p(this,"_rankingsByExternalId"),p(this,"images"),p(this,"imageBinaries"),p(this,"scenes"),p(this,"analytics"),p(this,"navigator"),this.options=e,D(this,mn,mt.create(this)),this.analytics=new Hi(e)}generateGetters(e){try{for(let t=0,r=e.length;t<r;++t){let r=e[t];Array.isArray(this[r])&&(Object.defineProperty(this,`_${r}ByExternalId`,{get(){let e=f(this,mn)[r];if(null!=e)return e;let t={};return this[r].forEach((e=>t[e.externalId]=e)),f(this,mn)[r]=t,t}}),Object.defineProperty(this,`_${r}ById`,{get(){let e=f(this,mn)[r];if(null!=e)return e;let t={};return this[r].forEach((e=>t[e.id]=e)),f(this,mn)[r]=t,t}}))}return this}catch(e){throw new Error("Unable to generate getters, "+e)}}getCollectionItemById(e,t){let r=`_${e}ByExternalId`,n=this[`_${e}ById`];return null!=n&&null!=n[t]||(n=this[r],null!=n&&null!=n[t])?n[t]:null}async hydrateFromMVF(e){let t=Yl(e);return this.hydrate(t)}async hydrate(e,t){let r;if("string"==typeof e)try{D(this,_a,e),r=JSON.parse(e)}catch(e){return void console.error("Unable to parse JSON",e)}else r=e,D(this,_a,JSON.stringify(r));let n=Object.keys(r);for(let e=0,t=n.length;e<t;++e){let t=n[e],i=r[t];null!=Ma[t]&&"function"==typeof Ma[t].hydrate&&(this[t]=Ma[t].hydrate(i,this))}t&&await Vl(r);let{images:i,scenes:o,imageBinaries:a}=r;this.images=i,this.scenes=o,this.imageBinaries=a,this.generateGetters(n),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),ql(this.options.clientId)||(this.options.things.rankings&&delete this.options.things.rankings,this.options.things.locationRankings&&delete this.options.things.locationRankings);let{things:e}=this.options,t=[],r=Object.keys(e);for(let e=0,n=r.length;e<n;++e){let n=r[e];Ma[n]&&t.push(Ma[n].fetch(this).then((e=>(this[n]=e,Promise.resolve()))))}return this.generateGetters(r),Promise.all(t).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new Lo({locations:this.locations.map((e=>e.toJSON())),nodes:this.nodes.map((e=>e.toJSON())),vortexes:this.vortexes.map((e=>e.toJSON())),maps:this.maps.map((e=>e.toJSON()))})}toJSON(){var e;let t={};for(let e in Ma)Array.isArray(this[e])&&(t[e]=this[e].map((e=>e.toJSON())));let r={...t,venue:this.venue.toJSON()};return null!=this.rankings&&(r.rankings=null==(e=this.rankings)?void 0:e.toJSON()),delete r.locationRankings,r}toString(){return f(this,_a)||JSON.stringify(this.toJSON())}};mn=new WeakMap,_a=new WeakMap,j();var Mu={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"],locationRankings:[]},Rc=Ne(wc());j();var Hn=Ne(Mc());j();var Hh=["0","1","2","3","4","5","6","7","8","9"],Yh=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Jh=["0","1","2","3","4","5","6","7","8","9"],Xh=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Jg=[...Hh,...Yh,...Jh,...Xh],_c=["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"];j();var Yn,_t,wn,qt,Ze,Ur,Vr,Ea,$r,Aa,en,uo,co,Mn,Hr,ho,po,fo,dp,Yr,Jr,vs,Qh=32,pt=!1,Kh=120,gs=0,ys=class{constructor(e){p(this,"_callback"),p(this,"_frameCount"),p(this,"_ordering"),p(this,"_supersededBy"),p(this,"name"),p(this,"_remainingFrameCount"),p(this,"_lastFrameTime"),p(this,"userdata"),this._callback=e.callback,this._frameCount=null!=e.frameCount?e.frameCount:1,this._ordering=null!=e.ordering?e.ordering:0,this._supersededBy=null!=e.supersededBy?new Set(e.supersededBy):new Set,this.name=e.name,this.userdata=e.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,pt&&console.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}},vn=class{constructor(e){if(p(this,"_postponed"),p(this,"userdata"),p(this,"_priority"),p(this,"_group"),p(this,"name"),p(this,"_lastFrameTime"),p(this,"_callback"),p(this,"_complete"),p(this,"_scheduled"),p(this,"_cancelled"),null!=e.group&&null!=e.priority)throw new Error("cannot specify task priority individually within group");if(null!=e.group&&null!=e.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=e.callback,this._group=null!=e.group?e.group:null,this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,pt&&console.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},bs=class{constructor(e){p(this,"_postponed"),p(this,"_onComplete"),p(this,"_priority"),p(this,"userdata"),p(this,"name"),p(this,"_tasks"),p(this,"_scheduledTasks"),p(this,"_scheduled"),p(this,"_cancelled"),this._onComplete=null!=e.onComplete?e.onComplete:()=>{},this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,pt&&console.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 e of this._scheduledTasks)return this._scheduledTasks.delete(e),e}},Sc=class{constructor(e){p(this,"_maxMillisecondsPerFrame"),p(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==e?void 0:e.maxMillisecondsPerFrame)?e.maxMillisecondsPerFrame:Qh,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},ks=class{constructor(e){p(this,"_timer"),p(this,"_performance"),p(this,"_scheduledUpdatesByOrdering"),p(this,"_scheduledTasksByPriority"),p(this,"_postponedTasks"),p(this,"_requestAnimationFrameHandle"),p(this,"_updatesToRunThisFrame"),p(this,"_lastFrameTime",0),p(this,"_updatesRunLastFrame"),this._timer=null!=(null==e?void 0:e.timer)?e.timer:new Sc,this._performance=null!=(null==e?void 0:e.performance)&&e.performance,this._scheduledUpdatesByOrdering=new Gr,this._scheduledTasksByPriority=new Gr,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),pt&&console.log("task scheduler instantiated")}clear(){for(let e of this._scheduledTasksByPriority.values())e._cancelled=!0;for(let e of this._postponedTasks.values())e._cancelled=!0;this._scheduledUpdatesByOrdering=new Gr,this._scheduledTasksByPriority=new Gr,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),pt&&console.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle=requestAnimationFrame(this.update))}update(e){let t;this._timer.beginFrame(),this._performance&&(t=performance.now());let r=!1;pt&&(0===gs&&(r=!0),++gs,gs%=Kh);let n=this._scheduledUpdatesByOrdering.keys();for(let e=n.length-1;e>=0;--e){let t=n[e];for(let e of this._scheduledUpdatesByOrdering.get(t).values())this._updatesToRunThisFrame.push(e),r&&console.log("update scheduled to run this frame",e.name)}for(let e of this._updatesToRunThisFrame){--e._remainingFrameCount,e._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(e._ordering,e),e._superseded=!1;for(let t of this._updatesToRunThisFrame)e._supersededBy.has(t)&&(e._superseded=!0,r&&console.log("update superseded",e.name,t.name))}for(let e=0;e<this._updatesToRunThisFrame.length;++e)this._updatesToRunThisFrame[e]._superseded&&(this._updatesToRunThisFrame.splice(e,1),--e);for(let t of this._updatesToRunThisFrame){let n;this._performance&&(n=performance.now()),t._callback(e),this._performance&&(t._lastFrameTime=performance.now()-n),r&&console.log("update completed",t.name)}this._updatesRunLastFrame.clear();for(let e of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(e);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(e)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-t),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(e){let t,r=this._scheduledTasksByPriority.popFromMaxKey(),n=null;console.assert(void 0!==r),Object.getPrototypeOf(r)===bs.prototype&&(n=r,r=n._popTask()),console.assert(void 0!==r),console.assert(Object.getPrototypeOf(r)===vn.prototype),this._performance&&(t=performance.now()),r._callback(e),r._complete=!0,this._performance&&(r._lastFrameTime=performance.now()-t),pt&&console.log("task completed",r.name),null!=n&&(n.isComplete()?(n.clear(),n._onComplete(),pt&&console.log("group completed",n.name)):this._scheduledTasksByPriority.insert(n._priority,n))}scheduleUpdate(e){e._remainingFrameCount=e._frameCount,this._scheduledUpdatesByOrdering.insert(e._ordering,e),this.requestAnimationFrame()}scheduleTask(e){if(Object.getPrototypeOf(e)===bs)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+e.name);if(e._scheduled)throw new Error("cannot schedule already scheduled task: "+e.name);if(e._cancelled)throw new Error("cannot schedule cancelled task: "+e.name);let t=e;"_group"in e&&null!=e._group&&(e._group._tasks.add(e),e._group._scheduledTasks.add(e),t=e._group),t._postponed?this._postponedTasks.add(t):this._scheduledTasksByPriority.insert(t._priority,t),e._scheduled=!0,t._scheduled=!0,pt&&console.log("task scheduled",e.name),this.requestAnimationFrame()}cancelUpdate(e){this._scheduledUpdatesByOrdering.delete(e._ordering,e),pt&&console.log("update cancelled",e.name)}cancelTask(e){if(!e._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+e.name);if(e._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+e.name);if("_group"in e&&null!=e._group){let t=e._group.isComplete();e._group._tasks.delete(e),e._group._scheduledTasks.delete(e),e._group.isComplete()&&(this._scheduledTasksByPriority.delete(e._group._priority,e._group),t||e._group._onComplete())}else this._scheduledTasksByPriority.delete(e._priority,e),this._postponedTasks.delete(e);Object.getPrototypeOf(e)===vn.prototype?e._cancelled=!0:"clear"in e&&e.clear(),pt&&console.log("task cancelled",e.name)}postponeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot postpone individual tasks in group: "+e.name);if(e._cancelled)throw new Error("cannot postpone cancelled task: "+e.name);if(!e._postponed){if(Object.getPrototypeOf(e)===vn.prototype){if("_complete"in e)return;if(!e._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+e.name)}this._scheduledTasksByPriority.delete(e._priority,e),(Object.getPrototypeOf(e)===vn.prototype||!e.isComplete())&&this._postponedTasks.add(e),e._postponed=!0,pt&&console.log("task postponed",e.name)}}resumeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot resume individual tasks in groups");if(e._cancelled)throw new Error("cannot resume cancelled task");if(e._postponed){if(Object.getPrototypeOf(e)===vn.prototype){if("_complete"in e&&e._complete)return;if(!e._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(e),(Object.getPrototypeOf(e)===vn.prototype||!e.isComplete())&&this._scheduledTasksByPriority.insert(e._priority,e),e._postponed=!1,this.requestAnimationFrame(),pt&&console.log("task resumed",e.name)}}setTaskPriority(e,t){if(Object.getPrototypeOf(e)===vn.prototype&&!e._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(e._priority,e)&&(this._scheduledTasksByPriority.delete(e._priority,e),this._scheduledTasksByPriority.insert(t,e)),e._priority=t,pt&&console.log("task priority changed",e.name,t)}},Gr=class{constructor(){p(this,"_map"),p(this,"_size"),p(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(e,t){return null!=this._map.get(e)&&this._map.get(e).has(t)}get(e){return this._map.get(e)}insert(e,t){if(console.assert("number"==typeof e&&Number.isFinite(e)),null==this._map.get(e)){this._map.set(e,new Set);for(let t=0;t<=this._sortedKeys.length;++t)if(t===this._sortedKeys.length||e<this._sortedKeys[t]){this._sortedKeys.splice(t,0,e);break}}this._map.get(e).has(t)||(this._map.get(e).add(t),++this._size)}delete(e,t){null!=this._map.get(e)&&this._map.get(e).has(t)&&(this._map.get(e).delete(t),--this._size,0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)))}pop(e){if(null!=this._map.get(e)){let t;for(t of this._map.get(e).values()){this._map.get(e).delete(t),--this._size;break}return 0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)),t}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let e=this._map.keys(),t=null,r={[Symbol.iterator]:()=>r,next:()=>{if(null==t){let r=e.next();if(r.done)return r;t=this._map.get(r.value).values()}let r=t.next();for(;r.done;){let n=e.next();if(n.done)return n;t=this._map.get(n.value).values(),r=t.next()}return r}};return r}keys(){return this._sortedKeys}get size(){let e=0;for(let t of this._map.values())e+=t.size;return console.assert(e===this._size),e}},Zt=e=>e.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),xa="",Zh=.09,ep=1,tp=.025,np=.5,ap=5e-4,rp=5e-4,ip=.01,op=.05,Tc=1,sp=.01,lp=.2,up={MappedinCategory:"categories",MappedinLocation:"locations"},cp={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:_c,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===G.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Zh,PRIMARY_INDEX_WEIGHT:ep,SECONDARY_INDEX_WEIGHT:tp,CATEGORY_NAME_WEIGHT:np,LOCATION_NAME_WEIGHT:Tc,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:ap,CATEGORY_LOCATION_TAGS_WEIGHT:rp,CATEGORY_LOCATION_NAME_WEIGHT:ip,PRIMARY_INDEX_TAGS_NAME_WEIGHT:op,LOCATION_DEFAULT_RANK:Tc,RATIO_OF_FUZZY_TO_EXACT:sp,RATIO_OF_PREFIX_TO_EXACT:lp}},lo=class{constructor(e,t){var r,n,i;F(this,fo),F(this,Yn,void 0),F(this,_t,void 0),F(this,wn,void 0),F(this,qt,void 0),F(this,Ze,void 0),F(this,Ur,new ks({performance:!0})),F(this,Vr,void 0),F(this,Ea,void 0),F(this,$r,new Map),F(this,Aa,0),F(this,en,(e=>{D(this,Aa,1+ +f(this,Aa)),f(this,Ur).scheduleUpdate(new ys({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{e(),D(this,Aa,+f(this,Aa)-1),0===f(this,Aa)&&f(this,Hr).call(this)}}))})),F(this,uo,(e=>{var t,r,n;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:o,PRIMARY_INDEX_TAGS_NAME_WEIGHT:a}=f(this,Ze).constants,s=o;(null==(t=f(this,Ze))?void 0:t.useLocationRank)&&(s=Array.isArray(e.polygons)?Math.max(...e.polygons.map((e=>{var t,r;return(null==(t=e.rank)?void 0:t.score)?null==(r=e.rank)?void 0:r.score:o})),o):o),f(this,en).call(this,(()=>{f(this,_t).add({name:Zt(e.name),tags:"",id:"MappedinLocation_"+e.id,weight:o,rank:s})})),(null==(r=f(this,Ze))?void 0:r.searchTags)&&Array.isArray(e.tags)&&e.tags.forEach((t=>{f(this,_t).add({name:"",tag:Zt(t),id:"MappedinLocation_"+e.id,weight:a,rank:s})})),(null==(n=f(this,Ze))?void 0:n.searchDescriptions)&&f(this,en).call(this,(()=>f(this,wn).add({description:Zt(e.description||""),id:"MappedinLocation_"+e.id,weight:i,rank:s})))})),F(this,co,(e=>{var t,r;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:n,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:o,CATEGORY_NAME_WEIGHT:a}=f(this,Ze).constants;f(this,en).call(this,(()=>f(this,_t).add({name:Zt(e.name||""),description:"",id:"MappedinCategory_"+e.id,weight:a})));let s=e.locations.reduce(((e,t)=>e+` ${xa} `+t.name),"")+` ${xa}`;if((null==(t=f(this,Ze))?void 0:t.searchDescriptionsInCategories)&&e.locations.forEach((t=>{null!=t.description&&f(this,en).call(this,(()=>f(this,qt).add({id:"MappedinCategory_"+e.id,"category.locations.description":Zt(t.description),ref:t.name,weight:n})))})),null==(r=f(this,Ze))?void 0:r.searchTagsInCategories){let t=e.locations.reduce(((e,t)=>{var r;return e+(null==(r=t.tags)?void 0:r.reduce(((e,t)=>e+` ${xa} `+t),""))+` ${xa}`}),"");f(this,en).call(this,(()=>f(this,qt).add({"category.locations.tags":Zt(t),id:"MappedinCategory_"+e.id,weight:i})))}f(this,en).call(this,(()=>f(this,qt).add({"category.locations.name":Zt(s),id:"MappedinCategory_"+e.id,weight:o})))})),F(this,Mn,void 0),F(this,Hr,void 0),F(this,ho,(e=>{var t;let r=e.score,{object:n,id:i,weight:o,rank:a}=e,[s,l]=i.split("_"),u=n||f(this,Yn).getCollectionItemById(up[s],l);return a&&(null==(t=f(this,Ze))?void 0:t.useLocationRank)&&(r+=a),o&&(r*=o),{score:r,type:s,object:u}})),F(this,po,((e,t)=>{for(let r in e.match)e.match[r].forEach((n=>{let i=e.ref||e[n]||t.object[n];if("category.locations.tags"===n||"category.locations.name"===n){let t=new RegExp(`[^${xa}]* `+r+` [^${xa}]*`,"ig").exec(e[n]);null!=t&&(i=t[0].slice(1,-1))}t.matches.push({term:r,weight:e.weight,matchesOn:n,value:i})}))})),F(this,Yr,void 0),F(this,Jr,void 0),D(this,Ea,new Hi({...e.options,testMode:!1===(null==t?void 0:t.emitAnalyticsEvents)})),D(this,Ze,{...cp,...t}),D(this,Yn,e),D(this,Vr,new Set(null==(r=f(this,Ze))?void 0:r.stopWords));let{PRIMARY_INDEX_FUZZYNESS:o,PRIMARY_INDEX_WEIGHT:a,CATEGORY_NAME_WEIGHT:s,RATIO_OF_FUZZY_TO_EXACT:l,RATIO_OF_PREFIX_TO_EXACT:u,PRIMARY_INDEX_TAGS_NAME_WEIGHT:h}=f(this,Ze).constants,c=["object","query","weight","tag","rank"],d={fields:["query","name","tag"],storeFields:c,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:o},boost:{name:a,query:a,tag:h},weights:{fuzzy:l,prefix:u},boostDocument:e=>e.includes("MappedinLocation")?a:e.includes("MappedinCategory")?s:a},p={fields:["description"],storeFields:c,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(e,t)=>{var r;return(null==(r=f(this,Vr))?void 0:r.has(e.toLowerCase()))?null:e.toLowerCase()}},y={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...c,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(null==(n=f(this,Ze))?void 0:n.jsonIndex){let{primary:e,secondary:t,extra:r}=JSON.parse(null==(i=f(this,Ze))?void 0:i.jsonIndex);D(this,_t,Hn.default.loadJS(e,d)),D(this,wn,Hn.default.loadJS(t,p)),D(this,qt,Hn.default.loadJS(r,y))}else D(this,_t,new Hn.default(d)),D(this,wn,new Hn.default(p)),D(this,qt,new Hn.default(y)),f(this,Yn).locations.forEach(f(this,uo)),f(this,Yn).categories.forEach(f(this,co));D(this,Mn,new Promise((e=>{D(this,Hr,e)}))),f(this,Ur).update(performance.now()),D(this,Yr,Go(((e,t)=>{f(this,Ea).trackSearchSuggest({query:e,hits:t})}),300)),D(this,Jr,Go(((e,t)=>{f(this,Ea).trackSearch({query:e,hits:t})}),300))}async suggest(e){await f(this,Mn);let{PRIMARY_INDEX_FUZZYNESS:t,PRIMARY_INDEX_WEIGHT:r,PRIMARY_INDEX_TAGS_NAME_WEIGHT:n,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:o}=f(this,Ze).constants,a=f(this,_t).autoSuggest(e,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:t,boost:{name:r,query:r,tag:n},weights:{fuzzy:i,prefix:o}});return f(this,Yr).call(this,e,a.length),{total:a.length,hits:a.map((e=>({text:e.suggestion})))}}async search(e){await f(this,Mn);let t=pl(this,fo,dp).call(this,e);return f(this,Jr).call(this,e,t.length),t}async toJSON(){return await f(this,Mn),JSON.stringify({primary:f(this,_t),secondary:f(this,wn),extra:f(this,qt)})}async addQuery(e){let t,r,{query:n,object:i,weight:o=1}=e;await f(this,Mn),t=i instanceof fn?"MappedinLocation":i instanceof da?"MappedinCategory":"Custom","MappedinLocation"===t||"MappedinCategory"===t?r=t+"_"+i.id:"string"==typeof i.id?r="Custom_"+i.id:(r=f(this,$r).get(i),r||(r="Custom_"+Pn(),f(this,$r).set(i,r))),f(this,_t).add({id:r,weight:o,object:i,query:Zt(n)})}};Yn=new WeakMap,_t=new WeakMap,wn=new WeakMap,qt=new WeakMap,Ze=new WeakMap,Ur=new WeakMap,Vr=new WeakMap,Ea=new WeakMap,$r=new WeakMap,Aa=new WeakMap,en=new WeakMap,uo=new WeakMap,co=new WeakMap,Mn=new WeakMap,Hr=new WeakMap,ho=new WeakMap,po=new WeakMap,fo=new WeakSet,dp=function(e){let t=[],r=Zt(e);t=[...f(this,_t).search(r),...f(this,wn).search(r),...f(this,qt).search(r)].sort(((e,t)=>t.score-e.score));let n={};for(let e of t){let t=f(this,ho).call(this,e);n[e.id]?n[e.id].score+=t.score:n[e.id]={...t,matches:[]},f(this,po).call(this,e,n[e.id])}return Object.keys(n).map((e=>({...n[e],matches:n[e].matches.sort(((e,t)=>t.weight-e.weight))}))).sort(((e,t)=>t.score-e.score))},Yr=new WeakMap,Jr=new WeakMap,j(),function(e){e.MULTI_GEOMETRY="MULTI_GEOMETRY",e.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(vs||(vs={}));var xc=globalThis.fetch||Rc.default;function ir(){if(null==xc)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return xc}var Ac,Ic,hp=null==(Ic=null==(Ac=G)?void 0:Ac.env)?void 0:Ic.npm_package_version;globalThis.btoa||(globalThis.btoa=jc.encode);var pp=["ar"];function ws(e){let t={...wu,things:Mu,...e};return t.headers={...t.headers,"mappedin-sdk-version":hp},e.platformString&&(t.headers={...t.headers,"mappedin-platform-version":e.platformString}),t.noAuth||(t.accessToken?t.authorization=`Bearer ${t.accessToken}`:t.clientId&&t.clientSecret&&(t.authorization=`Basic ${globalThis.btoa(`${t.clientId}:${t.clientSecret}`)}`)),t}async function Ms(e){let t=ws({baseUrl:"https://api-gateway.mappedin.com/",...e}),r="public/1/"+(t.useDraftData?"draft/":""),n=new Ln({...t,baseUrl:t.baseUrl+r});return await n.fetch(),n}var Ec={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function _s(e){let t=ws({baseUrl:"https://api-gateway.mappedin.com/",...Ec,...e}),{url:r,updated_at:n}=await fp(e),i=await ir()(r,{mode:"cors"}),{data:o,format:a="jsonstring"}=await i.json();if("jsonstring"!==a)throw new Error(`Unrecognized format ${a}`);let s=new Ln(t);return await s.hydrate(o,t.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}async function fp(e){let t=ws({baseUrl:"https://api-gateway.mappedin.com/",...Ec,...e}),{version:r,venue:n}=e,i=`${e.bundleBaseUri||t.baseUrl+`exports/legacy${null!=t.language&&pp.includes(t.language)?"-"+t.language:""}/1/bundle`}?venue=${n}&version=1.0.0`;return t.language=void 0,await Wo(t,i)}var mp=!1;function gp(e){e.things=e.things||{},e.things.venue=e.things.venue||[],e.things.venue.push("slug","defaultMap"),e.things.nodes=e.things.nodes||[],e.things.nodes.push("x","y","paths","map"),e.things.polygons=e.things.polygons||[],e.things.locations=e.things.locations||[],e.things.locations.push("sortOrder","parent","showLabelWhenImagePresent","hidden"),e.things.maps=e.things.maps||[],e.things.maps.push("height","width","georeference"),e.perspective=e.perspective3D||e.perspective||void 0,e.things.maps.push("scene","layers"),e.things.polygons.push("canvasBounds","map","image","perspectives","material","holes","label","geometry"),mp&&e.things.polygons.push("layer","geometry","vertexes"),e.do2D=!1}var yp=function(e){return null==e.mapView&&(e.mapView={}),new Promise((function(t,r){function n(n,i){if(n)r(n);else{let n={};try{e.firstMapSelector&&(e.mapView=e.mapView||{},e.mapView.firstMap=e.firstMapSelector(i))}catch(e){console.error("Failure in firstMapSelector! Loading default map instead."),console.error(e),r(e)}n.venue=i,t(n)}}gp(e.venue),e.venue.useVenueBundle?_s(e.venue).then((e=>n(null,e))).catch((e=>n(e,null))):Ms(e.venue).then((e=>n(null,e))).catch((e=>n(e,null)))}))};
|
|
1
|
+
var Qd,G,Ud=Object.create,Va=Object.defineProperty,Vd=Object.getOwnPropertyDescriptor,$d=Object.getOwnPropertyNames,Hd=Object.getPrototypeOf,Yd=Object.prototype.hasOwnProperty,Jd=(e,t,r)=>t in e?Va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hl=e=>Va(e,"__esModule",{value:!0}),Ve=(e,t)=>()=>(e&&(t=e(e=0)),t),vt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Po=(e,t)=>{for(var r in hl(e),t)Va(e,r,{get:t[r],enumerable:!0})},Xd=(e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of $d(t))!Yd.call(e,n)&&"default"!==n&&Va(e,n,{get:()=>t[n],enumerable:!(r=Vd(t,n))||r.enumerable});return e},Ne=e=>Xd(hl(Va(null!=e?Ud(Hd(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),p=(e,t,r)=>(Jd(e,"symbol"!=typeof t?t+"":t,r),r),Fo=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},f=(e,t,r)=>(Fo(e,t,"read from private field"),r?r.call(e):t.get(e)),F=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},D=(e,t,r,n)=>(Fo(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),pl=(e,t,r)=>(Fo(e,t,"access private method"),r),j=Ve((()=>{G={env:Qd={NODE_ENV:"production",npm_package_version:"4.1.5"}}})),ml=vt(((e,t)=>{j(),function(r){var n="object"==typeof e&&e,i="object"==typeof t&&t&&t.exports==n&&t,o="object"==typeof global&&global;(o.global===o||o.window===o)&&(r=o);var a=function(e){this.message=e};(a.prototype=new Error).name="InvalidCharacterError";var s=function(e){throw new a(e)},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,h={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&s("The string to be encoded contains characters outside of the Latin1 range.");for(var t,r,n,i,o=e.length%3,a="",u=-1,h=e.length-o;++u<h;)t=e.charCodeAt(u)<<16,r=e.charCodeAt(++u)<<8,n=e.charCodeAt(++u),a+=l.charAt((i=t+r+n)>>18&63)+l.charAt(i>>12&63)+l.charAt(i>>6&63)+l.charAt(63&i);return 2==o?(t=e.charCodeAt(u)<<8,r=e.charCodeAt(++u),a+=l.charAt((i=t+r)>>10)+l.charAt(i>>4&63)+l.charAt(i<<2&63)+"="):1==o&&(i=e.charCodeAt(u),a+=l.charAt(i>>2)+l.charAt(i<<4&63)+"=="),a},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var r,n,i=0,o="",a=-1;++a<t;)n=l.indexOf(e.charAt(a)),r=i%4?64*r+n:n,i++%4&&(o+=String.fromCharCode(255&r>>(-2*i&6)));return o},version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return h}));else if(n&&!n.nodeType)if(i)i.exports=h;else for(var c in h)h.hasOwnProperty(c)&&(n[c]=h[c]);else r.base64=h}(e)})),gl=vt(((e,t)=>{var r,n;j(),r="undefined"!=typeof self?self:e,n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t),r.d(t,"computeDestinationPoint",(function(){return P})),r.d(t,"convertArea",(function(){return D})),r.d(t,"convertDistance",(function(){return C})),r.d(t,"convertSpeed",(function(){return B})),r.d(t,"decimalToSexagesimal",(function(){return W})),r.d(t,"findNearest",(function(){return U})),r.d(t,"getAreaOfPolygon",(function(){return H})),r.d(t,"getBounds",(function(){return G})),r.d(t,"getBoundsOfDistance",(function(){return V})),r.d(t,"getCenter",(function(){return Q})),r.d(t,"getCenterOfBounds",(function(){return Y})),r.d(t,"getCompassDirection",(function(){return X})),r.d(t,"getCoordinateKey",(function(){return y})),r.d(t,"getCoordinateKeys",(function(){return S})),r.d(t,"getDistance",(function(){return z})),r.d(t,"getDistanceFromLine",(function(){return Z})),r.d(t,"getGreatCircleBearing",(function(){return K})),r.d(t,"getLatitude",(function(){return x})),r.d(t,"getLongitude",(function(){return O})),r.d(t,"getPathLength",(function(){return te})),r.d(t,"getPreciseDistance",(function(){return re})),r.d(t,"getRhumbLineBearing",(function(){return J})),r.d(t,"getRoughCompassDirection",(function(){return ne})),r.d(t,"getSpeed",(function(){return ie})),r.d(t,"isDecimal",(function(){return g})),r.d(t,"isPointInLine",(function(){return oe})),r.d(t,"isPointInPolygon",(function(){return ae})),r.d(t,"isPointNearLine",(function(){return se})),r.d(t,"isPointWithinRadius",(function(){return le})),r.d(t,"isSexagesimal",(function(){return m})),r.d(t,"isValidCoordinate",(function(){return E})),r.d(t,"isValidLatitude",(function(){return M})),r.d(t,"isValidLongitude",(function(){return T})),r.d(t,"orderByDistance",(function(){return $})),r.d(t,"sexagesimalToDecimal",(function(){return b})),r.d(t,"toDecimal",(function(){return k})),r.d(t,"toRad",(function(){return I})),r.d(t,"toDeg",(function(){return N})),r.d(t,"wktToPolygon",(function(){return he})),r.d(t,"sexagesimalPattern",(function(){return n})),r.d(t,"earthRadius",(function(){return i})),r.d(t,"MINLAT",(function(){return o})),r.d(t,"MAXLAT",(function(){return a})),r.d(t,"MINLON",(function(){return s})),r.d(t,"MAXLON",(function(){return l})),r.d(t,"longitudeKeys",(function(){return u})),r.d(t,"latitudeKeys",(function(){return h})),r.d(t,"altitudeKeys",(function(){return c})),r.d(t,"distanceConversion",(function(){return d})),r.d(t,"timeConversion",(function(){return p})),r.d(t,"areaConversion",(function(){return f}));var n=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,i=6378137,o=-90,a=90,s=-180,l=180,u=["lng","lon","longitude",0],h=["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 y=function(e,t){return t.reduce((function(t,r){if(null==e)throw new Error("'".concat(e,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(e,r)&&void 0!==r&&void 0===t?(t=r,r):t}),void 0)},g=function(e){var t=e.toString().trim();return!isNaN(parseFloat(t))&&parseFloat(t)===Number(t)},m=function(e){return n.test(e.toString().trim())},b=function(e){var t=new RegExp(n).exec(e);if(null==t)throw new Error("Given value is not in sexagesimal format");var r=Number(t[2])/60||0,i=Number(t[4])/3600||0,o=parseFloat(t[1])+r+i;return["S","W"].includes(t[7])?-o:o};function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){w(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:u,latitude:h,altitude:c},r=y(e,t.longitude),n=y(e,t.latitude),i=y(e,t.altitude);return v({latitude:n,longitude:r},i?{altitude:i}:{})},M=function e(t){return g(t)?!(parseFloat(t)>a||t<o):!!m(t)&&e(b(t))},T=function e(t){return g(t)?!(parseFloat(t)>l||t<s):!!m(t)&&e(b(t))},E=function(e){var t=S(e),r=t.latitude,n=t.longitude;if(Array.isArray(e)&&e.length>=2)return T(e[0])&&M(e[1]);if(void 0===r||void 0===n)return!1;var i=e[n],o=e[r];return void 0!==o&&void 0!==i&&!1!==M(o)&&!1!==T(i)};function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){F(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function F(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var k=function e(t){if(g(t))return Number(t);if(m(t))return b(t);if(E(t)){var r=S(t);return Array.isArray(t)?t.map((function(t,r){return[0,1].includes(r)?e(t):t})):A(A(A({},t),r.latitude&&F({},r.latitude,e(t[r.latitude]))),r.longitude&&F({},r.longitude,e(t[r.longitude])))}return Array.isArray(t)?t.map((function(t){return E(t)?e(t):t})):t},x=function(e,t){var r=y(e,h);if(null!=r){var n=e[r];return!0===t?n:k(n)}},O=function(e,t){var r=y(e,u);if(null!=r){var n=e[r];return!0===t?n:k(n)}},I=function(e){return e*Math.PI/180},N=function(e){return 180*e/Math.PI},P=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,i=x(e),o=O(e),a=t/n,u=I(r),h=I(i),c=I(o),d=Math.asin(Math.sin(h)*Math.cos(a)+Math.cos(h)*Math.sin(a)*Math.cos(u)),p=c+Math.atan2(Math.sin(u)*Math.sin(a)*Math.cos(h),Math.cos(a)-Math.sin(h)*Math.sin(d)),f=N(p);return(f<s||f>l)&&(p=(p+3*Math.PI)%(2*Math.PI)-Math.PI,f=N(p)),{latitude:N(d),longitude:f}},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=f[t];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",r=d[t];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")},B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(t){case"kmh":return e*p.h*d.km;case"mph":return e*p.h*d.mi;default:return e}};function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var L=function(e){var t=Math.pow(10,12);return Math.round(e*t)/t},W=function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.toString().split("."),2),r=t[0],n=t[1],i=Math.abs(Number(r)),o=L(60*Number("0."+(n||0))),a=Math.floor(o),s=L(60*(o%a||0));return i+"° "+Number(a.toFixed(6)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+"' "+Number(s.toFixed(4)).toString().split(".").map((function(e,t){return 0===t?e.padStart(2,"0"):e})).join(".")+'"'},q=function(e){return e>1?1:e<-1?-1:e},z=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;r=void 0===r||isNaN(r)?1:r;var n=x(e),o=O(e),a=x(t),s=O(t),l=Math.acos(q(Math.sin(I(a))*Math.sin(I(n))+Math.cos(I(a))*Math.cos(I(n))*Math.cos(I(o)-I(s))))*i;return Math.round(l/r)*r},$=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z;return r="function"==typeof r?r:z,t.slice().sort((function(t,n){return r(e,t)-r(e,n)}))},U=function(e,t){return $(e,t)[0]},H=function(e){var t=0;if(e.length>2){for(var r,n,o,a=0;a<e.length;a++){a===e.length-2?(r=e.length-2,n=e.length-1,o=0):a===e.length-1?(r=e.length-1,n=0,o=1):(r=a,n=a+1,o=a+2);var s=O(e[r]),l=x(e[n]),u=O(e[o]);t+=(I(u)-I(s))*Math.sin(I(l))}t=t*i*i/2}return Math.abs(t)},G=function(e){if(!1===Array.isArray(e)||0===e.length)throw new Error("No points were given.");return e.reduce((function(e,t){var r=x(t),n=O(t);return{maxLat:Math.max(r,e.maxLat),minLat:Math.min(r,e.minLat),maxLng:Math.max(n,e.maxLng),minLng:Math.min(n,e.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})},V=function(e,t){var r,n,u=x(e),h=O(e),c=I(u),d=I(h),p=t/i,f=c-p,y=c+p,g=I(a),m=I(o),b=I(l),_=I(s);if(f>m&&y<g){var v=Math.asin(Math.sin(p)/Math.cos(c));(r=d-v)<_&&(r+=2*Math.PI),(n=d+v)>b&&(n-=2*Math.PI)}else f=Math.max(f,m),y=Math.min(y,g),r=_,n=b;return[{latitude:N(f),longitude:N(r)},{latitude:N(y),longitude:N(n)}]},Q=function(e){if(!1===Array.isArray(e)||0===e.length)return!1;var t=e.length,r=e.reduce((function(e,t){var r=I(x(t)),n=I(O(t));return{X:e.X+Math.cos(r)*Math.cos(n),Y:e.Y+Math.cos(r)*Math.sin(n),Z:e.Z+Math.sin(r)}}),{X:0,Y:0,Z:0}),n=r.X/t,i=r.Y/t,o=r.Z/t;return{longitude:N(Math.atan2(i,n)),latitude:N(Math.atan2(o,Math.sqrt(n*n+i*i)))}},Y=function(e){var t=G(e),r=t.minLat+(t.maxLat-t.minLat)/2,n=t.minLng+(t.maxLng-t.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(n.toFixed(6))}},J=function(e,t){var r=I(O(t))-I(O(e)),n=Math.log(Math.tan(I(x(t))/2+Math.PI/4)/Math.tan(I(x(e))/2+Math.PI/4));return Math.abs(r)>Math.PI&&(r=r>0?-1*(2*Math.PI-r):2*Math.PI+r),(N(Math.atan2(r,n))+360)%360},X=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J,n="function"==typeof r?r(e,t):J(e,t);if(isNaN(n))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(n/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}},Z=function(e,t,r){var n=z(t,e),i=z(e,r),o=z(t,r),a=Math.acos(q((n*n+o*o-i*i)/(2*n*o))),s=Math.acos(q((i*i+o*o-n*n)/(2*i*o)));return a>Math.PI/2?n:s>Math.PI/2?i:Math.sin(a)*n},K=function(e,t){var r=x(t),n=O(t),i=x(e),o=O(e);return(N(Math.atan2(Math.sin(I(n)-I(o))*Math.cos(I(r)),Math.cos(I(i))*Math.sin(I(r))-Math.sin(I(i))*Math.cos(I(r))*Math.cos(I(n)-I(o))))+360)%360};function ee(e){return(ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;return e.reduce((function(e,r){return"object"===ee(e)&&null!==e.last&&(e.distance+=t(r,e.last)),e.last=r,e}),{last:null,distance:0}).distance},re=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;r=void 0===r||isNaN(r)?1:r;var n,o,a,s,l,u,h,c=x(e),d=O(e),p=x(t),f=O(t),y=6356752.314245,g=1/298.257223563,m=I(f-d),b=Math.atan((1-g)*Math.tan(I(parseFloat(c)))),_=Math.atan((1-g)*Math.tan(I(parseFloat(p)))),v=Math.sin(b),w=Math.cos(b),S=Math.sin(_),M=Math.cos(_),T=m,E=100;do{var R=Math.sin(T),A=Math.cos(T);if(0===(u=Math.sqrt(M*R*(M*R)+(w*S-v*M*A)*(w*S-v*M*A))))return 0;n=v*S+w*M*A,o=Math.atan2(u,n),l=n-2*v*S/(s=1-(a=w*M*R/u)*a),isNaN(l)&&(l=0);var F=g/16*s*(4+g*(4-3*s));h=T,T=m+(1-F)*g*a*(o+F*u*(l+F*n*(2*l*l-1)))}while(Math.abs(T-h)>1e-12&&--E>0);if(0===E)return NaN;var k=s*(i*i-y*y)/(y*y),N=1+k/16384*(4096+k*(k*(320-175*k)-768)),P=k/1024*(256+k*(k*(74-47*k)-128)),D=P*u*(l+P/4*(n*(2*l*l-1)-P/6*l*(4*u*u-3)*(4*l*l-3))),C=y*N*(o-D);return Math.round(C/r)*r},ne=function(e){return/^NNE|NE|NNW|N$/.test(e)?"N":/^ENE|E|ESE|SE$/.test(e)?"E":/^SSE|S|SSW|SW$/.test(e)?"S":/^WSW|W|WNW|NW$/.test(e)?"W":void 0},ie=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z,n=r(e,t),i=Number(t.time)-Number(e.time),o=n/i*1e3;return o},oe=function(e,t,r){return z(t,e)+z(e,r)===z(t,r)},ae=function(e,t){for(var r=!1,n=t.length,i=-1,o=n-1;++i<n;o=i)(O(t[i])<=O(e)&&O(e)<O(t[o])||O(t[o])<=O(e)&&O(e)<O(t[i]))&&x(e)<(x(t[o])-x(t[i]))*(O(e)-O(t[i]))/(O(t[o])-O(t[i]))+x(t[i])&&(r=!r);return r},se=function(e,t,r,n){return Z(e,t,r)<n},le=function(e,t,r){return z(e,t)<r};function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var he=function(e){if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ue(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ue(e,t)}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(" "),2),r=t[0],n=t[1];return{longitude:parseFloat(r),latitude:parseFloat(n)}}))}}])},"object"==typeof e&&"object"==typeof t?t.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof e?e.geolib=n():r.geolib=n()})),Zl=vt(((e,t)=>{j(),t.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))})),ru=vt(((e,t)=>{j();var r="%[a-f0-9]{2}",n=new RegExp(r,"gi"),i=new RegExp("("+r+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],o(r),o(n))}function a(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=i.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=a(r[0]);n!==r[0]&&(t[r[0]]=n)}r=i.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),s=0;s<o.length;s++){var l=o[s];e=e.replace(new RegExp(l,"g"),t[l])}return e}(e)}}})),ou=vt(((e,t)=>{j(),t.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}})),lu=vt(((e,t)=>{j(),t.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),o=0;o<n.length;o++){var a=n[o],s=e[a];(i?-1!==t.indexOf(a):t(a,s,e))&&(r[a]=s)}return r}})),gu=vt((e=>{j();var t=Zl(),r=ru(),n=ou(),i=lu(),o=Symbol("encodeFragmentIdentifier");function a(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(e,r){return r.encode?r.strict?t(e):encodeURIComponent(e):e}function l(e,t){return t.decode?r(e):e}function u(e){return Array.isArray(e)?e.sort():"object"==typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function h(e){let t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function c(e){let t=(e=h(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function p(e,t){a((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{let i="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!i&&l(r,e).includes(e.arrayFormatSeparator);r=o?l(r,e):r;let a=i||o?r.split(e.arrayFormatSeparator).map((t=>l(t,e))):null===r?r:l(r,e);n[t]=a};case"bracket-separator":return(t,r,n)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(n[t]=r&&l(r,e));let o=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>l(t,e)));void 0!==n[t]?n[t]=[].concat(n[t],o):n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return i;for(let o of e.split("&")){if(""===o)continue;let[e,a]=n(t.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:l(a,t),r(l(e,t),a,i)}for(let e of Object.keys(i)){let r=i[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=d(r[e],t);else i[e]=d(r,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{let r=i[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=u(r):e[t]=r,e}),Object.create(null))}e.extract=c,e.parse=p,e.stringify=(e,t)=>{if(!e)return"";a((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&(e=>null==e)(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[s(t,e),"[",i,"]"].join("")]:[...r,[s(t,e),"[",s(i,e),"]=",s(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[s(t,e),"[]"].join("")]:[...r,[s(t,e),"[]=",s(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[s(r,e),t,s(i,e)].join("")]:[[n,s(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,s(t,e)]:[...r,[s(t,e),"=",s(n,e)].join("")]}}(t),i={};for(let t of Object.keys(e))r(t)||(i[t]=e[t]);let o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((r=>{let i=e[r];return void 0===i?"":null===i?s(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?s(r,t)+"[]":i.reduce(n(r),[]).join("&"):s(r,t)+"="+s(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[r,i]=n(e,"#");return Object.assign({url:r.split("?")[0]||"",query:p(c(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:l(i,t)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0,[o]:!0},r);let n=h(t.url).split("?")[0]||"",i=e.extract(t.url),a=e.parse(i,{sort:!1}),l=Object.assign(a,t.query),u=e.stringify(l,r);u&&(u=`?${u}`);let c=function(e){let t="",r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(t.url);return t.fragmentIdentifier&&(c=`#${r[o]?s(t.fragmentIdentifier,r):t.fragmentIdentifier}`),`${n}${u}${c}`},e.pick=(t,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[o]:!1},n);let{url:a,query:s,fragmentIdentifier:l}=e.parseUrl(t,n);return e.stringifyUrl({url:a,query:i(s,r),fragmentIdentifier:l},n)},e.exclude=(t,r,n)=>{let i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return e.pick(t,i,n)}}));function Sh(e){if(!/^data:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');let t=(e=e.replace(/\r?\n/g,"")).indexOf(",");if(-1===t||t<=4)throw new TypeError("malformed data: URI");let r=e.substring(5,t).split(";"),n="",i=!1,o=r[0]||"text/plain",a=o;for(let e=1;e<r.length;e++)"base64"===r[e]?i=!0:(a+=`;${r[e]}`,0===r[e].indexOf("charset=")&&(n=r[e].substring(8)));!r[0]&&!n.length&&(a+=";charset=US-ASCII",n="US-ASCII");let s=i?"base64":"ascii",l=unescape(e.substring(t+1)),u=Buffer.from(l,s);return u.type=o,u.typeFull=a,u.charset=n,u}var _u,Su=Ve((()=>{j(),_u=Sh})),ju=vt(((e,t)=>{var r,n;j(),r=e,n=function(e){"use strict";let t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:e=>`Symbol(${e})`;function r(){}let n="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;function i(e){return"object"==typeof e&&null!==e||"function"==typeof e}let o=r,a=Promise,s=Promise.prototype.then,l=Promise.resolve.bind(a),u=Promise.reject.bind(a);function h(e){return new a(e)}function c(e){return l(e)}function d(e){return u(e)}function p(e,t,r){return s.call(e,t,r)}function f(e,t,r){p(p(e,t,r),void 0,o)}function y(e,t){f(e,t)}function g(e,t){f(e,void 0,t)}function m(e,t,r){return p(e,t,r)}function b(e){p(e,void 0,o)}let _=(()=>{let e=n&&n.queueMicrotask;if("function"==typeof e)return e;let t=c(void 0);return e=>p(t,e)})();function v(e,t,r){if("function"!=typeof e)throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function w(e,t,r){try{return c(v(e,t,r))}catch(e){return d(e)}}class S{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let t=this._back,r=t;16383===t._elements.length&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){let e=this._front,t=e,r=this._cursor,n=r+1,i=e._elements,o=i[r];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),i[r]=void 0,o}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&void 0===r._next||t===n.length&&(r=r._next,n=r._elements,t=0,0===n.length));)e(n[t]),++t}peek(){let e=this._front,t=this._cursor;return e._elements[t]}}function M(e,t){e._ownerReadableStream=t,t._reader=e,"readable"===t._state?A(e):"closed"===t._state?function(e){A(e),x(e)}(e):F(e,t._storedError)}function T(e,t){return Sr(e._ownerReadableStream,t)}function E(e){"readable"===e._ownerReadableStream._state?k(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){F(e,t)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function R(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function A(e){e._closedPromise=h(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r}))}function F(e,t){A(e),k(e,t)}function k(e,t){void 0!==e._closedPromise_reject&&(b(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function x(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}let O=t("[[AbortSteps]]"),I=t("[[ErrorSteps]]"),N=t("[[CancelSteps]]"),P=t("[[PullSteps]]"),D=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},C=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function B(e,t){if(void 0!==e&&!function(e){return"object"==typeof e||"function"==typeof e}(e))throw new TypeError(`${t} is not an object.`)}function j(e,t){if("function"!=typeof e)throw new TypeError(`${t} is not a function.`)}function L(e,t){if(!function(e){return"object"==typeof e&&null!==e||"function"==typeof e}(e))throw new TypeError(`${t} is not an object.`)}function W(e,t,r){if(void 0===e)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function q(e,t,r){if(void 0===e)throw new TypeError(`${t} is required in '${r}'.`)}function z(e){return Number(e)}function $(e){return 0===e?0:e}function U(e,t){let r=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=$(n),!D(n))throw new TypeError(`${t} is not a finite number`);if(n=function(e){return $(C(e))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return D(n)&&0!==n?n:0}function H(e,t){if(!vr(e))throw new TypeError(`${t} is not a ReadableStream.`)}function G(e){return new X(e)}function V(e,t){e._reader._readRequests.push(t)}function Q(e,t,r){let n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function Y(e){return e._reader._readRequests.length}function J(e){let t=e._reader;return!(void 0===t||!Z(t))}class X{constructor(e){if(W(e,1,"ReadableStreamDefaultReader"),H(e,"First parameter"),wr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");M(this,e),this._readRequests=new S}get closed(){return Z(this)?this._closedPromise:d(ee("closed"))}cancel(e){return Z(this)?void 0===this._ownerReadableStream?d(R("cancel")):T(this,e):d(ee("cancel"))}read(){if(!Z(this))return d(ee("read"));if(void 0===this._ownerReadableStream)return d(R("read from"));let e,t,r=h(((r,n)=>{e=r,t=n}));return K(this,{_chunkSteps:t=>e({value:t,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:e=>t(e)}),r}releaseLock(){if(!Z(this))throw ee("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");E(this)}}}function Z(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_readRequests"))&&e instanceof X}function K(e,t){let r=e._ownerReadableStream;r._disturbed=!0,"closed"===r._state?t._closeSteps():"errored"===r._state?t._errorSteps(r._storedError):r._readableStreamController[P](t)}function ee(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(X.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(X.prototype,t.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});let te=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class re{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){let e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?m(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let t=()=>this._returnSteps(e);return this._ongoingPromise?m(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let e=this._reader;if(void 0===e._ownerReadableStream)return d(R("iterate"));let t,r,n=h(((e,n)=>{t=e,r=n}));return K(e,{_chunkSteps:e=>{this._ongoingPromise=void 0,_((()=>t({value:e,done:!1})))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,E(e),t({value:void 0,done:!0})},_errorSteps:t=>{this._ongoingPromise=void 0,this._isFinished=!0,E(e),r(t)}}),n}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let t=this._reader;if(void 0===t._ownerReadableStream)return d(R("finish iterating"));if(!this._preventCancel){let r=T(t,e);return E(t),m(r,(()=>({value:e,done:!0})))}return E(t),c({value:e,done:!0})}}let ne={next(){return ie(this)?this._asyncIteratorImpl.next():d(oe("next"))},return(e){return ie(this)?this._asyncIteratorImpl.return(e):d(oe("return"))}};function ie(e){if(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof re}catch(e){return!1}}function oe(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}void 0!==te&&Object.setPrototypeOf(ne,te);let ae=Number.isNaN||function(e){return e!=e};function se(e){return e.slice()}function le(e,t,r,n,i){new Uint8Array(e).set(new Uint8Array(r,n,i),t)}function ue(e,t,r){if(e.slice)return e.slice(t,r);let n=r-t,i=new ArrayBuffer(n);return le(i,0,e,t,n),i}function he(e){let t=ue(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function ce(e){let t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function de(e,t,r){if(!function(e){return!("number"!=typeof e||ae(e)||e<0)}(r)||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function pe(e){e._queue=new S,e._queueTotalSize=0}class fe{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!me(this))throw Le("view");return this._view}respond(e){if(!me(this))throw Le("respond");if(W(e,1,"respond"),e=U(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,Ce(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!me(this))throw Le("respondWithNewView");if(W(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");e.buffer,Be(this._associatedReadableByteStreamController,e)}}Object.defineProperties(fe.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(fe.prototype,t.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class ye{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ge(this))throw We("byobRequest");return Pe(this)}get desiredSize(){if(!ge(this))throw We("desiredSize");return De(this)}close(){if(!ge(this))throw We("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);Oe(this)}enqueue(e){if(!ge(this))throw We("enqueue");if(W(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw new TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if("readable"!==t)throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);Ie(this,e)}error(e){if(!ge(this))throw We("error");Ne(this,e)}[N](e){_e(this),pe(this);let t=this._cancelAlgorithm(e);return xe(this),t}[P](e){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0){let t=this._queue.shift();this._queueTotalSize-=t.byteLength,Ee(this);let r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return void e._chunkSteps(r)}let r=this._autoAllocateChunkSize;if(void 0!==r){let t;try{t=new ArrayBuffer(r)}catch(t){return void e._errorSteps(t)}let n={buffer:t,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(n)}V(t,e),be(this)}}function ge(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream"))&&e instanceof ye}function me(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController"))&&e instanceof fe}function be(e){(function(e){let t=e._controlledReadableByteStream;return!("readable"!==t._state||e._closeRequested||!e._started||!(J(t)&&Y(t)>0||Ue(t)&&$e(t)>0||De(e)>0))})(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,f(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,be(e))}),(t=>{Ne(e,t)}))))}function _e(e){Re(e),e._pendingPullIntos=new S}function ve(e,t){let r=!1;"closed"===e._state&&(r=!0);let n=we(t);"default"===t.readerType?Q(e,n,r):function(e,t,r){let n=e._reader._readIntoRequests.shift();r?n._closeSteps(t):n._chunkSteps(t)}(e,n,r)}function we(e){let t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Se(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function Me(e,t){let r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,i=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),o=t.bytesFilled+i,a=o-o%r,s=i,l=!1;a>n&&(s=a-t.bytesFilled,l=!0);let u=e._queue;for(;s>0;){let r=u.peek(),n=Math.min(s,r.byteLength),i=t.byteOffset+t.bytesFilled;le(t.buffer,i,r.buffer,r.byteOffset,n),r.byteLength===n?u.shift():(r.byteOffset+=n,r.byteLength-=n),e._queueTotalSize-=n,Te(0,n,t),s-=n}return l}function Te(e,t,r){r.bytesFilled+=t}function Ee(e){0===e._queueTotalSize&&e._closeRequested?(xe(e),Mr(e._controlledReadableByteStream)):be(e)}function Re(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Ae(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;let t=e._pendingPullIntos.peek();Me(e,t)&&(ke(e),ve(e._controlledReadableByteStream,t))}}function Fe(e,t){let r=e._pendingPullIntos.peek();Re(e),"closed"===e._controlledReadableByteStream._state?function(e,t){let r=e._controlledReadableByteStream;if(Ue(r))for(;$e(r)>0;)ve(r,ke(e))}(e):function(e,t,r){if(Te(0,t,r),r.bytesFilled<r.elementSize)return;ke(e);let n=r.bytesFilled%r.elementSize;if(n>0){let t=r.byteOffset+r.bytesFilled,i=ue(r.buffer,t-n,t);Se(e,i,0,i.byteLength)}r.bytesFilled-=n,ve(e._controlledReadableByteStream,r),Ae(e)}(e,t,r),be(e)}function ke(e){return e._pendingPullIntos.shift()}function xe(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function Oe(e){let t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state){if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){let t=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ne(e,t),t}xe(e),Mr(t)}}function Ie(e,t){let r=e._controlledReadableByteStream;if(e._closeRequested||"readable"!==r._state)return;let n=t.buffer,i=t.byteOffset,o=t.byteLength,a=n;if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();t.buffer,t.buffer=t.buffer}Re(e),J(r)?0===Y(r)?Se(e,a,i,o):(e._pendingPullIntos.length>0&&ke(e),Q(r,new Uint8Array(a,i,o),!1)):Ue(r)?(Se(e,a,i,o),Ae(e)):Se(e,a,i,o),be(e)}function Ne(e,t){let r=e._controlledReadableByteStream;"readable"===r._state&&(_e(e),pe(e),xe(e),Tr(r,t))}function Pe(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=Object.create(fe.prototype);(function(e,t,r){e._associatedReadableByteStreamController=t,e._view=r})(n,e,r),e._byobRequest=n}return e._byobRequest}function De(e){let t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function Ce(e,t){let r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===t)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(r.bytesFilled+t>r.byteLength)throw new RangeError("bytesWritten out of range")}r.buffer=r.buffer,Fe(e,t)}function Be(e,t){let r=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t.byteLength)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===t.byteLength)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(r.byteOffset+r.bytesFilled!==t.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(r.bufferByteLength!==t.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(r.bytesFilled+t.byteLength>r.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let n=t.byteLength;r.buffer=t.buffer,Fe(e,n)}function je(e,t,r,n,i,o,a){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,pe(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=o,t._pullAlgorithm=n,t._cancelAlgorithm=i,t._autoAllocateChunkSize=a,t._pendingPullIntos=new S,e._readableStreamController=t,f(c(r()),(()=>{t._started=!0,be(t)}),(e=>{Ne(t,e)}))}function Le(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function We(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function qe(e){return new He(e)}function ze(e,t){e._reader._readIntoRequests.push(t)}function $e(e){return e._reader._readIntoRequests.length}function Ue(e){let t=e._reader;return!(void 0===t||!Ge(t))}Object.defineProperties(ye.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ye.prototype,t.toStringTag,{value:"ReadableByteStreamController",configurable:!0});class He{constructor(e){if(W(e,1,"ReadableStreamBYOBReader"),H(e,"First parameter"),wr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ge(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");M(this,e),this._readIntoRequests=new S}get closed(){return Ge(this)?this._closedPromise:d(Qe("closed"))}cancel(e){return Ge(this)?void 0===this._ownerReadableStream?d(R("cancel")):T(this,e):d(Qe("cancel"))}read(e){if(!Ge(this))return d(Qe("read"));if(!ArrayBuffer.isView(e))return d(new TypeError("view must be an array buffer view"));if(0===e.byteLength)return d(new TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return d(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,void 0===this._ownerReadableStream)return d(R("read from"));let t,r,n=h(((e,n)=>{t=e,r=n}));return Ve(this,e,{_chunkSteps:e=>t({value:e,done:!1}),_closeSteps:e=>t({value:e,done:!0}),_errorSteps:e=>r(e)}),n}releaseLock(){if(!Ge(this))throw Qe("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");E(this)}}}function Ge(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests"))&&e instanceof He}function Ve(e,t,r){let n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?r._errorSteps(n._storedError):function(e,t,r){let n=e._controlledReadableByteStream,i=1;t.constructor!==DataView&&(i=t.constructor.BYTES_PER_ELEMENT);let o=t.constructor,a=t.buffer,s={buffer:a,bufferByteLength:a.byteLength,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:i,viewConstructor:o,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(s),void ze(n,r);if("closed"!==n._state){if(e._queueTotalSize>0){if(Me(e,s)){let t=we(s);return Ee(e),void r._chunkSteps(t)}if(e._closeRequested){let t=new TypeError("Insufficient bytes to fill elements in the given buffer");return Ne(e,t),void r._errorSteps(t)}}e._pendingPullIntos.push(s),ze(n,r),be(e)}else{let e=new o(s.buffer,s.byteOffset,0);r._closeSteps(e)}}(n._readableStreamController,t,r)}function Qe(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Ye(e,t){let{highWaterMark:r}=e;if(void 0===r)return t;if(ae(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function Je(e){let{size:t}=e;return t||(()=>1)}function Xe(e,t){B(e,t);let r=null==e?void 0:e.highWaterMark,n=null==e?void 0:e.size;return{highWaterMark:void 0===r?void 0:z(r),size:void 0===n?void 0:Ze(n,`${t} has member 'size' that`)}}function Ze(e,t){return j(e,t),t=>z(e(t))}function Ke(e,t,r){return j(e,r),r=>w(e,t,[r])}function et(e,t,r){return j(e,r),()=>w(e,t,[])}function tt(e,t,r){return j(e,r),r=>v(e,t,[r])}function rt(e,t,r){return j(e,r),(r,n)=>w(e,t,[r,n])}function nt(e,t){if(!lt(e))throw new TypeError(`${t} is not a WritableStream.`)}Object.defineProperties(He.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(He.prototype,t.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});let it="function"==typeof AbortController;class ot{constructor(e={},t={}){void 0===e?e=null:L(e,"First parameter");let r=Xe(t,"Second parameter"),n=function(e,t){B(e,t);let r=null==e?void 0:e.abort,n=null==e?void 0:e.close,i=null==e?void 0:e.start,o=null==e?void 0:e.type,a=null==e?void 0:e.write;return{abort:void 0===r?void 0:Ke(r,e,`${t} has member 'abort' that`),close:void 0===n?void 0:et(n,e,`${t} has member 'close' that`),start:void 0===i?void 0:tt(i,e,`${t} has member 'start' that`),write:void 0===a?void 0:rt(a,e,`${t} has member 'write' that`),type:o}}(e,"First parameter");if(st(this),void 0!==n.type)throw new RangeError("Invalid type is specified");let i=Je(r);!function(e,t,r,n){let i=Object.create(Rt.prototype),o=()=>{},a=()=>c(void 0),s=()=>c(void 0),l=()=>c(void 0);void 0!==t.start&&(o=()=>t.start(i)),void 0!==t.write&&(a=e=>t.write(e,i)),void 0!==t.close&&(s=()=>t.close()),void 0!==t.abort&&(l=e=>t.abort(e)),Ft(e,i,o,a,s,l,r,n)}(this,n,Ye(r,1),i)}get locked(){if(!lt(this))throw Dt("locked");return ut(this)}abort(e){return lt(this)?ut(this)?d(new TypeError("Cannot abort a stream that already has a writer")):ht(this,e):d(Dt("abort"))}close(){return lt(this)?ut(this)?d(new TypeError("Cannot close a stream that already has a writer")):yt(this)?d(new TypeError("Cannot close an already-closing stream")):ct(this):d(Dt("close"))}getWriter(){if(!lt(this))throw Dt("getWriter");return at(this)}}function at(e){return new bt(e)}function st(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new S,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function lt(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_writableStreamController"))&&e instanceof ot}function ut(e){return void 0!==e._writer}function ht(e,t){var r;if("closed"===e._state||"errored"===e._state)return c(void 0);e._writableStreamController._abortReason=t,null===(r=e._writableStreamController._abortController)||void 0===r||r.abort();let n=e._state;if("closed"===n||"errored"===n)return c(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;let i=!1;"erroring"===n&&(i=!0,t=void 0);let o=h(((r,n)=>{e._pendingAbortRequest={_promise:void 0,_resolve:r,_reject:n,_reason:t,_wasAlreadyErroring:i}}));return e._pendingAbortRequest._promise=o,i||pt(e,t),o}function ct(e){let t=e._state;if("closed"===t||"errored"===t)return d(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));let r=h(((t,r)=>{let n={_resolve:t,_reject:r};e._closeRequest=n})),n=e._writer;return void 0!==n&&e._backpressure&&"writable"===t&&Vt(n),function(e){de(e,Et,0),Ot(e)}(e._writableStreamController),r}function dt(e,t){"writable"!==e._state?ft(e):pt(e,t)}function pt(e,t){let r=e._writableStreamController;e._state="erroring",e._storedError=t;let n=e._writer;void 0!==n&&St(n,t),!function(e){return!(void 0===e._inFlightWriteRequest&&void 0===e._inFlightCloseRequest)}(e)&&r._started&&ft(e)}function ft(e){e._state="errored",e._writableStreamController[I]();let t=e._storedError;if(e._writeRequests.forEach((e=>{e._reject(t)})),e._writeRequests=new S,void 0===e._pendingAbortRequest)return void gt(e);let r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void gt(e);f(e._writableStreamController[O](r._reason),(()=>{r._resolve(),gt(e)}),(t=>{r._reject(t),gt(e)}))}function yt(e){return!(void 0===e._closeRequest&&void 0===e._inFlightCloseRequest)}function gt(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let t=e._writer;void 0!==t&&qt(t,e._storedError)}function mt(e,t){let r=e._writer;void 0!==r&&t!==e._backpressure&&(t?function(e){$t(e)}(r):Vt(r)),e._backpressure=t}Object.defineProperties(ot.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(ot.prototype,t.toStringTag,{value:"WritableStream",configurable:!0});class bt{constructor(e){if(W(e,1,"WritableStreamDefaultWriter"),nt(e,"First parameter"),ut(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;let t=e._state;if("writable"===t)!yt(e)&&e._backpressure?$t(this):Ht(this),Lt(this);else if("erroring"===t)Ut(this,e._storedError),Lt(this);else if("closed"===t)Ht(this),Lt(r=this),zt(r);else{let t=e._storedError;Ut(this,t),Wt(this,t)}var r}get closed(){return _t(this)?this._closedPromise:d(Bt("closed"))}get desiredSize(){if(!_t(this))throw Bt("desiredSize");if(void 0===this._ownerWritableStream)throw jt("desiredSize");return function(e){let t=e._ownerWritableStream,r=t._state;return"errored"===r||"erroring"===r?null:"closed"===r?0:xt(t._writableStreamController)}(this)}get ready(){return _t(this)?this._readyPromise:d(Bt("ready"))}abort(e){return _t(this)?void 0===this._ownerWritableStream?d(jt("abort")):function(e,t){return ht(e._ownerWritableStream,t)}(this,e):d(Bt("abort"))}close(){if(!_t(this))return d(Bt("close"));let e=this._ownerWritableStream;return void 0===e?d(jt("close")):yt(e)?d(new TypeError("Cannot close an already-closing stream")):vt(this)}releaseLock(){if(!_t(this))throw Bt("releaseLock");void 0!==this._ownerWritableStream&&Mt(this)}write(e){return _t(this)?void 0===this._ownerWritableStream?d(jt("write to")):Tt(this,e):d(Bt("write"))}}function _t(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream"))&&e instanceof bt}function vt(e){return ct(e._ownerWritableStream)}function wt(e,t){"pending"===e._closedPromiseState?qt(e,t):function(e,t){Wt(e,t)}(e,t)}function St(e,t){"pending"===e._readyPromiseState?Gt(e,t):function(e,t){Ut(e,t)}(e,t)}function Mt(e){let t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");St(e,r),wt(e,r),t._writer=void 0,e._ownerWritableStream=void 0}function Tt(e,t){let r=e._ownerWritableStream,n=r._writableStreamController,i=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return It(e,t),1}}(n,t);if(r!==e._ownerWritableStream)return d(jt("write to"));let o=r._state;if("errored"===o)return d(r._storedError);if(yt(r)||"closed"===o)return d(new TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===o)return d(r._storedError);let a=function(e){return h(((t,r)=>{let n={_resolve:t,_reject:r};e._writeRequests.push(n)}))}(r);return function(e,t,r){try{de(e,t,r)}catch(t){return void It(e,t)}let n=e._controlledWritableStream;yt(n)||"writable"!==n._state||mt(n,Nt(e)),Ot(e)}(n,t,i),a}Object.defineProperties(bt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(bt.prototype,t.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});let Et={};class Rt{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!At(this))throw Ct("abortReason");return this._abortReason}get signal(){if(!At(this))throw Ct("signal");if(void 0===this._abortController)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!At(this))throw Ct("error");"writable"===this._controlledWritableStream._state&&Pt(this,e)}[O](e){let t=this._abortAlgorithm(e);return kt(this),t}[I](){pe(this)}}function At(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream"))&&e instanceof Rt}function Ft(e,t,r,n,i,o,a,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,pe(t),t._abortReason=void 0,t._abortController=function(){if(it)return new AbortController}(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=a,t._writeAlgorithm=n,t._closeAlgorithm=i,t._abortAlgorithm=o;let l=Nt(t);mt(e,l),f(c(r()),(()=>{t._started=!0,Ot(t)}),(r=>{t._started=!0,dt(e,r)}))}function kt(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function xt(e){return e._strategyHWM-e._queueTotalSize}function Ot(e){let t=e._controlledWritableStream;if(!e._started||void 0!==t._inFlightWriteRequest)return;if("erroring"===t._state)return void ft(t);if(0===e._queue.length)return;let r=function(e){return e._queue.peek().value}(e);r===Et?function(e){let t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),ce(e);let r=e._closeAlgorithm();kt(e),f(r,(()=>{!function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,"erroring"===e._state&&(e._storedError=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state="closed";let t=e._writer;void 0!==t&&zt(t)}(t)}),(e=>{!function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,void 0!==e._pendingAbortRequest&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),dt(e,t)}(t,e)}))}(e):function(e,t){let r=e._controlledWritableStream;(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(r),f(e._writeAlgorithm(t),(()=>{!function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0}(r);let t=r._state;if(ce(e),!yt(r)&&"writable"===t){let t=Nt(e);mt(r,t)}Ot(e)}),(t=>{"writable"===r._state&&kt(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,dt(e,t)}(r,t)}))}(e,r)}function It(e,t){"writable"===e._controlledWritableStream._state&&Pt(e,t)}function Nt(e){return xt(e)<=0}function Pt(e,t){let r=e._controlledWritableStream;kt(e),pt(r,t)}function Dt(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Ct(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function Bt(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function jt(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Lt(e){e._closedPromise=h(((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"}))}function Wt(e,t){Lt(e),qt(e,t)}function qt(e,t){void 0!==e._closedPromise_reject&&(b(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function zt(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function $t(e){e._readyPromise=h(((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r})),e._readyPromiseState="pending"}function Ut(e,t){$t(e),Gt(e,t)}function Ht(e){$t(e),Vt(e)}function Gt(e,t){void 0!==e._readyPromise_reject&&(b(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function Vt(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Rt.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Rt.prototype,t.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});let Qt="undefined"!=typeof DOMException?DOMException:void 0,Yt=function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(Qt)?Qt:function(){let e=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Jt(e,t,n,i,o,a){let s=G(e),l=at(t);e._disturbed=!0;let u=!1,m=c(void 0);return h(((_,v)=>{let w;if(void 0!==a){if(w=()=>{let r=new Yt("Aborted","AbortError"),n=[];i||n.push((()=>"writable"===t._state?ht(t,r):c(void 0))),o||n.push((()=>"readable"===e._state?Sr(e,r):c(void 0))),F((()=>Promise.all(n.map((e=>e())))),!0,r)},a.aborted)return void w();a.addEventListener("abort",w)}if(A(e,s._closedPromise,(e=>{i?k(!0,e):F((()=>ht(t,e)),!0,e)})),A(t,l._closedPromise,(t=>{o?k(!0,t):F((()=>Sr(e,t)),!0,t)})),S=e,M=s._closedPromise,T=()=>{n?k():F((()=>function(e){let t=e._ownerWritableStream,r=t._state;return yt(t)||"closed"===r?c(void 0):"errored"===r?d(t._storedError):vt(e)}(l)))},"closed"===S._state?T():y(M,T),yt(t)||"closed"===t._state){let t=new TypeError("the destination writable stream closed before all data could be piped to it");o?k(!0,t):F((()=>Sr(e,t)),!0,t)}var S,M,T;function R(){let e=m;return p(m,(()=>e!==m?R():void 0))}function A(e,t,r){"errored"===e._state?r(e._storedError):g(t,r)}function F(e,r,n){function i(){f(e(),(()=>x(r,n)),(e=>x(!0,e)))}u||(u=!0,"writable"!==t._state||yt(t)?i():y(R(),i))}function k(e,r){u||(u=!0,"writable"!==t._state||yt(t)?x(e,r):y(R(),(()=>x(e,r))))}function x(e,t){Mt(l),E(s),void 0!==a&&a.removeEventListener("abort",w),e?v(t):_(void 0)}b(h(((e,t)=>{!function n(i){i?e():p(u?c(!0):p(l._readyPromise,(()=>h(((e,t)=>{K(s,{_chunkSteps:t=>{m=p(Tt(l,t),void 0,r),e(!1)},_closeSteps:()=>e(!0),_errorSteps:t})})))),n,t)}(!1)})))}))}class Xt{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Zt(this))throw lr("desiredSize");return or(this)}close(){if(!Zt(this))throw lr("close");if(!ar(this))throw new TypeError("The stream is not in a state that permits close");rr(this)}enqueue(e){if(!Zt(this))throw lr("enqueue");if(!ar(this))throw new TypeError("The stream is not in a state that permits enqueue");return nr(this,e)}error(e){if(!Zt(this))throw lr("error");ir(this,e)}[N](e){pe(this);let t=this._cancelAlgorithm(e);return tr(this),t}[P](e){let t=this._controlledReadableStream;if(this._queue.length>0){let r=ce(this);this._closeRequested&&0===this._queue.length?(tr(this),Mr(t)):Kt(this),e._chunkSteps(r)}else V(t,e),Kt(this)}}function Zt(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream"))&&e instanceof Xt}function Kt(e){er(e)&&(e._pulling?e._pullAgain=!0:(e._pulling=!0,f(e._pullAlgorithm(),(()=>{e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Kt(e))}),(t=>{ir(e,t)}))))}function er(e){let t=e._controlledReadableStream;return!(!ar(e)||!e._started||!(wr(t)&&Y(t)>0||or(e)>0))}function tr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function rr(e){if(!ar(e))return;let t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(tr(e),Mr(t))}function nr(e,t){if(!ar(e))return;let r=e._controlledReadableStream;if(wr(r)&&Y(r)>0)Q(r,t,!1);else{let r;try{r=e._strategySizeAlgorithm(t)}catch(t){throw ir(e,t),t}try{de(e,t,r)}catch(t){throw ir(e,t),t}}Kt(e)}function ir(e,t){let r=e._controlledReadableStream;"readable"===r._state&&(pe(e),tr(e),Tr(r,t))}function or(e){let t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function ar(e){let t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function sr(e,t,r,n,i,o,a){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,pe(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=a,t._strategyHWM=o,t._pullAlgorithm=n,t._cancelAlgorithm=i,e._readableStreamController=t,f(c(r()),(()=>{t._started=!0,Kt(t)}),(e=>{ir(t,e)}))}function lr(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function ur(e,t){return ge(e._readableStreamController)?function(e){let t,r,n,i,o,a=G(e),s=!1,l=!1,u=!1,d=!1,p=!1,f=h((e=>{o=e}));function y(e){g(e._closedPromise,(t=>{e===a&&(Ne(n._readableStreamController,t),Ne(i._readableStreamController,t),(!d||!p)&&o(void 0))}))}function m(){Ge(a)&&(E(a),a=G(e),y(a)),K(a,{_chunkSteps:t=>{_((()=>{l=!1,u=!1;let r=t,a=t;if(!d&&!p)try{a=he(t)}catch(t){return Ne(n._readableStreamController,t),Ne(i._readableStreamController,t),void o(Sr(e,t))}d||Ie(n._readableStreamController,r),p||Ie(i._readableStreamController,a),s=!1,l?v():u&&w()}))},_closeSteps:()=>{s=!1,d||Oe(n._readableStreamController),p||Oe(i._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&Ce(n._readableStreamController,0),i._readableStreamController._pendingPullIntos.length>0&&Ce(i._readableStreamController,0),(!d||!p)&&o(void 0)},_errorSteps:()=>{s=!1}})}function b(t,r){Z(a)&&(E(a),a=qe(e),y(a));let h=r?i:n,c=r?n:i;Ve(a,t,{_chunkSteps:t=>{_((()=>{l=!1,u=!1;let n=r?p:d;if(r?d:p)n||Be(h._readableStreamController,t);else{let r;try{r=he(t)}catch(t){return Ne(h._readableStreamController,t),Ne(c._readableStreamController,t),void o(Sr(e,t))}n||Be(h._readableStreamController,t),Ie(c._readableStreamController,r)}s=!1,l?v():u&&w()}))},_closeSteps:e=>{s=!1;let t=r?p:d,n=r?d:p;t||Oe(h._readableStreamController),n||Oe(c._readableStreamController),void 0!==e&&(t||Be(h._readableStreamController,e),!n&&c._readableStreamController._pendingPullIntos.length>0&&Ce(c._readableStreamController,0)),(!t||!n)&&o(void 0)},_errorSteps:()=>{s=!1}})}function v(){if(s)return l=!0,c(void 0);s=!0;let e=Pe(n._readableStreamController);return null===e?m():b(e._view,!1),c(void 0)}function w(){if(s)return u=!0,c(void 0);s=!0;let e=Pe(i._readableStreamController);return null===e?m():b(e._view,!0),c(void 0)}function S(n){if(d=!0,t=n,p){let n=se([t,r]),i=Sr(e,n);o(i)}return f}function M(n){if(p=!0,r=n,d){let n=se([t,r]),i=Sr(e,n);o(i)}return f}function T(){}return n=br(T,v,S),i=br(T,w,M),y(a),[n,i]}(e):function(e,t){let r,n,i,o,a,s=G(e),l=!1,u=!1,d=!1,p=!1,f=h((e=>{a=e}));function y(){return l?(u=!0,c(void 0)):(l=!0,K(s,{_chunkSteps:e=>{_((()=>{u=!1;let t=e,r=e;d||nr(i._readableStreamController,t),p||nr(o._readableStreamController,r),l=!1,u&&y()}))},_closeSteps:()=>{l=!1,d||rr(i._readableStreamController),p||rr(o._readableStreamController),(!d||!p)&&a(void 0)},_errorSteps:()=>{l=!1}}),c(void 0))}function m(t){if(d=!0,r=t,p){let t=se([r,n]),i=Sr(e,t);a(i)}return f}function b(t){if(p=!0,n=t,d){let t=se([r,n]),i=Sr(e,t);a(i)}return f}function v(){}return i=mr(v,y,m),o=mr(v,y,b),g(s._closedPromise,(e=>{ir(i._readableStreamController,e),ir(o._readableStreamController,e),(!d||!p)&&a(void 0)})),[i,o]}(e)}function hr(e,t,r){return j(e,r),r=>w(e,t,[r])}function cr(e,t,r){return j(e,r),r=>w(e,t,[r])}function dr(e,t,r){return j(e,r),r=>v(e,t,[r])}function pr(e,t){if("bytes"!=(e=`${e}`))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function fr(e,t){if("byob"!=(e=`${e}`))throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function yr(e,t){B(e,t);let r=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,i=null==e?void 0:e.preventClose,o=null==e?void 0:e.signal;return void 0!==o&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw new TypeError(`${t} is not an AbortSignal.`)}(o,`${t} has member 'signal' that`),{preventAbort:Boolean(r),preventCancel:Boolean(n),preventClose:Boolean(i),signal:o}}Object.defineProperties(Xt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Xt.prototype,t.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});class gr{constructor(e={},t={}){void 0===e?e=null:L(e,"First parameter");let r=Xe(t,"Second parameter"),n=function(e,t){B(e,t);let r=e,n=null==r?void 0:r.autoAllocateChunkSize,i=null==r?void 0:r.cancel,o=null==r?void 0:r.pull,a=null==r?void 0:r.start,s=null==r?void 0:r.type;return{autoAllocateChunkSize:void 0===n?void 0:U(n,`${t} has member 'autoAllocateChunkSize' that`),cancel:void 0===i?void 0:hr(i,r,`${t} has member 'cancel' that`),pull:void 0===o?void 0:cr(o,r,`${t} has member 'pull' that`),start:void 0===a?void 0:dr(a,r,`${t} has member 'start' that`),type:void 0===s?void 0:pr(s,`${t} has member 'type' that`)}}(e,"First parameter");if(_r(this),"bytes"===n.type){if(void 0!==r.size)throw new RangeError("The strategy for a byte stream cannot have a size function");!function(e,t,r){let n=Object.create(ye.prototype),i=()=>{},o=()=>c(void 0),a=()=>c(void 0);void 0!==t.start&&(i=()=>t.start(n)),void 0!==t.pull&&(o=()=>t.pull(n)),void 0!==t.cancel&&(a=e=>t.cancel(e));let s=t.autoAllocateChunkSize;if(0===s)throw new TypeError("autoAllocateChunkSize must be greater than 0");je(e,n,i,o,a,r,s)}(this,n,Ye(r,0))}else{let e=Je(r);!function(e,t,r,n){let i=Object.create(Xt.prototype),o=()=>{},a=()=>c(void 0),s=()=>c(void 0);void 0!==t.start&&(o=()=>t.start(i)),void 0!==t.pull&&(a=()=>t.pull(i)),void 0!==t.cancel&&(s=e=>t.cancel(e)),sr(e,i,o,a,s,r,n)}(this,n,Ye(r,1),e)}}get locked(){if(!vr(this))throw Er("locked");return wr(this)}cancel(e){return vr(this)?wr(this)?d(new TypeError("Cannot cancel a stream that already has a reader")):Sr(this,e):d(Er("cancel"))}getReader(e){if(!vr(this))throw Er("getReader");return void 0===function(e,t){B(e,t);let r=null==e?void 0:e.mode;return{mode:void 0===r?void 0:fr(r,`${t} has member 'mode' that`)}}(e,"First parameter").mode?G(this):qe(this)}pipeThrough(e,t={}){if(!vr(this))throw Er("pipeThrough");W(e,1,"pipeThrough");let r=function(e,t){B(e,t);let r=null==e?void 0:e.readable;q(r,"readable","ReadableWritablePair"),H(r,`${t} has member 'readable' that`);let n=null==e?void 0:e.writable;return q(n,"writable","ReadableWritablePair"),nt(n,`${t} has member 'writable' that`),{readable:r,writable:n}}(e,"First parameter"),n=yr(t,"Second parameter");if(wr(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(ut(r.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return b(Jt(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!vr(this))return d(Er("pipeTo"));if(void 0===e)return d("Parameter 1 is required in 'pipeTo'.");if(!lt(e))return d(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=yr(t,"Second parameter")}catch(e){return d(e)}return wr(this)?d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):ut(e)?d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Jt(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!vr(this))throw Er("tee");return se(ur(this))}values(e){if(!vr(this))throw Er("values");let t=function(e,t){B(e,t);let r=null==e?void 0:e.preventCancel;return{preventCancel:Boolean(r)}}(e,"First parameter");return function(e,t){let r=G(e),n=new re(r,t),i=Object.create(ne);return i._asyncIteratorImpl=n,i}(this,t.preventCancel)}}function mr(e,t,r,n=1,i=(()=>1)){let o=Object.create(gr.prototype);return _r(o),sr(o,Object.create(Xt.prototype),e,t,r,n,i),o}function br(e,t,r){let n=Object.create(gr.prototype);return _r(n),je(n,Object.create(ye.prototype),e,t,r,0,void 0),n}function _r(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function vr(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_readableStreamController"))&&e instanceof gr}function wr(e){return void 0!==e._reader}function Sr(e,t){if(e._disturbed=!0,"closed"===e._state)return c(void 0);if("errored"===e._state)return d(e._storedError);Mr(e);let n=e._reader;return void 0!==n&&Ge(n)&&(n._readIntoRequests.forEach((e=>{e._closeSteps(void 0)})),n._readIntoRequests=new S),m(e._readableStreamController[N](t),r)}function Mr(e){e._state="closed";let t=e._reader;void 0!==t&&(x(t),Z(t)&&(t._readRequests.forEach((e=>{e._closeSteps()})),t._readRequests=new S))}function Tr(e,t){e._state="errored",e._storedError=t;let r=e._reader;void 0!==r&&(k(r,t),Z(r)?(r._readRequests.forEach((e=>{e._errorSteps(t)})),r._readRequests=new S):(r._readIntoRequests.forEach((e=>{e._errorSteps(t)})),r._readIntoRequests=new S))}function Er(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Rr(e,t){B(e,t);let r=null==e?void 0:e.highWaterMark;return q(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:z(r)}}Object.defineProperties(gr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(gr.prototype,t.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof t.asyncIterator&&Object.defineProperty(gr.prototype,t.asyncIterator,{value:gr.prototype.values,writable:!0,configurable:!0});let Ar=e=>e.byteLength;try{Object.defineProperty(Ar,"name",{value:"size",configurable:!0})}catch(e){}class Fr{constructor(e){W(e,1,"ByteLengthQueuingStrategy"),e=Rr(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!xr(this))throw kr("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!xr(this))throw kr("size");return Ar}}function kr(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function xr(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark"))&&e instanceof Fr}Object.defineProperties(Fr.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Fr.prototype,t.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});let Or=()=>1;try{Object.defineProperty(Or,"name",{value:"size",configurable:!0})}catch(e){}class Ir{constructor(e){W(e,1,"CountQueuingStrategy"),e=Rr(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Pr(this))throw Nr("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Pr(this))throw Nr("size");return Or}}function Nr(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Pr(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark"))&&e instanceof Ir}function Dr(e,t,r){return j(e,r),r=>w(e,t,[r])}function Cr(e,t,r){return j(e,r),r=>v(e,t,[r])}function Br(e,t,r){return j(e,r),(r,n)=>w(e,t,[r,n])}Object.defineProperties(Ir.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(Ir.prototype,t.toStringTag,{value:"CountQueuingStrategy",configurable:!0});class jr{constructor(e={},t={},r={}){void 0===e&&(e=null);let n=Xe(t,"Second parameter"),i=Xe(r,"Third parameter"),o=function(e,t){B(e,t);let r=null==e?void 0:e.flush,n=null==e?void 0:e.readableType,i=null==e?void 0:e.start,o=null==e?void 0:e.transform,a=null==e?void 0:e.writableType;return{flush:void 0===r?void 0:Dr(r,e,`${t} has member 'flush' that`),readableType:n,start:void 0===i?void 0:Cr(i,e,`${t} has member 'start' that`),transform:void 0===o?void 0:Br(o,e,`${t} has member 'transform' that`),writableType:a}}(e,"First parameter");if(void 0!==o.readableType)throw new RangeError("Invalid readableType specified");if(void 0!==o.writableType)throw new RangeError("Invalid writableType specified");let a,s=Ye(i,0),l=Je(i),u=Ye(n,1),p=Je(n);(function(e,t,r,n,i,o){function a(){return t}function s(t){return function(e,t){let r=e._transformStreamController;return e._backpressure?m(e._backpressureChangePromise,(()=>{let n=e._writable;if("erroring"===n._state)throw n._storedError;return Vr(r,t)})):Vr(r,t)}(e,t)}function l(t){return function(e,t){return Wr(e,t),c(void 0)}(e,t)}function u(){return function(e){let t=e._readable,r=e._transformStreamController,n=r._flushAlgorithm();return Hr(r),m(n,(()=>{if("errored"===t._state)throw t._storedError;rr(t._readableStreamController)}),(r=>{throw Wr(e,r),t._storedError}))}(e)}function h(){return function(e){return zr(e,!1),e._backpressureChangePromise}(e)}function d(t){return qr(e,t),c(void 0)}e._writable=function(e,t,r,n,i=1,o=(()=>1)){let a=Object.create(ot.prototype);return st(a),Ft(a,Object.create(Rt.prototype),e,t,r,n,i,o),a}(a,s,u,l,r,n),e._readable=mr(a,h,d,i,o),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,zr(e,!0),e._transformStreamController=void 0})(this,h((e=>{a=e})),u,p,s,l),function(e,t){let r=Object.create($r.prototype),n=e=>{try{return Gr(r,e),c(void 0)}catch(e){return d(e)}},i=()=>c(void 0);void 0!==t.transform&&(n=e=>t.transform(e,r)),void 0!==t.flush&&(i=()=>t.flush(r)),function(e,t,r,n){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=r,t._flushAlgorithm=n}(e,r,n,i)}(this,o),void 0!==o.start?a(o.start(this._transformStreamController)):a(void 0)}get readable(){if(!Lr(this))throw Yr("readable");return this._readable}get writable(){if(!Lr(this))throw Yr("writable");return this._writable}}function Lr(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_transformStreamController"))&&e instanceof jr}function Wr(e,t){ir(e._readable._readableStreamController,t),qr(e,t)}function qr(e,t){Hr(e._transformStreamController),It(e._writable._writableStreamController,t),e._backpressure&&zr(e,!1)}function zr(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=h((t=>{e._backpressureChangePromise_resolve=t})),e._backpressure=t}Object.defineProperties(jr.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty(jr.prototype,t.toStringTag,{value:"TransformStream",configurable:!0});class $r{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ur(this))throw Qr("desiredSize");return or(this._controlledTransformStream._readable._readableStreamController)}enqueue(e){if(!Ur(this))throw Qr("enqueue");Gr(this,e)}error(e){if(!Ur(this))throw Qr("error");!function(e,t){Wr(e._controlledTransformStream,t)}(this,e)}terminate(){if(!Ur(this))throw Qr("terminate");!function(e){let t=e._controlledTransformStream;rr(t._readable._readableStreamController);let r=new TypeError("TransformStream terminated");qr(t,r)}(this)}}function Ur(e){return!(!i(e)||!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream"))&&e instanceof $r}function Hr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Gr(e,t){let r=e._controlledTransformStream,n=r._readable._readableStreamController;if(!ar(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{nr(n,t)}catch(e){throw qr(r,e),r._readable._storedError}(function(e){return!er(e)})(n)!==r._backpressure&&zr(r,!0)}function Vr(e,t){return m(e._transformAlgorithm(t),void 0,(t=>{throw Wr(e._controlledTransformStream,t),t}))}function Qr(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Yr(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties($r.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof t.toStringTag&&Object.defineProperty($r.prototype,t.toStringTag,{value:"TransformStreamDefaultController",configurable:!0}),e.ByteLengthQueuingStrategy=Fr,e.CountQueuingStrategy=Ir,e.ReadableByteStreamController=ye,e.ReadableStream=gr,e.ReadableStreamBYOBReader=He,e.ReadableStreamBYOBRequest=fe,e.ReadableStreamDefaultController=Xt,e.ReadableStreamDefaultReader=X,e.TransformStream=jr,e.TransformStreamDefaultController=$r,e.WritableStream=ot,e.WritableStreamDefaultController=Rt,e.WritableStreamDefaultWriter=bt,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?n(e):"function"==typeof define&&define.amd?define(["exports"],n):n((r="undefined"!=typeof globalThis?globalThis:r||self).WebStreamsPolyfill={})})),Ru=vt((()=>{j();if(!globalThis.ReadableStream)try{let e=require("node:process"),{emitWarning:t}=e;try{e.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),e.emitWarning=t}catch(r){throw e.emitWarning=t,r}}catch(e){Object.assign(globalThis,ju())}try{let{Blob:e}=require("buffer");e&&!e.prototype.stream&&(e.prototype.stream=function(e){let t=0,r=this;return new ReadableStream({type:"bytes",async pull(e){let n=await r.slice(t,Math.min(r.size,t+65536)).arrayBuffer();t+=n.byteLength,e.enqueue(new Uint8Array(n)),t===r.size&&e.close()}})})}catch(e){}}));async function*Zo(e,t=!0){for(let r of e)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(t){let e=r.byteOffset,t=r.byteOffset+r.byteLength;for(;e!==t;){let n=Math.min(t-e,xu),i=r.buffer.slice(e,e+n);e+=i.byteLength,yield new Uint8Array(i)}}else yield r;else{let e=0,t=r;for(;e!==t.size;){let r=await t.slice(e,Math.min(t.size,e+xu)).arrayBuffer();e+=r.byteLength,yield new Uint8Array(r)}}}var Xm,xu,Jt,Ir,Sa,Ji,Ta,Eu,jh,Et,zr,Cr,Au,Rh,xh,gn,Or=Ve((()=>{j(),Xm=Ne(Ru()),xu=65536,Ta=class{constructor(e=[],t={}){if(F(this,Jt,[]),F(this,Ir,""),F(this,Sa,0),F(this,Ji,"transparent"),"object"!=typeof e||null===e)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if("function"!=typeof e[Symbol.iterator])throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");null===t&&(t={});let r=new TextEncoder;for(let t of e){let e;e=ArrayBuffer.isView(t)?new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)):t instanceof ArrayBuffer?new Uint8Array(t.slice(0)):t instanceof Ta?t:r.encode(`${t}`),D(this,Sa,f(this,Sa)+(ArrayBuffer.isView(e)?e.byteLength:e.size)),f(this,Jt).push(e)}D(this,Ji,`${void 0===t.endings?"transparent":t.endings}`);let n=void 0===t.type?"":String(t.type);D(this,Ir,/^[\x20-\x7E]*$/.test(n)?n:"")}get size(){return f(this,Sa)}get type(){return f(this,Ir)}async text(){let e=new TextDecoder,t="";for await(let r of Zo(f(this,Jt),!1))t+=e.decode(r,{stream:!0});return t+=e.decode(),t}async arrayBuffer(){let e=new Uint8Array(this.size),t=0;for await(let r of Zo(f(this,Jt),!1))e.set(r,t),t+=r.length;return e.buffer}stream(){let e=Zo(f(this,Jt),!0);return new globalThis.ReadableStream({type:"bytes",async pull(t){let r=await e.next();r.done?t.close():t.enqueue(r.value)},async cancel(){await e.return()}})}slice(e=0,t=this.size,r=""){let{size:n}=this,i=e<0?Math.max(n+e,0):Math.min(e,n),o=t<0?Math.max(n+t,0):Math.min(t,n),a=Math.max(o-i,0),s=f(this,Jt),l=[],u=0;for(let e of s){if(u>=a)break;let t=ArrayBuffer.isView(e)?e.byteLength:e.size;if(i&&t<=i)i-=t,o-=t;else{let r;ArrayBuffer.isView(e)?(r=e.subarray(i,Math.min(t,o)),u+=r.byteLength):(r=e.slice(i,Math.min(t,o)),u+=r.size),o-=t,l.push(r),i=0}}let h=new Ta([],{type:String(r).toLowerCase()});return D(h,Sa,a),D(h,Jt,l),h}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&"object"==typeof e&&"function"==typeof e.constructor&&("function"==typeof e.stream||"function"==typeof e.arrayBuffer)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}},Jt=new WeakMap,Ir=new WeakMap,Sa=new WeakMap,Ji=new WeakMap,Eu=Ta,Object.defineProperties(Eu.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Et=jh=Eu})),es=Ve((()=>{j(),Or(),Au=class extends Et{constructor(e,t,r={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,r),F(this,zr,0),F(this,Cr,""),null===r&&(r={});let n=void 0===r.lastModified?Date.now():Number(r.lastModified);Number.isNaN(n)||D(this,zr,n),D(this,Cr,String(t))}get name(){return f(this,Cr)}get lastModified(){return f(this,zr)}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof Et&&/^(File)$/.test(e[Symbol.toStringTag])}},zr=new WeakMap,Cr=new WeakMap,gn=xh=Rh=Au}));function zu(e,t=Et){var r=`${Iu()}${Iu()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r\nContent-Disposition: form-data; name="`;return e.forEach(((e,t)=>"string"==typeof e?n.push(i+ts(t)+`"\r\n\r\n${e.replace(/\r(?!\n)|(?<!\r)\n/g,"\r\n")}\r\n`):n.push(i+ts(t)+`"; filename="${ts(e.name,1)}"\r\nContent-Type: ${e.type||"application/octet-stream"}\r\n\r\n`,e,"\r\n"))),n.push(`--${r}--`),new t(n,{type:"multipart/form-data; boundary="+r})}var Pr,Eh,Ah,Iu,Ih,Ou,ts,Dn,wt,Cu,yn,bn,ct,Ki,as,Fr,Pu,Fu,Nu,qn,Du,qu,rs,Wu,Gu,Uu,Vu,$u,Hu,Wn,Gn,os,is,Xi=Ve((()=>{j(),Or(),es(),({toStringTag:Pr,iterator:Eh,hasInstance:Ah}=Symbol),Iu=Math.random,Ih="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),Ou=(e,t,r)=>(e+="",/^(Blob|File)$/.test(t&&t[Pr])?[(r=void 0!==r?r+"":"File"==t[Pr]?t.name:"blob",e),t.name!==r||"blob"==t[Pr]?new gn([t],r,t):t]:[e,t+""]),ts=(e,t)=>(t?e:e.replace(/\r?\n|\r/g,"\r\n")).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Dn=(e,t,r)=>{if(t.length<r)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${r} arguments required, but only ${t.length} present.`)},Cu=class{constructor(...e){if(F(this,wt,[]),e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Pr](){return"FormData"}[Eh](){return this.entries()}static[Ah](e){return e&&"object"==typeof e&&"FormData"===e[Pr]&&!Ih.some((t=>"function"!=typeof e[t]))}append(...e){Dn("append",arguments,2),f(this,wt).push(Ou(...e))}delete(e){Dn("delete",arguments,1),e+="",D(this,wt,f(this,wt).filter((([t])=>t!==e)))}get(e){Dn("get",arguments,1),e+="";for(var t=f(this,wt),r=t.length,n=0;n<r;n++)if(t[n][0]===e)return t[n][1];return null}getAll(e,t){return Dn("getAll",arguments,1),t=[],e+="",f(this,wt).forEach((r=>r[0]===e&&t.push(r[1]))),t}has(e){return Dn("has",arguments,1),e+="",f(this,wt).some((t=>t[0]===e))}forEach(e,t){for(var[r,n]of(Dn("forEach",arguments,1),this))e.call(t,n,r,this)}set(...e){Dn("set",arguments,2);var t=[],r=!0;e=Ou(...e),f(this,wt).forEach((n=>{n[0]===e[0]?r&&(r=!t.push(e)):t.push(n)})),r&&t.push(e),D(this,wt,t)}*entries(){yield*f(this,wt)}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}},wt=new WeakMap,yn=Cu})),Qi=Ve((()=>{j(),bn=class extends Error{constructor(e,t){super(e),Error.captureStackTrace(this,this.constructor),this.type=t}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}})),ns=Ve((()=>{j(),Qi(),ct=class extends bn{constructor(e,t,r){super(e,t),r&&(this.code=this.errno=r.code,this.erroredSysCall=r.syscall)}}})),Zi=Ve((()=>{j(),Ki=Symbol.toStringTag,as=e=>"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&"function"==typeof e.sort&&"URLSearchParams"===e[Ki],Fr=e=>e&&"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&/^(Blob|File)$/.test(e[Ki]),Pu=e=>"object"==typeof e&&("AbortSignal"===e[Ki]||"EventTarget"===e[Ki]),Fu=(e,t)=>{let r=new URL(t).hostname,n=new URL(e).hostname;return r===n||r.endsWith(`.${n}`)},Nu=(e,t)=>new URL(t).protocol===new URL(e).protocol})),Lu=vt(((e,t)=>{if(j(),!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),t=(new e).port1,r=new ArrayBuffer;t.postMessage(r,[r,r])}catch(e){"DOMException"===e.constructor.name&&(globalThis.DOMException=e.constructor)}t.exports=globalThis.DOMException})),ss=Ve((()=>{j(),qn=Ne(require("node:fs")),Du=Ne(require("node:path")),qu=Ne(Lu()),es(),Or(),({stat:rs}=qn.promises),Wu=(e,t)=>$u((0,qn.statSync)(e),e,t),Gu=(e,t)=>rs(e).then((r=>$u(r,e,t))),Uu=(e,t)=>rs(e).then((r=>Hu(r,e,t))),Vu=(e,t)=>Hu((0,qn.statSync)(e),e,t),$u=(e,t,r="")=>new Et([new is({path:t,size:e.size,lastModified:e.mtimeMs,start:0})],{type:r}),Hu=(e,t,r="")=>new gn([new is({path:t,size:e.size,lastModified:e.mtimeMs,start:0})],(0,Du.basename)(t),{type:r,lastModified:e.mtimeMs}),os=class{constructor(e){F(this,Wn,void 0),F(this,Gn,void 0),D(this,Wn,e.path),D(this,Gn,e.start),this.size=e.size,this.lastModified=e.lastModified}slice(e,t){return new os({path:f(this,Wn),lastModified:this.lastModified,size:t-e,start:f(this,Gn)+e})}async*stream(){let{mtimeMs:e}=await rs(f(this,Wn));if(e>this.lastModified)throw new qu.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,qn.createReadStream)(f(this,Wn),{start:f(this,Gn),end:f(this,Gn)+this.size-1})}get[Symbol.toStringTag](){return"Blob"}},is=os,Wn=new WeakMap,Gn=new WeakMap})),Xu={};function Nh(e){let t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let r=t[2]||t[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,((e,t)=>String.fromCharCode(t))),n}async function Bh(e,t){if(!/multipart/i.test(t))throw new TypeError("Failed to fetch");let r=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let n,i,o,a,s,l,u=new Ju(r[1]||r[2]),h=[],c=new yn,d=e=>{o+=g.decode(e,{stream:!0})},p=e=>{h.push(e)},f=()=>{let e=new gn(h,l,{type:s});c.append(a,e)},y=()=>{c.append(a,o)},g=new TextDecoder("utf-8");g.decode(),u.onPartBegin=function(){u.onPartData=d,u.onPartEnd=y,n="",i="",o="",a="",s="",l=null,h.length=0},u.onHeaderField=function(e){n+=g.decode(e,{stream:!0})},u.onHeaderValue=function(e){i+=g.decode(e,{stream:!0})},u.onHeaderEnd=function(){if(i+=g.decode(),n=n.toLowerCase(),"content-disposition"===n){let e=i.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);e&&(a=e[2]||e[3]||""),l=Nh(i),l&&(u.onPartData=p,u.onPartEnd=f)}else"content-type"===n&&(s=i);i="",n=""};for await(let t of e)u.write(t);return u.end(),c}Po(Xu,{toFormData:()=>Bh});var Dt,Ce,Yu,kn,eo,to,Oh,Nr,zh,Ch,Ph,Fh,Un,Ju,Qu=Ve((()=>{j(),ss(),Xi(),Dt=0,Ce={START_BOUNDARY:Dt++,HEADER_FIELD_START:Dt++,HEADER_FIELD:Dt++,HEADER_VALUE_START:Dt++,HEADER_VALUE:Dt++,HEADER_VALUE_ALMOST_DONE:Dt++,HEADERS_ALMOST_DONE:Dt++,PART_DATA_START:Dt++,PART_DATA:Dt++,END:Dt++},kn={PART_BOUNDARY:Yu=1,LAST_BOUNDARY:Yu*=2},eo=10,to=13,Oh=32,Nr=45,zh=58,Ch=97,Ph=122,Fh=e=>32|e,Un=()=>{},Ju=class{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=Un,this.onHeaderField=Un,this.onHeadersEnd=Un,this.onHeaderValue=Un,this.onPartBegin=Un,this.onPartData=Un,this.onPartEnd=Un,this.boundaryChars={},e="\r\n--"+e;let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r),this.boundaryChars[t[r]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Ce.START_BOUNDARY}write(e){let t,r,n=0,i=e.length,o=this.index,{lookbehind:a,boundary:s,boundaryChars:l,index:u,state:h,flags:c}=this,d=this.boundary.length,p=d-1,f=e.length,y=e=>{this[e+"Mark"]=n},g=e=>{delete this[e+"Mark"]},m=(e,t,r,n)=>{(void 0===t||t!==r)&&this[e](n&&n.subarray(t,r))},b=(t,r)=>{let i=t+"Mark";i in this&&(r?(m(t,this[i],n,e),delete this[i]):(m(t,this[i],e.length,e),this[i]=0))};for(n=0;n<i;n++)switch(t=e[n],h){case Ce.START_BOUNDARY:if(u===s.length-2){if(t===Nr)c|=kn.LAST_BOUNDARY;else if(t!==to)return;u++;break}if(u-1==s.length-2){if(c&kn.LAST_BOUNDARY&&t===Nr)h=Ce.END,c=0;else{if(c&kn.LAST_BOUNDARY||t!==eo)return;u=0,m("onPartBegin"),h=Ce.HEADER_FIELD_START}break}t!==s[u+2]&&(u=-2),t===s[u+2]&&u++;break;case Ce.HEADER_FIELD_START:h=Ce.HEADER_FIELD,y("onHeaderField"),u=0;case Ce.HEADER_FIELD:if(t===to){g("onHeaderField"),h=Ce.HEADERS_ALMOST_DONE;break}if(u++,t===Nr)break;if(t===zh){if(1===u)return;b("onHeaderField",!0),h=Ce.HEADER_VALUE_START;break}if(r=Fh(t),r<Ch||r>Ph)return;break;case Ce.HEADER_VALUE_START:if(t===Oh)break;y("onHeaderValue"),h=Ce.HEADER_VALUE;case Ce.HEADER_VALUE:t===to&&(b("onHeaderValue",!0),m("onHeaderEnd"),h=Ce.HEADER_VALUE_ALMOST_DONE);break;case Ce.HEADER_VALUE_ALMOST_DONE:if(t!==eo)return;h=Ce.HEADER_FIELD_START;break;case Ce.HEADERS_ALMOST_DONE:if(t!==eo)return;m("onHeadersEnd"),h=Ce.PART_DATA_START;break;case Ce.PART_DATA_START:h=Ce.PART_DATA,y("onPartData");case Ce.PART_DATA:if(o=u,0===u){for(n+=p;n<f&&!(e[n]in l);)n+=d;n-=p,t=e[n]}if(u<s.length)s[u]===t?(0===u&&b("onPartData",!0),u++):u=0;else if(u===s.length)u++,t===to?c|=kn.PART_BOUNDARY:t===Nr?c|=kn.LAST_BOUNDARY:u=0;else if(u-1===s.length)if(c&kn.PART_BOUNDARY){if(u=0,t===eo){c&=~kn.PART_BOUNDARY,m("onPartEnd"),m("onPartBegin"),h=Ce.HEADER_FIELD_START;break}}else c&kn.LAST_BOUNDARY&&t===Nr?(m("onPartEnd"),h=Ce.END,c=0):u=0;if(u>0)a[u-1]=t;else if(o>0){let e=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);m("onPartData",0,o,e),o=0,y("onPartData"),n--}break;case Ce.END:break;default:throw new Error(`Unexpected state entered: ${h}`)}b("onHeaderField"),b("onHeaderValue"),b("onPartData"),this.index=u,this.state=h,this.flags=c}end(){if(this.state===Ce.HEADER_FIELD_START&&0===this.index||this.state===Ce.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Ce.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}}));async function ls(e){if(e[dt].disturbed)throw new TypeError(`body used already for: ${e.url}`);if(e[dt].disturbed=!0,e[dt].error)throw e[dt].error;let{body:t}=e;if(null===t)return yt.Buffer.alloc(0);if(!(t instanceof Mt.default))return yt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of t){if(e.size>0&&n+i.length>e.size){let r=new ct(`content size at ${e.url} over limit: ${e.size}`,"max-size");throw t.destroy(r),r}n+=i.length,r.push(i)}}catch(t){throw t instanceof bn?t:new ct(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t)}if(!0!==t.readableEnded&&!0!==t._readableState.ended)throw new ct(`Premature close of server response while trying to fetch ${e.url}`);try{return r.every((e=>"string"==typeof e))?yt.Buffer.from(r.join("")):yt.Buffer.concat(r,n)}catch(t){throw new ct(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t)}}var Mt,Xt,yt,Lh,dt,Qt,ja,Dh,no,Ku,Zu,ao=Ve((()=>{j(),Mt=Ne(require("node:stream")),Xt=Ne(require("node:util")),yt=Ne(require("node:buffer")),Or(),Xi(),ns(),Qi(),Zi(),Lh=(0,Xt.promisify)(Mt.default.pipeline),dt=Symbol("Body internals"),(Qt=class{constructor(e,{size:t=0}={}){let r=null;null===e?e=null:as(e)?e=yt.Buffer.from(e.toString()):Fr(e)||yt.Buffer.isBuffer(e)||(Xt.types.isAnyArrayBuffer(e)?e=yt.Buffer.from(e):ArrayBuffer.isView(e)?e=yt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof Mt.default||(e instanceof yn?r=(e=zu(e)).type.split("=")[1]:e=yt.Buffer.from(String(e))));let n=e;yt.Buffer.isBuffer(e)?n=Mt.default.Readable.from(e):Fr(e)&&(n=Mt.default.Readable.from(e.stream())),this[dt]={body:e,stream:n,boundary:r,disturbed:!1,error:null},this.size=t,e instanceof Mt.default&&e.on("error",(e=>{let t=e instanceof bn?e:new ct(`Invalid response body while trying to fetch ${this.url}: ${e.message}`,"system",e);this[dt].error=t}))}get body(){return this[dt].stream}get bodyUsed(){return this[dt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:t,byteLength:r}=await ls(this);return e.slice(t,t+r)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let e=new yn,t=new URLSearchParams(await this.text());for(let[r,n]of t)e.append(r,n);return e}let{toFormData:t}=await Promise.resolve().then((()=>(Qu(),Xu)));return t(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[dt].body&&this[dt].body.type||"",t=await this.arrayBuffer();return new Et([t],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await ls(this);return(new TextDecoder).decode(e)}buffer(){return ls(this)}}).prototype.buffer=(0,Xt.deprecate)(Qt.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer"),Object.defineProperties(Qt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Xt.deprecate)((()=>{}),"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}}),ja=(e,t)=>{let r,n,{body:i}=e[dt];if(e.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof Mt.default&&"function"!=typeof i.getBoundary&&(r=new Mt.PassThrough({highWaterMark:t}),n=new Mt.PassThrough({highWaterMark:t}),i.pipe(r),i.pipe(n),e[dt].stream=r,i=n),i},Dh=(0,Xt.deprecate)((e=>e.getBoundary()),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),no=(e,t)=>null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":as(e)?"application/x-www-form-urlencoded;charset=UTF-8":Fr(e)?e.type||null:yt.Buffer.isBuffer(e)||Xt.types.isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof yn?`multipart/form-data; boundary=${t[dt].boundary}`:e&&"function"==typeof e.getBoundary?`multipart/form-data;boundary=${Dh(e)}`:e instanceof Mt.default?null:"text/plain;charset=UTF-8",Ku=e=>{let{body:t}=e[dt];return null===t?0:Fr(t)?t.size:yt.Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},Zu=async(e,{body:t})=>{null===t?e.end():await Lh(t,e)}}));function ec(e=[]){return new ht(e.reduce(((e,t,r,n)=>(r%2==0&&e.push(n.slice(r,r+2)),e)),[]).filter((([e,t])=>{try{return ro(e),cs(e,String(t)),!0}catch{return!1}})))}var us,Br,ro,cs,ht,qh,Lr,At,tt,nc,io=Ve((()=>{j(),us=Ne(require("node:util")),Br=Ne(require("node:http")),ro="function"==typeof Br.default.validateHeaderName?Br.default.validateHeaderName:e=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),t}},cs="function"==typeof Br.default.validateHeaderValue?Br.default.validateHeaderValue:(e,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let t=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_CHAR"}),t}},ht=class extends URLSearchParams{constructor(e){let t=[];if(e instanceof ht){let r=e.raw();for(let[e,n]of Object.entries(r))t.push(...n.map((t=>[e,t])))}else if(null!=e){if("object"!=typeof e||us.types.isBoxedPrimitive(e))throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");{let r=e[Symbol.iterator];if(null==r)t.push(...Object.entries(e));else{if("function"!=typeof r)throw new TypeError("Header pairs must be iterable");t=[...e].map((e=>{if("object"!=typeof e||us.types.isBoxedPrimitive(e))throw new TypeError("Each header pair must be an iterable object");return[...e]})).map((e=>{if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");return[...e]}))}}}return t=t.length>0?t.map((([e,t])=>(ro(e),cs(e,String(t)),[String(e).toLowerCase(),String(t)]))):void 0,super(t),new Proxy(this,{get(e,t,r){switch(t){case"append":case"set":return(r,n)=>(ro(r),cs(r,String(n)),URLSearchParams.prototype[t].call(e,String(r).toLowerCase(),String(n)));case"delete":case"has":case"getAll":return r=>(ro(r),URLSearchParams.prototype[t].call(e,String(r).toLowerCase()));case"keys":return()=>(e.sort(),new Set(URLSearchParams.prototype.keys.call(e)).keys());default:return Reflect.get(e,t,r)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let t=this.getAll(e);if(0===t.length)return null;let r=t.join(", ");return/^content-encoding$/i.test(e)&&(r=r.toLowerCase()),r}forEach(e,t){for(let r of this.keys())Reflect.apply(e,t,[this.get(r),r,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce(((e,t)=>(e[t]=this.getAll(t),e)),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce(((e,t)=>{let r=this.getAll(t);return e[t]="host"===t?r[0]:r.length>1?r:r[0],e}),{})}},Object.defineProperties(ht.prototype,["get","entries","forEach","values"].reduce(((e,t)=>(e[t]={enumerable:!0},e)),{}))})),ds=Ve((()=>{j(),qh=new Set([301,302,303,307,308]),Lr=e=>qh.has(e)})),tc=Ve((()=>{j(),io(),ao(),ds(),At=Symbol("Response internals"),tt=class extends Qt{constructor(e=null,t={}){super(e,t);let r=null!=t.status?t.status:200,n=new ht(t.headers);if(null!==e&&!n.has("Content-Type")){let t=no(e,this);t&&n.append("Content-Type",t)}this[At]={type:"default",url:t.url,status:r,statusText:t.statusText||"",headers:n,counter:t.counter,highWaterMark:t.highWaterMark}}get type(){return this[At].type}get url(){return this[At].url||""}get status(){return this[At].status}get ok(){return this[At].status>=200&&this[At].status<300}get redirected(){return this[At].counter>0}get statusText(){return this[At].statusText}get headers(){return this[At].headers}get highWaterMark(){return this[At].highWaterMark}clone(){return new tt(ja(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,t=302){if(!Lr(t))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new tt(null,{headers:{location:new URL(e).toString()},status:t})}static error(){let e=new tt(null,{status:0,statusText:""});return e[At].type="error",e}get[Symbol.toStringTag](){return"Response"}},Object.defineProperties(tt.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})})),ac=Ve((()=>{j(),nc=e=>{if(e.search)return e.search;let t=e.href.length-1,r=e.hash||("#"===e.href[t]?"#":"");return"?"===e.href[t-r.length]?"?":""}}));function ic(e,t=!1){return null==e||(e=new URL(e),/^(about|blob|data):$/.test(e.protocol))?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}function lc(e){if(!oc.has(e))throw new TypeError(`Invalid referrerPolicy: ${e}`);return e}function Wh(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,""),r=(0,rc.isIP)(t);return!!(4===r&&/^127\./.test(t)||6===r&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t))||"localhost"!==e.host&&!e.host.endsWith(".localhost")&&"file:"===e.protocol}function Ra(e){return!(!/^about:(blank|srcdoc)$/.test(e)&&"data:"!==e.protocol&&!/^(blob|filesystem):$/.test(e.protocol))||Wh(e)}function uc(e,{referrerURLCallback:t,referrerOriginCallback:r}={}){if("no-referrer"===e.referrer||""===e.referrerPolicy)return null;let n=e.referrerPolicy;if("about:client"===e.referrer)return"no-referrer";let i=e.referrer,o=ic(i),a=ic(i,!0);o.toString().length>4096&&(o=a),t&&(o=t(o)),r&&(a=r(a));let s=new URL(e.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return a;case"unsafe-url":return o;case"strict-origin":return Ra(o)&&!Ra(s)?"no-referrer":a.toString();case"strict-origin-when-cross-origin":return o.origin===s.origin?o:Ra(o)&&!Ra(s)?"no-referrer":a;case"same-origin":return o.origin===s.origin?o:"no-referrer";case"origin-when-cross-origin":return o.origin===s.origin?o:a;case"no-referrer-when-downgrade":return Ra(o)&&!Ra(s)?"no-referrer":o;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function cc(e){let t=(e.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let e of t)e&&oc.has(e)&&(r=e);return r}var rc,oc,sc,dc,hc,Qe,Dr,Gh,Kt,pc,oo,hs=Ve((()=>{j(),rc=Ne(require("node:net")),oc=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),sc="strict-origin-when-cross-origin"})),fc=Ve((()=>{j(),dc=Ne(require("node:url")),hc=Ne(require("node:util")),io(),ao(),Zi(),ac(),hs(),Qe=Symbol("Request internals"),Dr=e=>"object"==typeof e&&"object"==typeof e[Qe],Gh=(0,hc.deprecate)((()=>{}),".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Kt=class extends Qt{constructor(e,t={}){let r;if(Dr(e)?r=new URL(e.url):(r=new URL(e),e={}),""!==r.username||""!==r.password)throw new TypeError(`${r} is an url with embedded credentials.`);let n=t.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(n)&&(n=n.toUpperCase()),!Dr(t)&&"data"in t&&Gh(),(null!=t.body||Dr(e)&&null!==e.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let i=t.body?t.body:Dr(e)&&null!==e.body?ja(e):null;super(i,{size:t.size||e.size||0});let o=new ht(t.headers||e.headers||{});if(null!==i&&!o.has("Content-Type")){let e=no(i,this);e&&o.set("Content-Type",e)}let a=Dr(e)?e.signal:null;if("signal"in t&&(a=t.signal),null!=a&&!Pu(a))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let s=null==t.referrer?e.referrer:t.referrer;if(""===s)s="no-referrer";else if(s){let e=new URL(s);s=/^about:(\/\/)?client$/.test(e)?"client":e}else s=void 0;this[Qe]={method:n,redirect:t.redirect||e.redirect||"follow",headers:o,parsedURL:r,signal:a,referrer:s},this.follow=void 0===t.follow?void 0===e.follow?20:e.follow:t.follow,this.compress=void 0===t.compress?void 0===e.compress||e.compress:t.compress,this.counter=t.counter||e.counter||0,this.agent=t.agent||e.agent,this.highWaterMark=t.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=t.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=t.referrerPolicy||e.referrerPolicy||""}get method(){return this[Qe].method}get url(){return(0,dc.format)(this[Qe].parsedURL)}get headers(){return this[Qe].headers}get redirect(){return this[Qe].redirect}get signal(){return this[Qe].signal}get referrer(){return"no-referrer"===this[Qe].referrer?"":"client"===this[Qe].referrer?"about:client":this[Qe].referrer?this[Qe].referrer.toString():void 0}get referrerPolicy(){return this[Qe].referrerPolicy}set referrerPolicy(e){this[Qe].referrerPolicy=lc(e)}clone(){return new Kt(this)}get[Symbol.toStringTag](){return"Request"}},Object.defineProperties(Kt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}}),pc=e=>{let{parsedURL:t}=e[Qe],r=new ht(e[Qe].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(null===e.body&&/^(post|put)$/i.test(e.method)&&(n="0"),null!==e.body){let t=Ku(e);"number"==typeof t&&!Number.isNaN(t)&&(n=String(t))}n&&r.set("Content-Length",n),""===e.referrerPolicy&&(e.referrerPolicy=sc),e.referrer&&"no-referrer"!==e.referrer?e[Qe].referrer=uc(e):e[Qe].referrer="no-referrer",e[Qe].referrer instanceof URL&&r.set("Referer",e.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),e.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=e;"function"==typeof i&&(i=i(t)),!r.has("Connection")&&!i&&r.set("Connection","close");let o=nc(t);return{parsedURL:t,options:{path:t.pathname+o,method:e.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:e.insecureHTTPParser,agent:i}}}})),mc=Ve((()=>{j(),Qi(),oo=class extends bn{constructor(e,t="aborted"){super(e,t)}}})),bc={};async function ps(e,t){return new Promise(((r,n)=>{let i=new Kt(e,t),{parsedURL:o,options:a}=pc(i);if(!Uh.has(o.protocol))throw new TypeError(`node-fetch cannot load ${e}. URL scheme "${o.protocol.replace(/:$/,"")}" is not supported.`);if("data:"===o.protocol){let e=_u(i.url),t=new tt(e,{headers:{"Content-Type":e.typeFull}});return void r(t)}let s=("https:"===o.protocol?yc.default:gc.default).request,{signal:l}=i,u=null,h=()=>{let e=new oo("The operation was aborted.");n(e),i.body&&i.body instanceof bt.default.Readable&&i.body.destroy(e),u&&u.body&&u.body.emit("error",e)};if(l&&l.aborted)return void h();let c=()=>{h(),p()},d=s(o.toString(),a);l&&l.addEventListener("abort",c);let p=()=>{d.abort(),l&&l.removeEventListener("abort",c)};d.on("error",(e=>{n(new ct(`request to ${i.url} failed, reason: ${e.message}`,"system",e)),p()})),Vh(d,(e=>{u&&u.body&&u.body.destroy(e)})),G.version<"v14"&&d.on("socket",(e=>{let t;e.prependListener("end",(()=>{t=e._eventsCount})),e.prependListener("close",(r=>{if(u&&t<e._eventsCount&&!r){let e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",u.body.emit("error",e)}}))})),d.on("response",(e=>{d.setTimeout(0);let o=ec(e.rawHeaders);if(Lr(e.statusCode)){let a=o.get("Location"),s=null;try{s=null===a?null:new URL(a,i.url)}catch{if("manual"!==i.redirect)return n(new ct(`uri requested responds with an invalid redirect URL: ${a}`,"invalid-redirect")),void p()}switch(i.redirect){case"error":return n(new ct(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),void p();case"manual":break;case"follow":{if(null===s)break;if(i.counter>=i.follow)return n(new ct(`maximum redirect reached at: ${i.url}`,"max-redirect")),void p();let a={headers:new ht(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:ja(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!Fu(i.url,s)||!Nu(i.url,s))for(let e of["authorization","www-authenticate","cookie","cookie2"])a.headers.delete(e);if(303!==e.statusCode&&i.body&&t.body instanceof bt.default.Readable)return n(new ct("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void p();(303===e.statusCode||(301===e.statusCode||302===e.statusCode)&&"POST"===i.method)&&(a.method="GET",a.body=void 0,a.headers.delete("content-length"));let l=cc(o);return l&&(a.referrerPolicy=l),r(ps(new Kt(s,a))),void p()}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}l&&e.once("end",(()=>{l.removeEventListener("abort",c)}));let a=(0,bt.pipeline)(e,new bt.PassThrough,(e=>{e&&n(e)}));G.version<"v12.10"&&e.on("aborted",c);let s={url:i.url,status:e.statusCode,statusText:e.statusMessage,headers:o,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},h=o.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===h||204===e.statusCode||304===e.statusCode)return u=new tt(a,s),void r(u);let f={flush:Vn.default.Z_SYNC_FLUSH,finishFlush:Vn.default.Z_SYNC_FLUSH};if("gzip"===h||"x-gzip"===h)return a=(0,bt.pipeline)(a,Vn.default.createGunzip(f),(e=>{e&&n(e)})),u=new tt(a,s),void r(u);if("deflate"===h||"x-deflate"===h){let t=(0,bt.pipeline)(e,new bt.PassThrough,(e=>{e&&n(e)}));return t.once("data",(e=>{a=8==(15&e[0])?(0,bt.pipeline)(a,Vn.default.createInflate(),(e=>{e&&n(e)})):(0,bt.pipeline)(a,Vn.default.createInflateRaw(),(e=>{e&&n(e)})),u=new tt(a,s),r(u)})),void t.once("end",(()=>{u||(u=new tt(a,s),r(u))}))}if("br"===h)return a=(0,bt.pipeline)(a,Vn.default.createBrotliDecompress(),(e=>{e&&n(e)})),u=new tt(a,s),void r(u);u=new tt(a,s),r(u)})),Zu(d,i).catch(n)}))}function Vh(e,t){let r,n=qr.Buffer.from("0\r\n\r\n"),i=!1,o=!1;e.on("response",(e=>{let{headers:t}=e;i="chunked"===t["transfer-encoding"]&&!t["content-length"]})),e.on("socket",(a=>{let s=()=>{if(i&&!o){let e=new Error("Premature close");e.code="ERR_STREAM_PREMATURE_CLOSE",t(e)}},l=e=>{o=0===qr.Buffer.compare(e.slice(-5),n),!o&&r&&(o=0===qr.Buffer.compare(r.slice(-3),n.slice(0,3))&&0===qr.Buffer.compare(e.slice(-2),n.slice(3))),r=e};a.prependListener("close",s),a.on("data",l),e.on("close",(()=>{a.removeListener("close",s),a.removeListener("data",l)}))}))}Po(bc,{AbortError:()=>oo,Blob:()=>Et,FetchError:()=>ct,File:()=>gn,FormData:()=>yn,Headers:()=>ht,Request:()=>Kt,Response:()=>tt,blobFrom:()=>Gu,blobFromSync:()=>Wu,default:()=>ps,fileFrom:()=>Uu,fileFromSync:()=>Vu,isRedirect:()=>Lr});var gc,yc,Vn,bt,qr,Uh,kc=Ve((()=>{j(),gc=Ne(require("node:http")),yc=Ne(require("node:https")),Vn=Ne(require("node:zlib")),bt=Ne(require("node:stream")),qr=Ne(require("node:buffer")),Su(),ao(),tc(),io(),fc(),ns(),mc(),ds(),Xi(),Zi(),hs(),ss(),Uh=new Set(["data:","http:","https:"])})),wc=vt(((e,t)=>{j();var r=(kc(),bc),n=r.default||r,i=function(e,t){return/^\/\//.test(e)&&(e="https:"+e),n.call(this,e,t)};i.ponyfill=!0,t.exports=e=i,e.fetch=i,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,e.default=i})),Mc=vt(((e,t)=>{var r,n;j(),r=e,n=function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};function t(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}var n,i="KEYS",o="VALUES",a="",s=function(){function e(e,t){var r=e._tree,n=Array.from(r.keys());this.set=e,this._type=t,this._path=n.length>0?[{node:r,keys:n}]:[]}return e.prototype.next=function(){var e=this.dive();return this.backtrack(),e},e.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var e=l(this._path),t=e.node,r=e.keys;if(l(r)===a)return{done:!1,value:this.result()};var n=t.get(l(r));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},e.prototype.backtrack=function(){if(0!==this._path.length){var e=l(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},e.prototype.key=function(){return this.set._prefix+this._path.map((function(e){var t=e.keys;return l(t)})).filter((function(e){return e!==a})).join("")},e.prototype.value=function(){return l(this._path).node.get(a)},e.prototype.result=function(){switch(this._type){case o:return this.value();case i:return this.key();default:return[this.key(),this.value()]}},e.prototype[Symbol.iterator]=function(){return this},e}(),l=function(e){return e[e.length-1]},u=function(e,r,n,i,o,s,l,h){var c,d,p=s*l;try{e:for(var f=t(e.keys()),y=f.next();!y.done;y=f.next()){var g=y.value;if(g===a){var m=o[p-1];m<=n&&i.set(h,[e.get(g),m])}else{for(var b=s,_=0;_<g.length;++_,++b){for(var v=g[_],w=l*b,S=w-l,M=o[w],T=Math.max(0,b-n-1),E=Math.min(l-1,b+n),R=T;R<E;++R){var A=v!==r[R],F=o[S+R]+ +A,k=o[S+R+1]+1,x=o[w+R]+1,O=o[w+R+1]=Math.min(F,k,x);O<M&&(M=O)}if(M>n)continue e}u(e.get(g),r,n,i,o,b,l,h+g)}}}catch(e){c={error:e}}finally{try{y&&!y.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}},h=function(){function e(e,t){void 0===e&&(e=new Map),void 0===t&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return e.prototype.atPrefix=function(n){var i,o;if(!n.startsWith(this._prefix))throw new Error("Mismatched prefix");var s=r(c(this._tree,n.slice(this._prefix.length)),2),l=s[0],u=s[1];if(void 0===l){var h=r(m(u),2),d=h[0],p=h[1];try{for(var f=t(d.keys()),y=f.next();!y.done;y=f.next()){var g=y.value;if(g!==a&&g.startsWith(p)){var b=new Map;return b.set(g.slice(p.length),d.get(g)),new e(b,n)}}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}return new e(l,n)},e.prototype.clear=function(){this._size=void 0,this._tree.clear()},e.prototype.delete=function(e){return this._size=void 0,f(this._tree,e)},e.prototype.entries=function(){return new s(this,"ENTRIES")},e.prototype.forEach=function(e){var n,i;try{for(var o=t(this),a=o.next();!a.done;a=o.next()){var s=r(a.value,2);e(s[0],s[1],this)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.fuzzyGet=function(e,t){return function(e,t,r){var n=new Map;if(void 0===t)return n;for(var i=t.length+1,o=i+r,a=new Uint8Array(o*i).fill(r+1),s=0;s<i;++s)a[s]=s;for(var l=1;l<o;++l)a[l*i]=l;return u(e,t,r,n,a,1,i,""),n}(this._tree,e,t)},e.prototype.get=function(e){var t=d(this._tree,e);return void 0!==t?t.get(a):void 0},e.prototype.has=function(e){var t=d(this._tree,e);return void 0!==t&&t.has(a)},e.prototype.keys=function(){return new s(this,i)},e.prototype.set=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");return this._size=void 0,p(this._tree,e).set(a,t),this},Object.defineProperty(e.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),e.prototype.update=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var r=p(this._tree,e);return r.set(a,t(r.get(a))),this},e.prototype.fetch=function(e,t){if("string"!=typeof e)throw new Error("key must be a string");this._size=void 0;var r=p(this._tree,e),n=r.get(a);return void 0===n&&r.set(a,n=t()),n},e.prototype.values=function(){return new s(this,o)},e.prototype[Symbol.iterator]=function(){return this.entries()},e.from=function(n){var i,o,a=new e;try{for(var s=t(n),l=s.next();!l.done;l=s.next()){var u=r(l.value,2),h=u[0],c=u[1];a.set(h,c)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a},e.fromObject=function(t){return e.from(Object.entries(t))},e}(),c=function(e,r,n){var i,o;if(void 0===n&&(n=[]),0===r.length||null==e)return[e,n];try{for(var s=t(e.keys()),l=s.next();!l.done;l=s.next()){var u=l.value;if(u!==a&&r.startsWith(u))return n.push([e,u]),c(e.get(u),r.slice(u.length),n)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return n.push([e,r]),c(void 0,"",n)},d=function(e,r){var n,i;if(0===r.length||null==e)return e;try{for(var o=t(e.keys()),s=o.next();!s.done;s=o.next()){var l=s.value;if(l!==a&&r.startsWith(l))return d(e.get(l),r.slice(l.length))}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},p=function(e,r){var n,i,o=r.length;e:for(var s=0;e&&s<o;){try{for(var l=(n=void 0,t(e.keys())),u=l.next();!u.done;u=l.next()){var h=u.value;if(h!==a&&r[s]===h[0]){for(var c=Math.min(o-s,h.length),d=1;d<c&&r[s+d]===h[d];)++d;var p=e.get(h);if(d===h.length)e=p;else{var f=new Map;f.set(h.slice(d),p),e.set(r.slice(s,s+d),f),e.delete(h),e=f}s+=d;continue e}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}var y=new Map;return e.set(r.slice(s),y),y}return e},f=function(e,t){var n=r(c(e,t),2),i=n[0],o=n[1];if(void 0!==i)if(i.delete(a),0===i.size)y(o);else if(1===i.size){var s=r(i.entries().next().value,2),l=s[0],u=s[1];g(o,l,u)}},y=function(e){if(0!==e.length){var t=r(m(e),2),n=t[0],i=t[1];if(n.delete(i),0===n.size)y(e.slice(0,-1));else if(1===n.size){var o=r(n.entries().next().value,2),s=o[0],l=o[1];s!==a&&g(e.slice(0,-1),s,l)}}},g=function(e,t,n){if(0!==e.length){var i=r(m(e),2),o=i[0],a=i[1];o.set(a+t,n),o.delete(a)}},m=function(e){return e[e.length-1]},b="or",_=function(){function n(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=e(e(e({},T),t),{searchOptions:e(e({},E),t.searchOptions||{})}),this._index=new h,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 n.prototype.add=function(e){var r,n,i,o,a=this._options,s=a.extractField,l=a.tokenize,u=a.processTerm,h=a.fields,c=a.idField,d=s(e,c);if(null==d)throw new Error('MiniSearch: document does not have ID field "'.concat(c,'"'));var p=this.addDocumentId(d);this.saveStoredFields(p,e);try{for(var f=t(h),y=f.next();!y.done;y=f.next()){var g=y.value,m=s(e,g);if(null!=m){var b=l(m.toString(),g),_=this._fieldIds[g],v=new Set(b).size;this.addFieldLength(p,_,this._documentCount-1,v);try{for(var w=(i=void 0,t(b)),S=w.next();!S.done;S=w.next()){var M=u(S.value,g);M&&this.addTerm(_,p,M)}}catch(e){i={error:e}}finally{try{S&&!S.done&&(o=w.return)&&o.call(w)}finally{if(i)throw i.error}}}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}},n.prototype.addAll=function(e){var r,n;try{for(var i=t(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.add(a)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},n.prototype.addAllAsync=function(e,t){var r=this;void 0===t&&(t={});var n=t.chunkSize,i=void 0===n?10:n,o={chunk:[],promise:Promise.resolve()},a=e.reduce((function(e,t,n){var o=e.chunk,a=e.promise;return o.push(t),(n+1)%i==0?{chunk:[],promise:a.then((function(){return new Promise((function(e){return setTimeout(e,0)}))})).then((function(){return r.addAll(o)}))}:{chunk:o,promise:a}}),o),s=a.chunk;return a.promise.then((function(){return r.addAll(s)}))},n.prototype.remove=function(e){var n,i,o,a,s,l,u=this._options,h=u.tokenize,c=u.processTerm,d=u.extractField,p=u.fields,f=u.idField,y=d(e,f);if(null==y)throw new Error('MiniSearch: document does not have ID field "'.concat(f,'"'));try{for(var g=t(this._documentIds),m=g.next();!m.done;m=g.next()){var b=r(m.value,2),_=b[0];if(y===b[1]){try{for(var v=(o=void 0,t(p)),w=v.next();!w.done;w=v.next()){var S=w.value,M=d(e,S);if(null!=M){var T=h(M.toString(),S),E=this._fieldIds[S],R=new Set(T).size;this.removeFieldLength(_,E,this._documentCount,R);try{for(var A=(s=void 0,t(T)),F=A.next();!F.done;F=A.next()){var k=c(F.value,S);k&&this.removeTerm(E,_,k)}}catch(e){s={error:e}}finally{try{F&&!F.done&&(l=A.return)&&l.call(A)}finally{if(s)throw s.error}}}}}catch(e){o={error:e}}finally{try{w&&!w.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}return this._storedFields.delete(_),this._documentIds.delete(_),this._fieldLength.delete(_),void(this._documentCount-=1)}}}catch(e){n={error:e}}finally{try{m&&!m.done&&(i=g.return)&&i.call(g)}finally{if(n)throw n.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(y,": it is not in the index"))},n.prototype.removeAll=function(e){var r,n;if(e)try{for(var i=t(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.remove(a)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new h,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.search=function(e,n){var i,o;void 0===n&&(n={});var a=this.executeQuery(e,n),s=[];try{for(var l=t(a),u=l.next();!u.done;u=l.next()){var h=r(u.value,2),c=h[0],d=h[1],p=d.score,f=d.terms,y=d.match,g=f.length,m={id:this._documentIds.get(c),score:p*g,terms:Object.keys(y),match:y};Object.assign(m,this._storedFields.get(c)),(null==n.filter||n.filter(m))&&s.push(m)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return s.sort(k),s},n.prototype.autoSuggest=function(n,i){var o,a,s,l;void 0===i&&(i={}),i=e(e({},R),i);var u=new Map;try{for(var h=t(this.search(n,i)),c=h.next();!c.done;c=h.next()){var d=c.value,p=d.score,f=(w=d.terms).join(" ");null!=(_=u.get(f))?(_.score+=p,_.count+=1):u.set(f,{score:p,terms:w,count:1})}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}var y=[];try{for(var g=t(u),m=g.next();!m.done;m=g.next()){var b=r(m.value,2),_=b[0],v=b[1],w=(p=v.score,v.terms),S=v.count;y.push({suggestion:_,terms:w,score:p/S})}}catch(e){s={error:e}}finally{try{m&&!m.done&&(l=g.return)&&l.call(g)}finally{if(s)throw s.error}}return y.sort(k),y},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(null==t)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return n.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(T.hasOwnProperty(e))return v(T,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,i){var o,a,s,l,u=e.index,c=e.documentCount,d=e.nextId,p=e.documentIds,f=e.fieldIds,y=e.fieldLength,g=e.averageFieldLength,m=e.storedFields,b=e.serializationVersion;if(1!==b&&2!==b)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var _=new n(i);_._documentCount=c,_._nextId=d,_._documentIds=O(p),_._fieldIds=f,_._fieldLength=O(y),_._avgFieldLength=g,_._storedFields=O(m),_._index=new h;try{for(var v=t(u),w=v.next();!w.done;w=v.next()){var S=r(w.value,2),M=S[0],T=S[1],E=new Map;try{for(var R=(s=void 0,t(Object.keys(T))),A=R.next();!A.done;A=R.next()){var F=A.value,k=T[F];1===b&&(k=k.ds),E.set(parseInt(F,10),O(k))}}catch(e){s={error:e}}finally{try{A&&!A.done&&(l=R.return)&&l.call(R)}finally{if(s)throw s.error}}_._index.set(M,E)}}catch(e){o={error:e}}finally{try{w&&!w.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}return _},n.prototype.executeQuery=function(t,r){var n=this;if(void 0===r&&(r={}),"string"!=typeof t){var i=e(e(e({},r),t),{queries:void 0}),o=t.queries.map((function(e){return n.executeQuery(e,i)}));return this.combineResults(o,t.combineWith)}var a=this._options,s=a.tokenize,l=a.processTerm,u=a.searchOptions,h=e(e({tokenize:s,processTerm:l},u),r),c=h.tokenize,d=h.processTerm,p=c(t).map((function(e){return d(e)})).filter((function(e){return!!e})).map(M(h)).map((function(e){return n.executeQuerySpec(e,h)}));return this.combineResults(p,h.combineWith)},n.prototype.executeQuerySpec=function(n,i){var o,a,s,l,u,h,c=e(e({},this._options.searchOptions),i),d=(c.fields||this._options.fields).reduce((function(t,r){var n;return e(e({},t),((n={})[r]=v(t,r)||1,n))}),c.boost||{}),p=c.boostDocument,f=c.weights,y=c.maxFuzzy,g=e(e({},E.weights),f),m=g.fuzzy,b=g.prefix,_=this._index.get(n.term),w=this.termResults(n.term,n.term,1,_,d,p);if(n.prefix&&(u=this._index.atPrefix(n.term)),n.fuzzy){var S=!0===n.fuzzy?.2:n.fuzzy,M=S<1?Math.min(y,Math.round(n.term.length*S)):S;M&&(h=this._index.fuzzyGet(n.term,M))}if(u)try{for(var T=t(u),R=T.next();!R.done;R=T.next()){var A=r(R.value,2),F=A[0],k=A[1];if(N=F.length-n.term.length){null==h||h.delete(F);var x=b*F.length/(F.length+.3*N);this.termResults(n.term,F,x,k,d,p,w)}}}catch(e){o={error:e}}finally{try{R&&!R.done&&(a=T.return)&&a.call(T)}finally{if(o)throw o.error}}if(h)try{for(var O=t(h.keys()),I=O.next();!I.done;I=O.next()){F=I.value;var N,P=r(h.get(F),2),D=P[0];(N=P[1])&&(x=m*F.length/(F.length+N),this.termResults(n.term,F,x,D,d,p,w))}}catch(e){s={error:e}}finally{try{I&&!I.done&&(l=O.return)&&l.call(O)}finally{if(s)throw s.error}}return w},n.prototype.combineResults=function(e,t){if(void 0===t&&(t=b),0===e.length)return new Map;var r=t.toLowerCase();return e.reduce(w[r])||new Map},n.prototype.toJSON=function(){var e,n,i,o,a=[];try{for(var s=t(this._index),l=s.next();!l.done;l=s.next()){var u=r(l.value,2),h=u[0],c=u[1],d={};try{for(var p=(i=void 0,t(c)),f=p.next();!f.done;f=p.next()){var y=r(f.value,2),g=y[0],m=y[1];d[g]=Object.fromEntries(m)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}a.push([h,d])}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.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:a,serializationVersion:2}},n.prototype.termResults=function(e,r,n,i,o,a,s){var l,u,h,c,d;if(void 0===s&&(s=new Map),null==i)return s;try{for(var p=t(Object.keys(o)),f=p.next();!f.done;f=p.next()){var y=f.value,g=o[y],m=this._fieldIds[y],b=i.get(m);if(null!=b){var _=b.size,w=this._avgFieldLength[m];try{for(var M=(h=void 0,t(b.keys())),T=M.next();!T.done;T=M.next()){var E=T.value,R=a?a(this._documentIds.get(E),r):1;if(R){var F=b.get(E),k=this._fieldLength.get(E)[m],x=n*g*R*S(F,_,this._documentCount,k,w),O=s.get(E);if(O){O.score+=x,A(O.terms,e);var I=v(O.match,r);I?I.push(y):O.match[r]=[y]}else s.set(E,{score:x,terms:[e],match:(d={},d[r]=[y],d)})}}}catch(e){h={error:e}}finally{try{T&&!T.done&&(c=M.return)&&c.call(M)}finally{if(h)throw h.error}}}}}catch(e){l={error:e}}finally{try{f&&!f.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}return s},n.prototype.addTerm=function(e,t,r){var n=this._index.fetch(r,x),i=n.get(e);if(null==i)(i=new Map).set(t,1),n.set(e,i);else{var o=i.get(t);i.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,r){if(this._index.has(r)){var n=this._index.fetch(r,x),i=n.get(e);null==i||null==i.get(t)?this.warnDocumentChanged(t,e,r):i.get(t)<=1?i.size<=1?n.delete(e):i.delete(t):i.set(t,i.get(t)-1),0===this._index.get(r).size&&this._index.delete(r)}else this.warnDocumentChanged(t,e,r)},n.prototype.warnDocumentChanged=function(e,r,n){var i,o;if(null!=console&&null!=console.warn)try{for(var a=t(Object.keys(this._fieldIds)),s=a.next();!s.done;s=a.next()){var l=s.value;if(this._fieldIds[l]===r)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(n,'" was not present in field "').concat(l,'". Removing a document after it has changed can corrupt the index!'))}}catch(e){i={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,r,n){var i=this._fieldLength.get(e);null==i&&this._fieldLength.set(e,i=[]),i[t]=n;var o=(this._avgFieldLength[t]||0)*r+n;this._avgFieldLength[t]=o/(r+1)},n.prototype.removeFieldLength=function(e,t,r,n){var i=this._avgFieldLength[t]*r-n;this._avgFieldLength[t]=i/(r-1)},n.prototype.saveStoredFields=function(e,r){var n,i,o=this._options,a=o.storeFields,s=o.extractField;if(null!=a&&0!==a.length){var l=this._storedFields.get(e);null==l&&this._storedFields.set(e,l={});try{for(var u=t(a),h=u.next();!h.done;h=u.next()){var c=h.value,d=s(r,c);void 0!==d&&(l[c]=d)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}},n}(),v=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},w=((n={}).or=function(e,r){var n,i;try{for(var o=t(r.keys()),a=o.next();!a.done;a=o.next()){var s=a.value,l=e.get(s);if(null==l)e.set(s,r.get(s));else{var u=r.get(s),h=u.score,c=u.terms,d=u.match;l.score=l.score+h,l.match=Object.assign(l.match,d),F(l.terms,c)}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e},n.and=function(e,r){var n,i,o=new Map;try{for(var a=t(r.keys()),s=a.next();!s.done;s=a.next()){var l=s.value,u=e.get(l);if(null!=u){var h=r.get(l),c=h.score,d=h.terms,p=h.match;F(u.terms,d),o.set(l,{score:u.score+c,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o},n.and_not=function(e,r){var n,i;try{for(var o=t(r.keys()),a=o.next();!a.done;a=o.next()){var s=a.value;e.delete(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e},n),S=function(e,t,r,n,i){return Math.log(1+(r-t+.5)/(t+.5))*(.5+2.2*e/(e+1.2*(1-.7+.7*n/i)))},M=function(e){return function(t,r,n){return{term:t,fuzzy:"function"==typeof e.fuzzy?e.fuzzy(t,r,n):e.fuzzy||!1,prefix:"function"==typeof e.prefix?e.prefix(t,r,n):!0===e.prefix}}},T={idField:"id",extractField:function(e,t){return e[t]},tokenize:function(e,t){return e.split(I)},processTerm:function(e,t){return e.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},E={combineWith:b,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},R={prefix:function(e,t,r){return t===r.length-1}},A=function(e,t){e.includes(t)||e.push(t)},F=function(e,r){var n,i;try{for(var o=t(r),a=o.next();!a.done;a=o.next()){var s=a.value;e.includes(s)||e.push(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},k=function(e,t){var r=e.score;return t.score-r},x=function(){return new Map},O=function(e){var r,n,i=new Map;try{for(var o=t(Object.keys(e)),a=o.next();!a.done;a=o.next()){var s=a.value;i.set(parseInt(s,10),e[s])}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},I=/[\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 _},"object"==typeof e&&void 0!==t?t.exports=n():"function"==typeof define&&define.amd?define(n):(r="undefined"!=typeof globalThis?globalThis:r||self).MiniSearch=n()}));Po(exports,{Mappedin:()=>Ln,MappedinDestinationSet:()=>ua,OfflineSearch:()=>lo,getVenue:()=>Ms,getVenueBundle:()=>_s,initialize:()=>yp}),j(),j();var jc=Ne(ml());j(),j(),j();var bl=Ne(gl());j();var yl=class{constructor({origin:e,destination:t,vortex:r,elevationDelta:n=0,distance:i=0,angle:o=0}){let a,s;if(p(this,"origin"),p(this,"destination"),p(this,"vortex"),p(this,"distance"),p(this,"angle"),p(this,"weight"),this.origin=e,this.destination=t,this.vortex=r,this.distance=i,this.angle=o,r?(this.distance=0,this.angle=0,a=void 0!==r.weight&&r.weight>0?r.weight:"elevator"===r.type?2e3:1e3,s=r.multiplier&&r.multiplier>=1?r.multiplier:1,this.weight=n*s+a):(a=t.weight&&t.weight>=0?t.weight:0,s=t.multiplier&&t.multiplier>=1?t.multiplier:1,this.weight=this.distance*s+a),isNaN(this.angle))throw new Error("nan angle")}},Si=yl;function Kd(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale||1);try{if(!e.georeference)throw new Error(`map ${e.name||e.shortName||e.id} does not have a georeference field`);if(e.georeference.length<3)throw new Error(`map ${e.name||e.shortName||e.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let t=e.georeference[0],r=e.georeference[2],n=(0,bl.getDistance)({latitude:t.target.x,longitude:t.target.y},{latitude:r.target.x,longitude:r.target.y}),i=t.control.x-r.control.x,o=t.control.y-r.control.y;return Math.sqrt(i*i+o*o)/n}catch(e){return console.error(e),1}}function Zd(e,t){let r=e.x-t.x,n=e.y-t.y;return(Math.atan2(n,r)+2.5*Math.PI)%(2*Math.PI)}var Ge,lt,cn,kl=class{constructor({nodes:e,vortexes:t,maps:r,showVortexNames:n=!1}){p(this,"edges"),p(this,"nodesById"),p(this,"mapsById"),this.edges={},this.mapsById=r.map((e=>({...e,_scale:Kd(e)}))).reduce(((e,t)=>(e[t.id]=t,e)),{});let i=e.filter((e=>!!this.mapsById[e.map])).map((e=>({...e,paths:e.paths?e.paths.filter((({map:t})=>t===e.map)):[]})));this.nodesById=i.reduce(((e,t)=>(e[t.id]=t,e)),{});for(let e in this.nodesById)this.nodesById.hasOwnProperty(e)&&(this.nodesById[e].paths=this.nodesById[e].paths.filter((({node:e})=>!!this.nodesById[e])));let o=t.map((e=>({...e,name:n?e.name:e.type,nodes:e.nodes?e.nodes.filter((e=>!!this.nodesById[e])):[]})));i.forEach((e=>{this.edges[e.id]=e.paths.map((({node:t})=>{let r=this.nodesById[t];return new Si({angle:Zd(e,r),destination:r,distance:this.getDistance(e,r),origin:e})}))})),o.forEach((e=>{if(null==e.nodes||0===e.nodes.length)return;let t=0;for(;t<e.nodes.length-1;){let r=this.nodesById[e.nodes[t]];if(t++,null==r)continue;let n=t;for(;n<e.nodes.length;){let t=this.nodesById[e.nodes[n]];if(n++,null==t)continue;let i=this.mapsById[r.map].elevation||0,o=this.mapsById[t.map].elevation||0,a=Math.abs(i-o);this.edges[r.id].push(new Si({destination:t,elevationDelta:a,origin:r,vortex:e})),this.edges[t.id].push(new Si({destination:r,elevationDelta:a,origin:t,vortex:e}))}}}))}aStar(e,t,r){let n=e.map((e=>this.nodesById[e])).filter((e=>e)),i=t.map((e=>this.nodesById[e])).filter((e=>e));if(0===n.length||0===i.length)return[];let o=[],a={},s={};for(n.forEach((e=>{let t=this.getShortestEuclideanDistance(e,i);o.push({origin:e,priority:t}),a[e.id]=null,s[e.id]=0})),o.sort(((e,t)=>e.priority-t.priority));o.length>0;){let e=o[0];if(i.includes(e.origin)){let t=[],r=a[e.origin.id];for(;null!=r;){t.push(r);let e=a[r.origin.id];r=null!=e?e:null}return t.reverse()}for(let t of this.edges[e.origin.id]){let n=t.vortex&&!1===t.vortex.accessible;if(r&&(n||!1===t.origin.accessible||!1===t.destination.accessible))continue;let l=s[e.origin.id]+t.weight;if(null==s[t.destination.id]||l<s[t.destination.id]){s[t.destination.id]=l;let e=l+this.getShortestEuclideanDistance(t.destination,i);o.push({origin:t.destination,priority:e}),a[t.destination.id]=t}}o.splice(0,1),o.sort(((e,t)=>e.priority-t.priority))}return[]}getDistance(e,t){let r,n=e.x-t.x,i=e.y-t.y,o=n*n+i*i;return r=null==this.mapsById[e.map]?1:this.mapsById[e.map]._scale,Math.sqrt(o)/r}getShortestEuclideanDistance(e,t){return t.reduce(((t,r)=>{let n=this.getDistance(e,r);return Math.min(t,n)}),Number.MAX_VALUE)}},Bo=kl;function eh(e){switch(e){case cn.DOWN:case cn.UP:return`${e} `;default:return""}}j(),j(),function(e){e.DEPARTURE="Departure",e.TAKEVORTEX="TakeVortex",e.EXITVORTEX="ExitVortex",e.TURN="Turn",e.ARRIVAL="Arrival"}(Ge||(Ge={})),function(e){e.STRAIGHT="Straight",e.RIGHT="Right",e.SLIGHTRIGHT="SlightRight",e.LEFT="Left",e.SLIGHTLEFT="SlightLeft"}(lt||(lt={})),function(e){e.UP="up",e.DOWN="down",e.NONE="none"}(cn||(cn={}));var Ti,vl=class{constructor({origin:e,action:t,distance:r,atLocation:n,instruction:i}){p(this,"node"),p(this,"instruction"),p(this,"action"),p(this,"atLocation"),p(this,"type"),p(this,"distance",0),this.node=e,this.action=t,this.distance=r||0,this.atLocation=n,this.instruction="",i?this.instruction=i:(null!=t&&t.type===Ge.DEPARTURE?this.instruction=null!=n?`Depart from ${n.name}`:"Depart from current location":null!=t&&t.type===Ge.ARRIVAL?this.instruction=null!=n?`Arrive at ${n.name}`:"Arrive at destination":null!=t&&t.type===Ge.TAKEVORTEX?this.instruction=`Take ${n&&n.name} ${eh(t.direction)}to ${t.toMap.name}`:null!=t&&t.type===Ge.EXITVORTEX?this.instruction=`Exit ${n&&n.name} at ${t.toMap.name}`:null!=t&&t.bearing===lt.RIGHT?this.instruction="Turn right":null!=t&&t.bearing===lt.SLIGHTRIGHT?this.instruction="Turn slightly right":null!=t&&t.bearing===lt.STRAIGHT?this.instruction="Head straight":null!=t&&t.bearing===lt.SLIGHTLEFT?this.instruction="Turn slightly left":null!=t&&t.bearing===lt.LEFT&&(this.instruction="Turn left"),null!=t&&t.type===Ge.TURN&&n&&(this.instruction+=` at ${n.name}`))}},dn=vl;(Ti||(Ti={})).NO_VALID_PATH="No Valid Path Available";var ji=.1*Math.PI;function Ri(e,t){return((t-e+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}var wl=class{constructor({locations:e,nodes:t,vortexes:r,maps:n,showVortexNames:i}){p(this,"graph"),p(this,"locationsByNodeId"),this.graph=new Bo({maps:n,nodes:t,showVortexNames:i,vortexes:r}),this.locationsByNodeId=e.reduce(((e,t)=>(t.nodes&&t.nodes.forEach((r=>{e[r.node]=t})),t.polygons&&t.polygons.forEach((r=>{r.entrances&&r.entrances.forEach((r=>{e[r]=t}))})),e)),{})}getClosestLocationInRay(e,t=.5*Math.PI,r=10){let n=0,i=0,o=e;for(;Math.abs(n)<t&&i<r;){let e=this.graph.edges[o.destination.id],a=null,s=0;for(let t of e)if(t.distance>0)if(null!=a){let e=-Ri(o.angle,t.angle);Math.abs(e)<Math.abs(s)&&(a=t,s=e)}else a=t,s=-Ri(o.angle,t.angle);if(null==a)return null;{if(Math.abs(s)>=t||(n+=s,i+=a.distance,Math.abs(n)>=t||i>r))return null;let e=this.locationsByNodeId[a.destination.id];if(null!=e)return e;o=a}}return null}getDirections({originIds:e,destinationNodeIds:t,accessible:r,departFrom:n,arriveAt:i}){let o=this.graph.aStar(e,t,r);if(0===o.length)return{distance:0,instructions:[new dn({distance:0,instruction:Ti.NO_VALID_PATH})],path:[]};let a=0,s=new Array(o.length+1);for(let e=0;e<o.length;e++)s[e]=o[e].origin;s[o.length]=o[o.length-1].destination;let l=[],u=null,h=null,c=0,d=0;for(let e=0;e<o.length;e++){let t=o[e],r=t.origin,s=t.destination;if(a+=t.distance,c+=(null==h?void 0:h.distance)||0,0===e&&l.push(new dn({action:{type:Ge.DEPARTURE},atLocation:n,distance:0,origin:r})),null!=t.vortex){let e=this.graph.mapsById[r.map],n=this.graph.mapsById[s.map],i=cn.NONE;if(null!=e.elevation&&null!=n.elevation){let t=e.elevation-n.elevation;t>0?i=cn.DOWN:t<0&&(i=cn.UP)}l.push(new dn({action:{direction:i,fromMap:e,toMap:n,type:Ge.TAKEVORTEX},atLocation:t.vortex,distance:c,origin:r})),d+=c,c=0}else if(null!=u&&null!=h)if(null!=h.vortex){let e=this.graph.mapsById[u.map],t=this.graph.mapsById[h.destination.map];l.push(new dn({action:{fromMap:e,toMap:t,type:Ge.EXITVORTEX},atLocation:h.vortex,distance:c,origin:r})),d+=c,c=0}else{let e=this.graph.edges[r.id].filter((e=>e.destination!==u&&e.destination!==t.destination));if(e.length>0){let n=-Ri(h.angle,t.angle),i=e.reduce(((e,r)=>{let n=-Ri(t.angle,r.angle);return Math.min(e,Math.abs(n))}),Math.PI);if(Math.abs(n)>=ji||Math.abs(i)<=ji){let e;e=n<=-Math.PI/4?lt.RIGHT:n<=-ji?lt.SLIGHTRIGHT:n<=ji?lt.STRAIGHT:n<=Math.PI/4?lt.SLIGHTLEFT:lt.LEFT;let t=this.locationsByNodeId[r.id];if(t||(t=this.getClosestLocationInRay(h,.5*Math.PI,10)),null!=t){let n=new dn({action:{bearing:e,referencePosition:"At",type:Ge.TURN},atLocation:t,distance:c,origin:r});n.type=e,l.push(n)}else l.push(new dn({action:{bearing:e,referencePosition:"At",type:Ge.TURN},distance:c,origin:r}));d+=c,c=0}}}e===o.length-1&&(l.push(new dn({action:{type:Ge.ARRIVAL},atLocation:i,distance:a-d<0?0:a-d,origin:t.destination})),d+=c,c=0),u=r,h=t}let p=[],f=null;for(let e=l.length-1;e>=0;e--){let t=l[e],{action:r}=t;r&&r.type===Ge.TAKEVORTEX?(f=t.node,p.unshift(t)):r&&r.type===Ge.TURN&&null!=f?this.graph.getDistance(t.node,f)>5&&p.unshift(t):p.unshift(t)}return{distance:a,instructions:p,path:s}}},Lo=wl;function Ml(e){let t=+this._x.call(null,e),r=+this._y.call(null,e);return _l(this.cover(t,r),t,r,e)}function _l(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,o,a,s,l,u,h,c,d,p=e._root,f={data:n},y=e._x0,g=e._y0,m=e._x1,b=e._y1;if(!p)return e._root=f,e;for(;p.length;)if((u=t>=(o=(y+m)/2))?y=o:m=o,(h=r>=(a=(g+b)/2))?g=a:b=a,i=p,!(p=p[c=h<<1|u]))return i[c]=f,e;if(s=+e._x.call(null,p.data),l=+e._y.call(null,p.data),t===s&&r===l)return f.next=p,i?i[c]=f:e._root=f,e;do{i=i?i[c]=new Array(4):e._root=new Array(4),(u=t>=(o=(y+m)/2))?y=o:m=o,(h=r>=(a=(g+b)/2))?g=a:b=a}while((c=h<<1|u)==(d=(l>=a)<<1|s>=o));return i[d]=p,i[c]=f,e}function Sl(e){var t,r,n,i,o=e.length,a=new Array(o),s=new Array(o),l=1/0,u=1/0,h=-1/0,c=-1/0;for(r=0;r<o;++r)isNaN(n=+this._x.call(null,t=e[r]))||isNaN(i=+this._y.call(null,t))||(a[r]=n,s[r]=i,n<l&&(l=n),n>h&&(h=n),i<u&&(u=i),i>c&&(c=i));if(l>h||u>c)return this;for(this.cover(l,u).cover(h,c),r=0;r<o;++r)_l(this,a[r],s[r],e[r]);return this}function Tl(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,o=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,o=(n=Math.floor(t))+1;else{for(var a,s,l=i-r||1,u=this._root;r>e||e>=i||n>t||t>=o;)switch(s=(t<n)<<1|e<r,a=new Array(4),a[s]=u,u=a,l*=2,s){case 0:i=r+l,o=n+l;break;case 1:r=i-l,o=n+l;break;case 2:i=r+l,n=o-l;break;case 3:r=i-l,n=o-l}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=o,this}function jl(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e}function Rl(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Je(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function xl(e,t,r){var n,i,o,a,s,l,u,h=this._x0,c=this._y0,d=this._x1,p=this._y1,f=[],y=this._root;for(y&&f.push(new Je(y,h,c,d,p)),null==r?r=1/0:(h=e-r,c=t-r,d=e+r,p=t+r,r*=r);l=f.pop();)if(!(!(y=l.node)||(i=l.x0)>d||(o=l.y0)>p||(a=l.x1)<h||(s=l.y1)<c))if(y.length){var g=(i+a)/2,m=(o+s)/2;f.push(new Je(y[3],g,m,a,s),new Je(y[2],i,m,g,s),new Je(y[1],g,o,a,m),new Je(y[0],i,o,g,m)),(u=(t>=m)<<1|e>=g)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=l)}else{var b=e-+this._x.call(null,y.data),_=t-+this._y.call(null,y.data),v=b*b+_*_;if(v<r){var w=Math.sqrt(r=v);h=e-w,c=t-w,d=e+w,p=t+w,n=y.data}}return n}function El(e){if(isNaN(o=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,r,n,i,o,a,s,l,u,h,c,d,p=this._root,f=this._x0,y=this._y0,g=this._x1,m=this._y1;if(!p)return this;if(p.length)for(;;){if((u=o>=(s=(f+g)/2))?f=s:g=s,(h=a>=(l=(y+m)/2))?y=l:m=l,t=p,!(p=p[c=h<<1|u]))return this;if(!p.length)break;(t[c+1&3]||t[c+2&3]||t[c+3&3])&&(r=t,d=c)}for(;p.data!==e;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):t?(i?t[c]=i:delete t[c],(p=t[0]||t[1]||t[2]||t[3])&&p===(t[3]||t[2]||t[1]||t[0])&&!p.length&&(r?r[d]=p:this._root=p),this):(this._root=i,this)}function Al(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}function Il(){return this._root}function Ol(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e}function zl(e){var t,r,n,i,o,a,s=[],l=this._root;for(l&&s.push(new Je(l,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(l=t.node,n=t.x0,i=t.y0,o=t.x1,a=t.y1)&&l.length){var u=(n+o)/2,h=(i+a)/2;(r=l[3])&&s.push(new Je(r,u,h,o,a)),(r=l[2])&&s.push(new Je(r,n,h,u,a)),(r=l[1])&&s.push(new Je(r,u,i,o,h)),(r=l[0])&&s.push(new Je(r,n,i,u,h))}return this}function Cl(e){var t,r=[],n=[];for(this._root&&r.push(new Je(this._root,this._x0,this._y0,this._x1,this._y1));t=r.pop();){var i=t.node;if(i.length){var o,a=t.x0,s=t.y0,l=t.x1,u=t.y1,h=(a+l)/2,c=(s+u)/2;(o=i[0])&&r.push(new Je(o,a,s,h,c)),(o=i[1])&&r.push(new Je(o,h,s,l,c)),(o=i[2])&&r.push(new Je(o,a,c,h,u)),(o=i[3])&&r.push(new Je(o,h,c,l,u))}n.push(t)}for(;t=n.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this}function Pl(e){return e[0]}function Fl(e){return arguments.length?(this._x=e,this):this._x}function Nl(e){return e[1]}function Bl(e){return arguments.length?(this._y=e,this):this._y}function Ya(e,t,r){var n=new Do(null==t?Pl:t,null==r?Nl:r,NaN,NaN,NaN,NaN);return null==e?n:n.addAll(e)}function Do(e,t,r,n,i,o){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=o,this._root=void 0}function Ll(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j(),j();var rt=Ya.prototype=Do.prototype;rt.copy=function(){var e,t,r=new Do(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=Ll(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(t=n.source[i])&&(t.length?e.push({source:t,target:n.target[i]=new Array(4)}):n.target[i]=Ll(t));return r},rt.add=Ml,rt.addAll=Sl,rt.cover=Tl,rt.data=jl,rt.extent=Rl,rt.find=xl,rt.remove=El,rt.removeAll=Al,rt.root=Il,rt.size=Ol,rt.visit=zl,rt.visitAfter=Cl,rt.x=Fl,rt.y=Bl;var Ft,Ue,On=class{constructor(e){F(this,Ft,void 0),p(this,"categories"),p(this,"locations"),p(this,"vortexes"),p(this,"maps"),p(this,"nodes"),p(this,"polygons"),p(this,"events"),p(this,"mapGroups"),p(this,"locationStates"),p(this,"locationRankings"),p(this,"rankings"),F(this,Ue,{}),D(this,Ft,e)}get polygonsByMapId(){if(f(this,Ue).polygonsByMapId)return f(this,Ue).polygonsByMapId;let e,t={};for(let r=0,n=f(this,Ft).polygons.length;r<n;++r)e=f(this,Ft).polygons[r],t[e.map]||(t[e.map]=[]),t[e.map].push(e);return f(this,Ue).polygonsByMapId=t,f(this,Ue).polygonsByMapId}get nodesByMapId(){if(f(this,Ue).nodesByMapId)return f(this,Ue).nodesByMapId;let e,t={};for(let r=0,n=f(this,Ft).nodes.length;r<n;++r)e=f(this,Ft).nodes[r],t[e.map]||(t[e.map]=[]),t[e.map].push(e);return f(this,Ue).nodesByMapId=t,f(this,Ue).nodesByMapId}findNearestNodeOnMap(e,t){if(f(this,Ue).nodeTreesByMap||(f(this,Ue).nodeTreesByMap=new Map),!f(this,Ue).nodeTreesByMap.has(e)){let t=this.nodesByMapId[e],r=Ya();r.x((e=>e.x)),r.y((e=>e.y)),r.addAll(t),f(this,Ue).nodeTreesByMap.set(e,r)}return f(this,Ue).nodeTreesByMap.get(e).find(t.x,t.y)}get locationsByMapId(){if(f(this,Ue).locationsByMapId)return f(this,Ue).locationsByMapId;let e,t={};for(let r=0,n=f(this,Ft).locations.length;r<n;++r){e=f(this,Ft).locations[r];for(let r=0,n=e.polygons.length;r<n;++r)t[e.polygons[r].map]||(t[e.polygons[r].map]=[]),t[e.polygons[r].map].push(e)}return f(this,Ue).locationsByMapId=t,f(this,Ue).locationsByMapId}static create(e){return On.instances.has(e)||On.instances.set(e,new On(e)),On.instances.get(e)}static clear(){On.instances.clear()}},qo=On;Ft=new WeakMap,Ue=new WeakMap,p(qo,"instances",new Map);var mt=qo;j(),j(),j(),j();var Dl=" ",it=class{static get separator(){return Dl}static set separator(e){Dl=e}static parse(e){if(!isNaN(parseFloat(e))&&isFinite(e))return Number(e);let t=String(e).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;let r=null;switch(t.length){case 3:r=t[0]/1+t[1]/60+t[2]/3600;break;case 2:r=t[0]/1+t[1]/60;break;case 1:r=t[0];break;default:return NaN}return/^-|[WS]$/i.test(e.trim())&&(r=-r),Number(r)}static toDms(e,t="d",r){if(isNaN(e)||"string"==typeof e&&""==e.trim()||"boolean"==typeof e||e==1/0||null==e)return null;if(void 0===r)switch(t){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:t="d",r=4}e=Math.abs(e);let n=null,i=null,o=null,a=null;switch(t){default:case"d":case"deg":i=e.toFixed(r),i<100&&(i="0"+i),i<10&&(i="0"+i),n=i+"°";break;case"dm":case"deg+min":i=Math.floor(e),o=(60*e%60).toFixed(r),60==o&&(o=(0).toFixed(r),i++),i=("000"+i).slice(-3),o<10&&(o="0"+o),n=i+"°"+it.separator+o+"′";break;case"dms":case"deg+min+sec":i=Math.floor(e),o=Math.floor(3600*e/60)%60,a=(3600*e%60).toFixed(r),60==a&&(a=(0).toFixed(r),o++),60==o&&(o=0,i++),i=("000"+i).slice(-3),o=("00"+o).slice(-2),a<10&&(a="0"+a),n=i+"°"+it.separator+o+"′"+it.separator+a+"″"}return n}static toLat(e,t,r){let n=it.toDms(it.wrap90(e),t,r);return null===n?"–":n.slice(1)+it.separator+(e<0?"S":"N")}static toLon(e,t,r){let n=it.toDms(it.wrap180(e),t,r);return null===n?"–":n+it.separator+(e<0?"W":"E")}static toBrng(e,t,r){let n=it.toDms(it.wrap360(e),t,r);return null===n?"–":n.replace("360","0")}static fromLocale(e){let t=123456.789.toLocaleString(),r={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(r.thousands,"⁜").replace(r.decimal,".").replace("⁜",",")}static toLocale(e){let t=123456.789.toLocaleString(),r={thousands:t.slice(3,4),decimal:t.slice(7,8)};return e.replace(/,([0-9])/,"⁜$1").replace(".",r.decimal).replace("⁜",r.thousands)}static compassPoint(e,t=3){if(![1,2,3].includes(Number(t)))throw new RangeError(`invalid precision ‘${t}’`);e=it.wrap360(e);let r=4*2**(t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(e*r/360)%r*16/r]}static wrap360(e){return 0<=e&&e<360?e:(e%360+360)%360}static wrap180(e){return-180<e&&e<=180?e:(e+540)%360-180}static wrap90(e){return-90<=e&&e<=90?e:Math.abs((e%360+270)%360-180)-90}};Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var me=it,Fe=Math.PI,Q=class{constructor(e,t){if(isNaN(e))throw new TypeError(`invalid lat ‘${e}’`);if(isNaN(t))throw new TypeError(`invalid lon ‘${t}’`);this._lat=me.wrap90(Number(e)),this._lon=me.wrap180(Number(t))}get lat(){return this._lat}get latitude(){return this._lat}set lat(e){if(this._lat=isNaN(e)?me.wrap90(me.parse(e)):me.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${e}’`)}set latitude(e){if(this._lat=isNaN(e)?me.wrap90(me.parse(e)):me.wrap90(Number(e)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${e}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(e){if(this._lon=isNaN(e)?me.wrap180(me.parse(e)):me.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${e}’`)}set lng(e){if(this._lon=isNaN(e)?me.wrap180(me.parse(e)):me.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${e}’`)}set longitude(e){if(this._lon=isNaN(e)?me.wrap180(me.parse(e)):me.wrap180(Number(e)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${e}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...e){if(0==e.length)throw new TypeError("invalid (empty) point");if(null===e[0]||null===e[1])throw new TypeError("invalid (null) point");let t,r;if(2==e.length&&([t,r]=e,t=me.wrap90(me.parse(t)),r=me.wrap180(me.parse(r)),isNaN(t)||isNaN(r)))throw new TypeError(`invalid point ‘${e.toString()}’`);if(1==e.length&&"string"==typeof e[0]&&([t,r]=e[0].split(","),t=me.wrap90(me.parse(t)),r=me.wrap180(me.parse(r)),isNaN(t)||isNaN(r)))throw new TypeError(`invalid point ‘${e[0]}’`);if(1==e.length&&"object"==typeof e[0]){let n=e[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[r,t]=n.coordinates:(null!=n.latitude&&(t=n.latitude),null!=n.lat&&(t=n.lat),null!=n.longitude&&(r=n.longitude),null!=n.lng&&(r=n.lng),null!=n.lon&&(r=n.lon),t=me.wrap90(me.parse(t)),r=me.wrap180(me.parse(r))),isNaN(t)||isNaN(r))throw new TypeError(`invalid point ‘${JSON.stringify(e[0])}’`)}if(isNaN(t)||isNaN(r))throw new TypeError(`invalid point ‘${e.toString()}’`);return new Q(t,r)}distanceTo(e,t=6371e3){if(e instanceof Q||(e=Q.parse(e)),isNaN(t))throw new TypeError(`invalid radius ‘${t}’`);let r=t,n=this.lat.toRadians(),i=this.lon.toRadians(),o=e.lat.toRadians(),a=o-n,s=e.lon.toRadians()-i,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(n)*Math.cos(o)*Math.sin(s/2)*Math.sin(s/2);return r*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(e){if(e instanceof Q||(e=Q.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),r=e.lat.toRadians(),n=(e.lon-this.lon).toRadians(),i=Math.cos(t)*Math.sin(r)-Math.sin(t)*Math.cos(r)*Math.cos(n),o=Math.sin(n)*Math.cos(r),a=Math.atan2(o,i).toDegrees();return me.wrap360(a)}finalBearingTo(e){e instanceof Q||(e=Q.parse(e));let t=e.initialBearingTo(this)+180;return me.wrap360(t)}midpointTo(e){e instanceof Q||(e=Q.parse(e));let t=this.lat.toRadians(),r=this.lon.toRadians(),n=e.lat.toRadians(),i=(e.lon-this.lon).toRadians(),o=Math.cos(t),a=0,s=Math.sin(t),l={x:o+Math.cos(n)*Math.cos(i),y:a+Math.cos(n)*Math.sin(i),z:s+Math.sin(n)},u=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),h=r+Math.atan2(l.y,l.x),c=u.toDegrees(),d=h.toDegrees();return new Q(c,d)}intermediatePointTo(e,t){if(e instanceof Q||(e=Q.parse(e)),this.equals(e))return new Q(this.lat,this.lon);let r=this.lat.toRadians(),n=this.lon.toRadians(),i=e.lat.toRadians(),o=e.lon.toRadians(),a=i-r,s=o-n,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(r)*Math.cos(i)*Math.sin(s/2)*Math.sin(s/2),u=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),h=Math.sin((1-t)*u)/Math.sin(u),c=Math.sin(t*u)/Math.sin(u),d=h*Math.cos(r)*Math.cos(n)+c*Math.cos(i)*Math.cos(o),p=h*Math.cos(r)*Math.sin(n)+c*Math.cos(i)*Math.sin(o),f=h*Math.sin(r)+c*Math.sin(i),y=Math.atan2(f,Math.sqrt(d*d+p*p)),g=Math.atan2(p,d),m=y.toDegrees(),b=g.toDegrees();return new Q(m,b)}destinationPoint(e,t,r=6371e3){let n=e/r,i=Number(t).toRadians(),o=this.lat.toRadians(),a=this.lon.toRadians(),s=Math.sin(o)*Math.cos(n)+Math.cos(o)*Math.sin(n)*Math.cos(i),l=Math.asin(s),u=Math.sin(i)*Math.sin(n)*Math.cos(o),h=Math.cos(n)-Math.sin(o)*s,c=a+Math.atan2(u,h),d=l.toDegrees(),p=c.toDegrees();return new Q(d,p)}static intersection(e,t,r,n){if(e instanceof Q||(e=Q.parse(e)),r instanceof Q||(r=Q.parse(r)),isNaN(t))throw new TypeError(`invalid brng1 ‘${t}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);let i=e.lat.toRadians(),o=e.lon.toRadians(),a=r.lat.toRadians(),s=r.lon.toRadians(),l=Number(t).toRadians(),u=Number(n).toRadians(),h=a-i,c=s-o,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(i)*Math.cos(a)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new Q(e.lat,e.lon);let p=(Math.sin(a)-Math.sin(i)*Math.cos(d))/(Math.sin(d)*Math.cos(i)),f=(Math.sin(i)-Math.sin(a)*Math.cos(d))/(Math.sin(d)*Math.cos(a)),y=Math.acos(Math.min(Math.max(p,-1),1)),g=Math.acos(Math.min(Math.max(f,-1),1)),m=l-(Math.sin(s-o)>0?y:2*Fe-y),b=(Math.sin(s-o)>0?2*Fe-g:g)-u;if(0==Math.sin(m)&&0==Math.sin(b)||Math.sin(m)*Math.sin(b)<0)return null;let _=-Math.cos(m)*Math.cos(b)+Math.sin(m)*Math.sin(b)*Math.cos(d),v=Math.atan2(Math.sin(d)*Math.sin(m)*Math.sin(b),Math.cos(b)+Math.cos(m)*_),w=Math.asin(Math.min(Math.max(Math.sin(i)*Math.cos(v)+Math.cos(i)*Math.sin(v)*Math.cos(l),-1),1)),S=o+Math.atan2(Math.sin(l)*Math.sin(v)*Math.cos(i),Math.cos(v)-Math.sin(i)*Math.sin(w)),M=w.toDegrees(),T=S.toDegrees();return new Q(M,T)}crossTrackDistanceTo(e,t,r=6371e3){e instanceof Q||(e=Q.parse(e)),t instanceof Q||(t=Q.parse(t));let n=r;if(this.equals(e))return 0;let i=e.distanceTo(this,n)/n,o=e.initialBearingTo(this).toRadians(),a=e.initialBearingTo(t).toRadians();return Math.asin(Math.sin(i)*Math.sin(o-a))*n}alongTrackDistanceTo(e,t,r=6371e3){e instanceof Q||(e=Q.parse(e)),t instanceof Q||(t=Q.parse(t));let n=r;if(this.equals(e))return 0;let i=e.distanceTo(this,n)/n,o=e.initialBearingTo(this).toRadians(),a=e.initialBearingTo(t).toRadians(),s=Math.asin(Math.sin(i)*Math.sin(o-a));return Math.acos(Math.cos(i)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(a-o))*n}maxLatitude(e){let t=Number(e).toRadians(),r=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(t)*Math.cos(r))).toDegrees()}static crossingParallels(e,t,r){if(e.equals(t))return null;let n=Number(r).toRadians(),i=e.lat.toRadians(),o=e.lon.toRadians(),a=t.lat.toRadians(),s=t.lon.toRadians()-o,l=Math.sin(i)*Math.cos(a)*Math.cos(n)*Math.sin(s),u=Math.sin(i)*Math.cos(a)*Math.cos(n)*Math.cos(s)-Math.cos(i)*Math.sin(a)*Math.cos(n),h=Math.cos(i)*Math.cos(a)*Math.sin(n)*Math.sin(s);if(h*h>l*l+u*u)return null;let c=Math.atan2(-u,l),d=Math.acos(h/Math.sqrt(l*l+u*u)),p=o+c+d,f=(o+c-d).toDegrees(),y=p.toDegrees();return{lon1:me.wrap180(f),lon2:me.wrap180(y)}}rhumbDistanceTo(e,t=6371e3){e instanceof Q||(e=Q.parse(e));let r=t,n=this.lat.toRadians(),i=e.lat.toRadians(),o=i-n,a=Math.abs(e.lon-this.lon).toRadians();Math.abs(a)>Fe&&(a=a>0?-(2*Fe-a):2*Fe+a);let s=Math.log(Math.tan(i/2+Fe/4)/Math.tan(n/2+Fe/4)),l=Math.abs(s)>1e-11?o/s:Math.cos(n);return Math.sqrt(o*o+l*l*a*a)*r}rhumbBearingTo(e){if(e instanceof Q||(e=Q.parse(e)),this.equals(e))return NaN;let t=this.lat.toRadians(),r=e.lat.toRadians(),n=(e.lon-this.lon).toRadians();Math.abs(n)>Fe&&(n=n>0?-(2*Fe-n):2*Fe+n);let i=Math.log(Math.tan(r/2+Fe/4)/Math.tan(t/2+Fe/4)),o=Math.atan2(n,i).toDegrees();return me.wrap360(o)}rhumbDestinationPoint(e,t,r=6371e3){let n=this.lat.toRadians(),i=this.lon.toRadians(),o=Number(t).toRadians(),a=e/r,s=a*Math.cos(o),l=n+s;Math.abs(l)>Fe/2&&(l=l>0?Fe-l:-Fe-l);let u=Math.log(Math.tan(l/2+Fe/4)/Math.tan(n/2+Fe/4)),h=Math.abs(u)>1e-11?s/u:Math.cos(n),c=i+a*Math.sin(o)/h,d=l.toDegrees(),p=c.toDegrees();return new Q(d,p)}rhumbMidpointTo(e){e instanceof Q||(e=Q.parse(e));let t=this.lat.toRadians(),r=this.lon.toRadians(),n=e.lat.toRadians(),i=e.lon.toRadians();Math.abs(i-r)>Fe&&(r+=2*Fe);let o=(t+n)/2,a=Math.tan(Fe/4+t/2),s=Math.tan(Fe/4+n/2),l=Math.tan(Fe/4+o/2),u=((i-r)*Math.log(l)+r*Math.log(s)-i*Math.log(a))/Math.log(s/a);isFinite(u)||(u=(r+i)/2);let h=o.toDegrees(),c=u.toDegrees();return new Q(h,c)}static areaOf(e,t=6371e3){let r=t,n=e[0].equals(e[e.length-1]);n||e.push(e[0]);let i=e.length-1,o=0;for(let t=0;t<i;t++){let r=e[t].lat.toRadians(),n=e[t+1].lat.toRadians(),i=(e[t+1].lon-e[t].lon).toRadians();o+=2*Math.atan2(Math.tan(i/2)*(Math.tan(r/2)+Math.tan(n/2)),1+Math.tan(r/2)*Math.tan(n/2))}(function(e){let t=0,r=e[0].initialBearingTo(e[1]);for(let n=0;n<e.length-1;n++){let i=e[n].initialBearingTo(e[n+1]),o=e[n].finalBearingTo(e[n+1]);t+=(i-r+540)%360-180,t+=(o-i+540)%360-180,r=o}return t+=(e[0].initialBearingTo(e[1])-r+540)%360-180,Math.abs(t)<90})(e)&&(o=Math.abs(o)-2*Fe);let a=Math.abs(o*r*r);return n||e.pop(),a}equals(e){return e instanceof Q||(e=Q.parse(e)),!(Math.abs(this.lat-e.lat)>Number.EPSILON||Math.abs(this.lon-e.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(e="d",t){if(!["d","dm","dms","n"].includes(e))throw new RangeError(`invalid format ‘${e}’`);if("n"==e)return null==t&&(t=4),`${this.lat.toFixed(t)},${this.lon.toFixed(t)}`;return`${me.toLat(this.lat,e,t)}, ${me.toLon(this.lon,e,t)}`}};j(),j(),j();var ua=class{constructor(e){p(this,"destinations",[]),this.destinations=e}};j();var Xa,$t,Ja=class{constructor(e,t){F(this,Xa,void 0),F(this,$t,void 0),p(this,"distance",0),p(this,"path",[]),p(this,"instructions",[]),D(this,$t,e),D(this,Xa,t),this.distance=t.distance,this.instructions=t.instructions.map((e=>{var t,r,n,i,o,a,s,l,u,h,c,d;let p={...e,action:{...e.action},atLocation:(null==(t=e.atLocation)?void 0:t.id)?null==(n=null==(r=f(this,$t))?void 0:r._vortexesById)?void 0:n[e.atLocation.id]:void 0,node:(null==(i=e.node)?void 0:i.id)?null==(a=null==(o=f(this,$t))?void 0:o._nodesById)?void 0:a[e.node.id]:void 0};return((null==(s=p.action)?void 0:s.type)===Ge.TAKEVORTEX||(null==(l=p.action)?void 0:l.type)===Ge.EXITVORTEX)&&(p.action.fromMap=null==(h=f(this,$t)._mapsById)?void 0:h[null==(u=p.action)?void 0:u.fromMap.id],p.action.toMap=null==(d=f(this,$t)._mapsById)?void 0:d[null==(c=p.action)?void 0:c.toMap.id]),p})),this.path=t.path.map((e=>{var t,r;return null==(r=null==(t=f(this,$t))?void 0:t._nodesById)?void 0:r[e.id]}))}toJSON(){return f(this,Xa)}};Xa=new WeakMap,$t=new WeakMap;var pn,hn=class{constructor(e){F(this,pn,void 0),D(this,pn,e)}directionsTo(e,t){if(e instanceof ua){let r=[],n=this;for(let i=0;i<e.destinations.length;i++){let o=e.destinations[i],a=Qa(n),s=Qa(o),l=f(this,pn).navigator.getDirections({originIds:a,destinationNodeIds:s,accessible:(null==t?void 0:t.accessible)||!1}),u=new Ja(f(this,pn),l);r.push(u),n=o}return r}{let r=Qa(this),n=Qa(e),i=f(this,pn).navigator.getDirections({originIds:r,destinationNodeIds:n,accessible:(null==t?void 0:t.accessible)||!1});return new Ja(f(this,pn),i)}}distanceTo(e,t){let r=this.directionsTo(e,t);return(null==r?void 0:r.distance)||0}directionsToCallback(e,t){return this.directionsTo(e,t)}};pn=new WeakMap;var th=0,nh="9999-12-31T00:00:00.000Z";function ah(e,t,r=new Date){if(!e.states)return;let n=r||new Date,i=e.states.find((e=>{let t=new Date(e.start||th),r=new Date(e.end||nh);return t<n&&r>n}));return i?t.find((e=>e.value===i.type)):void 0}var Nt,zn,gt,Ka,Za,er,tr=class extends hn{constructor(e,t){super(e),F(this,Nt,void 0),F(this,zn,void 0),F(this,gt,{}),p(this,"states"),p(this,"id",""),p(this,"name",""),p(this,"type",""),p(this,"description"),p(this,"sortOrder"),p(this,"logo"),p(this,"phone"),p(this,"social"),p(this,"color"),p(this,"shortName"),p(this,"detailsUrl"),p(this,"tags"),p(this,"externalId"),p(this,"showLabelWhenImagePresent"),p(this,"picture"),p(this,"operationHours"),p(this,"siblingGroups"),p(this,"gallery"),p(this,"categories",[]),F(this,Ka,void 0),F(this,Za,[]),F(this,er,void 0),D(this,Nt,e),D(this,zn,t),Object.assign(this,t)}get polygons(){let e=f(this,gt).polygons;if(void 0!==e)return e;let t=[],r=f(this,Ka),n=f(this,Nt)._polygonsById;if(Array.isArray(r))for(let e=0,i=r.length;e<i;++e){let i=n[r[e].id];null!=i&&i.geometry.visible&&t.push(i)}return f(this,gt).polygons=t,t}set polygons(e){D(this,Ka,e)}get rank(){let e=f(this,gt).rank;if(void 0!==e)return e;let t=f(this,Nt).locationRankings;if(!t||!t.locations)return null;let r=t.locations.find((e=>e.ids.find((e=>e===this.id))));return r?(f(this,gt).rank=r.score,r.score):null}get nodes(){let e=f(this,gt).nodes;if(void 0!==e)return e;let t=[],r=f(this,Za),n=f(this,Nt)._nodesById;if(r)for(let e=0,i=r.length;e<i;++e){let i=n[r[e].node];null!=i&&t.push(i)}return f(this,gt).nodes=t,t}set nodes(e){D(this,Za,e)}get parent(){let e=f(this,gt).parent;if(void 0!==e)return e;let t,r=f(this,Nt)._locationsById,n=f(this,er);return void 0!==n&&(t=r[n]),f(this,gt).parent=t,t}set parent(e){D(this,er,e)}get state(){return ah(this,f(this,Nt).locationStates)}clone(){return new tr(f(this,Nt),f(this,zn))}get nodeOperationHours(){let e=f(this,gt).nodeOperationHours;if(void 0!==e)return e;if(null==this.nodes)return{};let t=f(this,zn).nodes.reduce(((e,t)=>(null!=t.operationHours&&(e[t.node]=t.operationHours),e)),{});return f(this,gt).nodeOperationHours=t,t}static hydrate(e,t){return e.map((e=>new tr(t,e)))}static async fetch(e){let t=e.options.things.locations.slice();e.options.things.categories&&Le(t,"categories"),e.options.things.nodes&&Le(t,"nodes"),e.options.things.polygons&&Le(t,"polygons"),e.options.things.locationStates&&Le(t,"states");let r={fields:t,venue:e.options.venue};try{let t=await Be(e.options,"location",r);return e.options.includeHidden||(t=t.filter((e=>!e.hidden))),t.map((t=>new tr(e,t)))}catch(e){return console.error("Fetch Locations:",e),[]}}toJSON(){let e=f(this,zn);return delete e.color,e}},fn=tr;Nt=new WeakMap,zn=new WeakMap,gt=new WeakMap,Ka=new WeakMap,Za=new WeakMap,er=new WeakMap,j();var Cn,nr,Bt,ar,xi=class extends hn{constructor(e,t){super(e),F(this,Cn,void 0),F(this,nr,void 0),F(this,Bt,{}),p(this,"geometry"),p(this,"image"),p(this,"holes"),p(this,"textures"),p(this,"material"),p(this,"label"),p(this,"id",""),p(this,"map",""),p(this,"layer"),p(this,"layerId"),p(this,"name"),p(this,"externalId"),p(this,"vertexes"),p(this,"canvasBounds"),F(this,ar,void 0),D(this,Cn,e),D(this,nr,t),Object.assign(this,t)}get locations(){let e=f(this,Bt).locations;if(void 0!==e)return e;let t=[],r=mt.instances.get(f(this,Cn)).locationsByMapId[this.map],{id:n}=this;for(let e=0,i=r.length;e<i;++e){let i=r[e],o=i.polygons;if(Array.isArray(o))for(let e=0,r=o.length;e<r;++e)if(o[e].id===n){t.push(i);break}}return f(this,Bt).locations=t,t}get entrances(){let e=f(this,Bt).entrances;if(void 0!==e)return e;let t=[],r=f(this,ar),n=f(this,Cn)._nodesById;if(Array.isArray(r)){for(let e=0,i=r.length;e<i;++e){let i=n[r[e].id];null!=i&&t.push(i)}return f(this,Bt).entrances=t,t}return[]}set entrances(e){D(this,ar,e)}get rank(){let e=f(this,Bt).rank;if(void 0!==e)return e;let{rankings:t}=f(this,Cn);if(!t||!t.polygons)return null;let r=t.polygons.find((e=>e.polygonId===this.id));return r?(f(this,Bt).rank={score:r.score,node:r.entranceNodeId},{score:r.score,node:r.entranceNodeId}):(f(this,Bt).rank=null,null)}static hydrate(e,t){return e.map((e=>new xi(t,e)))}static async fetch(e){let t=e.options.things.polygons.slice();e.options.things.maps&&Le(t,"map"),e.options.things.nodes&&Le(t,"entrances");let r={fields:t,perspective:e.options.do2D&&e.options.perspective||void 0,venue:e.options.venue};try{return(await Be(e.options,"polygon",r)).filter((e=>e.geometry.visible)).map((t=>new xi(e,t)))}catch(e){return console.error("Fetch Polygons:",e),[]}}toJSON(){return f(this,nr)}},ca=xi;function ql(e){return/^[\da-f]{24}$/i.test(e)}function Wl(e,t=!1){let r="";if(null!=e){let n="?",i=t?Object.keys(e).filter((e=>!["slug","venue"].includes(e))):Object.keys(e);for(let t=0,o=i.length;t<o;++t){let o=i[t],a=e[o];null!=a&&(r+=`${n+encodeURIComponent(o)}=${encodeURIComponent(a)}`,n="&")}}return r}function rh(e,t,r,n=!1){var i,o;return n?`${e.supplementaryUrl}${t}?venue=${r.venue||r.slug}`:(null==(i=e.baseUrl)?void 0:i.includes("gateway"))?`${e.baseUrl}${t}/${r.venue||r.slug}${Wl(r,null==(o=e.baseUrl)?void 0:o.includes("gateway"))}`:e.baseUrl+t+Wl(r)}async function Be(e,t,r,n=!1){return rr(e,t,r,n,!0)}async function rr(e,t,r,n=!1,i=!1){let o=rh(e,t,r,n),a=await Wo(e,o,n);if(!i&&Array.isArray(a)){if(1===a.length)return a[0];throw new Error("Invalid response object")}return a}async function Wo(e,t,r=!1){let n={language:e.language,clientId:e.clientId,clientSecret:e.clientSecret};r&&delete n.language,n.language&&(t+=`&lang=${encodeURIComponent(n.language)}`);let{headers:i}=e;i["Content-Type"]="text/json",e.authorization&&(i.Authorization=e.authorization),n.language&&(i["Accept-Language"]=n.language);let o={method:"GET",headers:i},a=await ir()(t,o);if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()}function Le(e,t){e.indexOf(t)<0&&e.push(t)}function Gl([e,t],[r,n]){let i=new Q(e,t),o=new Q(r,n);return i.distanceTo(o)}function Ul(e){if(e.scale||e.x_scale)return 1/(e.scale||e.x_scale);let t;try{let r=e.georeference[0],n=e.georeference[2],i=new Q(r.target.x,r.target.y),o=new Q(n.target.x,n.target.y),a=i.distanceTo(o),s=r.control.x-n.control.x,l=r.control.y-n.control.y;t=Math.sqrt(s*s+l*l)/a}catch(r){t=1,console.warn(r),console.warn(`Couldn't georeference ${e.name||e.shortName||e.id}. Probably not enough geocoordinates.`)}return t}function Qa(e){var t;return e instanceof ca?e.entrances.map((e=>e.id)):e instanceof fn?(null==(t=e.nodes)?void 0:t.map((e=>e.id)))||[]:[e.id]}async function Vl(e){let t={},{maps:r,images:n,scenes:i,polygons:o}=e;if(null!=n)try{let e=Object.keys(n).map((e=>fetch(`data:image/png;base64,${n[e]}`).then((e=>e.blob())).then((r=>{t[e]=r})).catch((e=>{console.error(e)}))));await Promise.all(e)}catch(e){console.error(e)}return r.forEach((e=>{var r;!(null==(r=e.scene)?void 0:r.polygons)&&!i[e.id]||(null!=i&&i[e.id]&&(e.scene||(e.scene={}),Object.defineProperty(e.scene,"polygons",{get:()=>i[e.id]})),null!=n&&(e.scene.images=e.scene.images.map((({filename:e})=>({filename:e,url:t[e]}))),e.scene.polygons.forEach((e=>{var r,n;if((null==(r=null==e?void 0:e.image)?void 0:r.url)&&(null==(n=null==e?void 0:e.image)?void 0:n.url)){let r=e.image.url.split("/"),n=t[r[r.length-1]];n&&(e.image.url=n)}}))))})),null!=n&&o.forEach((e=>{var r;if(null==(r=null==e?void 0:e.image)?void 0:r.url){let r=e.image.url.split("/"),n=t[r[r.length-1]];n&&(e.image.url=n)}})),null!=e.images&&delete e.images,null!=e.scenes&&delete e.scenes,e}function Go(e,t,r){let n;return function(){let i=this,o=arguments,a=function(){n=null,r||e.apply(i,o)},s=r&&!n;clearTimeout(n),n=setTimeout(a,t),s&&e.apply(i,o)}}Cn=new WeakMap,nr=new WeakMap,Bt=new WeakMap,ar=new WeakMap;var or,sr,lr,Ei=class{constructor(e,t){F(this,or,void 0),F(this,sr,{}),F(this,lr,void 0),p(this,"name"),p(this,"externalId"),p(this,"parents"),p(this,"id"),p(this,"icon"),this.id=t.id,D(this,lr,t),D(this,or,e),Object.assign(this,t)}get locations(){let e=f(this,sr).locations;if(void 0!==e)return e;let t=[],{locations:r}=f(this,or),{id:n}=this;for(let e=0,i=r.length;e<i;++e){let i=r[e],o=i.categories;if(Array.isArray(o))for(let e=0,r=o.length;e<r;++e)if(o[e]===n){t.push(i);break}}return f(this,sr).locations=t,t}static hydrate(e,t){return e.map((e=>new Ei(t,e)))}static async fetch(e){let t={fields:e.options.things.categories,venue:e.options.venue};try{return(await Be(e.options,"category",t)).map((t=>new Ei(e,t)))}catch(e){return console.error("Fetch Categories:",e),[]}}toJSON(){return f(this,lr)}},da=Ei;or=new WeakMap,sr=new WeakMap,lr=new WeakMap,j();var ur,ha,cr,Ii=class{constructor(e,t){F(this,ur,void 0),F(this,ha,void 0),F(this,cr,{}),p(this,"id",""),p(this,"type",""),p(this,"name",""),p(this,"description"),p(this,"image"),p(this,"startDate"),p(this,"endDate"),p(this,"showDate"),D(this,ha,t),D(this,ur,e),Object.assign(this,t)}location(){let e=f(this,cr).location;if(void 0!==e)return e;let t,r=f(this,ur)._locationsById,n=f(this,ha).location;if(null!=n){let e=r[n];null!=e&&(t=e)}return f(this,cr).location=t,t}static hydrate(e,t){return e.map((e=>new Ii(t,e)))}static async fetch(e){let t=e.options.things.events.slice();e.options.things.locations&&Le(t,"location");let r={fields:t,venue:e.options.venue,activeAtOrAfter:Date.now()};try{return(await Be(e.options,"event",r)).map((t=>new Ii(e,t)))}catch(e){return console.error("Fetch Events:",e),[]}}toJSON(){return f(this,ha)}},Ai=Ii;ur=new WeakMap,ha=new WeakMap,cr=new WeakMap,j();var dr,Oi=class{constructor(e){F(this,dr,void 0),p(this,"locations",[]),D(this,dr,e),Object.assign(this,e)}static hydrate(e){return new Oi(e)}static async fetch(e){try{let t=await rr(e.options,"smart-labels/location-label-ranking",{venue:e.options.venue},!0);return new Oi(t)}catch(e){return console.error("Fetch Location Rankings:",e),{}}}toJSON(){return f(this,dr)}},Uo=Oi;dr=new WeakMap,j();var hr,zi=class{constructor(e){F(this,hr,void 0),p(this,"id",""),p(this,"name",""),p(this,"value",""),D(this,hr,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new zi(e)))}static async fetch(e){let t={fields:e.options.things.locationStates.slice(),venue:e.options.venue};try{return(await Be(e.options,"location-state",t)).map((e=>new zi(e)))}catch(e){return console.error("Fetch Location States:",e),[]}}toJSON(){return f(this,hr)}},Vo=zi;hr=new WeakMap,j(),j();var fr,mr,pr=class{constructor(e,t,r,n,i,o){p(this,"map"),p(this,"x",0),p(this,"y",0),p(this,"lat",0),p(this,"lon",0),F(this,fr,{}),F(this,mr,void 0),this.lat=e,this.lon=t,this.map="string"==typeof i?i:i.id,this.x=r,this.y=n,D(this,mr,o)}absoluteDistanceTo(e){return Gl([e.lat,e.lon],[this.lat,this.lon])}get nearestNode(){let e=f(this,fr).nearestNode;if(void 0!==e)return e;let t=mt.instances.get(f(this,mr)).findNearestNodeOnMap(this.map,this);return f(this,fr).nearestNode=t,t}};fr=new WeakMap,mr=new WeakMap;var Lt,gr,yr,Pi=class{constructor(e,t){F(this,Lt,void 0),F(this,gr,{}),F(this,yr,void 0),p(this,"id",""),p(this,"group",""),p(this,"name",""),p(this,"shortName",""),p(this,"elevation",0),p(this,"scale",0),p(this,"layers"),p(this,"x_scale"),p(this,"perspectiveId"),p(this,"scene"),p(this,"width",0),p(this,"height",0),p(this,"georeference",[]),p(this,"_scale",0),D(this,Lt,e),D(this,yr,t),Object.assign(this,t),this._scale=Ul(this),this.scale=this.x_scale||1/this._scale}get polygons(){var e;return(null==(e=mt.instances.get(f(this,Lt)))?void 0:e.polygonsByMapId[this.id])||[]}get locations(){var e;return(null==(e=mt.instances.get(f(this,Lt)))?void 0:e.locationsByMapId[this.id])||[]}get nodes(){var e;return(null==(e=mt.instances.get(f(this,Lt)))?void 0:e.nodesByMapId[this.id])||[]}get mapGroup(){let e=f(this,gr).mapGroup;if(void 0!==e)return e;let t=this.group,r=t&&f(this,Lt)._mapGroupsById[t]||null;return f(this,gr).mapGroup=r,r}createCoordinateByXY(e,t){let r,n=this.georeference[0],i=new Q(n.target.x,n.target.y),o=e-n.control.x,a=n.control.y-t,s=Math.atan2(o,a);r=0===o&&0===a?0:0===o?a:o/Math.sin(s);let l=s-this.getNorth(),u=r/this._scale,h=i.destinationPoint(u,180*l/Math.PI);return new pr(h.lat,h.lon,e,t,this.id,f(this,Lt))}createCoordinate(e,t){let r=this.georeference[0],n=new Q(r.target.x,r.target.y),i=new Q(e,t),o=n.distanceTo(i),a=(n.finalBearingTo(i)+360)%360*Math.PI/180||0,s=o*(1/this.scale),l=a+this.getNorth(),u=Math.sin(l)*s,h=Math.cos(l)*s;return new pr(e,t,r.control.x+u,r.control.y-h,this.id,f(this,Lt))}getNorth(){let e;try{let t=this.georeference[0],r=this.georeference[2],n=new Q(t.target.x,t.target.y),i=new Q(r.target.x,r.target.y);e=-((n.finalBearingTo(i)+0)*Math.PI/180-Math.atan2(r.control.y-t.control.y,r.control.x-t.control.x)-Math.PI/2)}catch(t){e=0,console.warn(t),console.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return e}static hydrate(e,t){return e.map((e=>new Pi(t,e)))}static async fetch(e){let t=e.options.things.maps.slice();e.options.perspective&&Le(t,"perspectives"),e.options.things.mapGroups&&Le(t,"group"),Le(t,"elevation"),Le(t,"x_scale"),Le(t,"scale"),Le(t,"georeference");let r={fields:t,perspective:e.options.perspective,venue:e.options.venue};try{let i=await Be(e.options,"map",r),o=e=>{let t=n.layers.find((t=>t.id===e));t?t.visible=!0:n.layers.push({id:e,visible:!0})};for(let r=0,a=i.length;r<a;++r){var n=i[r];if(n){let r=n.perspective;null!=r&&(n.perspectiveId=r.id,e.options.do2D?(t.indexOf("width")>-1&&(n.width=r.size&&r.size.width||r.width),t.indexOf("height")>-1&&(n.height=r.size&&r.size.height||r.height),t.indexOf("tiles")>-1&&(n.tiles=r.tiles),t.indexOf("original")>-1&&(n.original=r.original)):(t.indexOf("scene")>-1&&(n.scene=r.scene),r.layers?(n.layers.forEach((e=>{e.visible=!1})),r.layers.forEach(o)):n.layers.forEach((e=>{e.visible=!0})))),delete n.perspective}i[r]=new Pi(e,n)}return i}catch(e){return console.error("Fetch Maps:",e),[]}}toJSON(){return f(this,yr)}},Ci=Pi;Lt=new WeakMap,gr=new WeakMap,yr=new WeakMap,j();var br,pa,kr,Ni=class{constructor(e,t){F(this,br,void 0),F(this,pa,void 0),F(this,kr,{}),p(this,"id",""),p(this,"name",""),D(this,pa,t),D(this,br,e),Object.assign(this,t)}get maps(){let e=f(this,kr).maps;if(void 0!==e)return e;let t=[],{maps:r}=f(this,br),{id:n}=f(this,pa);for(let e=0,i=r.length;e<i;++e){let i=r[e];i.group===n&&t.push(i)}return f(this,kr).maps=t,t}static hydrate(e,t){return e.map((e=>new Ni(t,e)))}static async fetch(e){let t={fields:e.options.things.mapGroups.slice(),venue:e.options.venue};try{return(await Be(e.options,"map-group",t)).map((t=>new Ni(e,t)))}catch(e){return console.error("Fetch Map Groups:",e),[]}}toJSON(){return f(this,pa)}},Fi=Ni;br=new WeakMap,pa=new WeakMap,kr=new WeakMap,j();var Ht,vr,ot,wr,Li=class extends hn{constructor(e,t){super(e),F(this,Ht,void 0),F(this,vr,void 0),F(this,ot,{}),p(this,"id",""),p(this,"map",""),p(this,"x",0),p(this,"y",0),p(this,"operationHours"),p(this,"externalId"),F(this,wr,void 0),D(this,Ht,e),D(this,vr,t),Object.assign(this,t)}get lat(){var e;let t=f(this,ot).cachedLatLon;if(null!=t)return t.lat;let r=null==(e=f(this,Ht)._mapsById)?void 0:e[this.map];if(null==r)throw new Error("Map not found");return f(this,ot).cachedLatLon=r.createCoordinateByXY(this.x,this.y),f(this,ot).cachedLatLon.lat}get lon(){var e;let t=f(this,ot).cachedLatLon;if(null!=t)return t.lon;let r=null==(e=f(this,Ht)._mapsById)?void 0:e[this.map];if(null==r)throw new Error("Map not found");return f(this,ot).cachedLatLon=r.createCoordinateByXY(this.x,this.y),f(this,ot).cachedLatLon.lon}get paths(){let e=f(this,ot).paths;if(void 0!==e)return e;let t=[],r=f(this,Ht)._nodesById,n=f(this,wr);if(Array.isArray(n))for(let e=0,i=n.length;e<i;++e){let i=r[n[e].node];null!=i&&t.push(i)}return f(this,ot).paths=t,t}set paths(e){D(this,wr,e)}get locations(){var e;let t=f(this,ot).locations;if(void 0!==t)return t;let r=[],n=null==(e=mt.instances.get(f(this,Ht)))?void 0:e.locationsByMapId[this.map],i=this.id;for(let e=0,t=n.length;e<t;++e){let t=n[e],o=t.nodes;if(Array.isArray(o))for(let e=0,n=o.length;e<n;++e)if(o[e].id===i){r.push(t);break}}return f(this,ot).locations=r,r}get polygon(){let e=f(this,ot).polygon;if(void 0!==e)return e;let t,r=mt.instances.get(f(this,Ht)).polygonsByMapId[this.map],n=this.id;for(let e=0,i=r.length;e<i;++e){let i=r[e];i.entrances.map((e=>e.id)).includes(n)&&(t=i)}return f(this,ot).polygon=t,t}static hydrate(e,t){return e.map((e=>new Li(t,e)))}static async fetch(e){let t=e.options.things.nodes.slice();e.options.things.maps&&Le(t,"map"),["weight","multiplier","accessible"].forEach((function(e){Le(t,e)}));let r={fields:t,perspective:e.options.do2D&&e.options.perspective||void 0,venue:e.options.venue};try{return(await Be(e.options,"node",r)).map((t=>new Li(e,t)))}catch(e){return console.error("Fetch Nodes:",e),[]}}toJSON(){return f(this,vr)}},Bi=Li;Ht=new WeakMap,vr=new WeakMap,ot=new WeakMap,wr=new WeakMap,j();var Mr,qi=class{constructor(e){F(this,Mr,void 0),p(this,"polygons",[]),D(this,Mr,e),Object.assign(this,e)}static hydrate(e){return new qi(e)}static async fetch(e){try{let t=await rr(e.options,"smart-labels/polygon-label-ranking",{venue:e.options.venue},!0);return new qi(t)}catch(e){return console.error("Fetch Rankings:",e),null}}toJSON(){return f(this,Mr)}},Di=qi;Mr=new WeakMap,j();var _r,Wi=class{constructor(e){p(this,"id",""),F(this,_r,void 0),D(this,_r,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new Wi(e)))}static async fetch(e){let t={fields:e.options.things.themes.slice(),venue:e.options.venue};try{return(await Be(e.options,"apollo-theme",t)).map((e=>new Wi(e)))}catch(e){return console.error("Fetch Theme:",e),[]}}toJSON(){return f(this,_r)}},$o=Wi;_r=new WeakMap,j();var Sr,Tr,fa,Ui=class{constructor(e,t){F(this,Sr,void 0),F(this,Tr,void 0),F(this,fa,{}),p(this,"defaultMap",""),p(this,"address",""),p(this,"city",""),p(this,"countrycode",""),p(this,"externalId",""),p(this,"id",""),p(this,"latitude"),p(this,"logo"),p(this,"longitude"),p(this,"metadata"),p(this,"name",""),p(this,"operationHours"),p(this,"postal",""),p(this,"slug",""),p(this,"state",""),p(this,"telephone",""),p(this,"tzid",""),p(this,"tzidOverride",""),p(this,"utcOffset",""),p(this,"website",""),D(this,Tr,e),D(this,Sr,t),Object.assign(this,t)}static hydrate(e,t){return new Ui(t,e)}static async fetch(e){let t={fields:e.options.things.venue,slug:e.options.venue,limit:1};try{let r=await Be(e.options,"venue",t);return new Ui(e,r[0])}catch(e){return console.error("Fetch Venue:",e),{}}}get isMultiBuilding(){if(null==f(this,fa).isMultiBuilding){let e=f(this,Tr).maps,t=e.reduce(((e,t)=>e.add(t.elevation)),new Set),r=e.length!==t.size;f(this,fa).isMultiBuilding=r}return f(this,fa).isMultiBuilding}toJSON(){return f(this,Sr)}},Gi=Ui;Sr=new WeakMap,Tr=new WeakMap,fa=new WeakMap,j();var jr,$i=class{constructor(e){p(this,"id",""),F(this,jr,void 0),p(this,"name"),p(this,"type"),p(this,"weight"),p(this,"multiplier"),D(this,jr,e),Object.assign(this,e)}static hydrate(e){return e.map((e=>new $i(e)))}static async fetch(e){let t=e.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(e){Le(t,e)}));let r={fields:t,venue:e.options.venue};try{return(await Be(e.options,"vortex",r)).map((e=>new $i(e)))}catch(e){return console.error("Fetch Vortexes:",e),[]}}toJSON(){return f(this,jr)}},Vi=$i;function ih(e,t){let r=[];return e.features.forEach((e=>{var n,i;let o=[];null==(n=e.properties.spaces)||n.forEach((e=>{if("id"in e){let r;r=t.get(e.id),r&&o.push(...r)}else null==o||o.push({id:e.node,level:""})}));let a=o.map((e=>({node:"n_"+e.id,map:e.level}))),s=null==(i=e.properties.spaces)?void 0:i.filter((e=>"id"in e)),l=(e.properties.hours||[]).map((e=>({...e,"@type":"OpeningHoursSpecification",dayOfWeek:[e.dayOfWeek.replace("http://schema.org/","")]}))),u={...e.properties,polygons:s||[],nodes:a||[],description:e.properties.description||"",logo:e.properties.logo||{},picture:e.properties.picture||{},phone:e.properties.phone||{},social:e.properties.social||{},externalId:e.properties.externalId||"",states:e.properties.states||[],siblingGroups:e.properties.siblingGroups||[],operationHours:l};delete u.spaces,r.push(u)})),r}function oh(e){let t=new Set;return e.features.forEach((e=>{var r;null==(r=e.properties.states)||r.forEach((e=>{t.add(e.type)}))})),Array.from(t).map((e=>({id:e,name:e,value:e})))}function sh(e){let t=[];return e.features.forEach((e=>{let r={...e.properties,icon:e.properties.picture};delete r.picture,t.push(r)})),t}function lh(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;return e.features.forEach((e=>{let o;o="MultiPolygon"===e.geometry.type?e.geometry.coordinates[0].flat():e.geometry.coordinates[0],o.forEach((e=>{t=Math.min(t,e[1]),n=Math.max(n,e[1]),r=Math.min(r,e[0]),i=Math.max(i,e[0])}))})),{id:e.features[0].properties.id,minLat:t,minLong:r,maxLat:n,maxLong:i}}function uh(e,t,r){let n=r.createGeoreferences(),i=[];return e.features.forEach((e=>{let o=new Set;t.forEach((e=>{e.layer&&o.add(e.layer)}));let a=[...o].map((e=>({id:e,visible:!0}))),s=1/r.mapScale,l={...e.properties,georeference:n,shortName:e.properties.abbreviation||"",scene:{polygons:t},scale:s,x_scale:s,group:e.properties.building,layers:a,width:r.widthInMapUnits,height:r.heightInMapUnits};i.push(l)})),i}jr=new WeakMap,j();var $l=class{constructor(e){p(this,"mapExtent"),p(this,"stretchRatio"),p(this,"midLat"),p(this,"midLong"),p(this,"mapUnitRatio",1e6),p(this,"latDistance"),p(this,"longDistance"),p(this,"mapScale"),p(this,"widthInMapUnits"),p(this,"heightInMapUnits"),this.mapExtent=e;let{minLat:t,minLong:r,maxLat:n,maxLong:i}=e,o=(t+n)/2,a=(r+i)/2,s=new Q(o,i),l=new Q(o,r),u=new Q(t,a),h=new Q(n,a);this.latDistance=u.distanceTo(h),this.longDistance=s.distanceTo(l);let c=this.latDistance/this.longDistance,d=(n-t)/(i-r);this.stretchRatio=c/d,this.midLat=o,this.midLong=a,this.widthInMapUnits=(i-r)*this.mapUnitRatio,this.heightInMapUnits=(n-t)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(e){let t=e[1];return{x:(e[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-t)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:e,minLong:t,maxLat:r,maxLong:n}=this.mapExtent;return[[e,t],[e,n],[r,n],[r,t]].map((e=>({target:{x:e[0],y:e[1]},control:this.convert([e[1],e[0]])})))}};function ch(e,t){let r=[];return e.features.forEach((e=>{let n=t.convert(e.geometry.coordinates),i=(e.properties.neighbors||[]).map((t=>({node:t,map:e.properties.level}))),o=e.properties.level,a={...e.properties,x:n.x,y:n.y,paths:i,map:o,externalId:e.properties.externalId||""};r.push(a)})),r}var Hl=(e,t,r,n,i)=>{let o=[];return e.features.forEach((e=>{if(!e.geometry.coordinates[0].forEach)return;let a=[];"entrances"in e.properties&&(a=e.properties.entrances.map((e=>({id:"n_"+e.id,node:"n_"+e.id,map:e.level}))));let s,l=r[e.properties.id],u=t.find((e=>e.id===l)),h=e.geometry.coordinates[0].map((e=>i.convert(e))),c=n.find((t=>t.polygonId===e.properties.id)),d=Math.max(i.widthInMapUnits,i.heightInMapUnits)/1e3;if(c){let e=i.convert([c.position[0],c.position[1]]),t=c.size.x,r=c.size.y,n=i.mapScale,o=r*n,a=t*n/d/c.viewBox.width,l=o/d/c.viewBox.height;s={url:null==u?void 0:u.image,visible:!!(null==u?void 0:u.image),viewBox:c.viewBox,scale:{x:a,y:l},position:{x:e.x,y:e.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let p={...e.properties,entrances:a,map:e.properties.level,externalId:e.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==u?void 0:u.altitude)||0)*i.mapScale/d},scale:{x:1,y:1,z:((null==u?void 0:u.height)||1)*i.mapScale/d}},material:{color:(null==u?void 0:u.color)||"#000000"},image:s,vertexes:h};o.push(p)})),o};function dh(e,t,r,n,i,o){let a=Hl(e,r,n,i,o),s=Hl(t,r,n,i,o);return a.concat(s)}function hh(e){let t=new Map;return e.forEach((e=>{e.features.forEach((e=>{let{destinations:r}=e.properties;if(0===r.length)return;let n=r[0].split("-")[0],i=t.get(n),o=r.map((e=>e.split("-")[1])).map((e=>"n_"+e));if(i)i.nodes.push(...o);else{let{name:r,type:i,weight:a,multiplier:s,accessible:l}=e.properties,u={id:n,nodes:o,name:r,type:i,weight:a,multiplier:s,accessible:l};t.set(n,u)}}))})),Array.from(t.values())}function ph(e){let t=[];return e.features.forEach((e=>{let r={...e.properties};t.push(r)})),t}function Yl(e){let t=Array.from(e.connection.values()),r=Array.from(e.level.values()),n=e.building,i=e.category,o=e.style,a=e.location,s=e.imageInstance,l=e.polygonStyle,u={},h=[],c=new Map;r.forEach((t=>{let r=t.features[0].properties.id,n=lh(t),i=new $l(n);c.set(r,i);let a=e.obstruction.get(r),d=e.space.get(r),p=s.get(r),f=l.get(r);u[r]=dh(d,a,o,f,p,i);let y=e.node.get(r);h.push(...ch(y,i))}));let d=Object.values(u).flat(),p=hh(t),f=r.map((e=>{let t=e.features[0].properties.id,r=c.get(t);return uh(e,u[t],r)})).flat(),y=new Map;Array.from(e.space.values()).forEach((e=>{e.features.forEach((e=>{y.set(e.properties.id,e.properties.entrances)}))}));let g=ph(n),m=ih(a,y),b=sh(i),_=oh(a),v=e.manifest.features[0].properties.name,w=e.manifest.features[0].geometry.coordinates[0],S=e.manifest.features[0].geometry.coordinates[1],M=e.imageBinaries;return{locations:m,categories:b,nodes:h,maps:f,polygons:d,vortexes:p,mapGroups:g,locationStates:_,themes:[],venue:{name:v,latitude:S,longitude:w},imageBinaries:M}}j(),j(),j();var Fn,Nn,Ho=[0,4,6,8,10],Pn=()=>{let e=new Array(16).fill(0),t=4294967296*Math.random();for(let r=0;r<e.length;r++)r>0&&0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;let r=e.map((e=>e.toString(16).padStart(2,"0")));return r[6]="4"+r[6][1],r[8]=["8","9","a","b"].includes(r[7][0])?r[7]:"a"+r[7][1],Ho.map(((e,t)=>r.slice(e,t===Ho.length-1?void 0:Ho[t+1]).join(""))).join("-")};function Jl(e){return/^[\da-f]{24}$/i.test(e)}function Xl(){if(!Fn)try{let e="mi-uuid";(Fn=localStorage.getItem(e))||(Fn=Pn(),localStorage.setItem(e,Fn))}catch(e){Fn="NLS-"+Pn()}return Fn}function Ql(){if(!Nn)try{let e="mi-session";(Nn=sessionStorage.getItem(e))||(Nn=Pn(),sessionStorage.setItem(e,Nn))}catch(e){Nn="NSS-"+Pn()}return Nn}var ku,vu,Rr,ma,ga,xr,ya,ba,ka,Bn,Er,va,wa,Ar,yu=Ne(gu()),_h=null==(vu=null==(ku=G)?void 0:ku.env)?void 0:vu.npm_package_version,bu=["websdk","web","webv2"],Qo=class{constructor(e){var t;F(this,Rr,void 0),F(this,ma,void 0),F(this,ga,void 0),F(this,xr,void 0),F(this,ya,void 0),F(this,ba,void 0),F(this,ka,void 0),F(this,Bn,void 0),F(this,Er,void 0),F(this,va,void 0),F(this,wa,void 0),F(this,Ar,void 0),D(this,Bn,e.clientId),D(this,Er,e.clientSecret),D(this,va,e.accessToken),D(this,ka,e.noAuth||!1);let r="https://api-gateway.mappedin.com/track-analytics/a/";!f(this,ka)&&f(this,Bn)&&!Jl(f(this,Bn))&&(r="https://web-proxy.mappedin.com/a/"),D(this,ga,r),D(this,ga,f(this,ga)+(e.venue+"/")),D(this,ma,!1),D(this,Rr,"boolean"==typeof e.testMode?e.testMode:"true"===(null==(t=e.testMode)?void 0:t.toLowerCase())),D(this,xr,bu.find((t=>t===e.context))||bu[0]),D(this,ya,Xl()),D(this,ba,Ql()),D(this,wa,new Set),D(this,Ar,e.platformString||"")}track(e,t){if(f(this,Rr))return;let r={...t,g:f(this,ma)},n=f(this,ga)+e+"?"+yu.default.stringify(r),i={"mi-context":f(this,xr),"mi-session":f(this,ba),"mi-device":f(this,ya),"mappedin-sdk-version":_h,"mappedin-platform-version":f(this,Ar)};f(this,va)?i.Authorization=`Bearer ${f(this,va)}`:f(this,ka)||(i.Authorization=`Basic ${btoa(`${f(this,Bn)}:${f(this,Er)}`)}`),ir()(n,{method:"GET",mode:"cors",headers:i})}locationSelected(e){let t=e.id||e;this.track("select-location",{id:t})}categorySelected(e){let t=e.id||e;this.track("select-category",{id:t})}mapViewLoaded(e,t,r,n){this.track("load-mapview",{type:e,force:t,benchmark:r||-1,reason:n||"success"})}getDirections(e,t){let r={start:e,end:t,type:"location_to_location"};this.track("query-directions",r)}getSessionID(){return f(this,ba)}getDeviceID(){return f(this,ya)}setGeolocationMode(e){D(this,ma,e)}trackBlueDotEvent(e){e&&Object.values(Qo.BLUEDOT_EVENT).includes(e)&&!f(this,wa).has(e)?(this.track(e),f(this,wa).add(e)):console.warn(`Ignored unsupported blue dot event: "${e}".`)}trackSearch(e){null!=e&&this.track("query-search",e)}trackSearchSuggest(e){null!=e&&this.track("query-suggest",e)}},Xo=Qo;Rr=new WeakMap,ma=new WeakMap,ga=new WeakMap,xr=new WeakMap,ya=new WeakMap,ba=new WeakMap,ka=new WeakMap,Bn=new WeakMap,Er=new WeakMap,va=new WeakMap,wa=new WeakMap,Ar=new WeakMap,p(Xo,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var Ko,Hi=Xo,wu={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,do2D:!1,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""};!function(e){e.CATEGORY="categories",e.EVENT="events",e.LOCATION="locations",e.MAPGROUP="mapGroups",e.MAP="maps",e.NODE="nodes",e.POLYGON="polygons",e.VORTEX="vortexes"}(Ko||(Ko={}));var mn,_a,Ma={categories:da,locations:fn,vortexes:Vi,maps:Ci,nodes:Bi,polygons:ca,venue:Gi,events:Ai,mapGroups:Fi,themes:$o,locationStates:Vo,locationRankings:Uo,rankings:Di},Ln=class{constructor(e){p(this,"perspective"),p(this,"things"),p(this,"options"),F(this,mn,void 0),F(this,_a,""),p(this,"updatedAt"),p(this,"categories",[]),p(this,"locations",[]),p(this,"vortexes",[]),p(this,"maps",[]),p(this,"nodes",[]),p(this,"polygons",[]),p(this,"venue",{}),p(this,"events",[]),p(this,"mapGroups",[]),p(this,"themes",[]),p(this,"locationStates",[]),p(this,"locationRankings",[]),p(this,"rankings"),p(this,"_categoriesById"),p(this,"_locationsById"),p(this,"_vortexesById"),p(this,"_mapsById"),p(this,"_nodesById"),p(this,"_polygonsById"),p(this,"_eventsById"),p(this,"_mapGroupsById"),p(this,"_locationStatesById"),p(this,"_locationRankingsById"),p(this,"_rankingsById"),p(this,"_categoriesByExternalId"),p(this,"_locationsByExternalId"),p(this,"_vortexesByExternalId"),p(this,"_mapsByExternalId"),p(this,"_nodesByExternalId"),p(this,"_polygonsByExternalId"),p(this,"_eventsByExternalId"),p(this,"_mapGroupsByExternalId"),p(this,"_locationStatesByExternalId"),p(this,"_locationRankingsByExternalId"),p(this,"_rankingsByExternalId"),p(this,"images"),p(this,"imageBinaries"),p(this,"scenes"),p(this,"analytics"),p(this,"navigator"),this.options=e,D(this,mn,mt.create(this)),this.analytics=new Hi(e)}generateGetters(e){try{for(let t=0,r=e.length;t<r;++t){let r=e[t];Array.isArray(this[r])&&(Object.defineProperty(this,`_${r}ByExternalId`,{get(){let e=f(this,mn)[r];if(null!=e)return e;let t={};return this[r].forEach((e=>t[e.externalId]=e)),f(this,mn)[r]=t,t}}),Object.defineProperty(this,`_${r}ById`,{get(){let e=f(this,mn)[r];if(null!=e)return e;let t={};return this[r].forEach((e=>t[e.id]=e)),f(this,mn)[r]=t,t}}))}return this}catch(e){throw new Error("Unable to generate getters, "+e)}}getCollectionItemById(e,t){let r=`_${e}ByExternalId`,n=this[`_${e}ById`];return null!=n&&null!=n[t]||(n=this[r],null!=n&&null!=n[t])?n[t]:null}async hydrateFromMVF(e){let t=Yl(e);return this.hydrate(t)}async hydrate(e,t){let r;if("string"==typeof e)try{D(this,_a,e),r=JSON.parse(e)}catch(e){return void console.error("Unable to parse JSON",e)}else r=e,D(this,_a,JSON.stringify(r));let n=Object.keys(r);for(let e=0,t=n.length;e<t;++e){let t=n[e],i=r[t];null!=Ma[t]&&"function"==typeof Ma[t].hydrate&&(this[t]=Ma[t].hydrate(i,this))}t&&await Vl(r);let{images:i,scenes:o,imageBinaries:a}=r;this.images=i,this.scenes=o,this.imageBinaries=a,this.generateGetters(n),this.initNavigator()}async fetch(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),ql(this.options.clientId)||(this.options.things.rankings&&delete this.options.things.rankings,this.options.things.locationRankings&&delete this.options.things.locationRankings);let{things:e}=this.options,t=[],r=Object.keys(e);for(let e=0,n=r.length;e<n;++e){let n=r[e];Ma[n]&&t.push(Ma[n].fetch(this).then((e=>(this[n]=e,Promise.resolve()))))}return this.generateGetters(r),Promise.all(t).then((()=>{this.initNavigator()}))}initNavigator(){this.navigator=new Lo({locations:this.locations.map((e=>e.toJSON())),nodes:this.nodes.map((e=>e.toJSON())),vortexes:this.vortexes.map((e=>e.toJSON())),maps:this.maps.map((e=>e.toJSON()))})}toJSON(){var e;let t={};for(let e in Ma)Array.isArray(this[e])&&(t[e]=this[e].map((e=>e.toJSON())));let r={...t,venue:this.venue.toJSON()};return null!=this.rankings&&(r.rankings=null==(e=this.rankings)?void 0:e.toJSON()),delete r.locationRankings,r}toString(){return f(this,_a)||JSON.stringify(this.toJSON())}};mn=new WeakMap,_a=new WeakMap,j();var Mu={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"],locationRankings:[]},Rc=Ne(wc());j();var Hn=Ne(Mc());j();var Hh=["0","1","2","3","4","5","6","7","8","9"],Yh=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],Jh=["0","1","2","3","4","5","6","7","8","9"],Xh=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],Jg=[...Hh,...Yh,...Jh,...Xh],_c=["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"];j();var Yn,_t,wn,qt,Ze,Ur,Vr,Ea,$r,Aa,en,uo,co,Mn,Hr,ho,po,fo,dp,Yr,Jr,vs,Qh=32,pt=!1,Kh=120,gs=0,ys=class{constructor(e){p(this,"_callback"),p(this,"_frameCount"),p(this,"_ordering"),p(this,"_supersededBy"),p(this,"name"),p(this,"_remainingFrameCount"),p(this,"_lastFrameTime"),p(this,"userdata"),this._callback=e.callback,this._frameCount=null!=e.frameCount?e.frameCount:1,this._ordering=null!=e.ordering?e.ordering:0,this._supersededBy=null!=e.supersededBy?new Set(e.supersededBy):new Set,this.name=e.name,this.userdata=e.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,pt&&console.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}},vn=class{constructor(e){if(p(this,"_postponed"),p(this,"userdata"),p(this,"_priority"),p(this,"_group"),p(this,"name"),p(this,"_lastFrameTime"),p(this,"_callback"),p(this,"_complete"),p(this,"_scheduled"),p(this,"_cancelled"),null!=e.group&&null!=e.priority)throw new Error("cannot specify task priority individually within group");if(null!=e.group&&null!=e.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=e.callback,this._group=null!=e.group?e.group:null,this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,pt&&console.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}},bs=class{constructor(e){p(this,"_postponed"),p(this,"_onComplete"),p(this,"_priority"),p(this,"userdata"),p(this,"name"),p(this,"_tasks"),p(this,"_scheduledTasks"),p(this,"_scheduled"),p(this,"_cancelled"),this._onComplete=null!=e.onComplete?e.onComplete:()=>{},this._priority=null!=e.priority?e.priority:0,this._postponed=null!=e.postponeOnAdd&&e.postponeOnAdd,this.name=e.name,this.userdata=e.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,pt&&console.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 e of this._scheduledTasks)return this._scheduledTasks.delete(e),e}},Sc=class{constructor(e){p(this,"_maxMillisecondsPerFrame"),p(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==e?void 0:e.maxMillisecondsPerFrame)?e.maxMillisecondsPerFrame:Qh,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}},ks=class{constructor(e){p(this,"_timer"),p(this,"_performance"),p(this,"_scheduledUpdatesByOrdering"),p(this,"_scheduledTasksByPriority"),p(this,"_postponedTasks"),p(this,"_requestAnimationFrameHandle"),p(this,"_updatesToRunThisFrame"),p(this,"_lastFrameTime",0),p(this,"_updatesRunLastFrame"),this._timer=null!=(null==e?void 0:e.timer)?e.timer:new Sc,this._performance=null!=(null==e?void 0:e.performance)&&e.performance,this._scheduledUpdatesByOrdering=new Gr,this._scheduledTasksByPriority=new Gr,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),pt&&console.log("task scheduler instantiated")}clear(){for(let e of this._scheduledTasksByPriority.values())e._cancelled=!0;for(let e of this._postponedTasks.values())e._cancelled=!0;this._scheduledUpdatesByOrdering=new Gr,this._scheduledTasksByPriority=new Gr,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),pt&&console.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle=requestAnimationFrame(this.update))}update(e){let t;this._timer.beginFrame(),this._performance&&(t=performance.now());let r=!1;pt&&(0===gs&&(r=!0),++gs,gs%=Kh);let n=this._scheduledUpdatesByOrdering.keys();for(let e=n.length-1;e>=0;--e){let t=n[e];for(let e of this._scheduledUpdatesByOrdering.get(t).values())this._updatesToRunThisFrame.push(e),r&&console.log("update scheduled to run this frame",e.name)}for(let e of this._updatesToRunThisFrame){--e._remainingFrameCount,e._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(e._ordering,e),e._superseded=!1;for(let t of this._updatesToRunThisFrame)e._supersededBy.has(t)&&(e._superseded=!0,r&&console.log("update superseded",e.name,t.name))}for(let e=0;e<this._updatesToRunThisFrame.length;++e)this._updatesToRunThisFrame[e]._superseded&&(this._updatesToRunThisFrame.splice(e,1),--e);for(let t of this._updatesToRunThisFrame){let n;this._performance&&(n=performance.now()),t._callback(e),this._performance&&(t._lastFrameTime=performance.now()-n),r&&console.log("update completed",t.name)}this._updatesRunLastFrame.clear();for(let e of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(e);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(e)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-t),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(e){let t,r=this._scheduledTasksByPriority.popFromMaxKey(),n=null;console.assert(void 0!==r),Object.getPrototypeOf(r)===bs.prototype&&(n=r,r=n._popTask()),console.assert(void 0!==r),console.assert(Object.getPrototypeOf(r)===vn.prototype),this._performance&&(t=performance.now()),r._callback(e),r._complete=!0,this._performance&&(r._lastFrameTime=performance.now()-t),pt&&console.log("task completed",r.name),null!=n&&(n.isComplete()?(n.clear(),n._onComplete(),pt&&console.log("group completed",n.name)):this._scheduledTasksByPriority.insert(n._priority,n))}scheduleUpdate(e){e._remainingFrameCount=e._frameCount,this._scheduledUpdatesByOrdering.insert(e._ordering,e),this.requestAnimationFrame()}scheduleTask(e){if(Object.getPrototypeOf(e)===bs)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+e.name);if(e._scheduled)throw new Error("cannot schedule already scheduled task: "+e.name);if(e._cancelled)throw new Error("cannot schedule cancelled task: "+e.name);let t=e;"_group"in e&&null!=e._group&&(e._group._tasks.add(e),e._group._scheduledTasks.add(e),t=e._group),t._postponed?this._postponedTasks.add(t):this._scheduledTasksByPriority.insert(t._priority,t),e._scheduled=!0,t._scheduled=!0,pt&&console.log("task scheduled",e.name),this.requestAnimationFrame()}cancelUpdate(e){this._scheduledUpdatesByOrdering.delete(e._ordering,e),pt&&console.log("update cancelled",e.name)}cancelTask(e){if(!e._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+e.name);if(e._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+e.name);if("_group"in e&&null!=e._group){let t=e._group.isComplete();e._group._tasks.delete(e),e._group._scheduledTasks.delete(e),e._group.isComplete()&&(this._scheduledTasksByPriority.delete(e._group._priority,e._group),t||e._group._onComplete())}else this._scheduledTasksByPriority.delete(e._priority,e),this._postponedTasks.delete(e);Object.getPrototypeOf(e)===vn.prototype?e._cancelled=!0:"clear"in e&&e.clear(),pt&&console.log("task cancelled",e.name)}postponeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot postpone individual tasks in group: "+e.name);if(e._cancelled)throw new Error("cannot postpone cancelled task: "+e.name);if(!e._postponed){if(Object.getPrototypeOf(e)===vn.prototype){if("_complete"in e)return;if(!e._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+e.name)}this._scheduledTasksByPriority.delete(e._priority,e),(Object.getPrototypeOf(e)===vn.prototype||!e.isComplete())&&this._postponedTasks.add(e),e._postponed=!0,pt&&console.log("task postponed",e.name)}}resumeTask(e){if("_group"in e&&null!=e._group)throw new Error("cannot resume individual tasks in groups");if(e._cancelled)throw new Error("cannot resume cancelled task");if(e._postponed){if(Object.getPrototypeOf(e)===vn.prototype){if("_complete"in e&&e._complete)return;if(!e._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(e),(Object.getPrototypeOf(e)===vn.prototype||!e.isComplete())&&this._scheduledTasksByPriority.insert(e._priority,e),e._postponed=!1,this.requestAnimationFrame(),pt&&console.log("task resumed",e.name)}}setTaskPriority(e,t){if(Object.getPrototypeOf(e)===vn.prototype&&!e._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(e._priority,e)&&(this._scheduledTasksByPriority.delete(e._priority,e),this._scheduledTasksByPriority.insert(t,e)),e._priority=t,pt&&console.log("task priority changed",e.name,t)}},Gr=class{constructor(){p(this,"_map"),p(this,"_size"),p(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(e,t){return null!=this._map.get(e)&&this._map.get(e).has(t)}get(e){return this._map.get(e)}insert(e,t){if(console.assert("number"==typeof e&&Number.isFinite(e)),null==this._map.get(e)){this._map.set(e,new Set);for(let t=0;t<=this._sortedKeys.length;++t)if(t===this._sortedKeys.length||e<this._sortedKeys[t]){this._sortedKeys.splice(t,0,e);break}}this._map.get(e).has(t)||(this._map.get(e).add(t),++this._size)}delete(e,t){null!=this._map.get(e)&&this._map.get(e).has(t)&&(this._map.get(e).delete(t),--this._size,0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)))}pop(e){if(null!=this._map.get(e)){let t;for(t of this._map.get(e).values()){this._map.get(e).delete(t),--this._size;break}return 0===this._map.get(e).size&&(this._map.delete(e),this._sortedKeys.splice(this._sortedKeys.indexOf(e),1)),t}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let e=this._map.keys(),t=null,r={[Symbol.iterator]:()=>r,next:()=>{if(null==t){let r=e.next();if(r.done)return r;t=this._map.get(r.value).values()}let r=t.next();for(;r.done;){let n=e.next();if(n.done)return n;t=this._map.get(n.value).values(),r=t.next()}return r}};return r}keys(){return this._sortedKeys}get size(){let e=0;for(let t of this._map.values())e+=t.size;return console.assert(e===this._size),e}},Zt=e=>e.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase(),xa="",Zh=.09,ep=1,tp=.025,np=.5,ap=5e-4,rp=5e-4,ip=.01,op=.05,Tc=1,sp=.01,lp=.2,up={MappedinCategory:"categories",MappedinLocation:"locations"},cp={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:_c,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===G.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:Zh,PRIMARY_INDEX_WEIGHT:ep,SECONDARY_INDEX_WEIGHT:tp,CATEGORY_NAME_WEIGHT:np,LOCATION_NAME_WEIGHT:Tc,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:ap,CATEGORY_LOCATION_TAGS_WEIGHT:rp,CATEGORY_LOCATION_NAME_WEIGHT:ip,PRIMARY_INDEX_TAGS_NAME_WEIGHT:op,LOCATION_DEFAULT_RANK:Tc,RATIO_OF_FUZZY_TO_EXACT:sp,RATIO_OF_PREFIX_TO_EXACT:lp}},lo=class{constructor(e,t){var r,n,i;F(this,fo),F(this,Yn,void 0),F(this,_t,void 0),F(this,wn,void 0),F(this,qt,void 0),F(this,Ze,void 0),F(this,Ur,new ks({performance:!0})),F(this,Vr,void 0),F(this,Ea,void 0),F(this,$r,new Map),F(this,Aa,0),F(this,en,(e=>{D(this,Aa,1+ +f(this,Aa)),f(this,Ur).scheduleUpdate(new ys({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{e(),D(this,Aa,+f(this,Aa)-1),0===f(this,Aa)&&f(this,Hr).call(this)}}))})),F(this,uo,(e=>{var t,r,n;let{SECONDARY_INDEX_WEIGHT:i,LOCATION_DEFAULT_RANK:o,PRIMARY_INDEX_TAGS_NAME_WEIGHT:a}=f(this,Ze).constants,s=o;(null==(t=f(this,Ze))?void 0:t.useLocationRank)&&(s=Array.isArray(e.polygons)?Math.max(...e.polygons.map((e=>{var t,r;return(null==(t=e.rank)?void 0:t.score)?null==(r=e.rank)?void 0:r.score:o})),o):o),f(this,en).call(this,(()=>{f(this,_t).add({name:Zt(e.name),tags:"",id:"MappedinLocation_"+e.id,weight:o,rank:s})})),(null==(r=f(this,Ze))?void 0:r.searchTags)&&Array.isArray(e.tags)&&e.tags.forEach((t=>{f(this,_t).add({name:"",tag:Zt(t),id:"MappedinLocation_"+e.id,weight:a,rank:s})})),(null==(n=f(this,Ze))?void 0:n.searchDescriptions)&&f(this,en).call(this,(()=>f(this,wn).add({description:Zt(e.description||""),id:"MappedinLocation_"+e.id,weight:i,rank:s})))})),F(this,co,(e=>{var t,r;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:n,CATEGORY_LOCATION_TAGS_WEIGHT:i,CATEGORY_LOCATION_NAME_WEIGHT:o,CATEGORY_NAME_WEIGHT:a}=f(this,Ze).constants;f(this,en).call(this,(()=>f(this,_t).add({name:Zt(e.name||""),description:"",id:"MappedinCategory_"+e.id,weight:a})));let s=e.locations.reduce(((e,t)=>e+` ${xa} `+t.name),"")+` ${xa}`;if((null==(t=f(this,Ze))?void 0:t.searchDescriptionsInCategories)&&e.locations.forEach((t=>{null!=t.description&&f(this,en).call(this,(()=>f(this,qt).add({id:"MappedinCategory_"+e.id,"category.locations.description":Zt(t.description),ref:t.name,weight:n})))})),null==(r=f(this,Ze))?void 0:r.searchTagsInCategories){let t=e.locations.reduce(((e,t)=>{var r;return e+(null==(r=t.tags)?void 0:r.reduce(((e,t)=>e+` ${xa} `+t),""))+` ${xa}`}),"");f(this,en).call(this,(()=>f(this,qt).add({"category.locations.tags":Zt(t),id:"MappedinCategory_"+e.id,weight:i})))}f(this,en).call(this,(()=>f(this,qt).add({"category.locations.name":Zt(s),id:"MappedinCategory_"+e.id,weight:o})))})),F(this,Mn,void 0),F(this,Hr,void 0),F(this,ho,(e=>{var t;let r=e.score,{object:n,id:i,weight:o,rank:a}=e,[s,l]=i.split("_"),u=n||f(this,Yn).getCollectionItemById(up[s],l);return a&&(null==(t=f(this,Ze))?void 0:t.useLocationRank)&&(r+=a),o&&(r*=o),{score:r,type:s,object:u}})),F(this,po,((e,t)=>{for(let r in e.match)e.match[r].forEach((n=>{let i=e.ref||e[n]||t.object[n];if("category.locations.tags"===n||"category.locations.name"===n){let t=new RegExp(`[^${xa}]* `+r+` [^${xa}]*`,"ig").exec(e[n]);null!=t&&(i=t[0].slice(1,-1))}t.matches.push({term:r,weight:e.weight,matchesOn:n,value:i})}))})),F(this,Yr,void 0),F(this,Jr,void 0),D(this,Ea,new Hi({...e.options,testMode:!1===(null==t?void 0:t.emitAnalyticsEvents)})),D(this,Ze,{...cp,...t}),D(this,Yn,e),D(this,Vr,new Set(null==(r=f(this,Ze))?void 0:r.stopWords));let{PRIMARY_INDEX_FUZZYNESS:o,PRIMARY_INDEX_WEIGHT:a,CATEGORY_NAME_WEIGHT:s,RATIO_OF_FUZZY_TO_EXACT:l,RATIO_OF_PREFIX_TO_EXACT:u,PRIMARY_INDEX_TAGS_NAME_WEIGHT:h}=f(this,Ze).constants,c=["object","query","weight","tag","rank"],d={fields:["query","name","tag"],storeFields:c,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:o},boost:{name:a,query:a,tag:h},weights:{fuzzy:l,prefix:u},boostDocument:e=>e.includes("MappedinLocation")?a:e.includes("MappedinCategory")?s:a},p={fields:["description"],storeFields:c,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(e,t)=>{var r;return(null==(r=f(this,Vr))?void 0:r.has(e.toLowerCase()))?null:e.toLowerCase()}},y={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...c,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(null==(n=f(this,Ze))?void 0:n.jsonIndex){let{primary:e,secondary:t,extra:r}=JSON.parse(null==(i=f(this,Ze))?void 0:i.jsonIndex);D(this,_t,Hn.default.loadJS(e,d)),D(this,wn,Hn.default.loadJS(t,p)),D(this,qt,Hn.default.loadJS(r,y))}else D(this,_t,new Hn.default(d)),D(this,wn,new Hn.default(p)),D(this,qt,new Hn.default(y)),f(this,Yn).locations.forEach(f(this,uo)),f(this,Yn).categories.forEach(f(this,co));D(this,Mn,new Promise((e=>{D(this,Hr,e)}))),f(this,Ur).update(performance.now()),D(this,Yr,Go(((e,t)=>{f(this,Ea).trackSearchSuggest({query:e,hits:t})}),300)),D(this,Jr,Go(((e,t)=>{f(this,Ea).trackSearch({query:e,hits:t})}),300))}async suggest(e){await f(this,Mn);let{PRIMARY_INDEX_FUZZYNESS:t,PRIMARY_INDEX_WEIGHT:r,PRIMARY_INDEX_TAGS_NAME_WEIGHT:n,RATIO_OF_FUZZY_TO_EXACT:i,RATIO_OF_PREFIX_TO_EXACT:o}=f(this,Ze).constants,a=f(this,_t).autoSuggest(e,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:t,boost:{name:r,query:r,tag:n},weights:{fuzzy:i,prefix:o}});return f(this,Yr).call(this,e,a.length),{total:a.length,hits:a.map((e=>({text:e.suggestion})))}}async search(e){await f(this,Mn);let t=pl(this,fo,dp).call(this,e);return f(this,Jr).call(this,e,t.length),t}async toJSON(){return await f(this,Mn),JSON.stringify({primary:f(this,_t),secondary:f(this,wn),extra:f(this,qt)})}async addQuery(e){let t,r,{query:n,object:i,weight:o=1}=e;await f(this,Mn),t=i instanceof fn?"MappedinLocation":i instanceof da?"MappedinCategory":"Custom","MappedinLocation"===t||"MappedinCategory"===t?r=t+"_"+i.id:"string"==typeof i.id?r="Custom_"+i.id:(r=f(this,$r).get(i),r||(r="Custom_"+Pn(),f(this,$r).set(i,r))),f(this,_t).add({id:r,weight:o,object:i,query:Zt(n)})}};Yn=new WeakMap,_t=new WeakMap,wn=new WeakMap,qt=new WeakMap,Ze=new WeakMap,Ur=new WeakMap,Vr=new WeakMap,Ea=new WeakMap,$r=new WeakMap,Aa=new WeakMap,en=new WeakMap,uo=new WeakMap,co=new WeakMap,Mn=new WeakMap,Hr=new WeakMap,ho=new WeakMap,po=new WeakMap,fo=new WeakSet,dp=function(e){let t=[],r=Zt(e);t=[...f(this,_t).search(r),...f(this,wn).search(r),...f(this,qt).search(r)].sort(((e,t)=>t.score-e.score));let n={};for(let e of t){let t=f(this,ho).call(this,e);n[e.id]?n[e.id].score+=t.score:n[e.id]={...t,matches:[]},f(this,po).call(this,e,n[e.id])}return Object.keys(n).map((e=>({...n[e],matches:n[e].matches.sort(((e,t)=>t.weight-e.weight))}))).sort(((e,t)=>t.score-e.score))},Yr=new WeakMap,Jr=new WeakMap,j(),function(e){e.MULTI_GEOMETRY="MULTI_GEOMETRY",e.SINGLE_GEOMETRY="SINGLE_GEOMETRY"}(vs||(vs={}));var xc=globalThis.fetch||Rc.default;function ir(){if(null==xc)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return xc}var Ac,Ic,hp=null==(Ic=null==(Ac=G)?void 0:Ac.env)?void 0:Ic.npm_package_version;globalThis.btoa||(globalThis.btoa=jc.encode);var pp=["ar"];function ws(e){let t={...wu,things:Mu,...e};return t.headers={...t.headers,"mappedin-sdk-version":hp},e.platformString&&(t.headers={...t.headers,"mappedin-platform-version":e.platformString}),t.noAuth||(t.accessToken?t.authorization=`Bearer ${t.accessToken}`:t.clientId&&t.clientSecret&&(t.authorization=`Basic ${globalThis.btoa(`${t.clientId}:${t.clientSecret}`)}`)),t}async function Ms(e){let t=ws({baseUrl:"https://api-gateway.mappedin.com/",...e}),r="public/1/"+(t.useDraftData?"draft/":""),n=new Ln({...t,baseUrl:t.baseUrl+r});return await n.fetch(),n}var Ec={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};async function _s(e){let t=ws({baseUrl:"https://api-gateway.mappedin.com/",...Ec,...e}),{url:r,updated_at:n}=await fp(e),i=await ir()(r,{mode:"cors"}),{data:o,format:a="jsonstring"}=await i.json();if("jsonstring"!==a)throw new Error(`Unrecognized format ${a}`);let s=new Ln(t);return await s.hydrate(o,t.shouldPopulateBundledImagesAsBlobs),s.updatedAt=n,s}async function fp(e){let t=ws({baseUrl:"https://api-gateway.mappedin.com/",...Ec,...e}),{version:r,venue:n}=e,i=`${e.bundleBaseUri||t.baseUrl+`exports/legacy${null!=t.language&&pp.includes(t.language)?"-"+t.language:""}/1/bundle`}?venue=${n}&version=1.0.0`;return t.language=void 0,await Wo(t,i)}var mp=!1;function gp(e){e.things=e.things||{},e.things.venue=e.things.venue||[],e.things.venue.push("slug","defaultMap"),e.things.nodes=e.things.nodes||[],e.things.nodes.push("x","y","paths","map"),e.things.polygons=e.things.polygons||[],e.things.locations=e.things.locations||[],e.things.locations.push("sortOrder","parent","showLabelWhenImagePresent","hidden"),e.things.maps=e.things.maps||[],e.things.maps.push("height","width","georeference"),e.perspective=e.perspective3D||e.perspective||void 0,e.things.maps.push("scene","layers"),e.things.polygons.push("canvasBounds","map","image","perspectives","material","holes","label","geometry"),mp&&e.things.polygons.push("layer","geometry","vertexes"),e.do2D=!1}var yp=function(e){return null==e.mapView&&(e.mapView={}),new Promise((function(t,r){function n(n,i){if(n)r(n);else{let n={};try{e.firstMapSelector&&(e.mapView=e.mapView||{},e.mapView.firstMap=e.firstMapSelector(i))}catch(e){console.error("Failure in firstMapSelector! Loading default map instead."),console.error(e),r(e)}n.venue=i,t(n)}}gp(e.venue),e.venue.useVenueBundle?_s(e.venue).then((e=>n(null,e))).catch((e=>n(e,null))):Ms(e.venue).then((e=>n(null,e))).catch((e=>n(e,null)))}))};
|