@basemaps/lambda-tiler 6.30.0 → 6.31.0

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/dist/index.js CHANGED
@@ -1,51 +1,51 @@
1
- var Og=Object.create;var za=Object.defineProperty;var Lg=Object.getOwnPropertyDescriptor;var Ng=Object.getOwnPropertyNames;var Dg=Object.getPrototypeOf,Bg=Object.prototype.hasOwnProperty;var zg=(t,e,r)=>e in t?za(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ja=(t,e)=>()=>(t&&(e=t(t=0)),e);var H=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),t2=(t,e)=>{for(var r in e)za(t,r,{get:e[r],enumerable:!0})},r2=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ng(e))!Bg.call(t,n)&&n!==r&&za(t,n,{get:()=>e[n],enumerable:!(i=Lg(e,n))||i.enumerable});return t};var fe=(t,e,r)=>(r=t!=null?Og(Dg(t)):{},r2(e||!t||!t.__esModule?za(r,"default",{value:t,enumerable:!0}):r,t)),jg=t=>r2(za({},"__esModule",{value:!0}),t);var $h=(t,e,r)=>(zg(t,typeof e!="symbol"?e+"":e,r),r),i2=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var Me=(t,e,r)=>(i2(t,e,"read from private field"),r?r.call(t):e.get(t)),yt=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Ze=(t,e,r,i)=>(i2(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),Wh=(t,e,r,i)=>({set _(n){Ze(t,e,n,r)},get _(){return Me(t,e,i)}});var a2=H(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});jl.Nztm2000Quad=void 0;jl.Nztm2000Quad={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid V2",abstract:"",identifier:"NZTM2000Quad",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[419435.9938,-32605867284e-4],upperCorner:[104381901652e-4,6758167443e-3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:139770566007179e-6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:698852830035895e-7,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:3494264150179475e-8,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:17471320750897374e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:8735660375448687e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:4.3678301877243435e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:2.1839150938621718e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:1.0919575469310859e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:545978.7734655429,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:272989.38673277147,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:136494.69336638573,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:68247.34668319287,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:34123.67334159643,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:17061.836670798217,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:8530.918335399108,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:4265.459167699554,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:2132.729583849777,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:1066.3647919248886,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:533.1823959624443,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:266.59119798122214,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:133.29559899061107,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:66.64779949530553,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152}]}});var l2=H(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.Nztm2000=void 0;ql.Nztm2000={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid",abstract:"See https://www.linz.govt.nz/data/linz-data-service/guides-and-documentation/nztm2000-map-tile-service-schema",identifier:"NZTM2000",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[3087e3,274e3],upperCorner:[7173e3,3327e3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:32e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:4},{type:"TileMatrixType",identifier:"1",scaleDenominator:16e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:8},{type:"TileMatrixType",identifier:"2",scaleDenominator:8e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:16},{type:"TileMatrixType",identifier:"3",scaleDenominator:4e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:32},{type:"TileMatrixType",identifier:"4",scaleDenominator:2e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:64},{type:"TileMatrixType",identifier:"5",scaleDenominator:1e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:128},{type:"TileMatrixType",identifier:"6",scaleDenominator:5e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:256},{type:"TileMatrixType",identifier:"7",scaleDenominator:25e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:512},{type:"TileMatrixType",identifier:"8",scaleDenominator:1e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:640,matrixHeight:1280},{type:"TileMatrixType",identifier:"9",scaleDenominator:5e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:1280,matrixHeight:2560},{type:"TileMatrixType",identifier:"10",scaleDenominator:25e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2560,matrixHeight:5120},{type:"TileMatrixType",identifier:"11",scaleDenominator:1e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:6400,matrixHeight:12800},{type:"TileMatrixType",identifier:"12",scaleDenominator:5e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:12800,matrixHeight:25600},{type:"TileMatrixType",identifier:"13",scaleDenominator:2500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:25600,matrixHeight:51200},{type:"TileMatrixType",identifier:"14",scaleDenominator:1e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64e3,matrixHeight:128e3},{type:"TileMatrixType",identifier:"15",scaleDenominator:500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128e3,matrixHeight:256e3},{type:"TileMatrixType",identifier:"16",scaleDenominator:250,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256e3,matrixHeight:512e3}]}});var u2=H(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.Nztm2000=no.Nztm2000Quad=void 0;var Wg=a2();Object.defineProperty(no,"Nztm2000Quad",{enumerable:!0,get:function(){return Wg.Nztm2000Quad}});var Fg=l2();Object.defineProperty(no,"Nztm2000",{enumerable:!0,get:function(){return Fg.Nztm2000}})});var Zn=H((Wl,c2)=>{(function(t,e){typeof Wl=="object"&&typeof c2<"u"?e(Wl):typeof define=="function"&&define.amd?define(["exports"],e):e(t.ULID={})})(Wl,function(t){"use strict";function e(C){var T=new Error(C);return T.source="ulid",T}var r="0123456789ABCDEFGHJKMNPQRSTVWXYZ",i=r.length,n=Math.pow(2,48)-1,s=10,a=16;function c(C,T,O){return T>C.length-1?C:C.substr(0,T)+O+C.substr(T+1)}function d(C){for(var T=void 0,O=C.length,B=void 0,z=void 0,G=i-1;!T&&O-->=0;){if(B=C[O],z=r.indexOf(B),z===-1)throw e("incorrectly encoded string");if(z===G){C=c(C,O,r[0]);continue}T=c(C,O,r[z+1])}if(typeof T=="string")return T;throw e("cannot increment this string")}function p(C){var T=Math.floor(C()*i);return T===i&&(T=i-1),r.charAt(T)}function m(C,T){if(isNaN(C))throw new Error(C+" must be a number");if(C>n)throw e("cannot encode time greater than "+n);if(C<0)throw e("time must be positive");if(Number.isInteger(C)===!1)throw e("time must be an integer");for(var O=void 0,B="";T>0;T--)O=C%i,B=r.charAt(O)+B,C=(C-O)/i;return B}function w(C,T){for(var O="";C>0;C--)O=p(T)+O;return O}function S(C){if(C.length!==s+a)throw e("malformed ulid");var T=C.substr(0,s).split("").reverse().reduce(function(O,B,z){var G=r.indexOf(B);if(G===-1)throw e("invalid character found: "+B);return O+=G*Math.pow(i,z)},0);if(T>n)throw e("malformed ulid, timestamp too large");return T}function v(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,T=arguments[1];T||(T=typeof window<"u"?window:null);var O=T&&(T.crypto||T.msCrypto);if(O)return function(){var z=new Uint8Array(1);return O.getRandomValues(z),z[0]/255};try{var B=require("crypto");return function(){return B.randomBytes(1).readUInt8()/255}}catch{}if(C){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw e("secure crypto unusable, insecure Math.random not allowed")}function R(C){return C||(C=v()),function(O){return isNaN(O)&&(O=Date.now()),m(O,s)+w(a,C)}}function x(C){C||(C=v());var T=0,O=void 0;return function(z){if(isNaN(z)&&(z=Date.now()),z<=T){var G=O=d(O);return m(T,s)+G}T=z;var te=O=w(a,C);return m(z,s)+te}}var A=R();t.replaceCharAt=c,t.incrementBase32=d,t.randomChar=p,t.encodeTime=m,t.encodeRandom=w,t.decodeTime=S,t.detectPrng=v,t.factory=R,t.monotonicFactory=x,t.ulid=A,Object.defineProperty(t,"__esModule",{value:!0})})});var y2=H((Kl,g2)=>{(function(t,e){typeof Kl=="object"&&typeof g2<"u"?e(Kl):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(Kl,function(t){"use strict";let e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:l=>`Symbol(${l})`;function r(){}function i(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}let n=i();function s(l){return typeof l=="object"&&l!==null||typeof l=="function"}let a=r,c=Promise,d=Promise.prototype.then,p=Promise.resolve.bind(c),m=Promise.reject.bind(c);function w(l){return new c(l)}function S(l){return p(l)}function v(l){return m(l)}function R(l,f,b){return d.call(l,f,b)}function x(l,f,b){R(R(l,f,b),void 0,a)}function A(l,f){x(l,f)}function C(l,f){x(l,void 0,f)}function T(l,f,b){return R(l,f,b)}function O(l){R(l,void 0,a)}let B=(()=>{let l=n&&n.queueMicrotask;if(typeof l=="function")return l;let f=S(void 0);return b=>R(f,b)})();function z(l,f,b){if(typeof l!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(l,f,b)}function G(l,f,b){try{return S(z(l,f,b))}catch(I){return v(I)}}let te=16384;class se{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(f){let b=this._back,I=b;b._elements.length===te-1&&(I={_elements:[],_next:void 0}),b._elements.push(f),I!==b&&(this._back=I,b._next=I),++this._size}shift(){let f=this._front,b=f,I=this._cursor,L=I+1,j=f._elements,$=j[I];return L===te&&(b=f._next,L=0),--this._size,this._cursor=L,f!==b&&(this._front=b),j[I]=void 0,$}forEach(f){let b=this._cursor,I=this._front,L=I._elements;for(;(b!==L.length||I._next!==void 0)&&!(b===L.length&&(I=I._next,L=I._elements,b=0,L.length===0));)f(L[b]),++b}peek(){let f=this._front,b=this._cursor;return f._elements[b]}}function ke(l,f){l._ownerReadableStream=f,f._reader=l,f._state==="readable"?ot(l):f._state==="closed"?Fr(l):Rt(l,f._storedError)}function De(l,f){let b=l._ownerReadableStream;return Qt(b,f)}function Pe(l){l._ownerReadableStream._state==="readable"?Kt(l,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Nc(l,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),l._ownerReadableStream._reader=void 0,l._ownerReadableStream=void 0}function We(l){return new TypeError("Cannot "+l+" a stream using a released reader")}function ot(l){l._closedPromise=w((f,b)=>{l._closedPromise_resolve=f,l._closedPromise_reject=b})}function Rt(l,f){ot(l),Kt(l,f)}function Fr(l){ot(l),na(l)}function Kt(l,f){l._closedPromise_reject!==void 0&&(O(l._closedPromise),l._closedPromise_reject(f),l._closedPromise_resolve=void 0,l._closedPromise_reject=void 0)}function Nc(l,f){Rt(l,f)}function na(l){l._closedPromise_resolve!==void 0&&(l._closedPromise_resolve(void 0),l._closedPromise_resolve=void 0,l._closedPromise_reject=void 0)}let vi=e("[[AbortSteps]]"),N1=e("[[ErrorSteps]]"),sa=e("[[CancelSteps]]"),Zt=e("[[PullSteps]]"),D1=Number.isFinite||function(l){return typeof l=="number"&&isFinite(l)},B1=Math.trunc||function(l){return l<0?Math.ceil(l):Math.floor(l)};function dt(l){return typeof l=="object"||typeof l=="function"}function Pr(l,f){if(l!==void 0&&!dt(l))throw new TypeError(`${f} is not an object.`)}function Jt(l,f){if(typeof l!="function")throw new TypeError(`${f} is not a function.`)}function Dc(l){return typeof l=="object"&&l!==null||typeof l=="function"}function z1(l,f){if(!Dc(l))throw new TypeError(`${f} is not an object.`)}function Tr(l,f,b){if(l===void 0)throw new TypeError(`Parameter ${f} is required in '${b}'.`)}function oa(l,f,b){if(l===void 0)throw new TypeError(`${f} is required in '${b}'.`)}function aa(l){return Number(l)}function j1(l){return l===0?0:l}function Bc(l){return j1(B1(l))}function la(l,f){let I=Number.MAX_SAFE_INTEGER,L=Number(l);if(L=j1(L),!D1(L))throw new TypeError(`${f} is not a finite number`);if(L=Bc(L),L<0||L>I)throw new TypeError(`${f} is outside the accepted range of ${0} to ${I}, inclusive`);return!D1(L)||L===0?0:L}function Nt(l,f){if(!Qr(l))throw new TypeError(`${f} is not a ReadableStream.`)}function fr(l){return new An(l)}function Z(l,f){l._reader._readRequests.push(f)}function Ct(l,f,b){let L=l._reader._readRequests.shift();b?L._closeSteps():L._chunkSteps(f)}function Hr(l){return l._reader._readRequests.length}function q1(l){let f=l._reader;return!(f===void 0||!Gr(f))}class An{constructor(f){if(Tr(f,1,"ReadableStreamDefaultReader"),Nt(f,"First parameter"),ei(f))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ke(this,f),this._readRequests=new se}get closed(){return Gr(this)?this._closedPromise:v(Cs("closed"))}cancel(f=void 0){return Gr(this)?this._ownerReadableStream===void 0?v(We("cancel")):De(this,f):v(Cs("cancel"))}read(){if(!Gr(this))return v(Cs("read"));if(this._ownerReadableStream===void 0)return v(We("read from"));let f,b,I=w((j,$)=>{f=j,b=$});return Pn(this,{_chunkSteps:j=>f({value:j,done:!1}),_closeSteps:()=>f({value:void 0,done:!0}),_errorSteps:j=>b(j)}),I}releaseLock(){if(!Gr(this))throw Cs("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Pe(this)}}}Object.defineProperties(An.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(An.prototype,e.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function Gr(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_readRequests")?!1:l instanceof An}function Pn(l,f){let b=l._ownerReadableStream;b._disturbed=!0,b._state==="closed"?f._closeSteps():b._state==="errored"?f._errorSteps(b._storedError):b._readableStreamController[Zt](f)}function Cs(l){return new TypeError(`ReadableStreamDefaultReader.prototype.${l} can only be used on a ReadableStreamDefaultReader`)}let U1=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class ua{constructor(f,b){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=f,this._preventCancel=b}next(){let f=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?T(this._ongoingPromise,f,f):f(),this._ongoingPromise}return(f){let b=()=>this._returnSteps(f);return this._ongoingPromise?T(this._ongoingPromise,b,b):b()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let f=this._reader;if(f._ownerReadableStream===void 0)return v(We("iterate"));let b,I,L=w(($,ee)=>{b=$,I=ee});return Pn(f,{_chunkSteps:$=>{this._ongoingPromise=void 0,B(()=>b({value:$,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Pe(f),b({value:void 0,done:!0})},_errorSteps:$=>{this._ongoingPromise=void 0,this._isFinished=!0,Pe(f),I($)}}),L}_returnSteps(f){if(this._isFinished)return Promise.resolve({value:f,done:!0});this._isFinished=!0;let b=this._reader;if(b._ownerReadableStream===void 0)return v(We("finish iterating"));if(!this._preventCancel){let I=De(b,f);return Pe(b),T(I,()=>({value:f,done:!0}))}return Pe(b),S({value:f,done:!0})}}let $1={next(){return W1(this)?this._asyncIteratorImpl.next():v(Tn("next"))},return(l){return W1(this)?this._asyncIteratorImpl.return(l):v(Tn("return"))}};U1!==void 0&&Object.setPrototypeOf($1,U1);function zc(l,f){let b=fr(l),I=new ua(b,f),L=Object.create($1);return L._asyncIteratorImpl=I,L}function W1(l){if(!s(l)||!Object.prototype.hasOwnProperty.call(l,"_asyncIteratorImpl"))return!1;try{return l._asyncIteratorImpl instanceof ua}catch{return!1}}function Tn(l){return new TypeError(`ReadableStreamAsyncIterator.${l} can only be used on a ReadableSteamAsyncIterator`)}let In=Number.isNaN||function(l){return l!==l};function Wi(l){return l.slice()}function F1(l,f,b,I,L){new Uint8Array(l).set(new Uint8Array(b,I,L),f)}function Yd(l){return l}function As(l){return!1}function le(l,f,b){if(l.slice)return l.slice(f,b);let I=b-f,L=new ArrayBuffer(I);return F1(L,0,l,f,I),L}function jc(l){return!(typeof l!="number"||In(l)||l<0)}function H1(l){let f=le(l.buffer,l.byteOffset,l.byteOffset+l.byteLength);return new Uint8Array(f)}function ca(l){let f=l._queue.shift();return l._queueTotalSize-=f.size,l._queueTotalSize<0&&(l._queueTotalSize=0),f.value}function Qe(l,f,b){if(!jc(b)||b===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");l._queue.push({value:f,size:b}),l._queueTotalSize+=b}function qc(l){return l._queue.peek().value}function at(l){l._queue=new se,l._queueTotalSize=0}class kn{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!ha(this))throw wa("view");return this._view}respond(f){if(!ha(this))throw wa("respond");if(Tr(f,1,"respond"),f=la(f,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");As(this._view.buffer),Dn(this._associatedReadableByteStreamController,f)}respondWithNewView(f){if(!ha(this))throw wa("respondWithNewView");if(Tr(f,1,"respondWithNewView"),!ArrayBuffer.isView(f))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");As(f.buffer),Ps(this._associatedReadableByteStreamController,f)}}Object.defineProperties(kn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(kn.prototype,e.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class wi{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Vr(this))throw xi("byobRequest");return Si(this)}get desiredSize(){if(!Vr(this))throw xi("desiredSize");return J1(this)}close(){if(!Vr(this))throw xi("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let f=this._controlledReadableByteStream._state;if(f!=="readable")throw new TypeError(`The stream (in ${f} state) is not in the readable state and cannot be closed`);nt(this)}enqueue(f){if(!Vr(this))throw xi("enqueue");if(Tr(f,1,"enqueue"),!ArrayBuffer.isView(f))throw new TypeError("chunk must be an array buffer view");if(f.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(f.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let b=this._controlledReadableByteStream._state;if(b!=="readable")throw new TypeError(`The stream (in ${b} state) is not in the readable state and cannot be enqueued to`);pt(this,f)}error(f=void 0){if(!Vr(this))throw xi("error");mt(this,f)}[sa](f){On(this),at(this);let b=this._cancelAlgorithm(f);return Ir(this),b}[Zt](f){let b=this._controlledReadableByteStream;if(this._queueTotalSize>0){let L=this._queue.shift();this._queueTotalSize-=L.byteLength,V1(this);let j=new Uint8Array(L.buffer,L.byteOffset,L.byteLength);f._chunkSteps(j);return}let I=this._autoAllocateChunkSize;if(I!==void 0){let L;try{L=new ArrayBuffer(I)}catch($){f._errorSteps($);return}let j={buffer:L,bufferByteLength:I,byteOffset:0,byteLength:I,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(j)}Z(b,f),_i(this)}}Object.defineProperties(wi.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(wi.prototype,e.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Vr(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_controlledReadableByteStream")?!1:l instanceof wi}function ha(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_associatedReadableByteStreamController")?!1:l instanceof kn}function _i(l){if(!Z1(l))return;if(l._pulling){l._pullAgain=!0;return}l._pulling=!0;let b=l._pullAlgorithm();x(b,()=>{l._pulling=!1,l._pullAgain&&(l._pullAgain=!1,_i(l))},I=>{mt(l,I)})}function On(l){Fi(l),l._pendingPullIntos=new se}function fa(l,f){let b=!1;l._state==="closed"&&(b=!0);let I=da(f);f.readerType==="default"?Ct(l,I,b):Uc(l,I,b)}function da(l){let f=l.bytesFilled,b=l.elementSize;return new l.viewConstructor(l.buffer,l.byteOffset,f/b)}function Ln(l,f,b,I){l._queue.push({buffer:f,byteOffset:b,byteLength:I}),l._queueTotalSize+=I}function G1(l,f){let b=f.elementSize,I=f.bytesFilled-f.bytesFilled%b,L=Math.min(l._queueTotalSize,f.byteLength-f.bytesFilled),j=f.bytesFilled+L,$=j-j%b,ee=L,ce=!1;$>I&&(ee=$-f.bytesFilled,ce=!0);let ve=l._queue;for(;ee>0;){let Ce=ve.peek(),Ae=Math.min(ee,Ce.byteLength),et=f.byteOffset+f.bytesFilled;F1(f.buffer,et,Ce.buffer,Ce.byteOffset,Ae),Ce.byteLength===Ae?ve.shift():(Ce.byteOffset+=Ae,Ce.byteLength-=Ae),l._queueTotalSize-=Ae,pa(l,Ae,f),ee-=Ae}return ce}function pa(l,f,b){b.bytesFilled+=f}function V1(l){l._queueTotalSize===0&&l._closeRequested?(Ir(l),Fn(l._controlledReadableByteStream)):_i(l)}function Fi(l){l._byobRequest!==null&&(l._byobRequest._associatedReadableByteStreamController=void 0,l._byobRequest._view=null,l._byobRequest=null)}function ma(l){for(;l._pendingPullIntos.length>0;){if(l._queueTotalSize===0)return;let f=l._pendingPullIntos.peek();G1(l,f)&&(Nn(l),fa(l._controlledReadableByteStream,f))}}function ga(l,f,b){let I=l._controlledReadableByteStream,L=1;f.constructor!==DataView&&(L=f.constructor.BYTES_PER_ELEMENT);let j=f.constructor,$=f.buffer,ee={buffer:$,bufferByteLength:$.byteLength,byteOffset:f.byteOffset,byteLength:f.byteLength,bytesFilled:0,elementSize:L,viewConstructor:j,readerType:"byob"};if(l._pendingPullIntos.length>0){l._pendingPullIntos.push(ee),Q1(I,b);return}if(I._state==="closed"){let ce=new j(ee.buffer,ee.byteOffset,0);b._closeSteps(ce);return}if(l._queueTotalSize>0){if(G1(l,ee)){let ce=da(ee);V1(l),b._chunkSteps(ce);return}if(l._closeRequested){let ce=new TypeError("Insufficient bytes to fill elements in the given buffer");mt(l,ce),b._errorSteps(ce);return}}l._pendingPullIntos.push(ee),Q1(I,b),_i(l)}function K1(l,f){let b=l._controlledReadableByteStream;if(Sa(b))for(;_a(b)>0;){let I=Nn(l);fa(b,I)}}function Dt(l,f,b){if(pa(l,f,b),b.bytesFilled<b.elementSize)return;Nn(l);let I=b.bytesFilled%b.elementSize;if(I>0){let L=b.byteOffset+b.bytesFilled,j=le(b.buffer,L-I,L);Ln(l,j,0,j.byteLength)}b.bytesFilled-=I,fa(l._controlledReadableByteStream,b),ma(l)}function ya(l,f){let b=l._pendingPullIntos.peek();Fi(l),l._controlledReadableByteStream._state==="closed"?K1(l):Dt(l,f,b),_i(l)}function Nn(l){return l._pendingPullIntos.shift()}function Z1(l){let f=l._controlledReadableByteStream;return f._state!=="readable"||l._closeRequested||!l._started?!1:!!(q1(f)&&Hr(f)>0||Sa(f)&&_a(f)>0||J1(l)>0)}function Ir(l){l._pullAlgorithm=void 0,l._cancelAlgorithm=void 0}function nt(l){let f=l._controlledReadableByteStream;if(!(l._closeRequested||f._state!=="readable")){if(l._queueTotalSize>0){l._closeRequested=!0;return}if(l._pendingPullIntos.length>0&&l._pendingPullIntos.peek().bytesFilled>0){let I=new TypeError("Insufficient bytes to fill elements in the given buffer");throw mt(l,I),I}Ir(l),Fn(f)}}function pt(l,f){let b=l._controlledReadableByteStream;if(l._closeRequested||b._state!=="readable")return;let I=f.buffer,L=f.byteOffset,j=f.byteLength,$=I;if(l._pendingPullIntos.length>0){let ee=l._pendingPullIntos.peek();As(ee.buffer),ee.buffer=ee.buffer}if(Fi(l),q1(b))if(Hr(b)===0)Ln(l,$,L,j);else{l._pendingPullIntos.length>0&&Nn(l);let ee=new Uint8Array($,L,j);Ct(b,ee,!1)}else Sa(b)?(Ln(l,$,L,j),ma(l)):Ln(l,$,L,j);_i(l)}function mt(l,f){let b=l._controlledReadableByteStream;b._state==="readable"&&(On(l),at(l),Ir(l),Sl(b,f))}function Si(l){if(l._byobRequest===null&&l._pendingPullIntos.length>0){let f=l._pendingPullIntos.peek(),b=new Uint8Array(f.buffer,f.byteOffset+f.bytesFilled,f.byteLength-f.bytesFilled),I=Object.create(kn.prototype);Y1(I,l,b),l._byobRequest=I}return l._byobRequest}function J1(l){let f=l._controlledReadableByteStream._state;return f==="errored"?null:f==="closed"?0:l._strategyHWM-l._queueTotalSize}function Dn(l,f){let b=l._pendingPullIntos.peek();if(l._controlledReadableByteStream._state==="closed"){if(f!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(f===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(b.bytesFilled+f>b.byteLength)throw new RangeError("bytesWritten out of range")}b.buffer=b.buffer,ya(l,f)}function Ps(l,f){let b=l._pendingPullIntos.peek();if(l._controlledReadableByteStream._state==="closed"){if(f.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(f.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(b.byteOffset+b.bytesFilled!==f.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(b.bufferByteLength!==f.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(b.bytesFilled+f.byteLength>b.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let L=f.byteLength;b.buffer=f.buffer,ya(l,L)}function ba(l,f,b,I,L,j,$){f._controlledReadableByteStream=l,f._pullAgain=!1,f._pulling=!1,f._byobRequest=null,f._queue=f._queueTotalSize=void 0,at(f),f._closeRequested=!1,f._started=!1,f._strategyHWM=j,f._pullAlgorithm=I,f._cancelAlgorithm=L,f._autoAllocateChunkSize=$,f._pendingPullIntos=new se,l._readableStreamController=f;let ee=b();x(S(ee),()=>{f._started=!0,_i(f)},ce=>{mt(f,ce)})}function va(l,f,b){let I=Object.create(wi.prototype),L=()=>{},j=()=>S(void 0),$=()=>S(void 0);f.start!==void 0&&(L=()=>f.start(I)),f.pull!==void 0&&(j=()=>f.pull(I)),f.cancel!==void 0&&($=ce=>f.cancel(ce));let ee=f.autoAllocateChunkSize;if(ee===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");ba(l,I,L,j,$,b,ee)}function Y1(l,f,b){l._associatedReadableByteStreamController=f,l._view=b}function wa(l){return new TypeError(`ReadableStreamBYOBRequest.prototype.${l} can only be used on a ReadableStreamBYOBRequest`)}function xi(l){return new TypeError(`ReadableByteStreamController.prototype.${l} can only be used on a ReadableByteStreamController`)}function X1(l){return new Hi(l)}function Q1(l,f){l._reader._readIntoRequests.push(f)}function Uc(l,f,b){let L=l._reader._readIntoRequests.shift();b?L._closeSteps(f):L._chunkSteps(f)}function _a(l){return l._reader._readIntoRequests.length}function Sa(l){let f=l._reader;return!(f===void 0||!Mi(f))}class Hi{constructor(f){if(Tr(f,1,"ReadableStreamBYOBReader"),Nt(f,"First parameter"),ei(f))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Vr(f._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ke(this,f),this._readIntoRequests=new se}get closed(){return Mi(this)?this._closedPromise:v(Ts("closed"))}cancel(f=void 0){return Mi(this)?this._ownerReadableStream===void 0?v(We("cancel")):De(this,f):v(Ts("cancel"))}read(f){if(!Mi(this))return v(Ts("read"));if(!ArrayBuffer.isView(f))return v(new TypeError("view must be an array buffer view"));if(f.byteLength===0)return v(new TypeError("view must have non-zero byteLength"));if(f.buffer.byteLength===0)return v(new TypeError("view's buffer must have non-zero byteLength"));if(As(f.buffer),this._ownerReadableStream===void 0)return v(We("read from"));let b,I,L=w(($,ee)=>{b=$,I=ee});return el(this,f,{_chunkSteps:$=>b({value:$,done:!1}),_closeSteps:$=>b({value:$,done:!0}),_errorSteps:$=>I($)}),L}releaseLock(){if(!Mi(this))throw Ts("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Pe(this)}}}Object.defineProperties(Hi.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Hi.prototype,e.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Mi(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_readIntoRequests")?!1:l instanceof Hi}function el(l,f,b){let I=l._ownerReadableStream;I._disturbed=!0,I._state==="errored"?b._errorSteps(I._storedError):ga(I._readableStreamController,f,b)}function Ts(l){return new TypeError(`ReadableStreamBYOBReader.prototype.${l} can only be used on a ReadableStreamBYOBReader`)}function dr(l,f){let{highWaterMark:b}=l;if(b===void 0)return f;if(In(b)||b<0)throw new RangeError("Invalid highWaterMark");return b}function Is(l){let{size:f}=l;return f||(()=>1)}function ks(l,f){Pr(l,f);let b=l?.highWaterMark,I=l?.size;return{highWaterMark:b===void 0?void 0:aa(b),size:I===void 0?void 0:tl(I,`${f} has member 'size' that`)}}function tl(l,f){return Jt(l,f),b=>aa(l(b))}function rl(l,f){Pr(l,f);let b=l?.abort,I=l?.close,L=l?.start,j=l?.type,$=l?.write;return{abort:b===void 0?void 0:il(b,l,`${f} has member 'abort' that`),close:I===void 0?void 0:$c(I,l,`${f} has member 'close' that`),start:L===void 0?void 0:Wc(L,l,`${f} has member 'start' that`),write:$===void 0?void 0:Fc($,l,`${f} has member 'write' that`),type:j}}function il(l,f,b){return Jt(l,b),I=>G(l,f,[I])}function $c(l,f,b){return Jt(l,b),()=>G(l,f,[])}function Wc(l,f,b){return Jt(l,b),I=>z(l,f,[I])}function Fc(l,f,b){return Jt(l,b),(I,L)=>G(l,f,[I,L])}function nl(l,f){if(!Vi(l))throw new TypeError(`${f} is not a WritableStream.`)}function Hc(l){if(typeof l!="object"||l===null)return!1;try{return typeof l.aborted=="boolean"}catch{return!1}}let Gc=typeof AbortController=="function";function Vc(){if(Gc)return new AbortController}class Gi{constructor(f={},b={}){f===void 0?f=null:z1(f,"First parameter");let I=ks(b,"Second parameter"),L=rl(f,"First parameter");if(xa(this),L.type!==void 0)throw new RangeError("Invalid type is specified");let $=Is(I),ee=dr(I,1);sh(this,L,ee,$)}get locked(){if(!Vi(this))throw zs("locked");return Ki(this)}abort(f=void 0){return Vi(this)?Ki(this)?v(new TypeError("Cannot abort a stream that already has a writer")):Os(this,f):v(zs("abort"))}close(){return Vi(this)?Ki(this)?v(new TypeError("Cannot close a stream that already has a writer")):Yt(this)?v(new TypeError("Cannot close an already-closing stream")):sl(this):v(zs("close"))}getWriter(){if(!Vi(this))throw zs("getWriter");return Bn(this)}}Object.defineProperties(Gi.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Gi.prototype,e.toStringTag,{value:"WritableStream",configurable:!0});function Bn(l){return new zn(l)}function Kc(l,f,b,I,L=1,j=()=>1){let $=Object.create(Gi.prototype);xa($);let ee=Object.create(Kr.prototype);return hl($,ee,l,f,b,I,L,j),$}function xa(l){l._state="writable",l._storedError=void 0,l._writer=void 0,l._writableStreamController=void 0,l._writeRequests=new se,l._inFlightWriteRequest=void 0,l._closeRequest=void 0,l._inFlightCloseRequest=void 0,l._pendingAbortRequest=void 0,l._backpressure=!1}function Vi(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_writableStreamController")?!1:l instanceof Gi}function Ki(l){return l._writer!==void 0}function Os(l,f){var b;if(l._state==="closed"||l._state==="errored")return S(void 0);l._writableStreamController._abortReason=f,(b=l._writableStreamController._abortController)===null||b===void 0||b.abort();let I=l._state;if(I==="closed"||I==="errored")return S(void 0);if(l._pendingAbortRequest!==void 0)return l._pendingAbortRequest._promise;let L=!1;I==="erroring"&&(L=!0,f=void 0);let j=w(($,ee)=>{l._pendingAbortRequest={_promise:void 0,_resolve:$,_reject:ee,_reason:f,_wasAlreadyErroring:L}});return l._pendingAbortRequest._promise=j,L||Zi(l,f),j}function sl(l){let f=l._state;if(f==="closed"||f==="errored")return v(new TypeError(`The stream (in ${f} state) is not in the writable state and cannot be closed`));let b=w((L,j)=>{let $={_resolve:L,_reject:j};l._closeRequest=$}),I=l._writer;return I!==void 0&&l._backpressure&&f==="writable"&&Oa(I),oh(l._writableStreamController),b}function Zc(l){return w((b,I)=>{let L={_resolve:b,_reject:I};l._writeRequests.push(L)})}function Ls(l,f){if(l._state==="writable"){Zi(l,f);return}Ma(l)}function Zi(l,f){let b=l._writableStreamController;l._state="erroring",l._storedError=f;let I=l._writer;I!==void 0&&al(I,f),!Qc(l)&&b._started&&Ma(l)}function Ma(l){l._state="errored",l._writableStreamController[N1]();let f=l._storedError;if(l._writeRequests.forEach(L=>{L._reject(f)}),l._writeRequests=new se,l._pendingAbortRequest===void 0){Ns(l);return}let b=l._pendingAbortRequest;if(l._pendingAbortRequest=void 0,b._wasAlreadyErroring){b._reject(f),Ns(l);return}let I=l._writableStreamController[vi](b._reason);x(I,()=>{b._resolve(),Ns(l)},L=>{b._reject(L),Ns(l)})}function Jc(l){l._inFlightWriteRequest._resolve(void 0),l._inFlightWriteRequest=void 0}function Ea(l,f){l._inFlightWriteRequest._reject(f),l._inFlightWriteRequest=void 0,Ls(l,f)}function Yc(l){l._inFlightCloseRequest._resolve(void 0),l._inFlightCloseRequest=void 0,l._state==="erroring"&&(l._storedError=void 0,l._pendingAbortRequest!==void 0&&(l._pendingAbortRequest._resolve(),l._pendingAbortRequest=void 0)),l._state="closed";let b=l._writer;b!==void 0&&ml(b)}function Xc(l,f){l._inFlightCloseRequest._reject(f),l._inFlightCloseRequest=void 0,l._pendingAbortRequest!==void 0&&(l._pendingAbortRequest._reject(f),l._pendingAbortRequest=void 0),Ls(l,f)}function Yt(l){return!(l._closeRequest===void 0&&l._inFlightCloseRequest===void 0)}function Qc(l){return!(l._inFlightWriteRequest===void 0&&l._inFlightCloseRequest===void 0)}function eh(l){l._inFlightCloseRequest=l._closeRequest,l._closeRequest=void 0}function th(l){l._inFlightWriteRequest=l._writeRequests.shift()}function Ns(l){l._closeRequest!==void 0&&(l._closeRequest._reject(l._storedError),l._closeRequest=void 0);let f=l._writer;f!==void 0&&Ia(f,l._storedError)}function Ji(l,f){let b=l._writer;b!==void 0&&f!==l._backpressure&&(f?dh(b):Oa(b)),l._backpressure=f}class zn{constructor(f){if(Tr(f,1,"WritableStreamDefaultWriter"),nl(f,"First parameter"),Ki(f))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=f,f._writer=this;let b=f._state;if(b==="writable")!Yt(f)&&f._backpressure?qs(this):gl(this),js(this);else if(b==="erroring")ka(this,f._storedError),js(this);else if(b==="closed")gl(this),hh(this);else{let I=f._storedError;ka(this,I),pl(this,I)}}get closed(){return Ei(this)?this._closedPromise:v(Ri("closed"))}get desiredSize(){if(!Ei(this))throw Ri("desiredSize");if(this._ownerWritableStream===void 0)throw jn("desiredSize");return nh(this)}get ready(){return Ei(this)?this._readyPromise:v(Ri("ready"))}abort(f=void 0){return Ei(this)?this._ownerWritableStream===void 0?v(jn("abort")):rh(this,f):v(Ri("abort"))}close(){if(!Ei(this))return v(Ri("close"));let f=this._ownerWritableStream;return f===void 0?v(jn("close")):Yt(f)?v(new TypeError("Cannot close an already-closing stream")):ol(this)}releaseLock(){if(!Ei(this))throw Ri("releaseLock");this._ownerWritableStream!==void 0&&ll(this)}write(f=void 0){return Ei(this)?this._ownerWritableStream===void 0?v(jn("write to")):ul(this,f):v(Ri("write"))}}Object.defineProperties(zn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(zn.prototype,e.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Ei(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_ownerWritableStream")?!1:l instanceof zn}function rh(l,f){let b=l._ownerWritableStream;return Os(b,f)}function ol(l){let f=l._ownerWritableStream;return sl(f)}function ih(l){let f=l._ownerWritableStream,b=f._state;return Yt(f)||b==="closed"?S(void 0):b==="errored"?v(f._storedError):ol(l)}function Ra(l,f){l._closedPromiseState==="pending"?Ia(l,f):fh(l,f)}function al(l,f){l._readyPromiseState==="pending"?yl(l,f):ph(l,f)}function nh(l){let f=l._ownerWritableStream,b=f._state;return b==="errored"||b==="erroring"?null:b==="closed"?0:fl(f._writableStreamController)}function ll(l){let f=l._ownerWritableStream,b=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");al(l,b),Ra(l,b),f._writer=void 0,l._ownerWritableStream=void 0}function ul(l,f){let b=l._ownerWritableStream,I=b._writableStreamController,L=ah(I,f);if(b!==l._ownerWritableStream)return v(jn("write to"));let j=b._state;if(j==="errored")return v(b._storedError);if(Yt(b)||j==="closed")return v(new TypeError("The stream is closing or closed and cannot be written to"));if(j==="erroring")return v(b._storedError);let $=Zc(b);return lh(I,f,L),$}let cl={};class Kr{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Ca(this))throw Ta("abortReason");return this._abortReason}get signal(){if(!Ca(this))throw Ta("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(f=void 0){if(!Ca(this))throw Ta("error");this._controlledWritableStream._state==="writable"&&dl(this,f)}[vi](f){let b=this._abortAlgorithm(f);return Ds(this),b}[N1](){at(this)}}Object.defineProperties(Kr.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Kr.prototype,e.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Ca(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_controlledWritableStream")?!1:l instanceof Kr}function hl(l,f,b,I,L,j,$,ee){f._controlledWritableStream=l,l._writableStreamController=f,f._queue=void 0,f._queueTotalSize=void 0,at(f),f._abortReason=void 0,f._abortController=Vc(),f._started=!1,f._strategySizeAlgorithm=ee,f._strategyHWM=$,f._writeAlgorithm=I,f._closeAlgorithm=L,f._abortAlgorithm=j;let ce=Pa(f);Ji(l,ce);let ve=b(),Ce=S(ve);x(Ce,()=>{f._started=!0,Bs(f)},Ae=>{f._started=!0,Ls(l,Ae)})}function sh(l,f,b,I){let L=Object.create(Kr.prototype),j=()=>{},$=()=>S(void 0),ee=()=>S(void 0),ce=()=>S(void 0);f.start!==void 0&&(j=()=>f.start(L)),f.write!==void 0&&($=ve=>f.write(ve,L)),f.close!==void 0&&(ee=()=>f.close()),f.abort!==void 0&&(ce=ve=>f.abort(ve)),hl(l,L,j,$,ee,ce,b,I)}function Ds(l){l._writeAlgorithm=void 0,l._closeAlgorithm=void 0,l._abortAlgorithm=void 0,l._strategySizeAlgorithm=void 0}function oh(l){Qe(l,cl,0),Bs(l)}function ah(l,f){try{return l._strategySizeAlgorithm(f)}catch(b){return Aa(l,b),1}}function fl(l){return l._strategyHWM-l._queueTotalSize}function lh(l,f,b){try{Qe(l,f,b)}catch(L){Aa(l,L);return}let I=l._controlledWritableStream;if(!Yt(I)&&I._state==="writable"){let L=Pa(l);Ji(I,L)}Bs(l)}function Bs(l){let f=l._controlledWritableStream;if(!l._started||f._inFlightWriteRequest!==void 0)return;if(f._state==="erroring"){Ma(f);return}if(l._queue.length===0)return;let I=qc(l);I===cl?uh(l):ch(l,I)}function Aa(l,f){l._controlledWritableStream._state==="writable"&&dl(l,f)}function uh(l){let f=l._controlledWritableStream;eh(f),ca(l);let b=l._closeAlgorithm();Ds(l),x(b,()=>{Yc(f)},I=>{Xc(f,I)})}function ch(l,f){let b=l._controlledWritableStream;th(b);let I=l._writeAlgorithm(f);x(I,()=>{Jc(b);let L=b._state;if(ca(l),!Yt(b)&&L==="writable"){let j=Pa(l);Ji(b,j)}Bs(l)},L=>{b._state==="writable"&&Ds(l),Ea(b,L)})}function Pa(l){return fl(l)<=0}function dl(l,f){let b=l._controlledWritableStream;Ds(l),Zi(b,f)}function zs(l){return new TypeError(`WritableStream.prototype.${l} can only be used on a WritableStream`)}function Ta(l){return new TypeError(`WritableStreamDefaultController.prototype.${l} can only be used on a WritableStreamDefaultController`)}function Ri(l){return new TypeError(`WritableStreamDefaultWriter.prototype.${l} can only be used on a WritableStreamDefaultWriter`)}function jn(l){return new TypeError("Cannot "+l+" a stream using a released writer")}function js(l){l._closedPromise=w((f,b)=>{l._closedPromise_resolve=f,l._closedPromise_reject=b,l._closedPromiseState="pending"})}function pl(l,f){js(l),Ia(l,f)}function hh(l){js(l),ml(l)}function Ia(l,f){l._closedPromise_reject!==void 0&&(O(l._closedPromise),l._closedPromise_reject(f),l._closedPromise_resolve=void 0,l._closedPromise_reject=void 0,l._closedPromiseState="rejected")}function fh(l,f){pl(l,f)}function ml(l){l._closedPromise_resolve!==void 0&&(l._closedPromise_resolve(void 0),l._closedPromise_resolve=void 0,l._closedPromise_reject=void 0,l._closedPromiseState="resolved")}function qs(l){l._readyPromise=w((f,b)=>{l._readyPromise_resolve=f,l._readyPromise_reject=b}),l._readyPromiseState="pending"}function ka(l,f){qs(l),yl(l,f)}function gl(l){qs(l),Oa(l)}function yl(l,f){l._readyPromise_reject!==void 0&&(O(l._readyPromise),l._readyPromise_reject(f),l._readyPromise_resolve=void 0,l._readyPromise_reject=void 0,l._readyPromiseState="rejected")}function dh(l){qs(l)}function ph(l,f){ka(l,f)}function Oa(l){l._readyPromise_resolve!==void 0&&(l._readyPromise_resolve(void 0),l._readyPromise_resolve=void 0,l._readyPromise_reject=void 0,l._readyPromiseState="fulfilled")}let ht=typeof DOMException<"u"?DOMException:void 0;function qn(l){if(!(typeof l=="function"||typeof l=="object"))return!1;try{return new l,!0}catch{return!1}}function Un(){let l=function(b,I){this.message=b||"",this.name=I||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return l.prototype=Object.create(Error.prototype),Object.defineProperty(l.prototype,"constructor",{value:l,writable:!0,configurable:!0}),l}let $n=qn(ht)?ht:Un();function Yi(l,f,b,I,L,j){let $=fr(l),ee=Bn(f);l._disturbed=!0;let ce=!1,ve=S(void 0);return w((Ce,Ae)=>{let et;if(j!==void 0){if(et=()=>{let re=new $n("Aborted","AbortError"),me=[];I||me.push(()=>f._state==="writable"?Os(f,re):S(void 0)),L||me.push(()=>l._state==="readable"?Qt(l,re):S(void 0)),bt(()=>Promise.all(me.map(Ue=>Ue())),!0,re)},j.aborted){et();return}j.addEventListener("abort",et)}function er(){return w((re,me)=>{function Ue(we){we?re():R(Qi(),Ue,me)}Ue(!1)})}function Qi(){return ce?S(!0):R(ee._readyPromise,()=>w((re,me)=>{Pn($,{_chunkSteps:Ue=>{ve=R(ul(ee,Ue),void 0,r),re(!1)},_closeSteps:()=>re(!0),_errorSteps:me})}))}if(Or(l,$._closedPromise,re=>{I?Bt(!0,re):bt(()=>Os(f,re),!0,re)}),Or(f,ee._closedPromise,re=>{L?Bt(!0,re):bt(()=>Qt(l,re),!0,re)}),gt(l,$._closedPromise,()=>{b?Bt():bt(()=>ih(ee))}),Yt(f)||f._state==="closed"){let re=new TypeError("the destination writable stream closed before all data could be piped to it");L?Bt(!0,re):bt(()=>Qt(l,re),!0,re)}O(er());function ti(){let re=ve;return R(ve,()=>re!==ve?ti():void 0)}function Or(re,me,Ue){re._state==="errored"?Ue(re._storedError):C(me,Ue)}function gt(re,me,Ue){re._state==="closed"?Ue():A(me,Ue)}function bt(re,me,Ue){if(ce)return;ce=!0,f._state==="writable"&&!Yt(f)?A(ti(),we):we();function we(){x(re(),()=>Lr(me,Ue),_e=>Lr(!0,_e))}}function Bt(re,me){ce||(ce=!0,f._state==="writable"&&!Yt(f)?A(ti(),()=>Lr(re,me)):Lr(re,me))}function Lr(re,me){ll(ee),Pe($),j!==void 0&&j.removeEventListener("abort",et),re?Ae(me):Ce(void 0)}})}class Xt{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!kr(this))throw Ws("desiredSize");return pr(this)}close(){if(!kr(this))throw Ws("close");if(!Xi(this))throw new TypeError("The stream is not in a state that permits close");Wn(this)}enqueue(f=void 0){if(!kr(this))throw Ws("enqueue");if(!Xi(this))throw new TypeError("The stream is not in a state that permits enqueue");return $s(this,f)}error(f=void 0){if(!kr(this))throw Ws("error");Jr(this,f)}[sa](f){at(this);let b=this._cancelAlgorithm(f);return Us(this),b}[Zt](f){let b=this._controlledReadableStream;if(this._queue.length>0){let I=ca(this);this._closeRequested&&this._queue.length===0?(Us(this),Fn(b)):Zr(this),f._chunkSteps(I)}else Z(b,f),Zr(this)}}Object.defineProperties(Xt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Xt.prototype,e.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function kr(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_controlledReadableStream")?!1:l instanceof Xt}function Zr(l){if(!bl(l))return;if(l._pulling){l._pullAgain=!0;return}l._pulling=!0;let b=l._pullAlgorithm();x(b,()=>{l._pulling=!1,l._pullAgain&&(l._pullAgain=!1,Zr(l))},I=>{Jr(l,I)})}function bl(l){let f=l._controlledReadableStream;return!Xi(l)||!l._started?!1:!!(ei(f)&&Hr(f)>0||pr(l)>0)}function Us(l){l._pullAlgorithm=void 0,l._cancelAlgorithm=void 0,l._strategySizeAlgorithm=void 0}function Wn(l){if(!Xi(l))return;let f=l._controlledReadableStream;l._closeRequested=!0,l._queue.length===0&&(Us(l),Fn(f))}function $s(l,f){if(!Xi(l))return;let b=l._controlledReadableStream;if(ei(b)&&Hr(b)>0)Ct(b,f,!1);else{let I;try{I=l._strategySizeAlgorithm(f)}catch(L){throw Jr(l,L),L}try{Qe(l,f,I)}catch(L){throw Jr(l,L),L}}Zr(l)}function Jr(l,f){let b=l._controlledReadableStream;b._state==="readable"&&(at(l),Us(l),Sl(b,f))}function pr(l){let f=l._controlledReadableStream._state;return f==="errored"?null:f==="closed"?0:l._strategyHWM-l._queueTotalSize}function mh(l){return!bl(l)}function Xi(l){let f=l._controlledReadableStream._state;return!l._closeRequested&&f==="readable"}function vl(l,f,b,I,L,j,$){f._controlledReadableStream=l,f._queue=void 0,f._queueTotalSize=void 0,at(f),f._started=!1,f._closeRequested=!1,f._pullAgain=!1,f._pulling=!1,f._strategySizeAlgorithm=$,f._strategyHWM=j,f._pullAlgorithm=I,f._cancelAlgorithm=L,l._readableStreamController=f;let ee=b();x(S(ee),()=>{f._started=!0,Zr(f)},ce=>{Jr(f,ce)})}function gh(l,f,b,I){let L=Object.create(Xt.prototype),j=()=>{},$=()=>S(void 0),ee=()=>S(void 0);f.start!==void 0&&(j=()=>f.start(L)),f.pull!==void 0&&($=()=>f.pull(L)),f.cancel!==void 0&&(ee=ce=>f.cancel(ce)),vl(l,L,j,$,ee,b,I)}function Ws(l){return new TypeError(`ReadableStreamDefaultController.prototype.${l} can only be used on a ReadableStreamDefaultController`)}function yh(l,f){return Vr(l._readableStreamController)?vh(l):bh(l)}function bh(l,f){let b=fr(l),I=!1,L=!1,j=!1,$=!1,ee,ce,ve,Ce,Ae,et=w(gt=>{Ae=gt});function er(){return I?(L=!0,S(void 0)):(I=!0,Pn(b,{_chunkSteps:bt=>{B(()=>{L=!1;let Bt=bt,Lr=bt;j||$s(ve._readableStreamController,Bt),$||$s(Ce._readableStreamController,Lr),I=!1,L&&er()})},_closeSteps:()=>{I=!1,j||Wn(ve._readableStreamController),$||Wn(Ce._readableStreamController),(!j||!$)&&Ae(void 0)},_errorSteps:()=>{I=!1}}),S(void 0))}function Qi(gt){if(j=!0,ee=gt,$){let bt=Wi([ee,ce]),Bt=Qt(l,bt);Ae(Bt)}return et}function ti(gt){if($=!0,ce=gt,j){let bt=Wi([ee,ce]),Bt=Qt(l,bt);Ae(Bt)}return et}function Or(){}return ve=La(Or,er,Qi),Ce=La(Or,er,ti),C(b._closedPromise,gt=>{Jr(ve._readableStreamController,gt),Jr(Ce._readableStreamController,gt),(!j||!$)&&Ae(void 0)}),[ve,Ce]}function vh(l){let f=fr(l),b=!1,I=!1,L=!1,j=!1,$=!1,ee,ce,ve,Ce,Ae,et=w(re=>{Ae=re});function er(re){C(re._closedPromise,me=>{re===f&&(mt(ve._readableStreamController,me),mt(Ce._readableStreamController,me),(!j||!$)&&Ae(void 0))})}function Qi(){Mi(f)&&(Pe(f),f=fr(l),er(f)),Pn(f,{_chunkSteps:me=>{B(()=>{I=!1,L=!1;let Ue=me,we=me;if(!j&&!$)try{we=H1(me)}catch(_e){mt(ve._readableStreamController,_e),mt(Ce._readableStreamController,_e),Ae(Qt(l,_e));return}j||pt(ve._readableStreamController,Ue),$||pt(Ce._readableStreamController,we),b=!1,I?Or():L&&gt()})},_closeSteps:()=>{b=!1,j||nt(ve._readableStreamController),$||nt(Ce._readableStreamController),ve._readableStreamController._pendingPullIntos.length>0&&Dn(ve._readableStreamController,0),Ce._readableStreamController._pendingPullIntos.length>0&&Dn(Ce._readableStreamController,0),(!j||!$)&&Ae(void 0)},_errorSteps:()=>{b=!1}})}function ti(re,me){Gr(f)&&(Pe(f),f=X1(l),er(f));let Ue=me?Ce:ve,we=me?ve:Ce;el(f,re,{_chunkSteps:en=>{B(()=>{I=!1,L=!1;let tn=me?$:j;if(me?j:$)tn||Ps(Ue._readableStreamController,en);else{let Gn;try{Gn=H1(en)}catch(ri){mt(Ue._readableStreamController,ri),mt(we._readableStreamController,ri),Ae(Qt(l,ri));return}tn||Ps(Ue._readableStreamController,en),pt(we._readableStreamController,Gn)}b=!1,I?Or():L&&gt()})},_closeSteps:en=>{b=!1;let tn=me?$:j,Xs=me?j:$;tn||nt(Ue._readableStreamController),Xs||nt(we._readableStreamController),en!==void 0&&(tn||Ps(Ue._readableStreamController,en),!Xs&&we._readableStreamController._pendingPullIntos.length>0&&Dn(we._readableStreamController,0)),(!tn||!Xs)&&Ae(void 0)},_errorSteps:()=>{b=!1}})}function Or(){if(b)return I=!0,S(void 0);b=!0;let re=Si(ve._readableStreamController);return re===null?Qi():ti(re._view,!1),S(void 0)}function gt(){if(b)return L=!0,S(void 0);b=!0;let re=Si(Ce._readableStreamController);return re===null?Qi():ti(re._view,!0),S(void 0)}function bt(re){if(j=!0,ee=re,$){let me=Wi([ee,ce]),Ue=Qt(l,me);Ae(Ue)}return et}function Bt(re){if($=!0,ce=re,j){let me=Wi([ee,ce]),Ue=Qt(l,me);Ae(Ue)}return et}function Lr(){}return ve=_l(Lr,Or,bt),Ce=_l(Lr,gt,Bt),er(f),[ve,Ce]}function wh(l,f){Pr(l,f);let b=l,I=b?.autoAllocateChunkSize,L=b?.cancel,j=b?.pull,$=b?.start,ee=b?.type;return{autoAllocateChunkSize:I===void 0?void 0:la(I,`${f} has member 'autoAllocateChunkSize' that`),cancel:L===void 0?void 0:_h(L,b,`${f} has member 'cancel' that`),pull:j===void 0?void 0:Sh(j,b,`${f} has member 'pull' that`),start:$===void 0?void 0:xh($,b,`${f} has member 'start' that`),type:ee===void 0?void 0:Mh(ee,`${f} has member 'type' that`)}}function _h(l,f,b){return Jt(l,b),I=>G(l,f,[I])}function Sh(l,f,b){return Jt(l,b),I=>G(l,f,[I])}function xh(l,f,b){return Jt(l,b),I=>z(l,f,[I])}function Mh(l,f){if(l=`${l}`,l!=="bytes")throw new TypeError(`${f} '${l}' is not a valid enumeration value for ReadableStreamType`);return l}function Eh(l,f){Pr(l,f);let b=l?.mode;return{mode:b===void 0?void 0:Rh(b,`${f} has member 'mode' that`)}}function Rh(l,f){if(l=`${l}`,l!=="byob")throw new TypeError(`${f} '${l}' is not a valid enumeration value for ReadableStreamReaderMode`);return l}function Ch(l,f){Pr(l,f);let b=l?.preventCancel;return{preventCancel:Boolean(b)}}function wl(l,f){Pr(l,f);let b=l?.preventAbort,I=l?.preventCancel,L=l?.preventClose,j=l?.signal;return j!==void 0&&Yr(j,`${f} has member 'signal' that`),{preventAbort:Boolean(b),preventCancel:Boolean(I),preventClose:Boolean(L),signal:j}}function Yr(l,f){if(!Hc(l))throw new TypeError(`${f} is not an AbortSignal.`)}function Ah(l,f){Pr(l,f);let b=l?.readable;oa(b,"readable","ReadableWritablePair"),Nt(b,`${f} has member 'readable' that`);let I=l?.writable;return oa(I,"writable","ReadableWritablePair"),nl(I,`${f} has member 'writable' that`),{readable:b,writable:I}}class Xr{constructor(f={},b={}){f===void 0?f=null:z1(f,"First parameter");let I=ks(b,"Second parameter"),L=wh(f,"First parameter");if(Na(this),L.type==="bytes"){if(I.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let j=dr(I,0);va(this,L,j)}else{let j=Is(I),$=dr(I,1);gh(this,L,$,j)}}get locked(){if(!Qr(this))throw Ci("locked");return ei(this)}cancel(f=void 0){return Qr(this)?ei(this)?v(new TypeError("Cannot cancel a stream that already has a reader")):Qt(this,f):v(Ci("cancel"))}getReader(f=void 0){if(!Qr(this))throw Ci("getReader");return Eh(f,"First parameter").mode===void 0?fr(this):X1(this)}pipeThrough(f,b={}){if(!Qr(this))throw Ci("pipeThrough");Tr(f,1,"pipeThrough");let I=Ah(f,"First parameter"),L=wl(b,"Second parameter");if(ei(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ki(I.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let j=Yi(this,I.writable,L.preventClose,L.preventAbort,L.preventCancel,L.signal);return O(j),I.readable}pipeTo(f,b={}){if(!Qr(this))return v(Ci("pipeTo"));if(f===void 0)return v("Parameter 1 is required in 'pipeTo'.");if(!Vi(f))return v(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let I;try{I=wl(b,"Second parameter")}catch(L){return v(L)}return ei(this)?v(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ki(f)?v(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Yi(this,f,I.preventClose,I.preventAbort,I.preventCancel,I.signal)}tee(){if(!Qr(this))throw Ci("tee");let f=yh(this);return Wi(f)}values(f=void 0){if(!Qr(this))throw Ci("values");let b=Ch(f,"First parameter");return zc(this,b.preventCancel)}}Object.defineProperties(Xr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Xr.prototype,e.toStringTag,{value:"ReadableStream",configurable:!0}),typeof e.asyncIterator=="symbol"&&Object.defineProperty(Xr.prototype,e.asyncIterator,{value:Xr.prototype.values,writable:!0,configurable:!0});function La(l,f,b,I=1,L=()=>1){let j=Object.create(Xr.prototype);Na(j);let $=Object.create(Xt.prototype);return vl(j,$,l,f,b,I,L),j}function _l(l,f,b){let I=Object.create(Xr.prototype);Na(I);let L=Object.create(wi.prototype);return ba(I,L,l,f,b,0,void 0),I}function Na(l){l._state="readable",l._reader=void 0,l._storedError=void 0,l._disturbed=!1}function Qr(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_readableStreamController")?!1:l instanceof Xr}function ei(l){return l._reader!==void 0}function Qt(l,f){if(l._disturbed=!0,l._state==="closed")return S(void 0);if(l._state==="errored")return v(l._storedError);Fn(l);let b=l._reader;b!==void 0&&Mi(b)&&(b._readIntoRequests.forEach(L=>{L._closeSteps(void 0)}),b._readIntoRequests=new se);let I=l._readableStreamController[sa](f);return T(I,r)}function Fn(l){l._state="closed";let f=l._reader;f!==void 0&&(na(f),Gr(f)&&(f._readRequests.forEach(b=>{b._closeSteps()}),f._readRequests=new se))}function Sl(l,f){l._state="errored",l._storedError=f;let b=l._reader;b!==void 0&&(Kt(b,f),Gr(b)?(b._readRequests.forEach(I=>{I._errorSteps(f)}),b._readRequests=new se):(b._readIntoRequests.forEach(I=>{I._errorSteps(f)}),b._readIntoRequests=new se))}function Ci(l){return new TypeError(`ReadableStream.prototype.${l} can only be used on a ReadableStream`)}function xl(l,f){Pr(l,f);let b=l?.highWaterMark;return oa(b,"highWaterMark","QueuingStrategyInit"),{highWaterMark:aa(b)}}let Ml=l=>l.byteLength;Object.defineProperty(Ml,"name",{value:"size",configurable:!0});class Fs{constructor(f){Tr(f,1,"ByteLengthQueuingStrategy"),f=xl(f,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=f.highWaterMark}get highWaterMark(){if(!Rl(this))throw El("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Rl(this))throw El("size");return Ml}}Object.defineProperties(Fs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Fs.prototype,e.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function El(l){return new TypeError(`ByteLengthQueuingStrategy.prototype.${l} can only be used on a ByteLengthQueuingStrategy`)}function Rl(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_byteLengthQueuingStrategyHighWaterMark")?!1:l instanceof Fs}let Cl=()=>1;Object.defineProperty(Cl,"name",{value:"size",configurable:!0});class Hs{constructor(f){Tr(f,1,"CountQueuingStrategy"),f=xl(f,"First parameter"),this._countQueuingStrategyHighWaterMark=f.highWaterMark}get highWaterMark(){if(!Pl(this))throw Al("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Pl(this))throw Al("size");return Cl}}Object.defineProperties(Hs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Hs.prototype,e.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Al(l){return new TypeError(`CountQueuingStrategy.prototype.${l} can only be used on a CountQueuingStrategy`)}function Pl(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_countQueuingStrategyHighWaterMark")?!1:l instanceof Hs}function Ph(l,f){Pr(l,f);let b=l?.flush,I=l?.readableType,L=l?.start,j=l?.transform,$=l?.writableType;return{flush:b===void 0?void 0:Th(b,l,`${f} has member 'flush' that`),readableType:I,start:L===void 0?void 0:Tl(L,l,`${f} has member 'start' that`),transform:j===void 0?void 0:Ih(j,l,`${f} has member 'transform' that`),writableType:$}}function Th(l,f,b){return Jt(l,b),I=>G(l,f,[I])}function Tl(l,f,b){return Jt(l,b),I=>z(l,f,[I])}function Ih(l,f,b){return Jt(l,b),(I,L)=>G(l,f,[I,L])}class Gs{constructor(f={},b={},I={}){f===void 0&&(f=null);let L=ks(b,"Second parameter"),j=ks(I,"Third parameter"),$=Ph(f,"First parameter");if($.readableType!==void 0)throw new RangeError("Invalid readableType specified");if($.writableType!==void 0)throw new RangeError("Invalid writableType specified");let ee=dr(j,0),ce=Is(j),ve=dr(L,1),Ce=Is(L),Ae,et=w(er=>{Ae=er});kh(this,et,ve,Ce,ee,ce),Lh(this,$),$.start!==void 0?Ae($.start(this._transformStreamController)):Ae(void 0)}get readable(){if(!Il(this))throw Nl("readable");return this._readable}get writable(){if(!Il(this))throw Nl("writable");return this._writable}}Object.defineProperties(Gs.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Gs.prototype,e.toStringTag,{value:"TransformStream",configurable:!0});function kh(l,f,b,I,L,j){function $(){return f}function ee(et){return Bh(l,et)}function ce(et){return zh(l,et)}function ve(){return jh(l)}l._writable=Kc($,ee,ve,ce,b,I);function Ce(){return qh(l)}function Ae(et){return Ks(l,et),S(void 0)}l._readable=La($,Ce,Ae,L,j),l._backpressure=void 0,l._backpressureChangePromise=void 0,l._backpressureChangePromise_resolve=void 0,Zs(l,!0),l._transformStreamController=void 0}function Il(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_transformStreamController")?!1:l instanceof Gs}function Vs(l,f){Jr(l._readable._readableStreamController,f),Ks(l,f)}function Ks(l,f){kl(l._transformStreamController),Aa(l._writable._writableStreamController,f),l._backpressure&&Zs(l,!1)}function Zs(l,f){l._backpressureChangePromise!==void 0&&l._backpressureChangePromise_resolve(),l._backpressureChangePromise=w(b=>{l._backpressureChangePromise_resolve=b}),l._backpressure=f}class Hn{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Js(this))throw Ys("desiredSize");let f=this._controlledTransformStream._readable._readableStreamController;return pr(f)}enqueue(f=void 0){if(!Js(this))throw Ys("enqueue");Ol(this,f)}error(f=void 0){if(!Js(this))throw Ys("error");Nh(this,f)}terminate(){if(!Js(this))throw Ys("terminate");Dh(this)}}Object.defineProperties(Hn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Hn.prototype,e.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Js(l){return!s(l)||!Object.prototype.hasOwnProperty.call(l,"_controlledTransformStream")?!1:l instanceof Hn}function Oh(l,f,b,I){f._controlledTransformStream=l,l._transformStreamController=f,f._transformAlgorithm=b,f._flushAlgorithm=I}function Lh(l,f){let b=Object.create(Hn.prototype),I=j=>{try{return Ol(b,j),S(void 0)}catch($){return v($)}},L=()=>S(void 0);f.transform!==void 0&&(I=j=>f.transform(j,b)),f.flush!==void 0&&(L=()=>f.flush(b)),Oh(l,b,I,L)}function kl(l){l._transformAlgorithm=void 0,l._flushAlgorithm=void 0}function Ol(l,f){let b=l._controlledTransformStream,I=b._readable._readableStreamController;if(!Xi(I))throw new TypeError("Readable side is not in a state that permits enqueue");try{$s(I,f)}catch(j){throw Ks(b,j),b._readable._storedError}mh(I)!==b._backpressure&&Zs(b,!0)}function Nh(l,f){Vs(l._controlledTransformStream,f)}function Ll(l,f){let b=l._transformAlgorithm(f);return T(b,void 0,I=>{throw Vs(l._controlledTransformStream,I),I})}function Dh(l){let f=l._controlledTransformStream,b=f._readable._readableStreamController;Wn(b);let I=new TypeError("TransformStream terminated");Ks(f,I)}function Bh(l,f){let b=l._transformStreamController;if(l._backpressure){let I=l._backpressureChangePromise;return T(I,()=>{let L=l._writable;if(L._state==="erroring")throw L._storedError;return Ll(b,f)})}return Ll(b,f)}function zh(l,f){return Vs(l,f),S(void 0)}function jh(l){let f=l._readable,b=l._transformStreamController,I=b._flushAlgorithm();return kl(b),T(I,()=>{if(f._state==="errored")throw f._storedError;Wn(f._readableStreamController)},L=>{throw Vs(l,L),f._storedError})}function qh(l){return Zs(l,!1),l._backpressureChangePromise}function Ys(l){return new TypeError(`TransformStreamDefaultController.prototype.${l} can only be used on a TransformStreamDefaultController`)}function Nl(l){return new TypeError(`TransformStream.prototype.${l} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=Fs,t.CountQueuingStrategy=Hs,t.ReadableByteStreamController=wi,t.ReadableStream=Xr,t.ReadableStreamBYOBReader=Hi,t.ReadableStreamBYOBRequest=kn,t.ReadableStreamDefaultController=Xt,t.ReadableStreamDefaultReader=An,t.TransformStream=Gs,t.TransformStreamDefaultController=Hn,t.WritableStream=Gi,t.WritableStreamDefaultController=Kr,t.WritableStreamDefaultWriter=zn,Object.defineProperty(t,"__esModule",{value:!0})})});var b2=H(()=>{if(!globalThis.ReadableStream)try{let t=require("process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,y2())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=function(r){let i=0,n=this;return new ReadableStream({type:"bytes",async pull(s){let c=await n.slice(i,Math.min(n.size,i+65536)).arrayBuffer();i+=c.byteLength,s.enqueue(new Uint8Array(c)),i===n.size&&s.close()}})})}catch{}});async function*Kh(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let i=r.byteOffset,n=r.byteOffset+r.byteLength;for(;i!==n;){let s=Math.min(n-i,v2),a=r.buffer.slice(i,i+s);i+=a.byteLength,yield new Uint8Array(a)}}else yield r;else{let i=0,n=r;for(;i!==n.size;){let a=await n.slice(i,Math.min(n.size,i+v2)).arrayBuffer();i+=a.byteLength,yield new Uint8Array(a)}}}var hE,v2,Ti,Fa,oo,Zl,ao,w2,Qg,Ii,Ha=ja(()=>{hE=fe(b2(),1);v2=65536;w2=(ao=class{constructor(e=[],r={}){yt(this,Ti,[]);yt(this,Fa,"");yt(this,oo,0);yt(this,Zl,"transparent");if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let i=new TextEncoder;for(let s of e){let a;ArrayBuffer.isView(s)?a=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?a=new Uint8Array(s.slice(0)):s instanceof ao?a=s:a=i.encode(`${s}`),Ze(this,oo,Me(this,oo)+(ArrayBuffer.isView(a)?a.byteLength:a.size)),Me(this,Ti).push(a)}Ze(this,Zl,`${r.endings===void 0?"transparent":r.endings}`);let n=r.type===void 0?"":String(r.type);Ze(this,Fa,/^[\x20-\x7E]*$/.test(n)?n:"")}get size(){return Me(this,oo)}get type(){return Me(this,Fa)}async text(){let e=new TextDecoder,r="";for await(let i of Kh(Me(this,Ti),!1))r+=e.decode(i,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let i of Kh(Me(this,Ti),!1))e.set(i,r),r+=i.length;return e.buffer}stream(){let e=Kh(Me(this,Ti),!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let i=await e.next();i.done?r.close():r.enqueue(i.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,i=""){let{size:n}=this,s=e<0?Math.max(n+e,0):Math.min(e,n),a=r<0?Math.max(n+r,0):Math.min(r,n),c=Math.max(a-s,0),d=Me(this,Ti),p=[],m=0;for(let S of d){if(m>=c)break;let v=ArrayBuffer.isView(S)?S.byteLength:S.size;if(s&&v<=s)s-=v,a-=v;else{let R;ArrayBuffer.isView(S)?(R=S.subarray(s,Math.min(v,a)),m+=R.byteLength):(R=S.slice(s,Math.min(v,a)),m+=R.size),a-=v,p.push(R),s=0}}let w=new ao([],{type:String(i).toLowerCase()});return Ze(w,oo,c),Ze(w,Ti,p),w}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}},Ti=new WeakMap,Fa=new WeakMap,oo=new WeakMap,Zl=new WeakMap,ao);Object.defineProperties(w2.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Qg=w2,Ii=Qg});var Ga,Va,_2,ey,ty,lo,Zh=ja(()=>{Ha();ey=(_2=class extends Ii{constructor(r,i,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(r,n);yt(this,Ga,0);yt(this,Va,"");n===null&&(n={});let s=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(s)||Ze(this,Ga,s),Ze(this,Va,String(i))}get name(){return Me(this,Va)}get lastModified(){return Me(this,Ga)}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](r){return!!r&&r instanceof Ii&&/^(File)$/.test(r[Symbol.toStringTag])}},Ga=new WeakMap,Va=new WeakMap,_2),ty=ey,lo=ty});function E2(t,e=Ii){var r=`${S2()}${S2()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),i=[],n=`--${r}\r
2
- Content-Disposition: form-data; name="`;return t.forEach((s,a)=>typeof s=="string"?i.push(n+Jh(a)+`"\r
1
+ var fy=Object.create;var Ka=Object.defineProperty;var dy=Object.getOwnPropertyDescriptor;var my=Object.getOwnPropertyNames;var py=Object.getPrototypeOf,gy=Object.prototype.hasOwnProperty;var yy=(t,e,r)=>e in t?Ka(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Ja=(t,e)=>()=>(t&&(e=t(t=0)),e);var V=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),s2=(t,e)=>{for(var r in e)Ka(t,r,{get:e[r],enumerable:!0})},o2=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of my(e))!gy.call(t,n)&&n!==r&&Ka(t,n,{get:()=>e[n],enumerable:!(i=dy(e,n))||i.enumerable});return t};var de=(t,e,r)=>(r=t!=null?fy(py(t)):{},o2(e||!t||!t.__esModule?Ka(r,"default",{value:t,enumerable:!0}):r,t)),by=t=>o2(Ka({},"__esModule",{value:!0}),t);var Kc=(t,e,r)=>(yy(t,typeof e!="symbol"?e+"":e,r),r),a2=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var Me=(t,e,r)=>(a2(t,e,"read from private field"),r?r.call(t):e.get(t)),yt=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Je=(t,e,r,i)=>(a2(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),Jc=(t,e,r,i)=>({set _(n){Je(t,e,n,r)},get _(){return Me(t,e,i)}});var c2=V(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.Nztm2000Quad=void 0;Vl.Nztm2000Quad={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid V2",abstract:"",identifier:"NZTM2000Quad",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[419435.9938,-32605867284e-4],upperCorner:[104381901652e-4,6758167443e-3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:139770566007179e-6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:698852830035895e-7,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:3494264150179475e-8,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:17471320750897374e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:8735660375448687e-9,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:4.3678301877243435e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:2.1839150938621718e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:1.0919575469310859e6,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:545978.7734655429,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:272989.38673277147,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:136494.69336638573,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:68247.34668319287,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:34123.67334159643,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:17061.836670798217,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:8530.918335399108,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:4265.459167699554,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:2132.729583849777,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:1066.3647919248886,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:533.1823959624443,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:266.59119798122214,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:133.29559899061107,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:66.64779949530553,topLeftCorner:[104381901652e-4,-32605867284e-4],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152}]}});var f2=V(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.Nztm2000=void 0;Kl.Nztm2000={type:"TileMatrixSetType",title:"LINZ NZTM2000 Map Tile Grid",abstract:"See https://www.linz.govt.nz/data/linz-data-service/guides-and-documentation/nztm2000-map-tile-service-schema",identifier:"NZTM2000",supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/2193",boundingBox:{type:"BoundingBoxType",crs:"https://www.opengis.net/def/crs/EPSG/0/2193",lowerCorner:[3087e3,274e3],upperCorner:[7173e3,3327e3]},tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:32e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:4},{type:"TileMatrixType",identifier:"1",scaleDenominator:16e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:8},{type:"TileMatrixType",identifier:"2",scaleDenominator:8e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:16},{type:"TileMatrixType",identifier:"3",scaleDenominator:4e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:32},{type:"TileMatrixType",identifier:"4",scaleDenominator:2e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:64},{type:"TileMatrixType",identifier:"5",scaleDenominator:1e6,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:128},{type:"TileMatrixType",identifier:"6",scaleDenominator:5e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:256},{type:"TileMatrixType",identifier:"7",scaleDenominator:25e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:512},{type:"TileMatrixType",identifier:"8",scaleDenominator:1e5,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:640,matrixHeight:1280},{type:"TileMatrixType",identifier:"9",scaleDenominator:5e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:1280,matrixHeight:2560},{type:"TileMatrixType",identifier:"10",scaleDenominator:25e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:2560,matrixHeight:5120},{type:"TileMatrixType",identifier:"11",scaleDenominator:1e4,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:6400,matrixHeight:12800},{type:"TileMatrixType",identifier:"12",scaleDenominator:5e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:12800,matrixHeight:25600},{type:"TileMatrixType",identifier:"13",scaleDenominator:2500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:25600,matrixHeight:51200},{type:"TileMatrixType",identifier:"14",scaleDenominator:1e3,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:64e3,matrixHeight:128e3},{type:"TileMatrixType",identifier:"15",scaleDenominator:500,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:128e3,matrixHeight:256e3},{type:"TileMatrixType",identifier:"16",scaleDenominator:250,topLeftCorner:[1e7,-1e6],tileWidth:256,tileHeight:256,matrixWidth:256e3,matrixHeight:512e3}]}});var d2=V(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.Nztm2000=yo.Nztm2000Quad=void 0;var xy=c2();Object.defineProperty(yo,"Nztm2000Quad",{enumerable:!0,get:function(){return xy.Nztm2000Quad}});var Sy=f2();Object.defineProperty(yo,"Nztm2000",{enumerable:!0,get:function(){return Sy.Nztm2000}})});var Xn=V((Yl,m2)=>{(function(t,e){typeof Yl=="object"&&typeof m2<"u"?e(Yl):typeof define=="function"&&define.amd?define(["exports"],e):e(t.ULID={})})(Yl,function(t){"use strict";function e(C){var P=new Error(C);return P.source="ulid",P}var r="0123456789ABCDEFGHJKMNPQRSTVWXYZ",i=r.length,n=Math.pow(2,48)-1,o=10,a=16;function h(C,P,k){return P>C.length-1?C:C.substr(0,P)+k+C.substr(P+1)}function d(C){for(var P=void 0,k=C.length,B=void 0,z=void 0,H=i-1;!P&&k-->=0;){if(B=C[k],z=r.indexOf(B),z===-1)throw e("incorrectly encoded string");if(z===H){C=h(C,k,r[0]);continue}P=h(C,k,r[z+1])}if(typeof P=="string")return P;throw e("cannot increment this string")}function m(C){var P=Math.floor(C()*i);return P===i&&(P=i-1),r.charAt(P)}function p(C,P){if(isNaN(C))throw new Error(C+" must be a number");if(C>n)throw e("cannot encode time greater than "+n);if(C<0)throw e("time must be positive");if(Number.isInteger(C)===!1)throw e("time must be an integer");for(var k=void 0,B="";P>0;P--)k=C%i,B=r.charAt(k)+B,C=(C-k)/i;return B}function M(C,P){for(var k="";C>0;C--)k=m(P)+k;return k}function R(C){if(C.length!==o+a)throw e("malformed ulid");var P=C.substr(0,o).split("").reverse().reduce(function(k,B,z){var H=r.indexOf(B);if(H===-1)throw e("invalid character found: "+B);return k+=H*Math.pow(i,z)},0);if(P>n)throw e("malformed ulid, timestamp too large");return P}function x(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,P=arguments[1];P||(P=typeof window<"u"?window:null);var k=P&&(P.crypto||P.msCrypto);if(k)return function(){var z=new Uint8Array(1);return k.getRandomValues(z),z[0]/255};try{var B=require("crypto");return function(){return B.randomBytes(1).readUInt8()/255}}catch{}if(C){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return function(){return Math.random()}}throw e("secure crypto unusable, insecure Math.random not allowed")}function v(C){return C||(C=x()),function(k){return isNaN(k)&&(k=Date.now()),p(k,o)+M(a,C)}}function E(C){C||(C=x());var P=0,k=void 0;return function(z){if(isNaN(z)&&(z=Date.now()),z<=P){var H=k=d(k);return p(P,o)+H}P=z;var J=k=M(a,C);return p(z,o)+J}}var T=v();t.replaceCharAt=h,t.incrementBase32=d,t.randomChar=m,t.encodeTime=p,t.encodeRandom=M,t.decodeTime=R,t.detectPrng=x,t.factory=v,t.monotonicFactory=E,t.ulid=T,Object.defineProperty(t,"__esModule",{value:!0})})});var g2=V((bE,p2)=>{"use strict";function Cy(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var n=t.charAt(i),o=n.charCodeAt(0);if(e[o]!==255)throw new TypeError(n+" is ambiguous");e[o]=i}var a=t.length,h=t.charAt(0),d=Math.log(a)/Math.log(256),m=Math.log(256)/Math.log(a);function p(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var v=0,E=0,T=0,C=x.length;T!==C&&x[T]===0;)T++,v++;for(var P=(C-T)*m+1>>>0,k=new Uint8Array(P);T!==C;){for(var B=x[T],z=0,H=P-1;(B!==0||z<E)&&H!==-1;H--,z++)B+=256*k[H]>>>0,k[H]=B%a>>>0,B=B/a>>>0;if(B!==0)throw new Error("Non-zero carry");E=z,T++}for(var J=P-E;J!==P&&k[J]===0;)J++;for(var ne=h.repeat(v);J<P;++J)ne+=t.charAt(k[J]);return ne}function M(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;for(var v=0,E=0,T=0;x[v]===h;)E++,v++;for(var C=(x.length-v)*d+1>>>0,P=new Uint8Array(C);x[v];){var k=e[x.charCodeAt(v)];if(k===255)return;for(var B=0,z=C-1;(k!==0||B<T)&&z!==-1;z--,B++)k+=a*P[z]>>>0,P[z]=k%256>>>0,k=k/256>>>0;if(k!==0)throw new Error("Non-zero carry");T=B,v++}for(var H=C-T;H!==C&&P[H]===0;)H++;for(var J=new Uint8Array(E+(C-H)),ne=E;H!==C;)J[ne++]=P[H++];return J}function R(x){var v=M(x);if(v)return v;throw new Error("Non-base"+a+" character")}return{encode:p,decodeUnsafe:M,decode:R}}p2.exports=Cy});var M2=V((ru,S2)=>{(function(t,e){typeof ru=="object"&&typeof S2<"u"?e(ru):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(ru,function(t){"use strict";let e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:u=>`Symbol(${u})`;function r(){}function i(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}let n=i();function o(u){return typeof u=="object"&&u!==null||typeof u=="function"}let a=r,h=Promise,d=Promise.prototype.then,m=Promise.resolve.bind(h),p=Promise.reject.bind(h);function M(u){return new h(u)}function R(u){return m(u)}function x(u){return p(u)}function v(u,f,_){return d.call(u,f,_)}function E(u,f,_){v(v(u,f,_),void 0,a)}function T(u,f){E(u,f)}function C(u,f){E(u,void 0,f)}function P(u,f,_){return v(u,f,_)}function k(u){v(u,void 0,a)}let B=(()=>{let u=n&&n.queueMicrotask;if(typeof u=="function")return u;let f=R(void 0);return _=>v(f,_)})();function z(u,f,_){if(typeof u!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(u,f,_)}function H(u,f,_){try{return R(z(u,f,_))}catch(I){return x(I)}}let J=16384;class ne{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(f){let _=this._back,I=_;_._elements.length===J-1&&(I={_elements:[],_next:void 0}),_._elements.push(f),I!==_&&(this._back=I,_._next=I),++this._size}shift(){let f=this._front,_=f,I=this._cursor,N=I+1,U=f._elements,F=U[I];return N===J&&(_=f._next,N=0),--this._size,this._cursor=N,f!==_&&(this._front=_),U[I]=void 0,F}forEach(f){let _=this._cursor,I=this._front,N=I._elements;for(;(_!==N.length||I._next!==void 0)&&!(_===N.length&&(I=I._next,N=I._elements,_=0,N.length===0));)f(N[_]),++_}peek(){let f=this._front,_=this._cursor;return f._elements[_]}}function Se(u,f){u._ownerReadableStream=f,f._reader=u,f._state==="readable"?nt(u):f._state==="closed"?mi(u):Bt(u,f._storedError)}function ze(u,f){let _=u._ownerReadableStream;return Qt(_,f)}function Ce(u){u._ownerReadableStream._state==="readable"?ga(u,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Wh(u,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._ownerReadableStream._reader=void 0,u._ownerReadableStream=void 0}function Le(u){return new TypeError("Cannot "+u+" a stream using a released reader")}function nt(u){u._closedPromise=M((f,_)=>{u._closedPromise_resolve=f,u._closedPromise_reject=_})}function Bt(u,f){nt(u),ga(u,f)}function mi(u){nt(u),On(u)}function ga(u,f){u._closedPromise_reject!==void 0&&(k(u._closedPromise),u._closedPromise_reject(f),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0)}function Wh(u,f){Bt(u,f)}function On(u){u._closedPromise_resolve!==void 0&&(u._closedPromise_resolve(void 0),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0)}let ya=e("[[AbortSteps]]"),cr=e("[[ErrorSteps]]"),ba=e("[[CancelSteps]]"),Ps=e("[[PullSteps]]"),pi=Number.isFinite||function(u){return typeof u=="number"&&isFinite(u)},Hh=Math.trunc||function(u){return u<0?Math.ceil(u):Math.floor(u)};function Gh(u){return typeof u=="object"||typeof u=="function"}function at(u,f){if(u!==void 0&&!Gh(u))throw new TypeError(`${f} is not an object.`)}function Yt(u,f){if(typeof u!="function")throw new TypeError(`${f} is not a function.`)}function H1(u){return typeof u=="object"&&u!==null||typeof u=="function"}function ct(u,f){if(!H1(u))throw new TypeError(`${f} is not an object.`)}function Tr(u,f,_){if(u===void 0)throw new TypeError(`Parameter ${f} is required in '${_}'.`)}function va(u,f,_){if(u===void 0)throw new TypeError(`${f} is required in '${_}'.`)}function wa(u){return Number(u)}function G1(u){return u===0?0:u}function Vh(u){return G1(Hh(u))}function V1(u,f){let I=Number.MAX_SAFE_INTEGER,N=Number(u);if(N=G1(N),!pi(N))throw new TypeError(`${f} is not a finite number`);if(N=Vh(N),N<0||N>I)throw new TypeError(`${f} is outside the accepted range of ${0} to ${I}, inclusive`);return!pi(N)||N===0?0:N}function _a(u,f){if(!Jr(u))throw new TypeError(`${f} is not a ReadableStream.`)}function qi(u){return new Z(u)}function K1(u,f){u._reader._readRequests.push(f)}function Is(u,f,_){let N=u._reader._readRequests.shift();_?N._closeSteps():N._chunkSteps(f)}function Rt(u){return u._reader._readRequests.length}function Fi(u){let f=u._reader;return!(f===void 0||!st(f))}class Z{constructor(f){if(Tr(f,1,"ReadableStreamDefaultReader"),_a(f,"First parameter"),Zr(f))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Se(this,f),this._readRequests=new ne}get closed(){return st(this)?this._closedPromise:x(Os("closed"))}cancel(f=void 0){return st(this)?this._ownerReadableStream===void 0?x(Le("cancel")):ze(this,f):x(Os("cancel"))}read(){if(!st(this))return x(Os("read"));if(this._ownerReadableStream===void 0)return x(Le("read from"));let f,_,I=M((U,F)=>{f=U,_=F});return Pr(this,{_chunkSteps:U=>f({value:U,done:!1}),_closeSteps:()=>f({value:void 0,done:!0}),_errorSteps:U=>_(U)}),I}releaseLock(){if(!st(this))throw Os("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Ce(this)}}}Object.defineProperties(Z.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Z.prototype,e.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function st(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_readRequests")?!1:u instanceof Z}function Pr(u,f){let _=u._ownerReadableStream;_._disturbed=!0,_._state==="closed"?f._closeSteps():_._state==="errored"?f._errorSteps(_._storedError):_._readableStreamController[Ps](f)}function Os(u){return new TypeError(`ReadableStreamDefaultReader.prototype.${u} can only be used on a ReadableStreamDefaultReader`)}let J1=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Z1{constructor(f,_){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=f,this._preventCancel=_}next(){let f=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?P(this._ongoingPromise,f,f):f(),this._ongoingPromise}return(f){let _=()=>this._returnSteps(f);return this._ongoingPromise?P(this._ongoingPromise,_,_):_()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let f=this._reader;if(f._ownerReadableStream===void 0)return x(Le("iterate"));let _,I,N=M((F,te)=>{_=F,I=te});return Pr(f,{_chunkSteps:F=>{this._ongoingPromise=void 0,B(()=>_({value:F,done:!1}))},_closeSteps:()=>{this._ongoingPromise=void 0,this._isFinished=!0,Ce(f),_({value:void 0,done:!0})},_errorSteps:F=>{this._ongoingPromise=void 0,this._isFinished=!0,Ce(f),I(F)}}),N}_returnSteps(f){if(this._isFinished)return Promise.resolve({value:f,done:!0});this._isFinished=!0;let _=this._reader;if(_._ownerReadableStream===void 0)return x(Le("finish iterating"));if(!this._preventCancel){let I=ze(_,f);return Ce(_),P(I,()=>({value:f,done:!0}))}return Ce(_),R({value:f,done:!0})}}let Y1={next(){return X1(this)?this._asyncIteratorImpl.next():x(xa("next"))},return(u){return X1(this)?this._asyncIteratorImpl.return(u):x(xa("return"))}};J1!==void 0&&Object.setPrototypeOf(Y1,J1);function Kh(u,f){let _=qi(u),I=new Z1(_,f),N=Object.create(Y1);return N._asyncIteratorImpl=I,N}function X1(u){if(!o(u)||!Object.prototype.hasOwnProperty.call(u,"_asyncIteratorImpl"))return!1;try{return u._asyncIteratorImpl instanceof Z1}catch{return!1}}function xa(u){return new TypeError(`ReadableStreamAsyncIterator.${u} can only be used on a ReadableSteamAsyncIterator`)}let Q1=Number.isNaN||function(u){return u!==u};function kn(u){return u.slice()}function el(u,f,_,I,N){new Uint8Array(u).set(new Uint8Array(_,I,N),f)}function Sa(u){return u}function gi(u){return!1}function Ma(u,f,_){if(u.slice)return u.slice(f,_);let I=_-f,N=new ArrayBuffer(I);return el(N,0,u,f,I),N}function Jh(u){return!(typeof u!="number"||Q1(u)||u<0)}function tl(u){let f=Ma(u.buffer,u.byteOffset,u.byteOffset+u.byteLength);return new Uint8Array(f)}function Ea(u){let f=u._queue.shift();return u._queueTotalSize-=f.size,u._queueTotalSize<0&&(u._queueTotalSize=0),f.value}function le(u,f,_){if(!Jh(_)||_===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");u._queue.push({value:f,size:_}),u._queueTotalSize+=_}function Zh(u){return u._queue.peek().value}function Wr(u){u._queue=new ne,u._queueTotalSize=0}class Ln{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!ks(this))throw $i("view");return this._view}respond(f){if(!ks(this))throw $i("respond");if(Tr(f,1,"respond"),f=V1(f,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");gi(this._view.buffer),Bn(this._associatedReadableByteStreamController,f)}respondWithNewView(f){if(!ks(this))throw $i("respondWithNewView");if(Tr(f,1,"respondWithNewView"),!ArrayBuffer.isView(f))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");gi(f.buffer),Dn(this._associatedReadableByteStreamController,f)}}Object.defineProperties(Ln.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Ln.prototype,e.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Ve{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!yi(this))throw Wi("byobRequest");return Ta(this)}get desiredSize(){if(!yi(this))throw Wi("desiredSize");return Pa(this)}close(){if(!yi(this))throw Wi("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let f=this._controlledReadableByteStream._state;if(f!=="readable")throw new TypeError(`The stream (in ${f} state) is not in the readable state and cannot be closed`);Hr(this)}enqueue(f){if(!yi(this))throw Wi("enqueue");if(Tr(f,1,"enqueue"),!ArrayBuffer.isView(f))throw new TypeError("chunk must be an array buffer view");if(f.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(f.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let _=this._controlledReadableByteStream._state;if(_!=="readable")throw new TypeError(`The stream (in ${_} state) is not in the readable state and cannot be enqueued to`);Ds(this,f)}error(f=void 0){if(!yi(this))throw Wi("error");Dt(this,f)}[ba](f){rl(this),Wr(this);let _=this._cancelAlgorithm(f);return Bs(this),_}[Ps](f){let _=this._controlledReadableByteStream;if(this._queueTotalSize>0){let N=this._queue.shift();this._queueTotalSize-=N.byteLength,nl(this);let U=new Uint8Array(N.buffer,N.byteOffset,N.byteLength);f._chunkSteps(U);return}let I=this._autoAllocateChunkSize;if(I!==void 0){let N;try{N=new ArrayBuffer(I)}catch(F){f._errorSteps(F);return}let U={buffer:N,bufferByteLength:I,byteOffset:0,byteLength:I,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(U)}K1(_,f),bi(this)}}Object.defineProperties(Ve.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Ve.prototype,e.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function yi(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_controlledReadableByteStream")?!1:u instanceof Ve}function ks(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_associatedReadableByteStreamController")?!1:u instanceof Ln}function bi(u){if(!Qh(u))return;if(u._pulling){u._pullAgain=!0;return}u._pulling=!0;let _=u._pullAlgorithm();E(_,()=>{u._pulling=!1,u._pullAgain&&(u._pullAgain=!1,bi(u))},I=>{Dt(u,I)})}function rl(u){Ca(u),u._pendingPullIntos=new ne}function Ra(u,f){let _=!1;u._state==="closed"&&(_=!0);let I=vi(f);f.readerType==="default"?Is(u,I,_):Ct(u,I,_)}function vi(u){let f=u.bytesFilled,_=u.elementSize;return new u.viewConstructor(u.buffer,u.byteOffset,f/_)}function Ls(u,f,_,I){u._queue.push({buffer:f,byteOffset:_,byteLength:I}),u._queueTotalSize+=I}function il(u,f){let _=f.elementSize,I=f.bytesFilled-f.bytesFilled%_,N=Math.min(u._queueTotalSize,f.byteLength-f.bytesFilled),U=f.bytesFilled+N,F=U-U%_,te=N,ce=!1;F>I&&(te=F-f.bytesFilled,ce=!0);let we=u._queue;for(;te>0;){let Ae=we.peek(),Te=Math.min(te,Ae.byteLength),et=f.byteOffset+f.bytesFilled;el(f.buffer,et,Ae.buffer,Ae.byteOffset,Te),Ae.byteLength===Te?we.shift():(Ae.byteOffset+=Te,Ae.byteLength-=Te),u._queueTotalSize-=Te,Ns(u,Te,f),te-=Te}return ce}function Ns(u,f,_){_.bytesFilled+=f}function nl(u){u._queueTotalSize===0&&u._closeRequested?(Bs(u),Vn(u._controlledReadableByteStream)):bi(u)}function Ca(u){u._byobRequest!==null&&(u._byobRequest._associatedReadableByteStreamController=void 0,u._byobRequest._view=null,u._byobRequest=null)}function sl(u){for(;u._pendingPullIntos.length>0;){if(u._queueTotalSize===0)return;let f=u._pendingPullIntos.peek();il(u,f)&&(Nn(u),Ra(u._controlledReadableByteStream,f))}}function Yh(u,f,_){let I=u._controlledReadableByteStream,N=1;f.constructor!==DataView&&(N=f.constructor.BYTES_PER_ELEMENT);let U=f.constructor,F=f.buffer,te={buffer:F,bufferByteLength:F.byteLength,byteOffset:f.byteOffset,byteLength:f.byteLength,bytesFilled:0,elementSize:N,viewConstructor:U,readerType:"byob"};if(u._pendingPullIntos.length>0){u._pendingPullIntos.push(te),Ia(I,_);return}if(I._state==="closed"){let ce=new U(te.buffer,te.byteOffset,0);_._closeSteps(ce);return}if(u._queueTotalSize>0){if(il(u,te)){let ce=vi(te);nl(u),_._chunkSteps(ce);return}if(u._closeRequested){let ce=new TypeError("Insufficient bytes to fill elements in the given buffer");Dt(u,ce),_._errorSteps(ce);return}}u._pendingPullIntos.push(te),Ia(I,_),bi(u)}function fr(u,f){let _=u._controlledReadableByteStream;if(js(_))for(;Oa(_)>0;){let I=Nn(u);Ra(_,I)}}function Xh(u,f,_){if(Ns(u,f,_),_.bytesFilled<_.elementSize)return;Nn(u);let I=_.bytesFilled%_.elementSize;if(I>0){let N=_.byteOffset+_.bytesFilled,U=Ma(_.buffer,N-I,N);Ls(u,U,0,U.byteLength)}_.bytesFilled-=I,Ra(u._controlledReadableByteStream,_),sl(u)}function Aa(u,f){let _=u._pendingPullIntos.peek();Ca(u),u._controlledReadableByteStream._state==="closed"?fr(u):Xh(u,f,_),bi(u)}function Nn(u){return u._pendingPullIntos.shift()}function Qh(u){let f=u._controlledReadableByteStream;return f._state!=="readable"||u._closeRequested||!u._started?!1:!!(Fi(f)&&Rt(f)>0||js(f)&&Oa(f)>0||Pa(u)>0)}function Bs(u){u._pullAlgorithm=void 0,u._cancelAlgorithm=void 0}function Hr(u){let f=u._controlledReadableByteStream;if(!(u._closeRequested||f._state!=="readable")){if(u._queueTotalSize>0){u._closeRequested=!0;return}if(u._pendingPullIntos.length>0&&u._pendingPullIntos.peek().bytesFilled>0){let I=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Dt(u,I),I}Bs(u),Vn(f)}}function Ds(u,f){let _=u._controlledReadableByteStream;if(u._closeRequested||_._state!=="readable")return;let I=f.buffer,N=f.byteOffset,U=f.byteLength,F=I;if(u._pendingPullIntos.length>0){let te=u._pendingPullIntos.peek();gi(te.buffer),te.buffer=te.buffer}if(Ca(u),Fi(_))if(Rt(_)===0)Ls(u,F,N,U);else{u._pendingPullIntos.length>0&&Nn(u);let te=new Uint8Array(F,N,U);Is(_,te,!1)}else js(_)?(Ls(u,F,N,U),sl(u)):Ls(u,F,N,U);bi(u)}function Dt(u,f){let _=u._controlledReadableByteStream;_._state==="readable"&&(rl(u),Wr(u),Bs(u),Tl(_,f))}function Ta(u){if(u._byobRequest===null&&u._pendingPullIntos.length>0){let f=u._pendingPullIntos.peek(),_=new Uint8Array(f.buffer,f.byteOffset+f.bytesFilled,f.byteLength-f.bytesFilled),I=Object.create(Ln.prototype);ec(I,u,_),u._byobRequest=I}return u._byobRequest}function Pa(u){let f=u._controlledReadableByteStream._state;return f==="errored"?null:f==="closed"?0:u._strategyHWM-u._queueTotalSize}function Bn(u,f){let _=u._pendingPullIntos.peek();if(u._controlledReadableByteStream._state==="closed"){if(f!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(f===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(_.bytesFilled+f>_.byteLength)throw new RangeError("bytesWritten out of range")}_.buffer=_.buffer,Aa(u,f)}function Dn(u,f){let _=u._pendingPullIntos.peek();if(u._controlledReadableByteStream._state==="closed"){if(f.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(f.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(_.byteOffset+_.bytesFilled!==f.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(_.bufferByteLength!==f.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(_.bytesFilled+f.byteLength>_.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let N=f.byteLength;_.buffer=f.buffer,Aa(u,N)}function ol(u,f,_,I,N,U,F){f._controlledReadableByteStream=u,f._pullAgain=!1,f._pulling=!1,f._byobRequest=null,f._queue=f._queueTotalSize=void 0,Wr(f),f._closeRequested=!1,f._started=!1,f._strategyHWM=U,f._pullAlgorithm=I,f._cancelAlgorithm=N,f._autoAllocateChunkSize=F,f._pendingPullIntos=new ne,u._readableStreamController=f;let te=_();E(R(te),()=>{f._started=!0,bi(f)},ce=>{Dt(f,ce)})}function al(u,f,_){let I=Object.create(Ve.prototype),N=()=>{},U=()=>R(void 0),F=()=>R(void 0);f.start!==void 0&&(N=()=>f.start(I)),f.pull!==void 0&&(U=()=>f.pull(I)),f.cancel!==void 0&&(F=ce=>f.cancel(ce));let te=f.autoAllocateChunkSize;if(te===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");ol(u,I,N,U,F,_,te)}function ec(u,f,_){u._associatedReadableByteStreamController=f,u._view=_}function $i(u){return new TypeError(`ReadableStreamBYOBRequest.prototype.${u} can only be used on a ReadableStreamBYOBRequest`)}function Wi(u){return new TypeError(`ReadableByteStreamController.prototype.${u} can only be used on a ReadableByteStreamController`)}function zs(u){return new Hi(u)}function Ia(u,f){u._reader._readIntoRequests.push(f)}function Ct(u,f,_){let N=u._reader._readIntoRequests.shift();_?N._closeSteps(f):N._chunkSteps(f)}function Oa(u){return u._reader._readIntoRequests.length}function js(u){let f=u._reader;return!(f===void 0||!zt(f))}class Hi{constructor(f){if(Tr(f,1,"ReadableStreamBYOBReader"),_a(f,"First parameter"),Zr(f))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!yi(f._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Se(this,f),this._readIntoRequests=new ne}get closed(){return zt(this)?this._closedPromise:x(mt("closed"))}cancel(f=void 0){return zt(this)?this._ownerReadableStream===void 0?x(Le("cancel")):ze(this,f):x(mt("cancel"))}read(f){if(!zt(this))return x(mt("read"));if(!ArrayBuffer.isView(f))return x(new TypeError("view must be an array buffer view"));if(f.byteLength===0)return x(new TypeError("view must have non-zero byteLength"));if(f.buffer.byteLength===0)return x(new TypeError("view's buffer must have non-zero byteLength"));if(gi(f.buffer),this._ownerReadableStream===void 0)return x(Le("read from"));let _,I,N=M((F,te)=>{_=F,I=te});return dt(this,f,{_chunkSteps:F=>_({value:F,done:!1}),_closeSteps:F=>_({value:F,done:!0}),_errorSteps:F=>I(F)}),N}releaseLock(){if(!zt(this))throw mt("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Ce(this)}}}Object.defineProperties(Hi.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Hi.prototype,e.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function zt(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_readIntoRequests")?!1:u instanceof Hi}function dt(u,f,_){let I=u._ownerReadableStream;I._disturbed=!0,I._state==="errored"?_._errorSteps(I._storedError):Yh(I._readableStreamController,f,_)}function mt(u){return new TypeError(`ReadableStreamBYOBReader.prototype.${u} can only be used on a ReadableStreamBYOBReader`)}function Ir(u,f){let{highWaterMark:_}=u;if(_===void 0)return f;if(Q1(_)||_<0)throw new RangeError("Invalid highWaterMark");return _}function Gr(u){let{size:f}=u;return f||(()=>1)}function Us(u,f){at(u,f);let _=u?.highWaterMark,I=u?.size;return{highWaterMark:_===void 0?void 0:wa(_),size:I===void 0?void 0:ll(I,`${f} has member 'size' that`)}}function ll(u,f){return Yt(u,f),_=>wa(u(_))}function tc(u,f){at(u,f);let _=u?.abort,I=u?.close,N=u?.start,U=u?.type,F=u?.write;return{abort:_===void 0?void 0:ul(_,u,`${f} has member 'abort' that`),close:I===void 0?void 0:ka(I,u,`${f} has member 'close' that`),start:N===void 0?void 0:hl(N,u,`${f} has member 'start' that`),write:F===void 0?void 0:rc(F,u,`${f} has member 'write' that`),type:U}}function ul(u,f,_){return Yt(u,_),I=>H(u,f,[I])}function ka(u,f,_){return Yt(u,_),()=>H(u,f,[])}function hl(u,f,_){return Yt(u,_),I=>z(u,f,[I])}function rc(u,f,_){return Yt(u,_),(I,N)=>H(u,f,[I,N])}function qs(u,f){if(!Vi(u))throw new TypeError(`${f} is not a WritableStream.`)}function ic(u){if(typeof u!="object"||u===null)return!1;try{return typeof u.aborted=="boolean"}catch{return!1}}let nc=typeof AbortController=="function";function sc(){if(nc)return new AbortController}class Gi{constructor(f={},_={}){f===void 0?f=null:ct(f,"First parameter");let I=Us(_,"Second parameter"),N=tc(f,"First parameter");if(dl(this),N.type!==void 0)throw new RangeError("Invalid type is specified");let F=Gr(I),te=Ir(I,1);pc(this,N,te,F)}get locked(){if(!Vi(this))throw Js("locked");return Ki(this)}abort(f=void 0){return Vi(this)?Ki(this)?x(new TypeError("Cannot abort a stream that already has a writer")):Or(this,f):x(Js("abort"))}close(){return Vi(this)?Ki(this)?x(new TypeError("Cannot close a stream that already has a writer")):dr(this)?x(new TypeError("Cannot close an already-closing stream")):ml(this):x(Js("close"))}getWriter(){if(!Vi(this))throw Js("getWriter");return cl(this)}}Object.defineProperties(Gi.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Gi.prototype,e.toStringTag,{value:"WritableStream",configurable:!0});function cl(u){return new Ji(u)}function fl(u,f,_,I,N=1,U=()=>1){let F=Object.create(Gi.prototype);dl(F);let te=Object.create(Zi.prototype);return Da(F,te,u,f,_,I,N,U),F}function dl(u){u._state="writable",u._storedError=void 0,u._writer=void 0,u._writableStreamController=void 0,u._writeRequests=new ne,u._inFlightWriteRequest=void 0,u._closeRequest=void 0,u._inFlightCloseRequest=void 0,u._pendingAbortRequest=void 0,u._backpressure=!1}function Vi(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_writableStreamController")?!1:u instanceof Gi}function Ki(u){return u._writer!==void 0}function Or(u,f){var _;if(u._state==="closed"||u._state==="errored")return R(void 0);u._writableStreamController._abortReason=f,(_=u._writableStreamController._abortController)===null||_===void 0||_.abort();let I=u._state;if(I==="closed"||I==="errored")return R(void 0);if(u._pendingAbortRequest!==void 0)return u._pendingAbortRequest._promise;let N=!1;I==="erroring"&&(N=!0,f=void 0);let U=M((F,te)=>{u._pendingAbortRequest={_promise:void 0,_resolve:F,_reject:te,_reason:f,_wasAlreadyErroring:N}});return u._pendingAbortRequest._promise=U,N||$s(u,f),U}function ml(u){let f=u._state;if(f==="closed"||f==="errored")return x(new TypeError(`The stream (in ${f} state) is not in the writable state and cannot be closed`));let _=M((N,U)=>{let F={_resolve:N,_reject:U};u._closeRequest=F}),I=u._writer;return I!==void 0&&u._backpressure&&f==="writable"&&Fa(I),gc(u._writableStreamController),_}function oc(u){return M((_,I)=>{let N={_resolve:_,_reject:I};u._writeRequests.push(N)})}function Fs(u,f){if(u._state==="writable"){$s(u,f);return}Ws(u)}function $s(u,f){let _=u._writableStreamController;u._state="erroring",u._storedError=f;let I=u._writer;I!==void 0&&Na(I,f),!cc(u)&&_._started&&Ws(u)}function Ws(u){u._state="errored",u._writableStreamController[cr]();let f=u._storedError;if(u._writeRequests.forEach(N=>{N._reject(f)}),u._writeRequests=new ne,u._pendingAbortRequest===void 0){wi(u);return}let _=u._pendingAbortRequest;if(u._pendingAbortRequest=void 0,_._wasAlreadyErroring){_._reject(f),wi(u);return}let I=u._writableStreamController[ya](_._reason);E(I,()=>{_._resolve(),wi(u)},N=>{_._reject(N),wi(u)})}function ac(u){u._inFlightWriteRequest._resolve(void 0),u._inFlightWriteRequest=void 0}function lc(u,f){u._inFlightWriteRequest._reject(f),u._inFlightWriteRequest=void 0,Fs(u,f)}function uc(u){u._inFlightCloseRequest._resolve(void 0),u._inFlightCloseRequest=void 0,u._state==="erroring"&&(u._storedError=void 0,u._pendingAbortRequest!==void 0&&(u._pendingAbortRequest._resolve(),u._pendingAbortRequest=void 0)),u._state="closed";let _=u._writer;_!==void 0&&_l(_)}function hc(u,f){u._inFlightCloseRequest._reject(f),u._inFlightCloseRequest=void 0,u._pendingAbortRequest!==void 0&&(u._pendingAbortRequest._reject(f),u._pendingAbortRequest=void 0),Fs(u,f)}function dr(u){return!(u._closeRequest===void 0&&u._inFlightCloseRequest===void 0)}function cc(u){return!(u._inFlightWriteRequest===void 0&&u._inFlightCloseRequest===void 0)}function fc(u){u._inFlightCloseRequest=u._closeRequest,u._closeRequest=void 0}function pl(u){u._inFlightWriteRequest=u._writeRequests.shift()}function wi(u){u._closeRequest!==void 0&&(u._closeRequest._reject(u._storedError),u._closeRequest=void 0);let f=u._writer;f!==void 0&&Ua(f,u._storedError)}function La(u,f){let _=u._writer;_!==void 0&&f!==u._backpressure&&(f?Sc(_):Fa(_)),u._backpressure=f}class Ji{constructor(f){if(Tr(f,1,"WritableStreamDefaultWriter"),qs(f,"First parameter"),Ki(f))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=f,f._writer=this;let _=f._state;if(_==="writable")!dr(f)&&f._backpressure?Zs(this):xl(this),Yi(this);else if(_==="erroring")qa(this,f._storedError),Yi(this);else if(_==="closed")xl(this),_c(this);else{let I=f._storedError;qa(this,I),wl(this,I)}}get closed(){return _i(this)?this._closedPromise:x(xi("closed"))}get desiredSize(){if(!_i(this))throw xi("desiredSize");if(this._ownerWritableStream===void 0)throw Un("desiredSize");return Xt(this)}get ready(){return _i(this)?this._readyPromise:x(xi("ready"))}abort(f=void 0){return _i(this)?this._ownerWritableStream===void 0?x(Un("abort")):dc(this,f):x(xi("abort"))}close(){if(!_i(this))return x(xi("close"));let f=this._ownerWritableStream;return f===void 0?x(Un("close")):dr(f)?x(new TypeError("Cannot close an already-closing stream")):gl(this)}releaseLock(){if(!_i(this))throw xi("releaseLock");this._ownerWritableStream!==void 0&&yl(this)}write(f=void 0){return _i(this)?this._ownerWritableStream===void 0?x(Un("write to")):bl(this,f):x(xi("write"))}}Object.defineProperties(Ji.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Ji.prototype,e.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function _i(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_ownerWritableStream")?!1:u instanceof Ji}function dc(u,f){let _=u._ownerWritableStream;return Or(_,f)}function gl(u){let f=u._ownerWritableStream;return ml(f)}function mc(u){let f=u._ownerWritableStream,_=f._state;return dr(f)||_==="closed"?R(void 0):_==="errored"?x(f._storedError):gl(u)}function Hs(u,f){u._closedPromiseState==="pending"?Ua(u,f):xc(u,f)}function Na(u,f){u._readyPromiseState==="pending"?Sl(u,f):Mc(u,f)}function Xt(u){let f=u._ownerWritableStream,_=f._state;return _==="errored"||_==="erroring"?null:_==="closed"?0:zn(f._writableStreamController)}function yl(u){let f=u._ownerWritableStream,_=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Na(u,_),Hs(u,_),f._writer=void 0,u._ownerWritableStream=void 0}function bl(u,f){let _=u._ownerWritableStream,I=_._writableStreamController,N=yc(I,f);if(_!==u._ownerWritableStream)return x(Un("write to"));let U=_._state;if(U==="errored")return x(_._storedError);if(dr(_)||U==="closed")return x(new TypeError("The stream is closing or closed and cannot be written to"));if(U==="erroring")return x(_._storedError);let F=oc(_);return bc(I,f,N),F}let Gs={};class Zi{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Ba(this))throw ja("abortReason");return this._abortReason}get signal(){if(!Ba(this))throw ja("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(f=void 0){if(!Ba(this))throw ja("error");this._controlledWritableStream._state==="writable"&&vl(this,f)}[ya](f){let _=this._abortAlgorithm(f);return Vs(this),_}[cr](){Wr(this)}}Object.defineProperties(Zi.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Zi.prototype,e.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Ba(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_controlledWritableStream")?!1:u instanceof Zi}function Da(u,f,_,I,N,U,F,te){f._controlledWritableStream=u,u._writableStreamController=f,f._queue=void 0,f._queueTotalSize=void 0,Wr(f),f._abortReason=void 0,f._abortController=sc(),f._started=!1,f._strategySizeAlgorithm=te,f._strategyHWM=F,f._writeAlgorithm=I,f._closeAlgorithm=N,f._abortAlgorithm=U;let ce=jn(f);La(u,ce);let we=_(),Ae=R(we);E(Ae,()=>{f._started=!0,Ks(f)},Te=>{f._started=!0,Fs(u,Te)})}function pc(u,f,_,I){let N=Object.create(Zi.prototype),U=()=>{},F=()=>R(void 0),te=()=>R(void 0),ce=()=>R(void 0);f.start!==void 0&&(U=()=>f.start(N)),f.write!==void 0&&(F=we=>f.write(we,N)),f.close!==void 0&&(te=()=>f.close()),f.abort!==void 0&&(ce=we=>f.abort(we)),Da(u,N,U,F,te,ce,_,I)}function Vs(u){u._writeAlgorithm=void 0,u._closeAlgorithm=void 0,u._abortAlgorithm=void 0,u._strategySizeAlgorithm=void 0}function gc(u){le(u,Gs,0),Ks(u)}function yc(u,f){try{return u._strategySizeAlgorithm(f)}catch(_){return za(u,_),1}}function zn(u){return u._strategyHWM-u._queueTotalSize}function bc(u,f,_){try{le(u,f,_)}catch(N){za(u,N);return}let I=u._controlledWritableStream;if(!dr(I)&&I._state==="writable"){let N=jn(u);La(I,N)}Ks(u)}function Ks(u){let f=u._controlledWritableStream;if(!u._started||f._inFlightWriteRequest!==void 0)return;if(f._state==="erroring"){Ws(f);return}if(u._queue.length===0)return;let I=Zh(u);I===Gs?vc(u):wc(u,I)}function za(u,f){u._controlledWritableStream._state==="writable"&&vl(u,f)}function vc(u){let f=u._controlledWritableStream;fc(f),Ea(u);let _=u._closeAlgorithm();Vs(u),E(_,()=>{uc(f)},I=>{hc(f,I)})}function wc(u,f){let _=u._controlledWritableStream;pl(_);let I=u._writeAlgorithm(f);E(I,()=>{ac(_);let N=_._state;if(Ea(u),!dr(_)&&N==="writable"){let U=jn(u);La(_,U)}Ks(u)},N=>{_._state==="writable"&&Vs(u),lc(_,N)})}function jn(u){return zn(u)<=0}function vl(u,f){let _=u._controlledWritableStream;Vs(u),$s(_,f)}function Js(u){return new TypeError(`WritableStream.prototype.${u} can only be used on a WritableStream`)}function ja(u){return new TypeError(`WritableStreamDefaultController.prototype.${u} can only be used on a WritableStreamDefaultController`)}function xi(u){return new TypeError(`WritableStreamDefaultWriter.prototype.${u} can only be used on a WritableStreamDefaultWriter`)}function Un(u){return new TypeError("Cannot "+u+" a stream using a released writer")}function Yi(u){u._closedPromise=M((f,_)=>{u._closedPromise_resolve=f,u._closedPromise_reject=_,u._closedPromiseState="pending"})}function wl(u,f){Yi(u),Ua(u,f)}function _c(u){Yi(u),_l(u)}function Ua(u,f){u._closedPromise_reject!==void 0&&(k(u._closedPromise),u._closedPromise_reject(f),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0,u._closedPromiseState="rejected")}function xc(u,f){wl(u,f)}function _l(u){u._closedPromise_resolve!==void 0&&(u._closedPromise_resolve(void 0),u._closedPromise_resolve=void 0,u._closedPromise_reject=void 0,u._closedPromiseState="resolved")}function Zs(u){u._readyPromise=M((f,_)=>{u._readyPromise_resolve=f,u._readyPromise_reject=_}),u._readyPromiseState="pending"}function qa(u,f){Zs(u),Sl(u,f)}function xl(u){Zs(u),Fa(u)}function Sl(u,f){u._readyPromise_reject!==void 0&&(k(u._readyPromise),u._readyPromise_reject(f),u._readyPromise_resolve=void 0,u._readyPromise_reject=void 0,u._readyPromiseState="rejected")}function Sc(u){Zs(u)}function Mc(u,f){qa(u,f)}function Fa(u){u._readyPromise_resolve!==void 0&&(u._readyPromise_resolve(void 0),u._readyPromise_resolve=void 0,u._readyPromise_reject=void 0,u._readyPromiseState="fulfilled")}let Ml=typeof DOMException<"u"?DOMException:void 0;function Ec(u){if(!(typeof u=="function"||typeof u=="object"))return!1;try{return new u,!0}catch{return!1}}function Rc(){let u=function(_,I){this.message=_||"",this.name=I||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return u.prototype=Object.create(Error.prototype),Object.defineProperty(u.prototype,"constructor",{value:u,writable:!0,configurable:!0}),u}let Cc=Ec(Ml)?Ml:Rc();function Si(u,f,_,I,N,U){let F=qi(u),te=cl(f);u._disturbed=!0;let ce=!1,we=R(void 0);return M((Ae,Te)=>{let et;if(U!==void 0){if(et=()=>{let ie=new Cc("Aborted","AbortError"),pe=[];I||pe.push(()=>f._state==="writable"?Or(f,ie):R(void 0)),N||pe.push(()=>u._state==="readable"?Qt(u,ie):R(void 0)),bt(()=>Promise.all(pe.map(qe=>qe())),!0,ie)},U.aborted){et();return}U.addEventListener("abort",et)}function er(){return M((ie,pe)=>{function qe(At){At?ie():v(rn(),qe,pe)}qe(!1)})}function rn(){return ce?R(!0):v(te._readyPromise,()=>M((ie,pe)=>{Pr(F,{_chunkSteps:qe=>{we=v(bl(te,qe),void 0,r),ie(!1)},_closeSteps:()=>ie(!0),_errorSteps:pe})}))}if(kr(u,F._closedPromise,ie=>{I?jt(!0,ie):bt(()=>Or(f,ie),!0,ie)}),kr(f,te._closedPromise,ie=>{N?jt(!0,ie):bt(()=>Qt(u,ie),!0,ie)}),gt(u,F._closedPromise,()=>{_?jt():bt(()=>mc(te))}),dr(f)||f._state==="closed"){let ie=new TypeError("the destination writable stream closed before all data could be piped to it");N?jt(!0,ie):bt(()=>Qt(u,ie),!0,ie)}k(er());function Xr(){let ie=we;return v(we,()=>ie!==we?Xr():void 0)}function kr(ie,pe,qe){ie._state==="errored"?qe(ie._storedError):C(pe,qe)}function gt(ie,pe,qe){ie._state==="closed"?qe():T(pe,qe)}function bt(ie,pe,qe){if(ce)return;ce=!0,f._state==="writable"&&!dr(f)?T(Xr(),At):At();function At(){E(ie(),()=>Lr(pe,qe),nn=>Lr(!0,nn))}}function jt(ie,pe){ce||(ce=!0,f._state==="writable"&&!dr(f)?T(Xr(),()=>Lr(ie,pe)):Lr(ie,pe))}function Lr(ie,pe){yl(te),Ce(F),U!==void 0&&U.removeEventListener("abort",et),ie?Te(pe):Ae(void 0)}})}class Xi{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ys(this))throw eo("desiredSize");return $a(this)}close(){if(!Ys(this))throw eo("close");if(!Qi(this))throw new TypeError("The stream is not in a state that permits close");Fn(this)}enqueue(f=void 0){if(!Ys(this))throw eo("enqueue");if(!Qi(this))throw new TypeError("The stream is not in a state that permits enqueue");return Qs(this,f)}error(f=void 0){if(!Ys(this))throw eo("error");Vr(this,f)}[ba](f){Wr(this);let _=this._cancelAlgorithm(f);return Xs(this),_}[Ps](f){let _=this._controlledReadableStream;if(this._queue.length>0){let I=Ea(this);this._closeRequested&&this._queue.length===0?(Xs(this),Vn(_)):qn(this),f._chunkSteps(I)}else K1(_,f),qn(this)}}Object.defineProperties(Xi.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Xi.prototype,e.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Ys(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_controlledReadableStream")?!1:u instanceof Xi}function qn(u){if(!El(u))return;if(u._pulling){u._pullAgain=!0;return}u._pulling=!0;let _=u._pullAlgorithm();E(_,()=>{u._pulling=!1,u._pullAgain&&(u._pullAgain=!1,qn(u))},I=>{Vr(u,I)})}function El(u){let f=u._controlledReadableStream;return!Qi(u)||!u._started?!1:!!(Zr(f)&&Rt(f)>0||$a(u)>0)}function Xs(u){u._pullAlgorithm=void 0,u._cancelAlgorithm=void 0,u._strategySizeAlgorithm=void 0}function Fn(u){if(!Qi(u))return;let f=u._controlledReadableStream;u._closeRequested=!0,u._queue.length===0&&(Xs(u),Vn(f))}function Qs(u,f){if(!Qi(u))return;let _=u._controlledReadableStream;if(Zr(_)&&Rt(_)>0)Is(_,f,!1);else{let I;try{I=u._strategySizeAlgorithm(f)}catch(N){throw Vr(u,N),N}try{le(u,f,I)}catch(N){throw Vr(u,N),N}}qn(u)}function Vr(u,f){let _=u._controlledReadableStream;_._state==="readable"&&(Wr(u),Xs(u),Tl(_,f))}function $a(u){let f=u._controlledReadableStream._state;return f==="errored"?null:f==="closed"?0:u._strategyHWM-u._queueTotalSize}function Ac(u){return!El(u)}function Qi(u){let f=u._controlledReadableStream._state;return!u._closeRequested&&f==="readable"}function Rl(u,f,_,I,N,U,F){f._controlledReadableStream=u,f._queue=void 0,f._queueTotalSize=void 0,Wr(f),f._started=!1,f._closeRequested=!1,f._pullAgain=!1,f._pulling=!1,f._strategySizeAlgorithm=F,f._strategyHWM=U,f._pullAlgorithm=I,f._cancelAlgorithm=N,u._readableStreamController=f;let te=_();E(R(te),()=>{f._started=!0,qn(f)},ce=>{Vr(f,ce)})}function Tc(u,f,_,I){let N=Object.create(Xi.prototype),U=()=>{},F=()=>R(void 0),te=()=>R(void 0);f.start!==void 0&&(U=()=>f.start(N)),f.pull!==void 0&&(F=()=>f.pull(N)),f.cancel!==void 0&&(te=ce=>f.cancel(ce)),Rl(u,N,U,F,te,_,I)}function eo(u){return new TypeError(`ReadableStreamDefaultController.prototype.${u} can only be used on a ReadableStreamDefaultController`)}function Pc(u,f){return yi(u._readableStreamController)?pt(u):Ic(u)}function Ic(u,f){let _=qi(u),I=!1,N=!1,U=!1,F=!1,te,ce,we,Ae,Te,et=M(gt=>{Te=gt});function er(){return I?(N=!0,R(void 0)):(I=!0,Pr(_,{_chunkSteps:bt=>{B(()=>{N=!1;let jt=bt,Lr=bt;U||Qs(we._readableStreamController,jt),F||Qs(Ae._readableStreamController,Lr),I=!1,N&&er()})},_closeSteps:()=>{I=!1,U||Fn(we._readableStreamController),F||Fn(Ae._readableStreamController),(!U||!F)&&Te(void 0)},_errorSteps:()=>{I=!1}}),R(void 0))}function rn(gt){if(U=!0,te=gt,F){let bt=kn([te,ce]),jt=Qt(u,bt);Te(jt)}return et}function Xr(gt){if(F=!0,ce=gt,U){let bt=kn([te,ce]),jt=Qt(u,bt);Te(jt)}return et}function kr(){}return we=mr(kr,er,rn),Ae=mr(kr,er,Xr),C(_._closedPromise,gt=>{Vr(we._readableStreamController,gt),Vr(Ae._readableStreamController,gt),(!U||!F)&&Te(void 0)}),[we,Ae]}function pt(u){let f=qi(u),_=!1,I=!1,N=!1,U=!1,F=!1,te,ce,we,Ae,Te,et=M(ie=>{Te=ie});function er(ie){C(ie._closedPromise,pe=>{ie===f&&(Dt(we._readableStreamController,pe),Dt(Ae._readableStreamController,pe),(!U||!F)&&Te(void 0))})}function rn(){zt(f)&&(Ce(f),f=qi(u),er(f)),Pr(f,{_chunkSteps:pe=>{B(()=>{I=!1,N=!1;let qe=pe,At=pe;if(!U&&!F)try{At=tl(pe)}catch(nn){Dt(we._readableStreamController,nn),Dt(Ae._readableStreamController,nn),Te(Qt(u,nn));return}U||Ds(we._readableStreamController,qe),F||Ds(Ae._readableStreamController,At),_=!1,I?kr():N&&gt()})},_closeSteps:()=>{_=!1,U||Hr(we._readableStreamController),F||Hr(Ae._readableStreamController),we._readableStreamController._pendingPullIntos.length>0&&Bn(we._readableStreamController,0),Ae._readableStreamController._pendingPullIntos.length>0&&Bn(Ae._readableStreamController,0),(!U||!F)&&Te(void 0)},_errorSteps:()=>{_=!1}})}function Xr(ie,pe){st(f)&&(Ce(f),f=zs(u),er(f));let qe=pe?Ae:we,At=pe?we:Ae;dt(f,ie,{_chunkSteps:sn=>{B(()=>{I=!1,N=!1;let on=pe?F:U;if(pe?U:F)on||Dn(qe._readableStreamController,sn);else{let Fl;try{Fl=tl(sn)}catch(Ha){Dt(qe._readableStreamController,Ha),Dt(At._readableStreamController,Ha),Te(Qt(u,Ha));return}on||Dn(qe._readableStreamController,sn),Ds(At._readableStreamController,Fl)}_=!1,I?kr():N&&gt()})},_closeSteps:sn=>{_=!1;let on=pe?F:U,uo=pe?U:F;on||Hr(qe._readableStreamController),uo||Hr(At._readableStreamController),sn!==void 0&&(on||Dn(qe._readableStreamController,sn),!uo&&At._readableStreamController._pendingPullIntos.length>0&&Bn(At._readableStreamController,0)),(!on||!uo)&&Te(void 0)},_errorSteps:()=>{_=!1}})}function kr(){if(_)return I=!0,R(void 0);_=!0;let ie=Ta(we._readableStreamController);return ie===null?rn():Xr(ie._view,!1),R(void 0)}function gt(){if(_)return N=!0,R(void 0);_=!0;let ie=Ta(Ae._readableStreamController);return ie===null?rn():Xr(ie._view,!0),R(void 0)}function bt(ie){if(U=!0,te=ie,F){let pe=kn([te,ce]),qe=Qt(u,pe);Te(qe)}return et}function jt(ie){if(F=!0,ce=ie,U){let pe=kn([te,ce]),qe=Qt(u,pe);Te(qe)}return et}function Lr(){}return we=Al(Lr,kr,bt),Ae=Al(Lr,gt,jt),er(f),[we,Ae]}function $n(u,f){at(u,f);let _=u,I=_?.autoAllocateChunkSize,N=_?.cancel,U=_?.pull,F=_?.start,te=_?.type;return{autoAllocateChunkSize:I===void 0?void 0:V1(I,`${f} has member 'autoAllocateChunkSize' that`),cancel:N===void 0?void 0:Wn(N,_,`${f} has member 'cancel' that`),pull:U===void 0?void 0:Hn(U,_,`${f} has member 'pull' that`),start:F===void 0?void 0:Gn(F,_,`${f} has member 'start' that`),type:te===void 0?void 0:en(te,`${f} has member 'type' that`)}}function Wn(u,f,_){return Yt(u,_),I=>H(u,f,[I])}function Hn(u,f,_){return Yt(u,_),I=>H(u,f,[I])}function Gn(u,f,_){return Yt(u,_),I=>z(u,f,[I])}function en(u,f){if(u=`${u}`,u!=="bytes")throw new TypeError(`${f} '${u}' is not a valid enumeration value for ReadableStreamType`);return u}function tn(u,f){at(u,f);let _=u?.mode;return{mode:_===void 0?void 0:to(_,`${f} has member 'mode' that`)}}function to(u,f){if(u=`${u}`,u!=="byob")throw new TypeError(`${f} '${u}' is not a valid enumeration value for ReadableStreamReaderMode`);return u}function Oc(u,f){at(u,f);let _=u?.preventCancel;return{preventCancel:Boolean(_)}}function Cl(u,f){at(u,f);let _=u?.preventAbort,I=u?.preventCancel,N=u?.preventClose,U=u?.signal;return U!==void 0&&kc(U,`${f} has member 'signal' that`),{preventAbort:Boolean(_),preventCancel:Boolean(I),preventClose:Boolean(N),signal:U}}function kc(u,f){if(!ic(u))throw new TypeError(`${f} is not an AbortSignal.`)}function Lc(u,f){at(u,f);let _=u?.readable;va(_,"readable","ReadableWritablePair"),_a(_,`${f} has member 'readable' that`);let I=u?.writable;return va(I,"writable","ReadableWritablePair"),qs(I,`${f} has member 'writable' that`),{readable:_,writable:I}}class Kr{constructor(f={},_={}){f===void 0?f=null:ct(f,"First parameter");let I=Us(_,"Second parameter"),N=$n(f,"First parameter");if(Wa(this),N.type==="bytes"){if(I.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let U=Ir(I,0);al(this,N,U)}else{let U=Gr(I),F=Ir(I,1);Tc(this,N,F,U)}}get locked(){if(!Jr(this))throw Mi("locked");return Zr(this)}cancel(f=void 0){return Jr(this)?Zr(this)?x(new TypeError("Cannot cancel a stream that already has a reader")):Qt(this,f):x(Mi("cancel"))}getReader(f=void 0){if(!Jr(this))throw Mi("getReader");return tn(f,"First parameter").mode===void 0?qi(this):zs(this)}pipeThrough(f,_={}){if(!Jr(this))throw Mi("pipeThrough");Tr(f,1,"pipeThrough");let I=Lc(f,"First parameter"),N=Cl(_,"Second parameter");if(Zr(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ki(I.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let U=Si(this,I.writable,N.preventClose,N.preventAbort,N.preventCancel,N.signal);return k(U),I.readable}pipeTo(f,_={}){if(!Jr(this))return x(Mi("pipeTo"));if(f===void 0)return x("Parameter 1 is required in 'pipeTo'.");if(!Vi(f))return x(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let I;try{I=Cl(_,"Second parameter")}catch(N){return x(N)}return Zr(this)?x(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ki(f)?x(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Si(this,f,I.preventClose,I.preventAbort,I.preventCancel,I.signal)}tee(){if(!Jr(this))throw Mi("tee");let f=Pc(this);return kn(f)}values(f=void 0){if(!Jr(this))throw Mi("values");let _=Oc(f,"First parameter");return Kh(this,_.preventCancel)}}Object.defineProperties(Kr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Kr.prototype,e.toStringTag,{value:"ReadableStream",configurable:!0}),typeof e.asyncIterator=="symbol"&&Object.defineProperty(Kr.prototype,e.asyncIterator,{value:Kr.prototype.values,writable:!0,configurable:!0});function mr(u,f,_,I=1,N=()=>1){let U=Object.create(Kr.prototype);Wa(U);let F=Object.create(Xi.prototype);return Rl(U,F,u,f,_,I,N),U}function Al(u,f,_){let I=Object.create(Kr.prototype);Wa(I);let N=Object.create(Ve.prototype);return ol(I,N,u,f,_,0,void 0),I}function Wa(u){u._state="readable",u._reader=void 0,u._storedError=void 0,u._disturbed=!1}function Jr(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_readableStreamController")?!1:u instanceof Kr}function Zr(u){return u._reader!==void 0}function Qt(u,f){if(u._disturbed=!0,u._state==="closed")return R(void 0);if(u._state==="errored")return x(u._storedError);Vn(u);let _=u._reader;_!==void 0&&zt(_)&&(_._readIntoRequests.forEach(N=>{N._closeSteps(void 0)}),_._readIntoRequests=new ne);let I=u._readableStreamController[ba](f);return P(I,r)}function Vn(u){u._state="closed";let f=u._reader;f!==void 0&&(On(f),st(f)&&(f._readRequests.forEach(_=>{_._closeSteps()}),f._readRequests=new ne))}function Tl(u,f){u._state="errored",u._storedError=f;let _=u._reader;_!==void 0&&(ga(_,f),st(_)?(_._readRequests.forEach(I=>{I._errorSteps(f)}),_._readRequests=new ne):(_._readIntoRequests.forEach(I=>{I._errorSteps(f)}),_._readIntoRequests=new ne))}function Mi(u){return new TypeError(`ReadableStream.prototype.${u} can only be used on a ReadableStream`)}function Pl(u,f){at(u,f);let _=u?.highWaterMark;return va(_,"highWaterMark","QueuingStrategyInit"),{highWaterMark:wa(_)}}let Il=u=>u.byteLength;Object.defineProperty(Il,"name",{value:"size",configurable:!0});class ro{constructor(f){Tr(f,1,"ByteLengthQueuingStrategy"),f=Pl(f,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=f.highWaterMark}get highWaterMark(){if(!kl(this))throw Ol("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!kl(this))throw Ol("size");return Il}}Object.defineProperties(ro.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(ro.prototype,e.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Ol(u){return new TypeError(`ByteLengthQueuingStrategy.prototype.${u} can only be used on a ByteLengthQueuingStrategy`)}function kl(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_byteLengthQueuingStrategyHighWaterMark")?!1:u instanceof ro}let Ll=()=>1;Object.defineProperty(Ll,"name",{value:"size",configurable:!0});class io{constructor(f){Tr(f,1,"CountQueuingStrategy"),f=Pl(f,"First parameter"),this._countQueuingStrategyHighWaterMark=f.highWaterMark}get highWaterMark(){if(!Bl(this))throw Nl("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Bl(this))throw Nl("size");return Ll}}Object.defineProperties(io.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(io.prototype,e.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Nl(u){return new TypeError(`CountQueuingStrategy.prototype.${u} can only be used on a CountQueuingStrategy`)}function Bl(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_countQueuingStrategyHighWaterMark")?!1:u instanceof io}function Yr(u,f){at(u,f);let _=u?.flush,I=u?.readableType,N=u?.start,U=u?.transform,F=u?.writableType;return{flush:_===void 0?void 0:Nc(_,u,`${f} has member 'flush' that`),readableType:I,start:N===void 0?void 0:Bc(N,u,`${f} has member 'start' that`),transform:U===void 0?void 0:Dc(U,u,`${f} has member 'transform' that`),writableType:F}}function Nc(u,f,_){return Yt(u,_),I=>H(u,f,[I])}function Bc(u,f,_){return Yt(u,_),I=>z(u,f,[I])}function Dc(u,f,_){return Yt(u,_),(I,N)=>H(u,f,[I,N])}class no{constructor(f={},_={},I={}){f===void 0&&(f=null);let N=Us(_,"Second parameter"),U=Us(I,"Third parameter"),F=Yr(f,"First parameter");if(F.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(F.writableType!==void 0)throw new RangeError("Invalid writableType specified");let te=Ir(U,0),ce=Gr(U),we=Ir(N,1),Ae=Gr(N),Te,et=M(er=>{Te=er});zc(this,et,we,Ae,te,ce),Uc(this,F),F.start!==void 0?Te(F.start(this._transformStreamController)):Te(void 0)}get readable(){if(!Dl(this))throw ql("readable");return this._readable}get writable(){if(!Dl(this))throw ql("writable");return this._writable}}Object.defineProperties(no.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(no.prototype,e.toStringTag,{value:"TransformStream",configurable:!0});function zc(u,f,_,I,N,U){function F(){return f}function te(et){return $c(u,et)}function ce(et){return Wc(u,et)}function we(){return Hc(u)}u._writable=fl(F,te,we,ce,_,I);function Ae(){return Gc(u)}function Te(et){return oo(u,et),R(void 0)}u._readable=mr(F,Ae,Te,N,U),u._backpressure=void 0,u._backpressureChangePromise=void 0,u._backpressureChangePromise_resolve=void 0,ao(u,!0),u._transformStreamController=void 0}function Dl(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_transformStreamController")?!1:u instanceof no}function so(u,f){Vr(u._readable._readableStreamController,f),oo(u,f)}function oo(u,f){zl(u._transformStreamController),za(u._writable._writableStreamController,f),u._backpressure&&ao(u,!1)}function ao(u,f){u._backpressureChangePromise!==void 0&&u._backpressureChangePromise_resolve(),u._backpressureChangePromise=M(_=>{u._backpressureChangePromise_resolve=_}),u._backpressure=f}class Kn{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!lo(this))throw Jn("desiredSize");let f=this._controlledTransformStream._readable._readableStreamController;return $a(f)}enqueue(f=void 0){if(!lo(this))throw Jn("enqueue");jl(this,f)}error(f=void 0){if(!lo(this))throw Jn("error");qc(this,f)}terminate(){if(!lo(this))throw Jn("terminate");Fc(this)}}Object.defineProperties(Kn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof e.toStringTag=="symbol"&&Object.defineProperty(Kn.prototype,e.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function lo(u){return!o(u)||!Object.prototype.hasOwnProperty.call(u,"_controlledTransformStream")?!1:u instanceof Kn}function jc(u,f,_,I){f._controlledTransformStream=u,u._transformStreamController=f,f._transformAlgorithm=_,f._flushAlgorithm=I}function Uc(u,f){let _=Object.create(Kn.prototype),I=U=>{try{return jl(_,U),R(void 0)}catch(F){return x(F)}},N=()=>R(void 0);f.transform!==void 0&&(I=U=>f.transform(U,_)),f.flush!==void 0&&(N=()=>f.flush(_)),jc(u,_,I,N)}function zl(u){u._transformAlgorithm=void 0,u._flushAlgorithm=void 0}function jl(u,f){let _=u._controlledTransformStream,I=_._readable._readableStreamController;if(!Qi(I))throw new TypeError("Readable side is not in a state that permits enqueue");try{Qs(I,f)}catch(U){throw oo(_,U),_._readable._storedError}Ac(I)!==_._backpressure&&ao(_,!0)}function qc(u,f){so(u._controlledTransformStream,f)}function Ul(u,f){let _=u._transformAlgorithm(f);return P(_,void 0,I=>{throw so(u._controlledTransformStream,I),I})}function Fc(u){let f=u._controlledTransformStream,_=f._readable._readableStreamController;Fn(_);let I=new TypeError("TransformStream terminated");oo(f,I)}function $c(u,f){let _=u._transformStreamController;if(u._backpressure){let I=u._backpressureChangePromise;return P(I,()=>{let N=u._writable;if(N._state==="erroring")throw N._storedError;return Ul(_,f)})}return Ul(_,f)}function Wc(u,f){return so(u,f),R(void 0)}function Hc(u){let f=u._readable,_=u._transformStreamController,I=_._flushAlgorithm();return zl(_),P(I,()=>{if(f._state==="errored")throw f._storedError;Fn(f._readableStreamController)},N=>{throw so(u,N),f._storedError})}function Gc(u){return ao(u,!1),u._backpressureChangePromise}function Jn(u){return new TypeError(`TransformStreamDefaultController.prototype.${u} can only be used on a TransformStreamDefaultController`)}function ql(u){return new TypeError(`TransformStream.prototype.${u} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=ro,t.CountQueuingStrategy=io,t.ReadableByteStreamController=Ve,t.ReadableStream=Kr,t.ReadableStreamBYOBReader=Hi,t.ReadableStreamBYOBRequest=Ln,t.ReadableStreamDefaultController=Xi,t.ReadableStreamDefaultReader=Z,t.TransformStream=no,t.TransformStreamDefaultController=Kn,t.WritableStream=Gi,t.WritableStreamDefaultController=Zi,t.WritableStreamDefaultWriter=Ji,Object.defineProperty(t,"__esModule",{value:!0})})});var E2=V(()=>{if(!globalThis.ReadableStream)try{let t=require("process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,M2())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=function(r){let i=0,n=this;return new ReadableStream({type:"bytes",async pull(o){let h=await n.slice(i,Math.min(n.size,i+65536)).arrayBuffer();i+=h.byteLength,o.enqueue(new Uint8Array(h)),i===n.size&&o.close()}})})}catch{}});async function*ef(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let i=r.byteOffset,n=r.byteOffset+r.byteLength;for(;i!==n;){let o=Math.min(n-i,R2),a=r.buffer.slice(i,i+o);i+=a.byteLength,yield new Uint8Array(a)}}else yield r;else{let i=0,n=r;for(;i!==n.size;){let a=await n.slice(i,Math.min(n.size,i+R2)).arrayBuffer();i+=a.byteLength,yield new Uint8Array(a)}}}var YE,R2,Ai,e1,vo,iu,wo,C2,By,Ti,t1=Ja(()=>{YE=de(E2(),1);R2=65536;C2=(wo=class{constructor(e=[],r={}){yt(this,Ai,[]);yt(this,e1,"");yt(this,vo,0);yt(this,iu,"transparent");if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let i=new TextEncoder;for(let o of e){let a;ArrayBuffer.isView(o)?a=new Uint8Array(o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)):o instanceof ArrayBuffer?a=new Uint8Array(o.slice(0)):o instanceof wo?a=o:a=i.encode(`${o}`),Je(this,vo,Me(this,vo)+(ArrayBuffer.isView(a)?a.byteLength:a.size)),Me(this,Ai).push(a)}Je(this,iu,`${r.endings===void 0?"transparent":r.endings}`);let n=r.type===void 0?"":String(r.type);Je(this,e1,/^[\x20-\x7E]*$/.test(n)?n:"")}get size(){return Me(this,vo)}get type(){return Me(this,e1)}async text(){let e=new TextDecoder,r="";for await(let i of ef(Me(this,Ai),!1))r+=e.decode(i,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let i of ef(Me(this,Ai),!1))e.set(i,r),r+=i.length;return e.buffer}stream(){let e=ef(Me(this,Ai),!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let i=await e.next();i.done?r.close():r.enqueue(i.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,i=""){let{size:n}=this,o=e<0?Math.max(n+e,0):Math.min(e,n),a=r<0?Math.max(n+r,0):Math.min(r,n),h=Math.max(a-o,0),d=Me(this,Ai),m=[],p=0;for(let R of d){if(p>=h)break;let x=ArrayBuffer.isView(R)?R.byteLength:R.size;if(o&&x<=o)o-=x,a-=x;else{let v;ArrayBuffer.isView(R)?(v=R.subarray(o,Math.min(x,a)),p+=v.byteLength):(v=R.slice(o,Math.min(x,a)),p+=v.size),a-=x,m.push(v),o=0}}let M=new wo([],{type:String(i).toLowerCase()});return Je(M,vo,h),Je(M,Ai,m),M}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}},Ai=new WeakMap,e1=new WeakMap,vo=new WeakMap,iu=new WeakMap,wo);Object.defineProperties(C2.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});By=C2,Ti=By});var r1,i1,A2,Dy,zy,_o,tf=Ja(()=>{t1();Dy=(A2=class extends Ti{constructor(r,i,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(r,n);yt(this,r1,0);yt(this,i1,"");n===null&&(n={});let o=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(o)||Je(this,r1,o),Je(this,i1,String(i))}get name(){return Me(this,i1)}get lastModified(){return Me(this,r1)}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](r){return!!r&&r instanceof Ti&&/^(File)$/.test(r[Symbol.toStringTag])}},r1=new WeakMap,i1=new WeakMap,A2),zy=Dy,_o=zy});function O2(t,e=Ti){var r=`${T2()}${T2()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),i=[],n=`--${r}\r
2
+ Content-Disposition: form-data; name="`;return t.forEach((o,a)=>typeof o=="string"?i.push(n+rf(a)+`"\r
3
3
  \r
4
- ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
4
+ ${o.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
5
5
  `)}\r
6
- `):i.push(n+Jh(a)+`"; filename="${Jh(s.name,1)}"\r
7
- Content-Type: ${s.type||"application/octet-stream"}\r
6
+ `):i.push(n+rf(a)+`"; filename="${rf(o.name,1)}"\r
7
+ Content-Type: ${o.type||"application/octet-stream"}\r
8
8
  \r
9
- `,s,`\r
10
- `)),i.push(`--${r}--`),new e(i,{type:"multipart/form-data; boundary="+r})}var Ka,ry,iy,S2,ny,x2,Jh,Jn,mr,M2,Yn,Jl=ja(()=>{Ha();Zh();({toStringTag:Ka,iterator:ry,hasInstance:iy}=Symbol),S2=Math.random,ny="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),x2=(t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[Ka])?[(r=r!==void 0?r+"":e[Ka]=="File"?e.name:"blob",t),e.name!==r||e[Ka]=="blob"?new lo([e],r,e):e]:[t,e+""]),Jh=(t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
11
- `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Jn=(t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},Yn=(M2=class{constructor(...e){yt(this,mr,[]);if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Ka](){return"FormData"}[ry](){return this.entries()}static[iy](e){return e&&typeof e=="object"&&e[Ka]==="FormData"&&!ny.some(r=>typeof e[r]!="function")}append(...e){Jn("append",arguments,2),Me(this,mr).push(x2(...e))}delete(e){Jn("delete",arguments,1),e+="",Ze(this,mr,Me(this,mr).filter(([r])=>r!==e))}get(e){Jn("get",arguments,1),e+="";for(var r=Me(this,mr),i=r.length,n=0;n<i;n++)if(r[n][0]===e)return r[n][1];return null}getAll(e,r){return Jn("getAll",arguments,1),r=[],e+="",Me(this,mr).forEach(i=>i[0]===e&&r.push(i[1])),r}has(e){return Jn("has",arguments,1),e+="",Me(this,mr).some(r=>r[0]===e)}forEach(e,r){Jn("forEach",arguments,1);for(var[i,n]of this)e.call(r,n,i,this)}set(...e){Jn("set",arguments,2);var r=[],i=!0;e=x2(...e),Me(this,mr).forEach(n=>{n[0]===e[0]?i&&(i=!r.push(e)):r.push(n)}),i&&r.push(e),Ze(this,mr,r)}*entries(){yield*Me(this,mr)}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}},mr=new WeakMap,M2)});var P2=H((ME,A2)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,r=new ArrayBuffer;e.postMessage(r,[r,r])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}A2.exports=globalThis.DOMException});var Ja,I2,sy,Xn,Qn,Xh,T2,Qh=ja(()=>{Ja=require("fs"),I2=fe(P2(),1);Zh();Ha();({stat:sy}=Ja.promises),Xh=class{constructor(e){yt(this,Xn,void 0);yt(this,Qn,void 0);Ze(this,Xn,e.path),Ze(this,Qn,e.start),this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new Xh({path:Me(this,Xn),lastModified:this.lastModified,size:r-e,start:Me(this,Qn)+e})}async*stream(){let{mtimeMs:e}=await sy(Me(this,Xn));if(e>this.lastModified)throw new I2.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,Ja.createReadStream)(Me(this,Xn),{start:Me(this,Qn),end:Me(this,Qn)+this.size-1})}get[Symbol.toStringTag](){return"Blob"}},T2=Xh;Xn=new WeakMap,Qn=new WeakMap});var O2={};t2(O2,{toFormData:()=>fy});function hy(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",i=r.slice(r.lastIndexOf("\\")+1);return i=i.replace(/%22/g,'"'),i=i.replace(/&#(\d{4});/g,(n,s)=>String.fromCharCode(s)),i}async function fy(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let r=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let i=new ef(r[1]||r[2]),n,s,a,c,d,p,m=[],w=new Yn,S=C=>{a+=A.decode(C,{stream:!0})},v=C=>{m.push(C)},R=()=>{let C=new lo(m,p,{type:d});w.append(c,C)},x=()=>{w.append(c,a)},A=new TextDecoder("utf-8");A.decode(),i.onPartBegin=function(){i.onPartData=S,i.onPartEnd=x,n="",s="",a="",c="",d="",p=null,m.length=0},i.onHeaderField=function(C){n+=A.decode(C,{stream:!0})},i.onHeaderValue=function(C){s+=A.decode(C,{stream:!0})},i.onHeaderEnd=function(){if(s+=A.decode(),n=n.toLowerCase(),n==="content-disposition"){let C=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);C&&(c=C[2]||C[3]||""),p=hy(s),p&&(i.onPartData=v,i.onPartEnd=R)}else n==="content-type"&&(d=s);s="",n=""};for await(let C of t)i.write(C);return i.end(),w}var si,He,k2,ln,Xl,Ql,oy,Ya,ay,ly,uy,cy,es,ef,L2=ja(()=>{Qh();Jl();si=0,He={START_BOUNDARY:si++,HEADER_FIELD_START:si++,HEADER_FIELD:si++,HEADER_VALUE_START:si++,HEADER_VALUE:si++,HEADER_VALUE_ALMOST_DONE:si++,HEADERS_ALMOST_DONE:si++,PART_DATA_START:si++,PART_DATA:si++,END:si++},k2=1,ln={PART_BOUNDARY:k2,LAST_BOUNDARY:k2*=2},Xl=10,Ql=13,oy=32,Ya=45,ay=58,ly=97,uy=122,cy=t=>t|32,es=()=>{},ef=class{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=es,this.onHeaderField=es,this.onHeadersEnd=es,this.onHeaderValue=es,this.onPartBegin=es,this.onPartData=es,this.onPartEnd=es,this.boundaryChars={},e=`\r
12
- --`+e;let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i),this.boundaryChars[r[i]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=He.START_BOUNDARY}write(e){let r=0,i=e.length,n=this.index,{lookbehind:s,boundary:a,boundaryChars:c,index:d,state:p,flags:m}=this,w=this.boundary.length,S=w-1,v=e.length,R,x,A=B=>{this[B+"Mark"]=r},C=B=>{delete this[B+"Mark"]},T=(B,z,G,te)=>{(z===void 0||z!==G)&&this[B](te&&te.subarray(z,G))},O=(B,z)=>{let G=B+"Mark";G in this&&(z?(T(B,this[G],r,e),delete this[G]):(T(B,this[G],e.length,e),this[G]=0))};for(r=0;r<i;r++)switch(R=e[r],p){case He.START_BOUNDARY:if(d===a.length-2){if(R===Ya)m|=ln.LAST_BOUNDARY;else if(R!==Ql)return;d++;break}else if(d-1===a.length-2){if(m&ln.LAST_BOUNDARY&&R===Ya)p=He.END,m=0;else if(!(m&ln.LAST_BOUNDARY)&&R===Xl)d=0,T("onPartBegin"),p=He.HEADER_FIELD_START;else return;break}R!==a[d+2]&&(d=-2),R===a[d+2]&&d++;break;case He.HEADER_FIELD_START:p=He.HEADER_FIELD,A("onHeaderField"),d=0;case He.HEADER_FIELD:if(R===Ql){C("onHeaderField"),p=He.HEADERS_ALMOST_DONE;break}if(d++,R===Ya)break;if(R===ay){if(d===1)return;O("onHeaderField",!0),p=He.HEADER_VALUE_START;break}if(x=cy(R),x<ly||x>uy)return;break;case He.HEADER_VALUE_START:if(R===oy)break;A("onHeaderValue"),p=He.HEADER_VALUE;case He.HEADER_VALUE:R===Ql&&(O("onHeaderValue",!0),T("onHeaderEnd"),p=He.HEADER_VALUE_ALMOST_DONE);break;case He.HEADER_VALUE_ALMOST_DONE:if(R!==Xl)return;p=He.HEADER_FIELD_START;break;case He.HEADERS_ALMOST_DONE:if(R!==Xl)return;T("onHeadersEnd"),p=He.PART_DATA_START;break;case He.PART_DATA_START:p=He.PART_DATA,A("onPartData");case He.PART_DATA:if(n=d,d===0){for(r+=S;r<v&&!(e[r]in c);)r+=w;r-=S,R=e[r]}if(d<a.length)a[d]===R?(d===0&&O("onPartData",!0),d++):d=0;else if(d===a.length)d++,R===Ql?m|=ln.PART_BOUNDARY:R===Ya?m|=ln.LAST_BOUNDARY:d=0;else if(d-1===a.length)if(m&ln.PART_BOUNDARY){if(d=0,R===Xl){m&=~ln.PART_BOUNDARY,T("onPartEnd"),T("onPartBegin"),p=He.HEADER_FIELD_START;break}}else m&ln.LAST_BOUNDARY&&R===Ya?(T("onPartEnd"),p=He.END,m=0):d=0;if(d>0)s[d-1]=R;else if(n>0){let B=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);T("onPartData",0,n,B),n=0,A("onPartData"),r--}break;case He.END:break;default:throw new Error(`Unexpected state entered: ${p}`)}O("onHeaderField"),O("onHeaderValue"),O("onPartData"),this.index=d,this.state=p,this.flags=m}end(){if(this.state===He.HEADER_FIELD_START&&this.index===0||this.state===He.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==He.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var c5=H((dC,u5)=>{"use strict";u5.exports=l5;var{toString:_8}=Object.prototype,lf=Symbol("circular-ref-tag"),uf=Symbol("pino-raw-err-ref"),a5=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[uf]},set:function(t){this[uf]=t}}});Object.defineProperty(a5,uf,{writable:!0,value:{}});function l5(t){if(!(t instanceof Error))return t;t[lf]=void 0;let e=Object.create(a5);e.type=_8.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack;for(let r in t)if(e[r]===void 0){let i=t[r];i instanceof Error?i.hasOwnProperty(lf)||(e[r]=l5(i)):e[r]=i}return delete t[lf],e.raw=t,e}});var p5=H((pC,d5)=>{"use strict";d5.exports={mapHttpRequest:S8,reqSerializer:f5};var cf=Symbol("pino-raw-req-ref"),h5=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[cf]},set:function(t){this[cf]=t}}});Object.defineProperty(h5,cf,{writable:!0,value:{}});function f5(t){let e=t.info||t.socket,r=Object.create(h5);return r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl?(r.url=t.originalUrl,r.query=t.query,r.params=t.params):r.url=t.path||(t.url?t.url.path||t.url:void 0),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function S8(t){return{req:f5(t)}}});var b5=H((mC,y5)=>{"use strict";y5.exports={mapHttpResponse:x8,resSerializer:g5};var hf=Symbol("pino-raw-res-ref"),m5=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[hf]},set:function(t){this[hf]=t}}});Object.defineProperty(m5,hf,{writable:!0,value:{}});function g5(t){let e=Object.create(m5);return e.statusCode=t.statusCode,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function x8(t){return{res:g5(t)}}});var df=H((gC,v5)=>{"use strict";var ff=c5(),fu=p5(),du=b5();v5.exports={err:ff,mapHttpRequest:fu.mapHttpRequest,mapHttpResponse:du.mapHttpResponse,req:fu.reqSerializer,res:du.resSerializer,wrapErrorSerializer:function(e){return e===ff?e:function(i){return e(ff(i))}},wrapRequestSerializer:function(e){return e===fu.reqSerializer?e:function(i){return e(fu.reqSerializer(i))}},wrapResponseSerializer:function(e){return e===du.resSerializer?e:function(i){return e(du.resSerializer(i))}}}});var pf=H((yC,w5)=>{"use strict";function M8(t,e){return e}w5.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=M8;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let i=r.slice(2),n=[];for(let s of i)!s||n.push(s.getFileName());return n}});var S5=H((bC,_5)=>{"use strict";var{createContext:E8,runInContext:R8}=require("vm");_5.exports=C8;function C8(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=i=>`fast-redact \u2013 Invalid path (${i})`}=t;return function({paths:n}){n.forEach(s=>{if(typeof s!="string")throw Error(e());try{if(/〇/.test(s))throw Error();let a=new Proxy({},{get:()=>a,set:()=>{throw Error()}}),c=(s[0]==="["?"":".")+s.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(c)||/\/\*/.test(c))throw Error();R8(`
9
+ `,o,`\r
10
+ `)),i.push(`--${r}--`),new e(i,{type:"multipart/form-data; boundary="+r})}var n1,jy,Uy,T2,qy,P2,rf,Qn,pr,I2,es,nu=Ja(()=>{t1();tf();({toStringTag:n1,iterator:jy,hasInstance:Uy}=Symbol),T2=Math.random,qy="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),P2=(t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[n1])?[(r=r!==void 0?r+"":e[n1]=="File"?e.name:"blob",t),e.name!==r||e[n1]=="blob"?new _o([e],r,e):e]:[t,e+""]),rf=(t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
11
+ `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),Qn=(t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},es=(I2=class{constructor(...e){yt(this,pr,[]);if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[n1](){return"FormData"}[jy](){return this.entries()}static[Uy](e){return e&&typeof e=="object"&&e[n1]==="FormData"&&!qy.some(r=>typeof e[r]!="function")}append(...e){Qn("append",arguments,2),Me(this,pr).push(P2(...e))}delete(e){Qn("delete",arguments,1),e+="",Je(this,pr,Me(this,pr).filter(([r])=>r!==e))}get(e){Qn("get",arguments,1),e+="";for(var r=Me(this,pr),i=r.length,n=0;n<i;n++)if(r[n][0]===e)return r[n][1];return null}getAll(e,r){return Qn("getAll",arguments,1),r=[],e+="",Me(this,pr).forEach(i=>i[0]===e&&r.push(i[1])),r}has(e){return Qn("has",arguments,1),e+="",Me(this,pr).some(r=>r[0]===e)}forEach(e,r){Qn("forEach",arguments,1);for(var[i,n]of this)e.call(r,n,i,this)}set(...e){Qn("set",arguments,2);var r=[],i=!0;e=P2(...e),Me(this,pr).forEach(n=>{n[0]===e[0]?i&&(i=!r.push(e)):r.push(n)}),i&&r.push(e),Je(this,pr,r)}*entries(){yield*Me(this,pr)}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}},pr=new WeakMap,I2)});var B2=V((hR,N2)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,r=new ArrayBuffer;e.postMessage(r,[r,r])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}N2.exports=globalThis.DOMException});var o1,z2,Fy,ts,rs,sf,D2,of=Ja(()=>{o1=require("fs"),z2=de(B2(),1);tf();t1();({stat:Fy}=o1.promises),sf=class{constructor(e){yt(this,ts,void 0);yt(this,rs,void 0);Je(this,ts,e.path),Je(this,rs,e.start),this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new sf({path:Me(this,ts),lastModified:this.lastModified,size:r-e,start:Me(this,rs)+e})}async*stream(){let{mtimeMs:e}=await Fy(Me(this,ts));if(e>this.lastModified)throw new z2.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,o1.createReadStream)(Me(this,ts),{start:Me(this,rs),end:Me(this,rs)+this.size-1})}get[Symbol.toStringTag](){return"Blob"}},D2=sf;ts=new WeakMap,rs=new WeakMap});var U2={};s2(U2,{toFormData:()=>Jy});function Ky(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",i=r.slice(r.lastIndexOf("\\")+1);return i=i.replace(/%22/g,'"'),i=i.replace(/&#(\d{4});/g,(n,o)=>String.fromCharCode(o)),i}async function Jy(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let r=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let i=new af(r[1]||r[2]),n,o,a,h,d,m,p=[],M=new es,R=C=>{a+=T.decode(C,{stream:!0})},x=C=>{p.push(C)},v=()=>{let C=new _o(p,m,{type:d});M.append(h,C)},E=()=>{M.append(h,a)},T=new TextDecoder("utf-8");T.decode(),i.onPartBegin=function(){i.onPartData=R,i.onPartEnd=E,n="",o="",a="",h="",d="",m=null,p.length=0},i.onHeaderField=function(C){n+=T.decode(C,{stream:!0})},i.onHeaderValue=function(C){o+=T.decode(C,{stream:!0})},i.onHeaderEnd=function(){if(o+=T.decode(),n=n.toLowerCase(),n==="content-disposition"){let C=o.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);C&&(h=C[2]||C[3]||""),m=Ky(o),m&&(i.onPartData=x,i.onPartEnd=v)}else n==="content-type"&&(d=o);o="",n=""};for await(let C of t)i.write(C);return i.end(),M}var ti,He,j2,cn,ou,au,$y,a1,Wy,Hy,Gy,Vy,is,af,q2=Ja(()=>{of();nu();ti=0,He={START_BOUNDARY:ti++,HEADER_FIELD_START:ti++,HEADER_FIELD:ti++,HEADER_VALUE_START:ti++,HEADER_VALUE:ti++,HEADER_VALUE_ALMOST_DONE:ti++,HEADERS_ALMOST_DONE:ti++,PART_DATA_START:ti++,PART_DATA:ti++,END:ti++},j2=1,cn={PART_BOUNDARY:j2,LAST_BOUNDARY:j2*=2},ou=10,au=13,$y=32,a1=45,Wy=58,Hy=97,Gy=122,Vy=t=>t|32,is=()=>{},af=class{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=is,this.onHeaderField=is,this.onHeadersEnd=is,this.onHeaderValue=is,this.onPartBegin=is,this.onPartData=is,this.onPartEnd=is,this.boundaryChars={},e=`\r
12
+ --`+e;let r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i),this.boundaryChars[r[i]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=He.START_BOUNDARY}write(e){let r=0,i=e.length,n=this.index,{lookbehind:o,boundary:a,boundaryChars:h,index:d,state:m,flags:p}=this,M=this.boundary.length,R=M-1,x=e.length,v,E,T=B=>{this[B+"Mark"]=r},C=B=>{delete this[B+"Mark"]},P=(B,z,H,J)=>{(z===void 0||z!==H)&&this[B](J&&J.subarray(z,H))},k=(B,z)=>{let H=B+"Mark";H in this&&(z?(P(B,this[H],r,e),delete this[H]):(P(B,this[H],e.length,e),this[H]=0))};for(r=0;r<i;r++)switch(v=e[r],m){case He.START_BOUNDARY:if(d===a.length-2){if(v===a1)p|=cn.LAST_BOUNDARY;else if(v!==au)return;d++;break}else if(d-1===a.length-2){if(p&cn.LAST_BOUNDARY&&v===a1)m=He.END,p=0;else if(!(p&cn.LAST_BOUNDARY)&&v===ou)d=0,P("onPartBegin"),m=He.HEADER_FIELD_START;else return;break}v!==a[d+2]&&(d=-2),v===a[d+2]&&d++;break;case He.HEADER_FIELD_START:m=He.HEADER_FIELD,T("onHeaderField"),d=0;case He.HEADER_FIELD:if(v===au){C("onHeaderField"),m=He.HEADERS_ALMOST_DONE;break}if(d++,v===a1)break;if(v===Wy){if(d===1)return;k("onHeaderField",!0),m=He.HEADER_VALUE_START;break}if(E=Vy(v),E<Hy||E>Gy)return;break;case He.HEADER_VALUE_START:if(v===$y)break;T("onHeaderValue"),m=He.HEADER_VALUE;case He.HEADER_VALUE:v===au&&(k("onHeaderValue",!0),P("onHeaderEnd"),m=He.HEADER_VALUE_ALMOST_DONE);break;case He.HEADER_VALUE_ALMOST_DONE:if(v!==ou)return;m=He.HEADER_FIELD_START;break;case He.HEADERS_ALMOST_DONE:if(v!==ou)return;P("onHeadersEnd"),m=He.PART_DATA_START;break;case He.PART_DATA_START:m=He.PART_DATA,T("onPartData");case He.PART_DATA:if(n=d,d===0){for(r+=R;r<x&&!(e[r]in h);)r+=M;r-=R,v=e[r]}if(d<a.length)a[d]===v?(d===0&&k("onPartData",!0),d++):d=0;else if(d===a.length)d++,v===au?p|=cn.PART_BOUNDARY:v===a1?p|=cn.LAST_BOUNDARY:d=0;else if(d-1===a.length)if(p&cn.PART_BOUNDARY){if(d=0,v===ou){p&=~cn.PART_BOUNDARY,P("onPartEnd"),P("onPartBegin"),m=He.HEADER_FIELD_START;break}}else p&cn.LAST_BOUNDARY&&v===a1?(P("onPartEnd"),m=He.END,p=0):d=0;if(d>0)o[d-1]=v;else if(n>0){let B=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);P("onPartData",0,n,B),n=0,T("onPartData"),r--}break;case He.END:break;default:throw new Error(`Unexpected state entered: ${m}`)}k("onHeaderField"),k("onHeaderValue"),k("onPartData"),this.index=d,this.state=m,this.flags=p}end(){if(this.state===He.HEADER_FIELD_START&&this.index===0||this.state===He.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==He.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var y5=V((eA,g5)=>{"use strict";g5.exports=p5;var{toString:n3}=Object.prototype,mf=Symbol("circular-ref-tag"),pf=Symbol("pino-raw-err-ref"),m5=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[pf]},set:function(t){this[pf]=t}}});Object.defineProperty(m5,pf,{writable:!0,value:{}});function p5(t){if(!(t instanceof Error))return t;t[mf]=void 0;let e=Object.create(m5);e.type=n3.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack;for(let r in t)if(e[r]===void 0){let i=t[r];i instanceof Error?i.hasOwnProperty(mf)||(e[r]=p5(i)):e[r]=i}return delete t[mf],e.raw=t,e}});var _5=V((tA,w5)=>{"use strict";w5.exports={mapHttpRequest:s3,reqSerializer:v5};var gf=Symbol("pino-raw-req-ref"),b5=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[gf]},set:function(t){this[gf]=t}}});Object.defineProperty(b5,gf,{writable:!0,value:{}});function v5(t){let e=t.info||t.socket,r=Object.create(b5);return r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl?(r.url=t.originalUrl,r.query=t.query,r.params=t.params):r.url=t.path||(t.url?t.url.path||t.url:void 0),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function s3(t){return{req:v5(t)}}});var E5=V((rA,M5)=>{"use strict";M5.exports={mapHttpResponse:o3,resSerializer:S5};var yf=Symbol("pino-raw-res-ref"),x5=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[yf]},set:function(t){this[yf]=t}}});Object.defineProperty(x5,yf,{writable:!0,value:{}});function S5(t){let e=Object.create(x5);return e.statusCode=t.statusCode,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function o3(t){return{res:S5(t)}}});var vf=V((iA,R5)=>{"use strict";var bf=y5(),wu=_5(),_u=E5();R5.exports={err:bf,mapHttpRequest:wu.mapHttpRequest,mapHttpResponse:_u.mapHttpResponse,req:wu.reqSerializer,res:_u.resSerializer,wrapErrorSerializer:function(e){return e===bf?e:function(i){return e(bf(i))}},wrapRequestSerializer:function(e){return e===wu.reqSerializer?e:function(i){return e(wu.reqSerializer(i))}},wrapResponseSerializer:function(e){return e===_u.resSerializer?e:function(i){return e(_u.resSerializer(i))}}}});var wf=V((nA,C5)=>{"use strict";function a3(t,e){return e}C5.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=a3;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let i=r.slice(2),n=[];for(let o of i)!o||n.push(o.getFileName());return n}});var T5=V((sA,A5)=>{"use strict";var{createContext:l3,runInContext:u3}=require("vm");A5.exports=h3;function h3(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=i=>`fast-redact \u2013 Invalid path (${i})`}=t;return function({paths:n}){n.forEach(o=>{if(typeof o!="string")throw Error(e());try{if(/〇/.test(o))throw Error();let a=new Proxy({},{get:()=>a,set:()=>{throw Error()}}),h=(o[0]==="["?"":".")+o.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(h)||/\/\*/.test(h))throw Error();u3(`
13
13
  (function () {
14
14
  'use strict'
15
- o${c}
16
- if ([o${c}].length !== 1) throw Error()
15
+ o${h}
16
+ if ([o${h}].length !== 1) throw Error()
17
17
  })()
18
- `,E8({o:a,"\u3007":null}),{codeGeneration:{strings:!1,wasm:!1}})}catch{throw Error(r(s))}})}}});var pu=H((vC,x5)=>{"use strict";x5.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var E5=H((wC,M5)=>{"use strict";var A8=pu();M5.exports=P8;function P8({paths:t}){let e=[];var r=0;let i=t.reduce(function(n,s,a){var c=s.match(A8).map(m=>m.replace(/'|"|`/g,""));let d=s[0]==="[";c=c.map(m=>m[0]==="["?m.substr(1,m.length-2):m);let p=c.indexOf("*");if(p>-1){let m=c.slice(0,p),w=m.join("."),S=c.slice(p+1,c.length);if(S.indexOf("*")>-1)throw Error("fast-redact \u2013 Only one wildcard per path is supported");let v=S.length>0;r++,e.push({before:m,beforeStr:w,after:S,nested:v})}else n[s]={path:c,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(s),leadingBracket:d};return n},{});return{wildcards:e,wcLen:r,secret:i}}});var C5=H((_C,R5)=>{"use strict";var T8=pu();R5.exports=I8;function I8({secret:t,serialize:e,wcLen:r,strict:i,isCensorFct:n,censorFctTakesPath:s},a){let c=Function("o",`
18
+ `,l3({o:a,"\u3007":null}),{codeGeneration:{strings:!1,wasm:!1}})}catch{throw Error(r(o))}})}}});var xu=V((oA,P5)=>{"use strict";P5.exports=/[^.[\]]+|\[((?:.)*?)\]/g});var O5=V((aA,I5)=>{"use strict";var c3=xu();I5.exports=f3;function f3({paths:t}){let e=[];var r=0;let i=t.reduce(function(n,o,a){var h=o.match(c3).map(p=>p.replace(/'|"|`/g,""));let d=o[0]==="[";h=h.map(p=>p[0]==="["?p.substr(1,p.length-2):p);let m=h.indexOf("*");if(m>-1){let p=h.slice(0,m),M=p.join("."),R=h.slice(m+1,h.length);if(R.indexOf("*")>-1)throw Error("fast-redact \u2013 Only one wildcard per path is supported");let x=R.length>0;r++,e.push({before:p,beforeStr:M,after:R,nested:x})}else n[o]={path:h,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(o),leadingBracket:d};return n},{});return{wildcards:e,wcLen:r,secret:i}}});var L5=V((lA,k5)=>{"use strict";var d3=xu();k5.exports=m3;function m3({secret:t,serialize:e,wcLen:r,strict:i,isCensorFct:n,censorFctTakesPath:o},a){let h=Function("o",`
19
19
  if (typeof o !== 'object' || o == null) {
20
- ${N8(i,e)}
20
+ ${b3(i,e)}
21
21
  }
22
22
  const { censor, secret } = this
23
- ${k8(t,n,s)}
23
+ ${p3(t,n,o)}
24
24
  this.compileRestore()
25
- ${O8(r>0,n,s)}
26
- ${L8(e)}
27
- `).bind(a);return e===!1&&(c.restore=d=>a.restore(d)),c}function k8(t,e,r){return Object.keys(t).map(i=>{let{escPath:n,leadingBracket:s,path:a}=t[i],c=s?1:0,d=s?"":".",p=[];for(var m;(m=T8.exec(i))!==null;){let[,R]=m,{index:x,input:A}=m;x>c&&p.push(A.substring(0,x-(R?0:1)))}var w=p.map(R=>`o${d}${R}`).join(" && ");w.length===0?w+=`o${d}${i} != null`:w+=` && o${d}${i} != null`;let S=`
25
+ ${g3(r>0,n,o)}
26
+ ${y3(e)}
27
+ `).bind(a);return e===!1&&(h.restore=d=>a.restore(d)),h}function p3(t,e,r){return Object.keys(t).map(i=>{let{escPath:n,leadingBracket:o,path:a}=t[i],h=o?1:0,d=o?"":".",m=[];for(var p;(p=d3.exec(i))!==null;){let[,v]=p,{index:E,input:T}=p;E>h&&m.push(T.substring(0,E-(v?0:1)))}var M=m.map(v=>`o${d}${v}`).join(" && ");M.length===0?M+=`o${d}${i} != null`:M+=` && o${d}${i} != null`;let R=`
28
28
  switch (true) {
29
- ${p.reverse().map(R=>`
30
- case o${d}${R} === censor:
31
- secret[${n}].circle = ${JSON.stringify(R)}
29
+ ${m.reverse().map(v=>`
30
+ case o${d}${v} === censor:
31
+ secret[${n}].circle = ${JSON.stringify(v)}
32
32
  break
33
33
  `).join(`
34
34
  `)}
35
35
  }
36
- `,v=r?`val, ${JSON.stringify(a)}`:"val";return`
37
- if (${w}) {
36
+ `,x=r?`val, ${JSON.stringify(a)}`:"val";return`
37
+ if (${M}) {
38
38
  const val = o${d}${i}
39
39
  if (val === censor) {
40
40
  secret[${n}].precensored = true
41
41
  } else {
42
42
  secret[${n}].val = val
43
- o${d}${i} = ${e?`censor(${v})`:"censor"}
44
- ${S}
43
+ o${d}${i} = ${e?`censor(${x})`:"censor"}
44
+ ${R}
45
45
  }
46
46
  }
47
47
  `}).join(`
48
- `)}function O8(t,e,r){return t===!0?`
48
+ `)}function g3(t,e,r){return t===!0?`
49
49
  {
50
50
  const { wildcards, wcLen, groupRedact, nestedRedact } = this
51
51
  for (var i = 0; i < wcLen; i++) {
@@ -56,16 +56,16 @@ Content-Type: ${s.type||"application/octet-stream"}\r
56
56
  } else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${r})
57
57
  }
58
58
  }
59
- `:""}function L8(t){return t===!1?"return o":`
59
+ `:""}function y3(t){return t===!1?"return o":`
60
60
  var s = this.serialize(o)
61
61
  this.restore(o)
62
62
  return s
63
- `}function N8(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var mf=H((SC,P5)=>{"use strict";P5.exports={groupRedact:B8,groupRestore:D8,nestedRedact:j8,nestedRestore:z8};function D8({keys:t,values:e,target:r}){if(r==null)return;let i=t.length;for(var n=0;n<i;n++){let s=t[n];r[s]=e[n]}}function B8(t,e,r,i,n){let s=A5(t,e);if(s==null)return{keys:null,values:null,target:null,flat:!0};let a=Object.keys(s),c=a.length,d=e.length,p=n?[...e]:void 0,m=new Array(c);for(var w=0;w<c;w++){let S=a[w];m[w]=s[S],n?(p[d]=S,s[S]=r(s[S],p)):i?s[S]=r(s[S]):s[S]=r}return{keys:a,values:m,target:s,flat:!0}}function z8(t){let e=t.length;for(var r=0;r<e;r++){let{key:i,target:n,value:s}=t[r];n[i]=s}}function j8(t,e,r,i,n,s,a){let c=A5(e,r);if(c==null)return;let d=Object.keys(c),p=d.length;for(var m=0;m<p;m++){let w=d[m],{value:S,parent:v,exists:R}=U8(c,w,r,i,n,s,a);R===!0&&v!==null&&t.push({key:i[i.length-1],target:v,value:S})}return t}function q8(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function U8(t,e,r,i,n,s,a){let c=i.length,d=c-1,p=e;var m=-1,w,S,v,R=null,x=!0;if(v=w=t[e],typeof w!="object")return{value:null,parent:null,exists:x};for(;w!=null&&++m<c;){if(e=i[m],R=v,!(e in w)){x=!1;break}if(v=w[e],S=m!==d?v:s?a?n(v,[...r,p,...i]):n(v):n,w[e]=q8(w,e)&&S===v||S===void 0&&n!==void 0?w[e]:S,w=w[e],typeof w!="object")break}return{value:v,parent:R,exists:x}}function A5(t,e){for(var r=-1,i=e.length,n=t;n!=null&&++r<i;)n=n[e[r]];return n}});var I5=H((xC,T5)=>{"use strict";var{groupRestore:$8,nestedRestore:W8}=mf();T5.exports=F8;function F8({secret:t,wcLen:e}){return function(){if(this.restore)return;let i=Object.keys(t).filter(c=>t[c].precensored===!1),n=H8(t,i),s=e>0,a=s?{secret:t,groupRestore:$8,nestedRestore:W8}:{secret:t};this.restore=Function("o",G8(n,i,s)).bind(a)}}function H8(t,e){return e.map(r=>{let{circle:i,escPath:n,leadingBracket:s}=t[r],c=i?`o.${i} = secret[${n}].val`:`o${s?"":"."}${r} = secret[${n}].val`,d=`secret[${n}].val = undefined`;return`
63
+ `}function b3(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var _f=V((uA,B5)=>{"use strict";B5.exports={groupRedact:w3,groupRestore:v3,nestedRedact:x3,nestedRestore:_3};function v3({keys:t,values:e,target:r}){if(r==null)return;let i=t.length;for(var n=0;n<i;n++){let o=t[n];r[o]=e[n]}}function w3(t,e,r,i,n){let o=N5(t,e);if(o==null)return{keys:null,values:null,target:null,flat:!0};let a=Object.keys(o),h=a.length,d=e.length,m=n?[...e]:void 0,p=new Array(h);for(var M=0;M<h;M++){let R=a[M];p[M]=o[R],n?(m[d]=R,o[R]=r(o[R],m)):i?o[R]=r(o[R]):o[R]=r}return{keys:a,values:p,target:o,flat:!0}}function _3(t){let e=t.length;for(var r=0;r<e;r++){let{key:i,target:n,value:o}=t[r];n[i]=o}}function x3(t,e,r,i,n,o,a){let h=N5(e,r);if(h==null)return;let d=Object.keys(h),m=d.length;for(var p=0;p<m;p++){let M=d[p],{value:R,parent:x,exists:v}=M3(h,M,r,i,n,o,a);v===!0&&x!==null&&t.push({key:i[i.length-1],target:x,value:R})}return t}function S3(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function M3(t,e,r,i,n,o,a){let h=i.length,d=h-1,m=e;var p=-1,M,R,x,v=null,E=!0;if(x=M=t[e],typeof M!="object")return{value:null,parent:null,exists:E};for(;M!=null&&++p<h;){if(e=i[p],v=x,!(e in M)){E=!1;break}if(x=M[e],R=p!==d?x:o?a?n(x,[...r,m,...i]):n(x):n,M[e]=S3(M,e)&&R===x||R===void 0&&n!==void 0?M[e]:R,M=M[e],typeof M!="object")break}return{value:x,parent:v,exists:E}}function N5(t,e){for(var r=-1,i=e.length,n=t;n!=null&&++r<i;)n=n[e[r]];return n}});var z5=V((hA,D5)=>{"use strict";var{groupRestore:E3,nestedRestore:R3}=_f();D5.exports=C3;function C3({secret:t,wcLen:e}){return function(){if(this.restore)return;let i=Object.keys(t).filter(h=>t[h].precensored===!1),n=A3(t,i),o=e>0,a=o?{secret:t,groupRestore:E3,nestedRestore:R3}:{secret:t};this.restore=Function("o",T3(n,i,o)).bind(a)}}function A3(t,e){return e.map(r=>{let{circle:i,escPath:n,leadingBracket:o}=t[r],h=i?`o.${i} = secret[${n}].val`:`o${o?"":"."}${r} = secret[${n}].val`,d=`secret[${n}].val = undefined`;return`
64
64
  if (secret[${n}].val !== undefined) {
65
- try { ${c} } catch (e) {}
65
+ try { ${h} } catch (e) {}
66
66
  ${d}
67
67
  }
68
- `}).join("")}function G8(t,e,r){let i=r===!0?`
68
+ `}).join("")}function T3(t,e,r){let i=r===!0?`
69
69
  const keys = Object.keys(secret)
70
70
  const len = keys.length
71
71
  for (var i = ${e.length}; i < len; i++) {
@@ -80,63 +80,63 @@ Content-Type: ${s.type||"application/octet-stream"}\r
80
80
  ${t}
81
81
  ${i}
82
82
  return o
83
- `}});var O5=H((MC,k5)=>{"use strict";k5.exports=V8;function V8(t){let{secret:e,censor:r,compileRestore:i,serialize:n,groupRedact:s,nestedRedact:a,wildcards:c,wcLen:d}=t,p=[{secret:e,censor:r,compileRestore:i}];return n!==!1&&p.push({serialize:n}),d>0&&p.push({groupRedact:s,nestedRedact:a,wildcards:c,wcLen:d}),Object.assign(...p)}});var D5=H((EC,N5)=>{"use strict";var L5=S5(),K8=E5(),Z8=C5(),J8=I5(),{groupRedact:Y8,nestedRedact:X8}=mf(),Q8=O5(),e3=pu(),t3=L5(),gf=t=>t;gf.restore=gf;var r3="[REDACTED]";yf.rx=e3;yf.validator=L5;N5.exports=yf;function yf(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,i=t.remove;if(i===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let n=i===!0?void 0:"censor"in t?t.censor:r3,s=typeof n=="function",a=s&&n.length>1;if(e.length===0)return r||gf;t3({paths:e,serialize:r,censor:n});let{wildcards:c,wcLen:d,secret:p}=K8({paths:e,censor:n}),m=J8({secret:p,wcLen:d}),w="strict"in t?t.strict:!0;return Z8({secret:p,wcLen:d,serialize:r,strict:w,isCensorFct:s,censorFctTakesPath:a},Q8({secret:p,censor:n,compileRestore:m,serialize:r,groupRedact:Y8,nestedRedact:X8,wildcards:c,wcLen:d}))}});var Ao=H((RC,B5)=>{"use strict";var i3=Symbol("pino.setLevel"),n3=Symbol("pino.getLevel"),s3=Symbol("pino.levelVal"),o3=Symbol("pino.useLevelLabels"),a3=Symbol("pino.useOnlyCustomLevels"),l3=Symbol("pino.mixin"),u3=Symbol("pino.lsCache"),c3=Symbol("pino.chindings"),h3=Symbol("pino.parsedChindings"),f3=Symbol("pino.asJson"),d3=Symbol("pino.write"),p3=Symbol("pino.redactFmt"),m3=Symbol("pino.time"),g3=Symbol("pino.timeSliceIndex"),y3=Symbol("pino.stream"),b3=Symbol("pino.stringify"),v3=Symbol("pino.stringifySafe"),w3=Symbol("pino.stringifiers"),_3=Symbol("pino.end"),S3=Symbol("pino.formatOpts"),x3=Symbol("pino.messageKey"),M3=Symbol("pino.nestedKey"),E3=Symbol("pino.nestedKeyStr"),R3=Symbol("pino.mixinMergeStrategy"),C3=Symbol("pino.wildcardFirst"),A3=Symbol.for("pino.serializers"),P3=Symbol.for("pino.formatters"),T3=Symbol.for("pino.hooks"),I3=Symbol.for("pino.metadata");B5.exports={setLevelSym:i3,getLevelSym:n3,levelValSym:s3,useLevelLabelsSym:o3,mixinSym:l3,lsCacheSym:u3,chindingsSym:c3,parsedChindingsSym:h3,asJsonSym:f3,writeSym:d3,serializersSym:A3,redactFmtSym:p3,timeSym:m3,timeSliceIndexSym:g3,streamSym:y3,stringifySym:b3,stringifySafeSym:v3,stringifiersSym:w3,endSym:_3,formatOptsSym:S3,messageKeySym:x3,nestedKeySym:M3,wildcardFirstSym:C3,needsMetadataGsym:I3,useOnlyCustomLevelsSym:a3,formattersSym:P3,hooksSym:T3,nestedKeyStrSym:E3,mixinMergeStrategySym:R3}});var wf=H((CC,U5)=>{"use strict";var vf=D5(),{redactFmtSym:k3,wildcardFirstSym:mu}=Ao(),{rx:bf,validator:O3}=vf,z5=O3({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),j5="[Redacted]",q5=!1;function L3(t,e){let{paths:r,censor:i}=N3(t),n=r.reduce((c,d)=>{bf.lastIndex=0;let p=bf.exec(d),m=bf.exec(d),w=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(w==="*"&&(w=mu),m===null)return c[w]=null,c;if(c[w]===null)return c;let{index:S}=m,v=`${d.substr(S,d.length-1)}`;return c[w]=c[w]||[],w!==mu&&c[w].length===0&&c[w].push(...c[mu]||[]),w===mu&&Object.keys(c).forEach(function(R){c[R]&&c[R].push(v)}),c[w].push(v),c},{}),s={[k3]:vf({paths:r,censor:i,serialize:e,strict:q5})},a=(...c)=>e(typeof i=="function"?i(...c):i);return[...Object.keys(n),...Object.getOwnPropertySymbols(n)].reduce((c,d)=>{if(n[d]===null)c[d]=p=>a(p,[d]);else{let p=typeof i=="function"?(m,w)=>i(m,[d,...w]):i;c[d]=vf({paths:n[d],censor:p,serialize:e,strict:q5})}return c},s)}function N3(t){if(Array.isArray(t))return t={paths:t,censor:j5},z5(t),t;let{paths:e,censor:r=j5,remove:i}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(r=void 0),z5({paths:e,censor:r}),{paths:e,censor:r}}U5.exports=L3});var W5=H((AC,$5)=>{"use strict";var D3=()=>"",B3=()=>`,"time":${Date.now()}`,z3=()=>`,"time":${Math.round(Date.now()/1e3)}`,j3=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;$5.exports={nullTime:D3,epochTime:B3,unixTime:z3,isoTime:j3}});var H5=H((PC,F5)=>{"use strict";function q3(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}F5.exports=U3;function U3(t,e,r){var i=r&&r.stringify||q3,n=1;if(typeof t=="object"&&t!==null){var s=e.length+n;if(s===1)return t;var a=new Array(s);a[0]=i(t);for(var c=1;c<s;c++)a[c]=i(e[c]);return a.join(" ")}if(typeof t!="string")return t;var d=e.length;if(d===0)return t;for(var p="",m=1-n,w=-1,S=t&&t.length||0,v=0;v<S;){if(t.charCodeAt(v)===37&&v+1<S){switch(w=w>-1?w:0,t.charCodeAt(v+1)){case 100:case 102:if(m>=d||(w<v&&(p+=t.slice(w,v)),e[m]==null))break;p+=Number(e[m]),w=v=v+2;break;case 105:if(m>=d||(w<v&&(p+=t.slice(w,v)),e[m]==null))break;p+=Math.floor(Number(e[m])),w=v=v+2;break;case 79:case 111:case 106:if(m>=d||(w<v&&(p+=t.slice(w,v)),e[m]===void 0))break;var R=typeof e[m];if(R==="string"){p+="'"+e[m]+"'",w=v+2,v++;break}if(R==="function"){p+=e[m].name||"<anonymous>",w=v+2,v++;break}p+=i(e[m]),w=v+2,v++;break;case 115:if(m>=d)break;w<v&&(p+=t.slice(w,v)),p+=String(e[m]),w=v+2,v++;break;case 37:w<v&&(p+=t.slice(w,v)),p+="%",w=v+2,v++,m--;break}++m}++v}return w===-1?t:(w<S&&(p+=t.slice(w)),p)}});var Sf=H((TC,_f)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));_f.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let i=Date.now()+Number(e);for(;i>Date.now(););};_f.exports=t}});var J5=H((IC,Z5)=>{"use strict";var sr=require("fs"),$3=require("events"),W3=require("util").inherits,G5=require("path"),V5=Sf(),xf=100,Mf=16*1024*1024;function K5(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(n,s){if(n){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",n)}):e.emit("error",n);return}e.fd=s,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e._reopening&&!e._writing&&e._len>e.minLength&&!e.destroyed&&Po(e)}let i=e.append?"a":"w";if(e.sync)try{e.mkdir&&sr.mkdirSync(G5.dirname(t),{recursive:!0});let n=sr.openSync(t,i);r(null,n)}catch(n){throw r(n),n}else e.mkdir?sr.mkdir(G5.dirname(t),{recursive:!0},n=>{if(n)return r(n);sr.open(t,i,r)}):sr.open(t,i,r)}function $t(t){if(!(this instanceof $t))return new $t(t);let{fd:e,dest:r,minLength:i,maxLength:n,sync:s,append:a=!0,mkdir:c,retryEAGAIN:d}=t||{};if(e=e||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=n||0,this.sync=s||!1,this.append=a||!1,this.retryEAGAIN=d||(()=>!0),this.mkdir=c||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")K5(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=Mf)throw new Error(`minLength should be smaller than MAX_WRITE (${Mf})`);this.release=(p,m)=>{if(p){if(p.code==="EAGAIN"&&this.retryEAGAIN(p,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{V5(xf),this.release(void 0,0)}catch(S){this.release(S)}else setTimeout(()=>{sr.write(this.fd,this._writingBuf,"utf8",this.release)},xf);else this._writing=!1,this.emit("error",p);return}if(this._len-=m,this._writingBuf=this._writingBuf.slice(m),this._writingBuf.length){if(!this.sync){sr.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let S=sr.writeSync(this.fd,this._writingBuf,"utf8");this._len-=S,this._writingBuf=this._writingBuf.slice(S)}while(this._writingBuf)}catch(S){this.release(S);return}}let w=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):w>this.minLength?Po(this):this._ending?w>0?Po(this):(this._writing=!1,gu(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(F3,this)):this.emit("drain"))},this.on("newListener",function(p){p==="drain"&&(this._asyncDrainScheduled=!1)})}function F3(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}W3($t,$3);$t.prototype.write=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(!this._writing&&e>Mf?r.push(t):r.length===0?r[0]=""+t:r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&Po(this),this._len<this._hwm)};$t.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),Po(this))};$t.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&sr.close(e,r=>{if(r)return this.emit("error",r)})}),K5(t||this.file,this)};$t.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?Po(this):gu(this)))};$t.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");for(!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");this._bufs.length;){let t=this._bufs[0];try{this._len-=sr.writeSync(this.fd,t,"utf8"),this._bufs.shift()}catch(e){if(e.code!=="EAGAIN"||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;V5(xf)}}};$t.prototype.destroy=function(){this.destroyed||gu(this)};function Po(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift(),t.sync)try{let r=sr.writeSync(t.fd,t._writingBuf,"utf8");e(null,r)}catch(r){e(r)}else sr.write(t.fd,t._writingBuf,"utf8",e)}function gu(t){if(t.fd===-1){t.once("ready",gu.bind(null,t));return}sr.close(t.fd,e=>{if(e){t.emit("error",e);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}),t.destroyed=!0,t._bufs=[]}$t.SonicBoom=$t;$t.default=$t;Z5.exports=$t});var X5=H((kC,Y5)=>{"use strict";var{format:Ef}=require("util");function H3(){let t={},e=new Map;function r(n,s,a){if(!n)throw new Error("Warning name must not be empty");if(!s)throw new Error("Warning code must not be empty");if(!a)throw new Error("Warning message must not be empty");if(s=s.toUpperCase(),t[s]!==void 0)throw new Error(`The code '${s}' already exist`);function c(d,p,m){let w;return d&&p&&m?w=Ef(a,d,p,m):d&&p?w=Ef(a,d,p):d?w=Ef(a,d):w=a,{code:s,name:n,message:w}}return e.set(s,!1),t[s]=c,t[s]}function i(n,s,a,c){if(t[n]===void 0)throw new Error(`The code '${n}' does not exist`);if(e.get(n)===!0)return;e.set(n,!0);let d=t[n](s,a,c);process.emitWarning(d.message,d.name,d.code)}return{create:r,emit:i,emitted:e}}Y5.exports=H3});var t9=H((OC,e9)=>{"use strict";var Rf=X5()();e9.exports=Rf;var Q5="PinoWarning";Rf.create(Q5,"PINODEP008","prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.");Rf.create(Q5,"PINODEP009","The use of pino.final is discouraged in Node.js v14+ and not required. It will be removed in the next major version")});var Af=H((LC,s9)=>{"use strict";function r9(t,e,r,i){function n(){let s=e.deref();s!==void 0&&r(s,i)}t[i]=n,process.once(i,n)}var i9=new FinalizationRegistry(n9),Cf=new WeakMap;function n9(t){process.removeListener("exit",t.exit),process.removeListener("beforeExit",t.beforeExit)}function G3(t,e){if(t===void 0)throw new Error("the object can't be undefined");let r=new WeakRef(t),i={};Cf.set(t,i),i9.register(t,i),r9(i,r,e,"exit"),r9(i,r,e,"beforeExit")}function V3(t){let e=Cf.get(t);Cf.delete(t),e&&n9(e),i9.unregister(t)}s9.exports={register:G3,unregister:V3}});var a9=H((NC,o9)=>{"use strict";function K3(t,e,r,i,n){let s=Date.now()+i,a=Atomics.load(t,e);if(a===r){n(null,"ok");return}let c=a,d=p=>{Date.now()>s?n(null,"timed-out"):setTimeout(()=>{c=a,a=Atomics.load(t,e),a===c?d(p>=1e3?1e3:p*2):a===r?n(null,"ok"):n(null,"not-equal")},p)};d(1)}function Z3(t,e,r,i,n){let s=Date.now()+i,a=Atomics.load(t,e);if(a!==r){n(null,"ok");return}let c=d=>{Date.now()>s?n(null,"timed-out"):setTimeout(()=>{a=Atomics.load(t,e),a!==r?n(null,"ok"):c(d>=1e3?1e3:d*2)},d)};c(1)}o9.exports={wait:K3,waitDiff:Z3}});var u9=H((DC,l9)=>{"use strict";l9.exports={WRITE_INDEX:4,READ_INDEX:8}});var p9=H((zC,d9)=>{"use strict";var{EventEmitter:J3}=require("events"),{Worker:Y3}=require("worker_threads"),{join:X3}=require("path"),{pathToFileURL:Q3}=require("url"),{wait:e7}=a9(),{WRITE_INDEX:Wt,READ_INDEX:ci}=u9(),t7=require("buffer"),r7=require("assert"),U=Symbol("kImpl"),i7=t7.constants.MAX_STRING_LENGTH,bu=class{constructor(e){this._value=e}deref(){return this._value}},n7=global.FinalizationRegistry||class{register(){}unregister(){}},s7=global.WeakRef||bu,c9=new n7(t=>{t.exited||t.terminate()});function o7(t,e){let{filename:r,workerData:i}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||X3(__dirname,"lib","worker.js"),a=new Y3(s,{...e.workerOpts,workerData:{filename:r.indexOf("file://")===0?r:Q3(r).href,dataBuf:t[U].dataBuf,stateBuf:t[U].stateBuf,workerData:i}});return a.stream=new bu(t),a.on("message",a7),a.on("exit",f9),c9.register(t,a),a}function h9(t){r7(!t[U].sync),t[U].needDrain&&(t[U].needDrain=!1,t.emit("drain"))}function yu(t){let e=Atomics.load(t[U].state,Wt),r=t[U].data.length-e;if(r>0){if(t[U].buf.length===0){t[U].flushing=!1,t[U].ending?kf(t):t[U].needDrain&&process.nextTick(h9,t);return}let i=t[U].buf.slice(0,r),n=Buffer.byteLength(i);n<=r?(t[U].buf=t[U].buf.slice(r),vu(t,i,yu.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[U].state,ci,0),Atomics.store(t[U].state,Wt,0);n>t[U].data.length;)r=r/2,i=t[U].buf.slice(0,r),n=Buffer.byteLength(i);t[U].buf=t[U].buf.slice(r),vu(t,i,yu.bind(null,t))}})}else if(r===0){if(e===0&&t[U].buf.length===0)return;t.flush(()=>{Atomics.store(t[U].state,ci,0),Atomics.store(t[U].state,Wt,0),yu(t)})}else throw new Error("overwritten")}function a7(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new s7(e),e.flush(()=>{e[U].ready=!0,e.emit("ready")});break;case"ERROR":To(e,t.err);break;default:throw new Error("this should not happen: "+t.code)}}function f9(t){let e=this.stream.deref();e!==void 0&&(c9.unregister(e),e.worker.exited=!0,e.worker.off("exit",f9),To(e,t!==0?new Error("The worker thread exited"):null))}var Tf=class extends J3{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[U]={},this[U].stateBuf=new SharedArrayBuffer(128),this[U].state=new Int32Array(this[U].stateBuf),this[U].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[U].data=Buffer.from(this[U].dataBuf),this[U].sync=e.sync||!1,this[U].ending=!1,this[U].ended=!1,this[U].needDrain=!1,this[U].destroyed=!1,this[U].flushing=!1,this[U].ready=!1,this[U].finished=!1,this[U].errored=null,this[U].closed=!1,this[U].buf="",this.worker=o7(this,e)}write(e){if(this[U].destroyed)throw new Error("the worker has exited");if(this[U].ending)throw new Error("the worker is ending");if(this[U].flushing&&this[U].buf.length+e.length>=i7)try{Pf(this),this[U].flushing=!0}catch(r){return To(this,r),!1}if(this[U].buf+=e,this[U].sync)try{return Pf(this),!0}catch(r){return To(this,r),!1}return this[U].flushing||(this[U].flushing=!0,setImmediate(yu,this)),this[U].needDrain=this[U].data.length-this[U].buf.length-Atomics.load(this[U].state,Wt)<=0,!this[U].needDrain}end(){this[U].destroyed||(this[U].ending=!0,kf(this))}flush(e){if(this[U].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[U].state,Wt);e7(this[U].state,ci,r,1/0,(i,n)=>{if(i){To(this,i),process.nextTick(e,i);return}if(n==="not-equal"){this.flush(e);return}process.nextTick(e)})}flushSync(){this[U].destroyed||(Pf(this),If(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[U].ready}get destroyed(){return this[U].destroyed}get closed(){return this[U].closed}get writable(){return!this[U].destroyed&&!this[U].ending}get writableEnded(){return this[U].ending}get writableFinished(){return this[U].finished}get writableNeedDrain(){return this[U].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[U].errored}};function To(t,e){t[U].destroyed||(t[U].destroyed=!0,e&&(t[U].errored=e,t.emit("error",e)),t.worker.exited?setImmediate(()=>{t[U].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[U].closed=!0,t.emit("close")}))}function vu(t,e,r){let i=Atomics.load(t[U].state,Wt),n=Buffer.byteLength(e);return t[U].data.write(e,i),Atomics.store(t[U].state,Wt,i+n),Atomics.notify(t[U].state,Wt),r(),!0}function kf(t){if(!(t[U].ended||!t[U].ending||t[U].flushing)){t[U].ended=!0;try{t.flushSync();let e=Atomics.load(t[U].state,ci);Atomics.store(t[U].state,Wt,-1),Atomics.notify(t[U].state,Wt);let r=0;for(;e!==-1;){if(Atomics.wait(t[U].state,ci,e,1e3),e=Atomics.load(t[U].state,ci),e===-2)throw new Error("end() failed");if(++r===10)throw new Error("end() took too long (10s)")}process.nextTick(()=>{t[U].finished=!0,t.emit("finish")})}catch(e){To(t,e)}}}function Pf(t){let e=()=>{t[U].ending?kf(t):t[U].needDrain&&process.nextTick(h9,t)};for(t[U].flushing=!1;t[U].buf.length!==0;){let r=Atomics.load(t[U].state,Wt),i=t[U].data.length-r;if(i===0){If(t),Atomics.store(t[U].state,ci,0),Atomics.store(t[U].state,Wt,0);continue}else if(i<0)throw new Error("overwritten");let n=t[U].buf.slice(0,i),s=Buffer.byteLength(n);if(s<=i)t[U].buf=t[U].buf.slice(i),vu(t,n,e);else{for(If(t),Atomics.store(t[U].state,ci,0),Atomics.store(t[U].state,Wt,0);s>t[U].buf.length;)i=i/2,n=t[U].buf.slice(0,i),s=Buffer.byteLength(n);t[U].buf=t[U].buf.slice(i),vu(t,n,e)}}}function If(t){if(t[U].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[U].state,Wt),r=0;for(;;){let i=Atomics.load(t[U].state,ci);if(i===-2)throw new Error("_flushSync failed");if(i!==e)Atomics.wait(t[U].state,ci,i,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}d9.exports=Tf});var Lf=H((jC,g9)=>{"use strict";var{createRequire:l7}=require("module"),u7=pf(),{join:Of,isAbsolute:c7}=require("path"),h7=Sf(),wu;global.WeakRef&&global.WeakMap&&global.FinalizationRegistry&&(wu=Af());var f7=p9();function d7(t){if(wu)wu.register(t,m9),t.on("close",function(){wu.unregister(t)});else{let e=m9.bind(null,t);process.once("beforeExit",e),process.once("exit",e),t.on("close",function(){process.removeListener("beforeExit",e),process.removeListener("exit",e)})}}function p7(t,e,r){let i=new f7({filename:t,workerData:e,workerOpts:r});i.on("ready",n),i.on("close",function(){process.removeListener("exit",s)}),process.on("exit",s);function n(){process.removeListener("exit",s),i.unref(),r.autoEnd!==!1&&d7(i)}function s(){i.closed||(i.flushSync(),h7(100),i.end())}return i}function m9(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function m7(t){let{pipeline:e,targets:r,levels:i,options:n={},worker:s={},caller:a=u7()}=t,c=typeof a=="string"?[a]:a,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},p=t.target;if(p&&r)throw new Error("only one of target or targets can be specified");return r?(p=d["pino-worker"]||Of(__dirname,"worker.js"),n.targets=r.map(w=>({...w,target:m(w.target)}))):e&&(p=d["pino-pipeline-worker"]||Of(__dirname,"worker-pipeline.js"),n.targets=e.map(w=>({...w,target:m(w.target)}))),i&&(n.levels=i),p7(m(p),n,s);function m(w){if(w=d[w]||w,c7(w)||w.indexOf("file://")===0)return w;if(w==="pino/file")return Of(__dirname,"..","file.js");let S;for(let v of c)try{S=l7(v).resolve(w);break}catch{continue}if(!S)throw new Error(`unable to determine transport target for "${w}"`);return S}}g9.exports=m7});var Su=H((qC,A9)=>{"use strict";var y9=H5(),{mapHttpRequest:g7,mapHttpResponse:y7}=df(),Bf=J5(),S9=t9(),{lsCacheSym:b7,chindingsSym:zf,parsedChindingsSym:Nf,writeSym:b9,serializersSym:jf,formatOptsSym:v9,endSym:v7,stringifiersSym:qf,stringifySym:x9,stringifySafeSym:Uf,wildcardFirstSym:M9,needsMetadataGsym:E9,redactFmtSym:w7,streamSym:_7,nestedKeySym:S7,formattersSym:$f,messageKeySym:R9,nestedKeyStrSym:x7}=Ao(),{isMainThread:M7}=require("worker_threads"),E7=Lf();function i1(){}function R7(t,e){if(!e)return r;return function(...n){e.call(this,n,r,t)};function r(i,...n){if(typeof i=="object"){let s=i;i!==null&&(i.method&&i.headers&&i.socket?i=g7(i):typeof i.setHeader=="function"&&(i=y7(i)));let a;s===null&&n.length===0?a=[null]:(s=n.shift(),a=n),this[b9](i,y9(s,a,this[v9]),t)}else this[b9](null,y9(i,n,this[v9]),t)}}function w9(t){let e="",r=0,i=!1,n=255,s=t.length;if(s>100)return JSON.stringify(t);for(var a=0;a<s&&n>=32;a++)n=t.charCodeAt(a),(n===34||n===92)&&(e+=t.slice(r,a)+"\\",r=a,i=!0);return i?e+=t.slice(r):e=t,n<32?JSON.stringify(t):'"'+e+'"'}function C7(t,e,r,i){let n=this[x9],s=this[Uf],a=this[qf],c=this[v7],d=this[zf],p=this[jf],m=this[$f],w=this[R9],S=this[b7][r]+i;S=S+d;let v;m.log&&(t=m.log(t));let R=a[M9],x="";for(let C in t)if(v=t[C],Object.prototype.hasOwnProperty.call(t,C)&&v!==void 0){v=p[C]?p[C](v):v;let T=a[C]||R;switch(typeof v){case"undefined":case"function":continue;case"number":Number.isFinite(v)===!1&&(v=null);case"boolean":T&&(v=T(v));break;case"string":v=(T||w9)(v);break;default:v=(T||n)(v,s)}if(v===void 0)continue;x+=',"'+C+'":'+v}let A="";if(e!==void 0){v=p[w]?p[w](e):e;let C=a[w]||R;switch(typeof v){case"function":break;case"number":Number.isFinite(v)===!1&&(v=null);case"boolean":C&&(v=C(v)),A=',"'+w+'":'+v;break;case"string":v=(C||w9)(v),A=',"'+w+'":'+v;break;default:v=(C||n)(v,s),A=',"'+w+'":'+v}}return this[S7]&&x?S+this[x7]+x.slice(1)+"}"+A+c:S+x+A+c}function A7(t,e){let r,i=t[zf],n=t[x9],s=t[Uf],a=t[qf],c=a[M9],d=t[jf];e=t[$f].bindings(e);for(let m in e)if(r=e[m],(m!=="level"&&m!=="serializers"&&m!=="formatters"&&m!=="customLevels"&&e.hasOwnProperty(m)&&r!==void 0)===!0){if(r=d[m]?d[m](r):r,r=(a[m]||c||n)(r,s),r===void 0)continue;i+=',"'+m+'":'+r}return i}function C9(t,e,r,i){if(e&&typeof e=="function")return e=e.bind(i),Df(e(t),r,t);try{let n=require("pino-pretty").prettyFactory;return n.asMetaWrapper=Df,Df(n(t),r,t)}catch(n){throw n.message.startsWith("Cannot find module 'pino-pretty'")?Error("Missing `pino-pretty` module: `pino-pretty` must be installed separately"):n}}function Df(t,e,r){r=Object.assign({suppressFlushSyncWarning:!1},r);let i=!1;return{[E9]:!0,lastLevel:0,lastMsg:null,lastObj:null,lastLogger:null,flushSync(){r.suppressFlushSyncWarning||i||(i=!0,_9(e,this),e.write(t(Object.assign({level:40,msg:"pino.final with prettyPrint does not support flushing",time:Date.now()},this.chindings()))))},chindings(){let n=this.lastLogger,s=null;return n?(n.hasOwnProperty(Nf)?s=n[Nf]:(s=JSON.parse("{"+n[zf].substr(1)+"}"),n[Nf]=s),s):null},write(n){let s=this.lastLogger,a=this.chindings(),c=this.lastTime;typeof c=="number"||(c.match(/^\d+/)?c=parseInt(c):c=c.slice(1,-1));let d=this.lastObj,p=this.lastMsg,m=null,w=s[$f],S=w.log?w.log(d):d,v=s[R9];p&&S&&!Object.prototype.hasOwnProperty.call(S,v)&&(S[v]=p);let R=Object.assign({level:this.lastLevel,time:c},S,m),x=s[jf],A=Object.keys(x);for(var C=0;C<A.length;C++){let z=A[C];R[z]!==void 0&&(R[z]=x[z](R[z]))}for(let z in a)R.hasOwnProperty(z)||(R[z]=a[z]);let O=s[qf][w7],B=t(typeof O=="function"?O(R):R);B!==void 0&&(_9(e,this),e.write(B))}}}function P7(t){return t.write!==t.constructor.prototype.write}function _u(t){let e=new Bf(t);return e.on("error",r),!t.sync&&M7&&T7(e),e;function r(i){if(i.code==="EPIPE"){e.write=i1,e.end=i1,e.flushSync=i1,e.destroy=i1;return}e.removeListener("error",r),e.emit("error",i)}}function T7(t){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let e=Af();e.register(t,I7),t.on("close",function(){e.unregister(t)})}}function I7(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function k7(t){return function(r,i,n={},s){if(typeof n=="string")s=_u({dest:n,sync:!0}),n={};else if(typeof s=="string"){if(n&&n.transport)throw Error("only one of option.transport or stream can be specified");s=_u({dest:s,sync:!0})}else if(n instanceof Bf||n.writable||n._writableState)s=n,n={};else if(n.transport){if(n.transport instanceof Bf||n.transport.writable||n.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(n.transport.targets&&n.transport.targets.length&&n.formatters&&typeof n.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let m;n.customLevels&&(m=n.useOnlyCustomLevels?n.customLevels:Object.assign({},n.levels,n.customLevels)),s=E7({caller:i,...n.transport,levels:m})}if(n=Object.assign({},t,n),n.serializers=Object.assign({},t.serializers,n.serializers),n.formatters=Object.assign({},t.formatters,n.formatters),"onTerminated"in n)throw Error("The onTerminated option has been removed, use pino.final instead");"changeLevelName"in n&&(process.emitWarning("The changeLevelName option is deprecated and will be removed in v7. Use levelKey instead.",{code:"changeLevelName_deprecation"}),n.levelKey=n.changeLevelName,delete n.changeLevelName);let{enabled:a,prettyPrint:c,prettifier:d,messageKey:p}=n;if(a===!1&&(n.level="silent"),s=s||process.stdout,s===process.stdout&&s.fd>=0&&!P7(s)&&(s=_u({fd:s.fd,sync:!0})),c){S9.emit("PINODEP008");let m=Object.assign({messageKey:p},c);s=C9(m,d,s,r)}return{opts:n,stream:s}}}function O7(t,e){if(Number(process.versions.node.split(".")[0])>=14&&S9.emit("PINODEP009"),typeof t>"u"||typeof t.child!="function")throw Error("expected a pino logger instance");let i=typeof e<"u";if(i&&typeof e!="function")throw Error("if supplied, the handler parameter should be a function");let n=t[_7];if(typeof n.flushSync!="function")throw Error("final requires a stream that has a flushSync method, such as pino.destination");let s=new Proxy(t,{get:(a,c)=>c in a.levels.values?(...d)=>{a[c](...d),n.flushSync()}:a[c]});if(!i){try{n.flushSync()}catch{}return s}return(a=null,...c)=>{try{n.flushSync()}catch{}return e(a,s,...c)}}function L7(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Uf])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function N7(t,e,r){return{level:t,bindings:e,log:r}}function _9(t,e){t[E9]===!0&&(t.lastLevel=e.lastLevel,t.lastMsg=e.lastMsg,t.lastObj=e.lastObj,t.lastTime=e.lastTime,t.lastLogger=e.lastLogger)}function D7(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t}A9.exports={noop:i1,buildSafeSonicBoom:_u,getPrettyStream:C9,asChindings:A7,asJson:C7,genLog:R7,createArgsNormalizer:k7,final:O7,stringify:L7,buildFormatters:N7,normalizeDestFileDescriptor:D7}});var xu=H((UC,T9)=>{"use strict";var{lsCacheSym:B7,levelValSym:Wf,useOnlyCustomLevelsSym:z7,streamSym:j7,formattersSym:q7,hooksSym:U7}=Ao(),{noop:$7,genLog:ss}=Su(),Br={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},P9={fatal:t=>{let e=ss(Br.fatal,t);return function(...r){let i=this[j7];if(e.call(this,...r),typeof i.flushSync=="function")try{i.flushSync()}catch{}}},error:t=>ss(Br.error,t),warn:t=>ss(Br.warn,t),info:t=>ss(Br.info,t),debug:t=>ss(Br.debug,t),trace:t=>ss(Br.trace,t)},Ff=Object.keys(Br).reduce((t,e)=>(t[Br[e]]=e,t),{}),W7=Object.keys(Ff).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function F7(t){let e=t[q7].level,{labels:r}=t.levels,i={};for(let n in r){let s=e(r[n],Number(n));i[n]=JSON.stringify(s).slice(0,-1)}return t[B7]=i,t}function H7(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function G7(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let i=this[Wf],n=this[Wf]=r[t],s=this[z7],a=this[U7].logMethod;for(let c in r){if(n>r[c]){this[c]=$7;continue}this[c]=H7(c,s)?P9[c](a):ss(r[c],a)}this.emit("level-change",t,n,e[i],i)}function V7(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function K7(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[Wf]}function Z7(t=null,e=!1){let r=t?Object.keys(t).reduce((s,a)=>(s[t[a]]=a,s),{}):null,i=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Ff,r),n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Br,t);return{labels:i,values:n}}function J7(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(Ff).map(s=>+s),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Br,e);if(!(t in i))throw Error(`default level:${t} must be included in custom levels`)}function Y7(t,e){let{labels:r,values:i}=t;for(let n in e){if(n in i)throw Error("levels cannot be overridden");if(e[n]in r)throw Error("pre-existing level values cannot be used for new levels")}}T9.exports={initialLsCache:W7,genLsCache:F7,levelMethods:P9,getLevel:V7,setLevel:G7,isLevelEnabled:K7,mappings:Z7,levels:Br,assertNoLevelCollisions:Y7,assertDefaultLevelFound:J7}});var I9=H(($C,X7)=>{X7.exports={name:"pino",version:"7.11.0",description:"super fast, all natural json logger",main:"pino.js",type:"commonjs",types:"pino.d.ts",browser:"./browser.js",files:["pino.js","file.js","pino.d.ts","bin.js","browser.js","pretty.js","usage.txt","test","docs","example.js","lib"],scripts:{docs:"docsify serve","browser-test":"airtap --local 8080 test/browser*test.js",lint:"eslint .",test:"npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types","test-ci":"npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types","test-ci-pnpm":"pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types","test-ci-yarn-pnp":"yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly","test-types":"tsc && tsd && ts-node test/types/pino.ts",transpile:"node ./test/fixtures/ts/transpile.cjs","cov-ui":"tap --ts --coverage-report=html",bench:"node benchmarks/utils/runbench all","bench-basic":"node benchmarks/utils/runbench basic","bench-object":"node benchmarks/utils/runbench object","bench-deep-object":"node benchmarks/utils/runbench deep-object","bench-multi-arg":"node benchmarks/utils/runbench multi-arg","bench-longs-tring":"node benchmarks/utils/runbench long-string","bench-child":"node benchmarks/utils/runbench child","bench-child-child":"node benchmarks/utils/runbench child-child","bench-child-creation":"node benchmarks/utils/runbench child-creation","bench-formatters":"node benchmarks/utils/runbench formatters","update-bench-doc":"node benchmarks/utils/generate-benchmark-doc > docs/benchmarks.md"},bin:{pino:"./bin.js"},precommit:"test",repository:{type:"git",url:"git+https://github.com/pinojs/pino.git"},keywords:["fast","logger","stream","json"],author:"Matteo Collina <hello@matteocollina.com>",contributors:["David Mark Clements <huperekchuno@googlemail.com>","James Sumners <james.sumners@gmail.com>","Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)"],license:"MIT",bugs:{url:"https://github.com/pinojs/pino/issues"},homepage:"http://getpino.io",devDependencies:{"@types/flush-write-stream":"^1.0.0","@types/node":"^17.0.0","@types/tap":"^15.0.6",airtap:"4.0.4",benchmark:"^2.1.4",bole:"^4.0.0",bunyan:"^1.8.14","docsify-cli":"^4.4.1",eslint:"^7.17.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0",execa:"^5.0.0",fastbench:"^1.0.1","flush-write-stream":"^2.0.0","import-fresh":"^3.2.1",jest:"^27.3.1",log:"^6.0.0",loglevel:"^1.6.7","pino-pretty":"^v7.6.0","pre-commit":"^1.2.2",proxyquire:"^2.1.3",pump:"^3.0.0",rimraf:"^3.0.2",semver:"^7.0.0",split2:"^4.0.0",steed:"^1.1.3","strip-ansi":"^6.0.0",tap:"^16.0.0",tape:"^5.0.0",through2:"^4.0.0","ts-node":"^10.7.0",tsd:"^0.20.0",typescript:"^4.4.4",winston:"^3.3.3"},dependencies:{"atomic-sleep":"^1.0.0","fast-redact":"^3.0.0","on-exit-leak-free":"^0.2.0","pino-abstract-transport":"v0.5.0","pino-std-serializers":"^4.0.0","process-warning":"^1.0.0","quick-format-unescaped":"^4.0.3","real-require":"^0.1.0","safe-stable-stringify":"^2.1.0","sonic-boom":"^2.2.1","thread-stream":"^0.15.1"},tsd:{directory:"test/types"}}});var Hf=H((WC,k9)=>{"use strict";var{version:Q7}=I9();k9.exports={version:Q7}});var $9=H((HC,U9)=>{"use strict";var{EventEmitter:eb}=require("events"),{lsCacheSym:tb,levelValSym:rb,setLevelSym:Vf,getLevelSym:O9,chindingsSym:Kf,parsedChindingsSym:ib,mixinSym:nb,asJsonSym:B9,writeSym:sb,mixinMergeStrategySym:ob,timeSym:ab,timeSliceIndexSym:lb,streamSym:z9,serializersSym:os,formattersSym:Gf,useOnlyCustomLevelsSym:ub,needsMetadataGsym:cb,redactFmtSym:hb,stringifySym:fb,formatOptsSym:db,stringifiersSym:pb}=Ao(),{getLevel:mb,setLevel:gb,isLevelEnabled:yb,mappings:bb,initialLsCache:vb,genLsCache:wb,assertNoLevelCollisions:_b}=xu(),{asChindings:j9,asJson:Sb,buildFormatters:L9,stringify:N9}=Su(),{version:xb}=Hf(),Mb=wf(),Eb=class{},q9={constructor:Eb,child:Rb,bindings:Cb,setBindings:Ab,flush:kb,isLevelEnabled:yb,version:xb,get level(){return this[O9]()},set level(t){this[Vf](t)},get levelVal(){return this[rb]},set levelVal(t){throw Error("levelVal is read-only")},[tb]:vb,[sb]:Tb,[B9]:Sb,[O9]:mb,[Vf]:gb};Object.setPrototypeOf(q9,eb.prototype);U9.exports=function(){return Object.create(q9)};var D9=t=>t;function Rb(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[os],i=this[Gf],n=Object.create(this);if(e.hasOwnProperty("serializers")===!0){n[os]=Object.create(null);for(let m in r)n[os][m]=r[m];let d=Object.getOwnPropertySymbols(r);for(var s=0;s<d.length;s++){let m=d[s];n[os][m]=r[m]}for(let m in e.serializers)n[os][m]=e.serializers[m];let p=Object.getOwnPropertySymbols(e.serializers);for(var a=0;a<p.length;a++){let m=p[a];n[os][m]=e.serializers[m]}}else n[os]=r;if(e.hasOwnProperty("formatters")){let{level:d,bindings:p,log:m}=e.formatters;n[Gf]=L9(d||i.level,p||D9,m||i.log)}else n[Gf]=L9(i.level,D9,i.log);if(e.hasOwnProperty("customLevels")===!0&&(_b(this.levels,e.customLevels),n.levels=bb(e.customLevels,n[ub]),wb(n)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){n.redact=e.redact;let d=Mb(n.redact,N9),p={stringify:d[hb]};n[fb]=N9,n[pb]=d,n[db]=p}n[Kf]=j9(n,t);let c=e.level||this.level;return n[Vf](c),n}function Cb(){let e=`{${this[Kf].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function Ab(t){let e=j9(this,t);this[Kf]=e,delete this[ib]}function Pb(t,e){return Object.assign(e,t)}function Tb(t,e,r){let i=this[ab](),n=this[nb],s=this[ob]||Pb,a;t==null?a={}:t instanceof Error?(a={err:t},e===void 0&&(e=t.message)):(a=t,e===void 0&&t.err&&(e=t.err.message)),n&&(a=s(a,n(a,r)));let c=this[B9](a,e,r,i),d=this[z9];d[cb]===!0&&(d.lastLevel=r,d.lastObj=a,d.lastMsg=e,d.lastTime=i.slice(this[lb]),d.lastLogger=this),d.write(c)}function Ib(){}function kb(){let t=this[z9];"flush"in t&&t.flush(Ib)}});var G9=H((e0,H9)=>{"use strict";var ls=Qf();ls.configure=Qf;ls.stringify=ls;ls.default=ls;e0.stringify=ls;e0.configure=Qf;H9.exports=ls;var Ob=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Lb=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g,Xf=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\"];function Nb(t){let e=t.charCodeAt(0);return Xf.length>e?Xf[e]:`\\u${e.toString(16)}`}function fn(t){if(t.length<5e3&&!Ob.test(t))return t;if(t.length>100)return t.replace(Lb,Nb);let e="",r=0;for(let i=0;i<t.length;i++){let n=t.charCodeAt(i);if(n===34||n===92||n<32)e+=`${t.slice(r,i)}${Xf[n]}`,r=i+1;else if(n>=55296&&n<=57343){if(n<=56319&&i+1<t.length){let s=t.charCodeAt(i+1);if(s>=56320&&s<=57343){i++;continue}}e+=`${t.slice(r,i)}${`\\u${n.toString(16)}`}`,r=i+1}}return e+=t.slice(r),e}function Zf(t){if(t.length>200)return t.sort();for(let e=1;e<t.length;e++){let r=t[e],i=e;for(;i!==0&&t[i-1]>r;)t[i]=t[i-1],i--;t[i]=r}return t}var Db=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Uint8Array)),Symbol.toStringTag).get;function Jf(t){return Db.call(t)!==void 0&&t.length!==0}function Yf(t,e,r){t.length<r&&(r=t.length);let i=e===","?"":" ",n=`"0":${i}${t[0]}`;for(let s=1;s<r;s++)n+=`${e}"${s}":${i}${t[s]}`;return n}function Bb(t){if(t&&Object.prototype.hasOwnProperty.call(t,"circularValue")){var e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function W9(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(typeof r!="boolean")throw new TypeError(`The "${e}" argument must be of type boolean`)}return r===void 0?!0:r}function F9(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function as(t){return t===1?"1 item":`${t} items`}function zb(t){let e=new Set;for(let r of t)typeof r=="string"?e.add(r):typeof r=="number"&&e.add(String(r));return e}function Qf(t){let e=Bb(t),r=W9(t,"bigint"),i=W9(t,"deterministic"),n=F9(t,"maximumDepth"),s=F9(t,"maximumBreadth");function a(w,S,v,R,x,A){let C=S[w];switch(typeof C=="object"&&C!==null&&typeof C.toJSON=="function"&&(C=C.toJSON(w)),C=R.call(S,w,C),typeof C){case"string":return`"${fn(C)}"`;case"object":{if(C===null)return"null";if(v.indexOf(C)!==-1)return e;let T="",O=",",B=A;if(Array.isArray(C)){if(C.length===0)return"[]";if(n<v.length+1)return'"[Array]"';v.push(C),x!==""&&(A+=x,T+=`
84
- ${A}`,O=`,
85
- ${A}`);let De=Math.min(C.length,s),Pe=0;for(;Pe<De-1;Pe++){let ot=a(Pe,C,v,R,x,A);T+=ot!==void 0?ot:"null",T+=O}let We=a(Pe,C,v,R,x,A);if(T+=We!==void 0?We:"null",C.length-1>s){let ot=C.length-s-1;T+=`${O}"... ${as(ot)} not stringified"`}return x!==""&&(T+=`
86
- ${B}`),v.pop(),`[${T}]`}let z=Object.keys(C),G=z.length;if(G===0)return"{}";if(n<v.length+1)return'"[Object]"';let te="",se="";x!==""&&(A+=x,O=`,
87
- ${A}`,te=" ");let ke=Math.min(G,s);Jf(C)&&(T+=Yf(C,O,s),z=z.slice(C.length),ke-=C.length,se=O),i&&(z=Zf(z)),v.push(C);for(let De=0;De<ke;De++){let Pe=z[De],We=a(Pe,C,v,R,x,A);We!==void 0&&(T+=`${se}"${fn(Pe)}":${te}${We}`,se=O)}if(G>s){let De=G-s;T+=`${se}"...":${te}"${as(De)} not stringified"`,se=O}return x!==""&&se.length>1&&(T=`
88
- ${A}${T}
89
- ${B}`),v.pop(),`{${T}}`}case"number":return isFinite(C)?String(C):"null";case"boolean":return C===!0?"true":"false";case"bigint":return r?String(C):void 0}}function c(w,S,v,R,x,A){switch(typeof S=="object"&&S!==null&&typeof S.toJSON=="function"&&(S=S.toJSON(w)),typeof S){case"string":return`"${fn(S)}"`;case"object":{if(S===null)return"null";if(v.indexOf(S)!==-1)return e;let C=A,T="",O=",";if(Array.isArray(S)){if(S.length===0)return"[]";if(n<v.length+1)return'"[Array]"';v.push(S),x!==""&&(A+=x,T+=`
90
- ${A}`,O=`,
91
- ${A}`);let G=Math.min(S.length,s),te=0;for(;te<G-1;te++){let ke=c(te,S[te],v,R,x,A);T+=ke!==void 0?ke:"null",T+=O}let se=c(te,S[te],v,R,x,A);if(T+=se!==void 0?se:"null",S.length-1>s){let ke=S.length-s-1;T+=`${O}"... ${as(ke)} not stringified"`}return x!==""&&(T+=`
92
- ${C}`),v.pop(),`[${T}]`}if(R.size===0)return"{}";v.push(S);let B="";x!==""&&(A+=x,O=`,
93
- ${A}`,B=" ");let z="";for(let G of R){let te=c(G,S[G],v,R,x,A);te!==void 0&&(T+=`${z}"${fn(G)}":${B}${te}`,z=O)}return x!==""&&z.length>1&&(T=`
94
- ${A}${T}
95
- ${C}`),v.pop(),`{${T}}`}case"number":return isFinite(S)?String(S):"null";case"boolean":return S===!0?"true":"false";case"bigint":return r?String(S):void 0}}function d(w,S,v,R,x){switch(typeof S){case"string":return`"${fn(S)}"`;case"object":{if(S===null)return"null";if(typeof S.toJSON=="function"){if(S=S.toJSON(w),typeof S!="object")return d(w,S,v,R,x);if(S===null)return"null"}if(v.indexOf(S)!==-1)return e;let A=x;if(Array.isArray(S)){if(S.length===0)return"[]";if(n<v.length+1)return'"[Array]"';v.push(S),x+=R;let te=`
96
- ${x}`,se=`,
97
- ${x}`,ke=Math.min(S.length,s),De=0;for(;De<ke-1;De++){let We=d(De,S[De],v,R,x);te+=We!==void 0?We:"null",te+=se}let Pe=d(De,S[De],v,R,x);if(te+=Pe!==void 0?Pe:"null",S.length-1>s){let We=S.length-s-1;te+=`${se}"... ${as(We)} not stringified"`}return te+=`
98
- ${A}`,v.pop(),`[${te}]`}let C=Object.keys(S),T=C.length;if(T===0)return"{}";if(n<v.length+1)return'"[Object]"';x+=R;let O=`,
99
- ${x}`,B="",z="",G=Math.min(T,s);Jf(S)&&(B+=Yf(S,O,s),C=C.slice(S.length),G-=S.length,z=O),i&&(C=Zf(C)),v.push(S);for(let te=0;te<G;te++){let se=C[te],ke=d(se,S[se],v,R,x);ke!==void 0&&(B+=`${z}"${fn(se)}": ${ke}`,z=O)}if(T>s){let te=T-s;B+=`${z}"...": "${as(te)} not stringified"`,z=O}return z!==""&&(B=`
100
- ${x}${B}
101
- ${A}`),v.pop(),`{${B}}`}case"number":return isFinite(S)?String(S):"null";case"boolean":return S===!0?"true":"false";case"bigint":return r?String(S):void 0}}function p(w,S,v){switch(typeof S){case"string":return`"${fn(S)}"`;case"object":{if(S===null)return"null";if(typeof S.toJSON=="function"){if(S=S.toJSON(w),typeof S!="object")return p(w,S,v);if(S===null)return"null"}if(v.indexOf(S)!==-1)return e;let R="";if(Array.isArray(S)){if(S.length===0)return"[]";if(n<v.length+1)return'"[Array]"';v.push(S);let O=Math.min(S.length,s),B=0;for(;B<O-1;B++){let G=p(B,S[B],v);R+=G!==void 0?G:"null",R+=","}let z=p(B,S[B],v);if(R+=z!==void 0?z:"null",S.length-1>s){let G=S.length-s-1;R+=`,"... ${as(G)} not stringified"`}return v.pop(),`[${R}]`}let x=Object.keys(S),A=x.length;if(A===0)return"{}";if(n<v.length+1)return'"[Object]"';let C="",T=Math.min(A,s);Jf(S)&&(R+=Yf(S,",",s),x=x.slice(S.length),T-=S.length,C=","),i&&(x=Zf(x)),v.push(S);for(let O=0;O<T;O++){let B=x[O],z=p(B,S[B],v);z!==void 0&&(R+=`${C}"${fn(B)}":${z}`,C=",")}if(A>s){let O=A-s;R+=`${C}"...":"${as(O)} not stringified"`}return v.pop(),`{${R}}`}case"number":return isFinite(S)?String(S):"null";case"boolean":return S===!0?"true":"false";case"bigint":return r?String(S):void 0}}function m(w,S,v){if(arguments.length>1){let R="";if(typeof v=="number"?R=" ".repeat(Math.min(v,10)):typeof v=="string"&&(R=v.slice(0,10)),S!=null){if(typeof S=="function")return a("",{"":w},[],S,R,"");if(Array.isArray(S))return c("",w,[],zb(S),R,"")}if(R.length!==0)return d("",w,[],R,"")}return p("",w,[])}return m}});var J9=H((GC,Z9)=>{"use strict";var t0=Symbol.for("pino.metadata"),{levels:V9}=xu(),K9=Object.create(V9);K9.silent=1/0;var jb=V9.info;function qb(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let i=K9;e.levels&&typeof e.levels=="object"&&(i=e.levels);let n={write:s,add:c,flushSync:a,end:d,minLevel:0,streams:[],clone:p,[t0]:!0};return Array.isArray(t)?t.forEach(c,n):c.call(n,t),t=null,n;function s(m){let w,S=this.lastLevel,{streams:v}=this,R;for(let x=0;x<v.length&&(w=v[x],w.level<=S);x++){if(R=w.stream,R[t0]){let{lastTime:A,lastMsg:C,lastObj:T,lastLogger:O}=this;R.lastLevel=S,R.lastTime=A,R.lastMsg=C,R.lastObj=T,R.lastLogger=O}(!e.dedupe||w.level===S)&&R.write(m)}}function a(){for(let{stream:m}of this.streams)typeof m.flushSync=="function"&&m.flushSync()}function c(m){if(!m)return n;let w=typeof m.write=="function"||m.stream,S=m.write?m:m.stream;if(!w)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:v}=this,R;typeof m.levelVal=="number"?R=m.levelVal:typeof m.level=="string"?R=i[m.level]:typeof m.level=="number"?R=m.level:R=jb;let x={stream:S,level:R,levelVal:void 0,id:r++};return v.unshift(x),v.sort(Ub),this.minLevel=v[0].level,n}function d(){for(let{stream:m}of this.streams)typeof m.flushSync=="function"&&m.flushSync(),m.end()}function p(m){let w=new Array(this.streams.length);for(let S=0;S<w.length;S++)w[S]={level:m,stream:this.streams[S].stream};return{write:s,add:c,minLevel:m,streams:w,clone:p,flushSync:a,[t0]:!0}}}function Ub(t,e){return t.level-e.level}Z9.exports=qb});var n0=H((VC,or)=>{"use strict";var $b=require("os"),np=df(),Wb=pf(),Fb=wf(),sp=W5(),Hb=$9(),op=Ao(),{configure:Gb}=G9(),{assertDefaultLevelFound:Vb,mappings:ap,genLsCache:Kb,levels:Zb}=xu(),{createArgsNormalizer:Jb,asChindings:Yb,final:Xb,buildSafeSonicBoom:Y9,buildFormatters:Qb,stringify:Mu,normalizeDestFileDescriptor:X9,noop:ev}=Su(),{version:tv}=Hf(),{chindingsSym:Q9,redactFmtSym:rv,serializersSym:ep,timeSym:iv,timeSliceIndexSym:nv,streamSym:sv,stringifySym:tp,stringifySafeSym:r0,stringifiersSym:rp,setLevelSym:ov,endSym:av,formatOptsSym:lv,messageKeySym:uv,nestedKeySym:cv,mixinSym:hv,useOnlyCustomLevelsSym:fv,formattersSym:ip,hooksSym:dv,nestedKeyStrSym:pv,mixinMergeStrategySym:mv}=op,{epochTime:lp,nullTime:gv}=sp,{pid:yv}=process,bv=$b.hostname(),vv=np.err,wv={level:"info",levels:Zb,messageKey:"msg",nestedKey:null,enabled:!0,prettyPrint:!1,base:{pid:yv,hostname:bv},serializers:Object.assign(Object.create(null),{err:vv}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0},timestamp:lp,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},_v=Jb(wv),Sv=Object.assign(Object.create(null),np);function i0(...t){let e={},{opts:r,stream:i}=_v(e,Wb(),...t),{redact:n,crlf:s,serializers:a,timestamp:c,messageKey:d,nestedKey:p,base:m,name:w,level:S,customLevels:v,mixin:R,mixinMergeStrategy:x,useOnlyCustomLevels:A,formatters:C,hooks:T,depthLimit:O,edgeLimit:B}=r,z=Gb({maximumDepth:O,maximumBreadth:B}),G=Qb(C.level,C.bindings,C.log),te=n?Fb(n,Mu):{},se=Mu.bind({[r0]:z}),ke=n?{stringify:te[rv]}:{stringify:se},De="}"+(s?`\r
83
+ `}});var U5=V((cA,j5)=>{"use strict";j5.exports=P3;function P3(t){let{secret:e,censor:r,compileRestore:i,serialize:n,groupRedact:o,nestedRedact:a,wildcards:h,wcLen:d}=t,m=[{secret:e,censor:r,compileRestore:i}];return n!==!1&&m.push({serialize:n}),d>0&&m.push({groupRedact:o,nestedRedact:a,wildcards:h,wcLen:d}),Object.assign(...m)}});var $5=V((fA,F5)=>{"use strict";var q5=T5(),I3=O5(),O3=L5(),k3=z5(),{groupRedact:L3,nestedRedact:N3}=_f(),B3=U5(),D3=xu(),z3=q5(),xf=t=>t;xf.restore=xf;var j3="[REDACTED]";Sf.rx=D3;Sf.validator=q5;F5.exports=Sf;function Sf(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,i=t.remove;if(i===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let n=i===!0?void 0:"censor"in t?t.censor:j3,o=typeof n=="function",a=o&&n.length>1;if(e.length===0)return r||xf;z3({paths:e,serialize:r,censor:n});let{wildcards:h,wcLen:d,secret:m}=I3({paths:e,censor:n}),p=k3({secret:m,wcLen:d}),M="strict"in t?t.strict:!0;return O3({secret:m,wcLen:d,serialize:r,strict:M,isCensorFct:o,censorFctTakesPath:a},B3({secret:m,censor:n,compileRestore:p,serialize:r,groupRedact:L3,nestedRedact:N3,wildcards:h,wcLen:d}))}});var Uo=V((dA,W5)=>{"use strict";var U3=Symbol("pino.setLevel"),q3=Symbol("pino.getLevel"),F3=Symbol("pino.levelVal"),$3=Symbol("pino.useLevelLabels"),W3=Symbol("pino.useOnlyCustomLevels"),H3=Symbol("pino.mixin"),G3=Symbol("pino.lsCache"),V3=Symbol("pino.chindings"),K3=Symbol("pino.parsedChindings"),J3=Symbol("pino.asJson"),Z3=Symbol("pino.write"),Y3=Symbol("pino.redactFmt"),X3=Symbol("pino.time"),Q3=Symbol("pino.timeSliceIndex"),e7=Symbol("pino.stream"),t7=Symbol("pino.stringify"),r7=Symbol("pino.stringifySafe"),i7=Symbol("pino.stringifiers"),n7=Symbol("pino.end"),s7=Symbol("pino.formatOpts"),o7=Symbol("pino.messageKey"),a7=Symbol("pino.nestedKey"),l7=Symbol("pino.nestedKeyStr"),u7=Symbol("pino.mixinMergeStrategy"),h7=Symbol("pino.wildcardFirst"),c7=Symbol.for("pino.serializers"),f7=Symbol.for("pino.formatters"),d7=Symbol.for("pino.hooks"),m7=Symbol.for("pino.metadata");W5.exports={setLevelSym:U3,getLevelSym:q3,levelValSym:F3,useLevelLabelsSym:$3,mixinSym:H3,lsCacheSym:G3,chindingsSym:V3,parsedChindingsSym:K3,asJsonSym:J3,writeSym:Z3,serializersSym:c7,redactFmtSym:Y3,timeSym:X3,timeSliceIndexSym:Q3,streamSym:e7,stringifySym:t7,stringifySafeSym:r7,stringifiersSym:i7,endSym:n7,formatOptsSym:s7,messageKeySym:o7,nestedKeySym:a7,wildcardFirstSym:h7,needsMetadataGsym:m7,useOnlyCustomLevelsSym:W3,formattersSym:f7,hooksSym:d7,nestedKeyStrSym:l7,mixinMergeStrategySym:u7}});var Rf=V((mA,K5)=>{"use strict";var Ef=$5(),{redactFmtSym:p7,wildcardFirstSym:Su}=Uo(),{rx:Mf,validator:g7}=Ef,H5=g7({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),G5="[Redacted]",V5=!1;function y7(t,e){let{paths:r,censor:i}=b7(t),n=r.reduce((h,d)=>{Mf.lastIndex=0;let m=Mf.exec(d),p=Mf.exec(d),M=m[1]!==void 0?m[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):m[0];if(M==="*"&&(M=Su),p===null)return h[M]=null,h;if(h[M]===null)return h;let{index:R}=p,x=`${d.substr(R,d.length-1)}`;return h[M]=h[M]||[],M!==Su&&h[M].length===0&&h[M].push(...h[Su]||[]),M===Su&&Object.keys(h).forEach(function(v){h[v]&&h[v].push(x)}),h[M].push(x),h},{}),o={[p7]:Ef({paths:r,censor:i,serialize:e,strict:V5})},a=(...h)=>e(typeof i=="function"?i(...h):i);return[...Object.keys(n),...Object.getOwnPropertySymbols(n)].reduce((h,d)=>{if(n[d]===null)h[d]=m=>a(m,[d]);else{let m=typeof i=="function"?(p,M)=>i(p,[d,...M]):i;h[d]=Ef({paths:n[d],censor:m,serialize:e,strict:V5})}return h},o)}function b7(t){if(Array.isArray(t))return t={paths:t,censor:G5},H5(t),t;let{paths:e,censor:r=G5,remove:i}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return i===!0&&(r=void 0),H5({paths:e,censor:r}),{paths:e,censor:r}}K5.exports=y7});var Z5=V((pA,J5)=>{"use strict";var v7=()=>"",w7=()=>`,"time":${Date.now()}`,_7=()=>`,"time":${Math.round(Date.now()/1e3)}`,x7=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;J5.exports={nullTime:v7,epochTime:w7,unixTime:_7,isoTime:x7}});var X5=V((gA,Y5)=>{"use strict";function S7(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Y5.exports=M7;function M7(t,e,r){var i=r&&r.stringify||S7,n=1;if(typeof t=="object"&&t!==null){var o=e.length+n;if(o===1)return t;var a=new Array(o);a[0]=i(t);for(var h=1;h<o;h++)a[h]=i(e[h]);return a.join(" ")}if(typeof t!="string")return t;var d=e.length;if(d===0)return t;for(var m="",p=1-n,M=-1,R=t&&t.length||0,x=0;x<R;){if(t.charCodeAt(x)===37&&x+1<R){switch(M=M>-1?M:0,t.charCodeAt(x+1)){case 100:case 102:if(p>=d||(M<x&&(m+=t.slice(M,x)),e[p]==null))break;m+=Number(e[p]),M=x=x+2;break;case 105:if(p>=d||(M<x&&(m+=t.slice(M,x)),e[p]==null))break;m+=Math.floor(Number(e[p])),M=x=x+2;break;case 79:case 111:case 106:if(p>=d||(M<x&&(m+=t.slice(M,x)),e[p]===void 0))break;var v=typeof e[p];if(v==="string"){m+="'"+e[p]+"'",M=x+2,x++;break}if(v==="function"){m+=e[p].name||"<anonymous>",M=x+2,x++;break}m+=i(e[p]),M=x+2,x++;break;case 115:if(p>=d)break;M<x&&(m+=t.slice(M,x)),m+=String(e[p]),M=x+2,x++;break;case 37:M<x&&(m+=t.slice(M,x)),m+="%",M=x+2,x++,p--;break}++p}++x}return M===-1?t:(M<R&&(m+=t.slice(M)),m)}});var Af=V((yA,Cf)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));Cf.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let i=Date.now()+Number(e);for(;i>Date.now(););};Cf.exports=t}});var i9=V((bA,r9)=>{"use strict";var nr=require("fs"),E7=require("events"),R7=require("util").inherits,Q5=require("path"),e9=Af(),Tf=100,Pf=16*1024*1024;function t9(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(n,o){if(n){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",n)}):e.emit("error",n);return}e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e._reopening&&!e._writing&&e._len>e.minLength&&!e.destroyed&&qo(e)}let i=e.append?"a":"w";if(e.sync)try{e.mkdir&&nr.mkdirSync(Q5.dirname(t),{recursive:!0});let n=nr.openSync(t,i);r(null,n)}catch(n){throw r(n),n}else e.mkdir?nr.mkdir(Q5.dirname(t),{recursive:!0},n=>{if(n)return r(n);nr.open(t,i,r)}):nr.open(t,i,r)}function Ht(t){if(!(this instanceof Ht))return new Ht(t);let{fd:e,dest:r,minLength:i,maxLength:n,sync:o,append:a=!0,mkdir:h,retryEAGAIN:d}=t||{};if(e=e||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(i||0,16387),this.file=null,this.destroyed=!1,this.minLength=i||0,this.maxLength=n||0,this.sync=o||!1,this.append=a||!1,this.retryEAGAIN=d||(()=>!0),this.mkdir=h||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")t9(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=Pf)throw new Error(`minLength should be smaller than MAX_WRITE (${Pf})`);this.release=(m,p)=>{if(m){if(m.code==="EAGAIN"&&this.retryEAGAIN(m,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{e9(Tf),this.release(void 0,0)}catch(R){this.release(R)}else setTimeout(()=>{nr.write(this.fd,this._writingBuf,"utf8",this.release)},Tf);else this._writing=!1,this.emit("error",m);return}if(this._len-=p,this._writingBuf=this._writingBuf.slice(p),this._writingBuf.length){if(!this.sync){nr.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let R=nr.writeSync(this.fd,this._writingBuf,"utf8");this._len-=R,this._writingBuf=this._writingBuf.slice(R)}while(this._writingBuf)}catch(R){this.release(R);return}}let M=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):M>this.minLength?qo(this):this._ending?M>0?qo(this):(this._writing=!1,Mu(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(C7,this)):this.emit("drain"))},this.on("newListener",function(m){m==="drain"&&(this._asyncDrainScheduled=!1)})}function C7(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}R7(Ht,E7);Ht.prototype.write=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(!this._writing&&e>Pf?r.push(t):r.length===0?r[0]=""+t:r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&qo(this),this._len<this._hwm)};Ht.prototype.flush=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");this._writing||this.minLength<=0||(this._bufs.length===0&&this._bufs.push(""),qo(this))};Ht.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&nr.close(e,r=>{if(r)return this.emit("error",r)})}),t9(t||this.file,this)};Ht.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?qo(this):Mu(this)))};Ht.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");for(!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");this._bufs.length;){let t=this._bufs[0];try{this._len-=nr.writeSync(this.fd,t,"utf8"),this._bufs.shift()}catch(e){if(e.code!=="EAGAIN"||!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;e9(Tf)}}};Ht.prototype.destroy=function(){this.destroyed||Mu(this)};function qo(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift(),t.sync)try{let r=nr.writeSync(t.fd,t._writingBuf,"utf8");e(null,r)}catch(r){e(r)}else nr.write(t.fd,t._writingBuf,"utf8",e)}function Mu(t){if(t.fd===-1){t.once("ready",Mu.bind(null,t));return}nr.close(t.fd,e=>{if(e){t.emit("error",e);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}),t.destroyed=!0,t._bufs=[]}Ht.SonicBoom=Ht;Ht.default=Ht;r9.exports=Ht});var s9=V((vA,n9)=>{"use strict";var{format:If}=require("util");function A7(){let t={},e=new Map;function r(n,o,a){if(!n)throw new Error("Warning name must not be empty");if(!o)throw new Error("Warning code must not be empty");if(!a)throw new Error("Warning message must not be empty");if(o=o.toUpperCase(),t[o]!==void 0)throw new Error(`The code '${o}' already exist`);function h(d,m,p){let M;return d&&m&&p?M=If(a,d,m,p):d&&m?M=If(a,d,m):d?M=If(a,d):M=a,{code:o,name:n,message:M}}return e.set(o,!1),t[o]=h,t[o]}function i(n,o,a,h){if(t[n]===void 0)throw new Error(`The code '${n}' does not exist`);if(e.get(n)===!0)return;e.set(n,!0);let d=t[n](o,a,h);process.emitWarning(d.message,d.name,d.code)}return{create:r,emit:i,emitted:e}}n9.exports=A7});var l9=V((wA,a9)=>{"use strict";var Of=s9()();a9.exports=Of;var o9="PinoWarning";Of.create(o9,"PINODEP008","prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.");Of.create(o9,"PINODEP009","The use of pino.final is discouraged in Node.js v14+ and not required. It will be removed in the next major version")});var Lf=V((_A,f9)=>{"use strict";function u9(t,e,r,i){function n(){let o=e.deref();o!==void 0&&r(o,i)}t[i]=n,process.once(i,n)}var h9=new FinalizationRegistry(c9),kf=new WeakMap;function c9(t){process.removeListener("exit",t.exit),process.removeListener("beforeExit",t.beforeExit)}function T7(t,e){if(t===void 0)throw new Error("the object can't be undefined");let r=new WeakRef(t),i={};kf.set(t,i),h9.register(t,i),u9(i,r,e,"exit"),u9(i,r,e,"beforeExit")}function P7(t){let e=kf.get(t);kf.delete(t),e&&c9(e),h9.unregister(t)}f9.exports={register:T7,unregister:P7}});var m9=V((xA,d9)=>{"use strict";function I7(t,e,r,i,n){let o=Date.now()+i,a=Atomics.load(t,e);if(a===r){n(null,"ok");return}let h=a,d=m=>{Date.now()>o?n(null,"timed-out"):setTimeout(()=>{h=a,a=Atomics.load(t,e),a===h?d(m>=1e3?1e3:m*2):a===r?n(null,"ok"):n(null,"not-equal")},m)};d(1)}function O7(t,e,r,i,n){let o=Date.now()+i,a=Atomics.load(t,e);if(a!==r){n(null,"ok");return}let h=d=>{Date.now()>o?n(null,"timed-out"):setTimeout(()=>{a=Atomics.load(t,e),a!==r?n(null,"ok"):h(d>=1e3?1e3:d*2)},d)};h(1)}d9.exports={wait:I7,waitDiff:O7}});var g9=V((SA,p9)=>{"use strict";p9.exports={WRITE_INDEX:4,READ_INDEX:8}});var _9=V((EA,w9)=>{"use strict";var{EventEmitter:k7}=require("events"),{Worker:L7}=require("worker_threads"),{join:N7}=require("path"),{pathToFileURL:B7}=require("url"),{wait:D7}=m9(),{WRITE_INDEX:Gt,READ_INDEX:oi}=g9(),z7=require("buffer"),j7=require("assert"),q=Symbol("kImpl"),U7=z7.constants.MAX_STRING_LENGTH,Ru=class{constructor(e){this._value=e}deref(){return this._value}},q7=global.FinalizationRegistry||class{register(){}unregister(){}},F7=global.WeakRef||Ru,y9=new q7(t=>{t.exited||t.terminate()});function $7(t,e){let{filename:r,workerData:i}=e,o=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||N7(__dirname,"lib","worker.js"),a=new L7(o,{...e.workerOpts,workerData:{filename:r.indexOf("file://")===0?r:B7(r).href,dataBuf:t[q].dataBuf,stateBuf:t[q].stateBuf,workerData:i}});return a.stream=new Ru(t),a.on("message",W7),a.on("exit",v9),y9.register(t,a),a}function b9(t){j7(!t[q].sync),t[q].needDrain&&(t[q].needDrain=!1,t.emit("drain"))}function Eu(t){let e=Atomics.load(t[q].state,Gt),r=t[q].data.length-e;if(r>0){if(t[q].buf.length===0){t[q].flushing=!1,t[q].ending?zf(t):t[q].needDrain&&process.nextTick(b9,t);return}let i=t[q].buf.slice(0,r),n=Buffer.byteLength(i);n<=r?(t[q].buf=t[q].buf.slice(r),Cu(t,i,Eu.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[q].state,oi,0),Atomics.store(t[q].state,Gt,0);n>t[q].data.length;)r=r/2,i=t[q].buf.slice(0,r),n=Buffer.byteLength(i);t[q].buf=t[q].buf.slice(r),Cu(t,i,Eu.bind(null,t))}})}else if(r===0){if(e===0&&t[q].buf.length===0)return;t.flush(()=>{Atomics.store(t[q].state,oi,0),Atomics.store(t[q].state,Gt,0),Eu(t)})}else throw new Error("overwritten")}function W7(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new F7(e),e.flush(()=>{e[q].ready=!0,e.emit("ready")});break;case"ERROR":Fo(e,t.err);break;default:throw new Error("this should not happen: "+t.code)}}function v9(t){let e=this.stream.deref();e!==void 0&&(y9.unregister(e),e.worker.exited=!0,e.worker.off("exit",v9),Fo(e,t!==0?new Error("The worker thread exited"):null))}var Bf=class extends k7{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[q]={},this[q].stateBuf=new SharedArrayBuffer(128),this[q].state=new Int32Array(this[q].stateBuf),this[q].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[q].data=Buffer.from(this[q].dataBuf),this[q].sync=e.sync||!1,this[q].ending=!1,this[q].ended=!1,this[q].needDrain=!1,this[q].destroyed=!1,this[q].flushing=!1,this[q].ready=!1,this[q].finished=!1,this[q].errored=null,this[q].closed=!1,this[q].buf="",this.worker=$7(this,e)}write(e){if(this[q].destroyed)throw new Error("the worker has exited");if(this[q].ending)throw new Error("the worker is ending");if(this[q].flushing&&this[q].buf.length+e.length>=U7)try{Nf(this),this[q].flushing=!0}catch(r){return Fo(this,r),!1}if(this[q].buf+=e,this[q].sync)try{return Nf(this),!0}catch(r){return Fo(this,r),!1}return this[q].flushing||(this[q].flushing=!0,setImmediate(Eu,this)),this[q].needDrain=this[q].data.length-this[q].buf.length-Atomics.load(this[q].state,Gt)<=0,!this[q].needDrain}end(){this[q].destroyed||(this[q].ending=!0,zf(this))}flush(e){if(this[q].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[q].state,Gt);D7(this[q].state,oi,r,1/0,(i,n)=>{if(i){Fo(this,i),process.nextTick(e,i);return}if(n==="not-equal"){this.flush(e);return}process.nextTick(e)})}flushSync(){this[q].destroyed||(Nf(this),Df(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[q].ready}get destroyed(){return this[q].destroyed}get closed(){return this[q].closed}get writable(){return!this[q].destroyed&&!this[q].ending}get writableEnded(){return this[q].ending}get writableFinished(){return this[q].finished}get writableNeedDrain(){return this[q].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[q].errored}};function Fo(t,e){t[q].destroyed||(t[q].destroyed=!0,e&&(t[q].errored=e,t.emit("error",e)),t.worker.exited?setImmediate(()=>{t[q].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[q].closed=!0,t.emit("close")}))}function Cu(t,e,r){let i=Atomics.load(t[q].state,Gt),n=Buffer.byteLength(e);return t[q].data.write(e,i),Atomics.store(t[q].state,Gt,i+n),Atomics.notify(t[q].state,Gt),r(),!0}function zf(t){if(!(t[q].ended||!t[q].ending||t[q].flushing)){t[q].ended=!0;try{t.flushSync();let e=Atomics.load(t[q].state,oi);Atomics.store(t[q].state,Gt,-1),Atomics.notify(t[q].state,Gt);let r=0;for(;e!==-1;){if(Atomics.wait(t[q].state,oi,e,1e3),e=Atomics.load(t[q].state,oi),e===-2)throw new Error("end() failed");if(++r===10)throw new Error("end() took too long (10s)")}process.nextTick(()=>{t[q].finished=!0,t.emit("finish")})}catch(e){Fo(t,e)}}}function Nf(t){let e=()=>{t[q].ending?zf(t):t[q].needDrain&&process.nextTick(b9,t)};for(t[q].flushing=!1;t[q].buf.length!==0;){let r=Atomics.load(t[q].state,Gt),i=t[q].data.length-r;if(i===0){Df(t),Atomics.store(t[q].state,oi,0),Atomics.store(t[q].state,Gt,0);continue}else if(i<0)throw new Error("overwritten");let n=t[q].buf.slice(0,i),o=Buffer.byteLength(n);if(o<=i)t[q].buf=t[q].buf.slice(i),Cu(t,n,e);else{for(Df(t),Atomics.store(t[q].state,oi,0),Atomics.store(t[q].state,Gt,0);o>t[q].buf.length;)i=i/2,n=t[q].buf.slice(0,i),o=Buffer.byteLength(n);t[q].buf=t[q].buf.slice(i),Cu(t,n,e)}}}function Df(t){if(t[q].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[q].state,Gt),r=0;for(;;){let i=Atomics.load(t[q].state,oi);if(i===-2)throw new Error("_flushSync failed");if(i!==e)Atomics.wait(t[q].state,oi,i,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}w9.exports=Bf});var Uf=V((RA,S9)=>{"use strict";var{createRequire:H7}=require("module"),G7=wf(),{join:jf,isAbsolute:V7}=require("path"),K7=Af(),Au;global.WeakRef&&global.WeakMap&&global.FinalizationRegistry&&(Au=Lf());var J7=_9();function Z7(t){if(Au)Au.register(t,x9),t.on("close",function(){Au.unregister(t)});else{let e=x9.bind(null,t);process.once("beforeExit",e),process.once("exit",e),t.on("close",function(){process.removeListener("beforeExit",e),process.removeListener("exit",e)})}}function Y7(t,e,r){let i=new J7({filename:t,workerData:e,workerOpts:r});i.on("ready",n),i.on("close",function(){process.removeListener("exit",o)}),process.on("exit",o);function n(){process.removeListener("exit",o),i.unref(),r.autoEnd!==!1&&Z7(i)}function o(){i.closed||(i.flushSync(),K7(100),i.end())}return i}function x9(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function X7(t){let{pipeline:e,targets:r,levels:i,options:n={},worker:o={},caller:a=G7()}=t,h=typeof a=="string"?[a]:a,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},m=t.target;if(m&&r)throw new Error("only one of target or targets can be specified");return r?(m=d["pino-worker"]||jf(__dirname,"worker.js"),n.targets=r.map(M=>({...M,target:p(M.target)}))):e&&(m=d["pino-pipeline-worker"]||jf(__dirname,"worker-pipeline.js"),n.targets=e.map(M=>({...M,target:p(M.target)}))),i&&(n.levels=i),Y7(p(m),n,o);function p(M){if(M=d[M]||M,V7(M)||M.indexOf("file://")===0)return M;if(M==="pino/file")return jf(__dirname,"..","file.js");let R;for(let x of h)try{R=H7(x).resolve(M);break}catch{continue}if(!R)throw new Error(`unable to determine transport target for "${M}"`);return R}}S9.exports=X7});var Pu=V((CA,N9)=>{"use strict";var M9=X5(),{mapHttpRequest:Q7,mapHttpResponse:eb}=vf(),$f=i9(),T9=l9(),{lsCacheSym:tb,chindingsSym:Wf,parsedChindingsSym:qf,writeSym:E9,serializersSym:Hf,formatOptsSym:R9,endSym:rb,stringifiersSym:Gf,stringifySym:P9,stringifySafeSym:Vf,wildcardFirstSym:I9,needsMetadataGsym:O9,redactFmtSym:ib,streamSym:nb,nestedKeySym:sb,formattersSym:Kf,messageKeySym:k9,nestedKeyStrSym:ob}=Uo(),{isMainThread:ab}=require("worker_threads"),lb=Uf();function d1(){}function ub(t,e){if(!e)return r;return function(...n){e.call(this,n,r,t)};function r(i,...n){if(typeof i=="object"){let o=i;i!==null&&(i.method&&i.headers&&i.socket?i=Q7(i):typeof i.setHeader=="function"&&(i=eb(i)));let a;o===null&&n.length===0?a=[null]:(o=n.shift(),a=n),this[E9](i,M9(o,a,this[R9]),t)}else this[E9](null,M9(i,n,this[R9]),t)}}function C9(t){let e="",r=0,i=!1,n=255,o=t.length;if(o>100)return JSON.stringify(t);for(var a=0;a<o&&n>=32;a++)n=t.charCodeAt(a),(n===34||n===92)&&(e+=t.slice(r,a)+"\\",r=a,i=!0);return i?e+=t.slice(r):e=t,n<32?JSON.stringify(t):'"'+e+'"'}function hb(t,e,r,i){let n=this[P9],o=this[Vf],a=this[Gf],h=this[rb],d=this[Wf],m=this[Hf],p=this[Kf],M=this[k9],R=this[tb][r]+i;R=R+d;let x;p.log&&(t=p.log(t));let v=a[I9],E="";for(let C in t)if(x=t[C],Object.prototype.hasOwnProperty.call(t,C)&&x!==void 0){x=m[C]?m[C](x):x;let P=a[C]||v;switch(typeof x){case"undefined":case"function":continue;case"number":Number.isFinite(x)===!1&&(x=null);case"boolean":P&&(x=P(x));break;case"string":x=(P||C9)(x);break;default:x=(P||n)(x,o)}if(x===void 0)continue;E+=',"'+C+'":'+x}let T="";if(e!==void 0){x=m[M]?m[M](e):e;let C=a[M]||v;switch(typeof x){case"function":break;case"number":Number.isFinite(x)===!1&&(x=null);case"boolean":C&&(x=C(x)),T=',"'+M+'":'+x;break;case"string":x=(C||C9)(x),T=',"'+M+'":'+x;break;default:x=(C||n)(x,o),T=',"'+M+'":'+x}}return this[sb]&&E?R+this[ob]+E.slice(1)+"}"+T+h:R+E+T+h}function cb(t,e){let r,i=t[Wf],n=t[P9],o=t[Vf],a=t[Gf],h=a[I9],d=t[Hf];e=t[Kf].bindings(e);for(let p in e)if(r=e[p],(p!=="level"&&p!=="serializers"&&p!=="formatters"&&p!=="customLevels"&&e.hasOwnProperty(p)&&r!==void 0)===!0){if(r=d[p]?d[p](r):r,r=(a[p]||h||n)(r,o),r===void 0)continue;i+=',"'+p+'":'+r}return i}function L9(t,e,r,i){if(e&&typeof e=="function")return e=e.bind(i),Ff(e(t),r,t);try{let n=require("pino-pretty").prettyFactory;return n.asMetaWrapper=Ff,Ff(n(t),r,t)}catch(n){throw n.message.startsWith("Cannot find module 'pino-pretty'")?Error("Missing `pino-pretty` module: `pino-pretty` must be installed separately"):n}}function Ff(t,e,r){r=Object.assign({suppressFlushSyncWarning:!1},r);let i=!1;return{[O9]:!0,lastLevel:0,lastMsg:null,lastObj:null,lastLogger:null,flushSync(){r.suppressFlushSyncWarning||i||(i=!0,A9(e,this),e.write(t(Object.assign({level:40,msg:"pino.final with prettyPrint does not support flushing",time:Date.now()},this.chindings()))))},chindings(){let n=this.lastLogger,o=null;return n?(n.hasOwnProperty(qf)?o=n[qf]:(o=JSON.parse("{"+n[Wf].substr(1)+"}"),n[qf]=o),o):null},write(n){let o=this.lastLogger,a=this.chindings(),h=this.lastTime;typeof h=="number"||(h.match(/^\d+/)?h=parseInt(h):h=h.slice(1,-1));let d=this.lastObj,m=this.lastMsg,p=null,M=o[Kf],R=M.log?M.log(d):d,x=o[k9];m&&R&&!Object.prototype.hasOwnProperty.call(R,x)&&(R[x]=m);let v=Object.assign({level:this.lastLevel,time:h},R,p),E=o[Hf],T=Object.keys(E);for(var C=0;C<T.length;C++){let z=T[C];v[z]!==void 0&&(v[z]=E[z](v[z]))}for(let z in a)v.hasOwnProperty(z)||(v[z]=a[z]);let k=o[Gf][ib],B=t(typeof k=="function"?k(v):v);B!==void 0&&(A9(e,this),e.write(B))}}}function fb(t){return t.write!==t.constructor.prototype.write}function Tu(t){let e=new $f(t);return e.on("error",r),!t.sync&&ab&&db(e),e;function r(i){if(i.code==="EPIPE"){e.write=d1,e.end=d1,e.flushSync=d1,e.destroy=d1;return}e.removeListener("error",r),e.emit("error",i)}}function db(t){if(global.WeakRef&&global.WeakMap&&global.FinalizationRegistry){let e=Lf();e.register(t,mb),t.on("close",function(){e.unregister(t)})}}function mb(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function pb(t){return function(r,i,n={},o){if(typeof n=="string")o=Tu({dest:n,sync:!0}),n={};else if(typeof o=="string"){if(n&&n.transport)throw Error("only one of option.transport or stream can be specified");o=Tu({dest:o,sync:!0})}else if(n instanceof $f||n.writable||n._writableState)o=n,n={};else if(n.transport){if(n.transport instanceof $f||n.transport.writable||n.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(n.transport.targets&&n.transport.targets.length&&n.formatters&&typeof n.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let p;n.customLevels&&(p=n.useOnlyCustomLevels?n.customLevels:Object.assign({},n.levels,n.customLevels)),o=lb({caller:i,...n.transport,levels:p})}if(n=Object.assign({},t,n),n.serializers=Object.assign({},t.serializers,n.serializers),n.formatters=Object.assign({},t.formatters,n.formatters),"onTerminated"in n)throw Error("The onTerminated option has been removed, use pino.final instead");"changeLevelName"in n&&(process.emitWarning("The changeLevelName option is deprecated and will be removed in v7. Use levelKey instead.",{code:"changeLevelName_deprecation"}),n.levelKey=n.changeLevelName,delete n.changeLevelName);let{enabled:a,prettyPrint:h,prettifier:d,messageKey:m}=n;if(a===!1&&(n.level="silent"),o=o||process.stdout,o===process.stdout&&o.fd>=0&&!fb(o)&&(o=Tu({fd:o.fd,sync:!0})),h){T9.emit("PINODEP008");let p=Object.assign({messageKey:m},h);o=L9(p,d,o,r)}return{opts:n,stream:o}}}function gb(t,e){if(Number(process.versions.node.split(".")[0])>=14&&T9.emit("PINODEP009"),typeof t>"u"||typeof t.child!="function")throw Error("expected a pino logger instance");let i=typeof e<"u";if(i&&typeof e!="function")throw Error("if supplied, the handler parameter should be a function");let n=t[nb];if(typeof n.flushSync!="function")throw Error("final requires a stream that has a flushSync method, such as pino.destination");let o=new Proxy(t,{get:(a,h)=>h in a.levels.values?(...d)=>{a[h](...d),n.flushSync()}:a[h]});if(!i){try{n.flushSync()}catch{}return o}return(a=null,...h)=>{try{n.flushSync()}catch{}return e(a,o,...h)}}function yb(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Vf])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function bb(t,e,r){return{level:t,bindings:e,log:r}}function A9(t,e){t[O9]===!0&&(t.lastLevel=e.lastLevel,t.lastMsg=e.lastMsg,t.lastObj=e.lastObj,t.lastTime=e.lastTime,t.lastLogger=e.lastLogger)}function vb(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t}N9.exports={noop:d1,buildSafeSonicBoom:Tu,getPrettyStream:L9,asChindings:cb,asJson:hb,genLog:ub,createArgsNormalizer:pb,final:gb,stringify:yb,buildFormatters:bb,normalizeDestFileDescriptor:vb}});var Iu=V((AA,D9)=>{"use strict";var{lsCacheSym:wb,levelValSym:Jf,useOnlyCustomLevelsSym:_b,streamSym:xb,formattersSym:Sb,hooksSym:Mb}=Uo(),{noop:Eb,genLog:ls}=Pu(),Dr={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},B9={fatal:t=>{let e=ls(Dr.fatal,t);return function(...r){let i=this[xb];if(e.call(this,...r),typeof i.flushSync=="function")try{i.flushSync()}catch{}}},error:t=>ls(Dr.error,t),warn:t=>ls(Dr.warn,t),info:t=>ls(Dr.info,t),debug:t=>ls(Dr.debug,t),trace:t=>ls(Dr.trace,t)},Zf=Object.keys(Dr).reduce((t,e)=>(t[Dr[e]]=e,t),{}),Rb=Object.keys(Zf).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Cb(t){let e=t[Sb].level,{labels:r}=t.levels,i={};for(let n in r){let o=e(r[n],Number(n));i[n]=JSON.stringify(o).slice(0,-1)}return t[wb]=i,t}function Ab(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function Tb(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let i=this[Jf],n=this[Jf]=r[t],o=this[_b],a=this[Mb].logMethod;for(let h in r){if(n>r[h]){this[h]=Eb;continue}this[h]=Ab(h,o)?B9[h](a):ls(r[h],a)}this.emit("level-change",t,n,e[i],i)}function Pb(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function Ib(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[Jf]}function Ob(t=null,e=!1){let r=t?Object.keys(t).reduce((o,a)=>(o[t[a]]=a,o),{}):null,i=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Zf,r),n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Dr,t);return{labels:i,values:n}}function kb(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(o=>e[o]),r?[]:Object.keys(Zf).map(o=>+o),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Dr,e);if(!(t in i))throw Error(`default level:${t} must be included in custom levels`)}function Lb(t,e){let{labels:r,values:i}=t;for(let n in e){if(n in i)throw Error("levels cannot be overridden");if(e[n]in r)throw Error("pre-existing level values cannot be used for new levels")}}D9.exports={initialLsCache:Rb,genLsCache:Cb,levelMethods:B9,getLevel:Pb,setLevel:Tb,isLevelEnabled:Ib,mappings:Ob,levels:Dr,assertNoLevelCollisions:Lb,assertDefaultLevelFound:kb}});var z9=V((TA,Nb)=>{Nb.exports={name:"pino",version:"7.11.0",description:"super fast, all natural json logger",main:"pino.js",type:"commonjs",types:"pino.d.ts",browser:"./browser.js",files:["pino.js","file.js","pino.d.ts","bin.js","browser.js","pretty.js","usage.txt","test","docs","example.js","lib"],scripts:{docs:"docsify serve","browser-test":"airtap --local 8080 test/browser*test.js",lint:"eslint .",test:"npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types","test-ci":"npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types","test-ci-pnpm":"pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types","test-ci-yarn-pnp":"yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly","test-types":"tsc && tsd && ts-node test/types/pino.ts",transpile:"node ./test/fixtures/ts/transpile.cjs","cov-ui":"tap --ts --coverage-report=html",bench:"node benchmarks/utils/runbench all","bench-basic":"node benchmarks/utils/runbench basic","bench-object":"node benchmarks/utils/runbench object","bench-deep-object":"node benchmarks/utils/runbench deep-object","bench-multi-arg":"node benchmarks/utils/runbench multi-arg","bench-longs-tring":"node benchmarks/utils/runbench long-string","bench-child":"node benchmarks/utils/runbench child","bench-child-child":"node benchmarks/utils/runbench child-child","bench-child-creation":"node benchmarks/utils/runbench child-creation","bench-formatters":"node benchmarks/utils/runbench formatters","update-bench-doc":"node benchmarks/utils/generate-benchmark-doc > docs/benchmarks.md"},bin:{pino:"./bin.js"},precommit:"test",repository:{type:"git",url:"git+https://github.com/pinojs/pino.git"},keywords:["fast","logger","stream","json"],author:"Matteo Collina <hello@matteocollina.com>",contributors:["David Mark Clements <huperekchuno@googlemail.com>","James Sumners <james.sumners@gmail.com>","Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)"],license:"MIT",bugs:{url:"https://github.com/pinojs/pino/issues"},homepage:"http://getpino.io",devDependencies:{"@types/flush-write-stream":"^1.0.0","@types/node":"^17.0.0","@types/tap":"^15.0.6",airtap:"4.0.4",benchmark:"^2.1.4",bole:"^4.0.0",bunyan:"^1.8.14","docsify-cli":"^4.4.1",eslint:"^7.17.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0",execa:"^5.0.0",fastbench:"^1.0.1","flush-write-stream":"^2.0.0","import-fresh":"^3.2.1",jest:"^27.3.1",log:"^6.0.0",loglevel:"^1.6.7","pino-pretty":"^v7.6.0","pre-commit":"^1.2.2",proxyquire:"^2.1.3",pump:"^3.0.0",rimraf:"^3.0.2",semver:"^7.0.0",split2:"^4.0.0",steed:"^1.1.3","strip-ansi":"^6.0.0",tap:"^16.0.0",tape:"^5.0.0",through2:"^4.0.0","ts-node":"^10.7.0",tsd:"^0.20.0",typescript:"^4.4.4",winston:"^3.3.3"},dependencies:{"atomic-sleep":"^1.0.0","fast-redact":"^3.0.0","on-exit-leak-free":"^0.2.0","pino-abstract-transport":"v0.5.0","pino-std-serializers":"^4.0.0","process-warning":"^1.0.0","quick-format-unescaped":"^4.0.3","real-require":"^0.1.0","safe-stable-stringify":"^2.1.0","sonic-boom":"^2.2.1","thread-stream":"^0.15.1"},tsd:{directory:"test/types"}}});var Yf=V((PA,j9)=>{"use strict";var{version:Bb}=z9();j9.exports={version:Bb}});var J9=V((OA,K9)=>{"use strict";var{EventEmitter:Db}=require("events"),{lsCacheSym:zb,levelValSym:jb,setLevelSym:Qf,getLevelSym:U9,chindingsSym:e0,parsedChindingsSym:Ub,mixinSym:qb,asJsonSym:W9,writeSym:Fb,mixinMergeStrategySym:$b,timeSym:Wb,timeSliceIndexSym:Hb,streamSym:H9,serializersSym:us,formattersSym:Xf,useOnlyCustomLevelsSym:Gb,needsMetadataGsym:Vb,redactFmtSym:Kb,stringifySym:Jb,formatOptsSym:Zb,stringifiersSym:Yb}=Uo(),{getLevel:Xb,setLevel:Qb,isLevelEnabled:ev,mappings:tv,initialLsCache:rv,genLsCache:iv,assertNoLevelCollisions:nv}=Iu(),{asChindings:G9,asJson:sv,buildFormatters:q9,stringify:F9}=Pu(),{version:ov}=Yf(),av=Rf(),lv=class{},V9={constructor:lv,child:uv,bindings:hv,setBindings:cv,flush:pv,isLevelEnabled:ev,version:ov,get level(){return this[U9]()},set level(t){this[Qf](t)},get levelVal(){return this[jb]},set levelVal(t){throw Error("levelVal is read-only")},[zb]:rv,[Fb]:dv,[W9]:sv,[U9]:Xb,[Qf]:Qb};Object.setPrototypeOf(V9,Db.prototype);K9.exports=function(){return Object.create(V9)};var $9=t=>t;function uv(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[us],i=this[Xf],n=Object.create(this);if(e.hasOwnProperty("serializers")===!0){n[us]=Object.create(null);for(let p in r)n[us][p]=r[p];let d=Object.getOwnPropertySymbols(r);for(var o=0;o<d.length;o++){let p=d[o];n[us][p]=r[p]}for(let p in e.serializers)n[us][p]=e.serializers[p];let m=Object.getOwnPropertySymbols(e.serializers);for(var a=0;a<m.length;a++){let p=m[a];n[us][p]=e.serializers[p]}}else n[us]=r;if(e.hasOwnProperty("formatters")){let{level:d,bindings:m,log:p}=e.formatters;n[Xf]=q9(d||i.level,m||$9,p||i.log)}else n[Xf]=q9(i.level,$9,i.log);if(e.hasOwnProperty("customLevels")===!0&&(nv(this.levels,e.customLevels),n.levels=tv(e.customLevels,n[Gb]),iv(n)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){n.redact=e.redact;let d=av(n.redact,F9),m={stringify:d[Kb]};n[Jb]=F9,n[Yb]=d,n[Zb]=m}n[e0]=G9(n,t);let h=e.level||this.level;return n[Qf](h),n}function hv(){let e=`{${this[e0].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function cv(t){let e=G9(this,t);this[e0]=e,delete this[Ub]}function fv(t,e){return Object.assign(e,t)}function dv(t,e,r){let i=this[Wb](),n=this[qb],o=this[$b]||fv,a;t==null?a={}:t instanceof Error?(a={err:t},e===void 0&&(e=t.message)):(a=t,e===void 0&&t.err&&(e=t.err.message)),n&&(a=o(a,n(a,r)));let h=this[W9](a,e,r,i),d=this[H9];d[Vb]===!0&&(d.lastLevel=r,d.lastObj=a,d.lastMsg=e,d.lastTime=i.slice(this[Hb]),d.lastLogger=this),d.write(h)}function mv(){}function pv(){let t=this[H9];"flush"in t&&t.flush(mv)}});var Q9=V((o0,X9)=>{"use strict";var cs=s0();cs.configure=s0;cs.stringify=cs;cs.default=cs;o0.stringify=cs;o0.configure=s0;X9.exports=cs;var gv=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,yv=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g,n0=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\"];function bv(t){let e=t.charCodeAt(0);return n0.length>e?n0[e]:`\\u${e.toString(16)}`}function pn(t){if(t.length<5e3&&!gv.test(t))return t;if(t.length>100)return t.replace(yv,bv);let e="",r=0;for(let i=0;i<t.length;i++){let n=t.charCodeAt(i);if(n===34||n===92||n<32)e+=`${t.slice(r,i)}${n0[n]}`,r=i+1;else if(n>=55296&&n<=57343){if(n<=56319&&i+1<t.length){let o=t.charCodeAt(i+1);if(o>=56320&&o<=57343){i++;continue}}e+=`${t.slice(r,i)}${`\\u${n.toString(16)}`}`,r=i+1}}return e+=t.slice(r),e}function t0(t){if(t.length>200)return t.sort();for(let e=1;e<t.length;e++){let r=t[e],i=e;for(;i!==0&&t[i-1]>r;)t[i]=t[i-1],i--;t[i]=r}return t}var vv=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Uint8Array)),Symbol.toStringTag).get;function r0(t){return vv.call(t)!==void 0&&t.length!==0}function i0(t,e,r){t.length<r&&(r=t.length);let i=e===","?"":" ",n=`"0":${i}${t[0]}`;for(let o=1;o<r;o++)n+=`${e}"${o}":${i}${t[o]}`;return n}function wv(t){if(t&&Object.prototype.hasOwnProperty.call(t,"circularValue")){var e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function Z9(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(typeof r!="boolean")throw new TypeError(`The "${e}" argument must be of type boolean`)}return r===void 0?!0:r}function Y9(t,e){if(t&&Object.prototype.hasOwnProperty.call(t,e)){var r=t[e];if(typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function hs(t){return t===1?"1 item":`${t} items`}function _v(t){let e=new Set;for(let r of t)typeof r=="string"?e.add(r):typeof r=="number"&&e.add(String(r));return e}function s0(t){let e=wv(t),r=Z9(t,"bigint"),i=Z9(t,"deterministic"),n=Y9(t,"maximumDepth"),o=Y9(t,"maximumBreadth");function a(M,R,x,v,E,T){let C=R[M];switch(typeof C=="object"&&C!==null&&typeof C.toJSON=="function"&&(C=C.toJSON(M)),C=v.call(R,M,C),typeof C){case"string":return`"${pn(C)}"`;case"object":{if(C===null)return"null";if(x.indexOf(C)!==-1)return e;let P="",k=",",B=T;if(Array.isArray(C)){if(C.length===0)return"[]";if(n<x.length+1)return'"[Array]"';x.push(C),E!==""&&(T+=E,P+=`
84
+ ${T}`,k=`,
85
+ ${T}`);let ze=Math.min(C.length,o),Ce=0;for(;Ce<ze-1;Ce++){let nt=a(Ce,C,x,v,E,T);P+=nt!==void 0?nt:"null",P+=k}let Le=a(Ce,C,x,v,E,T);if(P+=Le!==void 0?Le:"null",C.length-1>o){let nt=C.length-o-1;P+=`${k}"... ${hs(nt)} not stringified"`}return E!==""&&(P+=`
86
+ ${B}`),x.pop(),`[${P}]`}let z=Object.keys(C),H=z.length;if(H===0)return"{}";if(n<x.length+1)return'"[Object]"';let J="",ne="";E!==""&&(T+=E,k=`,
87
+ ${T}`,J=" ");let Se=Math.min(H,o);r0(C)&&(P+=i0(C,k,o),z=z.slice(C.length),Se-=C.length,ne=k),i&&(z=t0(z)),x.push(C);for(let ze=0;ze<Se;ze++){let Ce=z[ze],Le=a(Ce,C,x,v,E,T);Le!==void 0&&(P+=`${ne}"${pn(Ce)}":${J}${Le}`,ne=k)}if(H>o){let ze=H-o;P+=`${ne}"...":${J}"${hs(ze)} not stringified"`,ne=k}return E!==""&&ne.length>1&&(P=`
88
+ ${T}${P}
89
+ ${B}`),x.pop(),`{${P}}`}case"number":return isFinite(C)?String(C):"null";case"boolean":return C===!0?"true":"false";case"bigint":return r?String(C):void 0}}function h(M,R,x,v,E,T){switch(typeof R=="object"&&R!==null&&typeof R.toJSON=="function"&&(R=R.toJSON(M)),typeof R){case"string":return`"${pn(R)}"`;case"object":{if(R===null)return"null";if(x.indexOf(R)!==-1)return e;let C=T,P="",k=",";if(Array.isArray(R)){if(R.length===0)return"[]";if(n<x.length+1)return'"[Array]"';x.push(R),E!==""&&(T+=E,P+=`
90
+ ${T}`,k=`,
91
+ ${T}`);let H=Math.min(R.length,o),J=0;for(;J<H-1;J++){let Se=h(J,R[J],x,v,E,T);P+=Se!==void 0?Se:"null",P+=k}let ne=h(J,R[J],x,v,E,T);if(P+=ne!==void 0?ne:"null",R.length-1>o){let Se=R.length-o-1;P+=`${k}"... ${hs(Se)} not stringified"`}return E!==""&&(P+=`
92
+ ${C}`),x.pop(),`[${P}]`}if(v.size===0)return"{}";x.push(R);let B="";E!==""&&(T+=E,k=`,
93
+ ${T}`,B=" ");let z="";for(let H of v){let J=h(H,R[H],x,v,E,T);J!==void 0&&(P+=`${z}"${pn(H)}":${B}${J}`,z=k)}return E!==""&&z.length>1&&(P=`
94
+ ${T}${P}
95
+ ${C}`),x.pop(),`{${P}}`}case"number":return isFinite(R)?String(R):"null";case"boolean":return R===!0?"true":"false";case"bigint":return r?String(R):void 0}}function d(M,R,x,v,E){switch(typeof R){case"string":return`"${pn(R)}"`;case"object":{if(R===null)return"null";if(typeof R.toJSON=="function"){if(R=R.toJSON(M),typeof R!="object")return d(M,R,x,v,E);if(R===null)return"null"}if(x.indexOf(R)!==-1)return e;let T=E;if(Array.isArray(R)){if(R.length===0)return"[]";if(n<x.length+1)return'"[Array]"';x.push(R),E+=v;let J=`
96
+ ${E}`,ne=`,
97
+ ${E}`,Se=Math.min(R.length,o),ze=0;for(;ze<Se-1;ze++){let Le=d(ze,R[ze],x,v,E);J+=Le!==void 0?Le:"null",J+=ne}let Ce=d(ze,R[ze],x,v,E);if(J+=Ce!==void 0?Ce:"null",R.length-1>o){let Le=R.length-o-1;J+=`${ne}"... ${hs(Le)} not stringified"`}return J+=`
98
+ ${T}`,x.pop(),`[${J}]`}let C=Object.keys(R),P=C.length;if(P===0)return"{}";if(n<x.length+1)return'"[Object]"';E+=v;let k=`,
99
+ ${E}`,B="",z="",H=Math.min(P,o);r0(R)&&(B+=i0(R,k,o),C=C.slice(R.length),H-=R.length,z=k),i&&(C=t0(C)),x.push(R);for(let J=0;J<H;J++){let ne=C[J],Se=d(ne,R[ne],x,v,E);Se!==void 0&&(B+=`${z}"${pn(ne)}": ${Se}`,z=k)}if(P>o){let J=P-o;B+=`${z}"...": "${hs(J)} not stringified"`,z=k}return z!==""&&(B=`
100
+ ${E}${B}
101
+ ${T}`),x.pop(),`{${B}}`}case"number":return isFinite(R)?String(R):"null";case"boolean":return R===!0?"true":"false";case"bigint":return r?String(R):void 0}}function m(M,R,x){switch(typeof R){case"string":return`"${pn(R)}"`;case"object":{if(R===null)return"null";if(typeof R.toJSON=="function"){if(R=R.toJSON(M),typeof R!="object")return m(M,R,x);if(R===null)return"null"}if(x.indexOf(R)!==-1)return e;let v="";if(Array.isArray(R)){if(R.length===0)return"[]";if(n<x.length+1)return'"[Array]"';x.push(R);let k=Math.min(R.length,o),B=0;for(;B<k-1;B++){let H=m(B,R[B],x);v+=H!==void 0?H:"null",v+=","}let z=m(B,R[B],x);if(v+=z!==void 0?z:"null",R.length-1>o){let H=R.length-o-1;v+=`,"... ${hs(H)} not stringified"`}return x.pop(),`[${v}]`}let E=Object.keys(R),T=E.length;if(T===0)return"{}";if(n<x.length+1)return'"[Object]"';let C="",P=Math.min(T,o);r0(R)&&(v+=i0(R,",",o),E=E.slice(R.length),P-=R.length,C=","),i&&(E=t0(E)),x.push(R);for(let k=0;k<P;k++){let B=E[k],z=m(B,R[B],x);z!==void 0&&(v+=`${C}"${pn(B)}":${z}`,C=",")}if(T>o){let k=T-o;v+=`${C}"...":"${hs(k)} not stringified"`}return x.pop(),`{${v}}`}case"number":return isFinite(R)?String(R):"null";case"boolean":return R===!0?"true":"false";case"bigint":return r?String(R):void 0}}function p(M,R,x){if(arguments.length>1){let v="";if(typeof x=="number"?v=" ".repeat(Math.min(x,10)):typeof x=="string"&&(v=x.slice(0,10)),R!=null){if(typeof R=="function")return a("",{"":M},[],R,v,"");if(Array.isArray(R))return h("",M,[],_v(R),v,"")}if(v.length!==0)return d("",M,[],v,"")}return m("",M,[])}return p}});var im=V((kA,rm)=>{"use strict";var a0=Symbol.for("pino.metadata"),{levels:em}=Iu(),tm=Object.create(em);tm.silent=1/0;var xv=em.info;function Sv(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let i=tm;e.levels&&typeof e.levels=="object"&&(i=e.levels);let n={write:o,add:h,flushSync:a,end:d,minLevel:0,streams:[],clone:m,[a0]:!0};return Array.isArray(t)?t.forEach(h,n):h.call(n,t),t=null,n;function o(p){let M,R=this.lastLevel,{streams:x}=this,v;for(let E=0;E<x.length&&(M=x[E],M.level<=R);E++){if(v=M.stream,v[a0]){let{lastTime:T,lastMsg:C,lastObj:P,lastLogger:k}=this;v.lastLevel=R,v.lastTime=T,v.lastMsg=C,v.lastObj=P,v.lastLogger=k}(!e.dedupe||M.level===R)&&v.write(p)}}function a(){for(let{stream:p}of this.streams)typeof p.flushSync=="function"&&p.flushSync()}function h(p){if(!p)return n;let M=typeof p.write=="function"||p.stream,R=p.write?p:p.stream;if(!M)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:x}=this,v;typeof p.levelVal=="number"?v=p.levelVal:typeof p.level=="string"?v=i[p.level]:typeof p.level=="number"?v=p.level:v=xv;let E={stream:R,level:v,levelVal:void 0,id:r++};return x.unshift(E),x.sort(Mv),this.minLevel=x[0].level,n}function d(){for(let{stream:p}of this.streams)typeof p.flushSync=="function"&&p.flushSync(),p.end()}function m(p){let M=new Array(this.streams.length);for(let R=0;R<M.length;R++)M[R]={level:p,stream:this.streams[R].stream};return{write:o,add:h,minLevel:p,streams:M,clone:m,flushSync:a,[a0]:!0}}}function Mv(t,e){return t.level-e.level}rm.exports=Sv});var h0=V((LA,sr)=>{"use strict";var Ev=require("os"),cm=vf(),Rv=wf(),Cv=Rf(),fm=Z5(),Av=J9(),dm=Uo(),{configure:Tv}=Q9(),{assertDefaultLevelFound:Pv,mappings:mm,genLsCache:Iv,levels:Ov}=Iu(),{createArgsNormalizer:kv,asChindings:Lv,final:Nv,buildSafeSonicBoom:nm,buildFormatters:Bv,stringify:Ou,normalizeDestFileDescriptor:sm,noop:Dv}=Pu(),{version:zv}=Yf(),{chindingsSym:om,redactFmtSym:jv,serializersSym:am,timeSym:Uv,timeSliceIndexSym:qv,streamSym:Fv,stringifySym:lm,stringifySafeSym:l0,stringifiersSym:um,setLevelSym:$v,endSym:Wv,formatOptsSym:Hv,messageKeySym:Gv,nestedKeySym:Vv,mixinSym:Kv,useOnlyCustomLevelsSym:Jv,formattersSym:hm,hooksSym:Zv,nestedKeyStrSym:Yv,mixinMergeStrategySym:Xv}=dm,{epochTime:pm,nullTime:Qv}=fm,{pid:ew}=process,tw=Ev.hostname(),rw=cm.err,iw={level:"info",levels:Ov,messageKey:"msg",nestedKey:null,enabled:!0,prettyPrint:!1,base:{pid:ew,hostname:tw},serializers:Object.assign(Object.create(null),{err:rw}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0},timestamp:pm,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},nw=kv(iw),sw=Object.assign(Object.create(null),cm);function u0(...t){let e={},{opts:r,stream:i}=nw(e,Rv(),...t),{redact:n,crlf:o,serializers:a,timestamp:h,messageKey:d,nestedKey:m,base:p,name:M,level:R,customLevels:x,mixin:v,mixinMergeStrategy:E,useOnlyCustomLevels:T,formatters:C,hooks:P,depthLimit:k,edgeLimit:B}=r,z=Tv({maximumDepth:k,maximumBreadth:B}),H=Bv(C.level,C.bindings,C.log),J=n?Cv(n,Ou):{},ne=Ou.bind({[l0]:z}),Se=n?{stringify:J[jv]}:{stringify:ne},ze="}"+(o?`\r
102
102
  `:`
103
- `),Pe=Yb.bind(null,{[Q9]:"",[ep]:a,[rp]:te,[tp]:Mu,[r0]:z,[ip]:G}),We="";m!==null&&(w===void 0?We=Pe(m):We=Pe(Object.assign({},m,{name:w})));let ot=c instanceof Function?c:c?lp:gv,Rt=ot().indexOf(":")+1;if(A&&!v)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(R&&typeof R!="function")throw Error(`Unknown mixin type "${typeof R}" - expected "function"`);Vb(S,v,A);let Fr=ap(v,A);return Object.assign(e,{levels:Fr,[fv]:A,[sv]:i,[iv]:ot,[nv]:Rt,[tp]:Mu,[r0]:z,[rp]:te,[av]:De,[lv]:ke,[uv]:d,[cv]:p,[pv]:p?`,${JSON.stringify(p)}:{`:"",[ep]:a,[hv]:R,[mv]:x,[Q9]:We,[ip]:G,[dv]:T,silent:ev}),Object.setPrototypeOf(e,Hb()),Kb(e),e[ov](S),e}or.exports=i0;or.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=X9(t.dest||process.stdout.fd),Y9(t)):Y9({dest:X9(t),minLength:0,sync:!0});or.exports.transport=Lf();or.exports.multistream=J9();or.exports.final=Xb;or.exports.levels=ap();or.exports.stdSerializers=Sv;or.exports.stdTimeFunctions=Object.assign({},sp);or.exports.symbols=op;or.exports.version=tv;or.exports.default=i0;or.exports.pino=i0});var fp=H((KC,n1)=>{"use strict";var xv=process.env.TERM_PROGRAM==="Hyper",Mv=process.platform==="win32",up=process.platform==="linux",s0={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},cp=Object.assign({},s0,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),hp=Object.assign({},s0,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",question:"?",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:up?"\u25B8":"\u276F",pointerSmall:up?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});n1.exports=Mv&&!xv?cp:hp;Reflect.defineProperty(n1.exports,"common",{enumerable:!1,value:s0});Reflect.defineProperty(n1.exports,"windows",{enumerable:!1,value:cp});Reflect.defineProperty(n1.exports,"other",{enumerable:!1,value:hp})});var pp=H((ZC,o0)=>{"use strict";var Ev=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Rv=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,dp=()=>{let t={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in process.env&&(t.enabled=process.env.FORCE_COLOR!=="0");let e=s=>{let a=s.open=`\x1B[${s.codes[0]}m`,c=s.close=`\x1B[${s.codes[1]}m`,d=s.regex=new RegExp(`\\u001b\\[${s.codes[1]}m`,"g");return s.wrap=(p,m)=>{p.includes(c)&&(p=p.replace(d,c+a));let w=a+p+c;return m?w.replace(/\r*\n/g,`${c}$&${a}`):w},s},r=(s,a,c)=>typeof s=="function"?s(a):s.wrap(a,c),i=(s,a)=>{if(s===""||s==null)return"";if(t.enabled===!1)return s;if(t.visible===!1)return"";let c=""+s,d=c.includes(`
104
- `),p=a.length;for(p>0&&a.includes("unstyle")&&(a=[...new Set(["unstyle",...a])].reverse());p-- >0;)c=r(t.styles[a[p]],c,d);return c},n=(s,a,c)=>{t.styles[s]=e({name:s,codes:a}),(t.keys[c]||(t.keys[c]=[])).push(s),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(p){t.alias(s,p)},get(){let p=m=>i(m,p.stack);return Reflect.setPrototypeOf(p,t),p.stack=this.stack?this.stack.concat(s):[s],p}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=Rv,t.hasColor=t.hasAnsi=s=>(t.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&t.ansiRegex.test(s)),t.alias=(s,a)=>{let c=typeof a=="string"?t[a]:a;if(typeof c!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");c.stack||(Reflect.defineProperty(c,"name",{value:s}),t.styles[s]=c,c.stack=[s]),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(d){t.alias(s,d)},get(){let d=p=>i(p,d.stack);return Reflect.setPrototypeOf(d,t),d.stack=this.stack?this.stack.concat(c.stack):c.stack,d}})},t.theme=s=>{if(!Ev(s))throw new TypeError("Expected theme to be an object");for(let a of Object.keys(s))t.alias(a,s[a]);return t},t.alias("unstyle",s=>typeof s=="string"&&s!==""?(t.ansiRegex.lastIndex=0,s.replace(t.ansiRegex,"")):""),t.alias("noop",s=>s),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=fp(),t.define=n,t};o0.exports=dp();o0.exports.create=dp});var a0=H((YC,mp)=>{mp.exports=require("stream")});var vp=H((XC,bp)=>{"use strict";function gp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Av(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gp(Object(r),!0).forEach(function(i){Pv(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gp(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Pv(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Tv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yp(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Iv(t,e,r){return e&&yp(t.prototype,e),r&&yp(t,r),t}var kv=require("buffer"),Eu=kv.Buffer,Ov=require("util"),l0=Ov.inspect,Lv=l0&&l0.custom||"inspect";function Nv(t,e,r){Eu.prototype.copy.call(t,e,r)}bp.exports=function(){function t(){Tv(this,t),this.head=null,this.tail=null,this.length=0}return Iv(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return Eu.alloc(0);for(var i=Eu.allocUnsafe(r>>>0),n=this.head,s=0;n;)Nv(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var a=i.data,c=r>a.length?a.length:r;if(c===a.length?s+=a:s+=a.slice(0,r),r-=c,r===0){c===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(c));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(r){var i=Eu.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var a=n.data,c=r>a.length?a.length:r;if(a.copy(i,i.length-r,0,c),r-=c,r===0){c===a.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(c));break}++s}return this.length-=s,i}},{key:Lv,value:function(r,i){return l0(this,Av({},i,{depth:0,customInspect:!1}))}}]),t}()});var c0=H((QC,_p)=>{"use strict";function Dv(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(u0,this,t)):process.nextTick(u0,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Ru,r):(r._writableState.errorEmitted=!0,process.nextTick(wp,r,s)):process.nextTick(wp,r,s):e?(process.nextTick(Ru,r),e(s)):process.nextTick(Ru,r)}),this)}function wp(t,e){u0(t,e),Ru(t)}function Ru(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Bv(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function u0(t,e){t.emit("error",e)}function zv(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}_p.exports={destroy:Dv,undestroy:Bv,errorOrDestroy:zv}});var dn=H((eA,Mp)=>{"use strict";var xp={};function Sr(t,e,r){r||(r=Error);function i(s,a,c){return typeof e=="string"?e:e(s,a,c)}class n extends r{constructor(a,c,d){super(i(a,c,d))}}n.prototype.name=r.name,n.prototype.code=t,xp[t]=n}function Sp(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(i=>String(i)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function jv(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function qv(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Uv(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Sr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Sr("ERR_INVALID_ARG_TYPE",function(t,e,r){let i;typeof e=="string"&&jv(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(qv(t," argument"))n=`The ${t} ${i} ${Sp(e,"type")}`;else{let s=Uv(t,".")?"property":"argument";n=`The "${t}" ${s} ${i} ${Sp(e,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);Sr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Sr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Sr("ERR_STREAM_PREMATURE_CLOSE","Premature close");Sr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Sr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Sr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Sr("ERR_STREAM_WRITE_AFTER_END","write after end");Sr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Sr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Sr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Mp.exports.codes=xp});var h0=H((tA,Ep)=>{"use strict";var $v=dn().codes.ERR_INVALID_OPT_VALUE;function Wv(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Fv(t,e,r,i){var n=Wv(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new $v(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}Ep.exports={getHighWaterMark:Fv}});var Rp=H((rA,f0)=>{typeof Object.create=="function"?f0.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:f0.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var Io=H((iA,p0)=>{try{if(d0=require("util"),typeof d0.inherits!="function")throw"";p0.exports=d0.inherits}catch{p0.exports=Rp()}var d0});var Ap=H((nA,Cp)=>{Cp.exports=require("util").deprecate});var y0=H((sA,Lp)=>{"use strict";Lp.exports=rt;function Tp(t){var e=this;this.next=null,this.entry=null,this.finish=function(){yw(e,t)}}var ko;rt.WritableState=o1;var Hv={deprecate:Ap()},Ip=a0(),Au=require("buffer").Buffer,Gv=global.Uint8Array||function(){};function Vv(t){return Au.from(t)}function Kv(t){return Au.isBuffer(t)||t instanceof Gv}var g0=c0(),Zv=h0(),Jv=Zv.getHighWaterMark,pn=dn().codes,Yv=pn.ERR_INVALID_ARG_TYPE,Xv=pn.ERR_METHOD_NOT_IMPLEMENTED,Qv=pn.ERR_MULTIPLE_CALLBACK,ew=pn.ERR_STREAM_CANNOT_PIPE,tw=pn.ERR_STREAM_DESTROYED,rw=pn.ERR_STREAM_NULL_VALUES,iw=pn.ERR_STREAM_WRITE_AFTER_END,nw=pn.ERR_UNKNOWN_ENCODING,Oo=g0.errorOrDestroy;Io()(rt,Ip);function sw(){}function o1(t,e,r){ko=ko||us(),t=t||{},typeof r!="boolean"&&(r=e instanceof ko),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Jv(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){fw(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Tp(this)}o1.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(o1.prototype,"buffer",{get:Hv.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Cu;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Cu=Function.prototype[Symbol.hasInstance],Object.defineProperty(rt,Symbol.hasInstance,{value:function(e){return Cu.call(this,e)?!0:this!==rt?!1:e&&e._writableState instanceof o1}})):Cu=function(e){return e instanceof this};function rt(t){ko=ko||us();var e=this instanceof ko;if(!e&&!Cu.call(rt,this))return new rt(t);this._writableState=new o1(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Ip.call(this)}rt.prototype.pipe=function(){Oo(this,new ew)};function ow(t,e){var r=new iw;Oo(t,r),process.nextTick(e,r)}function aw(t,e,r,i){var n;return r===null?n=new rw:typeof r!="string"&&!e.objectMode&&(n=new Yv("chunk",["string","Buffer"],r)),n?(Oo(t,n),process.nextTick(i,n),!1):!0}rt.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&Kv(t);return s&&!Au.isBuffer(t)&&(t=Vv(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=sw),i.ending?ow(this,r):(s||aw(this,i,t,r))&&(i.pendingcb++,n=uw(this,i,s,t,e,r)),n};rt.prototype.cork=function(){this._writableState.corked++};rt.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&kp(this,t))};rt.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new nw(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(rt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function lw(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Au.from(e,r)),e}Object.defineProperty(rt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function uw(t,e,r,i,n,s){if(!r){var a=lw(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var c=e.objectMode?1:i.length;e.length+=c;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var p=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},p?p.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else m0(t,e,!1,c,i,n,s);return d}function m0(t,e,r,i,n,s,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new tw("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function cw(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(s1,t,e),t._writableState.errorEmitted=!0,Oo(t,i)):(n(i),t._writableState.errorEmitted=!0,Oo(t,i),s1(t,e))}function hw(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function fw(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new Qv;if(hw(r),e)cw(t,r,i,e,n);else{var s=Op(r)||t.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&kp(t,r),i?process.nextTick(Pp,t,r,s,n):Pp(t,r,s,n)}}function Pp(t,e,r,i){r||dw(t,e),e.pendingcb--,i(),s1(t,e)}function dw(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function kp(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)n[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;n.allBuffers=c,m0(t,e,!0,e.length,n,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new Tp(e),e.bufferedRequestCount=0}else{for(;r;){var d=r.chunk,p=r.encoding,m=r.callback,w=e.objectMode?1:d.length;if(m0(t,e,!1,w,d,p,m),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}rt.prototype._write=function(t,e,r){r(new Xv("_write()"))};rt.prototype._writev=null;rt.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||gw(this,i,r),this};Object.defineProperty(rt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Op(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function pw(t,e){t._final(function(r){e.pendingcb--,r&&Oo(t,r),e.prefinished=!0,t.emit("prefinish"),s1(t,e)})}function mw(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(pw,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function s1(t,e){var r=Op(e);if(r&&(mw(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function gw(t,e,r){e.ending=!0,s1(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function yw(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(rt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});rt.prototype.destroy=g0.destroy;rt.prototype._undestroy=g0.undestroy;rt.prototype._destroy=function(t,e){e(t)}});var us=H((oA,Dp)=>{"use strict";var bw=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Dp.exports=hi;var Np=w0(),v0=y0();Io()(hi,Np);for(b0=bw(v0.prototype),Pu=0;Pu<b0.length;Pu++)Tu=b0[Pu],hi.prototype[Tu]||(hi.prototype[Tu]=v0.prototype[Tu]);var b0,Tu,Pu;function hi(t){if(!(this instanceof hi))return new hi(t);Np.call(this,t),v0.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",vw)))}Object.defineProperty(hi.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(hi.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(hi.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function vw(){this._writableState.ended||process.nextTick(ww,this)}function ww(t){t.end()}Object.defineProperty(hi.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var jp=H((_0,zp)=>{var Iu=require("buffer"),fi=Iu.Buffer;function Bp(t,e){for(var r in t)e[r]=t[r]}fi.from&&fi.alloc&&fi.allocUnsafe&&fi.allocUnsafeSlow?zp.exports=Iu:(Bp(Iu,_0),_0.Buffer=cs);function cs(t,e,r){return fi(t,e,r)}cs.prototype=Object.create(fi.prototype);Bp(fi,cs);cs.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return fi(t,e,r)};cs.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=fi(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};cs.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return fi(t)};cs.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Iu.SlowBuffer(t)}});var M0=H(Up=>{"use strict";var x0=jp().Buffer,qp=x0.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function _w(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function Sw(t){var e=_w(t);if(typeof e!="string"&&(x0.isEncoding===qp||!qp(t)))throw new Error("Unknown encoding: "+t);return e||t}Up.StringDecoder=a1;function a1(t){this.encoding=Sw(t);var e;switch(this.encoding){case"utf16le":this.text=Aw,this.end=Pw,e=4;break;case"utf8":this.fillLast=Ew,e=4;break;case"base64":this.text=Tw,this.end=Iw,e=3;break;default:this.write=kw,this.end=Ow;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=x0.allocUnsafe(e)}a1.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};a1.prototype.end=Cw;a1.prototype.text=Rw;a1.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function S0(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function xw(t,e,r){var i=e.length-1;if(i<r)return 0;var n=S0(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=S0(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=S0(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function Mw(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function Ew(t){var e=this.lastTotal-this.lastNeed,r=Mw(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function Rw(t,e){var r=xw(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function Cw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Aw(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Pw(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Tw(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function Iw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function kw(t){return t.toString(this.encoding)}function Ow(t){return t&&t.length?this.write(t):""}});var ku=H((lA,Fp)=>{"use strict";var $p=dn().codes.ERR_STREAM_PREMATURE_CLOSE;function Lw(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function Nw(){}function Dw(t){return t.setHeader&&typeof t.abort=="function"}function Wp(t,e,r){if(typeof e=="function")return Wp(t,null,e);e||(e={}),r=Lw(r||Nw);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||c()},a=t._writableState&&t._writableState.finished,c=function(){n=!1,a=!0,i||r.call(t)},d=t._readableState&&t._readableState.endEmitted,p=function(){i=!1,d=!0,n||r.call(t)},m=function(R){r.call(t,R)},w=function(){var R;if(i&&!d)return(!t._readableState||!t._readableState.ended)&&(R=new $p),r.call(t,R);if(n&&!a)return(!t._writableState||!t._writableState.ended)&&(R=new $p),r.call(t,R)},S=function(){t.req.on("finish",c)};return Dw(t)?(t.on("complete",c),t.on("abort",w),t.req?S():t.on("request",S)):n&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",p),t.on("finish",c),e.error!==!1&&t.on("error",m),t.on("close",w),function(){t.removeListener("complete",c),t.removeListener("abort",w),t.removeListener("request",S),t.req&&t.req.removeListener("finish",c),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",c),t.removeListener("end",p),t.removeListener("error",m),t.removeListener("close",w)}}Fp.exports=Wp});var Gp=H((uA,Hp)=>{"use strict";var Ou;function mn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Bw=ku(),gn=Symbol("lastResolve"),hs=Symbol("lastReject"),l1=Symbol("error"),Lu=Symbol("ended"),fs=Symbol("lastPromise"),E0=Symbol("handlePromise"),ds=Symbol("stream");function yn(t,e){return{value:t,done:e}}function zw(t){var e=t[gn];if(e!==null){var r=t[ds].read();r!==null&&(t[fs]=null,t[gn]=null,t[hs]=null,e(yn(r,!1)))}}function jw(t){process.nextTick(zw,t)}function qw(t,e){return function(r,i){t.then(function(){if(e[Lu]){r(yn(void 0,!0));return}e[E0](r,i)},i)}}var Uw=Object.getPrototypeOf(function(){}),$w=Object.setPrototypeOf((Ou={get stream(){return this[ds]},next:function(){var e=this,r=this[l1];if(r!==null)return Promise.reject(r);if(this[Lu])return Promise.resolve(yn(void 0,!0));if(this[ds].destroyed)return new Promise(function(a,c){process.nextTick(function(){e[l1]?c(e[l1]):a(yn(void 0,!0))})});var i=this[fs],n;if(i)n=new Promise(qw(i,this));else{var s=this[ds].read();if(s!==null)return Promise.resolve(yn(s,!1));n=new Promise(this[E0])}return this[fs]=n,n}},mn(Ou,Symbol.asyncIterator,function(){return this}),mn(Ou,"return",function(){var e=this;return new Promise(function(r,i){e[ds].destroy(null,function(n){if(n){i(n);return}r(yn(void 0,!0))})})}),Ou),Uw),Ww=function(e){var r,i=Object.create($w,(r={},mn(r,ds,{value:e,writable:!0}),mn(r,gn,{value:null,writable:!0}),mn(r,hs,{value:null,writable:!0}),mn(r,l1,{value:null,writable:!0}),mn(r,Lu,{value:e._readableState.endEmitted,writable:!0}),mn(r,E0,{value:function(s,a){var c=i[ds].read();c?(i[fs]=null,i[gn]=null,i[hs]=null,s(yn(c,!1))):(i[gn]=s,i[hs]=a)},writable:!0}),r));return i[fs]=null,Bw(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=i[hs];s!==null&&(i[fs]=null,i[gn]=null,i[hs]=null,s(n)),i[l1]=n;return}var a=i[gn];a!==null&&(i[fs]=null,i[gn]=null,i[hs]=null,a(yn(void 0,!0))),i[Lu]=!0}),e.on("readable",jw.bind(null,i)),i};Hp.exports=Ww});var Jp=H((cA,Zp)=>{"use strict";function Vp(t,e,r,i,n,s,a){try{var c=t[s](a),d=c.value}catch(p){r(p);return}c.done?e(d):Promise.resolve(d).then(i,n)}function Fw(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function a(d){Vp(s,i,n,a,c,"next",d)}function c(d){Vp(s,i,n,a,c,"throw",d)}a(void 0)})}}function Kp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Hw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Kp(Object(r),!0).forEach(function(i){Gw(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kp(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Gw(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Vw=dn().codes.ERR_INVALID_ARG_TYPE;function Kw(t,e,r){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new Vw("iterable",["Iterable"],e);var n=new t(Hw({objectMode:!0},r)),s=!1;n._read=function(){s||(s=!0,a())};function a(){return c.apply(this,arguments)}function c(){return c=Fw(function*(){try{var d=yield i.next(),p=d.value,m=d.done;m?n.push(null):n.push(yield p)?a():s=!1}catch(w){n.destroy(w)}}),c.apply(this,arguments)}return n}Zp.exports=Kw});var w0=H((fA,om)=>{"use strict";om.exports=Te;var Lo;Te.ReadableState=em;var hA=require("events").EventEmitter,Qp=function(e,r){return e.listeners(r).length},c1=a0(),Nu=require("buffer").Buffer,Zw=global.Uint8Array||function(){};function Jw(t){return Nu.from(t)}function Yw(t){return Nu.isBuffer(t)||t instanceof Zw}var R0=require("util"),ye;R0&&R0.debuglog?ye=R0.debuglog("stream"):ye=function(){};var Xw=vp(),O0=c0(),Qw=h0(),e_=Qw.getHighWaterMark,Du=dn().codes,t_=Du.ERR_INVALID_ARG_TYPE,r_=Du.ERR_STREAM_PUSH_AFTER_EOF,i_=Du.ERR_METHOD_NOT_IMPLEMENTED,n_=Du.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,No,C0,A0;Io()(Te,c1);var u1=O0.errorOrDestroy,P0=["error","close","destroy","pause","resume"];function s_(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function em(t,e,r){Lo=Lo||us(),t=t||{},typeof r!="boolean"&&(r=e instanceof Lo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=e_(this,t,"readableHighWaterMark",r),this.buffer=new Xw,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(No||(No=M0().StringDecoder),this.decoder=new No(t.encoding),this.encoding=t.encoding)}function Te(t){if(Lo=Lo||us(),!(this instanceof Te))return new Te(t);var e=this instanceof Lo;this._readableState=new em(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),c1.call(this)}Object.defineProperty(Te.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});Te.prototype.destroy=O0.destroy;Te.prototype._undestroy=O0.undestroy;Te.prototype._destroy=function(t,e){e(t)};Te.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Nu.from(t,e),e=""),i=!0),tm(this,t,e,!1,i)};Te.prototype.unshift=function(t){return tm(this,t,null,!0,!1)};function tm(t,e,r,i,n){ye("readableAddChunk",e);var s=t._readableState;if(e===null)s.reading=!1,l_(t,s);else{var a;if(n||(a=o_(s,e)),a)u1(t,a);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==Nu.prototype&&(e=Jw(e)),i)s.endEmitted?u1(t,new n_):T0(t,s,e,!0);else if(s.ended)u1(t,new r_);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?T0(t,s,e,!1):k0(t,s)):T0(t,s,e,!1)}else i||(s.reading=!1,k0(t,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function T0(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Bu(t)),k0(t,e)}function o_(t,e){var r;return!Yw(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new t_("chunk",["string","Buffer","Uint8Array"],e)),r}Te.prototype.isPaused=function(){return this._readableState.flowing===!1};Te.prototype.setEncoding=function(t){No||(No=M0().StringDecoder);var e=new No(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var Yp=1073741824;function a_(t){return t>=Yp?t=Yp:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Xp(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=a_(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Te.prototype.read=function(t){ye("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ye("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?I0(this):Bu(this),null;if(t=Xp(t,e),t===0&&e.ended)return e.length===0&&I0(this),null;var i=e.needReadable;ye("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,ye("length less than watermark",i)),e.ended||e.reading?(i=!1,ye("reading or ended",i)):i&&(ye("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Xp(r,e)));var n;return t>0?n=nm(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I0(this)),n!==null&&this.emit("data",n),n};function l_(t,e){if(ye("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Bu(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,rm(t)))}}function Bu(t){var e=t._readableState;ye("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ye("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(rm,t))}function rm(t){var e=t._readableState;ye("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,L0(t)}function k0(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(u_,t,e))}function u_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ye("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}Te.prototype._read=function(t){u1(this,new i_("_read()"))};Te.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,ye("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,s=n?c:x;i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",a);function a(A,C){ye("onunpipe"),A===r&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,m())}function c(){ye("onend"),t.end()}var d=c_(r);t.on("drain",d);var p=!1;function m(){ye("cleanup"),t.removeListener("close",v),t.removeListener("finish",R),t.removeListener("drain",d),t.removeListener("error",S),t.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",x),r.removeListener("data",w),p=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&d()}r.on("data",w);function w(A){ye("ondata");var C=t.write(A);ye("dest.write",C),C===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&sm(i.pipes,t)!==-1)&&!p&&(ye("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function S(A){ye("onerror",A),x(),t.removeListener("error",S),Qp(t,"error")===0&&u1(t,A)}s_(t,"error",S);function v(){t.removeListener("finish",R),x()}t.once("close",v);function R(){ye("onfinish"),t.removeListener("close",v),x()}t.once("finish",R);function x(){ye("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(ye("pipe resume"),r.resume()),t};function c_(t){return function(){var r=t._readableState;ye("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Qp(t,"data")&&(r.flowing=!0,L0(t))}}Te.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=sm(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Te.prototype.on=function(t,e){var r=c1.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,ye("on readable",i.length,i.reading),i.length?Bu(this):i.reading||process.nextTick(h_,this)),r};Te.prototype.addListener=Te.prototype.on;Te.prototype.removeListener=function(t,e){var r=c1.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(im,this),r};Te.prototype.removeAllListeners=function(t){var e=c1.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(im,this),e};function im(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function h_(t){ye("readable nexttick read 0"),t.read(0)}Te.prototype.resume=function(){var t=this._readableState;return t.flowing||(ye("resume"),t.flowing=!t.readableListening,f_(this,t)),t.paused=!1,this};function f_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(d_,t,e))}function d_(t,e){ye("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),L0(t),e.flowing&&!e.reading&&t.read(0)}Te.prototype.pause=function(){return ye("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ye("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function L0(t){var e=t._readableState;for(ye("flow",e.flowing);e.flowing&&t.read()!==null;);}Te.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(ye("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(ye("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var c=e.push(a);c||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(c){return function(){return t[c].apply(t,arguments)}}(n));for(var s=0;s<P0.length;s++)t.on(P0[s],this.emit.bind(this,P0[s]));return this._read=function(a){ye("wrapped _read",a),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(Te.prototype[Symbol.asyncIterator]=function(){return C0===void 0&&(C0=Gp()),C0(this)});Object.defineProperty(Te.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Te.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Te.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Te._fromList=nm;Object.defineProperty(Te.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function nm(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function I0(t){var e=t._readableState;ye("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(p_,e,t))}function p_(t,e){if(ye("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Te.from=function(t,e){return A0===void 0&&(A0=Jp()),A0(Te,t,e)});function sm(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var N0=H((dA,lm)=>{"use strict";lm.exports=Ui;var zu=dn().codes,m_=zu.ERR_METHOD_NOT_IMPLEMENTED,g_=zu.ERR_MULTIPLE_CALLBACK,y_=zu.ERR_TRANSFORM_ALREADY_TRANSFORMING,b_=zu.ERR_TRANSFORM_WITH_LENGTH_0,ju=us();Io()(Ui,ju);function v_(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new g_);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Ui(t){if(!(this instanceof Ui))return new Ui(t);ju.call(this,t),this._transformState={afterTransform:v_.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",w_)}function w_(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){am(t,e,r)}):am(this,null,null)}Ui.prototype.push=function(t,e){return this._transformState.needTransform=!1,ju.prototype.push.call(this,t,e)};Ui.prototype._transform=function(t,e,r){r(new m_("_transform()"))};Ui.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Ui.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Ui.prototype._destroy=function(t,e){ju.prototype._destroy.call(this,t,function(r){e(r)})};function am(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new b_;if(t._transformState.transforming)throw new y_;return t.push(null)}});var hm=H((pA,cm)=>{"use strict";cm.exports=h1;var um=N0();Io()(h1,um);function h1(t){if(!(this instanceof h1))return new h1(t);um.call(this,t)}h1.prototype._transform=function(t,e,r){r(null,t)}});var gm=H((mA,mm)=>{"use strict";var D0;function __(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var pm=dn().codes,S_=pm.ERR_MISSING_ARGS,x_=pm.ERR_STREAM_DESTROYED;function fm(t){if(t)throw t}function M_(t){return t.setHeader&&typeof t.abort=="function"}function E_(t,e,r,i){i=__(i);var n=!1;t.on("close",function(){n=!0}),D0===void 0&&(D0=ku()),D0(t,{readable:e,writable:r},function(a){if(a)return i(a);n=!0,i()});var s=!1;return function(a){if(!n&&!s){if(s=!0,M_(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(a||new x_("pipe"))}}}function dm(t){t()}function R_(t,e){return t.pipe(e)}function C_(t){return!t.length||typeof t[t.length-1]!="function"?fm:t.pop()}function A_(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=C_(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new S_("streams");var n,s=e.map(function(a,c){var d=c<e.length-1,p=c>0;return E_(a,d,p,function(m){n||(n=m),m&&s.forEach(dm),!d&&(s.forEach(dm),i(n))})});return e.reduce(R_)}mm.exports=A_});var ym=H((xr,d1)=>{var f1=require("stream");process.env.READABLE_STREAM==="disable"&&f1?(d1.exports=f1.Readable,Object.assign(d1.exports,f1),d1.exports.Stream=f1):(xr=d1.exports=w0(),xr.Stream=f1||xr,xr.Readable=xr,xr.Writable=y0(),xr.Duplex=us(),xr.Transform=N0(),xr.PassThrough=hm(),xr.finished=ku(),xr.pipeline=gm())});var _m=H((gA,wm)=>{"use strict";var{Transform:P_}=ym(),{StringDecoder:T_}=require("string_decoder"),bn=Symbol("last"),qu=Symbol("decoder");function I_(t,e,r){var i;if(this.overflow){var n=this[qu].write(t);if(i=n.split(this.matcher),i.length===1)return r();i.shift(),this.overflow=!1}else this[bn]+=this[qu].write(t),i=this[bn].split(this.matcher);this[bn]=i.pop();for(var s=0;s<i.length;s++)vm(this,this.mapper(i[s]));if(this.overflow=this[bn].length>this.maxLength,this.overflow&&!this.skipOverflow)return r(new Error("maximum buffer reached"));r()}function k_(t){this[bn]+=this[qu].end(),this[bn]&&vm(this,this.mapper(this[bn])),t()}function vm(t,e){e!==void 0&&t.push(e)}function bm(t){return t}function O_(t,e,r){switch(t=t||/\r?\n/,e=e||bm,r=r||{},arguments.length){case 1:typeof t=="function"?(e=t,t=/\r?\n/):typeof t=="object"&&!(t instanceof RegExp)&&(r=t,t=/\r?\n/);break;case 2:typeof t=="function"?(r=e,e=t,t=/\r?\n/):typeof e=="object"&&(r=e,e=bm)}r=Object.assign({},r),r.transform=I_,r.flush=k_,r.readableObjectMode=!0;let i=new P_(r);return i[bn]="",i[qu]=new T_("utf8"),i.matcher=t,i.mapper=e,i.maxLength=r.maxLength,i.skipOverflow=r.skipOverflow,i.overflow=!1,i}wm.exports=O_});var Wm=H((dP,$m)=>{"use strict";$m.exports=Gu;Gu.polyline=Gu;Gu.polygon=H_;function Gu(t,e,r){var i=t.length,n=jo(t[0],e),s=[],a,c,d,p,m;for(r||(r=[]),a=1;a<i;a++){for(c=t[a-1],d=t[a],p=m=jo(d,e);;)if(n|p){if(n&p)break;n?(c=H0(c,d,n,e),n=jo(c,e)):(d=H0(c,d,p,e),p=jo(d,e))}else{s.push(c),p!==m?(s.push(d),a<i-1&&(r.push(s),s=[])):a===i-1&&s.push(d);break}n=m}return s.length&&r.push(s),r}function H_(t,e){var r,i,n,s,a,c,d;for(i=1;i<=8;i*=2){for(r=[],n=t[t.length-1],s=!(jo(n,e)&i),a=0;a<t.length;a++)c=t[a],d=!(jo(c,e)&i),d!==s&&r.push(H0(n,c,i,e)),d&&r.push(c),n=c,s=d;if(t=r,!t.length)break}return r}function H0(t,e,r,i){return r&8?[t[0]+(e[0]-t[0])*(i[3]-t[1])/(e[1]-t[1]),i[3]]:r&4?[t[0]+(e[0]-t[0])*(i[1]-t[1])/(e[1]-t[1]),i[1]]:r&2?[i[2],t[1]+(e[1]-t[1])*(i[2]-t[0])/(e[0]-t[0])]:r&1?[i[0],t[1]+(e[1]-t[1])*(i[0]-t[0])/(e[0]-t[0])]:null}function jo(t,e){var r=0;return t[0]<e[0]?r|=1:t[0]>e[2]&&(r|=2),t[1]<e[1]?r|=4:t[1]>e[3]&&(r|=8),r}});var Fm=H((G0,V0)=>{(function(t,e){typeof G0=="object"&&typeof V0<"u"?V0.exports=e():typeof define=="function"&&define.amd?define(e):t.SplayTree=e()})(G0,function(){"use strict";var t=function(){function R(x,A){this.next=null,this.key=x,this.data=A,this.left=null,this.right=null}return R}();function e(R,x){return R>x?1:R<x?-1:0}function r(R,x,A){for(var C=new t(null,null),T=C,O=C;;){var B=A(R,x.key);if(B<0){if(x.left===null)break;if(A(R,x.left.key)<0){var z=x.left;if(x.left=z.right,z.right=x,x=z,x.left===null)break}O.left=x,O=x,x=x.left}else if(B>0){if(x.right===null)break;if(A(R,x.right.key)>0){var z=x.right;if(x.right=z.left,z.left=x,x=z,x.right===null)break}T.right=x,T=x,x=x.right}else break}return T.right=x.left,O.left=x.right,x.left=C.right,x.right=C.left,x}function i(R,x,A,C){var T=new t(R,x);if(A===null)return T.left=T.right=null,T;A=r(R,A,C);var O=C(R,A.key);return O<0?(T.left=A.left,T.right=A,A.left=null):O>=0&&(T.right=A.right,T.left=A,A.right=null),T}function n(R,x,A){var C=null,T=null;if(x){x=r(R,x,A);var O=A(x.key,R);O===0?(C=x.left,T=x.right):O<0?(T=x.right,x.right=null,C=x):(C=x.left,x.left=null,T=x)}return{left:C,right:T}}function s(R,x,A){return x===null?R:(R===null||(x=r(R.key,x,A),x.left=R),x)}function a(R,x,A,C,T){if(R){C(""+x+(A?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+T(R)+`
105
- `);var O=x+(A?" ":"\u2502 ");R.left&&a(R.left,O,!1,C,T),R.right&&a(R.right,O,!0,C,T)}}var c=function(){function R(x){x===void 0&&(x=e),this._root=null,this._size=0,this._comparator=x}return R.prototype.insert=function(x,A){return this._size++,this._root=i(x,A,this._root,this._comparator)},R.prototype.add=function(x,A){var C=new t(x,A);this._root===null&&(C.left=C.right=null,this._size++,this._root=C);var T=this._comparator,O=r(x,this._root,T),B=T(x,O.key);return B===0?this._root=O:(B<0?(C.left=O.left,C.right=O,O.left=null):B>0&&(C.right=O.right,C.left=O,O.right=null),this._size++,this._root=C),this._root},R.prototype.remove=function(x){this._root=this._remove(x,this._root,this._comparator)},R.prototype._remove=function(x,A,C){var T;if(A===null)return null;A=r(x,A,C);var O=C(x,A.key);return O===0?(A.left===null?T=A.right:(T=r(x,A.left,C),T.right=A.right),this._size--,T):A},R.prototype.pop=function(){var x=this._root;if(x){for(;x.left;)x=x.left;return this._root=r(x.key,this._root,this._comparator),this._root=this._remove(x.key,this._root,this._comparator),{key:x.key,data:x.data}}return null},R.prototype.findStatic=function(x){for(var A=this._root,C=this._comparator;A;){var T=C(x,A.key);if(T===0)return A;T<0?A=A.left:A=A.right}return null},R.prototype.find=function(x){return this._root&&(this._root=r(x,this._root,this._comparator),this._comparator(x,this._root.key)!==0)?null:this._root},R.prototype.contains=function(x){for(var A=this._root,C=this._comparator;A;){var T=C(x,A.key);if(T===0)return!0;T<0?A=A.left:A=A.right}return!1},R.prototype.forEach=function(x,A){for(var C=this._root,T=[],O=!1;!O;)C!==null?(T.push(C),C=C.left):T.length!==0?(C=T.pop(),x.call(A,C),C=C.right):O=!0;return this},R.prototype.range=function(x,A,C,T){for(var O=[],B=this._comparator,z=this._root,G;O.length!==0||z;)if(z)O.push(z),z=z.left;else{if(z=O.pop(),G=B(z.key,A),G>0)break;if(B(z.key,x)>=0&&C.call(T,z))return this;z=z.right}return this},R.prototype.keys=function(){var x=[];return this.forEach(function(A){var C=A.key;return x.push(C)}),x},R.prototype.values=function(){var x=[];return this.forEach(function(A){var C=A.data;return x.push(C)}),x},R.prototype.min=function(){return this._root?this.minNode(this._root).key:null},R.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},R.prototype.minNode=function(x){if(x===void 0&&(x=this._root),x)for(;x.left;)x=x.left;return x},R.prototype.maxNode=function(x){if(x===void 0&&(x=this._root),x)for(;x.right;)x=x.right;return x},R.prototype.at=function(x){for(var A=this._root,C=!1,T=0,O=[];!C;)if(A)O.push(A),A=A.left;else if(O.length>0){if(A=O.pop(),T===x)return A;T++,A=A.right}else C=!0;return null},R.prototype.next=function(x){var A=this._root,C=null;if(x.right){for(C=x.right;C.left;)C=C.left;return C}for(var T=this._comparator;A;){var O=T(x.key,A.key);if(O===0)break;O<0?(C=A,A=A.left):A=A.right}return C},R.prototype.prev=function(x){var A=this._root,C=null;if(x.left!==null){for(C=x.left;C.right;)C=C.right;return C}for(var T=this._comparator;A;){var O=T(x.key,A.key);if(O===0)break;O<0?A=A.left:(C=A,A=A.right)}return C},R.prototype.clear=function(){return this._root=null,this._size=0,this},R.prototype.toList=function(){return m(this._root)},R.prototype.load=function(x,A,C){A===void 0&&(A=[]),C===void 0&&(C=!1);var T=x.length,O=this._comparator;if(C&&v(x,A,0,T-1,O),this._root===null)this._root=d(x,A,0,T),this._size=T;else{var B=S(this.toList(),p(x,A),O);T=this._size+T,this._root=w({head:B},0,T)}return this},R.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(R.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),R.prototype.toString=function(x){x===void 0&&(x=function(C){return String(C.key)});var A=[];return a(this._root,"",!0,function(C){return A.push(C)},x),A.join("")},R.prototype.update=function(x,A,C){var T=this._comparator,O=n(x,this._root,T),B=O.left,z=O.right;T(x,A)<0?z=i(A,C,z,T):B=i(A,C,B,T),this._root=s(B,z,T)},R.prototype.split=function(x){return n(x,this._root,this._comparator)},R}();function d(R,x,A,C){var T=C-A;if(T>0){var O=A+Math.floor(T/2),B=R[O],z=x[O],G=new t(B,z);return G.left=d(R,x,A,O),G.right=d(R,x,O+1,C),G}return null}function p(R,x){for(var A=new t(null,null),C=A,T=0;T<R.length;T++)C=C.next=new t(R[T],x[T]);return C.next=null,A.next}function m(R){for(var x=R,A=[],C=!1,T=new t(null,null),O=T;!C;)x?(A.push(x),x=x.left):A.length>0?(x=O=O.next=A.pop(),x=x.right):C=!0;return O.next=null,T.next}function w(R,x,A){var C=A-x;if(C>0){var T=x+Math.floor(C/2),O=w(R,x,T),B=R.head;return B.left=O,R.head=R.head.next,B.right=w(R,T+1,A),B}return null}function S(R,x,A){for(var C=new t(null,null),T=C,O=R,B=x;O!==null&&B!==null;)A(O.key,B.key)<0?(T.next=O,O=O.next):(T.next=B,B=B.next),T=T.next;return O!==null?T.next=O:B!==null&&(T.next=B),C.next}function v(R,x,A,C,T){if(!(A>=C)){for(var O=R[A+C>>1],B=A-1,z=C+1;;){do B++;while(T(R[B],O)<0);do z--;while(T(R[z],O)>0);if(B>=z)break;var G=R[B];R[B]=R[z],R[z]=G,G=x[B],x[B]=x[z],x[z]=G}v(R,x,A,z,T),v(R,x,z+1,C,T)}}return c})});var r6=H((pP,t6)=>{"use strict";var G_=Fm();function V_(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var J0=V_(G_);function Mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hm(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function It(t,e,r){return e&&Hm(t.prototype,e),r&&Hm(t,r),t}var g1=function(e,r){return e.ll.x<=r.x&&r.x<=e.ur.x&&e.ll.y<=r.y&&r.y<=e.ur.y},K0=function(e,r){if(r.ur.x<e.ll.x||e.ur.x<r.ll.x||r.ur.y<e.ll.y||e.ur.y<r.ll.y)return null;var i=e.ll.x<r.ll.x?r.ll.x:e.ll.x,n=e.ur.x<r.ur.x?e.ur.x:r.ur.x,s=e.ll.y<r.ll.y?r.ll.y:e.ll.y,a=e.ur.y<r.ur.y?e.ur.y:r.ur.y;return{ll:{x:i,y:s},ur:{x:n,y:a}}},wn=Number.EPSILON;wn===void 0&&(wn=Math.pow(2,-52));var K_=wn*wn,Z0=function(e,r){if(-wn<e&&e<wn&&-wn<r&&r<wn)return 0;var i=e-r;return i*i<K_*e*r?0:e<r?-1:1},Z_=function(){function t(){Mr(this,t),this.reset()}return It(t,[{key:"reset",value:function(){this.xRounder=new Gm,this.yRounder=new Gm}},{key:"round",value:function(r,i){return{x:this.xRounder.round(r),y:this.yRounder.round(i)}}}]),t}(),Gm=function(){function t(){Mr(this,t),this.tree=new J0.default,this.round(0)}return It(t,[{key:"round",value:function(r){var i=this.tree.add(r),n=this.tree.prev(i);if(n!==null&&Z0(i.key,n.key)===0)return this.tree.remove(r),n.key;var s=this.tree.next(i);return s!==null&&Z0(i.key,s.key)===0?(this.tree.remove(r),s.key):r}}]),t}(),b1=new Z_,y1=function(e,r){return e.x*r.y-e.y*r.x},e6=function(e,r){return e.x*r.x+e.y*r.y},Vm=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},s={x:i.x-e.x,y:i.y-e.y},a=y1(n,s);return Z0(a,0)},Vu=function(e){return Math.sqrt(e6(e,e))},J_=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},s={x:i.x-e.x,y:i.y-e.y};return y1(s,n)/Vu(s)/Vu(n)},Y_=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},s={x:i.x-e.x,y:i.y-e.y};return e6(s,n)/Vu(s)/Vu(n)},Km=function(e,r,i){return r.y===0?null:{x:e.x+r.x/r.y*(i-e.y),y:i}},Zm=function(e,r,i){return r.x===0?null:{x:i,y:e.y+r.y/r.x*(i-e.x)}},X_=function(e,r,i,n){if(r.x===0)return Zm(i,n,e.x);if(n.x===0)return Zm(e,r,i.x);if(r.y===0)return Km(i,n,e.y);if(n.y===0)return Km(e,r,i.y);var s=y1(r,n);if(s==0)return null;var a={x:i.x-e.x,y:i.y-e.y},c=y1(a,r)/s,d=y1(a,n)/s,p=e.x+d*r.x,m=i.x+c*n.x,w=e.y+d*r.y,S=i.y+c*n.y,v=(p+m)/2,R=(w+S)/2;return{x:v,y:R}},pi=function(){It(t,null,[{key:"compare",value:function(r,i){var n=t.comparePoints(r.point,i.point);return n!==0?n:(r.point!==i.point&&r.link(i),r.isLeft!==i.isLeft?r.isLeft?1:-1:Ku.compare(r.segment,i.segment))}},{key:"comparePoints",value:function(r,i){return r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0}}]);function t(e,r){Mr(this,t),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=r}return It(t,[{key:"link",value:function(r){if(r.point===this.point)throw new Error("Tried to link already linked events");for(var i=r.point.events,n=0,s=i.length;n<s;n++){var a=i[n];this.point.events.push(a),a.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var r=this.point.events.length,i=0;i<r;i++){var n=this.point.events[i];if(n.segment.consumedBy===void 0)for(var s=i+1;s<r;s++){var a=this.point.events[s];a.consumedBy===void 0&&n.otherSE.point.events===a.otherSE.point.events&&n.segment.consume(a.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var r=[],i=0,n=this.point.events.length;i<n;i++){var s=this.point.events[i];s!==this&&!s.segment.ringOut&&s.segment.isInResult()&&r.push(s)}return r}},{key:"getLeftmostComparator",value:function(r){var i=this,n=new Map,s=function(c){var d=c.otherSE;n.set(c,{sine:J_(i.point,r.point,d.point),cosine:Y_(i.point,r.point,d.point)})};return function(a,c){n.has(a)||s(a),n.has(c)||s(c);var d=n.get(a),p=d.sine,m=d.cosine,w=n.get(c),S=w.sine,v=w.cosine;return p>=0&&S>=0?m<v?1:m>v?-1:0:p<0&&S<0?m<v?-1:m>v?1:0:S<p?-1:S>p?1:0}}}]),t}(),Q_=0,Ku=function(){It(t,null,[{key:"compare",value:function(r,i){var n=r.leftSE.point.x,s=i.leftSE.point.x,a=r.rightSE.point.x,c=i.rightSE.point.x;if(c<n)return 1;if(a<s)return-1;var d=r.leftSE.point.y,p=i.leftSE.point.y,m=r.rightSE.point.y,w=i.rightSE.point.y;if(n<s){if(p<d&&p<m)return 1;if(p>d&&p>m)return-1;var S=r.comparePoint(i.leftSE.point);if(S<0)return 1;if(S>0)return-1;var v=i.comparePoint(r.rightSE.point);return v!==0?v:-1}if(n>s){if(d<p&&d<w)return-1;if(d>p&&d>w)return 1;var R=i.comparePoint(r.leftSE.point);if(R!==0)return R;var x=r.comparePoint(i.rightSE.point);return x<0?1:x>0?-1:1}if(d<p)return-1;if(d>p)return 1;if(a<c){var A=i.comparePoint(r.rightSE.point);if(A!==0)return A}if(a>c){var C=r.comparePoint(i.rightSE.point);if(C<0)return 1;if(C>0)return-1}if(a!==c){var T=m-d,O=a-n,B=w-p,z=c-s;if(T>O&&B<z)return 1;if(T<O&&B>z)return-1}return a>c?1:a<c||m<w?-1:m>w?1:r.id<i.id?-1:r.id>i.id?1:0}}]);function t(e,r,i,n){Mr(this,t),this.id=++Q_,this.leftSE=e,e.segment=this,e.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=e,this.rings=i,this.windings=n}return It(t,[{key:"replaceRightSE",value:function(r){this.rightSE=r,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var r=this.leftSE.point.y,i=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:r<i?r:i},ur:{x:this.rightSE.point.x,y:r>i?r:i}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(r){return r.x===this.leftSE.point.x&&r.y===this.leftSE.point.y||r.x===this.rightSE.point.x&&r.y===this.rightSE.point.y}},{key:"comparePoint",value:function(r){if(this.isAnEndpoint(r))return 0;var i=this.leftSE.point,n=this.rightSE.point,s=this.vector();if(i.x===n.x)return r.x===i.x?0:r.x<i.x?1:-1;var a=(r.y-i.y)/s.y,c=i.x+a*s.x;if(r.x===c)return 0;var d=(r.x-i.x)/s.x,p=i.y+d*s.y;return r.y===p?0:r.y<p?-1:1}},{key:"getIntersection",value:function(r){var i=this.bbox(),n=r.bbox(),s=K0(i,n);if(s===null)return null;var a=this.leftSE.point,c=this.rightSE.point,d=r.leftSE.point,p=r.rightSE.point,m=g1(i,d)&&this.comparePoint(d)===0,w=g1(n,a)&&r.comparePoint(a)===0,S=g1(i,p)&&this.comparePoint(p)===0,v=g1(n,c)&&r.comparePoint(c)===0;if(w&&m)return v&&!S?c:!v&&S?p:null;if(w)return S&&a.x===p.x&&a.y===p.y?null:a;if(m)return v&&c.x===d.x&&c.y===d.y?null:d;if(v&&S)return null;if(v)return c;if(S)return p;var R=X_(a,this.vector(),d,r.vector());return R===null||!g1(s,R)?null:b1.round(R.x,R.y)}},{key:"split",value:function(r){var i=[],n=r.events!==void 0,s=new pi(r,!0),a=new pi(r,!1),c=this.rightSE;this.replaceRightSE(a),i.push(a),i.push(s);var d=new t(s,c,this.rings.slice(),this.windings.slice());return pi.comparePoints(d.leftSE.point,d.rightSE.point)>0&&d.swapEvents(),pi.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(s.checkForConsuming(),a.checkForConsuming()),i}},{key:"swapEvents",value:function(){var r=this.rightSE;this.rightSE=this.leftSE,this.leftSE=r,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var i=0,n=this.windings.length;i<n;i++)this.windings[i]*=-1}},{key:"consume",value:function(r){for(var i=this,n=r;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var s=t.compare(i,n);if(s!==0){if(s>0){var a=i;i=n,n=a}if(i.prev===n){var c=i;i=n,n=c}for(var d=0,p=n.rings.length;d<p;d++){var m=n.rings[d],w=n.windings[d],S=i.rings.indexOf(m);S===-1?(i.rings.push(m),i.windings.push(w)):i.windings[S]+=w}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var r=this.prev.consumedBy||this.prev;this._beforeState=r.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var r=this.beforeState();this._afterState={rings:r.rings.slice(0),windings:r.windings.slice(0),multiPolys:[]};for(var i=this._afterState.rings,n=this._afterState.windings,s=this._afterState.multiPolys,a=0,c=this.rings.length;a<c;a++){var d=this.rings[a],p=this.windings[a],m=i.indexOf(d);m===-1?(i.push(d),n.push(p)):n[m]+=p}for(var w=[],S=[],v=0,R=i.length;v<R;v++)if(n[v]!==0){var x=i[v],A=x.poly;if(S.indexOf(A)===-1)if(x.isExterior)w.push(A);else{S.indexOf(A)===-1&&S.push(A);var C=w.indexOf(x.poly);C!==-1&&w.splice(C,1)}}for(var T=0,O=w.length;T<O;T++){var B=w[T].multiPoly;s.indexOf(B)===-1&&s.push(B)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var r=this.beforeState().multiPolys,i=this.afterState().multiPolys;switch(jr.type){case"union":{var n=r.length===0,s=i.length===0;this._isInResult=n!==s;break}case"intersection":{var a,c;r.length<i.length?(a=r.length,c=i.length):(a=i.length,c=r.length),this._isInResult=c===jr.numMultiPolys&&a<c;break}case"xor":{var d=Math.abs(r.length-i.length);this._isInResult=d%2===1;break}case"difference":{var p=function(w){return w.length===1&&w[0].isSubject};this._isInResult=p(r)!==p(i);break}default:throw new Error("Unrecognized operation type found ".concat(jr.type))}return this._isInResult}}],[{key:"fromRing",value:function(r,i,n){var s,a,c,d=pi.comparePoints(r,i);if(d<0)s=r,a=i,c=1;else if(d>0)s=i,a=r,c=-1;else throw new Error("Tried to create degenerate segment at [".concat(r.x,", ").concat(r.y,"]"));var p=new pi(s,!0),m=new pi(a,!1);return new t(p,m,[n],[c])}}]),t}(),Jm=function(){function t(e,r,i){if(Mr(this,t),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=b1.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var s=n,a=1,c=e.length;a<c;a++){if(typeof e[a][0]!="number"||typeof e[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var d=b1.round(e[a][0],e[a][1]);d.x===s.x&&d.y===s.y||(this.segments.push(Ku.fromRing(s,d,this)),d.x<this.bbox.ll.x&&(this.bbox.ll.x=d.x),d.y<this.bbox.ll.y&&(this.bbox.ll.y=d.y),d.x>this.bbox.ur.x&&(this.bbox.ur.x=d.x),d.y>this.bbox.ur.y&&(this.bbox.ur.y=d.y),s=d)}(n.x!==s.x||n.y!==s.y)&&this.segments.push(Ku.fromRing(s,n,this))}return It(t,[{key:"getSweepEvents",value:function(){for(var r=[],i=0,n=this.segments.length;i<n;i++){var s=this.segments[i];r.push(s.leftSE),r.push(s.rightSE)}return r}}]),t}(),eS=function(){function t(e,r){if(Mr(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Jm(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,n=e.length;i<n;i++){var s=new Jm(e[i],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=r}return It(t,[{key:"getSweepEvents",value:function(){for(var r=this.exteriorRing.getSweepEvents(),i=0,n=this.interiorRings.length;i<n;i++)for(var s=this.interiorRings[i].getSweepEvents(),a=0,c=s.length;a<c;a++)r.push(s[a]);return r}}]),t}(),Ym=function(){function t(e,r){if(Mr(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,n=e.length;i<n;i++){var s=new eS(e[i],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=r}return It(t,[{key:"getSweepEvents",value:function(){for(var r=[],i=0,n=this.polys.length;i<n;i++)for(var s=this.polys[i].getSweepEvents(),a=0,c=s.length;a<c;a++)r.push(s[a]);return r}}]),t}(),tS=function(){It(t,null,[{key:"factory",value:function(r){for(var i=[],n=0,s=r.length;n<s;n++){var a=r[n];if(!(!a.isInResult()||a.ringOut)){for(var c=null,d=a.leftSE,p=a.rightSE,m=[d],w=d.point,S=[];c=d,d=p,m.push(d),d.point!==w;)for(;;){var v=d.getAvailableLinkedEvents();if(v.length===0){var R=m[0].point,x=m[m.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(R.x,",")+" ".concat(R.y,"]. Last matching segment found ends at")+" [".concat(x.x,", ").concat(x.y,"]."))}if(v.length===1){p=v[0].otherSE;break}for(var A=null,C=0,T=S.length;C<T;C++)if(S[C].point===d.point){A=C;break}if(A!==null){var O=S.splice(A)[0],B=m.splice(O.index);B.unshift(B[0].otherSE),i.push(new t(B.reverse()));continue}S.push({index:m.length,point:d.point});var z=d.getLeftmostComparator(c);p=v.sort(z)[0].otherSE;break}i.push(new t(m))}}return i}}]);function t(e){Mr(this,t),this.events=e;for(var r=0,i=e.length;r<i;r++)e[r].segment.ringOut=this;this.poly=null}return It(t,[{key:"getGeom",value:function(){for(var r=this.events[0].point,i=[r],n=1,s=this.events.length-1;n<s;n++){var a=this.events[n].point,c=this.events[n+1].point;Vm(a,r,c)!==0&&(i.push(a),r=a)}if(i.length===1)return null;var d=i[0],p=i[1];Vm(d,r,p)===0&&i.shift(),i.push(i[0]);for(var m=this.isExteriorRing()?1:-1,w=this.isExteriorRing()?0:i.length-1,S=this.isExteriorRing()?i.length:-1,v=[],R=w;R!=S;R+=m)v.push([i[R].x,i[R].y]);return v}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var r=this.enclosingRing();this._isExteriorRing=r?!r.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var r=this.events[0],i=1,n=this.events.length;i<n;i++){var s=this.events[i];pi.compare(r,s)>0&&(r=s)}for(var a=r.segment.prevInResult(),c=a?a.prevInResult():null;;){if(!a)return null;if(!c)return a.ringOut;if(c.ringOut!==a.ringOut)return c.ringOut.enclosingRing()!==a.ringOut?a.ringOut:a.ringOut.enclosingRing();a=c.prevInResult(),c=a?a.prevInResult():null}}}]),t}(),Xm=function(){function t(e){Mr(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return It(t,[{key:"addInterior",value:function(r){this.interiorRings.push(r),r.poly=this}},{key:"getGeom",value:function(){var r=[this.exteriorRing.getGeom()];if(r[0]===null)return null;for(var i=0,n=this.interiorRings.length;i<n;i++){var s=this.interiorRings[i].getGeom();s!==null&&r.push(s)}return r}}]),t}(),rS=function(){function t(e){Mr(this,t),this.rings=e,this.polys=this._composePolys(e)}return It(t,[{key:"getGeom",value:function(){for(var r=[],i=0,n=this.polys.length;i<n;i++){var s=this.polys[i].getGeom();s!==null&&r.push(s)}return r}},{key:"_composePolys",value:function(r){for(var i=[],n=0,s=r.length;n<s;n++){var a=r[n];if(!a.poly)if(a.isExteriorRing())i.push(new Xm(a));else{var c=a.enclosingRing();c.poly||i.push(new Xm(c)),c.poly.addInterior(a)}}return i}}]),t}(),iS=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ku.compare;Mr(this,t),this.queue=e,this.tree=new J0.default(r),this.segments=[]}return It(t,[{key:"process",value:function(r){var i=r.segment,n=[];if(r.consumedBy)return r.isLeft?this.queue.remove(r.otherSE):this.tree.remove(i),n;var s=r.isLeft?this.tree.insert(i):this.tree.find(i);if(!s)throw new Error("Unable to find segment #".concat(i.id," ")+"[".concat(i.leftSE.point.x,", ").concat(i.leftSE.point.y,"] -> ")+"[".concat(i.rightSE.point.x,", ").concat(i.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var a=s,c=s,d=void 0,p=void 0;d===void 0;)a=this.tree.prev(a),a===null?d=null:a.key.consumedBy===void 0&&(d=a.key);for(;p===void 0;)c=this.tree.next(c),c===null?p=null:c.key.consumedBy===void 0&&(p=c.key);if(r.isLeft){var m=null;if(d){var w=d.getIntersection(i);if(w!==null&&(i.isAnEndpoint(w)||(m=w),!d.isAnEndpoint(w)))for(var S=this._splitSafely(d,w),v=0,R=S.length;v<R;v++)n.push(S[v])}var x=null;if(p){var A=p.getIntersection(i);if(A!==null&&(i.isAnEndpoint(A)||(x=A),!p.isAnEndpoint(A)))for(var C=this._splitSafely(p,A),T=0,O=C.length;T<O;T++)n.push(C[T])}if(m!==null||x!==null){var B=null;if(m===null)B=x;else if(x===null)B=m;else{var z=pi.comparePoints(m,x);B=z<=0?m:x}this.queue.remove(i.rightSE),n.push(i.rightSE);for(var G=i.split(B),te=0,se=G.length;te<se;te++)n.push(G[te])}n.length>0?(this.tree.remove(i),n.push(r)):(this.segments.push(i),i.prev=d)}else{if(d&&p){var ke=d.getIntersection(p);if(ke!==null){if(!d.isAnEndpoint(ke))for(var De=this._splitSafely(d,ke),Pe=0,We=De.length;Pe<We;Pe++)n.push(De[Pe]);if(!p.isAnEndpoint(ke))for(var ot=this._splitSafely(p,ke),Rt=0,Fr=ot.length;Rt<Fr;Rt++)n.push(ot[Rt])}}this.tree.remove(i)}return n}},{key:"_splitSafely",value:function(r,i){this.tree.remove(r);var n=r.rightSE;this.queue.remove(n);var s=r.split(i);return s.push(n),r.consumedBy===void 0&&this.tree.insert(r),s}}]),t}(),Qm=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,nS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,sS=function(){function t(){Mr(this,t)}return It(t,[{key:"run",value:function(r,i,n){jr.type=r,b1.reset();for(var s=[new Ym(i,!0)],a=0,c=n.length;a<c;a++)s.push(new Ym(n[a],!1));if(jr.numMultiPolys=s.length,jr.type==="difference")for(var d=s[0],p=1;p<s.length;)K0(s[p].bbox,d.bbox)!==null?p++:s.splice(p,1);if(jr.type==="intersection"){for(var m=0,w=s.length;m<w;m++)for(var S=s[m],v=m+1,R=s.length;v<R;v++)if(K0(S.bbox,s[v].bbox)===null)return[]}for(var x=new J0.default(pi.compare),A=0,C=s.length;A<C;A++)for(var T=s[A].getSweepEvents(),O=0,B=T.length;O<B;O++)if(x.insert(T[O]),x.size>Qm)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var z=new iS(x),G=x.size,te=x.pop();te;){var se=te.key;if(x.size===G){var ke=se.segment;throw new Error("Unable to pop() ".concat(se.isLeft?"left":"right"," SweepEvent ")+"[".concat(se.point.x,", ").concat(se.point.y,"] from segment #").concat(ke.id," ")+"[".concat(ke.leftSE.point.x,", ").concat(ke.leftSE.point.y,"] -> ")+"[".concat(ke.rightSE.point.x,", ").concat(ke.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(x.size>Qm)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(z.segments.length>nS)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var De=z.process(se),Pe=0,We=De.length;Pe<We;Pe++){var ot=De[Pe];ot.consumedBy===void 0&&x.insert(ot)}G=x.size,te=x.pop()}b1.reset();var Rt=tS.factory(z.segments),Fr=new rS(Rt);return Fr.getGeom()}}]),t}(),jr=new sS,oS=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return jr.run("union",e,i)},aS=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return jr.run("intersection",e,i)},lS=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return jr.run("xor",e,i)},uS=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return jr.run("difference",e,i)},cS={union:oS,intersection:aS,xor:lS,difference:uS};t6.exports=cS});var u6=H((X0,Q0)=>{(function(t,e){typeof X0=="object"&&typeof Q0<"u"?Q0.exports=e():typeof define=="function"&&define.amd?define(e):t.proj4=e()})(X0,function(){"use strict";var t=function(o){o("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),o("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),o("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),o.WGS84=o["EPSG:4326"],o["EPSG:3785"]=o["EPSG:3857"],o.GOOGLE=o["EPSG:3857"],o["EPSG:900913"]=o["EPSG:3857"],o["EPSG:102113"]=o["EPSG:3857"]},e=1,r=2,i=4,n=5,s=484813681109536e-20,a=Math.PI/2,c=.16666666666666666,d=.04722222222222222,p=.022156084656084655,m=1e-10,w=.017453292519943295,S=57.29577951308232,v=Math.PI/4,R=Math.PI*2,x=3.14159265359,A={};A.greenwich=0,A.lisbon=-9.131906111111,A.paris=2.337229166667,A.bogota=-74.080916666667,A.madrid=-3.687938888889,A.rome=12.452333333333,A.bern=7.439583333333,A.jakarta=106.807719444444,A.ferro=-17.666666666667,A.brussels=4.367975,A.stockholm=18.058277777778,A.athens=23.7163375,A.oslo=10.722916666667;var C={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},T=/[\s_\-\/\(\)]/g;function O(o,u){if(o[u])return o[u];for(var h=Object.keys(o),y=u.toLowerCase().replace(T,""),g=-1,_,M;++g<h.length;)if(_=h[g],M=_.toLowerCase().replace(T,""),M===y)return o[_]}var B=function(o){var u={},h=o.split("+").map(function(E){return E.trim()}).filter(function(E){return E}).reduce(function(E,P){var k=P.split("=");return k.push(!0),E[k[0].toLowerCase()]=k[1],E},{}),y,g,_,M={proj:"projName",datum:"datumCode",rf:function(E){u.rf=parseFloat(E)},lat_0:function(E){u.lat0=E*w},lat_1:function(E){u.lat1=E*w},lat_2:function(E){u.lat2=E*w},lat_ts:function(E){u.lat_ts=E*w},lon_0:function(E){u.long0=E*w},lon_1:function(E){u.long1=E*w},lon_2:function(E){u.long2=E*w},alpha:function(E){u.alpha=parseFloat(E)*w},lonc:function(E){u.longc=E*w},x_0:function(E){u.x0=parseFloat(E)},y_0:function(E){u.y0=parseFloat(E)},k_0:function(E){u.k0=parseFloat(E)},k:function(E){u.k0=parseFloat(E)},a:function(E){u.a=parseFloat(E)},b:function(E){u.b=parseFloat(E)},r_a:function(){u.R_A=!0},zone:function(E){u.zone=parseInt(E,10)},south:function(){u.utmSouth=!0},towgs84:function(E){u.datum_params=E.split(",").map(function(P){return parseFloat(P)})},to_meter:function(E){u.to_meter=parseFloat(E)},units:function(E){u.units=E;var P=O(C,E);P&&(u.to_meter=P.to_meter)},from_greenwich:function(E){u.from_greenwich=E*w},pm:function(E){var P=O(A,E);u.from_greenwich=(P||parseFloat(E))*w},nadgrids:function(E){E==="@null"?u.datumCode="none":u.nadgrids=E},axis:function(E){var P="ewnsud";E.length===3&&P.indexOf(E.substr(0,1))!==-1&&P.indexOf(E.substr(1,1))!==-1&&P.indexOf(E.substr(2,1))!==-1&&(u.axis=E)}};for(y in h)g=h[y],y in M?(_=M[y],typeof _=="function"?_(g):u[_]=g):u[y]=g;return typeof u.datumCode=="string"&&u.datumCode!=="WGS84"&&(u.datumCode=u.datumCode.toLowerCase()),u},z=1,G=2,te=3,se=4,ke=5,De=-1,Pe=/\s/,We=/[A-Za-z]/,ot=/[A-Za-z84]/,Rt=/[,\]]/,Fr=/[\d\.E\-\+]/;function Kt(o){if(typeof o!="string")throw new Error("not a string");this.text=o.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=z}Kt.prototype.readCharicter=function(){var o=this.text[this.place++];if(this.state!==se)for(;Pe.test(o);){if(this.place>=this.text.length)return;o=this.text[this.place++]}switch(this.state){case z:return this.neutral(o);case G:return this.keyword(o);case se:return this.quoted(o);case ke:return this.afterquote(o);case te:return this.number(o);case De:return}},Kt.prototype.afterquote=function(o){if(o==='"'){this.word+='"',this.state=se;return}if(Rt.test(o)){this.word=this.word.trim(),this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in afterquote yet, index '+this.place)},Kt.prototype.afterItem=function(o){if(o===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=z;return}if(o==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=z,this.currentObject=this.stack.pop(),this.currentObject||(this.state=De);return}},Kt.prototype.number=function(o){if(Fr.test(o)){this.word+=o;return}if(Rt.test(o)){this.word=parseFloat(this.word),this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in number yet, index '+this.place)},Kt.prototype.quoted=function(o){if(o==='"'){this.state=ke;return}this.word+=o},Kt.prototype.keyword=function(o){if(ot.test(o)){this.word+=o;return}if(o==="["){var u=[];u.push(this.word),this.level++,this.root===null?this.root=u:this.currentObject.push(u),this.stack.push(this.currentObject),this.currentObject=u,this.state=z;return}if(Rt.test(o)){this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in keyword yet, index '+this.place)},Kt.prototype.neutral=function(o){if(We.test(o)){this.word=o,this.state=G;return}if(o==='"'){this.word="",this.state=se;return}if(Fr.test(o)){this.word=o,this.state=te;return}if(Rt.test(o)){this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in neutral yet, index '+this.place)},Kt.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===De)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function Nc(o){var u=new Kt(o);return u.output()}function na(o,u,h){Array.isArray(u)&&(h.unshift(u),u=null);var y=u?{}:o,g=h.reduce(function(_,M){return vi(M,_),_},y);u&&(o[u]=g)}function vi(o,u){if(!Array.isArray(o)){u[o]=!0;return}var h=o.shift();if(h==="PARAMETER"&&(h=o.shift()),o.length===1){if(Array.isArray(o[0])){u[h]={},vi(o[0],u[h]);return}u[h]=o[0];return}if(!o.length){u[h]=!0;return}if(h==="TOWGS84"){u[h]=o;return}if(h==="AXIS"){h in u||(u[h]=[]),u[h].push(o);return}Array.isArray(h)||(u[h]={});var y;switch(h){case"UNIT":case"PRIMEM":case"VERT_DATUM":u[h]={name:o[0].toLowerCase(),convert:o[1]},o.length===3&&vi(o[2],u[h]);return;case"SPHEROID":case"ELLIPSOID":u[h]={name:o[0],a:o[1],rf:o[2]},o.length===4&&vi(o[3],u[h]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":o[0]=["name",o[0]],na(u,h,o);return;default:for(y=-1;++y<o.length;)if(!Array.isArray(o[y]))return vi(o,u[h]);return na(u,h,o)}}var N1=.017453292519943295;function sa(o,u){var h=u[0],y=u[1];!(h in o)&&y in o&&(o[h]=o[y],u.length===3&&(o[h]=u[2](o[h])))}function Zt(o){return o*N1}function D1(o){if(o.type==="GEOGCS"?o.projName="longlat":o.type==="LOCAL_CS"?(o.projName="identity",o.local=!0):typeof o.PROJECTION=="object"?o.projName=Object.keys(o.PROJECTION)[0]:o.projName=o.PROJECTION,o.AXIS){for(var u="",h=0,y=o.AXIS.length;h<y;++h){var g=o.AXIS[h],_=g[0].toLowerCase();_.indexOf("north")!==-1?u+="n":_.indexOf("south")!==-1?u+="s":_.indexOf("east")!==-1?u+="e":_.indexOf("west")!==-1&&(u+="w")}u.length===2&&(u+="u"),u.length===3&&(o.axis=u)}o.UNIT&&(o.units=o.UNIT.name.toLowerCase(),o.units==="metre"&&(o.units="meter"),o.UNIT.convert&&(o.type==="GEOGCS"?o.DATUM&&o.DATUM.SPHEROID&&(o.to_meter=o.UNIT.convert*o.DATUM.SPHEROID.a):o.to_meter=o.UNIT.convert));var M=o.GEOGCS;o.type==="GEOGCS"&&(M=o),M&&(M.DATUM?o.datumCode=M.DATUM.name.toLowerCase():o.datumCode=M.name.toLowerCase(),o.datumCode.slice(0,2)==="d_"&&(o.datumCode=o.datumCode.slice(2)),(o.datumCode==="new_zealand_geodetic_datum_1949"||o.datumCode==="new_zealand_1949")&&(o.datumCode="nzgd49"),(o.datumCode==="wgs_1984"||o.datumCode==="world_geodetic_system_1984")&&(o.PROJECTION==="Mercator_Auxiliary_Sphere"&&(o.sphere=!0),o.datumCode="wgs84"),o.datumCode.slice(-6)==="_ferro"&&(o.datumCode=o.datumCode.slice(0,-6)),o.datumCode.slice(-8)==="_jakarta"&&(o.datumCode=o.datumCode.slice(0,-8)),~o.datumCode.indexOf("belge")&&(o.datumCode="rnb72"),M.DATUM&&M.DATUM.SPHEROID&&(o.ellps=M.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),o.ellps.toLowerCase().slice(0,13)==="international"&&(o.ellps="intl"),o.a=M.DATUM.SPHEROID.a,o.rf=parseFloat(M.DATUM.SPHEROID.rf,10)),M.DATUM&&M.DATUM.TOWGS84&&(o.datum_params=M.DATUM.TOWGS84),~o.datumCode.indexOf("osgb_1936")&&(o.datumCode="osgb36"),~o.datumCode.indexOf("osni_1952")&&(o.datumCode="osni52"),(~o.datumCode.indexOf("tm65")||~o.datumCode.indexOf("geodetic_datum_of_1965"))&&(o.datumCode="ire65"),o.datumCode==="ch1903+"&&(o.datumCode="ch1903"),~o.datumCode.indexOf("israel")&&(o.datumCode="isr93")),o.b&&!isFinite(o.b)&&(o.b=o.a);function E(D){var N=o.to_meter||1;return D*N}var P=function(D){return sa(o,D)},k=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Zt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Zt],["x0","false_easting",E],["y0","false_northing",E],["long0","central_meridian",Zt],["lat0","latitude_of_origin",Zt],["lat0","standard_parallel_1",Zt],["lat1","standard_parallel_1",Zt],["lat2","standard_parallel_2",Zt],["azimuth","Azimuth"],["alpha","azimuth",Zt],["srsCode","name"]];k.forEach(P),!o.long0&&o.longc&&(o.projName==="Albers_Conic_Equal_Area"||o.projName==="Lambert_Azimuthal_Equal_Area")&&(o.long0=o.longc),!o.lat_ts&&o.lat1&&(o.projName==="Stereographic_South_Pole"||o.projName==="Polar Stereographic (variant B)")&&(o.lat0=Zt(o.lat1>0?90:-90),o.lat_ts=o.lat1)}var B1=function(o){var u=Nc(o),h=u.shift(),y=u.shift();u.unshift(["name",y]),u.unshift(["type",h]);var g={};return vi(u,g),D1(g),g};function dt(o){var u=this;if(arguments.length===2){var h=arguments[1];typeof h=="string"?h.charAt(0)==="+"?dt[o]=B(arguments[1]):dt[o]=B1(arguments[1]):dt[o]=h}else if(arguments.length===1){if(Array.isArray(o))return o.map(function(y){Array.isArray(y)?dt.apply(u,y):dt(y)});if(typeof o=="string"){if(o in dt)return dt[o]}else"EPSG"in o?dt["EPSG:"+o.EPSG]=o:"ESRI"in o?dt["ESRI:"+o.ESRI]=o:"IAU2000"in o?dt["IAU2000:"+o.IAU2000]=o:console.log(o);return}}t(dt);function Pr(o){return typeof o=="string"}function Jt(o){return o in dt}var Dc=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function z1(o){return Dc.some(function(u){return o.indexOf(u)>-1})}var Tr=["3857","900913","3785","102113"];function oa(o){var u=O(o,"authority");if(!!u){var h=O(u,"epsg");return h&&Tr.indexOf(h)>-1}}function aa(o){var u=O(o,"extension");if(!!u)return O(u,"proj4")}function j1(o){return o[0]==="+"}function Bc(o){if(Pr(o)){if(Jt(o))return dt[o];if(z1(o)){var u=B1(o);if(oa(u))return dt["EPSG:3857"];var h=aa(u);return h?B(h):u}if(j1(o))return B(o)}else return o}var la=function(o,u){o=o||{};var h,y;if(!u)return o;for(y in u)h=u[y],h!==void 0&&(o[y]=h);return o},Nt=function(o,u,h){var y=o*u;return h/Math.sqrt(1-y*y)},fr=function(o){return o<0?-1:1},Z=function(o){return Math.abs(o)<=x?o:o-fr(o)*R},Ct=function(o,u,h){var y=o*h,g=.5*o;return y=Math.pow((1-y)/(1+y),g),Math.tan(.5*(a-u))/y},Hr=function(o,u){for(var h=.5*o,y,g,_=a-2*Math.atan(u),M=0;M<=15;M++)if(y=o*Math.sin(_),g=a-2*Math.atan(u*Math.pow((1-y)/(1+y),h))-_,_+=g,Math.abs(g)<=1e-10)return _;return-9999};function q1(){var o=this.b/this.a;this.es=1-o*o,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Nt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function An(o){var u=o.x,h=o.y;if(h*S>90&&h*S<-90&&u*S>180&&u*S<-180)return null;var y,g;if(Math.abs(Math.abs(h)-a)<=m)return null;if(this.sphere)y=this.x0+this.a*this.k0*Z(u-this.long0),g=this.y0+this.a*this.k0*Math.log(Math.tan(v+.5*h));else{var _=Math.sin(h),M=Ct(this.e,h,_);y=this.x0+this.a*this.k0*Z(u-this.long0),g=this.y0-this.a*this.k0*Math.log(M)}return o.x=y,o.y=g,o}function Gr(o){var u=o.x-this.x0,h=o.y-this.y0,y,g;if(this.sphere)g=a-2*Math.atan(Math.exp(-h/(this.a*this.k0)));else{var _=Math.exp(-h/(this.a*this.k0));if(g=Hr(this.e,_),g===-9999)return null}return y=Z(this.long0+u/(this.a*this.k0)),o.x=y,o.y=g,o}var Pn=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],Cs={init:q1,forward:An,inverse:Gr,names:Pn};function U1(){}function ua(o){return o}var $1=["longlat","identity"],zc={init:U1,forward:ua,inverse:ua,names:$1},W1=[Cs,zc],Tn={},In=[];function Wi(o,u){var h=In.length;return o.names?(In[h]=o,o.names.forEach(function(y){Tn[y.toLowerCase()]=h}),this):(console.log(u),!0)}function F1(o){if(!o)return!1;var u=o.toLowerCase();if(typeof Tn[u]<"u"&&In[Tn[u]])return In[Tn[u]]}function Yd(){W1.forEach(Wi)}var As={start:Yd,add:Wi,get:F1},le={};le.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},le.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},le.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},le.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},le.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},le.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},le.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},le.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},le.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},le.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},le.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},le.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},le.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},le.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},le.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},le.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},le.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},le.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},le.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},le.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},le.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},le.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},le.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},le.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},le.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},le.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},le.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},le.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},le.hough={a:6378270,rf:297,ellipseName:"Hough"},le.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},le.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},le.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},le.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},le.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},le.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},le.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},le.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},le.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},le.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},le.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},le.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var jc=le.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};le.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function H1(o,u,h,y){var g=o*o,_=u*u,M=(g-_)/g,E=0;y?(o*=1-M*(c+M*(d+M*p)),g=o*o,M=0):E=Math.sqrt(M);var P=(g-_)/_;return{es:M,e:E,ep2:P}}function ca(o,u,h,y,g){if(!o){var _=O(le,y);_||(_=jc),o=_.a,u=_.b,h=_.rf}return h&&!u&&(u=(1-1/h)*o),(h===0||Math.abs(o-u)<m)&&(g=!0,u=o),{a:o,b:u,rf:h,sphere:g}}var Qe={};Qe.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Qe.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Qe.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Qe.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Qe.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Qe.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Qe.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Qe.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},Qe.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Qe.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Qe.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Qe.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Qe.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Qe.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Qe.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Qe.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Qe.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function qc(o,u,h,y,g,_){var M={};return o===void 0||o==="none"?M.datum_type=n:M.datum_type=i,u&&(M.datum_params=u.map(parseFloat),(M.datum_params[0]!==0||M.datum_params[1]!==0||M.datum_params[2]!==0)&&(M.datum_type=e),M.datum_params.length>3&&(M.datum_params[3]!==0||M.datum_params[4]!==0||M.datum_params[5]!==0||M.datum_params[6]!==0)&&(M.datum_type=r,M.datum_params[3]*=s,M.datum_params[4]*=s,M.datum_params[5]*=s,M.datum_params[6]=M.datum_params[6]/1e6+1)),M.a=h,M.b=y,M.es=g,M.ep2=_,M}function at(o,u){if(!(this instanceof at))return new at(o);u=u||function(P){if(P)throw P};var h=Bc(o);if(typeof h!="object"){u(o);return}var y=at.projections.get(h.projName);if(!y){u(o);return}if(h.datumCode&&h.datumCode!=="none"){var g=O(Qe,h.datumCode);g&&(h.datum_params=g.towgs84?g.towgs84.split(","):null,h.ellps=g.ellipse,h.datumName=g.datumName?g.datumName:h.datumCode)}h.k0=h.k0||1,h.axis=h.axis||"enu",h.ellps=h.ellps||"wgs84";var _=ca(h.a,h.b,h.rf,h.ellps,h.sphere),M=H1(_.a,_.b,_.rf,h.R_A),E=h.datum||qc(h.datumCode,h.datum_params,_.a,_.b,M.es,M.ep2);la(this,h),la(this,y),this.a=_.a,this.b=_.b,this.rf=_.rf,this.sphere=_.sphere,this.es=M.es,this.e=M.e,this.ep2=M.ep2,this.datum=E,this.init(),u(null,this)}at.projections=As,at.projections.start();function kn(o,u){return o.datum_type!==u.datum_type||o.a!==u.a||Math.abs(o.es-u.es)>5e-11?!1:o.datum_type===e?o.datum_params[0]===u.datum_params[0]&&o.datum_params[1]===u.datum_params[1]&&o.datum_params[2]===u.datum_params[2]:o.datum_type===r?o.datum_params[0]===u.datum_params[0]&&o.datum_params[1]===u.datum_params[1]&&o.datum_params[2]===u.datum_params[2]&&o.datum_params[3]===u.datum_params[3]&&o.datum_params[4]===u.datum_params[4]&&o.datum_params[5]===u.datum_params[5]&&o.datum_params[6]===u.datum_params[6]:!0}function wi(o,u,h){var y=o.x,g=o.y,_=o.z?o.z:0,M,E,P,k;if(g<-a&&g>-1.001*a)g=-a;else if(g>a&&g<1.001*a)g=a;else{if(g<-a)return{x:-1/0,y:-1/0,z:o.z};if(g>a)return{x:1/0,y:1/0,z:o.z}}return y>Math.PI&&(y-=2*Math.PI),E=Math.sin(g),k=Math.cos(g),P=E*E,M=h/Math.sqrt(1-u*P),{x:(M+_)*k*Math.cos(y),y:(M+_)*k*Math.sin(y),z:(M*(1-u)+_)*E}}function Vr(o,u,h,y){var g=1e-12,_=g*g,M=30,E,P,k,D,N,q,F,W,V,K,ae,pe,Oe,Ke=o.x,Le=o.y,Be=o.z?o.z:0,wt,tt,ii;if(E=Math.sqrt(Ke*Ke+Le*Le),P=Math.sqrt(Ke*Ke+Le*Le+Be*Be),E/h<g){if(wt=0,P/h<g)return tt=a,ii=-y,{x:o.x,y:o.y,z:o.z}}else wt=Math.atan2(Le,Ke);k=Be/P,D=E/P,N=1/Math.sqrt(1-u*(2-u)*D*D),W=D*(1-u)*N,V=k*N,Oe=0;do Oe++,F=h/Math.sqrt(1-u*V*V),ii=E*W+Be*V-F*(1-u*V*V),q=u*F/(F+ii),N=1/Math.sqrt(1-q*(2-q)*D*D),K=D*(1-q)*N,ae=k*N,pe=ae*W-K*V,W=K,V=ae;while(pe*pe>_&&Oe<M);return tt=Math.atan(ae/Math.abs(K)),{x:wt,y:tt,z:ii}}function ha(o,u,h){if(u===e)return{x:o.x+h[0],y:o.y+h[1],z:o.z+h[2]};if(u===r){var y=h[0],g=h[1],_=h[2],M=h[3],E=h[4],P=h[5],k=h[6];return{x:k*(o.x-P*o.y+E*o.z)+y,y:k*(P*o.x+o.y-M*o.z)+g,z:k*(-E*o.x+M*o.y+o.z)+_}}}function _i(o,u,h){if(u===e)return{x:o.x-h[0],y:o.y-h[1],z:o.z-h[2]};if(u===r){var y=h[0],g=h[1],_=h[2],M=h[3],E=h[4],P=h[5],k=h[6],D=(o.x-y)/k,N=(o.y-g)/k,q=(o.z-_)/k;return{x:D+P*N-E*q,y:-P*D+N+M*q,z:E*D-M*N+q}}}function On(o){return o===e||o===r}var fa=function(o,u,h){return kn(o,u)||o.datum_type===n||u.datum_type===n||o.es===u.es&&o.a===u.a&&!On(o.datum_type)&&!On(u.datum_type)?h:(h=wi(h,o.es,o.a),On(o.datum_type)&&(h=ha(h,o.datum_type,o.datum_params)),On(u.datum_type)&&(h=_i(h,u.datum_type,u.datum_params)),Vr(h,u.es,u.a,u.b))},da=function(o,u,h){var y=h.x,g=h.y,_=h.z||0,M,E,P,k={};for(P=0;P<3;P++)if(!(u&&P===2&&h.z===void 0))switch(P===0?(M=y,"ew".indexOf(o.axis[P])!==-1?E="x":E="y"):P===1?(M=g,"ns".indexOf(o.axis[P])!==-1?E="y":E="x"):(M=_,E="z"),o.axis[P]){case"e":k[E]=M;break;case"w":k[E]=-M;break;case"n":k[E]=M;break;case"s":k[E]=-M;break;case"u":h[E]!==void 0&&(k.z=M);break;case"d":h[E]!==void 0&&(k.z=-M);break;default:return null}return k},Ln=function(o){var u={x:o[0],y:o[1]};return o.length>2&&(u.z=o[2]),o.length>3&&(u.m=o[3]),u},G1=function(o){pa(o.x),pa(o.y)};function pa(o){if(typeof Number.isFinite=="function"){if(Number.isFinite(o))return;throw new TypeError("coordinates must be finite numbers")}if(typeof o!="number"||o!==o||!isFinite(o))throw new TypeError("coordinates must be finite numbers")}function V1(o,u){return(o.datum.datum_type===e||o.datum.datum_type===r)&&u.datumCode!=="WGS84"||(u.datum.datum_type===e||u.datum.datum_type===r)&&o.datumCode!=="WGS84"}function Fi(o,u,h){var y;if(Array.isArray(h)&&(h=Ln(h)),G1(h),o.datum&&u.datum&&V1(o,u)&&(y=new at("WGS84"),h=Fi(o,y,h),o=y),o.axis!=="enu"&&(h=da(o,!1,h)),o.projName==="longlat")h={x:h.x*w,y:h.y*w,z:h.z||0};else if(o.to_meter&&(h={x:h.x*o.to_meter,y:h.y*o.to_meter,z:h.z||0}),h=o.inverse(h),!h)return;return o.from_greenwich&&(h.x+=o.from_greenwich),h=fa(o.datum,u.datum,h),u.from_greenwich&&(h={x:h.x-u.from_greenwich,y:h.y,z:h.z||0}),u.projName==="longlat"?h={x:h.x*S,y:h.y*S,z:h.z||0}:(h=u.forward(h),u.to_meter&&(h={x:h.x/u.to_meter,y:h.y/u.to_meter,z:h.z||0})),u.axis!=="enu"?da(u,!0,h):h}var ma=at("WGS84");function ga(o,u,h){var y,g,_;return Array.isArray(h)?(y=Fi(o,u,h)||{x:NaN,y:NaN},h.length>2?typeof o.name<"u"&&o.name==="geocent"||typeof u.name<"u"&&u.name==="geocent"?typeof y.z=="number"?[y.x,y.y,y.z].concat(h.splice(3)):[y.x,y.y,h[2]].concat(h.splice(3)):[y.x,y.y].concat(h.splice(2)):[y.x,y.y]):(g=Fi(o,u,h),_=Object.keys(h),_.length===2||_.forEach(function(M){if(typeof o.name<"u"&&o.name==="geocent"||typeof u.name<"u"&&u.name==="geocent"){if(M==="x"||M==="y"||M==="z")return}else if(M==="x"||M==="y")return;g[M]=h[M]}),g)}function K1(o){return o instanceof at?o:o.oProj?o.oProj:at(o)}function Dt(o,u,h){o=K1(o);var y=!1,g;return typeof u>"u"?(u=o,o=ma,y=!0):(typeof u.x<"u"||Array.isArray(u))&&(h=u,u=o,o=ma,y=!0),u=K1(u),h?ga(o,u,h):(g={forward:function(_){return ga(o,u,_)},inverse:function(_){return ga(u,o,_)}},y&&(g.oProj=u),g)}var ya=6,Nn="AJSAJS",Z1="AFAFAF",Ir=65,nt=73,pt=79,mt=86,Si=90,J1={forward:Dn,inverse:Ps,toPoint:ba};function Dn(o,u){return u=u||5,Q1(wa({lat:o[1],lon:o[0]}),u)}function Ps(o){var u=xi(Hi(o.toUpperCase()));return u.lat&&u.lon?[u.lon,u.lat,u.lon,u.lat]:[u.left,u.bottom,u.right,u.top]}function ba(o){var u=xi(Hi(o.toUpperCase()));return u.lat&&u.lon?[u.lon,u.lat]:[(u.left+u.right)/2,(u.top+u.bottom)/2]}function va(o){return o*(Math.PI/180)}function Y1(o){return 180*(o/Math.PI)}function wa(o){var u=o.lat,h=o.lon,y=6378137,g=.00669438,_=.9996,M,E,P,k,D,N,q,F=va(u),W=va(h),V,K;K=Math.floor((h+180)/6)+1,h===180&&(K=60),u>=56&&u<64&&h>=3&&h<12&&(K=32),u>=72&&u<84&&(h>=0&&h<9?K=31:h>=9&&h<21?K=33:h>=21&&h<33?K=35:h>=33&&h<42&&(K=37)),M=(K-1)*6-180+3,V=va(M),E=g/(1-g),P=y/Math.sqrt(1-g*Math.sin(F)*Math.sin(F)),k=Math.tan(F)*Math.tan(F),D=E*Math.cos(F)*Math.cos(F),N=Math.cos(F)*(W-V),q=y*((1-g/4-3*g*g/64-5*g*g*g/256)*F-(3*g/8+3*g*g/32+45*g*g*g/1024)*Math.sin(2*F)+(15*g*g/256+45*g*g*g/1024)*Math.sin(4*F)-35*g*g*g/3072*Math.sin(6*F));var ae=_*P*(N+(1-k+D)*N*N*N/6+(5-18*k+k*k+72*D-58*E)*N*N*N*N*N/120)+5e5,pe=_*(q+P*Math.tan(F)*(N*N/2+(5-k+9*D+4*D*D)*N*N*N*N/24+(61-58*k+k*k+600*D-330*E)*N*N*N*N*N*N/720));return u<0&&(pe+=1e7),{northing:Math.round(pe),easting:Math.round(ae),zoneNumber:K,zoneLetter:X1(u)}}function xi(o){var u=o.northing,h=o.easting,y=o.zoneLetter,g=o.zoneNumber;if(g<0||g>60)return null;var _=.9996,M=6378137,E=.00669438,P,k=(1-Math.sqrt(1-E))/(1+Math.sqrt(1-E)),D,N,q,F,W,V,K,ae,pe,Oe=h-5e5,Ke=u;y<"N"&&(Ke-=1e7),K=(g-1)*6-180+3,P=E/(1-E),V=Ke/_,ae=V/(M*(1-E/4-3*E*E/64-5*E*E*E/256)),pe=ae+(3*k/2-27*k*k*k/32)*Math.sin(2*ae)+(21*k*k/16-55*k*k*k*k/32)*Math.sin(4*ae)+151*k*k*k/96*Math.sin(6*ae),D=M/Math.sqrt(1-E*Math.sin(pe)*Math.sin(pe)),N=Math.tan(pe)*Math.tan(pe),q=P*Math.cos(pe)*Math.cos(pe),F=M*(1-E)/Math.pow(1-E*Math.sin(pe)*Math.sin(pe),1.5),W=Oe/(D*_);var Le=pe-D*Math.tan(pe)/F*(W*W/2-(5+3*N+10*q-4*q*q-9*P)*W*W*W*W/24+(61+90*N+298*q+45*N*N-252*P-3*q*q)*W*W*W*W*W*W/720);Le=Y1(Le);var Be=(W-(1+2*N+q)*W*W*W/6+(5-2*q+28*N-3*q*q+8*P+24*N*N)*W*W*W*W*W/120)/Math.cos(pe);Be=K+Y1(Be);var wt;if(o.accuracy){var tt=xi({northing:o.northing+o.accuracy,easting:o.easting+o.accuracy,zoneLetter:o.zoneLetter,zoneNumber:o.zoneNumber});wt={top:tt.lat,right:tt.lon,bottom:Le,left:Be}}else wt={lat:Le,lon:Be};return wt}function X1(o){var u="Z";return 84>=o&&o>=72?u="X":72>o&&o>=64?u="W":64>o&&o>=56?u="V":56>o&&o>=48?u="U":48>o&&o>=40?u="T":40>o&&o>=32?u="S":32>o&&o>=24?u="R":24>o&&o>=16?u="Q":16>o&&o>=8?u="P":8>o&&o>=0?u="N":0>o&&o>=-8?u="M":-8>o&&o>=-16?u="L":-16>o&&o>=-24?u="K":-24>o&&o>=-32?u="J":-32>o&&o>=-40?u="H":-40>o&&o>=-48?u="G":-48>o&&o>=-56?u="F":-56>o&&o>=-64?u="E":-64>o&&o>=-72?u="D":-72>o&&o>=-80&&(u="C"),u}function Q1(o,u){var h="00000"+o.easting,y="00000"+o.northing;return o.zoneNumber+o.zoneLetter+Uc(o.easting,o.northing,o.zoneNumber)+h.substr(h.length-5,u)+y.substr(y.length-5,u)}function Uc(o,u,h){var y=_a(h),g=Math.floor(o/1e5),_=Math.floor(u/1e5)%20;return Sa(g,_,y)}function _a(o){var u=o%ya;return u===0&&(u=ya),u}function Sa(o,u,h){var y=h-1,g=Nn.charCodeAt(y),_=Z1.charCodeAt(y),M=g+o-1,E=_+u,P=!1;M>Si&&(M=M-Si+Ir-1,P=!0),(M===nt||g<nt&&M>nt||(M>nt||g<nt)&&P)&&M++,(M===pt||g<pt&&M>pt||(M>pt||g<pt)&&P)&&(M++,M===nt&&M++),M>Si&&(M=M-Si+Ir-1),E>mt?(E=E-mt+Ir-1,P=!0):P=!1,(E===nt||_<nt&&E>nt||(E>nt||_<nt)&&P)&&E++,(E===pt||_<pt&&E>pt||(E>pt||_<pt)&&P)&&(E++,E===nt&&E++),E>mt&&(E=E-mt+Ir-1);var k=String.fromCharCode(M)+String.fromCharCode(E);return k}function Hi(o){if(o&&o.length===0)throw"MGRSPoint coverting from nothing";for(var u=o.length,h=null,y="",g,_=0;!/[A-Z]/.test(g=o.charAt(_));){if(_>=2)throw"MGRSPoint bad conversion from: "+o;y+=g,_++}var M=parseInt(y,10);if(_===0||_+3>u)throw"MGRSPoint bad conversion from: "+o;var E=o.charAt(_++);if(E<="A"||E==="B"||E==="Y"||E>="Z"||E==="I"||E==="O")throw"MGRSPoint zone letter "+E+" not handled: "+o;h=o.substring(_,_+=2);for(var P=_a(M),k=Mi(h.charAt(0),P),D=el(h.charAt(1),P);D<Ts(E);)D+=2e6;var N=u-_;if(N%2!==0)throw`MGRSPoint has to have an even number
103
+ `),Ce=Lv.bind(null,{[om]:"",[am]:a,[um]:J,[lm]:Ou,[l0]:z,[hm]:H}),Le="";p!==null&&(M===void 0?Le=Ce(p):Le=Ce(Object.assign({},p,{name:M})));let nt=h instanceof Function?h:h?pm:Qv,Bt=nt().indexOf(":")+1;if(T&&!x)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(v&&typeof v!="function")throw Error(`Unknown mixin type "${typeof v}" - expected "function"`);Pv(R,x,T);let mi=mm(x,T);return Object.assign(e,{levels:mi,[Jv]:T,[Fv]:i,[Uv]:nt,[qv]:Bt,[lm]:Ou,[l0]:z,[um]:J,[Wv]:ze,[Hv]:Se,[Gv]:d,[Vv]:m,[Yv]:m?`,${JSON.stringify(m)}:{`:"",[am]:a,[Kv]:v,[Xv]:E,[om]:Le,[hm]:H,[Zv]:P,silent:Dv}),Object.setPrototypeOf(e,Av()),Iv(e),e[$v](R),e}sr.exports=u0;sr.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=sm(t.dest||process.stdout.fd),nm(t)):nm({dest:sm(t),minLength:0,sync:!0});sr.exports.transport=Uf();sr.exports.multistream=im();sr.exports.final=Nv;sr.exports.levels=mm();sr.exports.stdSerializers=sw;sr.exports.stdTimeFunctions=Object.assign({},fm);sr.exports.symbols=dm;sr.exports.version=zv;sr.exports.default=u0;sr.exports.pino=u0});var vm=V((NA,m1)=>{"use strict";var ow=process.env.TERM_PROGRAM==="Hyper",aw=process.platform==="win32",gm=process.platform==="linux",c0={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},ym=Object.assign({},c0,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),bm=Object.assign({},c0,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",question:"?",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:gm?"\u25B8":"\u276F",pointerSmall:gm?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});m1.exports=aw&&!ow?ym:bm;Reflect.defineProperty(m1.exports,"common",{enumerable:!1,value:c0});Reflect.defineProperty(m1.exports,"windows",{enumerable:!1,value:ym});Reflect.defineProperty(m1.exports,"other",{enumerable:!1,value:bm})});var _m=V((BA,f0)=>{"use strict";var lw=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),uw=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,wm=()=>{let t={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in process.env&&(t.enabled=process.env.FORCE_COLOR!=="0");let e=o=>{let a=o.open=`\x1B[${o.codes[0]}m`,h=o.close=`\x1B[${o.codes[1]}m`,d=o.regex=new RegExp(`\\u001b\\[${o.codes[1]}m`,"g");return o.wrap=(m,p)=>{m.includes(h)&&(m=m.replace(d,h+a));let M=a+m+h;return p?M.replace(/\r*\n/g,`${h}$&${a}`):M},o},r=(o,a,h)=>typeof o=="function"?o(a):o.wrap(a,h),i=(o,a)=>{if(o===""||o==null)return"";if(t.enabled===!1)return o;if(t.visible===!1)return"";let h=""+o,d=h.includes(`
104
+ `),m=a.length;for(m>0&&a.includes("unstyle")&&(a=[...new Set(["unstyle",...a])].reverse());m-- >0;)h=r(t.styles[a[m]],h,d);return h},n=(o,a,h)=>{t.styles[o]=e({name:o,codes:a}),(t.keys[h]||(t.keys[h]=[])).push(o),Reflect.defineProperty(t,o,{configurable:!0,enumerable:!0,set(m){t.alias(o,m)},get(){let m=p=>i(p,m.stack);return Reflect.setPrototypeOf(m,t),m.stack=this.stack?this.stack.concat(o):[o],m}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=uw,t.hasColor=t.hasAnsi=o=>(t.ansiRegex.lastIndex=0,typeof o=="string"&&o!==""&&t.ansiRegex.test(o)),t.alias=(o,a)=>{let h=typeof a=="string"?t[a]:a;if(typeof h!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");h.stack||(Reflect.defineProperty(h,"name",{value:o}),t.styles[o]=h,h.stack=[o]),Reflect.defineProperty(t,o,{configurable:!0,enumerable:!0,set(d){t.alias(o,d)},get(){let d=m=>i(m,d.stack);return Reflect.setPrototypeOf(d,t),d.stack=this.stack?this.stack.concat(h.stack):h.stack,d}})},t.theme=o=>{if(!lw(o))throw new TypeError("Expected theme to be an object");for(let a of Object.keys(o))t.alias(a,o[a]);return t},t.alias("unstyle",o=>typeof o=="string"&&o!==""?(t.ansiRegex.lastIndex=0,o.replace(t.ansiRegex,"")):""),t.alias("noop",o=>o),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=vm(),t.define=n,t};f0.exports=wm();f0.exports.create=wm});var d0=V((zA,xm)=>{xm.exports=require("stream")});var Rm=V((jA,Em)=>{"use strict";function Sm(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function cw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Sm(Object(r),!0).forEach(function(i){fw(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sm(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function fw(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mm(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function mw(t,e,r){return e&&Mm(t.prototype,e),r&&Mm(t,r),t}var pw=require("buffer"),ku=pw.Buffer,gw=require("util"),m0=gw.inspect,yw=m0&&m0.custom||"inspect";function bw(t,e,r){ku.prototype.copy.call(t,e,r)}Em.exports=function(){function t(){dw(this,t),this.head=null,this.tail=null,this.length=0}return mw(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return ku.alloc(0);for(var i=ku.allocUnsafe(r>>>0),n=this.head,o=0;n;)bw(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var a=i.data,h=r>a.length?a.length:r;if(h===a.length?o+=a:o+=a.slice(0,r),r-=h,r===0){h===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(h));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(r){var i=ku.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var a=n.data,h=r>a.length?a.length:r;if(a.copy(i,i.length-r,0,h),r-=h,r===0){h===a.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(h));break}++o}return this.length-=o,i}},{key:yw,value:function(r,i){return m0(this,cw({},i,{depth:0,customInspect:!1}))}}]),t}()});var g0=V((UA,Am)=>{"use strict";function vw(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(p0,this,t)):process.nextTick(p0,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Lu,r):(r._writableState.errorEmitted=!0,process.nextTick(Cm,r,o)):process.nextTick(Cm,r,o):e?(process.nextTick(Lu,r),e(o)):process.nextTick(Lu,r)}),this)}function Cm(t,e){p0(t,e),Lu(t)}function Lu(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function ww(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function p0(t,e){t.emit("error",e)}function _w(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}Am.exports={destroy:vw,undestroy:ww,errorOrDestroy:_w}});var gn=V((qA,Im)=>{"use strict";var Pm={};function xr(t,e,r){r||(r=Error);function i(o,a,h){return typeof e=="string"?e:e(o,a,h)}class n extends r{constructor(a,h,d){super(i(a,h,d))}}n.prototype.name=r.name,n.prototype.code=t,Pm[t]=n}function Tm(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(i=>String(i)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function xw(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Sw(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Mw(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}xr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);xr("ERR_INVALID_ARG_TYPE",function(t,e,r){let i;typeof e=="string"&&xw(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(Sw(t," argument"))n=`The ${t} ${i} ${Tm(e,"type")}`;else{let o=Mw(t,".")?"property":"argument";n=`The "${t}" ${o} ${i} ${Tm(e,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);xr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");xr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});xr("ERR_STREAM_PREMATURE_CLOSE","Premature close");xr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});xr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");xr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");xr("ERR_STREAM_WRITE_AFTER_END","write after end");xr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);xr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);xr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Im.exports.codes=Pm});var y0=V((FA,Om)=>{"use strict";var Ew=gn().codes.ERR_INVALID_OPT_VALUE;function Rw(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Cw(t,e,r,i){var n=Rw(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new Ew(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}Om.exports={getHighWaterMark:Cw}});var km=V(($A,b0)=>{typeof Object.create=="function"?b0.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:b0.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var $o=V((WA,w0)=>{try{if(v0=require("util"),typeof v0.inherits!="function")throw"";w0.exports=v0.inherits}catch{w0.exports=km()}var v0});var Nm=V((HA,Lm)=>{Lm.exports=require("util").deprecate});var S0=V((GA,qm)=>{"use strict";qm.exports=rt;function Dm(t){var e=this;this.next=null,this.entry=null,this.finish=function(){e_(e,t)}}var Wo;rt.WritableState=g1;var Aw={deprecate:Nm()},zm=d0(),Bu=require("buffer").Buffer,Tw=global.Uint8Array||function(){};function Pw(t){return Bu.from(t)}function Iw(t){return Bu.isBuffer(t)||t instanceof Tw}var x0=g0(),Ow=y0(),kw=Ow.getHighWaterMark,yn=gn().codes,Lw=yn.ERR_INVALID_ARG_TYPE,Nw=yn.ERR_METHOD_NOT_IMPLEMENTED,Bw=yn.ERR_MULTIPLE_CALLBACK,Dw=yn.ERR_STREAM_CANNOT_PIPE,zw=yn.ERR_STREAM_DESTROYED,jw=yn.ERR_STREAM_NULL_VALUES,Uw=yn.ERR_STREAM_WRITE_AFTER_END,qw=yn.ERR_UNKNOWN_ENCODING,Ho=x0.errorOrDestroy;$o()(rt,zm);function Fw(){}function g1(t,e,r){Wo=Wo||fs(),t=t||{},typeof r!="boolean"&&(r=e instanceof Wo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=kw(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){Jw(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Dm(this)}g1.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(g1.prototype,"buffer",{get:Aw.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Nu;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Nu=Function.prototype[Symbol.hasInstance],Object.defineProperty(rt,Symbol.hasInstance,{value:function(e){return Nu.call(this,e)?!0:this!==rt?!1:e&&e._writableState instanceof g1}})):Nu=function(e){return e instanceof this};function rt(t){Wo=Wo||fs();var e=this instanceof Wo;if(!e&&!Nu.call(rt,this))return new rt(t);this._writableState=new g1(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),zm.call(this)}rt.prototype.pipe=function(){Ho(this,new Dw)};function $w(t,e){var r=new Uw;Ho(t,r),process.nextTick(e,r)}function Ww(t,e,r,i){var n;return r===null?n=new jw:typeof r!="string"&&!e.objectMode&&(n=new Lw("chunk",["string","Buffer"],r)),n?(Ho(t,n),process.nextTick(i,n),!1):!0}rt.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&Iw(t);return o&&!Bu.isBuffer(t)&&(t=Pw(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=Fw),i.ending?$w(this,r):(o||Ww(this,i,t,r))&&(i.pendingcb++,n=Gw(this,i,o,t,e,r)),n};rt.prototype.cork=function(){this._writableState.corked++};rt.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&jm(this,t))};rt.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new qw(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(rt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Hw(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Bu.from(e,r)),e}Object.defineProperty(rt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Gw(t,e,r,i,n,o){if(!r){var a=Hw(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var h=e.objectMode?1:i.length;e.length+=h;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var m=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},m?m.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else _0(t,e,!1,h,i,n,o);return d}function _0(t,e,r,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new zw("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function Vw(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(p1,t,e),t._writableState.errorEmitted=!0,Ho(t,i)):(n(i),t._writableState.errorEmitted=!0,Ho(t,i),p1(t,e))}function Kw(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function Jw(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new Bw;if(Kw(r),e)Vw(t,r,i,e,n);else{var o=Um(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&jm(t,r),i?process.nextTick(Bm,t,r,o,n):Bm(t,r,o,n)}}function Bm(t,e,r,i){r||Zw(t,e),e.pendingcb--,i(),p1(t,e)}function Zw(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function jm(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var a=0,h=!0;r;)n[a]=r,r.isBuf||(h=!1),r=r.next,a+=1;n.allBuffers=h,_0(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Dm(e),e.bufferedRequestCount=0}else{for(;r;){var d=r.chunk,m=r.encoding,p=r.callback,M=e.objectMode?1:d.length;if(_0(t,e,!1,M,d,m,p),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}rt.prototype._write=function(t,e,r){r(new Nw("_write()"))};rt.prototype._writev=null;rt.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||Qw(this,i,r),this};Object.defineProperty(rt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Um(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function Yw(t,e){t._final(function(r){e.pendingcb--,r&&Ho(t,r),e.prefinished=!0,t.emit("prefinish"),p1(t,e)})}function Xw(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(Yw,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function p1(t,e){var r=Um(e);if(r&&(Xw(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function Qw(t,e,r){e.ending=!0,p1(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function e_(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(rt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});rt.prototype.destroy=x0.destroy;rt.prototype._undestroy=x0.undestroy;rt.prototype._destroy=function(t,e){e(t)}});var fs=V((VA,$m)=>{"use strict";var t_=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};$m.exports=ai;var Fm=R0(),E0=S0();$o()(ai,Fm);for(M0=t_(E0.prototype),Du=0;Du<M0.length;Du++)zu=M0[Du],ai.prototype[zu]||(ai.prototype[zu]=E0.prototype[zu]);var M0,zu,Du;function ai(t){if(!(this instanceof ai))return new ai(t);Fm.call(this,t),E0.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",r_)))}Object.defineProperty(ai.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(ai.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(ai.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function r_(){this._writableState.ended||process.nextTick(i_,this)}function i_(t){t.end()}Object.defineProperty(ai.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Gm=V((C0,Hm)=>{var ju=require("buffer"),li=ju.Buffer;function Wm(t,e){for(var r in t)e[r]=t[r]}li.from&&li.alloc&&li.allocUnsafe&&li.allocUnsafeSlow?Hm.exports=ju:(Wm(ju,C0),C0.Buffer=ds);function ds(t,e,r){return li(t,e,r)}ds.prototype=Object.create(li.prototype);Wm(li,ds);ds.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return li(t,e,r)};ds.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=li(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};ds.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return li(t)};ds.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ju.SlowBuffer(t)}});var P0=V(Km=>{"use strict";var T0=Gm().Buffer,Vm=T0.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n_(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function s_(t){var e=n_(t);if(typeof e!="string"&&(T0.isEncoding===Vm||!Vm(t)))throw new Error("Unknown encoding: "+t);return e||t}Km.StringDecoder=y1;function y1(t){this.encoding=s_(t);var e;switch(this.encoding){case"utf16le":this.text=c_,this.end=f_,e=4;break;case"utf8":this.fillLast=l_,e=4;break;case"base64":this.text=d_,this.end=m_,e=3;break;default:this.write=p_,this.end=g_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=T0.allocUnsafe(e)}y1.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};y1.prototype.end=h_;y1.prototype.text=u_;y1.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function A0(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function o_(t,e,r){var i=e.length-1;if(i<r)return 0;var n=A0(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=A0(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=A0(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function a_(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function l_(t){var e=this.lastTotal-this.lastNeed,r=a_(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function u_(t,e){var r=o_(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function h_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function c_(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f_(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function d_(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function m_(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p_(t){return t.toString(this.encoding)}function g_(t){return t&&t.length?this.write(t):""}});var Uu=V((JA,Ym)=>{"use strict";var Jm=gn().codes.ERR_STREAM_PREMATURE_CLOSE;function y_(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function b_(){}function v_(t){return t.setHeader&&typeof t.abort=="function"}function Zm(t,e,r){if(typeof e=="function")return Zm(t,null,e);e||(e={}),r=y_(r||b_);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||h()},a=t._writableState&&t._writableState.finished,h=function(){n=!1,a=!0,i||r.call(t)},d=t._readableState&&t._readableState.endEmitted,m=function(){i=!1,d=!0,n||r.call(t)},p=function(v){r.call(t,v)},M=function(){var v;if(i&&!d)return(!t._readableState||!t._readableState.ended)&&(v=new Jm),r.call(t,v);if(n&&!a)return(!t._writableState||!t._writableState.ended)&&(v=new Jm),r.call(t,v)},R=function(){t.req.on("finish",h)};return v_(t)?(t.on("complete",h),t.on("abort",M),t.req?R():t.on("request",R)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",m),t.on("finish",h),e.error!==!1&&t.on("error",p),t.on("close",M),function(){t.removeListener("complete",h),t.removeListener("abort",M),t.removeListener("request",R),t.req&&t.req.removeListener("finish",h),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",h),t.removeListener("end",m),t.removeListener("error",p),t.removeListener("close",M)}}Ym.exports=Zm});var Qm=V((ZA,Xm)=>{"use strict";var qu;function bn(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var w_=Uu(),vn=Symbol("lastResolve"),ms=Symbol("lastReject"),b1=Symbol("error"),Fu=Symbol("ended"),ps=Symbol("lastPromise"),I0=Symbol("handlePromise"),gs=Symbol("stream");function wn(t,e){return{value:t,done:e}}function __(t){var e=t[vn];if(e!==null){var r=t[gs].read();r!==null&&(t[ps]=null,t[vn]=null,t[ms]=null,e(wn(r,!1)))}}function x_(t){process.nextTick(__,t)}function S_(t,e){return function(r,i){t.then(function(){if(e[Fu]){r(wn(void 0,!0));return}e[I0](r,i)},i)}}var M_=Object.getPrototypeOf(function(){}),E_=Object.setPrototypeOf((qu={get stream(){return this[gs]},next:function(){var e=this,r=this[b1];if(r!==null)return Promise.reject(r);if(this[Fu])return Promise.resolve(wn(void 0,!0));if(this[gs].destroyed)return new Promise(function(a,h){process.nextTick(function(){e[b1]?h(e[b1]):a(wn(void 0,!0))})});var i=this[ps],n;if(i)n=new Promise(S_(i,this));else{var o=this[gs].read();if(o!==null)return Promise.resolve(wn(o,!1));n=new Promise(this[I0])}return this[ps]=n,n}},bn(qu,Symbol.asyncIterator,function(){return this}),bn(qu,"return",function(){var e=this;return new Promise(function(r,i){e[gs].destroy(null,function(n){if(n){i(n);return}r(wn(void 0,!0))})})}),qu),M_),R_=function(e){var r,i=Object.create(E_,(r={},bn(r,gs,{value:e,writable:!0}),bn(r,vn,{value:null,writable:!0}),bn(r,ms,{value:null,writable:!0}),bn(r,b1,{value:null,writable:!0}),bn(r,Fu,{value:e._readableState.endEmitted,writable:!0}),bn(r,I0,{value:function(o,a){var h=i[gs].read();h?(i[ps]=null,i[vn]=null,i[ms]=null,o(wn(h,!1))):(i[vn]=o,i[ms]=a)},writable:!0}),r));return i[ps]=null,w_(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[ms];o!==null&&(i[ps]=null,i[vn]=null,i[ms]=null,o(n)),i[b1]=n;return}var a=i[vn];a!==null&&(i[ps]=null,i[vn]=null,i[ms]=null,a(wn(void 0,!0))),i[Fu]=!0}),e.on("readable",x_.bind(null,i)),i};Xm.exports=R_});var ip=V((YA,rp)=>{"use strict";function ep(t,e,r,i,n,o,a){try{var h=t[o](a),d=h.value}catch(m){r(m);return}h.done?e(d):Promise.resolve(d).then(i,n)}function C_(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function a(d){ep(o,i,n,a,h,"next",d)}function h(d){ep(o,i,n,a,h,"throw",d)}a(void 0)})}}function tp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function A_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tp(Object(r),!0).forEach(function(i){T_(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tp(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function T_(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var P_=gn().codes.ERR_INVALID_ARG_TYPE;function I_(t,e,r){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new P_("iterable",["Iterable"],e);var n=new t(A_({objectMode:!0},r)),o=!1;n._read=function(){o||(o=!0,a())};function a(){return h.apply(this,arguments)}function h(){return h=C_(function*(){try{var d=yield i.next(),m=d.value,p=d.done;p?n.push(null):n.push(yield m)?a():o=!1}catch(M){n.destroy(M)}}),h.apply(this,arguments)}return n}rp.exports=I_});var R0=V((QA,dp)=>{"use strict";dp.exports=Pe;var Go;Pe.ReadableState=ap;var XA=require("events").EventEmitter,op=function(e,r){return e.listeners(r).length},w1=d0(),$u=require("buffer").Buffer,O_=global.Uint8Array||function(){};function k_(t){return $u.from(t)}function L_(t){return $u.isBuffer(t)||t instanceof O_}var O0=require("util"),be;O0&&O0.debuglog?be=O0.debuglog("stream"):be=function(){};var N_=Rm(),j0=g0(),B_=y0(),D_=B_.getHighWaterMark,Wu=gn().codes,z_=Wu.ERR_INVALID_ARG_TYPE,j_=Wu.ERR_STREAM_PUSH_AFTER_EOF,U_=Wu.ERR_METHOD_NOT_IMPLEMENTED,q_=Wu.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Vo,k0,L0;$o()(Pe,w1);var v1=j0.errorOrDestroy,N0=["error","close","destroy","pause","resume"];function F_(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function ap(t,e,r){Go=Go||fs(),t=t||{},typeof r!="boolean"&&(r=e instanceof Go),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=D_(this,t,"readableHighWaterMark",r),this.buffer=new N_,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Vo||(Vo=P0().StringDecoder),this.decoder=new Vo(t.encoding),this.encoding=t.encoding)}function Pe(t){if(Go=Go||fs(),!(this instanceof Pe))return new Pe(t);var e=this instanceof Go;this._readableState=new ap(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),w1.call(this)}Object.defineProperty(Pe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});Pe.prototype.destroy=j0.destroy;Pe.prototype._undestroy=j0.undestroy;Pe.prototype._destroy=function(t,e){e(t)};Pe.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=$u.from(t,e),e=""),i=!0),lp(this,t,e,!1,i)};Pe.prototype.unshift=function(t){return lp(this,t,null,!0,!1)};function lp(t,e,r,i,n){be("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,H_(t,o);else{var a;if(n||(a=$_(o,e)),a)v1(t,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==$u.prototype&&(e=k_(e)),i)o.endEmitted?v1(t,new q_):B0(t,o,e,!0);else if(o.ended)v1(t,new j_);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?B0(t,o,e,!1):z0(t,o)):B0(t,o,e,!1)}else i||(o.reading=!1,z0(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function B0(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Hu(t)),z0(t,e)}function $_(t,e){var r;return!L_(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new z_("chunk",["string","Buffer","Uint8Array"],e)),r}Pe.prototype.isPaused=function(){return this._readableState.flowing===!1};Pe.prototype.setEncoding=function(t){Vo||(Vo=P0().StringDecoder);var e=new Vo(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var np=1073741824;function W_(t){return t>=np?t=np:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function sp(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=W_(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Pe.prototype.read=function(t){be("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return be("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?D0(this):Hu(this),null;if(t=sp(t,e),t===0&&e.ended)return e.length===0&&D0(this),null;var i=e.needReadable;be("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,be("length less than watermark",i)),e.ended||e.reading?(i=!1,be("reading or ended",i)):i&&(be("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=sp(r,e)));var n;return t>0?n=cp(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&D0(this)),n!==null&&this.emit("data",n),n};function H_(t,e){if(be("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Hu(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,up(t)))}}function Hu(t){var e=t._readableState;be("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(be("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(up,t))}function up(t){var e=t._readableState;be("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,U0(t)}function z0(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(G_,t,e))}function G_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(be("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}Pe.prototype._read=function(t){v1(this,new U_("_read()"))};Pe.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,be("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=n?h:E;i.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(T,C){be("onunpipe"),T===r&&C&&C.hasUnpiped===!1&&(C.hasUnpiped=!0,p())}function h(){be("onend"),t.end()}var d=V_(r);t.on("drain",d);var m=!1;function p(){be("cleanup"),t.removeListener("close",x),t.removeListener("finish",v),t.removeListener("drain",d),t.removeListener("error",R),t.removeListener("unpipe",a),r.removeListener("end",h),r.removeListener("end",E),r.removeListener("data",M),m=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&d()}r.on("data",M);function M(T){be("ondata");var C=t.write(T);be("dest.write",C),C===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&fp(i.pipes,t)!==-1)&&!m&&(be("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function R(T){be("onerror",T),E(),t.removeListener("error",R),op(t,"error")===0&&v1(t,T)}F_(t,"error",R);function x(){t.removeListener("finish",v),E()}t.once("close",x);function v(){be("onfinish"),t.removeListener("close",x),E()}t.once("finish",v);function E(){be("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(be("pipe resume"),r.resume()),t};function V_(t){return function(){var r=t._readableState;be("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&op(t,"data")&&(r.flowing=!0,U0(t))}}Pe.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=fp(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Pe.prototype.on=function(t,e){var r=w1.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,be("on readable",i.length,i.reading),i.length?Hu(this):i.reading||process.nextTick(K_,this)),r};Pe.prototype.addListener=Pe.prototype.on;Pe.prototype.removeListener=function(t,e){var r=w1.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(hp,this),r};Pe.prototype.removeAllListeners=function(t){var e=w1.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(hp,this),e};function hp(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function K_(t){be("readable nexttick read 0"),t.read(0)}Pe.prototype.resume=function(){var t=this._readableState;return t.flowing||(be("resume"),t.flowing=!t.readableListening,J_(this,t)),t.paused=!1,this};function J_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(Z_,t,e))}function Z_(t,e){be("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U0(t),e.flowing&&!e.reading&&t.read(0)}Pe.prototype.pause=function(){return be("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(be("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function U0(t){var e=t._readableState;for(be("flow",e.flowing);e.flowing&&t.read()!==null;);}Pe.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(be("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),t.on("data",function(a){if(be("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var h=e.push(a);h||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(h){return function(){return t[h].apply(t,arguments)}}(n));for(var o=0;o<N0.length;o++)t.on(N0[o],this.emit.bind(this,N0[o]));return this._read=function(a){be("wrapped _read",a),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(Pe.prototype[Symbol.asyncIterator]=function(){return k0===void 0&&(k0=Qm()),k0(this)});Object.defineProperty(Pe.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Pe.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Pe.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Pe._fromList=cp;Object.defineProperty(Pe.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function cp(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function D0(t){var e=t._readableState;be("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(Y_,e,t))}function Y_(t,e){if(be("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Pe.from=function(t,e){return L0===void 0&&(L0=ip()),L0(Pe,t,e)});function fp(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var q0=V((eT,pp)=>{"use strict";pp.exports=ji;var Gu=gn().codes,X_=Gu.ERR_METHOD_NOT_IMPLEMENTED,Q_=Gu.ERR_MULTIPLE_CALLBACK,ex=Gu.ERR_TRANSFORM_ALREADY_TRANSFORMING,tx=Gu.ERR_TRANSFORM_WITH_LENGTH_0,Vu=fs();$o()(ji,Vu);function rx(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new Q_);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function ji(t){if(!(this instanceof ji))return new ji(t);Vu.call(this,t),this._transformState={afterTransform:rx.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",ix)}function ix(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){mp(t,e,r)}):mp(this,null,null)}ji.prototype.push=function(t,e){return this._transformState.needTransform=!1,Vu.prototype.push.call(this,t,e)};ji.prototype._transform=function(t,e,r){r(new X_("_transform()"))};ji.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};ji.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};ji.prototype._destroy=function(t,e){Vu.prototype._destroy.call(this,t,function(r){e(r)})};function mp(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new tx;if(t._transformState.transforming)throw new ex;return t.push(null)}});var bp=V((tT,yp)=>{"use strict";yp.exports=_1;var gp=q0();$o()(_1,gp);function _1(t){if(!(this instanceof _1))return new _1(t);gp.call(this,t)}_1.prototype._transform=function(t,e,r){r(null,t)}});var Sp=V((rT,xp)=>{"use strict";var F0;function nx(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var _p=gn().codes,sx=_p.ERR_MISSING_ARGS,ox=_p.ERR_STREAM_DESTROYED;function vp(t){if(t)throw t}function ax(t){return t.setHeader&&typeof t.abort=="function"}function lx(t,e,r,i){i=nx(i);var n=!1;t.on("close",function(){n=!0}),F0===void 0&&(F0=Uu()),F0(t,{readable:e,writable:r},function(a){if(a)return i(a);n=!0,i()});var o=!1;return function(a){if(!n&&!o){if(o=!0,ax(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(a||new ox("pipe"))}}}function wp(t){t()}function ux(t,e){return t.pipe(e)}function hx(t){return!t.length||typeof t[t.length-1]!="function"?vp:t.pop()}function cx(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=hx(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new sx("streams");var n,o=e.map(function(a,h){var d=h<e.length-1,m=h>0;return lx(a,d,m,function(p){n||(n=p),p&&o.forEach(wp),!d&&(o.forEach(wp),i(n))})});return e.reduce(ux)}xp.exports=cx});var Mp=V((Sr,S1)=>{var x1=require("stream");process.env.READABLE_STREAM==="disable"&&x1?(S1.exports=x1.Readable,Object.assign(S1.exports,x1),S1.exports.Stream=x1):(Sr=S1.exports=R0(),Sr.Stream=x1||Sr,Sr.Readable=Sr,Sr.Writable=S0(),Sr.Duplex=fs(),Sr.Transform=q0(),Sr.PassThrough=bp(),Sr.finished=Uu(),Sr.pipeline=Sp())});var Ap=V((iT,Cp)=>{"use strict";var{Transform:fx}=Mp(),{StringDecoder:dx}=require("string_decoder"),_n=Symbol("last"),Ku=Symbol("decoder");function mx(t,e,r){var i;if(this.overflow){var n=this[Ku].write(t);if(i=n.split(this.matcher),i.length===1)return r();i.shift(),this.overflow=!1}else this[_n]+=this[Ku].write(t),i=this[_n].split(this.matcher);this[_n]=i.pop();for(var o=0;o<i.length;o++)Rp(this,this.mapper(i[o]));if(this.overflow=this[_n].length>this.maxLength,this.overflow&&!this.skipOverflow)return r(new Error("maximum buffer reached"));r()}function px(t){this[_n]+=this[Ku].end(),this[_n]&&Rp(this,this.mapper(this[_n])),t()}function Rp(t,e){e!==void 0&&t.push(e)}function Ep(t){return t}function gx(t,e,r){switch(t=t||/\r?\n/,e=e||Ep,r=r||{},arguments.length){case 1:typeof t=="function"?(e=t,t=/\r?\n/):typeof t=="object"&&!(t instanceof RegExp)&&(r=t,t=/\r?\n/);break;case 2:typeof t=="function"?(r=e,e=t,t=/\r?\n/):typeof e=="object"&&(r=e,e=Ep)}r=Object.assign({},r),r.transform=mx,r.flush=px,r.readableObjectMode=!0;let i=new fx(r);return i[_n]="",i[Ku]=new dx("utf8"),i.matcher=t,i.mapper=e,i.maxLength=r.maxLength,i.skipOverflow=r.skipOverflow,i.overflow=!1,i}Cp.exports=gx});var Zp=V((eP,Jp)=>{"use strict";Jp.exports=eh;eh.polyline=eh;eh.polygon=Ax;function eh(t,e,r){var i=t.length,n=Yo(t[0],e),o=[],a,h,d,m,p;for(r||(r=[]),a=1;a<i;a++){for(h=t[a-1],d=t[a],m=p=Yo(d,e);;)if(n|m){if(n&m)break;n?(h=Y0(h,d,n,e),n=Yo(h,e)):(d=Y0(h,d,m,e),m=Yo(d,e))}else{o.push(h),m!==p?(o.push(d),a<i-1&&(r.push(o),o=[])):a===i-1&&o.push(d);break}n=p}return o.length&&r.push(o),r}function Ax(t,e){var r,i,n,o,a,h,d;for(i=1;i<=8;i*=2){for(r=[],n=t[t.length-1],o=!(Yo(n,e)&i),a=0;a<t.length;a++)h=t[a],d=!(Yo(h,e)&i),d!==o&&r.push(Y0(n,h,i,e)),d&&r.push(h),n=h,o=d;if(t=r,!t.length)break}return r}function Y0(t,e,r,i){return r&8?[t[0]+(e[0]-t[0])*(i[3]-t[1])/(e[1]-t[1]),i[3]]:r&4?[t[0]+(e[0]-t[0])*(i[1]-t[1])/(e[1]-t[1]),i[1]]:r&2?[i[2],t[1]+(e[1]-t[1])*(i[2]-t[0])/(e[0]-t[0])]:r&1?[i[0],t[1]+(e[1]-t[1])*(i[0]-t[0])/(e[0]-t[0])]:null}function Yo(t,e){var r=0;return t[0]<e[0]?r|=1:t[0]>e[2]&&(r|=2),t[1]<e[1]?r|=4:t[1]>e[3]&&(r|=8),r}});var Yp=V((X0,Q0)=>{(function(t,e){typeof X0=="object"&&typeof Q0<"u"?Q0.exports=e():typeof define=="function"&&define.amd?define(e):t.SplayTree=e()})(X0,function(){"use strict";var t=function(){function v(E,T){this.next=null,this.key=E,this.data=T,this.left=null,this.right=null}return v}();function e(v,E){return v>E?1:v<E?-1:0}function r(v,E,T){for(var C=new t(null,null),P=C,k=C;;){var B=T(v,E.key);if(B<0){if(E.left===null)break;if(T(v,E.left.key)<0){var z=E.left;if(E.left=z.right,z.right=E,E=z,E.left===null)break}k.left=E,k=E,E=E.left}else if(B>0){if(E.right===null)break;if(T(v,E.right.key)>0){var z=E.right;if(E.right=z.left,z.left=E,E=z,E.right===null)break}P.right=E,P=E,E=E.right}else break}return P.right=E.left,k.left=E.right,E.left=C.right,E.right=C.left,E}function i(v,E,T,C){var P=new t(v,E);if(T===null)return P.left=P.right=null,P;T=r(v,T,C);var k=C(v,T.key);return k<0?(P.left=T.left,P.right=T,T.left=null):k>=0&&(P.right=T.right,P.left=T,T.right=null),P}function n(v,E,T){var C=null,P=null;if(E){E=r(v,E,T);var k=T(E.key,v);k===0?(C=E.left,P=E.right):k<0?(P=E.right,E.right=null,C=E):(C=E.left,E.left=null,P=E)}return{left:C,right:P}}function o(v,E,T){return E===null?v:(v===null||(E=r(v.key,E,T),E.left=v),E)}function a(v,E,T,C,P){if(v){C(""+E+(T?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+P(v)+`
105
+ `);var k=E+(T?" ":"\u2502 ");v.left&&a(v.left,k,!1,C,P),v.right&&a(v.right,k,!0,C,P)}}var h=function(){function v(E){E===void 0&&(E=e),this._root=null,this._size=0,this._comparator=E}return v.prototype.insert=function(E,T){return this._size++,this._root=i(E,T,this._root,this._comparator)},v.prototype.add=function(E,T){var C=new t(E,T);this._root===null&&(C.left=C.right=null,this._size++,this._root=C);var P=this._comparator,k=r(E,this._root,P),B=P(E,k.key);return B===0?this._root=k:(B<0?(C.left=k.left,C.right=k,k.left=null):B>0&&(C.right=k.right,C.left=k,k.right=null),this._size++,this._root=C),this._root},v.prototype.remove=function(E){this._root=this._remove(E,this._root,this._comparator)},v.prototype._remove=function(E,T,C){var P;if(T===null)return null;T=r(E,T,C);var k=C(E,T.key);return k===0?(T.left===null?P=T.right:(P=r(E,T.left,C),P.right=T.right),this._size--,P):T},v.prototype.pop=function(){var E=this._root;if(E){for(;E.left;)E=E.left;return this._root=r(E.key,this._root,this._comparator),this._root=this._remove(E.key,this._root,this._comparator),{key:E.key,data:E.data}}return null},v.prototype.findStatic=function(E){for(var T=this._root,C=this._comparator;T;){var P=C(E,T.key);if(P===0)return T;P<0?T=T.left:T=T.right}return null},v.prototype.find=function(E){return this._root&&(this._root=r(E,this._root,this._comparator),this._comparator(E,this._root.key)!==0)?null:this._root},v.prototype.contains=function(E){for(var T=this._root,C=this._comparator;T;){var P=C(E,T.key);if(P===0)return!0;P<0?T=T.left:T=T.right}return!1},v.prototype.forEach=function(E,T){for(var C=this._root,P=[],k=!1;!k;)C!==null?(P.push(C),C=C.left):P.length!==0?(C=P.pop(),E.call(T,C),C=C.right):k=!0;return this},v.prototype.range=function(E,T,C,P){for(var k=[],B=this._comparator,z=this._root,H;k.length!==0||z;)if(z)k.push(z),z=z.left;else{if(z=k.pop(),H=B(z.key,T),H>0)break;if(B(z.key,E)>=0&&C.call(P,z))return this;z=z.right}return this},v.prototype.keys=function(){var E=[];return this.forEach(function(T){var C=T.key;return E.push(C)}),E},v.prototype.values=function(){var E=[];return this.forEach(function(T){var C=T.data;return E.push(C)}),E},v.prototype.min=function(){return this._root?this.minNode(this._root).key:null},v.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},v.prototype.minNode=function(E){if(E===void 0&&(E=this._root),E)for(;E.left;)E=E.left;return E},v.prototype.maxNode=function(E){if(E===void 0&&(E=this._root),E)for(;E.right;)E=E.right;return E},v.prototype.at=function(E){for(var T=this._root,C=!1,P=0,k=[];!C;)if(T)k.push(T),T=T.left;else if(k.length>0){if(T=k.pop(),P===E)return T;P++,T=T.right}else C=!0;return null},v.prototype.next=function(E){var T=this._root,C=null;if(E.right){for(C=E.right;C.left;)C=C.left;return C}for(var P=this._comparator;T;){var k=P(E.key,T.key);if(k===0)break;k<0?(C=T,T=T.left):T=T.right}return C},v.prototype.prev=function(E){var T=this._root,C=null;if(E.left!==null){for(C=E.left;C.right;)C=C.right;return C}for(var P=this._comparator;T;){var k=P(E.key,T.key);if(k===0)break;k<0?T=T.left:(C=T,T=T.right)}return C},v.prototype.clear=function(){return this._root=null,this._size=0,this},v.prototype.toList=function(){return p(this._root)},v.prototype.load=function(E,T,C){T===void 0&&(T=[]),C===void 0&&(C=!1);var P=E.length,k=this._comparator;if(C&&x(E,T,0,P-1,k),this._root===null)this._root=d(E,T,0,P),this._size=P;else{var B=R(this.toList(),m(E,T),k);P=this._size+P,this._root=M({head:B},0,P)}return this},v.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(v.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),v.prototype.toString=function(E){E===void 0&&(E=function(C){return String(C.key)});var T=[];return a(this._root,"",!0,function(C){return T.push(C)},E),T.join("")},v.prototype.update=function(E,T,C){var P=this._comparator,k=n(E,this._root,P),B=k.left,z=k.right;P(E,T)<0?z=i(T,C,z,P):B=i(T,C,B,P),this._root=o(B,z,P)},v.prototype.split=function(E){return n(E,this._root,this._comparator)},v}();function d(v,E,T,C){var P=C-T;if(P>0){var k=T+Math.floor(P/2),B=v[k],z=E[k],H=new t(B,z);return H.left=d(v,E,T,k),H.right=d(v,E,k+1,C),H}return null}function m(v,E){for(var T=new t(null,null),C=T,P=0;P<v.length;P++)C=C.next=new t(v[P],E[P]);return C.next=null,T.next}function p(v){for(var E=v,T=[],C=!1,P=new t(null,null),k=P;!C;)E?(T.push(E),E=E.left):T.length>0?(E=k=k.next=T.pop(),E=E.right):C=!0;return k.next=null,P.next}function M(v,E,T){var C=T-E;if(C>0){var P=E+Math.floor(C/2),k=M(v,E,P),B=v.head;return B.left=k,v.head=v.head.next,B.right=M(v,P+1,T),B}return null}function R(v,E,T){for(var C=new t(null,null),P=C,k=v,B=E;k!==null&&B!==null;)T(k.key,B.key)<0?(P.next=k,k=k.next):(P.next=B,B=B.next),P=P.next;return k!==null?P.next=k:B!==null&&(P.next=B),C.next}function x(v,E,T,C,P){if(!(T>=C)){for(var k=v[T+C>>1],B=T-1,z=C+1;;){do B++;while(P(v[B],k)<0);do z--;while(P(v[z],k)>0);if(B>=z)break;var H=v[B];v[B]=v[z],v[z]=H,H=E[B],E[B]=E[z],E[z]=H}x(v,E,T,z,P),x(v,E,z+1,C,P)}}return h})});var u6=V((tP,l6)=>{"use strict";var Tx=Yp();function Px(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var rd=Px(Tx);function Mr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xp(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ot(t,e,r){return e&&Xp(t.prototype,e),r&&Xp(t,r),t}var R1=function(e,r){return e.ll.x<=r.x&&r.x<=e.ur.x&&e.ll.y<=r.y&&r.y<=e.ur.y},ed=function(e,r){if(r.ur.x<e.ll.x||e.ur.x<r.ll.x||r.ur.y<e.ll.y||e.ur.y<r.ll.y)return null;var i=e.ll.x<r.ll.x?r.ll.x:e.ll.x,n=e.ur.x<r.ur.x?e.ur.x:r.ur.x,o=e.ll.y<r.ll.y?r.ll.y:e.ll.y,a=e.ur.y<r.ur.y?e.ur.y:r.ur.y;return{ll:{x:i,y:o},ur:{x:n,y:a}}},Sn=Number.EPSILON;Sn===void 0&&(Sn=Math.pow(2,-52));var Ix=Sn*Sn,td=function(e,r){if(-Sn<e&&e<Sn&&-Sn<r&&r<Sn)return 0;var i=e-r;return i*i<Ix*e*r?0:e<r?-1:1},Ox=function(){function t(){Mr(this,t),this.reset()}return Ot(t,[{key:"reset",value:function(){this.xRounder=new Qp,this.yRounder=new Qp}},{key:"round",value:function(r,i){return{x:this.xRounder.round(r),y:this.yRounder.round(i)}}}]),t}(),Qp=function(){function t(){Mr(this,t),this.tree=new rd.default,this.round(0)}return Ot(t,[{key:"round",value:function(r){var i=this.tree.add(r),n=this.tree.prev(i);if(n!==null&&td(i.key,n.key)===0)return this.tree.remove(r),n.key;var o=this.tree.next(i);return o!==null&&td(i.key,o.key)===0?(this.tree.remove(r),o.key):r}}]),t}(),A1=new Ox,C1=function(e,r){return e.x*r.y-e.y*r.x},a6=function(e,r){return e.x*r.x+e.y*r.y},e6=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},o={x:i.x-e.x,y:i.y-e.y},a=C1(n,o);return td(a,0)},th=function(e){return Math.sqrt(a6(e,e))},kx=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},o={x:i.x-e.x,y:i.y-e.y};return C1(o,n)/th(o)/th(n)},Lx=function(e,r,i){var n={x:r.x-e.x,y:r.y-e.y},o={x:i.x-e.x,y:i.y-e.y};return a6(o,n)/th(o)/th(n)},t6=function(e,r,i){return r.y===0?null:{x:e.x+r.x/r.y*(i-e.y),y:i}},r6=function(e,r,i){return r.x===0?null:{x:i,y:e.y+r.y/r.x*(i-e.x)}},Nx=function(e,r,i,n){if(r.x===0)return r6(i,n,e.x);if(n.x===0)return r6(e,r,i.x);if(r.y===0)return t6(i,n,e.y);if(n.y===0)return t6(e,r,i.y);var o=C1(r,n);if(o==0)return null;var a={x:i.x-e.x,y:i.y-e.y},h=C1(a,r)/o,d=C1(a,n)/o,m=e.x+d*r.x,p=i.x+h*n.x,M=e.y+d*r.y,R=i.y+h*n.y,x=(m+p)/2,v=(M+R)/2;return{x,y:v}},hi=function(){Ot(t,null,[{key:"compare",value:function(r,i){var n=t.comparePoints(r.point,i.point);return n!==0?n:(r.point!==i.point&&r.link(i),r.isLeft!==i.isLeft?r.isLeft?1:-1:rh.compare(r.segment,i.segment))}},{key:"comparePoints",value:function(r,i){return r.x<i.x?-1:r.x>i.x?1:r.y<i.y?-1:r.y>i.y?1:0}}]);function t(e,r){Mr(this,t),e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=r}return Ot(t,[{key:"link",value:function(r){if(r.point===this.point)throw new Error("Tried to link already linked events");for(var i=r.point.events,n=0,o=i.length;n<o;n++){var a=i[n];this.point.events.push(a),a.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var r=this.point.events.length,i=0;i<r;i++){var n=this.point.events[i];if(n.segment.consumedBy===void 0)for(var o=i+1;o<r;o++){var a=this.point.events[o];a.consumedBy===void 0&&n.otherSE.point.events===a.otherSE.point.events&&n.segment.consume(a.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var r=[],i=0,n=this.point.events.length;i<n;i++){var o=this.point.events[i];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&r.push(o)}return r}},{key:"getLeftmostComparator",value:function(r){var i=this,n=new Map,o=function(h){var d=h.otherSE;n.set(h,{sine:kx(i.point,r.point,d.point),cosine:Lx(i.point,r.point,d.point)})};return function(a,h){n.has(a)||o(a),n.has(h)||o(h);var d=n.get(a),m=d.sine,p=d.cosine,M=n.get(h),R=M.sine,x=M.cosine;return m>=0&&R>=0?p<x?1:p>x?-1:0:m<0&&R<0?p<x?-1:p>x?1:0:R<m?-1:R>m?1:0}}}]),t}(),Bx=0,rh=function(){Ot(t,null,[{key:"compare",value:function(r,i){var n=r.leftSE.point.x,o=i.leftSE.point.x,a=r.rightSE.point.x,h=i.rightSE.point.x;if(h<n)return 1;if(a<o)return-1;var d=r.leftSE.point.y,m=i.leftSE.point.y,p=r.rightSE.point.y,M=i.rightSE.point.y;if(n<o){if(m<d&&m<p)return 1;if(m>d&&m>p)return-1;var R=r.comparePoint(i.leftSE.point);if(R<0)return 1;if(R>0)return-1;var x=i.comparePoint(r.rightSE.point);return x!==0?x:-1}if(n>o){if(d<m&&d<M)return-1;if(d>m&&d>M)return 1;var v=i.comparePoint(r.leftSE.point);if(v!==0)return v;var E=r.comparePoint(i.rightSE.point);return E<0?1:E>0?-1:1}if(d<m)return-1;if(d>m)return 1;if(a<h){var T=i.comparePoint(r.rightSE.point);if(T!==0)return T}if(a>h){var C=r.comparePoint(i.rightSE.point);if(C<0)return 1;if(C>0)return-1}if(a!==h){var P=p-d,k=a-n,B=M-m,z=h-o;if(P>k&&B<z)return 1;if(P<k&&B>z)return-1}return a>h?1:a<h||p<M?-1:p>M?1:r.id<i.id?-1:r.id>i.id?1:0}}]);function t(e,r,i,n){Mr(this,t),this.id=++Bx,this.leftSE=e,e.segment=this,e.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=e,this.rings=i,this.windings=n}return Ot(t,[{key:"replaceRightSE",value:function(r){this.rightSE=r,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var r=this.leftSE.point.y,i=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:r<i?r:i},ur:{x:this.rightSE.point.x,y:r>i?r:i}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(r){return r.x===this.leftSE.point.x&&r.y===this.leftSE.point.y||r.x===this.rightSE.point.x&&r.y===this.rightSE.point.y}},{key:"comparePoint",value:function(r){if(this.isAnEndpoint(r))return 0;var i=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(i.x===n.x)return r.x===i.x?0:r.x<i.x?1:-1;var a=(r.y-i.y)/o.y,h=i.x+a*o.x;if(r.x===h)return 0;var d=(r.x-i.x)/o.x,m=i.y+d*o.y;return r.y===m?0:r.y<m?-1:1}},{key:"getIntersection",value:function(r){var i=this.bbox(),n=r.bbox(),o=ed(i,n);if(o===null)return null;var a=this.leftSE.point,h=this.rightSE.point,d=r.leftSE.point,m=r.rightSE.point,p=R1(i,d)&&this.comparePoint(d)===0,M=R1(n,a)&&r.comparePoint(a)===0,R=R1(i,m)&&this.comparePoint(m)===0,x=R1(n,h)&&r.comparePoint(h)===0;if(M&&p)return x&&!R?h:!x&&R?m:null;if(M)return R&&a.x===m.x&&a.y===m.y?null:a;if(p)return x&&h.x===d.x&&h.y===d.y?null:d;if(x&&R)return null;if(x)return h;if(R)return m;var v=Nx(a,this.vector(),d,r.vector());return v===null||!R1(o,v)?null:A1.round(v.x,v.y)}},{key:"split",value:function(r){var i=[],n=r.events!==void 0,o=new hi(r,!0),a=new hi(r,!1),h=this.rightSE;this.replaceRightSE(a),i.push(a),i.push(o);var d=new t(o,h,this.rings.slice(),this.windings.slice());return hi.comparePoints(d.leftSE.point,d.rightSE.point)>0&&d.swapEvents(),hi.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),a.checkForConsuming()),i}},{key:"swapEvents",value:function(){var r=this.rightSE;this.rightSE=this.leftSE,this.leftSE=r,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var i=0,n=this.windings.length;i<n;i++)this.windings[i]*=-1}},{key:"consume",value:function(r){for(var i=this,n=r;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var o=t.compare(i,n);if(o!==0){if(o>0){var a=i;i=n,n=a}if(i.prev===n){var h=i;i=n,n=h}for(var d=0,m=n.rings.length;d<m;d++){var p=n.rings[d],M=n.windings[d],R=i.rings.indexOf(p);R===-1?(i.rings.push(p),i.windings.push(M)):i.windings[R]+=M}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}},{key:"beforeState",value:function(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var r=this.prev.consumedBy||this.prev;this._beforeState=r.afterState()}return this._beforeState}},{key:"afterState",value:function(){if(this._afterState!==void 0)return this._afterState;var r=this.beforeState();this._afterState={rings:r.rings.slice(0),windings:r.windings.slice(0),multiPolys:[]};for(var i=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys,a=0,h=this.rings.length;a<h;a++){var d=this.rings[a],m=this.windings[a],p=i.indexOf(d);p===-1?(i.push(d),n.push(m)):n[p]+=m}for(var M=[],R=[],x=0,v=i.length;x<v;x++)if(n[x]!==0){var E=i[x],T=E.poly;if(R.indexOf(T)===-1)if(E.isExterior)M.push(T);else{R.indexOf(T)===-1&&R.push(T);var C=M.indexOf(E.poly);C!==-1&&M.splice(C,1)}}for(var P=0,k=M.length;P<k;P++){var B=M[P].multiPoly;o.indexOf(B)===-1&&o.push(B)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;var r=this.beforeState().multiPolys,i=this.afterState().multiPolys;switch(jr.type){case"union":{var n=r.length===0,o=i.length===0;this._isInResult=n!==o;break}case"intersection":{var a,h;r.length<i.length?(a=r.length,h=i.length):(a=i.length,h=r.length),this._isInResult=h===jr.numMultiPolys&&a<h;break}case"xor":{var d=Math.abs(r.length-i.length);this._isInResult=d%2===1;break}case"difference":{var m=function(M){return M.length===1&&M[0].isSubject};this._isInResult=m(r)!==m(i);break}default:throw new Error("Unrecognized operation type found ".concat(jr.type))}return this._isInResult}}],[{key:"fromRing",value:function(r,i,n){var o,a,h,d=hi.comparePoints(r,i);if(d<0)o=r,a=i,h=1;else if(d>0)o=i,a=r,h=-1;else throw new Error("Tried to create degenerate segment at [".concat(r.x,", ").concat(r.y,"]"));var m=new hi(o,!0),p=new hi(a,!1);return new t(m,p,[n],[h])}}]),t}(),i6=function(){function t(e,r,i){if(Mr(this,t),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=r,this.isExterior=i,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=A1.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var o=n,a=1,h=e.length;a<h;a++){if(typeof e[a][0]!="number"||typeof e[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var d=A1.round(e[a][0],e[a][1]);d.x===o.x&&d.y===o.y||(this.segments.push(rh.fromRing(o,d,this)),d.x<this.bbox.ll.x&&(this.bbox.ll.x=d.x),d.y<this.bbox.ll.y&&(this.bbox.ll.y=d.y),d.x>this.bbox.ur.x&&(this.bbox.ur.x=d.x),d.y>this.bbox.ur.y&&(this.bbox.ur.y=d.y),o=d)}(n.x!==o.x||n.y!==o.y)&&this.segments.push(rh.fromRing(o,n,this))}return Ot(t,[{key:"getSweepEvents",value:function(){for(var r=[],i=0,n=this.segments.length;i<n;i++){var o=this.segments[i];r.push(o.leftSE),r.push(o.rightSE)}return r}}]),t}(),Dx=function(){function t(e,r){if(Mr(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new i6(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,n=e.length;i<n;i++){var o=new i6(e[i],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=r}return Ot(t,[{key:"getSweepEvents",value:function(){for(var r=this.exteriorRing.getSweepEvents(),i=0,n=this.interiorRings.length;i<n;i++)for(var o=this.interiorRings[i].getSweepEvents(),a=0,h=o.length;a<h;a++)r.push(o[a]);return r}}]),t}(),n6=function(){function t(e,r){if(Mr(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,n=e.length;i<n;i++){var o=new Dx(e[i],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=r}return Ot(t,[{key:"getSweepEvents",value:function(){for(var r=[],i=0,n=this.polys.length;i<n;i++)for(var o=this.polys[i].getSweepEvents(),a=0,h=o.length;a<h;a++)r.push(o[a]);return r}}]),t}(),zx=function(){Ot(t,null,[{key:"factory",value:function(r){for(var i=[],n=0,o=r.length;n<o;n++){var a=r[n];if(!(!a.isInResult()||a.ringOut)){for(var h=null,d=a.leftSE,m=a.rightSE,p=[d],M=d.point,R=[];h=d,d=m,p.push(d),d.point!==M;)for(;;){var x=d.getAvailableLinkedEvents();if(x.length===0){var v=p[0].point,E=p[p.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(v.x,",")+" ".concat(v.y,"]. Last matching segment found ends at")+" [".concat(E.x,", ").concat(E.y,"]."))}if(x.length===1){m=x[0].otherSE;break}for(var T=null,C=0,P=R.length;C<P;C++)if(R[C].point===d.point){T=C;break}if(T!==null){var k=R.splice(T)[0],B=p.splice(k.index);B.unshift(B[0].otherSE),i.push(new t(B.reverse()));continue}R.push({index:p.length,point:d.point});var z=d.getLeftmostComparator(h);m=x.sort(z)[0].otherSE;break}i.push(new t(p))}}return i}}]);function t(e){Mr(this,t),this.events=e;for(var r=0,i=e.length;r<i;r++)e[r].segment.ringOut=this;this.poly=null}return Ot(t,[{key:"getGeom",value:function(){for(var r=this.events[0].point,i=[r],n=1,o=this.events.length-1;n<o;n++){var a=this.events[n].point,h=this.events[n+1].point;e6(a,r,h)!==0&&(i.push(a),r=a)}if(i.length===1)return null;var d=i[0],m=i[1];e6(d,r,m)===0&&i.shift(),i.push(i[0]);for(var p=this.isExteriorRing()?1:-1,M=this.isExteriorRing()?0:i.length-1,R=this.isExteriorRing()?i.length:-1,x=[],v=M;v!=R;v+=p)x.push([i[v].x,i[v].y]);return x}},{key:"isExteriorRing",value:function(){if(this._isExteriorRing===void 0){var r=this.enclosingRing();this._isExteriorRing=r?!r.isExteriorRing():!0}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var r=this.events[0],i=1,n=this.events.length;i<n;i++){var o=this.events[i];hi.compare(r,o)>0&&(r=o)}for(var a=r.segment.prevInResult(),h=a?a.prevInResult():null;;){if(!a)return null;if(!h)return a.ringOut;if(h.ringOut!==a.ringOut)return h.ringOut.enclosingRing()!==a.ringOut?a.ringOut:a.ringOut.enclosingRing();a=h.prevInResult(),h=a?a.prevInResult():null}}}]),t}(),s6=function(){function t(e){Mr(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return Ot(t,[{key:"addInterior",value:function(r){this.interiorRings.push(r),r.poly=this}},{key:"getGeom",value:function(){var r=[this.exteriorRing.getGeom()];if(r[0]===null)return null;for(var i=0,n=this.interiorRings.length;i<n;i++){var o=this.interiorRings[i].getGeom();o!==null&&r.push(o)}return r}}]),t}(),jx=function(){function t(e){Mr(this,t),this.rings=e,this.polys=this._composePolys(e)}return Ot(t,[{key:"getGeom",value:function(){for(var r=[],i=0,n=this.polys.length;i<n;i++){var o=this.polys[i].getGeom();o!==null&&r.push(o)}return r}},{key:"_composePolys",value:function(r){for(var i=[],n=0,o=r.length;n<o;n++){var a=r[n];if(!a.poly)if(a.isExteriorRing())i.push(new s6(a));else{var h=a.enclosingRing();h.poly||i.push(new s6(h)),h.poly.addInterior(a)}}return i}}]),t}(),Ux=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rh.compare;Mr(this,t),this.queue=e,this.tree=new rd.default(r),this.segments=[]}return Ot(t,[{key:"process",value:function(r){var i=r.segment,n=[];if(r.consumedBy)return r.isLeft?this.queue.remove(r.otherSE):this.tree.remove(i),n;var o=r.isLeft?this.tree.insert(i):this.tree.find(i);if(!o)throw new Error("Unable to find segment #".concat(i.id," ")+"[".concat(i.leftSE.point.x,", ").concat(i.leftSE.point.y,"] -> ")+"[".concat(i.rightSE.point.x,", ").concat(i.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var a=o,h=o,d=void 0,m=void 0;d===void 0;)a=this.tree.prev(a),a===null?d=null:a.key.consumedBy===void 0&&(d=a.key);for(;m===void 0;)h=this.tree.next(h),h===null?m=null:h.key.consumedBy===void 0&&(m=h.key);if(r.isLeft){var p=null;if(d){var M=d.getIntersection(i);if(M!==null&&(i.isAnEndpoint(M)||(p=M),!d.isAnEndpoint(M)))for(var R=this._splitSafely(d,M),x=0,v=R.length;x<v;x++)n.push(R[x])}var E=null;if(m){var T=m.getIntersection(i);if(T!==null&&(i.isAnEndpoint(T)||(E=T),!m.isAnEndpoint(T)))for(var C=this._splitSafely(m,T),P=0,k=C.length;P<k;P++)n.push(C[P])}if(p!==null||E!==null){var B=null;if(p===null)B=E;else if(E===null)B=p;else{var z=hi.comparePoints(p,E);B=z<=0?p:E}this.queue.remove(i.rightSE),n.push(i.rightSE);for(var H=i.split(B),J=0,ne=H.length;J<ne;J++)n.push(H[J])}n.length>0?(this.tree.remove(i),n.push(r)):(this.segments.push(i),i.prev=d)}else{if(d&&m){var Se=d.getIntersection(m);if(Se!==null){if(!d.isAnEndpoint(Se))for(var ze=this._splitSafely(d,Se),Ce=0,Le=ze.length;Ce<Le;Ce++)n.push(ze[Ce]);if(!m.isAnEndpoint(Se))for(var nt=this._splitSafely(m,Se),Bt=0,mi=nt.length;Bt<mi;Bt++)n.push(nt[Bt])}}this.tree.remove(i)}return n}},{key:"_splitSafely",value:function(r,i){this.tree.remove(r);var n=r.rightSE;this.queue.remove(n);var o=r.split(i);return o.push(n),r.consumedBy===void 0&&this.tree.insert(r),o}}]),t}(),o6=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,qx=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Fx=function(){function t(){Mr(this,t)}return Ot(t,[{key:"run",value:function(r,i,n){jr.type=r,A1.reset();for(var o=[new n6(i,!0)],a=0,h=n.length;a<h;a++)o.push(new n6(n[a],!1));if(jr.numMultiPolys=o.length,jr.type==="difference")for(var d=o[0],m=1;m<o.length;)ed(o[m].bbox,d.bbox)!==null?m++:o.splice(m,1);if(jr.type==="intersection"){for(var p=0,M=o.length;p<M;p++)for(var R=o[p],x=p+1,v=o.length;x<v;x++)if(ed(R.bbox,o[x].bbox)===null)return[]}for(var E=new rd.default(hi.compare),T=0,C=o.length;T<C;T++)for(var P=o[T].getSweepEvents(),k=0,B=P.length;k<B;k++)if(E.insert(P[k]),E.size>o6)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var z=new Ux(E),H=E.size,J=E.pop();J;){var ne=J.key;if(E.size===H){var Se=ne.segment;throw new Error("Unable to pop() ".concat(ne.isLeft?"left":"right"," SweepEvent ")+"[".concat(ne.point.x,", ").concat(ne.point.y,"] from segment #").concat(Se.id," ")+"[".concat(Se.leftSE.point.x,", ").concat(Se.leftSE.point.y,"] -> ")+"[".concat(Se.rightSE.point.x,", ").concat(Se.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(E.size>o6)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(z.segments.length>qx)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var ze=z.process(ne),Ce=0,Le=ze.length;Ce<Le;Ce++){var nt=ze[Ce];nt.consumedBy===void 0&&E.insert(nt)}H=E.size,J=E.pop()}A1.reset();var Bt=zx.factory(z.segments),mi=new jx(Bt);return mi.getGeom()}}]),t}(),jr=new Fx,$x=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return jr.run("union",e,i)},Wx=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return jr.run("intersection",e,i)},Hx=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return jr.run("xor",e,i)},Gx=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return jr.run("difference",e,i)},Vx={union:$x,intersection:Wx,xor:Hx,difference:Gx};l6.exports=Vx});var g6=V((nd,sd)=>{(function(t,e){typeof nd=="object"&&typeof sd<"u"?sd.exports=e():typeof define=="function"&&define.amd?define(e):t.proj4=e()})(nd,function(){"use strict";var t=function(s){s("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),s("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),s("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),s.WGS84=s["EPSG:4326"],s["EPSG:3785"]=s["EPSG:3857"],s.GOOGLE=s["EPSG:3857"],s["EPSG:900913"]=s["EPSG:3857"],s["EPSG:102113"]=s["EPSG:3857"]},e=1,r=2,i=3,n=4,o=5,a=6378137,h=6356752314e-3,d=.0066943799901413165,m=484813681109536e-20,p=Math.PI/2,M=.16666666666666666,R=.04722222222222222,x=.022156084656084655,v=1e-10,E=.017453292519943295,T=57.29577951308232,C=Math.PI/4,P=Math.PI*2,k=3.14159265359,B={};B.greenwich=0,B.lisbon=-9.131906111111,B.paris=2.337229166667,B.bogota=-74.080916666667,B.madrid=-3.687938888889,B.rome=12.452333333333,B.bern=7.439583333333,B.jakarta=106.807719444444,B.ferro=-17.666666666667,B.brussels=4.367975,B.stockholm=18.058277777778,B.athens=23.7163375,B.oslo=10.722916666667;var z={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},H=/[\s_\-\/\(\)]/g;function J(s,l){if(s[l])return s[l];for(var c=Object.keys(s),y=l.toLowerCase().replace(H,""),g=-1,w,S;++g<c.length;)if(w=c[g],S=w.toLowerCase().replace(H,""),S===y)return s[w]}var ne=function(s){var l={},c=s.split("+").map(function(b){return b.trim()}).filter(function(b){return b}).reduce(function(b,A){var O=A.split("=");return O.push(!0),b[O[0].toLowerCase()]=O[1],b},{}),y,g,w,S={proj:"projName",datum:"datumCode",rf:function(b){l.rf=parseFloat(b)},lat_0:function(b){l.lat0=b*E},lat_1:function(b){l.lat1=b*E},lat_2:function(b){l.lat2=b*E},lat_ts:function(b){l.lat_ts=b*E},lon_0:function(b){l.long0=b*E},lon_1:function(b){l.long1=b*E},lon_2:function(b){l.long2=b*E},alpha:function(b){l.alpha=parseFloat(b)*E},gamma:function(b){l.rectified_grid_angle=parseFloat(b)},lonc:function(b){l.longc=b*E},x_0:function(b){l.x0=parseFloat(b)},y_0:function(b){l.y0=parseFloat(b)},k_0:function(b){l.k0=parseFloat(b)},k:function(b){l.k0=parseFloat(b)},a:function(b){l.a=parseFloat(b)},b:function(b){l.b=parseFloat(b)},r_a:function(){l.R_A=!0},zone:function(b){l.zone=parseInt(b,10)},south:function(){l.utmSouth=!0},towgs84:function(b){l.datum_params=b.split(",").map(function(A){return parseFloat(A)})},to_meter:function(b){l.to_meter=parseFloat(b)},units:function(b){l.units=b;var A=J(z,b);A&&(l.to_meter=A.to_meter)},from_greenwich:function(b){l.from_greenwich=b*E},pm:function(b){var A=J(B,b);l.from_greenwich=(A||parseFloat(b))*E},nadgrids:function(b){b==="@null"?l.datumCode="none":l.nadgrids=b},axis:function(b){var A="ewnsud";b.length===3&&A.indexOf(b.substr(0,1))!==-1&&A.indexOf(b.substr(1,1))!==-1&&A.indexOf(b.substr(2,1))!==-1&&(l.axis=b)},approx:function(){l.approx=!0}};for(y in c)g=c[y],y in S?(w=S[y],typeof w=="function"?w(g):l[w]=g):l[y]=g;return typeof l.datumCode=="string"&&l.datumCode!=="WGS84"&&(l.datumCode=l.datumCode.toLowerCase()),l},Se=1,ze=2,Ce=3,Le=4,nt=5,Bt=-1,mi=/\s/,ga=/[A-Za-z]/,Wh=/[A-Za-z84]/,On=/[,\]]/,ya=/[\d\.E\-\+]/;function cr(s){if(typeof s!="string")throw new Error("not a string");this.text=s.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Se}cr.prototype.readCharicter=function(){var s=this.text[this.place++];if(this.state!==Le)for(;mi.test(s);){if(this.place>=this.text.length)return;s=this.text[this.place++]}switch(this.state){case Se:return this.neutral(s);case ze:return this.keyword(s);case Le:return this.quoted(s);case nt:return this.afterquote(s);case Ce:return this.number(s);case Bt:return}},cr.prototype.afterquote=function(s){if(s==='"'){this.word+='"',this.state=Le;return}if(On.test(s)){this.word=this.word.trim(),this.afterItem(s);return}throw new Error(`havn't handled "`+s+'" in afterquote yet, index '+this.place)},cr.prototype.afterItem=function(s){if(s===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Se;return}if(s==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Se,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Bt);return}},cr.prototype.number=function(s){if(ya.test(s)){this.word+=s;return}if(On.test(s)){this.word=parseFloat(this.word),this.afterItem(s);return}throw new Error(`havn't handled "`+s+'" in number yet, index '+this.place)},cr.prototype.quoted=function(s){if(s==='"'){this.state=nt;return}this.word+=s},cr.prototype.keyword=function(s){if(Wh.test(s)){this.word+=s;return}if(s==="["){var l=[];l.push(this.word),this.level++,this.root===null?this.root=l:this.currentObject.push(l),this.stack.push(this.currentObject),this.currentObject=l,this.state=Se;return}if(On.test(s)){this.afterItem(s);return}throw new Error(`havn't handled "`+s+'" in keyword yet, index '+this.place)},cr.prototype.neutral=function(s){if(ga.test(s)){this.word=s,this.state=ze;return}if(s==='"'){this.word="",this.state=Le;return}if(ya.test(s)){this.word=s,this.state=Ce;return}if(On.test(s)){this.afterItem(s);return}throw new Error(`havn't handled "`+s+'" in neutral yet, index '+this.place)},cr.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Bt)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function ba(s){var l=new cr(s);return l.output()}function Ps(s,l,c){Array.isArray(l)&&(c.unshift(l),l=null);var y=l?{}:s,g=c.reduce(function(w,S){return pi(S,w),w},y);l&&(s[l]=g)}function pi(s,l){if(!Array.isArray(s)){l[s]=!0;return}var c=s.shift();if(c==="PARAMETER"&&(c=s.shift()),s.length===1){if(Array.isArray(s[0])){l[c]={},pi(s[0],l[c]);return}l[c]=s[0];return}if(!s.length){l[c]=!0;return}if(c==="TOWGS84"){l[c]=s;return}if(c==="AXIS"){c in l||(l[c]=[]),l[c].push(s);return}Array.isArray(c)||(l[c]={});var y;switch(c){case"UNIT":case"PRIMEM":case"VERT_DATUM":l[c]={name:s[0].toLowerCase(),convert:s[1]},s.length===3&&pi(s[2],l[c]);return;case"SPHEROID":case"ELLIPSOID":l[c]={name:s[0],a:s[1],rf:s[2]},s.length===4&&pi(s[3],l[c]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":s[0]=["name",s[0]],Ps(l,c,s);return;default:for(y=-1;++y<s.length;)if(!Array.isArray(s[y]))return pi(s,l[c]);return Ps(l,c,s)}}var Hh=.017453292519943295;function Gh(s,l){var c=l[0],y=l[1];!(c in s)&&y in s&&(s[c]=s[y],l.length===3&&(s[c]=l[2](s[c])))}function at(s){return s*Hh}function Yt(s){if(s.type==="GEOGCS"?s.projName="longlat":s.type==="LOCAL_CS"?(s.projName="identity",s.local=!0):typeof s.PROJECTION=="object"?s.projName=Object.keys(s.PROJECTION)[0]:s.projName=s.PROJECTION,s.AXIS){for(var l="",c=0,y=s.AXIS.length;c<y;++c){var g=[s.AXIS[c][0].toLowerCase(),s.AXIS[c][1].toLowerCase()];g[0].indexOf("north")!==-1||(g[0]==="y"||g[0]==="lat")&&g[1]==="north"?l+="n":g[0].indexOf("south")!==-1||(g[0]==="y"||g[0]==="lat")&&g[1]==="south"?l+="s":g[0].indexOf("east")!==-1||(g[0]==="x"||g[0]==="lon")&&g[1]==="east"?l+="e":(g[0].indexOf("west")!==-1||(g[0]==="x"||g[0]==="lon")&&g[1]==="west")&&(l+="w")}l.length===2&&(l+="u"),l.length===3&&(s.axis=l)}s.UNIT&&(s.units=s.UNIT.name.toLowerCase(),s.units==="metre"&&(s.units="meter"),s.UNIT.convert&&(s.type==="GEOGCS"?s.DATUM&&s.DATUM.SPHEROID&&(s.to_meter=s.UNIT.convert*s.DATUM.SPHEROID.a):s.to_meter=s.UNIT.convert));var w=s.GEOGCS;s.type==="GEOGCS"&&(w=s),w&&(w.DATUM?s.datumCode=w.DATUM.name.toLowerCase():s.datumCode=w.name.toLowerCase(),s.datumCode.slice(0,2)==="d_"&&(s.datumCode=s.datumCode.slice(2)),(s.datumCode==="new_zealand_geodetic_datum_1949"||s.datumCode==="new_zealand_1949")&&(s.datumCode="nzgd49"),(s.datumCode==="wgs_1984"||s.datumCode==="world_geodetic_system_1984")&&(s.PROJECTION==="Mercator_Auxiliary_Sphere"&&(s.sphere=!0),s.datumCode="wgs84"),s.datumCode.slice(-6)==="_ferro"&&(s.datumCode=s.datumCode.slice(0,-6)),s.datumCode.slice(-8)==="_jakarta"&&(s.datumCode=s.datumCode.slice(0,-8)),~s.datumCode.indexOf("belge")&&(s.datumCode="rnb72"),w.DATUM&&w.DATUM.SPHEROID&&(s.ellps=w.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),s.ellps.toLowerCase().slice(0,13)==="international"&&(s.ellps="intl"),s.a=w.DATUM.SPHEROID.a,s.rf=parseFloat(w.DATUM.SPHEROID.rf,10)),w.DATUM&&w.DATUM.TOWGS84&&(s.datum_params=w.DATUM.TOWGS84),~s.datumCode.indexOf("osgb_1936")&&(s.datumCode="osgb36"),~s.datumCode.indexOf("osni_1952")&&(s.datumCode="osni52"),(~s.datumCode.indexOf("tm65")||~s.datumCode.indexOf("geodetic_datum_of_1965"))&&(s.datumCode="ire65"),s.datumCode==="ch1903+"&&(s.datumCode="ch1903"),~s.datumCode.indexOf("israel")&&(s.datumCode="isr93")),s.b&&!isFinite(s.b)&&(s.b=s.a);function S(O){var D=s.to_meter||1;return O*D}var b=function(O){return Gh(s,O)},A=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",at],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",at],["x0","false_easting",S],["y0","false_northing",S],["long0","central_meridian",at],["lat0","latitude_of_origin",at],["lat0","standard_parallel_1",at],["lat1","standard_parallel_1",at],["lat2","standard_parallel_2",at],["azimuth","Azimuth"],["alpha","azimuth",at],["srsCode","name"]];A.forEach(b),!s.long0&&s.longc&&(s.projName==="Albers_Conic_Equal_Area"||s.projName==="Lambert_Azimuthal_Equal_Area")&&(s.long0=s.longc),!s.lat_ts&&s.lat1&&(s.projName==="Stereographic_South_Pole"||s.projName==="Polar Stereographic (variant B)")&&(s.lat0=at(s.lat1>0?90:-90),s.lat_ts=s.lat1)}var H1=function(s){var l=ba(s),c=l.shift(),y=l.shift();l.unshift(["name",y]),l.unshift(["type",c]);var g={};return pi(l,g),Yt(g),g};function ct(s){var l=this;if(arguments.length===2){var c=arguments[1];typeof c=="string"?c.charAt(0)==="+"?ct[s]=ne(arguments[1]):ct[s]=H1(arguments[1]):ct[s]=c}else if(arguments.length===1){if(Array.isArray(s))return s.map(function(y){Array.isArray(y)?ct.apply(l,y):ct(y)});if(typeof s=="string"){if(s in ct)return ct[s]}else"EPSG"in s?ct["EPSG:"+s.EPSG]=s:"ESRI"in s?ct["ESRI:"+s.ESRI]=s:"IAU2000"in s?ct["IAU2000:"+s.IAU2000]=s:console.log(s);return}}t(ct);function Tr(s){return typeof s=="string"}function va(s){return s in ct}var wa=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function G1(s){return wa.some(function(l){return s.indexOf(l)>-1})}var Vh=["3857","900913","3785","102113"];function V1(s){var l=J(s,"authority");if(!!l){var c=J(l,"epsg");return c&&Vh.indexOf(c)>-1}}function _a(s){var l=J(s,"extension");if(!!l)return J(l,"proj4")}function qi(s){return s[0]==="+"}function K1(s){if(Tr(s)){if(va(s))return ct[s];if(G1(s)){var l=H1(s);if(V1(l))return ct["EPSG:3857"];var c=_a(l);return c?ne(c):l}if(qi(s))return ne(s)}else return s}var Is=function(s,l){s=s||{};var c,y;if(!l)return s;for(y in l)c=l[y],c!==void 0&&(s[y]=c);return s},Rt=function(s,l,c){var y=s*l;return c/Math.sqrt(1-y*y)},Fi=function(s){return s<0?-1:1},Z=function(s){return Math.abs(s)<=k?s:s-Fi(s)*P},st=function(s,l,c){var y=s*c,g=.5*s;return y=Math.pow((1-y)/(1+y),g),Math.tan(.5*(p-l))/y},Pr=function(s,l){for(var c=.5*s,y,g,w=p-2*Math.atan(l),S=0;S<=15;S++)if(y=s*Math.sin(w),g=p-2*Math.atan(l*Math.pow((1-y)/(1+y),c))-w,w+=g,Math.abs(g)<=1e-10)return w;return-9999};function Os(){var s=this.b/this.a;this.es=1-s*s,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Rt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function J1(s){var l=s.x,c=s.y;if(c*T>90&&c*T<-90&&l*T>180&&l*T<-180)return null;var y,g;if(Math.abs(Math.abs(c)-p)<=v)return null;if(this.sphere)y=this.x0+this.a*this.k0*Z(l-this.long0),g=this.y0+this.a*this.k0*Math.log(Math.tan(C+.5*c));else{var w=Math.sin(c),S=st(this.e,c,w);y=this.x0+this.a*this.k0*Z(l-this.long0),g=this.y0-this.a*this.k0*Math.log(S)}return s.x=y,s.y=g,s}function Z1(s){var l=s.x-this.x0,c=s.y-this.y0,y,g;if(this.sphere)g=p-2*Math.atan(Math.exp(-c/(this.a*this.k0)));else{var w=Math.exp(-c/(this.a*this.k0));if(g=Pr(this.e,w),g===-9999)return null}return y=Z(this.long0+l/(this.a*this.k0)),s.x=y,s.y=g,s}var Y1=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],Kh={init:Os,forward:J1,inverse:Z1,names:Y1};function X1(){}function xa(s){return s}var Q1=["longlat","identity"],kn={init:X1,forward:xa,inverse:xa,names:Q1},el=[Kh,kn],Sa={},gi=[];function Ma(s,l){var c=gi.length;return s.names?(gi[c]=s,s.names.forEach(function(y){Sa[y.toLowerCase()]=c}),this):(console.log(l),!0)}function Jh(s){if(!s)return!1;var l=s.toLowerCase();if(typeof Sa[l]<"u"&&gi[Sa[l]])return gi[Sa[l]]}function tl(){el.forEach(Ma)}var Ea={start:tl,add:Ma,get:Jh},le={};le.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},le.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},le.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},le.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},le.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},le.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},le.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},le.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},le.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},le.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},le.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},le.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},le.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},le.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},le.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},le.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},le.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},le.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},le.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},le.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},le.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},le.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},le.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},le.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},le.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},le.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},le.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},le.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},le.hough={a:6378270,rf:297,ellipseName:"Hough"},le.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},le.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},le.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},le.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},le.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},le.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},le.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},le.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},le.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},le.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},le.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},le.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Zh=le.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};le.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Wr(s,l,c,y){var g=s*s,w=l*l,S=(g-w)/g,b=0;y?(s*=1-S*(M+S*(R+S*x)),g=s*s,S=0):b=Math.sqrt(S);var A=(g-w)/w;return{es:S,e:b,ep2:A}}function Ln(s,l,c,y,g){if(!s){var w=J(le,y);w||(w=Zh),s=w.a,l=w.b,c=w.rf}return c&&!l&&(l=(1-1/c)*s),(c===0||Math.abs(s-l)<v)&&(g=!0,l=s),{a:s,b:l,rf:c,sphere:g}}var Ve={};Ve.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Ve.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Ve.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Ve.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Ve.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Ve.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Ve.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Ve.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Ve.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Ve.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Ve.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Ve.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Ve.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Ve.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Ve.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Ve.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Ve.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function yi(s,l,c,y,g,w,S){var b={};return s===void 0||s==="none"?b.datum_type=o:b.datum_type=n,l&&(b.datum_params=l.map(parseFloat),(b.datum_params[0]!==0||b.datum_params[1]!==0||b.datum_params[2]!==0)&&(b.datum_type=e),b.datum_params.length>3&&(b.datum_params[3]!==0||b.datum_params[4]!==0||b.datum_params[5]!==0||b.datum_params[6]!==0)&&(b.datum_type=r,b.datum_params[3]*=m,b.datum_params[4]*=m,b.datum_params[5]*=m,b.datum_params[6]=b.datum_params[6]/1e6+1)),S&&(b.datum_type=i,b.grids=S),b.a=c,b.b=y,b.es=g,b.ep2=w,b}var ks={};function bi(s,l){var c=new DataView(l),y=Ls(c),g=il(c,y);g.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var w=nl(c,g,y),S={header:g,subgrids:w};return ks[s]=S,S}function rl(s){if(s===void 0)return null;var l=s.split(",");return l.map(Ra)}function Ra(s){if(s.length===0)return null;var l=s[0]==="@";return l&&(s=s.slice(1)),s==="null"?{name:"null",mandatory:!l,grid:null,isNull:!0}:{name:s,mandatory:!l,grid:ks[s]||null,isNull:!1}}function vi(s){return s/3600*Math.PI/180}function Ls(s){var l=s.getInt32(8,!1);return l===11?!1:(l=s.getInt32(8,!0),l!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function il(s,l){return{nFields:s.getInt32(8,l),nSubgridFields:s.getInt32(24,l),nSubgrids:s.getInt32(40,l),shiftType:Ns(s,56,56+8).trim(),fromSemiMajorAxis:s.getFloat64(120,l),fromSemiMinorAxis:s.getFloat64(136,l),toSemiMajorAxis:s.getFloat64(152,l),toSemiMinorAxis:s.getFloat64(168,l)}}function Ns(s,l,c){return String.fromCharCode.apply(null,new Uint8Array(s.buffer.slice(l,c)))}function nl(s,l,c){for(var y=176,g=[],w=0;w<l.nSubgrids;w++){var S=sl(s,y,c),b=Yh(s,y,S,c),A=Math.round(1+(S.upperLongitude-S.lowerLongitude)/S.longitudeInterval),O=Math.round(1+(S.upperLatitude-S.lowerLatitude)/S.latitudeInterval);g.push({ll:[vi(S.lowerLongitude),vi(S.lowerLatitude)],del:[vi(S.longitudeInterval),vi(S.latitudeInterval)],lim:[A,O],count:S.gridNodeCount,cvs:Ca(b)})}return g}function Ca(s){return s.map(function(l){return[vi(l.longitudeShift),vi(l.latitudeShift)]})}function sl(s,l,c){return{name:Ns(s,l+8,l+16).trim(),parent:Ns(s,l+24,l+24+8).trim(),lowerLatitude:s.getFloat64(l+72,c),upperLatitude:s.getFloat64(l+88,c),lowerLongitude:s.getFloat64(l+104,c),upperLongitude:s.getFloat64(l+120,c),latitudeInterval:s.getFloat64(l+136,c),longitudeInterval:s.getFloat64(l+152,c),gridNodeCount:s.getInt32(l+168,c)}}function Yh(s,l,c,y){for(var g=l+176,w=16,S=[],b=0;b<c.gridNodeCount;b++){var A={latitudeShift:s.getFloat32(g+b*w,y),longitudeShift:s.getFloat32(g+b*w+4,y),latitudeAccuracy:s.getFloat32(g+b*w+8,y),longitudeAccuracy:s.getFloat32(g+b*w+12,y)};S.push(A)}return S}function fr(s,l){if(!(this instanceof fr))return new fr(s);l=l||function(O){if(O)throw O};var c=K1(s);if(typeof c!="object"){l(s);return}var y=fr.projections.get(c.projName);if(!y){l(s);return}if(c.datumCode&&c.datumCode!=="none"){var g=J(Ve,c.datumCode);g&&(c.datum_params=c.datum_params||(g.towgs84?g.towgs84.split(","):null),c.ellps=g.ellipse,c.datumName=g.datumName?g.datumName:c.datumCode)}c.k0=c.k0||1,c.axis=c.axis||"enu",c.ellps=c.ellps||"wgs84",c.lat1=c.lat1||c.lat0;var w=Ln(c.a,c.b,c.rf,c.ellps,c.sphere),S=Wr(w.a,w.b,w.rf,c.R_A),b=rl(c.nadgrids),A=c.datum||yi(c.datumCode,c.datum_params,w.a,w.b,S.es,S.ep2,b);Is(this,c),Is(this,y),this.a=w.a,this.b=w.b,this.rf=w.rf,this.sphere=w.sphere,this.es=S.es,this.e=S.e,this.ep2=S.ep2,this.datum=A,this.init(),l(null,this)}fr.projections=Ea,fr.projections.start();function Xh(s,l){return s.datum_type!==l.datum_type||s.a!==l.a||Math.abs(s.es-l.es)>5e-11?!1:s.datum_type===e?s.datum_params[0]===l.datum_params[0]&&s.datum_params[1]===l.datum_params[1]&&s.datum_params[2]===l.datum_params[2]:s.datum_type===r?s.datum_params[0]===l.datum_params[0]&&s.datum_params[1]===l.datum_params[1]&&s.datum_params[2]===l.datum_params[2]&&s.datum_params[3]===l.datum_params[3]&&s.datum_params[4]===l.datum_params[4]&&s.datum_params[5]===l.datum_params[5]&&s.datum_params[6]===l.datum_params[6]:!0}function Aa(s,l,c){var y=s.x,g=s.y,w=s.z?s.z:0,S,b,A,O;if(g<-p&&g>-1.001*p)g=-p;else if(g>p&&g<1.001*p)g=p;else{if(g<-p)return{x:-1/0,y:-1/0,z:s.z};if(g>p)return{x:1/0,y:1/0,z:s.z}}return y>Math.PI&&(y-=2*Math.PI),b=Math.sin(g),O=Math.cos(g),A=b*b,S=c/Math.sqrt(1-l*A),{x:(S+w)*O*Math.cos(y),y:(S+w)*O*Math.sin(y),z:(S*(1-l)+w)*b}}function Nn(s,l,c,y){var g=1e-12,w=g*g,S=30,b,A,O,D,L,j,W,$,G,K,re,ue,ge,$e=s.x,Oe=s.y,Be=s.z?s.z:0,wt,tt,Qr;if(b=Math.sqrt($e*$e+Oe*Oe),A=Math.sqrt($e*$e+Oe*Oe+Be*Be),b/c<g){if(wt=0,A/c<g)return tt=p,Qr=-y,{x:s.x,y:s.y,z:s.z}}else wt=Math.atan2(Oe,$e);O=Be/A,D=b/A,L=1/Math.sqrt(1-l*(2-l)*D*D),$=D*(1-l)*L,G=O*L,ge=0;do ge++,W=c/Math.sqrt(1-l*G*G),Qr=b*$+Be*G-W*(1-l*G*G),j=l*W/(W+Qr),L=1/Math.sqrt(1-j*(2-j)*D*D),K=D*(1-j)*L,re=O*L,ue=re*$-K*G,$=K,G=re;while(ue*ue>w&&ge<S);return tt=Math.atan(re/Math.abs(K)),{x:wt,y:tt,z:Qr}}function Qh(s,l,c){if(l===e)return{x:s.x+c[0],y:s.y+c[1],z:s.z+c[2]};if(l===r){var y=c[0],g=c[1],w=c[2],S=c[3],b=c[4],A=c[5],O=c[6];return{x:O*(s.x-A*s.y+b*s.z)+y,y:O*(A*s.x+s.y-S*s.z)+g,z:O*(-b*s.x+S*s.y+s.z)+w}}}function Bs(s,l,c){if(l===e)return{x:s.x-c[0],y:s.y-c[1],z:s.z-c[2]};if(l===r){var y=c[0],g=c[1],w=c[2],S=c[3],b=c[4],A=c[5],O=c[6],D=(s.x-y)/O,L=(s.y-g)/O,j=(s.z-w)/O;return{x:D+A*L-b*j,y:-A*D+L+S*j,z:b*D-S*L+j}}}function Hr(s){return s===e||s===r}var Ds=function(s,l,c){if(Xh(s,l)||s.datum_type===o||l.datum_type===o)return c;var y=s.a,g=s.es;if(s.datum_type===i){var w=Dt(s,!1,c);if(w!==0)return;y=a,g=d}var S=l.a,b=l.b,A=l.es;if(l.datum_type===i&&(S=a,b=h,A=d),g===A&&y===S&&!Hr(s.datum_type)&&!Hr(l.datum_type))return c;if(c=Aa(c,g,y),Hr(s.datum_type)&&(c=Qh(c,s.datum_type,s.datum_params)),Hr(l.datum_type)&&(c=Bs(c,l.datum_type,l.datum_params)),c=Nn(c,A,S,b),l.datum_type===i){var O=Dt(l,!0,c);if(O!==0)return}return c};function Dt(s,l,c){if(s.grids===null||s.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var y={x:-c.x,y:c.y},g={x:Number.NaN,y:Number.NaN},w=[],S=0;S<s.grids.length;S++){var b=s.grids[S];if(w.push(b.name),b.isNull){g=y;break}if(b.grid===null){if(b.mandatory)return console.log("Unable to find mandatory grid '"+b.name+"'"),-1;continue}var A=b.grid.subgrids[0],O=(Math.abs(A.del[1])+Math.abs(A.del[0]))/1e4,D=A.ll[0]-O,L=A.ll[1]-O,j=A.ll[0]+(A.lim[0]-1)*A.del[0]+O,W=A.ll[1]+(A.lim[1]-1)*A.del[1]+O;if(!(L>y.y||D>y.x||W<y.y||j<y.x)&&(g=Ta(y,l,A),!isNaN(g.x)))break}return isNaN(g.x)?(console.log("Failed to find a grid shift table for location '"+-y.x*T+" "+y.y*T+" tried: '"+w+"'"),-1):(c.x=-g.x,c.y=g.y,0)}function Ta(s,l,c){var y={x:Number.NaN,y:Number.NaN};if(isNaN(s.x))return y;var g={x:s.x,y:s.y};g.x-=c.ll[0],g.y-=c.ll[1],g.x=Z(g.x-Math.PI)+Math.PI;var w=Pa(g,c);if(l){if(isNaN(w.x))return y;w.x=g.x-w.x,w.y=g.y-w.y;var S=9,b=1e-12,A,O;do{if(O=Pa(w,c),isNaN(O.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}A={x:g.x-(O.x+w.x),y:g.y-(O.y+w.y)},w.x+=A.x,w.y+=A.y}while(S--&&Math.abs(A.x)>b&&Math.abs(A.y)>b);if(S<0)return console.log("Inverse grid shift iterator failed to converge."),y;y.x=Z(w.x+c.ll[0]),y.y=w.y+c.ll[1]}else isNaN(w.x)||(y.x=s.x+w.x,y.y=s.y+w.y);return y}function Pa(s,l){var c={x:s.x/l.del[0],y:s.y/l.del[1]},y={x:Math.floor(c.x),y:Math.floor(c.y)},g={x:c.x-1*y.x,y:c.y-1*y.y},w={x:Number.NaN,y:Number.NaN},S;if(y.x<0||y.x>=l.lim[0]||y.y<0||y.y>=l.lim[1])return w;S=y.y*l.lim[0]+y.x;var b={x:l.cvs[S][0],y:l.cvs[S][1]};S++;var A={x:l.cvs[S][0],y:l.cvs[S][1]};S+=l.lim[0];var O={x:l.cvs[S][0],y:l.cvs[S][1]};S--;var D={x:l.cvs[S][0],y:l.cvs[S][1]},L=g.x*g.y,j=g.x*(1-g.y),W=(1-g.x)*(1-g.y),$=(1-g.x)*g.y;return w.x=W*b.x+j*A.x+$*D.x+L*O.x,w.y=W*b.y+j*A.y+$*D.y+L*O.y,w}var Bn=function(s,l,c){var y=c.x,g=c.y,w=c.z||0,S,b,A,O={};for(A=0;A<3;A++)if(!(l&&A===2&&c.z===void 0))switch(A===0?(S=y,"ew".indexOf(s.axis[A])!==-1?b="x":b="y"):A===1?(S=g,"ns".indexOf(s.axis[A])!==-1?b="y":b="x"):(S=w,b="z"),s.axis[A]){case"e":O[b]=S;break;case"w":O[b]=-S;break;case"n":O[b]=S;break;case"s":O[b]=-S;break;case"u":c[b]!==void 0&&(O.z=S);break;case"d":c[b]!==void 0&&(O.z=-S);break;default:return null}return O},Dn=function(s){var l={x:s[0],y:s[1]};return s.length>2&&(l.z=s[2]),s.length>3&&(l.m=s[3]),l},ol=function(s){al(s.x),al(s.y)};function al(s){if(typeof Number.isFinite=="function"){if(Number.isFinite(s))return;throw new TypeError("coordinates must be finite numbers")}if(typeof s!="number"||s!==s||!isFinite(s))throw new TypeError("coordinates must be finite numbers")}function ec(s,l){return(s.datum.datum_type===e||s.datum.datum_type===r)&&l.datumCode!=="WGS84"||(l.datum.datum_type===e||l.datum.datum_type===r)&&s.datumCode!=="WGS84"}function $i(s,l,c,y){var g;if(Array.isArray(c)&&(c=Dn(c)),ol(c),s.datum&&l.datum&&ec(s,l)&&(g=new fr("WGS84"),c=$i(s,g,c,y),s=g),y&&s.axis!=="enu"&&(c=Bn(s,!1,c)),s.projName==="longlat")c={x:c.x*E,y:c.y*E,z:c.z||0};else if(s.to_meter&&(c={x:c.x*s.to_meter,y:c.y*s.to_meter,z:c.z||0}),c=s.inverse(c),!c)return;if(s.from_greenwich&&(c.x+=s.from_greenwich),c=Ds(s.datum,l.datum,c),!!c)return l.from_greenwich&&(c={x:c.x-l.from_greenwich,y:c.y,z:c.z||0}),l.projName==="longlat"?c={x:c.x*T,y:c.y*T,z:c.z||0}:(c=l.forward(c),l.to_meter&&(c={x:c.x/l.to_meter,y:c.y/l.to_meter,z:c.z||0})),y&&l.axis!=="enu"?Bn(l,!0,c):c}var Wi=fr("WGS84");function zs(s,l,c,y){var g,w,S;return Array.isArray(c)?(g=$i(s,l,c,y)||{x:NaN,y:NaN},c.length>2?typeof s.name<"u"&&s.name==="geocent"||typeof l.name<"u"&&l.name==="geocent"?typeof g.z=="number"?[g.x,g.y,g.z].concat(c.splice(3)):[g.x,g.y,c[2]].concat(c.splice(3)):[g.x,g.y].concat(c.splice(2)):[g.x,g.y]):(w=$i(s,l,c,y),S=Object.keys(c),S.length===2||S.forEach(function(b){if(typeof s.name<"u"&&s.name==="geocent"||typeof l.name<"u"&&l.name==="geocent"){if(b==="x"||b==="y"||b==="z")return}else if(b==="x"||b==="y")return;w[b]=c[b]}),w)}function Ia(s){return s instanceof fr?s:s.oProj?s.oProj:fr(s)}function Ct(s,l,c){s=Ia(s);var y=!1,g;return typeof l>"u"?(l=s,s=Wi,y=!0):(typeof l.x<"u"||Array.isArray(l))&&(c=l,l=s,s=Wi,y=!0),l=Ia(l),c?zs(s,l,c):(g={forward:function(w,S){return zs(s,l,w,S)},inverse:function(w,S){return zs(l,s,w,S)}},y&&(g.oProj=l),g)}var Oa=6,js="AJSAJS",Hi="AFAFAF",zt=65,dt=73,mt=79,Ir=86,Gr=90,Us={forward:ll,inverse:tc,toPoint:ul};function ll(s,l){return l=l||5,nc(rc({lat:s[1],lon:s[0]}),l)}function tc(s){var l=qs(fl(s.toUpperCase()));return l.lat&&l.lon?[l.lon,l.lat,l.lon,l.lat]:[l.left,l.bottom,l.right,l.top]}function ul(s){var l=qs(fl(s.toUpperCase()));return l.lat&&l.lon?[l.lon,l.lat]:[(l.left+l.right)/2,(l.top+l.bottom)/2]}function ka(s){return s*(Math.PI/180)}function hl(s){return 180*(s/Math.PI)}function rc(s){var l=s.lat,c=s.lon,y=6378137,g=.00669438,w=.9996,S,b,A,O,D,L,j,W=ka(l),$=ka(c),G,K;K=Math.floor((c+180)/6)+1,c===180&&(K=60),l>=56&&l<64&&c>=3&&c<12&&(K=32),l>=72&&l<84&&(c>=0&&c<9?K=31:c>=9&&c<21?K=33:c>=21&&c<33?K=35:c>=33&&c<42&&(K=37)),S=(K-1)*6-180+3,G=ka(S),b=g/(1-g),A=y/Math.sqrt(1-g*Math.sin(W)*Math.sin(W)),O=Math.tan(W)*Math.tan(W),D=b*Math.cos(W)*Math.cos(W),L=Math.cos(W)*($-G),j=y*((1-g/4-3*g*g/64-5*g*g*g/256)*W-(3*g/8+3*g*g/32+45*g*g*g/1024)*Math.sin(2*W)+(15*g*g/256+45*g*g*g/1024)*Math.sin(4*W)-35*g*g*g/3072*Math.sin(6*W));var re=w*A*(L+(1-O+D)*L*L*L/6+(5-18*O+O*O+72*D-58*b)*L*L*L*L*L/120)+5e5,ue=w*(j+A*Math.tan(W)*(L*L/2+(5-O+9*D+4*D*D)*L*L*L*L/24+(61-58*O+O*O+600*D-330*b)*L*L*L*L*L*L/720));return l<0&&(ue+=1e7),{northing:Math.round(ue),easting:Math.round(re),zoneNumber:K,zoneLetter:ic(l)}}function qs(s){var l=s.northing,c=s.easting,y=s.zoneLetter,g=s.zoneNumber;if(g<0||g>60)return null;var w=.9996,S=6378137,b=.00669438,A,O=(1-Math.sqrt(1-b))/(1+Math.sqrt(1-b)),D,L,j,W,$,G,K,re,ue,ge=c-5e5,$e=l;y<"N"&&($e-=1e7),K=(g-1)*6-180+3,A=b/(1-b),G=$e/w,re=G/(S*(1-b/4-3*b*b/64-5*b*b*b/256)),ue=re+(3*O/2-27*O*O*O/32)*Math.sin(2*re)+(21*O*O/16-55*O*O*O*O/32)*Math.sin(4*re)+151*O*O*O/96*Math.sin(6*re),D=S/Math.sqrt(1-b*Math.sin(ue)*Math.sin(ue)),L=Math.tan(ue)*Math.tan(ue),j=A*Math.cos(ue)*Math.cos(ue),W=S*(1-b)/Math.pow(1-b*Math.sin(ue)*Math.sin(ue),1.5),$=ge/(D*w);var Oe=ue-D*Math.tan(ue)/W*($*$/2-(5+3*L+10*j-4*j*j-9*A)*$*$*$*$/24+(61+90*L+298*j+45*L*L-252*A-3*j*j)*$*$*$*$*$*$/720);Oe=hl(Oe);var Be=($-(1+2*L+j)*$*$*$/6+(5-2*j+28*L-3*j*j+8*A+24*L*L)*$*$*$*$*$/120)/Math.cos(ue);Be=K+hl(Be);var wt;if(s.accuracy){var tt=qs({northing:s.northing+s.accuracy,easting:s.easting+s.accuracy,zoneLetter:s.zoneLetter,zoneNumber:s.zoneNumber});wt={top:tt.lat,right:tt.lon,bottom:Oe,left:Be}}else wt={lat:Oe,lon:Be};return wt}function ic(s){var l="Z";return 84>=s&&s>=72?l="X":72>s&&s>=64?l="W":64>s&&s>=56?l="V":56>s&&s>=48?l="U":48>s&&s>=40?l="T":40>s&&s>=32?l="S":32>s&&s>=24?l="R":24>s&&s>=16?l="Q":16>s&&s>=8?l="P":8>s&&s>=0?l="N":0>s&&s>=-8?l="M":-8>s&&s>=-16?l="L":-16>s&&s>=-24?l="K":-24>s&&s>=-32?l="J":-32>s&&s>=-40?l="H":-40>s&&s>=-48?l="G":-48>s&&s>=-56?l="F":-56>s&&s>=-64?l="E":-64>s&&s>=-72?l="D":-72>s&&s>=-80&&(l="C"),l}function nc(s,l){var c="00000"+s.easting,y="00000"+s.northing;return s.zoneNumber+s.zoneLetter+sc(s.easting,s.northing,s.zoneNumber)+c.substr(c.length-5,l)+y.substr(y.length-5,l)}function sc(s,l,c){var y=Gi(c),g=Math.floor(s/1e5),w=Math.floor(l/1e5)%20;return cl(g,w,y)}function Gi(s){var l=s%Oa;return l===0&&(l=Oa),l}function cl(s,l,c){var y=c-1,g=js.charCodeAt(y),w=Hi.charCodeAt(y),S=g+s-1,b=w+l,A=!1;S>Gr&&(S=S-Gr+zt-1,A=!0),(S===dt||g<dt&&S>dt||(S>dt||g<dt)&&A)&&S++,(S===mt||g<mt&&S>mt||(S>mt||g<mt)&&A)&&(S++,S===dt&&S++),S>Gr&&(S=S-Gr+zt-1),b>Ir?(b=b-Ir+zt-1,A=!0):A=!1,(b===dt||w<dt&&b>dt||(b>dt||w<dt)&&A)&&b++,(b===mt||w<mt&&b>mt||(b>mt||w<mt)&&A)&&(b++,b===dt&&b++),b>Ir&&(b=b-Ir+zt-1);var O=String.fromCharCode(S)+String.fromCharCode(b);return O}function fl(s){if(s&&s.length===0)throw"MGRSPoint coverting from nothing";for(var l=s.length,c=null,y="",g,w=0;!/[A-Z]/.test(g=s.charAt(w));){if(w>=2)throw"MGRSPoint bad conversion from: "+s;y+=g,w++}var S=parseInt(y,10);if(w===0||w+3>l)throw"MGRSPoint bad conversion from: "+s;var b=s.charAt(w++);if(b<="A"||b==="B"||b==="Y"||b>="Z"||b==="I"||b==="O")throw"MGRSPoint zone letter "+b+" not handled: "+s;c=s.substring(w,w+=2);for(var A=Gi(S),O=dl(c.charAt(0),A),D=Vi(c.charAt(1),A);D<Ki(b);)D+=2e6;var L=l-w;if(L%2!==0)throw`MGRSPoint has to have an even number
106
106
  of digits after the zone letter and two 100km letters - front
107
107
  half for easting meters, second half for
108
- northing meters`+o;var q=N/2,F=0,W=0,V,K,ae,pe,Oe;return q>0&&(V=1e5/Math.pow(10,q),K=o.substring(_,_+q),F=parseFloat(K)*V,ae=o.substring(_+q),W=parseFloat(ae)*V),pe=F+k,Oe=W+D,{easting:pe,northing:Oe,zoneLetter:E,zoneNumber:M,accuracy:V}}function Mi(o,u){for(var h=Nn.charCodeAt(u-1),y=1e5,g=!1;h!==o.charCodeAt(0);){if(h++,h===nt&&h++,h===pt&&h++,h>Si){if(g)throw"Bad character: "+o;h=Ir,g=!0}y+=1e5}return y}function el(o,u){if(o>"V")throw"MGRSPoint given invalid Northing "+o;for(var h=Z1.charCodeAt(u-1),y=0,g=!1;h!==o.charCodeAt(0);){if(h++,h===nt&&h++,h===pt&&h++,h>mt){if(g)throw"Bad character: "+o;h=Ir,g=!0}y+=1e5}return y}function Ts(o){var u;switch(o){case"C":u=11e5;break;case"D":u=2e6;break;case"E":u=28e5;break;case"F":u=37e5;break;case"G":u=46e5;break;case"H":u=55e5;break;case"J":u=64e5;break;case"K":u=73e5;break;case"L":u=82e5;break;case"M":u=91e5;break;case"N":u=0;break;case"P":u=8e5;break;case"Q":u=17e5;break;case"R":u=26e5;break;case"S":u=35e5;break;case"T":u=44e5;break;case"U":u=53e5;break;case"V":u=62e5;break;case"W":u=7e6;break;case"X":u=79e5;break;default:u=-1}if(u>=0)return u;throw"Invalid zone letter: "+o}function dr(o,u,h){if(!(this instanceof dr))return new dr(o,u,h);if(Array.isArray(o))this.x=o[0],this.y=o[1],this.z=o[2]||0;else if(typeof o=="object")this.x=o.x,this.y=o.y,this.z=o.z||0;else if(typeof o=="string"&&typeof u>"u"){var y=o.split(",");this.x=parseFloat(y[0],10),this.y=parseFloat(y[1],10),this.z=parseFloat(y[2],10)||0}else this.x=o,this.y=u,this.z=h||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}dr.fromMGRS=function(o){return new dr(ba(o))},dr.prototype.toMGRS=function(o){return Dn([this.x,this.y],o)};var Is=1,ks=.25,tl=.046875,rl=.01953125,il=.01068115234375,$c=.75,Wc=.46875,Fc=.013020833333333334,nl=.007120768229166667,Hc=.3645833333333333,Gc=.005696614583333333,Vc=.3076171875,Gi=function(o){var u=[];u[0]=Is-o*(ks+o*(tl+o*(rl+o*il))),u[1]=o*($c-o*(tl+o*(rl+o*il)));var h=o*o;return u[2]=h*(Wc-o*(Fc+o*nl)),h*=o,u[3]=h*(Hc-o*Gc),u[4]=h*o*Vc,u},Bn=function(o,u,h,y){return h*=u,u*=u,y[0]*o-h*(y[1]+u*(y[2]+u*(y[3]+u*y[4])))},Kc=20,xa=function(o,u,h){for(var y=1/(1-u),g=o,_=Kc;_;--_){var M=Math.sin(g),E=1-u*M*M;if(E=(Bn(g,M,Math.cos(g),h)-o)*(E*Math.sqrt(E))*y,g-=E,Math.abs(E)<m)return g}return g};function Vi(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Gi(this.es),this.ml0=Bn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Ki(o){var u=o.x,h=o.y,y=Z(u-this.long0),g,_,M,E=Math.sin(h),P=Math.cos(h);if(this.es){var D=P*y,N=Math.pow(D,2),q=this.ep2*Math.pow(P,2),F=Math.pow(q,2),W=Math.abs(P)>m?Math.tan(h):0,V=Math.pow(W,2),K=Math.pow(V,2);g=1-this.es*Math.pow(E,2),D=D/Math.sqrt(g);var ae=Bn(h,E,P,this.en);_=this.a*(this.k0*D*(1+N/6*(1-V+q+N/20*(5-18*V+K+14*q-58*V*q+N/42*(61+179*K-K*V-479*V)))))+this.x0,M=this.a*(this.k0*(ae-this.ml0+E*y*D/2*(1+N/12*(5-V+9*q+4*F+N/30*(61+K-58*V+270*q-330*V*q+N/56*(1385+543*K-K*V-3111*V))))))+this.y0}else{var k=P*Math.sin(y);if(Math.abs(Math.abs(k)-1)<m)return 93;if(_=.5*this.a*this.k0*Math.log((1+k)/(1-k))+this.x0,M=P*Math.cos(y)/Math.sqrt(1-Math.pow(k,2)),k=Math.abs(M),k>=1){if(k-1>m)return 93;M=0}else M=Math.acos(M);h<0&&(M=-M),M=this.a*this.k0*(M-this.lat0)+this.y0}return o.x=_,o.y=M,o}function Os(o){var u,h,y,g,_=(o.x-this.x0)*(1/this.a),M=(o.y-this.y0)*(1/this.a);if(this.es)if(u=this.ml0+M/this.k0,h=xa(u,this.es,this.en),Math.abs(h)<a){var N=Math.sin(h),q=Math.cos(h),F=Math.abs(q)>m?Math.tan(h):0,W=this.ep2*Math.pow(q,2),V=Math.pow(W,2),K=Math.pow(F,2),ae=Math.pow(K,2);u=1-this.es*Math.pow(N,2);var pe=_*Math.sqrt(u)/this.k0,Oe=Math.pow(pe,2);u=u*F,y=h-u*Oe/(1-this.es)*.5*(1-Oe/12*(5+3*K-9*W*K+W-4*V-Oe/30*(61+90*K-252*W*K+45*ae+46*W-Oe/56*(1385+3633*K+4095*ae+1574*ae*K)))),g=Z(this.long0+pe*(1-Oe/6*(1+2*K+W-Oe/20*(5+28*K+24*ae+8*W*K+6*W-Oe/42*(61+662*K+1320*ae+720*ae*K))))/q)}else y=a*fr(M),g=0;else{var E=Math.exp(_/this.k0),P=.5*(E-1/E),k=this.lat0+M/this.k0,D=Math.cos(k);u=Math.sqrt((1-Math.pow(D,2))/(1+Math.pow(P,2))),y=Math.asin(u),M<0&&(y=-y),P===0&&D===0?g=0:g=Z(Math.atan2(P,D)+this.long0)}return o.x=g,o.y=y,o}var sl=["Transverse_Mercator","Transverse Mercator","tmerc"],Zc={init:Vi,forward:Ki,inverse:Os,names:sl},Ls=function(o){var u=Math.exp(o);return u=(u-1/u)/2,u},Zi=function(o,u){o=Math.abs(o),u=Math.abs(u);var h=Math.max(o,u),y=Math.min(o,u)/(h||1);return h*Math.sqrt(1+Math.pow(y,2))},Ma=function(o){var u=1+o,h=u-1;return h===0?o:o*Math.log(u)/h},Jc=function(o){var u=Math.abs(o);return u=Ma(u*(1+u/(Zi(1,u)+1))),o<0?-u:u},Ea=function(o,u){for(var h=2*Math.cos(2*u),y=o.length-1,g=o[y],_=0,M;--y>=0;)M=-_+h*g+o[y],_=g,g=M;return u+M*Math.sin(2*u)},Yc=function(o,u){for(var h=2*Math.cos(u),y=o.length-1,g=o[y],_=0,M;--y>=0;)M=-_+h*g+o[y],_=g,g=M;return Math.sin(u)*M},Xc=function(o){var u=Math.exp(o);return u=(u+1/u)/2,u},Yt=function(o,u,h){for(var y=Math.sin(u),g=Math.cos(u),_=Ls(h),M=Xc(h),E=2*g*M,P=-2*y*_,k=o.length-1,D=o[k],N=0,q=0,F=0,W,V;--k>=0;)W=q,V=N,q=D,N=F,D=-W+E*q-P*N+o[k],F=-V+P*q+E*N;return E=y*M,P=g*_,[E*D-P*F,E*F+P*D]};function Qc(){if(this.es===void 0||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var o=this.es/(1+Math.sqrt(1-this.es)),u=o/(2-o),h=u;this.cgb[0]=u*(2+u*(-2/3+u*(-2+u*(116/45+u*(26/45+u*(-2854/675)))))),this.cbg[0]=u*(-2+u*(2/3+u*(4/3+u*(-82/45+u*(32/45+u*(4642/4725)))))),h=h*u,this.cgb[1]=h*(7/3+u*(-8/5+u*(-227/45+u*(2704/315+u*(2323/945))))),this.cbg[1]=h*(5/3+u*(-16/15+u*(-13/9+u*(904/315+u*(-1522/945))))),h=h*u,this.cgb[2]=h*(56/15+u*(-136/35+u*(-1262/105+u*(73814/2835)))),this.cbg[2]=h*(-26/15+u*(34/21+u*(8/5+u*(-12686/2835)))),h=h*u,this.cgb[3]=h*(4279/630+u*(-332/35+u*(-399572/14175))),this.cbg[3]=h*(1237/630+u*(-12/5+u*(-24832/14175))),h=h*u,this.cgb[4]=h*(4174/315+u*(-144838/6237)),this.cbg[4]=h*(-734/315+u*(109598/31185)),h=h*u,this.cgb[5]=h*(601676/22275),this.cbg[5]=h*(444337/155925),h=Math.pow(u,2),this.Qn=this.k0/(1+u)*(1+h*(1/4+h*(1/64+h/256))),this.utg[0]=u*(-.5+u*(2/3+u*(-37/96+u*(1/360+u*(81/512+u*(-96199/604800)))))),this.gtu[0]=u*(.5+u*(-2/3+u*(5/16+u*(41/180+u*(-127/288+u*(7891/37800)))))),this.utg[1]=h*(-1/48+u*(-1/15+u*(437/1440+u*(-46/105+u*(1118711/3870720))))),this.gtu[1]=h*(13/48+u*(-3/5+u*(557/1440+u*(281/630+u*(-1983433/1935360))))),h=h*u,this.utg[2]=h*(-17/480+u*(37/840+u*(209/4480+u*(-5569/90720)))),this.gtu[2]=h*(61/240+u*(-103/140+u*(15061/26880+u*(167603/181440)))),h=h*u,this.utg[3]=h*(-4397/161280+u*(11/504+u*(830251/7257600))),this.gtu[3]=h*(49561/161280+u*(-179/168+u*(6601661/7257600))),h=h*u,this.utg[4]=h*(-4583/161280+u*(108847/3991680)),this.gtu[4]=h*(34729/80640+u*(-3418889/1995840)),h=h*u,this.utg[5]=h*(-20648693/638668800),this.gtu[5]=h*(212378941/319334400);var y=Ea(this.cbg,this.lat0);this.Zb=-this.Qn*(y+Yc(this.gtu,2*y))}function eh(o){var u=Z(o.x-this.long0),h=o.y;h=Ea(this.cbg,h);var y=Math.sin(h),g=Math.cos(h),_=Math.sin(u),M=Math.cos(u);h=Math.atan2(y,M*g),u=Math.atan2(_*g,Zi(y,g*M)),u=Jc(Math.tan(u));var E=Yt(this.gtu,2*h,2*u);h=h+E[0],u=u+E[1];var P,k;return Math.abs(u)<=2.623395162778?(P=this.a*(this.Qn*u)+this.x0,k=this.a*(this.Qn*h+this.Zb)+this.y0):(P=1/0,k=1/0),o.x=P,o.y=k,o}function th(o){var u=(o.x-this.x0)*(1/this.a),h=(o.y-this.y0)*(1/this.a);h=(h-this.Zb)/this.Qn,u=u/this.Qn;var y,g;if(Math.abs(u)<=2.623395162778){var _=Yt(this.utg,2*h,2*u);h=h+_[0],u=u+_[1],u=Math.atan(Ls(u));var M=Math.sin(h),E=Math.cos(h),P=Math.sin(u),k=Math.cos(u);h=Math.atan2(M*k,Zi(P,k*E)),u=Math.atan2(P,k*E),y=Z(u+this.long0),g=Ea(this.cgb,h)}else y=1/0,g=1/0;return o.x=y,o.y=g,o}var Ns=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"],Ji={init:Qc,forward:eh,inverse:th,names:Ns},zn=function(o,u){if(o===void 0){if(o=Math.floor((Z(u)+Math.PI)*30/Math.PI)+1,o<0)return 0;if(o>60)return 60}return o},Ei="etmerc";function rh(){var o=zn(this.zone,this.long0);if(o===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(o)-183)*w,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ji.init.apply(this),this.forward=Ji.forward,this.inverse=Ji.inverse}var ol=["Universal Transverse Mercator System","utm"],ih={init:rh,names:ol,dependsOn:Ei},Ra=function(o,u){return Math.pow((1-o)/(1+o),u)},al=20;function nh(){var o=Math.sin(this.lat0),u=Math.cos(this.lat0);u*=u,this.rc=Math.sqrt(1-this.es)/(1-this.es*o*o),this.C=Math.sqrt(1+this.es*u*u/(1-this.es)),this.phic0=Math.asin(o/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+v)/(Math.pow(Math.tan(.5*this.lat0+v),this.C)*Ra(this.e*o,this.ratexp))}function ll(o){var u=o.x,h=o.y;return o.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*h+v),this.C)*Ra(this.e*Math.sin(h),this.ratexp))-a,o.x=this.C*u,o}function ul(o){for(var u=1e-14,h=o.x/this.C,y=o.y,g=Math.pow(Math.tan(.5*y+v)/this.K,1/this.C),_=al;_>0&&(y=2*Math.atan(g*Ra(this.e*Math.sin(o.y),-.5*this.e))-a,!(Math.abs(y-o.y)<u));--_)o.y=y;return _?(o.x=h,o.y=y,o):null}var cl=["gauss"],Kr={init:nh,forward:ll,inverse:ul,names:cl};function Ca(){Kr.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function hl(o){var u,h,y,g;return o.x=Z(o.x-this.long0),Kr.forward.apply(this,[o]),u=Math.sin(o.y),h=Math.cos(o.y),y=Math.cos(o.x),g=this.k0*this.R2/(1+this.sinc0*u+this.cosc0*h*y),o.x=g*h*Math.sin(o.x),o.y=g*(this.cosc0*u-this.sinc0*h*y),o.x=this.a*o.x+this.x0,o.y=this.a*o.y+this.y0,o}function sh(o){var u,h,y,g,_;if(o.x=(o.x-this.x0)/this.a,o.y=(o.y-this.y0)/this.a,o.x/=this.k0,o.y/=this.k0,_=Math.sqrt(o.x*o.x+o.y*o.y)){var M=2*Math.atan2(_,this.R2);u=Math.sin(M),h=Math.cos(M),g=Math.asin(h*this.sinc0+o.y*u*this.cosc0/_),y=Math.atan2(o.x*u,_*this.cosc0*h-o.y*this.sinc0*u)}else g=this.phic0,y=0;return o.x=y,o.y=g,Kr.inverse.apply(this,[o]),o.x=Z(o.x+this.long0),o}var Ds=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],oh={init:Ca,forward:hl,inverse:sh,names:Ds};function ah(o,u,h){return u*=h,Math.tan(.5*(a+o))*Math.pow((1-u)/(1+u),.5*h)}function fl(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=m&&(this.k0=.5*(1+fr(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=m&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=m&&(this.k0=.5*this.cons*Nt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ct(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Nt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-a,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function lh(o){var u=o.x,h=o.y,y=Math.sin(h),g=Math.cos(h),_,M,E,P,k,D,N=Z(u-this.long0);return Math.abs(Math.abs(u-this.long0)-Math.PI)<=m&&Math.abs(h+this.lat0)<=m?(o.x=NaN,o.y=NaN,o):this.sphere?(_=2*this.k0/(1+this.sinlat0*y+this.coslat0*g*Math.cos(N)),o.x=this.a*_*g*Math.sin(N)+this.x0,o.y=this.a*_*(this.coslat0*y-this.sinlat0*g*Math.cos(N))+this.y0,o):(M=2*Math.atan(this.ssfn_(h,y,this.e))-a,P=Math.cos(M),E=Math.sin(M),Math.abs(this.coslat0)<=m?(k=Ct(this.e,h*this.con,this.con*y),D=2*this.a*this.k0*k/this.cons,o.x=this.x0+D*Math.sin(u-this.long0),o.y=this.y0-this.con*D*Math.cos(u-this.long0),o):(Math.abs(this.sinlat0)<m?(_=2*this.a*this.k0/(1+P*Math.cos(N)),o.y=_*E):(_=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*E+this.cosX0*P*Math.cos(N))),o.y=_*(this.cosX0*E-this.sinX0*P*Math.cos(N))+this.y0),o.x=_*P*Math.sin(N)+this.x0,o))}function Bs(o){o.x-=this.x0,o.y-=this.y0;var u,h,y,g,_,M=Math.sqrt(o.x*o.x+o.y*o.y);if(this.sphere){var E=2*Math.atan(M/(2*this.a*this.k0));return u=this.long0,h=this.lat0,M<=m?(o.x=u,o.y=h,o):(h=Math.asin(Math.cos(E)*this.sinlat0+o.y*Math.sin(E)*this.coslat0/M),Math.abs(this.coslat0)<m?this.lat0>0?u=Z(this.long0+Math.atan2(o.x,-1*o.y)):u=Z(this.long0+Math.atan2(o.x,o.y)):u=Z(this.long0+Math.atan2(o.x*Math.sin(E),M*this.coslat0*Math.cos(E)-o.y*this.sinlat0*Math.sin(E))),o.x=u,o.y=h,o)}else if(Math.abs(this.coslat0)<=m){if(M<=m)return h=this.lat0,u=this.long0,o.x=u,o.y=h,o;o.x*=this.con,o.y*=this.con,y=M*this.cons/(2*this.a*this.k0),h=this.con*Hr(this.e,y),u=this.con*Z(this.con*this.long0+Math.atan2(o.x,-1*o.y))}else g=2*Math.atan(M*this.cosX0/(2*this.a*this.k0*this.ms1)),u=this.long0,M<=m?_=this.X0:(_=Math.asin(Math.cos(g)*this.sinX0+o.y*Math.sin(g)*this.cosX0/M),u=Z(this.long0+Math.atan2(o.x*Math.sin(g),M*this.cosX0*Math.cos(g)-o.y*this.sinX0*Math.sin(g)))),h=-1*Hr(this.e,Math.tan(.5*(a+_)));return o.x=u,o.y=h,o}var Aa=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],uh={init:fl,forward:lh,inverse:Bs,names:Aa,ssfn_:ah};function ch(){var o=this.lat0;this.lambda0=this.long0;var u=Math.sin(o),h=this.a,y=this.rf,g=1/y,_=2*g-Math.pow(g,2),M=this.e=Math.sqrt(_);this.R=this.k0*h*Math.sqrt(1-_)/(1-_*Math.pow(u,2)),this.alpha=Math.sqrt(1+_/(1-_)*Math.pow(Math.cos(o),4)),this.b0=Math.asin(u/this.alpha);var E=Math.log(Math.tan(Math.PI/4+this.b0/2)),P=Math.log(Math.tan(Math.PI/4+o/2)),k=Math.log((1+M*u)/(1-M*u));this.K=E-this.alpha*P+this.alpha*M/2*k}function Pa(o){var u=Math.log(Math.tan(Math.PI/4-o.y/2)),h=this.e/2*Math.log((1+this.e*Math.sin(o.y))/(1-this.e*Math.sin(o.y))),y=-this.alpha*(u+h)+this.K,g=2*(Math.atan(Math.exp(y))-Math.PI/4),_=this.alpha*(o.x-this.lambda0),M=Math.atan(Math.sin(_)/(Math.sin(this.b0)*Math.tan(g)+Math.cos(this.b0)*Math.cos(_))),E=Math.asin(Math.cos(this.b0)*Math.sin(g)-Math.sin(this.b0)*Math.cos(g)*Math.cos(_));return o.y=this.R/2*Math.log((1+Math.sin(E))/(1-Math.sin(E)))+this.y0,o.x=this.R*M+this.x0,o}function dl(o){for(var u=o.x-this.x0,h=o.y-this.y0,y=u/this.R,g=2*(Math.atan(Math.exp(h/this.R))-Math.PI/4),_=Math.asin(Math.cos(this.b0)*Math.sin(g)+Math.sin(this.b0)*Math.cos(g)*Math.cos(y)),M=Math.atan(Math.sin(y)/(Math.cos(this.b0)*Math.cos(y)-Math.sin(this.b0)*Math.tan(g))),E=this.lambda0+M/this.alpha,P=0,k=_,D=-1e3,N=0;Math.abs(k-D)>1e-7;){if(++N>20)return;P=1/this.alpha*(Math.log(Math.tan(Math.PI/4+_/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(k))/2)),D=k,k=2*Math.atan(Math.exp(P))-Math.PI/2}return o.x=E,o.y=k,o}var zs=["somerc"],Ta={init:ch,forward:Pa,inverse:dl,names:zs};function Ri(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var o=Math.sin(this.lat0),u=Math.cos(this.lat0),h=this.e*o;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(u,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-h*h);var y=Ct(this.e,this.lat0,o),g=this.bl/u*Math.sqrt((1-this.es)/(1-h*h));g*g<1&&(g=1);var _,M;if(!isNaN(this.longc))this.lat0>=0?_=g+Math.sqrt(g*g-1):_=g-Math.sqrt(g*g-1),this.el=_*Math.pow(y,this.bl),M=.5*(_-1/_),this.gamma0=Math.asin(Math.sin(this.alpha)/g),this.long0=this.longc-Math.asin(M*Math.tan(this.gamma0))/this.bl;else{var E=Ct(this.e,this.lat1,Math.sin(this.lat1)),P=Ct(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(g+Math.sqrt(g*g-1))*Math.pow(y,this.bl):this.el=(g-Math.sqrt(g*g-1))*Math.pow(y,this.bl);var k=Math.pow(E,this.bl),D=Math.pow(P,this.bl);_=this.el/k,M=.5*(_-1/_);var N=(this.el*this.el-D*k)/(this.el*this.el+D*k),q=(D-k)/(D+k),F=Z(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(N*Math.tan(.5*this.bl*F)/q)/this.bl,this.long0=Z(this.long0);var W=Z(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*W)/M),this.alpha=Math.asin(g*Math.sin(this.gamma0))}this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(g*g-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(g*g-1),Math.cos(this.alpha))}function jn(o){var u=o.x,h=o.y,y=Z(u-this.long0),g,_,M;if(Math.abs(Math.abs(h)-a)<=m)h>0?M=-1:M=1,_=this.al/this.bl*Math.log(Math.tan(v+M*this.gamma0*.5)),g=-1*M*a*this.al/this.bl;else{var E=Ct(this.e,h,Math.sin(h)),P=this.el/Math.pow(E,this.bl),k=.5*(P-1/P),D=.5*(P+1/P),N=Math.sin(this.bl*y),q=(k*Math.sin(this.gamma0)-N*Math.cos(this.gamma0))/D;Math.abs(Math.abs(q)-1)<=m?_=Number.POSITIVE_INFINITY:_=.5*this.al*Math.log((1-q)/(1+q))/this.bl,Math.abs(Math.cos(this.bl*y))<=m?g=this.al*this.bl*y:g=this.al*Math.atan2(k*Math.cos(this.gamma0)+N*Math.sin(this.gamma0),Math.cos(this.bl*y))/this.bl}return this.no_rot?(o.x=this.x0+g,o.y=this.y0+_):(g-=this.uc,o.x=this.x0+_*Math.cos(this.alpha)+g*Math.sin(this.alpha),o.y=this.y0+g*Math.cos(this.alpha)-_*Math.sin(this.alpha)),o}function js(o){var u,h;this.no_rot?(h=o.y-this.y0,u=o.x-this.x0):(h=(o.x-this.x0)*Math.cos(this.alpha)-(o.y-this.y0)*Math.sin(this.alpha),u=(o.y-this.y0)*Math.cos(this.alpha)+(o.x-this.x0)*Math.sin(this.alpha),u+=this.uc);var y=Math.exp(-1*this.bl*h/this.al),g=.5*(y-1/y),_=.5*(y+1/y),M=Math.sin(this.bl*u/this.al),E=(M*Math.cos(this.gamma0)+g*Math.sin(this.gamma0))/_,P=Math.pow(this.el/Math.sqrt((1+E)/(1-E)),1/this.bl);return Math.abs(E-1)<m?(o.x=this.long0,o.y=a):Math.abs(E+1)<m?(o.x=this.long0,o.y=-1*a):(o.y=Hr(this.e,P),o.x=Z(this.long0-Math.atan2(g*Math.cos(this.gamma0)-M*Math.sin(this.gamma0),Math.cos(this.bl*u/this.al))/this.bl)),o}var pl=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"],hh={init:Ri,forward:jn,inverse:js,names:pl};function Ia(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<m)){var o=this.b/this.a;this.e=Math.sqrt(1-o*o);var u=Math.sin(this.lat1),h=Math.cos(this.lat1),y=Nt(this.e,u,h),g=Ct(this.e,this.lat1,u),_=Math.sin(this.lat2),M=Math.cos(this.lat2),E=Nt(this.e,_,M),P=Ct(this.e,this.lat2,_),k=Ct(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>m?this.ns=Math.log(y/E)/Math.log(g/P):this.ns=u,isNaN(this.ns)&&(this.ns=u),this.f0=y/(this.ns*Math.pow(g,this.ns)),this.rh=this.a*this.f0*Math.pow(k,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function fh(o){var u=o.x,h=o.y;Math.abs(2*Math.abs(h)-Math.PI)<=m&&(h=fr(h)*(a-2*m));var y=Math.abs(Math.abs(h)-a),g,_;if(y>m)g=Ct(this.e,h,Math.sin(h)),_=this.a*this.f0*Math.pow(g,this.ns);else{if(y=h*this.ns,y<=0)return null;_=0}var M=this.ns*Z(u-this.long0);return o.x=this.k0*(_*Math.sin(M))+this.x0,o.y=this.k0*(this.rh-_*Math.cos(M))+this.y0,o}function ml(o){var u,h,y,g,_,M=(o.x-this.x0)/this.k0,E=this.rh-(o.y-this.y0)/this.k0;this.ns>0?(u=Math.sqrt(M*M+E*E),h=1):(u=-Math.sqrt(M*M+E*E),h=-1);var P=0;if(u!==0&&(P=Math.atan2(h*M,h*E)),u!==0||this.ns>0){if(h=1/this.ns,y=Math.pow(u/(this.a*this.f0),h),g=Hr(this.e,y),g===-9999)return null}else g=-a;return _=Z(P/this.ns+this.long0),o.x=_,o.y=g,o}var qs=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"],ka={init:Ia,forward:fh,inverse:ml,names:qs};function gl(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function yl(o){var u,h,y,g,_,M,E,P=o.x,k=o.y,D=Z(P-this.long0);return u=Math.pow((1+this.e*Math.sin(k))/(1-this.e*Math.sin(k)),this.alfa*this.e/2),h=2*(Math.atan(this.k*Math.pow(Math.tan(k/2+this.s45),this.alfa)/u)-this.s45),y=-D*this.alfa,g=Math.asin(Math.cos(this.ad)*Math.sin(h)+Math.sin(this.ad)*Math.cos(h)*Math.cos(y)),_=Math.asin(Math.cos(h)*Math.sin(y)/Math.cos(g)),M=this.n*_,E=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(g/2+this.s45),this.n),o.y=E*Math.cos(M)/1,o.x=E*Math.sin(M)/1,this.czech||(o.y*=-1,o.x*=-1),o}function dh(o){var u,h,y,g,_,M,E,P,k=o.x;o.x=o.y,o.y=k,this.czech||(o.y*=-1,o.x*=-1),M=Math.sqrt(o.x*o.x+o.y*o.y),_=Math.atan2(o.y,o.x),g=_/Math.sin(this.s0),y=2*(Math.atan(Math.pow(this.ro0/M,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),u=Math.asin(Math.cos(this.ad)*Math.sin(y)-Math.sin(this.ad)*Math.cos(y)*Math.cos(g)),h=Math.asin(Math.cos(y)*Math.sin(g)/Math.cos(u)),o.x=this.long0-h/this.alfa,E=u,P=0;var D=0;do o.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(u/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(E))/(1-this.e*Math.sin(E)),this.e/2))-this.s45),Math.abs(E-o.y)<1e-10&&(P=1),E=o.y,D+=1;while(P===0&&D<15);return D>=15?null:o}var ph=["Krovak","krovak"],Oa={init:gl,forward:yl,inverse:dh,names:ph},ht=function(o,u,h,y,g){return o*g-u*Math.sin(2*g)+h*Math.sin(4*g)-y*Math.sin(6*g)},qn=function(o){return 1-.25*o*(1+o/16*(3+1.25*o))},Un=function(o){return .375*o*(1+.25*o*(1+.46875*o))},$n=function(o){return .05859375*o*o*(1+.75*o)},Yi=function(o){return o*o*o*(35/3072)},Xt=function(o,u,h){var y=u*h;return o/Math.sqrt(1-y*y)},kr=function(o){return Math.abs(o)<a?o:o-fr(o)*Math.PI},Zr=function(o,u,h,y,g){var _,M;_=o/u;for(var E=0;E<15;E++)if(M=(o-(u*_-h*Math.sin(2*_)+y*Math.sin(4*_)-g*Math.sin(6*_)))/(u-2*h*Math.cos(2*_)+4*y*Math.cos(4*_)-6*g*Math.cos(6*_)),_+=M,Math.abs(M)<=1e-10)return _;return NaN};function bl(){this.sphere||(this.e0=qn(this.es),this.e1=Un(this.es),this.e2=$n(this.es),this.e3=Yi(this.es),this.ml0=this.a*ht(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Us(o){var u,h,y=o.x,g=o.y;if(y=Z(y-this.long0),this.sphere)u=this.a*Math.asin(Math.cos(g)*Math.sin(y)),h=this.a*(Math.atan2(Math.tan(g),Math.cos(y))-this.lat0);else{var _=Math.sin(g),M=Math.cos(g),E=Xt(this.a,this.e,_),P=Math.tan(g)*Math.tan(g),k=y*Math.cos(g),D=k*k,N=this.es*M*M/(1-this.es),q=this.a*ht(this.e0,this.e1,this.e2,this.e3,g);u=E*k*(1-D*P*(1/6-(8-P+8*N)*D/120)),h=q-this.ml0+E*_/M*D*(.5+(5-P+6*N)*D/24)}return o.x=u+this.x0,o.y=h+this.y0,o}function Wn(o){o.x-=this.x0,o.y-=this.y0;var u=o.x/this.a,h=o.y/this.a,y,g;if(this.sphere){var _=h+this.lat0;y=Math.asin(Math.sin(_)*Math.cos(u)),g=Math.atan2(Math.tan(u),Math.cos(_))}else{var M=this.ml0/this.a+h,E=Zr(M,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(E)-a)<=m)return o.x=this.long0,o.y=a,h<0&&(o.y*=-1),o;var P=Xt(this.a,this.e,Math.sin(E)),k=P*P*P/this.a/this.a*(1-this.es),D=Math.pow(Math.tan(E),2),N=u*this.a/P,q=N*N;y=E-P*Math.tan(E)/k*N*N*(.5-(1+3*D)*N*N/24),g=N*(1-q*(D/3+(1+3*D)*D*q/15))/Math.cos(E)}return o.x=Z(g+this.long0),o.y=kr(y),o}var $s=["Cassini","Cassini_Soldner","cass"],Jr={init:bl,forward:Us,inverse:Wn,names:$s},pr=function(o,u){var h;return o>1e-7?(h=o*u,(1-o*o)*(u/(1-h*h)-.5/o*Math.log((1-h)/(1+h)))):2*u},mh=1,Xi=2,vl=3,gh=4;function Ws(){var o=Math.abs(this.lat0);if(Math.abs(o-a)<m?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(o)<m?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var u;switch(this.qp=pr(this.e,1),this.mmf=.5/(1-this.es),this.apa=Eh(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),u=Math.sin(this.lat0),this.sinb1=pr(this.e,u)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*u*u)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function yh(o){var u,h,y,g,_,M,E,P,k,D,N=o.x,q=o.y;if(N=Z(N-this.long0),this.sphere){if(_=Math.sin(q),D=Math.cos(q),y=Math.cos(N),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(h=this.mode===this.EQUIT?1+D*y:1+this.sinph0*_+this.cosph0*D*y,h<=m)return null;h=Math.sqrt(2/h),u=h*D*Math.sin(N),h*=this.mode===this.EQUIT?_:this.cosph0*_-this.sinph0*D*y}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(y=-y),Math.abs(q+this.lat0)<m)return null;h=v-q*.5,h=2*(this.mode===this.S_POLE?Math.cos(h):Math.sin(h)),u=h*Math.sin(N),h*=y}}else{switch(E=0,P=0,k=0,y=Math.cos(N),g=Math.sin(N),_=Math.sin(q),M=pr(this.e,_),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(E=M/this.qp,P=Math.sqrt(1-E*E)),this.mode){case this.OBLIQ:k=1+this.sinb1*E+this.cosb1*P*y;break;case this.EQUIT:k=1+P*y;break;case this.N_POLE:k=a+q,M=this.qp-M;break;case this.S_POLE:k=q-a,M=this.qp+M;break}if(Math.abs(k)<m)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:k=Math.sqrt(2/k),this.mode===this.OBLIQ?h=this.ymf*k*(this.cosb1*E-this.sinb1*P*y):h=(k=Math.sqrt(2/(1+P*y)))*E*this.ymf,u=this.xmf*k*P*g;break;case this.N_POLE:case this.S_POLE:M>=0?(u=(k=Math.sqrt(M))*g,h=y*(this.mode===this.S_POLE?k:-k)):u=h=0;break}}return o.x=this.a*u+this.x0,o.y=this.a*h+this.y0,o}function bh(o){o.x-=this.x0,o.y-=this.y0;var u=o.x/this.a,h=o.y/this.a,y,g,_,M,E,P,k;if(this.sphere){var D=0,N,q=0;if(N=Math.sqrt(u*u+h*h),g=N*.5,g>1)return null;switch(g=2*Math.asin(g),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(q=Math.sin(g),D=Math.cos(g)),this.mode){case this.EQUIT:g=Math.abs(N)<=m?0:Math.asin(h*q/N),u*=q,h=D*N;break;case this.OBLIQ:g=Math.abs(N)<=m?this.lat0:Math.asin(D*this.sinph0+h*q*this.cosph0/N),u*=q*this.cosph0,h=(D-Math.sin(g)*this.sinph0)*N;break;case this.N_POLE:h=-h,g=a-g;break;case this.S_POLE:g-=a;break}y=h===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(u,h)}else{if(k=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(u/=this.dd,h*=this.dd,P=Math.sqrt(u*u+h*h),P<m)return o.x=this.long0,o.y=this.lat0,o;M=2*Math.asin(.5*P/this.rq),_=Math.cos(M),u*=M=Math.sin(M),this.mode===this.OBLIQ?(k=_*this.sinb1+h*M*this.cosb1/P,E=this.qp*k,h=P*this.cosb1*_-h*this.sinb1*M):(k=h*M/P,E=this.qp*k,h=P*_)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),E=u*u+h*h,!E)return o.x=this.long0,o.y=this.lat0,o;k=1-E/this.qp,this.mode===this.S_POLE&&(k=-k)}y=Math.atan2(u,h),g=Rh(Math.asin(k),this.apa)}return o.x=Z(this.long0+y),o.y=g,o}var vh=.3333333333333333,wh=.17222222222222222,_h=.10257936507936508,Sh=.06388888888888888,xh=.0664021164021164,Mh=.016415012942191543;function Eh(o){var u,h=[];return h[0]=o*vh,u=o*o,h[0]+=u*wh,h[1]=u*Sh,u*=o,h[0]+=u*_h,h[1]+=u*xh,h[2]=u*Mh,h}function Rh(o,u){var h=o+o;return o+u[0]*Math.sin(h)+u[1]*Math.sin(h+h)+u[2]*Math.sin(h+h+h)}var Ch=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],wl={init:Ws,forward:yh,inverse:bh,names:Ch,S_POLE:mh,N_POLE:Xi,EQUIT:vl,OBLIQ:gh},Yr=function(o){return Math.abs(o)>1&&(o=o>1?1:-1),Math.asin(o)};function Ah(){Math.abs(this.lat1+this.lat2)<m||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Nt(this.e3,this.sin_po,this.cos_po),this.qs1=pr(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Nt(this.e3,this.sin_po,this.cos_po),this.qs2=pr(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=pr(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>m?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Xr(o){var u=o.x,h=o.y;this.sin_phi=Math.sin(h),this.cos_phi=Math.cos(h);var y=pr(this.e3,this.sin_phi,this.cos_phi),g=this.a*Math.sqrt(this.c-this.ns0*y)/this.ns0,_=this.ns0*Z(u-this.long0),M=g*Math.sin(_)+this.x0,E=this.rh-g*Math.cos(_)+this.y0;return o.x=M,o.y=E,o}function La(o){var u,h,y,g,_,M;return o.x-=this.x0,o.y=this.rh-o.y+this.y0,this.ns0>=0?(u=Math.sqrt(o.x*o.x+o.y*o.y),y=1):(u=-Math.sqrt(o.x*o.x+o.y*o.y),y=-1),g=0,u!==0&&(g=Math.atan2(y*o.x,y*o.y)),y=u*this.ns0/this.a,this.sphere?M=Math.asin((this.c-y*y)/(2*this.ns0)):(h=(this.c-y*y)/this.ns0,M=this.phi1z(this.e3,h)),_=Z(g/this.ns0+this.long0),o.x=_,o.y=M,o}function _l(o,u){var h,y,g,_,M,E=Yr(.5*u);if(o<m)return E;for(var P=o*o,k=1;k<=25;k++)if(h=Math.sin(E),y=Math.cos(E),g=o*h,_=1-g*g,M=.5*_*_/y*(u/(1-P)-h/_+.5/o*Math.log((1-g)/(1+g))),E=E+M,Math.abs(M)<=1e-7)return E;return null}var Na=["Albers_Conic_Equal_Area","Albers","aea"],Qr={init:Ah,forward:Xr,inverse:La,names:Na,phi1z:_l};function ei(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Qt(o){var u,h,y,g,_,M,E,P,k=o.x,D=o.y;return y=Z(k-this.long0),u=Math.sin(D),h=Math.cos(D),g=Math.cos(y),M=this.sin_p14*u+this.cos_p14*h*g,_=1,M>0||Math.abs(M)<=m?(E=this.x0+this.a*_*h*Math.sin(y)/M,P=this.y0+this.a*_*(this.cos_p14*u-this.sin_p14*h*g)/M):(E=this.x0+this.infinity_dist*h*Math.sin(y),P=this.y0+this.infinity_dist*(this.cos_p14*u-this.sin_p14*h*g)),o.x=E,o.y=P,o}function Fn(o){var u,h,y,g,_,M;return o.x=(o.x-this.x0)/this.a,o.y=(o.y-this.y0)/this.a,o.x/=this.k0,o.y/=this.k0,(u=Math.sqrt(o.x*o.x+o.y*o.y))?(g=Math.atan2(u,this.rc),h=Math.sin(g),y=Math.cos(g),M=Yr(y*this.sin_p14+o.y*h*this.cos_p14/u),_=Math.atan2(o.x*h,u*this.cos_p14*y-o.y*this.sin_p14*h),_=Z(this.long0+_)):(M=this.phic0,_=0),o.x=_,o.y=M,o}var Sl=["gnom"],Ci={init:ei,forward:Qt,inverse:Fn,names:Sl},xl=function(o,u){var h=1-(1-o*o)/(2*o)*Math.log((1-o)/(1+o));if(Math.abs(Math.abs(u)-h)<1e-6)return u<0?-1*a:a;for(var y=Math.asin(.5*u),g,_,M,E,P=0;P<30;P++)if(_=Math.sin(y),M=Math.cos(y),E=o*_,g=Math.pow(1-E*E,2)/(2*M)*(u/(1-o*o)-_/(1-E*E)+.5/o*Math.log((1-E)/(1+E))),y+=g,Math.abs(g)<=1e-10)return y;return NaN};function Ml(){this.sphere||(this.k0=Nt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Fs(o){var u=o.x,h=o.y,y,g,_=Z(u-this.long0);if(this.sphere)y=this.x0+this.a*_*Math.cos(this.lat_ts),g=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var M=pr(this.e,Math.sin(h));y=this.x0+this.a*this.k0*_,g=this.y0+this.a*M*.5/this.k0}return o.x=y,o.y=g,o}function El(o){o.x-=this.x0,o.y-=this.y0;var u,h;return this.sphere?(u=Z(this.long0+o.x/this.a/Math.cos(this.lat_ts)),h=Math.asin(o.y/this.a*Math.cos(this.lat_ts))):(h=xl(this.e,2*o.y*this.k0/this.a),u=Z(this.long0+o.x/(this.a*this.k0))),o.x=u,o.y=h,o}var Rl=["cea"],Cl={init:Ml,forward:Fs,inverse:El,names:Rl};function Hs(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Al(o){var u=o.x,h=o.y,y=Z(u-this.long0),g=kr(h-this.lat0);return o.x=this.x0+this.a*y*this.rc,o.y=this.y0+this.a*g,o}function Pl(o){var u=o.x,h=o.y;return o.x=Z(this.long0+(u-this.x0)/(this.a*this.rc)),o.y=kr(this.lat0+(h-this.y0)/this.a),o}var Ph=["Equirectangular","Equidistant_Cylindrical","eqc"],Th={init:Hs,forward:Al,inverse:Pl,names:Ph},Tl=20;function Ih(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qn(this.es),this.e1=Un(this.es),this.e2=$n(this.es),this.e3=Yi(this.es),this.ml0=this.a*ht(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Gs(o){var u=o.x,h=o.y,y,g,_,M=Z(u-this.long0);if(_=M*Math.sin(h),this.sphere)Math.abs(h)<=m?(y=this.a*M,g=-1*this.a*this.lat0):(y=this.a*Math.sin(_)/Math.tan(h),g=this.a*(kr(h-this.lat0)+(1-Math.cos(_))/Math.tan(h)));else if(Math.abs(h)<=m)y=this.a*M,g=-1*this.ml0;else{var E=Xt(this.a,this.e,Math.sin(h))/Math.tan(h);y=E*Math.sin(_),g=this.a*ht(this.e0,this.e1,this.e2,this.e3,h)-this.ml0+E*(1-Math.cos(_))}return o.x=y+this.x0,o.y=g+this.y0,o}function kh(o){var u,h,y,g,_,M,E,P,k;if(y=o.x-this.x0,g=o.y-this.y0,this.sphere)if(Math.abs(g+this.a*this.lat0)<=m)u=Z(y/this.a+this.long0),h=0;else{M=this.lat0+g/this.a,E=y*y/this.a/this.a+M*M,P=M;var D;for(_=Tl;_;--_)if(D=Math.tan(P),k=-1*(M*(P*D+1)-P-.5*(P*P+E)*D)/((P-M)/D-1),P+=k,Math.abs(k)<=m){h=P;break}u=Z(this.long0+Math.asin(y*Math.tan(P)/this.a)/Math.sin(h))}else if(Math.abs(g+this.ml0)<=m)h=0,u=Z(this.long0+y/this.a);else{M=(this.ml0+g)/this.a,E=y*y/this.a/this.a+M*M,P=M;var N,q,F,W,V;for(_=Tl;_;--_)if(V=this.e*Math.sin(P),N=Math.sqrt(1-V*V)*Math.tan(P),q=this.a*ht(this.e0,this.e1,this.e2,this.e3,P),F=this.e0-2*this.e1*Math.cos(2*P)+4*this.e2*Math.cos(4*P)-6*this.e3*Math.cos(6*P),W=q/this.a,k=(M*(N*W+1)-W-.5*N*(W*W+E))/(this.es*Math.sin(2*P)*(W*W+E-2*M*W)/(4*N)+(M-W)*(N*F-2/Math.sin(2*P))-F),P-=k,Math.abs(k)<=m){h=P;break}N=Math.sqrt(1-this.es*Math.pow(Math.sin(h),2))*Math.tan(h),u=Z(this.long0+Math.asin(y*N/this.a)/Math.sin(h))}return o.x=u,o.y=h,o}var Il=["Polyconic","poly"],Vs={init:Ih,forward:Gs,inverse:kh,names:Il};function Ks(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Zs(o){var u,h=o.x,y=o.y,g=y-this.lat0,_=h-this.long0,M=g/s*1e-5,E=_,P=1,k=0;for(u=1;u<=10;u++)P=P*M,k=k+this.A[u]*P;var D=k,N=E,q=1,F=0,W,V,K=0,ae=0;for(u=1;u<=6;u++)W=q*D-F*N,V=F*D+q*N,q=W,F=V,K=K+this.B_re[u]*q-this.B_im[u]*F,ae=ae+this.B_im[u]*q+this.B_re[u]*F;return o.x=ae*this.a+this.x0,o.y=K*this.a+this.y0,o}function Hn(o){var u,h=o.x,y=o.y,g=h-this.x0,_=y-this.y0,M=_/this.a,E=g/this.a,P=1,k=0,D,N,q=0,F=0;for(u=1;u<=6;u++)D=P*M-k*E,N=k*M+P*E,P=D,k=N,q=q+this.C_re[u]*P-this.C_im[u]*k,F=F+this.C_im[u]*P+this.C_re[u]*k;for(var W=0;W<this.iterations;W++){var V=q,K=F,ae,pe,Oe=M,Ke=E;for(u=2;u<=6;u++)ae=V*q-K*F,pe=K*q+V*F,V=ae,K=pe,Oe=Oe+(u-1)*(this.B_re[u]*V-this.B_im[u]*K),Ke=Ke+(u-1)*(this.B_im[u]*V+this.B_re[u]*K);V=1,K=0;var Le=this.B_re[1],Be=this.B_im[1];for(u=2;u<=6;u++)ae=V*q-K*F,pe=K*q+V*F,V=ae,K=pe,Le=Le+u*(this.B_re[u]*V-this.B_im[u]*K),Be=Be+u*(this.B_im[u]*V+this.B_re[u]*K);var wt=Le*Le+Be*Be;q=(Oe*Le+Ke*Be)/wt,F=(Ke*Le-Oe*Be)/wt}var tt=q,ii=F,Vn=1,Kn=0;for(u=1;u<=9;u++)Vn=Vn*tt,Kn=Kn+this.D[u]*Vn;var Bl=this.lat0+Kn*s*1e5,kg=this.long0+ii;return o.x=kg,o.y=Bl,o}var Js=["New_Zealand_Map_Grid","nzmg"],Oh={init:Ks,forward:Zs,inverse:Hn,names:Js};function Lh(){}function kl(o){var u=o.x,h=o.y,y=Z(u-this.long0),g=this.x0+this.a*y,_=this.y0+this.a*Math.log(Math.tan(Math.PI/4+h/2.5))*1.25;return o.x=g,o.y=_,o}function Ol(o){o.x-=this.x0,o.y-=this.y0;var u=Z(this.long0+o.x/this.a),h=2.5*(Math.atan(Math.exp(.8*o.y/this.a))-Math.PI/4);return o.x=u,o.y=h,o}var Nh=["Miller_Cylindrical","mill"],Ll={init:Lh,forward:kl,inverse:Ol,names:Nh},Dh=20;function Bh(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Gi(this.es)}function zh(o){var u,h,y=o.x,g=o.y;if(y=Z(y-this.long0),this.sphere){if(!this.m)g=this.n!==1?Math.asin(this.n*Math.sin(g)):g;else for(var _=this.n*Math.sin(g),M=Dh;M;--M){var E=(this.m*g+Math.sin(g)-_)/(this.m+Math.cos(g));if(g-=E,Math.abs(E)<m)break}u=this.a*this.C_x*y*(this.m+Math.cos(g)),h=this.a*this.C_y*g}else{var P=Math.sin(g),k=Math.cos(g);h=this.a*Bn(g,P,k,this.en),u=this.a*y*k/Math.sqrt(1-this.es*P*P)}return o.x=u,o.y=h,o}function jh(o){var u,h,y,g;return o.x-=this.x0,y=o.x/this.a,o.y-=this.y0,u=o.y/this.a,this.sphere?(u/=this.C_y,y=y/(this.C_x*(this.m+Math.cos(u))),this.m?u=Yr((this.m*u+Math.sin(u))/this.n):this.n!==1&&(u=Yr(Math.sin(u)/this.n)),y=Z(y+this.long0),u=kr(u)):(u=xa(o.y/this.a,this.es,this.en),g=Math.abs(u),g<a?(g=Math.sin(u),h=this.long0+o.x*Math.sqrt(1-this.es*g*g)/(this.a*Math.cos(u)),y=Z(h)):g-m<a&&(y=this.long0)),o.x=y,o.y=u,o}var qh=["Sinusoidal","sinu"],Ys={init:Bh,forward:zh,inverse:jh,names:qh};function Nl(){}function l(o){for(var u=o.x,h=o.y,y=Z(u-this.long0),g=h,_=Math.PI*Math.sin(h);;){var M=-(g+Math.sin(g)-_)/(1+Math.cos(g));if(g+=M,Math.abs(M)<m)break}g/=2,Math.PI/2-Math.abs(h)<m&&(y=0);var E=.900316316158*this.a*y*Math.cos(g)+this.x0,P=1.4142135623731*this.a*Math.sin(g)+this.y0;return o.x=E,o.y=P,o}function f(o){var u,h;o.x-=this.x0,o.y-=this.y0,h=o.y/(1.4142135623731*this.a),Math.abs(h)>.999999999999&&(h=.999999999999),u=Math.asin(h);var y=Z(this.long0+o.x/(.900316316158*this.a*Math.cos(u)));y<-Math.PI&&(y=-Math.PI),y>Math.PI&&(y=Math.PI),h=(2*u+Math.sin(2*u))/Math.PI,Math.abs(h)>1&&(h=1);var g=Math.asin(h);return o.x=y,o.y=g,o}var b=["Mollweide","moll"],I={init:Nl,forward:l,inverse:f,names:b};function L(){Math.abs(this.lat1+this.lat2)<m||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qn(this.es),this.e1=Un(this.es),this.e2=$n(this.es),this.e3=Yi(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Nt(this.e,this.sinphi,this.cosphi),this.ml1=ht(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<m?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Nt(this.e,this.sinphi,this.cosphi),this.ml2=ht(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=ht(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function j(o){var u=o.x,h=o.y,y;if(this.sphere)y=this.a*(this.g-h);else{var g=ht(this.e0,this.e1,this.e2,this.e3,h);y=this.a*(this.g-g)}var _=this.ns*Z(u-this.long0),M=this.x0+y*Math.sin(_),E=this.y0+this.rh-y*Math.cos(_);return o.x=M,o.y=E,o}function $(o){o.x-=this.x0,o.y=this.rh-o.y+this.y0;var u,h,y,g;this.ns>=0?(h=Math.sqrt(o.x*o.x+o.y*o.y),u=1):(h=-Math.sqrt(o.x*o.x+o.y*o.y),u=-1);var _=0;if(h!==0&&(_=Math.atan2(u*o.x,u*o.y)),this.sphere)return g=Z(this.long0+_/this.ns),y=kr(this.g-h/this.a),o.x=g,o.y=y,o;var M=this.g-h/this.a;return y=Zr(M,this.e0,this.e1,this.e2,this.e3),g=Z(this.long0+_/this.ns),o.x=g,o.y=y,o}var ee=["Equidistant_Conic","eqdc"],ce={init:L,forward:j,inverse:$,names:ee};function ve(){this.R=this.a}function Ce(o){var u=o.x,h=o.y,y=Z(u-this.long0),g,_;Math.abs(h)<=m&&(g=this.x0+this.R*y,_=this.y0);var M=Yr(2*Math.abs(h/Math.PI));(Math.abs(y)<=m||Math.abs(Math.abs(h)-a)<=m)&&(g=this.x0,h>=0?_=this.y0+Math.PI*this.R*Math.tan(.5*M):_=this.y0+Math.PI*this.R*-Math.tan(.5*M));var E=.5*Math.abs(Math.PI/y-y/Math.PI),P=E*E,k=Math.sin(M),D=Math.cos(M),N=D/(k+D-1),q=N*N,F=N*(2/k-1),W=F*F,V=Math.PI*this.R*(E*(N-W)+Math.sqrt(P*(N-W)*(N-W)-(W+P)*(q-W)))/(W+P);y<0&&(V=-V),g=this.x0+V;var K=P+N;return V=Math.PI*this.R*(F*K-E*Math.sqrt((W+P)*(P+1)-K*K))/(W+P),h>=0?_=this.y0+V:_=this.y0-V,o.x=g,o.y=_,o}function Ae(o){var u,h,y,g,_,M,E,P,k,D,N,q,F;return o.x-=this.x0,o.y-=this.y0,N=Math.PI*this.R,y=o.x/N,g=o.y/N,_=y*y+g*g,M=-Math.abs(g)*(1+_),E=M-2*g*g+y*y,P=-2*M+1+2*g*g+_*_,F=g*g/P+(2*E*E*E/P/P/P-9*M*E/P/P)/27,k=(M-E*E/3/P)/P,D=2*Math.sqrt(-k/3),N=3*F/k/D,Math.abs(N)>1&&(N>=0?N=1:N=-1),q=Math.acos(N)/3,o.y>=0?h=(-D*Math.cos(q+Math.PI/3)-E/3/P)*Math.PI:h=-(-D*Math.cos(q+Math.PI/3)-E/3/P)*Math.PI,Math.abs(y)<m?u=this.long0:u=Z(this.long0+Math.PI*(_-1+Math.sqrt(1+2*(y*y-g*g)+_*_))/2/y),o.x=u,o.y=h,o}var et=["Van_der_Grinten_I","VanDerGrinten","vandg"],er={init:ve,forward:Ce,inverse:Ae,names:et};function Qi(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function ti(o){var u=o.x,h=o.y,y=Math.sin(o.y),g=Math.cos(o.y),_=Z(u-this.long0),M,E,P,k,D,N,q,F,W,V,K,ae,pe,Oe,Ke,Le,Be,wt,tt,ii,Vn,Kn,Bl;return this.sphere?Math.abs(this.sin_p12-1)<=m?(o.x=this.x0+this.a*(a-h)*Math.sin(_),o.y=this.y0-this.a*(a-h)*Math.cos(_),o):Math.abs(this.sin_p12+1)<=m?(o.x=this.x0+this.a*(a+h)*Math.sin(_),o.y=this.y0+this.a*(a+h)*Math.cos(_),o):(wt=this.sin_p12*y+this.cos_p12*g*Math.cos(_),Le=Math.acos(wt),Be=Le?Le/Math.sin(Le):1,o.x=this.x0+this.a*Be*g*Math.sin(_),o.y=this.y0+this.a*Be*(this.cos_p12*y-this.sin_p12*g*Math.cos(_)),o):(M=qn(this.es),E=Un(this.es),P=$n(this.es),k=Yi(this.es),Math.abs(this.sin_p12-1)<=m?(D=this.a*ht(M,E,P,k,a),N=this.a*ht(M,E,P,k,h),o.x=this.x0+(D-N)*Math.sin(_),o.y=this.y0-(D-N)*Math.cos(_),o):Math.abs(this.sin_p12+1)<=m?(D=this.a*ht(M,E,P,k,a),N=this.a*ht(M,E,P,k,h),o.x=this.x0+(D+N)*Math.sin(_),o.y=this.y0+(D+N)*Math.cos(_),o):(q=y/g,F=Xt(this.a,this.e,this.sin_p12),W=Xt(this.a,this.e,y),V=Math.atan((1-this.es)*q+this.es*F*this.sin_p12/(W*g)),K=Math.atan2(Math.sin(_),this.cos_p12*Math.tan(V)-this.sin_p12*Math.cos(_)),K===0?tt=Math.asin(this.cos_p12*Math.sin(V)-this.sin_p12*Math.cos(V)):Math.abs(Math.abs(K)-Math.PI)<=m?tt=-Math.asin(this.cos_p12*Math.sin(V)-this.sin_p12*Math.cos(V)):tt=Math.asin(Math.sin(_)*Math.cos(V)/Math.sin(K)),ae=this.e*this.sin_p12/Math.sqrt(1-this.es),pe=this.e*this.cos_p12*Math.cos(K)/Math.sqrt(1-this.es),Oe=ae*pe,Ke=pe*pe,ii=tt*tt,Vn=ii*tt,Kn=Vn*tt,Bl=Kn*tt,Le=F*tt*(1-ii*Ke*(1-Ke)/6+Vn/8*Oe*(1-2*Ke)+Kn/120*(Ke*(4-7*Ke)-3*ae*ae*(1-7*Ke))-Bl/48*Oe),o.x=this.x0+Le*Math.sin(K),o.y=this.y0+Le*Math.cos(K),o))}function Or(o){o.x-=this.x0,o.y-=this.y0;var u,h,y,g,_,M,E,P,k,D,N,q,F,W,V,K,ae,pe,Oe,Ke,Le,Be,wt,tt;return this.sphere?(u=Math.sqrt(o.x*o.x+o.y*o.y),u>2*a*this.a?void 0:(h=u/this.a,y=Math.sin(h),g=Math.cos(h),_=this.long0,Math.abs(u)<=m?M=this.lat0:(M=Yr(g*this.sin_p12+o.y*y*this.cos_p12/u),E=Math.abs(this.lat0)-a,Math.abs(E)<=m?this.lat0>=0?_=Z(this.long0+Math.atan2(o.x,-o.y)):_=Z(this.long0-Math.atan2(-o.x,o.y)):_=Z(this.long0+Math.atan2(o.x*y,u*this.cos_p12*g-o.y*this.sin_p12*y))),o.x=_,o.y=M,o)):(P=qn(this.es),k=Un(this.es),D=$n(this.es),N=Yi(this.es),Math.abs(this.sin_p12-1)<=m?(q=this.a*ht(P,k,D,N,a),u=Math.sqrt(o.x*o.x+o.y*o.y),F=q-u,M=Zr(F/this.a,P,k,D,N),_=Z(this.long0+Math.atan2(o.x,-1*o.y)),o.x=_,o.y=M,o):Math.abs(this.sin_p12+1)<=m?(q=this.a*ht(P,k,D,N,a),u=Math.sqrt(o.x*o.x+o.y*o.y),F=u-q,M=Zr(F/this.a,P,k,D,N),_=Z(this.long0+Math.atan2(o.x,o.y)),o.x=_,o.y=M,o):(u=Math.sqrt(o.x*o.x+o.y*o.y),K=Math.atan2(o.x,o.y),W=Xt(this.a,this.e,this.sin_p12),ae=Math.cos(K),pe=this.e*this.cos_p12*ae,Oe=-pe*pe/(1-this.es),Ke=3*this.es*(1-Oe)*this.sin_p12*this.cos_p12*ae/(1-this.es),Le=u/W,Be=Le-Oe*(1+Oe)*Math.pow(Le,3)/6-Ke*(1+3*Oe)*Math.pow(Le,4)/24,wt=1-Oe*Be*Be/2-Le*Be*Be*Be/6,V=Math.asin(this.sin_p12*Math.cos(Be)+this.cos_p12*Math.sin(Be)*ae),_=Z(this.long0+Math.asin(Math.sin(K)*Math.sin(Be)/Math.cos(V))),tt=Math.sin(V),M=Math.atan2((tt-this.es*wt*this.sin_p12)*Math.tan(V),tt*(1-this.es)),o.x=_,o.y=M,o))}var gt=["Azimuthal_Equidistant","aeqd"],bt={init:Qi,forward:ti,inverse:Or,names:gt};function Bt(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Lr(o){var u,h,y,g,_,M,E,P,k=o.x,D=o.y;return y=Z(k-this.long0),u=Math.sin(D),h=Math.cos(D),g=Math.cos(y),M=this.sin_p14*u+this.cos_p14*h*g,_=1,(M>0||Math.abs(M)<=m)&&(E=this.a*_*h*Math.sin(y),P=this.y0+this.a*_*(this.cos_p14*u-this.sin_p14*h*g)),o.x=E,o.y=P,o}function re(o){var u,h,y,g,_,M,E;return o.x-=this.x0,o.y-=this.y0,u=Math.sqrt(o.x*o.x+o.y*o.y),h=Yr(u/this.a),y=Math.sin(h),g=Math.cos(h),M=this.long0,Math.abs(u)<=m?(E=this.lat0,o.x=M,o.y=E,o):(E=Yr(g*this.sin_p14+o.y*y*this.cos_p14/u),_=Math.abs(this.lat0)-a,Math.abs(_)<=m?(this.lat0>=0?M=Z(this.long0+Math.atan2(o.x,-o.y)):M=Z(this.long0-Math.atan2(-o.x,o.y)),o.x=M,o.y=E,o):(M=Z(this.long0+Math.atan2(o.x*y,u*this.cos_p14*g-o.y*this.sin_p14*y)),o.x=M,o.y=E,o))}var me=["ortho"],Ue={init:Bt,forward:Lr,inverse:re,names:me},we={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},_e={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function en(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=a-v/2?this.face=we.TOP:this.lat0<=-(a-v/2)?this.face=we.BOTTOM:Math.abs(this.long0)<=v?this.face=we.FRONT:Math.abs(this.long0)<=a+v?this.face=this.long0>0?we.RIGHT:we.LEFT:this.face=we.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function tn(o){var u={x:0,y:0},h,y,g,_,M,E,P={value:0};if(o.x-=this.long0,this.es!==0?h=Math.atan(this.one_minus_f_squared*Math.tan(o.y)):h=o.y,y=o.x,this.face===we.TOP)_=a-h,y>=v&&y<=a+v?(P.value=_e.AREA_0,g=y-a):y>a+v||y<=-(a+v)?(P.value=_e.AREA_1,g=y>0?y-x:y+x):y>-(a+v)&&y<=-v?(P.value=_e.AREA_2,g=y+a):(P.value=_e.AREA_3,g=y);else if(this.face===we.BOTTOM)_=a+h,y>=v&&y<=a+v?(P.value=_e.AREA_0,g=-y+a):y<v&&y>=-v?(P.value=_e.AREA_1,g=-y):y<-v&&y>=-(a+v)?(P.value=_e.AREA_2,g=-y-a):(P.value=_e.AREA_3,g=y>0?-y+x:-y-x);else{var k,D,N,q,F,W,V;this.face===we.RIGHT?y=ri(y,+a):this.face===we.BACK?y=ri(y,+x):this.face===we.LEFT&&(y=ri(y,-a)),q=Math.sin(h),F=Math.cos(h),W=Math.sin(y),V=Math.cos(y),k=F*V,D=F*W,N=q,this.face===we.FRONT?(_=Math.acos(k),g=Gn(_,N,D,P)):this.face===we.RIGHT?(_=Math.acos(D),g=Gn(_,N,-k,P)):this.face===we.BACK?(_=Math.acos(-k),g=Gn(_,N,-D,P)):this.face===we.LEFT?(_=Math.acos(-D),g=Gn(_,N,k,P)):(_=g=0,P.value=_e.AREA_0)}return E=Math.atan(12/x*(g+Math.acos(Math.sin(g)*Math.cos(v))-a)),M=Math.sqrt((1-Math.cos(_))/(Math.cos(E)*Math.cos(E))/(1-Math.cos(Math.atan(1/Math.cos(g))))),P.value===_e.AREA_1?E+=a:P.value===_e.AREA_2?E+=x:P.value===_e.AREA_3&&(E+=1.5*x),u.x=M*Math.cos(E),u.y=M*Math.sin(E),u.x=u.x*this.a+this.x0,u.y=u.y*this.a+this.y0,o.x=u.x,o.y=u.y,o}function Xs(o){var u={lam:0,phi:0},h,y,g,_,M,E,P,k,D,N={value:0};if(o.x=(o.x-this.x0)/this.a,o.y=(o.y-this.y0)/this.a,y=Math.atan(Math.sqrt(o.x*o.x+o.y*o.y)),h=Math.atan2(o.y,o.x),o.x>=0&&o.x>=Math.abs(o.y)?N.value=_e.AREA_0:o.y>=0&&o.y>=Math.abs(o.x)?(N.value=_e.AREA_1,h-=a):o.x<0&&-o.x>=Math.abs(o.y)?(N.value=_e.AREA_2,h=h<0?h+x:h-x):(N.value=_e.AREA_3,h+=a),D=x/12*Math.tan(h),M=Math.sin(D)/(Math.cos(D)-1/Math.sqrt(2)),E=Math.atan(M),g=Math.cos(h),_=Math.tan(y),P=1-g*g*_*_*(1-Math.cos(Math.atan(1/Math.cos(E)))),P<-1?P=-1:P>1&&(P=1),this.face===we.TOP)k=Math.acos(P),u.phi=a-k,N.value===_e.AREA_0?u.lam=E+a:N.value===_e.AREA_1?u.lam=E<0?E+x:E-x:N.value===_e.AREA_2?u.lam=E-a:u.lam=E;else if(this.face===we.BOTTOM)k=Math.acos(P),u.phi=k-a,N.value===_e.AREA_0?u.lam=-E+a:N.value===_e.AREA_1?u.lam=-E:N.value===_e.AREA_2?u.lam=-E-a:u.lam=E<0?-E-x:-E+x;else{var q,F,W;q=P,D=q*q,D>=1?W=0:W=Math.sqrt(1-D)*Math.sin(E),D+=W*W,D>=1?F=0:F=Math.sqrt(1-D),N.value===_e.AREA_1?(D=F,F=-W,W=D):N.value===_e.AREA_2?(F=-F,W=-W):N.value===_e.AREA_3&&(D=F,F=W,W=-D),this.face===we.RIGHT?(D=q,q=-F,F=D):this.face===we.BACK?(q=-q,F=-F):this.face===we.LEFT&&(D=q,q=F,F=-D),u.phi=Math.acos(-W)-a,u.lam=Math.atan2(F,q),this.face===we.RIGHT?u.lam=ri(u.lam,-a):this.face===we.BACK?u.lam=ri(u.lam,-x):this.face===we.LEFT&&(u.lam=ri(u.lam,+a))}if(this.es!==0){var V,K,ae;V=u.phi<0?1:0,K=Math.tan(u.phi),ae=this.b/Math.sqrt(K*K+this.one_minus_f_squared),u.phi=Math.atan(Math.sqrt(this.a*this.a-ae*ae)/(this.one_minus_f*ae)),V&&(u.phi=-u.phi)}return u.lam+=this.long0,o.x=u.lam,o.y=u.phi,o}function Gn(o,u,h,y){var g;return o<m?(y.value=_e.AREA_0,g=0):(g=Math.atan2(u,h),Math.abs(g)<=v?y.value=_e.AREA_0:g>v&&g<=a+v?(y.value=_e.AREA_1,g-=a):g>a+v||g<=-(a+v)?(y.value=_e.AREA_2,g=g>=0?g-x:g+x):(y.value=_e.AREA_3,g+=a)),g}function ri(o,u){var h=o+u;return h<-x?h+=R:h>+x&&(h-=R),h}var hg=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],fg={init:en,forward:tn,inverse:Xs,names:hg},Uh=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Da=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Xd=.8487,Qd=1.3523,e2=S/5,dg=1/e2,Qs=18,Dl=function(o,u){return o[0]+u*(o[1]+u*(o[2]+u*o[3]))},pg=function(o,u){return o[1]+u*(2*o[2]+u*3*o[3])};function mg(o,u,h,y){for(var g=u;y;--y){var _=o(g);if(g-=_,Math.abs(_)<h)break}return g}function gg(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function yg(o){var u=Z(o.x-this.long0),h=Math.abs(o.y),y=Math.floor(h*e2);y<0?y=0:y>=Qs&&(y=Qs-1),h=S*(h-dg*y);var g={x:Dl(Uh[y],h)*u,y:Dl(Da[y],h)};return o.y<0&&(g.y=-g.y),g.x=g.x*this.a*Xd+this.x0,g.y=g.y*this.a*Qd+this.y0,g}function bg(o){var u={x:(o.x-this.x0)/(this.a*Xd),y:Math.abs(o.y-this.y0)/(this.a*Qd)};if(u.y>=1)u.x/=Uh[Qs][0],u.y=o.y<0?-a:a;else{var h=Math.floor(u.y*Qs);for(h<0?h=0:h>=Qs&&(h=Qs-1);;)if(Da[h][0]>u.y)--h;else if(Da[h+1][0]<=u.y)++h;else break;var y=Da[h],g=5*(u.y-y[0])/(Da[h+1][0]-y[0]);g=mg(function(_){return(Dl(y,_)-u.y)/pg(y,_)},g,m,100),u.x/=Dl(Uh[h],g),u.y=(5*h+g)*w,o.y<0&&(u.y=-u.y)}return u.x=Z(u.x+this.long0),u}var vg=["Robinson","robin"],wg={init:gg,forward:yg,inverse:bg,names:vg};function _g(){this.name="geocent"}function Sg(o){var u=wi(o,this.es,this.a);return u}function xg(o){var u=Vr(o,this.es,this.a,this.b);return u}var Mg=["Geocentric","geocentric","geocent","Geocent"],Eg={init:_g,forward:Sg,inverse:xg,names:Mg},vt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Ba={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Rg(){if(Object.keys(Ba).forEach(function(h){if(typeof this[h]>"u")this[h]=Ba[h].def;else{if(Ba[h].num&&isNaN(this[h]))throw new Error("Invalid parameter value, must be numeric "+h+" = "+this[h]);Ba[h].num&&(this[h]=parseFloat(this[h]))}Ba[h].degrees&&(this[h]=this[h]*w)}.bind(this)),Math.abs(Math.abs(this.lat0)-a)<m?this.mode=this.lat0<0?vt.S_POLE:vt.N_POLE:Math.abs(this.lat0)<m?this.mode=vt.EQUIT:(this.mode=vt.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var o=this.tilt,u=this.azi;this.cg=Math.cos(u),this.sg=Math.sin(u),this.cw=Math.cos(o),this.sw=Math.sin(o)}function Cg(o){o.x-=this.long0;var u=Math.sin(o.y),h=Math.cos(o.y),y=Math.cos(o.x),g,_;switch(this.mode){case vt.OBLIQ:_=this.sinph0*u+this.cosph0*h*y;break;case vt.EQUIT:_=h*y;break;case vt.S_POLE:_=-u;break;case vt.N_POLE:_=u;break}switch(_=this.pn1/(this.p-_),g=_*h*Math.sin(o.x),this.mode){case vt.OBLIQ:_*=this.cosph0*u-this.sinph0*h*y;break;case vt.EQUIT:_*=u;break;case vt.N_POLE:_*=-(h*y);break;case vt.S_POLE:_*=h*y;break}var M,E;return M=_*this.cg+g*this.sg,E=1/(M*this.sw*this.h1+this.cw),g=(g*this.cg-_*this.sg)*this.cw*E,_=M*E,o.x=g*this.a,o.y=_*this.a,o}function Ag(o){o.x/=this.a,o.y/=this.a;var u={x:o.x,y:o.y},h,y,g;g=1/(this.pn1-o.y*this.sw),h=this.pn1*o.x*g,y=this.pn1*o.y*this.cw*g,o.x=h*this.cg+y*this.sg,o.y=y*this.cg-h*this.sg;var _=Zi(o.x,o.y);if(Math.abs(_)<m)u.x=0,u.y=o.y;else{var M,E;switch(E=1-_*_*this.pfact,E=(this.p-Math.sqrt(E))/(this.pn1/_+_/this.pn1),M=Math.sqrt(1-E*E),this.mode){case vt.OBLIQ:u.y=Math.asin(M*this.sinph0+o.y*E*this.cosph0/_),o.y=(M-this.sinph0*Math.sin(u.y))*_,o.x*=E*this.cosph0;break;case vt.EQUIT:u.y=Math.asin(o.y*E/_),o.y=M*_,o.x*=E;break;case vt.N_POLE:u.y=Math.asin(M),o.y=-o.y;break;case vt.S_POLE:u.y=-Math.asin(M);break}u.x=Math.atan2(o.x,o.y)}return o.x=u.x+this.long0,o.y=u.y,o}var Pg=["Tilted_Perspective","tpers"],Tg={init:Rg,forward:Cg,inverse:Ag,names:Pg},Ig=function(o){o.Proj.projections.add(Zc),o.Proj.projections.add(Ji),o.Proj.projections.add(ih),o.Proj.projections.add(oh),o.Proj.projections.add(uh),o.Proj.projections.add(Ta),o.Proj.projections.add(hh),o.Proj.projections.add(ka),o.Proj.projections.add(Oa),o.Proj.projections.add(Jr),o.Proj.projections.add(wl),o.Proj.projections.add(Qr),o.Proj.projections.add(Ci),o.Proj.projections.add(Cl),o.Proj.projections.add(Th),o.Proj.projections.add(Vs),o.Proj.projections.add(Oh),o.Proj.projections.add(Ll),o.Proj.projections.add(Ys),o.Proj.projections.add(I),o.Proj.projections.add(ce),o.Proj.projections.add(er),o.Proj.projections.add(bt),o.Proj.projections.add(Ue),o.Proj.projections.add(fg),o.Proj.projections.add(wg),o.Proj.projections.add(Eg),o.Proj.projections.add(Tg)};return Dt.defaultDatum="WGS84",Dt.Proj=at,Dt.WGS84=new Dt.Proj("WGS84"),Dt.Point=dr,Dt.toPoint=Ln,Dt.defs=dt,Dt.transform=Fi,Dt.mgrs=J1,Dt.version="2.6.3",Ig(Dt),Dt})});var _1=H((ZT,S6)=>{S6.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var id=H(Sn=>{var ze=_1(),rd=()=>[{type:ze.RANGE,from:48,to:57}],x6=()=>[{type:ze.CHAR,value:95},{type:ze.RANGE,from:97,to:122},{type:ze.RANGE,from:65,to:90}].concat(rd()),M6=()=>[{type:ze.CHAR,value:9},{type:ze.CHAR,value:10},{type:ze.CHAR,value:11},{type:ze.CHAR,value:12},{type:ze.CHAR,value:13},{type:ze.CHAR,value:32},{type:ze.CHAR,value:160},{type:ze.CHAR,value:5760},{type:ze.RANGE,from:8192,to:8202},{type:ze.CHAR,value:8232},{type:ze.CHAR,value:8233},{type:ze.CHAR,value:8239},{type:ze.CHAR,value:8287},{type:ze.CHAR,value:12288},{type:ze.CHAR,value:65279}],SS=()=>[{type:ze.CHAR,value:10},{type:ze.CHAR,value:13},{type:ze.CHAR,value:8232},{type:ze.CHAR,value:8233}];Sn.words=()=>({type:ze.SET,set:x6(),not:!1});Sn.notWords=()=>({type:ze.SET,set:x6(),not:!0});Sn.ints=()=>({type:ze.SET,set:rd(),not:!1});Sn.notInts=()=>({type:ze.SET,set:rd(),not:!0});Sn.whitespace=()=>({type:ze.SET,set:M6(),not:!1});Sn.notWhitespace=()=>({type:ze.SET,set:M6(),not:!0});Sn.anyChar=()=>({type:ze.SET,set:SS(),not:!0})});var R6=H(S1=>{var E6=_1(),Go=id(),xS="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",MS={"0":0,t:9,n:10,v:11,f:12,r:13};S1.strToChars=function(t){var e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return t=t.replace(e,function(r,i,n,s,a,c,d,p){if(n)return r;var m=i?8:s?parseInt(s,16):a?parseInt(a,16):c?parseInt(c,8):d?xS.indexOf(d):MS[p],w=String.fromCharCode(m);return/[[\]{}^$.|?*+()]/.test(w)&&(w="\\"+w),w}),t};S1.tokenizeClass=(t,e)=>{for(var r=[],i=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,n,s;(n=i.exec(t))!=null;)if(n[1])r.push(Go.words());else if(n[2])r.push(Go.ints());else if(n[3])r.push(Go.whitespace());else if(n[4])r.push(Go.notWords());else if(n[5])r.push(Go.notInts());else if(n[6])r.push(Go.notWhitespace());else if(n[7])r.push({type:E6.RANGE,from:(n[8]||n[9]).charCodeAt(0),to:n[10].charCodeAt(0)});else if(s=n[12])r.push({type:E6.CHAR,value:s.charCodeAt(0)});else return[r,i.lastIndex];S1.error(e,"Unterminated character class")};S1.error=(t,e)=>{throw new SyntaxError("Invalid regular expression: /"+t+"/: "+e)}});var C6=H(x1=>{var Yu=_1();x1.wordBoundary=()=>({type:Yu.POSITION,value:"b"});x1.nonWordBoundary=()=>({type:Yu.POSITION,value:"B"});x1.begin=()=>({type:Yu.POSITION,value:"^"});x1.end=()=>({type:Yu.POSITION,value:"$"})});var A6=H((QT,nd)=>{var Vo=R6(),Er=_1(),vs=id(),Xu=C6();nd.exports=t=>{var e=0,r,i,n={type:Er.ROOT,stack:[]},s=n,a=n.stack,c=[],d=C=>{Vo.error(t,`Nothing to repeat at column ${C-1}`)},p=Vo.strToChars(t);for(r=p.length;e<r;)switch(i=p[e++],i){case"\\":switch(i=p[e++],i){case"b":a.push(Xu.wordBoundary());break;case"B":a.push(Xu.nonWordBoundary());break;case"w":a.push(vs.words());break;case"W":a.push(vs.notWords());break;case"d":a.push(vs.ints());break;case"D":a.push(vs.notInts());break;case"s":a.push(vs.whitespace());break;case"S":a.push(vs.notWhitespace());break;default:/\d/.test(i)?a.push({type:Er.REFERENCE,value:parseInt(i,10)}):a.push({type:Er.CHAR,value:i.charCodeAt(0)})}break;case"^":a.push(Xu.begin());break;case"$":a.push(Xu.end());break;case"[":var m;p[e]==="^"?(m=!0,e++):m=!1;var w=Vo.tokenizeClass(p.slice(e),t);e+=w[1],a.push({type:Er.SET,set:w[0],not:m});break;case".":a.push(vs.anyChar());break;case"(":var S={type:Er.GROUP,stack:[],remember:!0};i=p[e],i==="?"&&(i=p[e+1],e+=2,i==="="?S.followedBy=!0:i==="!"?S.notFollowedBy=!0:i!==":"&&Vo.error(t,`Invalid group, character '${i}' after '?' at column ${e-1}`),S.remember=!1),a.push(S),c.push(s),s=S,a=S.stack;break;case")":c.length===0&&Vo.error(t,`Unmatched ) at column ${e-1}`),s=c.pop(),a=s.options?s.options[s.options.length-1]:s.stack;break;case"|":s.options||(s.options=[s.stack],delete s.stack);var v=[];s.options.push(v),a=v;break;case"{":var R=/^(\d+)(,(\d+)?)?\}/.exec(p.slice(e)),x,A;R!==null?(a.length===0&&d(e),x=parseInt(R[1],10),A=R[2]?R[3]?parseInt(R[3],10):1/0:x,e+=R[0].length,a.push({type:Er.REPETITION,min:x,max:A,value:a.pop()})):a.push({type:Er.CHAR,value:123});break;case"?":a.length===0&&d(e),a.push({type:Er.REPETITION,min:0,max:1,value:a.pop()});break;case"+":a.length===0&&d(e),a.push({type:Er.REPETITION,min:1,max:1/0,value:a.pop()});break;case"*":a.length===0&&d(e),a.push({type:Er.REPETITION,min:0,max:1/0,value:a.pop()});break;default:a.push({type:Er.CHAR,value:i.charCodeAt(0)})}return c.length!==0&&Vo.error(t,"Unterminated group"),n};nd.exports.types=Er});var I6=H((eI,T6)=>{"use strict";var P6=A6(),ES=P6.types;T6.exports=function(t,e){e||(e={});var r=e.limit===void 0?25:e.limit;RS(t)?t=t.source:typeof t!="string"&&(t=String(t));try{t=P6(t)}catch{return!1}var i=0;return function n(s,a){var c,d,p;if(s.type===ES.REPETITION&&(a++,i++,a>1||i>r))return!1;if(s.options){for(c=0,p=s.options.length;c<p;c++)if(d=n({stack:s.options[c]},a),!d)return!1}var m=s.stack||s.value&&s.value.stack;if(!m)return!0;for(c=0;c<m.length;c++)if(d=n(m[c],a),!d)return!1;return!0}(t,0)};function RS(t){return{}.toString.call(t)==="[object RegExp]"}});var O6=H((tI,k6)=>{"use strict";k6.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,n,s;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),i=s.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[n]))return!1;for(n=i;n--!==0;){var a=s[n];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var $6=H((rI,U6)=>{"use strict";var Ko=" ",Zo="\u2502 ",L6="\u251C\u2500\u2500 ",N6="\u2514\u2500\u2500 ",D6="*",M1="/",B6=/(?=\/)/;function CS(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function z6(t){return Array.isArray(t)?t.map(e=>z6(e)):typeof t=="symbol"?t.toString():typeof t=="function"?CS(t):t}function sd(t,e){let r={},i=this.buildPrettyMeta(t);return Array.isArray(e)||(e=i?Reflect.ownKeys(i):[]),e.forEach(n=>{let s=typeof n=="symbol"?n.toString():n;i&&i[n]&&(r[s]=z6(i[n]))}),r}function AS(t,e={}){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");e.includeMeta=e.includeMeta||null;let r=[],i="";t.sort((s,a)=>!s.path||!a.path?0:s.path.localeCompare(a.path));for(let s=0;s<t.length;s++){let a=t[s],c=r.find(p=>a.path===p.path);if(c){c.handlers.push({method:a.method,opts:a.opts.constraints||void 0,meta:e.includeMeta?sd.call(this,a,e.includeMeta):null});continue}let d={method:a.method,opts:a.opts.constraints||void 0,meta:e.includeMeta?sd.call(this,a,e.includeMeta):null};r.push({path:a.path,methods:[a.method],opts:[a.opts],handlers:[d]})}if(!r.filter(s=>s.path===M1).length){let s={path:M1,truncatedPath:"",methods:[],opts:[],handlers:[{}]};r.filter(a=>a.path===D6).length?r.splice(1,0,s):r.unshift(s)}let n=PS(r);return n.forEach((s,a)=>{i+=j6(s,null,a===n.length-1,!1,!0),i+=`
109
- `}),i}function PS(t,e){e=e||M1;let r=[],i={result:r};return t.forEach((n,s)=>{let a=n.path.split(B6);a[0]!==M1&&a[0]!==D6&&(a=[M1,a[0].slice(1),...a.slice(1)]),a.reduce((c,d,p)=>{if(!c[d]){c[d]={result:[]};let m={path:d,children:c[d].result};p===a.length-1&&(m.handlers=n.handlers),c.result.push(m)}return c[d]},i)}),r}function j6(t,e,r,i,n){let s="";if(!i&&!n&&(s+=`
110
- `),i||(s+=`${e||""}${r?N6:L6}`),s+=`${t.path}`,t.handlers){let a=t.handlers.reduce((c,d)=>{let p=c.findIndex(m=>JSON.stringify(m.opts)===JSON.stringify(d.opts));return p!==-1?c[p].method=[c[p].method,d.method].join(", "):c.push(d),c},[]);a.forEach((c,d)=>{d>0&&(s+=`${i?"":e||""}${r?Ko:Zo}${t.path}`),s+=` (${c.method||"-"})`,c.opts&&JSON.stringify(c.opts)!=="{}"&&(s+=` ${JSON.stringify(c.opts)}`),c.meta&&Reflect.ownKeys(c.meta).forEach((p,m)=>{s+=`
111
- ${i?"":e||""}${r?Ko:Zo}`,s+=`\u2022 (${p}) ${JSON.stringify(c.meta[p])}`}),a.length>1&&d!==a.length-1&&(s+=`
112
- `)})}else t.children.length>1&&(s+=" (-)");return i||(e=`${e||""}${r?Ko:Zo}`),t.children.forEach((a,c)=>{let d=c===t.children.length-1,p=!t.handlers&&t.children.length===1;s+=j6(a,e,d,p)}),s}function q6(t,e,r,i){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");i.includeMeta=i.includeMeta||null;let n="",s=[];for(let{node:d,method:p}of t.nodes)for(let m of d.handlerStorage.handlers)s.push({method:p,...m});s.length?s.forEach((d,p)=>{let m=`(${d.method||"-"})`;Object.keys(d.constraints).length>0&&(m+=" "+JSON.stringify(d.constraints));let w="",S=t.prefix.split("").map((v,R)=>v===":"?R:null).filter(v=>v!==null);if(S.length){let v=0;S.forEach((R,x)=>{w+=t.prefix.slice(v,R+1),w+=d.params[d.params.length-S.length+x],x===S.length-1&&(w+=t.prefix.slice(R+1)),v=R+1})}else w=t.prefix;if(p===0?n+=`${w} ${m}`:n+=`
113
- ${e}${r?Ko:Zo}${w} ${m}`,i.includeMeta){let v=sd.call(this,d,i.includeMeta);Object.keys(v).forEach((R,x)=>{n+=`
114
- ${e||""}${r?Ko:Zo}`,n+=`\u2022 (${R}) ${JSON.stringify(v[R])}`})}}):n=t.prefix;let a=`${e}${r?N6:L6}${n}
115
- `;e=`${e}${r?Ko:Zo}`;let c=Object.keys(t.children);for(let d=0;d<c.length;d++){let p=t.children[c[d]];a+=q6.call(this,p,e,d===c.length-1,i)}return a}function Qu(t,e,r){if(e.handlerStorage.handlers.length!==0&&t.nodes.push({method:r,node:e}),e.parametricChildren&&e.parametricChildren[0]&&(t.children[":"]||(t.children[":"]={prefix:":",nodes:[],children:{}}),Qu(t.children[":"],e.parametricChildren[0],r)),e.wildcardChild&&(t.children["*"]||(t.children["*"]={prefix:"*",nodes:[],children:{}}),Qu(t.children["*"],e.wildcardChild,r)),e.staticChildren)for(let i of Object.values(e.staticChildren)){let n=i.prefix.split(B6),s=t,a;for(let c of n)a=s,s=s.children[c],s||(s={prefix:c,nodes:[],children:{}},a.children[c]=s);Qu(s,i,r)}}function od(t){let e=Object.keys(t.children);if(t.nodes.length===0&&e.length===1){let r=t.children[e[0]];if(r.nodes.length<=1)return od(r),t.nodes=r.nodes,t.prefix+=r.prefix,t.children=r.children,t}for(let r of Object.keys(t.children))od(t.children[r]);return t}U6.exports={flattenNode:Qu,compressFlattenedNode:od,prettyPrintFlattenedNode:q6,prettyPrintRoutesArray:AS}});var F6=H((iI,W6)=>{"use strict";var ad=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,r,i,n,s){let a={handler:e,params:r,constraints:s,store:i||null,_createParamsObject:this._compileCreateParamsObject(r)};Object.keys(s).length===0&&(this.unconstrainedHandler=a);for(let c of Object.keys(s))this.constraints.includes(c)||(c==="version"?this.constraints.unshift(c):this.constraints.push(c));if(this.handlers.length>=32)throw new Error("find-my-way supports a maximum of 32 route handlers per node when there are constraints, limit reached");this.handlers.push(a),this.handlers.sort((c,d)=>Object.keys(c.constraints).length-Object.keys(d.constraints).length),this._compileGetHandlerMatchingConstraints(n,s)}_compileCreateParamsObject(e){let r=[];for(let i=0;i<e.length;i++)r.push(`'${e[i]}': paramsArray[${i}]`);return new Function("paramsArray",`return {${r.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,r){for(let i=0;i<this.handlers.length;i++){let s=this.handlers[i].constraints[r];if(s!==void 0){let a=e.get(s)||0;a|=1<<i,e.set(s,a)}}}_constrainedIndexBitmask(e){let r=0;for(let i=0;i<this.handlers.length;i++)this.handlers[i].constraints[e]!==void 0&&(r|=1<<i);return~r}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let i of this.constraints){let n=e.newStoreForConstraint(i);this.constrainedHandlerStores[i]=n,this._buildConstraintStore(n,i)}let r=[];r.push(`
108
+ northing meters`+s;var j=L/2,W=0,$=0,G,K,re,ue,ge;return j>0&&(G=1e5/Math.pow(10,j),K=s.substring(w,w+j),W=parseFloat(K)*G,re=s.substring(w+j),$=parseFloat(re)*G),ue=W+O,ge=$+D,{easting:ue,northing:ge,zoneLetter:b,zoneNumber:S,accuracy:G}}function dl(s,l){for(var c=js.charCodeAt(l-1),y=1e5,g=!1;c!==s.charCodeAt(0);){if(c++,c===dt&&c++,c===mt&&c++,c>Gr){if(g)throw"Bad character: "+s;c=zt,g=!0}y+=1e5}return y}function Vi(s,l){if(s>"V")throw"MGRSPoint given invalid Northing "+s;for(var c=Hi.charCodeAt(l-1),y=0,g=!1;c!==s.charCodeAt(0);){if(c++,c===dt&&c++,c===mt&&c++,c>Ir){if(g)throw"Bad character: "+s;c=zt,g=!0}y+=1e5}return y}function Ki(s){var l;switch(s){case"C":l=11e5;break;case"D":l=2e6;break;case"E":l=28e5;break;case"F":l=37e5;break;case"G":l=46e5;break;case"H":l=55e5;break;case"J":l=64e5;break;case"K":l=73e5;break;case"L":l=82e5;break;case"M":l=91e5;break;case"N":l=0;break;case"P":l=8e5;break;case"Q":l=17e5;break;case"R":l=26e5;break;case"S":l=35e5;break;case"T":l=44e5;break;case"U":l=53e5;break;case"V":l=62e5;break;case"W":l=7e6;break;case"X":l=79e5;break;default:l=-1}if(l>=0)return l;throw"Invalid zone letter: "+s}function Or(s,l,c){if(!(this instanceof Or))return new Or(s,l,c);if(Array.isArray(s))this.x=s[0],this.y=s[1],this.z=s[2]||0;else if(typeof s=="object")this.x=s.x,this.y=s.y,this.z=s.z||0;else if(typeof s=="string"&&typeof l>"u"){var y=s.split(",");this.x=parseFloat(y[0],10),this.y=parseFloat(y[1],10),this.z=parseFloat(y[2],10)||0}else this.x=s,this.y=l,this.z=c||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Or.fromMGRS=function(s){return new Or(ul(s))},Or.prototype.toMGRS=function(s){return ll([this.x,this.y],s)};var ml=1,oc=.25,Fs=.046875,$s=.01953125,Ws=.01068115234375,ac=.75,lc=.46875,uc=.013020833333333334,hc=.007120768229166667,dr=.3645833333333333,cc=.005696614583333333,fc=.3076171875,pl=function(s){var l=[];l[0]=ml-s*(oc+s*(Fs+s*($s+s*Ws))),l[1]=s*(ac-s*(Fs+s*($s+s*Ws)));var c=s*s;return l[2]=c*(lc-s*(uc+s*hc)),c*=s,l[3]=c*(dr-s*cc),l[4]=c*s*fc,l},wi=function(s,l,c,y){return c*=l,l*=l,y[0]*s-c*(y[1]+l*(y[2]+l*(y[3]+l*y[4])))},La=20,Ji=function(s,l,c){for(var y=1/(1-l),g=s,w=La;w;--w){var S=Math.sin(g),b=1-l*S*S;if(b=(wi(g,S,Math.cos(g),c)-s)*(b*Math.sqrt(b))*y,g-=b,Math.abs(b)<v)return g}return g};function _i(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=pl(this.es),this.ml0=wi(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function dc(s){var l=s.x,c=s.y,y=Z(l-this.long0),g,w,S,b=Math.sin(c),A=Math.cos(c);if(this.es){var D=A*y,L=Math.pow(D,2),j=this.ep2*Math.pow(A,2),W=Math.pow(j,2),$=Math.abs(A)>v?Math.tan(c):0,G=Math.pow($,2),K=Math.pow(G,2);g=1-this.es*Math.pow(b,2),D=D/Math.sqrt(g);var re=wi(c,b,A,this.en);w=this.a*(this.k0*D*(1+L/6*(1-G+j+L/20*(5-18*G+K+14*j-58*G*j+L/42*(61+179*K-K*G-479*G)))))+this.x0,S=this.a*(this.k0*(re-this.ml0+b*y*D/2*(1+L/12*(5-G+9*j+4*W+L/30*(61+K-58*G+270*j-330*G*j+L/56*(1385+543*K-K*G-3111*G))))))+this.y0}else{var O=A*Math.sin(y);if(Math.abs(Math.abs(O)-1)<v)return 93;if(w=.5*this.a*this.k0*Math.log((1+O)/(1-O))+this.x0,S=A*Math.cos(y)/Math.sqrt(1-Math.pow(O,2)),O=Math.abs(S),O>=1){if(O-1>v)return 93;S=0}else S=Math.acos(S);c<0&&(S=-S),S=this.a*this.k0*(S-this.lat0)+this.y0}return s.x=w,s.y=S,s}function gl(s){var l,c,y,g,w=(s.x-this.x0)*(1/this.a),S=(s.y-this.y0)*(1/this.a);if(this.es)if(l=this.ml0+S/this.k0,c=Ji(l,this.es,this.en),Math.abs(c)<p){var L=Math.sin(c),j=Math.cos(c),W=Math.abs(j)>v?Math.tan(c):0,$=this.ep2*Math.pow(j,2),G=Math.pow($,2),K=Math.pow(W,2),re=Math.pow(K,2);l=1-this.es*Math.pow(L,2);var ue=w*Math.sqrt(l)/this.k0,ge=Math.pow(ue,2);l=l*W,y=c-l*ge/(1-this.es)*.5*(1-ge/12*(5+3*K-9*$*K+$-4*G-ge/30*(61+90*K-252*$*K+45*re+46*$-ge/56*(1385+3633*K+4095*re+1574*re*K)))),g=Z(this.long0+ue*(1-ge/6*(1+2*K+$-ge/20*(5+28*K+24*re+8*$*K+6*$-ge/42*(61+662*K+1320*re+720*re*K))))/j)}else y=p*Fi(S),g=0;else{var b=Math.exp(w/this.k0),A=.5*(b-1/b),O=this.lat0+S/this.k0,D=Math.cos(O);l=Math.sqrt((1-Math.pow(D,2))/(1+Math.pow(A,2))),y=Math.asin(l),S<0&&(y=-y),A===0&&D===0?g=0:g=Z(Math.atan2(A,D)+this.long0)}return s.x=g,s.y=y,s}var mc=["Fast_Transverse_Mercator","Fast Transverse Mercator"],Hs={init:_i,forward:dc,inverse:gl,names:mc},Na=function(s){var l=Math.exp(s);return l=(l-1/l)/2,l},Xt=function(s,l){s=Math.abs(s),l=Math.abs(l);var c=Math.max(s,l),y=Math.min(s,l)/(c||1);return c*Math.sqrt(1+Math.pow(y,2))},yl=function(s){var l=1+s,c=l-1;return c===0?s:s*Math.log(l)/c},bl=function(s){var l=Math.abs(s);return l=yl(l*(1+l/(Xt(1,l)+1))),s<0?-l:l},Gs=function(s,l){for(var c=2*Math.cos(2*l),y=s.length-1,g=s[y],w=0,S;--y>=0;)S=-w+c*g+s[y],w=g,g=S;return l+S*Math.sin(2*l)},Zi=function(s,l){for(var c=2*Math.cos(l),y=s.length-1,g=s[y],w=0,S;--y>=0;)S=-w+c*g+s[y],w=g,g=S;return Math.sin(l)*S},Ba=function(s){var l=Math.exp(s);return l=(l+1/l)/2,l},Da=function(s,l,c){for(var y=Math.sin(l),g=Math.cos(l),w=Na(c),S=Ba(c),b=2*g*S,A=-2*y*w,O=s.length-1,D=s[O],L=0,j=0,W=0,$,G;--O>=0;)$=j,G=L,j=D,L=W,D=-$+b*j-A*L+s[O],W=-G+A*j+b*L;return b=y*S,A=g*w,[b*D-A*W,b*W+A*D]};function pc(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Hs.init.apply(this),this.forward=Hs.forward,this.inverse=Hs.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var s=this.es/(1+Math.sqrt(1-this.es)),l=s/(2-s),c=l;this.cgb[0]=l*(2+l*(-2/3+l*(-2+l*(116/45+l*(26/45+l*(-2854/675)))))),this.cbg[0]=l*(-2+l*(2/3+l*(4/3+l*(-82/45+l*(32/45+l*(4642/4725)))))),c=c*l,this.cgb[1]=c*(7/3+l*(-8/5+l*(-227/45+l*(2704/315+l*(2323/945))))),this.cbg[1]=c*(5/3+l*(-16/15+l*(-13/9+l*(904/315+l*(-1522/945))))),c=c*l,this.cgb[2]=c*(56/15+l*(-136/35+l*(-1262/105+l*(73814/2835)))),this.cbg[2]=c*(-26/15+l*(34/21+l*(8/5+l*(-12686/2835)))),c=c*l,this.cgb[3]=c*(4279/630+l*(-332/35+l*(-399572/14175))),this.cbg[3]=c*(1237/630+l*(-12/5+l*(-24832/14175))),c=c*l,this.cgb[4]=c*(4174/315+l*(-144838/6237)),this.cbg[4]=c*(-734/315+l*(109598/31185)),c=c*l,this.cgb[5]=c*(601676/22275),this.cbg[5]=c*(444337/155925),c=Math.pow(l,2),this.Qn=this.k0/(1+l)*(1+c*(1/4+c*(1/64+c/256))),this.utg[0]=l*(-.5+l*(2/3+l*(-37/96+l*(1/360+l*(81/512+l*(-96199/604800)))))),this.gtu[0]=l*(.5+l*(-2/3+l*(5/16+l*(41/180+l*(-127/288+l*(7891/37800)))))),this.utg[1]=c*(-1/48+l*(-1/15+l*(437/1440+l*(-46/105+l*(1118711/3870720))))),this.gtu[1]=c*(13/48+l*(-3/5+l*(557/1440+l*(281/630+l*(-1983433/1935360))))),c=c*l,this.utg[2]=c*(-17/480+l*(37/840+l*(209/4480+l*(-5569/90720)))),this.gtu[2]=c*(61/240+l*(-103/140+l*(15061/26880+l*(167603/181440)))),c=c*l,this.utg[3]=c*(-4397/161280+l*(11/504+l*(830251/7257600))),this.gtu[3]=c*(49561/161280+l*(-179/168+l*(6601661/7257600))),c=c*l,this.utg[4]=c*(-4583/161280+l*(108847/3991680)),this.gtu[4]=c*(34729/80640+l*(-3418889/1995840)),c=c*l,this.utg[5]=c*(-20648693/638668800),this.gtu[5]=c*(212378941/319334400);var y=Gs(this.cbg,this.lat0);this.Zb=-this.Qn*(y+Zi(this.gtu,2*y))}function Vs(s){var l=Z(s.x-this.long0),c=s.y;c=Gs(this.cbg,c);var y=Math.sin(c),g=Math.cos(c),w=Math.sin(l),S=Math.cos(l);c=Math.atan2(y,S*g),l=Math.atan2(w*g,Xt(y,g*S)),l=bl(Math.tan(l));var b=Da(this.gtu,2*c,2*l);c=c+b[0],l=l+b[1];var A,O;return Math.abs(l)<=2.623395162778?(A=this.a*(this.Qn*l)+this.x0,O=this.a*(this.Qn*c+this.Zb)+this.y0):(A=1/0,O=1/0),s.x=A,s.y=O,s}function gc(s){var l=(s.x-this.x0)*(1/this.a),c=(s.y-this.y0)*(1/this.a);c=(c-this.Zb)/this.Qn,l=l/this.Qn;var y,g;if(Math.abs(l)<=2.623395162778){var w=Da(this.utg,2*c,2*l);c=c+w[0],l=l+w[1],l=Math.atan(Na(l));var S=Math.sin(c),b=Math.cos(c),A=Math.sin(l),O=Math.cos(l);c=Math.atan2(S*O,Xt(A,O*b)),l=Math.atan2(A,O*b),y=Z(l+this.long0),g=Gs(this.cgb,c)}else y=1/0,g=1/0;return s.x=y,s.y=g,s}var yc=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"],zn={init:pc,forward:Vs,inverse:gc,names:yc},bc=function(s,l){if(s===void 0){if(s=Math.floor((Z(l)+Math.PI)*30/Math.PI)+1,s<0)return 0;if(s>60)return 60}return s},Ks="etmerc";function za(){var s=bc(this.zone,this.long0);if(s===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(s)-183)*E,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,zn.init.apply(this),this.forward=zn.forward,this.inverse=zn.inverse}var vc=["Universal Transverse Mercator System","utm"],wc={init:za,names:vc,dependsOn:Ks},jn=function(s,l){return Math.pow((1-s)/(1+s),l)},vl=20;function Js(){var s=Math.sin(this.lat0),l=Math.cos(this.lat0);l*=l,this.rc=Math.sqrt(1-this.es)/(1-this.es*s*s),this.C=Math.sqrt(1+this.es*l*l/(1-this.es)),this.phic0=Math.asin(s/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+C)/(Math.pow(Math.tan(.5*this.lat0+C),this.C)*jn(this.e*s,this.ratexp))}function ja(s){var l=s.x,c=s.y;return s.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*c+C),this.C)*jn(this.e*Math.sin(c),this.ratexp))-p,s.x=this.C*l,s}function xi(s){for(var l=1e-14,c=s.x/this.C,y=s.y,g=Math.pow(Math.tan(.5*y+C)/this.K,1/this.C),w=vl;w>0&&(y=2*Math.atan(g*jn(this.e*Math.sin(s.y),-.5*this.e))-p,!(Math.abs(y-s.y)<l));--w)s.y=y;return w?(s.x=c,s.y=y,s):null}var Un=["gauss"],Yi={init:Js,forward:ja,inverse:xi,names:Un};function wl(){Yi.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function _c(s){var l,c,y,g;return s.x=Z(s.x-this.long0),Yi.forward.apply(this,[s]),l=Math.sin(s.y),c=Math.cos(s.y),y=Math.cos(s.x),g=this.k0*this.R2/(1+this.sinc0*l+this.cosc0*c*y),s.x=g*c*Math.sin(s.x),s.y=g*(this.cosc0*l-this.sinc0*c*y),s.x=this.a*s.x+this.x0,s.y=this.a*s.y+this.y0,s}function Ua(s){var l,c,y,g,w;if(s.x=(s.x-this.x0)/this.a,s.y=(s.y-this.y0)/this.a,s.x/=this.k0,s.y/=this.k0,w=Math.sqrt(s.x*s.x+s.y*s.y)){var S=2*Math.atan2(w,this.R2);l=Math.sin(S),c=Math.cos(S),g=Math.asin(c*this.sinc0+s.y*l*this.cosc0/w),y=Math.atan2(s.x*l,w*this.cosc0*c-s.y*this.sinc0*l)}else g=this.phic0,y=0;return s.x=y,s.y=g,Yi.inverse.apply(this,[s]),s.x=Z(s.x+this.long0),s}var xc=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],_l={init:wl,forward:_c,inverse:Ua,names:xc};function Zs(s,l,c){return l*=c,Math.tan(.5*(p+s))*Math.pow((1-l)/(1+l),.5*c)}function qa(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=v&&(this.k0=.5*(1+Fi(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=v&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=v&&(this.k0=.5*this.cons*Rt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/st(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Rt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-p,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function xl(s){var l=s.x,c=s.y,y=Math.sin(c),g=Math.cos(c),w,S,b,A,O,D,L=Z(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=v&&Math.abs(c+this.lat0)<=v?(s.x=NaN,s.y=NaN,s):this.sphere?(w=2*this.k0/(1+this.sinlat0*y+this.coslat0*g*Math.cos(L)),s.x=this.a*w*g*Math.sin(L)+this.x0,s.y=this.a*w*(this.coslat0*y-this.sinlat0*g*Math.cos(L))+this.y0,s):(S=2*Math.atan(this.ssfn_(c,y,this.e))-p,A=Math.cos(S),b=Math.sin(S),Math.abs(this.coslat0)<=v?(O=st(this.e,c*this.con,this.con*y),D=2*this.a*this.k0*O/this.cons,s.x=this.x0+D*Math.sin(l-this.long0),s.y=this.y0-this.con*D*Math.cos(l-this.long0),s):(Math.abs(this.sinlat0)<v?(w=2*this.a*this.k0/(1+A*Math.cos(L)),s.y=w*b):(w=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*b+this.cosX0*A*Math.cos(L))),s.y=w*(this.cosX0*b-this.sinX0*A*Math.cos(L))+this.y0),s.x=w*A*Math.sin(L)+this.x0,s))}function Sl(s){s.x-=this.x0,s.y-=this.y0;var l,c,y,g,w,S=Math.sqrt(s.x*s.x+s.y*s.y);if(this.sphere){var b=2*Math.atan(S/(2*this.a*this.k0));return l=this.long0,c=this.lat0,S<=v?(s.x=l,s.y=c,s):(c=Math.asin(Math.cos(b)*this.sinlat0+s.y*Math.sin(b)*this.coslat0/S),Math.abs(this.coslat0)<v?this.lat0>0?l=Z(this.long0+Math.atan2(s.x,-1*s.y)):l=Z(this.long0+Math.atan2(s.x,s.y)):l=Z(this.long0+Math.atan2(s.x*Math.sin(b),S*this.coslat0*Math.cos(b)-s.y*this.sinlat0*Math.sin(b))),s.x=l,s.y=c,s)}else if(Math.abs(this.coslat0)<=v){if(S<=v)return c=this.lat0,l=this.long0,s.x=l,s.y=c,s;s.x*=this.con,s.y*=this.con,y=S*this.cons/(2*this.a*this.k0),c=this.con*Pr(this.e,y),l=this.con*Z(this.con*this.long0+Math.atan2(s.x,-1*s.y))}else g=2*Math.atan(S*this.cosX0/(2*this.a*this.k0*this.ms1)),l=this.long0,S<=v?w=this.X0:(w=Math.asin(Math.cos(g)*this.sinX0+s.y*Math.sin(g)*this.cosX0/S),l=Z(this.long0+Math.atan2(s.x*Math.sin(g),S*this.cosX0*Math.cos(g)-s.y*this.sinX0*Math.sin(g)))),c=-1*Pr(this.e,Math.tan(.5*(p+w)));return s.x=l,s.y=c,s}var Sc=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],Mc={init:qa,forward:xl,inverse:Sl,names:Sc,ssfn_:Zs};function Fa(){var s=this.lat0;this.lambda0=this.long0;var l=Math.sin(s),c=this.a,y=this.rf,g=1/y,w=2*g-Math.pow(g,2),S=this.e=Math.sqrt(w);this.R=this.k0*c*Math.sqrt(1-w)/(1-w*Math.pow(l,2)),this.alpha=Math.sqrt(1+w/(1-w)*Math.pow(Math.cos(s),4)),this.b0=Math.asin(l/this.alpha);var b=Math.log(Math.tan(Math.PI/4+this.b0/2)),A=Math.log(Math.tan(Math.PI/4+s/2)),O=Math.log((1+S*l)/(1-S*l));this.K=b-this.alpha*A+this.alpha*S/2*O}function Ml(s){var l=Math.log(Math.tan(Math.PI/4-s.y/2)),c=this.e/2*Math.log((1+this.e*Math.sin(s.y))/(1-this.e*Math.sin(s.y))),y=-this.alpha*(l+c)+this.K,g=2*(Math.atan(Math.exp(y))-Math.PI/4),w=this.alpha*(s.x-this.lambda0),S=Math.atan(Math.sin(w)/(Math.sin(this.b0)*Math.tan(g)+Math.cos(this.b0)*Math.cos(w))),b=Math.asin(Math.cos(this.b0)*Math.sin(g)-Math.sin(this.b0)*Math.cos(g)*Math.cos(w));return s.y=this.R/2*Math.log((1+Math.sin(b))/(1-Math.sin(b)))+this.y0,s.x=this.R*S+this.x0,s}function Ec(s){for(var l=s.x-this.x0,c=s.y-this.y0,y=l/this.R,g=2*(Math.atan(Math.exp(c/this.R))-Math.PI/4),w=Math.asin(Math.cos(this.b0)*Math.sin(g)+Math.sin(this.b0)*Math.cos(g)*Math.cos(y)),S=Math.atan(Math.sin(y)/(Math.cos(this.b0)*Math.cos(y)-Math.sin(this.b0)*Math.tan(g))),b=this.lambda0+S/this.alpha,A=0,O=w,D=-1e3,L=0;Math.abs(O-D)>1e-7;){if(++L>20)return;A=1/this.alpha*(Math.log(Math.tan(Math.PI/4+w/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(O))/2)),D=O,O=2*Math.atan(Math.exp(A))-Math.PI/2}return s.x=b,s.y=O,s}var Rc=["somerc"],Cc={init:Fa,forward:Ml,inverse:Ec,names:Rc},Si=1e-7;function Xi(s){var l=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],c=typeof s.PROJECTION=="object"?Object.keys(s.PROJECTION)[0]:s.PROJECTION;return"no_uoff"in s||"no_off"in s||l.indexOf(c)!==-1}function Ys(){var s,l,c,y,g,w,S,b,A,O,D=0,L,j=0,W=0,$=0,G=0,K=0,re=0;this.no_off=Xi(this),this.no_rot="no_rot"in this;var ue=!1;"alpha"in this&&(ue=!0);var ge=!1;if("rectified_grid_angle"in this&&(ge=!0),ue&&(re=this.alpha),ge&&(D=this.rectified_grid_angle*E),ue||ge)j=this.longc;else if(W=this.long1,G=this.lat1,$=this.long2,K=this.lat2,Math.abs(G-K)<=Si||(s=Math.abs(G))<=Si||Math.abs(s-p)<=Si||Math.abs(Math.abs(this.lat0)-p)<=Si||Math.abs(Math.abs(K)-p)<=Si)throw new Error;var $e=1-this.es;l=Math.sqrt($e),Math.abs(this.lat0)>v?(b=Math.sin(this.lat0),c=Math.cos(this.lat0),s=1-this.es*b*b,this.B=c*c,this.B=Math.sqrt(1+this.es*this.B*this.B/$e),this.A=this.B*this.k0*l/s,y=this.B*l/(c*Math.sqrt(s)),g=y*y-1,g<=0?g=0:(g=Math.sqrt(g),this.lat0<0&&(g=-g)),this.E=g+=y,this.E*=Math.pow(st(this.e,this.lat0,b),this.B)):(this.B=1/l,this.A=this.k0,this.E=y=g=1),ue||ge?(ue?(L=Math.asin(Math.sin(re)/y),ge||(D=re)):(L=D,re=Math.asin(y*Math.sin(L))),this.lam0=j-Math.asin(.5*(g-1/g)*Math.tan(L))/this.B):(w=Math.pow(st(this.e,G,Math.sin(G)),this.B),S=Math.pow(st(this.e,K,Math.sin(K)),this.B),g=this.E/w,A=(S-w)/(S+w),O=this.E*this.E,O=(O-S*w)/(O+S*w),s=W-$,s<-Math.pi?$-=P:s>Math.pi&&($+=P),this.lam0=Z(.5*(W+$)-Math.atan(O*Math.tan(.5*this.B*(W-$))/A)/this.B),L=Math.atan(2*Math.sin(this.B*Z(W-this.lam0))/(g-1/g)),D=re=Math.asin(y*Math.sin(L))),this.singam=Math.sin(L),this.cosgam=Math.cos(L),this.sinrot=Math.sin(D),this.cosrot=Math.cos(D),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(y*y-1)/Math.cos(re))),this.lat0<0&&(this.u_0=-this.u_0)),g=.5*L,this.v_pole_n=this.ArB*Math.log(Math.tan(C-g)),this.v_pole_s=this.ArB*Math.log(Math.tan(C+g))}function qn(s){var l={},c,y,g,w,S,b,A,O;if(s.x=s.x-this.lam0,Math.abs(Math.abs(s.y)-p)>v){if(S=this.E/Math.pow(st(this.e,s.y,Math.sin(s.y)),this.B),b=1/S,c=.5*(S-b),y=.5*(S+b),w=Math.sin(this.B*s.x),g=(c*this.singam-w*this.cosgam)/y,Math.abs(Math.abs(g)-1)<v)throw new Error;O=.5*this.ArB*Math.log((1-g)/(1+g)),b=Math.cos(this.B*s.x),Math.abs(b)<Si?A=this.A*s.x:A=this.ArB*Math.atan2(c*this.cosgam+w*this.singam,b)}else O=s.y>0?this.v_pole_n:this.v_pole_s,A=this.ArB*s.y;return this.no_rot?(l.x=A,l.y=O):(A-=this.u_0,l.x=O*this.cosrot+A*this.sinrot,l.y=A*this.cosrot-O*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l}function El(s){var l,c,y,g,w,S,b,A={};if(s.x=(s.x-this.x0)*(1/this.a),s.y=(s.y-this.y0)*(1/this.a),this.no_rot?(c=s.y,l=s.x):(c=s.x*this.cosrot-s.y*this.sinrot,l=s.y*this.cosrot+s.x*this.sinrot+this.u_0),y=Math.exp(-this.BrA*c),g=.5*(y-1/y),w=.5*(y+1/y),S=Math.sin(this.BrA*l),b=(S*this.cosgam+g*this.singam)/w,Math.abs(Math.abs(b)-1)<v)A.x=0,A.y=b<0?-p:p;else{if(A.y=this.E/Math.sqrt((1+b)/(1-b)),A.y=Pr(this.e,Math.pow(A.y,1/this.B)),A.y===1/0)throw new Error;A.x=-this.rB*Math.atan2(g*this.cosgam-S*this.singam,Math.cos(this.BrA*l))}return A.x+=this.lam0,A}var Xs=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"],Fn={init:Ys,forward:qn,inverse:El,names:Xs};function Qs(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<v)){var s=this.b/this.a;this.e=Math.sqrt(1-s*s);var l=Math.sin(this.lat1),c=Math.cos(this.lat1),y=Rt(this.e,l,c),g=st(this.e,this.lat1,l),w=Math.sin(this.lat2),S=Math.cos(this.lat2),b=Rt(this.e,w,S),A=st(this.e,this.lat2,w),O=st(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>v?this.ns=Math.log(y/b)/Math.log(g/A):this.ns=l,isNaN(this.ns)&&(this.ns=l),this.f0=y/(this.ns*Math.pow(g,this.ns)),this.rh=this.a*this.f0*Math.pow(O,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Vr(s){var l=s.x,c=s.y;Math.abs(2*Math.abs(c)-Math.PI)<=v&&(c=Fi(c)*(p-2*v));var y=Math.abs(Math.abs(c)-p),g,w;if(y>v)g=st(this.e,c,Math.sin(c)),w=this.a*this.f0*Math.pow(g,this.ns);else{if(y=c*this.ns,y<=0)return null;w=0}var S=this.ns*Z(l-this.long0);return s.x=this.k0*(w*Math.sin(S))+this.x0,s.y=this.k0*(this.rh-w*Math.cos(S))+this.y0,s}function $a(s){var l,c,y,g,w,S=(s.x-this.x0)/this.k0,b=this.rh-(s.y-this.y0)/this.k0;this.ns>0?(l=Math.sqrt(S*S+b*b),c=1):(l=-Math.sqrt(S*S+b*b),c=-1);var A=0;if(l!==0&&(A=Math.atan2(c*S,c*b)),l!==0||this.ns>0){if(c=1/this.ns,y=Math.pow(l/(this.a*this.f0),c),g=Pr(this.e,y),g===-9999)return null}else g=-p;return w=Z(A/this.ns+this.long0),s.x=w,s.y=g,s}var Ac=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],Qi={init:Qs,forward:Vr,inverse:$a,names:Ac};function Rl(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Tc(s){var l,c,y,g,w,S,b,A=s.x,O=s.y,D=Z(A-this.long0);return l=Math.pow((1+this.e*Math.sin(O))/(1-this.e*Math.sin(O)),this.alfa*this.e/2),c=2*(Math.atan(this.k*Math.pow(Math.tan(O/2+this.s45),this.alfa)/l)-this.s45),y=-D*this.alfa,g=Math.asin(Math.cos(this.ad)*Math.sin(c)+Math.sin(this.ad)*Math.cos(c)*Math.cos(y)),w=Math.asin(Math.cos(c)*Math.sin(y)/Math.cos(g)),S=this.n*w,b=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(g/2+this.s45),this.n),s.y=b*Math.cos(S)/1,s.x=b*Math.sin(S)/1,this.czech||(s.y*=-1,s.x*=-1),s}function eo(s){var l,c,y,g,w,S,b,A,O=s.x;s.x=s.y,s.y=O,this.czech||(s.y*=-1,s.x*=-1),S=Math.sqrt(s.x*s.x+s.y*s.y),w=Math.atan2(s.y,s.x),g=w/Math.sin(this.s0),y=2*(Math.atan(Math.pow(this.ro0/S,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),l=Math.asin(Math.cos(this.ad)*Math.sin(y)-Math.sin(this.ad)*Math.cos(y)*Math.cos(g)),c=Math.asin(Math.cos(y)*Math.sin(g)/Math.cos(l)),s.x=this.long0-c/this.alfa,b=l,A=0;var D=0;do s.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(l/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(b))/(1-this.e*Math.sin(b)),this.e/2))-this.s45),Math.abs(b-s.y)<1e-10&&(A=1),b=s.y,D+=1;while(A===0&&D<15);return D>=15?null:s}var Pc=["Krovak","krovak"],Ic={init:Rl,forward:Tc,inverse:eo,names:Pc},pt=function(s,l,c,y,g){return s*g-l*Math.sin(2*g)+c*Math.sin(4*g)-y*Math.sin(6*g)},$n=function(s){return 1-.25*s*(1+s/16*(3+1.25*s))},Wn=function(s){return .375*s*(1+.25*s*(1+.46875*s))},Hn=function(s){return .05859375*s*s*(1+.75*s)},Gn=function(s){return s*s*s*(35/3072)},en=function(s,l,c){var y=l*c;return s/Math.sqrt(1-y*y)},tn=function(s){return Math.abs(s)<p?s:s-Fi(s)*Math.PI},to=function(s,l,c,y,g){var w,S;w=s/l;for(var b=0;b<15;b++)if(S=(s-(l*w-c*Math.sin(2*w)+y*Math.sin(4*w)-g*Math.sin(6*w)))/(l-2*c*Math.cos(2*w)+4*y*Math.cos(4*w)-6*g*Math.cos(6*w)),w+=S,Math.abs(S)<=1e-10)return w;return NaN};function Oc(){this.sphere||(this.e0=$n(this.es),this.e1=Wn(this.es),this.e2=Hn(this.es),this.e3=Gn(this.es),this.ml0=this.a*pt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Cl(s){var l,c,y=s.x,g=s.y;if(y=Z(y-this.long0),this.sphere)l=this.a*Math.asin(Math.cos(g)*Math.sin(y)),c=this.a*(Math.atan2(Math.tan(g),Math.cos(y))-this.lat0);else{var w=Math.sin(g),S=Math.cos(g),b=en(this.a,this.e,w),A=Math.tan(g)*Math.tan(g),O=y*Math.cos(g),D=O*O,L=this.es*S*S/(1-this.es),j=this.a*pt(this.e0,this.e1,this.e2,this.e3,g);l=b*O*(1-D*A*(1/6-(8-A+8*L)*D/120)),c=j-this.ml0+b*w/S*D*(.5+(5-A+6*L)*D/24)}return s.x=l+this.x0,s.y=c+this.y0,s}function kc(s){s.x-=this.x0,s.y-=this.y0;var l=s.x/this.a,c=s.y/this.a,y,g;if(this.sphere){var w=c+this.lat0;y=Math.asin(Math.sin(w)*Math.cos(l)),g=Math.atan2(Math.tan(l),Math.cos(w))}else{var S=this.ml0/this.a+c,b=to(S,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(b)-p)<=v)return s.x=this.long0,s.y=p,c<0&&(s.y*=-1),s;var A=en(this.a,this.e,Math.sin(b)),O=A*A*A/this.a/this.a*(1-this.es),D=Math.pow(Math.tan(b),2),L=l*this.a/A,j=L*L;y=b-A*Math.tan(b)/O*L*L*(.5-(1+3*D)*L*L/24),g=L*(1-j*(D/3+(1+3*D)*D*j/15))/Math.cos(b)}return s.x=Z(g+this.long0),s.y=tn(y),s}var Lc=["Cassini","Cassini_Soldner","cass"],Kr={init:Oc,forward:Cl,inverse:kc,names:Lc},mr=function(s,l){var c;return s>1e-7?(c=s*l,(1-s*s)*(l/(1-c*c)-.5/s*Math.log((1-c)/(1+c)))):2*l},Al=1,Wa=2,Jr=3,Zr=4;function Qt(){var s=Math.abs(this.lat0);if(Math.abs(s-p)<v?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(s)<v?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var l;switch(this.qp=mr(this.e,1),this.mmf=.5/(1-this.es),this.apa=Ll(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),l=Math.sin(this.lat0),this.sinb1=mr(this.e,l)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*l*l)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Vn(s){var l,c,y,g,w,S,b,A,O,D,L=s.x,j=s.y;if(L=Z(L-this.long0),this.sphere){if(w=Math.sin(j),D=Math.cos(j),y=Math.cos(L),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c=this.mode===this.EQUIT?1+D*y:1+this.sinph0*w+this.cosph0*D*y,c<=v)return null;c=Math.sqrt(2/c),l=c*D*Math.sin(L),c*=this.mode===this.EQUIT?w:this.cosph0*w-this.sinph0*D*y}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(y=-y),Math.abs(j+this.lat0)<v)return null;c=C-j*.5,c=2*(this.mode===this.S_POLE?Math.cos(c):Math.sin(c)),l=c*Math.sin(L),c*=y}}else{switch(b=0,A=0,O=0,y=Math.cos(L),g=Math.sin(L),w=Math.sin(j),S=mr(this.e,w),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(b=S/this.qp,A=Math.sqrt(1-b*b)),this.mode){case this.OBLIQ:O=1+this.sinb1*b+this.cosb1*A*y;break;case this.EQUIT:O=1+A*y;break;case this.N_POLE:O=p+j,S=this.qp-S;break;case this.S_POLE:O=j-p,S=this.qp+S;break}if(Math.abs(O)<v)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:O=Math.sqrt(2/O),this.mode===this.OBLIQ?c=this.ymf*O*(this.cosb1*b-this.sinb1*A*y):c=(O=Math.sqrt(2/(1+A*y)))*b*this.ymf,l=this.xmf*O*A*g;break;case this.N_POLE:case this.S_POLE:S>=0?(l=(O=Math.sqrt(S))*g,c=y*(this.mode===this.S_POLE?O:-O)):l=c=0;break}}return s.x=this.a*l+this.x0,s.y=this.a*c+this.y0,s}function Tl(s){s.x-=this.x0,s.y-=this.y0;var l=s.x/this.a,c=s.y/this.a,y,g,w,S,b,A,O;if(this.sphere){var D=0,L,j=0;if(L=Math.sqrt(l*l+c*c),g=L*.5,g>1)return null;switch(g=2*Math.asin(g),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(j=Math.sin(g),D=Math.cos(g)),this.mode){case this.EQUIT:g=Math.abs(L)<=v?0:Math.asin(c*j/L),l*=j,c=D*L;break;case this.OBLIQ:g=Math.abs(L)<=v?this.lat0:Math.asin(D*this.sinph0+c*j*this.cosph0/L),l*=j*this.cosph0,c=(D-Math.sin(g)*this.sinph0)*L;break;case this.N_POLE:c=-c,g=p-g;break;case this.S_POLE:g-=p;break}y=c===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(l,c)}else{if(O=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,c*=this.dd,A=Math.sqrt(l*l+c*c),A<v)return s.x=this.long0,s.y=this.lat0,s;S=2*Math.asin(.5*A/this.rq),w=Math.cos(S),l*=S=Math.sin(S),this.mode===this.OBLIQ?(O=w*this.sinb1+c*S*this.cosb1/A,b=this.qp*O,c=A*this.cosb1*w-c*this.sinb1*S):(O=c*S/A,b=this.qp*O,c=A*w)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(c=-c),b=l*l+c*c,!b)return s.x=this.long0,s.y=this.lat0,s;O=1-b/this.qp,this.mode===this.S_POLE&&(O=-O)}y=Math.atan2(l,c),g=io(Math.asin(O),this.apa)}return s.x=Z(this.long0+y),s.y=g,s}var Mi=.3333333333333333,Pl=.17222222222222222,Il=.10257936507936508,ro=.06388888888888888,Ol=.0664021164021164,kl=.016415012942191543;function Ll(s){var l,c=[];return c[0]=s*Mi,l=s*s,c[0]+=l*Pl,c[1]=l*ro,l*=s,c[0]+=l*Il,c[1]+=l*Ol,c[2]=l*kl,c}function io(s,l){var c=s+s;return s+l[0]*Math.sin(c)+l[1]*Math.sin(c+c)+l[2]*Math.sin(c+c+c)}var Nl=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],Bl={init:Qt,forward:Vn,inverse:Tl,names:Nl,S_POLE:Al,N_POLE:Wa,EQUIT:Jr,OBLIQ:Zr},Yr=function(s){return Math.abs(s)>1&&(s=s>1?1:-1),Math.asin(s)};function Nc(){Math.abs(this.lat1+this.lat2)<v||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Rt(this.e3,this.sin_po,this.cos_po),this.qs1=mr(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Rt(this.e3,this.sin_po,this.cos_po),this.qs2=mr(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=mr(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>v?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Bc(s){var l=s.x,c=s.y;this.sin_phi=Math.sin(c),this.cos_phi=Math.cos(c);var y=mr(this.e3,this.sin_phi,this.cos_phi),g=this.a*Math.sqrt(this.c-this.ns0*y)/this.ns0,w=this.ns0*Z(l-this.long0),S=g*Math.sin(w)+this.x0,b=this.rh-g*Math.cos(w)+this.y0;return s.x=S,s.y=b,s}function Dc(s){var l,c,y,g,w,S;return s.x-=this.x0,s.y=this.rh-s.y+this.y0,this.ns0>=0?(l=Math.sqrt(s.x*s.x+s.y*s.y),y=1):(l=-Math.sqrt(s.x*s.x+s.y*s.y),y=-1),g=0,l!==0&&(g=Math.atan2(y*s.x,y*s.y)),y=l*this.ns0/this.a,this.sphere?S=Math.asin((this.c-y*y)/(2*this.ns0)):(c=(this.c-y*y)/this.ns0,S=this.phi1z(this.e3,c)),w=Z(g/this.ns0+this.long0),s.x=w,s.y=S,s}function no(s,l){var c,y,g,w,S,b=Yr(.5*l);if(s<v)return b;for(var A=s*s,O=1;O<=25;O++)if(c=Math.sin(b),y=Math.cos(b),g=s*c,w=1-g*g,S=.5*w*w/y*(l/(1-A)-c/w+.5/s*Math.log((1-g)/(1+g))),b=b+S,Math.abs(S)<=1e-7)return b;return null}var zc=["Albers_Conic_Equal_Area","Albers","aea"],Dl={init:Nc,forward:Bc,inverse:Dc,names:zc,phi1z:no};function so(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function oo(s){var l,c,y,g,w,S,b,A,O=s.x,D=s.y;return y=Z(O-this.long0),l=Math.sin(D),c=Math.cos(D),g=Math.cos(y),S=this.sin_p14*l+this.cos_p14*c*g,w=1,S>0||Math.abs(S)<=v?(b=this.x0+this.a*w*c*Math.sin(y)/S,A=this.y0+this.a*w*(this.cos_p14*l-this.sin_p14*c*g)/S):(b=this.x0+this.infinity_dist*c*Math.sin(y),A=this.y0+this.infinity_dist*(this.cos_p14*l-this.sin_p14*c*g)),s.x=b,s.y=A,s}function ao(s){var l,c,y,g,w,S;return s.x=(s.x-this.x0)/this.a,s.y=(s.y-this.y0)/this.a,s.x/=this.k0,s.y/=this.k0,(l=Math.sqrt(s.x*s.x+s.y*s.y))?(g=Math.atan2(l,this.rc),c=Math.sin(g),y=Math.cos(g),S=Yr(y*this.sin_p14+s.y*c*this.cos_p14/l),w=Math.atan2(s.x*c,l*this.cos_p14*y-s.y*this.sin_p14*c),w=Z(this.long0+w)):(S=this.phic0,w=0),s.x=w,s.y=S,s}var Kn=["gnom"],lo={init:so,forward:oo,inverse:ao,names:Kn},jc=function(s,l){var c=1-(1-s*s)/(2*s)*Math.log((1-s)/(1+s));if(Math.abs(Math.abs(l)-c)<1e-6)return l<0?-1*p:p;for(var y=Math.asin(.5*l),g,w,S,b,A=0;A<30;A++)if(w=Math.sin(y),S=Math.cos(y),b=s*w,g=Math.pow(1-b*b,2)/(2*S)*(l/(1-s*s)-w/(1-b*b)+.5/s*Math.log((1-b)/(1+b))),y+=g,Math.abs(g)<=1e-10)return y;return NaN};function Uc(){this.sphere||(this.k0=Rt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function zl(s){var l=s.x,c=s.y,y,g,w=Z(l-this.long0);if(this.sphere)y=this.x0+this.a*w*Math.cos(this.lat_ts),g=this.y0+this.a*Math.sin(c)/Math.cos(this.lat_ts);else{var S=mr(this.e,Math.sin(c));y=this.x0+this.a*this.k0*w,g=this.y0+this.a*S*.5/this.k0}return s.x=y,s.y=g,s}function jl(s){s.x-=this.x0,s.y-=this.y0;var l,c;return this.sphere?(l=Z(this.long0+s.x/this.a/Math.cos(this.lat_ts)),c=Math.asin(s.y/this.a*Math.cos(this.lat_ts))):(c=jc(this.e,2*s.y*this.k0/this.a),l=Z(this.long0+s.x/(this.a*this.k0))),s.x=l,s.y=c,s}var qc=["cea"],Ul={init:Uc,forward:zl,inverse:jl,names:qc};function Fc(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function $c(s){var l=s.x,c=s.y,y=Z(l-this.long0),g=tn(c-this.lat0);return s.x=this.x0+this.a*y*this.rc,s.y=this.y0+this.a*g,s}function Wc(s){var l=s.x,c=s.y;return s.x=Z(this.long0+(l-this.x0)/(this.a*this.rc)),s.y=tn(this.lat0+(c-this.y0)/this.a),s}var Hc=["Equirectangular","Equidistant_Cylindrical","eqc"],Gc={init:Fc,forward:$c,inverse:Wc,names:Hc},Jn=20;function ql(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=$n(this.es),this.e1=Wn(this.es),this.e2=Hn(this.es),this.e3=Gn(this.es),this.ml0=this.a*pt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function u(s){var l=s.x,c=s.y,y,g,w,S=Z(l-this.long0);if(w=S*Math.sin(c),this.sphere)Math.abs(c)<=v?(y=this.a*S,g=-1*this.a*this.lat0):(y=this.a*Math.sin(w)/Math.tan(c),g=this.a*(tn(c-this.lat0)+(1-Math.cos(w))/Math.tan(c)));else if(Math.abs(c)<=v)y=this.a*S,g=-1*this.ml0;else{var b=en(this.a,this.e,Math.sin(c))/Math.tan(c);y=b*Math.sin(w),g=this.a*pt(this.e0,this.e1,this.e2,this.e3,c)-this.ml0+b*(1-Math.cos(w))}return s.x=y+this.x0,s.y=g+this.y0,s}function f(s){var l,c,y,g,w,S,b,A,O;if(y=s.x-this.x0,g=s.y-this.y0,this.sphere)if(Math.abs(g+this.a*this.lat0)<=v)l=Z(y/this.a+this.long0),c=0;else{S=this.lat0+g/this.a,b=y*y/this.a/this.a+S*S,A=S;var D;for(w=Jn;w;--w)if(D=Math.tan(A),O=-1*(S*(A*D+1)-A-.5*(A*A+b)*D)/((A-S)/D-1),A+=O,Math.abs(O)<=v){c=A;break}l=Z(this.long0+Math.asin(y*Math.tan(A)/this.a)/Math.sin(c))}else if(Math.abs(g+this.ml0)<=v)c=0,l=Z(this.long0+y/this.a);else{S=(this.ml0+g)/this.a,b=y*y/this.a/this.a+S*S,A=S;var L,j,W,$,G;for(w=Jn;w;--w)if(G=this.e*Math.sin(A),L=Math.sqrt(1-G*G)*Math.tan(A),j=this.a*pt(this.e0,this.e1,this.e2,this.e3,A),W=this.e0-2*this.e1*Math.cos(2*A)+4*this.e2*Math.cos(4*A)-6*this.e3*Math.cos(6*A),$=j/this.a,O=(S*(L*$+1)-$-.5*L*($*$+b))/(this.es*Math.sin(2*A)*($*$+b-2*S*$)/(4*L)+(S-$)*(L*W-2/Math.sin(2*A))-W),A-=O,Math.abs(O)<=v){c=A;break}L=Math.sqrt(1-this.es*Math.pow(Math.sin(c),2))*Math.tan(c),l=Z(this.long0+Math.asin(y*L/this.a)/Math.sin(c))}return s.x=l,s.y=c,s}var _=["Polyconic","poly"],I={init:ql,forward:u,inverse:f,names:_};function N(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function U(s){var l,c=s.x,y=s.y,g=y-this.lat0,w=c-this.long0,S=g/m*1e-5,b=w,A=1,O=0;for(l=1;l<=10;l++)A=A*S,O=O+this.A[l]*A;var D=O,L=b,j=1,W=0,$,G,K=0,re=0;for(l=1;l<=6;l++)$=j*D-W*L,G=W*D+j*L,j=$,W=G,K=K+this.B_re[l]*j-this.B_im[l]*W,re=re+this.B_im[l]*j+this.B_re[l]*W;return s.x=re*this.a+this.x0,s.y=K*this.a+this.y0,s}function F(s){var l,c=s.x,y=s.y,g=c-this.x0,w=y-this.y0,S=w/this.a,b=g/this.a,A=1,O=0,D,L,j=0,W=0;for(l=1;l<=6;l++)D=A*S-O*b,L=O*S+A*b,A=D,O=L,j=j+this.C_re[l]*A-this.C_im[l]*O,W=W+this.C_im[l]*A+this.C_re[l]*O;for(var $=0;$<this.iterations;$++){var G=j,K=W,re,ue,ge=S,$e=b;for(l=2;l<=6;l++)re=G*j-K*W,ue=K*j+G*W,G=re,K=ue,ge=ge+(l-1)*(this.B_re[l]*G-this.B_im[l]*K),$e=$e+(l-1)*(this.B_im[l]*G+this.B_re[l]*K);G=1,K=0;var Oe=this.B_re[1],Be=this.B_im[1];for(l=2;l<=6;l++)re=G*j-K*W,ue=K*j+G*W,G=re,K=ue,Oe=Oe+l*(this.B_re[l]*G-this.B_im[l]*K),Be=Be+l*(this.B_im[l]*G+this.B_re[l]*K);var wt=Oe*Oe+Be*Be;j=(ge*Oe+$e*Be)/wt,W=($e*Oe-ge*Be)/wt}var tt=j,Qr=W,Zn=1,Yn=0;for(l=1;l<=9;l++)Zn=Zn*tt,Yn=Yn+this.D[l]*Zn;var Hl=this.lat0+Yn*m*1e5,cy=this.long0+Qr;return s.x=cy,s.y=Hl,s}var te=["New_Zealand_Map_Grid","nzmg"],ce={init:N,forward:U,inverse:F,names:te};function we(){}function Ae(s){var l=s.x,c=s.y,y=Z(l-this.long0),g=this.x0+this.a*y,w=this.y0+this.a*Math.log(Math.tan(Math.PI/4+c/2.5))*1.25;return s.x=g,s.y=w,s}function Te(s){s.x-=this.x0,s.y-=this.y0;var l=Z(this.long0+s.x/this.a),c=2.5*(Math.atan(Math.exp(.8*s.y/this.a))-Math.PI/4);return s.x=l,s.y=c,s}var et=["Miller_Cylindrical","mill"],er={init:we,forward:Ae,inverse:Te,names:et},rn=20;function Xr(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=pl(this.es)}function kr(s){var l,c,y=s.x,g=s.y;if(y=Z(y-this.long0),this.sphere){if(!this.m)g=this.n!==1?Math.asin(this.n*Math.sin(g)):g;else for(var w=this.n*Math.sin(g),S=rn;S;--S){var b=(this.m*g+Math.sin(g)-w)/(this.m+Math.cos(g));if(g-=b,Math.abs(b)<v)break}l=this.a*this.C_x*y*(this.m+Math.cos(g)),c=this.a*this.C_y*g}else{var A=Math.sin(g),O=Math.cos(g);c=this.a*wi(g,A,O,this.en),l=this.a*y*O/Math.sqrt(1-this.es*A*A)}return s.x=l,s.y=c,s}function gt(s){var l,c,y,g;return s.x-=this.x0,y=s.x/this.a,s.y-=this.y0,l=s.y/this.a,this.sphere?(l/=this.C_y,y=y/(this.C_x*(this.m+Math.cos(l))),this.m?l=Yr((this.m*l+Math.sin(l))/this.n):this.n!==1&&(l=Yr(Math.sin(l)/this.n)),y=Z(y+this.long0),l=tn(l)):(l=Ji(s.y/this.a,this.es,this.en),g=Math.abs(l),g<p?(g=Math.sin(l),c=this.long0+s.x*Math.sqrt(1-this.es*g*g)/(this.a*Math.cos(l)),y=Z(c)):g-v<p&&(y=this.long0)),s.x=y,s.y=l,s}var bt=["Sinusoidal","sinu"],jt={init:Xr,forward:kr,inverse:gt,names:bt};function Lr(){}function ie(s){for(var l=s.x,c=s.y,y=Z(l-this.long0),g=c,w=Math.PI*Math.sin(c);;){var S=-(g+Math.sin(g)-w)/(1+Math.cos(g));if(g+=S,Math.abs(S)<v)break}g/=2,Math.PI/2-Math.abs(c)<v&&(y=0);var b=.900316316158*this.a*y*Math.cos(g)+this.x0,A=1.4142135623731*this.a*Math.sin(g)+this.y0;return s.x=b,s.y=A,s}function pe(s){var l,c;s.x-=this.x0,s.y-=this.y0,c=s.y/(1.4142135623731*this.a),Math.abs(c)>.999999999999&&(c=.999999999999),l=Math.asin(c);var y=Z(this.long0+s.x/(.900316316158*this.a*Math.cos(l)));y<-Math.PI&&(y=-Math.PI),y>Math.PI&&(y=Math.PI),c=(2*l+Math.sin(2*l))/Math.PI,Math.abs(c)>1&&(c=1);var g=Math.asin(c);return s.x=y,s.y=g,s}var qe=["Mollweide","moll"],At={init:Lr,forward:ie,inverse:pe,names:qe};function nn(){Math.abs(this.lat1+this.lat2)<v||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=$n(this.es),this.e1=Wn(this.es),this.e2=Hn(this.es),this.e3=Gn(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Rt(this.e,this.sinphi,this.cosphi),this.ml1=pt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<v?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Rt(this.e,this.sinphi,this.cosphi),this.ml2=pt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=pt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function sn(s){var l=s.x,c=s.y,y;if(this.sphere)y=this.a*(this.g-c);else{var g=pt(this.e0,this.e1,this.e2,this.e3,c);y=this.a*(this.g-g)}var w=this.ns*Z(l-this.long0),S=this.x0+y*Math.sin(w),b=this.y0+this.rh-y*Math.cos(w);return s.x=S,s.y=b,s}function on(s){s.x-=this.x0,s.y=this.rh-s.y+this.y0;var l,c,y,g;this.ns>=0?(c=Math.sqrt(s.x*s.x+s.y*s.y),l=1):(c=-Math.sqrt(s.x*s.x+s.y*s.y),l=-1);var w=0;if(c!==0&&(w=Math.atan2(l*s.x,l*s.y)),this.sphere)return g=Z(this.long0+w/this.ns),y=tn(this.g-c/this.a),s.x=g,s.y=y,s;var S=this.g-c/this.a;return y=to(S,this.e0,this.e1,this.e2,this.e3),g=Z(this.long0+w/this.ns),s.x=g,s.y=y,s}var uo=["Equidistant_Conic","eqdc"],Fl={init:nn,forward:sn,inverse:on,names:uo};function Ha(){this.R=this.a}function xg(s){var l=s.x,c=s.y,y=Z(l-this.long0),g,w;Math.abs(c)<=v&&(g=this.x0+this.R*y,w=this.y0);var S=Yr(2*Math.abs(c/Math.PI));(Math.abs(y)<=v||Math.abs(Math.abs(c)-p)<=v)&&(g=this.x0,c>=0?w=this.y0+Math.PI*this.R*Math.tan(.5*S):w=this.y0+Math.PI*this.R*-Math.tan(.5*S));var b=.5*Math.abs(Math.PI/y-y/Math.PI),A=b*b,O=Math.sin(S),D=Math.cos(S),L=D/(O+D-1),j=L*L,W=L*(2/O-1),$=W*W,G=Math.PI*this.R*(b*(L-$)+Math.sqrt(A*(L-$)*(L-$)-($+A)*(j-$)))/($+A);y<0&&(G=-G),g=this.x0+G;var K=A+L;return G=Math.PI*this.R*(W*K-b*Math.sqrt(($+A)*(A+1)-K*K))/($+A),c>=0?w=this.y0+G:w=this.y0-G,s.x=g,s.y=w,s}function Sg(s){var l,c,y,g,w,S,b,A,O,D,L,j,W;return s.x-=this.x0,s.y-=this.y0,L=Math.PI*this.R,y=s.x/L,g=s.y/L,w=y*y+g*g,S=-Math.abs(g)*(1+w),b=S-2*g*g+y*y,A=-2*S+1+2*g*g+w*w,W=g*g/A+(2*b*b*b/A/A/A-9*S*b/A/A)/27,O=(S-b*b/3/A)/A,D=2*Math.sqrt(-O/3),L=3*W/O/D,Math.abs(L)>1&&(L>=0?L=1:L=-1),j=Math.acos(L)/3,s.y>=0?c=(-D*Math.cos(j+Math.PI/3)-b/3/A)*Math.PI:c=-(-D*Math.cos(j+Math.PI/3)-b/3/A)*Math.PI,Math.abs(y)<v?l=this.long0:l=Z(this.long0+Math.PI*(w-1+Math.sqrt(1+2*(y*y-g*g)+w*w))/2/y),s.x=l,s.y=c,s}var Mg=["Van_der_Grinten_I","VanDerGrinten","vandg"],Eg={init:Ha,forward:xg,inverse:Sg,names:Mg};function Rg(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Cg(s){var l=s.x,c=s.y,y=Math.sin(s.y),g=Math.cos(s.y),w=Z(l-this.long0),S,b,A,O,D,L,j,W,$,G,K,re,ue,ge,$e,Oe,Be,wt,tt,Qr,Zn,Yn,Hl;return this.sphere?Math.abs(this.sin_p12-1)<=v?(s.x=this.x0+this.a*(p-c)*Math.sin(w),s.y=this.y0-this.a*(p-c)*Math.cos(w),s):Math.abs(this.sin_p12+1)<=v?(s.x=this.x0+this.a*(p+c)*Math.sin(w),s.y=this.y0+this.a*(p+c)*Math.cos(w),s):(wt=this.sin_p12*y+this.cos_p12*g*Math.cos(w),Oe=Math.acos(wt),Be=Oe?Oe/Math.sin(Oe):1,s.x=this.x0+this.a*Be*g*Math.sin(w),s.y=this.y0+this.a*Be*(this.cos_p12*y-this.sin_p12*g*Math.cos(w)),s):(S=$n(this.es),b=Wn(this.es),A=Hn(this.es),O=Gn(this.es),Math.abs(this.sin_p12-1)<=v?(D=this.a*pt(S,b,A,O,p),L=this.a*pt(S,b,A,O,c),s.x=this.x0+(D-L)*Math.sin(w),s.y=this.y0-(D-L)*Math.cos(w),s):Math.abs(this.sin_p12+1)<=v?(D=this.a*pt(S,b,A,O,p),L=this.a*pt(S,b,A,O,c),s.x=this.x0+(D+L)*Math.sin(w),s.y=this.y0+(D+L)*Math.cos(w),s):(j=y/g,W=en(this.a,this.e,this.sin_p12),$=en(this.a,this.e,y),G=Math.atan((1-this.es)*j+this.es*W*this.sin_p12/($*g)),K=Math.atan2(Math.sin(w),this.cos_p12*Math.tan(G)-this.sin_p12*Math.cos(w)),K===0?tt=Math.asin(this.cos_p12*Math.sin(G)-this.sin_p12*Math.cos(G)):Math.abs(Math.abs(K)-Math.PI)<=v?tt=-Math.asin(this.cos_p12*Math.sin(G)-this.sin_p12*Math.cos(G)):tt=Math.asin(Math.sin(w)*Math.cos(G)/Math.sin(K)),re=this.e*this.sin_p12/Math.sqrt(1-this.es),ue=this.e*this.cos_p12*Math.cos(K)/Math.sqrt(1-this.es),ge=re*ue,$e=ue*ue,Qr=tt*tt,Zn=Qr*tt,Yn=Zn*tt,Hl=Yn*tt,Oe=W*tt*(1-Qr*$e*(1-$e)/6+Zn/8*ge*(1-2*$e)+Yn/120*($e*(4-7*$e)-3*re*re*(1-7*$e))-Hl/48*ge),s.x=this.x0+Oe*Math.sin(K),s.y=this.y0+Oe*Math.cos(K),s))}function Ag(s){s.x-=this.x0,s.y-=this.y0;var l,c,y,g,w,S,b,A,O,D,L,j,W,$,G,K,re,ue,ge,$e,Oe,Be,wt,tt;return this.sphere?(l=Math.sqrt(s.x*s.x+s.y*s.y),l>2*p*this.a?void 0:(c=l/this.a,y=Math.sin(c),g=Math.cos(c),w=this.long0,Math.abs(l)<=v?S=this.lat0:(S=Yr(g*this.sin_p12+s.y*y*this.cos_p12/l),b=Math.abs(this.lat0)-p,Math.abs(b)<=v?this.lat0>=0?w=Z(this.long0+Math.atan2(s.x,-s.y)):w=Z(this.long0-Math.atan2(-s.x,s.y)):w=Z(this.long0+Math.atan2(s.x*y,l*this.cos_p12*g-s.y*this.sin_p12*y))),s.x=w,s.y=S,s)):(A=$n(this.es),O=Wn(this.es),D=Hn(this.es),L=Gn(this.es),Math.abs(this.sin_p12-1)<=v?(j=this.a*pt(A,O,D,L,p),l=Math.sqrt(s.x*s.x+s.y*s.y),W=j-l,S=to(W/this.a,A,O,D,L),w=Z(this.long0+Math.atan2(s.x,-1*s.y)),s.x=w,s.y=S,s):Math.abs(this.sin_p12+1)<=v?(j=this.a*pt(A,O,D,L,p),l=Math.sqrt(s.x*s.x+s.y*s.y),W=l-j,S=to(W/this.a,A,O,D,L),w=Z(this.long0+Math.atan2(s.x,s.y)),s.x=w,s.y=S,s):(l=Math.sqrt(s.x*s.x+s.y*s.y),K=Math.atan2(s.x,s.y),$=en(this.a,this.e,this.sin_p12),re=Math.cos(K),ue=this.e*this.cos_p12*re,ge=-ue*ue/(1-this.es),$e=3*this.es*(1-ge)*this.sin_p12*this.cos_p12*re/(1-this.es),Oe=l/$,Be=Oe-ge*(1+ge)*Math.pow(Oe,3)/6-$e*(1+3*ge)*Math.pow(Oe,4)/24,wt=1-ge*Be*Be/2-Oe*Be*Be*Be/6,G=Math.asin(this.sin_p12*Math.cos(Be)+this.cos_p12*Math.sin(Be)*re),w=Z(this.long0+Math.asin(Math.sin(K)*Math.sin(Be)/Math.cos(G))),tt=Math.sin(G),S=Math.atan2((tt-this.es*wt*this.sin_p12)*Math.tan(G),tt*(1-this.es)),s.x=w,s.y=S,s))}var Tg=["Azimuthal_Equidistant","aeqd"],Pg={init:Rg,forward:Cg,inverse:Ag,names:Tg};function Ig(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Og(s){var l,c,y,g,w,S,b,A,O=s.x,D=s.y;return y=Z(O-this.long0),l=Math.sin(D),c=Math.cos(D),g=Math.cos(y),S=this.sin_p14*l+this.cos_p14*c*g,w=1,(S>0||Math.abs(S)<=v)&&(b=this.a*w*c*Math.sin(y),A=this.y0+this.a*w*(this.cos_p14*l-this.sin_p14*c*g)),s.x=b,s.y=A,s}function kg(s){var l,c,y,g,w,S,b;return s.x-=this.x0,s.y-=this.y0,l=Math.sqrt(s.x*s.x+s.y*s.y),c=Yr(l/this.a),y=Math.sin(c),g=Math.cos(c),S=this.long0,Math.abs(l)<=v?(b=this.lat0,s.x=S,s.y=b,s):(b=Yr(g*this.sin_p14+s.y*y*this.cos_p14/l),w=Math.abs(this.lat0)-p,Math.abs(w)<=v?(this.lat0>=0?S=Z(this.long0+Math.atan2(s.x,-s.y)):S=Z(this.long0-Math.atan2(-s.x,s.y)),s.x=S,s.y=b,s):(S=Z(this.long0+Math.atan2(s.x*y,l*this.cos_p14*g-s.y*this.sin_p14*y)),s.x=S,s.y=b,s))}var Lg=["ortho"],Ng={init:Ig,forward:Og,inverse:kg,names:Lg},Ze={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Ne={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Bg(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=p-C/2?this.face=Ze.TOP:this.lat0<=-(p-C/2)?this.face=Ze.BOTTOM:Math.abs(this.long0)<=C?this.face=Ze.FRONT:Math.abs(this.long0)<=p+C?this.face=this.long0>0?Ze.RIGHT:Ze.LEFT:this.face=Ze.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Dg(s){var l={x:0,y:0},c,y,g,w,S,b,A={value:0};if(s.x-=this.long0,this.es!==0?c=Math.atan(this.one_minus_f_squared*Math.tan(s.y)):c=s.y,y=s.x,this.face===Ze.TOP)w=p-c,y>=C&&y<=p+C?(A.value=Ne.AREA_0,g=y-p):y>p+C||y<=-(p+C)?(A.value=Ne.AREA_1,g=y>0?y-k:y+k):y>-(p+C)&&y<=-C?(A.value=Ne.AREA_2,g=y+p):(A.value=Ne.AREA_3,g=y);else if(this.face===Ze.BOTTOM)w=p+c,y>=C&&y<=p+C?(A.value=Ne.AREA_0,g=-y+p):y<C&&y>=-C?(A.value=Ne.AREA_1,g=-y):y<-C&&y>=-(p+C)?(A.value=Ne.AREA_2,g=-y-p):(A.value=Ne.AREA_3,g=y>0?-y+k:-y-k);else{var O,D,L,j,W,$,G;this.face===Ze.RIGHT?y=ho(y,+p):this.face===Ze.BACK?y=ho(y,+k):this.face===Ze.LEFT&&(y=ho(y,-p)),j=Math.sin(c),W=Math.cos(c),$=Math.sin(y),G=Math.cos(y),O=W*G,D=W*$,L=j,this.face===Ze.FRONT?(w=Math.acos(O),g=$l(w,L,D,A)):this.face===Ze.RIGHT?(w=Math.acos(D),g=$l(w,L,-O,A)):this.face===Ze.BACK?(w=Math.acos(-O),g=$l(w,L,-D,A)):this.face===Ze.LEFT?(w=Math.acos(-D),g=$l(w,L,O,A)):(w=g=0,A.value=Ne.AREA_0)}return b=Math.atan(12/k*(g+Math.acos(Math.sin(g)*Math.cos(C))-p)),S=Math.sqrt((1-Math.cos(w))/(Math.cos(b)*Math.cos(b))/(1-Math.cos(Math.atan(1/Math.cos(g))))),A.value===Ne.AREA_1?b+=p:A.value===Ne.AREA_2?b+=k:A.value===Ne.AREA_3&&(b+=1.5*k),l.x=S*Math.cos(b),l.y=S*Math.sin(b),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,s.x=l.x,s.y=l.y,s}function zg(s){var l={lam:0,phi:0},c,y,g,w,S,b,A,O,D,L={value:0};if(s.x=(s.x-this.x0)/this.a,s.y=(s.y-this.y0)/this.a,y=Math.atan(Math.sqrt(s.x*s.x+s.y*s.y)),c=Math.atan2(s.y,s.x),s.x>=0&&s.x>=Math.abs(s.y)?L.value=Ne.AREA_0:s.y>=0&&s.y>=Math.abs(s.x)?(L.value=Ne.AREA_1,c-=p):s.x<0&&-s.x>=Math.abs(s.y)?(L.value=Ne.AREA_2,c=c<0?c+k:c-k):(L.value=Ne.AREA_3,c+=p),D=k/12*Math.tan(c),S=Math.sin(D)/(Math.cos(D)-1/Math.sqrt(2)),b=Math.atan(S),g=Math.cos(c),w=Math.tan(y),A=1-g*g*w*w*(1-Math.cos(Math.atan(1/Math.cos(b)))),A<-1?A=-1:A>1&&(A=1),this.face===Ze.TOP)O=Math.acos(A),l.phi=p-O,L.value===Ne.AREA_0?l.lam=b+p:L.value===Ne.AREA_1?l.lam=b<0?b+k:b-k:L.value===Ne.AREA_2?l.lam=b-p:l.lam=b;else if(this.face===Ze.BOTTOM)O=Math.acos(A),l.phi=O-p,L.value===Ne.AREA_0?l.lam=-b+p:L.value===Ne.AREA_1?l.lam=-b:L.value===Ne.AREA_2?l.lam=-b-p:l.lam=b<0?-b-k:-b+k;else{var j,W,$;j=A,D=j*j,D>=1?$=0:$=Math.sqrt(1-D)*Math.sin(b),D+=$*$,D>=1?W=0:W=Math.sqrt(1-D),L.value===Ne.AREA_1?(D=W,W=-$,$=D):L.value===Ne.AREA_2?(W=-W,$=-$):L.value===Ne.AREA_3&&(D=W,W=$,$=-D),this.face===Ze.RIGHT?(D=j,j=-W,W=D):this.face===Ze.BACK?(j=-j,W=-W):this.face===Ze.LEFT&&(D=j,j=W,W=-D),l.phi=Math.acos(-$)-p,l.lam=Math.atan2(W,j),this.face===Ze.RIGHT?l.lam=ho(l.lam,-p):this.face===Ze.BACK?l.lam=ho(l.lam,-k):this.face===Ze.LEFT&&(l.lam=ho(l.lam,+p))}if(this.es!==0){var G,K,re;G=l.phi<0?1:0,K=Math.tan(l.phi),re=this.b/Math.sqrt(K*K+this.one_minus_f_squared),l.phi=Math.atan(Math.sqrt(this.a*this.a-re*re)/(this.one_minus_f*re)),G&&(l.phi=-l.phi)}return l.lam+=this.long0,s.x=l.lam,s.y=l.phi,s}function $l(s,l,c,y){var g;return s<v?(y.value=Ne.AREA_0,g=0):(g=Math.atan2(l,c),Math.abs(g)<=C?y.value=Ne.AREA_0:g>C&&g<=p+C?(y.value=Ne.AREA_1,g-=p):g>p+C||g<=-(p+C)?(y.value=Ne.AREA_2,g=g>=0?g-k:g+k):(y.value=Ne.AREA_3,g+=p)),g}function ho(s,l){var c=s+l;return c<-k?c+=P:c>+k&&(c-=P),c}var jg=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],Ug={init:Bg,forward:Dg,inverse:zg,names:jg},Vc=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ga=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],r2=.8487,i2=1.3523,n2=T/5,qg=1/n2,co=18,Wl=function(s,l){return s[0]+l*(s[1]+l*(s[2]+l*s[3]))},Fg=function(s,l){return s[1]+l*(2*s[2]+l*3*s[3])};function $g(s,l,c,y){for(var g=l;y;--y){var w=s(g);if(g-=w,Math.abs(w)<c)break}return g}function Wg(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Hg(s){var l=Z(s.x-this.long0),c=Math.abs(s.y),y=Math.floor(c*n2);y<0?y=0:y>=co&&(y=co-1),c=T*(c-qg*y);var g={x:Wl(Vc[y],c)*l,y:Wl(Ga[y],c)};return s.y<0&&(g.y=-g.y),g.x=g.x*this.a*r2+this.x0,g.y=g.y*this.a*i2+this.y0,g}function Gg(s){var l={x:(s.x-this.x0)/(this.a*r2),y:Math.abs(s.y-this.y0)/(this.a*i2)};if(l.y>=1)l.x/=Vc[co][0],l.y=s.y<0?-p:p;else{var c=Math.floor(l.y*co);for(c<0?c=0:c>=co&&(c=co-1);;)if(Ga[c][0]>l.y)--c;else if(Ga[c+1][0]<=l.y)++c;else break;var y=Ga[c],g=5*(l.y-y[0])/(Ga[c+1][0]-y[0]);g=$g(function(w){return(Wl(y,w)-l.y)/Fg(y,w)},g,v,100),l.x/=Wl(Vc[c],g),l.y=(5*c+g)*E,s.y<0&&(l.y=-l.y)}return l.x=Z(l.x+this.long0),l}var Vg=["Robinson","robin"],Kg={init:Wg,forward:Hg,inverse:Gg,names:Vg};function Jg(){this.name="geocent"}function Zg(s){var l=Aa(s,this.es,this.a);return l}function Yg(s){var l=Nn(s,this.es,this.a,this.b);return l}var Xg=["Geocentric","geocentric","geocent","Geocent"],Qg={init:Jg,forward:Zg,inverse:Yg,names:Xg},vt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Va={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function ey(){if(Object.keys(Va).forEach(function(c){if(typeof this[c]>"u")this[c]=Va[c].def;else{if(Va[c].num&&isNaN(this[c]))throw new Error("Invalid parameter value, must be numeric "+c+" = "+this[c]);Va[c].num&&(this[c]=parseFloat(this[c]))}Va[c].degrees&&(this[c]=this[c]*E)}.bind(this)),Math.abs(Math.abs(this.lat0)-p)<v?this.mode=this.lat0<0?vt.S_POLE:vt.N_POLE:Math.abs(this.lat0)<v?this.mode=vt.EQUIT:(this.mode=vt.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var s=this.tilt,l=this.azi;this.cg=Math.cos(l),this.sg=Math.sin(l),this.cw=Math.cos(s),this.sw=Math.sin(s)}function ty(s){s.x-=this.long0;var l=Math.sin(s.y),c=Math.cos(s.y),y=Math.cos(s.x),g,w;switch(this.mode){case vt.OBLIQ:w=this.sinph0*l+this.cosph0*c*y;break;case vt.EQUIT:w=c*y;break;case vt.S_POLE:w=-l;break;case vt.N_POLE:w=l;break}switch(w=this.pn1/(this.p-w),g=w*c*Math.sin(s.x),this.mode){case vt.OBLIQ:w*=this.cosph0*l-this.sinph0*c*y;break;case vt.EQUIT:w*=l;break;case vt.N_POLE:w*=-(c*y);break;case vt.S_POLE:w*=c*y;break}var S,b;return S=w*this.cg+g*this.sg,b=1/(S*this.sw*this.h1+this.cw),g=(g*this.cg-w*this.sg)*this.cw*b,w=S*b,s.x=g*this.a,s.y=w*this.a,s}function ry(s){s.x/=this.a,s.y/=this.a;var l={x:s.x,y:s.y},c,y,g;g=1/(this.pn1-s.y*this.sw),c=this.pn1*s.x*g,y=this.pn1*s.y*this.cw*g,s.x=c*this.cg+y*this.sg,s.y=y*this.cg-c*this.sg;var w=Xt(s.x,s.y);if(Math.abs(w)<v)l.x=0,l.y=s.y;else{var S,b;switch(b=1-w*w*this.pfact,b=(this.p-Math.sqrt(b))/(this.pn1/w+w/this.pn1),S=Math.sqrt(1-b*b),this.mode){case vt.OBLIQ:l.y=Math.asin(S*this.sinph0+s.y*b*this.cosph0/w),s.y=(S-this.sinph0*Math.sin(l.y))*w,s.x*=b*this.cosph0;break;case vt.EQUIT:l.y=Math.asin(s.y*b/w),s.y=S*w,s.x*=b;break;case vt.N_POLE:l.y=Math.asin(S),s.y=-s.y;break;case vt.S_POLE:l.y=-Math.asin(S);break}l.x=Math.atan2(s.x,s.y)}return s.x=l.x+this.long0,s.y=l.y,s}var iy=["Tilted_Perspective","tpers"],ny={init:ey,forward:ty,inverse:ry,names:iy};function sy(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var s=1-this.es,l=1/s;this.radius_p=Math.sqrt(s),this.radius_p2=s,this.radius_p_inv2=l,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function oy(s){var l=s.x,c=s.y,y,g,w,S;if(l=l-this.long0,this.shape==="ellipse"){c=Math.atan(this.radius_p2*Math.tan(c));var b=this.radius_p/Xt(this.radius_p*Math.cos(c),Math.sin(c));if(g=b*Math.cos(l)*Math.cos(c),w=b*Math.sin(l)*Math.cos(c),S=b*Math.sin(c),(this.radius_g-g)*g-w*w-S*S*this.radius_p_inv2<0)return s.x=Number.NaN,s.y=Number.NaN,s;y=this.radius_g-g,this.flip_axis?(s.x=this.radius_g_1*Math.atan(w/Xt(S,y)),s.y=this.radius_g_1*Math.atan(S/y)):(s.x=this.radius_g_1*Math.atan(w/y),s.y=this.radius_g_1*Math.atan(S/Xt(w,y)))}else this.shape==="sphere"&&(y=Math.cos(c),g=Math.cos(l)*y,w=Math.sin(l)*y,S=Math.sin(c),y=this.radius_g-g,this.flip_axis?(s.x=this.radius_g_1*Math.atan(w/Xt(S,y)),s.y=this.radius_g_1*Math.atan(S/y)):(s.x=this.radius_g_1*Math.atan(w/y),s.y=this.radius_g_1*Math.atan(S/Xt(w,y))));return s.x=s.x*this.a,s.y=s.y*this.a,s}function ay(s){var l=-1,c=0,y=0,g,w,S,b;if(s.x=s.x/this.a,s.y=s.y/this.a,this.shape==="ellipse"){this.flip_axis?(y=Math.tan(s.y/this.radius_g_1),c=Math.tan(s.x/this.radius_g_1)*Xt(1,y)):(c=Math.tan(s.x/this.radius_g_1),y=Math.tan(s.y/this.radius_g_1)*Xt(1,c));var A=y/this.radius_p;if(g=c*c+A*A+l*l,w=2*this.radius_g*l,S=w*w-4*g*this.C,S<0)return s.x=Number.NaN,s.y=Number.NaN,s;b=(-w-Math.sqrt(S))/(2*g),l=this.radius_g+b*l,c*=b,y*=b,s.x=Math.atan2(c,l),s.y=Math.atan(y*Math.cos(s.x)/l),s.y=Math.atan(this.radius_p_inv2*Math.tan(s.y))}else if(this.shape==="sphere"){if(this.flip_axis?(y=Math.tan(s.y/this.radius_g_1),c=Math.tan(s.x/this.radius_g_1)*Math.sqrt(1+y*y)):(c=Math.tan(s.x/this.radius_g_1),y=Math.tan(s.y/this.radius_g_1)*Math.sqrt(1+c*c)),g=c*c+y*y+l*l,w=2*this.radius_g*l,S=w*w-4*g*this.C,S<0)return s.x=Number.NaN,s.y=Number.NaN,s;b=(-w-Math.sqrt(S))/(2*g),l=this.radius_g+b*l,c*=b,y*=b,s.x=Math.atan2(c,l),s.y=Math.atan(y*Math.cos(s.x)/l)}return s.x=s.x+this.long0,s}var ly=["Geostationary Satellite View","Geostationary_Satellite","geos"],uy={init:sy,forward:oy,inverse:ay,names:ly},hy=function(s){s.Proj.projections.add(Hs),s.Proj.projections.add(zn),s.Proj.projections.add(wc),s.Proj.projections.add(_l),s.Proj.projections.add(Mc),s.Proj.projections.add(Cc),s.Proj.projections.add(Fn),s.Proj.projections.add(Qi),s.Proj.projections.add(Ic),s.Proj.projections.add(Kr),s.Proj.projections.add(Bl),s.Proj.projections.add(Dl),s.Proj.projections.add(lo),s.Proj.projections.add(Ul),s.Proj.projections.add(Gc),s.Proj.projections.add(I),s.Proj.projections.add(ce),s.Proj.projections.add(er),s.Proj.projections.add(jt),s.Proj.projections.add(At),s.Proj.projections.add(Fl),s.Proj.projections.add(Eg),s.Proj.projections.add(Pg),s.Proj.projections.add(Ng),s.Proj.projections.add(Ug),s.Proj.projections.add(Kg),s.Proj.projections.add(Qg),s.Proj.projections.add(ny),s.Proj.projections.add(uy)};return Ct.defaultDatum="WGS84",Ct.Proj=fr,Ct.WGS84=new Ct.Proj("WGS84"),Ct.Point=Or,Ct.toPoint=Dn,Ct.defs=ct,Ct.nadgrid=bi,Ct.transform=$i,Ct.mgrs=Us,Ct.version="2.8.0",hy(Ct),Ct})});var I1=V((BI,T6)=>{T6.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var ud=V(Rn=>{var De=I1(),ld=()=>[{type:De.RANGE,from:48,to:57}],P6=()=>[{type:De.CHAR,value:95},{type:De.RANGE,from:97,to:122},{type:De.RANGE,from:65,to:90}].concat(ld()),I6=()=>[{type:De.CHAR,value:9},{type:De.CHAR,value:10},{type:De.CHAR,value:11},{type:De.CHAR,value:12},{type:De.CHAR,value:13},{type:De.CHAR,value:32},{type:De.CHAR,value:160},{type:De.CHAR,value:5760},{type:De.RANGE,from:8192,to:8202},{type:De.CHAR,value:8232},{type:De.CHAR,value:8233},{type:De.CHAR,value:8239},{type:De.CHAR,value:8287},{type:De.CHAR,value:12288},{type:De.CHAR,value:65279}],sS=()=>[{type:De.CHAR,value:10},{type:De.CHAR,value:13},{type:De.CHAR,value:8232},{type:De.CHAR,value:8233}];Rn.words=()=>({type:De.SET,set:P6(),not:!1});Rn.notWords=()=>({type:De.SET,set:P6(),not:!0});Rn.ints=()=>({type:De.SET,set:ld(),not:!1});Rn.notInts=()=>({type:De.SET,set:ld(),not:!0});Rn.whitespace=()=>({type:De.SET,set:I6(),not:!1});Rn.notWhitespace=()=>({type:De.SET,set:I6(),not:!0});Rn.anyChar=()=>({type:De.SET,set:sS(),not:!0})});var k6=V(O1=>{var O6=I1(),na=ud(),oS="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",aS={"0":0,t:9,n:10,v:11,f:12,r:13};O1.strToChars=function(t){var e=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return t=t.replace(e,function(r,i,n,o,a,h,d,m){if(n)return r;var p=i?8:o?parseInt(o,16):a?parseInt(a,16):h?parseInt(h,8):d?oS.indexOf(d):aS[m],M=String.fromCharCode(p);return/[[\]{}^$.|?*+()]/.test(M)&&(M="\\"+M),M}),t};O1.tokenizeClass=(t,e)=>{for(var r=[],i=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,n,o;(n=i.exec(t))!=null;)if(n[1])r.push(na.words());else if(n[2])r.push(na.ints());else if(n[3])r.push(na.whitespace());else if(n[4])r.push(na.notWords());else if(n[5])r.push(na.notInts());else if(n[6])r.push(na.notWhitespace());else if(n[7])r.push({type:O6.RANGE,from:(n[8]||n[9]).charCodeAt(0),to:n[10].charCodeAt(0)});else if(o=n[12])r.push({type:O6.CHAR,value:o.charCodeAt(0)});else return[r,i.lastIndex];O1.error(e,"Unterminated character class")};O1.error=(t,e)=>{throw new SyntaxError("Invalid regular expression: /"+t+"/: "+e)}});var L6=V(k1=>{var sh=I1();k1.wordBoundary=()=>({type:sh.POSITION,value:"b"});k1.nonWordBoundary=()=>({type:sh.POSITION,value:"B"});k1.begin=()=>({type:sh.POSITION,value:"^"});k1.end=()=>({type:sh.POSITION,value:"$"})});var N6=V((UI,hd)=>{var sa=k6(),Er=I1(),xs=ud(),oh=L6();hd.exports=t=>{var e=0,r,i,n={type:Er.ROOT,stack:[]},o=n,a=n.stack,h=[],d=C=>{sa.error(t,`Nothing to repeat at column ${C-1}`)},m=sa.strToChars(t);for(r=m.length;e<r;)switch(i=m[e++],i){case"\\":switch(i=m[e++],i){case"b":a.push(oh.wordBoundary());break;case"B":a.push(oh.nonWordBoundary());break;case"w":a.push(xs.words());break;case"W":a.push(xs.notWords());break;case"d":a.push(xs.ints());break;case"D":a.push(xs.notInts());break;case"s":a.push(xs.whitespace());break;case"S":a.push(xs.notWhitespace());break;default:/\d/.test(i)?a.push({type:Er.REFERENCE,value:parseInt(i,10)}):a.push({type:Er.CHAR,value:i.charCodeAt(0)})}break;case"^":a.push(oh.begin());break;case"$":a.push(oh.end());break;case"[":var p;m[e]==="^"?(p=!0,e++):p=!1;var M=sa.tokenizeClass(m.slice(e),t);e+=M[1],a.push({type:Er.SET,set:M[0],not:p});break;case".":a.push(xs.anyChar());break;case"(":var R={type:Er.GROUP,stack:[],remember:!0};i=m[e],i==="?"&&(i=m[e+1],e+=2,i==="="?R.followedBy=!0:i==="!"?R.notFollowedBy=!0:i!==":"&&sa.error(t,`Invalid group, character '${i}' after '?' at column ${e-1}`),R.remember=!1),a.push(R),h.push(o),o=R,a=R.stack;break;case")":h.length===0&&sa.error(t,`Unmatched ) at column ${e-1}`),o=h.pop(),a=o.options?o.options[o.options.length-1]:o.stack;break;case"|":o.options||(o.options=[o.stack],delete o.stack);var x=[];o.options.push(x),a=x;break;case"{":var v=/^(\d+)(,(\d+)?)?\}/.exec(m.slice(e)),E,T;v!==null?(a.length===0&&d(e),E=parseInt(v[1],10),T=v[2]?v[3]?parseInt(v[3],10):1/0:E,e+=v[0].length,a.push({type:Er.REPETITION,min:E,max:T,value:a.pop()})):a.push({type:Er.CHAR,value:123});break;case"?":a.length===0&&d(e),a.push({type:Er.REPETITION,min:0,max:1,value:a.pop()});break;case"+":a.length===0&&d(e),a.push({type:Er.REPETITION,min:1,max:1/0,value:a.pop()});break;case"*":a.length===0&&d(e),a.push({type:Er.REPETITION,min:0,max:1/0,value:a.pop()});break;default:a.push({type:Er.CHAR,value:i.charCodeAt(0)})}return h.length!==0&&sa.error(t,"Unterminated group"),n};hd.exports.types=Er});var z6=V((qI,D6)=>{"use strict";var B6=N6(),lS=B6.types;D6.exports=function(t,e){e||(e={});var r=e.limit===void 0?25:e.limit;uS(t)?t=t.source:typeof t!="string"&&(t=String(t));try{t=B6(t)}catch{return!1}var i=0;return function n(o,a){var h,d,m;if(o.type===lS.REPETITION&&(a++,i++,a>1||i>r))return!1;if(o.options){for(h=0,m=o.options.length;h<m;h++)if(d=n({stack:o.options[h]},a),!d)return!1}var p=o.stack||o.value&&o.value.stack;if(!p)return!0;for(h=0;h<p.length;h++)if(d=n(p[h],a),!d)return!1;return!0}(t,0)};function uS(t){return{}.toString.call(t)==="[object RegExp]"}});var U6=V((FI,j6)=>{"use strict";j6.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,n,o;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),i=o.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=i;n--!==0;){var a=o[n];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var J6=V(($I,K6)=>{"use strict";var oa=" ",aa="\u2502 ",q6="\u251C\u2500\u2500 ",F6="\u2514\u2500\u2500 ",$6="*",L1="/",W6=/(?=\/)/;function hS(t){let e=t.name||"";return e=e.replace("bound","").trim(),e=(e||"anonymous")+"()",e}function H6(t){return Array.isArray(t)?t.map(e=>H6(e)):typeof t=="symbol"?t.toString():typeof t=="function"?hS(t):t}function cd(t,e){let r={},i=this.buildPrettyMeta(t);return Array.isArray(e)||(e=i?Reflect.ownKeys(i):[]),e.forEach(n=>{let o=typeof n=="symbol"?n.toString():n;i&&i[n]&&(r[o]=H6(i[n]))}),r}function cS(t,e={}){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");e.includeMeta=e.includeMeta||null;let r=[],i="";t.sort((o,a)=>!o.path||!a.path?0:o.path.localeCompare(a.path));for(let o=0;o<t.length;o++){let a=t[o],h=r.find(m=>a.path===m.path);if(h){h.handlers.push({method:a.method,opts:a.opts.constraints||void 0,meta:e.includeMeta?cd.call(this,a,e.includeMeta):null});continue}let d={method:a.method,opts:a.opts.constraints||void 0,meta:e.includeMeta?cd.call(this,a,e.includeMeta):null};r.push({path:a.path,methods:[a.method],opts:[a.opts],handlers:[d]})}if(!r.filter(o=>o.path===L1).length){let o={path:L1,truncatedPath:"",methods:[],opts:[],handlers:[{}]};r.filter(a=>a.path===$6).length?r.splice(1,0,o):r.unshift(o)}let n=fS(r);return n.forEach((o,a)=>{i+=G6(o,null,a===n.length-1,!1,!0),i+=`
109
+ `}),i}function fS(t,e){e=e||L1;let r=[],i={result:r};return t.forEach((n,o)=>{let a=n.path.split(W6);a[0]!==L1&&a[0]!==$6&&(a=[L1,a[0].slice(1),...a.slice(1)]),a.reduce((h,d,m)=>{if(!h[d]){h[d]={result:[]};let p={path:d,children:h[d].result};m===a.length-1&&(p.handlers=n.handlers),h.result.push(p)}return h[d]},i)}),r}function G6(t,e,r,i,n){let o="";if(!i&&!n&&(o+=`
110
+ `),i||(o+=`${e||""}${r?F6:q6}`),o+=`${t.path}`,t.handlers){let a=t.handlers.reduce((h,d)=>{let m=h.findIndex(p=>JSON.stringify(p.opts)===JSON.stringify(d.opts));return m!==-1?h[m].method=[h[m].method,d.method].join(", "):h.push(d),h},[]);a.forEach((h,d)=>{d>0&&(o+=`${i?"":e||""}${r?oa:aa}${t.path}`),o+=` (${h.method||"-"})`,h.opts&&JSON.stringify(h.opts)!=="{}"&&(o+=` ${JSON.stringify(h.opts)}`),h.meta&&Reflect.ownKeys(h.meta).forEach((m,p)=>{o+=`
111
+ ${i?"":e||""}${r?oa:aa}`,o+=`\u2022 (${m}) ${JSON.stringify(h.meta[m])}`}),a.length>1&&d!==a.length-1&&(o+=`
112
+ `)})}else t.children.length>1&&(o+=" (-)");return i||(e=`${e||""}${r?oa:aa}`),t.children.forEach((a,h)=>{let d=h===t.children.length-1,m=!t.handlers&&t.children.length===1;o+=G6(a,e,d,m)}),o}function V6(t,e,r,i){if(!this.buildPrettyMeta)throw new Error("buildPrettyMeta not defined");i.includeMeta=i.includeMeta||null;let n="",o=[];for(let{node:d,method:m}of t.nodes)for(let p of d.handlerStorage.handlers)o.push({method:m,...p});o.length?o.forEach((d,m)=>{let p=`(${d.method||"-"})`;Object.keys(d.constraints).length>0&&(p+=" "+JSON.stringify(d.constraints));let M="",R=t.prefix.split("").map((x,v)=>x===":"?v:null).filter(x=>x!==null);if(R.length){let x=0;R.forEach((v,E)=>{M+=t.prefix.slice(x,v+1),M+=d.params[d.params.length-R.length+E],E===R.length-1&&(M+=t.prefix.slice(v+1)),x=v+1})}else M=t.prefix;if(m===0?n+=`${M} ${p}`:n+=`
113
+ ${e}${r?oa:aa}${M} ${p}`,i.includeMeta){let x=cd.call(this,d,i.includeMeta);Object.keys(x).forEach((v,E)=>{n+=`
114
+ ${e||""}${r?oa:aa}`,n+=`\u2022 (${v}) ${JSON.stringify(x[v])}`})}}):n=t.prefix;let a=`${e}${r?F6:q6}${n}
115
+ `;e=`${e}${r?oa:aa}`;let h=Object.keys(t.children);for(let d=0;d<h.length;d++){let m=t.children[h[d]];a+=V6.call(this,m,e,d===h.length-1,i)}return a}function ah(t,e,r){if(e.handlerStorage.handlers.length!==0&&t.nodes.push({method:r,node:e}),e.parametricChildren&&e.parametricChildren[0]&&(t.children[":"]||(t.children[":"]={prefix:":",nodes:[],children:{}}),ah(t.children[":"],e.parametricChildren[0],r)),e.wildcardChild&&(t.children["*"]||(t.children["*"]={prefix:"*",nodes:[],children:{}}),ah(t.children["*"],e.wildcardChild,r)),e.staticChildren)for(let i of Object.values(e.staticChildren)){let n=i.prefix.split(W6),o=t,a;for(let h of n)a=o,o=o.children[h],o||(o={prefix:h,nodes:[],children:{}},a.children[h]=o);ah(o,i,r)}}function fd(t){let e=Object.keys(t.children);if(t.nodes.length===0&&e.length===1){let r=t.children[e[0]];if(r.nodes.length<=1)return fd(r),t.nodes=r.nodes,t.prefix+=r.prefix,t.children=r.children,t}for(let r of Object.keys(t.children))fd(t.children[r]);return t}K6.exports={flattenNode:ah,compressFlattenedNode:fd,prettyPrintFlattenedNode:V6,prettyPrintRoutesArray:cS}});var Y6=V((WI,Z6)=>{"use strict";var dd=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,r,i,n,o){let a={handler:e,params:r,constraints:o,store:i||null,_createParamsObject:this._compileCreateParamsObject(r)};Object.keys(o).length===0&&(this.unconstrainedHandler=a);for(let h of Object.keys(o))this.constraints.includes(h)||(h==="version"?this.constraints.unshift(h):this.constraints.push(h));if(this.handlers.length>=32)throw new Error("find-my-way supports a maximum of 32 route handlers per node when there are constraints, limit reached");this.handlers.push(a),this.handlers.sort((h,d)=>Object.keys(h.constraints).length-Object.keys(d.constraints).length),this._compileGetHandlerMatchingConstraints(n,o)}_compileCreateParamsObject(e){let r=[];for(let i=0;i<e.length;i++)r.push(`'${e[i]}': paramsArray[${i}]`);return new Function("paramsArray",`return {${r.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,r){for(let i=0;i<this.handlers.length;i++){let o=this.handlers[i].constraints[r];if(o!==void 0){let a=e.get(o)||0;a|=1<<i,e.set(o,a)}}}_constrainedIndexBitmask(e){let r=0;for(let i=0;i<this.handlers.length;i++)this.handlers[i].constraints[e]!==void 0&&(r|=1<<i);return~r}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let i of this.constraints){let n=e.newStoreForConstraint(i);this.constrainedHandlerStores[i]=n,this._buildConstraintStore(n,i)}let r=[];r.push(`
116
116
  let candidates = ${(1<<this.handlers.length)-1}
117
117
  let mask, matches
118
118
  `);for(let i of this.constraints){r.push(`
119
119
  mask = ${this._constrainedIndexBitmask(i)}
120
120
  value = derivedConstraints.${i}
121
- `);let s=e.strategies[i].mustMatchWhenDerived?"matches":"(matches | mask)";r.push(`
121
+ `);let o=e.strategies[i].mustMatchWhenDerived?"matches":"(matches | mask)";r.push(`
122
122
  if (value === undefined) {
123
123
  candidates &= mask
124
124
  } else {
125
125
  matches = this.constrainedHandlerStores.${i}.get(value) || 0
126
- candidates &= ${s}
126
+ candidates &= ${o}
127
127
  }
128
128
  if (candidates === 0) return null;
129
129
  `)}for(let i in e.strategies)e.strategies[i].mustMatchWhenDerived&&!this.constraints.includes(i)&&r.push(`if (derivedConstraints.${i} !== undefined) return null`);r.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",r.join(`
130
- `))}};W6.exports=ad});var G6=H((nI,H6)=>{"use strict";var TS=F6(),nc={STATIC:0,PARAMETRIC:1,WILDCARD:2},ec=class{constructor(){this.handlerStorage=new TS}},tc=class extends ec{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,r){let i=this.staticChildren[e.charAt(r)];return i===void 0||!i.matchPrefix(e,r)?null:i}createStaticChild(e){if(e.length===0)return this;let r=this.staticChildren[e.charAt(0)];if(r){let n=1;for(;n<r.prefix.length;n++)if(e.charCodeAt(n)!==r.prefix.charCodeAt(n)){r=r.split(this,n);break}return r.createStaticChild(e.slice(n))}let i=e.charAt(0);return this.staticChildren[i]=new Jo(e),this.staticChildren[i]}},Jo=class extends tc{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=nc.STATIC,this._compilePrefixMatch()}createParametricChild(e){let r=e&&e.source,i=this.parametricChildren.find(n=>(n.regex&&n.regex.source)===r);return i||(i=new rc(e),e?this.parametricChildren.unshift(i):this.parametricChildren.push(i),i)}createWildcardChild(){return this.wildcardChild?this.wildcardChild:(this.wildcardChild=new ic,this.wildcardChild)}split(e,r){let i=this.prefix.slice(0,r),n=this.prefix.slice(r);this.prefix=n,this._compilePrefixMatch();let s=new Jo(i);return s.staticChildren[n.charAt(0)]=this,e.staticChildren[i.charAt(0)]=s,s}getNextNode(e,r,i,n){let s=this.findStaticMatchingChild(e,r),a=0;if(s===null){if(this.parametricChildren.length===0)return this.wildcardChild;s=this.parametricChildren[0],a=1}this.wildcardChild!==null&&i.push({paramsCount:n,brotherPathIndex:r,brotherNode:this.wildcardChild});for(let c=this.parametricChildren.length-1;c>=a;c--)i.push({paramsCount:n,brotherPathIndex:r,brotherNode:this.parametricChildren[c]});return s}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let r=1;r<this.prefix.length;r++){let i=this.prefix.charCodeAt(r);e.push(`path.charCodeAt(i + ${r}) === ${i}`)}this.matchPrefix=new Function("path","i",`return ${e.join(" && ")}`)}},rc=class extends tc{constructor(e){super(),this.regex=e||null,this.isRegex=!!e,this.kind=nc.PARAMETRIC}getNextNode(e,r){return this.findStaticMatchingChild(e,r)}},ic=class extends ec{constructor(){super(),this.kind=nc.WILDCARD}getNextNode(){return null}};H6.exports={StaticNode:Jo,ParametricNode:rc,WildcardNode:ic,NODE_TYPES:nc}});var K6=H((sI,V6)=>{"use strict";var IS=require("assert");function E1(){if(!(this instanceof E1))return new E1;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}E1.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[r,i,n]=t.split(".");return r=Number(r)||0,i=Number(i)||0,n=Number(n)||0,r>=this.maxMajor&&(this.maxMajor=r,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),i>=(this.maxMinors[r]||0)&&(this.maxMinors[r]=i,this.store[`${r}.x`]=e,this.store[`${r}.x.x`]=e),n>=(this.store[`${r}.${i}`]||0)&&(this.maxPatches[`${r}.${i}`]=n,this.store[`${r}.${i}.x`]=e),this.store[`${r}.${i}.${n}`]=e,this};E1.prototype.get=function(t){return this.store[t]};V6.exports={name:"version",mustMatchWhenDerived:!0,storage:E1,validate(t){IS(typeof t=="string","Version should be a string")}}});var J6=H((oI,Z6)=>{"use strict";var kS=require("assert");function OS(){let t={},e=[];return{get:r=>{let i=t[r];if(i)return i;for(let n of e)if(n.host.test(r))return n.value},set:(r,i)=>{r instanceof RegExp?e.push({host:r,value:i}):t[r]=i}}}Z6.exports={name:"host",mustMatchWhenDerived:!1,storage:OS,validate(t){kS(typeof t=="string"||Object.prototype.toString.call(t)==="[object RegExp]","Host should be a string or a RegExp")}}});var X6=H((aI,Y6)=>{"use strict";var LS=K6(),NS=J6(),ld=require("assert"),ud=class{constructor(e){if(this.strategies={version:LS,host:NS},this.strategiesInUse=new Set,e)for(let r of Object.values(e))this.addConstraintStrategy(r)}hasConstraintStrategy(e){let r=this.strategies[e];return r!==void 0?r.isCustom||this.strategiesInUse.has(e):!1}addConstraintStrategy(e){if(ld(typeof e.name=="string"&&e.name!=="","strategy.name is required."),ld(e.storage&&typeof e.storage=="function","strategy.storage function is required."),ld(e.deriveConstraint&&typeof e.deriveConstraint=="function","strategy.deriveConstraint function is required."),this.strategies[e.name]&&this.strategies[e.name].isCustom)throw new Error(`There already exists a custom constraint with the name ${e.name}.`);if(this.strategiesInUse.has(e.name))throw new Error(`There already exists a route with ${e.name} constraint.`);e.isCustom=!0,this.strategies[e.name]=e,e.mustMatchWhenDerived&&this.noteUsage({[e.name]:e})}deriveConstraints(e,r){}noteUsage(e){if(e){let r=this.strategiesInUse.size;for(let i in e)this.strategiesInUse.add(i);r!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}newStoreForConstraint(e){if(!this.strategies[e])throw new Error(`No strategy registered for constraint key ${e}`);return this.strategies[e].storage()}validateConstraints(e){for(let r in e){let i=e[r];if(typeof i>"u")throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");let n=this.strategies[r];if(!n)throw new Error(`No strategy registered for constraint key ${r}`);n.validate&&n.validate(i)}}_buildDeriveConstraints(){if(this.strategiesInUse.size===0)return;let e=["return {"];for(let r of this.strategiesInUse){let i=this.strategies[r];if(i.isCustom)e.push(` ${i.name}: this.strategies.${r}.deriveConstraint(req, ctx),`);else if(r==="version")e.push(" version: req.headers['accept-version'],");else if(r==="host")e.push(" host: req.headers.host || req.headers[':authority'],");else throw new Error("unknown non-custom strategy for compiling constraint derivation function")}e.push("}"),this.deriveConstraints=new Function("req","ctx",e.join(`
131
- `)).bind(this)}};Y6.exports=ud});var t4=H((lI,e4)=>{"use strict";function Q6(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function DS(t){let e=!1,r=!1,i="";for(let s=1;s<t.length;s++){let a=t.charCodeAt(s);if(a===37){let c=t.charCodeAt(s+1),d=t.charCodeAt(s+2);Q6(c,d)===null?e=!0:(r=!0,c===50&&d===53&&(e=!0,t=t.slice(0,s+1)+"25"+t.slice(s+1),s+=2),s+=2)}else if(a===63||a===59||a===35){i=t.slice(s+1),t=t.slice(0,s);break}}return{path:e?decodeURI(t):t,querystring:i,shouldDecodeParam:r}}function BS(t){let e=t.indexOf("%");if(e===-1)return t;let r="",i=e;for(let n=e;n<t.length;n++)if(t.charCodeAt(n)===37){let s=t.charCodeAt(n+1),a=t.charCodeAt(n+2),c=Q6(s,a);r+=t.slice(i,n)+c,i=n+3}return t.slice(0,e)+r+t.slice(i)}e4.exports={safeDecodeURI:DS,safeDecodeURIComponent:BS}});var a4=H((uI,o4)=>{"use strict";var ut=require("assert"),sc=require("http"),zS=require("querystring"),fd=I6(),n4=O6(),{flattenNode:jS,compressFlattenedNode:qS,prettyPrintFlattenedNode:US,prettyPrintRoutesArray:$S}=$6(),{StaticNode:r4,NODE_TYPES:cd}=G6(),WS=X6(),{safeDecodeURI:FS,safeDecodeURIComponent:i4}=t4(),dd=sc.METHODS,s4=/^https?:\/\/.*?\//,ws=/(\/:[^/()]*?)\?(\/?)/;if(!fd(s4))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!fd(ws))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function ct(t){if(!(this instanceof ct))return new ct(t);t=t||{},t.defaultRoute?(ut(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(ut(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(ut(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=KS,t.querystringParser?(ut(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:zS.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.routes=[],this.trees={},this.constrainer=new WS(t.constraints),this._routesPatterns=[]}ct.prototype.on=function(e,r,i,n,s){typeof i=="function"&&(n!==void 0&&(s=n),n=i,i={}),ut(typeof r=="string","Path should be a string"),ut(r.length>0,"The path could not be empty"),ut(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),ut(typeof n=="function","Handler should be a function");let a=r.match(ws);if(a){ut(r.length===a.index+a[0].length,"Optional Parameter needs to be the last parameter of the path");let p=r.replace(ws,"$1$2"),m=r.replace(ws,"$2");this.on(e,p,i,n,s),this.on(e,m,i,n,s);return}let c=r;this.ignoreDuplicateSlashes&&(r=pd(r)),this.ignoreTrailingSlash&&(r=md(r));let d=Array.isArray(e)?e:[e];for(let p of d)this._on(p,r,i,n,s,c),this.routes.push({method:p,path:r,opts:i,handler:n,store:s})};ct.prototype._on=function(e,r,i,n,s){ut(typeof e=="string","Method should be a string"),ut(dd.includes(e),`Method '${e}' is not an http method.`);let a={};if(i.constraints!==void 0&&(ut(typeof i.constraints=="object"&&i.constraints!==null,"Constraints should be an object"),Object.keys(i.constraints).length!==0&&(a=i.constraints)),this.constrainer.validateConstraints(a),this.constrainer.noteUsage(a),this.trees[e]===void 0&&(this.trees[e]=new r4("/")),r==="*"&&this.trees[e].prefix.length!==0){let m=this.trees[e];this.trees[e]=new r4(""),this.trees[e].staticChildren["/"]=m}let c=this.trees[e],d=c.prefix.length,p=[];for(let m=0;m<=r.length;m++){if(r.charCodeAt(m)===58&&r.charCodeAt(m+1)===58){m++;continue}let w=r.charCodeAt(m)===58&&r.charCodeAt(m+1)!==58,S=r.charCodeAt(m)===42;if(w||S||m===r.length&&m!==d){let v=r.slice(d,m);this.caseSensitive||(v=v.toLowerCase()),v=v.split("::").join(":"),v=v.split("%").join("%25"),c=c.createStaticChild(v)}if(w){let v=!1,R=[],x=0,A=m+1;for(let T=A;;T++){let O=r.charCodeAt(T);if(O===40||O===45||O===46){v=!0;let B=r.slice(A,T);if(p.push(B),O===40){let te=VS(r,T),se=r.slice(T,te+1);this.allowUnsafeRegex||ut(fd(new RegExp(se)),`The regex '${se}' is not safe!`),R.push(GS(se)),T=te+1}else R.push("(.*?)");let z=T;for(;z<r.length;z++){let te=r.charCodeAt(z);if(te===58||te===47)break}let G=r.slice(T,z);G&&R.push(HS(G)),A=z+1,T=z,(r.charCodeAt(T)===47||T===r.length)&&(x=G.length)}else if(O===47||T===r.length){let B=r.slice(A,T);p.push(B),R.length!==0&&R.push("(.*?)")}if(r.charCodeAt(T)===47||T===r.length){r=r.slice(0,m+1)+r.slice(T-x),m+=x;break}}let C=null;v&&(C=new RegExp("^"+R.join("")+"$")),c=c.createParametricChild(C),d=m+1}else S&&(p.push("*"),c=c.createWildcardChild(),d=m+1)}this.caseSensitive||(r=r.toLowerCase());for(let m of this._routesPatterns)if(m.path===r&&m.method===e&&n4(m.constraints,a))throw new Error(`Method '${e}' already declared for route '${r}' with constraints '${JSON.stringify(a)}'`);this._routesPatterns.push({method:e,path:r,constraints:a}),c.handlerStorage.addHandler(n,p,s,this.constrainer,a)};ct.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)};ct.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)};ct.prototype.reset=function(){this.trees={},this.routes=[],this._routesPatterns=[]};ct.prototype.off=function(e,r,i){ut(typeof r=="string","Path should be a string"),ut(r.length>0,"The path could not be empty"),ut(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`");let n=r.match(ws);if(n){ut(r.length===n.index+n[0].length,"Optional Parameter needs to be the last parameter of the path");let a=r.replace(ws,"$1$2"),c=r.replace(ws,"$2");this.off(e,a,i),this.off(e,c,i);return}this.ignoreDuplicateSlashes&&(r=pd(r)),this.ignoreTrailingSlash&&(r=md(r));let s=Array.isArray(e)?e:[e];for(let a of s)this._off(a,r,i)};ct.prototype._off=function(e,r,i){ut(typeof e=="string","Method should be a string"),ut(dd.includes(e),`Method '${e}' is not an http method.`);function n(a){return!i||!a?!0:n4(i,a)}let s=this.routes.filter(a=>e!==a.method||r!==a.path||!n(a.opts.constraints));this._rebuild(s)};ct.prototype.lookup=function(e,r,i){var n=this.find(e.method,e.url,this.constrainer.deriveConstraints(e,i));return n===null?this._defaultRoute(e,r,i):i===void 0?n.handler(e,r,n.params,n.store,n.searchParams):n.handler.call(i,e,r,n.params,n.store,n.searchParams)};ct.prototype.find=function(e,r,i){let n=this.trees[e];if(n===void 0)return null;r.charCodeAt(0)!==47&&(r=r.replace(s4,"/")),this.ignoreDuplicateSlashes&&(r=pd(r));let s,a,c;try{s=FS(r),r=s.path,a=s.querystring,c=s.shouldDecodeParam}catch{return this._onBadUrl(r)}this.ignoreTrailingSlash&&(r=md(r));let d=r;this.caseSensitive===!1&&(r=r.toLowerCase());let p=this.maxParamLength,m=n.prefix.length,w=[],S=r.length,v=[];for(;;){if(m===S){let x=n.handlerStorage.getMatchingHandler(i);if(x!==null)return{handler:x.handler,store:x.store,params:x._createParamsObject(w),searchParams:this.querystringParser(a)}}let R=n.getNextNode(r,m,v,w.length);if(R===null){if(v.length===0)return null;let x=v.pop();m=x.brotherPathIndex,w.splice(x.paramsCount),R=x.brotherNode}if(n=R,n.kind===cd.STATIC){m+=n.prefix.length;continue}if(n.kind===cd.WILDCARD){let x=d.slice(m);c&&(x=i4(x)),w.push(x),m=S;continue}if(n.kind===cd.PARAMETRIC){let x=d.indexOf("/",m);x===-1&&(x=S);let A=d.slice(m,x);if(c&&(A=i4(A)),n.isRegex){let C=n.regex.exec(A);if(C===null)continue;for(let T=1;T<C.length;T++){let O=C[T];if(O.length>p)return null;w.push(O)}}else{if(A.length>p)return null;w.push(A)}m=x}}};ct.prototype._rebuild=function(t){this.reset();for(let e of t){let{method:r,path:i,opts:n,handler:s,store:a}=e;this._on(r,i,n,s,a),this.routes.push({method:r,path:i,opts:n,handler:s,store:a})}};ct.prototype._defaultRoute=function(t,e,r){if(this.defaultRoute!==null)return r===void 0?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()};ct.prototype._onBadUrl=function(t){if(this.onBadUrl===null)return null;let e=this.onBadUrl;return{handler:(r,i,n)=>e(t,r,i),params:{},store:null}};ct.prototype.prettyPrint=function(t={}){if(t.commonPrefix=t.commonPrefix===void 0?!0:t.commonPrefix,!t.commonPrefix)return $S.call(this,this.routes,t);let e={prefix:"/",nodes:[],children:{}};for(let r in this.trees){let i=this.trees[r];i&&jS(e,i,r)}return qS(e),US.call(this,e,"",!0,t)};for(hd in sc.METHODS){if(!sc.METHODS.hasOwnProperty(hd))continue;let t=sc.METHODS[hd],e=t.toLowerCase();if(ct.prototype[e])throw new Error("Method already exists: "+e);ct.prototype[e]=function(r,i,n){return this.on(t,r,i,n)}}var hd;ct.prototype.all=function(t,e,r){this.on(dd,t,e,r)};o4.exports=ct;function HS(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pd(t){return t.replace(/\/\/+/g,"/")}function md(t){return t.length>1&&t.charCodeAt(t.length-1)===47?t.slice(0,-1):t}function GS(t){return t.charCodeAt(1)===94&&(t=t.slice(0,1)+t.slice(2)),t.charCodeAt(t.length-2)===36&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function VS(t,e){for(var r=1;e<t.length;){if(e++,t[e]==="\\"){e++;continue}if(t[e]===")"?r--:t[e]==="("&&r++,!r)return e}throw new TypeError('Invalid regexp expression in "'+t+'"')}function KS(t){return t?t.store?Object.assign({},t.store):{}:{}}});var I4=H((dO,T4)=>{"use strict";T4.exports=ax;var ox={threshold:.1,includeAA:!1,alpha:.1,aaColor:[255,255,0],diffColor:[255,0,0],diffColorAlt:null,diffMask:!1};function ax(t,e,r,i,n,s){if(!Pd(t)||!Pd(e)||r&&!Pd(r))throw new Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");if(t.length!==e.length||r&&r.length!==t.length)throw new Error("Image sizes do not match.");if(t.length!==i*n*4)throw new Error("Image data size does not match width/height.");s=Object.assign({},ox,s);let a=i*n,c=new Uint32Array(t.buffer,t.byteOffset,a),d=new Uint32Array(e.buffer,e.byteOffset,a),p=!0;for(let S=0;S<a;S++)if(c[S]!==d[S]){p=!1;break}if(p){if(r&&!s.diffMask)for(let S=0;S<a;S++)A4(t,4*S,s.alpha,r);return 0}let m=35215*s.threshold*s.threshold,w=0;for(let S=0;S<n;S++)for(let v=0;v<i;v++){let R=(S*i+v)*4,x=P4(t,e,R,R);Math.abs(x)>m?!s.includeAA&&(E4(t,v,S,i,n,e)||E4(e,v,S,i,n,t))?r&&!s.diffMask&&Id(r,R,...s.aaColor):(r&&Id(r,R,...x<0&&s.diffColorAlt||s.diffColor),w++):r&&(s.diffMask||A4(t,R,s.alpha,r))}return w}function Pd(t){return ArrayBuffer.isView(t)&&t.constructor.BYTES_PER_ELEMENT===1}function E4(t,e,r,i,n,s){let a=Math.max(e-1,0),c=Math.max(r-1,0),d=Math.min(e+1,i-1),p=Math.min(r+1,n-1),m=(r*i+e)*4,w=e===a||e===d||r===c||r===p?1:0,S=0,v=0,R,x,A,C;for(let T=a;T<=d;T++)for(let O=c;O<=p;O++){if(T===e&&O===r)continue;let B=P4(t,t,m,(O*i+T)*4,!0);if(B===0){if(w++,w>2)return!1}else B<S?(S=B,R=T,x=O):B>v&&(v=B,A=T,C=O)}return S===0||v===0?!1:xc(t,R,x,i,n)&&xc(s,R,x,i,n)||xc(t,A,C,i,n)&&xc(s,A,C,i,n)}function xc(t,e,r,i,n){let s=Math.max(e-1,0),a=Math.max(r-1,0),c=Math.min(e+1,i-1),d=Math.min(r+1,n-1),p=(r*i+e)*4,m=e===s||e===c||r===a||r===d?1:0;for(let w=s;w<=c;w++)for(let S=a;S<=d;S++){if(w===e&&S===r)continue;let v=(S*i+w)*4;if(t[p]===t[v]&&t[p+1]===t[v+1]&&t[p+2]===t[v+2]&&t[p+3]===t[v+3]&&m++,m>2)return!0}return!1}function P4(t,e,r,i,n){let s=t[r+0],a=t[r+1],c=t[r+2],d=t[r+3],p=e[i+0],m=e[i+1],w=e[i+2],S=e[i+3];if(d===S&&s===p&&a===m&&c===w)return 0;d<255&&(d/=255,s=Ss(s,d),a=Ss(a,d),c=Ss(c,d)),S<255&&(S/=255,p=Ss(p,S),m=Ss(m,S),w=Ss(w,S));let v=Td(s,a,c),R=Td(p,m,w),x=v-R;if(n)return x;let A=R4(s,a,c)-R4(p,m,w),C=C4(s,a,c)-C4(p,m,w),T=.5053*x*x+.299*A*A+.1957*C*C;return v>R?-T:T}function Td(t,e,r){return t*.29889531+e*.58662247+r*.11448223}function R4(t,e,r){return t*.59597799-e*.2741761-r*.32180189}function C4(t,e,r){return t*.21147017-e*.52261711+r*.31114694}function Ss(t,e){return 255+(t-255)*e}function Id(t,e,r,i,n){t[e+0]=r,t[e+1]=i,t[e+2]=n,t[e+3]=255}function A4(t,e,r,i){let n=t[e+0],s=t[e+1],a=t[e+2],c=Ss(Td(n,s,a),r*t[e+3]/255);Id(i,e,c,c,c)}});var Ld=H(Od=>{Od.read=function(t,e,r,i,n){var s,a,c=n*8-i-1,d=(1<<c)-1,p=d>>1,m=-7,w=r?n-1:0,S=r?-1:1,v=t[e+w];for(w+=S,s=v&(1<<-m)-1,v>>=-m,m+=c;m>0;s=s*256+t[e+w],w+=S,m-=8);for(a=s&(1<<-m)-1,s>>=-m,m+=i;m>0;a=a*256+t[e+w],w+=S,m-=8);if(s===0)s=1-p;else{if(s===d)return a?NaN:(v?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-p}return(v?-1:1)*a*Math.pow(2,s-i)};Od.write=function(t,e,r,i,n,s){var a,c,d,p=s*8-n-1,m=(1<<p)-1,w=m>>1,S=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=i?0:s-1,R=i?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=m):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+w>=1?e+=S/d:e+=S*Math.pow(2,1-w),e*d>=2&&(a++,d/=2),a+w>=m?(c=0,a=m):a+w>=1?(c=(e*d-1)*Math.pow(2,n),a=a+w):(c=e*Math.pow(2,w-1)*Math.pow(2,n),a=0));n>=8;t[r+v]=c&255,v+=R,c/=256,n-=8);for(a=a<<n|c,p+=n;p>0;t[r+v]=a&255,v+=R,a/=256,p-=8);t[r+v-R]|=x*128}});var Lx={};t2(Lx,{handleRequest:()=>cg,handler:()=>Vt});module.exports=jg(Lx);var tr;(function(t){t.Imagery="im",t.TileSet="ts",t.Provider="pv",t.ImageryRule="ir",t.Style="st",t.ProcessingJob="pj",t.ConfigBundle="cb"})(tr||(tr={}));var n2=new Set(Object.values(tr));var st;(function(t){t.Raster="raster",t.Vector="vector"})(st||(st={}));var zl=class{get TileSet(){return this.cfg.TileSet}get Imagery(){return this.cfg.Imagery}get Style(){return this.cfg.Style}get Provider(){return this.cfg.Provider}get ProcessingJob(){return this.cfg.ProcessingJob}setConfigProvider(e){this.cfg=e}isTileSetRaster(e){return e==null?!1:e.type==null||e.type===st.Raster}isTileSetVector(e){return e==null?!1:e.type===st.Vector}async getAllImagery(e,r){let i=new Set;for(let n of r)for(let s of e){let a=s[n.code];a&&i.add(this.Imagery.id(a))}return this.Imagery.getAll(i)}prefix(e,r){return r===""||r.startsWith(e)?r:`${e}_${r}`}getPrefix(e){let r=e.indexOf("_");if(r===-1)return null;let i=e.slice(0,r);return n2.has(i)?i:null}unprefix(e,r){return r.startsWith(e)?r.slice(3):r}},eo=class{},qa=class{constructor(e){this.prefix=e}isWriteable(){return!1}id(e){return e.startsWith(`${this.prefix}_`)?e:`${this.prefix}_${e}`}is(e){return e!=null&&e.id.startsWith(this.prefix)}},je=new zl;var Fh;(function(t){t.Processing="processing",t.Complete="complete",t.Fail="failed"})(Fh||(Fh={}));var s2=fe(require("aws-sdk/clients/dynamodb.js"),1);var to=fe(require("aws-sdk/clients/dynamodb.js"),1);function qg(t){return{id:{S:t}}}var rn=class extends qa{constructor(e,r){super(r),this.cfg=e}ensureId(e){if(e.startsWith(this.prefix+"_"))return e;throw new Error(`Trying to query "${e}" expected prefix of ${this.prefix}`)}get db(){return this.cfg.dynamo}isWriteable(){return!0}clone(e){return to.default.Converter.unmarshall(to.default.Converter.marshall(e))}async get(e){let r=await this.db.getItem({Key:{id:{S:this.ensureId(e)}},TableName:this.cfg.tableName}).promise();if(r==null||r.Item==null)return null;let i=to.default.Converter.unmarshall(r.Item);return this.is(i)?i:null}async getAll(e){var r;let i=[];for(let s of e)i.push(qg(this.ensureId(s)));let n=new Map;for(;i.length>0;){let s=i.length>100?i.slice(0,100):i;i=i.length>100?i.slice(100):[];let a={[this.cfg.tableName]:{Keys:s}};for(;a!=null&&Object.keys(a).length>0;){let c=await this.db.batchGetItem({RequestItems:a}).promise(),d=(r=c.Responses)===null||r===void 0?void 0:r[this.cfg.tableName];if(d==null)throw new Error("Failed to fetch from "+this.cfg.tableName);for(let p of d){let m=to.default.Converter.unmarshall(p);this.is(m)&&n.set(m.id,m)}a=c.UnprocessedKeys}}return n}async put(e){return e.updatedAt=Date.now(),await this.db.putItem({TableName:this.cfg.tableName,Item:to.default.Converter.marshall(e)}).promise(),e.id}};var ro=class extends rn{constructor(){super(...arguments),this.cache=new Map}async get(e){let r=this.ensureId(e),i=this.cache.get(r);if(i==null){if(i=await super.get(r),i==null)return null;this.cache.set(r,i)}return i}async getAll(e){let r=new Map,i=new Set;for(let n of e){let s=this.ensureId(n),a=this.cache.get(s);a==null?i.add(s):r.set(s,a)}if(i.size>0){let n=await super.getAll(i);for(let s of n.values())r.set(s.id,s),this.cache.set(s.id,s)}return r}};var Ua=class extends eo{constructor(e){super(),this.Prefix=tr,this.type="dynamo",this.Imagery=new ro(this,tr.Imagery),this.Style=new ro(this,tr.Style),this.TileSet=new rn(this,tr.TileSet),this.Provider=new ro(this,tr.Provider),this.ProcessingJob=new rn(this,tr.ProcessingJob),this.dynamo=new s2.default({region:"ap-southeast-2"}),this.tableName=e}record(){let e=Date.now();return{id:"",name:"",updatedAt:e}}};var ge=class{constructor(e,r,i,n){this.x=e,this.y=r,this.width=i,this.height=n}get bottom(){return this.y+this.height}get right(){return this.x+this.width}intersects(e){return this.x<e.right&&e.x<this.right&&this.y<e.bottom&&e.y<this.bottom}containsBounds(e){return ge.contains(this,e)}intersection(e){let r=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return i>r&&s>n?new ge(r,n,i-r,s-n):null}static union(e){if(e.length===0)throw new Error("Union on empty list is not allowed");let{x:r,y:i}=e[0],n=r+e[0].width,s=i+e[0].height;for(let a=1;a<e.length;++a){let c=e[a];r=Math.min(r,c.x),n=Math.max(n,c.x+c.width),i=Math.min(i,c.y),s=Math.max(s,c.y+c.height)}return new ge(r,i,n-r,s-i)}union(e){return ge.union([this,e])}toJson(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toBbox(){return[this.x,this.y,this.right,this.bottom]}toPolygon(){return[[[this.x,this.y],[this.x,this.bottom],[this.right,this.bottom],[this.right,this.y],[this.x,this.y]]]}scale(e,r=e){return new ge(this.x*e,this.y*r,this.width*e,this.height*r)}scaleFromCenter(e,r=e){let i=this.width*e,n=this.height*r;return new ge(this.x-.5*(i-this.width),this.y-.5*(n-this.height),i,n)}pad(e,r=e){return new ge(this.x-e,this.y-r,this.width+e*2,this.height+r*2)}round(e=0){let r=Math.round(this.x-e),i=Math.round(this.y-e);return new ge(r,i,Math.round(this.right+e)-r,Math.round(this.bottom+e)-i)}add(e){return new ge(this.x+e.x,this.y+e.y,this.width,this.height)}subtract(e){return new ge(this.x-e.x,this.y-e.y,this.width,this.height)}static fromMultiPolygon(e){if(e.length===0)return new ge(0,0,0,0);let r=e[0][0][0][0],i=e[0][0][0][1],n=r,s=i;for(let[a]of e)for(let[c,d]of a)c<r?r=c:c>n&&(n=c),d<i?i=d:d>s&&(s=d);return new ge(r,i,n-r,s-i)}static fromBbox([e,r,i,n]){return new ge(Math.min(e,i),Math.min(r,n),Math.abs(i-e),Math.abs(n-r))}static fromUpperLeftLowerRight(e,r){return new ge(e.x,e.y,r.x-e.x,r.y-e.y)}static fromJson(e){return new ge(e.x,e.y,e.width,e.height)}static compareArea(e,r){let i=e.width*e.height-r.width*r.height;if(i!==0)return i;let n=e.x-r.x;return n===0?e.y-r.y:n}static contains(e,r){return e.x<=r.x&&e.x+e.width>=r.x+r.width&&e.y<=r.y&&e.y+e.height>=r.y+r.height}};var Fe;(function(t){t[t.Google=3857]="Google",t[t.Wgs84=4326]="Wgs84",t[t.Nztm2000=2193]="Nztm2000",t[t.Citm2000=3793]="Citm2000"})(Fe||(Fe={}));var Hh={google:Fe.Google,epsg3857:Fe.Google,[Fe.Google]:Fe.Google,globalmercator:Fe.Google,wgs84:Fe.Wgs84,epsg4326:Fe.Wgs84,[Fe.Wgs84]:Fe.Wgs84,nztm:Fe.Nztm2000,epsg2193:Fe.Nztm2000,[Fe.Nztm2000]:Fe.Nztm2000,nztm2000:Fe.Nztm2000,citm:Fe.Citm2000,epsg3793:Fe.Citm2000,[Fe.Citm2000]:Fe.Citm2000,citm2000:Fe.Citm2000},Se=class{constructor(e){if(this.code=e,Se.Codes.has(e))throw new Error(`Duplicate EPSG code created: ${e}`);Se.Codes.set(this.code,this)}toString(){return this.code.toString()}toJSON(){return this.code}toEpsgString(){return`EPSG:${this.code}`}toUrn(){return`urn:ogc:def:crs:EPSG::${this.code}`}static get(e){let r=Se.Codes.get(e);if(r==null)throw new Error(`Invalid EPSG:${e}`);return r}static tryGet(e){if(e!=null)return Se.Codes.get(e)}static parseCode(e){var r;return e.startsWith("urn:")?Hh[e.slice(e.lastIndexOf(":")+1)]:e.startsWith("https://")?Hh[e.slice(e.lastIndexOf("/")+1)]:(r=Hh[e.replace(/[\W_]/g,"").toLowerCase()])!==null&&r!==void 0?r:null}static parse(e){let r=Se.parseCode(e);return r==null?null:Se.get(r)}};Se.Codes=new Map;Se.Google=new Se(Fe.Google);Se.Wgs84=new Se(Fe.Wgs84);Se.Nztm2000=new Se(Fe.Nztm2000);Se.Citm2000=new Se(Fe.Citm2000);var Qx="0".charCodeAt(0),eM="1".charCodeAt(0),tM="2".charCodeAt(0),rM="3".charCodeAt(0);var io;(function(t){t[t.Xy=0]="Xy",t[t.Yx=1]="Yx"})(io||(io={}));function o2(t){return t===Se.Nztm2000?io.Yx:io.Xy}function Ug(t,e){return e.scaleDenominator-t.scaleDenominator}var _t=class{constructor(e){this.zooms=[],this.indexX=0,this.indexY=1,this.zoomConversionMap=new Map,this.def=e,this.tileSize=e.tileMatrix[0].tileHeight;let r=e.tileMatrix.slice().sort(Ug),i={};for(let p of r){if(i[p.identifier])throw new Error(`Duplicate tileMatrix identifier ${p.identifier}`);if(p.tileHeight!==p.tileWidth)throw new Error("Only square tiles supported");if(p.tileHeight!==this.tileSize)throw new Error("All tiles must have the same tile size");i[p.identifier]=!0}this.zooms=r;let n=Se.parse(e.supportedCRS);if(n==null)throw new Error(`Unable to find supported projection ${e.supportedCRS}`);this.projection=n,o2(this.projection)===io.Yx&&(this.indexX=1,this.indexY=0);let{lowerCorner:s,upperCorner:a}=e.boundingBox,c=s[this.indexX],d=s[this.indexY];this.extent=new ge(c,d,a[this.indexX]-c,a[this.indexY]-d)}get maxZoom(){return this.zooms.length-1}get identifier(){return this.def.identifier}pixelScale(e){let r=this.zooms[e];if(r==null)throw new Error(`Zoom not found :${e}`);return r.scaleDenominator*28e-5}tileToPixels(e,r){return{x:e*this.tileSize,y:r*this.tileSize}}pixelsToTile(e,r,i){let n=Math.floor(e/this.tileSize),s=Math.floor(r/this.tileSize);return{x:n,y:s,z:i}}sourceToPixels(e,r,i){let n=this.zooms[i],s=this.pixelScale(i),a=(e-n.topLeftCorner[this.indexX])/s,c=(n.topLeftCorner[this.indexY]-r)/s;return{x:a,y:c}}pixelsToSource(e,r,i){let n=this.zooms[i],s=this.pixelScale(i),a=n.topLeftCorner[this.indexX]+e*s,c=n.topLeftCorner[this.indexY]-r*s;return{x:a,y:c}}tileToSource(e){let r=this.tileToPixels(e.x,e.y);return this.pixelsToSource(r.x,r.y,e.z)}tileToSourceBounds(e){let r=this.tileToSource(e),i=this.pixelScale(e.z)*this.tileSize;return new ge(r.x,r.y-i,i,i)}*topLevelTiles(){let{matrixWidth:r,matrixHeight:i}=this.zooms[0];for(let n=0;n<i;++n)for(let s=0;s<r;++s)yield{x:s,y:n,z:0};return null}*coverTile(e){if(e==null)return yield*this.topLevelTiles(),null;let r=e.z+1,{matrixWidth:i,matrixHeight:n}=this.zooms[e.z],{matrixWidth:s,matrixHeight:a}=this.zooms[r],c=s/i,d=a/n,p=Math.floor(e.x*c),m=Math.floor(e.y*d),w=Math.ceil((e.x+1)*c),S=Math.ceil((e.y+1)*d);for(let v=m;v<S;++v)for(let R=p;R<w;++R)yield{x:R,y:v,z:r};return null}static tileToName(e){return`${e.z}-${e.x}-${e.y}`}static nameToTile(e){let r=e.split("-");if(r.length===3){let i=Number(r[0]),n=Number(r[1]),s=Number(r[2]);if(!(isNaN(i)||isNaN(s)||isNaN(n)))return{x:n,y:s,z:i}}throw new Error(`Invalid tile name '${e}'`)}findBestZoom(e){let r=this.zoomConversionMap.get(e);return r==null&&(r=this.convertZoomLevel(e),this.zoomConversionMap.set(e,r)),r}convertZoomLevel(e){for(let r=0;r<this.zooms.length;r++){let i=this.zooms[r].scaleDenominator-e;if(i>1e-5)continue;if(r===0)return r;let n=this.zooms[r-1].scaleDenominator-e;return Math.abs(i)<n?r:r-1}return this.maxZoom}static convertZoomLevel(e,r,i,n=!0){return r.identifier===i.identifier||(e>=r.maxZoom&&(e=r.maxZoom),n&&e===0)?e:n&&e===r.maxZoom?i.maxZoom:i.findBestZoom(r.zooms[e].scaleDenominator)}};var $a={Version:"1.0.0-beta.2",License:"CC BY 4.0",BaseMapsExtension:"https://basemaps.linz.govt.nz/json-schema/stac-basemaps-extension/1.0/schema.json"};var $g={type:"TileMatrixSetType",title:"Google Maps Compatible for the World",identifier:"WebMercatorQuad",boundingBox:{type:"BoundingBoxType",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",lowerCorner:[-200375083427892e-7,-200375083427892e-7],upperCorner:[200375083427892e-7,200375083427892e-7]},supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/3857",wellKnownScaleSet:"https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:559082264028717e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:279541132014358e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:139770566007179e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:698852830035897e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:349426415017948e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:174713207508974e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:873566037544871e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:436783018772435e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:218391509386217e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:109195754693108e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:545978.773465544,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:272989.386732772,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:136494.693366386,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:68247.346683193,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:34123.6733415964,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:17061.8366707982,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:8530.91833539913,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:4265.45916769956,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:2132.72958384978,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:1066.36479192489,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:533.182395962445,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:266.591197981222,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152},{type:"TileMatrixType",identifier:"22",scaleDenominator:133.295598990611,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4194304,matrixHeight:4194304},{type:"TileMatrixType",identifier:"23",scaleDenominator:66.6477994953056,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8388608,matrixHeight:8388608},{type:"TileMatrixType",identifier:"24",scaleDenominator:33.3238997476528,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16777216,matrixHeight:16777216}]},lt=new _t($g);var Ul=fe(u2(),1),$l=new _t(Ul.Nztm2000),nn=new _t(Ul.Nztm2000Quad);var sn={All:[lt,$l,nn],Defaults:new Map([[Se.Google.code,lt],[Se.Nztm2000.code,$l]]),get(t){let e=this.tryGet(t);if(e==null)throw new Error("Failed to lookup TileMatrixSet: "+t);return e},tryGet(t){var e,r;return t==null?null:typeof t=="number"?(e=this.Defaults.get(t))!==null&&e!==void 0?e:null:(r=this.Defaults.get(t.code))!==null&&r!==void 0?r:null},find(t){if(t==null)return null;let e=Se.parse(t);if(e!=null)return sn.tryGet(e);for(let r of sn.All)if(r.identifier===t)return r;return null}};var qe;(function(t){t.Png="png",t.Jpeg="jpeg",t.Webp="webp",t.Avif="avif"})(qe||(qe={}));var rr;(function(t){t.MapboxVectorTiles="pbf"})(rr||(rr={}));var h2=fe(Zn(),1);function Hg(t){if(!t.endsWith("m")||!t.includes("-"))return null;let e=Number(t.replace("-",".").slice(0,t.length-1));return isNaN(e)?null:String(e)+"m"}function Gg(t){let e=t.split("-");return e.length!==2||e[0].length!==4?null:e[1].length===4?t:e[1].length===2?`${e[0]}-${e[0].slice(0,2)}${e[1]}`:null}var Vg=[Hg,Gg];function so(t){let e=new Set(t.split("_"));e.delete("RGB"),e.delete("RGBI"),e.delete("RGBA");let r=[];for(let i of e){let n=!1;for(let s of Vg){let a=s(i);if(a!=null){n=!0,r.push(a);break}}n||r.push(i)}return r.join("-")}var zt={parse(t){let e={name:t},r=t.indexOf(":");return r!==-1&&(e.layer=e.name.substring(r+1),e.name=e.name.substring(0,r)),e},componentsToName(t){return zt.toName(t.name,t.layer)},toName(t,e){let r=[t];return e&&r.push(`:${e}`),r.join("")}};function Wa(t){if(t==="")return 0;let e=parseInt(t,16);if(isNaN(e))throw new Error("Invalid hex byte: "+t);return e}function Fl(t){if(t.startsWith("0x")?t=t.slice(2):t.startsWith("#")&&(t=t.slice(1)),t.length!==6&&t.length!==8)throw new Error("Invalid hex color: "+t);return{r:Wa(t.substr(0,2)),g:Wa(t.substr(2,2)),b:Wa(t.substr(4,2)),alpha:Wa(t.substr(6,2))}}var an=fe(require("fs"),1),Vl=fe(require("path"),1);var St;(function(t){t[t.UInt8=1]="UInt8",t[t.UInt16=2]="UInt16",t[t.UInt32=4]="UInt32",t[t.UInt64=8]="UInt64",t[t.Double=8]="Double",t[t.Float=4]="Float"})(St||(St={}));var f2=2**32,Kg=typeof setImmediate>"u"?setTimeout:setImmediate,At=()=>{throw new Error("Method not implemented.")},xt=class{constructor(){this.isLittleEndian=!0,this.delayMs=xt.DefaultDelayMs,this.maxChunkCount=10,this.chunks=xt.DefaultChunkCache(),this.blankFillCount=16,this.maxConcurrentRequests=50,this.toFetch=new Set,this.toFetchPromise=null,this.byteOffset=0,this.getFloat32=At,this.getFloat64=At,this.getInt8=At,this.getInt16=At,this.getInt32=At,this.setFloat32=At,this.setFloat64=At,this.setInt8=At,this.setInt16=At,this.setInt32=At,this.setUint8=At,this.setUint16=At,this.setUint32=At,this.setBigInt64=At,this.setBigUint64=At}static getByteRanges(e,r=32,i=16){if(e.size===0)return{chunks:[],blankFill:[]};let n=[...e.values()].sort((d,p)=>d-p),s=[],a=[];s.push(a);let c=[];for(let d=0;d<n.length;++d){let p=n[d],m=n[d-1];if(a.length>=r)a=[p],s.push(a);else if(d===0||p===m+1)a.push(p);else if(p<m+i){for(let w=m;w<p;w++)a.push(w+1),c.push(w+1);c.pop()}else a=[p],s.push(a)}return{chunks:s,blankFill:c}}async fetchData(){if(this.toFetch.size===0)return;let e=this.toFetch;this.toFetch=new Set,this.toFetchPromise=null;let r=xt.getByteRanges(e,this.maxChunkCount,this.blankFillCount),i=[];for(let n of r.chunks){let s=n[0],a=n[n.length-1],c=s*this.chunkSize,d=a*this.chunkSize+this.chunkSize-c,p=await this.fetchBytes(c,d);if(n.length===1){i[s]=p,this.chunks.set(s,new DataView(p));continue}let m=s*this.chunkSize;for(let w of n){let S=w*this.chunkSize-m,v=p.slice(S,S+this.chunkSize);i[w]=v,this.chunks.set(w,new DataView(v))}}}async loadBytes(e,r){if(e<0)throw new Error("Offset must be positive");let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let s=i;s<=n;s++)this.chunks.has(s)||this.toFetch.add(s);if(this.toFetch.size!==0){if(this.toFetchPromise==null&&(this.toFetchPromise=new Promise(s=>Kg(s,this.delayMs)).then(()=>this.fetchData())),this.toFetch.size>this.maxConcurrentRequests)throw new Error("Too many outstanding requests");await this.toFetchPromise}}getChunkId(e){return Math.floor(e/this.chunkSize)}getUint(e,r){switch(r){case St.UInt8:return this.getUint8(e);case St.UInt16:return this.getUint16(e);case St.UInt32:return this.getUint32(e);case St.UInt64:return this.getUint64(e)}}bytes(e,r){let i=this.isOneChunk(e,r);if(i){let p=this.getView(i),m=e-i*this.chunkSize;return new Uint8Array(p.buffer.slice(m,m+r))}let n=new Uint8Array(r),s=e+r,a=Math.floor(e/this.chunkSize),c=Math.ceil((e+r)/this.chunkSize)-1,d=0;for(let p=a;p<=c;p++){let m=e+d,w=p*this.chunkSize,S=this.getView(p),v=Math.min(s,w+this.chunkSize),R=S.buffer.slice(m-w,v-w);n.set(new Uint8Array(R),d),d+=R.byteLength}return n}getView(e){let r=this.chunks.get(e);if(r==null)throw new Error(`Chunk:${e} is not ready`);return r}isOneChunk(e,r){let i=e+r-1,n=Math.floor(e/this.chunkSize);return Math.floor(i/this.chunkSize)-n<1?n:null}hasBytes(e,r=1){let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let s=i;s<=n;s++)if(!this.chunks.has(s))return!1;return!0}toRange(e,r){if(r==null)return`bytes=${e}`;if(e<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${e}-${e+r}`}parseContentRange(e){let[r,i]=e.split(" ");if(r!=="bytes")throw new Error("Failed to parse content-range: "+e);if(i==null)throw new Error("Failed to parse content-range: "+e);let[,n]=i.split("/"),s=Number(n);if(isNaN(s))throw new Error("Failed to parse content-range: "+e);return s}get buffer(){throw new Error("Method not implemented.")}get byteLength(){if(this._byteLength)return this._byteLength;throw Error(".size() has not been fetched.")}getUint8(e){let r=Math.floor(e/this.chunkSize),i=this.chunks.get(r);if(i==null)throw new Error(`Chunk:${r} is not ready`);return i.getUint8(e-r*this.chunkSize)}getUint16(e){let r=this.isOneChunk(e,St.UInt16);if(r!=null)return this.getView(r).getUint16(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint8(e),n=this.getUint8(e+St.UInt8);return this.isLittleEndian?i+(n<<8):(i<<8)+n}getUint32(e){let r=this.isOneChunk(e,St.UInt32);if(r!=null)return this.getView(r).getUint32(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint16(e),n=this.getUint16(e+St.UInt16);return this.isLittleEndian?i+n*65536:i*65536+n}getUint64(e){let r=this.isOneChunk(e,St.UInt64);if(r!=null){let s=this.getView(r);return Number(s.getBigUint64(e-r*this.chunkSize,this.isLittleEndian))}let i=this.getUint32(e),n=this.getUint32(e+St.UInt32);return this.isLittleEndian?i+n*f2:i*f2+n}getBigUint64(e){let r=this.isOneChunk(e,St.UInt64);if(r!=null)return this.getView(r).getBigUint64(e-r*this.chunkSize,this.isLittleEndian);let i=BigInt(this.getUint32(e)),n=BigInt(this.getUint32(e+St.UInt32));return this.isLittleEndian?i+(n<<BigInt(32)):(i<<BigInt(32))+n}getBigInt64(){throw new Error("Not implemented.")}};xt.DefaultChunkCache=()=>new Map;xt.DefaultDelayMs=1;var Je=class extends Error{constructor(e,r,i){super(e),this.name="CompositeError",this.code=r,this.reason=i}static isCompositeError(e){return typeof e!="object"||e==null?!1:e.name==="CompositeError"}};function Ai(t){return typeof t=="object"&&t!==null}function ni(t){let e=t.split("/"),r=e[0];if(r==null||r==="")return null;r.endsWith(":")&&(r=r.slice(0,r.length-1));let i=e[2];if(i==null||i.trim()==="")return null;if(e.length===3)return{protocol:r,bucket:i};let n=e.slice(3).join("/");return n==null||n.trim()===""?{protocol:r,bucket:i}:{key:n,bucket:i,protocol:r}}var Jg=/\/$/,Yg=/^\//;function Gh(t,e){return t.replace(Jg,"")+"/"+e.replace(Yg,"")}function d2(t,...e){let r=t;for(let i=0;i<e.length;i++)r=Gh(r,e[i]);return r}async function p2(t){let e=[];for await(let r of t)e.push(r);return e}var Vh=require("fs"),Hl=require("path"),on=class extends xt{constructor(e){super(),this.type="file",this.protocol="file",this.chunkSize=on.DefaultChunkSize,this.fd=null,this.closeAfterRead=!1,this.fileName=e}static isSource(e){return e.type==="file"}async close(){let e=await this.fd;e!=null&&(await e.close(),this.fd=null)}get uri(){return(0,Hl.resolve)(this.fileName)}get name(){return(0,Hl.basename)(this.fileName)}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>(await Vh.promises.stat(this.fileName)).size),this._size)}async fetchBytes(e,r){if(e<0&&r!=null)throw new Error("Cannot fetch negative offsets with length");if(e<0&&(r=Math.abs(e),e=await this.size+e),r==null)throw new Error("Length is required for reading from files");this.fd==null&&(this.fd=Vh.promises.open(this.fileName,"r"));let i=await this.fd,{buffer:n}=await i.read(Buffer.allocUnsafe(r),0,r,e);return this.closeAfterRead&&await this.close(),n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}};on.DefaultChunkSize=16*1024;function Gl(t,e){return Ai(t)?t.code==="ENOENT"?new Je(e,404,t):t.code==="EACCES"?new Je(e,403,t):new Je(e,500,t):new Je(e,500,t)}var Pi=class{constructor(){this.protocol=Pi.protocol}static is(e){return e.protocol===Pi.protocol}source(e){return new on(e)}async*list(e,r){try{let i=await an.default.promises.readdir(e,{withFileTypes:!0}),n=Vl.default.resolve(e);for(let s of i){let a=Vl.default.join(n,s.name);s.isDirectory()&&r?.recursive!==!1?yield*this.list(a):yield a}}catch(i){throw Gl(i,`Failed to list: ${e}`)}}async*details(e,r){for await(let i of this.list(e,r)){let n=await this.head(i);n!=null&&(yield n)}}async head(e){try{let r=await an.default.promises.stat(e);return{path:e,size:r.size,isDirectory:r.isDirectory()}}catch(r){if(Ai(r)&&r.code==="ENOENT")return null;throw Gl(r,`Failed to stat: ${e}`)}}async read(e){try{return await an.default.promises.readFile(e)}catch(r){throw Gl(r,`Failed to read: ${e}`)}}async write(e,r){let i=Vl.default.dirname(e);await an.default.promises.mkdir(i,{recursive:!0});try{if(Buffer.isBuffer(r)||typeof r=="string")await an.default.promises.writeFile(e,r);else{let n=an.default.createWriteStream(e);await new Promise((s,a)=>{n.on("finish",s),n.on("error",a),r.pipe(n)})}}catch(n){throw Gl(n,`Failed to write: ${e}`)}}stream(e){return an.default.createReadStream(e)}};Pi.protocol="file";var Z2=fe(require("http"),1),J2=fe(require("https"),1),ts=fe(require("zlib"),1),nr=fe(require("stream"),1),Qa=require("buffer");function Xg(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),i="",n=!1,s=r[0]||"text/plain",a=s;for(let m=1;m<r.length;m++)r[m]==="base64"?n=!0:(a+=`;${r[m]}`,r[m].indexOf("charset=")===0&&(i=r[m].substring(8)));!r[0]&&!i.length&&(a+=";charset=US-ASCII",i="US-ASCII");let c=n?"base64":"ascii",d=unescape(t.substring(e+1)),p=Buffer.from(d,c);return p.type=s,p.typeFull=a,p.charset=i,p}var m2=Xg;var gr=fe(require("stream"),1),Oi=require("util"),ir=require("buffer");Ha();Jl();var ki=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var jt=class extends ki{constructor(e,r,i){super(e,r),i&&(this.code=this.errno=i.code,this.erroredSysCall=i.syscall)}};var Yl=Symbol.toStringTag,Yh=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[Yl]==="URLSearchParams",Za=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[Yl]),R2=t=>typeof t=="object"&&(t[Yl]==="AbortSignal"||t[Yl]==="EventTarget"),C2=(t,e)=>{let r=new URL(e).hostname,i=new URL(t).hostname;return r===i||r.endsWith(`.${i}`)};var dy=(0,Oi.promisify)(gr.default.pipeline),qt=Symbol("Body internals"),oi=class{constructor(e,{size:r=0}={}){let i=null;e===null?e=null:Yh(e)?e=ir.Buffer.from(e.toString()):Za(e)||ir.Buffer.isBuffer(e)||(Oi.types.isAnyArrayBuffer(e)?e=ir.Buffer.from(e):ArrayBuffer.isView(e)?e=ir.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof gr.default||(e instanceof Yn?(e=E2(e),i=e.type.split("=")[1]):e=ir.Buffer.from(String(e))));let n=e;ir.Buffer.isBuffer(e)?n=gr.default.Readable.from(e):Za(e)&&(n=gr.default.Readable.from(e.stream())),this[qt]={body:e,stream:n,boundary:i,disturbed:!1,error:null},this.size=r,e instanceof gr.default&&e.on("error",s=>{let a=s instanceof ki?s:new jt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[qt].error=a})}get body(){return this[qt].stream}get bodyUsed(){return this[qt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:i}=await eu(this);return e.slice(r,r+i)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let i=new Yn,n=new URLSearchParams(await this.text());for(let[s,a]of n)i.append(s,a);return i}let{toFormData:r}=await Promise.resolve().then(()=>(L2(),O2));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[qt].body&&this[qt].body.type||"",r=await this.arrayBuffer();return new Ii([r],{type:e})}async json(){let e=await eu(this);return JSON.parse(e.toString())}async text(){return(await eu(this)).toString()}buffer(){return eu(this)}};oi.prototype.buffer=(0,Oi.deprecate)(oi.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(oi.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Oi.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function eu(t){if(t[qt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[qt].disturbed=!0,t[qt].error)throw t[qt].error;let{body:e}=t;if(e===null)return ir.Buffer.alloc(0);if(!(e instanceof gr.default))return ir.Buffer.alloc(0);let r=[],i=0;try{for await(let n of e){if(t.size>0&&i+n.length>t.size){let s=new jt(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}i+=n.length,r.push(n)}}catch(n){throw n instanceof ki?n:new jt(`Invalid response body while trying to fetch ${t.url}: ${n.message}`,"system",n)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(n=>typeof n=="string")?ir.Buffer.from(r.join("")):ir.Buffer.concat(r,i)}catch(n){throw new jt(`Could not create Buffer from response body for ${t.url}: ${n.message}`,"system",n)}else throw new jt(`Premature close of server response while trying to fetch ${t.url}`)}var uo=(t,e)=>{let r,i,{body:n}=t[qt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof gr.default&&typeof n.getBoundary!="function"&&(r=new gr.PassThrough({highWaterMark:e}),i=new gr.PassThrough({highWaterMark:e}),n.pipe(r),n.pipe(i),t[qt].stream=r,n=i),n},py=(0,Oi.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),tu=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Yh(t)?"application/x-www-form-urlencoded;charset=UTF-8":Za(t)?t.type||null:ir.Buffer.isBuffer(t)||Oi.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Yn?`multipart/form-data; boundary=${e[qt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${py(t)}`:t instanceof gr.default?null:"text/plain;charset=UTF-8",N2=t=>{let{body:e}=t[qt];return e===null?0:Za(e)?e.size:ir.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},D2=async(t,{body:e})=>{e===null?t.end():await dy(e,t)};var tf=require("util"),Xa=fe(require("http"),1),ru=typeof Xa.default.validateHeaderName=="function"?Xa.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},rf=typeof Xa.default.validateHeaderValue=="function"?Xa.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},Ut=class extends URLSearchParams{constructor(e){let r=[];if(e instanceof Ut){let i=e.raw();for(let[n,s]of Object.entries(i))r.push(...s.map(a=>[n,a]))}else if(e!=null)if(typeof e=="object"&&!tf.types.isBoxedPrimitive(e)){let i=e[Symbol.iterator];if(i==null)r.push(...Object.entries(e));else{if(typeof i!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(n=>{if(typeof n!="object"||tf.types.isBoxedPrimitive(n))throw new TypeError("Each header pair must be an iterable object");return[...n]}).map(n=>{if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...n]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([i,n])=>(ru(i),rf(i,String(n)),[String(i).toLowerCase(),String(n)])):void 0,super(r),new Proxy(this,{get(i,n,s){switch(n){case"append":case"set":return(a,c)=>(ru(a),rf(a,String(c)),URLSearchParams.prototype[n].call(i,String(a).toLowerCase(),String(c)));case"delete":case"has":case"getAll":return a=>(ru(a),URLSearchParams.prototype[n].call(i,String(a).toLowerCase()));case"keys":return()=>(i.sort(),new Set(URLSearchParams.prototype.keys.call(i)).keys());default:return Reflect.get(i,n,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let i=r.join(", ");return/^content-encoding$/i.test(e)&&(i=i.toLowerCase()),i}forEach(e,r=void 0){for(let i of this.keys())Reflect.apply(e,r,[this.get(i),i,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,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let i=this.getAll(r);return r==="host"?e[r]=i[0]:e[r]=i.length>1?i:i[0],e},{})}};Object.defineProperties(Ut.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));function B2(t=[]){return new Ut(t.reduce((e,r,i,n)=>(i%2===0&&e.push(n.slice(i,i+2)),e),[]).filter(([e,r])=>{try{return ru(e),rf(e,String(r)),!0}catch{return!1}}))}var my=new Set([301,302,303,307,308]),iu=t=>my.has(t);var Nr=Symbol("Response internals"),Mt=class extends oi{constructor(e=null,r={}){super(e,r);let i=r.status!=null?r.status:200,n=new Ut(r.headers);if(e!==null&&!n.has("Content-Type")){let s=tu(e,this);s&&n.append("Content-Type",s)}this[Nr]={type:"default",url:r.url,status:i,statusText:r.statusText||"",headers:n,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Nr].type}get url(){return this[Nr].url||""}get status(){return this[Nr].status}get ok(){return this[Nr].status>=200&&this[Nr].status<300}get redirected(){return this[Nr].counter>0}get statusText(){return this[Nr].statusText}get headers(){return this[Nr].headers}get highWaterMark(){return this[Nr].highWaterMark}clone(){return new Mt(uo(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,r=302){if(!iu(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new Mt(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new Mt(null,{status:0,statusText:""});return e[Nr].type="error",e}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Mt.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}});var G2=require("url"),V2=require("util");var z2=t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""};var q2=require("net");function j2(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}var U2=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),$2="strict-origin-when-cross-origin";function W2(t){if(!U2.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function gy(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,q2.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:/^(.+\.)*localhost$/.test(t.host)?!1:t.protocol==="file:"}function co(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:gy(t)}function F2(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let i=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let n=t.referrer,s=j2(n),a=j2(n,!0);s.toString().length>4096&&(s=a),e&&(s=e(s)),r&&(a=r(a));let c=new URL(t.url);switch(i){case"no-referrer":return"no-referrer";case"origin":return a;case"unsafe-url":return s;case"strict-origin":return co(s)&&!co(c)?"no-referrer":a.toString();case"strict-origin-when-cross-origin":return s.origin===c.origin?s:co(s)&&!co(c)?"no-referrer":a;case"same-origin":return s.origin===c.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===c.origin?s:a;case"no-referrer-when-downgrade":return co(s)&&!co(c)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${i}`)}}function H2(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let i of e)i&&U2.has(i)&&(r=i);return r}var ft=Symbol("Request internals"),nu=t=>typeof t=="object"&&typeof t[ft]=="object",yy=(0,V2.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Li=class extends oi{constructor(e,r={}){let i;if(nu(e)?i=new URL(e.url):(i=new URL(e),e={}),i.username!==""||i.password!=="")throw new TypeError(`${i} is an url with embedded credentails.`);let n=r.method||e.method||"GET";if(n=n.toUpperCase(),"data"in r&&yy(),(r.body!=null||nu(e)&&e.body!==null)&&(n==="GET"||n==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:nu(e)&&e.body!==null?uo(e):null;super(s,{size:r.size||e.size||0});let a=new Ut(r.headers||e.headers||{});if(s!==null&&!a.has("Content-Type")){let p=tu(s,this);p&&a.set("Content-Type",p)}let c=nu(e)?e.signal:null;if("signal"in r&&(c=r.signal),c!=null&&!R2(c))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let d=r.referrer==null?e.referrer:r.referrer;if(d==="")d="no-referrer";else if(d){let p=new URL(d);d=/^about:(\/\/)?client$/.test(p)?"client":p}else d=void 0;this[ft]={method:n,redirect:r.redirect||e.redirect||"follow",headers:a,parsedURL:i,signal:c,referrer:d},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[ft].method}get url(){return(0,G2.format)(this[ft].parsedURL)}get headers(){return this[ft].headers}get redirect(){return this[ft].redirect}get signal(){return this[ft].signal}get referrer(){if(this[ft].referrer==="no-referrer")return"";if(this[ft].referrer==="client")return"about:client";if(this[ft].referrer)return this[ft].referrer.toString()}get referrerPolicy(){return this[ft].referrerPolicy}set referrerPolicy(e){this[ft].referrerPolicy=W2(e)}clone(){return new Li(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Li.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}});var K2=t=>{let{parsedURL:e}=t[ft],r=new Ut(t[ft].headers);r.has("Accept")||r.set("Accept","*/*");let i=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(i="0"),t.body!==null){let c=N2(t);typeof c=="number"&&!Number.isNaN(c)&&(i=String(c))}i&&r.set("Content-Length",i),t.referrerPolicy===""&&(t.referrerPolicy=$2),t.referrer&&t.referrer!=="no-referrer"?t[ft].referrer=F2(t):t[ft].referrer="no-referrer",t[ft].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate,br");let{agent:n}=t;typeof n=="function"&&(n=n(e)),!r.has("Connection")&&!n&&r.set("Connection","close");let s=z2(e),a={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:n};return{parsedURL:e,options:a}};var su=class extends ki{constructor(e,r="aborted"){super(e,r)}};Jl();Qh();var by=new Set(["data:","http:","https:"]);async function ou(t,e){return new Promise((r,i)=>{let n=new Li(t,e),{parsedURL:s,options:a}=K2(n);if(!by.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let R=m2(n.url),x=new Mt(R,{headers:{"Content-Type":R.typeFull}});r(x);return}let c=(s.protocol==="https:"?J2.default:Z2.default).request,{signal:d}=n,p=null,m=()=>{let R=new su("The operation was aborted.");i(R),n.body&&n.body instanceof nr.default.Readable&&n.body.destroy(R),!(!p||!p.body)&&p.body.emit("error",R)};if(d&&d.aborted){m();return}let w=()=>{m(),v()},S=c(s.toString(),a);d&&d.addEventListener("abort",w);let v=()=>{S.abort(),d&&d.removeEventListener("abort",w)};S.on("error",R=>{i(new jt(`request to ${n.url} failed, reason: ${R.message}`,"system",R)),v()}),vy(S,R=>{p.body.destroy(R)}),process.version<"v14"&&S.on("socket",R=>{let x;R.prependListener("end",()=>{x=R._eventsCount}),R.prependListener("close",A=>{if(p&&x<R._eventsCount&&!A){let C=new Error("Premature close");C.code="ERR_STREAM_PREMATURE_CLOSE",p.body.emit("error",C)}})}),S.on("response",R=>{S.setTimeout(0);let x=B2(R.rawHeaders);if(iu(R.statusCode)){let B=x.get("Location"),z=null;try{z=B===null?null:new URL(B,n.url)}catch{if(n.redirect!=="manual"){i(new jt(`uri requested responds with an invalid redirect URL: ${B}`,"invalid-redirect")),v();return}}switch(n.redirect){case"error":i(new jt(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,"no-redirect")),v();return;case"manual":break;case"follow":{if(z===null)break;if(n.counter>=n.follow){i(new jt(`maximum redirect reached at: ${n.url}`,"max-redirect")),v();return}let G={headers:new Ut(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:uo(n),signal:n.signal,size:n.size,referrer:n.referrer,referrerPolicy:n.referrerPolicy};if(!C2(n.url,z))for(let se of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(se);if(R.statusCode!==303&&n.body&&e.body instanceof nr.default.Readable){i(new jt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),v();return}(R.statusCode===303||(R.statusCode===301||R.statusCode===302)&&n.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let te=H2(x);te&&(G.referrerPolicy=te),r(ou(new Li(z,G))),v();return}default:return i(new TypeError(`Redirect option '${n.redirect}' is not a valid value of RequestRedirect`))}}d&&R.once("end",()=>{d.removeEventListener("abort",w)});let A=(0,nr.pipeline)(R,new nr.PassThrough,B=>{B&&i(B)});process.version<"v12.10"&&R.on("aborted",w);let C={url:n.url,status:R.statusCode,statusText:R.statusMessage,headers:x,size:n.size,counter:n.counter,highWaterMark:n.highWaterMark},T=x.get("Content-Encoding");if(!n.compress||n.method==="HEAD"||T===null||R.statusCode===204||R.statusCode===304){p=new Mt(A,C),r(p);return}let O={flush:ts.default.Z_SYNC_FLUSH,finishFlush:ts.default.Z_SYNC_FLUSH};if(T==="gzip"||T==="x-gzip"){A=(0,nr.pipeline)(A,ts.default.createGunzip(O),B=>{B&&i(B)}),p=new Mt(A,C),r(p);return}if(T==="deflate"||T==="x-deflate"){let B=(0,nr.pipeline)(R,new nr.PassThrough,z=>{z&&i(z)});B.once("data",z=>{(z[0]&15)===8?A=(0,nr.pipeline)(A,ts.default.createInflate(),G=>{G&&i(G)}):A=(0,nr.pipeline)(A,ts.default.createInflateRaw(),G=>{G&&i(G)}),p=new Mt(A,C),r(p)}),B.once("end",()=>{p||(p=new Mt(A,C),r(p))});return}if(T==="br"){A=(0,nr.pipeline)(A,ts.default.createBrotliDecompress(),B=>{B&&i(B)}),p=new Mt(A,C),r(p);return}p=new Mt(A,C),r(p)}),D2(S,n).catch(i)})}function vy(t,e){let r=Qa.Buffer.from(`0\r
130
+ `))}};Z6.exports=dd});var Q6=V((HI,X6)=>{"use strict";var dS=Y6(),fh={STATIC:0,PARAMETRIC:1,WILDCARD:2},lh=class{constructor(){this.handlerStorage=new dS}},uh=class extends lh{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,r){let i=this.staticChildren[e.charAt(r)];return i===void 0||!i.matchPrefix(e,r)?null:i}createStaticChild(e){if(e.length===0)return this;let r=this.staticChildren[e.charAt(0)];if(r){let n=1;for(;n<r.prefix.length;n++)if(e.charCodeAt(n)!==r.prefix.charCodeAt(n)){r=r.split(this,n);break}return r.createStaticChild(e.slice(n))}let i=e.charAt(0);return this.staticChildren[i]=new la(e),this.staticChildren[i]}},la=class extends uh{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=fh.STATIC,this._compilePrefixMatch()}createParametricChild(e){let r=e&&e.source,i=this.parametricChildren.find(n=>(n.regex&&n.regex.source)===r);return i||(i=new hh(e),e?this.parametricChildren.unshift(i):this.parametricChildren.push(i),i)}createWildcardChild(){return this.wildcardChild?this.wildcardChild:(this.wildcardChild=new ch,this.wildcardChild)}split(e,r){let i=this.prefix.slice(0,r),n=this.prefix.slice(r);this.prefix=n,this._compilePrefixMatch();let o=new la(i);return o.staticChildren[n.charAt(0)]=this,e.staticChildren[i.charAt(0)]=o,o}getNextNode(e,r,i,n){let o=this.findStaticMatchingChild(e,r),a=0;if(o===null){if(this.parametricChildren.length===0)return this.wildcardChild;o=this.parametricChildren[0],a=1}this.wildcardChild!==null&&i.push({paramsCount:n,brotherPathIndex:r,brotherNode:this.wildcardChild});for(let h=this.parametricChildren.length-1;h>=a;h--)i.push({paramsCount:n,brotherPathIndex:r,brotherNode:this.parametricChildren[h]});return o}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let r=1;r<this.prefix.length;r++){let i=this.prefix.charCodeAt(r);e.push(`path.charCodeAt(i + ${r}) === ${i}`)}this.matchPrefix=new Function("path","i",`return ${e.join(" && ")}`)}},hh=class extends uh{constructor(e){super(),this.regex=e||null,this.isRegex=!!e,this.kind=fh.PARAMETRIC}getNextNode(e,r){return this.findStaticMatchingChild(e,r)}},ch=class extends lh{constructor(){super(),this.kind=fh.WILDCARD}getNextNode(){return null}};X6.exports={StaticNode:la,ParametricNode:hh,WildcardNode:ch,NODE_TYPES:fh}});var t4=V((GI,e4)=>{"use strict";var mS=require("assert");function N1(){if(!(this instanceof N1))return new N1;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}N1.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[r,i,n]=t.split(".");return r=Number(r)||0,i=Number(i)||0,n=Number(n)||0,r>=this.maxMajor&&(this.maxMajor=r,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),i>=(this.maxMinors[r]||0)&&(this.maxMinors[r]=i,this.store[`${r}.x`]=e,this.store[`${r}.x.x`]=e),n>=(this.store[`${r}.${i}`]||0)&&(this.maxPatches[`${r}.${i}`]=n,this.store[`${r}.${i}.x`]=e),this.store[`${r}.${i}.${n}`]=e,this};N1.prototype.get=function(t){return this.store[t]};e4.exports={name:"version",mustMatchWhenDerived:!0,storage:N1,validate(t){mS(typeof t=="string","Version should be a string")}}});var i4=V((VI,r4)=>{"use strict";var pS=require("assert");function gS(){let t={},e=[];return{get:r=>{let i=t[r];if(i)return i;for(let n of e)if(n.host.test(r))return n.value},set:(r,i)=>{r instanceof RegExp?e.push({host:r,value:i}):t[r]=i}}}r4.exports={name:"host",mustMatchWhenDerived:!1,storage:gS,validate(t){pS(typeof t=="string"||Object.prototype.toString.call(t)==="[object RegExp]","Host should be a string or a RegExp")}}});var s4=V((KI,n4)=>{"use strict";var yS=t4(),bS=i4(),md=require("assert"),pd=class{constructor(e){if(this.strategies={version:yS,host:bS},this.strategiesInUse=new Set,e)for(let r of Object.values(e))this.addConstraintStrategy(r)}hasConstraintStrategy(e){let r=this.strategies[e];return r!==void 0?r.isCustom||this.strategiesInUse.has(e):!1}addConstraintStrategy(e){if(md(typeof e.name=="string"&&e.name!=="","strategy.name is required."),md(e.storage&&typeof e.storage=="function","strategy.storage function is required."),md(e.deriveConstraint&&typeof e.deriveConstraint=="function","strategy.deriveConstraint function is required."),this.strategies[e.name]&&this.strategies[e.name].isCustom)throw new Error(`There already exists a custom constraint with the name ${e.name}.`);if(this.strategiesInUse.has(e.name))throw new Error(`There already exists a route with ${e.name} constraint.`);e.isCustom=!0,this.strategies[e.name]=e,e.mustMatchWhenDerived&&this.noteUsage({[e.name]:e})}deriveConstraints(e,r){}noteUsage(e){if(e){let r=this.strategiesInUse.size;for(let i in e)this.strategiesInUse.add(i);r!==this.strategiesInUse.size&&this._buildDeriveConstraints()}}newStoreForConstraint(e){if(!this.strategies[e])throw new Error(`No strategy registered for constraint key ${e}`);return this.strategies[e].storage()}validateConstraints(e){for(let r in e){let i=e[r];if(typeof i>"u")throw new Error("Can't pass an undefined constraint value, must pass null or no key at all");let n=this.strategies[r];if(!n)throw new Error(`No strategy registered for constraint key ${r}`);n.validate&&n.validate(i)}}_buildDeriveConstraints(){if(this.strategiesInUse.size===0)return;let e=["return {"];for(let r of this.strategiesInUse){let i=this.strategies[r];if(i.isCustom)e.push(` ${i.name}: this.strategies.${r}.deriveConstraint(req, ctx),`);else if(r==="version")e.push(" version: req.headers['accept-version'],");else if(r==="host")e.push(" host: req.headers.host || req.headers[':authority'],");else throw new Error("unknown non-custom strategy for compiling constraint derivation function")}e.push("}"),this.deriveConstraints=new Function("req","ctx",e.join(`
131
+ `)).bind(this)}};n4.exports=pd});var l4=V((JI,a4)=>{"use strict";function o4(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function vS(t){let e=!1,r=!1,i="";for(let o=1;o<t.length;o++){let a=t.charCodeAt(o);if(a===37){let h=t.charCodeAt(o+1),d=t.charCodeAt(o+2);o4(h,d)===null?e=!0:(r=!0,h===50&&d===53&&(e=!0,t=t.slice(0,o+1)+"25"+t.slice(o+1),o+=2),o+=2)}else if(a===63||a===59||a===35){i=t.slice(o+1),t=t.slice(0,o);break}}return{path:e?decodeURI(t):t,querystring:i,shouldDecodeParam:r}}function wS(t){let e=t.indexOf("%");if(e===-1)return t;let r="",i=e;for(let n=e;n<t.length;n++)if(t.charCodeAt(n)===37){let o=t.charCodeAt(n+1),a=t.charCodeAt(n+2),h=o4(o,a);r+=t.slice(i,n)+h,i=n+3}return t.slice(0,e)+r+t.slice(i)}a4.exports={safeDecodeURI:vS,safeDecodeURIComponent:wS}});var m4=V((ZI,d4)=>{"use strict";var ut=require("assert"),dh=require("http"),_S=require("querystring"),bd=z6(),c4=U6(),{flattenNode:xS,compressFlattenedNode:SS,prettyPrintFlattenedNode:MS,prettyPrintRoutesArray:ES}=J6(),{StaticNode:u4,NODE_TYPES:gd}=Q6(),RS=s4(),{safeDecodeURI:CS,safeDecodeURIComponent:h4}=l4(),vd=dh.METHODS,f4=/^https?:\/\/.*?\//,Ss=/(\/:[^/()]*?)\?(\/?)/;if(!bd(f4))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!bd(Ss))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function ht(t){if(!(this instanceof ht))return new ht(t);t=t||{},t.defaultRoute?(ut(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(ut(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(ut(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=IS,t.querystringParser?(ut(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:_S.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.routes=[],this.trees={},this.constrainer=new RS(t.constraints),this._routesPatterns=[]}ht.prototype.on=function(e,r,i,n,o){typeof i=="function"&&(n!==void 0&&(o=n),n=i,i={}),ut(typeof r=="string","Path should be a string"),ut(r.length>0,"The path could not be empty"),ut(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`"),ut(typeof n=="function","Handler should be a function");let a=r.match(Ss);if(a){ut(r.length===a.index+a[0].length,"Optional Parameter needs to be the last parameter of the path");let m=r.replace(Ss,"$1$2"),p=r.replace(Ss,"$2");this.on(e,m,i,n,o),this.on(e,p,i,n,o);return}let h=r;this.ignoreDuplicateSlashes&&(r=wd(r)),this.ignoreTrailingSlash&&(r=_d(r));let d=Array.isArray(e)?e:[e];for(let m of d)this._on(m,r,i,n,o,h),this.routes.push({method:m,path:r,opts:i,handler:n,store:o})};ht.prototype._on=function(e,r,i,n,o){ut(typeof e=="string","Method should be a string"),ut(vd.includes(e),`Method '${e}' is not an http method.`);let a={};if(i.constraints!==void 0&&(ut(typeof i.constraints=="object"&&i.constraints!==null,"Constraints should be an object"),Object.keys(i.constraints).length!==0&&(a=i.constraints)),this.constrainer.validateConstraints(a),this.constrainer.noteUsage(a),this.trees[e]===void 0&&(this.trees[e]=new u4("/")),r==="*"&&this.trees[e].prefix.length!==0){let p=this.trees[e];this.trees[e]=new u4(""),this.trees[e].staticChildren["/"]=p}let h=this.trees[e],d=h.prefix.length,m=[];for(let p=0;p<=r.length;p++){if(r.charCodeAt(p)===58&&r.charCodeAt(p+1)===58){p++;continue}let M=r.charCodeAt(p)===58&&r.charCodeAt(p+1)!==58,R=r.charCodeAt(p)===42;if(M||R||p===r.length&&p!==d){let x=r.slice(d,p);this.caseSensitive||(x=x.toLowerCase()),x=x.split("::").join(":"),x=x.split("%").join("%25"),h=h.createStaticChild(x)}if(M){let x=!1,v=[],E=0,T=p+1;for(let P=T;;P++){let k=r.charCodeAt(P);if(k===40||k===45||k===46){x=!0;let B=r.slice(T,P);if(m.push(B),k===40){let J=PS(r,P),ne=r.slice(P,J+1);this.allowUnsafeRegex||ut(bd(new RegExp(ne)),`The regex '${ne}' is not safe!`),v.push(TS(ne)),P=J+1}else v.push("(.*?)");let z=P;for(;z<r.length;z++){let J=r.charCodeAt(z);if(J===58||J===47)break}let H=r.slice(P,z);H&&v.push(AS(H)),T=z+1,P=z,(r.charCodeAt(P)===47||P===r.length)&&(E=H.length)}else if(k===47||P===r.length){let B=r.slice(T,P);m.push(B),v.length!==0&&v.push("(.*?)")}if(r.charCodeAt(P)===47||P===r.length){r=r.slice(0,p+1)+r.slice(P-E),p+=E;break}}let C=null;x&&(C=new RegExp("^"+v.join("")+"$")),h=h.createParametricChild(C),d=p+1}else R&&(m.push("*"),h=h.createWildcardChild(),d=p+1)}this.caseSensitive||(r=r.toLowerCase());for(let p of this._routesPatterns)if(p.path===r&&p.method===e&&c4(p.constraints,a))throw new Error(`Method '${e}' already declared for route '${r}' with constraints '${JSON.stringify(a)}'`);this._routesPatterns.push({method:e,path:r,constraints:a}),h.handlerStorage.addHandler(n,m,o,this.constrainer,a)};ht.prototype.hasConstraintStrategy=function(t){return this.constrainer.hasConstraintStrategy(t)};ht.prototype.addConstraintStrategy=function(t){this.constrainer.addConstraintStrategy(t),this._rebuild(this.routes)};ht.prototype.reset=function(){this.trees={},this.routes=[],this._routesPatterns=[]};ht.prototype.off=function(e,r,i){ut(typeof r=="string","Path should be a string"),ut(r.length>0,"The path could not be empty"),ut(r[0]==="/"||r[0]==="*","The first character of a path should be `/` or `*`");let n=r.match(Ss);if(n){ut(r.length===n.index+n[0].length,"Optional Parameter needs to be the last parameter of the path");let a=r.replace(Ss,"$1$2"),h=r.replace(Ss,"$2");this.off(e,a,i),this.off(e,h,i);return}this.ignoreDuplicateSlashes&&(r=wd(r)),this.ignoreTrailingSlash&&(r=_d(r));let o=Array.isArray(e)?e:[e];for(let a of o)this._off(a,r,i)};ht.prototype._off=function(e,r,i){ut(typeof e=="string","Method should be a string"),ut(vd.includes(e),`Method '${e}' is not an http method.`);function n(a){return!i||!a?!0:c4(i,a)}let o=this.routes.filter(a=>e!==a.method||r!==a.path||!n(a.opts.constraints));this._rebuild(o)};ht.prototype.lookup=function(e,r,i){var n=this.find(e.method,e.url,this.constrainer.deriveConstraints(e,i));return n===null?this._defaultRoute(e,r,i):i===void 0?n.handler(e,r,n.params,n.store,n.searchParams):n.handler.call(i,e,r,n.params,n.store,n.searchParams)};ht.prototype.find=function(e,r,i){let n=this.trees[e];if(n===void 0)return null;r.charCodeAt(0)!==47&&(r=r.replace(f4,"/")),this.ignoreDuplicateSlashes&&(r=wd(r));let o,a,h;try{o=CS(r),r=o.path,a=o.querystring,h=o.shouldDecodeParam}catch{return this._onBadUrl(r)}this.ignoreTrailingSlash&&(r=_d(r));let d=r;this.caseSensitive===!1&&(r=r.toLowerCase());let m=this.maxParamLength,p=n.prefix.length,M=[],R=r.length,x=[];for(;;){if(p===R){let E=n.handlerStorage.getMatchingHandler(i);if(E!==null)return{handler:E.handler,store:E.store,params:E._createParamsObject(M),searchParams:this.querystringParser(a)}}let v=n.getNextNode(r,p,x,M.length);if(v===null){if(x.length===0)return null;let E=x.pop();p=E.brotherPathIndex,M.splice(E.paramsCount),v=E.brotherNode}if(n=v,n.kind===gd.STATIC){p+=n.prefix.length;continue}if(n.kind===gd.WILDCARD){let E=d.slice(p);h&&(E=h4(E)),M.push(E),p=R;continue}if(n.kind===gd.PARAMETRIC){let E=d.indexOf("/",p);E===-1&&(E=R);let T=d.slice(p,E);if(h&&(T=h4(T)),n.isRegex){let C=n.regex.exec(T);if(C===null)continue;for(let P=1;P<C.length;P++){let k=C[P];if(k.length>m)return null;M.push(k)}}else{if(T.length>m)return null;M.push(T)}p=E}}};ht.prototype._rebuild=function(t){this.reset();for(let e of t){let{method:r,path:i,opts:n,handler:o,store:a}=e;this._on(r,i,n,o,a),this.routes.push({method:r,path:i,opts:n,handler:o,store:a})}};ht.prototype._defaultRoute=function(t,e,r){if(this.defaultRoute!==null)return r===void 0?this.defaultRoute(t,e):this.defaultRoute.call(r,t,e);e.statusCode=404,e.end()};ht.prototype._onBadUrl=function(t){if(this.onBadUrl===null)return null;let e=this.onBadUrl;return{handler:(r,i,n)=>e(t,r,i),params:{},store:null}};ht.prototype.prettyPrint=function(t={}){if(t.commonPrefix=t.commonPrefix===void 0?!0:t.commonPrefix,!t.commonPrefix)return ES.call(this,this.routes,t);let e={prefix:"/",nodes:[],children:{}};for(let r in this.trees){let i=this.trees[r];i&&xS(e,i,r)}return SS(e),MS.call(this,e,"",!0,t)};for(yd in dh.METHODS){if(!dh.METHODS.hasOwnProperty(yd))continue;let t=dh.METHODS[yd],e=t.toLowerCase();if(ht.prototype[e])throw new Error("Method already exists: "+e);ht.prototype[e]=function(r,i,n){return this.on(t,r,i,n)}}var yd;ht.prototype.all=function(t,e,r){this.on(vd,t,e,r)};d4.exports=ht;function AS(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wd(t){return t.replace(/\/\/+/g,"/")}function _d(t){return t.length>1&&t.charCodeAt(t.length-1)===47?t.slice(0,-1):t}function TS(t){return t.charCodeAt(1)===94&&(t=t.slice(0,1)+t.slice(2)),t.charCodeAt(t.length-2)===36&&(t=t.slice(0,t.length-2)+t.slice(t.length-1)),t}function PS(t,e){for(var r=1;e<t.length;){if(e++,t[e]==="\\"){e++;continue}if(t[e]===")"?r--:t[e]==="("&&r++,!r)return e}throw new TypeError('Invalid regexp expression in "'+t+'"')}function IS(t){return t?t.store?Object.assign({},t.store):{}:{}}});var z4=V((eL,D4)=>{"use strict";D4.exports=WS;var $S={threshold:.1,includeAA:!1,alpha:.1,aaColor:[255,255,0],diffColor:[255,0,0],diffColorAlt:null,diffMask:!1};function WS(t,e,r,i,n,o){if(!Nd(t)||!Nd(e)||r&&!Nd(r))throw new Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");if(t.length!==e.length||r&&r.length!==t.length)throw new Error("Image sizes do not match.");if(t.length!==i*n*4)throw new Error("Image data size does not match width/height.");o=Object.assign({},$S,o);let a=i*n,h=new Uint32Array(t.buffer,t.byteOffset,a),d=new Uint32Array(e.buffer,e.byteOffset,a),m=!0;for(let R=0;R<a;R++)if(h[R]!==d[R]){m=!1;break}if(m){if(r&&!o.diffMask)for(let R=0;R<a;R++)N4(t,4*R,o.alpha,r);return 0}let p=35215*o.threshold*o.threshold,M=0;for(let R=0;R<n;R++)for(let x=0;x<i;x++){let v=(R*i+x)*4,E=B4(t,e,v,v);Math.abs(E)>p?!o.includeAA&&(O4(t,x,R,i,n,e)||O4(e,x,R,i,n,t))?r&&!o.diffMask&&Dd(r,v,...o.aaColor):(r&&Dd(r,v,...E<0&&o.diffColorAlt||o.diffColor),M++):r&&(o.diffMask||N4(t,v,o.alpha,r))}return M}function Nd(t){return ArrayBuffer.isView(t)&&t.constructor.BYTES_PER_ELEMENT===1}function O4(t,e,r,i,n,o){let a=Math.max(e-1,0),h=Math.max(r-1,0),d=Math.min(e+1,i-1),m=Math.min(r+1,n-1),p=(r*i+e)*4,M=e===a||e===d||r===h||r===m?1:0,R=0,x=0,v,E,T,C;for(let P=a;P<=d;P++)for(let k=h;k<=m;k++){if(P===e&&k===r)continue;let B=B4(t,t,p,(k*i+P)*4,!0);if(B===0){if(M++,M>2)return!1}else B<R?(R=B,v=P,E=k):B>x&&(x=B,T=P,C=k)}return R===0||x===0?!1:Ih(t,v,E,i,n)&&Ih(o,v,E,i,n)||Ih(t,T,C,i,n)&&Ih(o,T,C,i,n)}function Ih(t,e,r,i,n){let o=Math.max(e-1,0),a=Math.max(r-1,0),h=Math.min(e+1,i-1),d=Math.min(r+1,n-1),m=(r*i+e)*4,p=e===o||e===h||r===a||r===d?1:0;for(let M=o;M<=h;M++)for(let R=a;R<=d;R++){if(M===e&&R===r)continue;let x=(R*i+M)*4;if(t[m]===t[x]&&t[m+1]===t[x+1]&&t[m+2]===t[x+2]&&t[m+3]===t[x+3]&&p++,p>2)return!0}return!1}function B4(t,e,r,i,n){let o=t[r+0],a=t[r+1],h=t[r+2],d=t[r+3],m=e[i+0],p=e[i+1],M=e[i+2],R=e[i+3];if(d===R&&o===m&&a===p&&h===M)return 0;d<255&&(d/=255,o=Es(o,d),a=Es(a,d),h=Es(h,d)),R<255&&(R/=255,m=Es(m,R),p=Es(p,R),M=Es(M,R));let x=Bd(o,a,h),v=Bd(m,p,M),E=x-v;if(n)return E;let T=k4(o,a,h)-k4(m,p,M),C=L4(o,a,h)-L4(m,p,M),P=.5053*E*E+.299*T*T+.1957*C*C;return x>v?-P:P}function Bd(t,e,r){return t*.29889531+e*.58662247+r*.11448223}function k4(t,e,r){return t*.59597799-e*.2741761-r*.32180189}function L4(t,e,r){return t*.21147017-e*.52261711+r*.31114694}function Es(t,e){return 255+(t-255)*e}function Dd(t,e,r,i,n){t[e+0]=r,t[e+1]=i,t[e+2]=n,t[e+3]=255}function N4(t,e,r,i){let n=t[e+0],o=t[e+1],a=t[e+2],h=Es(Bd(n,o,a),r*t[e+3]/255);Dd(i,e,h,h,h)}});var Ud=V(jd=>{jd.read=function(t,e,r,i,n){var o,a,h=n*8-i-1,d=(1<<h)-1,m=d>>1,p=-7,M=r?n-1:0,R=r?-1:1,x=t[e+M];for(M+=R,o=x&(1<<-p)-1,x>>=-p,p+=h;p>0;o=o*256+t[e+M],M+=R,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=i;p>0;a=a*256+t[e+M],M+=R,p-=8);if(o===0)o=1-m;else{if(o===d)return a?NaN:(x?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-m}return(x?-1:1)*a*Math.pow(2,o-i)};jd.write=function(t,e,r,i,n,o){var a,h,d,m=o*8-n-1,p=(1<<m)-1,M=p>>1,R=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=i?0:o-1,v=i?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(h=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+M>=1?e+=R/d:e+=R*Math.pow(2,1-M),e*d>=2&&(a++,d/=2),a+M>=p?(h=0,a=p):a+M>=1?(h=(e*d-1)*Math.pow(2,n),a=a+M):(h=e*Math.pow(2,M-1)*Math.pow(2,n),a=0));n>=8;t[r+x]=h&255,x+=v,h/=256,n-=8);for(a=a<<n|h,m+=n;m>0;t[r+x]=a&255,x+=v,a/=256,m-=8);t[r+x-v]|=E*128}});var yM={};s2(yM,{handleRequest:()=>_g,handler:()=>Zt});module.exports=by(yM);var Ut;(function(t){t.Imagery="im",t.TileSet="ts",t.Provider="pv",t.ImageryRule="ir",t.Style="st",t.ProcessingJob="pj",t.ConfigBundle="cb"})(Ut||(Ut={}));var l2=new Set(Object.values(Ut));var ot;(function(t){t.Raster="raster",t.Vector="vector"})(ot||(ot={}));var Gl=class{get TileSet(){return this.cfg.TileSet}get Imagery(){return this.cfg.Imagery}get Style(){return this.cfg.Style}get Provider(){return this.cfg.Provider}get ProcessingJob(){return this.cfg.ProcessingJob}get ConfigBundle(){return this.cfg.ConfigBundle}setConfigProvider(e){this.cfg=e}isTileSetRaster(e){return e==null?!1:e.type==null||e.type===ot.Raster}isTileSetVector(e){return e==null?!1:e.type===ot.Vector}async getAllImagery(e,r){let i=new Set;for(let n of r)for(let o of e){let a=o[n.code];a&&i.add(this.Imagery.id(a))}return this.Imagery.getAll(i)}prefix(e,r){return r===""||r.startsWith(e)?r:`${e}_${r}`}getPrefix(e){let r=e.indexOf("_");if(r===-1)return null;let i=e.slice(0,r);return l2.has(i)?i:null}unprefix(e,r){return r.startsWith(e)?r.slice(3):r}},fo=class{},Za=class{constructor(e){this.prefix=e}isWriteable(){return!1}id(e){return e.startsWith(`${this.prefix}_`)?e:`${this.prefix}_${e}`}is(e){return e!=null&&e.id.startsWith(this.prefix)}},je=new Gl;var Zc;(function(t){t.Processing="processing",t.Complete="complete",t.Fail="failed"})(Zc||(Zc={}));var u2=de(require("aws-sdk/clients/dynamodb.js"),1);var mo=de(require("aws-sdk/clients/dynamodb.js"),1);function vy(t){return{id:{S:t}}}var Ei=class extends Za{constructor(e,r){super(r),this.cfg=e}ensureId(e){if(e.startsWith(this.prefix+"_"))return e;throw new Error(`Trying to query "${e}" expected prefix of ${this.prefix}`)}get db(){return this.cfg.dynamo}isWriteable(){return!0}clone(e){return mo.default.Converter.unmarshall(mo.default.Converter.marshall(e))}async get(e){let r=await this.db.getItem({Key:{id:{S:this.ensureId(e)}},TableName:this.cfg.tableName}).promise();if(r==null||r.Item==null)return null;let i=mo.default.Converter.unmarshall(r.Item);return this.is(i)?i:null}async getAll(e){var r;let i=[];for(let o of e)i.push(vy(this.ensureId(o)));let n=new Map;for(;i.length>0;){let o=i.length>100?i.slice(0,100):i;i=i.length>100?i.slice(100):[];let a={[this.cfg.tableName]:{Keys:o}};for(;a!=null&&Object.keys(a).length>0;){let h=await this.db.batchGetItem({RequestItems:a}).promise(),d=(r=h.Responses)===null||r===void 0?void 0:r[this.cfg.tableName];if(d==null)throw new Error("Failed to fetch from "+this.cfg.tableName);for(let m of d){let p=mo.default.Converter.unmarshall(m);this.is(p)&&n.set(p.id,p)}a=h.UnprocessedKeys}}return n}async put(e){return e.updatedAt=Date.now(),await this.db.putItem({TableName:this.cfg.tableName,Item:mo.default.Converter.marshall(e)}).promise(),e.id}};var po=class extends Ei{constructor(){super(...arguments),this.cache=new Map}async get(e){let r=this.ensureId(e),i=this.cache.get(r);if(i==null){if(i=await super.get(r),i==null)return null;this.cache.set(r,i)}return i}async getAll(e){let r=new Map,i=new Set;for(let n of e){let o=this.ensureId(n),a=this.cache.get(o);a==null?i.add(o):r.set(o,a)}if(i.size>0){let n=await super.getAll(i);for(let o of n.values())r.set(o.id,o),this.cache.set(o.id,o)}return r}};var Ya=class extends fo{constructor(e){super(),this.Prefix=Ut,this.type="dynamo",this.Imagery=new po(this,Ut.Imagery),this.Style=new po(this,Ut.Style),this.TileSet=new Ei(this,Ut.TileSet),this.Provider=new po(this,Ut.Provider),this.ProcessingJob=new Ei(this,Ut.ProcessingJob),this.ConfigBundle=new Ei(this,Ut.ConfigBundle),this.dynamo=new u2.default({region:"ap-southeast-2"}),this.tableName=e}record(){let e=Date.now();return{id:"",name:"",updatedAt:e}}};var ye=class{constructor(e,r,i,n){this.x=e,this.y=r,this.width=i,this.height=n}get bottom(){return this.y+this.height}get right(){return this.x+this.width}intersects(e){return this.x<e.right&&e.x<this.right&&this.y<e.bottom&&e.y<this.bottom}containsBounds(e){return ye.contains(this,e)}intersection(e){let r=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),o=Math.min(this.y+this.height,e.y+e.height);return i>r&&o>n?new ye(r,n,i-r,o-n):null}static union(e){if(e.length===0)throw new Error("Union on empty list is not allowed");let{x:r,y:i}=e[0],n=r+e[0].width,o=i+e[0].height;for(let a=1;a<e.length;++a){let h=e[a];r=Math.min(r,h.x),n=Math.max(n,h.x+h.width),i=Math.min(i,h.y),o=Math.max(o,h.y+h.height)}return new ye(r,i,n-r,o-i)}union(e){return ye.union([this,e])}toJson(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toBbox(){return[this.x,this.y,this.right,this.bottom]}toPolygon(){return[[[this.x,this.y],[this.x,this.bottom],[this.right,this.bottom],[this.right,this.y],[this.x,this.y]]]}scale(e,r=e){return new ye(this.x*e,this.y*r,this.width*e,this.height*r)}scaleFromCenter(e,r=e){let i=this.width*e,n=this.height*r;return new ye(this.x-.5*(i-this.width),this.y-.5*(n-this.height),i,n)}pad(e,r=e){return new ye(this.x-e,this.y-r,this.width+e*2,this.height+r*2)}round(e=0){let r=Math.round(this.x-e),i=Math.round(this.y-e);return new ye(r,i,Math.round(this.right+e)-r,Math.round(this.bottom+e)-i)}add(e){return new ye(this.x+e.x,this.y+e.y,this.width,this.height)}subtract(e){return new ye(this.x-e.x,this.y-e.y,this.width,this.height)}static fromMultiPolygon(e){if(e.length===0)return new ye(0,0,0,0);let r=e[0][0][0][0],i=e[0][0][0][1],n=r,o=i;for(let[a]of e)for(let[h,d]of a)h<r?r=h:h>n&&(n=h),d<i?i=d:d>o&&(o=d);return new ye(r,i,n-r,o-i)}static fromBbox([e,r,i,n]){return new ye(Math.min(e,i),Math.min(r,n),Math.abs(i-e),Math.abs(n-r))}static fromUpperLeftLowerRight(e,r){return new ye(e.x,e.y,r.x-e.x,r.y-e.y)}static fromJson(e){return new ye(e.x,e.y,e.width,e.height)}static compareArea(e,r){let i=e.width*e.height-r.width*r.height;if(i!==0)return i;let n=e.x-r.x;return n===0?e.y-r.y:n}static contains(e,r){return e.x<=r.x&&e.x+e.width>=r.x+r.width&&e.y<=r.y&&e.y+e.height>=r.y+r.height}};var We;(function(t){t[t.Google=3857]="Google",t[t.Wgs84=4326]="Wgs84",t[t.Nztm2000=2193]="Nztm2000",t[t.Citm2000=3793]="Citm2000"})(We||(We={}));var Yc={google:We.Google,epsg3857:We.Google,[We.Google]:We.Google,globalmercator:We.Google,wgs84:We.Wgs84,epsg4326:We.Wgs84,[We.Wgs84]:We.Wgs84,nztm:We.Nztm2000,epsg2193:We.Nztm2000,[We.Nztm2000]:We.Nztm2000,nztm2000:We.Nztm2000,citm:We.Citm2000,epsg3793:We.Citm2000,[We.Citm2000]:We.Citm2000,citm2000:We.Citm2000},_e=class{constructor(e){if(this.code=e,_e.Codes.has(e))throw new Error(`Duplicate EPSG code created: ${e}`);_e.Codes.set(this.code,this)}toString(){return this.code.toString()}toJSON(){return this.code}toEpsgString(){return`EPSG:${this.code}`}toUrn(){return`urn:ogc:def:crs:EPSG::${this.code}`}static get(e){let r=_e.Codes.get(e);if(r==null)throw new Error(`Invalid EPSG:${e}`);return r}static tryGet(e){if(e!=null)return _e.Codes.get(e)}static parseCode(e){var r;return e.startsWith("urn:")?Yc[e.slice(e.lastIndexOf(":")+1)]:e.startsWith("https://")?Yc[e.slice(e.lastIndexOf("/")+1)]:(r=Yc[e.replace(/[\W_]/g,"").toLowerCase()])!==null&&r!==void 0?r:null}static parse(e){let r=_e.parseCode(e);return r==null?null:_e.get(r)}};_e.Codes=new Map;_e.Google=new _e(We.Google);_e.Wgs84=new _e(We.Wgs84);_e.Nztm2000=new _e(We.Nztm2000);_e.Citm2000=new _e(We.Citm2000);var BM="0".charCodeAt(0),DM="1".charCodeAt(0),zM="2".charCodeAt(0),jM="3".charCodeAt(0);var go;(function(t){t[t.Xy=0]="Xy",t[t.Yx=1]="Yx"})(go||(go={}));function h2(t){return t===_e.Nztm2000?go.Yx:go.Xy}function wy(t,e){return e.scaleDenominator-t.scaleDenominator}var _t=class{constructor(e){this.zooms=[],this.indexX=0,this.indexY=1,this.zoomConversionMap=new Map,this.def=e,this.tileSize=e.tileMatrix[0].tileHeight;let r=e.tileMatrix.slice().sort(wy),i={};for(let m of r){if(i[m.identifier])throw new Error(`Duplicate tileMatrix identifier ${m.identifier}`);if(m.tileHeight!==m.tileWidth)throw new Error("Only square tiles supported");if(m.tileHeight!==this.tileSize)throw new Error("All tiles must have the same tile size");i[m.identifier]=!0}this.zooms=r;let n=_e.parse(e.supportedCRS);if(n==null)throw new Error(`Unable to find supported projection ${e.supportedCRS}`);this.projection=n,h2(this.projection)===go.Yx&&(this.indexX=1,this.indexY=0);let{lowerCorner:o,upperCorner:a}=e.boundingBox,h=o[this.indexX],d=o[this.indexY];this.extent=new ye(h,d,a[this.indexX]-h,a[this.indexY]-d)}get maxZoom(){return this.zooms.length-1}get identifier(){return this.def.identifier}pixelScale(e){let r=this.zooms[e];if(r==null)throw new Error(`Zoom not found :${e}`);return r.scaleDenominator*28e-5}tileToPixels(e,r){return{x:e*this.tileSize,y:r*this.tileSize}}pixelsToTile(e,r,i){let n=Math.floor(e/this.tileSize),o=Math.floor(r/this.tileSize);return{x:n,y:o,z:i}}sourceToPixels(e,r,i){let n=this.zooms[i],o=this.pixelScale(i),a=(e-n.topLeftCorner[this.indexX])/o,h=(n.topLeftCorner[this.indexY]-r)/o;return{x:a,y:h}}pixelsToSource(e,r,i){let n=this.zooms[i],o=this.pixelScale(i),a=n.topLeftCorner[this.indexX]+e*o,h=n.topLeftCorner[this.indexY]-r*o;return{x:a,y:h}}tileToSource(e){let r=this.tileToPixels(e.x,e.y);return this.pixelsToSource(r.x,r.y,e.z)}tileToSourceBounds(e){let r=this.tileToSource(e),i=this.pixelScale(e.z)*this.tileSize;return new ye(r.x,r.y-i,i,i)}*topLevelTiles(){let{matrixWidth:r,matrixHeight:i}=this.zooms[0];for(let n=0;n<i;++n)for(let o=0;o<r;++o)yield{x:o,y:n,z:0};return null}*coverTile(e){if(e==null)return yield*this.topLevelTiles(),null;let r=e.z+1,{matrixWidth:i,matrixHeight:n}=this.zooms[e.z],{matrixWidth:o,matrixHeight:a}=this.zooms[r],h=o/i,d=a/n,m=Math.floor(e.x*h),p=Math.floor(e.y*d),M=Math.ceil((e.x+1)*h),R=Math.ceil((e.y+1)*d);for(let x=p;x<R;++x)for(let v=m;v<M;++v)yield{x:v,y:x,z:r};return null}static tileToName(e){return`${e.z}-${e.x}-${e.y}`}static nameToTile(e){let r=e.split("-");if(r.length===3){let i=Number(r[0]),n=Number(r[1]),o=Number(r[2]);if(!(isNaN(i)||isNaN(o)||isNaN(n)))return{x:n,y:o,z:i}}throw new Error(`Invalid tile name '${e}'`)}findBestZoom(e){let r=this.zoomConversionMap.get(e);return r==null&&(r=this.convertZoomLevel(e),this.zoomConversionMap.set(e,r)),r}convertZoomLevel(e){for(let r=0;r<this.zooms.length;r++){let i=this.zooms[r].scaleDenominator-e;if(i>1e-5)continue;if(r===0)return r;let n=this.zooms[r-1].scaleDenominator-e;return Math.abs(i)<n?r:r-1}return this.maxZoom}static convertZoomLevel(e,r,i,n=!0){return r.identifier===i.identifier||(e>=r.maxZoom&&(e=r.maxZoom),n&&e===0)?e:n&&e===r.maxZoom?i.maxZoom:i.findBestZoom(r.zooms[e].scaleDenominator)}};var Xa={Version:"1.0.0-beta.2",License:"CC BY 4.0",BaseMapsExtension:"https://basemaps.linz.govt.nz/json-schema/stac-basemaps-extension/1.0/schema.json"};var _y={type:"TileMatrixSetType",title:"Google Maps Compatible for the World",identifier:"WebMercatorQuad",boundingBox:{type:"BoundingBoxType",crs:"http://www.opengis.net/def/crs/EPSG/0/3857",lowerCorner:[-200375083427892e-7,-200375083427892e-7],upperCorner:[200375083427892e-7,200375083427892e-7]},supportedCRS:"https://www.opengis.net/def/crs/EPSG/0/3857",wellKnownScaleSet:"https://www.opengis.net/def/wkss/OGC/1.0/GoogleMapsCompatible",tileMatrix:[{type:"TileMatrixType",identifier:"0",scaleDenominator:559082264028717e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1,matrixHeight:1},{type:"TileMatrixType",identifier:"1",scaleDenominator:279541132014358e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2,matrixHeight:2},{type:"TileMatrixType",identifier:"2",scaleDenominator:139770566007179e-6,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4,matrixHeight:4},{type:"TileMatrixType",identifier:"3",scaleDenominator:698852830035897e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8,matrixHeight:8},{type:"TileMatrixType",identifier:"4",scaleDenominator:349426415017948e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16,matrixHeight:16},{type:"TileMatrixType",identifier:"5",scaleDenominator:174713207508974e-7,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32,matrixHeight:32},{type:"TileMatrixType",identifier:"6",scaleDenominator:873566037544871e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:64,matrixHeight:64},{type:"TileMatrixType",identifier:"7",scaleDenominator:436783018772435e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:128,matrixHeight:128},{type:"TileMatrixType",identifier:"8",scaleDenominator:218391509386217e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:256,matrixHeight:256},{type:"TileMatrixType",identifier:"9",scaleDenominator:109195754693108e-8,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:512,matrixHeight:512},{type:"TileMatrixType",identifier:"10",scaleDenominator:545978.773465544,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1024,matrixHeight:1024},{type:"TileMatrixType",identifier:"11",scaleDenominator:272989.386732772,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2048,matrixHeight:2048},{type:"TileMatrixType",identifier:"12",scaleDenominator:136494.693366386,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4096,matrixHeight:4096},{type:"TileMatrixType",identifier:"13",scaleDenominator:68247.346683193,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8192,matrixHeight:8192},{type:"TileMatrixType",identifier:"14",scaleDenominator:34123.6733415964,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16384,matrixHeight:16384},{type:"TileMatrixType",identifier:"15",scaleDenominator:17061.8366707982,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:32768,matrixHeight:32768},{type:"TileMatrixType",identifier:"16",scaleDenominator:8530.91833539913,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:65536,matrixHeight:65536},{type:"TileMatrixType",identifier:"17",scaleDenominator:4265.45916769956,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:131072,matrixHeight:131072},{type:"TileMatrixType",identifier:"18",scaleDenominator:2132.72958384978,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:262144,matrixHeight:262144},{type:"TileMatrixType",identifier:"19",scaleDenominator:1066.36479192489,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:524288,matrixHeight:524288},{type:"TileMatrixType",identifier:"20",scaleDenominator:533.182395962445,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:1048576,matrixHeight:1048576},{type:"TileMatrixType",identifier:"21",scaleDenominator:266.591197981222,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:2097152,matrixHeight:2097152},{type:"TileMatrixType",identifier:"22",scaleDenominator:133.295598990611,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:4194304,matrixHeight:4194304},{type:"TileMatrixType",identifier:"23",scaleDenominator:66.6477994953056,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:8388608,matrixHeight:8388608},{type:"TileMatrixType",identifier:"24",scaleDenominator:33.3238997476528,topLeftCorner:[-200375083427892e-7,200375083427892e-7],tileWidth:256,tileHeight:256,matrixWidth:16777216,matrixHeight:16777216}]},lt=new _t(_y);var Jl=de(d2(),1),Zl=new _t(Jl.Nztm2000),an=new _t(Jl.Nztm2000Quad);var ln={All:[lt,Zl,an],Defaults:new Map([[_e.Google.code,lt],[_e.Nztm2000.code,Zl]]),get(t){let e=this.tryGet(t);if(e==null)throw new Error("Failed to lookup TileMatrixSet: "+t);return e},tryGet(t){var e,r;return t==null?null:typeof t=="number"?(e=this.Defaults.get(t))!==null&&e!==void 0?e:null:(r=this.Defaults.get(t.code))!==null&&r!==void 0?r:null},find(t){if(t==null)return null;let e=_e.parse(t);if(e!=null)return ln.tryGet(e);for(let r of ln.All)if(r.identifier===t)return r;return null}};var Ue;(function(t){t.Png="png",t.Jpeg="jpeg",t.Webp="webp",t.Avif="avif"})(Ue||(Ue={}));var tr;(function(t){t.MapboxVectorTiles="pbf"})(tr||(tr={}));var b2=de(Xn(),1);function My(t){if(!t.endsWith("m")||!t.includes("-"))return null;let e=Number(t.replace("-",".").slice(0,t.length-1));return isNaN(e)?null:String(e)+"m"}function Ey(t){let e=t.split("-");return e.length!==2||e[0].length!==4?null:e[1].length===4?t:e[1].length===2?`${e[0]}-${e[0].slice(0,2)}${e[1]}`:null}var Ry=[My,Ey];function bo(t){let e=new Set(t.split("_"));e.delete("RGB"),e.delete("RGBI"),e.delete("RGBA");let r=[];for(let i of e){let n=!1;for(let o of Ry){let a=o(i);if(a!=null){n=!0,r.push(a);break}}n||r.push(i)}return r.join("-")}var y2=de(g2(),1);var Ay="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Ty=(0,y2.default)(Ay);var qt={parse(t){let e={name:t},r=t.indexOf(":");return r!==-1&&(e.layer=e.name.substring(r+1),e.name=e.name.substring(0,r)),e},componentsToName(t){return qt.toName(t.name,t.layer)},toName(t,e){let r=[t];return e&&r.push(`:${e}`),r.join("")}};function Qa(t){if(t==="")return 0;let e=parseInt(t,16);if(isNaN(e))throw new Error("Invalid hex byte: "+t);return e}function Xl(t){if(t.startsWith("0x")?t=t.slice(2):t.startsWith("#")&&(t=t.slice(1)),t.length!==6&&t.length!==8)throw new Error("Invalid hex color: "+t);return{r:Qa(t.substr(0,2)),g:Qa(t.substr(2,2)),b:Qa(t.substr(4,2)),alpha:Qa(t.substr(6,2))}}var hn=de(require("fs"),1),tu=de(require("path"),1);var xt;(function(t){t[t.UInt8=1]="UInt8",t[t.UInt16=2]="UInt16",t[t.UInt32=4]="UInt32",t[t.UInt64=8]="UInt64",t[t.Double=8]="Double",t[t.Float=4]="Float"})(xt||(xt={}));var v2=2**32,Iy=typeof setImmediate>"u"?setTimeout:setImmediate,Tt=()=>{throw new Error("Method not implemented.")},St=class{constructor(){this.isLittleEndian=!0,this.delayMs=St.DefaultDelayMs,this.maxChunkCount=10,this.chunks=St.DefaultChunkCache(),this.blankFillCount=16,this.maxConcurrentRequests=50,this.toFetch=new Set,this.toFetchPromise=null,this.byteOffset=0,this.getFloat32=Tt,this.getFloat64=Tt,this.getInt8=Tt,this.getInt16=Tt,this.getInt32=Tt,this.setFloat32=Tt,this.setFloat64=Tt,this.setInt8=Tt,this.setInt16=Tt,this.setInt32=Tt,this.setUint8=Tt,this.setUint16=Tt,this.setUint32=Tt,this.setBigInt64=Tt,this.setBigUint64=Tt}static getByteRanges(e,r=32,i=16){if(e.size===0)return{chunks:[],blankFill:[]};let n=[...e.values()].sort((d,m)=>d-m),o=[],a=[];o.push(a);let h=[];for(let d=0;d<n.length;++d){let m=n[d],p=n[d-1];if(a.length>=r)a=[m],o.push(a);else if(d===0||m===p+1)a.push(m);else if(m<p+i){for(let M=p;M<m;M++)a.push(M+1),h.push(M+1);h.pop()}else a=[m],o.push(a)}return{chunks:o,blankFill:h}}async fetchData(){if(this.toFetch.size===0)return;let e=this.toFetch;this.toFetch=new Set,this.toFetchPromise=null;let r=St.getByteRanges(e,this.maxChunkCount,this.blankFillCount),i=[];for(let n of r.chunks){let o=n[0],a=n[n.length-1],h=o*this.chunkSize,d=a*this.chunkSize+this.chunkSize-h,m=await this.fetchBytes(h,d);if(n.length===1){i[o]=m,this.chunks.set(o,new DataView(m));continue}let p=o*this.chunkSize;for(let M of n){let R=M*this.chunkSize-p,x=m.slice(R,R+this.chunkSize);i[M]=x,this.chunks.set(M,new DataView(x))}}}async loadBytes(e,r){if(e<0)throw new Error("Offset must be positive");let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let o=i;o<=n;o++)this.chunks.has(o)||this.toFetch.add(o);if(this.toFetch.size!==0){if(this.toFetchPromise==null&&(this.toFetchPromise=new Promise(o=>Iy(o,this.delayMs)).then(()=>this.fetchData())),this.toFetch.size>this.maxConcurrentRequests)throw new Error("Too many outstanding requests");await this.toFetchPromise}}getChunkId(e){return Math.floor(e/this.chunkSize)}getUint(e,r){switch(r){case xt.UInt8:return this.getUint8(e);case xt.UInt16:return this.getUint16(e);case xt.UInt32:return this.getUint32(e);case xt.UInt64:return this.getUint64(e)}}bytes(e,r){let i=this.isOneChunk(e,r);if(i){let m=this.getView(i),p=e-i*this.chunkSize;return new Uint8Array(m.buffer.slice(p,p+r))}let n=new Uint8Array(r),o=e+r,a=Math.floor(e/this.chunkSize),h=Math.ceil((e+r)/this.chunkSize)-1,d=0;for(let m=a;m<=h;m++){let p=e+d,M=m*this.chunkSize,R=this.getView(m),x=Math.min(o,M+this.chunkSize),v=R.buffer.slice(p-M,x-M);n.set(new Uint8Array(v),d),d+=v.byteLength}return n}getView(e){let r=this.chunks.get(e);if(r==null)throw new Error(`Chunk:${e} is not ready`);return r}isOneChunk(e,r){let i=e+r-1,n=Math.floor(e/this.chunkSize);return Math.floor(i/this.chunkSize)-n<1?n:null}hasBytes(e,r=1){let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let o=i;o<=n;o++)if(!this.chunks.has(o))return!1;return!0}toRange(e,r){if(r==null)return`bytes=${e}`;if(e<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${e}-${e+r}`}parseContentRange(e){let[r,i]=e.split(" ");if(r!=="bytes")throw new Error("Failed to parse content-range: "+e);if(i==null)throw new Error("Failed to parse content-range: "+e);let[,n]=i.split("/"),o=Number(n);if(isNaN(o))throw new Error("Failed to parse content-range: "+e);return o}get buffer(){throw new Error("Method not implemented.")}get byteLength(){if(this._byteLength)return this._byteLength;throw Error(".size() has not been fetched.")}getUint8(e){let r=Math.floor(e/this.chunkSize),i=this.chunks.get(r);if(i==null)throw new Error(`Chunk:${r} is not ready`);return i.getUint8(e-r*this.chunkSize)}getUint16(e){let r=this.isOneChunk(e,xt.UInt16);if(r!=null)return this.getView(r).getUint16(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint8(e),n=this.getUint8(e+xt.UInt8);return this.isLittleEndian?i+(n<<8):(i<<8)+n}getUint32(e){let r=this.isOneChunk(e,xt.UInt32);if(r!=null)return this.getView(r).getUint32(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint16(e),n=this.getUint16(e+xt.UInt16);return this.isLittleEndian?i+n*65536:i*65536+n}getUint64(e){let r=this.isOneChunk(e,xt.UInt64);if(r!=null){let o=this.getView(r);return Number(o.getBigUint64(e-r*this.chunkSize,this.isLittleEndian))}let i=this.getUint32(e),n=this.getUint32(e+xt.UInt32);return this.isLittleEndian?i+n*v2:i*v2+n}getBigUint64(e){let r=this.isOneChunk(e,xt.UInt64);if(r!=null)return this.getView(r).getBigUint64(e-r*this.chunkSize,this.isLittleEndian);let i=BigInt(this.getUint32(e)),n=BigInt(this.getUint32(e+xt.UInt32));return this.isLittleEndian?i+(n<<BigInt(32)):(i<<BigInt(32))+n}getBigInt64(){throw new Error("Not implemented.")}};St.DefaultChunkCache=()=>new Map;St.DefaultDelayMs=1;var Ye=class extends Error{constructor(e,r,i){super(e),this.name="CompositeError",this.code=r,this.reason=i}static isCompositeError(e){return typeof e!="object"||e==null?!1:e.name==="CompositeError"}};function Ri(t){return typeof t=="object"&&t!==null}function ei(t){let e=t.split("/"),r=e[0];if(r==null||r==="")return null;r.endsWith(":")&&(r=r.slice(0,r.length-1));let i=e[2];if(i==null||i.trim()==="")return null;if(e.length===3)return{protocol:r,bucket:i};let n=e.slice(3).join("/");return n==null||n.trim()===""?{protocol:r,bucket:i}:{key:n,bucket:i,protocol:r}}var ky=/\/$/,Ly=/^\//;function Xc(t,e){return t.replace(ky,"")+"/"+e.replace(Ly,"")}function w2(t,...e){let r=t;for(let i=0;i<e.length;i++)r=Xc(r,e[i]);return r}async function _2(t){let e=[];for await(let r of t)e.push(r);return e}var Qc=require("fs"),Ql=require("path"),un=class extends St{constructor(e){super(),this.type="file",this.protocol="file",this.chunkSize=un.DefaultChunkSize,this.fd=null,this.closeAfterRead=!1,this.fileName=e}static isSource(e){return e.type==="file"}async close(){let e=await this.fd;e!=null&&(await e.close(),this.fd=null)}get uri(){return(0,Ql.resolve)(this.fileName)}get name(){return(0,Ql.basename)(this.fileName)}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>(await Qc.promises.stat(this.fileName)).size),this._size)}async fetchBytes(e,r){if(e<0&&r!=null)throw new Error("Cannot fetch negative offsets with length");if(e<0&&(r=Math.abs(e),e=await this.size+e),r==null)throw new Error("Length is required for reading from files");this.fd==null&&(this.fd=Qc.promises.open(this.fileName,"r"));let i=await this.fd,{buffer:n}=await i.read(Buffer.allocUnsafe(r),0,r,e);return this.closeAfterRead&&await this.close(),n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}};un.DefaultChunkSize=16*1024;function eu(t,e){return Ri(t)?t.code==="ENOENT"?new Ye(e,404,t):t.code==="EACCES"?new Ye(e,403,t):new Ye(e,500,t):new Ye(e,500,t)}var Ci=class{constructor(){this.protocol=Ci.protocol}static is(e){return e.protocol===Ci.protocol}source(e){return new un(e)}async*list(e,r){try{let i=await hn.default.promises.readdir(e,{withFileTypes:!0}),n=tu.default.resolve(e);for(let o of i){let a=tu.default.join(n,o.name);o.isDirectory()&&r?.recursive!==!1?yield*this.list(a):yield a}}catch(i){throw eu(i,`Failed to list: ${e}`)}}async*details(e,r){for await(let i of this.list(e,r)){let n=await this.head(i);n!=null&&(yield n)}}async head(e){try{let r=await hn.default.promises.stat(e);return{path:e,size:r.size,isDirectory:r.isDirectory()}}catch(r){if(Ri(r)&&r.code==="ENOENT")return null;throw eu(r,`Failed to stat: ${e}`)}}async read(e){try{return await hn.default.promises.readFile(e)}catch(r){throw eu(r,`Failed to read: ${e}`)}}async write(e,r){let i=tu.default.dirname(e);await hn.default.promises.mkdir(i,{recursive:!0});try{if(Buffer.isBuffer(r)||typeof r=="string")await hn.default.promises.writeFile(e,r);else{let n=hn.default.createWriteStream(e);await new Promise((o,a)=>{n.on("finish",o),n.on("error",a),r.pipe(n)})}}catch(n){throw eu(n,`Failed to write: ${e}`)}}stream(e){return hn.default.createReadStream(e)}};Ci.protocol="file";var r5=de(require("http"),1),i5=de(require("https"),1),ns=de(require("zlib"),1),ir=de(require("stream"),1),u1=require("buffer");function Ny(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),i="",n=!1,o=r[0]||"text/plain",a=o;for(let p=1;p<r.length;p++)r[p]==="base64"?n=!0:(a+=`;${r[p]}`,r[p].indexOf("charset=")===0&&(i=r[p].substring(8)));!r[0]&&!i.length&&(a+=";charset=US-ASCII",i="US-ASCII");let h=n?"base64":"ascii",d=unescape(t.substring(e+1)),m=Buffer.from(d,h);return m.type=o,m.typeFull=a,m.charset=i,m}var x2=Ny;var gr=de(require("stream"),1),Ii=require("util"),rr=require("buffer");t1();nu();var Pi=class extends Error{constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var Ft=class extends Pi{constructor(e,r,i){super(e,r),i&&(this.code=this.errno=i.code,this.erroredSysCall=i.syscall)}};var su=Symbol.toStringTag,nf=t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[su]==="URLSearchParams",s1=t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[su]),k2=t=>typeof t=="object"&&(t[su]==="AbortSignal"||t[su]==="EventTarget"),L2=(t,e)=>{let r=new URL(e).hostname,i=new URL(t).hostname;return r===i||r.endsWith(`.${i}`)};var Zy=(0,Ii.promisify)(gr.default.pipeline),$t=Symbol("Body internals"),ri=class{constructor(e,{size:r=0}={}){let i=null;e===null?e=null:nf(e)?e=rr.Buffer.from(e.toString()):s1(e)||rr.Buffer.isBuffer(e)||(Ii.types.isAnyArrayBuffer(e)?e=rr.Buffer.from(e):ArrayBuffer.isView(e)?e=rr.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof gr.default||(e instanceof es?(e=O2(e),i=e.type.split("=")[1]):e=rr.Buffer.from(String(e))));let n=e;rr.Buffer.isBuffer(e)?n=gr.default.Readable.from(e):s1(e)&&(n=gr.default.Readable.from(e.stream())),this[$t]={body:e,stream:n,boundary:i,disturbed:!1,error:null},this.size=r,e instanceof gr.default&&e.on("error",o=>{let a=o instanceof Pi?o:new Ft(`Invalid response body while trying to fetch ${this.url}: ${o.message}`,"system",o);this[$t].error=a})}get body(){return this[$t].stream}get bodyUsed(){return this[$t].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:i}=await lu(this);return e.slice(r,r+i)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let i=new es,n=new URLSearchParams(await this.text());for(let[o,a]of n)i.append(o,a);return i}let{toFormData:r}=await Promise.resolve().then(()=>(q2(),U2));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[$t].body&&this[$t].body.type||"",r=await this.arrayBuffer();return new Ti([r],{type:e})}async json(){let e=await lu(this);return JSON.parse(e.toString())}async text(){return(await lu(this)).toString()}buffer(){return lu(this)}};ri.prototype.buffer=(0,Ii.deprecate)(ri.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(ri.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Ii.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function lu(t){if(t[$t].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[$t].disturbed=!0,t[$t].error)throw t[$t].error;let{body:e}=t;if(e===null)return rr.Buffer.alloc(0);if(!(e instanceof gr.default))return rr.Buffer.alloc(0);let r=[],i=0;try{for await(let n of e){if(t.size>0&&i+n.length>t.size){let o=new Ft(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(o),o}i+=n.length,r.push(n)}}catch(n){throw n instanceof Pi?n:new Ft(`Invalid response body while trying to fetch ${t.url}: ${n.message}`,"system",n)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(n=>typeof n=="string")?rr.Buffer.from(r.join("")):rr.Buffer.concat(r,i)}catch(n){throw new Ft(`Could not create Buffer from response body for ${t.url}: ${n.message}`,"system",n)}else throw new Ft(`Premature close of server response while trying to fetch ${t.url}`)}var xo=(t,e)=>{let r,i,{body:n}=t[$t];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof gr.default&&typeof n.getBoundary!="function"&&(r=new gr.PassThrough({highWaterMark:e}),i=new gr.PassThrough({highWaterMark:e}),n.pipe(r),n.pipe(i),t[$t].stream=r,n=i),n},Yy=(0,Ii.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),uu=(t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":nf(t)?"application/x-www-form-urlencoded;charset=UTF-8":s1(t)?t.type||null:rr.Buffer.isBuffer(t)||Ii.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof es?`multipart/form-data; boundary=${e[$t].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${Yy(t)}`:t instanceof gr.default?null:"text/plain;charset=UTF-8",F2=t=>{let{body:e}=t[$t];return e===null?0:s1(e)?e.size:rr.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},$2=async(t,{body:e})=>{e===null?t.end():await Zy(e,t)};var lf=require("util"),l1=de(require("http"),1),hu=typeof l1.default.validateHeaderName=="function"?l1.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},uf=typeof l1.default.validateHeaderValue=="function"?l1.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},Wt=class extends URLSearchParams{constructor(e){let r=[];if(e instanceof Wt){let i=e.raw();for(let[n,o]of Object.entries(i))r.push(...o.map(a=>[n,a]))}else if(e!=null)if(typeof e=="object"&&!lf.types.isBoxedPrimitive(e)){let i=e[Symbol.iterator];if(i==null)r.push(...Object.entries(e));else{if(typeof i!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(n=>{if(typeof n!="object"||lf.types.isBoxedPrimitive(n))throw new TypeError("Each header pair must be an iterable object");return[...n]}).map(n=>{if(n.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...n]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([i,n])=>(hu(i),uf(i,String(n)),[String(i).toLowerCase(),String(n)])):void 0,super(r),new Proxy(this,{get(i,n,o){switch(n){case"append":case"set":return(a,h)=>(hu(a),uf(a,String(h)),URLSearchParams.prototype[n].call(i,String(a).toLowerCase(),String(h)));case"delete":case"has":case"getAll":return a=>(hu(a),URLSearchParams.prototype[n].call(i,String(a).toLowerCase()));case"keys":return()=>(i.sort(),new Set(URLSearchParams.prototype.keys.call(i)).keys());default:return Reflect.get(i,n,o)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let i=r.join(", ");return/^content-encoding$/i.test(e)&&(i=i.toLowerCase()),i}forEach(e,r=void 0){for(let i of this.keys())Reflect.apply(e,r,[this.get(i),i,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,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let i=this.getAll(r);return r==="host"?e[r]=i[0]:e[r]=i.length>1?i:i[0],e},{})}};Object.defineProperties(Wt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));function W2(t=[]){return new Wt(t.reduce((e,r,i,n)=>(i%2===0&&e.push(n.slice(i,i+2)),e),[]).filter(([e,r])=>{try{return hu(e),uf(e,String(r)),!0}catch{return!1}}))}var Xy=new Set([301,302,303,307,308]),cu=t=>Xy.has(t);var Nr=Symbol("Response internals"),Mt=class extends ri{constructor(e=null,r={}){super(e,r);let i=r.status!=null?r.status:200,n=new Wt(r.headers);if(e!==null&&!n.has("Content-Type")){let o=uu(e,this);o&&n.append("Content-Type",o)}this[Nr]={type:"default",url:r.url,status:i,statusText:r.statusText||"",headers:n,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Nr].type}get url(){return this[Nr].url||""}get status(){return this[Nr].status}get ok(){return this[Nr].status>=200&&this[Nr].status<300}get redirected(){return this[Nr].counter>0}get statusText(){return this[Nr].statusText}get headers(){return this[Nr].headers}get highWaterMark(){return this[Nr].highWaterMark}clone(){return new Mt(xo(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,r=302){if(!cu(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new Mt(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new Mt(null,{status:0,statusText:""});return e[Nr].type="error",e}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Mt.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}});var Q2=require("url"),e5=require("util");var H2=t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""};var V2=require("net");function G2(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}var K2=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),J2="strict-origin-when-cross-origin";function Z2(t){if(!K2.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function Qy(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,V2.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:/^(.+\.)*localhost$/.test(t.host)?!1:t.protocol==="file:"}function So(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:Qy(t)}function Y2(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let i=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let n=t.referrer,o=G2(n),a=G2(n,!0);o.toString().length>4096&&(o=a),e&&(o=e(o)),r&&(a=r(a));let h=new URL(t.url);switch(i){case"no-referrer":return"no-referrer";case"origin":return a;case"unsafe-url":return o;case"strict-origin":return So(o)&&!So(h)?"no-referrer":a.toString();case"strict-origin-when-cross-origin":return o.origin===h.origin?o:So(o)&&!So(h)?"no-referrer":a;case"same-origin":return o.origin===h.origin?o:"no-referrer";case"origin-when-cross-origin":return o.origin===h.origin?o:a;case"no-referrer-when-downgrade":return So(o)&&!So(h)?"no-referrer":o;default:throw new TypeError(`Invalid referrerPolicy: ${i}`)}}function X2(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let i of e)i&&K2.has(i)&&(r=i);return r}var ft=Symbol("Request internals"),fu=t=>typeof t=="object"&&typeof t[ft]=="object",e8=(0,e5.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Oi=class extends ri{constructor(e,r={}){let i;if(fu(e)?i=new URL(e.url):(i=new URL(e),e={}),i.username!==""||i.password!=="")throw new TypeError(`${i} is an url with embedded credentails.`);let n=r.method||e.method||"GET";if(n=n.toUpperCase(),"data"in r&&e8(),(r.body!=null||fu(e)&&e.body!==null)&&(n==="GET"||n==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let o=r.body?r.body:fu(e)&&e.body!==null?xo(e):null;super(o,{size:r.size||e.size||0});let a=new Wt(r.headers||e.headers||{});if(o!==null&&!a.has("Content-Type")){let m=uu(o,this);m&&a.set("Content-Type",m)}let h=fu(e)?e.signal:null;if("signal"in r&&(h=r.signal),h!=null&&!k2(h))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let d=r.referrer==null?e.referrer:r.referrer;if(d==="")d="no-referrer";else if(d){let m=new URL(d);d=/^about:(\/\/)?client$/.test(m)?"client":m}else d=void 0;this[ft]={method:n,redirect:r.redirect||e.redirect||"follow",headers:a,parsedURL:i,signal:h,referrer:d},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[ft].method}get url(){return(0,Q2.format)(this[ft].parsedURL)}get headers(){return this[ft].headers}get redirect(){return this[ft].redirect}get signal(){return this[ft].signal}get referrer(){if(this[ft].referrer==="no-referrer")return"";if(this[ft].referrer==="client")return"about:client";if(this[ft].referrer)return this[ft].referrer.toString()}get referrerPolicy(){return this[ft].referrerPolicy}set referrerPolicy(e){this[ft].referrerPolicy=Z2(e)}clone(){return new Oi(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Oi.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}});var t5=t=>{let{parsedURL:e}=t[ft],r=new Wt(t[ft].headers);r.has("Accept")||r.set("Accept","*/*");let i=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(i="0"),t.body!==null){let h=F2(t);typeof h=="number"&&!Number.isNaN(h)&&(i=String(h))}i&&r.set("Content-Length",i),t.referrerPolicy===""&&(t.referrerPolicy=J2),t.referrer&&t.referrer!=="no-referrer"?t[ft].referrer=Y2(t):t[ft].referrer="no-referrer",t[ft].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate,br");let{agent:n}=t;typeof n=="function"&&(n=n(e)),!r.has("Connection")&&!n&&r.set("Connection","close");let o=H2(e),a={path:e.pathname+o,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:n};return{parsedURL:e,options:a}};var du=class extends Pi{constructor(e,r="aborted"){super(e,r)}};nu();of();var t8=new Set(["data:","http:","https:"]);async function mu(t,e){return new Promise((r,i)=>{let n=new Oi(t,e),{parsedURL:o,options:a}=t5(n);if(!t8.has(o.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${o.protocol.replace(/:$/,"")}" is not supported.`);if(o.protocol==="data:"){let v=x2(n.url),E=new Mt(v,{headers:{"Content-Type":v.typeFull}});r(E);return}let h=(o.protocol==="https:"?i5.default:r5.default).request,{signal:d}=n,m=null,p=()=>{let v=new du("The operation was aborted.");i(v),n.body&&n.body instanceof ir.default.Readable&&n.body.destroy(v),!(!m||!m.body)&&m.body.emit("error",v)};if(d&&d.aborted){p();return}let M=()=>{p(),x()},R=h(o.toString(),a);d&&d.addEventListener("abort",M);let x=()=>{R.abort(),d&&d.removeEventListener("abort",M)};R.on("error",v=>{i(new Ft(`request to ${n.url} failed, reason: ${v.message}`,"system",v)),x()}),r8(R,v=>{m.body.destroy(v)}),process.version<"v14"&&R.on("socket",v=>{let E;v.prependListener("end",()=>{E=v._eventsCount}),v.prependListener("close",T=>{if(m&&E<v._eventsCount&&!T){let C=new Error("Premature close");C.code="ERR_STREAM_PREMATURE_CLOSE",m.body.emit("error",C)}})}),R.on("response",v=>{R.setTimeout(0);let E=W2(v.rawHeaders);if(cu(v.statusCode)){let B=E.get("Location"),z=null;try{z=B===null?null:new URL(B,n.url)}catch{if(n.redirect!=="manual"){i(new Ft(`uri requested responds with an invalid redirect URL: ${B}`,"invalid-redirect")),x();return}}switch(n.redirect){case"error":i(new Ft(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,"no-redirect")),x();return;case"manual":break;case"follow":{if(z===null)break;if(n.counter>=n.follow){i(new Ft(`maximum redirect reached at: ${n.url}`,"max-redirect")),x();return}let H={headers:new Wt(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:xo(n),signal:n.signal,size:n.size,referrer:n.referrer,referrerPolicy:n.referrerPolicy};if(!L2(n.url,z))for(let ne of["authorization","www-authenticate","cookie","cookie2"])H.headers.delete(ne);if(v.statusCode!==303&&n.body&&e.body instanceof ir.default.Readable){i(new Ft("Cannot follow redirect with body being a readable stream","unsupported-redirect")),x();return}(v.statusCode===303||(v.statusCode===301||v.statusCode===302)&&n.method==="POST")&&(H.method="GET",H.body=void 0,H.headers.delete("content-length"));let J=X2(E);J&&(H.referrerPolicy=J),r(mu(new Oi(z,H))),x();return}default:return i(new TypeError(`Redirect option '${n.redirect}' is not a valid value of RequestRedirect`))}}d&&v.once("end",()=>{d.removeEventListener("abort",M)});let T=(0,ir.pipeline)(v,new ir.PassThrough,B=>{B&&i(B)});process.version<"v12.10"&&v.on("aborted",M);let C={url:n.url,status:v.statusCode,statusText:v.statusMessage,headers:E,size:n.size,counter:n.counter,highWaterMark:n.highWaterMark},P=E.get("Content-Encoding");if(!n.compress||n.method==="HEAD"||P===null||v.statusCode===204||v.statusCode===304){m=new Mt(T,C),r(m);return}let k={flush:ns.default.Z_SYNC_FLUSH,finishFlush:ns.default.Z_SYNC_FLUSH};if(P==="gzip"||P==="x-gzip"){T=(0,ir.pipeline)(T,ns.default.createGunzip(k),B=>{B&&i(B)}),m=new Mt(T,C),r(m);return}if(P==="deflate"||P==="x-deflate"){let B=(0,ir.pipeline)(v,new ir.PassThrough,z=>{z&&i(z)});B.once("data",z=>{(z[0]&15)===8?T=(0,ir.pipeline)(T,ns.default.createInflate(),H=>{H&&i(H)}):T=(0,ir.pipeline)(T,ns.default.createInflateRaw(),H=>{H&&i(H)}),m=new Mt(T,C),r(m)}),B.once("end",()=>{m||(m=new Mt(T,C),r(m))});return}if(P==="br"){T=(0,ir.pipeline)(T,ns.default.createBrotliDecompress(),B=>{B&&i(B)}),m=new Mt(T,C),r(m);return}m=new Mt(T,C),r(m)}),$2(R,n).catch(i)})}function r8(t,e){let r=u1.Buffer.from(`0\r
132
132
  \r
133
- `),i=!1,n=!1,s;t.on("response",a=>{let{headers:c}=a;i=c["transfer-encoding"]==="chunked"&&!c["content-length"]}),t.on("socket",a=>{let c=()=>{if(i&&!n){let d=new Error("Premature close");d.code="ERR_STREAM_PREMATURE_CLOSE",e(d)}};a.prependListener("close",c),t.on("abort",()=>{a.removeListener("close",c)}),a.on("data",d=>{n=Qa.Buffer.compare(d.slice(-5),r)===0,!n&&s&&(n=Qa.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&Qa.Buffer.compare(d.slice(-2),r.slice(3))===0),s=d})})}var Pt=class extends xt{constructor(e){super(),this.type="url",this.protocol="http",this.chunkSize=Pt.DefaultChunkSize,this.uri=e}static isSource(e){return e.type==="url"}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>{let e=await Pt.fetch(this.uri,{method:"HEAD"});return Number(e.headers.get("content-length"))}),this._size)}async fetchBytes(e,r){let n={Range:this.toRange(e,r)},s=await Pt.fetch(this.uri,{headers:n});if(s.ok){let a=s.headers.get("content-range");return this._size==null&&a!=null&&(this._size=Promise.resolve(this.parseContentRange(a))),s.arrayBuffer()}throw new Error("Failed to fetch")}};Pt.DefaultChunkSize=32*1024;Pt.fetch=(t,e)=>fetch(t,e);function Y2(t,e){return Ai(t)?t.code==="ENOENT"?new Je(e,404,t):t.code==="EACCES"?new Je(e,403,t):new Je(e,500,t):new Je(e,500,t)}var Ni=class{constructor(){this.protocol=Ni.protocol}static is(e){return e.protocol===Ni.protocol}source(e){return new Pt(e)}async*list(e){throw new Error(`Unable to "list" on ${e}`)}async*details(e){throw new Error(`Unable to "details" on ${e}`)}async head(e){let r=await Pt.fetch(e,{method:"HEAD"});if(!r.ok)throw Y2(new Error(r.statusText),`Failed to head: ${e}`);return{path:e,size:Number(r.headers.get("content-length")),isDirectory:!1}}async read(e){let r=await Pt.fetch(e,{method:"GET"});if(!r.ok)throw Y2(new Error(r.statusText),`Failed to head: ${e}`);return Buffer.from(await r.arrayBuffer())}async write(e){throw new Error(`Unable to "write" on ${e}`)}stream(e){throw new Error(`Unable to "stream" on ${e}`)}};Ni.protocol="http";Pt.fetch=ou;function wy(t){return typeof t!="object"||t==null?!1:t.constructor===Object}var au=class{constructor(){this.protocol="abstract",this.isOrdered=!0,this.systems=[],this.toArray=p2,this.join=Gh,this.joinAll=d2}register(e,r,i="rw"){for(let n=0;n<this.systems.length;n++){let s=this.systems[n];if(s.path===e&&s.flag===i){this.systems.splice(n,1,{path:e,system:r,flag:i});return}}this.systems.push({path:e,system:r,flag:i}),this.isOrdered=!1}read(e){return this.get(e,"r").read(e)}async readJson(e){let r=await this.read(e);return JSON.parse(r.toString())}stream(e){return this.get(e,"r").stream(e)}write(e,r,i){if(Array.isArray(r)||wy(r)){let n=JSON.stringify(r,null,2);return this.get(e,"rw").write(e,n,{contentType:"application/json",...i})}return this.get(e,"rw").write(e,r,i)}list(e,r){return this.get(e,"r").list(e,r)}details(e,r){return this.get(e,"r").details(e,r)}exists(e){return this.get(e,"r").head(e).then(r=>r!=null)}head(e){return this.get(e,"r").head(e)}source(e){return this.get(e,"r").source(e)}sortSystems(){this.isOrdered||(this.systems.sort((e,r)=>r.path.length-e.path.length),this.isOrdered=!0)}get(e,r){this.sortSystems();for(let i of this.systems)if(e.startsWith(i.path)){if(r==="rw"&&i.flag==="r")continue;return i.system}throw new Error(`Unable to find file system for path:${e}`)}},Ye=new au;var X2=new Pi;Ye.register("",X2);Ye.register("file://",X2);var Q2=new Ni;Ye.register("http://",Q2);Ye.register("https://",Q2);var w8=fe(Zn(),1);var Ve;(function(t){function e(i){throw new Error}t.assertNever=e,t.arrayToEnum=i=>{let n={};for(let s of i)n[s]=s;return n},t.getValidEnumValues=i=>{let n=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of n)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(n){return i[n]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&n.push(s);return n},t.find=(i,n)=>{for(let s of i)if(n(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,n=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(n)}t.joinValues=r})(Ve||(Ve={}));var Q=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),un=t=>{switch(typeof t){case"undefined":return Q.undefined;case"string":return Q.string;case"number":return isNaN(t)?Q.nan:Q.number;case"boolean":return Q.boolean;case"function":return Q.function;case"bigint":return Q.bigint;case"object":return Array.isArray(t)?Q.array:t===null?Q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Q.promise:typeof Map<"u"&&t instanceof Map?Q.map:typeof Set<"u"&&t instanceof Set?Q.set:typeof Date<"u"&&t instanceof Date?Q.date:Q.object;default:return Q.unknown}},X=Ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of"]),_y=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Dr=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},i={_errors:[]},n=s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let c=i,d=0;for(;d<a.path.length;){let p=a.path[d];d===a.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(r(a))):c[p]=c[p]||{_errors:[]},c=c[p],d++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,null,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Dr.create=t=>new Dr(t);var e1=(t,e)=>{let r;switch(t.code){case X.invalid_type:t.received===Q.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case X.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected)}`;break;case X.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ve.joinValues(t.keys,", ")}`;break;case X.invalid_union:r="Invalid input";break;case X.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ve.joinValues(t.options)}`;break;case X.invalid_enum_value:r=`Invalid enum value. Expected ${Ve.joinValues(t.options)}, received '${t.received}'`;break;case X.invalid_arguments:r="Invalid function arguments";break;case X.invalid_return_type:r="Invalid function return type";break;case X.invalid_date:r="Invalid date";break;case X.invalid_string:t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case X.too_small:t.type==="array"?r=`Array must contain ${t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be greater than ${t.inclusive?"or equal to ":""}${t.minimum}`:r="Invalid input";break;case X.too_big:t.type==="array"?r=`Array must contain ${t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be less than ${t.inclusive?"or equal to ":""}${t.maximum}`:r="Invalid input";break;case X.custom:r="Invalid input";break;case X.invalid_intersection_types:r="Intersection results could not be merged";break;case X.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;default:r=e.defaultError,Ve.assertNever(t)}return{message:r}},t1=e1,Sy=t=>{t1=t},lu=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],a={...n,path:s},c="",d=i.filter(p=>!!p).slice().reverse();for(let p of d)c=p(a,{data:e,defaultError:c}).message;return{...n,path:s,message:n.message||c}},xy=[];function oe(t,e){let r=lu({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,t1,e1].filter(i=>!!i)});t.common.issues.push(r)}var Et=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return de;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return Et.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:a}=n;if(s.status==="aborted"||a.status==="aborted")return de;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),(typeof a.value<"u"||n.alwaysSet)&&(i[s.value]=a.value)}return{status:e.value,value:i}}},de=Object.freeze({status:"aborted"}),My=t=>({status:"dirty",value:t}),Tt=t=>({status:"valid",value:t}),nf=t=>t.status==="aborted",sf=t=>t.status==="dirty",uu=t=>t.status==="valid",of=t=>typeof Promise!==void 0&&t instanceof Promise,$e;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})($e||($e={}));var br=class{constructor(e,r,i,n){this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._path.concat(this._key)}},e5=(t,e)=>{if(uu(e))return{success:!0,data:e.value};{if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new Dr(t.common.issues);return{success:!1,error:r}}};function Ee(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,c)=>a.code!=="invalid_type"?{message:c.defaultError}:typeof c.data>"u"&&i?{message:i}:t.invalid_type_error?{message:t.invalid_type_error}:{message:c.defaultError},description:n}}var xe=class{constructor(e){this.spa=this.safeParseAsync,this.superRefine=this._refinement,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return un(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:un(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Et,ctx:{common:e.parent.common,data:e.data,parsedType:un(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(of(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:un(e)},s=this._parseSync({data:e,path:n.path,parent:n});return e5(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:un(e)},n=this._parse({data:e,path:[],parent:i}),s=await(of(n)?n:Promise.resolve(n));return e5(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let a=e(n),c=()=>s.addIssue({code:X.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(d=>d?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new _r({schema:this,typeName:he.ZodEffects,effect:{type:"refinement",refinement:e}})}optional(){return yr.create(this)}nullable(){return ji.create(this)}nullish(){return this.optional().nullable()}array(){return vr.create(this)}promise(){return hn.create(this)}or(e){return rs.create([this,e])}and(e){return is.create(this,e)}transform(e){return new _r({schema:this,typeName:he.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new r1({innerType:this,defaultValue:r,typeName:he.ZodDefault})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ey=/^c[^\s-]{8,}$/i,Ry=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,Cy=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,li=class extends xe{constructor(){super(...arguments),this._regex=(e,r,i)=>this.refinement(n=>e.test(n),{validation:r,code:X.invalid_string,...$e.errToObj(i)}),this.nonempty=e=>this.min(1,$e.errToObj(e)),this.trim=()=>new li({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._getType(e)!==Q.string){let s=this._getOrReturnCtx(e);return oe(s,{code:X.invalid_type,expected:Q.string,received:s.parsedType}),de}let i=new Et,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),oe(n,{code:X.too_small,minimum:s.value,type:"string",inclusive:!0,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),oe(n,{code:X.too_big,maximum:s.value,type:"string",inclusive:!0,message:s.message}),i.dirty());else if(s.kind==="email")Cy.test(e.data)||(n=this._getOrReturnCtx(e,n),oe(n,{validation:"email",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Ry.test(e.data)||(n=this._getOrReturnCtx(e,n),oe(n,{validation:"uuid",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Ey.test(e.data)||(n=this._getOrReturnCtx(e,n),oe(n,{validation:"cuid",code:X.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),oe(n,{validation:"url",code:X.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),oe(n,{validation:"regex",code:X.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():Ve.assertNever(s);return{status:i.value,value:e.data}}_addCheck(e){return new li({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$e.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$e.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$e.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$e.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...$e.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...$e.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...$e.errToObj(r)})}length(e,r){return this.min(e,r).max(e,r)}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=-1/0;return this._def.checks.map(r=>{r.kind==="min"&&(e===null||r.value>e)&&(e=r.value)}),e}get maxLength(){let e=null;return this._def.checks.map(r=>{r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}),e}};li.create=t=>new li({checks:[],typeName:he.ZodString,...Ee(t)});function Ay(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return s%a/Math.pow(10,n)}var Di=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._getType(e)!==Q.number){let s=this._getOrReturnCtx(e);return oe(s,{code:X.invalid_type,expected:Q.number,received:s.parsedType}),de}let i,n=new Et;for(let s of this._def.checks)s.kind==="int"?Ve.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),oe(i,{code:X.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),oe(i,{code:X.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),oe(i,{code:X.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?Ay(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),oe(i,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):Ve.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,$e.toString(r))}gt(e,r){return this.setLimit("min",e,!1,$e.toString(r))}lte(e,r){return this.setLimit("max",e,!0,$e.toString(r))}lt(e,r){return this.setLimit("max",e,!1,$e.toString(r))}setLimit(e,r,i,n){return new Di({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:$e.toString(n)}]})}_addCheck(e){return new Di({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$e.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$e.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:$e.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};Di.create=t=>new Di({checks:[],typeName:he.ZodNumber,...Ee(t)});var fo=class extends xe{_parse(e){if(this._getType(e)!==Q.bigint){let i=this._getOrReturnCtx(e);return oe(i,{code:X.invalid_type,expected:Q.bigint,received:i.parsedType}),de}return Tt(e.data)}};fo.create=t=>new fo({typeName:he.ZodBigInt,...Ee(t)});var po=class extends xe{_parse(e){if(this._getType(e)!==Q.boolean){let i=this._getOrReturnCtx(e);return oe(i,{code:X.invalid_type,expected:Q.boolean,received:i.parsedType}),de}return Tt(e.data)}};po.create=t=>new po({typeName:he.ZodBoolean,...Ee(t)});var mo=class extends xe{_parse(e){if(this._getType(e)!==Q.date){let i=this._getOrReturnCtx(e);return oe(i,{code:X.invalid_type,expected:Q.date,received:i.parsedType}),de}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return oe(i,{code:X.invalid_date}),de}return{status:"valid",value:new Date(e.data.getTime())}}};mo.create=t=>new mo({typeName:he.ZodDate,...Ee(t)});var go=class extends xe{_parse(e){if(this._getType(e)!==Q.undefined){let i=this._getOrReturnCtx(e);return oe(i,{code:X.invalid_type,expected:Q.undefined,received:i.parsedType}),de}return Tt(e.data)}};go.create=t=>new go({typeName:he.ZodUndefined,...Ee(t)});var yo=class extends xe{_parse(e){if(this._getType(e)!==Q.null){let i=this._getOrReturnCtx(e);return oe(i,{code:X.invalid_type,expected:Q.null,received:i.parsedType}),de}return Tt(e.data)}};yo.create=t=>new yo({typeName:he.ZodNull,...Ee(t)});var cn=class extends xe{constructor(){super(...arguments),this._any=!0}_parse(e){return Tt(e.data)}};cn.create=t=>new cn({typeName:he.ZodAny,...Ee(t)});var ai=class extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Tt(e.data)}};ai.create=t=>new ai({typeName:he.ZodUnknown,...Ee(t)});var ui=class extends xe{_parse(e){let r=this._getOrReturnCtx(e);return oe(r,{code:X.invalid_type,expected:Q.never,received:r.parsedType}),de}};ui.create=t=>new ui({typeName:he.ZodNever,...Ee(t)});var bo=class extends xe{_parse(e){if(this._getType(e)!==Q.undefined){let i=this._getOrReturnCtx(e);return oe(i,{code:X.invalid_type,expected:Q.void,received:i.parsedType}),de}return Tt(e.data)}};bo.create=t=>new bo({typeName:he.ZodVoid,...Ee(t)});var vr=class extends xe{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==Q.array)return oe(r,{code:X.invalid_type,expected:Q.array,received:r.parsedType}),de;if(n.minLength!==null&&r.data.length<n.minLength.value&&(oe(r,{code:X.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(oe(r,{code:X.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all(r.data.map((a,c)=>n.type._parseAsync(new br(r,a,r.path,c)))).then(a=>Et.mergeArray(i,a));let s=r.data.map((a,c)=>n.type._parseSync(new br(r,a,r.path,c)));return Et.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new vr({...this._def,minLength:{value:e,message:$e.toString(r)}})}max(e,r){return new vr({...this._def,maxLength:{value:e,message:$e.toString(r)}})}length(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};vr.create=(t,e)=>new vr({type:t,minLength:null,maxLength:null,typeName:he.ZodArray,...Ee(e)});var cu;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(cu||(cu={}));var t5=t=>e=>new Ge({...t,shape:()=>({...t.shape(),...e})});function ho(t){if(t instanceof Ge){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=yr.create(ho(i))}return new Ge({...t._def,shape:()=>e})}else return t instanceof vr?vr.create(ho(t.element)):t instanceof yr?yr.create(ho(t.unwrap())):t instanceof ji?ji.create(ho(t.unwrap())):t instanceof wr?wr.create(t.items.map(e=>ho(e))):t}var Ge=class extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=t5(this._def),this.extend=t5(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Ve.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Q.object){let p=this._getOrReturnCtx(e);return oe(p,{code:X.invalid_type,expected:Q.object,received:p.parsedType}),de}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),c=[];for(let p in n.data)a.includes(p)||c.push(p);let d=[];for(let p of a){let m=s[p],w=n.data[p];d.push({key:{status:"valid",value:p},value:m._parse(new br(n,w,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof ui){let p=this._def.unknownKeys;if(p==="passthrough")for(let m of c)d.push({key:{status:"valid",value:m},value:{status:"valid",value:n.data[m]}});else if(p==="strict")c.length>0&&(oe(n,{code:X.unrecognized_keys,keys:c}),i.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let m of c){let w=n.data[m];d.push({key:{status:"valid",value:m},value:p._parse(new br(n,w,n.path,m)),alwaysSet:m in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let m of d){let w=await m.key;p.push({key:w,value:await m.value,alwaysSet:m.alwaysSet})}return p}).then(p=>Et.mergeObjectSync(i,p)):Et.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(e){return $e.errToObj,new Ge({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,a,c;let d=(a=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&a!==void 0?a:i.defaultError;return r.code==="unrecognized_keys"?{message:(c=$e.errToObj(e).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new Ge({...this._def,unknownKeys:"strip"})}passthrough(){return new Ge({...this._def,unknownKeys:"passthrough"})}setKey(e,r){return this.augment({[e]:r})}merge(e){return new Ge({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>cu.mergeShapes(this._def.shape(),e._def.shape()),typeName:he.ZodObject})}catchall(e){return new Ge({...this._def,catchall:e})}pick(e){let r={};return Ve.objectKeys(e).map(i=>{this.shape[i]&&(r[i]=this.shape[i])}),new Ge({...this._def,shape:()=>r})}omit(e){let r={};return Ve.objectKeys(this.shape).map(i=>{Ve.objectKeys(e).indexOf(i)===-1&&(r[i]=this.shape[i])}),new Ge({...this._def,shape:()=>r})}deepPartial(){return ho(this)}partial(e){let r={};if(e)return Ve.objectKeys(this.shape).map(i=>{Ve.objectKeys(e).indexOf(i)===-1?r[i]=this.shape[i]:r[i]=this.shape[i].optional()}),new Ge({...this._def,shape:()=>r});for(let i in this.shape){let n=this.shape[i];r[i]=n.optional()}return new Ge({...this._def,shape:()=>r})}required(){let e={};for(let r in this.shape){let n=this.shape[r];for(;n instanceof yr;)n=n._def.innerType;e[r]=n}return new Ge({...this._def,shape:()=>e})}};Ge.create=(t,e)=>new Ge({shape:()=>t,unknownKeys:"strip",catchall:ui.create(),typeName:he.ZodObject,...Ee(e)});Ge.strictCreate=(t,e)=>new Ge({shape:()=>t,unknownKeys:"strict",catchall:ui.create(),typeName:he.ZodObject,...Ee(e)});Ge.lazycreate=(t,e)=>new Ge({shape:t,unknownKeys:"strip",catchall:ui.create(),typeName:he.ZodObject,...Ee(e)});var rs=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let a=s.map(c=>new Dr(c.ctx.common.issues));return oe(r,{code:X.invalid_union,unionErrors:a}),de}if(r.common.async)return Promise.all(i.map(async s=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let s,a=[];for(let d of i){let p={...r,common:{...r.common,issues:[]},parent:null},m=d._parseSync({data:r.data,path:r.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:p}),p.common.issues.length&&a.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let c=a.map(d=>new Dr(d));return oe(r,{code:X.invalid_union,unionErrors:c}),de}}get options(){return this._def.options}};rs.create=(t,e)=>new rs({options:t,typeName:he.ZodUnion,...Ee(e)});var vo=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Q.object)return oe(r,{code:X.invalid_type,expected:Q.object,received:r.parsedType}),de;let i=this.discriminator,n=r.data[i],s=this.options.get(n);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(oe(r,{code:X.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[i]}),de)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(e,r,i){let n=new Map;try{r.forEach(s=>{let a=s.shape[e].value;n.set(a,s)})}catch{throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(n.size!==r.length)throw new Error("Some of the discriminator values are not unique");return new vo({typeName:he.ZodDiscriminatedUnion,discriminator:e,options:n,...Ee(i)})}};function af(t,e){let r=un(t),i=un(e);if(t===e)return{valid:!0,data:t};if(r===Q.object&&i===Q.object){let n=Ve.objectKeys(e),s=Ve.objectKeys(t).filter(c=>n.indexOf(c)!==-1),a={...t,...e};for(let c of s){let d=af(t[c],e[c]);if(!d.valid)return{valid:!1};a[c]=d.data}return{valid:!0,data:a}}else if(r===Q.array&&i===Q.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let a=t[s],c=e[s],d=af(a,c);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return r===Q.date&&i===Q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var is=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,a)=>{if(nf(s)||nf(a))return de;let c=af(s.value,a.value);return c.valid?((sf(s)||sf(a))&&r.dirty(),{status:r.value,value:c.data}):(oe(i,{code:X.invalid_intersection_types}),de)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>n(s,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};is.create=(t,e,r)=>new is({left:t,right:e,typeName:he.ZodIntersection,...Ee(r)});var wr=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==Q.array)return oe(i,{code:X.invalid_type,expected:Q.array,received:i.parsedType}),de;if(i.data.length<this._def.items.length)return oe(i,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),de;!this._def.rest&&i.data.length>this._def.items.length&&(oe(i,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),r.dirty());let s=i.data.map((a,c)=>{let d=this._def.items[c]||this._def.rest;return d?d._parse(new br(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>Et.mergeArray(r,a)):Et.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new wr({...this._def,rest:e})}};wr.create=(t,e)=>new wr({items:t,typeName:he.ZodTuple,rest:null,...Ee(e)});var ns=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==Q.object)return oe(i,{code:X.invalid_type,expected:Q.object,received:i.parsedType}),de;let n=[],s=this._def.keyType,a=this._def.valueType;for(let c in i.data)n.push({key:s._parse(new br(i,c,i.path,c)),value:a._parse(new br(i,i.data[c],i.path,c))});return i.common.async?Et.mergeObjectAsync(r,n):Et.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof xe?new ns({keyType:e,valueType:r,typeName:he.ZodRecord,...Ee(i)}):new ns({keyType:li.create(),valueType:e,typeName:he.ZodRecord,...Ee(r)})}},wo=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==Q.map)return oe(i,{code:X.invalid_type,expected:Q.map,received:i.parsedType}),de;let n=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([c,d],p)=>({key:n._parse(new br(i,c,i.path,[p,"key"])),value:s._parse(new br(i,d,i.path,[p,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let d of a){let p=await d.key,m=await d.value;if(p.status==="aborted"||m.status==="aborted")return de;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(p.value,m.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let d of a){let p=d.key,m=d.value;if(p.status==="aborted"||m.status==="aborted")return de;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),c.set(p.value,m.value)}return{status:r.value,value:c}}}};wo.create=(t,e,r)=>new wo({valueType:e,keyType:t,typeName:he.ZodMap,...Ee(r)});var Bi=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==Q.set)return oe(i,{code:X.invalid_type,expected:Q.set,received:i.parsedType}),de;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(oe(i,{code:X.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(oe(i,{code:X.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,message:n.maxSize.message}),r.dirty());let s=this._def.valueType;function a(d){let p=new Set;for(let m of d){if(m.status==="aborted")return de;m.status==="dirty"&&r.dirty(),p.add(m.value)}return{status:r.value,value:p}}let c=[...i.data.values()].map((d,p)=>s._parse(new br(i,d,i.path,p)));return i.common.async?Promise.all(c).then(d=>a(d)):a(c)}min(e,r){return new Bi({...this._def,minSize:{value:e,message:$e.toString(r)}})}max(e,r){return new Bi({...this._def,maxSize:{value:e,message:$e.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Bi.create=(t,e)=>new Bi({valueType:t,minSize:null,maxSize:null,typeName:he.ZodSet,...Ee(e)});var zi=class extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Q.function)return oe(r,{code:X.invalid_type,expected:Q.function,received:r.parsedType}),de;function i(c,d){return lu({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t1,e1].filter(p=>!!p),issueData:{code:X.invalid_arguments,argumentsError:d}})}function n(c,d){return lu({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t1,e1].filter(p=>!!p),issueData:{code:X.invalid_return_type,returnTypeError:d}})}let s={errorMap:r.common.contextualErrorMap},a=r.data;return this._def.returns instanceof hn?Tt(async(...c)=>{let d=new Dr([]),p=await this._def.args.parseAsync(c,s).catch(S=>{throw d.addIssue(i(c,S)),d}),m=await a(...p);return await this._def.returns._def.type.parseAsync(m,s).catch(S=>{throw d.addIssue(n(m,S)),d})}):Tt((...c)=>{let d=this._def.args.safeParse(c,s);if(!d.success)throw new Dr([i(c,d.error)]);let p=a(...d.data),m=this._def.returns.safeParse(p,s);if(!m.success)throw new Dr([n(p,m.error)]);return m.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new zi({...this._def,args:wr.create(e).rest(ai.create())})}returns(e){return new zi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}};zi.create=(t,e,r)=>new zi({args:t?t.rest(ai.create()):wr.create([]).rest(ai.create()),returns:e||ai.create(),typeName:he.ZodFunction,...Ee(r)});var _o=class extends xe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};_o.create=(t,e)=>new _o({getter:t,typeName:he.ZodLazy,...Ee(e)});var So=class extends xe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return oe(r,{code:X.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:e.data}}get value(){return this._def.value}};So.create=(t,e)=>new So({value:t,typeName:he.ZodLiteral,...Ee(e)});function Py(t,e){return new xo({values:t,typeName:he.ZodEnum,...Ee(e)})}var xo=class extends xe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return oe(r,{expected:Ve.joinValues(i),received:r.parsedType,code:X.invalid_type}),de}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return oe(r,{received:r.data,code:X.invalid_enum_value,options:i}),de}return Tt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}};xo.create=Py;var Mo=class extends xe{_parse(e){let r=Ve.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==Q.string&&i.parsedType!==Q.number){let n=Ve.objectValues(r);return oe(i,{expected:Ve.joinValues(n),received:i.parsedType,code:X.invalid_type}),de}if(r.indexOf(e.data)===-1){let n=Ve.objectValues(r);return oe(i,{received:i.data,code:X.invalid_enum_value,options:n}),de}return Tt(e.data)}get enum(){return this._def.values}};Mo.create=(t,e)=>new Mo({values:t,typeName:he.ZodNativeEnum,...Ee(e)});var hn=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Q.promise&&r.common.async===!1)return oe(r,{code:X.invalid_type,expected:Q.promise,received:r.parsedType}),de;let i=r.parsedType===Q.promise?r.data:Promise.resolve(r.data);return Tt(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};hn.create=(t,e)=>new hn({type:t,typeName:he.ZodPromise,...Ee(e)});var _r=class extends xe{innerType(){return this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null;if(n.type==="preprocess"){let a=n.transform(i.data);return i.common.async?Promise.resolve(a).then(c=>this._def.schema._parseAsync({data:c,path:i.path,parent:i})):this._def.schema._parseSync({data:a,path:i.path,parent:i})}let s={addIssue:a=>{oe(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="refinement"){let a=c=>{let d=n.refinement(c,s);if(i.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?de:(c.status==="dirty"&&r.dirty(),a(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?de:(c.status==="dirty"&&r.dirty(),a(c.value).then(()=>({status:r.value,value:c.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!uu(a))return a;let c=n.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>uu(a)?Promise.resolve(n.transform(a.value,s)).then(c=>({status:r.value,value:c})):a);Ve.assertNever(n)}};_r.create=(t,e,r)=>new _r({schema:t,typeName:he.ZodEffects,effect:e,...Ee(r)});_r.createWithPreprocess=(t,e,r)=>new _r({schema:e,effect:{type:"preprocess",transform:t},typeName:he.ZodEffects,...Ee(r)});var yr=class extends xe{_parse(e){return this._getType(e)===Q.undefined?Tt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};yr.create=(t,e)=>new yr({innerType:t,typeName:he.ZodOptional,...Ee(e)});var ji=class extends xe{_parse(e){return this._getType(e)===Q.null?Tt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ji.create=(t,e)=>new ji({innerType:t,typeName:he.ZodNullable,...Ee(e)});var r1=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===Q.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};r1.create=(t,e)=>new yr({innerType:t,typeName:he.ZodOptional,...Ee(e)});var Eo=class extends xe{_parse(e){if(this._getType(e)!==Q.nan){let i=this._getOrReturnCtx(e);return oe(i,{code:X.invalid_type,expected:Q.nan,received:i.parsedType}),de}return{status:"valid",value:e.data}}};Eo.create=t=>new Eo({typeName:he.ZodNaN,...Ee(t)});var i5=(t,e={},r)=>t?cn.create().superRefine((i,n)=>{if(!t(i)){let s=typeof e=="function"?e(i):e,a=typeof s=="string"?{message:s}:s;n.addIssue({code:"custom",...a,fatal:r})}}):cn.create(),Ty={object:Ge.lazycreate},he;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodPromise="ZodPromise"})(he||(he={}));var Iy=(t,e={message:`Input not instance of ${t.name}`})=>i5(r=>r instanceof t,e,!0),n5=li.create,s5=Di.create,ky=Eo.create,Oy=fo.create,o5=po.create,Ly=mo.create,Ny=go.create,Dy=yo.create,By=cn.create,zy=ai.create,jy=ui.create,qy=bo.create,Uy=vr.create,$y=Ge.create,Wy=Ge.strictCreate,Fy=rs.create,Hy=vo.create,Gy=is.create,Vy=wr.create,Ky=ns.create,Zy=wo.create,Jy=Bi.create,Yy=zi.create,Xy=_o.create,Qy=So.create,e8=xo.create,t8=Mo.create,r8=hn.create,r5=_r.create,i8=yr.create,n8=ji.create,s8=_r.createWithPreprocess,o8=()=>n5().optional(),a8=()=>s5().optional(),l8=()=>o5().optional(),ie=Object.freeze({__proto__:null,getParsedType:un,ZodParsedType:Q,makeIssue:lu,EMPTY_PATH:xy,addIssueToContext:oe,ParseStatus:Et,INVALID:de,DIRTY:My,OK:Tt,isAborted:nf,isDirty:sf,isValid:uu,isAsync:of,ZodType:xe,ZodString:li,ZodNumber:Di,ZodBigInt:fo,ZodBoolean:po,ZodDate:mo,ZodUndefined:go,ZodNull:yo,ZodAny:cn,ZodUnknown:ai,ZodNever:ui,ZodVoid:bo,ZodArray:vr,get objectUtil(){return cu},ZodObject:Ge,ZodUnion:rs,ZodDiscriminatedUnion:vo,ZodIntersection:is,ZodTuple:wr,ZodRecord:ns,ZodMap:wo,ZodSet:Bi,ZodFunction:zi,ZodLazy:_o,ZodLiteral:So,ZodEnum:xo,ZodNativeEnum:Mo,ZodPromise:hn,ZodEffects:_r,ZodTransformer:_r,ZodOptional:yr,ZodNullable:ji,ZodDefault:r1,ZodNaN:Eo,custom:i5,Schema:xe,ZodSchema:xe,late:Ty,get ZodFirstPartyTypeKind(){return he},any:By,array:Uy,bigint:Oy,boolean:o5,date:Ly,discriminatedUnion:Hy,effect:r5,enum:e8,function:Yy,instanceof:Iy,intersection:Gy,lazy:Xy,literal:Qy,map:Zy,nan:ky,nativeEnum:t8,never:jy,null:Dy,nullable:n8,number:s5,object:$y,oboolean:l8,onumber:a8,optional:i8,ostring:o8,preprocess:s8,promise:r8,record:Ky,set:Jy,strictObject:Wy,string:n5,transformer:r5,tuple:Vy,undefined:Ny,union:Fy,unknown:zy,void:qy,ZodIssueCode:X,quotelessJson:_y,ZodError:Dr,defaultErrorMap:e1,get overrideErrorMap(){return t1},setErrorMap:Sy});var u8=ie.object({title:ie.string(),description:ie.string(),fees:ie.string(),accessConstraints:ie.string()}),c8=ie.object({deliveryPoint:ie.string(),city:ie.string(),postalCode:ie.string(),country:ie.string(),email:ie.string()}),h8=ie.object({individualName:ie.string(),position:ie.string(),phone:ie.string(),address:c8}),f8=ie.object({name:ie.string(),site:ie.string(),contact:h8}),d8=ie.object({id:ie.string(),serviceIdentification:u8,serviceProvider:f8});var p8=ie.object({id:ie.string(),version:ie.number(),name:ie.string(),metadata:ie.unknown().optional(),sprite:ie.string().optional(),glyphs:ie.string().optional(),sources:ie.unknown(),layers:ie.array(ie.unknown())});function m8(t){try{return Fl(t),!0}catch{return!1}}var g8=ie.string().refine(m8,{message:"Invalid hex color"}),Ro={minZoom:0,maxZoom:32},hu=ie.number().refine(t=>t>=Ro.minZoom&&t<=Ro.maxZoom,{message:`must be between ${Ro.minZoom} and ${Ro.maxZoom}`}),y8=ie.object({name:ie.string(),title:ie.string().optional(),category:ie.string().optional(),2193:ie.string().optional(),3857:ie.string().optional(),minZoom:hu.optional(),maxZoom:hu.optional()}).refine(({minZoom:t,maxZoom:e})=>(t||Ro.minZoom)<=(e||Ro.maxZoom),{message:"minZoom may no be greater than maxZoom",path:["minZoom"]}),b8=ie.object({type:ie.nativeEnum(st),id:ie.string(),title:ie.string().optional(),category:ie.string().optional(),description:ie.string().optional(),background:g8.optional(),layers:ie.array(y8),minZoom:hu.optional(),maxZoom:hu.optional(),format:ie.union([ie.nativeEnum(qe),ie.nativeEnum(rr)]).optional()});var Co={Aws:{Region:"ap-southeast-2"},ApiKey:{QueryString:"api",TableName:"ApiKey",RequestLimitMinute:1e3},TileMetadata:{TableName:"TileMetadata",RequestLimitMinute:1e3}},Xe={PublicUrlBase:"BASEMAPS_PUBLIC_URL",AssetLocation:"BASEMAPS_ASSEST_LOCATION",TiffConcurrency:"TIFF_CONCURRENCY",TempFolder:"TEMP_FOLDER",BatchIndex:"AWS_BATCH_JOB_ARRAY_INDEX",AwsRoleDurationHours:"AWS_ROLE_DURATION_HOURS",AwsRoleConfigPath:"ROLE_CONFIG_PATH",ImportImageryBucket:"IMPORT_IMAGERY_BUCKET",ImportFilesNumberLimit:"FILES_NUMBER_LIMIT",ImportFilesSizeLimitGb:"FILES_SIZE_LIMIT_GB",Gdal:{UseDocker:"GDAL_DOCKER",DockerContainer:"GDAL_DOCKER_CONTAINER",DockerContainerTag:"GDAL_DOCKER_CONTAINER_TAG"},Analytics:{CloudFrontId:"ANALYTICS_CLOUD_FRONT_ID",CloudFrontSourceBucket:"ANALYTICS_CLOUD_FRONT_SOURCE_BUCKET",CacheBucket:"ANALYTICS_CACHE_BUCKET"},get(t){return process.env[t]},getNumber(t,e){let r=Xe.get(t);if(r===""||r==null)return e;let i=parseFloat(r);return isNaN(i)?e:i},isProduction(){return!0}};var B0=fe(n0(),1);var zr=fe(pp(),1);function Cv(t){return t<=10?zr.default.gray("TRACE"):t<=20?zr.default.magenta("DEBUG"):t<=30?zr.default.cyan("INFO"):t<=40?zr.default.yellow("WARN"):t<=50?zr.default.red("ERROR"):zr.default.bgRed("FATAL")}var qi=class{constructor(e){this.level=e}static formatObject(e){let r=[];for(let i of Object.keys(e)){if(qi.Ignore.has(i))continue;let n=e[i];if(n==null||n==="")continue;let s="",a=typeof n;if(a==="number")s=zr.default.yellow(String(n));else if(a==="string")s=zr.default.green(n);else if(a==="object"){let c=this.formatObject(n);c.length>0&&(s=`{ ${c.join(" ")} }`)}else s=String(n);s!==""&&r.push(`${zr.default.dim(i)}=${s}`)}return r}pretty(e){if(e.level<this.level)return null;let r=new Date(e.time);if(isNaN(r.getTime()))return null;let n=qi.formatObject(e).join(" ");return`[${r.toISOString()}] ${Cv(e.level)} ${zr.default.blue(e.msg)} ${n}`}};qi.Ignore=new Set(["pid","time","hostname","level","v","name","msg"]);var Sm=fe(_m(),1),Do=require("stream"),xm=require("string_decoder");function L_(t){try{return JSON.parse(t)}catch{return null}}function N_(t){t!=null&&console.error("PrettyTransformFailed",t)}var vn=class extends Do.Transform{constructor(){super(),this.pretty=new qi(-1),this.decoder=new xm.StringDecoder}static stream(e=process.stdout){let r=new Do.PassThrough;return vn.pretty(r,e),r}static pretty(e,r=process.stdout){let i=new vn;return(0,Do.pipeline)(e,(0,Sm.default)(),i,r,N_),i}_transform(e,r,i){if(r!=="buffer")return i(new Error(`Unknown encoding: ${r}`));let n=this.decoder.write(e),s=L_(n);if(s==null)return i(null,e+`
134
- `);let a=this.pretty.pretty(s);if(a==null)return i(null,e+`
133
+ `),i=!1,n=!1,o;t.on("response",a=>{let{headers:h}=a;i=h["transfer-encoding"]==="chunked"&&!h["content-length"]}),t.on("socket",a=>{let h=()=>{if(i&&!n){let d=new Error("Premature close");d.code="ERR_STREAM_PREMATURE_CLOSE",e(d)}};a.prependListener("close",h),t.on("abort",()=>{a.removeListener("close",h)}),a.on("data",d=>{n=u1.Buffer.compare(d.slice(-5),r)===0,!n&&o&&(n=u1.Buffer.compare(o.slice(-3),r.slice(0,3))===0&&u1.Buffer.compare(d.slice(-2),r.slice(3))===0),o=d})})}var Pt=class extends St{constructor(e){super(),this.type="url",this.protocol="http",this.chunkSize=Pt.DefaultChunkSize,this.uri=e}static isSource(e){return e.type==="url"}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>{let e=await Pt.fetch(this.uri,{method:"HEAD"});return Number(e.headers.get("content-length"))}),this._size)}async fetchBytes(e,r){let n={Range:this.toRange(e,r)},o=await Pt.fetch(this.uri,{headers:n});if(o.ok){let a=o.headers.get("content-range");return this._size==null&&a!=null&&(this._size=Promise.resolve(this.parseContentRange(a))),o.arrayBuffer()}throw new Error("Failed to fetch")}};Pt.DefaultChunkSize=32*1024;Pt.fetch=(t,e)=>fetch(t,e);function n5(t,e){return Ri(t)?t.code==="ENOENT"?new Ye(e,404,t):t.code==="EACCES"?new Ye(e,403,t):new Ye(e,500,t):new Ye(e,500,t)}var ki=class{constructor(){this.protocol=ki.protocol}static is(e){return e.protocol===ki.protocol}source(e){return new Pt(e)}async*list(e){throw new Error(`Unable to "list" on ${e}`)}async*details(e){throw new Error(`Unable to "details" on ${e}`)}async head(e){let r=await Pt.fetch(e,{method:"HEAD"});if(!r.ok)throw n5(new Error(r.statusText),`Failed to head: ${e}`);return{path:e,size:Number(r.headers.get("content-length")),isDirectory:!1}}async read(e){let r=await Pt.fetch(e,{method:"GET"});if(!r.ok)throw n5(new Error(r.statusText),`Failed to head: ${e}`);return Buffer.from(await r.arrayBuffer())}async write(e){throw new Error(`Unable to "write" on ${e}`)}stream(e){throw new Error(`Unable to "stream" on ${e}`)}};ki.protocol="http";Pt.fetch=mu;function i8(t){return typeof t!="object"||t==null?!1:t.constructor===Object}var pu=class{constructor(){this.protocol="abstract",this.isOrdered=!0,this.systems=[],this.toArray=_2,this.join=Xc,this.joinAll=w2}register(e,r,i="rw"){for(let n=0;n<this.systems.length;n++){let o=this.systems[n];if(o.path===e&&o.flag===i){this.systems.splice(n,1,{path:e,system:r,flag:i});return}}this.systems.push({path:e,system:r,flag:i}),this.isOrdered=!1}read(e){return this.get(e,"r").read(e)}async readJson(e){let r=await this.read(e);return JSON.parse(r.toString())}stream(e){return this.get(e,"r").stream(e)}write(e,r,i){if(Array.isArray(r)||i8(r)){let n=JSON.stringify(r,null,2);return this.get(e,"rw").write(e,n,{contentType:"application/json",...i})}return this.get(e,"rw").write(e,r,i)}list(e,r){return this.get(e,"r").list(e,r)}details(e,r){return this.get(e,"r").details(e,r)}exists(e){return this.get(e,"r").head(e).then(r=>r!=null)}head(e){return this.get(e,"r").head(e)}source(e){return this.get(e,"r").source(e)}sortSystems(){this.isOrdered||(this.systems.sort((e,r)=>r.path.length-e.path.length),this.isOrdered=!0)}get(e,r){this.sortSystems();for(let i of this.systems)if(e.startsWith(i.path)){if(r==="rw"&&i.flag==="r")continue;return i.system}throw new Error(`Unable to find file system for path:${e}`)}},Xe=new pu;var s5=new Ci;Xe.register("",s5);Xe.register("file://",s5);var o5=new ki;Xe.register("http://",o5);Xe.register("https://",o5);var i3=de(Xn(),1);var Ke;(function(t){function e(i){throw new Error}t.assertNever=e,t.arrayToEnum=i=>{let n={};for(let o of i)n[o]=o;return n},t.getValidEnumValues=i=>{let n=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of n)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(n){return i[n]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&n.push(o);return n},t.find=(i,n)=>{for(let o of i)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,n=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=r})(Ke||(Ke={}));var ee=Ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fn=t=>{switch(typeof t){case"undefined":return ee.undefined;case"string":return ee.string;case"number":return isNaN(t)?ee.nan:ee.number;case"boolean":return ee.boolean;case"function":return ee.function;case"bigint":return ee.bigint;case"object":return Array.isArray(t)?ee.array:t===null?ee.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ee.promise:typeof Map<"u"&&t instanceof Map?ee.map:typeof Set<"u"&&t instanceof Set?ee.set:typeof Date<"u"&&t instanceof Date?ee.date:ee.object;default:return ee.unknown}},X=Ke.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of"]),n8=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Br=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(o){return o.message},i={_errors:[]},n=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let h=i,d=0;for(;d<a.path.length;){let m=a.path[d];d===a.path.length-1?(h[m]=h[m]||{_errors:[]},h[m]._errors.push(r(a))):h[m]=h[m]||{_errors:[]},h=h[m],d++}}};return n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,null,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Br.create=t=>new Br(t);var h1=(t,e)=>{let r;switch(t.code){case X.invalid_type:t.received===ee.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case X.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected)}`;break;case X.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ke.joinValues(t.keys,", ")}`;break;case X.invalid_union:r="Invalid input";break;case X.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ke.joinValues(t.options)}`;break;case X.invalid_enum_value:r=`Invalid enum value. Expected ${Ke.joinValues(t.options)}, received '${t.received}'`;break;case X.invalid_arguments:r="Invalid function arguments";break;case X.invalid_return_type:r="Invalid function return type";break;case X.invalid_date:r="Invalid date";break;case X.invalid_string:t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case X.too_small:t.type==="array"?r=`Array must contain ${t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be greater than ${t.inclusive?"or equal to ":""}${t.minimum}`:r="Invalid input";break;case X.too_big:t.type==="array"?r=`Array must contain ${t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be less than ${t.inclusive?"or equal to ":""}${t.maximum}`:r="Invalid input";break;case X.custom:r="Invalid input";break;case X.invalid_intersection_types:r="Intersection results could not be merged";break;case X.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;default:r=e.defaultError,Ke.assertNever(t)}return{message:r}},c1=h1,s8=t=>{c1=t},gu=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,o=[...r,...n.path||[]],a={...n,path:o},h="",d=i.filter(m=>!!m).slice().reverse();for(let m of d)h=m(a,{data:e,defaultError:h}).message;return{...n,path:o,message:n.message||h}},o8=[];function ae(t,e){let r=gu({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c1,h1].filter(i=>!!i)});t.common.issues.push(r)}var Et=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return me;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return Et.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return me;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),(typeof a.value<"u"||n.alwaysSet)&&(i[o.value]=a.value)}return{status:e.value,value:i}}},me=Object.freeze({status:"aborted"}),a8=t=>({status:"dirty",value:t}),It=t=>({status:"valid",value:t}),hf=t=>t.status==="aborted",cf=t=>t.status==="dirty",yu=t=>t.status==="valid",ff=t=>typeof Promise!==void 0&&t instanceof Promise,Fe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Fe||(Fe={}));var br=class{constructor(e,r,i,n){this.parent=e,this.data=r,this._path=i,this._key=n}get path(){return this._path.concat(this._key)}},a5=(t,e)=>{if(yu(e))return{success:!0,data:e.value};{if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new Br(t.common.issues);return{success:!1,error:r}}};function Ee(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid" or "required" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,h)=>a.code!=="invalid_type"?{message:h.defaultError}:typeof h.data>"u"&&i?{message:i}:t.invalid_type_error?{message:t.invalid_type_error}:{message:h.defaultError},description:n}}var xe=class{constructor(e){this.spa=this.safeParseAsync,this.superRefine=this._refinement,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.default=this.default.bind(this),this.describe=this.describe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return fn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:fn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Et,ctx:{common:e.parent.common,data:e.data,parsedType:fn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(ff(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r?.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fn(e)},o=this._parseSync({data:e,path:n.path,parent:n});return a5(n,o)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:fn(e)},n=this._parse({data:e,path:[],parent:i}),o=await(ff(n)?n:Promise.resolve(n));return a5(i,o)}refine(e,r){let i=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,o)=>{let a=e(n),h=()=>o.addIssue({code:X.custom,...i(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(d=>d?!0:(h(),!1)):a?!0:(h(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new _r({schema:this,typeName:fe.ZodEffects,effect:{type:"refinement",refinement:e}})}optional(){return yr.create(this)}nullable(){return Di.create(this)}nullish(){return this.optional().nullable()}array(){return vr.create(this)}promise(){return mn.create(this)}or(e){return ss.create([this,e])}and(e){return os.create(this,e)}transform(e){return new _r({schema:this,typeName:fe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new f1({innerType:this,defaultValue:r,typeName:fe.ZodDefault})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},l8=/^c[^\s-]{8,}$/i,u8=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,h8=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,ni=class extends xe{constructor(){super(...arguments),this._regex=(e,r,i)=>this.refinement(n=>e.test(n),{validation:r,code:X.invalid_string,...Fe.errToObj(i)}),this.nonempty=e=>this.min(1,Fe.errToObj(e)),this.trim=()=>new ni({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._getType(e)!==ee.string){let o=this._getOrReturnCtx(e);return ae(o,{code:X.invalid_type,expected:ee.string,received:o.parsedType}),me}let i=new Et,n;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),ae(n,{code:X.too_small,minimum:o.value,type:"string",inclusive:!0,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),ae(n,{code:X.too_big,maximum:o.value,type:"string",inclusive:!0,message:o.message}),i.dirty());else if(o.kind==="email")h8.test(e.data)||(n=this._getOrReturnCtx(e,n),ae(n,{validation:"email",code:X.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")u8.test(e.data)||(n=this._getOrReturnCtx(e,n),ae(n,{validation:"uuid",code:X.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")l8.test(e.data)||(n=this._getOrReturnCtx(e,n),ae(n,{validation:"cuid",code:X.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),ae(n,{validation:"url",code:X.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),ae(n,{validation:"regex",code:X.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():Ke.assertNever(o);return{status:i.value,value:e.data}}_addCheck(e){return new ni({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Fe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Fe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Fe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Fe.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Fe.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Fe.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Fe.errToObj(r)})}length(e,r){return this.min(e,r).max(e,r)}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get minLength(){let e=-1/0;return this._def.checks.map(r=>{r.kind==="min"&&(e===null||r.value>e)&&(e=r.value)}),e}get maxLength(){let e=null;return this._def.checks.map(r=>{r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}),e}};ni.create=t=>new ni({checks:[],typeName:fe.ZodString,...Ee(t)});function c8(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,o=parseInt(t.toFixed(n).replace(".","")),a=parseInt(e.toFixed(n).replace(".",""));return o%a/Math.pow(10,n)}var Li=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._getType(e)!==ee.number){let o=this._getOrReturnCtx(e);return ae(o,{code:X.invalid_type,expected:ee.number,received:o.parsedType}),me}let i,n=new Et;for(let o of this._def.checks)o.kind==="int"?Ke.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ae(i,{code:X.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),ae(i,{code:X.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),ae(i,{code:X.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?c8(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),ae(i,{code:X.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):Ke.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Fe.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Fe.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Fe.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Fe.toString(r))}setLimit(e,r,i,n){return new Li({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:Fe.toString(n)}]})}_addCheck(e){return new Li({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Fe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Fe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Fe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Fe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Fe.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Fe.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int")}};Li.create=t=>new Li({checks:[],typeName:fe.ZodNumber,...Ee(t)});var Eo=class extends xe{_parse(e){if(this._getType(e)!==ee.bigint){let i=this._getOrReturnCtx(e);return ae(i,{code:X.invalid_type,expected:ee.bigint,received:i.parsedType}),me}return It(e.data)}};Eo.create=t=>new Eo({typeName:fe.ZodBigInt,...Ee(t)});var Ro=class extends xe{_parse(e){if(this._getType(e)!==ee.boolean){let i=this._getOrReturnCtx(e);return ae(i,{code:X.invalid_type,expected:ee.boolean,received:i.parsedType}),me}return It(e.data)}};Ro.create=t=>new Ro({typeName:fe.ZodBoolean,...Ee(t)});var Co=class extends xe{_parse(e){if(this._getType(e)!==ee.date){let i=this._getOrReturnCtx(e);return ae(i,{code:X.invalid_type,expected:ee.date,received:i.parsedType}),me}if(isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return ae(i,{code:X.invalid_date}),me}return{status:"valid",value:new Date(e.data.getTime())}}};Co.create=t=>new Co({typeName:fe.ZodDate,...Ee(t)});var Ao=class extends xe{_parse(e){if(this._getType(e)!==ee.undefined){let i=this._getOrReturnCtx(e);return ae(i,{code:X.invalid_type,expected:ee.undefined,received:i.parsedType}),me}return It(e.data)}};Ao.create=t=>new Ao({typeName:fe.ZodUndefined,...Ee(t)});var To=class extends xe{_parse(e){if(this._getType(e)!==ee.null){let i=this._getOrReturnCtx(e);return ae(i,{code:X.invalid_type,expected:ee.null,received:i.parsedType}),me}return It(e.data)}};To.create=t=>new To({typeName:fe.ZodNull,...Ee(t)});var dn=class extends xe{constructor(){super(...arguments),this._any=!0}_parse(e){return It(e.data)}};dn.create=t=>new dn({typeName:fe.ZodAny,...Ee(t)});var ii=class extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return It(e.data)}};ii.create=t=>new ii({typeName:fe.ZodUnknown,...Ee(t)});var si=class extends xe{_parse(e){let r=this._getOrReturnCtx(e);return ae(r,{code:X.invalid_type,expected:ee.never,received:r.parsedType}),me}};si.create=t=>new si({typeName:fe.ZodNever,...Ee(t)});var Po=class extends xe{_parse(e){if(this._getType(e)!==ee.undefined){let i=this._getOrReturnCtx(e);return ae(i,{code:X.invalid_type,expected:ee.void,received:i.parsedType}),me}return It(e.data)}};Po.create=t=>new Po({typeName:fe.ZodVoid,...Ee(t)});var vr=class extends xe{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==ee.array)return ae(r,{code:X.invalid_type,expected:ee.array,received:r.parsedType}),me;if(n.minLength!==null&&r.data.length<n.minLength.value&&(ae(r,{code:X.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(ae(r,{code:X.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all(r.data.map((a,h)=>n.type._parseAsync(new br(r,a,r.path,h)))).then(a=>Et.mergeArray(i,a));let o=r.data.map((a,h)=>n.type._parseSync(new br(r,a,r.path,h)));return Et.mergeArray(i,o)}get element(){return this._def.type}min(e,r){return new vr({...this._def,minLength:{value:e,message:Fe.toString(r)}})}max(e,r){return new vr({...this._def,maxLength:{value:e,message:Fe.toString(r)}})}length(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};vr.create=(t,e)=>new vr({type:t,minLength:null,maxLength:null,typeName:fe.ZodArray,...Ee(e)});var bu;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(bu||(bu={}));var l5=t=>e=>new Ge({...t,shape:()=>({...t.shape(),...e})});function Mo(t){if(t instanceof Ge){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=yr.create(Mo(i))}return new Ge({...t._def,shape:()=>e})}else return t instanceof vr?vr.create(Mo(t.element)):t instanceof yr?yr.create(Mo(t.unwrap())):t instanceof Di?Di.create(Mo(t.unwrap())):t instanceof wr?wr.create(t.items.map(e=>Mo(e))):t}var Ge=class extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=l5(this._def),this.extend=l5(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Ke.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ee.object){let m=this._getOrReturnCtx(e);return ae(m,{code:X.invalid_type,expected:ee.object,received:m.parsedType}),me}let{status:i,ctx:n}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),h=[];for(let m in n.data)a.includes(m)||h.push(m);let d=[];for(let m of a){let p=o[m],M=n.data[m];d.push({key:{status:"valid",value:m},value:p._parse(new br(n,M,n.path,m)),alwaysSet:m in n.data})}if(this._def.catchall instanceof si){let m=this._def.unknownKeys;if(m==="passthrough")for(let p of h)d.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(m==="strict")h.length>0&&(ae(n,{code:X.unrecognized_keys,keys:h}),i.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let p of h){let M=n.data[p];d.push({key:{status:"valid",value:p},value:m._parse(new br(n,M,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let m=[];for(let p of d){let M=await p.key;m.push({key:M,value:await p.value,alwaysSet:p.alwaysSet})}return m}).then(m=>Et.mergeObjectSync(i,m)):Et.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(e){return Fe.errToObj,new Ge({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,o,a,h;let d=(a=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,r,i).message)!==null&&a!==void 0?a:i.defaultError;return r.code==="unrecognized_keys"?{message:(h=Fe.errToObj(e).message)!==null&&h!==void 0?h:d}:{message:d}}}:{}})}strip(){return new Ge({...this._def,unknownKeys:"strip"})}passthrough(){return new Ge({...this._def,unknownKeys:"passthrough"})}setKey(e,r){return this.augment({[e]:r})}merge(e){return new Ge({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>bu.mergeShapes(this._def.shape(),e._def.shape()),typeName:fe.ZodObject})}catchall(e){return new Ge({...this._def,catchall:e})}pick(e){let r={};return Ke.objectKeys(e).map(i=>{this.shape[i]&&(r[i]=this.shape[i])}),new Ge({...this._def,shape:()=>r})}omit(e){let r={};return Ke.objectKeys(this.shape).map(i=>{Ke.objectKeys(e).indexOf(i)===-1&&(r[i]=this.shape[i])}),new Ge({...this._def,shape:()=>r})}deepPartial(){return Mo(this)}partial(e){let r={};if(e)return Ke.objectKeys(this.shape).map(i=>{Ke.objectKeys(e).indexOf(i)===-1?r[i]=this.shape[i]:r[i]=this.shape[i].optional()}),new Ge({...this._def,shape:()=>r});for(let i in this.shape){let n=this.shape[i];r[i]=n.optional()}return new Ge({...this._def,shape:()=>r})}required(){let e={};for(let r in this.shape){let n=this.shape[r];for(;n instanceof yr;)n=n._def.innerType;e[r]=n}return new Ge({...this._def,shape:()=>e})}};Ge.create=(t,e)=>new Ge({shape:()=>t,unknownKeys:"strip",catchall:si.create(),typeName:fe.ZodObject,...Ee(e)});Ge.strictCreate=(t,e)=>new Ge({shape:()=>t,unknownKeys:"strict",catchall:si.create(),typeName:fe.ZodObject,...Ee(e)});Ge.lazycreate=(t,e)=>new Ge({shape:t,unknownKeys:"strip",catchall:si.create(),typeName:fe.ZodObject,...Ee(e)});var ss=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(o){for(let h of o)if(h.result.status==="valid")return h.result;for(let h of o)if(h.result.status==="dirty")return r.common.issues.push(...h.ctx.common.issues),h.result;let a=o.map(h=>new Br(h.ctx.common.issues));return ae(r,{code:X.invalid_union,unionErrors:a}),me}if(r.common.async)return Promise.all(i.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let o,a=[];for(let d of i){let m={...r,common:{...r.common,issues:[]},parent:null},p=d._parseSync({data:r.data,path:r.path,parent:m});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:m}),m.common.issues.length&&a.push(m.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let h=a.map(d=>new Br(d));return ae(r,{code:X.invalid_union,unionErrors:h}),me}}get options(){return this._def.options}};ss.create=(t,e)=>new ss({options:t,typeName:fe.ZodUnion,...Ee(e)});var Io=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.object)return ae(r,{code:X.invalid_type,expected:ee.object,received:r.parsedType}),me;let i=this.discriminator,n=r.data[i],o=this.options.get(n);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(ae(r,{code:X.invalid_union_discriminator,options:this.validDiscriminatorValues,path:[i]}),me)}get discriminator(){return this._def.discriminator}get validDiscriminatorValues(){return Array.from(this.options.keys())}get options(){return this._def.options}static create(e,r,i){let n=new Map;try{r.forEach(o=>{let a=o.shape[e].value;n.set(a,o)})}catch{throw new Error("The discriminator value could not be extracted from all the provided schemas")}if(n.size!==r.length)throw new Error("Some of the discriminator values are not unique");return new Io({typeName:fe.ZodDiscriminatedUnion,discriminator:e,options:n,...Ee(i)})}};function df(t,e){let r=fn(t),i=fn(e);if(t===e)return{valid:!0,data:t};if(r===ee.object&&i===ee.object){let n=Ke.objectKeys(e),o=Ke.objectKeys(t).filter(h=>n.indexOf(h)!==-1),a={...t,...e};for(let h of o){let d=df(t[h],e[h]);if(!d.valid)return{valid:!1};a[h]=d.data}return{valid:!0,data:a}}else if(r===ee.array&&i===ee.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let o=0;o<t.length;o++){let a=t[o],h=e[o],d=df(a,h);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return r===ee.date&&i===ee.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var os=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(o,a)=>{if(hf(o)||hf(a))return me;let h=df(o.value,a.value);return h.valid?((cf(o)||cf(a))&&r.dirty(),{status:r.value,value:h.data}):(ae(i,{code:X.invalid_intersection_types}),me)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,a])=>n(o,a)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};os.create=(t,e,r)=>new os({left:t,right:e,typeName:fe.ZodIntersection,...Ee(r)});var wr=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==ee.array)return ae(i,{code:X.invalid_type,expected:ee.array,received:i.parsedType}),me;if(i.data.length<this._def.items.length)return ae(i,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,type:"array"}),me;!this._def.rest&&i.data.length>this._def.items.length&&(ae(i,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,type:"array"}),r.dirty());let o=i.data.map((a,h)=>{let d=this._def.items[h]||this._def.rest;return d?d._parse(new br(i,a,i.path,h)):null}).filter(a=>!!a);return i.common.async?Promise.all(o).then(a=>Et.mergeArray(r,a)):Et.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new wr({...this._def,rest:e})}};wr.create=(t,e)=>new wr({items:t,typeName:fe.ZodTuple,rest:null,...Ee(e)});var as=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==ee.object)return ae(i,{code:X.invalid_type,expected:ee.object,received:i.parsedType}),me;let n=[],o=this._def.keyType,a=this._def.valueType;for(let h in i.data)n.push({key:o._parse(new br(i,h,i.path,h)),value:a._parse(new br(i,i.data[h],i.path,h))});return i.common.async?Et.mergeObjectAsync(r,n):Et.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof xe?new as({keyType:e,valueType:r,typeName:fe.ZodRecord,...Ee(i)}):new as({keyType:ni.create(),valueType:e,typeName:fe.ZodRecord,...Ee(r)})}},Oo=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==ee.map)return ae(i,{code:X.invalid_type,expected:ee.map,received:i.parsedType}),me;let n=this._def.keyType,o=this._def.valueType,a=[...i.data.entries()].map(([h,d],m)=>({key:n._parse(new br(i,h,i.path,[m,"key"])),value:o._parse(new br(i,d,i.path,[m,"value"]))}));if(i.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let d of a){let m=await d.key,p=await d.value;if(m.status==="aborted"||p.status==="aborted")return me;(m.status==="dirty"||p.status==="dirty")&&r.dirty(),h.set(m.value,p.value)}return{status:r.value,value:h}})}else{let h=new Map;for(let d of a){let m=d.key,p=d.value;if(m.status==="aborted"||p.status==="aborted")return me;(m.status==="dirty"||p.status==="dirty")&&r.dirty(),h.set(m.value,p.value)}return{status:r.value,value:h}}}};Oo.create=(t,e,r)=>new Oo({valueType:e,keyType:t,typeName:fe.ZodMap,...Ee(r)});var Ni=class extends xe{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==ee.set)return ae(i,{code:X.invalid_type,expected:ee.set,received:i.parsedType}),me;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(ae(i,{code:X.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(ae(i,{code:X.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,message:n.maxSize.message}),r.dirty());let o=this._def.valueType;function a(d){let m=new Set;for(let p of d){if(p.status==="aborted")return me;p.status==="dirty"&&r.dirty(),m.add(p.value)}return{status:r.value,value:m}}let h=[...i.data.values()].map((d,m)=>o._parse(new br(i,d,i.path,m)));return i.common.async?Promise.all(h).then(d=>a(d)):a(h)}min(e,r){return new Ni({...this._def,minSize:{value:e,message:Fe.toString(r)}})}max(e,r){return new Ni({...this._def,maxSize:{value:e,message:Fe.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Ni.create=(t,e)=>new Ni({valueType:t,minSize:null,maxSize:null,typeName:fe.ZodSet,...Ee(e)});var Bi=class extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.function)return ae(r,{code:X.invalid_type,expected:ee.function,received:r.parsedType}),me;function i(h,d){return gu({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,c1,h1].filter(m=>!!m),issueData:{code:X.invalid_arguments,argumentsError:d}})}function n(h,d){return gu({data:h,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,c1,h1].filter(m=>!!m),issueData:{code:X.invalid_return_type,returnTypeError:d}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;return this._def.returns instanceof mn?It(async(...h)=>{let d=new Br([]),m=await this._def.args.parseAsync(h,o).catch(R=>{throw d.addIssue(i(h,R)),d}),p=await a(...m);return await this._def.returns._def.type.parseAsync(p,o).catch(R=>{throw d.addIssue(n(p,R)),d})}):It((...h)=>{let d=this._def.args.safeParse(h,o);if(!d.success)throw new Br([i(h,d.error)]);let m=a(...d.data),p=this._def.returns.safeParse(m,o);if(!p.success)throw new Br([n(m,p.error)]);return p.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Bi({...this._def,args:wr.create(e).rest(ii.create())})}returns(e){return new Bi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}};Bi.create=(t,e,r)=>new Bi({args:t?t.rest(ii.create()):wr.create([]).rest(ii.create()),returns:e||ii.create(),typeName:fe.ZodFunction,...Ee(r)});var ko=class extends xe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ko.create=(t,e)=>new ko({getter:t,typeName:fe.ZodLazy,...Ee(e)});var Lo=class extends xe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ae(r,{code:X.invalid_literal,expected:this._def.value}),me}return{status:"valid",value:e.data}}get value(){return this._def.value}};Lo.create=(t,e)=>new Lo({value:t,typeName:fe.ZodLiteral,...Ee(e)});function f8(t,e){return new No({values:t,typeName:fe.ZodEnum,...Ee(e)})}var No=class extends xe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return ae(r,{expected:Ke.joinValues(i),received:r.parsedType,code:X.invalid_type}),me}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return ae(r,{received:r.data,code:X.invalid_enum_value,options:i}),me}return It(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}};No.create=f8;var Bo=class extends xe{_parse(e){let r=Ke.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==ee.string&&i.parsedType!==ee.number){let n=Ke.objectValues(r);return ae(i,{expected:Ke.joinValues(n),received:i.parsedType,code:X.invalid_type}),me}if(r.indexOf(e.data)===-1){let n=Ke.objectValues(r);return ae(i,{received:i.data,code:X.invalid_enum_value,options:n}),me}return It(e.data)}get enum(){return this._def.values}};Bo.create=(t,e)=>new Bo({values:t,typeName:fe.ZodNativeEnum,...Ee(e)});var mn=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ee.promise&&r.common.async===!1)return ae(r,{code:X.invalid_type,expected:ee.promise,received:r.parsedType}),me;let i=r.parsedType===ee.promise?r.data:Promise.resolve(r.data);return It(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};mn.create=(t,e)=>new mn({type:t,typeName:fe.ZodPromise,...Ee(e)});var _r=class extends xe{innerType(){return this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null;if(n.type==="preprocess"){let a=n.transform(i.data);return i.common.async?Promise.resolve(a).then(h=>this._def.schema._parseAsync({data:h,path:i.path,parent:i})):this._def.schema._parseSync({data:a,path:i.path,parent:i})}let o={addIssue:a=>{ae(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="refinement"){let a=h=>{let d=n.refinement(h,o);if(i.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(i.common.async===!1){let h=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return h.status==="aborted"?me:(h.status==="dirty"&&r.dirty(),a(h.value),{status:r.value,value:h.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(h=>h.status==="aborted"?me:(h.status==="dirty"&&r.dirty(),a(h.value).then(()=>({status:r.value,value:h.value}))))}if(n.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!yu(a))return a;let h=n.transform(a.value,o);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:h}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>yu(a)?Promise.resolve(n.transform(a.value,o)).then(h=>({status:r.value,value:h})):a);Ke.assertNever(n)}};_r.create=(t,e,r)=>new _r({schema:t,typeName:fe.ZodEffects,effect:e,...Ee(r)});_r.createWithPreprocess=(t,e,r)=>new _r({schema:e,effect:{type:"preprocess",transform:t},typeName:fe.ZodEffects,...Ee(r)});var yr=class extends xe{_parse(e){return this._getType(e)===ee.undefined?It(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};yr.create=(t,e)=>new yr({innerType:t,typeName:fe.ZodOptional,...Ee(e)});var Di=class extends xe{_parse(e){return this._getType(e)===ee.null?It(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Di.create=(t,e)=>new Di({innerType:t,typeName:fe.ZodNullable,...Ee(e)});var f1=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===ee.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};f1.create=(t,e)=>new yr({innerType:t,typeName:fe.ZodOptional,...Ee(e)});var Do=class extends xe{_parse(e){if(this._getType(e)!==ee.nan){let i=this._getOrReturnCtx(e);return ae(i,{code:X.invalid_type,expected:ee.nan,received:i.parsedType}),me}return{status:"valid",value:e.data}}};Do.create=t=>new Do({typeName:fe.ZodNaN,...Ee(t)});var h5=(t,e={},r)=>t?dn.create().superRefine((i,n)=>{if(!t(i)){let o=typeof e=="function"?e(i):e,a=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...a,fatal:r})}}):dn.create(),d8={object:Ge.lazycreate},fe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodPromise="ZodPromise"})(fe||(fe={}));var m8=(t,e={message:`Input not instance of ${t.name}`})=>h5(r=>r instanceof t,e,!0),c5=ni.create,f5=Li.create,p8=Do.create,g8=Eo.create,d5=Ro.create,y8=Co.create,b8=Ao.create,v8=To.create,w8=dn.create,_8=ii.create,x8=si.create,S8=Po.create,M8=vr.create,E8=Ge.create,R8=Ge.strictCreate,C8=ss.create,A8=Io.create,T8=os.create,P8=wr.create,I8=as.create,O8=Oo.create,k8=Ni.create,L8=Bi.create,N8=ko.create,B8=Lo.create,D8=No.create,z8=Bo.create,j8=mn.create,u5=_r.create,U8=yr.create,q8=Di.create,F8=_r.createWithPreprocess,$8=()=>c5().optional(),W8=()=>f5().optional(),H8=()=>d5().optional(),se=Object.freeze({__proto__:null,getParsedType:fn,ZodParsedType:ee,makeIssue:gu,EMPTY_PATH:o8,addIssueToContext:ae,ParseStatus:Et,INVALID:me,DIRTY:a8,OK:It,isAborted:hf,isDirty:cf,isValid:yu,isAsync:ff,ZodType:xe,ZodString:ni,ZodNumber:Li,ZodBigInt:Eo,ZodBoolean:Ro,ZodDate:Co,ZodUndefined:Ao,ZodNull:To,ZodAny:dn,ZodUnknown:ii,ZodNever:si,ZodVoid:Po,ZodArray:vr,get objectUtil(){return bu},ZodObject:Ge,ZodUnion:ss,ZodDiscriminatedUnion:Io,ZodIntersection:os,ZodTuple:wr,ZodRecord:as,ZodMap:Oo,ZodSet:Ni,ZodFunction:Bi,ZodLazy:ko,ZodLiteral:Lo,ZodEnum:No,ZodNativeEnum:Bo,ZodPromise:mn,ZodEffects:_r,ZodTransformer:_r,ZodOptional:yr,ZodNullable:Di,ZodDefault:f1,ZodNaN:Do,custom:h5,Schema:xe,ZodSchema:xe,late:d8,get ZodFirstPartyTypeKind(){return fe},any:w8,array:M8,bigint:g8,boolean:d5,date:y8,discriminatedUnion:A8,effect:u5,enum:D8,function:L8,instanceof:m8,intersection:T8,lazy:N8,literal:B8,map:O8,nan:p8,nativeEnum:z8,never:x8,null:v8,nullable:q8,number:f5,object:E8,oboolean:H8,onumber:W8,optional:U8,ostring:$8,preprocess:F8,promise:j8,record:I8,set:k8,strictObject:R8,string:c5,transformer:u5,tuple:P8,undefined:b8,union:C8,unknown:_8,void:S8,ZodIssueCode:X,quotelessJson:n8,ZodError:Br,defaultErrorMap:h1,get overrideErrorMap(){return c1},setErrorMap:s8});var G8=se.object({title:se.string(),description:se.string(),fees:se.string(),accessConstraints:se.string()}),V8=se.object({deliveryPoint:se.string(),city:se.string(),postalCode:se.string(),country:se.string(),email:se.string()}),K8=se.object({individualName:se.string(),position:se.string(),phone:se.string(),address:V8}),J8=se.object({name:se.string(),site:se.string(),contact:K8}),Z8=se.object({id:se.string(),serviceIdentification:G8,serviceProvider:J8});var Y8=se.object({id:se.string(),version:se.number(),name:se.string(),metadata:se.unknown().optional(),sprite:se.string().optional(),glyphs:se.string().optional(),sources:se.unknown(),layers:se.array(se.unknown())});function X8(t){try{return Xl(t),!0}catch{return!1}}var Q8=se.string().refine(X8,{message:"Invalid hex color"}),zo={minZoom:0,maxZoom:32},vu=se.number().refine(t=>t>=zo.minZoom&&t<=zo.maxZoom,{message:`must be between ${zo.minZoom} and ${zo.maxZoom}`}),e3=se.object({name:se.string(),title:se.string().optional(),category:se.string().optional(),2193:se.string().optional(),3857:se.string().optional(),minZoom:vu.optional(),maxZoom:vu.optional()}).refine(({minZoom:t,maxZoom:e})=>(t||zo.minZoom)<=(e||zo.maxZoom),{message:"minZoom may no be greater than maxZoom",path:["minZoom"]}),t3=se.object({type:se.nativeEnum(ot),id:se.string(),title:se.string().optional(),category:se.string().optional(),description:se.string().optional(),background:Q8.optional(),layers:se.array(e3),minZoom:vu.optional(),maxZoom:vu.optional(),format:se.union([se.nativeEnum(Ue),se.nativeEnum(tr)]).optional()});var jo={Aws:{Region:"ap-southeast-2"},ApiKey:{QueryString:"api",TableName:"ApiKey",RequestLimitMinute:1e3},TileMetadata:{TableName:"TileMetadata",RequestLimitMinute:1e3}},Qe={PublicUrlBase:"BASEMAPS_PUBLIC_URL",AssetLocation:"BASEMAPS_ASSEST_LOCATION",TiffConcurrency:"TIFF_CONCURRENCY",TempFolder:"TEMP_FOLDER",BatchIndex:"AWS_BATCH_JOB_ARRAY_INDEX",AwsRoleDurationHours:"AWS_ROLE_DURATION_HOURS",AwsRoleConfigPath:"ROLE_CONFIG_PATH",ImportImageryBucket:"IMPORT_IMAGERY_BUCKET",ImportFilesNumberLimit:"FILES_NUMBER_LIMIT",ImportFilesSizeLimitGb:"FILES_SIZE_LIMIT_GB",Gdal:{UseDocker:"GDAL_DOCKER",DockerContainer:"GDAL_DOCKER_CONTAINER",DockerContainerTag:"GDAL_DOCKER_CONTAINER_TAG"},Analytics:{CloudFrontId:"ANALYTICS_CLOUD_FRONT_ID",CloudFrontSourceBucket:"ANALYTICS_CLOUD_FRONT_SOURCE_BUCKET",CacheBucket:"ANALYTICS_CACHE_BUCKET"},get(t){return process.env[t]},getNumber(t,e){let r=Qe.get(t);if(r===""||r==null)return e;let i=parseFloat(r);return isNaN(i)?e:i},isProduction(){return!0}};var $0=de(h0(),1);var zr=de(_m(),1);function hw(t){return t<=10?zr.default.gray("TRACE"):t<=20?zr.default.magenta("DEBUG"):t<=30?zr.default.cyan("INFO"):t<=40?zr.default.yellow("WARN"):t<=50?zr.default.red("ERROR"):zr.default.bgRed("FATAL")}var zi=class{constructor(e){this.level=e}static formatObject(e){let r=[];for(let i of Object.keys(e)){if(zi.Ignore.has(i))continue;let n=e[i];if(n==null||n==="")continue;let o="",a=typeof n;if(a==="number")o=zr.default.yellow(String(n));else if(a==="string")o=zr.default.green(n);else if(a==="object"){let h=this.formatObject(n);h.length>0&&(o=`{ ${h.join(" ")} }`)}else o=String(n);o!==""&&r.push(`${zr.default.dim(i)}=${o}`)}return r}pretty(e){if(e.level<this.level)return null;let r=new Date(e.time);if(isNaN(r.getTime()))return null;let n=zi.formatObject(e).join(" ");return`[${r.toISOString()}] ${hw(e.level)} ${zr.default.blue(e.msg)} ${n}`}};zi.Ignore=new Set(["pid","time","hostname","level","v","name","msg"]);var Tp=de(Ap(),1),Ko=require("stream"),Pp=require("string_decoder");function yx(t){try{return JSON.parse(t)}catch{return null}}function bx(t){t!=null&&console.error("PrettyTransformFailed",t)}var xn=class extends Ko.Transform{constructor(){super(),this.pretty=new zi(-1),this.decoder=new Pp.StringDecoder}static stream(e=process.stdout){let r=new Ko.PassThrough;return xn.pretty(r,e),r}static pretty(e,r=process.stdout){let i=new xn;return(0,Ko.pipeline)(e,(0,Tp.default)(),i,r,bx),i}_transform(e,r,i){if(r!=="buffer")return i(new Error(`Unknown encoding: ${r}`));let n=this.decoder.write(e),o=yx(n);if(o==null)return i(null,e+`
134
+ `);let a=this.pretty.pretty(o);if(a==null)return i(null,e+`
135
135
  `);i(null,a+`
136
- `)}};var Uu,Mm={level:"debug"},$u={get(){return Uu==null&&(Uu=process.stdout.isTTY?(0,B0.default)(Mm,vn.stream()):(0,B0.default)(Mm)),Uu},set(t){Uu=t},disable(){$u.get().level="silent"}};var D_=.2,Bo=class{constructor(e){this.tms=e}async tile(e,r,i,n){let s=[];for(let a of e){let c=this.getTiles(a,r,i,n);c!=null&&(s=s.concat(c))}return s}getRasterTiffIntersection(e,r,i,n){let s=this.tms.tileToPixels(r,i),a=new ge(s.x,s.y,this.tms.tileSize,this.tms.tileSize),c=e.images[0].bbox,d=this.tms.sourceToPixels(c[0],c[3],n),p=this.tms.sourceToPixels(c[2],c[1],n),m=ge.fromUpperLeftLowerRight(d,p),w=m.intersection(a);return w==null?null:{tiff:m,intersection:w,tile:a}}createComposition(e,r,i,n,s){let a=ge.fromJson(e.getTileBounds(r,i)),c=a.scale(n,n).add(s.tiff).round(D_),d=c.intersection(s.tile);if(d==null)return null;let p=d.subtract(c);if(p.height<.5||p.width<.5)return null;let m=c.subtract(s.tile),w={tiff:e.tif,source:{x:r,y:i,imageId:e.id,width:a.width,height:a.height},y:Math.max(0,Math.round(m.y)),x:Math.max(0,Math.round(m.x))};if((a.width<e.tileSize.width||a.height<e.tileSize.height)&&(w.extract={width:a.width,height:a.height}),a.width!==c.width||a.height!==c.height){let S=a.width!==c.width?c.width/a.width:c.height/a.height;w.resize={width:c.width,height:c.height,scale:S}}return(p.y!==0||p.x!==0||p.height!==c.height||p.width!==c.width)&&(w.crop=p),w}getTiles(e,r,i,n){let s=this.getRasterTiffIntersection(e,r,i,n);if(s==null)return null;let a=this.tms.pixelScale(n),c=e.getImageByResolution(a),d=a/c.resolution[0],p=s.intersection.subtract(s.tiff),{tileSize:m,tileCount:w}=c,S=[],v=1/d;for(let R of Bo.getRequiredTiles(p,d,m,w)){let x=this.createComposition(c,R.x,R.y,v,s);x!=null&&S.push(x)}return S.length===0?null:S}static*getRequiredTiles(e,r,i,n){let s=Math.max(Math.floor(e.x/i.width*r),0),a=Math.min(Math.ceil(e.right/i.width*r),n.x),c=Math.max(Math.floor(e.y/i.height*r),0),d=Math.min(Math.ceil(e.bottom/i.height*r),n.y);for(let p=s;p<a;p++)for(let m=c;m<d;m++)yield{x:p,y:m}}};var Em=[qe.Jpeg,qe.Webp,qe.Png];function Wu(t){if(t==null)return null;let e=t.toLowerCase();return e===qe.Png?qe.Png:e===qe.Webp?qe.Webp:e===qe.Jpeg||e==="jpg"?qe.Jpeg:e===qe.Avif?qe.Avif:null}var di;(function(t){t.WMTS="WMTS",t.Tile="tile",t.Attribution="attribution"})(di||(di={}));function Rm(t,e){t.set("tileSet",e.name),e.tileMatrix!=null&&t.set("projection",e.tileMatrix.projection)}function p1(t){var e;let r=Se.parse(t);return r!=null?(e=sn.tryGet(r.code))!==null&&e!==void 0?e:null:sn.find(t)}function Cm(t){if(t.length<5)return null;let e=t[0],r=p1(t[1]);if(r==null)return null;let i=parseInt(t[2],10),n=parseInt(t[3],10),[s,a]=t[4].split(".",2),c=parseInt(s,10);if(isNaN(n)||isNaN(c)||isNaN(i))return null;if(a==="pbf")return{type:di.Tile,name:e,tileMatrix:r,x:n,y:c,z:i,ext:rr.MapboxVectorTiles};let d=Wu(a);return d==null?null:{type:di.Tile,name:e,tileMatrix:r,x:n,y:c,z:i,ext:d}}function Am(t){if(t.length<3)return null;let e=t[0],r=p1(t[1]);return r==null?null:{type:di.Attribution,name:e,tileMatrix:r}}function Pm(t){if(t.length>3)return null;let e=t.length<2?"aerial":t[0];if(t.length===3){let r=p1(t[1]);return r==null?null:{type:di.WMTS,name:e,tileMatrix:r}}return{type:di.WMTS,name:e,tileMatrix:null}}var Tm=fe(Zn(),1);var B_=24*60*60*1e3,LA=30*B_;var Im=new Uint16Array([7489,60,213,305,650,1181,1403,1488,1653,1758,1954,2006,2063,2634,2705,3489,3693,3849,3878,4298,4648,4833,5141,5277,5315,5343,5413,0,0,0,0,0,0,5483,5837,6541,7186,7645,8062,8288,8624,8845,9152,9211,9282,10276,10514,11528,11848,12238,12310,12986,13881,14252,14590,14888,14961,15072,15150,2048,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,92,98,102,109,115,127,132,139,144,149,152,166,179,185,200,207,108,105,103,32827,198,16582,80,32827,38,16422,99,117,116,101,32827,193,16577,114,101,118,101,59,16642,256,105,121,120,125,114,99,32827,194,16578,59,17424,114,59,49152,55349,56580,114,97,118,101,32827,192,16576,112,104,97,59,17297,97,99,114,59,16640,100,59,27219,256,103,112,157,161,111,110,59,16644,102,59,49152,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,24673,105,110,103,32827,197,16581,256,99,115,190,195,114,59,49152,55349,56476,105,103,110,59,25172,105,108,100,101,32827,195,16579,109,108,32827,196,16580,1024,97,99,101,102,111,114,115,117,229,251,254,279,284,290,295,298,256,99,114,234,242,107,115,108,97,115,104,59,25110,374,246,248,59,27367,101,100,59,25350,121,59,17425,384,99,114,116,261,267,276,97,117,115,101,59,25141,110,111,117,108,108,105,115,59,24876,97,59,17298,114,59,49152,55349,56581,112,102,59,49152,55349,56633,101,118,101,59,17112,99,242,275,109,112,101,113,59,25166,1792,72,79,97,99,100,101,102,104,105,108,111,114,115,117,333,337,342,384,414,418,437,439,442,476,533,627,632,638,99,121,59,17447,80,89,32827,169,16553,384,99,112,121,349,354,378,117,116,101,59,16646,256,59,105,359,360,25298,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,24901,108,101,121,115,59,24877,512,97,101,105,111,393,398,404,408,114,111,110,59,16652,100,105,108,32827,199,16583,114,99,59,16648,110,105,110,116,59,25136,111,116,59,16650,256,100,110,423,429,105,108,108,97,59,16568,116,101,114,68,111,116,59,16567,242,383,105,59,17319,114,99,108,101,512,68,77,80,84,455,459,465,470,111,116,59,25241,105,110,117,115,59,25238,108,117,115,59,25237,105,109,101,115,59,25239,111,256,99,115,482,504,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,25138,101,67,117,114,108,121,256,68,81,515,527,111,117,98,108,101,81,117,111,116,101,59,24605,117,111,116,101,59,24601,512,108,110,112,117,542,552,583,597,111,110,256,59,101,549,550,25143,59,27252,384,103,105,116,559,566,570,114,117,101,110,116,59,25185,110,116,59,25135,111,117,114,73,110,116,101,103,114,97,108,59,25134,256,102,114,588,590,59,24834,111,100,117,99,116,59,25104,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,25139,111,115,115,59,27183,99,114,59,49152,55349,56478,112,256,59,67,644,645,25299,97,112,59,25165,1408,68,74,83,90,97,99,101,102,105,111,115,672,684,688,692,696,715,727,737,742,819,1165,256,59,111,377,677,116,114,97,104,100,59,26897,99,121,59,17410,99,121,59,17413,99,121,59,17423,384,103,114,115,703,708,711,103,101,114,59,24609,114,59,24993,104,118,59,27364,256,97,121,720,725,114,111,110,59,16654,59,17428,108,256,59,116,733,734,25095,97,59,17300,114,59,49152,55349,56583,256,97,102,747,807,256,99,109,752,802,114,105,116,105,99,97,108,512,65,68,71,84,768,774,790,796,99,117,116,101,59,16564,111,372,779,781,59,17113,98,108,101,65,99,117,116,101,59,17117,114,97,118,101,59,16480,105,108,100,101,59,17116,111,110,100,59,25284,102,101,114,101,110,116,105,97,108,68,59,24902,1136,829,0,0,0,834,852,0,1029,102,59,49152,55349,56635,384,59,68,69,840,841,845,16552,111,116,59,24796,113,117,97,108,59,25168,98,108,101,768,67,68,76,82,85,86,867,882,898,975,994,1016,111,110,116,111,117,114,73,110,116,101,103,114,97,236,569,111,628,889,0,0,891,187,841,110,65,114,114,111,119,59,25043,256,101,111,903,932,102,116,384,65,82,84,912,918,929,114,114,111,119,59,25040,105,103,104,116,65,114,114,111,119,59,25044,101,229,714,110,103,256,76,82,939,964,101,102,116,256,65,82,947,953,114,114,111,119,59,26616,105,103,104,116,65,114,114,111,119,59,26618,105,103,104,116,65,114,114,111,119,59,26617,105,103,104,116,256,65,84,984,990,114,114,111,119,59,25042,101,101,59,25256,112,577,1001,0,0,1007,114,114,111,119,59,25041,111,119,110,65,114,114,111,119,59,25045,101,114,116,105,99,97,108,66,97,114,59,25125,110,768,65,66,76,82,84,97,1042,1066,1072,1118,1151,892,114,114,111,119,384,59,66,85,1053,1054,1058,24979,97,114,59,26899,112,65,114,114,111,119,59,25077,114,101,118,101,59,17169,101,102,116,722,1082,0,1094,0,1104,105,103,104,116,86,101,99,116,111,114,59,26960,101,101,86,101,99,116,111,114,59,26974,101,99,116,111,114,256,59,66,1113,1114,25021,97,114,59,26966,105,103,104,116,468,1127,0,1137,101,101,86,101,99,116,111,114,59,26975,101,99,116,111,114,256,59,66,1146,1147,25025,97,114,59,26967,101,101,256,59,65,1158,1159,25252,114,114,111,119,59,24999,256,99,116,1170,1175,114,59,49152,55349,56479,114,111,107,59,16656,2048,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1213,1216,1220,1227,1246,1250,1255,1262,1269,1313,1327,1334,1362,1373,1376,1381,71,59,16714,72,32827,208,16592,99,117,116,101,32827,201,16585,384,97,105,121,1234,1239,1244,114,111,110,59,16666,114,99,32827,202,16586,59,17453,111,116,59,16662,114,59,49152,55349,56584,114,97,118,101,32827,200,16584,101,109,101,110,116,59,25096,256,97,112,1274,1278,99,114,59,16658,116,121,595,1286,0,0,1298,109,97,108,108,83,113,117,97,114,101,59,26107,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,26027,256,103,112,1318,1322,111,110,59,16664,102,59,49152,55349,56636,115,105,108,111,110,59,17301,117,256,97,105,1340,1353,108,256,59,84,1346,1347,27253,105,108,100,101,59,25154,108,105,98,114,105,117,109,59,25036,256,99,105,1367,1370,114,59,24880,109,59,27251,97,59,17303,109,108,32827,203,16587,256,105,112,1386,1391,115,116,115,59,25091,111,110,101,110,116,105,97,108,69,59,24903,640,99,102,105,111,115,1413,1416,1421,1458,1484,121,59,17444,114,59,49152,55349,56585,108,108,101,100,595,1431,0,0,1443,109,97,108,108,83,113,117,97,114,101,59,26108,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,26026,880,1466,0,1471,0,0,1476,102,59,49152,55349,56637,65,108,108,59,25088,114,105,101,114,116,114,102,59,24881,99,242,1483,1536,74,84,97,98,99,100,102,103,111,114,115,116,1512,1516,1519,1530,1536,1554,1558,1563,1565,1571,1644,1650,99,121,59,17411,32827,62,16446,109,109,97,256,59,100,1527,1528,17299,59,17372,114,101,118,101,59,16670,384,101,105,121,1543,1548,1552,100,105,108,59,16674,114,99,59,16668,59,17427,111,116,59,16672,114,59,49152,55349,56586,59,25305,112,102,59,49152,55349,56638,101,97,116,101,114,768,69,70,71,76,83,84,1589,1604,1614,1622,1627,1638,113,117,97,108,256,59,76,1598,1599,25189,101,115,115,59,25307,117,108,108,69,113,117,97,108,59,25191,114,101,97,116,101,114,59,27298,101,115,115,59,25207,108,97,110,116,69,113,117,97,108,59,27262,105,108,100,101,59,25203,99,114,59,49152,55349,56482,59,25195,1024,65,97,99,102,105,111,115,117,1669,1675,1686,1691,1694,1706,1726,1738,82,68,99,121,59,17450,256,99,116,1680,1684,101,107,59,17095,59,16478,105,114,99,59,16676,114,59,24844,108,98,101,114,116,83,112,97,99,101,59,24843,496,1711,0,1714,102,59,24845,105,122,111,110,116,97,108,76,105,110,101,59,25856,256,99,116,1731,1733,242,1705,114,111,107,59,16678,109,112,324,1744,1752,111,119,110,72,117,109,240,303,113,117,97,108,59,25167,1792,69,74,79,97,99,100,102,103,109,110,111,115,116,117,1786,1790,1795,1799,1806,1818,1822,1825,1832,1860,1912,1931,1935,1941,99,121,59,17429,108,105,103,59,16690,99,121,59,17409,99,117,116,101,32827,205,16589,256,105,121,1811,1816,114,99,32827,206,16590,59,17432,111,116,59,16688,114,59,24849,114,97,118,101,32827,204,16588,384,59,97,112,1824,1839,1855,256,99,103,1844,1847,114,59,16682,105,110,97,114,121,73,59,24904,108,105,101,243,989,500,1865,0,1890,256,59,101,1869,1870,25132,256,103,114,1875,1880,114,97,108,59,25131,115,101,99,116,105,111,110,59,25282,105,115,105,98,108,101,256,67,84,1900,1906,111,109,109,97,59,24675,105,109,101,115,59,24674,384,103,112,116,1919,1923,1928,111,110,59,16686,102,59,49152,55349,56640,97,59,17305,99,114,59,24848,105,108,100,101,59,16680,491,1946,0,1950,99,121,59,17414,108,32827,207,16591,640,99,102,111,115,117,1964,1975,1980,1986,2e3,256,105,121,1969,1973,114,99,59,16692,59,17433,114,59,49152,55349,56589,112,102,59,49152,55349,56641,483,1991,0,1996,114,59,49152,55349,56485,114,99,121,59,17416,107,99,121,59,17412,896,72,74,97,99,102,111,115,2020,2024,2028,2033,2045,2050,2056,99,121,59,17445,99,121,59,17420,112,112,97,59,17306,256,101,121,2038,2043,100,105,108,59,16694,59,17434,114,59,49152,55349,56590,112,102,59,49152,55349,56642,99,114,59,49152,55349,56486,1408,74,84,97,99,101,102,108,109,111,115,116,2085,2089,2092,2128,2147,2483,2488,2503,2509,2615,2631,99,121,59,17417,32827,60,16444,640,99,109,110,112,114,2103,2108,2113,2116,2125,117,116,101,59,16697,98,100,97,59,17307,103,59,26602,108,97,99,101,116,114,102,59,24850,114,59,24990,384,97,101,121,2135,2140,2145,114,111,110,59,16701,100,105,108,59,16699,59,17435,256,102,115,2152,2416,116,1280,65,67,68,70,82,84,85,86,97,114,2174,2217,2225,2272,2278,2300,2351,2395,912,2410,256,110,114,2179,2191,103,108,101,66,114,97,99,107,101,116,59,26600,114,111,119,384,59,66,82,2201,2202,2206,24976,97,114,59,25060,105,103,104,116,65,114,114,111,119,59,25030,101,105,108,105,110,103,59,25352,111,501,2231,0,2243,98,108,101,66,114,97,99,107,101,116,59,26598,110,468,2248,0,2258,101,101,86,101,99,116,111,114,59,26977,101,99,116,111,114,256,59,66,2267,2268,25027,97,114,59,26969,108,111,111,114,59,25354,105,103,104,116,256,65,86,2287,2293,114,114,111,119,59,24980,101,99,116,111,114,59,26958,256,101,114,2305,2327,101,384,59,65,86,2313,2314,2320,25251,114,114,111,119,59,24996,101,99,116,111,114,59,26970,105,97,110,103,108,101,384,59,66,69,2340,2341,2345,25266,97,114,59,27087,113,117,97,108,59,25268,112,384,68,84,86,2359,2370,2380,111,119,110,86,101,99,116,111,114,59,26961,101,101,86,101,99,116,111,114,59,26976,101,99,116,111,114,256,59,66,2390,2391,25023,97,114,59,26968,101,99,116,111,114,256,59,66,2405,2406,25020,97,114,59,26962,105,103,104,116,225,924,115,768,69,70,71,76,83,84,2430,2443,2453,2461,2466,2477,113,117,97,108,71,114,101,97,116,101,114,59,25306,117,108,108,69,113,117,97,108,59,25190,114,101,97,116,101,114,59,25206,101,115,115,59,27297,108,97,110,116,69,113,117,97,108,59,27261,105,108,100,101,59,25202,114,59,49152,55349,56591,256,59,101,2493,2494,25304,102,116,97,114,114,111,119,59,25050,105,100,111,116,59,16703,384,110,112,119,2516,2582,2587,103,512,76,82,108,114,2526,2551,2562,2576,101,102,116,256,65,82,2534,2540,114,114,111,119,59,26613,105,103,104,116,65,114,114,111,119,59,26615,105,103,104,116,65,114,114,111,119,59,26614,101,102,116,256,97,114,947,2570,105,103,104,116,225,959,105,103,104,116,225,970,102,59,49152,55349,56643,101,114,256,76,82,2594,2604,101,102,116,65,114,114,111,119,59,24985,105,103,104,116,65,114,114,111,119,59,24984,384,99,104,116,2622,2624,2626,242,2124,59,25008,114,111,107,59,16705,59,25194,1024,97,99,101,102,105,111,115,117,2650,2653,2656,2679,2684,2693,2699,2702,112,59,26885,121,59,17436,256,100,108,2661,2671,105,117,109,83,112,97,99,101,59,24671,108,105,110,116,114,102,59,24883,114,59,49152,55349,56592,110,117,115,80,108,117,115,59,25107,112,102,59,49152,55349,56644,99,242,2678,59,17308,1152,74,97,99,101,102,111,115,116,117,2723,2727,2733,2752,2836,2841,3473,3479,3486,99,121,59,17418,99,117,116,101,59,16707,384,97,101,121,2740,2745,2750,114,111,110,59,16711,100,105,108,59,16709,59,17437,384,103,115,119,2759,2800,2830,97,116,105,118,101,384,77,84,86,2771,2783,2792,101,100,105,117,109,83,112,97,99,101,59,24587,104,105,256,99,110,2790,2776,235,2777,101,114,121,84,104,105,238,2777,116,101,100,256,71,76,2808,2822,114,101,97,116,101,114,71,114,101,97,116,101,242,1651,101,115,115,76,101,115,243,2632,76,105,110,101,59,16394,114,59,49152,55349,56593,512,66,110,112,116,2850,2856,2871,2874,114,101,97,107,59,24672,66,114,101,97,107,105,110,103,83,112,97,99,101,59,16544,102,59,24853,1664,59,67,68,69,71,72,76,78,80,82,83,84,86,2901,2902,2922,2940,2977,3051,3076,3166,3204,3238,3288,3425,3461,27372,256,111,117,2907,2916,110,103,114,117,101,110,116,59,25186,112,67,97,112,59,25197,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,25126,384,108,113,120,2947,2954,2971,101,109,101,110,116,59,25097,117,97,108,256,59,84,2962,2963,25184,105,108,100,101,59,49152,8770,824,105,115,116,115,59,25092,114,101,97,116,101,114,896,59,69,70,71,76,83,84,2998,2999,3005,3017,3027,3032,3045,25199,113,117,97,108,59,25201,117,108,108,69,113,117,97,108,59,49152,8807,824,114,101,97,116,101,114,59,49152,8811,824,101,115,115,59,25209,108,97,110,116,69,113,117,97,108,59,49152,10878,824,105,108,100,101,59,25205,117,109,112,324,3058,3069,111,119,110,72,117,109,112,59,49152,8782,824,113,117,97,108,59,49152,8783,824,101,256,102,115,3082,3111,116,84,114,105,97,110,103,108,101,384,59,66,69,3098,3099,3105,25322,97,114,59,49152,10703,824,113,117,97,108,59,25324,115,768,59,69,71,76,83,84,3125,3126,3132,3140,3147,3160,25198,113,117,97,108,59,25200,114,101,97,116,101,114,59,25208,101,115,115,59,49152,8810,824,108,97,110,116,69,113,117,97,108,59,49152,10877,824,105,108,100,101,59,25204,101,115,116,101,100,256,71,76,3176,3193,114,101,97,116,101,114,71,114,101,97,116,101,114,59,49152,10914,824,101,115,115,76,101,115,115,59,49152,10913,824,114,101,99,101,100,101,115,384,59,69,83,3218,3219,3227,25216,113,117,97,108,59,49152,10927,824,108,97,110,116,69,113,117,97,108,59,25312,256,101,105,3243,3257,118,101,114,115,101,69,108,101,109,101,110,116,59,25100,103,104,116,84,114,105,97,110,103,108,101,384,59,66,69,3275,3276,3282,25323,97,114,59,49152,10704,824,113,117,97,108,59,25325,256,113,117,3293,3340,117,97,114,101,83,117,256,98,112,3304,3321,115,101,116,256,59,69,3312,3315,49152,8847,824,113,117,97,108,59,25314,101,114,115,101,116,256,59,69,3331,3334,49152,8848,824,113,117,97,108,59,25315,384,98,99,112,3347,3364,3406,115,101,116,256,59,69,3355,3358,49152,8834,8402,113,117,97,108,59,25224,99,101,101,100,115,512,59,69,83,84,3378,3379,3387,3398,25217,113,117,97,108,59,49152,10928,824,108,97,110,116,69,113,117,97,108,59,25313,105,108,100,101,59,49152,8831,824,101,114,115,101,116,256,59,69,3416,3419,49152,8835,8402,113,117,97,108,59,25225,105,108,100,101,512,59,69,70,84,3438,3439,3445,3455,25153,113,117,97,108,59,25156,117,108,108,69,113,117,97,108,59,25159,105,108,100,101,59,25161,101,114,116,105,99,97,108,66,97,114,59,25124,99,114,59,49152,55349,56489,105,108,100,101,32827,209,16593,59,17309,1792,69,97,99,100,102,103,109,111,112,114,115,116,117,118,3517,3522,3529,3541,3547,3552,3559,3580,3586,3616,3618,3634,3647,3652,108,105,103,59,16722,99,117,116,101,32827,211,16595,256,105,121,3534,3539,114,99,32827,212,16596,59,17438,98,108,97,99,59,16720,114,59,49152,55349,56594,114,97,118,101,32827,210,16594,384,97,101,105,3566,3570,3574,99,114,59,16716,103,97,59,17321,99,114,111,110,59,17311,112,102,59,49152,55349,56646,101,110,67,117,114,108,121,256,68,81,3598,3610,111,117,98,108,101,81,117,111,116,101,59,24604,117,111,116,101,59,24600,59,27220,256,99,108,3623,3628,114,59,49152,55349,56490,97,115,104,32827,216,16600,105,364,3639,3644,100,101,32827,213,16597,101,115,59,27191,109,108,32827,214,16598,101,114,256,66,80,3659,3680,256,97,114,3664,3667,114,59,24638,97,99,256,101,107,3674,3676,59,25566,101,116,59,25524,97,114,101,110,116,104,101,115,105,115,59,25564,1152,97,99,102,104,105,108,111,114,115,3711,3719,3722,3727,3730,3732,3741,3760,3836,114,116,105,97,108,68,59,25090,121,59,17439,114,59,49152,55349,56595,105,59,17318,59,17312,117,115,77,105,110,117,115,59,16561,256,105,112,3746,3757,110,99,97,114,101,112,108,97,110,229,1693,102,59,24857,512,59,101,105,111,3769,3770,3808,3812,27323,99,101,100,101,115,512,59,69,83,84,3784,3785,3791,3802,25210,113,117,97,108,59,27311,108,97,110,116,69,113,117,97,108,59,25212,105,108,100,101,59,25214,109,101,59,24627,256,100,112,3817,3822,117,99,116,59,25103,111,114,116,105,111,110,256,59,97,549,3833,108,59,25117,256,99,105,3841,3846,114,59,49152,55349,56491,59,17320,512,85,102,111,115,3857,3862,3867,3871,79,84,32827,34,16418,114,59,49152,55349,56596,112,102,59,24858,99,114,59,49152,55349,56492,1536,66,69,97,99,101,102,104,105,111,114,115,117,3902,3907,3911,3936,3955,4007,4010,4013,4246,4265,4276,4286,97,114,114,59,26896,71,32827,174,16558,384,99,110,114,3918,3923,3926,117,116,101,59,16724,103,59,26603,114,256,59,116,3932,3933,24992,108,59,26902,384,97,101,121,3943,3948,3953,114,111,110,59,16728,100,105,108,59,16726,59,17440,256,59,118,3960,3961,24860,101,114,115,101,256,69,85,3970,3993,256,108,113,3975,3982,101,109,101,110,116,59,25099,117,105,108,105,98,114,105,117,109,59,25035,112,69,113,117,105,108,105,98,114,105,117,109,59,26991,114,187,3961,111,59,17313,103,104,116,1024,65,67,68,70,84,85,86,97,4033,4075,4083,4130,4136,4187,4231,984,256,110,114,4038,4050,103,108,101,66,114,97,99,107,101,116,59,26601,114,111,119,384,59,66,76,4060,4061,4065,24978,97,114,59,25061,101,102,116,65,114,114,111,119,59,25028,101,105,108,105,110,103,59,25353,111,501,4089,0,4101,98,108,101,66,114,97,99,107,101,116,59,26599,110,468,4106,0,4116,101,101,86,101,99,116,111,114,59,26973,101,99,116,111,114,256,59,66,4125,4126,25026,97,114,59,26965,108,111,111,114,59,25355,256,101,114,4141,4163,101,384,59,65,86,4149,4150,4156,25250,114,114,111,119,59,24998,101,99,116,111,114,59,26971,105,97,110,103,108,101,384,59,66,69,4176,4177,4181,25267,97,114,59,27088,113,117,97,108,59,25269,112,384,68,84,86,4195,4206,4216,111,119,110,86,101,99,116,111,114,59,26959,101,101,86,101,99,116,111,114,59,26972,101,99,116,111,114,256,59,66,4226,4227,25022,97,114,59,26964,101,99,116,111,114,256,59,66,4241,4242,25024,97,114,59,26963,256,112,117,4251,4254,102,59,24861,110,100,73,109,112,108,105,101,115,59,26992,105,103,104,116,97,114,114,111,119,59,25051,256,99,104,4281,4284,114,59,24859,59,25009,108,101,68,101,108,97,121,101,100,59,27124,1664,72,79,97,99,102,104,105,109,111,113,115,116,117,4324,4337,4343,4349,4377,4382,4433,4438,4449,4455,4533,4539,4543,256,67,99,4329,4334,72,99,121,59,17449,121,59,17448,70,84,99,121,59,17452,99,117,116,101,59,16730,640,59,97,101,105,121,4360,4361,4366,4371,4375,27324,114,111,110,59,16736,100,105,108,59,16734,114,99,59,16732,59,17441,114,59,49152,55349,56598,111,114,116,512,68,76,82,85,4394,4404,4414,4425,111,119,110,65,114,114,111,119,187,1054,101,102,116,65,114,114,111,119,187,2202,105,103,104,116,65,114,114,111,119,187,4061,112,65,114,114,111,119,59,24977,103,109,97,59,17315,97,108,108,67,105,114,99,108,101,59,25112,112,102,59,49152,55349,56650,626,4461,0,0,4464,116,59,25114,97,114,101,512,59,73,83,85,4475,4476,4489,4527,26017,110,116,101,114,115,101,99,116,105,111,110,59,25235,117,256,98,112,4495,4510,115,101,116,256,59,69,4503,4504,25231,113,117,97,108,59,25233,101,114,115,101,116,256,59,69,4520,4521,25232,113,117,97,108,59,25234,110,105,111,110,59,25236,99,114,59,49152,55349,56494,97,114,59,25286,512,98,99,109,112,4552,4571,4617,4619,256,59,115,4557,4558,25296,101,116,256,59,69,4557,4565,113,117,97,108,59,25222,256,99,104,4576,4613,101,101,100,115,512,59,69,83,84,4589,4590,4596,4607,25211,113,117,97,108,59,27312,108,97,110,116,69,113,117,97,108,59,25213,105,108,100,101,59,25215,84,104,225,3980,59,25105,384,59,101,115,4626,4627,4643,25297,114,115,101,116,256,59,69,4636,4637,25219,113,117,97,108,59,25223,101,116,187,4627,1408,72,82,83,97,99,102,104,105,111,114,115,4670,4676,4681,4693,4702,4721,4726,4767,4802,4808,4817,79,82,78,32827,222,16606,65,68,69,59,24866,256,72,99,4686,4690,99,121,59,17419,121,59,17446,256,98,117,4698,4700,59,16393,59,17316,384,97,101,121,4709,4714,4719,114,111,110,59,16740,100,105,108,59,16738,59,17442,114,59,49152,55349,56599,256,101,105,4731,4745,498,4736,0,4743,101,102,111,114,101,59,25140,97,59,17304,256,99,110,4750,4760,107,83,112,97,99,101,59,49152,8287,8202,83,112,97,99,101,59,24585,108,100,101,512,59,69,70,84,4779,4780,4786,4796,25148,113,117,97,108,59,25155,117,108,108,69,113,117,97,108,59,25157,105,108,100,101,59,25160,112,102,59,49152,55349,56651,105,112,108,101,68,111,116,59,24795,256,99,116,4822,4827,114,59,49152,55349,56495,114,111,107,59,16742,2785,4855,4878,4890,4902,0,4908,4913,0,0,0,0,0,4920,4925,4983,4997,0,5119,5124,5130,5136,256,99,114,4859,4865,117,116,101,32827,218,16602,114,256,59,111,4871,4872,24991,99,105,114,59,26953,114,483,4883,0,4886,121,59,17422,118,101,59,16748,256,105,121,4894,4899,114,99,32827,219,16603,59,17443,98,108,97,99,59,16752,114,59,49152,55349,56600,114,97,118,101,32827,217,16601,97,99,114,59,16746,256,100,105,4929,4969,101,114,256,66,80,4936,4957,256,97,114,4941,4944,114,59,16479,97,99,256,101,107,4951,4953,59,25567,101,116,59,25525,97,114,101,110,116,104,101,115,105,115,59,25565,111,110,256,59,80,4976,4977,25283,108,117,115,59,25230,256,103,112,4987,4991,111,110,59,16754,102,59,49152,55349,56652,1024,65,68,69,84,97,100,112,115,5013,5038,5048,5060,1e3,5074,5079,5107,114,114,111,119,384,59,66,68,4432,5024,5028,97,114,59,26898,111,119,110,65,114,114,111,119,59,25029,111,119,110,65,114,114,111,119,59,24981,113,117,105,108,105,98,114,105,117,109,59,26990,101,101,256,59,65,5067,5068,25253,114,114,111,119,59,24997,111,119,110,225,1011,101,114,256,76,82,5086,5096,101,102,116,65,114,114,111,119,59,24982,105,103,104,116,65,114,114,111,119,59,24983,105,256,59,108,5113,5114,17362,111,110,59,17317,105,110,103,59,16750,99,114,59,49152,55349,56496,105,108,100,101,59,16744,109,108,32827,220,16604,1152,68,98,99,100,101,102,111,115,118,5159,5164,5168,5171,5182,5253,5258,5264,5270,97,115,104,59,25259,97,114,59,27371,121,59,17426,97,115,104,256,59,108,5179,5180,25257,59,27366,256,101,114,5187,5189,59,25281,384,98,116,121,5196,5200,5242,97,114,59,24598,256,59,105,5199,5205,99,97,108,512,66,76,83,84,5217,5221,5226,5236,97,114,59,25123,105,110,101,59,16508,101,112,97,114,97,116,111,114,59,26456,105,108,100,101,59,25152,84,104,105,110,83,112,97,99,101,59,24586,114,59,49152,55349,56601,112,102,59,49152,55349,56653,99,114,59,49152,55349,56497,100,97,115,104,59,25258,640,99,101,102,111,115,5287,5292,5297,5302,5308,105,114,99,59,16756,100,103,101,59,25280,114,59,49152,55349,56602,112,102,59,49152,55349,56654,99,114,59,49152,55349,56498,512,102,105,111,115,5323,5328,5330,5336,114,59,49152,55349,56603,59,17310,112,102,59,49152,55349,56655,99,114,59,49152,55349,56499,1152,65,73,85,97,99,102,111,115,117,5361,5365,5369,5373,5380,5391,5396,5402,5408,99,121,59,17455,99,121,59,17415,99,121,59,17454,99,117,116,101,32827,221,16605,256,105,121,5385,5389,114,99,59,16758,59,17451,114,59,49152,55349,56604,112,102,59,49152,55349,56656,99,114,59,49152,55349,56500,109,108,59,16760,1024,72,97,99,100,101,102,111,115,5429,5433,5439,5451,5455,5469,5472,5476,99,121,59,17430,99,117,116,101,59,16761,256,97,121,5444,5449,114,111,110,59,16765,59,17431,111,116,59,16763,498,5460,0,5467,111,87,105,100,116,232,2777,97,59,17302,114,59,24872,112,102,59,24868,99,114,59,49152,55349,56501,3041,5507,5514,5520,0,5552,5558,5567,0,0,0,0,5574,5595,5611,5727,5741,0,5781,5787,5810,5817,0,5822,99,117,116,101,32827,225,16609,114,101,118,101,59,16643,768,59,69,100,105,117,121,5532,5533,5537,5539,5544,5549,25150,59,49152,8766,819,59,25151,114,99,32827,226,16610,116,101,32955,180,774,59,17456,108,105,103,32827,230,16614,256,59,114,178,5562,59,49152,55349,56606,114,97,118,101,32827,224,16608,256,101,112,5578,5590,256,102,112,5583,5588,115,121,109,59,24885,232,5587,104,97,59,17329,256,97,112,5599,99,256,99,108,5604,5607,114,59,16641,103,59,27199,612,5616,0,0,5642,640,59,97,100,115,118,5626,5627,5631,5633,5639,25127,110,100,59,27221,59,27228,108,111,112,101,59,27224,59,27226,896,59,101,108,109,114,115,122,5656,5657,5659,5662,5695,5711,5721,25120,59,27044,101,187,5657,115,100,256,59,97,5669,5670,25121,1121,5680,5682,5684,5686,5688,5690,5692,5694,59,27048,59,27049,59,27050,59,27051,59,27052,59,27053,59,27054,59,27055,116,256,59,118,5701,5702,25119,98,256,59,100,5708,5709,25278,59,27037,256,112,116,5716,5719,104,59,25122,187,185,97,114,114,59,25468,256,103,112,5731,5735,111,110,59,16645,102,59,49152,55349,56658,896,59,69,97,101,105,111,112,4801,5755,5757,5762,5764,5767,5770,59,27248,99,105,114,59,27247,59,25162,100,59,25163,115,59,16423,114,111,120,256,59,101,4801,5778,241,5763,105,110,103,32827,229,16613,384,99,116,121,5793,5798,5800,114,59,49152,55349,56502,59,16426,109,112,256,59,101,4801,5807,241,648,105,108,100,101,32827,227,16611,109,108,32827,228,16612,256,99,105,5826,5832,111,110,105,110,244,626,110,116,59,27153,2048,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,5869,5873,5936,5948,5955,5960,6008,6013,6112,6118,6201,6224,5901,6461,6472,6512,111,116,59,27373,256,99,114,5878,5918,107,512,99,101,112,115,5888,5893,5901,5907,111,110,103,59,25164,112,115,105,108,111,110,59,17398,114,105,109,101,59,24629,105,109,256,59,101,5914,5915,25149,113,59,25293,374,5922,5926,101,101,59,25277,101,100,256,59,103,5932,5933,25349,101,187,5933,114,107,256,59,116,4956,5943,98,114,107,59,25526,256,111,121,5889,5953,59,17457,113,117,111,59,24606,640,99,109,112,114,116,5971,5979,5985,5988,5992,97,117,115,256,59,101,266,265,112,116,121,118,59,27056,115,233,5900,110,111,245,275,384,97,104,119,5999,6001,6003,59,17330,59,24886,101,101,110,59,25196,114,59,49152,55349,56607,103,896,99,111,115,116,117,118,119,6029,6045,6067,6081,6101,6107,6110,384,97,105,117,6036,6038,6042,240,1888,114,99,59,26095,112,187,4977,384,100,112,116,6052,6056,6061,111,116,59,27136,108,117,115,59,27137,105,109,101,115,59,27138,625,6073,0,0,6078,99,117,112,59,27142,97,114,59,26117,114,105,97,110,103,108,101,256,100,117,6093,6098,111,119,110,59,26045,112,59,26035,112,108,117,115,59,27140,101,229,5188,229,5293,97,114,111,119,59,26893,384,97,107,111,6125,6182,6197,256,99,110,6130,6179,107,384,108,115,116,6138,1451,6146,111,122,101,110,103,101,59,27115,114,105,97,110,103,108,101,512,59,100,108,114,6162,6163,6168,6173,26036,111,119,110,59,26046,101,102,116,59,26050,105,103,104,116,59,26040,107,59,25635,433,6187,0,6195,434,6191,0,6193,59,26002,59,26001,52,59,26003,99,107,59,25992,256,101,111,6206,6221,256,59,113,6211,6214,49152,61,8421,117,105,118,59,49152,8801,8421,116,59,25360,512,112,116,119,120,6233,6238,6247,6252,102,59,49152,55349,56659,256,59,116,5067,6243,111,109,187,5068,116,105,101,59,25288,1536,68,72,85,86,98,100,104,109,112,116,117,118,6277,6294,6314,6331,6359,6363,6380,6399,6405,6410,6416,6433,512,76,82,108,114,6286,6288,6290,6292,59,25943,59,25940,59,25942,59,25939,640,59,68,85,100,117,6305,6306,6308,6310,6312,25936,59,25958,59,25961,59,25956,59,25959,512,76,82,108,114,6323,6325,6327,6329,59,25949,59,25946,59,25948,59,25945,896,59,72,76,82,104,108,114,6346,6347,6349,6351,6353,6355,6357,25937,59,25964,59,25955,59,25952,59,25963,59,25954,59,25951,111,120,59,27081,512,76,82,108,114,6372,6374,6376,6378,59,25941,59,25938,59,25872,59,25868,640,59,68,85,100,117,1725,6391,6393,6395,6397,59,25957,59,25960,59,25900,59,25908,105,110,117,115,59,25247,108,117,115,59,25246,105,109,101,115,59,25248,512,76,82,108,114,6425,6427,6429,6431,59,25947,59,25944,59,25880,59,25876,896,59,72,76,82,104,108,114,6448,6449,6451,6453,6455,6457,6459,25858,59,25962,59,25953,59,25950,59,25916,59,25892,59,25884,256,101,118,291,6466,98,97,114,32827,166,16550,512,99,101,105,111,6481,6486,6490,6496,114,59,49152,55349,56503,109,105,59,24655,109,256,59,101,5914,5916,108,384,59,98,104,6504,6505,6507,16476,59,27077,115,117,98,59,26568,364,6516,6526,108,256,59,101,6521,6522,24610,116,187,6522,112,384,59,69,101,303,6533,6535,59,27310,256,59,113,1756,1755,3297,6567,0,6632,6673,6677,6706,0,6711,6736,0,0,6836,0,0,6849,0,0,6945,6958,6989,6994,0,7165,0,7180,384,99,112,114,6573,6578,6621,117,116,101,59,16647,768,59,97,98,99,100,115,6591,6592,6596,6602,6613,6617,25129,110,100,59,27204,114,99,117,112,59,27209,256,97,117,6607,6610,112,59,27211,112,59,27207,111,116,59,27200,59,49152,8745,65024,256,101,111,6626,6629,116,59,24641,238,1683,512,97,101,105,117,6640,6651,6657,6661,496,6645,0,6648,115,59,27213,111,110,59,16653,100,105,108,32827,231,16615,114,99,59,16649,112,115,256,59,115,6668,6669,27212,109,59,27216,111,116,59,16651,384,100,109,110,6683,6688,6694,105,108,32955,184,429,112,116,121,118,59,27058,116,33024,162,59,101,6701,6702,16546,114,228,434,114,59,49152,55349,56608,384,99,101,105,6717,6720,6733,121,59,17479,99,107,256,59,109,6727,6728,26387,97,114,107,187,6728,59,17351,114,896,59,69,99,101,102,109,115,6751,6752,6754,6763,6820,6826,6830,26059,59,27075,384,59,101,108,6761,6762,6765,17094,113,59,25175,101,609,6772,0,0,6792,114,114,111,119,256,108,114,6780,6785,101,102,116,59,25018,105,103,104,116,59,25019,640,82,83,97,99,100,6802,6804,6806,6810,6815,187,3911,59,25800,115,116,59,25243,105,114,99,59,25242,97,115,104,59,25245,110,105,110,116,59,27152,105,100,59,27375,99,105,114,59,27074,117,98,115,256,59,117,6843,6844,26211,105,116,187,6844,748,6855,6868,6906,0,6922,111,110,256,59,101,6861,6862,16442,256,59,113,199,198,621,6873,0,0,6882,97,256,59,116,6878,6879,16428,59,16448,384,59,102,108,6888,6889,6891,25089,238,4448,101,256,109,120,6897,6902,101,110,116,187,6889,101,243,589,487,6910,0,6919,256,59,100,4795,6914,111,116,59,27245,110,244,582,384,102,114,121,6928,6932,6935,59,49152,55349,56660,111,228,596,33024,169,59,115,341,6941,114,59,24855,256,97,111,6949,6953,114,114,59,25013,115,115,59,26391,256,99,117,6962,6967,114,59,49152,55349,56504,256,98,112,6972,6980,256,59,101,6977,6978,27343,59,27345,256,59,101,6985,6986,27344,59,27346,100,111,116,59,25327,896,100,101,108,112,114,118,119,7008,7020,7031,7042,7084,7124,7161,97,114,114,256,108,114,7016,7018,59,26936,59,26933,624,7026,0,0,7029,114,59,25310,99,59,25311,97,114,114,256,59,112,7039,7040,25014,59,26941,768,59,98,99,100,111,115,7055,7056,7062,7073,7077,7080,25130,114,99,97,112,59,27208,256,97,117,7067,7070,112,59,27206,112,59,27210,111,116,59,25229,114,59,27205,59,49152,8746,65024,512,97,108,114,118,7093,7103,7134,7139,114,114,256,59,109,7100,7101,25015,59,26940,121,384,101,118,119,7111,7124,7128,113,624,7118,0,0,7122,114,101,227,7027,117,227,7029,101,101,59,25294,101,100,103,101,59,25295,101,110,32827,164,16548,101,97,114,114,111,119,256,108,114,7150,7155,101,102,116,187,7040,105,103,104,116,187,7101,101,228,7133,256,99,105,7169,7175,111,110,105,110,244,503,110,116,59,25137,108,99,116,121,59,25389,2432,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,7224,7227,7231,7261,7273,7285,7306,7326,7340,7351,7419,7423,7437,7547,7569,7595,7611,7622,7629,114,242,897,97,114,59,26981,512,103,108,114,115,7240,7245,7250,7252,103,101,114,59,24608,101,116,104,59,24888,242,4403,104,256,59,118,7258,7259,24592,187,2314,363,7265,7271,97,114,111,119,59,26895,97,227,789,256,97,121,7278,7283,114,111,110,59,16655,59,17460,384,59,97,111,818,7292,7300,256,103,114,703,7297,114,59,25034,116,115,101,113,59,27255,384,103,108,109,7313,7316,7320,32827,176,16560,116,97,59,17332,112,116,121,118,59,27057,256,105,114,7331,7336,115,104,116,59,27007,59,49152,55349,56609,97,114,256,108,114,7347,7349,187,2268,187,4126,640,97,101,103,115,118,7362,888,7382,7388,7392,109,384,59,111,115,806,7370,7380,110,100,256,59,115,806,7377,117,105,116,59,26214,97,109,109,97,59,17373,105,110,59,25330,384,59,105,111,7399,7400,7416,16631,100,101,33024,247,59,111,7399,7408,110,116,105,109,101,115,59,25287,110,248,7415,99,121,59,17490,99,623,7430,0,0,7434,114,110,59,25374,111,112,59,25357,640,108,112,116,117,119,7448,7453,7458,7497,7509,108,97,114,59,16420,102,59,49152,55349,56661,640,59,101,109,112,115,779,7469,7479,7485,7490,113,256,59,100,850,7475,111,116,59,25169,105,110,117,115,59,25144,108,117,115,59,25108,113,117,97,114,101,59,25249,98,108,101,98,97,114,119,101,100,103,229,250,110,384,97,100,104,4398,7517,7527,111,119,110,97,114,114,111,119,243,7299,97,114,112,111,111,110,256,108,114,7538,7542,101,102,244,7348,105,103,104,244,7350,354,7551,7557,107,97,114,111,247,3906,623,7562,0,0,7566,114,110,59,25375,111,112,59,25356,384,99,111,116,7576,7587,7590,256,114,121,7581,7585,59,49152,55349,56505,59,17493,108,59,27126,114,111,107,59,16657,256,100,114,7600,7604,111,116,59,25329,105,256,59,102,7610,6166,26047,256,97,104,7616,7619,114,242,1065,97,242,4006,97,110,103,108,101,59,27046,256,99,105,7634,7637,121,59,17503,103,114,97,114,114,59,26623,2304,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,7681,7689,7705,7736,1400,7740,7753,7777,7806,7845,7855,7869,7905,7978,7991,8004,8014,8026,256,68,111,7686,7476,111,244,7305,256,99,115,7694,7700,117,116,101,32827,233,16617,116,101,114,59,27246,512,97,105,111,121,7714,7719,7729,7734,114,111,110,59,16667,114,256,59,99,7725,7726,25174,32827,234,16618,108,111,110,59,25173,59,17485,111,116,59,16663,256,68,114,7745,7749,111,116,59,25170,59,49152,55349,56610,384,59,114,115,7760,7761,7767,27290,97,118,101,32827,232,16616,256,59,100,7772,7773,27286,111,116,59,27288,512,59,105,108,115,7786,7787,7794,7796,27289,110,116,101,114,115,59,25575,59,24851,256,59,100,7801,7802,27285,111,116,59,27287,384,97,112,115,7813,7817,7831,99,114,59,16659,116,121,384,59,115,118,7826,7827,7829,25093,101,116,187,7827,112,256,49,59,7837,7844,307,7841,7843,59,24580,59,24581,24579,256,103,115,7850,7852,59,16715,112,59,24578,256,103,112,7860,7864,111,110,59,16665,102,59,49152,55349,56662,384,97,108,115,7876,7886,7890,114,256,59,115,7882,7883,25301,108,59,27107,117,115,59,27249,105,384,59,108,118,7898,7899,7903,17333,111,110,187,7899,59,17397,512,99,115,117,118,7914,7923,7947,7971,256,105,111,7919,7729,114,99,187,7726,617,7929,0,0,7931,237,1352,97,110,116,256,103,108,7938,7942,116,114,187,7773,101,115,115,187,7802,384,97,101,105,7954,7958,7962,108,115,59,16445,115,116,59,25183,118,256,59,68,565,7968,68,59,27256,112,97,114,115,108,59,27109,256,68,97,7983,7987,111,116,59,25171,114,114,59,26993,384,99,100,105,7998,8001,7928,114,59,24879,111,244,850,256,97,104,8009,8011,59,17335,32827,240,16624,256,109,114,8019,8023,108,32827,235,16619,111,59,24748,384,99,105,112,8033,8036,8039,108,59,16417,115,244,1390,256,101,111,8044,8052,99,116,97,116,105,111,238,1369,110,101,110,116,105,97,108,229,1401,2529,8082,0,8094,0,8097,8103,0,0,8134,8140,0,8147,0,8166,8170,8192,0,8200,8282,108,108,105,110,103,100,111,116,115,101,241,7748,121,59,17476,109,97,108,101,59,26176,384,105,108,114,8109,8115,8129,108,105,103,59,32768,64259,617,8121,0,0,8125,103,59,32768,64256,105,103,59,32768,64260,59,49152,55349,56611,108,105,103,59,32768,64257,108,105,103,59,49152,102,106,384,97,108,116,8153,8156,8161,116,59,26221,105,103,59,32768,64258,110,115,59,26033,111,102,59,16786,496,8174,0,8179,102,59,49152,55349,56663,256,97,107,1471,8183,256,59,118,8188,8189,25300,59,27353,97,114,116,105,110,116,59,27149,256,97,111,8204,8277,256,99,115,8209,8274,945,8218,8240,8248,8261,8264,0,8272,946,8226,8229,8231,8234,8236,0,8238,32827,189,16573,59,24915,32827,188,16572,59,24917,59,24921,59,24923,435,8244,0,8246,59,24916,59,24918,692,8254,8257,0,0,8259,32827,190,16574,59,24919,59,24924,53,59,24920,438,8268,0,8270,59,24922,59,24925,56,59,24926,108,59,24644,119,110,59,25378,99,114,59,49152,55349,56507,2176,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,8322,8329,8351,8357,8368,8372,8432,8437,8442,8447,8451,8466,8504,791,8510,8530,8606,256,59,108,1613,8327,59,27276,384,99,109,112,8336,8341,8349,117,116,101,59,16885,109,97,256,59,100,8348,7386,17331,59,27270,114,101,118,101,59,16671,256,105,121,8362,8366,114,99,59,16669,59,17459,111,116,59,16673,512,59,108,113,115,1598,1602,8381,8393,384,59,113,115,1598,1612,8388,108,97,110,244,1637,512,59,99,100,108,1637,8402,8405,8421,99,59,27305,111,116,256,59,111,8412,8413,27264,256,59,108,8418,8419,27266,59,27268,256,59,101,8426,8429,49152,8923,65024,115,59,27284,114,59,49152,55349,56612,256,59,103,1651,1563,109,101,108,59,24887,99,121,59,17491,512,59,69,97,106,1626,8460,8462,8464,59,27282,59,27301,59,27300,512,69,97,101,115,8475,8477,8489,8500,59,25193,112,256,59,112,8483,8484,27274,114,111,120,187,8484,256,59,113,8494,8495,27272,256,59,113,8494,8475,105,109,59,25319,112,102,59,49152,55349,56664,256,99,105,8515,8518,114,59,24842,109,384,59,101,108,1643,8526,8528,59,27278,59,27280,33536,62,59,99,100,108,113,114,1518,8544,8554,8558,8563,8569,256,99,105,8549,8551,59,27303,114,59,27258,111,116,59,25303,80,97,114,59,27029,117,101,115,116,59,27260,640,97,100,101,108,115,8580,8554,8592,1622,8603,496,8585,0,8590,112,114,111,248,8350,114,59,27e3,113,256,108,113,1599,8598,108,101,115,243,8328,105,237,1643,256,101,110,8611,8621,114,116,110,101,113,113,59,49152,8809,65024,197,8618,1280,65,97,98,99,101,102,107,111,115,121,8644,8647,8689,8693,8698,8728,8733,8751,8808,8829,114,242,928,512,105,108,109,114,8656,8660,8663,8667,114,115,240,5252,102,187,8228,105,108,244,1705,256,100,114,8672,8676,99,121,59,17482,384,59,99,119,2292,8683,8687,105,114,59,26952,59,25005,97,114,59,24847,105,114,99,59,16677,384,97,108,114,8705,8718,8723,114,116,115,256,59,117,8713,8714,26213,105,116,187,8714,108,105,112,59,24614,99,111,110,59,25273,114,59,49152,55349,56613,115,256,101,119,8739,8745,97,114,111,119,59,26917,97,114,111,119,59,26918,640,97,109,111,112,114,8762,8766,8771,8798,8803,114,114,59,25087,116,104,116,59,25147,107,256,108,114,8777,8787,101,102,116,97,114,114,111,119,59,25001,105,103,104,116,97,114,114,111,119,59,25002,102,59,49152,55349,56665,98,97,114,59,24597,384,99,108,116,8815,8820,8824,114,59,49152,55349,56509,97,115,232,8692,114,111,107,59,16679,256,98,112,8834,8839,117,108,108,59,24643,104,101,110,187,7259,2785,8867,0,8874,0,8888,8901,8910,0,8917,8947,0,0,8952,8994,9063,9058,9087,0,9094,9130,9140,99,117,116,101,32827,237,16621,384,59,105,121,1905,8880,8885,114,99,32827,238,16622,59,17464,256,99,120,8892,8895,121,59,17461,99,108,32827,161,16545,256,102,114,927,8905,59,49152,55349,56614,114,97,118,101,32827,236,16620,512,59,105,110,111,1854,8925,8937,8942,256,105,110,8930,8934,110,116,59,27148,116,59,25133,102,105,110,59,27100,116,97,59,24873,108,105,103,59,16691,384,97,111,112,8958,8986,8989,384,99,103,116,8965,8968,8983,114,59,16683,384,101,108,112,1823,8975,8979,105,110,229,1934,97,114,244,1824,104,59,16689,102,59,25271,101,100,59,16821,640,59,99,102,111,116,1268,9004,9009,9021,9025,97,114,101,59,24837,105,110,256,59,116,9016,9017,25118,105,101,59,27101,100,111,244,8985,640,59,99,101,108,112,1879,9036,9040,9051,9057,97,108,59,25274,256,103,114,9045,9049,101,114,243,5475,227,9037,97,114,104,107,59,27159,114,111,100,59,27196,512,99,103,112,116,9071,9074,9078,9083,121,59,17489,111,110,59,16687,102,59,49152,55349,56666,97,59,17337,117,101,115,116,32827,191,16575,256,99,105,9098,9103,114,59,49152,55349,56510,110,640,59,69,100,115,118,1268,9115,9117,9121,1267,59,25337,111,116,59,25333,256,59,118,9126,9127,25332,59,25331,256,59,105,1911,9134,108,100,101,59,16681,491,9144,0,9148,99,121,59,17494,108,32827,239,16623,768,99,102,109,111,115,117,9164,9175,9180,9185,9191,9205,256,105,121,9169,9173,114,99,59,16693,59,17465,114,59,49152,55349,56615,97,116,104,59,16951,112,102,59,49152,55349,56667,483,9196,0,9201,114,59,49152,55349,56511,114,99,121,59,17496,107,99,121,59,17492,1024,97,99,102,103,104,106,111,115,9227,9238,9250,9255,9261,9265,9269,9275,112,112,97,256,59,118,9235,9236,17338,59,17392,256,101,121,9243,9248,100,105,108,59,16695,59,17466,114,59,49152,55349,56616,114,101,101,110,59,16696,99,121,59,17477,99,121,59,17500,112,102,59,49152,55349,56668,99,114,59,49152,55349,56512,2944,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,9328,9345,9350,9357,9361,9486,9533,9562,9600,9806,9822,9829,9849,9853,9882,9906,9944,10077,10088,10123,10176,10241,10258,384,97,114,116,9335,9338,9340,114,242,2502,242,917,97,105,108,59,26907,97,114,114,59,26894,256,59,103,2452,9355,59,27275,97,114,59,26978,2403,9381,0,9386,0,9393,0,0,0,0,0,9397,9402,0,9414,9416,9421,0,9465,117,116,101,59,16698,109,112,116,121,118,59,27060,114,97,238,2124,98,100,97,59,17339,103,384,59,100,108,2190,9409,9411,59,27025,229,2190,59,27269,117,111,32827,171,16555,114,1024,59,98,102,104,108,112,115,116,2201,9438,9446,9449,9451,9454,9457,9461,256,59,102,2205,9443,115,59,26911,115,59,26909,235,8786,112,59,25003,108,59,26937,105,109,59,26995,108,59,24994,384,59,97,101,9471,9472,9476,27307,105,108,59,26905,256,59,115,9481,9482,27309,59,49152,10925,65024,384,97,98,114,9493,9497,9501,114,114,59,26892,114,107,59,26482,256,97,107,9506,9516,99,256,101,107,9512,9514,59,16507,59,16475,256,101,115,9521,9523,59,27019,108,256,100,117,9529,9531,59,27023,59,27021,512,97,101,117,121,9542,9547,9558,9560,114,111,110,59,16702,256,100,105,9552,9556,105,108,59,16700,236,2224,226,9513,59,17467,512,99,113,114,115,9571,9574,9581,9597,97,59,26934,117,111,256,59,114,3609,5958,256,100,117,9586,9591,104,97,114,59,26983,115,104,97,114,59,26955,104,59,25010,640,59,102,103,113,115,9611,9612,2441,9715,9727,25188,116,640,97,104,108,114,116,9624,9636,9655,9666,9704,114,114,111,119,256,59,116,2201,9633,97,233,9462,97,114,112,111,111,110,256,100,117,9647,9652,111,119,110,187,1114,112,187,2406,101,102,116,97,114,114,111,119,115,59,25031,105,103,104,116,384,97,104,115,9677,9686,9694,114,114,111,119,256,59,115,2292,2215,97,114,112,111,111,110,243,3992,113,117,105,103,97,114,114,111,247,8688,104,114,101,101,116,105,109,101,115,59,25291,384,59,113,115,9611,2451,9722,108,97,110,244,2476,640,59,99,100,103,115,2476,9738,9741,9757,9768,99,59,27304,111,116,256,59,111,9748,9749,27263,256,59,114,9754,9755,27265,59,27267,256,59,101,9762,9765,49152,8922,65024,115,59,27283,640,97,100,101,103,115,9779,9785,9789,9801,9803,112,112,114,111,248,9414,111,116,59,25302,113,256,103,113,9795,9797,244,2441,103,116,242,9356,244,2459,105,237,2482,384,105,108,114,9813,2273,9818,115,104,116,59,27004,59,49152,55349,56617,256,59,69,2460,9827,59,27281,353,9833,9846,114,256,100,117,9650,9838,256,59,108,2405,9843,59,26986,108,107,59,25988,99,121,59,17497,640,59,97,99,104,116,2632,9864,9867,9873,9878,114,242,9665,111,114,110,101,242,7432,97,114,100,59,26987,114,105,59,26106,256,105,111,9887,9892,100,111,116,59,16704,117,115,116,256,59,97,9900,9901,25520,99,104,101,187,9901,512,69,97,101,115,9915,9917,9929,9940,59,25192,112,256,59,112,9923,9924,27273,114,111,120,187,9924,256,59,113,9934,9935,27271,256,59,113,9934,9915,105,109,59,25318,1024,97,98,110,111,112,116,119,122,9961,9972,9975,10010,10031,10049,10055,10064,256,110,114,9966,9969,103,59,26604,114,59,25085,114,235,2241,103,384,108,109,114,9983,9997,10004,101,102,116,256,97,114,2534,9991,105,103,104,116,225,2546,97,112,115,116,111,59,26620,105,103,104,116,225,2557,112,97,114,114,111,119,256,108,114,10021,10025,101,102,244,9453,105,103,104,116,59,25004,384,97,102,108,10038,10041,10045,114,59,27013,59,49152,55349,56669,117,115,59,27181,105,109,101,115,59,27188,353,10059,10063,115,116,59,25111,225,4942,384,59,101,102,10071,10072,6144,26058,110,103,101,187,10072,97,114,256,59,108,10084,10085,16424,116,59,27027,640,97,99,104,109,116,10099,10102,10108,10117,10119,114,242,2216,111,114,110,101,242,7564,97,114,256,59,100,3992,10115,59,26989,59,24590,114,105,59,25279,768,97,99,104,105,113,116,10136,10141,2624,10146,10158,10171,113,117,111,59,24633,114,59,49152,55349,56513,109,384,59,101,103,2482,10154,10156,59,27277,59,27279,256,98,117,9514,10163,111,256,59,114,3615,10169,59,24602,114,111,107,59,16706,33792,60,59,99,100,104,105,108,113,114,2091,10194,9785,10204,10208,10213,10218,10224,256,99,105,10199,10201,59,27302,114,59,27257,114,101,229,9714,109,101,115,59,25289,97,114,114,59,26998,117,101,115,116,59,27259,256,80,105,10229,10233,97,114,59,27030,384,59,101,102,10240,2349,6171,26051,114,256,100,117,10247,10253,115,104,97,114,59,26954,104,97,114,59,26982,256,101,110,10263,10273,114,116,110,101,113,113,59,49152,8808,65024,197,10270,1792,68,97,99,100,101,102,104,105,108,110,111,112,115,117,10304,10309,10370,10382,10387,10400,10405,10408,10458,10466,10468,2691,10483,10498,68,111,116,59,25146,512,99,108,112,114,10318,10322,10339,10365,114,32827,175,16559,256,101,116,10327,10329,59,26178,256,59,101,10334,10335,26400,115,101,187,10335,256,59,115,4155,10344,116,111,512,59,100,108,117,4155,10355,10359,10363,111,119,238,1164,101,102,244,2319,240,5073,107,101,114,59,26030,256,111,121,10375,10380,109,109,97,59,27177,59,17468,97,115,104,59,24596,97,115,117,114,101,100,97,110,103,108,101,187,5670,114,59,49152,55349,56618,111,59,24871,384,99,100,110,10415,10420,10441,114,111,32827,181,16565,512,59,97,99,100,5220,10429,10432,10436,115,244,5799,105,114,59,27376,111,116,32955,183,437,117,115,384,59,98,100,10450,6403,10451,25106,256,59,117,7484,10456,59,27178,355,10462,10465,112,59,27355,242,8722,240,2689,256,100,112,10473,10478,101,108,115,59,25255,102,59,49152,55349,56670,256,99,116,10488,10493,114,59,49152,55349,56514,112,111,115,187,5533,384,59,108,109,10505,10506,10509,17340,116,105,109,97,112,59,25272,3072,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,10562,10579,10622,10633,10648,10714,10729,10773,10778,10840,10845,10883,10901,10916,10920,11012,11015,11076,11135,11182,11316,11367,11388,11497,256,103,116,10567,10571,59,49152,8921,824,256,59,118,10576,3023,49152,8811,8402,384,101,108,116,10586,10610,10614,102,116,256,97,114,10593,10599,114,114,111,119,59,25037,105,103,104,116,97,114,114,111,119,59,25038,59,49152,8920,824,256,59,118,10619,3143,49152,8810,8402,105,103,104,116,97,114,114,111,119,59,25039,256,68,100,10638,10643,97,115,104,59,25263,97,115,104,59,25262,640,98,99,110,112,116,10659,10663,10668,10673,10700,108,97,187,734,117,116,101,59,16708,103,59,49152,8736,8402,640,59,69,105,111,112,3460,10684,10688,10693,10696,59,49152,10864,824,100,59,49152,8779,824,115,59,16713,114,111,248,3460,117,114,256,59,97,10707,10708,26222,108,256,59,115,10707,2872,499,10719,0,10723,112,32955,160,2871,109,112,256,59,101,3065,3072,640,97,101,111,117,121,10740,10750,10755,10768,10771,496,10745,0,10747,59,27203,111,110,59,16712,100,105,108,59,16710,110,103,256,59,100,3454,10762,111,116,59,49152,10861,824,112,59,27202,59,17469,97,115,104,59,24595,896,59,65,97,100,113,115,120,2962,10793,10797,10811,10817,10821,10832,114,114,59,25047,114,256,104,114,10803,10806,107,59,26916,256,59,111,5106,5104,111,116,59,49152,8784,824,117,105,246,2915,256,101,105,10826,10830,97,114,59,26920,237,2968,105,115,116,256,59,115,2976,2975,114,59,49152,55349,56619,512,69,101,115,116,3013,10854,10873,10876,384,59,113,115,3004,10861,3041,384,59,113,115,3004,3013,10868,108,97,110,244,3042,105,237,3050,256,59,114,2998,10881,187,2999,384,65,97,112,10890,10893,10897,114,242,10609,114,114,59,25006,97,114,59,27378,384,59,115,118,3981,10908,3980,256,59,100,10913,10914,25340,59,25338,99,121,59,17498,896,65,69,97,100,101,115,116,10935,10938,10942,10946,10949,10998,11001,114,242,10598,59,49152,8806,824,114,114,59,24986,114,59,24613,512,59,102,113,115,3131,10958,10979,10991,116,256,97,114,10964,10969,114,114,111,247,10945,105,103,104,116,97,114,114,111,247,10896,384,59,113,115,3131,10938,10986,108,97,110,244,3157,256,59,115,3157,10996,187,3126,105,237,3165,256,59,114,3125,11006,105,256,59,101,3098,3109,105,228,3472,256,112,116,11020,11025,102,59,49152,55349,56671,33152,172,59,105,110,11033,11034,11062,16556,110,512,59,69,100,118,2953,11044,11048,11054,59,49152,8953,824,111,116,59,49152,8949,824,481,2953,11059,11061,59,25335,59,25334,105,256,59,118,3256,11068,481,3256,11073,11075,59,25342,59,25341,384,97,111,114,11083,11107,11113,114,512,59,97,115,116,2939,11093,11098,11103,108,108,101,236,2939,108,59,49152,11005,8421,59,49152,8706,824,108,105,110,116,59,27156,384,59,99,101,3218,11120,11123,117,229,3237,256,59,99,3224,11128,256,59,101,3218,11133,241,3224,512,65,97,105,116,11144,11147,11165,11175,114,242,10632,114,114,384,59,99,119,11156,11157,11161,24987,59,49152,10547,824,59,49152,8605,824,103,104,116,97,114,114,111,119,187,11157,114,105,256,59,101,3275,3286,896,99,104,105,109,112,113,117,11197,11213,11225,11012,2936,11236,11247,512,59,99,101,114,3378,11206,3383,11209,117,229,3397,59,49152,55349,56515,111,114,116,621,11013,0,0,11222,97,114,225,11094,109,256,59,101,3438,11231,256,59,113,3444,3443,115,117,256,98,112,11243,11245,229,3320,229,3339,384,98,99,112,11254,11281,11289,512,59,69,101,115,11263,11264,3362,11268,25220,59,49152,10949,824,101,116,256,59,101,3355,11275,113,256,59,113,3363,11264,99,256,59,101,3378,11287,241,3384,512,59,69,101,115,11298,11299,3423,11303,25221,59,49152,10950,824,101,116,256,59,101,3416,11310,113,256,59,113,3424,11299,512,103,105,108,114,11325,11327,11333,11335,236,3031,108,100,101,32827,241,16625,231,3139,105,97,110,103,108,101,256,108,114,11346,11356,101,102,116,256,59,101,3098,11354,241,3110,105,103,104,116,256,59,101,3275,11365,241,3287,256,59,109,11372,11373,17341,384,59,101,115,11380,11381,11385,16419,114,111,59,24854,112,59,24583,1152,68,72,97,100,103,105,108,114,115,11407,11412,11417,11422,11427,11440,11446,11475,11491,97,115,104,59,25261,97,114,114,59,26884,112,59,49152,8781,8402,97,115,104,59,25260,256,101,116,11432,11436,59,49152,8805,8402,59,49152,62,8402,110,102,105,110,59,27102,384,65,101,116,11453,11457,11461,114,114,59,26882,59,49152,8804,8402,256,59,114,11466,11469,49152,60,8402,105,101,59,49152,8884,8402,256,65,116,11480,11484,114,114,59,26883,114,105,101,59,49152,8885,8402,105,109,59,49152,8764,8402,384,65,97,110,11504,11508,11522,114,114,59,25046,114,256,104,114,11514,11517,107,59,26915,256,59,111,5095,5093,101,97,114,59,26919,4691,6805,0,0,0,0,0,0,0,0,0,0,0,0,0,11565,0,11576,11592,11616,11621,11634,11652,6919,0,0,11661,11691,0,11720,11726,0,11740,11801,11819,11838,11843,256,99,115,11569,6807,117,116,101,32827,243,16627,256,105,121,11580,11589,114,256,59,99,6814,11586,32827,244,16628,59,17470,640,97,98,105,111,115,6816,11602,11607,456,11610,108,97,99,59,16721,118,59,27192,111,108,100,59,27068,108,105,103,59,16723,256,99,114,11625,11629,105,114,59,27071,59,49152,55349,56620,879,11641,0,0,11644,0,11650,110,59,17115,97,118,101,32827,242,16626,59,27073,256,98,109,11656,3572,97,114,59,27061,512,97,99,105,116,11669,11672,11685,11688,114,242,6784,256,105,114,11677,11680,114,59,27070,111,115,115,59,27067,110,229,3666,59,27072,384,97,101,105,11697,11701,11705,99,114,59,16717,103,97,59,17353,384,99,100,110,11712,11717,461,114,111,110,59,17343,59,27062,112,102,59,49152,55349,56672,384,97,101,108,11732,11735,466,114,59,27063,114,112,59,27065,896,59,97,100,105,111,115,118,11754,11755,11758,11784,11789,11792,11798,25128,114,242,6790,512,59,101,102,109,11767,11768,11778,11781,27229,114,256,59,111,11774,11775,24884,102,187,11775,32827,170,16554,32827,186,16570,103,111,102,59,25270,114,59,27222,108,111,112,101,59,27223,59,27227,384,99,108,111,11807,11809,11815,242,11777,97,115,104,32827,248,16632,108,59,25240,105,364,11823,11828,100,101,32827,245,16629,101,115,256,59,97,475,11834,115,59,27190,109,108,32827,246,16630,98,97,114,59,25405,2785,11870,0,11901,0,11904,11933,0,11938,11961,0,0,11979,3740,0,12051,0,0,12075,12220,0,12232,114,512,59,97,115,116,1027,11879,11890,3717,33024,182,59,108,11885,11886,16566,108,101,236,1027,617,11896,0,0,11899,109,59,27379,59,27389,121,59,17471,114,640,99,105,109,112,116,11915,11919,11923,6245,11927,110,116,59,16421,111,100,59,16430,105,108,59,24624,101,110,107,59,24625,114,59,49152,55349,56621,384,105,109,111,11944,11952,11956,256,59,118,11949,11950,17350,59,17365,109,97,244,2678,110,101,59,26126,384,59,116,118,11967,11968,11976,17344,99,104,102,111,114,107,187,8189,59,17366,256,97,117,11983,11999,110,256,99,107,11989,11997,107,256,59,104,8692,11995,59,24846,246,8692,115,1152,59,97,98,99,100,101,109,115,116,12019,12020,6408,12025,12029,12036,12038,12042,12046,16427,99,105,114,59,27171,105,114,59,27170,256,111,117,7488,12034,59,27173,59,27250,110,32955,177,3741,105,109,59,27174,119,111,59,27175,384,105,112,117,12057,12064,12069,110,116,105,110,116,59,27157,102,59,49152,55349,56673,110,100,32827,163,16547,1280,59,69,97,99,101,105,110,111,115,117,3784,12095,12097,12100,12103,12161,12169,12178,12158,12214,59,27315,112,59,27319,117,229,3801,256,59,99,3790,12108,768,59,97,99,101,110,115,3784,12121,12127,12134,12136,12158,112,112,114,111,248,12099,117,114,108,121,101,241,3801,241,3790,384,97,101,115,12143,12150,12154,112,112,114,111,120,59,27321,113,113,59,27317,105,109,59,25320,105,237,3807,109,101,256,59,115,12168,3758,24626,384,69,97,115,12152,12176,12154,240,12149,384,100,102,112,3820,12185,12207,384,97,108,115,12192,12197,12202,108,97,114,59,25390,105,110,101,59,25362,117,114,102,59,25363,256,59,116,3835,12212,239,3835,114,101,108,59,25264,256,99,105,12224,12229,114,59,49152,55349,56517,59,17352,110,99,115,112,59,24584,768,102,105,111,112,115,117,12250,8930,12255,12261,12267,12273,114,59,49152,55349,56622,112,102,59,49152,55349,56674,114,105,109,101,59,24663,99,114,59,49152,55349,56518,384,97,101,111,12280,12297,12307,116,256,101,105,12286,12293,114,110,105,111,110,243,1712,110,116,59,27158,115,116,256,59,101,12304,12305,16447,241,7961,244,3860,2688,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,12352,12369,12373,12377,12512,12558,12587,12615,12642,12658,12686,12806,12821,12836,12841,12888,12910,12914,12944,12976,12983,384,97,114,116,12359,12362,12364,114,242,4275,242,989,97,105,108,59,26908,97,114,242,7269,97,114,59,26980,896,99,100,101,110,113,114,116,12392,12405,12408,12415,12431,12436,12492,256,101,117,12397,12401,59,49152,8765,817,116,101,59,16725,105,227,4462,109,112,116,121,118,59,27059,103,512,59,100,101,108,4049,12425,12427,12429,59,27026,59,27045,229,4049,117,111,32827,187,16571,114,1408,59,97,98,99,102,104,108,112,115,116,119,4060,12460,12463,12471,12473,12476,12478,12480,12483,12487,12490,112,59,26997,256,59,102,4064,12468,115,59,26912,59,26931,115,59,26910,235,8797,240,10030,108,59,26949,105,109,59,26996,108,59,24995,59,24989,256,97,105,12497,12501,105,108,59,26906,111,256,59,110,12507,12508,25142,97,108,243,3870,384,97,98,114,12519,12522,12526,114,242,6117,114,107,59,26483,256,97,107,12531,12541,99,256,101,107,12537,12539,59,16509,59,16477,256,101,115,12546,12548,59,27020,108,256,100,117,12554,12556,59,27022,59,27024,512,97,101,117,121,12567,12572,12583,12585,114,111,110,59,16729,256,100,105,12577,12581,105,108,59,16727,236,4082,226,12538,59,17472,512,99,108,113,115,12596,12599,12605,12612,97,59,26935,100,104,97,114,59,26985,117,111,256,59,114,526,525,104,59,25011,384,97,99,103,12622,12639,3908,108,512,59,105,112,115,3960,12632,12635,4252,110,229,4283,97,114,244,4009,116,59,26029,384,105,108,114,12649,4131,12654,115,104,116,59,27005,59,49152,55349,56623,256,97,111,12663,12678,114,256,100,117,12669,12671,187,1147,256,59,108,4241,12676,59,26988,256,59,118,12683,12684,17345,59,17393,384,103,110,115,12693,12793,12796,104,116,768,97,104,108,114,115,116,12708,12720,12738,12760,12772,12782,114,114,111,119,256,59,116,4060,12717,97,233,12488,97,114,112,111,111,110,256,100,117,12731,12735,111,119,238,12670,112,187,4242,101,102,116,256,97,104,12746,12752,114,114,111,119,243,4074,97,114,112,111,111,110,243,1361,105,103,104,116,97,114,114,111,119,115,59,25033,113,117,105,103,97,114,114,111,247,12491,104,114,101,101,116,105,109,101,115,59,25292,103,59,17114,105,110,103,100,111,116,115,101,241,7986,384,97,104,109,12813,12816,12819,114,242,4074,97,242,1361,59,24591,111,117,115,116,256,59,97,12830,12831,25521,99,104,101,187,12831,109,105,100,59,27374,512,97,98,112,116,12850,12861,12864,12882,256,110,114,12855,12858,103,59,26605,114,59,25086,114,235,4099,384,97,102,108,12871,12874,12878,114,59,27014,59,49152,55349,56675,117,115,59,27182,105,109,101,115,59,27189,256,97,112,12893,12903,114,256,59,103,12899,12900,16425,116,59,27028,111,108,105,110,116,59,27154,97,114,242,12771,512,97,99,104,113,12923,12928,4284,12933,113,117,111,59,24634,114,59,49152,55349,56519,256,98,117,12539,12938,111,256,59,114,532,531,384,104,105,114,12951,12955,12960,114,101,229,12792,109,101,115,59,25290,105,512,59,101,102,108,12970,4185,6177,12971,26041,116,114,105,59,27086,108,117,104,97,114,59,26984,59,24862,3425,13013,13019,13023,13100,13112,13169,0,13178,13220,0,0,13292,13296,0,13352,13384,13402,13485,13489,13514,13553,0,13846,0,0,13875,99,117,116,101,59,16731,113,117,239,10170,1280,59,69,97,99,101,105,110,112,115,121,4589,13043,13045,13055,13058,13067,13071,13087,13094,13097,59,27316,496,13050,0,13052,59,27320,111,110,59,16737,117,229,4606,256,59,100,4595,13063,105,108,59,16735,114,99,59,16733,384,69,97,115,13078,13080,13083,59,27318,112,59,27322,105,109,59,25321,111,108,105,110,116,59,27155,105,237,4612,59,17473,111,116,384,59,98,101,13108,7495,13109,25285,59,27238,896,65,97,99,109,115,116,120,13126,13130,13143,13147,13150,13155,13165,114,114,59,25048,114,256,104,114,13136,13138,235,8744,256,59,111,2614,2612,116,32827,167,16551,105,59,16443,119,97,114,59,26921,109,256,105,110,13161,240,110,117,243,241,116,59,26422,114,256,59,111,13174,8277,49152,55349,56624,512,97,99,111,121,13186,13190,13201,13216,114,112,59,26223,256,104,121,13195,13199,99,121,59,17481,59,17480,114,116,621,13209,0,0,13212,105,228,5220,97,114,97,236,11887,32827,173,16557,256,103,109,13224,13236,109,97,384,59,102,118,13233,13234,13234,17347,59,17346,1024,59,100,101,103,108,110,112,114,4779,13253,13257,13262,13270,13278,13281,13286,111,116,59,27242,256,59,113,4785,4784,256,59,69,13267,13268,27294,59,27296,256,59,69,13275,13276,27293,59,27295,101,59,25158,108,117,115,59,27172,97,114,114,59,26994,97,114,242,4413,512,97,101,105,116,13304,13320,13327,13335,256,108,115,13309,13316,108,115,101,116,109,233,13162,104,112,59,27187,112,97,114,115,108,59,27108,256,100,108,5219,13332,101,59,25379,256,59,101,13340,13341,27306,256,59,115,13346,13347,27308,59,49152,10924,65024,384,102,108,112,13358,13363,13378,116,99,121,59,17484,256,59,98,13368,13369,16431,256,59,97,13374,13375,27076,114,59,25407,102,59,49152,55349,56676,97,256,100,114,13389,1026,101,115,256,59,117,13396,13397,26208,105,116,187,13397,384,99,115,117,13408,13433,13471,256,97,117,13413,13423,112,256,59,115,4488,13419,59,49152,8851,65024,112,256,59,115,4532,13429,59,49152,8852,65024,117,256,98,112,13439,13455,384,59,101,115,4503,4508,13446,101,116,256,59,101,4503,13453,241,4509,384,59,101,115,4520,4525,13462,101,116,256,59,101,4520,13469,241,4526,384,59,97,102,4475,13478,1456,114,357,13483,1457,187,4476,97,114,242,4424,512,99,101,109,116,13497,13502,13506,13509,114,59,49152,55349,56520,116,109,238,241,105,236,13333,97,114,230,4542,256,97,114,13518,13525,114,256,59,102,13524,6079,26118,256,97,110,13530,13549,105,103,104,116,256,101,112,13539,13546,112,115,105,108,111,238,7904,104,233,11951,115,187,10322,640,98,99,109,110,112,13563,13662,4617,13707,13710,1152,59,69,100,101,109,110,112,114,115,13582,13583,13585,13589,13598,13603,13612,13617,13622,25218,59,27333,111,116,59,27325,256,59,100,4570,13594,111,116,59,27331,117,108,116,59,27329,256,69,101,13608,13610,59,27339,59,25226,108,117,115,59,27327,97,114,114,59,27001,384,101,105,117,13629,13650,13653,116,384,59,101,110,13582,13637,13643,113,256,59,113,4570,13583,101,113,256,59,113,13611,13608,109,59,27335,256,98,112,13658,13660,59,27349,59,27347,99,768,59,97,99,101,110,115,4589,13676,13682,13689,13691,13094,112,112,114,111,248,13050,117,114,108,121,101,241,4606,241,4595,384,97,101,115,13698,13704,13083,112,112,114,111,248,13082,113,241,13079,103,59,26218,1664,49,50,51,59,69,100,101,104,108,109,110,112,115,13737,13740,13743,4636,13746,13748,13760,13769,13781,13786,13791,13800,13805,32827,185,16569,32827,178,16562,32827,179,16563,59,27334,256,111,115,13753,13756,116,59,27326,117,98,59,27352,256,59,100,4642,13765,111,116,59,27332,115,256,111,117,13775,13778,108,59,26569,98,59,27351,97,114,114,59,27003,117,108,116,59,27330,256,69,101,13796,13798,59,27340,59,25227,108,117,115,59,27328,384,101,105,117,13812,13833,13836,116,384,59,101,110,4636,13820,13826,113,256,59,113,4642,13746,101,113,256,59,113,13799,13796,109,59,27336,256,98,112,13841,13843,59,27348,59,27350,384,65,97,110,13852,13856,13869,114,114,59,25049,114,256,104,114,13862,13864,235,8750,256,59,111,2603,2601,119,97,114,59,26922,108,105,103,32827,223,16607,3041,13905,13917,13920,4814,13939,13945,0,13950,14018,0,0,0,0,0,14043,14083,0,14089,14188,0,0,0,14215,626,13910,0,0,13915,103,101,116,59,25366,59,17348,114,235,3679,384,97,101,121,13926,13931,13936,114,111,110,59,16741,100,105,108,59,16739,59,17474,108,114,101,99,59,25365,114,59,49152,55349,56625,512,101,105,107,111,13958,13981,14005,14012,498,13963,0,13969,101,256,52,102,4740,4737,97,384,59,115,118,13976,13977,13979,17336,121,109,59,17361,256,99,110,13986,14002,107,256,97,115,13992,13998,112,112,114,111,248,4801,105,109,187,4780,115,240,4766,256,97,115,14010,13998,240,4801,114,110,32827,254,16638,492,799,14022,8935,101,115,33152,215,59,98,100,14031,14032,14040,16599,256,59,97,6415,14037,114,59,27185,59,27184,384,101,112,115,14049,14051,14080,225,10829,512,59,98,99,102,1158,14060,14064,14068,111,116,59,25398,105,114,59,27377,256,59,111,14073,14076,49152,55349,56677,114,107,59,27354,225,13154,114,105,109,101,59,24628,384,97,105,112,14095,14098,14180,100,229,4680,896,97,100,101,109,112,115,116,14113,14157,14144,14161,14167,14172,14175,110,103,108,101,640,59,100,108,113,114,14128,14129,14134,14144,14146,26037,111,119,110,187,7611,101,102,116,256,59,101,10240,14142,241,2350,59,25180,105,103,104,116,256,59,101,12970,14155,241,4186,111,116,59,26092,105,110,117,115,59,27194,108,117,115,59,27193,98,59,27085,105,109,101,59,27195,101,122,105,117,109,59,25570,384,99,104,116,14194,14205,14209,256,114,121,14199,14203,59,49152,55349,56521,59,17478,99,121,59,17499,114,111,107,59,16743,256,105,111,14219,14222,120,244,6007,104,101,97,100,256,108,114,14231,14240,101,102,116,97,114,114,111,247,2127,105,103,104,116,97,114,114,111,119,187,3933,2304,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,14288,14291,14295,14308,14320,14332,14350,14364,14371,14388,14417,14429,14443,14505,14540,14546,14570,14582,114,242,1005,97,114,59,26979,256,99,114,14300,14306,117,116,101,32827,250,16634,242,4432,114,483,14314,0,14317,121,59,17502,118,101,59,16749,256,105,121,14325,14330,114,99,32827,251,16635,59,17475,384,97,98,104,14339,14342,14347,114,242,5037,108,97,99,59,16753,97,242,5059,256,105,114,14355,14360,115,104,116,59,27006,59,49152,55349,56626,114,97,118,101,32827,249,16633,353,14375,14385,114,256,108,114,14380,14382,187,2391,187,4227,108,107,59,25984,256,99,116,14393,14413,623,14399,0,0,14410,114,110,256,59,101,14405,14406,25372,114,187,14406,111,112,59,25359,114,105,59,26104,256,97,108,14422,14426,99,114,59,16747,32955,168,841,256,103,112,14434,14438,111,110,59,16755,102,59,49152,55349,56678,768,97,100,104,108,115,117,4427,14456,14461,4978,14481,14496,111,119,110,225,5043,97,114,112,111,111,110,256,108,114,14472,14476,101,102,244,14381,105,103,104,244,14383,105,384,59,104,108,14489,14490,14492,17349,187,5114,111,110,187,14490,112,97,114,114,111,119,115,59,25032,384,99,105,116,14512,14532,14536,623,14518,0,0,14529,114,110,256,59,101,14524,14525,25373,114,187,14525,111,112,59,25358,110,103,59,16751,114,105,59,26105,99,114,59,49152,55349,56522,384,100,105,114,14553,14557,14562,111,116,59,25328,108,100,101,59,16745,105,256,59,102,14128,14568,187,6163,256,97,109,14575,14578,114,242,14504,108,32827,252,16636,97,110,103,108,101,59,27047,1920,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,14620,14623,14633,14637,14773,14776,14781,14815,14820,14824,14835,14841,14845,14849,14880,114,242,1015,97,114,256,59,118,14630,14631,27368,59,27369,97,115,232,993,256,110,114,14642,14647,103,114,116,59,27036,896,101,107,110,112,114,115,116,13539,14662,14667,14674,14685,14692,14742,97,112,112,225,9237,111,116,104,105,110,231,7830,384,104,105,114,13547,11976,14681,111,112,244,12213,256,59,104,5047,14690,239,12685,256,105,117,14697,14701,103,109,225,13235,256,98,112,14706,14724,115,101,116,110,101,113,256,59,113,14717,14720,49152,8842,65024,59,49152,10955,65024,115,101,116,110,101,113,256,59,113,14735,14738,49152,8843,65024,59,49152,10956,65024,256,104,114,14747,14751,101,116,225,13980,105,97,110,103,108,101,256,108,114,14762,14767,101,102,116,187,2341,105,103,104,116,187,4177,121,59,17458,97,115,104,187,4150,384,101,108,114,14788,14802,14807,384,59,98,101,11754,14795,14799,97,114,59,25275,113,59,25178,108,105,112,59,25326,256,98,116,14812,5224,97,242,5225,114,59,49152,55349,56627,116,114,233,14766,115,117,256,98,112,14831,14833,187,3356,187,3417,112,102,59,49152,55349,56679,114,111,240,3835,116,114,233,14772,256,99,117,14854,14859,114,59,49152,55349,56523,256,98,112,14864,14872,110,256,69,101,14720,14870,187,14718,110,256,69,101,14738,14878,187,14736,105,103,122,97,103,59,27034,896,99,101,102,111,112,114,115,14902,14907,14934,14939,14932,14945,14954,105,114,99,59,16757,256,100,105,14912,14929,256,98,103,14917,14921,97,114,59,27231,101,256,59,113,5626,14927,59,25177,101,114,112,59,24856,114,59,49152,55349,56628,112,102,59,49152,55349,56680,256,59,101,5241,14950,97,116,232,5241,99,114,59,49152,55349,56524,2787,6030,14983,0,14987,0,14992,15003,0,0,15005,15016,15019,15023,0,0,15043,15054,0,15064,6108,6111,116,114,233,6097,114,59,49152,55349,56629,256,65,97,14996,14999,114,242,963,114,242,2550,59,17342,256,65,97,15009,15012,114,242,952,114,242,2539,97,240,10003,105,115,59,25339,384,100,112,116,6052,15029,15038,256,102,108,15034,6057,59,49152,55349,56681,105,109,229,6066,256,65,97,15047,15050,114,242,974,114,242,2561,256,99,113,15058,6072,114,59,49152,55349,56525,256,112,116,6102,15068,114,233,6100,1024,97,99,101,102,105,111,115,117,15088,15101,15112,15116,15121,15125,15131,15137,99,256,117,121,15094,15099,116,101,32827,253,16637,59,17487,256,105,121,15106,15110,114,99,59,16759,59,17483,110,32827,165,16549,114,59,49152,55349,56630,99,121,59,17495,112,102,59,49152,55349,56682,99,114,59,49152,55349,56526,256,99,109,15142,15145,121,59,17486,108,32827,255,16639,1280,97,99,100,101,102,104,105,111,115,119,15170,15176,15188,15192,15204,15209,15213,15220,15226,15232,99,117,116,101,59,16762,256,97,121,15181,15186,114,111,110,59,16766,59,17463,111,116,59,16764,256,101,116,15197,15201,116,114,230,5471,97,59,17334,114,59,49152,55349,56631,99,121,59,17462,103,114,97,114,114,59,25053,112,102,59,49152,55349,56683,99,114,59,49152,55349,56527,256,106,110,15237,15239,59,24589,106,59,24588]);var km=new Uint16Array([512,97,103,108,113,9,21,24,27,621,15,0,0,18,112,59,16422,111,115,59,16423,116,59,16446,116,59,16444,117,111,116,59,16418]);var z0,z_=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Om=(z0=String.fromCodePoint)!==null&&z0!==void 0?z0:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function Lm(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=z_.get(t))!==null&&e!==void 0?e:t}function j0(t){return Om(Lm(t))}var ar;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.To_LOWER_BIT=32]="To_LOWER_BIT"})(ar||(ar={}));var ps;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(ps||(ps={}));function Nm(t){return function(r,i){let n="",s=0,a=0;for(;(a=r.indexOf("&",a))>=0;){if(n+=r.slice(s,a),s=a,a+=1,r.charCodeAt(a)===ar.NUM){let w=a+1,S=10,v=r.charCodeAt(w);(v|ar.To_LOWER_BIT)===ar.LOWER_X&&(S=16,a+=1,w+=1);do v=r.charCodeAt(++a);while(v>=ar.ZERO&&v<=ar.NINE||S===16&&(v|ar.To_LOWER_BIT)>=ar.LOWER_A&&(v|ar.To_LOWER_BIT)<=ar.LOWER_F);if(w!==a){let R=r.substring(w,a),x=parseInt(R,S);if(r.charCodeAt(a)===ar.SEMI)a+=1;else if(i)continue;n+=j0(x),s=a}continue}let c=0,d=1,p=0,m=t[p];for(;a<r.length&&(p=j_(t,m,p+1,r.charCodeAt(a)),!(p<0));a++,d++){m=t[p];let w=m&ps.VALUE_LENGTH;if(w){(!i||r.charCodeAt(a)===ar.SEMI)&&(c=p,d=0);let S=(w>>14)-1;if(S===0)break;p+=S}}if(c!==0){let w=(t[c]&ps.VALUE_LENGTH)>>14;n+=w===1?String.fromCharCode(t[c]&~ps.VALUE_LENGTH):w===2?String.fromCharCode(t[c+1]):String.fromCharCode(t[c+1],t[c+2]),s=a-d+1}}return n+r.slice(s)}}function j_(t,e,r,i){let n=(e&ps.BRANCH_LENGTH)>>7,s=e&ps.JUMP_TABLE;if(n===0)return s!==0&&i===s?r:-1;if(s){let d=i-s;return d<0||d>n?-1:t[r+d]-1}let a=r,c=a+n-1;for(;a<=c;){let d=a+c>>>1,p=t[d];if(p<i)a=d+1;else if(p>i)c=d-1;else return t[d+n]}return-1}var $A=Nm(Im),WA=Nm(km);var q_=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]),U_=String.prototype.codePointAt!=null?(t,e)=>t.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function q0(t,e){return function(i){let n,s=0,a="";for(;n=t.exec(i);)s!==n.index&&(a+=i.substring(s,n.index)),a+=e.get(n[0].charCodeAt(0)),s=n.index+1;return a+i.substring(s)}}var Fu=q0(/[&<>'"]/g,q_),Dm=q0(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),Bm=q0(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]));var zm;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(zm||(zm={}));var jm;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict"})(jm||(jm={}));var qm;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(qm||(qm={}));var Hu=t=>" ".repeat(t),m1=class{toString(e=0){return Hu(e)+"[VNode]"}},ms=class extends m1{constructor(e){super(),this.text=e}toString(e=0){return Hu(e)+this.textContent}get textContent(){return Fu(this.text)}set textContent(e){this.text=e}},zo=class extends m1{constructor(e,r,i){super(),this.tag=e,this.attrs=r,this.children=i}get textContent(){return this.children.length===0?"":this.children.length===1?this.children[0].textContent:this.children.map(e=>e.textContent).join("")}set textContent(e){this.children=[new ms(e)]}toString(e=0){let r=this.toStringAttrs(),i=Hu(e),n=this.toStringChildren(e),s=`${i}<${this.tag}${r}`;return n===""?`${s} />`:`${s}>${n}</${this.tag}>`}*tags(e){this.tag===e&&(yield this);for(let r of this.elementChildren())yield*r.tags(e);return null}find(e,...r){for(let i of this.tags(e)){if(i===this)continue;if(r.length===0)return i;let n=i.find(...r);if(n!=null)return n}return null}*elementChildren(){for(let e of this.children)e instanceof zo&&(yield e);return null}toStringAttrs(){let e=Object.keys(this.attrs);if(e.length===0)return"";let r="";for(let i of e){let n=this.attrs[i];n!=null&&(r+=` ${i}="${n}"`)}return r}toStringChildren(e=0){if(this.children.length===0)return"";if(this.children.length===1){let r=this.children[0];if(r instanceof ms)return r.textContent}return`
136
+ `)}};var Ju,Ip={level:"debug"},Zu={get(){return Ju==null&&(Ju=process.stdout.isTTY?(0,$0.default)(Ip,xn.stream()):(0,$0.default)(Ip)),Ju},set(t){Ju=t},disable(){Zu.get().level="silent"}};var vx=.2,Jo=class{constructor(e){this.tms=e}async tile(e,r,i,n){let o=[];for(let a of e){let h=this.getTiles(a,r,i,n);h!=null&&(o=o.concat(h))}return o}getRasterTiffIntersection(e,r,i,n){let o=this.tms.tileToPixels(r,i),a=new ye(o.x,o.y,this.tms.tileSize,this.tms.tileSize),h=e.images[0].bbox,d=this.tms.sourceToPixels(h[0],h[3],n),m=this.tms.sourceToPixels(h[2],h[1],n),p=ye.fromUpperLeftLowerRight(d,m),M=p.intersection(a);return M==null?null:{tiff:p,intersection:M,tile:a}}createComposition(e,r,i,n,o){let a=ye.fromJson(e.getTileBounds(r,i)),h=a.scale(n,n).add(o.tiff).round(vx),d=h.intersection(o.tile);if(d==null)return null;let m=d.subtract(h);if(m.height<.5||m.width<.5)return null;let p=h.subtract(o.tile),M={tiff:e.tif,source:{x:r,y:i,imageId:e.id,width:a.width,height:a.height},y:Math.max(0,Math.round(p.y)),x:Math.max(0,Math.round(p.x))};if((a.width<e.tileSize.width||a.height<e.tileSize.height)&&(M.extract={width:a.width,height:a.height}),a.width!==h.width||a.height!==h.height){let R=a.width!==h.width?h.width/a.width:h.height/a.height;M.resize={width:h.width,height:h.height,scale:R}}return(m.y!==0||m.x!==0||m.height!==h.height||m.width!==h.width)&&(M.crop=m),M}getTiles(e,r,i,n){let o=this.getRasterTiffIntersection(e,r,i,n);if(o==null)return null;let a=this.tms.pixelScale(n),h=e.getImageByResolution(a),d=a/h.resolution[0],m=o.intersection.subtract(o.tiff),{tileSize:p,tileCount:M}=h,R=[],x=1/d;for(let v of Jo.getRequiredTiles(m,d,p,M)){let E=this.createComposition(h,v.x,v.y,x,o);E!=null&&R.push(E)}return R.length===0?null:R}static*getRequiredTiles(e,r,i,n){let o=Math.max(Math.floor(e.x/i.width*r),0),a=Math.min(Math.ceil(e.right/i.width*r),n.x),h=Math.max(Math.floor(e.y/i.height*r),0),d=Math.min(Math.ceil(e.bottom/i.height*r),n.y);for(let m=o;m<a;m++)for(let p=h;p<d;p++)yield{x:m,y:p}}};var Op=[Ue.Jpeg,Ue.Webp,Ue.Png];function Yu(t){if(t==null)return null;let e=t.toLowerCase();return e===Ue.Png?Ue.Png:e===Ue.Webp?Ue.Webp:e===Ue.Jpeg||e==="jpg"?Ue.Jpeg:e===Ue.Avif?Ue.Avif:null}var ui;(function(t){t.WMTS="WMTS",t.Tile="tile",t.Attribution="attribution"})(ui||(ui={}));function kp(t,e){t.set("tileSet",e.name),e.tileMatrix!=null&&t.set("projection",e.tileMatrix.projection)}function M1(t){var e;let r=_e.parse(t);return r!=null?(e=ln.tryGet(r.code))!==null&&e!==void 0?e:null:ln.find(t)}function Lp(t){if(t.length<5)return null;let e=t[0],r=M1(t[1]);if(r==null)return null;let i=parseInt(t[2],10),n=parseInt(t[3],10),[o,a]=t[4].split(".",2),h=parseInt(o,10);if(isNaN(n)||isNaN(h)||isNaN(i))return null;if(a==="pbf")return{type:ui.Tile,name:e,tileMatrix:r,x:n,y:h,z:i,ext:tr.MapboxVectorTiles};let d=Yu(a);return d==null?null:{type:ui.Tile,name:e,tileMatrix:r,x:n,y:h,z:i,ext:d}}function Np(t){if(t.length<3)return null;let e=t[0],r=M1(t[1]);return r==null?null:{type:ui.Attribution,name:e,tileMatrix:r}}function Bp(t){if(t.length>3)return null;let e=t.length<2?"aerial":t[0];if(t.length===3){let r=M1(t[1]);return r==null?null:{type:ui.WMTS,name:e,tileMatrix:r}}return{type:ui.WMTS,name:e,tileMatrix:null}}var Dp=de(Xn(),1);var wx=24*60*60*1e3,_T=30*wx;var zp=new Uint16Array([7489,60,213,305,650,1181,1403,1488,1653,1758,1954,2006,2063,2634,2705,3489,3693,3849,3878,4298,4648,4833,5141,5277,5315,5343,5413,0,0,0,0,0,0,5483,5837,6541,7186,7645,8062,8288,8624,8845,9152,9211,9282,10276,10514,11528,11848,12238,12310,12986,13881,14252,14590,14888,14961,15072,15150,2048,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,92,98,102,109,115,127,132,139,144,149,152,166,179,185,200,207,108,105,103,32827,198,16582,80,32827,38,16422,99,117,116,101,32827,193,16577,114,101,118,101,59,16642,256,105,121,120,125,114,99,32827,194,16578,59,17424,114,59,49152,55349,56580,114,97,118,101,32827,192,16576,112,104,97,59,17297,97,99,114,59,16640,100,59,27219,256,103,112,157,161,111,110,59,16644,102,59,49152,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,24673,105,110,103,32827,197,16581,256,99,115,190,195,114,59,49152,55349,56476,105,103,110,59,25172,105,108,100,101,32827,195,16579,109,108,32827,196,16580,1024,97,99,101,102,111,114,115,117,229,251,254,279,284,290,295,298,256,99,114,234,242,107,115,108,97,115,104,59,25110,374,246,248,59,27367,101,100,59,25350,121,59,17425,384,99,114,116,261,267,276,97,117,115,101,59,25141,110,111,117,108,108,105,115,59,24876,97,59,17298,114,59,49152,55349,56581,112,102,59,49152,55349,56633,101,118,101,59,17112,99,242,275,109,112,101,113,59,25166,1792,72,79,97,99,100,101,102,104,105,108,111,114,115,117,333,337,342,384,414,418,437,439,442,476,533,627,632,638,99,121,59,17447,80,89,32827,169,16553,384,99,112,121,349,354,378,117,116,101,59,16646,256,59,105,359,360,25298,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,24901,108,101,121,115,59,24877,512,97,101,105,111,393,398,404,408,114,111,110,59,16652,100,105,108,32827,199,16583,114,99,59,16648,110,105,110,116,59,25136,111,116,59,16650,256,100,110,423,429,105,108,108,97,59,16568,116,101,114,68,111,116,59,16567,242,383,105,59,17319,114,99,108,101,512,68,77,80,84,455,459,465,470,111,116,59,25241,105,110,117,115,59,25238,108,117,115,59,25237,105,109,101,115,59,25239,111,256,99,115,482,504,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,25138,101,67,117,114,108,121,256,68,81,515,527,111,117,98,108,101,81,117,111,116,101,59,24605,117,111,116,101,59,24601,512,108,110,112,117,542,552,583,597,111,110,256,59,101,549,550,25143,59,27252,384,103,105,116,559,566,570,114,117,101,110,116,59,25185,110,116,59,25135,111,117,114,73,110,116,101,103,114,97,108,59,25134,256,102,114,588,590,59,24834,111,100,117,99,116,59,25104,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,25139,111,115,115,59,27183,99,114,59,49152,55349,56478,112,256,59,67,644,645,25299,97,112,59,25165,1408,68,74,83,90,97,99,101,102,105,111,115,672,684,688,692,696,715,727,737,742,819,1165,256,59,111,377,677,116,114,97,104,100,59,26897,99,121,59,17410,99,121,59,17413,99,121,59,17423,384,103,114,115,703,708,711,103,101,114,59,24609,114,59,24993,104,118,59,27364,256,97,121,720,725,114,111,110,59,16654,59,17428,108,256,59,116,733,734,25095,97,59,17300,114,59,49152,55349,56583,256,97,102,747,807,256,99,109,752,802,114,105,116,105,99,97,108,512,65,68,71,84,768,774,790,796,99,117,116,101,59,16564,111,372,779,781,59,17113,98,108,101,65,99,117,116,101,59,17117,114,97,118,101,59,16480,105,108,100,101,59,17116,111,110,100,59,25284,102,101,114,101,110,116,105,97,108,68,59,24902,1136,829,0,0,0,834,852,0,1029,102,59,49152,55349,56635,384,59,68,69,840,841,845,16552,111,116,59,24796,113,117,97,108,59,25168,98,108,101,768,67,68,76,82,85,86,867,882,898,975,994,1016,111,110,116,111,117,114,73,110,116,101,103,114,97,236,569,111,628,889,0,0,891,187,841,110,65,114,114,111,119,59,25043,256,101,111,903,932,102,116,384,65,82,84,912,918,929,114,114,111,119,59,25040,105,103,104,116,65,114,114,111,119,59,25044,101,229,714,110,103,256,76,82,939,964,101,102,116,256,65,82,947,953,114,114,111,119,59,26616,105,103,104,116,65,114,114,111,119,59,26618,105,103,104,116,65,114,114,111,119,59,26617,105,103,104,116,256,65,84,984,990,114,114,111,119,59,25042,101,101,59,25256,112,577,1001,0,0,1007,114,114,111,119,59,25041,111,119,110,65,114,114,111,119,59,25045,101,114,116,105,99,97,108,66,97,114,59,25125,110,768,65,66,76,82,84,97,1042,1066,1072,1118,1151,892,114,114,111,119,384,59,66,85,1053,1054,1058,24979,97,114,59,26899,112,65,114,114,111,119,59,25077,114,101,118,101,59,17169,101,102,116,722,1082,0,1094,0,1104,105,103,104,116,86,101,99,116,111,114,59,26960,101,101,86,101,99,116,111,114,59,26974,101,99,116,111,114,256,59,66,1113,1114,25021,97,114,59,26966,105,103,104,116,468,1127,0,1137,101,101,86,101,99,116,111,114,59,26975,101,99,116,111,114,256,59,66,1146,1147,25025,97,114,59,26967,101,101,256,59,65,1158,1159,25252,114,114,111,119,59,24999,256,99,116,1170,1175,114,59,49152,55349,56479,114,111,107,59,16656,2048,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1213,1216,1220,1227,1246,1250,1255,1262,1269,1313,1327,1334,1362,1373,1376,1381,71,59,16714,72,32827,208,16592,99,117,116,101,32827,201,16585,384,97,105,121,1234,1239,1244,114,111,110,59,16666,114,99,32827,202,16586,59,17453,111,116,59,16662,114,59,49152,55349,56584,114,97,118,101,32827,200,16584,101,109,101,110,116,59,25096,256,97,112,1274,1278,99,114,59,16658,116,121,595,1286,0,0,1298,109,97,108,108,83,113,117,97,114,101,59,26107,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,26027,256,103,112,1318,1322,111,110,59,16664,102,59,49152,55349,56636,115,105,108,111,110,59,17301,117,256,97,105,1340,1353,108,256,59,84,1346,1347,27253,105,108,100,101,59,25154,108,105,98,114,105,117,109,59,25036,256,99,105,1367,1370,114,59,24880,109,59,27251,97,59,17303,109,108,32827,203,16587,256,105,112,1386,1391,115,116,115,59,25091,111,110,101,110,116,105,97,108,69,59,24903,640,99,102,105,111,115,1413,1416,1421,1458,1484,121,59,17444,114,59,49152,55349,56585,108,108,101,100,595,1431,0,0,1443,109,97,108,108,83,113,117,97,114,101,59,26108,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,26026,880,1466,0,1471,0,0,1476,102,59,49152,55349,56637,65,108,108,59,25088,114,105,101,114,116,114,102,59,24881,99,242,1483,1536,74,84,97,98,99,100,102,103,111,114,115,116,1512,1516,1519,1530,1536,1554,1558,1563,1565,1571,1644,1650,99,121,59,17411,32827,62,16446,109,109,97,256,59,100,1527,1528,17299,59,17372,114,101,118,101,59,16670,384,101,105,121,1543,1548,1552,100,105,108,59,16674,114,99,59,16668,59,17427,111,116,59,16672,114,59,49152,55349,56586,59,25305,112,102,59,49152,55349,56638,101,97,116,101,114,768,69,70,71,76,83,84,1589,1604,1614,1622,1627,1638,113,117,97,108,256,59,76,1598,1599,25189,101,115,115,59,25307,117,108,108,69,113,117,97,108,59,25191,114,101,97,116,101,114,59,27298,101,115,115,59,25207,108,97,110,116,69,113,117,97,108,59,27262,105,108,100,101,59,25203,99,114,59,49152,55349,56482,59,25195,1024,65,97,99,102,105,111,115,117,1669,1675,1686,1691,1694,1706,1726,1738,82,68,99,121,59,17450,256,99,116,1680,1684,101,107,59,17095,59,16478,105,114,99,59,16676,114,59,24844,108,98,101,114,116,83,112,97,99,101,59,24843,496,1711,0,1714,102,59,24845,105,122,111,110,116,97,108,76,105,110,101,59,25856,256,99,116,1731,1733,242,1705,114,111,107,59,16678,109,112,324,1744,1752,111,119,110,72,117,109,240,303,113,117,97,108,59,25167,1792,69,74,79,97,99,100,102,103,109,110,111,115,116,117,1786,1790,1795,1799,1806,1818,1822,1825,1832,1860,1912,1931,1935,1941,99,121,59,17429,108,105,103,59,16690,99,121,59,17409,99,117,116,101,32827,205,16589,256,105,121,1811,1816,114,99,32827,206,16590,59,17432,111,116,59,16688,114,59,24849,114,97,118,101,32827,204,16588,384,59,97,112,1824,1839,1855,256,99,103,1844,1847,114,59,16682,105,110,97,114,121,73,59,24904,108,105,101,243,989,500,1865,0,1890,256,59,101,1869,1870,25132,256,103,114,1875,1880,114,97,108,59,25131,115,101,99,116,105,111,110,59,25282,105,115,105,98,108,101,256,67,84,1900,1906,111,109,109,97,59,24675,105,109,101,115,59,24674,384,103,112,116,1919,1923,1928,111,110,59,16686,102,59,49152,55349,56640,97,59,17305,99,114,59,24848,105,108,100,101,59,16680,491,1946,0,1950,99,121,59,17414,108,32827,207,16591,640,99,102,111,115,117,1964,1975,1980,1986,2e3,256,105,121,1969,1973,114,99,59,16692,59,17433,114,59,49152,55349,56589,112,102,59,49152,55349,56641,483,1991,0,1996,114,59,49152,55349,56485,114,99,121,59,17416,107,99,121,59,17412,896,72,74,97,99,102,111,115,2020,2024,2028,2033,2045,2050,2056,99,121,59,17445,99,121,59,17420,112,112,97,59,17306,256,101,121,2038,2043,100,105,108,59,16694,59,17434,114,59,49152,55349,56590,112,102,59,49152,55349,56642,99,114,59,49152,55349,56486,1408,74,84,97,99,101,102,108,109,111,115,116,2085,2089,2092,2128,2147,2483,2488,2503,2509,2615,2631,99,121,59,17417,32827,60,16444,640,99,109,110,112,114,2103,2108,2113,2116,2125,117,116,101,59,16697,98,100,97,59,17307,103,59,26602,108,97,99,101,116,114,102,59,24850,114,59,24990,384,97,101,121,2135,2140,2145,114,111,110,59,16701,100,105,108,59,16699,59,17435,256,102,115,2152,2416,116,1280,65,67,68,70,82,84,85,86,97,114,2174,2217,2225,2272,2278,2300,2351,2395,912,2410,256,110,114,2179,2191,103,108,101,66,114,97,99,107,101,116,59,26600,114,111,119,384,59,66,82,2201,2202,2206,24976,97,114,59,25060,105,103,104,116,65,114,114,111,119,59,25030,101,105,108,105,110,103,59,25352,111,501,2231,0,2243,98,108,101,66,114,97,99,107,101,116,59,26598,110,468,2248,0,2258,101,101,86,101,99,116,111,114,59,26977,101,99,116,111,114,256,59,66,2267,2268,25027,97,114,59,26969,108,111,111,114,59,25354,105,103,104,116,256,65,86,2287,2293,114,114,111,119,59,24980,101,99,116,111,114,59,26958,256,101,114,2305,2327,101,384,59,65,86,2313,2314,2320,25251,114,114,111,119,59,24996,101,99,116,111,114,59,26970,105,97,110,103,108,101,384,59,66,69,2340,2341,2345,25266,97,114,59,27087,113,117,97,108,59,25268,112,384,68,84,86,2359,2370,2380,111,119,110,86,101,99,116,111,114,59,26961,101,101,86,101,99,116,111,114,59,26976,101,99,116,111,114,256,59,66,2390,2391,25023,97,114,59,26968,101,99,116,111,114,256,59,66,2405,2406,25020,97,114,59,26962,105,103,104,116,225,924,115,768,69,70,71,76,83,84,2430,2443,2453,2461,2466,2477,113,117,97,108,71,114,101,97,116,101,114,59,25306,117,108,108,69,113,117,97,108,59,25190,114,101,97,116,101,114,59,25206,101,115,115,59,27297,108,97,110,116,69,113,117,97,108,59,27261,105,108,100,101,59,25202,114,59,49152,55349,56591,256,59,101,2493,2494,25304,102,116,97,114,114,111,119,59,25050,105,100,111,116,59,16703,384,110,112,119,2516,2582,2587,103,512,76,82,108,114,2526,2551,2562,2576,101,102,116,256,65,82,2534,2540,114,114,111,119,59,26613,105,103,104,116,65,114,114,111,119,59,26615,105,103,104,116,65,114,114,111,119,59,26614,101,102,116,256,97,114,947,2570,105,103,104,116,225,959,105,103,104,116,225,970,102,59,49152,55349,56643,101,114,256,76,82,2594,2604,101,102,116,65,114,114,111,119,59,24985,105,103,104,116,65,114,114,111,119,59,24984,384,99,104,116,2622,2624,2626,242,2124,59,25008,114,111,107,59,16705,59,25194,1024,97,99,101,102,105,111,115,117,2650,2653,2656,2679,2684,2693,2699,2702,112,59,26885,121,59,17436,256,100,108,2661,2671,105,117,109,83,112,97,99,101,59,24671,108,105,110,116,114,102,59,24883,114,59,49152,55349,56592,110,117,115,80,108,117,115,59,25107,112,102,59,49152,55349,56644,99,242,2678,59,17308,1152,74,97,99,101,102,111,115,116,117,2723,2727,2733,2752,2836,2841,3473,3479,3486,99,121,59,17418,99,117,116,101,59,16707,384,97,101,121,2740,2745,2750,114,111,110,59,16711,100,105,108,59,16709,59,17437,384,103,115,119,2759,2800,2830,97,116,105,118,101,384,77,84,86,2771,2783,2792,101,100,105,117,109,83,112,97,99,101,59,24587,104,105,256,99,110,2790,2776,235,2777,101,114,121,84,104,105,238,2777,116,101,100,256,71,76,2808,2822,114,101,97,116,101,114,71,114,101,97,116,101,242,1651,101,115,115,76,101,115,243,2632,76,105,110,101,59,16394,114,59,49152,55349,56593,512,66,110,112,116,2850,2856,2871,2874,114,101,97,107,59,24672,66,114,101,97,107,105,110,103,83,112,97,99,101,59,16544,102,59,24853,1664,59,67,68,69,71,72,76,78,80,82,83,84,86,2901,2902,2922,2940,2977,3051,3076,3166,3204,3238,3288,3425,3461,27372,256,111,117,2907,2916,110,103,114,117,101,110,116,59,25186,112,67,97,112,59,25197,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,25126,384,108,113,120,2947,2954,2971,101,109,101,110,116,59,25097,117,97,108,256,59,84,2962,2963,25184,105,108,100,101,59,49152,8770,824,105,115,116,115,59,25092,114,101,97,116,101,114,896,59,69,70,71,76,83,84,2998,2999,3005,3017,3027,3032,3045,25199,113,117,97,108,59,25201,117,108,108,69,113,117,97,108,59,49152,8807,824,114,101,97,116,101,114,59,49152,8811,824,101,115,115,59,25209,108,97,110,116,69,113,117,97,108,59,49152,10878,824,105,108,100,101,59,25205,117,109,112,324,3058,3069,111,119,110,72,117,109,112,59,49152,8782,824,113,117,97,108,59,49152,8783,824,101,256,102,115,3082,3111,116,84,114,105,97,110,103,108,101,384,59,66,69,3098,3099,3105,25322,97,114,59,49152,10703,824,113,117,97,108,59,25324,115,768,59,69,71,76,83,84,3125,3126,3132,3140,3147,3160,25198,113,117,97,108,59,25200,114,101,97,116,101,114,59,25208,101,115,115,59,49152,8810,824,108,97,110,116,69,113,117,97,108,59,49152,10877,824,105,108,100,101,59,25204,101,115,116,101,100,256,71,76,3176,3193,114,101,97,116,101,114,71,114,101,97,116,101,114,59,49152,10914,824,101,115,115,76,101,115,115,59,49152,10913,824,114,101,99,101,100,101,115,384,59,69,83,3218,3219,3227,25216,113,117,97,108,59,49152,10927,824,108,97,110,116,69,113,117,97,108,59,25312,256,101,105,3243,3257,118,101,114,115,101,69,108,101,109,101,110,116,59,25100,103,104,116,84,114,105,97,110,103,108,101,384,59,66,69,3275,3276,3282,25323,97,114,59,49152,10704,824,113,117,97,108,59,25325,256,113,117,3293,3340,117,97,114,101,83,117,256,98,112,3304,3321,115,101,116,256,59,69,3312,3315,49152,8847,824,113,117,97,108,59,25314,101,114,115,101,116,256,59,69,3331,3334,49152,8848,824,113,117,97,108,59,25315,384,98,99,112,3347,3364,3406,115,101,116,256,59,69,3355,3358,49152,8834,8402,113,117,97,108,59,25224,99,101,101,100,115,512,59,69,83,84,3378,3379,3387,3398,25217,113,117,97,108,59,49152,10928,824,108,97,110,116,69,113,117,97,108,59,25313,105,108,100,101,59,49152,8831,824,101,114,115,101,116,256,59,69,3416,3419,49152,8835,8402,113,117,97,108,59,25225,105,108,100,101,512,59,69,70,84,3438,3439,3445,3455,25153,113,117,97,108,59,25156,117,108,108,69,113,117,97,108,59,25159,105,108,100,101,59,25161,101,114,116,105,99,97,108,66,97,114,59,25124,99,114,59,49152,55349,56489,105,108,100,101,32827,209,16593,59,17309,1792,69,97,99,100,102,103,109,111,112,114,115,116,117,118,3517,3522,3529,3541,3547,3552,3559,3580,3586,3616,3618,3634,3647,3652,108,105,103,59,16722,99,117,116,101,32827,211,16595,256,105,121,3534,3539,114,99,32827,212,16596,59,17438,98,108,97,99,59,16720,114,59,49152,55349,56594,114,97,118,101,32827,210,16594,384,97,101,105,3566,3570,3574,99,114,59,16716,103,97,59,17321,99,114,111,110,59,17311,112,102,59,49152,55349,56646,101,110,67,117,114,108,121,256,68,81,3598,3610,111,117,98,108,101,81,117,111,116,101,59,24604,117,111,116,101,59,24600,59,27220,256,99,108,3623,3628,114,59,49152,55349,56490,97,115,104,32827,216,16600,105,364,3639,3644,100,101,32827,213,16597,101,115,59,27191,109,108,32827,214,16598,101,114,256,66,80,3659,3680,256,97,114,3664,3667,114,59,24638,97,99,256,101,107,3674,3676,59,25566,101,116,59,25524,97,114,101,110,116,104,101,115,105,115,59,25564,1152,97,99,102,104,105,108,111,114,115,3711,3719,3722,3727,3730,3732,3741,3760,3836,114,116,105,97,108,68,59,25090,121,59,17439,114,59,49152,55349,56595,105,59,17318,59,17312,117,115,77,105,110,117,115,59,16561,256,105,112,3746,3757,110,99,97,114,101,112,108,97,110,229,1693,102,59,24857,512,59,101,105,111,3769,3770,3808,3812,27323,99,101,100,101,115,512,59,69,83,84,3784,3785,3791,3802,25210,113,117,97,108,59,27311,108,97,110,116,69,113,117,97,108,59,25212,105,108,100,101,59,25214,109,101,59,24627,256,100,112,3817,3822,117,99,116,59,25103,111,114,116,105,111,110,256,59,97,549,3833,108,59,25117,256,99,105,3841,3846,114,59,49152,55349,56491,59,17320,512,85,102,111,115,3857,3862,3867,3871,79,84,32827,34,16418,114,59,49152,55349,56596,112,102,59,24858,99,114,59,49152,55349,56492,1536,66,69,97,99,101,102,104,105,111,114,115,117,3902,3907,3911,3936,3955,4007,4010,4013,4246,4265,4276,4286,97,114,114,59,26896,71,32827,174,16558,384,99,110,114,3918,3923,3926,117,116,101,59,16724,103,59,26603,114,256,59,116,3932,3933,24992,108,59,26902,384,97,101,121,3943,3948,3953,114,111,110,59,16728,100,105,108,59,16726,59,17440,256,59,118,3960,3961,24860,101,114,115,101,256,69,85,3970,3993,256,108,113,3975,3982,101,109,101,110,116,59,25099,117,105,108,105,98,114,105,117,109,59,25035,112,69,113,117,105,108,105,98,114,105,117,109,59,26991,114,187,3961,111,59,17313,103,104,116,1024,65,67,68,70,84,85,86,97,4033,4075,4083,4130,4136,4187,4231,984,256,110,114,4038,4050,103,108,101,66,114,97,99,107,101,116,59,26601,114,111,119,384,59,66,76,4060,4061,4065,24978,97,114,59,25061,101,102,116,65,114,114,111,119,59,25028,101,105,108,105,110,103,59,25353,111,501,4089,0,4101,98,108,101,66,114,97,99,107,101,116,59,26599,110,468,4106,0,4116,101,101,86,101,99,116,111,114,59,26973,101,99,116,111,114,256,59,66,4125,4126,25026,97,114,59,26965,108,111,111,114,59,25355,256,101,114,4141,4163,101,384,59,65,86,4149,4150,4156,25250,114,114,111,119,59,24998,101,99,116,111,114,59,26971,105,97,110,103,108,101,384,59,66,69,4176,4177,4181,25267,97,114,59,27088,113,117,97,108,59,25269,112,384,68,84,86,4195,4206,4216,111,119,110,86,101,99,116,111,114,59,26959,101,101,86,101,99,116,111,114,59,26972,101,99,116,111,114,256,59,66,4226,4227,25022,97,114,59,26964,101,99,116,111,114,256,59,66,4241,4242,25024,97,114,59,26963,256,112,117,4251,4254,102,59,24861,110,100,73,109,112,108,105,101,115,59,26992,105,103,104,116,97,114,114,111,119,59,25051,256,99,104,4281,4284,114,59,24859,59,25009,108,101,68,101,108,97,121,101,100,59,27124,1664,72,79,97,99,102,104,105,109,111,113,115,116,117,4324,4337,4343,4349,4377,4382,4433,4438,4449,4455,4533,4539,4543,256,67,99,4329,4334,72,99,121,59,17449,121,59,17448,70,84,99,121,59,17452,99,117,116,101,59,16730,640,59,97,101,105,121,4360,4361,4366,4371,4375,27324,114,111,110,59,16736,100,105,108,59,16734,114,99,59,16732,59,17441,114,59,49152,55349,56598,111,114,116,512,68,76,82,85,4394,4404,4414,4425,111,119,110,65,114,114,111,119,187,1054,101,102,116,65,114,114,111,119,187,2202,105,103,104,116,65,114,114,111,119,187,4061,112,65,114,114,111,119,59,24977,103,109,97,59,17315,97,108,108,67,105,114,99,108,101,59,25112,112,102,59,49152,55349,56650,626,4461,0,0,4464,116,59,25114,97,114,101,512,59,73,83,85,4475,4476,4489,4527,26017,110,116,101,114,115,101,99,116,105,111,110,59,25235,117,256,98,112,4495,4510,115,101,116,256,59,69,4503,4504,25231,113,117,97,108,59,25233,101,114,115,101,116,256,59,69,4520,4521,25232,113,117,97,108,59,25234,110,105,111,110,59,25236,99,114,59,49152,55349,56494,97,114,59,25286,512,98,99,109,112,4552,4571,4617,4619,256,59,115,4557,4558,25296,101,116,256,59,69,4557,4565,113,117,97,108,59,25222,256,99,104,4576,4613,101,101,100,115,512,59,69,83,84,4589,4590,4596,4607,25211,113,117,97,108,59,27312,108,97,110,116,69,113,117,97,108,59,25213,105,108,100,101,59,25215,84,104,225,3980,59,25105,384,59,101,115,4626,4627,4643,25297,114,115,101,116,256,59,69,4636,4637,25219,113,117,97,108,59,25223,101,116,187,4627,1408,72,82,83,97,99,102,104,105,111,114,115,4670,4676,4681,4693,4702,4721,4726,4767,4802,4808,4817,79,82,78,32827,222,16606,65,68,69,59,24866,256,72,99,4686,4690,99,121,59,17419,121,59,17446,256,98,117,4698,4700,59,16393,59,17316,384,97,101,121,4709,4714,4719,114,111,110,59,16740,100,105,108,59,16738,59,17442,114,59,49152,55349,56599,256,101,105,4731,4745,498,4736,0,4743,101,102,111,114,101,59,25140,97,59,17304,256,99,110,4750,4760,107,83,112,97,99,101,59,49152,8287,8202,83,112,97,99,101,59,24585,108,100,101,512,59,69,70,84,4779,4780,4786,4796,25148,113,117,97,108,59,25155,117,108,108,69,113,117,97,108,59,25157,105,108,100,101,59,25160,112,102,59,49152,55349,56651,105,112,108,101,68,111,116,59,24795,256,99,116,4822,4827,114,59,49152,55349,56495,114,111,107,59,16742,2785,4855,4878,4890,4902,0,4908,4913,0,0,0,0,0,4920,4925,4983,4997,0,5119,5124,5130,5136,256,99,114,4859,4865,117,116,101,32827,218,16602,114,256,59,111,4871,4872,24991,99,105,114,59,26953,114,483,4883,0,4886,121,59,17422,118,101,59,16748,256,105,121,4894,4899,114,99,32827,219,16603,59,17443,98,108,97,99,59,16752,114,59,49152,55349,56600,114,97,118,101,32827,217,16601,97,99,114,59,16746,256,100,105,4929,4969,101,114,256,66,80,4936,4957,256,97,114,4941,4944,114,59,16479,97,99,256,101,107,4951,4953,59,25567,101,116,59,25525,97,114,101,110,116,104,101,115,105,115,59,25565,111,110,256,59,80,4976,4977,25283,108,117,115,59,25230,256,103,112,4987,4991,111,110,59,16754,102,59,49152,55349,56652,1024,65,68,69,84,97,100,112,115,5013,5038,5048,5060,1e3,5074,5079,5107,114,114,111,119,384,59,66,68,4432,5024,5028,97,114,59,26898,111,119,110,65,114,114,111,119,59,25029,111,119,110,65,114,114,111,119,59,24981,113,117,105,108,105,98,114,105,117,109,59,26990,101,101,256,59,65,5067,5068,25253,114,114,111,119,59,24997,111,119,110,225,1011,101,114,256,76,82,5086,5096,101,102,116,65,114,114,111,119,59,24982,105,103,104,116,65,114,114,111,119,59,24983,105,256,59,108,5113,5114,17362,111,110,59,17317,105,110,103,59,16750,99,114,59,49152,55349,56496,105,108,100,101,59,16744,109,108,32827,220,16604,1152,68,98,99,100,101,102,111,115,118,5159,5164,5168,5171,5182,5253,5258,5264,5270,97,115,104,59,25259,97,114,59,27371,121,59,17426,97,115,104,256,59,108,5179,5180,25257,59,27366,256,101,114,5187,5189,59,25281,384,98,116,121,5196,5200,5242,97,114,59,24598,256,59,105,5199,5205,99,97,108,512,66,76,83,84,5217,5221,5226,5236,97,114,59,25123,105,110,101,59,16508,101,112,97,114,97,116,111,114,59,26456,105,108,100,101,59,25152,84,104,105,110,83,112,97,99,101,59,24586,114,59,49152,55349,56601,112,102,59,49152,55349,56653,99,114,59,49152,55349,56497,100,97,115,104,59,25258,640,99,101,102,111,115,5287,5292,5297,5302,5308,105,114,99,59,16756,100,103,101,59,25280,114,59,49152,55349,56602,112,102,59,49152,55349,56654,99,114,59,49152,55349,56498,512,102,105,111,115,5323,5328,5330,5336,114,59,49152,55349,56603,59,17310,112,102,59,49152,55349,56655,99,114,59,49152,55349,56499,1152,65,73,85,97,99,102,111,115,117,5361,5365,5369,5373,5380,5391,5396,5402,5408,99,121,59,17455,99,121,59,17415,99,121,59,17454,99,117,116,101,32827,221,16605,256,105,121,5385,5389,114,99,59,16758,59,17451,114,59,49152,55349,56604,112,102,59,49152,55349,56656,99,114,59,49152,55349,56500,109,108,59,16760,1024,72,97,99,100,101,102,111,115,5429,5433,5439,5451,5455,5469,5472,5476,99,121,59,17430,99,117,116,101,59,16761,256,97,121,5444,5449,114,111,110,59,16765,59,17431,111,116,59,16763,498,5460,0,5467,111,87,105,100,116,232,2777,97,59,17302,114,59,24872,112,102,59,24868,99,114,59,49152,55349,56501,3041,5507,5514,5520,0,5552,5558,5567,0,0,0,0,5574,5595,5611,5727,5741,0,5781,5787,5810,5817,0,5822,99,117,116,101,32827,225,16609,114,101,118,101,59,16643,768,59,69,100,105,117,121,5532,5533,5537,5539,5544,5549,25150,59,49152,8766,819,59,25151,114,99,32827,226,16610,116,101,32955,180,774,59,17456,108,105,103,32827,230,16614,256,59,114,178,5562,59,49152,55349,56606,114,97,118,101,32827,224,16608,256,101,112,5578,5590,256,102,112,5583,5588,115,121,109,59,24885,232,5587,104,97,59,17329,256,97,112,5599,99,256,99,108,5604,5607,114,59,16641,103,59,27199,612,5616,0,0,5642,640,59,97,100,115,118,5626,5627,5631,5633,5639,25127,110,100,59,27221,59,27228,108,111,112,101,59,27224,59,27226,896,59,101,108,109,114,115,122,5656,5657,5659,5662,5695,5711,5721,25120,59,27044,101,187,5657,115,100,256,59,97,5669,5670,25121,1121,5680,5682,5684,5686,5688,5690,5692,5694,59,27048,59,27049,59,27050,59,27051,59,27052,59,27053,59,27054,59,27055,116,256,59,118,5701,5702,25119,98,256,59,100,5708,5709,25278,59,27037,256,112,116,5716,5719,104,59,25122,187,185,97,114,114,59,25468,256,103,112,5731,5735,111,110,59,16645,102,59,49152,55349,56658,896,59,69,97,101,105,111,112,4801,5755,5757,5762,5764,5767,5770,59,27248,99,105,114,59,27247,59,25162,100,59,25163,115,59,16423,114,111,120,256,59,101,4801,5778,241,5763,105,110,103,32827,229,16613,384,99,116,121,5793,5798,5800,114,59,49152,55349,56502,59,16426,109,112,256,59,101,4801,5807,241,648,105,108,100,101,32827,227,16611,109,108,32827,228,16612,256,99,105,5826,5832,111,110,105,110,244,626,110,116,59,27153,2048,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,5869,5873,5936,5948,5955,5960,6008,6013,6112,6118,6201,6224,5901,6461,6472,6512,111,116,59,27373,256,99,114,5878,5918,107,512,99,101,112,115,5888,5893,5901,5907,111,110,103,59,25164,112,115,105,108,111,110,59,17398,114,105,109,101,59,24629,105,109,256,59,101,5914,5915,25149,113,59,25293,374,5922,5926,101,101,59,25277,101,100,256,59,103,5932,5933,25349,101,187,5933,114,107,256,59,116,4956,5943,98,114,107,59,25526,256,111,121,5889,5953,59,17457,113,117,111,59,24606,640,99,109,112,114,116,5971,5979,5985,5988,5992,97,117,115,256,59,101,266,265,112,116,121,118,59,27056,115,233,5900,110,111,245,275,384,97,104,119,5999,6001,6003,59,17330,59,24886,101,101,110,59,25196,114,59,49152,55349,56607,103,896,99,111,115,116,117,118,119,6029,6045,6067,6081,6101,6107,6110,384,97,105,117,6036,6038,6042,240,1888,114,99,59,26095,112,187,4977,384,100,112,116,6052,6056,6061,111,116,59,27136,108,117,115,59,27137,105,109,101,115,59,27138,625,6073,0,0,6078,99,117,112,59,27142,97,114,59,26117,114,105,97,110,103,108,101,256,100,117,6093,6098,111,119,110,59,26045,112,59,26035,112,108,117,115,59,27140,101,229,5188,229,5293,97,114,111,119,59,26893,384,97,107,111,6125,6182,6197,256,99,110,6130,6179,107,384,108,115,116,6138,1451,6146,111,122,101,110,103,101,59,27115,114,105,97,110,103,108,101,512,59,100,108,114,6162,6163,6168,6173,26036,111,119,110,59,26046,101,102,116,59,26050,105,103,104,116,59,26040,107,59,25635,433,6187,0,6195,434,6191,0,6193,59,26002,59,26001,52,59,26003,99,107,59,25992,256,101,111,6206,6221,256,59,113,6211,6214,49152,61,8421,117,105,118,59,49152,8801,8421,116,59,25360,512,112,116,119,120,6233,6238,6247,6252,102,59,49152,55349,56659,256,59,116,5067,6243,111,109,187,5068,116,105,101,59,25288,1536,68,72,85,86,98,100,104,109,112,116,117,118,6277,6294,6314,6331,6359,6363,6380,6399,6405,6410,6416,6433,512,76,82,108,114,6286,6288,6290,6292,59,25943,59,25940,59,25942,59,25939,640,59,68,85,100,117,6305,6306,6308,6310,6312,25936,59,25958,59,25961,59,25956,59,25959,512,76,82,108,114,6323,6325,6327,6329,59,25949,59,25946,59,25948,59,25945,896,59,72,76,82,104,108,114,6346,6347,6349,6351,6353,6355,6357,25937,59,25964,59,25955,59,25952,59,25963,59,25954,59,25951,111,120,59,27081,512,76,82,108,114,6372,6374,6376,6378,59,25941,59,25938,59,25872,59,25868,640,59,68,85,100,117,1725,6391,6393,6395,6397,59,25957,59,25960,59,25900,59,25908,105,110,117,115,59,25247,108,117,115,59,25246,105,109,101,115,59,25248,512,76,82,108,114,6425,6427,6429,6431,59,25947,59,25944,59,25880,59,25876,896,59,72,76,82,104,108,114,6448,6449,6451,6453,6455,6457,6459,25858,59,25962,59,25953,59,25950,59,25916,59,25892,59,25884,256,101,118,291,6466,98,97,114,32827,166,16550,512,99,101,105,111,6481,6486,6490,6496,114,59,49152,55349,56503,109,105,59,24655,109,256,59,101,5914,5916,108,384,59,98,104,6504,6505,6507,16476,59,27077,115,117,98,59,26568,364,6516,6526,108,256,59,101,6521,6522,24610,116,187,6522,112,384,59,69,101,303,6533,6535,59,27310,256,59,113,1756,1755,3297,6567,0,6632,6673,6677,6706,0,6711,6736,0,0,6836,0,0,6849,0,0,6945,6958,6989,6994,0,7165,0,7180,384,99,112,114,6573,6578,6621,117,116,101,59,16647,768,59,97,98,99,100,115,6591,6592,6596,6602,6613,6617,25129,110,100,59,27204,114,99,117,112,59,27209,256,97,117,6607,6610,112,59,27211,112,59,27207,111,116,59,27200,59,49152,8745,65024,256,101,111,6626,6629,116,59,24641,238,1683,512,97,101,105,117,6640,6651,6657,6661,496,6645,0,6648,115,59,27213,111,110,59,16653,100,105,108,32827,231,16615,114,99,59,16649,112,115,256,59,115,6668,6669,27212,109,59,27216,111,116,59,16651,384,100,109,110,6683,6688,6694,105,108,32955,184,429,112,116,121,118,59,27058,116,33024,162,59,101,6701,6702,16546,114,228,434,114,59,49152,55349,56608,384,99,101,105,6717,6720,6733,121,59,17479,99,107,256,59,109,6727,6728,26387,97,114,107,187,6728,59,17351,114,896,59,69,99,101,102,109,115,6751,6752,6754,6763,6820,6826,6830,26059,59,27075,384,59,101,108,6761,6762,6765,17094,113,59,25175,101,609,6772,0,0,6792,114,114,111,119,256,108,114,6780,6785,101,102,116,59,25018,105,103,104,116,59,25019,640,82,83,97,99,100,6802,6804,6806,6810,6815,187,3911,59,25800,115,116,59,25243,105,114,99,59,25242,97,115,104,59,25245,110,105,110,116,59,27152,105,100,59,27375,99,105,114,59,27074,117,98,115,256,59,117,6843,6844,26211,105,116,187,6844,748,6855,6868,6906,0,6922,111,110,256,59,101,6861,6862,16442,256,59,113,199,198,621,6873,0,0,6882,97,256,59,116,6878,6879,16428,59,16448,384,59,102,108,6888,6889,6891,25089,238,4448,101,256,109,120,6897,6902,101,110,116,187,6889,101,243,589,487,6910,0,6919,256,59,100,4795,6914,111,116,59,27245,110,244,582,384,102,114,121,6928,6932,6935,59,49152,55349,56660,111,228,596,33024,169,59,115,341,6941,114,59,24855,256,97,111,6949,6953,114,114,59,25013,115,115,59,26391,256,99,117,6962,6967,114,59,49152,55349,56504,256,98,112,6972,6980,256,59,101,6977,6978,27343,59,27345,256,59,101,6985,6986,27344,59,27346,100,111,116,59,25327,896,100,101,108,112,114,118,119,7008,7020,7031,7042,7084,7124,7161,97,114,114,256,108,114,7016,7018,59,26936,59,26933,624,7026,0,0,7029,114,59,25310,99,59,25311,97,114,114,256,59,112,7039,7040,25014,59,26941,768,59,98,99,100,111,115,7055,7056,7062,7073,7077,7080,25130,114,99,97,112,59,27208,256,97,117,7067,7070,112,59,27206,112,59,27210,111,116,59,25229,114,59,27205,59,49152,8746,65024,512,97,108,114,118,7093,7103,7134,7139,114,114,256,59,109,7100,7101,25015,59,26940,121,384,101,118,119,7111,7124,7128,113,624,7118,0,0,7122,114,101,227,7027,117,227,7029,101,101,59,25294,101,100,103,101,59,25295,101,110,32827,164,16548,101,97,114,114,111,119,256,108,114,7150,7155,101,102,116,187,7040,105,103,104,116,187,7101,101,228,7133,256,99,105,7169,7175,111,110,105,110,244,503,110,116,59,25137,108,99,116,121,59,25389,2432,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,7224,7227,7231,7261,7273,7285,7306,7326,7340,7351,7419,7423,7437,7547,7569,7595,7611,7622,7629,114,242,897,97,114,59,26981,512,103,108,114,115,7240,7245,7250,7252,103,101,114,59,24608,101,116,104,59,24888,242,4403,104,256,59,118,7258,7259,24592,187,2314,363,7265,7271,97,114,111,119,59,26895,97,227,789,256,97,121,7278,7283,114,111,110,59,16655,59,17460,384,59,97,111,818,7292,7300,256,103,114,703,7297,114,59,25034,116,115,101,113,59,27255,384,103,108,109,7313,7316,7320,32827,176,16560,116,97,59,17332,112,116,121,118,59,27057,256,105,114,7331,7336,115,104,116,59,27007,59,49152,55349,56609,97,114,256,108,114,7347,7349,187,2268,187,4126,640,97,101,103,115,118,7362,888,7382,7388,7392,109,384,59,111,115,806,7370,7380,110,100,256,59,115,806,7377,117,105,116,59,26214,97,109,109,97,59,17373,105,110,59,25330,384,59,105,111,7399,7400,7416,16631,100,101,33024,247,59,111,7399,7408,110,116,105,109,101,115,59,25287,110,248,7415,99,121,59,17490,99,623,7430,0,0,7434,114,110,59,25374,111,112,59,25357,640,108,112,116,117,119,7448,7453,7458,7497,7509,108,97,114,59,16420,102,59,49152,55349,56661,640,59,101,109,112,115,779,7469,7479,7485,7490,113,256,59,100,850,7475,111,116,59,25169,105,110,117,115,59,25144,108,117,115,59,25108,113,117,97,114,101,59,25249,98,108,101,98,97,114,119,101,100,103,229,250,110,384,97,100,104,4398,7517,7527,111,119,110,97,114,114,111,119,243,7299,97,114,112,111,111,110,256,108,114,7538,7542,101,102,244,7348,105,103,104,244,7350,354,7551,7557,107,97,114,111,247,3906,623,7562,0,0,7566,114,110,59,25375,111,112,59,25356,384,99,111,116,7576,7587,7590,256,114,121,7581,7585,59,49152,55349,56505,59,17493,108,59,27126,114,111,107,59,16657,256,100,114,7600,7604,111,116,59,25329,105,256,59,102,7610,6166,26047,256,97,104,7616,7619,114,242,1065,97,242,4006,97,110,103,108,101,59,27046,256,99,105,7634,7637,121,59,17503,103,114,97,114,114,59,26623,2304,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,7681,7689,7705,7736,1400,7740,7753,7777,7806,7845,7855,7869,7905,7978,7991,8004,8014,8026,256,68,111,7686,7476,111,244,7305,256,99,115,7694,7700,117,116,101,32827,233,16617,116,101,114,59,27246,512,97,105,111,121,7714,7719,7729,7734,114,111,110,59,16667,114,256,59,99,7725,7726,25174,32827,234,16618,108,111,110,59,25173,59,17485,111,116,59,16663,256,68,114,7745,7749,111,116,59,25170,59,49152,55349,56610,384,59,114,115,7760,7761,7767,27290,97,118,101,32827,232,16616,256,59,100,7772,7773,27286,111,116,59,27288,512,59,105,108,115,7786,7787,7794,7796,27289,110,116,101,114,115,59,25575,59,24851,256,59,100,7801,7802,27285,111,116,59,27287,384,97,112,115,7813,7817,7831,99,114,59,16659,116,121,384,59,115,118,7826,7827,7829,25093,101,116,187,7827,112,256,49,59,7837,7844,307,7841,7843,59,24580,59,24581,24579,256,103,115,7850,7852,59,16715,112,59,24578,256,103,112,7860,7864,111,110,59,16665,102,59,49152,55349,56662,384,97,108,115,7876,7886,7890,114,256,59,115,7882,7883,25301,108,59,27107,117,115,59,27249,105,384,59,108,118,7898,7899,7903,17333,111,110,187,7899,59,17397,512,99,115,117,118,7914,7923,7947,7971,256,105,111,7919,7729,114,99,187,7726,617,7929,0,0,7931,237,1352,97,110,116,256,103,108,7938,7942,116,114,187,7773,101,115,115,187,7802,384,97,101,105,7954,7958,7962,108,115,59,16445,115,116,59,25183,118,256,59,68,565,7968,68,59,27256,112,97,114,115,108,59,27109,256,68,97,7983,7987,111,116,59,25171,114,114,59,26993,384,99,100,105,7998,8001,7928,114,59,24879,111,244,850,256,97,104,8009,8011,59,17335,32827,240,16624,256,109,114,8019,8023,108,32827,235,16619,111,59,24748,384,99,105,112,8033,8036,8039,108,59,16417,115,244,1390,256,101,111,8044,8052,99,116,97,116,105,111,238,1369,110,101,110,116,105,97,108,229,1401,2529,8082,0,8094,0,8097,8103,0,0,8134,8140,0,8147,0,8166,8170,8192,0,8200,8282,108,108,105,110,103,100,111,116,115,101,241,7748,121,59,17476,109,97,108,101,59,26176,384,105,108,114,8109,8115,8129,108,105,103,59,32768,64259,617,8121,0,0,8125,103,59,32768,64256,105,103,59,32768,64260,59,49152,55349,56611,108,105,103,59,32768,64257,108,105,103,59,49152,102,106,384,97,108,116,8153,8156,8161,116,59,26221,105,103,59,32768,64258,110,115,59,26033,111,102,59,16786,496,8174,0,8179,102,59,49152,55349,56663,256,97,107,1471,8183,256,59,118,8188,8189,25300,59,27353,97,114,116,105,110,116,59,27149,256,97,111,8204,8277,256,99,115,8209,8274,945,8218,8240,8248,8261,8264,0,8272,946,8226,8229,8231,8234,8236,0,8238,32827,189,16573,59,24915,32827,188,16572,59,24917,59,24921,59,24923,435,8244,0,8246,59,24916,59,24918,692,8254,8257,0,0,8259,32827,190,16574,59,24919,59,24924,53,59,24920,438,8268,0,8270,59,24922,59,24925,56,59,24926,108,59,24644,119,110,59,25378,99,114,59,49152,55349,56507,2176,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,8322,8329,8351,8357,8368,8372,8432,8437,8442,8447,8451,8466,8504,791,8510,8530,8606,256,59,108,1613,8327,59,27276,384,99,109,112,8336,8341,8349,117,116,101,59,16885,109,97,256,59,100,8348,7386,17331,59,27270,114,101,118,101,59,16671,256,105,121,8362,8366,114,99,59,16669,59,17459,111,116,59,16673,512,59,108,113,115,1598,1602,8381,8393,384,59,113,115,1598,1612,8388,108,97,110,244,1637,512,59,99,100,108,1637,8402,8405,8421,99,59,27305,111,116,256,59,111,8412,8413,27264,256,59,108,8418,8419,27266,59,27268,256,59,101,8426,8429,49152,8923,65024,115,59,27284,114,59,49152,55349,56612,256,59,103,1651,1563,109,101,108,59,24887,99,121,59,17491,512,59,69,97,106,1626,8460,8462,8464,59,27282,59,27301,59,27300,512,69,97,101,115,8475,8477,8489,8500,59,25193,112,256,59,112,8483,8484,27274,114,111,120,187,8484,256,59,113,8494,8495,27272,256,59,113,8494,8475,105,109,59,25319,112,102,59,49152,55349,56664,256,99,105,8515,8518,114,59,24842,109,384,59,101,108,1643,8526,8528,59,27278,59,27280,33536,62,59,99,100,108,113,114,1518,8544,8554,8558,8563,8569,256,99,105,8549,8551,59,27303,114,59,27258,111,116,59,25303,80,97,114,59,27029,117,101,115,116,59,27260,640,97,100,101,108,115,8580,8554,8592,1622,8603,496,8585,0,8590,112,114,111,248,8350,114,59,27e3,113,256,108,113,1599,8598,108,101,115,243,8328,105,237,1643,256,101,110,8611,8621,114,116,110,101,113,113,59,49152,8809,65024,197,8618,1280,65,97,98,99,101,102,107,111,115,121,8644,8647,8689,8693,8698,8728,8733,8751,8808,8829,114,242,928,512,105,108,109,114,8656,8660,8663,8667,114,115,240,5252,102,187,8228,105,108,244,1705,256,100,114,8672,8676,99,121,59,17482,384,59,99,119,2292,8683,8687,105,114,59,26952,59,25005,97,114,59,24847,105,114,99,59,16677,384,97,108,114,8705,8718,8723,114,116,115,256,59,117,8713,8714,26213,105,116,187,8714,108,105,112,59,24614,99,111,110,59,25273,114,59,49152,55349,56613,115,256,101,119,8739,8745,97,114,111,119,59,26917,97,114,111,119,59,26918,640,97,109,111,112,114,8762,8766,8771,8798,8803,114,114,59,25087,116,104,116,59,25147,107,256,108,114,8777,8787,101,102,116,97,114,114,111,119,59,25001,105,103,104,116,97,114,114,111,119,59,25002,102,59,49152,55349,56665,98,97,114,59,24597,384,99,108,116,8815,8820,8824,114,59,49152,55349,56509,97,115,232,8692,114,111,107,59,16679,256,98,112,8834,8839,117,108,108,59,24643,104,101,110,187,7259,2785,8867,0,8874,0,8888,8901,8910,0,8917,8947,0,0,8952,8994,9063,9058,9087,0,9094,9130,9140,99,117,116,101,32827,237,16621,384,59,105,121,1905,8880,8885,114,99,32827,238,16622,59,17464,256,99,120,8892,8895,121,59,17461,99,108,32827,161,16545,256,102,114,927,8905,59,49152,55349,56614,114,97,118,101,32827,236,16620,512,59,105,110,111,1854,8925,8937,8942,256,105,110,8930,8934,110,116,59,27148,116,59,25133,102,105,110,59,27100,116,97,59,24873,108,105,103,59,16691,384,97,111,112,8958,8986,8989,384,99,103,116,8965,8968,8983,114,59,16683,384,101,108,112,1823,8975,8979,105,110,229,1934,97,114,244,1824,104,59,16689,102,59,25271,101,100,59,16821,640,59,99,102,111,116,1268,9004,9009,9021,9025,97,114,101,59,24837,105,110,256,59,116,9016,9017,25118,105,101,59,27101,100,111,244,8985,640,59,99,101,108,112,1879,9036,9040,9051,9057,97,108,59,25274,256,103,114,9045,9049,101,114,243,5475,227,9037,97,114,104,107,59,27159,114,111,100,59,27196,512,99,103,112,116,9071,9074,9078,9083,121,59,17489,111,110,59,16687,102,59,49152,55349,56666,97,59,17337,117,101,115,116,32827,191,16575,256,99,105,9098,9103,114,59,49152,55349,56510,110,640,59,69,100,115,118,1268,9115,9117,9121,1267,59,25337,111,116,59,25333,256,59,118,9126,9127,25332,59,25331,256,59,105,1911,9134,108,100,101,59,16681,491,9144,0,9148,99,121,59,17494,108,32827,239,16623,768,99,102,109,111,115,117,9164,9175,9180,9185,9191,9205,256,105,121,9169,9173,114,99,59,16693,59,17465,114,59,49152,55349,56615,97,116,104,59,16951,112,102,59,49152,55349,56667,483,9196,0,9201,114,59,49152,55349,56511,114,99,121,59,17496,107,99,121,59,17492,1024,97,99,102,103,104,106,111,115,9227,9238,9250,9255,9261,9265,9269,9275,112,112,97,256,59,118,9235,9236,17338,59,17392,256,101,121,9243,9248,100,105,108,59,16695,59,17466,114,59,49152,55349,56616,114,101,101,110,59,16696,99,121,59,17477,99,121,59,17500,112,102,59,49152,55349,56668,99,114,59,49152,55349,56512,2944,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,9328,9345,9350,9357,9361,9486,9533,9562,9600,9806,9822,9829,9849,9853,9882,9906,9944,10077,10088,10123,10176,10241,10258,384,97,114,116,9335,9338,9340,114,242,2502,242,917,97,105,108,59,26907,97,114,114,59,26894,256,59,103,2452,9355,59,27275,97,114,59,26978,2403,9381,0,9386,0,9393,0,0,0,0,0,9397,9402,0,9414,9416,9421,0,9465,117,116,101,59,16698,109,112,116,121,118,59,27060,114,97,238,2124,98,100,97,59,17339,103,384,59,100,108,2190,9409,9411,59,27025,229,2190,59,27269,117,111,32827,171,16555,114,1024,59,98,102,104,108,112,115,116,2201,9438,9446,9449,9451,9454,9457,9461,256,59,102,2205,9443,115,59,26911,115,59,26909,235,8786,112,59,25003,108,59,26937,105,109,59,26995,108,59,24994,384,59,97,101,9471,9472,9476,27307,105,108,59,26905,256,59,115,9481,9482,27309,59,49152,10925,65024,384,97,98,114,9493,9497,9501,114,114,59,26892,114,107,59,26482,256,97,107,9506,9516,99,256,101,107,9512,9514,59,16507,59,16475,256,101,115,9521,9523,59,27019,108,256,100,117,9529,9531,59,27023,59,27021,512,97,101,117,121,9542,9547,9558,9560,114,111,110,59,16702,256,100,105,9552,9556,105,108,59,16700,236,2224,226,9513,59,17467,512,99,113,114,115,9571,9574,9581,9597,97,59,26934,117,111,256,59,114,3609,5958,256,100,117,9586,9591,104,97,114,59,26983,115,104,97,114,59,26955,104,59,25010,640,59,102,103,113,115,9611,9612,2441,9715,9727,25188,116,640,97,104,108,114,116,9624,9636,9655,9666,9704,114,114,111,119,256,59,116,2201,9633,97,233,9462,97,114,112,111,111,110,256,100,117,9647,9652,111,119,110,187,1114,112,187,2406,101,102,116,97,114,114,111,119,115,59,25031,105,103,104,116,384,97,104,115,9677,9686,9694,114,114,111,119,256,59,115,2292,2215,97,114,112,111,111,110,243,3992,113,117,105,103,97,114,114,111,247,8688,104,114,101,101,116,105,109,101,115,59,25291,384,59,113,115,9611,2451,9722,108,97,110,244,2476,640,59,99,100,103,115,2476,9738,9741,9757,9768,99,59,27304,111,116,256,59,111,9748,9749,27263,256,59,114,9754,9755,27265,59,27267,256,59,101,9762,9765,49152,8922,65024,115,59,27283,640,97,100,101,103,115,9779,9785,9789,9801,9803,112,112,114,111,248,9414,111,116,59,25302,113,256,103,113,9795,9797,244,2441,103,116,242,9356,244,2459,105,237,2482,384,105,108,114,9813,2273,9818,115,104,116,59,27004,59,49152,55349,56617,256,59,69,2460,9827,59,27281,353,9833,9846,114,256,100,117,9650,9838,256,59,108,2405,9843,59,26986,108,107,59,25988,99,121,59,17497,640,59,97,99,104,116,2632,9864,9867,9873,9878,114,242,9665,111,114,110,101,242,7432,97,114,100,59,26987,114,105,59,26106,256,105,111,9887,9892,100,111,116,59,16704,117,115,116,256,59,97,9900,9901,25520,99,104,101,187,9901,512,69,97,101,115,9915,9917,9929,9940,59,25192,112,256,59,112,9923,9924,27273,114,111,120,187,9924,256,59,113,9934,9935,27271,256,59,113,9934,9915,105,109,59,25318,1024,97,98,110,111,112,116,119,122,9961,9972,9975,10010,10031,10049,10055,10064,256,110,114,9966,9969,103,59,26604,114,59,25085,114,235,2241,103,384,108,109,114,9983,9997,10004,101,102,116,256,97,114,2534,9991,105,103,104,116,225,2546,97,112,115,116,111,59,26620,105,103,104,116,225,2557,112,97,114,114,111,119,256,108,114,10021,10025,101,102,244,9453,105,103,104,116,59,25004,384,97,102,108,10038,10041,10045,114,59,27013,59,49152,55349,56669,117,115,59,27181,105,109,101,115,59,27188,353,10059,10063,115,116,59,25111,225,4942,384,59,101,102,10071,10072,6144,26058,110,103,101,187,10072,97,114,256,59,108,10084,10085,16424,116,59,27027,640,97,99,104,109,116,10099,10102,10108,10117,10119,114,242,2216,111,114,110,101,242,7564,97,114,256,59,100,3992,10115,59,26989,59,24590,114,105,59,25279,768,97,99,104,105,113,116,10136,10141,2624,10146,10158,10171,113,117,111,59,24633,114,59,49152,55349,56513,109,384,59,101,103,2482,10154,10156,59,27277,59,27279,256,98,117,9514,10163,111,256,59,114,3615,10169,59,24602,114,111,107,59,16706,33792,60,59,99,100,104,105,108,113,114,2091,10194,9785,10204,10208,10213,10218,10224,256,99,105,10199,10201,59,27302,114,59,27257,114,101,229,9714,109,101,115,59,25289,97,114,114,59,26998,117,101,115,116,59,27259,256,80,105,10229,10233,97,114,59,27030,384,59,101,102,10240,2349,6171,26051,114,256,100,117,10247,10253,115,104,97,114,59,26954,104,97,114,59,26982,256,101,110,10263,10273,114,116,110,101,113,113,59,49152,8808,65024,197,10270,1792,68,97,99,100,101,102,104,105,108,110,111,112,115,117,10304,10309,10370,10382,10387,10400,10405,10408,10458,10466,10468,2691,10483,10498,68,111,116,59,25146,512,99,108,112,114,10318,10322,10339,10365,114,32827,175,16559,256,101,116,10327,10329,59,26178,256,59,101,10334,10335,26400,115,101,187,10335,256,59,115,4155,10344,116,111,512,59,100,108,117,4155,10355,10359,10363,111,119,238,1164,101,102,244,2319,240,5073,107,101,114,59,26030,256,111,121,10375,10380,109,109,97,59,27177,59,17468,97,115,104,59,24596,97,115,117,114,101,100,97,110,103,108,101,187,5670,114,59,49152,55349,56618,111,59,24871,384,99,100,110,10415,10420,10441,114,111,32827,181,16565,512,59,97,99,100,5220,10429,10432,10436,115,244,5799,105,114,59,27376,111,116,32955,183,437,117,115,384,59,98,100,10450,6403,10451,25106,256,59,117,7484,10456,59,27178,355,10462,10465,112,59,27355,242,8722,240,2689,256,100,112,10473,10478,101,108,115,59,25255,102,59,49152,55349,56670,256,99,116,10488,10493,114,59,49152,55349,56514,112,111,115,187,5533,384,59,108,109,10505,10506,10509,17340,116,105,109,97,112,59,25272,3072,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,10562,10579,10622,10633,10648,10714,10729,10773,10778,10840,10845,10883,10901,10916,10920,11012,11015,11076,11135,11182,11316,11367,11388,11497,256,103,116,10567,10571,59,49152,8921,824,256,59,118,10576,3023,49152,8811,8402,384,101,108,116,10586,10610,10614,102,116,256,97,114,10593,10599,114,114,111,119,59,25037,105,103,104,116,97,114,114,111,119,59,25038,59,49152,8920,824,256,59,118,10619,3143,49152,8810,8402,105,103,104,116,97,114,114,111,119,59,25039,256,68,100,10638,10643,97,115,104,59,25263,97,115,104,59,25262,640,98,99,110,112,116,10659,10663,10668,10673,10700,108,97,187,734,117,116,101,59,16708,103,59,49152,8736,8402,640,59,69,105,111,112,3460,10684,10688,10693,10696,59,49152,10864,824,100,59,49152,8779,824,115,59,16713,114,111,248,3460,117,114,256,59,97,10707,10708,26222,108,256,59,115,10707,2872,499,10719,0,10723,112,32955,160,2871,109,112,256,59,101,3065,3072,640,97,101,111,117,121,10740,10750,10755,10768,10771,496,10745,0,10747,59,27203,111,110,59,16712,100,105,108,59,16710,110,103,256,59,100,3454,10762,111,116,59,49152,10861,824,112,59,27202,59,17469,97,115,104,59,24595,896,59,65,97,100,113,115,120,2962,10793,10797,10811,10817,10821,10832,114,114,59,25047,114,256,104,114,10803,10806,107,59,26916,256,59,111,5106,5104,111,116,59,49152,8784,824,117,105,246,2915,256,101,105,10826,10830,97,114,59,26920,237,2968,105,115,116,256,59,115,2976,2975,114,59,49152,55349,56619,512,69,101,115,116,3013,10854,10873,10876,384,59,113,115,3004,10861,3041,384,59,113,115,3004,3013,10868,108,97,110,244,3042,105,237,3050,256,59,114,2998,10881,187,2999,384,65,97,112,10890,10893,10897,114,242,10609,114,114,59,25006,97,114,59,27378,384,59,115,118,3981,10908,3980,256,59,100,10913,10914,25340,59,25338,99,121,59,17498,896,65,69,97,100,101,115,116,10935,10938,10942,10946,10949,10998,11001,114,242,10598,59,49152,8806,824,114,114,59,24986,114,59,24613,512,59,102,113,115,3131,10958,10979,10991,116,256,97,114,10964,10969,114,114,111,247,10945,105,103,104,116,97,114,114,111,247,10896,384,59,113,115,3131,10938,10986,108,97,110,244,3157,256,59,115,3157,10996,187,3126,105,237,3165,256,59,114,3125,11006,105,256,59,101,3098,3109,105,228,3472,256,112,116,11020,11025,102,59,49152,55349,56671,33152,172,59,105,110,11033,11034,11062,16556,110,512,59,69,100,118,2953,11044,11048,11054,59,49152,8953,824,111,116,59,49152,8949,824,481,2953,11059,11061,59,25335,59,25334,105,256,59,118,3256,11068,481,3256,11073,11075,59,25342,59,25341,384,97,111,114,11083,11107,11113,114,512,59,97,115,116,2939,11093,11098,11103,108,108,101,236,2939,108,59,49152,11005,8421,59,49152,8706,824,108,105,110,116,59,27156,384,59,99,101,3218,11120,11123,117,229,3237,256,59,99,3224,11128,256,59,101,3218,11133,241,3224,512,65,97,105,116,11144,11147,11165,11175,114,242,10632,114,114,384,59,99,119,11156,11157,11161,24987,59,49152,10547,824,59,49152,8605,824,103,104,116,97,114,114,111,119,187,11157,114,105,256,59,101,3275,3286,896,99,104,105,109,112,113,117,11197,11213,11225,11012,2936,11236,11247,512,59,99,101,114,3378,11206,3383,11209,117,229,3397,59,49152,55349,56515,111,114,116,621,11013,0,0,11222,97,114,225,11094,109,256,59,101,3438,11231,256,59,113,3444,3443,115,117,256,98,112,11243,11245,229,3320,229,3339,384,98,99,112,11254,11281,11289,512,59,69,101,115,11263,11264,3362,11268,25220,59,49152,10949,824,101,116,256,59,101,3355,11275,113,256,59,113,3363,11264,99,256,59,101,3378,11287,241,3384,512,59,69,101,115,11298,11299,3423,11303,25221,59,49152,10950,824,101,116,256,59,101,3416,11310,113,256,59,113,3424,11299,512,103,105,108,114,11325,11327,11333,11335,236,3031,108,100,101,32827,241,16625,231,3139,105,97,110,103,108,101,256,108,114,11346,11356,101,102,116,256,59,101,3098,11354,241,3110,105,103,104,116,256,59,101,3275,11365,241,3287,256,59,109,11372,11373,17341,384,59,101,115,11380,11381,11385,16419,114,111,59,24854,112,59,24583,1152,68,72,97,100,103,105,108,114,115,11407,11412,11417,11422,11427,11440,11446,11475,11491,97,115,104,59,25261,97,114,114,59,26884,112,59,49152,8781,8402,97,115,104,59,25260,256,101,116,11432,11436,59,49152,8805,8402,59,49152,62,8402,110,102,105,110,59,27102,384,65,101,116,11453,11457,11461,114,114,59,26882,59,49152,8804,8402,256,59,114,11466,11469,49152,60,8402,105,101,59,49152,8884,8402,256,65,116,11480,11484,114,114,59,26883,114,105,101,59,49152,8885,8402,105,109,59,49152,8764,8402,384,65,97,110,11504,11508,11522,114,114,59,25046,114,256,104,114,11514,11517,107,59,26915,256,59,111,5095,5093,101,97,114,59,26919,4691,6805,0,0,0,0,0,0,0,0,0,0,0,0,0,11565,0,11576,11592,11616,11621,11634,11652,6919,0,0,11661,11691,0,11720,11726,0,11740,11801,11819,11838,11843,256,99,115,11569,6807,117,116,101,32827,243,16627,256,105,121,11580,11589,114,256,59,99,6814,11586,32827,244,16628,59,17470,640,97,98,105,111,115,6816,11602,11607,456,11610,108,97,99,59,16721,118,59,27192,111,108,100,59,27068,108,105,103,59,16723,256,99,114,11625,11629,105,114,59,27071,59,49152,55349,56620,879,11641,0,0,11644,0,11650,110,59,17115,97,118,101,32827,242,16626,59,27073,256,98,109,11656,3572,97,114,59,27061,512,97,99,105,116,11669,11672,11685,11688,114,242,6784,256,105,114,11677,11680,114,59,27070,111,115,115,59,27067,110,229,3666,59,27072,384,97,101,105,11697,11701,11705,99,114,59,16717,103,97,59,17353,384,99,100,110,11712,11717,461,114,111,110,59,17343,59,27062,112,102,59,49152,55349,56672,384,97,101,108,11732,11735,466,114,59,27063,114,112,59,27065,896,59,97,100,105,111,115,118,11754,11755,11758,11784,11789,11792,11798,25128,114,242,6790,512,59,101,102,109,11767,11768,11778,11781,27229,114,256,59,111,11774,11775,24884,102,187,11775,32827,170,16554,32827,186,16570,103,111,102,59,25270,114,59,27222,108,111,112,101,59,27223,59,27227,384,99,108,111,11807,11809,11815,242,11777,97,115,104,32827,248,16632,108,59,25240,105,364,11823,11828,100,101,32827,245,16629,101,115,256,59,97,475,11834,115,59,27190,109,108,32827,246,16630,98,97,114,59,25405,2785,11870,0,11901,0,11904,11933,0,11938,11961,0,0,11979,3740,0,12051,0,0,12075,12220,0,12232,114,512,59,97,115,116,1027,11879,11890,3717,33024,182,59,108,11885,11886,16566,108,101,236,1027,617,11896,0,0,11899,109,59,27379,59,27389,121,59,17471,114,640,99,105,109,112,116,11915,11919,11923,6245,11927,110,116,59,16421,111,100,59,16430,105,108,59,24624,101,110,107,59,24625,114,59,49152,55349,56621,384,105,109,111,11944,11952,11956,256,59,118,11949,11950,17350,59,17365,109,97,244,2678,110,101,59,26126,384,59,116,118,11967,11968,11976,17344,99,104,102,111,114,107,187,8189,59,17366,256,97,117,11983,11999,110,256,99,107,11989,11997,107,256,59,104,8692,11995,59,24846,246,8692,115,1152,59,97,98,99,100,101,109,115,116,12019,12020,6408,12025,12029,12036,12038,12042,12046,16427,99,105,114,59,27171,105,114,59,27170,256,111,117,7488,12034,59,27173,59,27250,110,32955,177,3741,105,109,59,27174,119,111,59,27175,384,105,112,117,12057,12064,12069,110,116,105,110,116,59,27157,102,59,49152,55349,56673,110,100,32827,163,16547,1280,59,69,97,99,101,105,110,111,115,117,3784,12095,12097,12100,12103,12161,12169,12178,12158,12214,59,27315,112,59,27319,117,229,3801,256,59,99,3790,12108,768,59,97,99,101,110,115,3784,12121,12127,12134,12136,12158,112,112,114,111,248,12099,117,114,108,121,101,241,3801,241,3790,384,97,101,115,12143,12150,12154,112,112,114,111,120,59,27321,113,113,59,27317,105,109,59,25320,105,237,3807,109,101,256,59,115,12168,3758,24626,384,69,97,115,12152,12176,12154,240,12149,384,100,102,112,3820,12185,12207,384,97,108,115,12192,12197,12202,108,97,114,59,25390,105,110,101,59,25362,117,114,102,59,25363,256,59,116,3835,12212,239,3835,114,101,108,59,25264,256,99,105,12224,12229,114,59,49152,55349,56517,59,17352,110,99,115,112,59,24584,768,102,105,111,112,115,117,12250,8930,12255,12261,12267,12273,114,59,49152,55349,56622,112,102,59,49152,55349,56674,114,105,109,101,59,24663,99,114,59,49152,55349,56518,384,97,101,111,12280,12297,12307,116,256,101,105,12286,12293,114,110,105,111,110,243,1712,110,116,59,27158,115,116,256,59,101,12304,12305,16447,241,7961,244,3860,2688,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,12352,12369,12373,12377,12512,12558,12587,12615,12642,12658,12686,12806,12821,12836,12841,12888,12910,12914,12944,12976,12983,384,97,114,116,12359,12362,12364,114,242,4275,242,989,97,105,108,59,26908,97,114,242,7269,97,114,59,26980,896,99,100,101,110,113,114,116,12392,12405,12408,12415,12431,12436,12492,256,101,117,12397,12401,59,49152,8765,817,116,101,59,16725,105,227,4462,109,112,116,121,118,59,27059,103,512,59,100,101,108,4049,12425,12427,12429,59,27026,59,27045,229,4049,117,111,32827,187,16571,114,1408,59,97,98,99,102,104,108,112,115,116,119,4060,12460,12463,12471,12473,12476,12478,12480,12483,12487,12490,112,59,26997,256,59,102,4064,12468,115,59,26912,59,26931,115,59,26910,235,8797,240,10030,108,59,26949,105,109,59,26996,108,59,24995,59,24989,256,97,105,12497,12501,105,108,59,26906,111,256,59,110,12507,12508,25142,97,108,243,3870,384,97,98,114,12519,12522,12526,114,242,6117,114,107,59,26483,256,97,107,12531,12541,99,256,101,107,12537,12539,59,16509,59,16477,256,101,115,12546,12548,59,27020,108,256,100,117,12554,12556,59,27022,59,27024,512,97,101,117,121,12567,12572,12583,12585,114,111,110,59,16729,256,100,105,12577,12581,105,108,59,16727,236,4082,226,12538,59,17472,512,99,108,113,115,12596,12599,12605,12612,97,59,26935,100,104,97,114,59,26985,117,111,256,59,114,526,525,104,59,25011,384,97,99,103,12622,12639,3908,108,512,59,105,112,115,3960,12632,12635,4252,110,229,4283,97,114,244,4009,116,59,26029,384,105,108,114,12649,4131,12654,115,104,116,59,27005,59,49152,55349,56623,256,97,111,12663,12678,114,256,100,117,12669,12671,187,1147,256,59,108,4241,12676,59,26988,256,59,118,12683,12684,17345,59,17393,384,103,110,115,12693,12793,12796,104,116,768,97,104,108,114,115,116,12708,12720,12738,12760,12772,12782,114,114,111,119,256,59,116,4060,12717,97,233,12488,97,114,112,111,111,110,256,100,117,12731,12735,111,119,238,12670,112,187,4242,101,102,116,256,97,104,12746,12752,114,114,111,119,243,4074,97,114,112,111,111,110,243,1361,105,103,104,116,97,114,114,111,119,115,59,25033,113,117,105,103,97,114,114,111,247,12491,104,114,101,101,116,105,109,101,115,59,25292,103,59,17114,105,110,103,100,111,116,115,101,241,7986,384,97,104,109,12813,12816,12819,114,242,4074,97,242,1361,59,24591,111,117,115,116,256,59,97,12830,12831,25521,99,104,101,187,12831,109,105,100,59,27374,512,97,98,112,116,12850,12861,12864,12882,256,110,114,12855,12858,103,59,26605,114,59,25086,114,235,4099,384,97,102,108,12871,12874,12878,114,59,27014,59,49152,55349,56675,117,115,59,27182,105,109,101,115,59,27189,256,97,112,12893,12903,114,256,59,103,12899,12900,16425,116,59,27028,111,108,105,110,116,59,27154,97,114,242,12771,512,97,99,104,113,12923,12928,4284,12933,113,117,111,59,24634,114,59,49152,55349,56519,256,98,117,12539,12938,111,256,59,114,532,531,384,104,105,114,12951,12955,12960,114,101,229,12792,109,101,115,59,25290,105,512,59,101,102,108,12970,4185,6177,12971,26041,116,114,105,59,27086,108,117,104,97,114,59,26984,59,24862,3425,13013,13019,13023,13100,13112,13169,0,13178,13220,0,0,13292,13296,0,13352,13384,13402,13485,13489,13514,13553,0,13846,0,0,13875,99,117,116,101,59,16731,113,117,239,10170,1280,59,69,97,99,101,105,110,112,115,121,4589,13043,13045,13055,13058,13067,13071,13087,13094,13097,59,27316,496,13050,0,13052,59,27320,111,110,59,16737,117,229,4606,256,59,100,4595,13063,105,108,59,16735,114,99,59,16733,384,69,97,115,13078,13080,13083,59,27318,112,59,27322,105,109,59,25321,111,108,105,110,116,59,27155,105,237,4612,59,17473,111,116,384,59,98,101,13108,7495,13109,25285,59,27238,896,65,97,99,109,115,116,120,13126,13130,13143,13147,13150,13155,13165,114,114,59,25048,114,256,104,114,13136,13138,235,8744,256,59,111,2614,2612,116,32827,167,16551,105,59,16443,119,97,114,59,26921,109,256,105,110,13161,240,110,117,243,241,116,59,26422,114,256,59,111,13174,8277,49152,55349,56624,512,97,99,111,121,13186,13190,13201,13216,114,112,59,26223,256,104,121,13195,13199,99,121,59,17481,59,17480,114,116,621,13209,0,0,13212,105,228,5220,97,114,97,236,11887,32827,173,16557,256,103,109,13224,13236,109,97,384,59,102,118,13233,13234,13234,17347,59,17346,1024,59,100,101,103,108,110,112,114,4779,13253,13257,13262,13270,13278,13281,13286,111,116,59,27242,256,59,113,4785,4784,256,59,69,13267,13268,27294,59,27296,256,59,69,13275,13276,27293,59,27295,101,59,25158,108,117,115,59,27172,97,114,114,59,26994,97,114,242,4413,512,97,101,105,116,13304,13320,13327,13335,256,108,115,13309,13316,108,115,101,116,109,233,13162,104,112,59,27187,112,97,114,115,108,59,27108,256,100,108,5219,13332,101,59,25379,256,59,101,13340,13341,27306,256,59,115,13346,13347,27308,59,49152,10924,65024,384,102,108,112,13358,13363,13378,116,99,121,59,17484,256,59,98,13368,13369,16431,256,59,97,13374,13375,27076,114,59,25407,102,59,49152,55349,56676,97,256,100,114,13389,1026,101,115,256,59,117,13396,13397,26208,105,116,187,13397,384,99,115,117,13408,13433,13471,256,97,117,13413,13423,112,256,59,115,4488,13419,59,49152,8851,65024,112,256,59,115,4532,13429,59,49152,8852,65024,117,256,98,112,13439,13455,384,59,101,115,4503,4508,13446,101,116,256,59,101,4503,13453,241,4509,384,59,101,115,4520,4525,13462,101,116,256,59,101,4520,13469,241,4526,384,59,97,102,4475,13478,1456,114,357,13483,1457,187,4476,97,114,242,4424,512,99,101,109,116,13497,13502,13506,13509,114,59,49152,55349,56520,116,109,238,241,105,236,13333,97,114,230,4542,256,97,114,13518,13525,114,256,59,102,13524,6079,26118,256,97,110,13530,13549,105,103,104,116,256,101,112,13539,13546,112,115,105,108,111,238,7904,104,233,11951,115,187,10322,640,98,99,109,110,112,13563,13662,4617,13707,13710,1152,59,69,100,101,109,110,112,114,115,13582,13583,13585,13589,13598,13603,13612,13617,13622,25218,59,27333,111,116,59,27325,256,59,100,4570,13594,111,116,59,27331,117,108,116,59,27329,256,69,101,13608,13610,59,27339,59,25226,108,117,115,59,27327,97,114,114,59,27001,384,101,105,117,13629,13650,13653,116,384,59,101,110,13582,13637,13643,113,256,59,113,4570,13583,101,113,256,59,113,13611,13608,109,59,27335,256,98,112,13658,13660,59,27349,59,27347,99,768,59,97,99,101,110,115,4589,13676,13682,13689,13691,13094,112,112,114,111,248,13050,117,114,108,121,101,241,4606,241,4595,384,97,101,115,13698,13704,13083,112,112,114,111,248,13082,113,241,13079,103,59,26218,1664,49,50,51,59,69,100,101,104,108,109,110,112,115,13737,13740,13743,4636,13746,13748,13760,13769,13781,13786,13791,13800,13805,32827,185,16569,32827,178,16562,32827,179,16563,59,27334,256,111,115,13753,13756,116,59,27326,117,98,59,27352,256,59,100,4642,13765,111,116,59,27332,115,256,111,117,13775,13778,108,59,26569,98,59,27351,97,114,114,59,27003,117,108,116,59,27330,256,69,101,13796,13798,59,27340,59,25227,108,117,115,59,27328,384,101,105,117,13812,13833,13836,116,384,59,101,110,4636,13820,13826,113,256,59,113,4642,13746,101,113,256,59,113,13799,13796,109,59,27336,256,98,112,13841,13843,59,27348,59,27350,384,65,97,110,13852,13856,13869,114,114,59,25049,114,256,104,114,13862,13864,235,8750,256,59,111,2603,2601,119,97,114,59,26922,108,105,103,32827,223,16607,3041,13905,13917,13920,4814,13939,13945,0,13950,14018,0,0,0,0,0,14043,14083,0,14089,14188,0,0,0,14215,626,13910,0,0,13915,103,101,116,59,25366,59,17348,114,235,3679,384,97,101,121,13926,13931,13936,114,111,110,59,16741,100,105,108,59,16739,59,17474,108,114,101,99,59,25365,114,59,49152,55349,56625,512,101,105,107,111,13958,13981,14005,14012,498,13963,0,13969,101,256,52,102,4740,4737,97,384,59,115,118,13976,13977,13979,17336,121,109,59,17361,256,99,110,13986,14002,107,256,97,115,13992,13998,112,112,114,111,248,4801,105,109,187,4780,115,240,4766,256,97,115,14010,13998,240,4801,114,110,32827,254,16638,492,799,14022,8935,101,115,33152,215,59,98,100,14031,14032,14040,16599,256,59,97,6415,14037,114,59,27185,59,27184,384,101,112,115,14049,14051,14080,225,10829,512,59,98,99,102,1158,14060,14064,14068,111,116,59,25398,105,114,59,27377,256,59,111,14073,14076,49152,55349,56677,114,107,59,27354,225,13154,114,105,109,101,59,24628,384,97,105,112,14095,14098,14180,100,229,4680,896,97,100,101,109,112,115,116,14113,14157,14144,14161,14167,14172,14175,110,103,108,101,640,59,100,108,113,114,14128,14129,14134,14144,14146,26037,111,119,110,187,7611,101,102,116,256,59,101,10240,14142,241,2350,59,25180,105,103,104,116,256,59,101,12970,14155,241,4186,111,116,59,26092,105,110,117,115,59,27194,108,117,115,59,27193,98,59,27085,105,109,101,59,27195,101,122,105,117,109,59,25570,384,99,104,116,14194,14205,14209,256,114,121,14199,14203,59,49152,55349,56521,59,17478,99,121,59,17499,114,111,107,59,16743,256,105,111,14219,14222,120,244,6007,104,101,97,100,256,108,114,14231,14240,101,102,116,97,114,114,111,247,2127,105,103,104,116,97,114,114,111,119,187,3933,2304,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,14288,14291,14295,14308,14320,14332,14350,14364,14371,14388,14417,14429,14443,14505,14540,14546,14570,14582,114,242,1005,97,114,59,26979,256,99,114,14300,14306,117,116,101,32827,250,16634,242,4432,114,483,14314,0,14317,121,59,17502,118,101,59,16749,256,105,121,14325,14330,114,99,32827,251,16635,59,17475,384,97,98,104,14339,14342,14347,114,242,5037,108,97,99,59,16753,97,242,5059,256,105,114,14355,14360,115,104,116,59,27006,59,49152,55349,56626,114,97,118,101,32827,249,16633,353,14375,14385,114,256,108,114,14380,14382,187,2391,187,4227,108,107,59,25984,256,99,116,14393,14413,623,14399,0,0,14410,114,110,256,59,101,14405,14406,25372,114,187,14406,111,112,59,25359,114,105,59,26104,256,97,108,14422,14426,99,114,59,16747,32955,168,841,256,103,112,14434,14438,111,110,59,16755,102,59,49152,55349,56678,768,97,100,104,108,115,117,4427,14456,14461,4978,14481,14496,111,119,110,225,5043,97,114,112,111,111,110,256,108,114,14472,14476,101,102,244,14381,105,103,104,244,14383,105,384,59,104,108,14489,14490,14492,17349,187,5114,111,110,187,14490,112,97,114,114,111,119,115,59,25032,384,99,105,116,14512,14532,14536,623,14518,0,0,14529,114,110,256,59,101,14524,14525,25373,114,187,14525,111,112,59,25358,110,103,59,16751,114,105,59,26105,99,114,59,49152,55349,56522,384,100,105,114,14553,14557,14562,111,116,59,25328,108,100,101,59,16745,105,256,59,102,14128,14568,187,6163,256,97,109,14575,14578,114,242,14504,108,32827,252,16636,97,110,103,108,101,59,27047,1920,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,14620,14623,14633,14637,14773,14776,14781,14815,14820,14824,14835,14841,14845,14849,14880,114,242,1015,97,114,256,59,118,14630,14631,27368,59,27369,97,115,232,993,256,110,114,14642,14647,103,114,116,59,27036,896,101,107,110,112,114,115,116,13539,14662,14667,14674,14685,14692,14742,97,112,112,225,9237,111,116,104,105,110,231,7830,384,104,105,114,13547,11976,14681,111,112,244,12213,256,59,104,5047,14690,239,12685,256,105,117,14697,14701,103,109,225,13235,256,98,112,14706,14724,115,101,116,110,101,113,256,59,113,14717,14720,49152,8842,65024,59,49152,10955,65024,115,101,116,110,101,113,256,59,113,14735,14738,49152,8843,65024,59,49152,10956,65024,256,104,114,14747,14751,101,116,225,13980,105,97,110,103,108,101,256,108,114,14762,14767,101,102,116,187,2341,105,103,104,116,187,4177,121,59,17458,97,115,104,187,4150,384,101,108,114,14788,14802,14807,384,59,98,101,11754,14795,14799,97,114,59,25275,113,59,25178,108,105,112,59,25326,256,98,116,14812,5224,97,242,5225,114,59,49152,55349,56627,116,114,233,14766,115,117,256,98,112,14831,14833,187,3356,187,3417,112,102,59,49152,55349,56679,114,111,240,3835,116,114,233,14772,256,99,117,14854,14859,114,59,49152,55349,56523,256,98,112,14864,14872,110,256,69,101,14720,14870,187,14718,110,256,69,101,14738,14878,187,14736,105,103,122,97,103,59,27034,896,99,101,102,111,112,114,115,14902,14907,14934,14939,14932,14945,14954,105,114,99,59,16757,256,100,105,14912,14929,256,98,103,14917,14921,97,114,59,27231,101,256,59,113,5626,14927,59,25177,101,114,112,59,24856,114,59,49152,55349,56628,112,102,59,49152,55349,56680,256,59,101,5241,14950,97,116,232,5241,99,114,59,49152,55349,56524,2787,6030,14983,0,14987,0,14992,15003,0,0,15005,15016,15019,15023,0,0,15043,15054,0,15064,6108,6111,116,114,233,6097,114,59,49152,55349,56629,256,65,97,14996,14999,114,242,963,114,242,2550,59,17342,256,65,97,15009,15012,114,242,952,114,242,2539,97,240,10003,105,115,59,25339,384,100,112,116,6052,15029,15038,256,102,108,15034,6057,59,49152,55349,56681,105,109,229,6066,256,65,97,15047,15050,114,242,974,114,242,2561,256,99,113,15058,6072,114,59,49152,55349,56525,256,112,116,6102,15068,114,233,6100,1024,97,99,101,102,105,111,115,117,15088,15101,15112,15116,15121,15125,15131,15137,99,256,117,121,15094,15099,116,101,32827,253,16637,59,17487,256,105,121,15106,15110,114,99,59,16759,59,17483,110,32827,165,16549,114,59,49152,55349,56630,99,121,59,17495,112,102,59,49152,55349,56682,99,114,59,49152,55349,56526,256,99,109,15142,15145,121,59,17486,108,32827,255,16639,1280,97,99,100,101,102,104,105,111,115,119,15170,15176,15188,15192,15204,15209,15213,15220,15226,15232,99,117,116,101,59,16762,256,97,121,15181,15186,114,111,110,59,16766,59,17463,111,116,59,16764,256,101,116,15197,15201,116,114,230,5471,97,59,17334,114,59,49152,55349,56631,99,121,59,17462,103,114,97,114,114,59,25053,112,102,59,49152,55349,56683,99,114,59,49152,55349,56527,256,106,110,15237,15239,59,24589,106,59,24588]);var jp=new Uint16Array([512,97,103,108,113,9,21,24,27,621,15,0,0,18,112,59,16422,111,115,59,16423,116,59,16446,116,59,16444,117,111,116,59,16418]);var W0,_x=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Up=(W0=String.fromCodePoint)!==null&&W0!==void 0?W0:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function qp(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=_x.get(t))!==null&&e!==void 0?e:t}function H0(t){return Up(qp(t))}var or;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.To_LOWER_BIT=32]="To_LOWER_BIT"})(or||(or={}));var ys;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(ys||(ys={}));function Fp(t){return function(r,i){let n="",o=0,a=0;for(;(a=r.indexOf("&",a))>=0;){if(n+=r.slice(o,a),o=a,a+=1,r.charCodeAt(a)===or.NUM){let M=a+1,R=10,x=r.charCodeAt(M);(x|or.To_LOWER_BIT)===or.LOWER_X&&(R=16,a+=1,M+=1);do x=r.charCodeAt(++a);while(x>=or.ZERO&&x<=or.NINE||R===16&&(x|or.To_LOWER_BIT)>=or.LOWER_A&&(x|or.To_LOWER_BIT)<=or.LOWER_F);if(M!==a){let v=r.substring(M,a),E=parseInt(v,R);if(r.charCodeAt(a)===or.SEMI)a+=1;else if(i)continue;n+=H0(E),o=a}continue}let h=0,d=1,m=0,p=t[m];for(;a<r.length&&(m=xx(t,p,m+1,r.charCodeAt(a)),!(m<0));a++,d++){p=t[m];let M=p&ys.VALUE_LENGTH;if(M){(!i||r.charCodeAt(a)===or.SEMI)&&(h=m,d=0);let R=(M>>14)-1;if(R===0)break;m+=R}}if(h!==0){let M=(t[h]&ys.VALUE_LENGTH)>>14;n+=M===1?String.fromCharCode(t[h]&~ys.VALUE_LENGTH):M===2?String.fromCharCode(t[h+1]):String.fromCharCode(t[h+1],t[h+2]),o=a-d+1}}return n+r.slice(o)}}function xx(t,e,r,i){let n=(e&ys.BRANCH_LENGTH)>>7,o=e&ys.JUMP_TABLE;if(n===0)return o!==0&&i===o?r:-1;if(o){let d=i-o;return d<0||d>n?-1:t[r+d]-1}let a=r,h=a+n-1;for(;a<=h;){let d=a+h>>>1,m=t[d];if(m<i)a=d+1;else if(m>i)h=d-1;else return t[d+n]}return-1}var TT=Fp(zp),PT=Fp(jp);var Sx=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]),Mx=String.prototype.codePointAt!=null?(t,e)=>t.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function G0(t,e){return function(i){let n,o=0,a="";for(;n=t.exec(i);)o!==n.index&&(a+=i.substring(o,n.index)),a+=e.get(n[0].charCodeAt(0)),o=n.index+1;return a+i.substring(o)}}var Xu=G0(/[&<>'"]/g,Sx),$p=G0(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),Wp=G0(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]]));var Hp;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(Hp||(Hp={}));var Gp;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict"})(Gp||(Gp={}));var Vp;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(Vp||(Vp={}));var Qu=t=>" ".repeat(t),E1=class{toString(e=0){return Qu(e)+"[VNode]"}},bs=class extends E1{constructor(e){super(),this.text=e}toString(e=0){return Qu(e)+this.textContent}get textContent(){return Xu(this.text)}set textContent(e){this.text=e}},Zo=class extends E1{constructor(e,r,i){super(),this.tag=e,this.attrs=r,this.children=i}get textContent(){return this.children.length===0?"":this.children.length===1?this.children[0].textContent:this.children.map(e=>e.textContent).join("")}set textContent(e){this.children=[new bs(e)]}toString(e=0){let r=this.toStringAttrs(),i=Qu(e),n=this.toStringChildren(e),o=`${i}<${this.tag}${r}`;return n===""?`${o} />`:`${o}>${n}</${this.tag}>`}*tags(e){this.tag===e&&(yield this);for(let r of this.elementChildren())yield*r.tags(e);return null}find(e,...r){for(let i of this.tags(e)){if(i===this)continue;if(r.length===0)return i;let n=i.find(...r);if(n!=null)return n}return null}*elementChildren(){for(let e of this.children)e instanceof Zo&&(yield e);return null}toStringAttrs(){let e=Object.keys(this.attrs);if(e.length===0)return"";let r="";for(let i of e){let n=this.attrs[i];n!=null&&(r+=` ${i}="${n}"`)}return r}toStringChildren(e=0){if(this.children.length===0)return"";if(this.children.length===1){let r=this.children[0];if(r instanceof bs)return r.textContent}return`
137
137
  ${this.children.map(r=>r.toString(e+1)).join(`
138
138
  `)}
139
- ${Hu(e)}`}};function F_(t){if(t==null)return[];if(Array.isArray(t)){let e=[];for(let r of t)if(r!=null){if(typeof r=="string"||typeof r=="number"){e.push(new ms(String(r)));continue}e.push(r)}return e}else if(typeof t=="string"||typeof t=="number")return[new ms(String(t))];return[t]}function J(t,e,r){let i=typeof e=="object"&&!Array.isArray(e);if(!i){if(r!=null)throw new Error("Invalid input");r=e}return new zo(t,i?e:{},F_(r))}var F0;(function(t){t.aerial="aerial"})(F0||(F0={}));var n6=fe(Wm(),1),s6=fe(r6(),1);function i6(t){return[[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],[t[0],t[1]]]]}var{intersection:hS,union:o6}=s6.default;function fS(t,e){return t[0]===e[0]&&t[1]===e[1]}function dS(t,e){return hS(t,i6(e))}function Y0(t,e){let r=[];for(let i of t){let n=n6.default.polygon(i[0],e);n.length!==0&&(fS(n[0],n[n.length-1])||n.push(n[0]),r.push([n]))}return dS(r,e)}var v1=t=>(t<-360?t=-(-t%360):t>360&&(t=t%360),t<-180?360+t:t>180?t-360:t),gs=(t,e)=>{let r=e-t;return r>180?r-360:r<-180?r+360:r},pS=(t,e)=>v1(t+(e<t?e+360-t:e-t)),mi={boxLonCenter(t){return v1(t[0]+.5*(t[2]<t[0]?360+t[2]-t[0]:t[2]-t[0]))},delta:gs,crossesAM(t,e){return Math.sign(gs(t,e))!==Math.sign(e-t)},normLon:v1,normExtent(t){return[v1(t[0]),t[1],v1(t[2]),t[3]]},union(t,e){if(e==null)return t.slice();let r=mi.boxLonCenter(t),i=mi.boxLonCenter(e);if(gs(r,i)<0)return this.union(e,t);let n=t.slice(),s=pS(r,i);return gs(s,e[0])<gs(s,t[0])&&(n[0]=e[0]),gs(s,e[2])>gs(s,t[2])&&(n[2]=e[2]),e[1]<t[1]&&(n[1]=e[1]),e[3]>t[3]&&(n[3]=e[3]),n},intersects(t,e){if(t[1]>e[3]||e[1]>t[3])return!1;let r=t[0],i=e[0],n=r<t[2]?t[2]:t[2]+360,s=i<e[2]?e[2]:e[2]+360;return r<=s&&i<=n||r+360<=s&&i<=n+360||r<=s+360&&i+360<=n},ringToBbox(t){if(t.length<3)throw new Error("Invalid ring");let e=!1,r=t[0],i=r[0],n=r[1],s=i,a=n,c=i;for(let d=1;d<t.length;++d){let p=t[d],m=p[0];mi.crossesAM(c,m)&&(e=!e),e&&(m<0?m+=360:(c+=360,d===1&&(i=s=c))),m<i?i=m:m>s&&(s=m);let S=p[1];S<n?n=S:S>a&&(a=S),c=p[0]}return[this.normLon(i),n,this.normLon(s),a]},multiPolygonToBbox(t){let e=null;for(let r of t){if(r.length===0)continue;let i=r[0];if(i.length<3)continue;let n=this.ringToBbox(i);e=e==null?n:this.union(e,n)}if(e==null)throw new Error("Invalid multipolygon");return e},bboxToMultiPolygon(t){let e=[t[0],t[1]],r=[t[2],t[1]],i=[t[0],t[3]],n=[t[2],t[3]];return t[0]<t[2]?[[[e,i,n,r,e]]]:[[[e,i,[180,n[1]],[180,r[1]],e]],[[n,r,[-180,e[1]],[-180,i[1]],n]]]}};var mS=[-180,-90,180,90],gS=[180,-90,360,90];function yS(t,e,r){return[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t]}function bS(t){let e=[];for(let r of Y0(t,mS))e.push(r);for(let r of Y0(t,gS))e.push(r.map(i=>i.map(n=>[n[0]-360,n[1]])));return e}function Zu(t,e,r=!0){let i=!1,n=!1,s=t.map(a=>a.map(c=>{let d=[];if(c.length===0)return d;let p=c[0],m=null,w=0;for(let S of c){let v=e(S),R=v[0];if(m!=null){let x=mi.crossesAM(w,R);if(x&&(i=!0,n=!n),n&&(R<0?v[0]=R+360:m[0]=w+360),x){let A=(180-v[0])/(m[0]-v[0]),C=e(yS(A,S,p));d.push([180,C[1]])}}d.push(v),p=S,m=v,w=R}return d}));return i&&r?bS(s):s}function vS(t){return{type:"Polygon",coordinates:t}}function a6(t,e={}){return{type:"Feature",geometry:vS(t),properties:e}}function l6(t,e={}){return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:t},properties:e}}var qo=fe(u6(),1);var c6=`PROJCS["NZGD2000 / Chatham Islands TM 2000",
139
+ ${Qu(e)}`}};function Cx(t){if(t==null)return[];if(Array.isArray(t)){let e=[];for(let r of t)if(r!=null){if(typeof r=="string"||typeof r=="number"){e.push(new bs(String(r)));continue}e.push(r)}return e}else if(typeof t=="string"||typeof t=="number")return[new bs(String(t))];return[t]}function Q(t,e,r){let i=typeof e=="object"&&!Array.isArray(e);if(!i){if(r!=null)throw new Error("Invalid input");r=e}return new Zo(t,i?e:{},Cx(r))}var Z0;(function(t){t.aerial="aerial"})(Z0||(Z0={}));var c6=de(Zp(),1),f6=de(u6(),1);function h6(t){return[[[t[0],t[1]],[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],[t[0],t[1]]]]}var{intersection:Kx,union:d6}=f6.default;function Jx(t,e){return t[0]===e[0]&&t[1]===e[1]}function Zx(t,e){return Kx(t,h6(e))}function id(t,e){let r=[];for(let i of t){let n=c6.default.polygon(i[0],e);n.length!==0&&(Jx(n[0],n[n.length-1])||n.push(n[0]),r.push([n]))}return Zx(r,e)}var T1=t=>(t<-360?t=-(-t%360):t>360&&(t=t%360),t<-180?360+t:t>180?t-360:t),vs=(t,e)=>{let r=e-t;return r>180?r-360:r<-180?r+360:r},Yx=(t,e)=>T1(t+(e<t?e+360-t:e-t)),Mn={boxLonCenter(t){return T1(t[0]+.5*(t[2]<t[0]?360+t[2]-t[0]:t[2]-t[0]))},delta:vs,crossesAM(t,e){return Math.sign(vs(t,e))!==Math.sign(e-t)},normLon:T1,normExtent(t){return[T1(t[0]),t[1],T1(t[2]),t[3]]},union(t,e){if(e==null)return t.slice();let r=Mn.boxLonCenter(t),i=Mn.boxLonCenter(e);if(vs(r,i)<0)return this.union(e,t);let n=t.slice(),o=Yx(r,i);return vs(o,e[0])<vs(o,t[0])&&(n[0]=e[0]),vs(o,e[2])>vs(o,t[2])&&(n[2]=e[2]),e[1]<t[1]&&(n[1]=e[1]),e[3]>t[3]&&(n[3]=e[3]),n},intersects(t,e){if(t[1]>e[3]||e[1]>t[3])return!1;let r=t[0],i=e[0],n=r<t[2]?t[2]:t[2]+360,o=i<e[2]?e[2]:e[2]+360;return r<=o&&i<=n||r+360<=o&&i<=n+360||r<=o+360&&i+360<=n},ringToBbox(t){if(t.length<3)throw new Error("Invalid ring");let e=!1,r=t[0],i=r[0],n=r[1],o=i,a=n,h=i;for(let d=1;d<t.length;++d){let m=t[d],p=m[0];Mn.crossesAM(h,p)&&(e=!e),e&&(p<0?p+=360:(h+=360,d===1&&(i=o=h))),p<i?i=p:p>o&&(o=p);let R=m[1];R<n?n=R:R>a&&(a=R),h=m[0]}return[this.normLon(i),n,this.normLon(o),a]},multiPolygonToBbox(t){let e=null;for(let r of t){if(r.length===0)continue;let i=r[0];if(i.length<3)continue;let n=this.ringToBbox(i);e=e==null?n:this.union(e,n)}if(e==null)throw new Error("Invalid multipolygon");return e},bboxToMultiPolygon(t){let e=[t[0],t[1]],r=[t[2],t[1]],i=[t[0],t[3]],n=[t[2],t[3]];return t[0]<t[2]?[[[e,i,n,r,e]]]:[[[e,i,[180,n[1]],[180,r[1]],e]],[[n,r,[-180,e[1]],[-180,i[1]],n]]]}};var Xx=[-180,-90,180,90],Qx=[180,-90,360,90];function eS(t,e,r){return[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t]}function tS(t){let e=[];for(let r of id(t,Xx))e.push(r);for(let r of id(t,Qx))e.push(r.map(i=>i.map(n=>[n[0]-360,n[1]])));return e}function ih(t,e,r=!0){let i=!1,n=!1,o=t.map(a=>a.map(h=>{let d=[];if(h.length===0)return d;let m=h[0],p=null,M=0;for(let R of h){let x=e(R),v=x[0];if(p!=null){let E=Mn.crossesAM(M,v);if(E&&(i=!0,n=!n),n&&(v<0?x[0]=v+360:p[0]=M+360),E){let T=(180-x[0])/(p[0]-x[0]),C=e(eS(T,R,m));d.push([180,C[1]])}}d.push(x),m=R,p=x,M=v}return d}));return i&&r?tS(o):o}function rS(t){return{type:"Polygon",coordinates:t}}function m6(t,e={}){return{type:"Feature",geometry:rS(t),properties:e}}function p6(t,e={}){return{type:"Feature",geometry:{type:"MultiPolygon",coordinates:t},properties:e}}var Xo=de(g6(),1);var y6=`PROJCS["NZGD2000 / Chatham Islands TM 2000",
140
140
  GEOGCS["NZGD2000",
141
141
  DATUM["New_Zealand_Geodetic_Datum_2000",
142
142
  SPHEROID["GRS 1980",6378137,298.257222101,
@@ -158,7 +158,7 @@ PARAMETER["false_easting",3500000],
158
158
  PARAMETER["false_northing",10000000],
159
159
  AUTHORITY["EPSG","3793"],
160
160
  AXIS["Easting",EAST],
161
- AXIS["Northing",NORTH]]`;var h6=`PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
161
+ AXIS["Northing",NORTH]]`;var b6=`PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
162
162
  GEOGCS["NZGD2000",
163
163
  DATUM["New_Zealand_Geodetic_Datum_2000",
164
164
  SPHEROID["GRS 1980",6378137,298.257222101,
@@ -178,11 +178,11 @@ PARAMETER["false_easting",1600000],
178
178
  PARAMETER["false_northing",10000000],
179
179
  UNIT["metre",1,
180
180
  AUTHORITY["EPSG","9001"]],
181
- AUTHORITY["EPSG","2193"]]`;qo.default.defs(Se.Nztm2000.toEpsgString(),h6);qo.default.defs(Se.Citm2000.toEpsgString(),c6);var ed=new Map;function wS(t){return t==null?null:typeof t=="number"?t:"code"in t?t.code:"projection"in t?t.projection.code:null}var qr=class{constructor(e){this.epsg=e;try{this.projection=(0,qo.default)(e.toEpsgString(),Se.Wgs84.toEpsgString())}catch(r){throw new Je(`Failed to create projection: ${e.toEpsgString()}, ${Se.Wgs84.toEpsgString()}`,500,r)}}static define(e,r){if(ed.get(e.code)!=null)throw new Error("Duplicate projection definition: "+e.toEpsgString());qo.default.defs(e.toEpsgString(),r)}static get(e){let r=this.tryGet(e);if(r==null)throw new Error(`Invalid projection: ${e}`);return r}static tryGet(e){let r=wS(e);if(r==null)return null;let i=ed.get(r);if(i!=null)return i;let n=Se.tryGet(r);return n==null||qo.default.defs(n.toEpsgString())==null?null:(i=new qr(n),ed.set(r,i),i)}projectMultipolygon(e,r){if(r.epsg.code===this.epsg.code)return e;let{toWgs84:i}=this,{fromWgs84:n}=r;return e.map(s=>s.map(a=>a.map(c=>n(i(c)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(e){let r=this.toWgs84([e.x,e.y]),i=this.toWgs84([e.x+e.width,e.y+e.height]);return[r[0],r[1],i[0],i[1]]}boundsToGeoJsonFeature(e,r={}){let i=[e.x,e.y],n=[e.x+e.width,e.y],s=[e.x,e.y+e.height],a=[e.x+e.width,e.y+e.height],c=Zu([[[i,s,a,n,i]]],this.toWgs84),d=c.length===1?a6(c[0],r):l6(c,r);return d.bbox=this.boundsToWgs84BoundingBox(e),d}toGeoJson(e){return{type:"FeatureCollection",features:e.map(r=>this.boundsToGeoJsonFeature(r,{name:r.name}))}}static getTiffResZoom(e,r,i=1){let n=0;for(;n<e.zooms.length;++n)if(e.pixelScale(n)<=r*i)return n;if(n===e.zooms.length)return n-1;throw new Error("ResZoom not found")}static tileToWgs84Bbox(e,r){let i=e.tileToSource(r),n=e.tileToSource({x:r.x+1,y:r.y+1,z:r.z}),s=this.get(e),[a,c]=s.toWgs84([i.x,n.y]),[d,p]=s.toWgs84([n.x,i.y]);return[a,c,d,p]}static tileCenterToLatLon(e,r){let i=e.tileToSource({x:r.x+.5,y:r.y+.5,z:r.z}),[n,s]=this.get(e).toWgs84([i.x,i.y]);return qr.wrapLatLon(s,n)}static wrapLatLon(e,r){let i={lat:e,lon:r},n=Math.floor(Math.abs(e)/90)%4,s=e>0?90:-90,a=e%90;switch(n){case 0:i.lat=a;break;case 1:i.lat=s-a,i.lon+=180;break;case 2:i.lat=-a,i.lon+=180;break;case 3:i.lat=-s+a;break}return(i.lon>180||i.lon<-180)&&(i.lon-=Math.floor((i.lon+180)/360)*360),i}static findAlignmentLevels(e,r,i){return Math.max(0,this.getTiffResZoom(e,i,2)-r.z)}static getImagePixelWidth(e,r,i){let n=e.tileToSource(r),s=e.tileToSource({x:r.x+1,y:r.y+1,z:r.z});return Math.round((s.x-n.x)/e.pixelScale(i))*2}};function f6(t){return t==null||typeof t=="string"?!1:"roleArn"in t&&typeof t.roleArn=="string"}var d6=fe(require("aws-sdk/lib/core.js"),1),p6=fe(require("aws-sdk/clients/s3.js"),1);function Uo(t){return"promise"in t?t.promise():t}function $o(t,e){return Ai(t)?typeof t.statusCode!="number"?new Je(e,500,t):new Je(e,t.statusCode,t):new Je(e,500,t)}var Ft=class extends xt{constructor(e,r,i){super(),this.type=Ft.type,this.protocol="s3",this.chunkSize=Ft.DefaultChunkSize,this.maxChunkCount=Ft.DefaultMaxChunkCount,this.bucket=e,this.key=r,this.remote=i}get uri(){return this.name}get name(){return`s3://${this.bucket}/${this.key}`}static isSource(e){return e.type===Ft.type}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>(await Uo(this.remote.headObject({Bucket:this.bucket,Key:this.key}))).ContentLength||-1),this._size)}static fromUri(e,r){let i=ni(e);return i==null||i.key==null||i.protocol!=="s3"?null:new Ft(i.bucket,i.key,r)}async fetchBytes(e,r){let i=this.toRange(e,r);try{let n=await this.remote.getObject({Bucket:this.bucket,Key:this.key,Range:i}).promise();if(!Buffer.isBuffer(n.Body))throw new Error("Failed to fetch object, Body is not a buffer");n.ContentRange!=null&&this._size==null&&(this._size=Promise.resolve(this.parseContentRange(n.ContentRange)));let s=n.Body;return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}catch(n){throw $o(n,`Failed to fetch ${this.name} ${i}`)}}};Ft.type="aws:s3";Ft.DefaultChunkSize=64*1024;Ft.DefaultMaxChunkCount=32;var Ht=class{constructor(e){this.protocol=Ht.protocol,this.s3=e}source(e){let r=Ft.fromUri(e,this.s3);if(r==null)throw new Error(`Failed to create aws s3 source from uri: ${e}`);return r}static is(e){return e.protocol===Ht.protocol}static isPath(e){return e==null?!1:e.startsWith("s3://")}async*list(e,r){for await(let i of this.details(e,r))yield i.path}async*details(e,r){let i=ni(e);if(i==null)return;let n,s=r?.recursive===!1?"/":void 0,a=i.bucket,c=i.key,d=0;try{for(;;){d++;let p=await Uo(this.s3.listObjectsV2({Bucket:a,Prefix:c,ContinuationToken:n,Delimiter:s}));if(p.CommonPrefixes!=null)for(let m of p.CommonPrefixes)m.Prefix!=null&&(yield{path:`s3://${a}/${m.Prefix}`,isDirectory:!0});if(p.Contents!=null)for(let m of p.Contents)m.Key!=null&&(yield{path:`s3://${a}/${m.Key}`,size:m.Size});if(!p.IsTruncated)break;if(d>=Ht.MaxListCount)throw new Error(`Failed to finish listing within ${Ht.MaxListCount} list attempts`);n=p.NextContinuationToken}}catch(p){throw $o(p,`Failed to list: "${e}"`)}}async read(e){let r=ni(e);if(r==null||r.key==null)throw new Error(`Failed to read: "${e}"`);try{return(await this.s3.getObject({Bucket:r.bucket,Key:r.key}).promise()).Body}catch(i){throw $o(i,`Failed to read: "${e}"`)}}async write(e,r,i){let n=ni(e);if(n==null||n.key==null)throw new Error(`Failed to write: "${e}"`);try{await Uo(this.s3.upload({Bucket:n.bucket,Key:n.key,Body:r,ContentEncoding:i?.contentEncoding,ContentType:i?.contentType}))}catch(s){throw $o(s,`Failed to write: "${e}"`)}}exists(e){return this.head(e).then(r=>r!=null)}stream(e){let r=ni(e);if(r==null||r.key==null)throw new Error(`S3: Unable to read "${e}"`);return this.s3.getObject({Bucket:r.bucket,Key:r.key}).createReadStream()}async head(e){let r=ni(e);if(r==null||r.key==null)throw new Error(`Failed to exists: "${e}"`);try{return{size:(await Uo(this.s3.headObject({Bucket:r.bucket,Key:r.key}))).ContentLength,path:e}}catch(i){if(Ai(i)&&i.code==="NotFound")return null;throw $o(i,`Failed to exists: "${e}"`)}}};Ht.protocol="s3";Ht.MaxListCount=100;var Gt=class{static fsFromRole(e,r,i){if(typeof e=="object")return Gt.fsFromRole(e.roleArn,e.externalId,e.durationSeconds);let n=Gt.role(e,r,i);return new Ht(new p6.default({credentials:n}))}static role(e,r,i){i=i??Gt.DefaultRoleDurationSeconds;let n=`role::${e}::${r}::${i}`,s=Gt.cache.get(n);return s==null&&(s=new d6.default.ChainableTemporaryCredentials({params:{RoleArn:e,ExternalId:r,RoleSessionName:"fsa-"+Math.random().toString(32)+"-"+Date.now(),DurationSeconds:i}}),Gt.cache.set(n,s)),s}};Gt.DefaultRoleDurationSeconds=3600;Gt.cache=new Map;var m6=fe(require("aws-sdk/clients/s3.js"),1),g6=require("util"),Ju=require("zlib");var _S=(0,g6.promisify)(Ju.gunzip),lr=Ye;lr.readJson=async function(e){let r=await this.read(e);return e.endsWith(".gz")?JSON.parse((await _S(r)).toString()):JSON.parse(r.toString())};lr.writeJson=async function(e,r){let i=Buffer.from(JSON.stringify(r,void 0,2));if(e.endsWith(".gz")){let n=(0,Ju.createGzip)();return n.end(i),this.write(e,n)}else return this.write(e,i)};lr.configure=function(e){if(e.type!=="s3"||!f6(e))return;let r=ni(e.path);if(r==null)throw new Error("Failed to parse URI: "+e.path);let i=`s3://${r.bucket}/`;this.register(i,Gt.fsFromRole(e.roleArn,e.externalId))};lr.register("s3://",new Ht(new m6.default));function w1(t){return t[0].toUpperCase()+t.slice(1).replace(/_(\d+)-(\d+)m/g," $1.$2m").replace(/_/g," ")}function y6(t){let e=/(?:^|\D)(\d{4})(?:-(\d{2}))?(?:$|\D)/g,r=[];for(let i=e.exec(t);i!=null;i=e.exec(t))r.push(parseInt(i[1])),i[2]!=null&&r.push(parseInt(i[1].slice(0,2)+i[2]));return r.length===0?[-1,-1]:(r.sort(),[r[0],r[r.length-1]+1])}process.env.AWS_NODEJS_CONNECTION_REUSE_ENABLED="1";je.setConfigProvider(new Ua(Co.TileMetadata.TableName));var h4=fe(n0(),1);var _n="application/json",ue;(function(t){t.CacheControl="Cache-Control",t.ContentEncoding="Content-Encoding",t.ContentType="Content-Type",t.Cors="Access-Control-Allow-Origin",t.ETag="ETag",t.IfNoneMatch="If-None-Match",t.Server="Server",t.ServerTiming="Server-Timing"})(ue||(ue={}));var Wo;(function(t){t.CloudfrontId="X-Amz-Cf-Id",t.TraceId="X-Amzn-Trace-Id"})(Wo||(Wo={}));var Ur;(function(t){t.CorrelationId="X-LINZ-Correlation-Id",t.RequestId="X-LINZ-Request-Id"})(Ur||(Ur={}));var ys=class{constructor(){if(this.timers=new Map,typeof process<"u"&&typeof process.hrtime.bigint=="function"){let e=BigInt(1e6);this.getTime=()=>Number(process.hrtime.bigint()/e)}else typeof typeof performance<"u"?this.getTime=()=>performance.now():this.getTime=()=>Date.now()}start(e){let r=this.timers.get(e);if(r!=null&&r.duration==null)throw new Error(`Duplicate startTime for "${e}"`);this.timers.set(e,{start:this.getTime()})}end(e){let r=this.timers.get(e);if(r==null)throw new Error(`Missing startTime information for "${e}"`);let i=this.getTime()-r.start;return r.duration=i,i}get metrics(){if(this.timers.size===0)return;let e={};for(let[r,i]of this.timers.entries())i.duration!=null&&(e[r]=i.duration);return e}get unfinished(){let e=[];for(let[r,i]of this.timers.entries())i.duration==null&&e.push(r);if(e.length!==0)return e}};var b6=fe(Zn(),1);function kt(t){return!(typeof t!="object"||t==null)}var bs=class{constructor(e,r,i){this.logContext={},this.timer=new ys,this.headers=new Map,this.context=r,this.event=e,this.id=(0,b6.ulid)(),this.log=i,this.timer=new ys,this.log=i.child({id:this.id,aws:{lambdaId:r.awsRequestId}})}set(e,r){r==null&&(r=void 0),this.logContext[e]=r}toResponse(e){return e?.body}};var w6=require("url");var v6=fe(Zn(),1);var ur=class extends bs{constructor(e,r,i){var n;super(e,r,i),this.headers=new Map,this.correlationId=(n=this.header(Ur.CorrelationId))!==null&&n!==void 0?n:v6.ulid(),this.set("correlationId",this.correlationId)}header(e){return this._isHeadersLoaded!==!0&&(this.loadHeaders(),this._isHeadersLoaded=!0),this.headers.get(e.toLowerCase())}json(){var e;if(this.header(ue.ContentType)!==_n)throw new Error(`Invalid Content-Type: "${this.header("content-type")}"`);if(this.body==null)throw new Error("Cannot parse empty body as JSON");try{return this.isBase64Encoded?JSON.parse(Buffer.from((e=this.body)!==null&&e!==void 0?e:"","base64").toString()):JSON.parse(this.body)}catch{throw new Error("Body is not a JSON object")}}get query(){return this._query==null&&(this._query=this.loadQueryString()),this._query}get url(){return this.path}};var Fo=class extends ur{static is(e){return kt(e)&&kt(e.requestContext)&&kt(e.requestContext.elb)}toResponse(e){return{statusCode:e.status,statusDescription:e.statusDescription,body:e.body,headers:this.toHeaders(e.headers),isBase64Encoded:e.isBase64Encoded}}toHeaders(e){if(e.size===0)return;let r={};for(let i of e)r[i[0]]=i[1];return r}loadHeaders(){if(this.event.headers!=null)for(let[e,r]of Object.entries(this.event.headers))r!=null&&this.headers.set(e.toLowerCase(),r)}loadQueryString(){let e=new w6.URLSearchParams;if(this.event.queryStringParameters==null)return e;for(let[r,i]of Object.entries(this.event.queryStringParameters))e.append(r.toLowerCase(),i??"true");return e}get method(){return this.event.httpMethod.toUpperCase()}get path(){return this.event.path}get body(){return this.event.body}get isBase64Encoded(){return this.event.isBase64Encoded}};var _6=require("url");var gi=class extends ur{static is(e){return!(!kt(e)||!kt(e.requestContext)||typeof e.requestContext.apiId!="string"||typeof e.requestContext.resourceId!="string"||typeof e.requestContext.httpMethod!="string")}toResponse(e){return{statusCode:e.status,body:e.body,headers:gi.toHeaders(e),isBase64Encoded:e.isBase64Encoded}}static toHeaders(e){if(e.headers.size===0)return;let r={};for(let i of e.headers)r[i[0]]=i[1];return r}loadHeaders(){if(this.event.headers!=null)for(let[e,r]of Object.entries(this.event.headers))r!=null&&this.headers.set(e.toLowerCase(),r)}loadQueryString(){let e=new _6.URLSearchParams;if(this.event.multiValueQueryStringParameters==null)return e;for(let[r,i]of Object.entries(this.event.multiValueQueryStringParameters))if(i!=null)for(let n of i)e.append(r.toLowerCase(),n);return e}get path(){return this.event.path}get method(){return this.event.httpMethod.toUpperCase()}get body(){return this.event.body}get isBase64Encoded(){return this.event.isBase64Encoded}};var td=require("url");var Ho=class extends ur{static is(e){if(!kt(e)||!Array.isArray(e.Records))return!1;let r=e.Records[0];return kt(r)?kt(r.cf):!1}toResponse(e){if(e.status===100&&this.event!=null){let r=this.event.Records[0].cf.request;for(let[i,n]of e.headers)r.headers[i.toLowerCase()]=[{key:i,value:String(n)}];return this.event.Records[0].cf.request}return{status:String(e.status),statusDescription:e.statusDescription,body:e.body,headers:this.toHeaders(e),bodyEncoding:"text"}}toHeaders(e){if(e.headers.size===0)return{};let r={};for(let i of e.headers)r[i[0]]=[{key:i[0],value:String(i[1])}];return r}loadHeaders(){var e;for(let[r,i]of Object.entries(this.event.Records[0].cf.request.headers))this.headers.set(r.toLowerCase(),(e=i[0])===null||e===void 0?void 0:e.value)}loadQueryString(){let e=this.event.Records[0].cf.request.querystring;return e==null?new td.URLSearchParams:new td.URLSearchParams(e.toLowerCase())}get path(){return this.event.Records[0].cf.request.uri}get method(){return this.event.Records[0].cf.request.method.toUpperCase()}get body(){let e=this.event.Records[0].cf.request.body;return e==null?null:e.data}get isBase64Encoded(){var e;return((e=this.event.Records[0].cf.request.body)===null||e===void 0?void 0:e.encoding)==="base64"}};var Y=class{constructor(e,r,i){if(this._body=null,this.headers=new Map,this.status=e,this.statusDescription=r,i!=null)for(let n of Object.keys(i))this.header(n,i[n])}static is(e){return e instanceof Y}static ok(e=200,r="Ok"){return new Y(e,r)}header(e,r){let i=e.toLowerCase();if(r==null)return this.headers.get(i);this.headers.set(i,r)}get isBase64Encoded(){return Buffer.isBuffer(this._body)}json(e){return this.buffer(JSON.stringify(e),_n),this}buffer(e,r=_n){return this.header(ue.ContentType,r),this._body=e,this}get body(){return this._body==null?(this.header(ue.ContentType,_n),JSON.stringify({id:this.header(Ur.RequestId),status:this.status,message:this.statusDescription,correlationId:this.header(Ur.CorrelationId)})):Buffer.isBuffer(this._body)?this._body.toString("base64"):this._body}};var l4=fe(a4(),1),oc=class{constructor(){this.hooks={request:[],response:[]},this.router=(0,l4.default)({defaultRoute:()=>new Y(404,"Not found")})}register(e,r,i){this.router.on(e,r,async(n,s,a)=>n instanceof ur?(n.params=a,yd(n,i)):new Y(500,"Internal server error"))}hook(e,r){this.hooks[e].push(r)}get(e,r){return this.register("GET",e,r)}post(e,r){return this.register("POST",e,r)}delete(e,r){return this.register("DELETE",e,r)}options(e,r){return this.register("OPTIONS",e,r)}patch(e,r){return this.register("PATCH",e,r)}head(e,r){return this.register("HEAD",e,r)}put(e,r){return this.register("PUT",e,r)}async after(e,r){try{for(let i of this.hooks.response)await i(e,r)}catch(i){return Y.is(i)?i:(e.set("err",i),new Y(500,"Internal Server Error"))}return r}async handle(e){for(let i of this.hooks.request){let n=await gd(e,i);if(n)return this.after(e,n)}let r=await this.router.lookup(e,null);return r?this.after(e,r):this.after(e,new Y(404,"Not found"))}};var u4=require("url");var Yo=class extends ur{toResponse(e){return{statusCode:e.status,body:e.body,headers:gi.toHeaders(e),isBase64Encoded:e.isBase64Encoded}}loadHeaders(){for(let[e,r]of Object.entries(this.event.headers))this.headers.set(e.toLowerCase(),r)}loadQueryString(){return new u4.URLSearchParams(this.event.rawQueryString)}get method(){return this.event.requestContext.http.method.toUpperCase()}get path(){return this.event.rawPath}get isBase64Encoded(){return this.event.isBase64Encoded}get body(){return this.event.body==null?null:this.event.body}static is(e){return!(!kt(e)||!kt(e.requestContext)||!kt(e.requestContext.http))}};var f4="v6.30.0",ZS="c4858d318fd769e086a11e8b2a8f052b54964aab",c4={version:f4,hash:ZS};async function gd(t,e){try{return await e(t)}catch(r){return Y.is(r)?r:(t.set("err",r),new Y(500,"Internal Server Error"))}}async function yd(t,e){t.timer.start("lambda");let r=await gd(t,e),i=200;Y.is(r)&&(i=r.status,t.set("description",r.statusDescription)),t.set("status",i),t.timer.timers.size>0&&t.set("metrics",t.timer.metrics),c4.hash&&t.set("package",c4);let n=t.timer.end("lambda");return t.set("unfinished",t.timer.unfinished),t.set("duration",n),t.set("@type","report"),i>499?t.log.error(t.logContext,"Lambda:Done"):i>399?t.log.warn(t.logContext,"Lambda:Done"):t.log.info(t.logContext,"Lambda:Done"),r}function JS(t){let e={rejectOnError:!0,tracePercent:0,...t};if(isNaN(e.tracePercent)||e.tracePercent>1)throw new Error("tracePercent is not between 0-1 :"+e.tracePercent);return e}var cr=class{static request(e,r,i){if(Fo.is(e))return new Fo(e,r,i);if(Yo.is(e))return new Yo(e,r,i);if(gi.is(e))return new gi(e,r,i);if(Ho.is(e))return new Ho(e,r,i);throw new Error("Request is not a a ALB, ApiGateway or Cloudfront event")}static handler(e,r,i){let n=JS(r);function s(a,c,d){let p=new bs(a,c,i??cr.Logger);n.tracePercent>0&&Math.random()<n.tracePercent&&(p.log.level="trace"),process.env.TRACE_LAMBDA&&(p.log.level="trace"),p.log.trace({event:a},"Lambda:Start");let m=c.awsRequestId;p.set("aws",{lambdaId:m}),yd(p,e).then(w=>{if(n.rejectOnError&&Y.is(w)){if(p.logContext.err)return d(p.logContext.err);if(w.status>399)return d(p.toResponse(w))}return d(null,p.toResponse(w))})}return s}static http(e){let r=new oc;function i(n,s,a){let c=cr.request(n,s,e??cr.Logger),d=c.header(Wo.CloudfrontId),p=c.header(Wo.TraceId),m=s.awsRequestId;(d||p||m)&&c.set("aws",{cloudFrontId:d,traceId:p,lambdaId:m}),c.set("method",c.method),c.set("path",c.path),r.handle(c).then(w=>{var S;w.status===500&&w.header(ue.CacheControl,"no-store"),w.header(Ur.RequestId,c.id),w.header(Ur.CorrelationId,c.correlationId);let v=(S=c.timer.metrics)===null||S===void 0?void 0:S.lambda;v!=null&&w.header(ue.ServerTiming,`total;dur=${v}`),!w.isBase64Encoded&&w.header(ue.ContentType)==null&&w.header(ue.ContentType,_n),cr.ServerName&&w.header(ue.Server,`${cr.ServerName}-${f4}`),a(null,c.toResponse(w))})}return i.router=r,i}};cr.Logger=(0,h4.default)();cr.ServerName="linz";var lg=require("crypto");var it=class{constructor(){this.handlers={}}static action(e){let r=e.path,[i,n,...s]=(r[0]==="/"?r.slice(1):r).split("/").map(a=>decodeURIComponent(a));return n==null?{version:"v1",name:i,rest:[]}:{version:i,name:n,rest:s}}static apiKey(e){let r=e.query.get(Co.ApiKey.QueryString)??e.header("X-LINZ-Api-Key");if(r!=null&&!Array.isArray(r))return e.set(Co.ApiKey.QueryString,this.apiKey),r}async handle(e){if(e.method==="options")return new Y(200,"Options",{[ue.Cors]:"*","Access-Control-Allow-Credentials":"false","Access-Control-Allow-Methods":"OPTIONS,GET,PUT,POST,DELETE"});if(e.method!=="GET")return new Y(405,"Method not allowed");let r=it.action(e),i=r.version==="v1"?this.handlers[r.name]:null;if(i==null)return new Y(404,"Not Found");let n=await i(e);return n.header(ue.Cors,"*"),n}get(e,r){if(this.handlers[e]!=null)throw new Error(e+" already registered");this.handlers[e]=r}};var d4=new Y(200,"ok");d4.header(ue.CacheControl,"no-store");async function bd(){return d4}async function vd(){let t=new Y(200,"ok");return t.header(ue.CacheControl,"no-store"),t.json({version:"v6.30.0",hash:"c4858d318fd769e086a11e8b2a8f052b54964aab"}),t}var Sc=fe(require("path"),1);var Ne=class{constructor(e){this.name=e}raw(e,r=0){return this.parse(e,{offset:r,startOffset:0})}read(e,r=0){let i={offset:r,startOffset:r};return{value:this.parse(e,i),offset:i.offset}}refine(e){return new wd(this,e)}},wd=class extends Ne{constructor(e,r){super("Function:"+e.name),this.input=e,this.cb=r}get size(){return this.input.size}parse(e,r){let i=this.input.parse(e,r);return this.cb(i,e,r)}};var ac=class extends Ne{constructor(e,r,i){super(`Array:${e}:${r.name}x${i}`),this.count=i,this.type=r}get size(){return this.count*this.type.size}parse(e,r){let i=[];for(let n=0;n<this.count;n++)i.push(this.type.parse(e,r));return i}},lc=class extends Ne{constructor(e,r,i,n){super("Array:Offset:"+e),this.isLookupRequired=!0,this.isMaxLength=n,this.lengthName=i,this.type=r}get size(){throw new Error("Unable to calculate size of dynamic object: "+this.name)}parse(e,r,i){let n=[],s=i?.[this.lengthName];if(s==null||typeof s!="number")throw new Error(`${this.name}: Missing variable a "${this.lengthName}"`);this.isMaxLength&&(s-=r.offset-r.startOffset);for(let a=0;a<s;a++)n.push(this.type.parse(e,r));return n}};var p4=[];for(let t=0;t<64;t++)p4[t]=Math.pow(2,t);var R1=class{constructor(e,r=0,i=e.length,n=!0){if(this.buffer=e,this.offset=r*8,this.maxOffset=i*8,this.isLittleEndian=n,!this.isLittleEndian)throw new Error("BigEndian is not supported")}get remainingBits(){return this.maxOffset-this.offset}getBitValue(e,r,i){return(e&((1<<r+i)-1&~((1<<r)-1)))>>r}skip(e){this.offset+=e}bit(){if(this.remainingBits<0)throw new Error("BitStream: Overflow "+this.remainingBits);let e=Math.floor(this.offset/8),r=this.offset%8,i=this.buffer[e];return this.offset++,this.getBitValue(i,r,1)}bool(){return this.bit()===1}bits(e){let r=e,i=0;for(;e>0;)this.bit()===1&&(i+=p4[r-e]),e--;return i}string(e){let r=[];e==null&&(e=Math.floor(this.remainingBits/8));for(let i=0;i<e;i++){let n=this.bits(8);if(n===0)break;r.push(String.fromCharCode(n))}return r.join("")}};var uc=class extends Ne{constructor(e,r){super("Bits:"+e);let i=0;this.fields=Object.keys(r).map(n=>{let s=r[n];return i+=s,{key:n,bits:s}}),this.size=Math.ceil(i/8)}parse(e,r){let i=r.offset,n={},s=new R1(e,i,i+this.size);for(let{key:a,bits:c}of this.fields)n[a]=s.bits(c);return r.offset+=this.size,n}},cc=class extends Ne{constructor(e,r,i){super("BitsFlags:"+e),this.type=r,this.fields=Object.entries(i)}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n={};for(let[s,a]of this.fields){let c=(i&a)===a;c&&(n[s]=c)}return n}};var hc=class extends Ne{constructor(e){super("Bytes:"+e),this.size=e}parse(e,r){let i=e.slice(r.offset,r.offset+this.size);return r.offset+=this.size,i}};var _d=class extends Ne{constructor(){super(...arguments),this.size=1}parse(e,r){let i=r.offset;return r.offset+=this.size,e[i]}},Sd=class extends Ne{constructor(){super(...arguments),this.size=2}parse(e,r){let i=r.offset,n=e[i++],s=e[i++]<<8;return r.offset+=2,n|s}},xd=class extends Ne{constructor(){super(...arguments),this.size=4}parse(e,r){let i=r.offset,n=e[i++],s=e[i++]<<8,a=e[i++]<<16,c=e[i++]*16777216;return r.offset=i,(n|s|a)+c}},YS=2**32,Md=class extends Ne{constructor(){super(...arguments),this.size=8}parse(e,r){let i=Xo.parse(e,r),n=Xo.parse(e,r);return i+n*YS}},Ed=class extends Ne{constructor(){super(...arguments),this.size=8}parse(e,r){let i=BigInt(Xo.parse(e,r)),n=BigInt(Xo.parse(e,r));return i+(n<<BigInt(32))}},m4=new _d("UInt8"),g4=new Sd("LUInt16"),Xo=new xd("LUInt32"),y4=new Md("LUInt64"),b4=new Ed("BigLUInt64");var fc=class extends Ne{constructor(e,r,i){super("Lookup:"+e),this.lookup=i,this.type=r}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n=this.lookup(i);if(n==null)throw new Error(`${this.name}: Failed to lookup ${i}`);return{id:i,name:n}}},dc=class extends Ne{constructor(e,r,i){super("Enum:"+e),this.enumeration=i,this.type=r}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n=this.enumeration[i];if(n==null)throw new Error(`${this.name}: Failed to lookup ${i}`);return{id:i,name:n}}};var Qo=class extends Ne{constructor(e,r){super(e),this._size=-1,this.fields=[];for(let[i,n]of Object.entries(r))this.fields.push({key:i,parser:n})}get size(){if(this._size>-1)return this._size;let e=0;for(let r of this.fields)e+=r.parser.size;return this._size=e,this._size}parse(e,r){let i={};for(let n of this.fields)i[n.key]=n.parser.parse(e,r,i);return i}},pc=class extends Ne{constructor(e,r){super(e),this.fields=[],this._size=-1;let i=Object.entries(r),n=!1;for(let[s,a]of i)a.isLookupRequired&&(n=!0),this.fields.push({key:s,parser:a});i.length!==0&&(n?this.generateObjectAssign():this.generateSingleObject())}generateSingleObject(){let e=[],r='"use strict"; return {';for(let n=0;n<this.fields.length;n++)e.push(this.fields[n].parser),r+=` ${JSON.stringify(this.fields[n].key)}: _bp[${n}].parse(buf, ctx),`;r+=" };";let i=new Function("_bp","buf","ctx",r);this.parse=i.bind(null,e)}generateObjectAssign(){let e=[],r=`"use strict"; const ret = {};
181
+ AUTHORITY["EPSG","2193"]]`;Xo.default.defs(_e.Nztm2000.toEpsgString(),b6);Xo.default.defs(_e.Citm2000.toEpsgString(),y6);var od=new Map;function iS(t){return t==null?null:typeof t=="number"?t:"code"in t?t.code:"projection"in t?t.projection.code:null}var Ur=class{constructor(e){this.epsg=e;try{this.projection=(0,Xo.default)(e.toEpsgString(),_e.Wgs84.toEpsgString())}catch(r){throw new Ye(`Failed to create projection: ${e.toEpsgString()}, ${_e.Wgs84.toEpsgString()}`,500,r)}}static define(e,r){if(od.get(e.code)!=null)throw new Error("Duplicate projection definition: "+e.toEpsgString());Xo.default.defs(e.toEpsgString(),r)}static get(e){let r=this.tryGet(e);if(r==null)throw new Error(`Invalid projection: ${e}`);return r}static tryGet(e){let r=iS(e);if(r==null)return null;let i=od.get(r);if(i!=null)return i;let n=_e.tryGet(r);return n==null||Xo.default.defs(n.toEpsgString())==null?null:(i=new Ur(n),od.set(r,i),i)}projectMultipolygon(e,r){if(r.epsg.code===this.epsg.code)return e;let{toWgs84:i}=this,{fromWgs84:n}=r;return e.map(o=>o.map(a=>a.map(h=>n(i(h)))))}get toWgs84(){return this.projection.forward}get fromWgs84(){return this.projection.inverse}boundsToWgs84BoundingBox(e){let r=this.toWgs84([e.x,e.y]),i=this.toWgs84([e.x+e.width,e.y+e.height]);return[r[0],r[1],i[0],i[1]]}boundsToGeoJsonFeature(e,r={}){let i=[e.x,e.y],n=[e.x+e.width,e.y],o=[e.x,e.y+e.height],a=[e.x+e.width,e.y+e.height],h=ih([[[i,o,a,n,i]]],this.toWgs84),d=h.length===1?m6(h[0],r):p6(h,r);return d.bbox=this.boundsToWgs84BoundingBox(e),d}toGeoJson(e){return{type:"FeatureCollection",features:e.map(r=>this.boundsToGeoJsonFeature(r,{name:r.name}))}}static getTiffResZoom(e,r,i=1){let n=0;for(;n<e.zooms.length;++n)if(e.pixelScale(n)<=r*i)return n;if(n===e.zooms.length)return n-1;throw new Error("ResZoom not found")}static tileToWgs84Bbox(e,r){let i=e.tileToSource(r),n=e.tileToSource({x:r.x+1,y:r.y+1,z:r.z}),o=this.get(e),[a,h]=o.toWgs84([i.x,n.y]),[d,m]=o.toWgs84([n.x,i.y]);return[a,h,d,m]}static tileCenterToLatLon(e,r){let i=e.tileToSource({x:r.x+.5,y:r.y+.5,z:r.z}),[n,o]=this.get(e).toWgs84([i.x,i.y]);return Ur.wrapLatLon(o,n)}static wrapLatLon(e,r){let i={lat:e,lon:r},n=Math.floor(Math.abs(e)/90)%4,o=e>0?90:-90,a=e%90;switch(n){case 0:i.lat=a;break;case 1:i.lat=o-a,i.lon+=180;break;case 2:i.lat=-a,i.lon+=180;break;case 3:i.lat=-o+a;break}return(i.lon>180||i.lon<-180)&&(i.lon-=Math.floor((i.lon+180)/360)*360),i}static findAlignmentLevels(e,r,i){return Math.max(0,this.getTiffResZoom(e,i,2)-r.z)}static getImagePixelWidth(e,r,i){let n=e.tileToSource(r),o=e.tileToSource({x:r.x+1,y:r.y+1,z:r.z});return Math.round((o.x-n.x)/e.pixelScale(i))*2}};function v6(t){return t==null||typeof t=="string"?!1:"roleArn"in t&&typeof t.roleArn=="string"}var w6=de(require("aws-sdk/lib/core.js"),1),_6=de(require("aws-sdk/clients/s3.js"),1);function Qo(t){return"promise"in t?t.promise():t}function ea(t,e){return Ri(t)?typeof t.statusCode!="number"?new Ye(e,500,t):new Ye(e,t.statusCode,t):new Ye(e,500,t)}var Vt=class extends St{constructor(e,r,i){super(),this.type=Vt.type,this.protocol="s3",this.chunkSize=Vt.DefaultChunkSize,this.maxChunkCount=Vt.DefaultMaxChunkCount,this.bucket=e,this.key=r,this.remote=i}get uri(){return this.name}get name(){return`s3://${this.bucket}/${this.key}`}static isSource(e){return e.type===Vt.type}get size(){return this._size?this._size:(this._size=Promise.resolve().then(async()=>(await Qo(this.remote.headObject({Bucket:this.bucket,Key:this.key}))).ContentLength||-1),this._size)}static fromUri(e,r){let i=ei(e);return i==null||i.key==null||i.protocol!=="s3"?null:new Vt(i.bucket,i.key,r)}async fetchBytes(e,r){let i=this.toRange(e,r);try{let n=await this.remote.getObject({Bucket:this.bucket,Key:this.key,Range:i}).promise();if(!Buffer.isBuffer(n.Body))throw new Error("Failed to fetch object, Body is not a buffer");n.ContentRange!=null&&this._size==null&&(this._size=Promise.resolve(this.parseContentRange(n.ContentRange)));let o=n.Body;return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}catch(n){throw ea(n,`Failed to fetch ${this.name} ${i}`)}}};Vt.type="aws:s3";Vt.DefaultChunkSize=64*1024;Vt.DefaultMaxChunkCount=32;var Kt=class{constructor(e){this.protocol=Kt.protocol,this.s3=e}source(e){let r=Vt.fromUri(e,this.s3);if(r==null)throw new Error(`Failed to create aws s3 source from uri: ${e}`);return r}static is(e){return e.protocol===Kt.protocol}static isPath(e){return e==null?!1:e.startsWith("s3://")}async*list(e,r){for await(let i of this.details(e,r))yield i.path}async*details(e,r){let i=ei(e);if(i==null)return;let n,o=r?.recursive===!1?"/":void 0,a=i.bucket,h=i.key,d=0;try{for(;;){d++;let m=await Qo(this.s3.listObjectsV2({Bucket:a,Prefix:h,ContinuationToken:n,Delimiter:o}));if(m.CommonPrefixes!=null)for(let p of m.CommonPrefixes)p.Prefix!=null&&(yield{path:`s3://${a}/${p.Prefix}`,isDirectory:!0});if(m.Contents!=null)for(let p of m.Contents)p.Key!=null&&(yield{path:`s3://${a}/${p.Key}`,size:p.Size});if(!m.IsTruncated)break;if(d>=Kt.MaxListCount)throw new Error(`Failed to finish listing within ${Kt.MaxListCount} list attempts`);n=m.NextContinuationToken}}catch(m){throw ea(m,`Failed to list: "${e}"`)}}async read(e){let r=ei(e);if(r==null||r.key==null)throw new Error(`Failed to read: "${e}"`);try{return(await this.s3.getObject({Bucket:r.bucket,Key:r.key}).promise()).Body}catch(i){throw ea(i,`Failed to read: "${e}"`)}}async write(e,r,i){let n=ei(e);if(n==null||n.key==null)throw new Error(`Failed to write: "${e}"`);try{await Qo(this.s3.upload({Bucket:n.bucket,Key:n.key,Body:r,ContentEncoding:i?.contentEncoding,ContentType:i?.contentType}))}catch(o){throw ea(o,`Failed to write: "${e}"`)}}exists(e){return this.head(e).then(r=>r!=null)}stream(e){let r=ei(e);if(r==null||r.key==null)throw new Error(`S3: Unable to read "${e}"`);return this.s3.getObject({Bucket:r.bucket,Key:r.key}).createReadStream()}async head(e){let r=ei(e);if(r==null||r.key==null)throw new Error(`Failed to exists: "${e}"`);try{return{size:(await Qo(this.s3.headObject({Bucket:r.bucket,Key:r.key}))).ContentLength,path:e}}catch(i){if(Ri(i)&&i.code==="NotFound")return null;throw ea(i,`Failed to exists: "${e}"`)}}};Kt.protocol="s3";Kt.MaxListCount=100;var Jt=class{static fsFromRole(e,r,i){if(typeof e=="object")return Jt.fsFromRole(e.roleArn,e.externalId,e.durationSeconds);let n=Jt.role(e,r,i);return new Kt(new _6.default({credentials:n}))}static role(e,r,i){i=i??Jt.DefaultRoleDurationSeconds;let n=`role::${e}::${r}::${i}`,o=Jt.cache.get(n);return o==null&&(o=new w6.default.ChainableTemporaryCredentials({params:{RoleArn:e,ExternalId:r,RoleSessionName:"fsa-"+Math.random().toString(32)+"-"+Date.now(),DurationSeconds:i}}),Jt.cache.set(n,o)),o}};Jt.DefaultRoleDurationSeconds=3600;Jt.cache=new Map;var x6=de(require("aws-sdk/clients/s3.js"),1),S6=require("util"),nh=require("zlib");var nS=(0,S6.promisify)(nh.gunzip),ar=Xe;ar.readJson=async function(e){let r=await this.read(e);return e.endsWith(".gz")?JSON.parse((await nS(r)).toString()):JSON.parse(r.toString())};ar.writeJson=async function(e,r){let i=Buffer.from(JSON.stringify(r,void 0,2));if(e.endsWith(".gz")){let n=(0,nh.createGzip)();return n.end(i),this.write(e,n)}else return this.write(e,i)};ar.configure=function(e){if(e.type!=="s3"||!v6(e))return;let r=ei(e.path);if(r==null)throw new Error("Failed to parse URI: "+e.path);let i=`s3://${r.bucket}/`;this.register(i,Jt.fsFromRole(e.roleArn,e.externalId))};ar.register("s3://",new Kt(new x6.default));function P1(t){return t[0].toUpperCase()+t.slice(1).replace(/_(\d+)-(\d+)m/g," $1.$2m").replace(/_/g," ")}function M6(t){let e=/(?:^|\D)(\d{4})(?:-(\d{2}))?(?:$|\D)/g,r=[];for(let i=e.exec(t);i!=null;i=e.exec(t))r.push(parseInt(i[1])),i[2]!=null&&r.push(parseInt(i[1].slice(0,2)+i[2]));return r.length===0?[-1,-1]:(r.sort(),[r[0],r[r.length-1]+1])}process.env.AWS_NODEJS_CONNECTION_REUSE_ENABLED="1";je.setConfigProvider(new Ya(jo.TileMetadata.TableName));var b4=de(h0(),1);var En="application/json",he;(function(t){t.CacheControl="Cache-Control",t.ContentEncoding="Content-Encoding",t.ContentType="Content-Type",t.Cors="Access-Control-Allow-Origin",t.ETag="ETag",t.IfNoneMatch="If-None-Match",t.Server="Server",t.ServerTiming="Server-Timing"})(he||(he={}));var ta;(function(t){t.CloudfrontId="X-Amz-Cf-Id",t.TraceId="X-Amzn-Trace-Id"})(ta||(ta={}));var qr;(function(t){t.CorrelationId="X-LINZ-Correlation-Id",t.RequestId="X-LINZ-Request-Id"})(qr||(qr={}));var ws=class{constructor(){if(this.timers=new Map,typeof process<"u"&&typeof process.hrtime.bigint=="function"){let e=BigInt(1e6);this.getTime=()=>Number(process.hrtime.bigint()/e)}else typeof typeof performance<"u"?this.getTime=()=>performance.now():this.getTime=()=>Date.now()}start(e){let r=this.timers.get(e);if(r!=null&&r.duration==null)throw new Error(`Duplicate startTime for "${e}"`);this.timers.set(e,{start:this.getTime()})}end(e){let r=this.timers.get(e);if(r==null)throw new Error(`Missing startTime information for "${e}"`);let i=this.getTime()-r.start;return r.duration=i,i}get metrics(){if(this.timers.size===0)return;let e={};for(let[r,i]of this.timers.entries())i.duration!=null&&(e[r]=i.duration);return e}get unfinished(){let e=[];for(let[r,i]of this.timers.entries())i.duration==null&&e.push(r);if(e.length!==0)return e}};var E6=de(Xn(),1);function kt(t){return!(typeof t!="object"||t==null)}var _s=class{constructor(e,r,i){this.logContext={},this.timer=new ws,this.headers=new Map,this.context=r,this.event=e,this.id=(0,E6.ulid)(),this.log=i,this.timer=new ws,this.log=i.child({id:this.id,aws:{lambdaId:r.awsRequestId}})}set(e,r){r==null&&(r=void 0),this.logContext[e]=r}toResponse(e){return e?.body}};var C6=require("url");var R6=de(Xn(),1);var lr=class extends _s{constructor(e,r,i){var n;super(e,r,i),this.headers=new Map,this.correlationId=(n=this.header(qr.CorrelationId))!==null&&n!==void 0?n:R6.ulid(),this.set("correlationId",this.correlationId)}header(e){return this._isHeadersLoaded!==!0&&(this.loadHeaders(),this._isHeadersLoaded=!0),this.headers.get(e.toLowerCase())}json(){var e;if(this.header(he.ContentType)!==En)throw new Error(`Invalid Content-Type: "${this.header("content-type")}"`);if(this.body==null)throw new Error("Cannot parse empty body as JSON");try{return this.isBase64Encoded?JSON.parse(Buffer.from((e=this.body)!==null&&e!==void 0?e:"","base64").toString()):JSON.parse(this.body)}catch{throw new Error("Body is not a JSON object")}}get query(){return this._query==null&&(this._query=this.loadQueryString()),this._query}get url(){return this.path}};var ra=class extends lr{static is(e){return kt(e)&&kt(e.requestContext)&&kt(e.requestContext.elb)}toResponse(e){return{statusCode:e.status,statusDescription:e.statusDescription,body:e.body,headers:this.toHeaders(e.headers),isBase64Encoded:e.isBase64Encoded}}toHeaders(e){if(e.size===0)return;let r={};for(let i of e)r[i[0]]=i[1];return r}loadHeaders(){if(this.event.headers!=null)for(let[e,r]of Object.entries(this.event.headers))r!=null&&this.headers.set(e.toLowerCase(),r)}loadQueryString(){let e=new C6.URLSearchParams;if(this.event.queryStringParameters==null)return e;for(let[r,i]of Object.entries(this.event.queryStringParameters))e.append(r.toLowerCase(),i??"true");return e}get method(){return this.event.httpMethod.toUpperCase()}get path(){return this.event.path}get body(){return this.event.body}get isBase64Encoded(){return this.event.isBase64Encoded}};var A6=require("url");var ci=class extends lr{static is(e){return!(!kt(e)||!kt(e.requestContext)||typeof e.requestContext.apiId!="string"||typeof e.requestContext.resourceId!="string"||typeof e.requestContext.httpMethod!="string")}toResponse(e){return{statusCode:e.status,body:e.body,headers:ci.toHeaders(e),isBase64Encoded:e.isBase64Encoded}}static toHeaders(e){if(e.headers.size===0)return;let r={};for(let i of e.headers)r[i[0]]=i[1];return r}loadHeaders(){if(this.event.headers!=null)for(let[e,r]of Object.entries(this.event.headers))r!=null&&this.headers.set(e.toLowerCase(),r)}loadQueryString(){let e=new A6.URLSearchParams;if(this.event.multiValueQueryStringParameters==null)return e;for(let[r,i]of Object.entries(this.event.multiValueQueryStringParameters))if(i!=null)for(let n of i)e.append(r.toLowerCase(),n);return e}get path(){return this.event.path}get method(){return this.event.httpMethod.toUpperCase()}get body(){return this.event.body}get isBase64Encoded(){return this.event.isBase64Encoded}};var ad=require("url");var ia=class extends lr{static is(e){if(!kt(e)||!Array.isArray(e.Records))return!1;let r=e.Records[0];return kt(r)?kt(r.cf):!1}toResponse(e){if(e.status===100&&this.event!=null){let r=this.event.Records[0].cf.request;for(let[i,n]of e.headers)r.headers[i.toLowerCase()]=[{key:i,value:String(n)}];return this.event.Records[0].cf.request}return{status:String(e.status),statusDescription:e.statusDescription,body:e.body,headers:this.toHeaders(e),bodyEncoding:"text"}}toHeaders(e){if(e.headers.size===0)return{};let r={};for(let i of e.headers)r[i[0]]=[{key:i[0],value:String(i[1])}];return r}loadHeaders(){var e;for(let[r,i]of Object.entries(this.event.Records[0].cf.request.headers))this.headers.set(r.toLowerCase(),(e=i[0])===null||e===void 0?void 0:e.value)}loadQueryString(){let e=this.event.Records[0].cf.request.querystring;return e==null?new ad.URLSearchParams:new ad.URLSearchParams(e.toLowerCase())}get path(){return this.event.Records[0].cf.request.uri}get method(){return this.event.Records[0].cf.request.method.toUpperCase()}get body(){let e=this.event.Records[0].cf.request.body;return e==null?null:e.data}get isBase64Encoded(){var e;return((e=this.event.Records[0].cf.request.body)===null||e===void 0?void 0:e.encoding)==="base64"}};var Y=class{constructor(e,r,i){if(this._body=null,this.headers=new Map,this.status=e,this.statusDescription=r,i!=null)for(let n of Object.keys(i))this.header(n,i[n])}static is(e){return e instanceof Y}static ok(e=200,r="Ok"){return new Y(e,r)}header(e,r){let i=e.toLowerCase();if(r==null)return this.headers.get(i);this.headers.set(i,r)}get isBase64Encoded(){return Buffer.isBuffer(this._body)}json(e){return this.buffer(JSON.stringify(e),En),this}buffer(e,r=En){return this.header(he.ContentType,r),this._body=e,this}get body(){return this._body==null?(this.header(he.ContentType,En),JSON.stringify({id:this.header(qr.RequestId),status:this.status,message:this.statusDescription,correlationId:this.header(qr.CorrelationId)})):Buffer.isBuffer(this._body)?this._body.toString("base64"):this._body}};var p4=de(m4(),1),mh=class{constructor(){this.hooks={request:[],response:[]},this.router=(0,p4.default)({defaultRoute:()=>new Y(404,"Not found")})}register(e,r,i){this.router.on(e,r,async(n,o,a)=>n instanceof lr?(n.params=a,Sd(n,i)):new Y(500,"Internal server error"))}hook(e,r){this.hooks[e].push(r)}get(e,r){return this.register("GET",e,r)}post(e,r){return this.register("POST",e,r)}delete(e,r){return this.register("DELETE",e,r)}options(e,r){return this.register("OPTIONS",e,r)}patch(e,r){return this.register("PATCH",e,r)}head(e,r){return this.register("HEAD",e,r)}put(e,r){return this.register("PUT",e,r)}async after(e,r){try{for(let i of this.hooks.response)await i(e,r)}catch(i){return Y.is(i)?i:(e.set("err",i),new Y(500,"Internal Server Error"))}return r}async handle(e){for(let i of this.hooks.request){let n=await xd(e,i);if(n)return this.after(e,n)}let r=await this.router.lookup(e,null);return r?this.after(e,r):this.after(e,new Y(404,"Not found"))}};var g4=require("url");var ua=class extends lr{toResponse(e){return{statusCode:e.status,body:e.body,headers:ci.toHeaders(e),isBase64Encoded:e.isBase64Encoded}}loadHeaders(){for(let[e,r]of Object.entries(this.event.headers))this.headers.set(e.toLowerCase(),r)}loadQueryString(){return new g4.URLSearchParams(this.event.rawQueryString)}get method(){return this.event.requestContext.http.method.toUpperCase()}get path(){return this.event.rawPath}get isBase64Encoded(){return this.event.isBase64Encoded}get body(){return this.event.body==null?null:this.event.body}static is(e){return!(!kt(e)||!kt(e.requestContext)||!kt(e.requestContext.http))}};var v4="v6.31.0",OS="2ab942c2a8cd82b94b20c2ad616042ea2fc38518",y4={version:v4,hash:OS};async function xd(t,e){try{return await e(t)}catch(r){return Y.is(r)?r:(t.set("err",r),new Y(500,"Internal Server Error"))}}async function Sd(t,e){t.timer.start("lambda");let r=await xd(t,e),i=200;Y.is(r)&&(i=r.status,t.set("description",r.statusDescription)),t.set("status",i),t.timer.timers.size>0&&t.set("metrics",t.timer.metrics),y4.hash&&t.set("package",y4);let n=t.timer.end("lambda");return t.set("unfinished",t.timer.unfinished),t.set("duration",n),t.set("@type","report"),i>499?t.log.error(t.logContext,"Lambda:Done"):i>399?t.log.warn(t.logContext,"Lambda:Done"):t.log.info(t.logContext,"Lambda:Done"),r}function kS(t){let e={rejectOnError:!0,tracePercent:0,...t};if(isNaN(e.tracePercent)||e.tracePercent>1)throw new Error("tracePercent is not between 0-1 :"+e.tracePercent);return e}var ur=class{static request(e,r,i){if(ra.is(e))return new ra(e,r,i);if(ua.is(e))return new ua(e,r,i);if(ci.is(e))return new ci(e,r,i);if(ia.is(e))return new ia(e,r,i);throw new Error("Request is not a a ALB, ApiGateway or Cloudfront event")}static handler(e,r,i){let n=kS(r);function o(a,h,d){let m=new _s(a,h,i??ur.Logger);n.tracePercent>0&&Math.random()<n.tracePercent&&(m.log.level="trace"),process.env.TRACE_LAMBDA&&(m.log.level="trace"),m.log.trace({event:a},"Lambda:Start");let p=h.awsRequestId;m.set("aws",{lambdaId:p}),Sd(m,e).then(M=>{if(n.rejectOnError&&Y.is(M)){if(m.logContext.err)return d(m.logContext.err);if(M.status>399)return d(m.toResponse(M))}return d(null,m.toResponse(M))})}return o}static http(e){let r=new mh;function i(n,o,a){let h=ur.request(n,o,e??ur.Logger),d=h.header(ta.CloudfrontId),m=h.header(ta.TraceId),p=o.awsRequestId;(d||m||p)&&h.set("aws",{cloudFrontId:d,traceId:m,lambdaId:p}),h.set("method",h.method),h.set("path",h.path),r.handle(h).then(M=>{var R;M.status===500&&M.header(he.CacheControl,"no-store"),M.header(qr.RequestId,h.id),M.header(qr.CorrelationId,h.correlationId);let x=(R=h.timer.metrics)===null||R===void 0?void 0:R.lambda;x!=null&&M.header(he.ServerTiming,`total;dur=${x}`),!M.isBase64Encoded&&M.header(he.ContentType)==null&&M.header(he.ContentType,En),ur.ServerName&&M.header(he.Server,`${ur.ServerName}-${v4}`),a(null,h.toResponse(M))})}return i.router=r,i}};ur.Logger=(0,b4.default)();ur.ServerName="linz";var vg=require("crypto");var it=class{constructor(){this.handlers={}}static action(e){let r=e.path,[i,n,...o]=(r[0]==="/"?r.slice(1):r).split("/").map(a=>decodeURIComponent(a));return n==null?{version:"v1",name:i,rest:[]}:{version:i,name:n,rest:o}}static apiKey(e){let r=e.query.get(jo.ApiKey.QueryString)??e.header("X-LINZ-Api-Key");if(r!=null&&!Array.isArray(r))return e.set(jo.ApiKey.QueryString,this.apiKey),r}async handle(e){if(e.method==="options")return new Y(200,"Options",{[he.Cors]:"*","Access-Control-Allow-Credentials":"false","Access-Control-Allow-Methods":"OPTIONS,GET,PUT,POST,DELETE"});if(e.method!=="GET")return new Y(405,"Method not allowed");let r=it.action(e),i=r.version==="v1"?this.handlers[r.name]:null;if(i==null)return new Y(404,"Not Found");let n=await i(e);return n.header(he.Cors,"*"),n}get(e,r){if(this.handlers[e]!=null)throw new Error(e+" already registered");this.handlers[e]=r}};var w4=new Y(200,"ok");w4.header(he.CacheControl,"no-store");async function Md(){return w4}async function Ed(){let t=new Y(200,"ok");return t.header(he.CacheControl,"no-store"),t.json({version:"v6.31.0",hash:"2ab942c2a8cd82b94b20c2ad616042ea2fc38518"}),t}var Ph=de(require("path"),1);var ke=class{constructor(e){this.name=e}raw(e,r=0){return this.parse(e,{offset:r,startOffset:0})}read(e,r=0){let i={offset:r,startOffset:r};return{value:this.parse(e,i),offset:i.offset}}refine(e){return new Rd(this,e)}},Rd=class extends ke{constructor(e,r){super("Function:"+e.name),this.input=e,this.cb=r}get size(){return this.input.size}parse(e,r){let i=this.input.parse(e,r);return this.cb(i,e,r)}};var ph=class extends ke{constructor(e,r,i){super(`Array:${e}:${r.name}x${i}`),this.count=i,this.type=r}get size(){return this.count*this.type.size}parse(e,r){let i=[];for(let n=0;n<this.count;n++)i.push(this.type.parse(e,r));return i}},gh=class extends ke{constructor(e,r,i,n){super("Array:Offset:"+e),this.isLookupRequired=!0,this.isMaxLength=n,this.lengthName=i,this.type=r}get size(){throw new Error("Unable to calculate size of dynamic object: "+this.name)}parse(e,r,i){let n=[],o=i?.[this.lengthName];if(o==null||typeof o!="number")throw new Error(`${this.name}: Missing variable a "${this.lengthName}"`);this.isMaxLength&&(o-=r.offset-r.startOffset);for(let a=0;a<o;a++)n.push(this.type.parse(e,r));return n}};var _4=[];for(let t=0;t<64;t++)_4[t]=Math.pow(2,t);var B1=class{constructor(e,r=0,i=e.length,n=!0){if(this.buffer=e,this.offset=r*8,this.maxOffset=i*8,this.isLittleEndian=n,!this.isLittleEndian)throw new Error("BigEndian is not supported")}get remainingBits(){return this.maxOffset-this.offset}getBitValue(e,r,i){return(e&((1<<r+i)-1&~((1<<r)-1)))>>r}skip(e){this.offset+=e}bit(){if(this.remainingBits<0)throw new Error("BitStream: Overflow "+this.remainingBits);let e=Math.floor(this.offset/8),r=this.offset%8,i=this.buffer[e];return this.offset++,this.getBitValue(i,r,1)}bool(){return this.bit()===1}bits(e){let r=e,i=0;for(;e>0;)this.bit()===1&&(i+=_4[r-e]),e--;return i}string(e){let r=[];e==null&&(e=Math.floor(this.remainingBits/8));for(let i=0;i<e;i++){let n=this.bits(8);if(n===0)break;r.push(String.fromCharCode(n))}return r.join("")}};var yh=class extends ke{constructor(e,r){super("Bits:"+e);let i=0;this.fields=Object.keys(r).map(n=>{let o=r[n];return i+=o,{key:n,bits:o}}),this.size=Math.ceil(i/8)}parse(e,r){let i=r.offset,n={},o=new B1(e,i,i+this.size);for(let{key:a,bits:h}of this.fields)n[a]=o.bits(h);return r.offset+=this.size,n}},bh=class extends ke{constructor(e,r,i){super("BitsFlags:"+e),this.type=r,this.fields=Object.entries(i)}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n={};for(let[o,a]of this.fields){let h=(i&a)===a;h&&(n[o]=h)}return n}};var vh=class extends ke{constructor(e){super("Bytes:"+e),this.size=e}parse(e,r){let i=e.slice(r.offset,r.offset+this.size);return r.offset+=this.size,i}};var Cd=class extends ke{constructor(){super(...arguments),this.size=1}parse(e,r){let i=r.offset;return r.offset+=this.size,e[i]}},Ad=class extends ke{constructor(){super(...arguments),this.size=2}parse(e,r){let i=r.offset,n=e[i++],o=e[i++]<<8;return r.offset+=2,n|o}},Td=class extends ke{constructor(){super(...arguments),this.size=4}parse(e,r){let i=r.offset,n=e[i++],o=e[i++]<<8,a=e[i++]<<16,h=e[i++]*16777216;return r.offset=i,(n|o|a)+h}},LS=2**32,Pd=class extends ke{constructor(){super(...arguments),this.size=8}parse(e,r){let i=ha.parse(e,r),n=ha.parse(e,r);return i+n*LS}},Id=class extends ke{constructor(){super(...arguments),this.size=8}parse(e,r){let i=BigInt(ha.parse(e,r)),n=BigInt(ha.parse(e,r));return i+(n<<BigInt(32))}},x4=new Cd("UInt8"),S4=new Ad("LUInt16"),ha=new Td("LUInt32"),M4=new Pd("LUInt64"),E4=new Id("BigLUInt64");var wh=class extends ke{constructor(e,r,i){super("Lookup:"+e),this.lookup=i,this.type=r}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n=this.lookup(i);if(n==null)throw new Error(`${this.name}: Failed to lookup ${i}`);return{id:i,name:n}}},_h=class extends ke{constructor(e,r,i){super("Enum:"+e),this.enumeration=i,this.type=r}get size(){return this.type.size}parse(e,r){let i=this.type.parse(e,r),n=this.enumeration[i];if(n==null)throw new Error(`${this.name}: Failed to lookup ${i}`);return{id:i,name:n}}};var ca=class extends ke{constructor(e,r){super(e),this._size=-1,this.fields=[];for(let[i,n]of Object.entries(r))this.fields.push({key:i,parser:n})}get size(){if(this._size>-1)return this._size;let e=0;for(let r of this.fields)e+=r.parser.size;return this._size=e,this._size}parse(e,r){let i={};for(let n of this.fields)i[n.key]=n.parser.parse(e,r,i);return i}},xh=class extends ke{constructor(e,r){super(e),this.fields=[],this._size=-1;let i=Object.entries(r),n=!1;for(let[o,a]of i)a.isLookupRequired&&(n=!0),this.fields.push({key:o,parser:a});i.length!==0&&(n?this.generateObjectAssign():this.generateSingleObject())}generateSingleObject(){let e=[],r='"use strict"; return {';for(let n=0;n<this.fields.length;n++)e.push(this.fields[n].parser),r+=` ${JSON.stringify(this.fields[n].key)}: _bp[${n}].parse(buf, ctx),`;r+=" };";let i=new Function("_bp","buf","ctx",r);this.parse=i.bind(null,e)}generateObjectAssign(){let e=[],r=`"use strict"; const ret = {};
182
182
  `;for(let n=0;n<this.fields.length;n++)e.push(this.fields[n].parser),r+=`ret[${JSON.stringify(this.fields[n].key)}] = _bp[${n}].parse(buf, ctx, ret)
183
- `;r+="return ret";let i=new Function("_bp","buf","ctx",r);this.parse=i.bind(null,e)}get size(){if(this._size>-1)return this._size;let e=0;for(let r of this.fields)e+=r.parser.size;return this._size=e,this._size}parse(e,r){return{}}};function ea(t,e=2){return"0x"+t.toString(16).padStart(e,"0")}var mc=class extends Ne{constructor(e,r){super("Offset:"+e.name+":"+r.name),this.type=r,this.offset=e}get size(){return this.type.size}parse(e,r){let i=this.offset.parse(e,r);if(i>e.length||i<0)throw new Error(`[${this.name}]: BufferOverflow attempted read at ${ea(i)}`);return this.type.parse(e,{offset:i,startOffset:i})}};var gc=class extends Ne{constructor(e){super("Skip:"+e),this.size=e}parse(e,r){r.offset+=this.size}};var yc=class extends Ne{constructor(){super("String")}get size(){throw new Error("Unable to calculate size from dynamic object")}parse(e,r){let i=r.offset,n=[],s=0;for(;s+i<e.length;){let a=e[i+s];if(a===0)break;n.push(String.fromCharCode(a)),s++}return r.offset+=s+1,n.join("")}},bc=class extends Ne{constructor(e){super("String:"+e),this.size=e}parse(e,r){let i=r.offset;if(this.size+i>e.length)throw new Error(`BufferOverflow: ${this.name} offset: ${ea(r.offset)}`);let n=[],s=0;for(;s<this.size;){let a=e[i+s];if(a===0)break;n.push(String.fromCharCode(a)),s++}return r.offset+=this.size,n.join("")}};function XS(t,e,r,i){return typeof r=="number"?new ac(t,e,r):new lc(t,e,r,i??!1)}var hr={u8:m4,lu16:g4,lu32:Xo,lu64:y4,blu64:b4,empty:new Qo("Empty",{}),offset(t,e){return new mc(t,e)},string(t){return t==null?new yc:new bc(t)},bits(t,e){return new uc(t,e)},flags(t,e,r){return new cc(t,e,r)},object(t,e){return new pc(t,e)},static(t,e){return new Qo(t,e)},lookup(t,e,r){return new fc(t,e,r)},enum(t,e,r){return new dc(t,e,r)},bytes(t){return new hc(t)},skip(t){return new gc(t)},array:XS};var v4;(function(t){t[t.File="0".charCodeAt(0)]="File",t[t.HardLink="1".charCodeAt(0)]="HardLink",t[t.SymLink="2".charCodeAt(0)]="SymLink",t[t.CharDeviceNode="3".charCodeAt(0)]="CharDeviceNode",t[t.BlockDeviceNode="4".charCodeAt(0)]="BlockDeviceNode",t[t.Directory="5".charCodeAt(0)]="Directory",t[t.FifoNode="6".charCodeAt(0)]="FifoNode",t[t.Reserved="7".charCodeAt(0)]="Reserved",t[t.LongName="L".charCodeAt(0)]="LongName",t[t.LongLink="K".charCodeAt(0)]="LongLink"})(v4||(v4={}));var QS=hr.object("TarHeader",{path:hr.string(100),skip1:hr.skip(24),size:hr.bytes(12).refine(t=>parseInt(t.toString(),8)),skip2:hr.skip(20),type:hr.u8,linkName:hr.string(100)});var w4={32:16777619n,64:1099511628211n,128:309485009821345068724781371n,256:374144419156711147060143317175368453031918731002211n,512:35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759n,1024:5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573n},ex={32:2166136261n,64:14695981039346656037n,128:144066263297769815596495629667062367629n,256:100029257958052580907070968620625704837092796014241193945225284501741471925557n,512:9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785n,1024:14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915n};function Rd(t,{size:e=32}={}){if(!w4[e])throw new Error("The `size` option must be one of 32, 64, 128, 256, 512, or 1024");let r=ex[e],i=w4[e],n=!1;for(let s=0;s<t.length;s++){let a=t.charCodeAt(s);a>127&&!n&&(t=unescape(encodeURIComponent(t)),a=t.charCodeAt(s),n=!0),r^=BigInt(a),r=BigInt.asUintN(e,r*i)}return r}var vc="COT";var tx=BigInt(0),rx=BigInt(32),ix=BigInt(2**32-1),_4=hr.object("CotarMetadata",{magic:hr.string(vc.length),version:hr.u8,count:hr.lu32}),$r=class{constructor(e,r,i=0){this.isHeader=!0,this.source=e,this.sourceOffset=i,this.metadata=r}static hash(e){return Rd(e,{size:64})}static async loadMetadata(e,r,i){if(i){await e.loadBytes(r,e.chunkSize);let s=e.bytes(r,8);return _4.read(s).value}let n=await e.fetchBytes(-8);return _4.read(new Uint8Array(n)).value}static async getMetadata(e,r,i){let n=await this.loadMetadata(e,r,i);if(n.magic!==vc)throw new Error(`Invalid source: ${e.uri} invalid magic found: ${n.magic}`);if(n.version===1||n.version===2)return n;throw new Error(`Invalid source: ${e.uri} invalid version found: ${n.version}`)}static async create(e,r=0,i=!0){let n=await this.getMetadata(e,r,i);return new $r(e,n,r)}async find(e){if(this.metadata.version===1)return this._findV1(e);if(this.metadata.version===2)return this._findV2(e);throw new Error("Invalid metadata version")}async _findV2(e){let r=$r.hash(e),i=this.metadata.count,n=Number(r%BigInt(i)),s=Number(r>>rx),a=Number(r&ix),c=null,d=null,p=n;for(;;){let m=this.sourceOffset+p*16+8;if(await this.source.loadBytes(m,16),d=this.source.getUint32(m),c=this.source.getUint32(m+4),c===s&&d===a){let w=this.source.getUint32(m+8)*512,S=this.source.getUint32(m+12);return{offset:w,size:S}}if(c===0&&d===0||(p++,p>=i&&(p=0),p===n))return null}}async _findV1(e){let r=$r.hash(e),i=this.metadata.count,n=Number(r%BigInt(i)),s=null,a=n;for(;;){let c=this.sourceOffset+a*24+8;if(await this.source.loadBytes(c,24),s=this.source.getBigUint64(c),s===r){let d=this.source.getUint64(c+8),p=this.source.getUint64(c+16);return{offset:d,size:p}}if(s===tx||(a++,a>=i&&(a=0),a===n))return null}}};var qk=BigInt(0);var _s=class{constructor(e,r){this.source=e,this.index=r}static async fromTar(e){let r=await $r.getMetadata(e,0,!1),i=await e.size,n=r.version===1?24:16,s=i-(r.count*n+16),a=new $r(e,r,s);return new _s(e,a)}async get(e){let r=await this.index.find(e);return r==null?null:(await this.source.loadBytes(r.offset,r.size),this.source.bytes(r.offset,r.size))}};var Ie=new Y(404,"Not Found"),xn=new Y(304,"Not modified");var Cd=class{constructor(){this.requests=[]}reset(){this.requests=[]}trace(e){let r=e.fetchBytes;e.fetchBytes=async(i,n)=>{let s={source:e.uri,offset:i,length:n};this.requests.push(s);let a=Date.now(),c=await r.apply(e,[i,n]);return s.duration=Date.now()-a,c}}},$i=new Cd;var _c=class{static get(e){let r=_c.cache.get(e);if(r==null){let i=Ye.source(e);$i.trace(i),r=_s.fromTar(i),_c.cache.set(e,r)}return r}},ta=_c;ta.cache=new Map;async function P1(t,e,r){let i=await ta.get(t);if(i==null)return Ie;let n=await i.get(e);if(n==null)return Ie;let s=Buffer.from(n),a=Y.ok().buffer(s,r);return Ad(s)&&a.header("content-encoding","gzip"),a}function Ad(t){return t[0]===31&&t[1]===139}async function x4(t){let e=Xe.get(Xe.AssetLocation);if(e==null)return Ie;let r=decodeURIComponent(t.params.fontStack),i=Sc.default.join("fonts",r,t.params.range)+".pbf";if(e.endsWith(".tar.co"))return P1(e,i,"application/x-protobuf");try{let n=Ye.join(e,i),s=await Ye.read(n);return Y.ok().buffer(s,"application/x-protobuf")}catch(n){if(n.code===404)return Ie;throw n}}async function sx(t){let e=new Set;for await(let r of Ye.list(t)){if(!r.endsWith(".pbf"))continue;let i=Sc.default.basename(Sc.default.dirname(r));i.includes("/")||e.add(i)}return[...e].sort()}async function M4(){let t=Xe.get(Xe.AssetLocation);if(t==null)return Ie;if(t.endsWith(".tar.co"))return P1(t,"fonts.json","application/json");try{let e=Ye.join(t,"/fonts"),r=await sx(e);return Y.ok().buffer(JSON.stringify(r),"application/json")}catch(e){if(e.code===404)return Ie;throw e}}var Fd=fe(require("fs"),1),kc=fe(require("path"),1),q4=fe(I4(),1),Hd=fe(require("sharp"),1),U4=fe(require("url"),1);var Ec=fe(require("sharp"),1);function lx(t){return t!=null}var Mc=new Map,Mn=class{constructor(e){this.tileSize=e}isTooLarge(e){return!!(e.resize&&(e.resize.width>=Mn.MaxImageSize||e.resize.height>=Mn.MaxImageSize))}getEmptyImage(e,r){let i=[e,r.r,r.g,r.b,r.alpha].join("-"),n=Mc.get(i);return n||(n=this.toImage(e,this.createImage(r)),Mc.size>128&&Mc.clear(),Mc.set(i,n),n)}toImage(e,r){switch(e){case qe.Jpeg:return r.jpeg().toBuffer();case qe.Png:return r.png().toBuffer();case qe.Webp:return r.webp().toBuffer();case qe.Avif:return r.avif().toBuffer();default:throw new Error(`Invalid image format "${e}"`)}}async getImageBuffer(e,r,i){return e.length===0?this.getEmptyImage(r,i):this.toImage(r,this.createImage(i).composite(e))}isDirectImage(e){var r;if(e.layers.length!==1)return!1;let i=e.layers[0];if(i.x!==0||i.y!==0||i.crop!=null||i.extract!=null||i.resize!=null)return!1;let n=i.tiff.getImage(i.source.imageId),s=n.tileSize;return!(s.height!==this.tileSize||s.width!==this.tileSize||!(!((r=n.compression)===null||r===void 0)&&r.includes(e.format))||e.background.alpha!==0)}async compose(e){var r;let i=(r=e.metrics)!==null&&r!==void 0?r:new ys;if(i.start("compose:overlay"),this.isDirectImage(e)){let c=e.layers[0],d=await c.tiff.getTile(c.source.x,c.source.y,c.source.imageId);return i.end("compose:overlay"),d==null?{buffer:await this.getEmptyImage(e.format,e.background),metrics:i,layers:0}:(i.start("compose:direct"),i.end("compose:direct"),{buffer:Buffer.from(d.bytes),metrics:i,layers:1})}let n=[];for(let c of e.layers)this.isTooLarge(c)||n.push(this.composeTile(c,e.resizeKernel));let s=await Promise.all(n).then(c=>c.filter(lx));i.end("compose:overlay"),i.start("compose:compress");let a=await this.getImageBuffer(s,e.format,e.background);return i.end("compose:compress"),{buffer:a,metrics:i,layers:s.length}}async composeTile(e,r){let i=await e.tiff.getTile(e.source.x,e.source.y,e.source.imageId);if(i==null)return null;let n=(0,Ec.default)(Buffer.from(i.bytes)),{extract:s,resize:a,crop:c}=e;if(s&&n.extract({top:0,left:0,width:s.width,height:s.height}),a){let d={fit:Ec.default.fit.cover,kernel:a.scale>1?r.in:r.out};n.resize(a.width,a.height,d)}return c&&n.extract({top:c.y,left:c.x,width:c.width,height:c.height}),{input:await n.toBuffer(),top:e.y,left:e.x}}createImage(e){return(0,Ec.default)({create:{width:this.tileSize,height:this.tileSize,channels:4,background:e}})}};Mn.MaxImageSize=256*2**15;var Rr;(function(t){t.NONE="application/octet-stream",t.JPEG="image/jpeg",t.JP2="image/jp2",t.WEBP="image/webp",t.LZW="application/lzw",t.DEFLATE="application/deflate"})(Rr||(Rr={}));var kd={1:Rr.NONE,5:Rr.LZW,6:Rr.JPEG,7:Rr.JPEG,8:Rr.DEFLATE,34712:Rr.JP2,50001:Rr.WEBP};var ne;(function(t){t[t.Artist=315]="Artist",t[t.BitsPerSample=258]="BitsPerSample",t[t.CellLength=265]="CellLength",t[t.CellWidth=264]="CellWidth",t[t.ColorMap=320]="ColorMap",t[t.Compression=259]="Compression",t[t.Copyright=33432]="Copyright",t[t.DateTime=306]="DateTime",t[t.ExtraSamples=338]="ExtraSamples",t[t.FillOrder=266]="FillOrder",t[t.FreeByteCounts=289]="FreeByteCounts",t[t.FreeOffsets=288]="FreeOffsets",t[t.GrayResponseCurve=291]="GrayResponseCurve",t[t.GrayResponseUnit=290]="GrayResponseUnit",t[t.HostComputer=316]="HostComputer",t[t.ImageDescription=270]="ImageDescription",t[t.ImageHeight=257]="ImageHeight",t[t.ImageWidth=256]="ImageWidth",t[t.Make=271]="Make",t[t.MaxSampleValue=281]="MaxSampleValue",t[t.MinSampleValue=280]="MinSampleValue",t[t.Model=272]="Model",t[t.NewSubFileType=254]="NewSubFileType",t[t.Orientation=274]="Orientation",t[t.PhotometricInterpretation=262]="PhotometricInterpretation",t[t.PlanarConfiguration=284]="PlanarConfiguration",t[t.ResolutionUnit=296]="ResolutionUnit",t[t.RowsPerStrip=278]="RowsPerStrip",t[t.SamplesPerPixel=277]="SamplesPerPixel",t[t.Software=305]="Software",t[t.StripByteCounts=279]="StripByteCounts",t[t.StripOffsets=273]="StripOffsets",t[t.SubFileType=255]="SubFileType",t[t.Threshholding=263]="Threshholding",t[t.XResolution=282]="XResolution",t[t.YResolution=283]="YResolution",t[t.BadFaxLines=326]="BadFaxLines",t[t.CleanFaxData=327]="CleanFaxData",t[t.ClipPath=343]="ClipPath",t[t.ConsecutiveBadFaxLines=328]="ConsecutiveBadFaxLines",t[t.Decode=433]="Decode",t[t.DefaultImageColor=434]="DefaultImageColor",t[t.DocumentName=269]="DocumentName",t[t.DotRange=336]="DotRange",t[t.HalftoneHints=321]="HalftoneHints",t[t.Indexed=346]="Indexed",t[t.JPEGTables=347]="JPEGTables",t[t.PageName=285]="PageName",t[t.PageNumber=297]="PageNumber",t[t.Predictor=317]="Predictor",t[t.PrimaryChromaticities=319]="PrimaryChromaticities",t[t.ReferenceBlackWhite=532]="ReferenceBlackWhite",t[t.SampleFormat=339]="SampleFormat",t[t.SMinSampleValue=340]="SMinSampleValue",t[t.SMaxSampleValue=341]="SMaxSampleValue",t[t.StripRowCounts=559]="StripRowCounts",t[t.SubIFDs=330]="SubIFDs",t[t.T4Options=292]="T4Options",t[t.T6Options=293]="T6Options",t[t.TileByteCounts=325]="TileByteCounts",t[t.TileHeight=323]="TileHeight",t[t.TileOffsets=324]="TileOffsets",t[t.TileWidth=322]="TileWidth",t[t.TransferFunction=301]="TransferFunction",t[t.WhitePoint=318]="WhitePoint",t[t.XClipPathUnits=344]="XClipPathUnits",t[t.XPosition=286]="XPosition",t[t.YCbCrCoefficients=529]="YCbCrCoefficients",t[t.YCbCrPositioning=531]="YCbCrPositioning",t[t.YCbCrSubSampling=530]="YCbCrSubSampling",t[t.YClipPathUnits=345]="YClipPathUnits",t[t.YPosition=287]="YPosition",t[t.ApertureValue=37378]="ApertureValue",t[t.ColorSpace=40961]="ColorSpace",t[t.DateTimeDigitized=36868]="DateTimeDigitized",t[t.DateTimeOriginal=36867]="DateTimeOriginal",t[t.ExifIFD=34665]="ExifIFD",t[t.ExifVersion=36864]="ExifVersion",t[t.ExposureTime=33434]="ExposureTime",t[t.FileSource=41728]="FileSource",t[t.Flash=37385]="Flash",t[t.FlashpixVersion=40960]="FlashpixVersion",t[t.FNumber=33437]="FNumber",t[t.ImageUniqueID=42016]="ImageUniqueID",t[t.LightSource=37384]="LightSource",t[t.MakerNote=37500]="MakerNote",t[t.ShutterSpeedValue=37377]="ShutterSpeedValue",t[t.UserComment=37510]="UserComment",t[t.IPTC=33723]="IPTC",t[t.ICCProfile=34675]="ICCProfile",t[t.XMP=700]="XMP",t[t.GDAL_METADATA=42112]="GDAL_METADATA",t[t.GDAL_NODATA=42113]="GDAL_NODATA",t[t.Photoshop=34377]="Photoshop",t[t.ModelPixelScale=33550]="ModelPixelScale",t[t.ModelTiePoint=33922]="ModelTiePoint",t[t.ModelTransformation=34264]="ModelTransformation",t[t.GeoKeyDirectory=34735]="GeoKeyDirectory",t[t.GeoDoubleParams=34736]="GeoDoubleParams",t[t.GeoAsciiParams=34737]="GeoAsciiParams"})(ne||(ne={}));var T1;(function(t){t[t.GTModelTypeGeoKey=1024]="GTModelTypeGeoKey",t[t.GTRasterTypeGeoKey=1025]="GTRasterTypeGeoKey",t[t.GTCitationGeoKey=1026]="GTCitationGeoKey",t[t.GeographicTypeGeoKey=2048]="GeographicTypeGeoKey",t[t.GeogCitationGeoKey=2049]="GeogCitationGeoKey",t[t.GeogGeodeticDatumGeoKey=2050]="GeogGeodeticDatumGeoKey",t[t.GeogPrimeMeridianGeoKey=2051]="GeogPrimeMeridianGeoKey",t[t.GeogLinearUnitsGeoKey=2052]="GeogLinearUnitsGeoKey",t[t.GeogLinearUnitSizeGeoKey=2053]="GeogLinearUnitSizeGeoKey",t[t.GeogAngularUnitsGeoKey=2054]="GeogAngularUnitsGeoKey",t[t.GeogAngularUnitSizeGeoKey=2055]="GeogAngularUnitSizeGeoKey",t[t.GeogEllipsoidGeoKey=2056]="GeogEllipsoidGeoKey",t[t.GeogSemiMajorAxisGeoKey=2057]="GeogSemiMajorAxisGeoKey",t[t.GeogSemiMinorAxisGeoKey=2058]="GeogSemiMinorAxisGeoKey",t[t.GeogInvFlatteningGeoKey=2059]="GeogInvFlatteningGeoKey",t[t.GeogAzimuthUnitsGeoKey=2060]="GeogAzimuthUnitsGeoKey",t[t.GeogPrimeMeridianLongGeoKey=2061]="GeogPrimeMeridianLongGeoKey",t[t.GeogTOWGS84GeoKey=2062]="GeogTOWGS84GeoKey",t[t.ProjectedCSTypeGeoKey=3072]="ProjectedCSTypeGeoKey",t[t.PCSCitationGeoKey=3073]="PCSCitationGeoKey",t[t.ProjectionGeoKey=3074]="ProjectionGeoKey",t[t.ProjCoordTransGeoKey=3075]="ProjCoordTransGeoKey",t[t.ProjLinearUnitsGeoKey=3076]="ProjLinearUnitsGeoKey",t[t.ProjLinearUnitSizeGeoKey=3077]="ProjLinearUnitSizeGeoKey",t[t.ProjStdParallel1GeoKey=3078]="ProjStdParallel1GeoKey",t[t.ProjStdParallel2GeoKey=3079]="ProjStdParallel2GeoKey",t[t.ProjNatOriginLongGeoKey=3080]="ProjNatOriginLongGeoKey",t[t.ProjNatOriginLatGeoKey=3081]="ProjNatOriginLatGeoKey",t[t.ProjFalseEastingGeoKey=3082]="ProjFalseEastingGeoKey",t[t.ProjFalseNorthingGeoKey=3083]="ProjFalseNorthingGeoKey",t[t.ProjFalseOriginLongGeoKey=3084]="ProjFalseOriginLongGeoKey",t[t.ProjFalseOriginLatGeoKey=3085]="ProjFalseOriginLatGeoKey",t[t.ProjFalseOriginEastingGeoKey=3086]="ProjFalseOriginEastingGeoKey",t[t.ProjFalseOriginNorthingGeoKey=3087]="ProjFalseOriginNorthingGeoKey",t[t.ProjCenterLongGeoKey=3088]="ProjCenterLongGeoKey",t[t.ProjCenterLatGeoKey=3089]="ProjCenterLatGeoKey",t[t.ProjCenterEastingGeoKey=3090]="ProjCenterEastingGeoKey",t[t.ProjCenterNorthingGeoKey=3091]="ProjCenterNorthingGeoKey",t[t.ProjScaleAtNatOriginGeoKey=3092]="ProjScaleAtNatOriginGeoKey",t[t.ProjScaleAtCenterGeoKey=3093]="ProjScaleAtCenterGeoKey",t[t.ProjAzimuthAngleGeoKey=3094]="ProjAzimuthAngleGeoKey",t[t.ProjStraightVertPoleLongGeoKey=3095]="ProjStraightVertPoleLongGeoKey",t[t.ProjRectifiedGridAngleGeoKey=3096]="ProjRectifiedGridAngleGeoKey",t[t.VerticalCSTypeGeoKey=4096]="VerticalCSTypeGeoKey",t[t.VerticalCitationGeoKey=4097]="VerticalCitationGeoKey",t[t.VerticalDatumGeoKey=4098]="VerticalDatumGeoKey",t[t.VerticalUnitsGeoKey=4099]="VerticalUnitsGeoKey"})(T1||(T1={}));var Re;(function(t){t[t.BYTE=1]="BYTE",t[t.ASCII=2]="ASCII",t[t.SHORT=3]="SHORT",t[t.LONG=4]="LONG",t[t.RATIONAL=5]="RATIONAL",t[t.SBYTE=6]="SBYTE",t[t.UNDEFINED=7]="UNDEFINED",t[t.SSHORT=8]="SSHORT",t[t.SLONG=9]="SLONG",t[t.SRATIONAL=10]="SRATIONAL",t[t.FLOAT=11]="FLOAT",t[t.DOUBLE=12]="DOUBLE",t[t.LONG8=16]="LONG8",t[t.SLONG8=17]="SLONG8",t[t.IFD8=18]="IFD8"})(Re||(Re={}));var be;(function(t){t[t.UInt8=1]="UInt8",t[t.UInt16=2]="UInt16",t[t.UInt32=4]="UInt32",t[t.UInt64=8]="UInt64",t[t.Double=8]="Double",t[t.Float=4]="Float"})(be||(be={}));var k4=2**32,ux=typeof setImmediate>"u"?setTimeout:setImmediate,Ot=()=>{throw new Error("Method not implemented.")},yi=class{constructor(){this.isLittleEndian=!0,this.delayMs=yi.DefaultDelayMs,this.maxChunkCount=10,this.chunks=yi.DefaultChunkCache(),this.blankFillCount=16,this.maxConcurrentRequests=50,this.toFetch=new Set,this.toFetchPromise=null,this.byteOffset=0,this.getFloat32=Ot,this.getFloat64=Ot,this.getInt8=Ot,this.getInt16=Ot,this.getInt32=Ot,this.setFloat32=Ot,this.setFloat64=Ot,this.setInt8=Ot,this.setInt16=Ot,this.setInt32=Ot,this.setUint8=Ot,this.setUint16=Ot,this.setUint32=Ot,this.setBigInt64=Ot,this.setBigUint64=Ot}static getByteRanges(e,r=32,i=16){if(e.size===0)return{chunks:[],blankFill:[]};let n=[...e.values()].sort((d,p)=>d-p),s=[],a=[];s.push(a);let c=[];for(let d=0;d<n.length;++d){let p=n[d],m=n[d-1];if(a.length>=r)a=[p],s.push(a);else if(d===0||p===m+1)a.push(p);else if(p<m+i){for(let w=m;w<p;w++)a.push(w+1),c.push(w+1);c.pop()}else a=[p],s.push(a)}return{chunks:s,blankFill:c}}async fetchData(){if(this.toFetch.size===0)return;let e=this.toFetch;this.toFetch=new Set,this.toFetchPromise=null;let r=yi.getByteRanges(e,this.maxChunkCount,this.blankFillCount),i=[];for(let n of r.chunks){let s=n[0],a=n[n.length-1],c=s*this.chunkSize,d=a*this.chunkSize+this.chunkSize-c,p=await this.fetchBytes(c,d);if(n.length===1){i[s]=p,this.chunks.set(s,new DataView(p));continue}let m=s*this.chunkSize;for(let w of n){let S=w*this.chunkSize-m,v=p.slice(S,S+this.chunkSize);i[w]=v,this.chunks.set(w,new DataView(v))}}}async loadBytes(e,r){if(e<0)throw new Error("Offset must be positive");let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let s=i;s<=n;s++)this.chunks.has(s)||this.toFetch.add(s);if(this.toFetch.size!==0){if(this.toFetchPromise==null&&(this.toFetchPromise=new Promise(s=>ux(s,this.delayMs)).then(()=>this.fetchData())),this.toFetch.size>this.maxConcurrentRequests)throw new Error("Too many outstanding requests");await this.toFetchPromise}}getChunkId(e){return Math.floor(e/this.chunkSize)}getUint(e,r){switch(r){case be.UInt8:return this.getUint8(e);case be.UInt16:return this.getUint16(e);case be.UInt32:return this.getUint32(e);case be.UInt64:return this.getUint64(e)}}bytes(e,r){let i=this.isOneChunk(e,r);if(i){let p=this.getView(i),m=e-i*this.chunkSize;return new Uint8Array(p.buffer.slice(m,m+r))}let n=new Uint8Array(r),s=e+r,a=Math.floor(e/this.chunkSize),c=Math.ceil((e+r)/this.chunkSize)-1,d=0;for(let p=a;p<=c;p++){let m=e+d,w=p*this.chunkSize,S=this.getView(p),v=Math.min(s,w+this.chunkSize),R=S.buffer.slice(m-w,v-w);n.set(new Uint8Array(R),d),d+=R.byteLength}return n}getView(e){let r=this.chunks.get(e);if(r==null)throw new Error(`Chunk:${e} is not ready`);return r}isOneChunk(e,r){let i=e+r-1,n=Math.floor(e/this.chunkSize);return Math.floor(i/this.chunkSize)-n<1?n:null}hasBytes(e,r=1){let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let s=i;s<=n;s++)if(!this.chunks.has(s))return!1;return!0}toRange(e,r){if(r==null)return`bytes=${e}`;if(e<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${e}-${e+r}`}parseContentRange(e){let[r,i]=e.split(" ");if(r!=="bytes")throw new Error("Failed to parse content-range: "+e);if(i==null)throw new Error("Failed to parse content-range: "+e);let[,n]=i.split("/"),s=Number(n);if(isNaN(s))throw new Error("Failed to parse content-range: "+e);return s}get buffer(){throw new Error("Method not implemented.")}get byteLength(){if(this._byteLength)return this._byteLength;throw Error(".size() has not been fetched.")}getUint8(e){let r=Math.floor(e/this.chunkSize),i=this.chunks.get(r);if(i==null)throw new Error(`Chunk:${r} is not ready`);return i.getUint8(e-r*this.chunkSize)}getUint16(e){let r=this.isOneChunk(e,be.UInt16);if(r!=null)return this.getView(r).getUint16(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint8(e),n=this.getUint8(e+be.UInt8);return this.isLittleEndian?i+(n<<8):(i<<8)+n}getUint32(e){let r=this.isOneChunk(e,be.UInt32);if(r!=null)return this.getView(r).getUint32(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint16(e),n=this.getUint16(e+be.UInt16);return this.isLittleEndian?i+n*65536:i*65536+n}getUint64(e){let r=this.isOneChunk(e,be.UInt64);if(r!=null){let s=this.getView(r);return Number(s.getBigUint64(e-r*this.chunkSize,this.isLittleEndian))}let i=this.getUint32(e),n=this.getUint32(e+be.UInt32);return this.isLittleEndian?i+n*k4:i*k4+n}getBigUint64(e){let r=this.isOneChunk(e,be.UInt64);if(r!=null)return this.getView(r).getBigUint64(e-r*this.chunkSize,this.isLittleEndian);let i=BigInt(this.getUint32(e)),n=BigInt(this.getUint32(e+be.UInt32));return this.isLittleEndian?i+(n<<BigInt(32)):(i<<BigInt(32))+n}getBigInt64(){throw new Error("Not implemented.")}};yi.DefaultChunkCache=()=>new Map;yi.DefaultDelayMs=1;var O4=fe(Ld(),1);function L4(t){switch(t){case Re.BYTE:case Re.ASCII:case Re.SBYTE:case Re.UNDEFINED:return 1;case Re.SHORT:case Re.SSHORT:return 2;case Re.LONG:case Re.SLONG:case Re.FLOAT:return 4;case Re.RATIONAL:case Re.SRATIONAL:case Re.DOUBLE:case Re.LONG8:case Re.SLONG8:case Re.IFD8:return 8;default:throw new Error(`Invalid fieldType ${t}`)}}var xs={char:(t,e)=>String.fromCharCode(t.getUint8(e)),uint8:(t,e)=>t.getUint8(e),uint16:(t,e)=>t.getUint16(e),uint32:(t,e)=>t.getUint32(e),uint64:(t,e)=>t.getUint64(e),double:(t,e)=>O4.read(t.bytes(e,be.Double),0,t.isLittleEndian,52,8),rational:(t,e)=>[t.getUint32(e),t.getUint32(e+4)]};function Rc(t){switch(t){case Re.ASCII:return xs.char;case Re.BYTE:case Re.UNDEFINED:case Re.SBYTE:return xs.uint8;case Re.SHORT:case Re.SSHORT:return xs.uint16;case Re.LONG:case Re.SLONG:return xs.uint32;case Re.RATIONAL:case Re.SRATIONAL:return xs.rational;case Re.DOUBLE:return xs.double;case Re.LONG8:return xs.uint64;default:throw new Error(`Unknown read type "${t}" "${Re[t]}"`)}}var En=class{constructor(e,r,i){this.tiff=r,this.byteOffset=i,this.id=e,this.name=ne[this.id],this.dataType=this.tiff.source.getUint16(i+2),this.dataCount=this.tiff.source.getUint(i+4,this.tiff.ifdConfig.pointer),this.dataTypeSize=L4(this.dataType),this.dataLength=this.dataTypeSize*this.dataCount}get hasBytes(){return this.tiff.source.hasBytes(this.valuePointer,this.dataLength)}get isReady(){return!0}get dataTypeName(){return Re[this.dataType]}get valuePointer(){let e=this.size-this.tiff.ifdConfig.pointer;return this.isValueInline?this.byteOffset+e:this.tiff.source.getUint(this.byteOffset+e,this.tiff.ifdConfig.pointer)}get size(){return this.tiff.ifdConfig.ifd}get isValueInline(){return this.dataLength<=this.tiff.ifdConfig.pointer}readValue(){let e=this.valuePointer,r=this.dataTypeSize,i=Rc(this.dataType),n=this.dataCount,s=n*r;if(n===1)return i(this.tiff.source,e);let a=[];for(let c=0;c<s;c+=r)a.push(i(this.tiff.source,e+c));return this.dataType===Re.ASCII?a.join("").trim():a}toJSON(){return{id:this.id,name:this.name,offset:this.byteOffset,isReady:this.isReady,type:this.dataTypeName,value:this.value}}};var Ms=class extends En{constructor(){super(...arguments),this.value=null}get isReady(){return this.value!=null}async fetch(){return this.tiff.source.hasBytes(this.valuePointer,this.dataLength)===!1&&await this.tiff.source.loadBytes(this.valuePointer,this.dataLength),this.value=this.readValue(),this.value}};var I1=class extends En{constructor(e,r,i){super(e,r,i),this.loadedValues=null}get value(){return this.loadedValues!=null?this.loadedValues:this.hasBytes?(this.readValue(),this.loadedValues):null}async load(){await this.tiff.source.loadBytes(this.valuePointer,this.dataLength),this.readValue()}readValue(){let e=super.readValue();return typeof e=="number"?this.loadedValues=[e]:this.loadedValues=e,this.loadedValues}async getValueAt(e){if(this.loadedValues)return this.loadedValues[e];let r=this.dataTypeSize,i=this.valuePointer+r*e,n=Rc(this.dataType);return this.tiff.source.hasBytes(i,r)||await this.tiff.source.loadBytes(i,r),n(this.tiff.source,i)}};var k1=class extends En{constructor(){super(...arguments),this._isRead=!1,this._value=null}get value(){return this._isRead===!1&&(this._value=this.readValue(),this._isRead=!0),this._value}};var Cc={create(t,e){let r=t.source.getUint16(e);if(r===ne.TileOffsets||r===ne.TileByteCounts||r===ne.StripByteCounts||r===ne.StripOffsets)return new I1(r,t,e);let i=new k1(r,t,e);return i.hasBytes?i:new Ms(r,t,e)},isStatic(t){return t instanceof k1},isLazy(t){return t instanceof Ms},isOffsetArray(t){return t instanceof I1}};var cx=32767,Ac=class{constructor(e,r,i){this.tagsGeoLoaded=!1,this.tagsGeo=new Map,this.tif=e,this.id=r,this.tags=i}async init(e=!1){let r=[this.fetch(ne.Compression),this.fetch(ne.ImageHeight),this.fetch(ne.ImageWidth),this.fetch(ne.ModelPixelScale),this.fetch(ne.ModelTiePoint),this.fetch(ne.ModelTransformation),this.fetch(ne.TileHeight),this.fetch(ne.TileWidth)];e&&(r.push(this.fetch(ne.GeoKeyDirectory)),r.push(this.fetch(ne.GeoAsciiParams)),r.push(this.fetch(ne.GeoDoubleParams))),await Promise.all(r),e&&await this.loadGeoTiffTags()}value(e){let r=this.tags.get(e);return r==null?null:r.value}async loadGeoTiffTags(){if(this.tagsGeoLoaded)return;let e=this.tags.get(ne.GeoKeyDirectory);if(e==null){this.tagsGeoLoaded=!0;return}if(!e.isReady&&e instanceof Ms&&await Promise.all([this.fetch(ne.GeoKeyDirectory),this.fetch(ne.GeoAsciiParams),this.fetch(ne.GeoDoubleParams)]),this.tagsGeoLoaded=!0,e.value==null)return;let r=e.value;if(!Array.isArray(r))throw new Error("Invalid geo tags found");for(let i=4;i<=r[3]*4;i+=4){let n=r[i],s=r[i+1],a=r[i+3];if(s===0){this.tagsGeo.set(n,a);continue}let c=this.tags.get(s);if(c==null||c.value==null)continue;let d=r[i+2];Array.isArray(c.value)?this.tagsGeo.set(n,c.value[a+d-1]):typeof c.value=="string"&&this.tagsGeo.set(n,c.value.substr(a,a+d-1).trim())}}valueGeo(e){if(this.tagsGeoLoaded===!1)throw new Error("loadGeoTiffTags() has not been called");return this.tagsGeo.get(e)}async fetch(e){let r=this.tags.get(e);return r==null?null:Cc.isLazy(r)?r.fetch():r.value}get origin(){let e=this.value(ne.ModelTiePoint);if(e!=null&&e.length===6)return[e[3],e[4],e[5]];let r=this.value(ne.ModelTransformation);if(r!=null)return[r[3],r[7],r[11]];if(this.value(ne.NewSubFileType)===1&&this.id!==0)return this.tif.images[0].origin;throw new Error("Image does not have a geo transformation.")}get isGeoLocated(){return this.value(ne.ModelPixelScale)!=null||this.value(ne.ModelTransformation)!=null?!0:this.value(ne.NewSubFileType)===1&&this.id!==0?this.tif.images[0].isGeoLocated:!1}get resolution(){let e=this.value(ne.ModelPixelScale);if(e!=null)return[e[0],-e[1],e[2]];let r=this.value(ne.ModelTransformation);if(r!=null)return[r[0],r[5],r[10]];if(this.value(ne.NewSubFileType)===1&&this.id!==0){let i=this.tif.images[0],[n,s,a]=i.resolution,c=i.size,d=this.size;return[n*c.width/d.width,s*c.height/d.height,a]}throw new Error("Image does not have a geo transformation.")}get bbox(){let e=this.size,r=this.origin,i=this.resolution;if(r==null||e==null||i==null)throw new Error("Unable to calculate bounding box");let n=r[0],s=r[1],a=n+i[0]*e.width,c=s+i[1]*e.height;return[Math.min(n,a),Math.min(s,c),Math.max(n,a),Math.max(s,c)]}get compression(){let e=this.value(ne.Compression);return e==null||typeof e!="number"?null:kd[e]}get epsg(){let e=this.valueGeo(T1.ProjectedCSTypeGeoKey);return e===cx?null:e}get size(){return{width:this.value(ne.ImageWidth),height:this.value(ne.ImageHeight)}}get tagList(){return[...this.tags.keys()].map(e=>ne[e])}isTiled(){return this.value(ne.TileWidth)!==null}get tileSize(){return{width:this.value(ne.TileWidth),height:this.value(ne.TileHeight)}}get tileCount(){let e=this.size,r=this.tileSize,i=Math.ceil(e.width/r.width),n=Math.ceil(e.height/r.height);return{x:i,y:n}}get tileOffset(){let e=this.tags.get(ne.TileOffsets);if(e==null)throw new Error("No tile offsets found");return e}get stripCount(){let e=this.tags.get(ne.StripByteCounts);return e==null?0:e.dataCount}async getTileOffset(e){let r=this.tileOffset;if(e<0||e>r.dataCount)throw new Error(`Tile offset: ${e} out of range: 0 -> ${r.dataCount}`);return r.getValueAt(e)}getTileBounds(e,r){let{size:i,tileSize:n}=this,s=r*n.height,a=e*n.width,c=a+n.width>=i.width?i.width-a:n.width,d=s+n.height>=i.height?i.height-s:n.height;return{x:a,y:s,width:c,height:d}}async getStrip(e){if(this.isTiled())throw new Error("Cannot read stripes, tiff is tiled");let r=this.tags.get(ne.StripByteCounts),i=this.tags.get(ne.StripOffsets);if(e>=r.dataCount)throw new Error("Cannot read strip, index out of bounds");let[n,s]=await Promise.all([i.getValueAt(e),r.getValueAt(e)]);return this.getBytes(n,s)}getJpegHeader(e){let r=this.value(ne.JPEGTables);if(r==null)throw new Error("Unable to find Jpeg header");let i=r.slice(0,r.length-2),n=new Uint8Array(e.byteLength+i.length-2);return n.set(i,0),n.set(e.slice(2),i.length),n}async getBytes(e,r){let i=this.compression;if(i==null)throw new Error("Unsupported compression: "+this.value(ne.Compression));if(r===0)return null;await this.tif.source.loadBytes(e,r);let n=this.tif.source.bytes(e,r);return this.compression===Rr.JPEG?{mimeType:i,bytes:this.getJpegHeader(n)}:{mimeType:i,bytes:n}}async getTile(e,r){let i=this.compression,n=this.size,s=this.tileSize;if(s==null)throw new Error("Tiff is not tiled");if(i==null)throw new Error("Unsupported compression: "+this.value(ne.Compression));let a=Math.ceil(n.height/s.height),c=Math.ceil(n.width/s.width);if(e>=c||r>=a)throw new Error(`Tile index is outside of range x:${e} >= ${c} or y:${r} >= ${a}`);let d=r*c+e,p=c*a;if(d>=p)throw new Error(`Tile index is outside of tile range: ${d} >= ${p}`);let{offset:m,imageSize:w}=await this.getTileSize(d);return this.getBytes(m,w)}async getTileSize(e){if(this.tif.options.tileLeaderByteSize){let s=await this.getTileOffset(e);if(s===0)return{offset:0,imageSize:0};let a=this.tif.options.tileLeaderByteSize;return await this.tif.source.loadBytes(s-a,a),{offset:s,imageSize:this.tif.source.getUint(s-a,a)}}let r=this.tags.get(ne.TileByteCounts);if(r==null)throw new Error("No tile byte counts found");let[i,n]=await Promise.all([this.getTileOffset(e),r.getValueAt(e)]);return{offset:i,imageSize:n}}};var O1;(function(t){t[t.Big=19789]="Big",t[t.Little=18761]="Little"})(O1||(O1={}));var Cr;(function(t){t[t.BigTiff=43]="BigTiff",t[t.Tiff=42]="Tiff"})(Cr||(Cr={}));var Nd="__reverse";function N4(t,e){if(t[Nd]==null){let r={};for(let i of Object.keys(t)){let n=t[i];r[n]=i}Object.defineProperty(t,Nd,{enumerable:!1,value:r,writable:!1})}return t[Nd][e]}var Rn;(function(t){t.GDAL_STRUCTURAL_METADATA_SIZE="GDAL_STRUCTURAL_METADATA_SIZE",t.LAYOUT="LAYOUT",t.BLOCK_ORDER="BLOCK_ORDER",t.BLOCK_LEADER="BLOCK_LEADER",t.BLOCK_TRAILER="BLOCK_TRAILER",t.KNOWN_INCOMPATIBLE_EDITION="KNOWN_INCOMPATIBLE_EDITION",t.MASK_INTERLEAVED_WITH_IMAGERY="MASK_INTERLEAVED_WITH_IMAGERY"})(Rn||(Rn={}));var Dd;(function(t){t.RowMajor="ROW_MAJOR"})(Dd||(Dd={}));var Bd;(function(t){t.uint32="SIZE_AS_UINT4"})(Bd||(Bd={}));var hx={uint32:be.UInt32},Pc=class{constructor(){this.options=new Map}get isCogOptimized(){return this.isBroken?!1:this.options.get(Rn.LAYOUT)==="IFDS_BEFORE_DATA"}get isBroken(){return this.options.get(Rn.KNOWN_INCOMPATIBLE_EDITION)==="YES"}set(e,r){this.options.set(e,r)}process(e,r,i){let n=[];for(let a=r;a<r+i;a++){let c=e.getUint8(a);c!==0&&n.push(String.fromCharCode(c))}let s=n.join("").trim().split(`
184
- `).map(a=>a.split("="));for(let[a,c]of s)this.options.set(Rn[a],c)}_getReverse(e,r){let i=this.options.get(r);return i==null?null:N4(e,i)}get tileOrder(){return this._getReverse(Dd,Rn.BLOCK_ORDER)}get tileLeader(){return this._getReverse(Bd,Rn.BLOCK_LEADER)}get tileLeaderByteSize(){return this.tileLeader==null?null:hx[this.tileLeader]}get isMaskInterleaved(){return this.options.get(Rn.MASK_INTERLEAVED_WITH_IMAGERY)==="YES"}};var zd={version:Cr.Tiff,pointer:be.UInt32,offset:be.UInt16,ifd:be.UInt16+be.UInt16+2*be.UInt32},jd={version:Cr.BigTiff,pointer:be.UInt64,offset:be.UInt64,ifd:be.UInt16+be.UInt16+2*be.UInt64},fL={[Cr.BigTiff]:jd,[Cr.Tiff]:zd};var qd=fe(Ld(),1),Tc=class{constructor(e,r=0){this.tiff=e,this.byteOffset=r,this.relativeOffset=0}get currentOffset(){return this.byteOffset+this.relativeOffset}seekTo(e){return this.byteOffset=e,this.relativeOffset=0,this}seek(e){let r=this.currentOffset;return this.relativeOffset+=e,r}bytes(e){return this.tiff.source.bytes(this.seek(e),e)}uint(e){return this.tiff.source.getUint(this.seek(e),e)}uint8(){return this.tiff.source.getUint8(this.seek(be.UInt8))}uint16(){return this.tiff.source.getUint16(this.seek(be.UInt16))}uint32(){return this.tiff.source.getUint32(this.seek(be.UInt32))}uint64(){return this.tiff.source.getUint64(this.seek(be.UInt64))}pointer(){let e=this.tiff.ifdConfig.pointer;return this.tiff.source.getUint(this.seek(e),e)}offset(){let e=this.tiff.ifdConfig.offset;return this.tiff.source.getUint(this.seek(e),e)}float(){return qd.read(this.bytes(be.Float),0,this.tiff.source.isLittleEndian,23,4)}double(){return qd.read(this.bytes(be.Double),0,this.tiff.source.isLittleEndian,52,8)}};function D4(t,e=4,r=!0){let i=t.toString(16).padStart(e,"0");return r?"0x"+i:i}var ra=class{constructor(e){this.version=Cr.Tiff,this.images=[],this.options=new Pc,this.ifdConfig=zd,this.isInitialized=!1,this.source=e,this.cursor=new Tc(this)}static create(e){return new ra(e).init()}init(e=!1){return this._initPromise?this._initPromise:(this._initPromise=this.doInit(e),this._initPromise)}async doInit(e=!1){return this.isInitialized?this:(await this.source.loadBytes(0,this.source.chunkSize),await this.fetchIfd(),await Promise.all(this.images.map(r=>r.init(e))),this.isInitialized=!0,this)}async fetchIfd(){let e=this.cursor.seekTo(0),r=e.uint16();if(this.source.isLittleEndian=r===O1.Little,!this.source.isLittleEndian)throw new Error("Only little endian is supported");this.version=e.uint16();let i;if(this.version===Cr.BigTiff){if(this.ifdConfig=jd,e.uint16()!==8)throw new Error("Only 8byte pointers are supported");if(e.uint16()!==0)throw new Error("Invalid big tiff header");i=e.pointer()}else if(this.version===Cr.Tiff)i=e.pointer();else throw new Error(`Only tiff supported version:${this.version}`);let n=i-this.cursor.currentOffset;return n>0&&n<16*1024,this.processIfd(i)}getImage(e){return this.images[e]}getImageByResolution(e){let r=this.images[0],i=r.size,[n]=r.resolution,s=n*i.width;for(let a=this.images.length-1;a>0;a--){let c=this.images[a],d=c.size;if(s/d.width-e<=.01)return c}return r}async getTile(e,r,i){let n=this.getImage(i);if(n==null)throw new Error(`Missing z: ${i}`);if(!n.isTiled())throw new Error("Tif is not tiled");return n.getTile(e,r)}async processIfd(e){this.source.hasBytes(e,4096)||await this.source.loadBytes(e,4096);let{image:r,nextOffset:i}=await this.readIfd(e);this.images.push(r),i&&await this.processIfd(i)}async readIfd(e){this.source.hasBytes(e,1024)||await this.source.loadBytes(e,this.source.chunkSize);let i=this.cursor.seekTo(e).offset(),n=e+this.ifdConfig.offset,s=new Map,a=n;for(let p=0;p<i;p++){let m=Cc.create(this,a);if(a+=m.size,m.name==null)throw new Error("Unknown IFD Tag: "+D4(m.id));s.set(m.id,m)}let c=new Ac(this,this.images.length,s);return{nextOffset:this.source.getUint(a,this.ifdConfig.pointer),image:c}}async close(){var e,r;await((r=(e=this.source)===null||e===void 0?void 0:e.close)===null||r===void 0?void 0:r.call(e))}};var Ud=class{constructor(e){$h(this,"value");$h(this,"next");this.value=e}},bi,Es,Rs,L1=class{constructor(){yt(this,bi,void 0);yt(this,Es,void 0);yt(this,Rs,void 0);this.clear()}enqueue(e){let r=new Ud(e);Me(this,bi)?(Me(this,Es).next=r,Ze(this,Es,r)):(Ze(this,bi,r),Ze(this,Es,r)),Wh(this,Rs)._++}dequeue(){let e=Me(this,bi);if(!!e)return Ze(this,bi,Me(this,bi).next),Wh(this,Rs)._--,e.value}clear(){Ze(this,bi,void 0),Ze(this,Es,void 0),Ze(this,Rs,0)}get size(){return Me(this,Rs)}*[Symbol.iterator](){let e=Me(this,bi);for(;e;)yield e.value,e=e.next}};bi=new WeakMap,Es=new WeakMap,Rs=new WeakMap;function $d(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new L1,r=0,i=()=>{r--,e.size>0&&e.dequeue()()},n=async(c,d,p)=>{r++;let m=(async()=>c(...p))();d(m);try{await m}catch{}i()},s=(c,d,p)=>{e.enqueue(n.bind(void 0,c,d,p)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},a=(c,...d)=>new Promise(p=>{s(c,p,d)});return Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),a}var B4=require("crypto");var z4=require("path"),Wr={RenderId:1,key(t){return(0,B4.createHash)("sha256").update(JSON.stringify(t)).digest("base64")},generate(t,e){let r=t.map(n=>({...n,tiff:(0,z4.basename)(n.tiff.source.uri)})),i={...e,tileMatrix:e.tileMatrix.identifier};return Wr.key({xyz:i,layers:r,RenderId:Wr.RenderId})},isNotModified(t,e){let r=t.header(ue.IfNoneMatch);return r!=null&&r.indexOf(e)>-1?(t.set("cache",{key:e,hit:!0,match:r}),!0):!1}};var Lt=class{static get(e){let r=Lt.cacheA.get(e);if(r)return r;let i=Lt.cacheB.get(e);return i==null?null:(Lt.cacheA.set(e,i),Lt.cacheB.delete(e),i)}static clear(){this.cacheA.clear(),this.cacheB.clear()}static set(e,r){Lt.cacheA.set(e,r),Lt.check()}static check(){Lt.MaxCacheSizeBytes<=0||Lt.currentSize<=Lt.MaxCacheSizeBytes||(Lt.cacheB=Lt.cacheA,Lt.cacheA=new Map)}static get currentSize(){let e=0;for(let r of Lt.cacheA.values())e+=r.source.chunkSize*r.source.chunks.size;return e}},Cn=Lt;Cn.cacheA=new Map,Cn.cacheB=new Map,Cn.MaxCacheSizeBytes=256*1024*1024;var fx=$d(Xe.getNumber(Xe.TiffConcurrency,25)),dx=new Mn(256),px={in:"lanczos3",out:"lanczos3"},mx={r:0,g:0,b:0,alpha:0};function gx(t){return t.endsWith(".tif")||t.endsWith(".tiff")?t:`${t}.tiff`}var ia=class{constructor(e,r){this.type=st.Raster;this.components=zt.parse(e),this.tileMatrix=r,this.tiler=new Bo(this.tileMatrix)}get id(){return Ar.id(this.fullName,this.tileMatrix)}get fullName(){return zt.componentsToName(this.components)}get title(){return this.tileSet?.title??this.components.name}get description(){return this.tileSet?.description??""}get extent(){return this.extentOverride??this.tileMatrix.extent}get format(){return this.tileSet.format??qe.Webp}async init(e){this.tileSet=e,this.imagery=await je.getAllImagery(this.tileSet.layers,[this.tileMatrix.projection])}async initTiffs(e,r){let i=this.getTiffsForTile(e,r),n=!1,s=i.map(a=>fx(async()=>{try{await a.init()}catch(c){r.warn({error:c,tiff:a.source.uri},"TiffLoadFailed"),n=!0}}));return await Promise.all(s),n?i.filter(a=>a.images.length>0):i}async tile(e,r){if(r.ext===rr.MapboxVectorTiles)return Ie;let i=await this.initTiffs(r,e.log),n=await this.tiler.tile(i,r.x,r.y,r.z),s=Wr.generate(n,r);if(e.set("layers",n.length),Wr.isNotModified(e,s))return xn;let a=await dx.compose({layers:n,format:r.ext,background:this.tileSet.background??mx,resizeKernel:this.tileSet.resizeKernel??px,metrics:e.timer});e.set("layersUsed",a.layers),e.set("bytes",a.buffer.byteLength);let c=new Y(200,"ok");return c.header(ue.ETag,s),c.header(ue.CacheControl,"public, max-age=604800"),c.buffer(a.buffer,"image/"+r.ext),c}getTiffsForTile(e,r){let i=[],n=this.tileMatrix.tileToSourceBounds(e),s=_t.convertZoomLevel(e.z,this.tileMatrix,sn.get(Se.Google));for(let a of this.tileSet.layers){if(a.maxZoom!=null&&s>a.maxZoom||a.minZoom!=null&&s<a.minZoom)continue;let c=a[this.tileMatrix.projection.code];if(c==null){r?.warn({layer:a.name,projection:this.tileMatrix.projection.code},"Failed to lookup imagery");continue}let d=this.imagery.get(c);if(d==null){r?.warn({layer:a.name,projection:this.tileMatrix.projection.code,imgId:c},"Failed to lookup imagery");continue}if(!!n.intersects(ge.fromJson(d.bounds)))for(let p of this.getCogsForTile(d,n))i.push(p)}return i}getCogsForTile(e,r){let i=[];for(let n of e.files){if(!r.intersects(ge.fromJson(n)))continue;let s=lr.join(e.uri,gx(n.name)),a=Cn.get(s);if(a==null){let c=lr.source(s);if(c==null)throw new Error(`Failed to create CogSource from ${s}`);$i.trace(c),a=new ra(c),Cn.set(s,a)}i.push(a)}return i}findImagery(e){let r=this.imagery.get(e);if(r!=null)return r;for(let i of this.imagery.values())if(i.name===e)return i;return null}child(e){let r=this.findImagery(e);if(r==null)return null;let i=zt.componentsToName({...this.components,layer:r.name}),n=new ia(i,this.tileMatrix);n.tileSet={...this.tileSet},n.tileSet.background=void 0;let s=this.tileSet?.title??this.tileSet?.name;n.tileSet.title=r.title??`${s} ${w1(r.name)}`,n.extentOverride=ge.fromJson(r.bounds),r.category&&(n.tileSet.category=r.category);let a={name:r.name,minZoom:0,maxZoom:100};return a[this.tileMatrix.projection.code]=r.id,n.tileSet.layers=[a],n.imagery=new Map,n.imagery.set(r.id,r),n}};var Ic=class{constructor(e,r){this.type=st.Vector;this.components=zt.parse(e),this.tileMatrix=r}async init(e){this.tileSet=e}get format(){return rr.MapboxVectorTiles}get id(){return Ar.id(this.fullName,this.tileMatrix)}get fullName(){return zt.componentsToName(this.components)}async tile(e,r){if(r.ext!==rr.MapboxVectorTiles)return Ie;if(r.tileMatrix.identifier!==lt.identifier)return Ie;if(this.tileSet.layers.length>1)return new Y(500,"Too many layers in tileset");let[i]=this.tileSet.layers;if(i[3857]==null)return new Y(500,"Layer url not found from tileset Config");e.timer.start("cotar:load");let n=await ta.get(i[3857]);if(n==null)return new Y(500,"Failed to load VectorTiles");e.timer.end("cotar:load");let s=(1<<r.z)-1-r.y;e.timer.start("cotar:tile");let a=await n.get(`tiles/${r.z}/${r.x}/${s}.pbf.gz`);if(a==null)return Ie;e.timer.end("cotar:tile");let c=new Y(200,"Ok");return c.buffer(Buffer.from(a),"application/x-protobuf"),c.header(ue.ContentEncoding,"gzip"),c}};var Wd=class{constructor(){this.CacheTime=3e4;this.cache=new Map;this.tileSets=new Map}id(e,r){if(typeof e=="string"){let i=zt.parse(e);return`${zt.componentsToName(i)}_${r?.identifier}`}return`${e.fullName}_${e.tileMatrix.identifier}`}add(e,r=Date.now()+this.CacheTime){let i=this.id(e);if(this.cache.has(i))throw new Error("Trying to add duplicate tile set:"+i);this.cache.set(i,{time:r,value:Promise.resolve(e)})}get(e,r){let i=this.id(e,r),n=this.cache.get(i);if(n==null||Date.now()-n.time>0){let s=this.loadTileSet(e,r);n={time:Date.now(),value:s},this.cache.set(i,n)}return n.value}async loadTileSet(e,r){let i=zt.parse(e),n=this.id(e,r);if(i.layer!=null){let p=zt.componentsToName({...i,layer:void 0}),m=await this.get(p,r);return m==null||m.type===st.Vector?null:m.child(i.layer)}let s=je.TileSet.id(e),a=await je.TileSet.get(s);if(a==null)return this.cache.delete(n),null;let c=this.tileSets.get(n);if(c!=null&&c?.tileSet.updatedAt===a.updatedAt)return c;if(je.isTileSetRaster(a)){let p=new ia(e,r);return await p.init(a),this.tileSets.set(n,p),p}let d=new Ic(e,r);return await d.init(a),this.tileSets.set(n,d),d}},Ar=new Wd;var vx={},yx=[{type:di.Tile,name:"health",tileMatrix:lt,ext:qe.Png,x:252,y:156,z:8},{type:di.Tile,name:"health",tileMatrix:nn,ext:qe.Png,x:30,y:33,z:6}],j4=256;async function bx(t){if(Buffer.isBuffer(t.buf))return t.buf;let e=`static/expected_tile_${t.tileMatrix.identifier}_${t.x}_${t.y}_z${t.z}.${t.ext}`;try{return await Fd.promises.readFile(e)}catch(r){if(r.code!=="ENOENT")throw r;let i=kc.join(kc.dirname(U4.default.fileURLToPath(vx.url)),"..","..",e);return await Fd.promises.readFile(i)}}async function Gd(t){for(let r of yx){let i=await Ar.get("health",r.tileMatrix);if(i==null)throw new Y(500,'TileSet: "health" not found');let n=await i.tile(t,r);if(n.status!==200)return new Y(500,n.statusDescription);if(!Buffer.isBuffer(n._body))throw new Y(500,"Not a Buffer response content.");let s=await(0,Hd.default)(n._body).raw().toBuffer(),a=await bx(r);r.buf=a;let c=await(0,Hd.default)(a).raw().toBuffer(),d=Buffer.alloc(c.length),p=(0,q4.default)(c,s,d,j4,j4);if(p)return t.log.error({missMatchedPixels:p,projection:r.tileMatrix.identifier,xyz:{x:r.x,y:r.y,z:r.z}},"Health:MissMatch"),new Y(500,"TileSet does not match.")}let e=new Y(200,"ok");return e.header(ue.CacheControl,"no-store"),e}var $4=require("crypto"),W4=require("util"),F4=require("zlib");var wx=(0,W4.promisify)(F4.gzip);function _x(t){return t==null?!1:!!(t.endsWith(".geojson")||t.endsWith(".json"))}async function H4(t){let e=t.params.fileName;if(!_x(e))return new Y(404,"Not found");let r=await je.Imagery.get(je.Imagery.id(t.params.imageryId));if(r==null)return new Y(404,"Not found");let i=lr.join(r.uri,e);try{let n=await lr.read(i),s=(0,$4.createHash)("sha256").update(n).digest("base64");if(Wr.isNotModified(t,s))return xn;let a=new Y(200,"ok");return a.header(ue.ETag,s),a.header(ue.ContentEncoding,"gzip"),a.buffer(await wx(n),"application/json"),t.set("bytes",n.byteLength),a}catch{return t.log.warn({targetPath:i},"ImageryMetadata:Failed"),new Y(404,"Not found")}}var G4=fe(require("path"),1);var Vd=new Map;Vd.set(".png","image/png");Vd.set(".json","application/json");async function V4(t){let e=Xe.get(Xe.AssetLocation);if(e==null)return Ie;let r=G4.default.extname(t.params.spriteName),i=Vd.get(r);if(i==null)return Ie;let n=Ye.join("sprites",t.params.spriteName);if(e.endsWith(".tar.co"))return P1(e,n,i);try{let s=Ye.join(e,n);t.set("target",s);let a=await Ye.read(s),c=Y.ok().buffer(a,i);return Ad(a)&&c.header("content-encoding","gzip"),c}catch(s){if(s.code===404)return Ie;throw s}}var K4=fe(Zn(),1),Sx=60*60*1e3,xx=24*Sx,Mx=91*xx;function Z4(t){if(t==null||!t.startsWith("c")&&!t.startsWith("d"))return!1;let e=t.slice(1).toUpperCase();try{let r=K4.decodeTime(e);if(t.startsWith("d"))return!0;if(Date.now()-r>Mx)return!1}catch{return!1}return!0}var Y4=require("crypto");var Ex=1+1e-10,Kd=new Y(404,"Not Found"),J4=10**8;function Zd(t){return Math.round(t*J4)/J4}function Rx(t){return[Zd(t[0]),Zd(t[1])]}function Cx(t,e,r){if(mi.delta(t[0],t[2])<=0)return mi.bboxToMultiPolygon(t);let i=[];for(let s of e){let a=[ge.fromJson(s).pad(Ex).toPolygon()];i=o6(i,a)}return Zu(i,s=>Rx(r.toWgs84(s)))}async function Ax(t){try{return await lr.readJson(t)}catch(e){if(Je.isCompositeError(e)&&e.code<500)return null;throw e}}function Px(t,e,r,i,n,s){let a=t.tileMatrix;return{stac_version:$a.Version,license:e?.license??$a.License,id:r.id,providers:e?.providers??[{name:n.serviceProvider.name,url:n.serviceProvider.site,roles:["host"]}],title:e?.title??w1(r.name),description:e?.description??"No description",extent:s,links:[],summaries:{"linz:zoom":{min:_t.convertZoomLevel(i.minZoom?i.minZoom:0,lt,a,!0),max:_t.convertZoomLevel(i.maxZoom?i.maxZoom:32,lt,a,!0)},"linz:priority":[1e3+t.tileSet.layers.indexOf(i)]}}}async function Tx(t){let e=qr.get(t.tileMatrix),r=new Map,i=[],n=[];for(let a of t.tileSet.layers){let c=a[e.epsg.code];if(c==null)continue;let d=t.imagery.get(c);d!=null&&r.get(d.uri)==null&&r.set(d.uri,Ax(lr.join(d.uri,"collection.json")))}let s=await je.Provider.get(je.Provider.id("linz"));if(s==null)return null;for(let a of t.tileSet.layers){let c=a[e.epsg.code];if(c==null)continue;let d=t.imagery.get(c);if(d==null)continue;let p=await r.get(d.uri),m=e.boundsToWgs84BoundingBox(d.bounds).map(Zd),w=p?.extent.temporal.interval;if(w==null){let v=y6(d.name);if(v[0]===-1)throw new Error("Missing date in imagery name: "+d.name);w=[v.map(R=>`${R}-01-01T00:00:00Z`)]}let S={spatial:{bbox:[m]},temporal:{interval:w}};n.push({type:"Feature",stac_version:$a.Version,id:c+"_item",collection:c,assets:{},links:[],bbox:m,geometry:{type:"MultiPolygon",coordinates:Cx(m,d.files,e)},properties:{title:w1(d.name),datetime:null,start_datetime:w[0][0],end_datetime:w[0][1]}}),i.push(Px(t,p,d,a,s,S))}return{id:t.id,type:"FeatureCollection",stac_version:$a.Version,stac_extensions:["single-file-stac"],title:t.title,description:t.description,features:n,collections:i,links:[]}}async function X4(t){let e=it.action(t),r=Am(e.rest);if(r==null)return Kd;Rm(t,r),t.timer.start("tileset:load");let i=await Ar.get(r.name,r.tileMatrix);if(t.timer.end("tileset:load"),i==null||i.type===st.Vector)return Kd;let n=(0,Y4.createHash)("sha256").update(JSON.stringify(i.tileSet)).digest("base64"),s=t.header(ue.IfNoneMatch);if(s!=null&&s.indexOf(n)>-1)return t.set("cache",{key:n,hit:!0,match:s}),new Y(304,"Not modified");t.timer.start("stac:load");let a=await Tx(i);if(t.timer.end("stac:load"),a==null)return Kd;let c=new Y(200,"ok");return c.header(ue.ETag,n),c.header(ue.CacheControl,"public, max-age=86400, stale-while-revalidate=604800"),c.json(a),c}async function Q4(t){let{version:e,rest:r,name:i}=it.action(t);if(r.length!==3)return Ie;let n=p1(r[1]);if(n==null)return Ie;t.timer.start("tileset:load");let s=await Ar.get(r[0],n);if(t.timer.end("tileset:load"),s==null)return Ie;let a=it.apiKey(t),p={tiles:[[Xe.get(Xe.PublicUrlBase)??"",e,i,s.fullName,n.identifier,"{z}","{x}","{y}"].join("/")+`.${s.format}?api=${a}`],tilejson:"3.0.0"},m=_t.convertZoomLevel(s.tileSet.maxZoom??30,lt,n,!0),w=_t.convertZoomLevel(s.tileSet.minZoom??0,lt,n,!0);s.tileSet.maxZoom&&(p.maxzoom=m),s.tileSet.minZoom&&(p.minzoom=w);let S=JSON.stringify(p),v=Buffer.from(S),R=new Y(200,"ok");return R.header(ue.CacheControl,"no-store"),R.buffer(v,"application/json"),t.set("bytes",v.byteLength),R}var eg=require("crypto"),tg=require("url");function Oc(t,e){if(t==null)return"";let r=Xe.get(Xe.PublicUrlBase)??"";if(!t.startsWith("/"))return t;let i=new tg.URL(Ye.join(r,t));return e&&i.searchParams.set("api",e),i.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")}function Ix(t,e){let r=JSON.parse(JSON.stringify(t.sources));for(let[i,n]of Object.entries(r)){if(n.type==="vector")n.url=Oc(n.url,e);else if(n.type==="raster"&&Array.isArray(n.tiles))for(let s=0;s<n.tiles.length;s++)n.tiles[s]=Oc(n.tiles[s],e);r[i]=n}return{version:8,id:t.id,name:t.name,sources:r,layers:t.layers,metadata:t.metadata??{},glyphs:Oc(t.glyphs),sprite:Oc(t.sprite)}}async function rg(t,e){let r=it.apiKey(t);if(r==null)return new Y(400,"Invalid API Key.");let i=e.split(".json")[0],n=je.Style.id(i),s=await je.Style.get(n);if(s==null)return Ie;let a=Ix(s.style,r),c=Buffer.from(JSON.stringify(a)),d=(0,eg.createHash)("sha256").update(c).digest("base64");if(Wr.isNotModified(t,d))return xn;let p=new Y(200,"ok");return p.header(ue.ETag,d),p.header(ue.CacheControl,"no-store"),p.buffer(c,"application/json"),t.set("bytes",c.byteLength),p}var ig=require("crypto");var kx={xmlns:"http://www.opengis.net/wmts/1.0","xmlns:ows":"http://www.opengis.net/ows/1.1","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:gml":"http://www.opengis.net/gml","xsi:schemaLocation":"http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd",version:"1.0.0"};function Jd(t,e){return qr.get(t).boundsToWgs84BoundingBox(e)}var Lc=class{constructor(e){this.tileMatrixSets=new Map;this.isIndividualLayers=!1;this.httpBase=e.httpBase,this.provider=e.provider,this.tileSet=e.tileSet,this.isIndividualLayers=e.isIndividualLayers;for(let r of e.tileMatrix)this.tileMatrixSets.set(r.identifier,r);this.apiKey=e.apiKey,this.formats=e.formats??Em,this.imagery=e.imagery}async loadImagery(){let e=new Set;for(let r of this.tileMatrixSets.values())for(let i of this.tileSet.layers){let n=i[r.projection.code];n!=null&&e.add(n)}this.imagery=await je.Imagery.getAll(e)}buildWgs84BoundingBox(e,r){let i;if(r.length>0){i=Jd(e,r[0]);for(let n=1;n<r.length;n++)i=mi.union(i,Jd(e,r[n]))}else i=Jd(e,e.extent);return J("ows:WGS84BoundingBox",{crs:"urn:ogc:def:crs:OGC:2:84"},i[2]>180?[J("ows:LowerCorner","-180 -90"),J("ows:UpperCorner","180 90")]:[J("ows:LowerCorner",`${i[0]} ${i[1]}`),J("ows:UpperCorner",`${i[2]} ${i[3]}`)])}buildBoundingBoxFromImagery(e,r){let i;for(let s of r){let a=s[e.projection.code];if(a==null)continue;let c=this.imagery.get(a);c!=null&&(i==null?i=ge.fromJson(c.bounds):i=i.union(ge.fromJson(c.bounds)))}if(i==null)return null;let n=i.toBbox();return J("ows:BoundingBox",{crs:e.projection.toUrn()},[J("ows:LowerCorner",`${n[e.indexX]} ${n[e.indexY]}`),J("ows:UpperCorner",`${n[e.indexX+2]} ${n[e.indexY+2]}`)])}buildProvider(){if(this.provider==null)return[];let{serviceIdentification:e,serviceProvider:r}=this.provider,{contact:i}=r;return[J("ows:ServiceIdentification",[J("ows:Title",e.title),J("ows:Abstract",e.description),J("ows:ServiceType","OGC WMTS"),J("ows:ServiceTypeVersion","1.0.0"),J("ows:Fees",e.fees),J("ows:AccessConstraints",e.accessConstraints)]),J("ows:ServiceProvider",[J("ows:ProviderName",r.name),J("ows:ProviderSite",{"xlink:href":r.site}),J("ows:ServiceContact",[J("ows:IndividualName",i.individualName),J("ows:PositionName",i.position),J("ows:ContactInfo",[J("ows:Phone",[J("ows:Voice",i.phone)]),J("ows:Address",[J("ows:DeliveryPoint",i.address.deliveryPoint),J("ows:City",i.address.city),J("ows:PostalCode",i.address.postalCode),J("ows:Country",i.address.country),J("ows:ElectronicMailAddress",i.address.email)])])])])]}buildTileUrl(e,r){let i=this.apiKey?`?api=${this.apiKey}`:"";return[this.httpBase,"v1","tiles",e,"{TileMatrixSet}","{TileMatrix}","{TileCol}",`{TileRow}.${r}${i}`].join("/")}buildResourceUrl(e,r){return J("ResourceURL",{format:"image/"+r,resourceType:"tile",template:this.buildTileUrl(e,r)})}buildLayerFromImagery(e){let r=new Set,i=[];for(let d of this.tileMatrixSets.values()){let p=e[d.projection.code];p==null||this.imagery.get(p)==null||(i.push(J("TileMatrixSetLink",[J("TileMatrixSet",d.identifier)])),r.add(d))}let n=so(e.name),s=[...r.values()],a=s[0];if(a==null)return null;let c=this.imagery.get(e[a.projection.code]??"");return c==null?null:J("Layer",[J("ows:Title",e.title??n),J("ows:Abstract",""),J("ows:Identifier",n),this.buildKeywords(c),...s.map(d=>this.buildBoundingBoxFromImagery(d,[e])),this.buildWgs84BoundingBox(a,[ge.fromJson(c.bounds)]),this.buildStyle(),...this.formats.map(d=>J("Format","image/"+d)),...i,...this.formats.map(d=>this.buildResourceUrl(n,d))])}buildLayer(e){let r=new Set,i=[];for(let p of this.tileMatrixSets.values())e.layers.find(m=>m[p.projection.code]!=null)&&(i.push(J("TileMatrixSetLink",[J("TileMatrixSet",p.identifier)])),r.add(p));let n=so(e.name),s=[...r.values()],a=s[0];if(a==null)throw new Error("No matrix sets found for layer "+e.name);let c=s.find(p=>p.identifier===lt.identifier)??a,d=[];for(let p of e.layers){let m=this.imagery.get(p[c.projection.code]??"");m!=null&&d.push(ge.fromJson(m.bounds))}return J("Layer",[J("ows:Title",e.title??n),J("ows:Abstract",e.description??""),J("ows:Identifier",n),this.buildKeywords(e),...[...r.values()].map(p=>this.buildBoundingBoxFromImagery(p,e.layers)),this.buildWgs84BoundingBox(c,d),this.buildStyle(),...this.formats.map(p=>J("Format","image/"+p)),...i,...this.formats.map(p=>this.buildResourceUrl(n,p))])}buildKeywords(e){return e.category==null?J("ows:Keywords"):J("ows:Keywords",[J("ows:Keyword",e.category)])}buildStyle(){return J("Style",{isDefault:"true"},[J("ows:Title","Default Style"),J("ows:Identifier","default")])}buildTileMatrixSet(e){return J("TileMatrixSet",[J("ows:Title",e.def.title),e.def.abstract?J("ows:Abstract",e.def.abstract):null,J("ows:Identifier",e.identifier),J("ows:SupportedCRS",e.projection.toUrn()),e.def.wellKnownScaleSet?J("WellKnownScaleSet",e.def.wellKnownScaleSet):null,...e.def.tileMatrix.map(r=>J("TileMatrix",[J("ows:Identifier",r.identifier),J("ScaleDenominator",r.scaleDenominator),J("TopLeftCorner",r.topLeftCorner.join(" ")),J("TileWidth",r.tileWidth),J("TileHeight",r.tileHeight),J("MatrixWidth",r.matrixWidth),J("MatrixHeight",r.matrixHeight)]))])}toVNode(){let e=[];if(e.push(this.buildLayer(this.tileSet)),this.isIndividualLayers){let r=new Map;for(let n of this.tileSet.layers)r.set(so(n.name),n);let i=Array.from(r.values()).sort((n,s)=>(n.title??n.name).localeCompare(s.title??s.name));for(let n of i)e.push(this.buildLayerFromImagery(n))}for(let r of this.tileMatrixSets.values())e.push(this.buildTileMatrixSet(r));return J("Capabilities",kx,[...this.buildProvider(),J("Contents",e)])}toXml(){return`<?xml version="1.0" encoding="utf-8"?>
185
- `+this.toVNode().toString()}};function Ox(t){let e=[...t.query.getAll("format"),...t.query.getAll("tileFormat")];if(e.length===0)return;let r=new Set;for(let i of e){let n=Wu(i);n!=null&&r.add(n)}if(r.size!==0)return[...r.values()]}async function ng(t){let e=it.action(t),r=Pm(e.rest);if(r==null)return Ie;let i=Xe.get(Xe.PublicUrlBase)??"";t.timer.start("tileset:load");let n=await je.TileSet.get(je.TileSet.id(r.name??"aerial"));if(t.timer.end("tileset:load"),n==null||n.type!==st.Raster)return Ie;let s=await je.Provider.get(je.Provider.id("linz")),a=r.tileMatrix==null?[lt,nn]:[r.tileMatrix];t.timer.start("imagery:load");let c=await je.getAllImagery(n.layers,a.map(v=>v.projection));t.timer.end("imagery:load");let d=it.apiKey(t),p=new Lc({httpBase:i,provider:s??void 0,tileSet:n,tileMatrix:a,isIndividualLayers:r.tileMatrix==null,imagery:c,apiKey:d,formats:Ox(t)}).toXml();if(p==null)return Ie;let m=Buffer.from(p),w=(0,ig.createHash)("sha256").update(m).digest("base64");if(Wr.isNotModified(t,w))return xn;let S=new Y(200,"ok");return S.header(ue.ETag,w),S.header(ue.CacheControl,"max-age=0"),S.buffer(m,"text/xml"),t.set("bytes",m.byteLength),S}var sg={validate(t,e){let{tileMatrix:r,x:i,y:n,z:s,ext:a}=e;if(t.set("xyz",{x:i,y:n,z:s}),t.set("projection",r.projection.code),t.set("tileMatrix",r.identifier),t.set("extension",a),t.set("tileSet",e.name),s>r.maxZoom||s<0)throw new Y(404,`Zoom not found: ${s}`);let c=r.zooms[s];if(i<0||i>c.matrixWidth)throw new Y(404,`X not found: ${i}`);if(n<0||n>c.matrixHeight)throw new Y(404,`Y not found: ${n}`);let d=qr.tileCenterToLatLon(r,e);t.set("location",d)}};async function og(t){let e=it.action(t),r=Cm(e.rest);if(r==null)return Ie;sg.validate(t,r),t.timer.start("tileset:load");let i=await Ar.get(r.name,r.tileMatrix);return t.timer.end("tileset:load"),i==null?Ie:await i.tile(t,r)}async function ag(t){let{rest:e}=it.action(t);if(e.length<1)return Ie;let r=it.apiKey(t);if(!Z4(r))return new Y(400,"Invalid API Key");let i=e[e.length-1].toLowerCase();return i==="attribution.json"?X4(t):i==="wmtscapabilities.xml"?ng(t):i==="tile.json"?Q4(t):i.endsWith("json")&&e[e.length-2]==="style"?rg(t,i):og(t)}var ug=new it;ug.get("tiles",ag);async function cg(t){let e=it.apiKey(t);if(e!=null){let r=(0,lg.createHash)("sha256").update(e).digest("base64");t.set("api",r)}return await ug.handle(t)}var Vt=cr.http($u.get());Vt.router.hook("request",t=>{t.set("name","LambdaTiler"),$i.reset()});Vt.router.hook("response",t=>{$i.requests.length>0&&(t.set("requests",$i.requests.slice(0,100)),t.set("requestCount",$i.requests.length))});Vt.router.get("/ping",bd);Vt.router.get("/health",Gd);Vt.router.get("/version",vd);Vt.router.get("/v1/ping",bd);Vt.router.get("/v1/health",Gd);Vt.router.get("/v1/version",vd);Vt.router.get("/v1/imagery/:imageryId/:fileName",H4);Vt.router.get("/v1/sprites/:spriteName",V4);Vt.router.get("/v1/fonts.json",M4);Vt.router.get("/v1/fonts/:fontStack/:range.pbf",x4);Vt.router.get("*",cg);0&&(module.exports={handleRequest,handler});
183
+ `;r+="return ret";let i=new Function("_bp","buf","ctx",r);this.parse=i.bind(null,e)}get size(){if(this._size>-1)return this._size;let e=0;for(let r of this.fields)e+=r.parser.size;return this._size=e,this._size}parse(e,r){return{}}};function fa(t,e=2){return"0x"+t.toString(16).padStart(e,"0")}var Sh=class extends ke{constructor(e,r){super("Offset:"+e.name+":"+r.name),this.type=r,this.offset=e}get size(){return this.type.size}parse(e,r){let i=this.offset.parse(e,r);if(i>e.length||i<0)throw new Error(`[${this.name}]: BufferOverflow attempted read at ${fa(i)}`);return this.type.parse(e,{offset:i,startOffset:i})}};var Mh=class extends ke{constructor(e){super("Skip:"+e),this.size=e}parse(e,r){r.offset+=this.size}};var Eh=class extends ke{constructor(){super("String")}get size(){throw new Error("Unable to calculate size from dynamic object")}parse(e,r){let i=r.offset,n=[],o=0;for(;o+i<e.length;){let a=e[i+o];if(a===0)break;n.push(String.fromCharCode(a)),o++}return r.offset+=o+1,n.join("")}},Rh=class extends ke{constructor(e){super("String:"+e),this.size=e}parse(e,r){let i=r.offset;if(this.size+i>e.length)throw new Error(`BufferOverflow: ${this.name} offset: ${fa(r.offset)}`);let n=[],o=0;for(;o<this.size;){let a=e[i+o];if(a===0)break;n.push(String.fromCharCode(a)),o++}return r.offset+=this.size,n.join("")}};function NS(t,e,r,i){return typeof r=="number"?new ph(t,e,r):new gh(t,e,r,i??!1)}var hr={u8:x4,lu16:S4,lu32:ha,lu64:M4,blu64:E4,empty:new ca("Empty",{}),offset(t,e){return new Sh(t,e)},string(t){return t==null?new Eh:new Rh(t)},bits(t,e){return new yh(t,e)},flags(t,e,r){return new bh(t,e,r)},object(t,e){return new xh(t,e)},static(t,e){return new ca(t,e)},lookup(t,e,r){return new wh(t,e,r)},enum(t,e,r){return new _h(t,e,r)},bytes(t){return new vh(t)},skip(t){return new Mh(t)},array:NS};var R4;(function(t){t[t.File="0".charCodeAt(0)]="File",t[t.HardLink="1".charCodeAt(0)]="HardLink",t[t.SymLink="2".charCodeAt(0)]="SymLink",t[t.CharDeviceNode="3".charCodeAt(0)]="CharDeviceNode",t[t.BlockDeviceNode="4".charCodeAt(0)]="BlockDeviceNode",t[t.Directory="5".charCodeAt(0)]="Directory",t[t.FifoNode="6".charCodeAt(0)]="FifoNode",t[t.Reserved="7".charCodeAt(0)]="Reserved",t[t.LongName="L".charCodeAt(0)]="LongName",t[t.LongLink="K".charCodeAt(0)]="LongLink"})(R4||(R4={}));var BS=hr.object("TarHeader",{path:hr.string(100),skip1:hr.skip(24),size:hr.bytes(12).refine(t=>parseInt(t.toString(),8)),skip2:hr.skip(20),type:hr.u8,linkName:hr.string(100)});var C4={32:16777619n,64:1099511628211n,128:309485009821345068724781371n,256:374144419156711147060143317175368453031918731002211n,512:35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759n,1024:5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573n},DS={32:2166136261n,64:14695981039346656037n,128:144066263297769815596495629667062367629n,256:100029257958052580907070968620625704837092796014241193945225284501741471925557n,512:9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785n,1024:14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915n};function Od(t,{size:e=32}={}){if(!C4[e])throw new Error("The `size` option must be one of 32, 64, 128, 256, 512, or 1024");let r=DS[e],i=C4[e],n=!1;for(let o=0;o<t.length;o++){let a=t.charCodeAt(o);a>127&&!n&&(t=unescape(encodeURIComponent(t)),a=t.charCodeAt(o),n=!0),r^=BigInt(a),r=BigInt.asUintN(e,r*i)}return r}var Ch="COT";var zS=BigInt(0),jS=BigInt(32),US=BigInt(2**32-1),A4=hr.object("CotarMetadata",{magic:hr.string(Ch.length),version:hr.u8,count:hr.lu32}),Fr=class{constructor(e,r,i=0){this.isHeader=!0,this.source=e,this.sourceOffset=i,this.metadata=r}static hash(e){return Od(e,{size:64})}static async loadMetadata(e,r,i){if(i){await e.loadBytes(r,e.chunkSize);let o=e.bytes(r,8);return A4.read(o).value}let n=await e.fetchBytes(-8);return A4.read(new Uint8Array(n)).value}static async getMetadata(e,r,i){let n=await this.loadMetadata(e,r,i);if(n.magic!==Ch)throw new Error(`Invalid source: ${e.uri} invalid magic found: ${n.magic}`);if(n.version===1||n.version===2)return n;throw new Error(`Invalid source: ${e.uri} invalid version found: ${n.version}`)}static async create(e,r=0,i=!0){let n=await this.getMetadata(e,r,i);return new Fr(e,n,r)}async find(e){if(this.metadata.version===1)return this._findV1(e);if(this.metadata.version===2)return this._findV2(e);throw new Error("Invalid metadata version")}async _findV2(e){let r=Fr.hash(e),i=this.metadata.count,n=Number(r%BigInt(i)),o=Number(r>>jS),a=Number(r&US),h=null,d=null,m=n;for(;;){let p=this.sourceOffset+m*16+8;if(await this.source.loadBytes(p,16),d=this.source.getUint32(p),h=this.source.getUint32(p+4),h===o&&d===a){let M=this.source.getUint32(p+8)*512,R=this.source.getUint32(p+12);return{offset:M,size:R}}if(h===0&&d===0||(m++,m>=i&&(m=0),m===n))return null}}async _findV1(e){let r=Fr.hash(e),i=this.metadata.count,n=Number(r%BigInt(i)),o=null,a=n;for(;;){let h=this.sourceOffset+a*24+8;if(await this.source.loadBytes(h,24),o=this.source.getBigUint64(h),o===r){let d=this.source.getUint64(h+8),m=this.source.getUint64(h+16);return{offset:d,size:m}}if(o===zS||(a++,a>=i&&(a=0),a===n))return null}}};var Ck=BigInt(0);var Ms=class{constructor(e,r){this.source=e,this.index=r}static async fromTar(e){let r=await Fr.getMetadata(e,0,!1),i=await e.size,n=r.version===1?24:16,o=i-(r.count*n+16),a=new Fr(e,r,o);return new Ms(e,a)}async get(e){let r=await this.index.find(e);return r==null?null:(await this.source.loadBytes(r.offset,r.size),this.source.bytes(r.offset,r.size))}};var Ie=new Y(404,"Not Found"),Cn=new Y(304,"Not modified");var kd=class{constructor(){this.requests=[]}reset(){this.requests=[]}trace(e){let r=e.fetchBytes;e.fetchBytes=async(i,n)=>{let o={source:e.uri,offset:i,length:n};this.requests.push(o);let a=Date.now(),h=await r.apply(e,[i,n]);return o.duration=Date.now()-a,h}}},Ui=new kd;var Th=class{static get(e){let r=Th.cache.get(e);if(r==null){let i=Xe.source(e);Ui.trace(i),r=Ms.fromTar(i),Th.cache.set(e,r)}return r}},da=Th;da.cache=new Map;async function j1(t,e,r){let i=await da.get(t);if(i==null)return Ie;let n=await i.get(e);if(n==null)return Ie;let o=Buffer.from(n),a=Y.ok().buffer(o,r);return Ld(o)&&a.header("content-encoding","gzip"),a}function Ld(t){return t[0]===31&&t[1]===139}async function P4(t){let e=Qe.get(Qe.AssetLocation);if(e==null)return Ie;let r=decodeURIComponent(t.params.fontStack),i=Ph.default.join("fonts",r,t.params.range)+".pbf";if(e.endsWith(".tar.co"))return j1(e,i,"application/x-protobuf");try{let n=Xe.join(e,i),o=await Xe.read(n);return Y.ok().buffer(o,"application/x-protobuf")}catch(n){if(n.code===404)return Ie;throw n}}async function FS(t){let e=new Set;for await(let r of Xe.list(t)){if(!r.endsWith(".pbf"))continue;let i=Ph.default.basename(Ph.default.dirname(r));i.includes("/")||e.add(i)}return[...e].sort()}async function I4(){let t=Qe.get(Qe.AssetLocation);if(t==null)return Ie;if(t.endsWith(".tar.co"))return j1(t,"fonts.json","application/json");try{let e=Xe.join(t,"/fonts"),r=await FS(e);return Y.ok().buffer(JSON.stringify(r),"application/json")}catch(e){if(e.code===404)return Ie;throw e}}var Zd=de(require("fs"),1),Uh=de(require("path"),1),V4=de(z4(),1),Yd=de(require("sharp"),1),K4=de(require("url"),1);var kh=de(require("sharp"),1);function HS(t){return t!=null}var Oh=new Map,An=class{constructor(e){this.tileSize=e}isTooLarge(e){return!!(e.resize&&(e.resize.width>=An.MaxImageSize||e.resize.height>=An.MaxImageSize))}getEmptyImage(e,r){let i=[e,r.r,r.g,r.b,r.alpha].join("-"),n=Oh.get(i);return n||(n=this.toImage(e,this.createImage(r)),Oh.size>128&&Oh.clear(),Oh.set(i,n),n)}toImage(e,r){switch(e){case Ue.Jpeg:return r.jpeg().toBuffer();case Ue.Png:return r.png().toBuffer();case Ue.Webp:return r.webp().toBuffer();case Ue.Avif:return r.avif().toBuffer();default:throw new Error(`Invalid image format "${e}"`)}}async getImageBuffer(e,r,i){return e.length===0?this.getEmptyImage(r,i):this.toImage(r,this.createImage(i).composite(e))}isDirectImage(e){var r;if(e.layers.length!==1)return!1;let i=e.layers[0];if(i.x!==0||i.y!==0||i.crop!=null||i.extract!=null||i.resize!=null)return!1;let n=i.tiff.getImage(i.source.imageId),o=n.tileSize;return!(o.height!==this.tileSize||o.width!==this.tileSize||!(!((r=n.compression)===null||r===void 0)&&r.includes(e.format))||e.background.alpha!==0)}async compose(e){var r;let i=(r=e.metrics)!==null&&r!==void 0?r:new ws;if(i.start("compose:overlay"),this.isDirectImage(e)){let h=e.layers[0],d=await h.tiff.getTile(h.source.x,h.source.y,h.source.imageId);return i.end("compose:overlay"),d==null?{buffer:await this.getEmptyImage(e.format,e.background),metrics:i,layers:0}:(i.start("compose:direct"),i.end("compose:direct"),{buffer:Buffer.from(d.bytes),metrics:i,layers:1})}let n=[];for(let h of e.layers)this.isTooLarge(h)||n.push(this.composeTile(h,e.resizeKernel));let o=await Promise.all(n).then(h=>h.filter(HS));i.end("compose:overlay"),i.start("compose:compress");let a=await this.getImageBuffer(o,e.format,e.background);return i.end("compose:compress"),{buffer:a,metrics:i,layers:o.length}}async composeTile(e,r){let i=await e.tiff.getTile(e.source.x,e.source.y,e.source.imageId);if(i==null)return null;let n=(0,kh.default)(Buffer.from(i.bytes)),{extract:o,resize:a,crop:h}=e;if(o&&n.extract({top:0,left:0,width:o.width,height:o.height}),a){let d={fit:kh.default.fit.cover,kernel:a.scale>1?r.in:r.out};n.resize(a.width,a.height,d)}return h&&n.extract({top:h.y,left:h.x,width:h.width,height:h.height}),{input:await n.toBuffer(),top:e.y,left:e.x}}createImage(e){return(0,kh.default)({create:{width:this.tileSize,height:this.tileSize,channels:4,background:e}})}};An.MaxImageSize=256*2**15;var Rr;(function(t){t.NONE="application/octet-stream",t.JPEG="image/jpeg",t.JP2="image/jp2",t.WEBP="image/webp",t.LZW="application/lzw",t.DEFLATE="application/deflate"})(Rr||(Rr={}));var zd={1:Rr.NONE,5:Rr.LZW,6:Rr.JPEG,7:Rr.JPEG,8:Rr.DEFLATE,34712:Rr.JP2,50001:Rr.WEBP};var oe;(function(t){t[t.Artist=315]="Artist",t[t.BitsPerSample=258]="BitsPerSample",t[t.CellLength=265]="CellLength",t[t.CellWidth=264]="CellWidth",t[t.ColorMap=320]="ColorMap",t[t.Compression=259]="Compression",t[t.Copyright=33432]="Copyright",t[t.DateTime=306]="DateTime",t[t.ExtraSamples=338]="ExtraSamples",t[t.FillOrder=266]="FillOrder",t[t.FreeByteCounts=289]="FreeByteCounts",t[t.FreeOffsets=288]="FreeOffsets",t[t.GrayResponseCurve=291]="GrayResponseCurve",t[t.GrayResponseUnit=290]="GrayResponseUnit",t[t.HostComputer=316]="HostComputer",t[t.ImageDescription=270]="ImageDescription",t[t.ImageHeight=257]="ImageHeight",t[t.ImageWidth=256]="ImageWidth",t[t.Make=271]="Make",t[t.MaxSampleValue=281]="MaxSampleValue",t[t.MinSampleValue=280]="MinSampleValue",t[t.Model=272]="Model",t[t.NewSubFileType=254]="NewSubFileType",t[t.Orientation=274]="Orientation",t[t.PhotometricInterpretation=262]="PhotometricInterpretation",t[t.PlanarConfiguration=284]="PlanarConfiguration",t[t.ResolutionUnit=296]="ResolutionUnit",t[t.RowsPerStrip=278]="RowsPerStrip",t[t.SamplesPerPixel=277]="SamplesPerPixel",t[t.Software=305]="Software",t[t.StripByteCounts=279]="StripByteCounts",t[t.StripOffsets=273]="StripOffsets",t[t.SubFileType=255]="SubFileType",t[t.Threshholding=263]="Threshholding",t[t.XResolution=282]="XResolution",t[t.YResolution=283]="YResolution",t[t.BadFaxLines=326]="BadFaxLines",t[t.CleanFaxData=327]="CleanFaxData",t[t.ClipPath=343]="ClipPath",t[t.ConsecutiveBadFaxLines=328]="ConsecutiveBadFaxLines",t[t.Decode=433]="Decode",t[t.DefaultImageColor=434]="DefaultImageColor",t[t.DocumentName=269]="DocumentName",t[t.DotRange=336]="DotRange",t[t.HalftoneHints=321]="HalftoneHints",t[t.Indexed=346]="Indexed",t[t.JPEGTables=347]="JPEGTables",t[t.PageName=285]="PageName",t[t.PageNumber=297]="PageNumber",t[t.Predictor=317]="Predictor",t[t.PrimaryChromaticities=319]="PrimaryChromaticities",t[t.ReferenceBlackWhite=532]="ReferenceBlackWhite",t[t.SampleFormat=339]="SampleFormat",t[t.SMinSampleValue=340]="SMinSampleValue",t[t.SMaxSampleValue=341]="SMaxSampleValue",t[t.StripRowCounts=559]="StripRowCounts",t[t.SubIFDs=330]="SubIFDs",t[t.T4Options=292]="T4Options",t[t.T6Options=293]="T6Options",t[t.TileByteCounts=325]="TileByteCounts",t[t.TileHeight=323]="TileHeight",t[t.TileOffsets=324]="TileOffsets",t[t.TileWidth=322]="TileWidth",t[t.TransferFunction=301]="TransferFunction",t[t.WhitePoint=318]="WhitePoint",t[t.XClipPathUnits=344]="XClipPathUnits",t[t.XPosition=286]="XPosition",t[t.YCbCrCoefficients=529]="YCbCrCoefficients",t[t.YCbCrPositioning=531]="YCbCrPositioning",t[t.YCbCrSubSampling=530]="YCbCrSubSampling",t[t.YClipPathUnits=345]="YClipPathUnits",t[t.YPosition=287]="YPosition",t[t.ApertureValue=37378]="ApertureValue",t[t.ColorSpace=40961]="ColorSpace",t[t.DateTimeDigitized=36868]="DateTimeDigitized",t[t.DateTimeOriginal=36867]="DateTimeOriginal",t[t.ExifIFD=34665]="ExifIFD",t[t.ExifVersion=36864]="ExifVersion",t[t.ExposureTime=33434]="ExposureTime",t[t.FileSource=41728]="FileSource",t[t.Flash=37385]="Flash",t[t.FlashpixVersion=40960]="FlashpixVersion",t[t.FNumber=33437]="FNumber",t[t.ImageUniqueID=42016]="ImageUniqueID",t[t.LightSource=37384]="LightSource",t[t.MakerNote=37500]="MakerNote",t[t.ShutterSpeedValue=37377]="ShutterSpeedValue",t[t.UserComment=37510]="UserComment",t[t.IPTC=33723]="IPTC",t[t.ICCProfile=34675]="ICCProfile",t[t.XMP=700]="XMP",t[t.GDAL_METADATA=42112]="GDAL_METADATA",t[t.GDAL_NODATA=42113]="GDAL_NODATA",t[t.Photoshop=34377]="Photoshop",t[t.ModelPixelScale=33550]="ModelPixelScale",t[t.ModelTiePoint=33922]="ModelTiePoint",t[t.ModelTransformation=34264]="ModelTransformation",t[t.GeoKeyDirectory=34735]="GeoKeyDirectory",t[t.GeoDoubleParams=34736]="GeoDoubleParams",t[t.GeoAsciiParams=34737]="GeoAsciiParams"})(oe||(oe={}));var U1;(function(t){t[t.GTModelTypeGeoKey=1024]="GTModelTypeGeoKey",t[t.GTRasterTypeGeoKey=1025]="GTRasterTypeGeoKey",t[t.GTCitationGeoKey=1026]="GTCitationGeoKey",t[t.GeographicTypeGeoKey=2048]="GeographicTypeGeoKey",t[t.GeogCitationGeoKey=2049]="GeogCitationGeoKey",t[t.GeogGeodeticDatumGeoKey=2050]="GeogGeodeticDatumGeoKey",t[t.GeogPrimeMeridianGeoKey=2051]="GeogPrimeMeridianGeoKey",t[t.GeogLinearUnitsGeoKey=2052]="GeogLinearUnitsGeoKey",t[t.GeogLinearUnitSizeGeoKey=2053]="GeogLinearUnitSizeGeoKey",t[t.GeogAngularUnitsGeoKey=2054]="GeogAngularUnitsGeoKey",t[t.GeogAngularUnitSizeGeoKey=2055]="GeogAngularUnitSizeGeoKey",t[t.GeogEllipsoidGeoKey=2056]="GeogEllipsoidGeoKey",t[t.GeogSemiMajorAxisGeoKey=2057]="GeogSemiMajorAxisGeoKey",t[t.GeogSemiMinorAxisGeoKey=2058]="GeogSemiMinorAxisGeoKey",t[t.GeogInvFlatteningGeoKey=2059]="GeogInvFlatteningGeoKey",t[t.GeogAzimuthUnitsGeoKey=2060]="GeogAzimuthUnitsGeoKey",t[t.GeogPrimeMeridianLongGeoKey=2061]="GeogPrimeMeridianLongGeoKey",t[t.GeogTOWGS84GeoKey=2062]="GeogTOWGS84GeoKey",t[t.ProjectedCSTypeGeoKey=3072]="ProjectedCSTypeGeoKey",t[t.PCSCitationGeoKey=3073]="PCSCitationGeoKey",t[t.ProjectionGeoKey=3074]="ProjectionGeoKey",t[t.ProjCoordTransGeoKey=3075]="ProjCoordTransGeoKey",t[t.ProjLinearUnitsGeoKey=3076]="ProjLinearUnitsGeoKey",t[t.ProjLinearUnitSizeGeoKey=3077]="ProjLinearUnitSizeGeoKey",t[t.ProjStdParallel1GeoKey=3078]="ProjStdParallel1GeoKey",t[t.ProjStdParallel2GeoKey=3079]="ProjStdParallel2GeoKey",t[t.ProjNatOriginLongGeoKey=3080]="ProjNatOriginLongGeoKey",t[t.ProjNatOriginLatGeoKey=3081]="ProjNatOriginLatGeoKey",t[t.ProjFalseEastingGeoKey=3082]="ProjFalseEastingGeoKey",t[t.ProjFalseNorthingGeoKey=3083]="ProjFalseNorthingGeoKey",t[t.ProjFalseOriginLongGeoKey=3084]="ProjFalseOriginLongGeoKey",t[t.ProjFalseOriginLatGeoKey=3085]="ProjFalseOriginLatGeoKey",t[t.ProjFalseOriginEastingGeoKey=3086]="ProjFalseOriginEastingGeoKey",t[t.ProjFalseOriginNorthingGeoKey=3087]="ProjFalseOriginNorthingGeoKey",t[t.ProjCenterLongGeoKey=3088]="ProjCenterLongGeoKey",t[t.ProjCenterLatGeoKey=3089]="ProjCenterLatGeoKey",t[t.ProjCenterEastingGeoKey=3090]="ProjCenterEastingGeoKey",t[t.ProjCenterNorthingGeoKey=3091]="ProjCenterNorthingGeoKey",t[t.ProjScaleAtNatOriginGeoKey=3092]="ProjScaleAtNatOriginGeoKey",t[t.ProjScaleAtCenterGeoKey=3093]="ProjScaleAtCenterGeoKey",t[t.ProjAzimuthAngleGeoKey=3094]="ProjAzimuthAngleGeoKey",t[t.ProjStraightVertPoleLongGeoKey=3095]="ProjStraightVertPoleLongGeoKey",t[t.ProjRectifiedGridAngleGeoKey=3096]="ProjRectifiedGridAngleGeoKey",t[t.VerticalCSTypeGeoKey=4096]="VerticalCSTypeGeoKey",t[t.VerticalCitationGeoKey=4097]="VerticalCitationGeoKey",t[t.VerticalDatumGeoKey=4098]="VerticalDatumGeoKey",t[t.VerticalUnitsGeoKey=4099]="VerticalUnitsGeoKey"})(U1||(U1={}));var Re;(function(t){t[t.BYTE=1]="BYTE",t[t.ASCII=2]="ASCII",t[t.SHORT=3]="SHORT",t[t.LONG=4]="LONG",t[t.RATIONAL=5]="RATIONAL",t[t.SBYTE=6]="SBYTE",t[t.UNDEFINED=7]="UNDEFINED",t[t.SSHORT=8]="SSHORT",t[t.SLONG=9]="SLONG",t[t.SRATIONAL=10]="SRATIONAL",t[t.FLOAT=11]="FLOAT",t[t.DOUBLE=12]="DOUBLE",t[t.LONG8=16]="LONG8",t[t.SLONG8=17]="SLONG8",t[t.IFD8=18]="IFD8"})(Re||(Re={}));var ve;(function(t){t[t.UInt8=1]="UInt8",t[t.UInt16=2]="UInt16",t[t.UInt32=4]="UInt32",t[t.UInt64=8]="UInt64",t[t.Double=8]="Double",t[t.Float=4]="Float"})(ve||(ve={}));var j4=2**32,GS=typeof setImmediate>"u"?setTimeout:setImmediate,Lt=()=>{throw new Error("Method not implemented.")},fi=class{constructor(){this.isLittleEndian=!0,this.delayMs=fi.DefaultDelayMs,this.maxChunkCount=10,this.chunks=fi.DefaultChunkCache(),this.blankFillCount=16,this.maxConcurrentRequests=50,this.toFetch=new Set,this.toFetchPromise=null,this.byteOffset=0,this.getFloat32=Lt,this.getFloat64=Lt,this.getInt8=Lt,this.getInt16=Lt,this.getInt32=Lt,this.setFloat32=Lt,this.setFloat64=Lt,this.setInt8=Lt,this.setInt16=Lt,this.setInt32=Lt,this.setUint8=Lt,this.setUint16=Lt,this.setUint32=Lt,this.setBigInt64=Lt,this.setBigUint64=Lt}static getByteRanges(e,r=32,i=16){if(e.size===0)return{chunks:[],blankFill:[]};let n=[...e.values()].sort((d,m)=>d-m),o=[],a=[];o.push(a);let h=[];for(let d=0;d<n.length;++d){let m=n[d],p=n[d-1];if(a.length>=r)a=[m],o.push(a);else if(d===0||m===p+1)a.push(m);else if(m<p+i){for(let M=p;M<m;M++)a.push(M+1),h.push(M+1);h.pop()}else a=[m],o.push(a)}return{chunks:o,blankFill:h}}async fetchData(){if(this.toFetch.size===0)return;let e=this.toFetch;this.toFetch=new Set,this.toFetchPromise=null;let r=fi.getByteRanges(e,this.maxChunkCount,this.blankFillCount),i=[];for(let n of r.chunks){let o=n[0],a=n[n.length-1],h=o*this.chunkSize,d=a*this.chunkSize+this.chunkSize-h,m=await this.fetchBytes(h,d);if(n.length===1){i[o]=m,this.chunks.set(o,new DataView(m));continue}let p=o*this.chunkSize;for(let M of n){let R=M*this.chunkSize-p,x=m.slice(R,R+this.chunkSize);i[M]=x,this.chunks.set(M,new DataView(x))}}}async loadBytes(e,r){if(e<0)throw new Error("Offset must be positive");let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let o=i;o<=n;o++)this.chunks.has(o)||this.toFetch.add(o);if(this.toFetch.size!==0){if(this.toFetchPromise==null&&(this.toFetchPromise=new Promise(o=>GS(o,this.delayMs)).then(()=>this.fetchData())),this.toFetch.size>this.maxConcurrentRequests)throw new Error("Too many outstanding requests");await this.toFetchPromise}}getChunkId(e){return Math.floor(e/this.chunkSize)}getUint(e,r){switch(r){case ve.UInt8:return this.getUint8(e);case ve.UInt16:return this.getUint16(e);case ve.UInt32:return this.getUint32(e);case ve.UInt64:return this.getUint64(e)}}bytes(e,r){let i=this.isOneChunk(e,r);if(i){let m=this.getView(i),p=e-i*this.chunkSize;return new Uint8Array(m.buffer.slice(p,p+r))}let n=new Uint8Array(r),o=e+r,a=Math.floor(e/this.chunkSize),h=Math.ceil((e+r)/this.chunkSize)-1,d=0;for(let m=a;m<=h;m++){let p=e+d,M=m*this.chunkSize,R=this.getView(m),x=Math.min(o,M+this.chunkSize),v=R.buffer.slice(p-M,x-M);n.set(new Uint8Array(v),d),d+=v.byteLength}return n}getView(e){let r=this.chunks.get(e);if(r==null)throw new Error(`Chunk:${e} is not ready`);return r}isOneChunk(e,r){let i=e+r-1,n=Math.floor(e/this.chunkSize);return Math.floor(i/this.chunkSize)-n<1?n:null}hasBytes(e,r=1){let i=Math.floor(e/this.chunkSize),n=Math.ceil((e+r)/this.chunkSize)-1;for(let o=i;o<=n;o++)if(!this.chunks.has(o))return!1;return!0}toRange(e,r){if(r==null)return`bytes=${e}`;if(e<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${e}-${e+r}`}parseContentRange(e){let[r,i]=e.split(" ");if(r!=="bytes")throw new Error("Failed to parse content-range: "+e);if(i==null)throw new Error("Failed to parse content-range: "+e);let[,n]=i.split("/"),o=Number(n);if(isNaN(o))throw new Error("Failed to parse content-range: "+e);return o}get buffer(){throw new Error("Method not implemented.")}get byteLength(){if(this._byteLength)return this._byteLength;throw Error(".size() has not been fetched.")}getUint8(e){let r=Math.floor(e/this.chunkSize),i=this.chunks.get(r);if(i==null)throw new Error(`Chunk:${r} is not ready`);return i.getUint8(e-r*this.chunkSize)}getUint16(e){let r=this.isOneChunk(e,ve.UInt16);if(r!=null)return this.getView(r).getUint16(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint8(e),n=this.getUint8(e+ve.UInt8);return this.isLittleEndian?i+(n<<8):(i<<8)+n}getUint32(e){let r=this.isOneChunk(e,ve.UInt32);if(r!=null)return this.getView(r).getUint32(e-r*this.chunkSize,this.isLittleEndian);let i=this.getUint16(e),n=this.getUint16(e+ve.UInt16);return this.isLittleEndian?i+n*65536:i*65536+n}getUint64(e){let r=this.isOneChunk(e,ve.UInt64);if(r!=null){let o=this.getView(r);return Number(o.getBigUint64(e-r*this.chunkSize,this.isLittleEndian))}let i=this.getUint32(e),n=this.getUint32(e+ve.UInt32);return this.isLittleEndian?i+n*j4:i*j4+n}getBigUint64(e){let r=this.isOneChunk(e,ve.UInt64);if(r!=null)return this.getView(r).getBigUint64(e-r*this.chunkSize,this.isLittleEndian);let i=BigInt(this.getUint32(e)),n=BigInt(this.getUint32(e+ve.UInt32));return this.isLittleEndian?i+(n<<BigInt(32)):(i<<BigInt(32))+n}getBigInt64(){throw new Error("Not implemented.")}};fi.DefaultChunkCache=()=>new Map;fi.DefaultDelayMs=1;var U4=de(Ud(),1);function q4(t){switch(t){case Re.BYTE:case Re.ASCII:case Re.SBYTE:case Re.UNDEFINED:return 1;case Re.SHORT:case Re.SSHORT:return 2;case Re.LONG:case Re.SLONG:case Re.FLOAT:return 4;case Re.RATIONAL:case Re.SRATIONAL:case Re.DOUBLE:case Re.LONG8:case Re.SLONG8:case Re.IFD8:return 8;default:throw new Error(`Invalid fieldType ${t}`)}}var Rs={char:(t,e)=>String.fromCharCode(t.getUint8(e)),uint8:(t,e)=>t.getUint8(e),uint16:(t,e)=>t.getUint16(e),uint32:(t,e)=>t.getUint32(e),uint64:(t,e)=>t.getUint64(e),double:(t,e)=>U4.read(t.bytes(e,ve.Double),0,t.isLittleEndian,52,8),rational:(t,e)=>[t.getUint32(e),t.getUint32(e+4)]};function Lh(t){switch(t){case Re.ASCII:return Rs.char;case Re.BYTE:case Re.UNDEFINED:case Re.SBYTE:return Rs.uint8;case Re.SHORT:case Re.SSHORT:return Rs.uint16;case Re.LONG:case Re.SLONG:return Rs.uint32;case Re.RATIONAL:case Re.SRATIONAL:return Rs.rational;case Re.DOUBLE:return Rs.double;case Re.LONG8:return Rs.uint64;default:throw new Error(`Unknown read type "${t}" "${Re[t]}"`)}}var Tn=class{constructor(e,r,i){this.tiff=r,this.byteOffset=i,this.id=e,this.name=oe[this.id],this.dataType=this.tiff.source.getUint16(i+2),this.dataCount=this.tiff.source.getUint(i+4,this.tiff.ifdConfig.pointer),this.dataTypeSize=q4(this.dataType),this.dataLength=this.dataTypeSize*this.dataCount}get hasBytes(){return this.tiff.source.hasBytes(this.valuePointer,this.dataLength)}get isReady(){return!0}get dataTypeName(){return Re[this.dataType]}get valuePointer(){let e=this.size-this.tiff.ifdConfig.pointer;return this.isValueInline?this.byteOffset+e:this.tiff.source.getUint(this.byteOffset+e,this.tiff.ifdConfig.pointer)}get size(){return this.tiff.ifdConfig.ifd}get isValueInline(){return this.dataLength<=this.tiff.ifdConfig.pointer}readValue(){let e=this.valuePointer,r=this.dataTypeSize,i=Lh(this.dataType),n=this.dataCount,o=n*r;if(n===1)return i(this.tiff.source,e);let a=[];for(let h=0;h<o;h+=r)a.push(i(this.tiff.source,e+h));return this.dataType===Re.ASCII?a.join("").trim():a}toJSON(){return{id:this.id,name:this.name,offset:this.byteOffset,isReady:this.isReady,type:this.dataTypeName,value:this.value}}};var Cs=class extends Tn{constructor(){super(...arguments),this.value=null}get isReady(){return this.value!=null}async fetch(){return this.tiff.source.hasBytes(this.valuePointer,this.dataLength)===!1&&await this.tiff.source.loadBytes(this.valuePointer,this.dataLength),this.value=this.readValue(),this.value}};var q1=class extends Tn{constructor(e,r,i){super(e,r,i),this.loadedValues=null}get value(){return this.loadedValues!=null?this.loadedValues:this.hasBytes?(this.readValue(),this.loadedValues):null}async load(){await this.tiff.source.loadBytes(this.valuePointer,this.dataLength),this.readValue()}readValue(){let e=super.readValue();return typeof e=="number"?this.loadedValues=[e]:this.loadedValues=e,this.loadedValues}async getValueAt(e){if(this.loadedValues)return this.loadedValues[e];let r=this.dataTypeSize,i=this.valuePointer+r*e,n=Lh(this.dataType);return this.tiff.source.hasBytes(i,r)||await this.tiff.source.loadBytes(i,r),n(this.tiff.source,i)}};var F1=class extends Tn{constructor(){super(...arguments),this._isRead=!1,this._value=null}get value(){return this._isRead===!1&&(this._value=this.readValue(),this._isRead=!0),this._value}};var Nh={create(t,e){let r=t.source.getUint16(e);if(r===oe.TileOffsets||r===oe.TileByteCounts||r===oe.StripByteCounts||r===oe.StripOffsets)return new q1(r,t,e);let i=new F1(r,t,e);return i.hasBytes?i:new Cs(r,t,e)},isStatic(t){return t instanceof F1},isLazy(t){return t instanceof Cs},isOffsetArray(t){return t instanceof q1}};var VS=32767,Bh=class{constructor(e,r,i){this.tagsGeoLoaded=!1,this.tagsGeo=new Map,this.tif=e,this.id=r,this.tags=i}async init(e=!1){let r=[this.fetch(oe.Compression),this.fetch(oe.ImageHeight),this.fetch(oe.ImageWidth),this.fetch(oe.ModelPixelScale),this.fetch(oe.ModelTiePoint),this.fetch(oe.ModelTransformation),this.fetch(oe.TileHeight),this.fetch(oe.TileWidth)];e&&(r.push(this.fetch(oe.GeoKeyDirectory)),r.push(this.fetch(oe.GeoAsciiParams)),r.push(this.fetch(oe.GeoDoubleParams))),await Promise.all(r),e&&await this.loadGeoTiffTags()}value(e){let r=this.tags.get(e);return r==null?null:r.value}async loadGeoTiffTags(){if(this.tagsGeoLoaded)return;let e=this.tags.get(oe.GeoKeyDirectory);if(e==null){this.tagsGeoLoaded=!0;return}if(!e.isReady&&e instanceof Cs&&await Promise.all([this.fetch(oe.GeoKeyDirectory),this.fetch(oe.GeoAsciiParams),this.fetch(oe.GeoDoubleParams)]),this.tagsGeoLoaded=!0,e.value==null)return;let r=e.value;if(!Array.isArray(r))throw new Error("Invalid geo tags found");for(let i=4;i<=r[3]*4;i+=4){let n=r[i],o=r[i+1],a=r[i+3];if(o===0){this.tagsGeo.set(n,a);continue}let h=this.tags.get(o);if(h==null||h.value==null)continue;let d=r[i+2];Array.isArray(h.value)?this.tagsGeo.set(n,h.value[a+d-1]):typeof h.value=="string"&&this.tagsGeo.set(n,h.value.substr(a,a+d-1).trim())}}valueGeo(e){if(this.tagsGeoLoaded===!1)throw new Error("loadGeoTiffTags() has not been called");return this.tagsGeo.get(e)}async fetch(e){let r=this.tags.get(e);return r==null?null:Nh.isLazy(r)?r.fetch():r.value}get origin(){let e=this.value(oe.ModelTiePoint);if(e!=null&&e.length===6)return[e[3],e[4],e[5]];let r=this.value(oe.ModelTransformation);if(r!=null)return[r[3],r[7],r[11]];if(this.value(oe.NewSubFileType)===1&&this.id!==0)return this.tif.images[0].origin;throw new Error("Image does not have a geo transformation.")}get isGeoLocated(){return this.value(oe.ModelPixelScale)!=null||this.value(oe.ModelTransformation)!=null?!0:this.value(oe.NewSubFileType)===1&&this.id!==0?this.tif.images[0].isGeoLocated:!1}get resolution(){let e=this.value(oe.ModelPixelScale);if(e!=null)return[e[0],-e[1],e[2]];let r=this.value(oe.ModelTransformation);if(r!=null)return[r[0],r[5],r[10]];if(this.value(oe.NewSubFileType)===1&&this.id!==0){let i=this.tif.images[0],[n,o,a]=i.resolution,h=i.size,d=this.size;return[n*h.width/d.width,o*h.height/d.height,a]}throw new Error("Image does not have a geo transformation.")}get bbox(){let e=this.size,r=this.origin,i=this.resolution;if(r==null||e==null||i==null)throw new Error("Unable to calculate bounding box");let n=r[0],o=r[1],a=n+i[0]*e.width,h=o+i[1]*e.height;return[Math.min(n,a),Math.min(o,h),Math.max(n,a),Math.max(o,h)]}get compression(){let e=this.value(oe.Compression);return e==null||typeof e!="number"?null:zd[e]}get epsg(){let e=this.valueGeo(U1.ProjectedCSTypeGeoKey);return e===VS?null:e}get size(){return{width:this.value(oe.ImageWidth),height:this.value(oe.ImageHeight)}}get tagList(){return[...this.tags.keys()].map(e=>oe[e])}isTiled(){return this.value(oe.TileWidth)!==null}get tileSize(){return{width:this.value(oe.TileWidth),height:this.value(oe.TileHeight)}}get tileCount(){let e=this.size,r=this.tileSize,i=Math.ceil(e.width/r.width),n=Math.ceil(e.height/r.height);return{x:i,y:n}}get tileOffset(){let e=this.tags.get(oe.TileOffsets);if(e==null)throw new Error("No tile offsets found");return e}get stripCount(){let e=this.tags.get(oe.StripByteCounts);return e==null?0:e.dataCount}async getTileOffset(e){let r=this.tileOffset;if(e<0||e>r.dataCount)throw new Error(`Tile offset: ${e} out of range: 0 -> ${r.dataCount}`);return r.getValueAt(e)}getTileBounds(e,r){let{size:i,tileSize:n}=this,o=r*n.height,a=e*n.width,h=a+n.width>=i.width?i.width-a:n.width,d=o+n.height>=i.height?i.height-o:n.height;return{x:a,y:o,width:h,height:d}}async getStrip(e){if(this.isTiled())throw new Error("Cannot read stripes, tiff is tiled");let r=this.tags.get(oe.StripByteCounts),i=this.tags.get(oe.StripOffsets);if(e>=r.dataCount)throw new Error("Cannot read strip, index out of bounds");let[n,o]=await Promise.all([i.getValueAt(e),r.getValueAt(e)]);return this.getBytes(n,o)}getJpegHeader(e){let r=this.value(oe.JPEGTables);if(r==null)throw new Error("Unable to find Jpeg header");let i=r.slice(0,r.length-2),n=new Uint8Array(e.byteLength+i.length-2);return n.set(i,0),n.set(e.slice(2),i.length),n}async getBytes(e,r){let i=this.compression;if(i==null)throw new Error("Unsupported compression: "+this.value(oe.Compression));if(r===0)return null;await this.tif.source.loadBytes(e,r);let n=this.tif.source.bytes(e,r);return this.compression===Rr.JPEG?{mimeType:i,bytes:this.getJpegHeader(n)}:{mimeType:i,bytes:n}}async getTile(e,r){let i=this.compression,n=this.size,o=this.tileSize;if(o==null)throw new Error("Tiff is not tiled");if(i==null)throw new Error("Unsupported compression: "+this.value(oe.Compression));let a=Math.ceil(n.height/o.height),h=Math.ceil(n.width/o.width);if(e>=h||r>=a)throw new Error(`Tile index is outside of range x:${e} >= ${h} or y:${r} >= ${a}`);let d=r*h+e,m=h*a;if(d>=m)throw new Error(`Tile index is outside of tile range: ${d} >= ${m}`);let{offset:p,imageSize:M}=await this.getTileSize(d);return this.getBytes(p,M)}async getTileSize(e){if(this.tif.options.tileLeaderByteSize){let o=await this.getTileOffset(e);if(o===0)return{offset:0,imageSize:0};let a=this.tif.options.tileLeaderByteSize;return await this.tif.source.loadBytes(o-a,a),{offset:o,imageSize:this.tif.source.getUint(o-a,a)}}let r=this.tags.get(oe.TileByteCounts);if(r==null)throw new Error("No tile byte counts found");let[i,n]=await Promise.all([this.getTileOffset(e),r.getValueAt(e)]);return{offset:i,imageSize:n}}};var $1;(function(t){t[t.Big=19789]="Big",t[t.Little=18761]="Little"})($1||($1={}));var Cr;(function(t){t[t.BigTiff=43]="BigTiff",t[t.Tiff=42]="Tiff"})(Cr||(Cr={}));var qd="__reverse";function F4(t,e){if(t[qd]==null){let r={};for(let i of Object.keys(t)){let n=t[i];r[n]=i}Object.defineProperty(t,qd,{enumerable:!1,value:r,writable:!1})}return t[qd][e]}var Pn;(function(t){t.GDAL_STRUCTURAL_METADATA_SIZE="GDAL_STRUCTURAL_METADATA_SIZE",t.LAYOUT="LAYOUT",t.BLOCK_ORDER="BLOCK_ORDER",t.BLOCK_LEADER="BLOCK_LEADER",t.BLOCK_TRAILER="BLOCK_TRAILER",t.KNOWN_INCOMPATIBLE_EDITION="KNOWN_INCOMPATIBLE_EDITION",t.MASK_INTERLEAVED_WITH_IMAGERY="MASK_INTERLEAVED_WITH_IMAGERY"})(Pn||(Pn={}));var Fd;(function(t){t.RowMajor="ROW_MAJOR"})(Fd||(Fd={}));var $d;(function(t){t.uint32="SIZE_AS_UINT4"})($d||($d={}));var KS={uint32:ve.UInt32},Dh=class{constructor(){this.options=new Map}get isCogOptimized(){return this.isBroken?!1:this.options.get(Pn.LAYOUT)==="IFDS_BEFORE_DATA"}get isBroken(){return this.options.get(Pn.KNOWN_INCOMPATIBLE_EDITION)==="YES"}set(e,r){this.options.set(e,r)}process(e,r,i){let n=[];for(let a=r;a<r+i;a++){let h=e.getUint8(a);h!==0&&n.push(String.fromCharCode(h))}let o=n.join("").trim().split(`
184
+ `).map(a=>a.split("="));for(let[a,h]of o)this.options.set(Pn[a],h)}_getReverse(e,r){let i=this.options.get(r);return i==null?null:F4(e,i)}get tileOrder(){return this._getReverse(Fd,Pn.BLOCK_ORDER)}get tileLeader(){return this._getReverse($d,Pn.BLOCK_LEADER)}get tileLeaderByteSize(){return this.tileLeader==null?null:KS[this.tileLeader]}get isMaskInterleaved(){return this.options.get(Pn.MASK_INTERLEAVED_WITH_IMAGERY)==="YES"}};var Wd={version:Cr.Tiff,pointer:ve.UInt32,offset:ve.UInt16,ifd:ve.UInt16+ve.UInt16+2*ve.UInt32},Hd={version:Cr.BigTiff,pointer:ve.UInt64,offset:ve.UInt64,ifd:ve.UInt16+ve.UInt16+2*ve.UInt64},QL={[Cr.BigTiff]:Hd,[Cr.Tiff]:Wd};var Gd=de(Ud(),1),zh=class{constructor(e,r=0){this.tiff=e,this.byteOffset=r,this.relativeOffset=0}get currentOffset(){return this.byteOffset+this.relativeOffset}seekTo(e){return this.byteOffset=e,this.relativeOffset=0,this}seek(e){let r=this.currentOffset;return this.relativeOffset+=e,r}bytes(e){return this.tiff.source.bytes(this.seek(e),e)}uint(e){return this.tiff.source.getUint(this.seek(e),e)}uint8(){return this.tiff.source.getUint8(this.seek(ve.UInt8))}uint16(){return this.tiff.source.getUint16(this.seek(ve.UInt16))}uint32(){return this.tiff.source.getUint32(this.seek(ve.UInt32))}uint64(){return this.tiff.source.getUint64(this.seek(ve.UInt64))}pointer(){let e=this.tiff.ifdConfig.pointer;return this.tiff.source.getUint(this.seek(e),e)}offset(){let e=this.tiff.ifdConfig.offset;return this.tiff.source.getUint(this.seek(e),e)}float(){return Gd.read(this.bytes(ve.Float),0,this.tiff.source.isLittleEndian,23,4)}double(){return Gd.read(this.bytes(ve.Double),0,this.tiff.source.isLittleEndian,52,8)}};function $4(t,e=4,r=!0){let i=t.toString(16).padStart(e,"0");return r?"0x"+i:i}var ma=class{constructor(e){this.version=Cr.Tiff,this.images=[],this.options=new Dh,this.ifdConfig=Wd,this.isInitialized=!1,this.source=e,this.cursor=new zh(this)}static create(e){return new ma(e).init()}init(e=!1){return this._initPromise?this._initPromise:(this._initPromise=this.doInit(e),this._initPromise)}async doInit(e=!1){return this.isInitialized?this:(await this.source.loadBytes(0,this.source.chunkSize),await this.fetchIfd(),await Promise.all(this.images.map(r=>r.init(e))),this.isInitialized=!0,this)}async fetchIfd(){let e=this.cursor.seekTo(0),r=e.uint16();if(this.source.isLittleEndian=r===$1.Little,!this.source.isLittleEndian)throw new Error("Only little endian is supported");this.version=e.uint16();let i;if(this.version===Cr.BigTiff){if(this.ifdConfig=Hd,e.uint16()!==8)throw new Error("Only 8byte pointers are supported");if(e.uint16()!==0)throw new Error("Invalid big tiff header");i=e.pointer()}else if(this.version===Cr.Tiff)i=e.pointer();else throw new Error(`Only tiff supported version:${this.version}`);let n=i-this.cursor.currentOffset;return n>0&&n<16*1024,this.processIfd(i)}getImage(e){return this.images[e]}getImageByResolution(e){let r=this.images[0],i=r.size,[n]=r.resolution,o=n*i.width;for(let a=this.images.length-1;a>0;a--){let h=this.images[a],d=h.size;if(o/d.width-e<=.01)return h}return r}async getTile(e,r,i){let n=this.getImage(i);if(n==null)throw new Error(`Missing z: ${i}`);if(!n.isTiled())throw new Error("Tif is not tiled");return n.getTile(e,r)}async processIfd(e){this.source.hasBytes(e,4096)||await this.source.loadBytes(e,4096);let{image:r,nextOffset:i}=await this.readIfd(e);this.images.push(r),i&&await this.processIfd(i)}async readIfd(e){this.source.hasBytes(e,1024)||await this.source.loadBytes(e,this.source.chunkSize);let i=this.cursor.seekTo(e).offset(),n=e+this.ifdConfig.offset,o=new Map,a=n;for(let m=0;m<i;m++){let p=Nh.create(this,a);if(a+=p.size,p.name==null)throw new Error("Unknown IFD Tag: "+$4(p.id));o.set(p.id,p)}let h=new Bh(this,this.images.length,o);return{nextOffset:this.source.getUint(a,this.ifdConfig.pointer),image:h}}async close(){var e,r;await((r=(e=this.source)===null||e===void 0?void 0:e.close)===null||r===void 0?void 0:r.call(e))}};var Vd=class{constructor(e){Kc(this,"value");Kc(this,"next");this.value=e}},di,As,Ts,W1=class{constructor(){yt(this,di,void 0);yt(this,As,void 0);yt(this,Ts,void 0);this.clear()}enqueue(e){let r=new Vd(e);Me(this,di)?(Me(this,As).next=r,Je(this,As,r)):(Je(this,di,r),Je(this,As,r)),Jc(this,Ts)._++}dequeue(){let e=Me(this,di);if(!!e)return Je(this,di,Me(this,di).next),Jc(this,Ts)._--,e.value}clear(){Je(this,di,void 0),Je(this,As,void 0),Je(this,Ts,0)}get size(){return Me(this,Ts)}*[Symbol.iterator](){let e=Me(this,di);for(;e;)yield e.value,e=e.next}};di=new WeakMap,As=new WeakMap,Ts=new WeakMap;function Kd(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new W1,r=0,i=()=>{r--,e.size>0&&e.dequeue()()},n=async(h,d,m)=>{r++;let p=(async()=>h(...m))();d(p);try{await p}catch{}i()},o=(h,d,m)=>{e.enqueue(n.bind(void 0,h,d,m)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},a=(h,...d)=>new Promise(m=>{o(h,m,d)});return Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),a}var W4=require("crypto");var H4=require("path"),$r={RenderId:1,key(t){return(0,W4.createHash)("sha256").update(JSON.stringify(t)).digest("base64")},generate(t,e){let r=t.map(n=>({...n,tiff:(0,H4.basename)(n.tiff.source.uri)})),i={...e,tileMatrix:e.tileMatrix.identifier};return $r.key({xyz:i,layers:r,RenderId:$r.RenderId})},isNotModified(t,e){let r=t.header(he.IfNoneMatch);return r!=null&&r.indexOf(e)>-1?(t.set("cache",{key:e,hit:!0,match:r}),!0):!1}};var Nt=class{static get(e){let r=Nt.cacheA.get(e);if(r)return r;let i=Nt.cacheB.get(e);return i==null?null:(Nt.cacheA.set(e,i),Nt.cacheB.delete(e),i)}static clear(){this.cacheA.clear(),this.cacheB.clear()}static set(e,r){Nt.cacheA.set(e,r),Nt.check()}static check(){Nt.MaxCacheSizeBytes<=0||Nt.currentSize<=Nt.MaxCacheSizeBytes||(Nt.cacheB=Nt.cacheA,Nt.cacheA=new Map)}static get currentSize(){let e=0;for(let r of Nt.cacheA.values())e+=r.source.chunkSize*r.source.chunks.size;return e}},In=Nt;In.cacheA=new Map,In.cacheB=new Map,In.MaxCacheSizeBytes=256*1024*1024;var JS=Kd(Qe.getNumber(Qe.TiffConcurrency,25)),ZS=new An(256),YS={in:"lanczos3",out:"lanczos3"},XS={r:0,g:0,b:0,alpha:0};function QS(t){return t.endsWith(".tif")||t.endsWith(".tiff")?t:`${t}.tiff`}var pa=class{constructor(e,r){this.type=ot.Raster;this.components=qt.parse(e),this.tileMatrix=r,this.tiler=new Jo(this.tileMatrix)}get id(){return Ar.id(this.fullName,this.tileMatrix)}get fullName(){return qt.componentsToName(this.components)}get title(){return this.tileSet?.title??this.components.name}get description(){return this.tileSet?.description??""}get extent(){return this.extentOverride??this.tileMatrix.extent}get format(){return this.tileSet.format??Ue.Webp}async init(e){this.tileSet=e,this.imagery=await je.getAllImagery(this.tileSet.layers,[this.tileMatrix.projection])}async initTiffs(e,r){let i=this.getTiffsForTile(e,r),n=!1,o=i.map(a=>JS(async()=>{try{await a.init()}catch(h){r.warn({error:h,tiff:a.source.uri},"TiffLoadFailed"),n=!0}}));return await Promise.all(o),n?i.filter(a=>a.images.length>0):i}async tile(e,r){if(r.ext===tr.MapboxVectorTiles)return Ie;let i=await this.initTiffs(r,e.log),n=await this.tiler.tile(i,r.x,r.y,r.z),o=$r.generate(n,r);if(e.set("layers",n.length),$r.isNotModified(e,o))return Cn;let a=await ZS.compose({layers:n,format:r.ext,background:this.tileSet.background??XS,resizeKernel:this.tileSet.resizeKernel??YS,metrics:e.timer});e.set("layersUsed",a.layers),e.set("bytes",a.buffer.byteLength);let h=new Y(200,"ok");return h.header(he.ETag,o),h.header(he.CacheControl,"public, max-age=604800"),h.buffer(a.buffer,"image/"+r.ext),h}getTiffsForTile(e,r){let i=[],n=this.tileMatrix.tileToSourceBounds(e),o=_t.convertZoomLevel(e.z,this.tileMatrix,ln.get(_e.Google));for(let a of this.tileSet.layers){if(a.maxZoom!=null&&o>a.maxZoom||a.minZoom!=null&&o<a.minZoom)continue;let h=a[this.tileMatrix.projection.code];if(h==null){r?.warn({layer:a.name,projection:this.tileMatrix.projection.code},"Failed to lookup imagery");continue}let d=this.imagery.get(h);if(d==null){r?.warn({layer:a.name,projection:this.tileMatrix.projection.code,imgId:h},"Failed to lookup imagery");continue}if(!!n.intersects(ye.fromJson(d.bounds)))for(let m of this.getCogsForTile(d,n))i.push(m)}return i}getCogsForTile(e,r){let i=[];for(let n of e.files){if(!r.intersects(ye.fromJson(n)))continue;let o=ar.join(e.uri,QS(n.name)),a=In.get(o);if(a==null){let h=ar.source(o);if(h==null)throw new Error(`Failed to create CogSource from ${o}`);Ui.trace(h),a=new ma(h),In.set(o,a)}i.push(a)}return i}findImagery(e){let r=this.imagery.get(e);if(r!=null)return r;for(let i of this.imagery.values())if(i.name===e)return i;return null}child(e){let r=this.findImagery(e);if(r==null)return null;let i=qt.componentsToName({...this.components,layer:r.name}),n=new pa(i,this.tileMatrix);n.tileSet={...this.tileSet},n.tileSet.background=void 0;let o=this.tileSet?.title??this.tileSet?.name;n.tileSet.title=r.title??`${o} ${P1(r.name)}`,n.extentOverride=ye.fromJson(r.bounds),r.category&&(n.tileSet.category=r.category);let a={name:r.name,minZoom:0,maxZoom:100};return a[this.tileMatrix.projection.code]=r.id,n.tileSet.layers=[a],n.imagery=new Map,n.imagery.set(r.id,r),n}};var jh=class{constructor(e,r){this.type=ot.Vector;this.components=qt.parse(e),this.tileMatrix=r}async init(e){this.tileSet=e}get format(){return tr.MapboxVectorTiles}get id(){return Ar.id(this.fullName,this.tileMatrix)}get fullName(){return qt.componentsToName(this.components)}async tile(e,r){if(r.ext!==tr.MapboxVectorTiles)return Ie;if(r.tileMatrix.identifier!==lt.identifier)return Ie;if(this.tileSet.layers.length>1)return new Y(500,"Too many layers in tileset");let[i]=this.tileSet.layers;if(i[3857]==null)return new Y(500,"Layer url not found from tileset Config");e.timer.start("cotar:load");let n=await da.get(i[3857]);if(n==null)return new Y(500,"Failed to load VectorTiles");e.timer.end("cotar:load");let o=(1<<r.z)-1-r.y;e.timer.start("cotar:tile");let a=await n.get(`tiles/${r.z}/${r.x}/${o}.pbf.gz`);if(a==null)return Ie;e.timer.end("cotar:tile");let h=new Y(200,"Ok");return h.buffer(Buffer.from(a),"application/x-protobuf"),h.header(he.ContentEncoding,"gzip"),h}};var Jd=class{constructor(){this.CacheTime=3e4;this.cache=new Map;this.tileSets=new Map}id(e,r){if(typeof e=="string"){let i=qt.parse(e);return`${qt.componentsToName(i)}_${r?.identifier}`}return`${e.fullName}_${e.tileMatrix.identifier}`}add(e,r=Date.now()+this.CacheTime){let i=this.id(e);if(this.cache.has(i))throw new Error("Trying to add duplicate tile set:"+i);this.cache.set(i,{time:r,value:Promise.resolve(e)})}get(e,r){let i=this.id(e,r),n=this.cache.get(i);if(n==null||Date.now()-n.time>0){let o=this.loadTileSet(e,r);n={time:Date.now(),value:o},this.cache.set(i,n)}return n.value}async loadTileSet(e,r){let i=qt.parse(e),n=this.id(e,r);if(i.layer!=null){let m=qt.componentsToName({...i,layer:void 0}),p=await this.get(m,r);return p==null||p.type===ot.Vector?null:p.child(i.layer)}let o=je.TileSet.id(e),a=await je.TileSet.get(o);if(a==null)return this.cache.delete(n),null;let h=this.tileSets.get(n);if(h!=null&&h?.tileSet.updatedAt===a.updatedAt)return h;if(je.isTileSetRaster(a)){let m=new pa(e,r);return await m.init(a),this.tileSets.set(n,m),m}let d=new jh(e,r);return await d.init(a),this.tileSets.set(n,d),d}},Ar=new Jd;var rM={},eM=[{type:ui.Tile,name:"health",tileMatrix:lt,ext:Ue.Png,x:252,y:156,z:8},{type:ui.Tile,name:"health",tileMatrix:an,ext:Ue.Png,x:30,y:33,z:6}],G4=256;async function tM(t){if(Buffer.isBuffer(t.buf))return t.buf;let e=`static/expected_tile_${t.tileMatrix.identifier}_${t.x}_${t.y}_z${t.z}.${t.ext}`;try{return await Zd.promises.readFile(e)}catch(r){if(r.code!=="ENOENT")throw r;let i=Uh.join(Uh.dirname(K4.default.fileURLToPath(rM.url)),"..","..",e);return await Zd.promises.readFile(i)}}async function Xd(t){for(let r of eM){let i=await Ar.get("health",r.tileMatrix);if(i==null)throw new Y(500,'TileSet: "health" not found');let n=await i.tile(t,r);if(n.status!==200)return new Y(500,n.statusDescription);if(!Buffer.isBuffer(n._body))throw new Y(500,"Not a Buffer response content.");let o=await(0,Yd.default)(n._body).raw().toBuffer(),a=await tM(r);r.buf=a;let h=await(0,Yd.default)(a).raw().toBuffer(),d=Buffer.alloc(h.length),m=(0,V4.default)(h,o,d,G4,G4);if(m)return t.log.error({missMatchedPixels:m,projection:r.tileMatrix.identifier,xyz:{x:r.x,y:r.y,z:r.z}},"Health:MissMatch"),new Y(500,"TileSet does not match.")}let e=new Y(200,"ok");return e.header(he.CacheControl,"no-store"),e}var J4=require("crypto"),Z4=require("util"),Y4=require("zlib");var iM=(0,Z4.promisify)(Y4.gzip);function nM(t){return t==null?!1:!!(t.endsWith(".geojson")||t.endsWith(".json"))}async function X4(t){let e=t.params.fileName;if(!nM(e))return new Y(404,"Not found");let r=await je.Imagery.get(je.Imagery.id(t.params.imageryId));if(r==null)return new Y(404,"Not found");let i=ar.join(r.uri,e);try{let n=await ar.read(i),o=(0,J4.createHash)("sha256").update(n).digest("base64");if($r.isNotModified(t,o))return Cn;let a=new Y(200,"ok");return a.header(he.ETag,o),a.header(he.ContentEncoding,"gzip"),a.buffer(await iM(n),"application/json"),t.set("bytes",n.byteLength),a}catch{return t.log.warn({targetPath:i},"ImageryMetadata:Failed"),new Y(404,"Not found")}}var Q4=de(require("path"),1);var Qd=new Map;Qd.set(".png","image/png");Qd.set(".json","application/json");async function eg(t){let e=Qe.get(Qe.AssetLocation);if(e==null)return Ie;let r=Q4.default.extname(t.params.spriteName),i=Qd.get(r);if(i==null)return Ie;let n=Xe.join("sprites",t.params.spriteName);if(e.endsWith(".tar.co"))return j1(e,n,i);try{let o=Xe.join(e,n);t.set("target",o);let a=await Xe.read(o),h=Y.ok().buffer(a,i);return Ld(a)&&h.header("content-encoding","gzip"),h}catch(o){if(o.code===404)return Ie;throw o}}var tg=de(Xn(),1),sM=60*60*1e3,oM=24*sM,aM=91*oM;function rg(t){if(t==null||!t.startsWith("c")&&!t.startsWith("d"))return!1;let e=t.slice(1).toUpperCase();try{let r=tg.decodeTime(e);if(t.startsWith("d"))return!0;if(Date.now()-r>aM)return!1}catch{return!1}return!0}var ng=require("crypto");var lM=1+1e-10,e2=new Y(404,"Not Found"),ig=10**8;function t2(t){return Math.round(t*ig)/ig}function uM(t){return[t2(t[0]),t2(t[1])]}function hM(t,e,r){if(Mn.delta(t[0],t[2])<=0)return Mn.bboxToMultiPolygon(t);let i=[];for(let o of e){let a=[ye.fromJson(o).pad(lM).toPolygon()];i=d6(i,a)}return ih(i,o=>uM(r.toWgs84(o)))}async function cM(t){try{return await ar.readJson(t)}catch(e){if(Ye.isCompositeError(e)&&e.code<500)return null;throw e}}function fM(t,e,r,i,n){let o=t.tileMatrix;return{stac_version:Xa.Version,license:Xa.License,id:e.id,providers:[{name:i.serviceProvider.name,url:i.serviceProvider.site,roles:["host"]}],title:e.title??P1(e.name),description:"No description",extent:n,links:[],summaries:{"linz:category":e.category,"linz:zoom":{min:_t.convertZoomLevel(r.minZoom?r.minZoom:0,lt,o,!0),max:_t.convertZoomLevel(r.maxZoom?r.maxZoom:32,lt,o,!0)},"linz:priority":[1e3+t.tileSet.layers.indexOf(r)]}}}async function dM(t){let e=Ur.get(t.tileMatrix),r=new Map,i=[],n=[];for(let a of t.tileSet.layers){let h=a[e.epsg.code];if(h==null)continue;let d=t.imagery.get(h);d!=null&&r.get(d.uri)==null&&r.set(d.uri,cM(ar.join(d.uri,"collection.json")))}let o=await je.Provider.get(je.Provider.id("linz"));if(o==null)return null;for(let a of t.tileSet.layers){let h=a[e.epsg.code];if(h==null)continue;let d=t.imagery.get(h);if(d==null)continue;let m=e.boundsToWgs84BoundingBox(d.bounds).map(t2),p=M6(d.name);if(p[0]===-1)throw new Error("Missing date in imagery name: "+d.name);let M=[p.map(x=>`${x}-01-01T00:00:00Z`)],R={spatial:{bbox:[m]},temporal:{interval:M}};n.push({type:"Feature",stac_version:Xa.Version,id:h+"_item",collection:h,assets:{},links:[],bbox:m,geometry:{type:"MultiPolygon",coordinates:hM(m,d.files,e)},properties:{title:d.title??P1(d.name),category:d.category,datetime:null,start_datetime:M[0][0],end_datetime:M[0][1]}}),i.push(fM(t,d,a,o,R))}return{id:t.id,type:"FeatureCollection",stac_version:Xa.Version,stac_extensions:["single-file-stac"],title:t.title,description:t.description,features:n,collections:i,links:[]}}async function sg(t){let e=it.action(t),r=Np(e.rest);if(r==null)return e2;kp(t,r),t.timer.start("tileset:load");let i=await Ar.get(r.name,r.tileMatrix);if(t.timer.end("tileset:load"),i==null||i.type===ot.Vector)return e2;let n=(0,ng.createHash)("sha256").update(JSON.stringify(i.tileSet)).digest("base64"),o=t.header(he.IfNoneMatch);if(o!=null&&o.indexOf(n)>-1)return t.set("cache",{key:n,hit:!0,match:o}),new Y(304,"Not modified");t.timer.start("stac:load");let a=await dM(i);if(t.timer.end("stac:load"),a==null)return e2;let h=new Y(200,"ok");return h.header(he.ETag,n),h.header(he.CacheControl,"public, max-age=86400, stale-while-revalidate=604800"),h.json(a),h}async function og(t){let{version:e,rest:r,name:i}=it.action(t);if(r.length!==3)return Ie;let n=M1(r[1]);if(n==null)return Ie;t.timer.start("tileset:load");let o=await Ar.get(r[0],n);if(t.timer.end("tileset:load"),o==null)return Ie;let a=it.apiKey(t),m={tiles:[[Qe.get(Qe.PublicUrlBase)??"",e,i,o.fullName,n.identifier,"{z}","{x}","{y}"].join("/")+`.${o.format}?api=${a}`],tilejson:"3.0.0"},p=_t.convertZoomLevel(o.tileSet.maxZoom??30,lt,n,!0),M=_t.convertZoomLevel(o.tileSet.minZoom??0,lt,n,!0);o.tileSet.maxZoom&&(m.maxzoom=p),o.tileSet.minZoom&&(m.minzoom=M);let R=JSON.stringify(m),x=Buffer.from(R),v=new Y(200,"ok");return v.header(he.CacheControl,"no-store"),v.buffer(x,"application/json"),t.set("bytes",x.byteLength),v}var ag=require("crypto"),lg=require("url");function qh(t,e){if(t==null)return"";let r=Qe.get(Qe.PublicUrlBase)??"";if(!t.startsWith("/"))return t;let i=new lg.URL(Xe.join(r,t));return e&&i.searchParams.set("api",e),i.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")}function mM(t,e){let r=JSON.parse(JSON.stringify(t.sources));for(let[i,n]of Object.entries(r)){if(n.type==="vector")n.url=qh(n.url,e);else if(n.type==="raster"&&Array.isArray(n.tiles))for(let o=0;o<n.tiles.length;o++)n.tiles[o]=qh(n.tiles[o],e);r[i]=n}return{version:8,id:t.id,name:t.name,sources:r,layers:t.layers,metadata:t.metadata??{},glyphs:qh(t.glyphs),sprite:qh(t.sprite)}}async function ug(t,e){let r=it.apiKey(t);if(r==null)return new Y(400,"Invalid API Key.");let i=e.split(".json")[0],n=je.Style.id(i),o=await je.Style.get(n);if(o==null)return Ie;let a=mM(o.style,r),h=Buffer.from(JSON.stringify(a)),d=(0,ag.createHash)("sha256").update(h).digest("base64");if($r.isNotModified(t,d))return Cn;let m=new Y(200,"ok");return m.header(he.ETag,d),m.header(he.CacheControl,"no-store"),m.buffer(h,"application/json"),t.set("bytes",h.byteLength),m}var mg=require("crypto");var pM={xmlns:"http://www.opengis.net/wmts/1.0","xmlns:ows":"http://www.opengis.net/ows/1.1","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:gml":"http://www.opengis.net/gml","xsi:schemaLocation":"http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd",version:"1.0.0"};function hg(t,e){return Ur.get(t).boundsToWgs84BoundingBox(e)}var cg=6,fg=4;function dg(t,e){return Number(t.toFixed(e)).toString()}function Fh(t,e,r){return`${dg(t,r)} ${dg(e,r)}`}var $h=class{constructor(e){this.tileMatrixSets=new Map;this.isIndividualLayers=!1;this.httpBase=e.httpBase,this.provider=e.provider,this.tileSet=e.tileSet,this.isIndividualLayers=e.isIndividualLayers;for(let r of e.tileMatrix)this.tileMatrixSets.set(r.identifier,r);this.apiKey=e.apiKey,this.formats=e.formats??Op,this.imagery=e.imagery}async loadImagery(){let e=new Set;for(let r of this.tileMatrixSets.values())for(let i of this.tileSet.layers){let n=i[r.projection.code];n!=null&&e.add(n)}this.imagery=await je.Imagery.getAll(e)}buildWgs84BoundingBox(e,r){let i;if(r.length>0){let n=r[0];for(let o=1;o<r.length;o++)n=n.union(r[o]);i=hg(e,n.toJson())}else i=hg(e,e.extent);return i[2]<i[0]&&(i[0]=-180,i[2]=180),Q("ows:WGS84BoundingBox",{crs:"urn:ogc:def:crs:OGC:2:84"},[Q("ows:LowerCorner",Fh(i[0],i[1],cg)),Q("ows:UpperCorner",Fh(i[2],i[3],cg))])}buildBoundingBoxFromImagery(e,r){let i;for(let o of r){let a=o[e.projection.code];if(a==null)continue;let h=this.imagery.get(a);h!=null&&(i==null?i=ye.fromJson(h.bounds):i=i.union(ye.fromJson(h.bounds)))}if(i==null)return null;let n=i.toBbox();return Q("ows:BoundingBox",{crs:e.projection.toUrn()},[Q("ows:LowerCorner",Fh(n[e.indexX],n[e.indexY],fg)),Q("ows:UpperCorner",Fh(n[e.indexX+2],n[e.indexY+2],fg))])}buildProvider(){if(this.provider==null)return[];let{serviceIdentification:e,serviceProvider:r}=this.provider,{contact:i}=r;return[Q("ows:ServiceIdentification",[Q("ows:Title",e.title),Q("ows:Abstract",e.description),Q("ows:ServiceType","OGC WMTS"),Q("ows:ServiceTypeVersion","1.0.0"),Q("ows:Fees",e.fees),Q("ows:AccessConstraints",e.accessConstraints)]),Q("ows:ServiceProvider",[Q("ows:ProviderName",r.name),Q("ows:ProviderSite",{"xlink:href":r.site}),Q("ows:ServiceContact",[Q("ows:IndividualName",i.individualName),Q("ows:PositionName",i.position),Q("ows:ContactInfo",[Q("ows:Phone",[Q("ows:Voice",i.phone)]),Q("ows:Address",[Q("ows:DeliveryPoint",i.address.deliveryPoint),Q("ows:City",i.address.city),Q("ows:PostalCode",i.address.postalCode),Q("ows:Country",i.address.country),Q("ows:ElectronicMailAddress",i.address.email)])])])])]}buildTileUrl(e,r){let i=this.apiKey?`?api=${this.apiKey}`:"";return[this.httpBase,"v1","tiles",e,"{TileMatrixSet}","{TileMatrix}","{TileCol}",`{TileRow}.${r}${i}`].join("/")}buildResourceUrl(e,r){return Q("ResourceURL",{format:"image/"+r,resourceType:"tile",template:this.buildTileUrl(e,r)})}buildLayerFromImagery(e){let r=new Set,i=[];for(let d of this.tileMatrixSets.values()){let m=e[d.projection.code];m==null||this.imagery.get(m)==null||(i.push(Q("TileMatrixSetLink",[Q("TileMatrixSet",d.identifier)])),r.add(d))}let n=bo(e.name),o=[...r.values()],a=o[0];if(a==null)return null;let h=this.imagery.get(e[a.projection.code]??"");return h==null?null:Q("Layer",[Q("ows:Title",e.title??n),Q("ows:Abstract",""),Q("ows:Identifier",n),this.buildKeywords(h),...o.map(d=>this.buildBoundingBoxFromImagery(d,[e])),this.buildWgs84BoundingBox(a,[ye.fromJson(h.bounds)]),this.buildStyle(),...this.formats.map(d=>Q("Format","image/"+d)),...i,...this.formats.map(d=>this.buildResourceUrl(n,d))])}buildLayer(e){let r=new Set,i=[];for(let m of this.tileMatrixSets.values())e.layers.find(p=>p[m.projection.code]!=null)&&(i.push(Q("TileMatrixSetLink",[Q("TileMatrixSet",m.identifier)])),r.add(m));let n=bo(e.name),o=[...r.values()],a=o[0];if(a==null)throw new Error("No matrix sets found for layer "+e.name);let h=o.find(m=>m.identifier===lt.identifier)??a,d=[];for(let m of e.layers){let p=this.imagery.get(m[h.projection.code]??"");p!=null&&d.push(ye.fromJson(p.bounds))}return Q("Layer",[Q("ows:Title",e.title??n),Q("ows:Abstract",e.description??""),Q("ows:Identifier",n),this.buildKeywords(e),...[...r.values()].map(m=>this.buildBoundingBoxFromImagery(m,e.layers)),this.buildWgs84BoundingBox(h,d),this.buildStyle(),...this.formats.map(m=>Q("Format","image/"+m)),...i,...this.formats.map(m=>this.buildResourceUrl(n,m))])}buildKeywords(e){return e.category==null?Q("ows:Keywords"):Q("ows:Keywords",[Q("ows:Keyword",e.category)])}buildStyle(){return Q("Style",{isDefault:"true"},[Q("ows:Title","Default Style"),Q("ows:Identifier","default")])}buildTileMatrixSet(e){return Q("TileMatrixSet",[Q("ows:Title",e.def.title),e.def.abstract?Q("ows:Abstract",e.def.abstract):null,Q("ows:Identifier",e.identifier),Q("ows:SupportedCRS",e.projection.toUrn()),e.def.wellKnownScaleSet?Q("WellKnownScaleSet",e.def.wellKnownScaleSet):null,...e.def.tileMatrix.map(r=>Q("TileMatrix",[Q("ows:Identifier",r.identifier),Q("ScaleDenominator",r.scaleDenominator),Q("TopLeftCorner",r.topLeftCorner.join(" ")),Q("TileWidth",r.tileWidth),Q("TileHeight",r.tileHeight),Q("MatrixWidth",r.matrixWidth),Q("MatrixHeight",r.matrixHeight)]))])}toVNode(){let e=[];if(e.push(this.buildLayer(this.tileSet)),this.isIndividualLayers){let r=new Map;for(let n of this.tileSet.layers)r.set(bo(n.name),n);let i=Array.from(r.values()).sort((n,o)=>(n.title??n.name).localeCompare(o.title??o.name));for(let n of i)e.push(this.buildLayerFromImagery(n))}for(let r of this.tileMatrixSets.values())e.push(this.buildTileMatrixSet(r));return Q("Capabilities",pM,[...this.buildProvider(),Q("Contents",e)])}toXml(){return`<?xml version="1.0" encoding="utf-8"?>
185
+ `+this.toVNode().toString()}};function gM(t){let e=[...t.query.getAll("format"),...t.query.getAll("tileFormat")];if(e.length===0)return;let r=new Set;for(let i of e){let n=Yu(i);n!=null&&r.add(n)}if(r.size!==0)return[...r.values()]}async function pg(t){let e=it.action(t),r=Bp(e.rest);if(r==null)return Ie;let i=Qe.get(Qe.PublicUrlBase)??"";t.timer.start("tileset:load");let n=await je.TileSet.get(je.TileSet.id(r.name??"aerial"));if(t.timer.end("tileset:load"),n==null||n.type!==ot.Raster)return Ie;let o=await je.Provider.get(je.Provider.id("linz")),a=r.tileMatrix==null?[lt,an]:[r.tileMatrix];t.timer.start("imagery:load");let h=await je.getAllImagery(n.layers,a.map(x=>x.projection));t.timer.end("imagery:load");let d=it.apiKey(t),m=new $h({httpBase:i,provider:o??void 0,tileSet:n,tileMatrix:a,isIndividualLayers:r.tileMatrix==null,imagery:h,apiKey:d,formats:gM(t)}).toXml();if(m==null)return Ie;let p=Buffer.from(m),M=(0,mg.createHash)("sha256").update(p).digest("base64");if($r.isNotModified(t,M))return Cn;let R=new Y(200,"ok");return R.header(he.ETag,M),R.header(he.CacheControl,"max-age=0"),R.buffer(p,"text/xml"),t.set("bytes",p.byteLength),R}var gg={validate(t,e){let{tileMatrix:r,x:i,y:n,z:o,ext:a}=e;if(t.set("xyz",{x:i,y:n,z:o}),t.set("projection",r.projection.code),t.set("tileMatrix",r.identifier),t.set("extension",a),t.set("tileSet",e.name),o>r.maxZoom||o<0)throw new Y(404,`Zoom not found: ${o}`);let h=r.zooms[o];if(i<0||i>h.matrixWidth)throw new Y(404,`X not found: ${i}`);if(n<0||n>h.matrixHeight)throw new Y(404,`Y not found: ${n}`);let d=Ur.tileCenterToLatLon(r,e);t.set("location",d)}};async function yg(t){let e=it.action(t),r=Lp(e.rest);if(r==null)return Ie;gg.validate(t,r),t.timer.start("tileset:load");let i=await Ar.get(r.name,r.tileMatrix);return t.timer.end("tileset:load"),i==null?Ie:await i.tile(t,r)}async function bg(t){let{rest:e}=it.action(t);if(e.length<1)return Ie;let r=it.apiKey(t);if(!rg(r))return new Y(400,"Invalid API Key");let i=e[e.length-1].toLowerCase();return i==="attribution.json"?sg(t):i==="wmtscapabilities.xml"?pg(t):i==="tile.json"?og(t):i.endsWith("json")&&e[e.length-2]==="style"?ug(t,i):yg(t)}var wg=new it;wg.get("tiles",bg);async function _g(t){let e=it.apiKey(t);if(e!=null){let r=(0,vg.createHash)("sha256").update(e).digest("base64");t.set("api",r)}return await wg.handle(t)}var Zt=ur.http(Zu.get());Zt.router.hook("request",t=>{t.set("name","LambdaTiler"),Ui.reset()});Zt.router.hook("response",t=>{Ui.requests.length>0&&(t.set("requests",Ui.requests.slice(0,100)),t.set("requestCount",Ui.requests.length))});Zt.router.get("/ping",Md);Zt.router.get("/health",Xd);Zt.router.get("/version",Ed);Zt.router.get("/v1/ping",Md);Zt.router.get("/v1/health",Xd);Zt.router.get("/v1/version",Ed);Zt.router.get("/v1/imagery/:imageryId/:fileName",X4);Zt.router.get("/v1/sprites/:spriteName",eg);Zt.router.get("/v1/fonts.json",I4);Zt.router.get("/v1/fonts/:fontStack/:range.pbf",P4);Zt.router.get("*",_g);0&&(module.exports={handleRequest,handler});
186
186
  /*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
187
187
  /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
188
188
  /*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */