@loaders.gl/tiles-3d 5.0.0-beta.4 → 5.0.0-beta.6

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.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
  3. package/dist/3d-tiles/dist.dev.js +941 -621
  4. package/dist/3d-tiles/dist.min.js +37 -37
  5. package/dist/3d-tiles/index.cjs +876 -947
  6. package/dist/3d-tiles/index.cjs.map +3 -3
  7. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +5 -1
  8. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  9. package/dist/3d-tiles/lib/utils/version.js +1 -1
  10. package/dist/3d-tiles-archive-writer.cjs +1 -1
  11. package/dist/cesium-ion-loader-with-parser.cjs +821 -942
  12. package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
  13. package/dist/copc/copc-source-loader.js +2 -2
  14. package/dist/copc/copc-source-loader.js.map +1 -1
  15. package/dist/copc/copc-writer.js +1 -1
  16. package/dist/copc/index.cjs +121 -181
  17. package/dist/copc/index.cjs.map +3 -3
  18. package/dist/dist.dev.js +323 -40
  19. package/dist/dist.min.js +10 -10
  20. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  21. package/dist/i3s/dist.dev.js +3173 -712
  22. package/dist/i3s/dist.min.js +47 -47
  23. package/dist/i3s/i3s-attribute-loader.js +1 -1
  24. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  25. package/dist/i3s/i3s-content-loader.js +1 -1
  26. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  27. package/dist/i3s/i3s-loader.js +1 -1
  28. package/dist/i3s/i3s-node-page-loader.js +1 -1
  29. package/dist/i3s/i3s-slpk-loader.js +1 -1
  30. package/dist/i3s/i3s-slpk-writer.js +1 -1
  31. package/dist/i3s/index.cjs +2097 -544
  32. package/dist/i3s/index.cjs.map +3 -3
  33. package/dist/i3s-content-worker-node.js +11 -11
  34. package/dist/i3s-content-worker-node.js.map +4 -4
  35. package/dist/i3s-content-worker.js +768 -346
  36. package/dist/i3s-lepcc-worker-node.js +245 -12
  37. package/dist/i3s-lepcc-worker-node.js.map +4 -4
  38. package/dist/i3s-lepcc-worker.js +240 -12
  39. package/dist/i3s-mesh-writer.cjs +1749 -290
  40. package/dist/i3s-mesh-writer.cjs.map +3 -3
  41. package/dist/i3s-slpk-writer.cjs +1 -1
  42. package/dist/index.cjs +98 -4
  43. package/dist/index.cjs.map +2 -2
  44. package/dist/point-cloud-tile-source-loader-types.js +1 -1
  45. package/dist/point-cloud-tile-source-loader.cjs +46 -2
  46. package/dist/point-cloud-tile-source-loader.cjs.map +2 -2
  47. package/dist/point-cloud-tile-source.cjs +45 -1
  48. package/dist/point-cloud-tile-source.cjs.map +1 -1
  49. package/dist/potree/dist.dev.js +325 -91
  50. package/dist/potree/dist.min.js +30 -30
  51. package/dist/potree/index.cjs +115 -176
  52. package/dist/potree/index.cjs.map +3 -3
  53. package/dist/potree/potree-bin-loader.js +1 -1
  54. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  55. package/dist/potree/potree-loader-types.js +1 -1
  56. package/dist/potree/potree-source-loader.js +1 -1
  57. package/dist/potree/potree-writer.js +1 -1
  58. package/dist/potree/potree2-source.d.ts.map +1 -1
  59. package/dist/potree/potree2-source.js +3 -13
  60. package/dist/potree/potree2-source.js.map +1 -1
  61. package/dist/potree-loader.cjs +1 -1
  62. package/package.json +13 -13
  63. package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +4 -1
  64. package/src/copc/copc-source-loader.ts +1 -1
  65. package/src/potree/potree2-source.ts +3 -14
@@ -1,26 +1,26 @@
1
- "use strict";var MD=Object.create;var B1=Object.defineProperty;var vD=Object.getOwnPropertyDescriptor;var ED=Object.getOwnPropertyNames;var TD=Object.getPrototypeOf,AD=Object.prototype.hasOwnProperty;var p=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var ae=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Jt=(e,t)=>{for(var r in t)B1(e,r,{get:t[r],enumerable:!0})},ID=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ED(t))!AD.call(e,i)&&i!==r&&B1(e,i,{get:()=>t[i],enumerable:!(n=vD(t,i))||n.enumerable});return e};var me=(e,t,r)=>(r=e!=null?MD(TD(e)):{},ID(t||!e||!e.__esModule?B1(r,"default",{value:e,enumerable:!0}):r,e));var K_,eN,tN,rN,nN,iN,oN,sN,aN,cN,lN,uN,fN,hN,dN,f,Ji=p(()=>{K_=e=>typeof e<"u"&&e!==null,eN=e=>typeof e=="object",tN=e=>Object.prototype.toString.call(e)==="[object Object]",rN=e=>typeof e=="function",nN=e=>typeof e=="boolean",iN=e=>e instanceof Buffer,oN=e=>{if(K_(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},sN=e=>e instanceof ArrayBuffer,aN=e=>typeof e=="string"&&e.length>0,cN=e=>typeof e=="number"&&Number.isFinite(e),lN=e=>Number.isInteger(e),uN=(e,t,r)=>e>=t&&e<=r,fN=(e,t)=>t.includes(e),hN=(e,t,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return new Error(`Expected ${t} for ${e} but received ${n} of type ${typeof r}`)},dN=(e,t)=>(t.message=e.message,t),f={defined:K_,object:eN,plainObject:tN,fn:rN,bool:nN,buffer:iN,typedArray:oN,arrayBuffer:sN,string:aN,number:cN,integer:lN,inRange:uN,inArray:fN,invalidParameterError:hN,nativeError:dN}});var Z_=ae((mY,Y_)=>{"use strict";var X_=()=>process.platform==="linux",hd=null,mN=()=>{if(!hd)if(X_()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,hd=process.report.getReport(),process.report.excludeNetwork=e}else hd={};return hd};Y_.exports={isLinux:X_,getReport:mN}});var Q_=ae((pY,J_)=>{"use strict";var yl=require("fs"),pN="/usr/bin/ldd",gN="/proc/self/exe",dd=2048,yN=e=>{let t=yl.openSync(e,"r"),r=Buffer.alloc(dd),n=yl.readSync(t,r,0,dd,0);return yl.close(t,()=>{}),r.subarray(0,n)},bN=e=>new Promise((t,r)=>{yl.open(e,"r",(n,i)=>{if(n)r(n);else{let o=Buffer.alloc(dd);yl.read(i,o,0,dd,0,(s,a)=>{t(o.subarray(0,a)),yl.close(i,()=>{})})}})});J_.exports={LDD_PATH:pN,SELF_PATH:gN,readFileSync:yN,readFile:bN}});var tS=ae((gY,eS)=>{"use strict";var wN=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let i=0;i<n;i++){let o=t+i*r;if(e.readUInt32LE(o)===3){let a=e.readUInt32LE(o+8),c=e.readUInt32LE(o+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};eS.exports={interpreterPath:wN}});var pd=ae((yY,wS)=>{"use strict";var nS=require("child_process"),{isLinux:bl,getReport:iS}=Z_(),{LDD_PATH:md,SELF_PATH:oS,readFile:U1,readFileSync:j1}=Q_(),{interpreterPath:sS}=tS(),Qi,eo,to,aS="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",vs="",cS=()=>vs||new Promise(e=>{nS.exec(aS,(t,r)=>{vs=t?" ":r,e(vs)})}),lS=()=>{if(!vs)try{vs=nS.execSync(aS,{encoding:"utf8"})}catch{vs=" "}return vs},Bo="glibc",uS=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Za="musl",xN=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),fS=()=>{let e=iS();return e.header&&e.header.glibcVersionRuntime?Bo:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(xN)?Za:null},hS=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(Bo)?Bo:r&&r.includes(Za)?Za:null},dS=e=>{if(e){if(e.includes("/ld-musl-"))return Za;if(e.includes("/ld-linux-"))return Bo}return null},mS=e=>(e=e.toString(),e.includes("musl")?Za:e.includes("GNU C Library")?Bo:null),_N=async()=>{if(eo!==void 0)return eo;eo=null;try{let e=await U1(md);eo=mS(e)}catch{}return eo},SN=()=>{if(eo!==void 0)return eo;eo=null;try{let e=j1(md);eo=mS(e)}catch{}return eo},MN=async()=>{if(Qi!==void 0)return Qi;Qi=null;try{let e=await U1(oS),t=sS(e);Qi=dS(t)}catch{}return Qi},vN=()=>{if(Qi!==void 0)return Qi;Qi=null;try{let e=j1(oS),t=sS(e);Qi=dS(t)}catch{}return Qi},pS=async()=>{let e=null;if(bl()&&(e=await MN(),!e&&(e=await _N(),e||(e=fS()),!e))){let t=await cS();e=hS(t)}return e},gS=()=>{let e=null;if(bl()&&(e=vN(),!e&&(e=SN(),e||(e=fS()),!e))){let t=lS();e=hS(t)}return e},EN=async()=>bl()&&await pS()!==Bo,TN=()=>bl()&&gS()!==Bo,AN=async()=>{if(to!==void 0)return to;to=null;try{let t=(await U1(md)).match(uS);t&&(to=t[1])}catch{}return to},IN=()=>{if(to!==void 0)return to;to=null;try{let t=j1(md).match(uS);t&&(to=t[1])}catch{}return to},yS=()=>{let e=iS();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},rS=e=>e.trim().split(/\s+/)[1],bS=e=>{let[t,r,n]=e.split(/[\r\n]+/);return t&&t.includes(Bo)?rS(t):r&&n&&r.includes(Za)?rS(n):null},PN=async()=>{let e=null;if(bl()&&(e=await AN(),e||(e=yS()),!e)){let t=await cS();e=bS(t)}return e},RN=()=>{let e=null;if(bl()&&(e=IN(),e||(e=yS()),!e)){let t=lS();e=bS(t)}return e};wS.exports={GLIBC:Bo,MUSL:Za,family:pS,familySync:gS,isNonGlibcLinux:EN,isNonGlibcLinuxSync:TN,version:PN,versionSync:RN}});var wl=ae((bY,xS)=>{"use strict";var LN="2.0.0",ON=Number.MAX_SAFE_INTEGER||9007199254740991,BN=16,CN=250,DN=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:BN,MAX_SAFE_BUILD_LENGTH:CN,MAX_SAFE_INTEGER:ON,RELEASE_TYPES:DN,SEMVER_SPEC_VERSION:LN,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var uf=ae((wY,_S)=>{"use strict";var NN=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};_S.exports=NN});var xl=ae((ro,SS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:z1,MAX_SAFE_BUILD_LENGTH:FN,MAX_LENGTH:GN}=wl(),kN=uf();ro=SS.exports={};var UN=ro.re=[],jN=ro.safeRe=[],Y=ro.src=[],zN=ro.safeSrc=[],Z=ro.t={},qN=0,q1="[a-zA-Z0-9-]",VN=[["\\s",1],["\\d",GN],[q1,FN]],WN=e=>{for(let[t,r]of VN)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},Pe=(e,t,r)=>{let n=WN(t),i=qN++;kN(e,i,t),Z[e]=i,Y[i]=t,zN[i]=n,UN[i]=new RegExp(t,r?"g":void 0),jN[i]=new RegExp(n,r?"g":void 0)};Pe("NUMERICIDENTIFIER","0|[1-9]\\d*");Pe("NUMERICIDENTIFIERLOOSE","\\d+");Pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${q1}*`);Pe("MAINVERSION",`(${Y[Z.NUMERICIDENTIFIER]})\\.(${Y[Z.NUMERICIDENTIFIER]})\\.(${Y[Z.NUMERICIDENTIFIER]})`);Pe("MAINVERSIONLOOSE",`(${Y[Z.NUMERICIDENTIFIERLOOSE]})\\.(${Y[Z.NUMERICIDENTIFIERLOOSE]})\\.(${Y[Z.NUMERICIDENTIFIERLOOSE]})`);Pe("PRERELEASEIDENTIFIER",`(?:${Y[Z.NONNUMERICIDENTIFIER]}|${Y[Z.NUMERICIDENTIFIER]})`);Pe("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[Z.NONNUMERICIDENTIFIER]}|${Y[Z.NUMERICIDENTIFIERLOOSE]})`);Pe("PRERELEASE",`(?:-(${Y[Z.PRERELEASEIDENTIFIER]}(?:\\.${Y[Z.PRERELEASEIDENTIFIER]})*))`);Pe("PRERELEASELOOSE",`(?:-?(${Y[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);Pe("BUILDIDENTIFIER",`${q1}+`);Pe("BUILD",`(?:\\+(${Y[Z.BUILDIDENTIFIER]}(?:\\.${Y[Z.BUILDIDENTIFIER]})*))`);Pe("FULLPLAIN",`v?${Y[Z.MAINVERSION]}${Y[Z.PRERELEASE]}?${Y[Z.BUILD]}?`);Pe("FULL",`^${Y[Z.FULLPLAIN]}$`);Pe("LOOSEPLAIN",`[v=\\s]*${Y[Z.MAINVERSIONLOOSE]}${Y[Z.PRERELEASELOOSE]}?${Y[Z.BUILD]}?`);Pe("LOOSE",`^${Y[Z.LOOSEPLAIN]}$`);Pe("GTLT","((?:<|>)?=?)");Pe("XRANGEIDENTIFIERLOOSE",`${Y[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Pe("XRANGEIDENTIFIER",`${Y[Z.NUMERICIDENTIFIER]}|x|X|\\*`);Pe("XRANGEPLAIN",`[v=\\s]*(${Y[Z.XRANGEIDENTIFIER]})(?:\\.(${Y[Z.XRANGEIDENTIFIER]})(?:\\.(${Y[Z.XRANGEIDENTIFIER]})(?:${Y[Z.PRERELEASE]})?${Y[Z.BUILD]}?)?)?`);Pe("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:${Y[Z.PRERELEASELOOSE]})?${Y[Z.BUILD]}?)?)?`);Pe("XRANGE",`^${Y[Z.GTLT]}\\s*${Y[Z.XRANGEPLAIN]}$`);Pe("XRANGELOOSE",`^${Y[Z.GTLT]}\\s*${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${z1}})(?:\\.(\\d{1,${z1}}))?(?:\\.(\\d{1,${z1}}))?`);Pe("COERCE",`${Y[Z.COERCEPLAIN]}(?:$|[^\\d])`);Pe("COERCEFULL",Y[Z.COERCEPLAIN]+`(?:${Y[Z.PRERELEASE]})?(?:${Y[Z.BUILD]})?(?:$|[^\\d])`);Pe("COERCERTL",Y[Z.COERCE],!0);Pe("COERCERTLFULL",Y[Z.COERCEFULL],!0);Pe("LONETILDE","(?:~>?)");Pe("TILDETRIM",`(\\s*)${Y[Z.LONETILDE]}\\s+`,!0);ro.tildeTrimReplace="$1~";Pe("TILDE",`^${Y[Z.LONETILDE]}${Y[Z.XRANGEPLAIN]}$`);Pe("TILDELOOSE",`^${Y[Z.LONETILDE]}${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("LONECARET","(?:\\^)");Pe("CARETTRIM",`(\\s*)${Y[Z.LONECARET]}\\s+`,!0);ro.caretTrimReplace="$1^";Pe("CARET",`^${Y[Z.LONECARET]}${Y[Z.XRANGEPLAIN]}$`);Pe("CARETLOOSE",`^${Y[Z.LONECARET]}${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("COMPARATORLOOSE",`^${Y[Z.GTLT]}\\s*(${Y[Z.LOOSEPLAIN]})$|^$`);Pe("COMPARATOR",`^${Y[Z.GTLT]}\\s*(${Y[Z.FULLPLAIN]})$|^$`);Pe("COMPARATORTRIM",`(\\s*)${Y[Z.GTLT]}\\s*(${Y[Z.LOOSEPLAIN]}|${Y[Z.XRANGEPLAIN]})`,!0);ro.comparatorTrimReplace="$1$2$3";Pe("HYPHENRANGE",`^\\s*(${Y[Z.XRANGEPLAIN]})\\s+-\\s+(${Y[Z.XRANGEPLAIN]})\\s*$`);Pe("HYPHENRANGELOOSE",`^\\s*(${Y[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[Z.XRANGEPLAINLOOSE]})\\s*$`);Pe("STAR","(<|>)?=?\\s*\\*");Pe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Pe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gd=ae((xY,MS)=>{"use strict";var HN=Object.freeze({loose:!0}),$N=Object.freeze({}),KN=e=>e?typeof e!="object"?HN:e:$N;MS.exports=KN});var V1=ae((_Y,TS)=>{"use strict";var vS=/^[0-9]+$/,ES=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=vS.test(e),n=vS.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},XN=(e,t)=>ES(t,e);TS.exports={compareIdentifiers:ES,rcompareIdentifiers:XN}});var Mr=ae((SY,IS)=>{"use strict";var yd=uf(),{MAX_LENGTH:AS,MAX_SAFE_INTEGER:bd}=wl(),{safeRe:wd,t:xd}=xl(),YN=gd(),{compareIdentifiers:W1}=V1(),ZN=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(W1(e[n],r[n])!==0)return!1;return!0},H1=class e{constructor(t,r){if(r=YN(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>AS)throw new TypeError(`version is longer than ${AS} characters`);yd("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?wd[xd.LOOSE]:wd[xd.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>bd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>bd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>bd||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<bd)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(yd("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(yd("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return W1(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(yd("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return W1(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?wd[xd.PRERELEASELOOSE]:wd[xd.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];if(n===!1&&(o=[r]),ZN(this.prerelease,r)){let s=this.prerelease[r.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};IS.exports=H1});var Es=ae((MY,RS)=>{"use strict";var PS=Mr(),JN=(e,t,r=!1)=>{if(e instanceof PS)return e;try{return new PS(e,t)}catch(n){if(!r)return null;throw n}};RS.exports=JN});var OS=ae((vY,LS)=>{"use strict";var QN=Es(),eF=(e,t)=>{let r=QN(e,t);return r?r.version:null};LS.exports=eF});var CS=ae((EY,BS)=>{"use strict";var tF=Es(),rF=(e,t)=>{let r=tF(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};BS.exports=rF});var FS=ae((TY,NS)=>{"use strict";var DS=Mr(),nF=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new DS(e instanceof DS?e.version:e,r).inc(t,n,i).version}catch{return null}};NS.exports=nF});var US=ae((AY,kS)=>{"use strict";var GS=Es(),iF=(e,t)=>{let r=GS(e,null,!0),n=GS(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};kS.exports=iF});var zS=ae((IY,jS)=>{"use strict";var oF=Mr(),sF=(e,t)=>new oF(e,t).major;jS.exports=sF});var VS=ae((PY,qS)=>{"use strict";var aF=Mr(),cF=(e,t)=>new aF(e,t).minor;qS.exports=cF});var HS=ae((RY,WS)=>{"use strict";var lF=Mr(),uF=(e,t)=>new lF(e,t).patch;WS.exports=uF});var KS=ae((LY,$S)=>{"use strict";var fF=Es(),hF=(e,t)=>{let r=fF(e,t);return r&&r.prerelease.length?r.prerelease:null};$S.exports=hF});var fi=ae((OY,YS)=>{"use strict";var XS=Mr(),dF=(e,t,r)=>new XS(e,r).compare(new XS(t,r));YS.exports=dF});var JS=ae((BY,ZS)=>{"use strict";var mF=fi(),pF=(e,t,r)=>mF(t,e,r);ZS.exports=pF});var eM=ae((CY,QS)=>{"use strict";var gF=fi(),yF=(e,t)=>gF(e,t,!0);QS.exports=yF});var _d=ae((DY,rM)=>{"use strict";var tM=Mr(),bF=(e,t,r)=>{let n=new tM(e,r),i=new tM(t,r);return n.compare(i)||n.compareBuild(i)};rM.exports=bF});var iM=ae((NY,nM)=>{"use strict";var wF=_d(),xF=(e,t)=>e.sort((r,n)=>wF(r,n,t));nM.exports=xF});var sM=ae((FY,oM)=>{"use strict";var _F=_d(),SF=(e,t)=>e.sort((r,n)=>_F(n,r,t));oM.exports=SF});var ff=ae((GY,aM)=>{"use strict";var MF=fi(),vF=(e,t,r)=>MF(e,t,r)>0;aM.exports=vF});var Sd=ae((kY,cM)=>{"use strict";var EF=fi(),TF=(e,t,r)=>EF(e,t,r)<0;cM.exports=TF});var $1=ae((UY,lM)=>{"use strict";var AF=fi(),IF=(e,t,r)=>AF(e,t,r)===0;lM.exports=IF});var K1=ae((jY,uM)=>{"use strict";var PF=fi(),RF=(e,t,r)=>PF(e,t,r)!==0;uM.exports=RF});var Md=ae((zY,fM)=>{"use strict";var LF=fi(),OF=(e,t,r)=>LF(e,t,r)>=0;fM.exports=OF});var vd=ae((qY,hM)=>{"use strict";var BF=fi(),CF=(e,t,r)=>BF(e,t,r)<=0;hM.exports=CF});var X1=ae((VY,dM)=>{"use strict";var DF=$1(),NF=K1(),FF=ff(),GF=Md(),kF=Sd(),UF=vd(),jF=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return DF(e,r,n);case"!=":return NF(e,r,n);case">":return FF(e,r,n);case">=":return GF(e,r,n);case"<":return kF(e,r,n);case"<=":return UF(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};dM.exports=jF});var pM=ae((WY,mM)=>{"use strict";var zF=Mr(),qF=Es(),{safeRe:Ed,t:Td}=xl(),VF=(e,t)=>{if(e instanceof zF)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Ed[Td.COERCEFULL]:Ed[Td.COERCE]);else{let c=t.includePrerelease?Ed[Td.COERCERTLFULL]:Ed[Td.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return qF(`${n}.${i}.${o}${s}${a}`,t)};mM.exports=VF});var yM=ae((HY,gM)=>{"use strict";var WF=Es(),HF=wl(),$F=Mr(),KF=(e,t,r)=>{if(!HF.RELEASE_TYPES.includes(t))return null;let n=XF(e,r);return n&&YF(n,t)},XF=(e,t)=>{let r=e instanceof $F?e.version:e;return WF(r,t)},YF=(e,t)=>{if(ZF(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},ZF=e=>e.startsWith("pre");gM.exports=KF});var wM=ae(($Y,bM)=>{"use strict";var Y1=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};bM.exports=Y1});var hi=ae((KY,MM)=>{"use strict";var JF=/\s+/g,Z1=class e{constructor(t,r){if(r=e7(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof J1)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(JF," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!_M(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&l7(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(c7,"");let n=((this.options.includePrerelease&&s7)|(this.options.loose&&a7))+":"+t,i=xM.get(n);if(i)return i;let o=this.options.loose,s=o?Jr[vr.HYPHENRANGELOOSE]:Jr[vr.HYPHENRANGE];t=t.replace(s,x7(this.options.includePrerelease)),Et("hyphen replace",t),t=t.replace(Jr[vr.COMPARATORTRIM],n7),Et("comparator trim",t),t=t.replace(Jr[vr.TILDETRIM],i7),Et("tilde trim",t),t=t.replace(Jr[vr.CARETTRIM],o7),Et("caret trim",t);let a=t.split(" ").map(h=>u7(h,this.options)).join(" ").split(/\s+/).map(h=>w7(h,this.options));o&&(a=a.filter(h=>(Et("loose invalid filter",h,this.options),!!h.match(Jr[vr.COMPARATORLOOSE])))),Et("range list",a);let c=new Map,l=a.map(h=>new J1(h,this.options));for(let h of l){if(_M(h))return[h];c.set(h.value,h)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return xM.set(n,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>SM(n,r)&&t.set.some(i=>SM(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new t7(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(_7(this.set[r],t,this.options))return!0;return!1}};MM.exports=Z1;var QF=wM(),xM=new QF,e7=gd(),J1=hf(),Et=uf(),t7=Mr(),{safeRe:Jr,src:r7,t:vr,comparatorTrimReplace:n7,tildeTrimReplace:i7,caretTrimReplace:o7}=xl(),{FLAG_INCLUDE_PRERELEASE:s7,FLAG_LOOSE:a7}=wl(),c7=new RegExp(r7[vr.BUILD],"g"),_M=e=>e.value==="<0.0.0-0",l7=e=>e.value==="",SM=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},u7=(e,t)=>(e=e.replace(Jr[vr.BUILD],""),Et("comp",e,t),e=m7(e,t),Et("caret",e),e=h7(e,t),Et("tildes",e),e=g7(e,t),Et("xrange",e),e=b7(e,t),Et("stars",e),e),ar=e=>!e||e.toLowerCase()==="x"||e==="*",f7=(e,t,r)=>ar(e)&&!ar(t)||ar(t)&&r&&!ar(r),h7=(e,t)=>e.trim().split(/\s+/).map(r=>d7(r,t)).join(" "),d7=(e,t)=>{let r=t.loose?Jr[vr.TILDELOOSE]:Jr[vr.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{Et("tilde",e,i,o,s,a,c);let l;return ar(o)?l="":ar(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ar(a)?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c?(Et("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Et("tilde return",l),l})},m7=(e,t)=>e.trim().split(/\s+/).map(r=>p7(r,t)).join(" "),p7=(e,t)=>{Et("caret",e,t);let r=t.loose?Jr[vr.CARETLOOSE]:Jr[vr.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{Et("caret",e,i,o,s,a,c);let l;return ar(o)?l="":ar(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ar(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(Et("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Et("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Et("caret return",l),l})},g7=(e,t)=>(Et("replaceXRanges",e,t),e.split(/\s+/).map(r=>y7(r,t)).join(" ")),y7=(e,t)=>{e=e.trim();let r=t.loose?Jr[vr.XRANGELOOSE]:Jr[vr.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(Et("xRange",e,n,i,o,s,a,c),f7(o,s,a))return e;let l=ar(o),u=l||ar(s),h=u||ar(a),d=h;return i==="="&&d&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&d?(u&&(s=0),a=0,i===">"?(i=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",u?o=+o+1:s=+s+1),i==="<"&&(c="-0"),n=`${i+o}.${s}.${a}${c}`):u?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:h&&(n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Et("xRange return",n),n})},b7=(e,t)=>(Et("replaceStars",e,t),e.trim().replace(Jr[vr.STAR],"")),w7=(e,t)=>(Et("replaceGTE0",e,t),e.trim().replace(Jr[t.includePrerelease?vr.GTE0PRE:vr.GTE0],"")),x7=e=>(t,r,n,i,o,s,a,c,l,u,h,d)=>(ar(n)?r="":ar(i)?r=`>=${n}.0.0${e?"-0":""}`:ar(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,ar(l)?c="":ar(u)?c=`<${+l+1}.0.0-0`:ar(h)?c=`<${l}.${+u+1}.0-0`:d?c=`<=${l}.${u}.${h}-${d}`:e?c=`<${l}.${u}.${+h+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),_7=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Et(e[n].semver),e[n].semver!==J1.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var hf=ae((XY,PM)=>{"use strict";var df=Symbol("SemVer ANY"),tg=class e{static get ANY(){return df}constructor(t,r){if(r=vM(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),eg("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===df?this.value="":this.value=this.operator+this.semver.version,eg("comp",this)}parse(t){let r=this.options.loose?EM[TM.COMPARATORLOOSE]:EM[TM.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new AM(n[2],this.options.loose):this.semver=df}toString(){return this.value}test(t){if(eg("Comparator.test",t,this.options.loose),this.semver===df||t===df)return!0;if(typeof t=="string")try{t=new AM(t,this.options)}catch{return!1}return Q1(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new IM(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new IM(this.value,r).test(t.semver):(r=vM(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Q1(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Q1(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};PM.exports=tg;var vM=gd(),{safeRe:EM,t:TM}=xl(),Q1=X1(),eg=uf(),AM=Mr(),IM=hi()});var mf=ae((YY,RM)=>{"use strict";var S7=hi(),M7=(e,t,r)=>{try{t=new S7(t,r)}catch{return!1}return t.test(e)};RM.exports=M7});var OM=ae((ZY,LM)=>{"use strict";var v7=hi(),E7=(e,t)=>new v7(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));LM.exports=E7});var CM=ae((JY,BM)=>{"use strict";var T7=Mr(),A7=hi(),I7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new A7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new T7(n,r))}),n};BM.exports=I7});var NM=ae((QY,DM)=>{"use strict";var P7=Mr(),R7=hi(),L7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new R7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new P7(n,r))}),n};DM.exports=L7});var kM=ae((eZ,GM)=>{"use strict";var rg=Mr(),O7=hi(),FM=ff(),B7=(e,t)=>{e=new O7(e,t);let r=new rg("0.0.0");if(e.test(r)||(r=new rg("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new rg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||FM(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||FM(r,o))&&(r=o)}return r&&e.test(r)?r:null};GM.exports=B7});var jM=ae((tZ,UM)=>{"use strict";var C7=hi(),D7=(e,t)=>{try{return new C7(e,t).range||"*"}catch{return null}};UM.exports=D7});var Ad=ae((rZ,WM)=>{"use strict";var N7=Mr(),VM=hf(),{ANY:F7}=VM,G7=hi(),k7=mf(),zM=ff(),qM=Sd(),U7=vd(),j7=Md(),z7=(e,t,r,n)=>{e=new N7(e,n),t=new G7(t,n);let i,o,s,a,c;switch(r){case">":i=zM,o=U7,s=qM,a=">",c=">=";break;case"<":i=qM,o=j7,s=zM,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(k7(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],h=null,d=null;if(u.forEach(m=>{m.semver===F7&&(m=new VM(">=0.0.0")),h=h||m,d=d||m,i(m.semver,h.semver,n)?h=m:s(m.semver,d.semver,n)&&(d=m)}),h.operator===a||h.operator===c||(!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===c&&s(e,d.semver))return!1}return!0};WM.exports=z7});var $M=ae((nZ,HM)=>{"use strict";var q7=Ad(),V7=(e,t,r)=>q7(e,t,">",r);HM.exports=V7});var XM=ae((iZ,KM)=>{"use strict";var W7=Ad(),H7=(e,t,r)=>W7(e,t,"<",r);KM.exports=H7});var JM=ae((oZ,ZM)=>{"use strict";var YM=hi(),$7=(e,t,r)=>(e=new YM(e,r),t=new YM(t,r),e.intersects(t,r));ZM.exports=$7});var e3=ae((sZ,QM)=>{"use strict";var K7=mf(),X7=fi();QM.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((u,h)=>X7(u,h,r));for(let u of s)K7(u,t,r)?(o=u,i||(i=u)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[u,h]of n)u===h?a.push(u):!h&&u===s[0]?a.push("*"):h?u===s[0]?a.push(`<=${h}`):a.push(`${u} - ${h}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var s3=ae((aZ,o3)=>{"use strict";var t3=hi(),og=hf(),{ANY:ng}=og,ig=mf(),sg=fi(),Y7=(e,t,r={})=>{if(e===t)return!0;e=new t3(e,r),t=new t3(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=J7(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Z7=[new og(">=0.0.0-0")],r3=[new og(">=0.0.0")],J7=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===ng){if(t.length===1&&t[0].semver===ng)return!0;r.includePrerelease?e=Z7:e=r3}if(t.length===1&&t[0].semver===ng){if(r.includePrerelease)return!0;t=r3}let n=new Set,i,o;for(let m of e)m.operator===">"||m.operator===">="?i=n3(i,m,r):m.operator==="<"||m.operator==="<="?o=i3(o,m,r):n.add(m.semver);if(n.size>1)return null;let s;if(i&&o){if(s=sg(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let m of n){if(i&&!ig(m,String(i),r)||o&&!ig(m,String(o),r))return null;for(let g of t)if(!ig(m,String(g),r))return!1;return!0}let a,c,l,u,h=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&o.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let m of t){if(u=u||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",i){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator===">"||m.operator===">="){if(a=n3(i,m,r),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(o){if(h&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===h.major&&m.semver.minor===h.minor&&m.semver.patch===h.patch&&(h=!1),m.operator==="<"||m.operator==="<="){if(c=i3(o,m,r),c===m&&c!==o)return!1}else if(o.operator==="<="&&!m.test(o.semver))return!1}if(!m.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&u&&!i&&s!==0||d||h)},n3=(e,t,r)=>{if(!e)return t;let n=sg(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},i3=(e,t,r)=>{if(!e)return t;let n=sg(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};o3.exports=Y7});var u3=ae((cZ,l3)=>{"use strict";var ag=xl(),a3=wl(),Q7=Mr(),c3=V1(),e9=Es(),t9=OS(),r9=CS(),n9=FS(),i9=US(),o9=zS(),s9=VS(),a9=HS(),c9=KS(),l9=fi(),u9=JS(),f9=eM(),h9=_d(),d9=iM(),m9=sM(),p9=ff(),g9=Sd(),y9=$1(),b9=K1(),w9=Md(),x9=vd(),_9=X1(),S9=pM(),M9=yM(),v9=hf(),E9=hi(),T9=mf(),A9=OM(),I9=CM(),P9=NM(),R9=kM(),L9=jM(),O9=Ad(),B9=$M(),C9=XM(),D9=JM(),N9=e3(),F9=s3();l3.exports={parse:e9,valid:t9,clean:r9,inc:n9,diff:i9,major:o9,minor:s9,patch:a9,prerelease:c9,compare:l9,rcompare:u9,compareLoose:f9,compareBuild:h9,sort:d9,rsort:m9,gt:p9,lt:g9,eq:y9,neq:b9,gte:w9,lte:x9,cmp:_9,coerce:S9,truncate:M9,Comparator:v9,Range:E9,satisfies:T9,toComparators:A9,maxSatisfying:I9,minSatisfying:P9,minVersion:R9,validRange:L9,outside:O9,gtr:B9,ltr:C9,intersects:D9,simplifyRange:N9,subset:F9,SemVer:Q7,re:ag.re,src:ag.src,tokens:ag.t,SEMVER_SPEC_VERSION:a3.SEMVER_SPEC_VERSION,RELEASE_TYPES:a3.RELEASE_TYPES,compareIdentifiers:c3.compareIdentifiers,rcompareIdentifiers:c3.rcompareIdentifiers}});var Co,Id=p(()=>{Co={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.5","@img/sharp-darwin-x64":"0.35.5","@img/sharp-freebsd-wasm32":"0.35.5","@img/sharp-libvips-darwin-arm64":"1.3.4","@img/sharp-libvips-darwin-x64":"1.3.4","@img/sharp-libvips-linux-arm":"1.3.4","@img/sharp-libvips-linux-arm64":"1.3.4","@img/sharp-libvips-linux-ppc64":"1.3.4","@img/sharp-libvips-linux-riscv64":"1.3.4","@img/sharp-libvips-linux-s390x":"1.3.4","@img/sharp-libvips-linux-x64":"1.3.4","@img/sharp-libvips-linuxmusl-arm64":"1.3.4","@img/sharp-libvips-linuxmusl-x64":"1.3.4","@img/sharp-linux-arm":"0.35.5","@img/sharp-linux-arm64":"0.35.5","@img/sharp-linux-ppc64":"0.35.5","@img/sharp-linux-riscv64":"0.35.5","@img/sharp-linux-s390x":"0.35.5","@img/sharp-linux-x64":"0.35.5","@img/sharp-linuxmusl-arm64":"0.35.5","@img/sharp-linuxmusl-x64":"0.35.5","@img/sharp-webcontainers-wasm32":"0.35.5","@img/sharp-win32-arm64":"0.35.5","@img/sharp-win32-ia32":"0.35.5","@img/sharp-win32-x64":"0.35.5"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.14","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.3","@img/sharp-libvips-dev":"1.3.4","@img/sharp-libvips-dev-wasm32":"1.3.4","@img/sharp-libvips-win32-arm64":"1.3.4","@img/sharp-libvips-win32-ia32":"1.3.4","@img/sharp-libvips-win32-x64":"1.3.4","@types/node":"*",emnapi:"^1.11.3","exif-reader":"^2.0.3",icc:"^4.0.0","node-addon-api":"^8.9.2","node-gyp":"^12.4.0",publint:"^0.3.24","tar-fs":"^3.1.3",tsd:"^0.33.0",yauzl:"^3.4.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.7"},funding:{url:"https://opencollective.com/libvips"}}});var Sl,h3,pf,lg,k9,d3,U9,ug,j9,m3,z9,_l,q9,V9,W9,H9,p3,$9,f3,K9,X9,g3,Y9,Z9,y3,cg,J9,Pd,fg=p(()=>{Sl=require("node:child_process"),h3=require("node:crypto"),pf=me(u3(),1),lg=me(pd(),1);Id();k9=process.env.npm_package_config_libvips||Co.config.libvips,d3=pf.default.coerce(k9).version,U9=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],ug={encoding:"utf8",shell:!0},j9=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},m3=()=>lg.default.isNonGlibcLinuxSync()?lg.default.familySync():"",z9=()=>`${process.platform}${m3()}-${process.arch}`,_l=()=>{if(p3())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r=="string"?r:m3();return`${t||process.platform}${n}-${e||process.arch}`},q9=()=>{try{return require(`@img/sharp-libvips-dev-${_l()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},V9=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},W9=()=>{try{return require(`@img/sharp-libvips-dev-${_l()}/lib`)}catch{try{return require(`@img/sharp-libvips-${_l()}/lib`)}catch{}}return""},H9=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!pf.default.satisfies(process.versions.node,Co.engines.node))return{found:process.versions.node,expected:Co.engines.node}},p3=()=>{let{CC:e}=process.env;return!!(e!=null&&e.endsWith("/emcc"))},$9=()=>process.platform==="darwin"&&process.arch==="x64"?((0,Sl.spawnSync)("sysctl sysctl.proc_translated",ug).stdout||"").trim()==="sysctl.proc_translated: 1":!1,f3=e=>(0,h3.createHash)("sha512").update(e).digest("hex"),K9=()=>{try{let e=f3(`imgsharp-libvips-${_l()}`),t=pf.default.coerce(Co.optionalDependencies[`@img/sharp-libvips-${_l()}`],{includePrerelease:!0}).version;return f3(`${e}npm:${t}`).slice(0,10)}catch{}return""},X9=()=>(0,Sl.spawnSync)(`node-gyp rebuild --directory=src ${p3()?"--nodedir=emscripten":""}`,{...ug,stdio:"inherit"}).status,g3=()=>process.platform!=="win32"?((0,Sl.spawnSync)("pkg-config --modversion vips-cpp",{...ug,env:{...process.env,PKG_CONFIG_PATH:y3()}}).stdout||"").trim():"",Y9=()=>{try{let e=((0,Sl.spawnSync)("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch{}},Z9=()=>{try{let e=((0,Sl.spawnSync)("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch{}},y3=()=>process.platform!=="win32"?[Y9(),Z9(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",cg=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),J9=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return cg(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return cg(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if($9())return cg(!1,"Rosetta",e);let t=g3();return!!t&&pf.default.gte(t,d3)},Pd={minimumLibvipsVersion:d3,prebuiltPlatforms:U9,buildPlatformArch:_l,buildSharpLibvipsIncludeDir:q9,buildSharpLibvipsCPlusPlusDir:V9,buildSharpLibvipsLibDir:W9,isUnsupportedNodeRuntime:H9,runtimePlatformArch:z9,log:j9,yarnLocator:K9,spawnRebuild:X9,globalLibvipsVersion:g3,pkgConfigPath:y3,useGlobalLibvips:J9}});var w3,Rd,rG,cr,x3,Q9,b3,eG,tG,Do,yt,Ts,nt,gf=p(()=>{w3=require("node:module"),Rd=me(pd(),1);fg();Id();rG={};cr=(0,w3.createRequire)(rG.url),{version:x3}=Co,{runtimePlatformArch:Q9,isUnsupportedNodeRuntime:b3,prebuiltPlatforms:eG,minimumLibvipsVersion:tG}=Pd,Do=Q9(),Ts=[];try{yt=cr(`../src/build/Release/sharp-${Do}-${x3}.node`)}catch(e){Ts.push(e)}if(!yt)try{yt=cr(`../src/build/Release/sharp-wasm32-${x3}.node`)}catch(e){Ts.push(e)}if(!yt)try{switch(Do){case"darwin-arm64":yt=cr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":yt=cr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":yt=cr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":yt=cr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":yt=cr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":yt=cr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":yt=cr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":yt=cr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":yt=cr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":yt=cr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":yt=cr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":yt=cr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":yt=cr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":yt=cr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":yt=cr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(yt&&["linux-x64","linuxmusl-x64"].includes(Do)&&!yt._isUsingX64V2()){let e=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",Ts.push(e),yt=null}yt&&process.versions.electron&&Do.startsWith("linux")&&process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(e){Ts.push(e)}if(!yt)try{yt=cr("@img/sharp-wasm32/sharp.node")}catch(e){Ts.push(e)}if(!yt){let[e,t,r]=["linux","darwin","win32"].map(o=>Do.startsWith(o)),n=[`Could not load the "sharp" module using the ${Do} runtime`];Ts.forEach(o=>{var s;(s=o.code)!=null&&s.endsWith("MODULE_NOT_FOUND")||n.push(o.code?`${o.code}: ${o.message}`:o.message)});let i=Ts.map(o=>o.message).join(" ");if(n.push("Possible solutions:"),b3()){let{found:o,expected:s}=b3();n.push("- Please upgrade Node.js:",` Found ${o}`,` Requires ${s}`)}else if(eG.includes(Do)&&!/libstdc\+\+\.so/.test(i)){let[o,s]=Do.split("-"),a=o.endsWith("musl")?" --libc=musl":"";n.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${o.replace("musl","")}${a} --cpu=${s} sharp`)}else n.push(`- Manually install libvips >= ${tG}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:o}=cr(`@img/sharp-libvips-${Do}/package`),s=`${(0,Rd.familySync)()} ${(0,Rd.versionSync)()}`,a=`${o.musl?"musl":"glibc"} ${o.musl||o.glibc}`;n.push("- Update your OS:",` Found ${s}`,` Requires ${a}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(i)&&n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(i)&&n.push("- Update Homebrew:"," brew update && brew upgrade vips"),Ts.some(o=>o.code==="ERR_DLOPEN_DISABLED")&&n.push("- Run Node.js without using the --no-addons flag"),r&&/The specified procedure could not be found/.test(i)&&n.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),n.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(n.join(`
2
- `))}nt=yt});function oG(){let e=this.constructor.call(),{debuglog:t,queueListener:r,...n}=this.options;return e.options=structuredClone(n),e.options.debuglog=t,e.options.queueListener=r,this._isStreamInput()&&this._whenStreamInFinished(()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}var _3,Ld,nG,iG,Ja,no,S3=p(()=>{_3=me(require("node:util"),1),Ld=me(require("node:stream"),1);Ji();gf();nG=_3.default.debuglog("sharp"),iG=e=>{Ja.queue.emit("change",e)},Ja=function(e,t){if(arguments.length===1&&!f.defined(e))throw new Error("Invalid input");return this instanceof Ja?(Ld.default.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:r=>{this.emit("warning",r),nG(r)},queueListener:iG},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new Ja(e,t)};Object.setPrototypeOf(Ja.prototype,Ld.default.Duplex.prototype);Object.setPrototypeOf(Ja,Ld.default.Duplex);Object.assign(Ja.prototype,{clone:oG});no=Ja});function M3(e){let t=aG.filter(r=>f.defined(e[r])).map(r=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function cG(e,t,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(e))n.file=e;else if(f.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");n.buffer=e}else if(f.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(e,0,e.byteLength)}else if(f.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(f.plainObject(e)&&!f.defined(t))t=e,M3(t)&&(n.buffer=[]);else if(!f.defined(e)&&!f.defined(t)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map(i=>this._createInputDescriptor(i));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${e}' of type ${typeof e}${f.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(f.object(t)){if(f.defined(t.failOn))if(f.string(t.failOn)&&f.inArray(t.failOn,["none","truncated","error","warning"]))n.failOn=t.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(f.defined(t.autoOrient))if(f.bool(t.autoOrient))n.autoOrient=t.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",t.autoOrient);if(f.defined(t.density))if(f.number(t.density)&&f.inRange(t.density,1,1e5))n.density=t.density;else throw f.invalidParameterError("density","number between 1 and 100000",t.density);if(f.defined(t.ignoreIcc))if(f.bool(t.ignoreIcc))n.ignoreIcc=t.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(f.defined(t.limitInputPixels))if(f.bool(t.limitInputPixels))n.limitInputPixels=t.limitInputPixels?16383**2:0;else if(f.integer(t.limitInputPixels)&&f.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=t.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(f.defined(t.limitInputChannels))if(f.bool(t.limitInputChannels))n.limitInputChannels=t.limitInputChannels?5:0;else if(f.integer(t.limitInputChannels)&&f.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=t.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(f.defined(t.unlimited))if(f.bool(t.unlimited))n.unlimited=t.unlimited;else throw f.invalidParameterError("unlimited","boolean",t.unlimited);if(f.defined(t.sequentialRead))if(f.bool(t.sequentialRead))n.sequentialRead=t.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(f.defined(t.raw)){if(f.object(t.raw)&&f.integer(t.raw.width)&&f.inRange(t.raw.width,1,1e8)&&f.integer(t.raw.height)&&f.inRange(t.raw.height,1,1e8)&&f.integer(t.raw.channels)&&f.inRange(t.raw.channels,1,4))switch(n.rawWidth=t.raw.width,n.rawHeight=t.raw.height,n.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:n.rawDepth="uchar";break;case Int8Array:n.rawDepth="char";break;case Uint16Array:n.rawDepth="ushort";break;case Int16Array:n.rawDepth="short";break;case Uint32Array:n.rawDepth="uint";break;case Int32Array:n.rawDepth="int";break;case Float32Array:n.rawDepth="float";break;case Float64Array:n.rawDepth="double";break;default:n.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(n.rawPremultiplied=!1,f.defined(t.raw.premultiplied))if(f.bool(t.raw.premultiplied))n.rawPremultiplied=t.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(n.rawPageHeight=0,f.defined(t.raw.pageHeight))if(f.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);n.rawPageHeight=t.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(f.defined(t.animated))if(f.bool(t.animated))n.pages=t.animated?-1:1;else throw f.invalidParameterError("animated","boolean",t.animated);if(f.defined(t.pages))if(f.integer(t.pages)&&f.inRange(t.pages,-1,1e5))n.pages=t.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(f.defined(t.page))if(f.integer(t.page)&&f.inRange(t.page,0,1e5))n.page=t.page;else throw f.invalidParameterError("page","integer between 0 and 100000",t.page);if(f.object(t.openSlide)&&f.defined(t.openSlide.level))if(f.integer(t.openSlide.level)&&f.inRange(t.openSlide.level,0,256))n.openSlideLevel=t.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(f.defined(t.level))if(f.integer(t.level)&&f.inRange(t.level,0,256))n.openSlideLevel=t.level;else throw f.invalidParameterError("level","integer between 0 and 256",t.level);if(f.object(t.tiff)&&f.defined(t.tiff.subifd))if(f.integer(t.tiff.subifd)&&f.inRange(t.tiff.subifd,-1,1e5))n.tiffSubifd=t.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(f.defined(t.subifd))if(f.integer(t.subifd)&&f.inRange(t.subifd,-1,1e5))n.tiffSubifd=t.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(f.object(t.svg)){if(f.defined(t.svg.stylesheet))if(f.string(t.svg.stylesheet))n.svgStylesheet=t.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(f.defined(t.svg.highBitdepth))if(f.bool(t.svg.highBitdepth))n.svgHighBitdepth=t.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(f.object(t.pdf)&&f.defined(t.pdf.background)?n.pdfBackground=this._getBackgroundColourOption(t.pdf.background):f.defined(t.pdfBackground)&&(n.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),f.object(t.jp2)&&f.defined(t.jp2.oneshot))if(f.bool(t.jp2.oneshot))n.jp2Oneshot=t.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(f.defined(t.create))if(f.object(t.create)&&f.integer(t.create.width)&&f.inRange(t.create.width,1,1e8)&&f.integer(t.create.height)&&f.inRange(t.create.height,1,1e8)&&f.integer(t.create.channels)){if(n.createWidth=t.create.width,n.createHeight=t.create.height,n.createChannels=t.create.channels,n.createPageHeight=0,f.defined(t.create.pageHeight))if(f.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);n.createPageHeight=t.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(f.defined(t.create.noise)){if(!f.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=t.create.noise.type,!f.inRange(t.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(n.createNoiseMean=128,f.defined(t.create.noise.mean))if(f.number(t.create.noise.mean)&&f.inRange(t.create.noise.mean,0,1e4))n.createNoiseMean=t.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(n.createNoiseSigma=30,f.defined(t.create.noise.sigma))if(f.number(t.create.noise.sigma)&&f.inRange(t.create.noise.sigma,0,1e4))n.createNoiseSigma=t.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(f.defined(t.create.background)){if(!f.inRange(t.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);n.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete n.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(f.defined(t.text))if(f.object(t.text)&&f.string(t.text.text)){if(n.textValue=t.text.text,f.defined(t.text.height)&&f.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(f.defined(t.text.font))if(f.string(t.text.font))n.textFont=t.text.font;else throw f.invalidParameterError("text.font","string",t.text.font);if(f.defined(t.text.fontfile))if(f.string(t.text.fontfile))n.textFontfile=t.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",t.text.fontfile);if(f.defined(t.text.width))if(f.integer(t.text.width)&&f.inRange(t.text.width,1,1e6))n.textWidth=t.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(f.defined(t.text.height))if(f.integer(t.text.height)&&f.inRange(t.text.height,1,1e6))n.textHeight=t.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(f.defined(t.text.align))if(f.string(t.text.align)&&f.string(this.constructor.align[t.text.align]))n.textAlign=this.constructor.align[t.text.align];else throw f.invalidParameterError("text.align","valid alignment",t.text.align);if(f.defined(t.text.justify))if(f.bool(t.text.justify))n.textJustify=t.text.justify;else throw f.invalidParameterError("text.justify","boolean",t.text.justify);if(f.defined(t.text.dpi))if(f.integer(t.text.dpi)&&f.inRange(t.text.dpi,1,1e6))n.textDpi=t.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(f.defined(t.text.rgba))if(f.bool(t.text.rgba))n.textRgba=t.text.rgba;else throw f.invalidParameterError("text.rgba","bool",t.text.rgba);if(f.defined(t.text.spacing))if(f.integer(t.text.spacing)&&f.inRange(t.text.spacing,-1e6,1e6))n.textSpacing=t.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(f.defined(t.text.wrap))if(f.string(t.text.wrap)&&f.inArray(t.text.wrap,["word","char","word-char","none"]))n.textWrap=t.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete n.buffer}else throw new Error("Expected a valid string to create an image with text.");if(f.defined(t.join))if(f.defined(this.options.join)){if(f.defined(t.join.animated))if(f.bool(t.join.animated))n.joinAnimated=t.join.animated;else throw f.invalidParameterError("join.animated","boolean",t.join.animated);if(f.defined(t.join.across))if(f.integer(t.join.across)&&f.inRange(t.join.across,1,1e6))n.joinAcross=t.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(f.defined(t.join.shim))if(f.integer(t.join.shim)&&f.inRange(t.join.shim,0,1e6))n.joinShim=t.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(f.defined(t.join.background)&&(n.joinBackground=this._getBackgroundColourOption(t.join.background)),f.defined(t.join.halign))if(f.string(t.join.halign)&&f.string(this.constructor.align[t.join.halign]))n.joinHalign=this.constructor.align[t.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",t.join.halign);if(f.defined(t.join.valign))if(f.string(t.join.valign)&&f.string(this.constructor.align[t.join.valign]))n.joinValign=this.constructor.align[t.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(f.defined(t))throw new Error(`Invalid input options ${t}`);return n}function lG(e,t,r){Array.isArray(this.options.input.buffer)?f.buffer(e)?(this.options.input.buffer.push(e),r()):r(new Error("Non-Buffer data on Writable Stream")):r(new Error("Unexpected data on Writable Stream"))}function uG(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function fG(){return Array.isArray(this.options.input.buffer)}function hG(e){this.writableFinished?e():this.once("finish",e)}function dG(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):nt.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{nt.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}function mG(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):nt.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{nt.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}var sG,aG,v3,E3=p(()=>{Ji();gf();sG={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},aG=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];v3=e=>{Object.assign(e.prototype,{_inputOptionsFromObject:M3,_createInputDescriptor:cG,_write:lG,_flattenBufferIn:uG,_isStreamInput:fG,_whenStreamInFinished:hG,metadata:dG,stats:mG}),e.align=sG}});function dg(e){return e.angle%360!==0||e.rotationAngle!==0}function Od(e){return e.width!==-1||e.height!==-1}function yG(e,t,r){if(Od(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),f.defined(e))if(f.object(e)&&!f.defined(r))r=e;else if(f.integer(e)&&f.inRange(e,1,1e8))this.options.width=e;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",e);else this.options.width=-1;if(f.defined(t))if(f.integer(t)&&f.inRange(t,1,1e8))this.options.height=t;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(f.object(r)){if(f.defined(r.width))if(f.integer(r.width)&&f.inRange(r.width,1,1e8))this.options.width=r.width;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",r.width);if(f.defined(r.height))if(f.integer(r.height)&&f.inRange(r.height,1,1e8))this.options.height=r.height;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",r.height);if(f.defined(r.fit)){let n=gG[r.fit];if(f.string(n))this.options.canvas=n;else throw f.invalidParameterError("fit","valid fit",r.fit)}if(f.defined(r.position)){let n=f.integer(r.position)?r.position:P3[r.position]||I3[r.position]||A3[r.position];if(f.integer(n)&&(f.inRange(n,0,8)||f.inRange(n,16,17)))this.options.position=n;else throw f.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),f.defined(r.kernel))if(f.string(hg[r.kernel]))this.options.kernel=hg[r.kernel];else throw f.invalidParameterError("kernel","valid kernel name",r.kernel);f.defined(r.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",r.withoutEnlargement),f.defined(r.withoutReduction)&&this._setBooleanOption("withoutReduction",r.withoutReduction),f.defined(r.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}return dg(this.options)&&Od(this.options)&&(this.options.rotateBefore=!0),this}function bG(e){if(f.integer(e))if(f.inRange(e,1,1e8))this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else throw f.invalidParameterError("extend","integer between 1 and 100000000",e);else if(f.object(e)){if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,0,1e8))this.options.extendTop=e.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",e.top);if(f.defined(e.bottom))if(f.integer(e.bottom)&&f.inRange(e.bottom,0,1e8))this.options.extendBottom=e.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",e.bottom);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,0,1e8))this.options.extendLeft=e.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",e.left);if(f.defined(e.right))if(f.integer(e.right)&&f.inRange(e.right,0,1e8))this.options.extendRight=e.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),f.defined(e.extendWith))if(f.string(T3[e.extendWith]))this.options.extendWith=T3[e.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw f.invalidParameterError("extend","integer or object",e);return this}function wG(e){let t=Od(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(r){let n=e[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),dg(this.options)&&!Od(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function xG(e){if(this.options.trimThreshold=10,f.defined(e))if(f.object(e)){if(f.defined(e.background)&&this._setBackgroundColourOption("trimBackground",e.background),f.defined(e.threshold))if(f.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw f.invalidParameterError("threshold","positive number",e.threshold);if(f.defined(e.lineArt)&&this._setBooleanOption("trimLineArt",e.lineArt),f.defined(e.margin))if(f.integer(e.margin)&&f.inRange(e.margin,0,1e7))this.options.trimMargin=e.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",e.margin)}else throw f.invalidParameterError("trim","object",e);return dg(this.options)&&(this.options.rotateBefore=!0),this}var A3,I3,T3,P3,hg,pG,gG,R3,L3=p(()=>{Ji();A3={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},I3={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},T3={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},P3={entropy:16,attention:17},hg={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},pG={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},gG={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};R3=e=>{Object.assign(e.prototype,{resize:yG,extend:bG,extract:wG,trim:xG}),e.gravity=A3,e.strategy=P3,e.kernel=hg,e.fit=pG,e.position=I3}});function _G(e){if(!Array.isArray(e))throw f.invalidParameterError("images to composite","array",e);return this.options.composite=e.map(t=>{if(!f.object(t))throw f.invalidParameterError("image to composite","object",t);let r=this._inputOptionsFromObject(t),n={input:this._createInputDescriptor(t.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(t.blend))if(f.string(mg[t.blend]))n.blend=mg[t.blend];else throw f.invalidParameterError("blend","valid blend name",t.blend);if(f.defined(t.tile))if(f.bool(t.tile))n.tile=t.tile;else throw f.invalidParameterError("tile","boolean",t.tile);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,-1e8,1e8))n.left=t.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,-1e8,1e8))n.top=t.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(f.defined(t.top)!==f.defined(t.left))throw new Error("Expected both left and top to be set");if(n.hasOffset=f.integer(t.top)&&f.integer(t.left),f.defined(t.gravity))if(f.integer(t.gravity)&&f.inRange(t.gravity,0,8))n.gravity=t.gravity;else if(f.string(t.gravity)&&f.integer(this.constructor.gravity[t.gravity]))n.gravity=this.constructor.gravity[t.gravity];else throw f.invalidParameterError("gravity","valid gravity",t.gravity);if(f.defined(t.premultiplied))if(f.bool(t.premultiplied))n.premultiplied=t.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",t.premultiplied);return n}),this}var mg,O3,B3=p(()=>{Ji();mg={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};O3=e=>{e.prototype.composite=_G,e.blend=mg}});function SG(e,t){if(!f.defined(e))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),f.integer(e)&&!(e%90))this.options.angle=e;else if(f.number(e))this.options.rotationAngle=e,f.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw f.invalidParameterError("angle","numeric",e);return this}function MG(){return this.options.input.autoOrient=!0,this}function vG(e){return this.options.flip=f.bool(e)?e:!0,this}function EG(e){return this.options.flop=f.bool(e)?e:!0,this}function TG(e,t){let n=Array.isArray(e)&&(e.length===4&&e.every(f.number)||e.length===2&&e.every(i=>Array.isArray(i)&&i.length===2))?e.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",e);if(f.defined(t))if(f.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),f.defined(t.idx))if(f.number(t.idx))this.options.affineIdx=t.idx;else throw f.invalidParameterError("options.idx","number",t.idx);if(f.defined(t.idy))if(f.number(t.idy))this.options.affineIdy=t.idy;else throw f.invalidParameterError("options.idy","number",t.idy);if(f.defined(t.odx))if(f.number(t.odx))this.options.affineOdx=t.odx;else throw f.invalidParameterError("options.odx","number",t.odx);if(f.defined(t.ody))if(f.number(t.ody))this.options.affineOdy=t.ody;else throw f.invalidParameterError("options.ody","number",t.ody);if(f.defined(t.interpolator))if(f.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw f.invalidParameterError("options","object",t);return this}function AG(e){if(f.plainObject(e)){if(f.number(e.sigma)&&f.inRange(e.sigma,1e-6,10))this.options.sharpenSigma=e.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(f.defined(e.m1))if(f.number(e.m1)&&f.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(f.defined(e.m2))if(f.number(e.m2)&&f.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(f.defined(e.x1))if(f.number(e.x1)&&f.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(f.defined(e.y2))if(f.number(e.y2)&&f.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(f.defined(e.y3))if(f.number(e.y3)&&f.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else this.options.sharpenSigma=-1;return this}function IG(e){if(!f.defined(e))this.options.medianSize=3;else if(f.integer(e)&&f.inRange(e,1,1e3))this.options.medianSize=e;else throw f.invalidParameterError("size","integer between 1 and 1000",e);return this}function PG(e){let t;if(f.number(e))t=e;else if(f.plainObject(e)){if(!f.number(e.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(f.string(C3[e.precision]))this.options.precision=C3[e.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(f.number(e.minAmplitude)&&f.inRange(e.minAmplitude,.001,1))this.options.minAmpl=e.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!f.defined(e))this.options.blurSigma=-1;else if(f.bool(e))this.options.blurSigma=e?-1:0;else if(f.number(t)&&f.inRange(t,.3,1e3))this.options.blurSigma=t;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function RG(e){if(!f.defined(e))this.options.dilateWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.dilateWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function LG(e){if(!f.defined(e))this.options.erodeWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.erodeWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function OG(e){return this.options.flatten=f.bool(e)?e:!0,f.object(e)&&this._setBackgroundColourOption("flattenBackground",e.background),this}function BG(){return this.options.unflatten=!0,this}function CG(e,t){if(!f.defined(e))this.options.gamma=2.2;else if(f.number(e)&&f.inRange(e,1,3))this.options.gamma=e;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!f.defined(t))this.options.gammaOut=this.options.gamma;else if(f.number(t)&&f.inRange(t,1,3))this.options.gammaOut=t;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function DG(e){if(this.options.negate=f.bool(e)?e:!0,f.plainObject(e)&&"alpha"in e)if(f.bool(e.alpha))this.options.negateAlpha=e.alpha;else throw f.invalidParameterError("alpha","should be boolean value",e.alpha);return this}function NG(e){if(f.plainObject(e)){if(f.defined(e.lower))if(f.number(e.lower)&&f.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw f.invalidParameterError("lower","number between 0 and 99",e.lower);if(f.defined(e.upper))if(f.number(e.upper)&&f.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw f.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw f.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function FG(e){return this.normalise(e)}function GG(e){if(f.plainObject(e)){if(f.integer(e.width)&&f.inRange(e.width,1,65536))this.options.claheWidth=e.width;else throw f.invalidParameterError("width","integer between 1 and 65536",e.width);if(f.integer(e.height)&&f.inRange(e.height,1,65536))this.options.claheHeight=e.height;else throw f.invalidParameterError("height","integer between 1 and 65536",e.height);if(f.defined(e.maxSlope))if(f.integer(e.maxSlope)&&f.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw f.invalidParameterError("options","plain object",e);return this}function kG(e){if(!f.object(e)||!Array.isArray(e.kernel)||!f.integer(e.width)||!f.integer(e.height)||!f.inRange(e.width,3,1001)||!f.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length||!e.kernel.every(f.number))throw new Error("Invalid convolution kernel");return f.integer(e.scale)||(e.scale=e.kernel.reduce((t,r)=>t+r,0)),e.scale<1&&(e.scale=1),f.integer(e.offset)||(e.offset=0),this.options.convKernel=e,this}function UG(e,t){if(!f.defined(e))this.options.threshold=128;else if(f.bool(e))this.options.threshold=e?128:0;else if(f.integer(e)&&f.inRange(e,0,255))this.options.threshold=e;else throw f.invalidParameterError("threshold","integer between 0 and 255",e);return!f.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function jG(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw f.invalidParameterError("operator","one of: and, or, eor",t);return this}function zG(e,t){if(!f.defined(e)&&f.number(t)?e=1:f.number(e)&&!f.defined(t)&&(t=0),!f.defined(e))this.options.linearA=[];else if(f.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearA=e;else throw f.invalidParameterError("a","number or array of numbers",e);if(!f.defined(t))this.options.linearB=[];else if(f.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearB=t;else throw f.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function qG(e){if(!Array.isArray(e))throw f.invalidParameterError("inputMatrix","array",e);let t=e.length;if(t!==3&&t!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!e.every(n=>Array.isArray(n)&&n.length===t))throw f.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,e);let r=e.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function VG(e){if(!f.plainObject(e))throw f.invalidParameterError("options","plain object",e);if("brightness"in e)if(f.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw f.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(f.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw f.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(f.integer(e.hue))this.options.hue=e.hue%360;else throw f.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(f.number(e.lightness))this.options.lightness=e.lightness;else throw f.invalidParameterError("lightness","number",e.lightness);return this}var C3,D3,N3=p(()=>{Ji();C3={integer:"integer",float:"float",approximate:"approximate"};D3=e=>{Object.assign(e.prototype,{autoOrient:MG,rotate:SG,flip:vG,flop:EG,affine:TG,sharpen:AG,erode:LG,dilate:RG,median:IG,blur:PG,flatten:OG,unflatten:BG,gamma:CG,negate:DG,normalise:NG,normalize:FG,clahe:GG,convolve:kG,threshold:UG,boolean:jG,linear:zG,recomb:qG,modulate:VG})}});var z3=ae((AZ,j3)=>{var wg=Object.defineProperty,WG=Object.getOwnPropertyDescriptor,HG=Object.getOwnPropertyNames,$G=Object.prototype.hasOwnProperty,KG=(e,t)=>{for(var r in t)wg(e,r,{get:t[r],enumerable:!0})},XG=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of HG(t))!$G.call(e,i)&&i!==r&&wg(e,i,{get:()=>t[i],enumerable:!(n=WG(t,i))||n.enumerable});return e},YG=e=>XG(wg({},"__esModule",{value:!0}),e),F3={};KG(F3,{default:()=>uk});j3.exports=YG(F3);var pg={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in pg)Object.freeze(pg[e]);var io=Object.freeze(pg),G3=Object.create(null);for(let e in io)Object.hasOwn(io,e)&&(G3[io[e]]=e);var gn={to:{},get:{}};gn.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=gn.get.hsl(e),n="hsl";break}case"hwb":{r=gn.get.hwb(e),n="hwb";break}default:{r=gn.get.rgb(e),n="rgb";break}}return r?{model:n,value:r}:null};gn.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,n=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,o=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(r)){for(l=a[2],a=a[1],c=0;c<3;c++){let u=c*2;s[c]=Number.parseInt(a.slice(u,u+2),16)}l&&(s[3]=Number.parseInt(l,16)/255)}else if(a=e.match(t)){for(a=a[1],l=a[3],c=0;c<3;c++)s[c]=Number.parseInt(a[c]+a[c],16);l&&(s[3]=Number.parseInt(l+l,16)/255)}else if(a=e.match(n)){for(c=0;c<3;c++)s[c]=Number.parseFloat(a[c+1]);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else if(a=e.match(i)){for(c=0;c<3;c++)s[c]=Math.round(Number.parseFloat(a[c+1])*2.55);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else return(a=e.toLowerCase().match(o))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(io,a[1])?(s=io[a[1]].slice(),s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=As(s[c],0,255);return s[3]=As(s[3],0,1),s};gn.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=As(Number.parseFloat(r[2]),0,100),s=As(Number.parseFloat(r[3]),0,100),a=As(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};gn.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=As(Number.parseFloat(r[2]),0,100),s=As(Number.parseFloat(r[3]),0,100),a=As(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};gn.to.hex=function(...e){return"#"+Bd(e[0])+Bd(e[1])+Bd(e[2])+(e[3]<1?Bd(Math.round(e[3]*255)):"")};gn.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};gn.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"};gn.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};gn.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};gn.to.keyword=function(...e){return G3[e.slice(0,3)]};function As(e,t,r){return Math.min(Math.max(t,e),r)}function Bd(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var Ml=gn,k3={};for(let e of Object.keys(io))k3[io[e]]=e;var X={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Qa=X,No=(6/29)**3;function El(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function Tl(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(X)){if(!("channels"in X[e]))throw new Error("missing channels property: "+e);if(!("labels"in X[e]))throw new Error("missing channel labels property: "+e);if(X[e].labels.length!==X[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=X[e];delete X[e].channels,delete X[e].labels,Object.defineProperty(X[e],"channels",{value:t}),Object.defineProperty(X[e],"labels",{value:r})}X.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=o-i,a,c;switch(o){case i:{a=0;break}case t:{a=(r-n)/s;break}case r:{a=2+(n-t)/s;break}case n:{a=4+(t-r)/s;break}}a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+o)/2;return o===i?c=0:l<=.5?c=s/(o+i):c=s/(2-o-i),[a,c*100,l*100]};X.rgb.hsv=function(e){let t,r,n,i,o,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),u=l-Math.min(s,a,c),h=function(d){return(l-d)/6/u+1/2};if(u===0)i=0,o=0;else{switch(o=u/l,t=h(s),r=h(a),n=h(c),l){case s:{i=n-r;break}case a:{i=1/3+t-n;break}case c:{i=2/3+r-t;break}}i<0?i+=1:i>1&&(i-=1)}return[i*360,o*100,l*100]};X.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],i=X.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[i,o*100,n*100]};X.rgb.oklab=function(e){let t=Tl(e[0]/255),r=Tl(e[1]/255),n=Tl(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),o=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),s=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n),a=.2104542553*i+.793617785*o-.0040720468*s,c=1.9779984951*i-2.428592205*o+.4505937099*s,l=.0259040371*i+.7827717662*o-.808675766*s;return[a*100,c*100,l*100]};X.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n),o=(1-t-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function ZG(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}X.rgb.keyword=function(e){let t=k3[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(io)){let o=io[i],s=ZG(e,o);s<r&&(r=s,n=i)}return n};X.keyword.rgb=function(e){return[...io[e]]};X.rgb.xyz=function(e){let t=Tl(e[0]/255),r=Tl(e[1]/255),n=Tl(e[2]/255),i=t*.4124564+r*.3575761+n*.1804375,o=t*.2126729+r*.7151522+n*.072175,s=t*.0193339+r*.119192+n*.9503041;return[i*100,o*100,s*100]};X.rgb.lab=function(e){let t=X.rgb.xyz(e),r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>No?r**(1/3):7.787*r+16/116,n=n>No?n**(1/3):7.787*n+16/116,i=i>No?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};X.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i,o;if(r===0)return o=n*255,[o,o,o];let s=n<.5?n*(1+r):n+r-n*r,a=2*n-s,c=[0,0,0];for(let l=0;l<3;l++)i=t+1/3*-(l-1),i<0&&i++,i>1&&i--,6*i<1?o=a+(s-a)*6*i:2*i<1?o=s:3*i<2?o=a+(s-a)*(2/3-i)*6:o=a,c[l]=o*255;return c};X.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[t,a*100,s*100]};X.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),s=255*n*(1-r),a=255*n*(1-r*o),c=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};X.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[t,o*100,s*100]};X.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*t),a=1-n;o=6*t-s,(s&1)!==0&&(o=1-o);let c=r+o*(a-r),l,u,h;switch(s){default:case 6:case 0:{l=a,u=c,h=r;break}case 1:{l=c,u=a,h=r;break}case 2:{l=r,u=a,h=c;break}case 3:{l=r,u=c,h=a;break}case 4:{l=c,u=r,h=a;break}case 5:{l=a,u=r,h=c;break}}return[l*255,u*255,h*255]};X.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100,o=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};X.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i,o,s;return i=t*3.2404542+r*-1.5371385+n*-.4985314,o=t*-.969266+r*1.8760108+n*.041556,s=t*.0556434+r*-.2040259+n*1.0572252,i=El(i),o=El(o),s=El(s),[i*255,o*255,s*255]};X.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>No?t**(1/3):7.787*t+16/116,r=r>No?r**(1/3):7.787*r+16/116,n=n>No?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(t-r),s=200*(r-n);return[i,o,s]};X.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*r-.1288597137*n),o=Math.cbrt(.0329845436*t+.9293118715*r+.0361456387*n),s=Math.cbrt(.0482003018*t+.2643662691*r+.633851707*n),a=.2104542553*i+.793617785*o-.0040720468*s,c=1.9779984951*i-2.428592205*o+.4505937099*s,l=.0259040371*i+.7827717662*o-.808675766*s;return[a*100,c*100,l*100]};X.oklab.oklch=function(e){return X.lab.lch(e)};X.oklab.xyz=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(.999999998*t+.396337792*r+.215803758*n)**3,o=(1.000000008*t-.105561342*r-.063854175*n)**3,s=(1.000000055*t-.089484182*r-1.291485538*n)**3,a=1.227013851*i-.55779998*o+.281256149*s,c=-.040580178*i+1.11225687*o-.071676679*s,l=-.076381285*i-.421481978*o+1.58616322*s;return[a*100,c*100,l*100]};X.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(t+.3963377774*r+.2158037573*n)**3,o=(t-.1055613458*r-.0638541728*n)**3,s=(t-.0894841775*r-1.291485548*n)**3,a=El(4.0767416621*i-3.3077115913*o+.2309699292*s),c=El(-1.2684380046*i+2.6097574011*o-.3413193965*s),l=El(-.0041960863*i-.7034186147*o+1.707614701*s);return[a*255,c*255,l*255]};X.oklch.oklab=function(e){return X.lch.lab(e)};X.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],i,o,s;o=(t+16)/116,i=r/500+o,s=o-n/200;let a=o**3,c=i**3,l=s**3;return o=a>No?a:(o-16/116)/7.787,i=c>No?c:(i-16/116)/7.787,s=l>No?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};X.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[t,s,i]};X.lch.lab=function(e){let t=e[0],r=e[1],i=e[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[t,o,s]};X.rgb.ansi16=function(e,t=null){let[r,n,i]=e,o=t===null?X.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};X.hsv.ansi16=function(e){return X.rgb.ansi16(X.hsv.rgb(e),e[2])};X.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t>>4===r>>4&&r>>4===n>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};X.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(Math.trunc(e>50)+1)*.5,n=(t&1)*r*255,i=(t>>1&1)*r*255,o=(t>>2&1)*r*255;return[n,i,o]};X.ansi256.rgb=function(e){if(e=e[0],e>=232){let o=(e-232)*10+8;return[o,o,o]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[r,n,i]};X.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};X.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=[...r].map(a=>a+a).join(""));let n=Number.parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};X.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),s=i-o,a,c=s<1?o/(1-s):0;return s<=0?a=0:i===t?a=(r-n)/s%6:i===r?a=2+(n-t)/s:a=4+(t-r)/s,a/=6,a%=1,[a*360,s*100,c*100]};X.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],n*100,i*100]};X.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],n*100,i*100]};X.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=t%1*6,s=o%1,a=1-s,c=0;switch(Math.floor(o)){case 0:{i[0]=1,i[1]=s,i[2]=0;break}case 1:{i[0]=a,i[1]=1,i[2]=0;break}case 2:{i[0]=0,i[1]=1,i[2]=s;break}case 3:{i[0]=0,i[1]=a,i[2]=1;break}case 4:{i[0]=s,i[1]=0,i[2]=1;break}default:i[0]=1,i[1]=0,i[2]=a}return c=(1-r)*n,[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};X.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),i=0;return n>0&&(i=t/n),[e[0],i*100,n*100]};X.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],i*100,n*100]};X.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};X.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,i=n-t,o=0;return i<1&&(o=(n-i)/(1-i)),[e[0],i*100,o*100]};X.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};X.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};X.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};X.gray.hsl=function(e){return[0,0,e[0]]};X.gray.hsv=X.gray.hsl;X.gray.hwb=function(e){return[0,100,e[0]]};X.gray.cmyk=function(e){return[0,0,0,e[0]]};X.gray.lab=function(e){return[e[0],0,0]};X.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n};X.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function JG(){let e={},t=Object.keys(Qa);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function QG(e){let t=JG(),r=[e];for(t[e].distance=0;r.length>0;){let n=r.pop(),i=Object.keys(Qa[n]);for(let{length:o}=i,s=0;s<o;s++){let a=i[s],c=t[a];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(a))}}return t}function ek(e,t){return function(r){return t(e(r))}}function tk(e,t){let r=[t[e].parent,e],n=Qa[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=ek(Qa[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}function rk(e){let t=QG(e),r={},n=Object.keys(t);for(let{length:i}=n,o=0;o<i;o++){let s=n[o];t[s].parent!==null&&(r[s]=tk(s,t))}return r}var nk=rk,vl={},ik=Object.keys(Qa);function ok(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function sk(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=e(r);if(typeof i=="object")for(let{length:o}=i,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}for(let e of ik){vl[e]={},Object.defineProperty(vl[e],"channels",{value:Qa[e].channels}),Object.defineProperty(vl[e],"labels",{value:Qa[e].labels});let t=nk(e),r=Object.keys(t);for(let n of r){let i=t[n];vl[e][n]=sk(i),vl[e][n].raw=ok(i)}}var Dn=vl,U3=["keyword","gray","hex"],gg={};for(let e of Object.keys(Dn))gg[[...Dn[e].labels].sort().join("")]=e;var yg={};function br(e,t){if(!(this instanceof br))return new br(e,t);if(t&&t in U3&&(t=null),t&&!(t in Dn))throw new Error("Unknown model: "+t);let r,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof br)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){let i=Ml.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Dn[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Dn[this.model].channels;let i=Array.prototype.slice.call(e,0,n);this.color=bg(i,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(e);"alpha"in e&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);let o=i.sort().join("");if(!(o in gg))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=gg[o];let{labels:s}=Dn[this.model],a=[];for(r=0;r<s.length;r++)a.push(e[s[r]]);this.color=bg(a)}if(yg[this.model])for(n=Dn[this.model].channels,r=0;r<n;r++){let i=yg[this.model][r];i&&(this.color[r]=i(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}br.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in Ml.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return Ml.to[t.model](...r)},percentString(e){let t=this.rgb().round(typeof e=="number"?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return Ml.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Dn[this.model],{labels:r}=Dn[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new br([...this.color.map(ck(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new br([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:qt("rgb",0,lr(255)),green:qt("rgb",1,lr(255)),blue:qt("rgb",2,lr(255)),hue:qt(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:qt("hsl",1,lr(100)),lightness:qt("hsl",2,lr(100)),saturationv:qt("hsv",1,lr(100)),value:qt("hsv",2,lr(100)),chroma:qt("hcg",1,lr(100)),gray:qt("hcg",2,lr(100)),white:qt("hwb",1,lr(100)),wblack:qt("hwb",2,lr(100)),cyan:qt("cmyk",0,lr(100)),magenta:qt("cmyk",1,lr(100)),yellow:qt("cmyk",2,lr(100)),black:qt("cmyk",3,lr(100)),x:qt("xyz",0,lr(95.047)),y:qt("xyz",1,lr(100)),z:qt("xyz",2,lr(108.833)),l:qt("lab",0,lr(100)),a:qt("lab",1),b:qt("lab",2),keyword(e){return e!==void 0?new br(e):Dn[this.model].keyword(this.color)},hex(e){return e!==void 0?new br(e):Ml.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new br(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),Ml.to.hex(...t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[r,n]of e.entries()){let i=n/255;t[r]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return br.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let r=e.rgb(),n=this.rgb(),i=t===void 0?.5:t,o=2*i-1,s=r.alpha()-n.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,c=1-a;return br.rgb(a*r.red()+c*n.red(),a*r.green()+c*n.green(),a*r.blue()+c*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(let e of Object.keys(Dn)){if(U3.includes(e))continue;let{channels:t}=Dn[e];br.prototype[e]=function(...r){return this.model===e?new br(this):r.length>0?new br(r,e):new br([...lk(Dn[this.model][e].raw(this.color)),this.valpha],e)},br[e]=function(...r){let n=r[0];return typeof n=="number"&&(n=bg(r,t)),new br(n,e)}}function ak(e,t){return Number(e.toFixed(t))}function ck(e){return function(t){return ak(t,e)}}function qt(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(yg[n]||=[])[t]=r;return e=e[0],function(n){let i;return n!==void 0?(r&&(n=r(n)),i=this[e](),i.color[t]=n,i):(i=this[e]().color[t],r&&(i=r(i)),i)}}function lr(e){return function(t){return Math.max(0,Math.min(e,t))}}function lk(e){return Array.isArray(e)?e:[e]}function bg(e,t){for(let r=0;r<t;r++)typeof e[r]!="number"&&(e[r]=0);return e}var uk=br});var V3=ae((IZ,q3)=>{q3.exports=z3().default});function fk(e){return this._setBackgroundColourOption("tint",e),this}function hk(e){return this.options.greyscale=f.bool(e)?e:!0,this}function dk(e){return this.greyscale(e)}function mk(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function pk(e){return this.pipelineColourspace(e)}function gk(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function yk(e){return this.toColourspace(e)}function $3(e){if(f.object(e)||f.string(e)&&e.length>=3&&e.length<=200){let t=(0,H3.default)(e),r=t.red(),n=t.green(),i=t.blue(),o=Math.round(t.alpha()*255);for(let[s,a]of[["red",r],["green",n],["blue",i],["alpha",o]])if(!f.number(a))throw f.invalidParameterError(`background.${s}`,"number",a);return[r,n,i,o]}else throw f.invalidParameterError("background","object or string",e)}function bk(e,t){f.defined(t)&&(this.options[e]=$3(t))}var H3,W3,K3,X3=p(()=>{H3=me(V3(),1);Ji();W3={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};K3=e=>{Object.assign(e.prototype,{tint:fk,greyscale:hk,grayscale:dk,pipelineColourspace:mk,pipelineColorspace:pk,toColourspace:gk,toColorspace:yk,_getBackgroundColourOption:$3,_setBackgroundColourOption:bk}),e.colourspace=W3,e.colorspace=W3}});function xk(){return this.options.removeAlpha=!0,this}function _k(e){if(f.defined(e))if(f.number(e)&&f.inRange(e,0,1))this.options.ensureAlpha=e;else throw f.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function Sk(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e)&&(e=t[e]),f.integer(e)&&f.inRange(e,0,4))this.options.extractChannel=e;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function Mk(e,t){return Array.isArray(e)?e.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(e,t)),this}function vk(e){if(f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw f.invalidParameterError("boolOp","one of: and, or, eor",e);return this}var wk,Y3,Z3=p(()=>{Ji();wk={and:"and",or:"or",eor:"eor"};Y3=e=>{Object.assign(e.prototype,{removeAlpha:xk,ensureAlpha:_k,extractChannel:Sk,joinChannel:Mk,bandbool:vk}),e.bool=wk}});function Tk(e,t){let r;if(f.string(e)?f.string(this.options.input.file)&&Cd.default.resolve(this.options.input.file)===Cd.default.resolve(e)?r=new Error("Cannot use same file for input and output"):Ek.test(Cd.default.extname(e))&&!this.constructor.format.jp2.output.file&&(r=Q3()):r=new Error("Missing output file path"),r)if(f.fn(t))t(r);else return Promise.reject(r);else{this.options.fileOut=e;let n=Error();return this._pipeline(t,n)}return this}function Ak(e,t){f.object(e)?this._setBooleanOption("resolveWithObject",e.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let r=Error();return this._pipeline(f.fn(e)?e:t,r)}function Ik(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function Pk(e){if(f.number(e)&&e>0)this.options.withMetadataDensity=e;else throw f.invalidParameterError("density","positive number",e);return this.keepExif()}function Rk(){return this.options.keepMetadata|=1,this}function Lk(e){if(f.object(e))for(let[t,r]of Object.entries(e))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${t.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${t}.${n}`,"string",i);else throw f.invalidParameterError(t,"object",r);else throw f.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function Ok(e){return this.withExif(e),this.options.withExifMerge=!0,this}function Bk(){return this.options.keepMetadata|=8,this}function Ck(e,t){if(f.string(e))this.options.withIccProfile=e;else throw f.invalidParameterError("icc","string",e);if(this.keepIccProfile(),f.object(t)&&f.defined(t.attach))if(f.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw f.invalidParameterError("attach","boolean",t.attach);return this}function Dk(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function Nk(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function Fk(){return this.options.keepMetadata|=2,this}function Gk(e){if(f.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",e);return this}function kk(){return this.options.keepMetadata|=31,this}function Uk(e){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(e)){if(f.defined(e.orientation))if(f.integer(e.orientation)&&f.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(f.defined(e.density))if(f.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw f.invalidParameterError("density","positive number",e.density);f.defined(e.icc)&&this.withIccProfile(e.icc),f.defined(e.exif)&&this.withExifMerge(e.exif)}return this}function jk(e,t){let r=J3.get((f.object(e)&&f.string(e.id)?e.id:e).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...J3.keys()].join(", ")}`,e);return this[r](t)}function zk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.progressive)&&this._setBooleanOption("jpegProgressive",e.progressive),f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=f.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(f.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),f.defined(e.mozjpeg))if(f.bool(e.mozjpeg))e.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw f.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=f.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;f.defined(r)&&this._setBooleanOption("jpegTrellisQuantisation",r),f.defined(e.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let n=f.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;f.defined(n)&&(this._setBooleanOption("jpegOptimiseScans",n),n&&(this.options.jpegProgressive=!0));let i=f.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(f.defined(i))if(f.integer(i)&&f.inRange(i,0,8))this.options.jpegQuantisationTable=i;else throw f.invalidParameterError("quantisationTable","integer between 0 and 8",i)}return this._updateFormatOut("jpeg",e)}function qk(e){if(f.object(e)){if(f.defined(e.progressive)&&this._setBooleanOption("pngProgressive",e.progressive),f.defined(e.compressionLevel))if(f.integer(e.compressionLevel)&&f.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);f.defined(e.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.pngBitdepth=ev(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.palette)?this._setBooleanOption("pngPalette",e.palette):[e.quality,e.effort,e.colours,e.colors,e.dither].some(f.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",e.quality);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function Vk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.alphaQuality))if(f.integer(e.alphaQuality)&&f.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(f.defined(e.lossless)&&this._setBooleanOption("webpLossless",e.lossless),f.defined(e.nearLossless)&&this._setBooleanOption("webpNearLossless",e.nearLossless),f.defined(e.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",e.smartSubsample),f.defined(e.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",e.smartDeblock),f.defined(e.preset))if(f.string(e.preset)&&f.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",e.effort);f.defined(e.minSize)&&this._setBooleanOption("webpMinSize",e.minSize),f.defined(e.mixed)&&this._setBooleanOption("webpMixed",e.mixed),f.defined(e.exact)&&this._setBooleanOption("webpExact",e.exact)}return xg(e,this.options),this._updateFormatOut("webp",e)}function Wk(e){if(f.object(e)){f.defined(e.reuse)&&this._setBooleanOption("gifReuse",e.reuse),f.defined(e.progressive)&&this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.gifBitdepth=ev(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(f.defined(e.interFrameMaxError))if(f.number(e.interFrameMaxError)&&f.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(f.defined(e.interPaletteMaxError))if(f.number(e.interPaletteMaxError)&&f.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(f.defined(e.keepDuplicateFrames))if(f.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return xg(e,this.options),this._updateFormatOut("gif",e)}function Hk(e){if(!this.constructor.format.jp2.output.buffer)throw Q3();if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function xg(e,t){if(f.object(e)&&f.defined(e.loop))if(f.integer(e.loop)&&f.inRange(e.loop,0,65535))t.loop=e.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(f.object(e)&&f.defined(e.delay))if(f.integer(e.delay)&&f.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&f.inRange(e.delay.length,1,1e6)&&e.delay.every(f.integer)&&e.delay.every(r=>f.inRange(r,0,65535)))t.delay=e.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function $k(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[1,2,4]))this.options.tiffBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",e.bitdepth);if(f.defined(e.tile)&&this._setBooleanOption("tiffTile",e.tile),f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.tiffTileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.tiffTileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.miniswhite)&&this._setBooleanOption("tiffMiniswhite",e.miniswhite),f.defined(e.pyramid)&&this._setBooleanOption("tiffPyramid",e.pyramid),f.defined(e.xres))if(f.number(e.xres)&&f.inRange(e.xres,.001,1e6))this.options.tiffXres=e.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",e.xres);if(f.defined(e.yres))if(f.number(e.yres)&&f.inRange(e.yres,.001,1e6))this.options.tiffYres=e.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",e.yres);if(f.defined(e.compression))if(f.string(e.compression)&&f.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(f.defined(e.bigtiff)&&this._setBooleanOption("tiffBigtiff",e.bigtiff),f.defined(e.predictor))if(f.string(e.predictor)&&f.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(f.defined(e.resolutionUnit))if(f.string(e.resolutionUnit)&&f.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function Kk(e){return this.heif({...e,compression:"av1"})}function Xk(e){if(f.object(e)){if(f.string(e.compression)&&f.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",e.compression);if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.heifLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",e.effort);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[8,10,12]))this.options.heifBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth);if(f.defined(e.tune))if(f.string(e.tune)&&f.inArray(e.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&e.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=e.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",e.tune)}else throw f.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function Yk(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?.1+(100-e.quality)*.09:53/3e3*e.quality*e.quality-23/20*e.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(f.defined(e.distance))if(f.number(e.distance)&&f.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(f.defined(e.decodingTier))if(f.integer(e.decodingTier)&&f.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",e.effort)}return xg(e,this.options),this._updateFormatOut("jxl",e)}function Zk(e){if(f.object(e)&&f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth);return this._updateFormatOut("raw")}function Jk(e){if(f.object(e)){if(f.defined(e.size))if(f.integer(e.size)&&f.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw f.invalidParameterError("size","integer between 1 and 8192",e.size);if(f.defined(e.overlap))if(f.integer(e.overlap)&&f.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(f.defined(e.container))if(f.string(e.container)&&f.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw f.invalidParameterError("container","one of: fs, zip",e.container);if(f.defined(e.layout))if(f.string(e.layout)&&f.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(f.defined(e.angle))if(f.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(f.defined(e.skipBlanks))if(f.integer(e.skipBlanks)&&f.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else f.defined(e.layout)&&e.layout==="google"&&(this.options.tileSkipBlanks=5);let t=f.bool(e.center)?e.center:e.centre;if(f.defined(t)&&this._setBooleanOption("tileCentre",t),f.defined(e.id))if(f.string(e.id))this.options.tileId=e.id;else throw f.invalidParameterError("id","string",e.id);if(f.defined(e.basename))if(f.string(e.basename))this.options.tileBasename=e.basename;else throw f.invalidParameterError("basename","string",e.basename)}if(f.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw f.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function Qk(e){if(!f.plainObject(e))throw f.invalidParameterError("options","object",e);if(f.integer(e.seconds)&&f.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function eU(e,t){return f.object(t)&&t.force===!1||(this.options.formatOut=e),this}function tU(e,t){if(f.bool(t))this.options[e]=t;else throw f.invalidParameterError(e,"boolean",t)}function rU(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function nU(e,t){return typeof e=="function"?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)})}):nt.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)}),this):this.options.streamOut?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,t)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))})}):nt.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,t)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),nt.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}):new Promise((r,n)=>{nt.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}var Cd,J3,Ek,Q3,ev,tv,rv=p(()=>{Cd=me(require("node:path"),1);Ji();gf();J3=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),Ek=/\.(jp[2x]|j2[kc])$/i,Q3=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),ev=e=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1);tv=e=>{Object.assign(e.prototype,{toFile:Tk,toBuffer:Ak,toUint8Array:Ik,withDensity:Pk,keepExif:Rk,withExif:Lk,withExifMerge:Ok,keepIccProfile:Bk,withIccProfile:Ck,keepGainMap:Dk,withGainMap:Nk,keepXmp:Fk,withXmp:Gk,keepMetadata:kk,withMetadata:Uk,toFormat:jk,jpeg:zk,jp2:Hk,png:qk,webp:Vk,tiff:$k,avif:Kk,heif:Xk,jxl:Yk,gif:Wk,raw:Zk,tile:Jk,timeout:Qk,_updateFormatOut:eU,_setBooleanOption:tU,_read:rU,_pipeline:nU})}});function av(e){if(f.bool(e))return e?nt.cache(50,20,100):nt.cache(0,0,0);if(f.object(e)){for(let t of["memory","files","items"]){let r=e[t];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(t,"a positive integer",r)}return nt.cache(e.memory,e.files,e.items)}else return nt.cache()}function oU(e){return nt.concurrency(f.integer(e)?e:null)}function aU(){return nt.counters()}function cU(e){return nt.simd(f.bool(e)?e:null)}function lU(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))nt.block(e.operation,!0);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}function uU(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))nt.block(e.operation,!1);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}var iv,ov,sv,yf,fU,_g,nv,Sg,Is,iU,Al,sU,cv,lv=p(()=>{iv=me(require("node:events"),1),ov=require("node:module"),sv=require("node:os"),yf=me(pd(),1);Ji();fg();gf();Id();fU={};_g=(0,ov.createRequire)(fU.url),nv=Pd.runtimePlatformArch(),Sg=nt.libvipsVersion(),Is=nt.format();Is.heif.output.alias=["avif","heic"];Is.jpeg.output.alias=["jpe","jpg"];Is.tiff.output.alias=["tif"];Is.jp2.output.alias=["j2c","j2k","jp2","jpx"];iU={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},Al={vips:Sg.semver};if(!Sg.isGlobal)if(Sg.isWasm)try{Al=_g("@img/sharp-wasm32/versions")}catch{}else try{Al=_g(`@img/sharp-${nv}/versions`)}catch{try{Al=_g(`@img/sharp-libvips-${nv}/versions`)}catch{}}Al.sharp=Co.version;Al.heif&&Is.heif&&(Is.heif.input.fileSuffix=[".avif"],Is.heif.output.alias=["avif"]);av(!0);!process.env.MALLOC_ARENA_MAX&&yf.default.familySync()===yf.default.GLIBC&&!nt._isUsingJemalloc()?nt.concurrency(1):yf.default.familySync()===yf.default.MUSL&&nt.concurrency()===1024&&nt.concurrency((0,sv.availableParallelism)());sU=new iv.default.EventEmitter;cv=e=>{e.cache=av,e.concurrency=oU,e.counters=aU,e.simd=cU,e.format=Is,e.interpolators=iU,e.versions=Al,e.queue=sU,e.block=lU,e.unblock=uU}});var uv={};Jt(uv,{default:()=>hU});var hU,fv=p(()=>{S3();E3();L3();B3();N3();X3();Z3();rv();lv();v3(no);R3(no);O3(no);D3(no);K3(no);Y3(no);tv(no);cv(no);hU=no});async function Pl(e,t,r,n){return n._parse(e,t,r,n)}var vv=p(()=>{"use strict"});function Rl(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Ev=p(()=>{"use strict"});var oo,xU,_U,SU,MU,Xd,Tv,vU,Av=p(()=>{"use strict";oo={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},xU=oo.self||oo.window||oo.global||{},_U=oo.window||oo.self||oo.global||{},SU=oo.global||oo.self||oo.window||{},MU=oo.document||{},Xd=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),Tv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),vU=Tv&&parseFloat(Tv[1])||0});function Ll(e,t){return new Promise((r,n)=>{let i=!1;function o(a){i||(i=!0,n(a))}function s(a){if(!i){i=!0;try{r(t(a))}catch(c){n(c)}}}try{let a=e(s,o);a==null||a.then(s,o)}catch(a){o(a)}})}var Iv=p(()=>{"use strict"});function Og(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Bg(e){var r,n;return((n=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:n[e])||null}var Cg=p(()=>{"use strict"});function EU(){let e="5.0.0-beta.4";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=e,e}var Pv,Rv=p(()=>{"use strict";Pv=EU()});function Lv(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Ov=p(()=>{"use strict"});var so,YJ,ZJ,JJ,QJ,Pi,tc,eQ,Bv,tQ,Dg=p(()=>{"use strict";so={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},YJ=so.self||so.window||so.global||{},ZJ=so.window||so.self||so.global||{},JJ=so.global||so.self||so.window||{},QJ=so.document||{},Pi=typeof process!="object"||String(process)!=="[object process]"||process.browser,tc=typeof importScripts=="function",eQ=typeof window<"u"&&typeof window.orientation<"u",Bv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),tQ=Bv&&parseFloat(Bv[1])||0});var Ng,Cv,Dv=p(()=>{Ng=require("worker_threads"),Cv=Ng.parentPort});function Fg(e,t=!0,r){let n=r||new Set,i=new Set;function o(s){if(!(!s||typeof s!="object"||i.has(s))){if(i.add(s),Nv(s))n.add(s);else if(ArrayBuffer.isView(s))Nv(s.buffer)&&n.add(s.buffer);else if(t&&typeof MessageChannel<"u"&&s instanceof MessageChannel)o(s.port1),o(s.port2);else if(t&&s instanceof Map)for(let[a,c]of s)o(a),o(c);else if(t&&s instanceof Set)for(let a of s)o(a);else if(t)for(let a of Object.keys(s))o(s[a])}}return o(e),r===void 0?Array.from(n):[]}function Nv(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var Fv=p(()=>{});async function Ol(){return Cv}function TU(e){if(!e||typeof e!="object")return null;let t="data"in e&&e.type==="message"?e.data:e;return t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")?t:null}var Yd,Qt,Gg=p(()=>{Fv();Dv();Yd=new Map,Qt=class{static async inWorkerThread(){let t=globalThis.WorkerGlobalScope;return typeof t=="function"&&globalThis instanceof t||!!await Ol()}static set onmessage(t){async function r(n){let i=await Ol(),{type:o,payload:s}=i?n:n.data;t(o,s)}Ol().then(n=>{n?(n.on("message",i=>{r(i)}),n.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r})}static async addEventListener(t){let r=Yd.get(t);r||(r=i=>{let o=TU(i);o&&t(o.type,o.payload)},Yd.set(t,r));let n=await Ol();n?n.on("message",r):globalThis.addEventListener("message",r)}static async removeEventListener(t){let r=Yd.get(t);if(Yd.delete(t),!r)return;let n=await Ol();n?n.off("message",r):globalThis.removeEventListener("message",r)}static async postMessage(t,r,n=!1){let i={source:"loaders.gl",type:t,payload:r},o=n?[]:Fg(r),s=await Ol();s?s.postMessage(i,o):globalThis.postMessage(i,o)}}});var Bl,Gv=p(()=>{Bl=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(t){return this.enqueue(t)}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let r=this._settlers.shift();t instanceof Error?r.reject(t):r.resolve({value:t})}else this._values.push(t)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let t=this._values.shift();return t instanceof Error?Promise.reject(t):Promise.resolve({done:!1,value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((t,r)=>{this._settlers.push({resolve:t,reject:r})})}}});var Zd,kv=p(()=>{Zd=class{constructor(t){if(typeof SharedArrayBuffer>"u"||!(t instanceof SharedArrayBuffer)||t.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=t,this.values=new Int32Array(t)}get snapshot(){return{cancelled:Atomics.load(this.values,0)!==0,completed:Atomics.load(this.values,1),total:Atomics.load(this.values,2),revision:Atomics.load(this.values,3)}}cancel(){Atomics.store(this.values,0,1),Atomics.add(this.values,3,1),Atomics.notify(this.values,0)}throwIfCancelled(){if(Atomics.load(this.values,0)!==0){let t=new Error("Shared worker task was cancelled");throw t.name="AbortError",t}}setProgress(t,r=-1){if(!Number.isInteger(t)||t<0||t>2147483647||!Number.isInteger(r)||r<-1||r>2147483647)throw new RangeError("Shared progress requires nonnegative int32 counts (or total -1)");Atomics.store(this.values,1,t),Atomics.store(this.values,2,r),Atomics.add(this.values,3,1)}}});function kg(e){if(e!==void 0&&e!=="copy"&&e!=="transfer")throw new Error("Invalid worker output ownership")}var Uv=p(()=>{});async function Ug(e,t,r){if(!await Qt.inWorkerThread())return;let n={process:PU};Qt.onmessage=async(i,o)=>{var d,m,g,y,b;if(i==="cancel"){ko==null||ko.abort(),Go==null||Go.close(),rc==null||rc.close();return}let s=i==="process"||i==="process-in-batches"?new AbortController:void 0;s&&(ko=s);let a=performance.now(),c=i==="process"||i==="process-in-batches"?RU():void 0,l,u=()=>{s==null||s.signal.throwIfAborted(),l==null||l.throwIfCancelled()},h={...n,signal:s==null?void 0:s.signal,sharedState:l,throwIfAborted:u,reportProgress:w=>{!(s!=null&&s.signal.aborted)&&!(l!=null&&l.snapshot.cancelled)&&(c==null||c.report(w))}};try{switch(s&&((d=o.options)!=null&&d.sharedState)&&(l=new Zd(o.options.sharedState),h.sharedState=l),i){case"preload":await(r==null?void 0:r()),Qt.postMessage("done",{});break;case"process":if(u(),kg((m=o.options)==null?void 0:m.outputOwnership),!e)throw new Error("Worker does not support atomic processing");let w=await e(o.input,o.options||{},h,o.context||{});u(),c==null||c.finish(),await Qt.postMessage("done",{result:w,executionMs:performance.now()-a},((g=o.options)==null?void 0:g.outputOwnership)==="copy");break;case"process-in-batches":if(u(),kg((y=o.options)==null?void 0:y.outputOwnership),!t)throw new Error("Worker does not support batched processing");let _=new Bl,S=new Bl;Go=_,rc=S;try{let v=t(IU(_),o.options||{},h,o.context||{});for await(let T of v)u(),await Qt.postMessage("output-batch",{result:T},((b=o.options)==null?void 0:b.outputOwnership)==="copy"),await S.next();u(),c==null||c.finish(),await Qt.postMessage("done",{executionMs:performance.now()-a})}finally{Go=null,rc=null}break;case"input-batch":if(!Go)throw new Error("Worker has no active batched processing session");Go.push(o.input);break;case"input-done":if(!Go)throw new Error("Worker has no active batched processing session");Go.close();break;case"output-ack":if(!rc)throw new Error("Worker has no active batched processing session");rc.push(void 0);break;default:}}catch(w){c==null||c.finish((s==null?void 0:s.signal.aborted)||(l==null?void 0:l.snapshot.cancelled));let _=w instanceof Error?w.message:"";await Qt.postMessage("error",{error:_,errorName:w instanceof Error?w.name:"Error"})}finally{s&&ko===s&&(ko=null)}},await Qt.postMessage("ready",{})}async function*IU(e){for(;;){await Qt.postMessage("input-request",{});let t=await e.next();if(t.done)return;yield t.value}}function PU(e,t={},r={}){let n=ko==null?void 0:ko.signal;return n==null||n.throwIfAborted(),new Promise((i,o)=>{let s=AU++,a=()=>{n==null||n.removeEventListener("abort",c),Qt.removeEventListener(l)},c=()=>{a(),o(n==null?void 0:n.reason)},l=(u,h)=>{h.id===s&&(u==="done"?(a(),i(h.result)):u==="error"&&(a(),o(h.error)))};Qt.addEventListener(l).then(async()=>{if(n!=null&&n.aborted){c();return}n==null||n.addEventListener("abort",c,{once:!0}),await Qt.postMessage("process",{id:s,input:e,options:t,context:r})}).catch(u=>{a(),o(u)})})}function RU(){let e,t=!1,r=!1,n=()=>{r=!1,e&&(Qt.postMessage("progress",{progress:e}),e=void 0)};return{report(i){t||(e&&e.phase!==i.phase&&n(),e={...i},r||(r=!0,setTimeout(n,0)))},finish(i=!1){i&&(e=void 0),n(),t=!0}}}var AU,ko,Go,rc,jv=p(()=>{kv();Gv();Gg();Uv();AU=0,ko=null,Go=null,rc=null});var LU,jg,gQ,zv=p(()=>{Gg();jv();LU={},jg=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",gQ=jg?`file://${jg.startsWith("/")?"":"/"}${encodeURI(jg).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:LU.url});function qg(e,t){if(!e.preload)return Promise.resolve();let r=zg.get(e);return r||(r=Promise.resolve().then(()=>e.preload()).then(()=>{OU.add(e)}),zg.set(e,r),r.catch(()=>zg.delete(e))),BU(r,t)}function BU(e,t){return t?new Promise((r,n)=>{let i=()=>{t.removeEventListener("abort",i),n(t.reason)};t.addEventListener("abort",i,{once:!0}),t.aborted&&i(),e.then(o=>{t.removeEventListener("abort",i),r(o)},o=>{t.removeEventListener("abort",i),n(o)})}):e}var zg,OU,qv=p(()=>{zg=new WeakMap,OU=new WeakSet});function wf(e){if(!e||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError("Task payloads must be plain objects with named fields")}function Vg(e,t={}){let r=t.signal??new AbortController().signal;return{state:e,signal:r,throwIfAborted:()=>{var n;r.throwIfAborted(),(n=t.throwIfAborted)==null||n.call(t)},reportProgress:n=>{var i;return(i=t.reportProgress)==null?void 0:i.call(t,{...n,phase:n.phase??"process",unit:n.unit??"items"})}}}async function Hg(e){if(!await Qt.inWorkerThread())throw new Error("initializeTaskWorker must run inside a worker");if(Vv)throw new Error("A task is already installed in this worker");Vv=!0;let t=new Wg(e),r={};return Ug(async(n,i,o)=>{switch(n.operation){case"initialize":return t.initialize(n.input,o);case"destroy":return t.destroy();case"stream-options":return r=n.options,{};case"process":return t.process(n.input,n.options,o);default:throw new Error("Unknown task operation")}},async function*(n,i,o){async function*s(){for await(let a of n)wf(a),yield a}try{yield*t.stream(s(),r,o)}finally{r={}}},()=>qg(e))}var Wg,Vv,Wv=p(()=>{zv();qv();Wg=class{constructor(t){this.task=t,this.initialized=!1}async initialize(t,r={}){var n,i,o;if(this.initialized)throw new Error("Task is already initialized");return wf(t),await qg(this.task,r.signal),(n=r.signal)==null||n.throwIfAborted(),this.state=await((o=(i=this.task).initialize)==null?void 0:o.call(i,t,Vg(void 0,r))),this.initialized=!0,{}}async destroy(){var t,r;if(this.initialized){this.initialized=!1;let n=this.state;this.state=void 0,this.task.initialize&&await((r=(t=this.task).destroy)==null?void 0:r.call(t,n))}return{}}async process(t,r,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.process)throw new Error("Task has no atomic processor");wf(t);let i=await this.task.process(t,r,Vg(this.state,n));return wf(i),i}async*stream(t,r,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.processInBatches)throw new Error("Task has no streaming processor");for await(let i of this.task.processInBatches(t,r,Vg(this.state,n)))wf(i),yield i}};Vv=!1});var Hv=p(()=>{Wv()});var $v={};Jt($v,{BroadcastChannel:()=>Je.BroadcastChannel,MessageChannel:()=>Je.MessageChannel,MessagePort:()=>Je.MessagePort,NodeWorker:()=>DU,SHARE_ENV:()=>Je.SHARE_ENV,Worker:()=>Je.Worker,getEnvironmentData:()=>Je.getEnvironmentData,isInternalThread:()=>NU,isMainThread:()=>Je.isMainThread,isMarkedAsUntransferable:()=>Je.isMarkedAsUntransferable,locks:()=>GU,markAsUncloneable:()=>Je.markAsUncloneable,markAsUntransferable:()=>Je.markAsUntransferable,moveMessagePortToContext:()=>Je.moveMessagePortToContext,parentPort:()=>CU,postMessageToThread:()=>Je.postMessageToThread,receiveMessageOnPort:()=>Je.receiveMessageOnPort,resourceLimits:()=>Je.resourceLimits,setEnvironmentData:()=>Je.setEnvironmentData,structuredClone:()=>kU,threadId:()=>Je.threadId,threadName:()=>FU,workerData:()=>Je.workerData});var Nn,Je,CU,DU,NU,FU,GU,kU,Kv=p(()=>{"use strict";Nn=me(require("worker_threads"),1),Je=require("worker_threads"),CU=Nn==null?void 0:Nn.parentPort,DU=Nn.Worker,NU=Nn.isInternalThread,FU=Nn.threadName,GU=Nn.locks,kU=Nn.structuredClone});function Xv(e){return{...e,phase:e.phase??"process",unit:e.unit??"items"}}async function Yv(){var e;if(typeof self<"u"&&typeof document>"u"&&typeof self.postMessage=="function")return!0;if(typeof process<"u"&&((e=process.versions)!=null&&e.node)){let{isMainThread:t}=await Promise.resolve().then(()=>(Kv(),$v));return!t}return!1}var Zv,Jv=p(()=>{"use strict";Hv();Zv=Hg});function $g(e,t=!0,r){let n=r||new Set;if(e){if(Qv(e))n.add(e);else if(Qv(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let i in e)$g(e[i],t,n)}}return r===void 0?Array.from(n):[]}function Qv(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var eE=p(()=>{"use strict"});async function Kg(e,t){await Yv()&&await Zv(UU(e,t))}function UU(e,t){return{id:"loaders.gl",initialize:r=>r,destroy:r=>{var n;return(n=r.port)==null?void 0:n.close()},process:async({value:r},n,i)=>{if(!e)throw new Error("Worker does not support atomic processing");return{value:await e(r,n,tE(i),i.state.context)}},...t?{processInBatches:async function*(r,n,i){async function*o(){for await(let s of r)yield s.value}for await(let s of t(o(),n,tE(i),i.state.context))yield{value:s}}}:{}}}function tE(e){let t=0,r=e.state.port;return{signal:e.signal,throwIfAborted:()=>e.throwIfAborted(),reportProgress:n=>e.reportProgress(Xv(n)),process:r?(n,i={},o={})=>{e.throwIfAborted();let s=++t;return new Promise((a,c)=>{let l=d=>{if(d.data.identifier===s)if(h(),d.data.error){let m=new Error(d.data.error.message);m.name=d.data.error.name,c(m)}else a(d.data.value)},u=()=>{h(),c(e.signal.reason)},h=()=>{r.removeEventListener("message",l),e.signal.removeEventListener("abort",u)};r.addEventListener("message",l),e.signal.addEventListener("abort",u,{once:!0}),r.start();try{let d={identifier:s,input:n,options:i,context:o};r.postMessage(d,$g(d))}catch(d){h(),c(d)}})}:void 0}}var rE=p(()=>{"use strict";Jv();eE()});function nc(e={}){var i,o;let t=e.useLocalLibraries??((i=e.core)==null?void 0:i.useLocalLibraries),r=jU(e.CDN,(o=e.core)==null?void 0:o.CDN),n=e.modules;return{...t!==void 0?{useLocalLibraries:t}:{},...r!==void 0?{CDN:r}:{},...n!==void 0?{modules:n}:{}}}function jU(e,t){if(typeof e=="string"||e===null)return e;if(typeof t=="string"||t===null)return t}async function Cl(e,t=null,r={},n=null,i=null){var a,c;let o=e;if(t){let l=n||e,u=(a=r.modules)==null?void 0:a[l];if(u!==void 0&&typeof u!="string")return u;e=Yg(e,t,r,n),o=i&&(!(typeof u=="string")||typeof((c=r.modules)==null?void 0:c[i])=="string")?Yg(i,t,r,i):e}let s=zU(e,o,tc);return Xg[s]=Xg[s]||qU(e,o),await Xg[s]}function zU(e,t,r){return r?JSON.stringify([e,t]):e}function Yg(e,t,r={},n=null){if(r!=null&&r.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||e;let i=r.modules||{};if(typeof i[n]=="string")return i[n];if(!r.useLocalLibraries&&e.startsWith("http"))return e;if(!Pi)return`modules/${t}/dist/libs/${n}`;if(r.CDN){if(typeof r.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return Lv(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Pv}/dist/libs/${n}`}return tc?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${t}/src/libs/${n}`}async function qU(e,t){if(e.endsWith("wasm"))return await HU(e);if(!Pi){let{requireFromFile:n}=globalThis.loaders||{};try{let i=await(n==null?void 0:n(e));return i||!e.includes("/dist/libs/")?i:await(n==null?void 0:n(e.replace("/dist/libs/","/src/libs/")))}catch(i){if(e.includes("/dist/libs/"))try{return await(n==null?void 0:n(e.replace("/dist/libs/","/src/libs/")))}catch{}return console.error(i),null}}if(tc)return VU(e,t);let r=await $U(e);return WU(r,e)}async function VU(e,t=e){try{importScripts()}catch{let n=await import(new URL(t,globalThis.location.href).href);return n.default??n}return importScripts(e)}function WU(e,t){let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function HU(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};if(Pi||!t||e.startsWith("http"))return await(await fetch(e)).arrayBuffer();try{return await t(e)}catch{if(e.includes("/dist/libs/"))return await t(e.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${e}`)}}async function $U(e){let{readFileAsText:t}=globalThis.loaders||{};if(Pi||!t||e.startsWith("http"))return await(await fetch(e)).text();try{return await t(e)}catch{if(e.includes("/dist/libs/"))return await t(e.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${e}`)}}var Xg,nE=p(()=>{"use strict";Dg();Ov();Rv();Xg={}});var ic=p(()=>{"use strict";Dg();rE();nE()});async function Jg(e,t=()=>e){await Kg((r,n,i,o)=>KU(t(n||{}),r,n,i,o),(r,n,i,o)=>iE(t(n||{}),r,n,i,o))}async function KU(e,t,r={},n,i={}){let o=await YU({loader:e,arrayBuffer:t,options:r,context:{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:oE(),_parse:sE(n==null?void 0:n.process)}});return e.serializeWorkerResult?e.serializeWorkerResult(o,r,i):o}async function*iE(e,t,r={},n,i={}){if(!e.parseInBatches)throw new Error(`${e.id} loader does not support batched parsing`);let o=cE(e,r),s=e.parseInBatches(t,o,{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:oE(),_parse:sE(n==null?void 0:n.process)});for await(let a of s)yield e.serializeWorkerBatch?e.serializeWorkerBatch(a,r,i):a}function oE(){let e=t=>()=>{throw new Error(`context.coreApi.${t} is unavailable inside worker loaders.`)};return{fetchFile:async(t,r)=>await fetch(t,r),parseSync:e("parseSync"),parse:e("parse"),parseFile:e("parseFile"),parseInBatches:e("parseInBatches"),load:e("load"),loadInBatches:e("loadInBatches")}}function sE(e){return(t,r,n,i)=>{if(!e)throw new Error("Worker not set up to parse on main thread");let o=XU(r,n,i);return e(t,o.options,{...o.context,...Array.isArray(r)||r&&aE(r)?{_loaderIsArray:Array.isArray(r),_loaderIds:(Array.isArray(r)?r:[r]).map(s=>s.id)}:{}})}}function XU(e,t,r){return t?{options:t,context:Zg(r)}:Array.isArray(e)||e&&aE(e)?{options:void 0,context:Zg(r)}:e&&!Array.isArray(e)?{options:e}:{options:void 0,context:Zg(r)}}function aE(e){return"id"in e&&"extensions"in e}function Zg(e){if(!e)return;let{fetch:t,loaders:r,coreApi:n,signal:i,reportProgress:o,_parse:s,_parseSync:a,_parseInBatches:c,...l}=e;return JSON.parse(JSON.stringify(l))}async function YU({loader:e,arrayBuffer:t,options:r,context:n}){let i,o;if(e.parse||e.parseSync)i=t,o=e.parse||e.parseSync;else if(e.parseTextSync)i=new TextDecoder().decode(t),o=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return r=cE(e,r),await o(i,{...r},n,e)}function cE(e,t){var r;return{...t,modules:{...(r=e.options)==null?void 0:r.modules,...t.modules},core:{...t.core,worker:!1}}}var lE=p(()=>{"use strict";ic()});function Jd(e={}){if(e.coordinateEpoch!==void 0&&!Number.isFinite(e.coordinateEpoch))throw new Error("Spatial reference coordinate epoch must be a finite decimal year");return Object.freeze({crs:uE(e.crs||{state:"absent",provenance:"unknown"}),vertical:e.vertical?uE(e.vertical):void 0,coordinateEpoch:e.coordinateEpoch,coordinateFrame:e.coordinateFrame||"unknown",coordinateOrder:Object.freeze([...e.coordinateOrder||[]]),units:e.units?Object.freeze([...e.units]):void 0})}function wr(e){if(typeof e=="object")return"projjson";let t=e.trim();return/^[A-Z][A-Z0-9_]*\s*[\[(]/i.test(t)?"wkt":/(?:^|\s)\+?proj=/i.test(t)?"proj-string":/^[A-Z][A-Z0-9._-]*(?::[A-Z0-9._-]+)+$/i.test(t)||/^urn:ogc:def:crs:/i.test(t)||/^https?:\/\//i.test(t)||/^[A-Z][A-Z0-9._-]*$/i.test(t)?"identifier":"opaque"}function uE(e){return e.state==="explicit"||e.state==="default"?Object.freeze({...e,definition:fE(e.definition),alternatives:e.alternatives?Object.freeze(e.alternatives.map(t=>Object.freeze({...t,definition:fE(t.definition)}))):void 0}):Object.freeze({...e})}function fE(e){return typeof e=="string"?e:Qg(e)}function Qg(e){return Array.isArray(e)?Object.freeze(e.map(t=>Qg(t))):e&&typeof e=="object"?Object.freeze(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Qg(r)]))):e}var Dl=p(()=>{});function _f(e,t){let n={type:"wkt-crs",root:new ey(e).parse()};if(t!=null&&t.strict){let i=pE(n,{profile:t.profile,allowExtensions:!1});if(i.length>0)throw new em(i)}return n}function pE(e,t){var a;if(!e||e.type!=="wkt-crs"||((a=e.root)==null?void 0:a.type)!=="node")throw new TypeError("validateWKTCRS expects a WKTCRSAst");let r=aj(e.root.keyword,(t==null?void 0:t.profile)||"auto"),n=oj[r],i=sj[r],o=[],s=e.root.keyword.toUpperCase();return n.has(s)||o.push({code:"invalid-root",message:`${e.root.keyword} is not a ${r} root keyword`,path:[],keyword:e.root.keyword}),gE(e.root,[],c=>{let l=c.node.keyword.toUpperCase();!(t!=null&&t.allowExtensions)&&!i.has(l)&&o.push({code:"unknown-keyword",message:`${c.node.keyword} is not defined by the ${r} profile`,path:c.path,keyword:c.node.keyword}),c.node.values.length===0&&o.push({code:"empty-node",message:`${c.node.keyword} must contain at least one value`,path:c.path,keyword:c.node.keyword});let u=cj(c.node);u&&o.push({code:"invalid-value",message:u,path:c.path,keyword:c.node.keyword})}),o}function aj(e,t){return t!=="auto"?t:xf.has(e.toUpperCase())?"wkt1":"wkt2:2019"}function cj(e){let t=e.keyword.toUpperCase(),r=e.values,n=(o,...s)=>!!(r[o]&&s.includes(r[o].type)),i=(o,...s)=>r.length===o&&s.every((a,c)=>n(c,a));if(["ANGLEUNIT","LENGTHUNIT","PARAMETRICUNIT","SCALEUNIT","TIMEUNIT","TEMPORALQUANTITY","UNIT"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${e.keyword} must start with a quoted name and numeric conversion factor`;if(t==="CS"&&!i(2,"enumeration","number"))return`${e.keyword} must contain a coordinate-system type and dimension`;if(t==="BBOX"&&!i(4,"number","number","number","number"))return`${e.keyword} must contain four numeric bounds`;if(["ENSEMBLEACCURACY","EPOCH","COORDEPOCH","FRAMEEPOCH","OPERATIONACCURACY","ORDER"].includes(t)&&!i(1,"number"))return`${e.keyword} must contain one number`;if(["ANCHOR","AREA","CALENDAR","CITATION","REMARK","SCOPE","URI","VERSION"].includes(t)&&!i(1,"string"))return`${e.keyword} must contain one quoted string`;if(["ELLIPSOID","SPHEROID","TRIAXIAL"].includes(t)&&!(r.length>=3&&n(0,"string")&&n(1,"number")&&n(2,"number")))return`${e.keyword} must start with a quoted name and numeric ellipsoid axes`;if(["PARAMETER"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${e.keyword} must start with a quoted name and numeric value`;if(t==="PARAMETERFILE"&&!i(2,"string","string"))return`${e.keyword} must contain a quoted name and file name`;if(["AUTHORITY","ID"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"string","number")))return`${e.keyword} must start with a quoted authority and identifier`;if(["AXIS"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"enumeration")))return`${e.keyword} must start with a quoted name and axis direction`;if(["METHOD","PROJECTION"].includes(t)&&!(r.length>=1&&n(0,"string")))return`${e.keyword} must start with a quoted name`;if(t==="TIMEEXTENT"){let o=s=>n(s,"enumeration","string");if(r.length!==2||!o(0)||!o(1))return`${e.keyword} must contain two date-time or quoted values`}if(t==="VERTICALEXTENT"&&(r.length<2||r.length>3||!n(0,"number")||!n(1,"number")||r.length===3&&!n(2,"node")))return`${e.keyword} must contain two numeric bounds and an optional unit`;if(t==="COORDINATEMETADATA"&&(r.length<1||r.length>2||!n(0,"node")||r.length===2&&(!n(1,"node")||!["EPOCH","COORDEPOCH"].includes(r[1].keyword.toUpperCase()))))return`${e.keyword} must contain a CRS and an optional coordinate epoch`;if(t==="BOUNDCRS"){let o=r.slice(0,3).map(s=>s.type==="node"?s.keyword.toUpperCase():"");if(o[0]!=="SOURCECRS"||o[1]!=="TARGETCRS"||o[2]!=="ABRIDGEDTRANSFORMATION")return`${e.keyword} must start with SOURCECRS, TARGETCRS, and ABRIDGEDTRANSFORMATION`}return["COMPOUNDCRS","CONCATENATEDOPERATION","COORDINATEOPERATION","DERIVEDPROJCRS","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","GEOGCRS","GEOGRAPHICCRS","PARAMETRICCRS","POINTMOTIONOPERATION","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"].includes(t)&&!n(0,"string")?`${e.keyword} must start with a quoted name`:null}function gE(e,t,r){r({node:e,path:t});for(let n=0;n<e.values.length;n++){let i=e.values[n];i.type==="node"&&gE(i,[...t,n],r)}}function lj(e,t){let r=1,n=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
3
- `?(r++,n=1):n++;return{line:r,column:n}}var Qd,em,ZU,JU,xf,ty,QU,ej,tj,rj,hE,dE,mE,nj,ij,oj,sj,ey,ry=p(()=>{Qd=class extends SyntaxError{constructor(t,r,n){let i=lj(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="WKTCRSSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}},em=class extends Error{constructor(t){var r;super(((r=t[0])==null?void 0:r.message)||"WKT validation failed"),this.name="WKTCRSValidationError",this.issues=t}},ZU=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?$/,JU=/^[A-Za-z][A-Za-z0-9_]*/,xf=new Set(["COMPD_CS","CONCAT_MT","FITTED_CS","GEOCCS","GEOGCS","INVERSE_MT","LOCAL_CS","PARAM_MT","PASSTHROUGH_MT","PROJCS","VERT_CS"]),ty=new Set([...xf,"AUTHORITY","AXIS","CONCAT_MT","DATUM","INVERSE_MT","LOCAL_DATUM","PARAMETER","PARAM_MT","PASSTHROUGH_MT","PRIMEM","PROJECTION","SPHEROID","TOWGS84","UNIT","VERT_DATUM"]),QU=new Set(xf),ej=new Set([...ty,"EXTENSION"]),tj=new Set([...xf,"COMPDCS","LOCALCS","VERTCS"]),rj=new Set([...ty,"COMPDCS","LOCALCS","VDATUM","VERTCS"]),hE=new Set(["BOUNDCRS","COMPOUNDCRS","COORDINATEOPERATION","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","PARAMETRICCRS","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"]),dE=new Set([...hE,"CONCATENATEDOPERATION","COORDINATEMETADATA","DERIVEDPROJCRS","GEOGCRS","GEOGRAPHICCRS","POINTMOTIONOPERATION"]),mE=new Set([...dE,"ABRIDGEDTRANSFORMATION","ANCHOR","ANGLEUNIT","AREA","AXIS","BASEENGCRS","BASEGEODCRS","BASEGEOGCRS","BASEPARAMCRS","BASEPROJCRS","BASETIMECRS","BASEVERTCRS","BBOX","BEARING","CALENDAR","CITATION","CONVERSION","COORDEPOCH","CS","DATUM","DERIVINGCONVERSION","DYNAMIC","EDATUM","ELLIPSOID","ENGINEERINGDATUM","ENSEMBLE","ENSEMBLEACCURACY","EPOCH","FRAMEEPOCH","GEODETICDATUM","GEOIDMODEL","ID","INTERPOLATIONCRS","LENGTHUNIT","MEMBER","MERIDIAN","METHOD","MODEL","OPERATIONACCURACY","ORDER","PARAMETER","PARAMETERFILE","PARAMETRICDATUM","PARAMETRICUNIT","PDATUM","PRIMEM","PRIMEMERIDIAN","REMARK","SCALEUNIT","SCOPE","SOURCECRS","STEP","TARGETCRS","TDATUM","TEMPORALQUANTITY","TIMEEXTENT","TIMEORIGIN","TIMEUNIT","TIMEDATUM","TRIAXIAL","TRF","URI","USAGE","VDATUM","VERSION","VERTICALDATUM","VERTICALEXTENT","VELOCITYGRID","VRF"]),nj=new Set(["BASEGEOGCRS","CALENDAR","CONCATENATEDOPERATION","COORDEPOCH","COORDINATEMETADATA","DERIVEDPROJCRS","DYNAMIC","ENSEMBLE","ENSEMBLEACCURACY","EPOCH","FRAMEEPOCH","GEOGCRS","GEOGRAPHICCRS","GEOIDMODEL","MEMBER","MODEL","POINTMOTIONOPERATION","STEP","TEMPORALQUANTITY","TRF","TRIAXIAL","VELOCITYGRID","VRF"]),ij=new Set([...mE].filter(e=>!nj.has(e))),oj={wkt1:xf,gdal:QU,esri:tj,"wkt2:2015":hE,"wkt2:2019":dE},sj={wkt1:ty,gdal:ej,esri:rj,"wkt2:2015":ij,"wkt2:2019":mE};ey=class{constructor(t){this.offset=0,this.source=t}parse(){this.skipWhitespace();let t=this.parseNode();return this.skipWhitespace(),this.offset!==this.source.length&&this.fail("Unexpected content after WKT root"),t}parseNode(){let t=this.parseKeyword();return this.parseNodeAfterKeyword(t)}parseNodeAfterKeyword(t){this.skipWhitespace();let r=this.source[this.offset];r!=="["&&r!=="("&&this.fail(`Expected '[' or '(' after ${t}`),this.offset++;let n=r==="["?"bracket":"parenthesis",i=r==="["?"]":")",o=[];if(this.skipWhitespace(),this.source[this.offset]===i)return this.offset++,{type:"node",keyword:t,delimiter:n,values:o};for(;this.offset<this.source.length;){o.push(this.parseValue()),this.skipWhitespace();let s=this.source[this.offset];if(s===","){this.offset++,this.skipWhitespace(),this.source[this.offset]===i&&this.fail("Expected a WKT value after comma");continue}if(s===i)return this.offset++,{type:"node",keyword:t,delimiter:n,values:o};(s==="]"||s===")")&&this.fail(`Expected '${i}' to close ${t}`),this.fail(`Expected ',' or '${i}' in ${t}`)}this.fail(`Unterminated ${t} node`)}parseValue(){if(this.skipWhitespace(),this.source[this.offset]==='"')return this.parseString();let r=this.offset;for(;this.offset<this.source.length&&!/[\s,\[\]()"]/.test(this.source[this.offset]);)this.offset++;r===this.offset&&this.fail("Expected a WKT value");let n=this.source.slice(r,this.offset);return this.source[this.offset]==='"'&&this.fail("Unexpected quote in unquoted WKT value"),this.skipWhitespace(),this.source[this.offset]==="["||this.source[this.offset]==="("?(/^[A-Za-z][A-Za-z0-9_]*$/.test(n)||this.fail(`Invalid WKT keyword '${n}'`),this.parseNodeAfterKeyword(n)):ZU.test(n)?{type:"number",value:Number(n),raw:n}:{type:"enumeration",value:n}}parseKeyword(){let t=this.source.slice(this.offset).match(JU);return t||this.fail("Expected a WKT keyword"),this.offset+=t[0].length,t[0]}parseString(){this.offset++;let t="";for(;this.offset<this.source.length;){let r=this.source[this.offset++];if(r==='"'){if(this.source[this.offset]==='"'){t+='"',this.offset++;continue}return{type:"string",value:t}}t+=r}this.fail("Unterminated WKT string")}skipWhitespace(){for(;this.offset<this.source.length&&/\s/.test(this.source[this.offset]);)this.offset++}fail(t){throw new Qd(t,this.source,this.offset)}}});function Sf(e){let t=hj(e);if(t.length===0)throw new Uo("PROJ string is empty",e,0);return{type:"proj-string",parameters:t.map(n=>fj(n.raw,n.offset,e))}}function fj(e,t,r){let n=e.startsWith("+")?e.slice(1):e;if(!n)throw new Uo("Expected a parameter after '+'",r,t);let i=n.indexOf("="),o=i<0?n:n.slice(0,i);if(!o||/[\s+=]/.test(o))throw new Uo(`Invalid PROJ parameter name '${o}'`,r,t);if(i<0)return{type:"parameter",name:o};let s=n.slice(i+1),a=dj(s,r,t+i+1);return{type:"parameter",name:o,value:a,rawValue:s}}function hj(e){let t=[],r=0;for(;r<e.length;){for(;r<e.length&&/\s/.test(e[r]);)r++;if(r>=e.length)break;let n=r,i=null,o=!1;for(;r<e.length;){let s=e[r];if(o){o=!1,r++;continue}if(s==="\\"&&i){o=!0,r++;continue}if(i){s===i&&(i=null),r++;continue}if((s==='"'||s==="'")&&e[r-1]==="="){i=s,r++;continue}if(/\s/.test(s))break;r++}if(i)throw new Uo("Unterminated quoted PROJ value",e,n);t.push({raw:e.slice(n,r),offset:n})}return t}function dj(e,t,r){if(!e)return"";let n=e[0];if(n!=='"'&&n!=="'"){if((e.includes('"')||e.includes("'"))&&!uj.test(e))throw new Uo("Quote must begin a PROJ parameter value",t,r);return e}if(e[e.length-1]!==n)throw new Uo("Unterminated quoted PROJ value",t,r);let i="";for(let o=1;o<e.length-1;o++){let s=e[o];s==="\\"&&o+1<e.length-1?i+=e[++o]:i+=s}return i}function mj(e,t){let r=1,n=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
4
- `?(r++,n=1):n++;return{line:r,column:n}}var Uo,uj,ny=p(()=>{Uo=class extends SyntaxError{constructor(t,r,n){let i=mj(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="PROJStringSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}};uj=/^[+-]?\d+(?:\.\d*)?d(?:\d+(?:\.\d*)?'(?:\d+(?:\.\d*)?")?)?[NSEW]?$/i});var Mf,yE=p(()=>{Mf={m:{name:"meters",metersPerUnit:1},mm:{name:"millimeters",metersPerUnit:.001},cm:{name:"centimeters",metersPerUnit:.01},ft:{name:"feet",metersPerUnit:.3048},"us-ft":{name:"us-survey-feet",metersPerUnit:.3048006096012192},fath:{name:"fathoms",metersPerUnit:1.8288},kmi:{name:"nautical-miles",metersPerUnit:1852},"us-ch":{name:"us-survey-chains",metersPerUnit:20.1168402336805},"us-mi":{name:"us-survey-miles",metersPerUnit:1609.34721869444},km:{name:"kilometers",metersPerUnit:1e3},"ind-ft":{name:"indian-feet",metersPerUnit:.30479841},"ind-yd":{name:"indian-yards",metersPerUnit:.91439523},mi:{name:"miles",metersPerUnit:1609.344},yd:{name:"yards",metersPerUnit:.9144},ch:{name:"chains",metersPerUnit:20.1168},link:{name:"links",metersPerUnit:.201168},dm:{name:"decimeters",metersPerUnit:.1},in:{name:"inches",metersPerUnit:.0254},"ind-ch":{name:"indian-chains",metersPerUnit:20.11669506},"us-in":{name:"us-survey-inches",metersPerUnit:.025400050800101},"us-yd":{name:"us-survey-yards",metersPerUnit:.914401828803658}}});function bE(e){return JSON.stringify([e.coordinateFrame,e.projection,Object.keys(e.parameters).sort().map(t=>[t,e.parameters[t]]),[e.ellipsoid.semiMajorAxis,e.ellipsoid.semiMinorAxis],e.axis,[e.xUnit.name,e.xUnit.metersPerUnit,e.xUnit.degreesPerUnit],[e.yUnit.name,e.yUnit.metersPerUnit,e.yUnit.degreesPerUnit],[e.zUnit.name,e.zUnit.metersPerUnit,e.zUnit.degreesPerUnit],e.lossy,e.areaOfUse])}var iy=p(()=>{yE()});var oy=p(()=>{Dl();ry();ny()});var tm={};Jt(tm,{EPSILON1:()=>pj,EPSILON10:()=>vj,EPSILON11:()=>Ej,EPSILON12:()=>Tj,EPSILON13:()=>Aj,EPSILON14:()=>Ij,EPSILON15:()=>Pj,EPSILON16:()=>Rj,EPSILON17:()=>Lj,EPSILON18:()=>Oj,EPSILON19:()=>Bj,EPSILON2:()=>gj,EPSILON20:()=>Cj,EPSILON3:()=>yj,EPSILON4:()=>bj,EPSILON5:()=>wj,EPSILON6:()=>xj,EPSILON7:()=>_j,EPSILON8:()=>Sj,EPSILON9:()=>Mj,PI:()=>Gj,PI_OVER_FOUR:()=>Nj,PI_OVER_SIX:()=>Fj,PI_OVER_TWO:()=>Dj,TWO_PI:()=>kj});var pj,gj,yj,bj,wj,xj,_j,Sj,Mj,vj,Ej,Tj,Aj,Ij,Pj,Rj,Lj,Oj,Bj,Cj,Dj,Nj,Fj,Gj,kj,wE=p(()=>{pj=.1,gj=.01,yj=.001,bj=1e-4,wj=1e-5,xj=1e-6,_j=1e-7,Sj=1e-8,Mj=1e-9,vj=1e-10,Ej=1e-11,Tj=1e-12,Aj=1e-13,Ij=1e-14,Pj=1e-15,Rj=1e-16,Lj=1e-17,Oj=1e-18,Bj=1e-19,Cj=1e-20,Dj=Math.PI/2,Nj=Math.PI/4,Fj=Math.PI/6,Gj=Math.PI,kj=Math.PI*2});function sy(e,{precision:t=xt.precision}={}){return e=qj(e),`${parseFloat(e.toPrecision(t))}`}function ao(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ay(e){return xE(e)}function cy(e){return _E(e)}function xE(e,t){return SE(e,r=>r*jj,t)}function _E(e,t){return SE(e,r=>r*Uj,t)}function rm(e,t,r){let n=xt.EPSILON;r&&(xt.EPSILON=r);try{if(e===t)return!0;if(ao(e)&&ao(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!rm(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=xt.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{xt.EPSILON=n}}function qj(e){return Math.round(e/xt.EPSILON)*xt.EPSILON}function Vj(e){return e.clone?e.clone():new Array(e.length)}function SE(e,t,r){if(ao(e)){let n=e;r=r||Vj(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof e=="number"?e:e[i];r[i]=t(o,i,r)}return r}return t(e)}var Uj,jj,zj,xt,Nl=p(()=>{Uj=1/Math.PI*180,jj=1/180*Math.PI,zj={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...zj}};xt=globalThis.mathgl.config});var Ps,nm=p(()=>{Nl();Ps=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:ao(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toString(){return this.formatString(xt)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+sy(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!rm(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let o=t[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(xt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}}});function Wj(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Kt(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function Fl(e,t,r=""){if(xt.debug&&!Wj(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}var oc=p(()=>{Nl()});var Gl,ly=p(()=>{nm();oc();Nl();Gl=class extends Ps{toString(){let t="[";if(xt.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Kt(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}}});function Ri(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var uy=p(()=>{});var im,ME=p(()=>{nm();oc();uy();im=class extends Ps{get x(){return this[0]}set x(t){this[0]=Kt(t)}get y(){return this[1]}set y(t){this[1]=Kt(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Kt(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Kt(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Ri(t>=0&&t<this.ELEMENTS,"index is out of range"),Kt(this[t])}setComponent(t,r){return Ri(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]+=t[n]*r;return this.check()}}});var om,mee,vE=p(()=>{om=typeof Float32Array<"u"?Float32Array:Array,mee=Math.PI/180});function EE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function TE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var sm=p(()=>{});function AE(e,t,r){let n=t[0],i=t[1],o=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/o,e[1]=(r[1]*n+r[5]*i)/o,e}function am(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o||1;return e[0]=(r[0]*n+r[4]*i+r[8]*o)/s,e[1]=(r[1]*n+r[5]*i+r[9]*o)/s,e[2]=(r[2]*n+r[6]*i+r[10]*o)/s,e}function IE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function PE(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*o,e[1]=r[1]*n+r[4]*i+r[7]*o,e[2]=r[2]*n+r[5]*i+r[8]*o,e[3]=t[3],e}var cm=p(()=>{});function RE(){let e=new om(3);return om!==Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function $j(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function fy(e,t,r){let n=new om(3);return n[0]=e,n[1]=t,n[2]=r,n}function LE(e,t){let r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function hy(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function kl(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[0],a=r[1],c=r[2];return e[0]=i*c-o*a,e[1]=o*s-n*c,e[2]=n*a-i*s,e}function lm(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,e}function um(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}function OE(e,t,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=t[0],c=t[1],l=t[2],u=i*l-o*c,h=o*a-n*l,d=n*c-i*a,m=i*d-o*h,g=o*u-n*d,y=n*h-i*u,b=s*2;return u*=b,h*=b,d*=b,m*=2,g*=2,y*=2,e[0]=a+u+m,e[1]=c+h+g,e[2]=l+d+y,e}function BE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function CE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function DE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function NE(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],a=t[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),l=c&&hy(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var FE,Ul=p(()=>{vE();FE=$j});var dy,fm,J,GE=p(()=>{ME();Nl();oc();Ul();cm();dy=[0,0,0],J=class e extends im{static get ZERO(){return fm||(fm=new e(0,0,0),Object.freeze(fm)),fm}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&ao(t)?this.copy(t):(xt.debug&&(Kt(t),Kt(r),Kt(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return xt.debug&&(Kt(t.x),Kt(t.y),Kt(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Kt(t)}angle(t){return NE(this,t)}cross(t){return kl(this,this,t),this.check()}rotateX({radians:t,origin:r=dy}){return BE(this,this,r,t),this.check()}rotateY({radians:t,origin:r=dy}){return CE(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=dy}){return DE(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return lm(this,this,t),this.check()}transformAsVector(t){return am(this,this,t),this.check()}transformByMatrix3(t){return um(this,this,t),this.check()}transformByMatrix2(t){return IE(this,this,t),this.check()}transformByQuaternion(t){return OE(this,this,t),this.check()}}});function kE(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function UE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],h=u*s-a*l,d=-u*o+a*c,m=l*o-s*c,g=r*h+n*d+i*m;return g?(g=1/g,e[0]=h*g,e[1]=(-u*n+i*l)*g,e[2]=(a*n-i*s)*g,e[3]=d*g,e[4]=(u*r-i*c)*g,e[5]=(-a*r+i*o)*g,e[6]=m*g,e[7]=(-l*r+n*c)*g,e[8]=(s*r-n*o)*g,e):null}function jE(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*(l*o-s*c)+r*(-l*i+s*a)+n*(c*i-o*a)}function my(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=r[0],m=r[1],g=r[2],y=r[3],b=r[4],w=r[5],_=r[6],S=r[7],v=r[8];return e[0]=d*n+m*s+g*l,e[1]=d*i+m*a+g*u,e[2]=d*o+m*c+g*h,e[3]=y*n+b*s+w*l,e[4]=y*i+b*a+w*u,e[5]=y*o+b*c+w*h,e[6]=_*n+S*s+v*l,e[7]=_*i+S*a+v*u,e[8]=_*o+S*c+v*h,e}function zE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=r[0],m=r[1];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=c,e[6]=d*n+m*s+l,e[7]=d*i+m*a+u,e[8]=d*o+m*c+h,e}function qE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=Math.sin(r),m=Math.cos(r);return e[0]=m*n+d*s,e[1]=m*i+d*a,e[2]=m*o+d*c,e[3]=m*s-d*n,e[4]=m*a-d*i,e[5]=m*c-d*o,e[6]=l,e[7]=u,e[8]=h,e}function py(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function VE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,h=n*a,d=i*s,m=i*a,g=i*c,y=o*s,b=o*a,w=o*c;return e[0]=1-h-g,e[3]=u-w,e[6]=d+b,e[1]=u+w,e[4]=1-l-g,e[7]=m-y,e[2]=d-b,e[5]=m+y,e[8]=1-l-h,e}var gy=p(()=>{});function Yj(){return hm||(hm=new sc([0,0,0,0,0,0,0,0,0]),Object.freeze(hm)),hm}function Zj(){return dm||(dm=new sc,Object.freeze(dm)),dm}var yy,Xj,sc,hm,dm,WE=p(()=>{ly();oc();cm();gy();sm();Ul();(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(yy||(yy={}));Xj=Object.freeze([1,0,0,0,1,0,0,0,1]),sc=class extends Gl{static get IDENTITY(){return Zj()}static get ZERO(){return Yj()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return yy}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(Xj)}fromObject(t){return this.check()}fromQuaternion(t){return VE(this,t),this.check()}fromMatrix4(t){return this.set(t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10])}set(t,r,n,i,o,s,a,c,l){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this.check()}setRowMajor(t,r,n,i,o,s,a,c,l){return this[0]=t,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=s,this[8]=l,this.check()}determinant(){return jE(this)}transpose(){return kE(this,this),this.check()}invert(){return UE(this,this),this.check()}multiplyLeft(t){return my(this,t,this),this.check()}multiplyRight(t){return my(this,this,t),this.check()}rotate(t){return qE(this,this,t),this.check()}scale(t){return Array.isArray(t)?py(this,this,t):py(this,this,[t,t]),this.check()}translate(t){return zE(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=EE(r||[-0,-0],t,this);break;case 3:n=um(r||[-0,-0,-0],t,this);break;case 4:n=PE(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Fl(n,t.length),n}},dm=null});function Jj(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function HE(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function $E(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],h=t[9],d=t[10],m=t[11],g=t[12],y=t[13],b=t[14],w=t[15],_=r*a-n*s,S=r*c-i*s,v=r*l-o*s,T=n*c-i*a,O=n*l-o*a,P=i*l-o*c,M=u*y-h*g,U=u*b-d*g,C=u*w-m*g,L=h*b-d*y,A=h*w-m*y,W=d*w-m*b,G=_*W-S*A+v*L+T*C-O*U+P*M;return G?(G=1/G,e[0]=(a*W-c*A+l*L)*G,e[1]=(i*A-n*W-o*L)*G,e[2]=(y*P-b*O+w*T)*G,e[3]=(d*O-h*P-m*T)*G,e[4]=(c*C-s*W-l*U)*G,e[5]=(r*W-i*C+o*U)*G,e[6]=(b*v-g*P-w*S)*G,e[7]=(u*P-d*v+m*S)*G,e[8]=(s*A-a*C+l*M)*G,e[9]=(n*C-r*A-o*M)*G,e[10]=(g*O-y*v+w*_)*G,e[11]=(h*v-u*O-m*_)*G,e[12]=(a*U-s*L-c*M)*G,e[13]=(r*L-n*U+i*M)*G,e[14]=(y*S-g*T-b*_)*G,e[15]=(u*T-h*S+d*_)*G,e):null}function KE(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],c=e[7],l=e[8],u=e[9],h=e[10],d=e[11],m=e[12],g=e[13],y=e[14],b=e[15],w=t*s-r*o,_=t*a-n*o,S=r*a-n*s,v=l*g-u*m,T=l*y-h*m,O=u*y-h*g,P=t*O-r*T+n*v,M=o*O-s*T+a*v,U=l*S-u*_+h*w,C=m*S-g*_+y*w;return c*P-i*M+b*U-d*C}function by(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=t[9],m=t[10],g=t[11],y=t[12],b=t[13],w=t[14],_=t[15],S=r[0],v=r[1],T=r[2],O=r[3];return e[0]=S*n+v*a+T*h+O*y,e[1]=S*i+v*c+T*d+O*b,e[2]=S*o+v*l+T*m+O*w,e[3]=S*s+v*u+T*g+O*_,S=r[4],v=r[5],T=r[6],O=r[7],e[4]=S*n+v*a+T*h+O*y,e[5]=S*i+v*c+T*d+O*b,e[6]=S*o+v*l+T*m+O*w,e[7]=S*s+v*u+T*g+O*_,S=r[8],v=r[9],T=r[10],O=r[11],e[8]=S*n+v*a+T*h+O*y,e[9]=S*i+v*c+T*d+O*b,e[10]=S*o+v*l+T*m+O*w,e[11]=S*s+v*u+T*g+O*_,S=r[12],v=r[13],T=r[14],O=r[15],e[12]=S*n+v*a+T*h+O*y,e[13]=S*i+v*c+T*d+O*b,e[14]=S*o+v*l+T*m+O*w,e[15]=S*s+v*u+T*g+O*_,e}function XE(e,t,r){let n=r[0],i=r[1],o=r[2],s,a,c,l,u,h,d,m,g,y,b,w;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*o+t[12],e[13]=t[1]*n+t[5]*i+t[9]*o+t[13],e[14]=t[2]*n+t[6]*i+t[10]*o+t[14],e[15]=t[3]*n+t[7]*i+t[11]*o+t[15]):(s=t[0],a=t[1],c=t[2],l=t[3],u=t[4],h=t[5],d=t[6],m=t[7],g=t[8],y=t[9],b=t[10],w=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=u,e[5]=h,e[6]=d,e[7]=m,e[8]=g,e[9]=y,e[10]=b,e[11]=w,e[12]=s*n+u*i+g*o+t[12],e[13]=a*n+h*i+y*o+t[13],e[14]=c*n+d*i+b*o+t[14],e[15]=l*n+m*i+w*o+t[15]),e}function YE(e,t,r){let n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ZE(e,t,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),c,l,u,h,d,m,g,y,b,w,_,S,v,T,O,P,M,U,C,L,A,W,G,E;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,l=Math.sin(r),c=Math.cos(r),u=1-c,h=t[0],d=t[1],m=t[2],g=t[3],y=t[4],b=t[5],w=t[6],_=t[7],S=t[8],v=t[9],T=t[10],O=t[11],P=i*i*u+c,M=o*i*u+s*l,U=s*i*u-o*l,C=i*o*u-s*l,L=o*o*u+c,A=s*o*u+i*l,W=i*s*u+o*l,G=o*s*u-i*l,E=s*s*u+c,e[0]=h*P+y*M+S*U,e[1]=d*P+b*M+v*U,e[2]=m*P+w*M+T*U,e[3]=g*P+_*M+O*U,e[4]=h*C+y*L+S*A,e[5]=d*C+b*L+v*A,e[6]=m*C+w*L+T*A,e[7]=g*C+_*L+O*A,e[8]=h*W+y*G+S*E,e[9]=d*W+b*G+v*E,e[10]=m*W+w*G+T*E,e[11]=g*W+_*G+O*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function JE(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],s=t[5],a=t[6],c=t[7],l=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+l*n,e[5]=s*i+u*n,e[6]=a*i+h*n,e[7]=c*i+d*n,e[8]=l*i-o*n,e[9]=u*i-s*n,e[10]=h*i-a*n,e[11]=d*i-c*n,e}function QE(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],c=t[3],l=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-l*n,e[1]=s*i-u*n,e[2]=a*i-h*n,e[3]=c*i-d*n,e[8]=o*n+l*i,e[9]=s*n+u*i,e[10]=a*n+h*i,e[11]=c*n+d*i,e}function e4(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],c=t[3],l=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+l*n,e[1]=s*i+u*n,e[2]=a*i+h*n,e[3]=c*i+d*n,e[4]=l*i-o*n,e[5]=u*i-s*n,e[6]=h*i-a*n,e[7]=d*i-c*n,e}function t4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,h=n*a,d=i*s,m=i*a,g=i*c,y=o*s,b=o*a,w=o*c;return e[0]=1-h-g,e[1]=u+w,e[2]=d-b,e[3]=0,e[4]=u-w,e[5]=1-l-g,e[6]=m+y,e[7]=0,e[8]=d+b,e[9]=m-y,e[10]=1-l-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function r4(e,t,r,n,i,o,s){let a=1/(r-t),c=1/(i-n),l=1/(o-s);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(i+n)*c,e[10]=(s+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*l,e[15]=0,e}function Qj(e,t,r,n,i){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let s=1/(n-i);e[10]=(i+n)*s,e[14]=2*i*n*s}else e[10]=-1,e[14]=-2*n;return e}function ez(e,t,r,n,i,o,s){let a=1/(t-r),c=1/(n-i),l=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+r)*a,e[13]=(i+n)*c,e[14]=(s+o)*l,e[15]=1,e}function o4(e,t,r,n){let i,o,s,a,c,l,u,h,d,m,g=t[0],y=t[1],b=t[2],w=n[0],_=n[1],S=n[2],v=r[0],T=r[1],O=r[2];return Math.abs(g-v)<1e-6&&Math.abs(y-T)<1e-6&&Math.abs(b-O)<1e-6?Jj(e):(h=g-v,d=y-T,m=b-O,i=1/Math.sqrt(h*h+d*d+m*m),h*=i,d*=i,m*=i,o=_*m-S*d,s=S*h-w*m,a=w*d-_*h,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),c=d*a-m*s,l=m*o-h*a,u=h*s-d*o,i=Math.sqrt(c*c+l*l+u*u),i?(i=1/i,c*=i,l*=i,u*=i):(c=0,l=0,u=0),e[0]=o,e[1]=c,e[2]=h,e[3]=0,e[4]=s,e[5]=l,e[6]=d,e[7]=0,e[8]=a,e[9]=u,e[10]=m,e[11]=0,e[12]=-(o*g+s*y+a*b),e[13]=-(c*g+l*y+u*b),e[14]=-(h*g+d*y+m*b),e[15]=1,e)}var n4,i4,wy=p(()=>{n4=Qj;i4=ez});function s4(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function a4(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function c4(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function l4(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function u4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=n*s,e[2]=i*s,e[3]=o*s,e}function f4(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function h4(e,t,r,n){let i=t[0],o=t[1],s=t[2],a=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=s+n*(r[2]-s),e[3]=a+n*(r[3]-a),e}function d4(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,e}var mm=p(()=>{});function oz(){return pm||(pm=new yn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(pm)),pm}function sz(){return gm||(gm=new yn,Object.freeze(gm)),gm}function m4(e){if(e>Math.PI*2)throw Error("expected radians")}function az(e,t,r,n,i,o){let s=2*o/(r-t),a=2*o/(i-n),c=(r+t)/(r-t),l=(i+n)/(i-n),u=-1,h=-1,d=-2*o;return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=l,e[10]=u,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}var Sy,rz,nz,xy,_y,iz,yn,pm,gm,p4=p(()=>{ly();oc();cm();wy();sm();Ul();mm();(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Sy||(Sy={}));rz=45*Math.PI/180,nz=1,xy=.1,_y=500,iz=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),yn=class extends Gl{static get IDENTITY(){return sz()}static get ZERO(){return oz()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Sy}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this[9]=u,this[10]=h,this[11]=d,this[12]=m,this[13]=g,this[14]=y,this[15]=b,this.check()}setRowMajor(t,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=t,this[1]=o,this[2]=l,this[3]=m,this[4]=r,this[5]=s,this[6]=u,this[7]=g,this[8]=n,this[9]=a,this[10]=h,this[11]=y,this[12]=i,this[13]=c,this[14]=d,this[15]=b,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(iz)}fromObject(t){return this.check()}fromQuaternion(t){return t4(this,t),this.check()}fromMatrix3(t){return this.set(t[0],t[1],t[2],0,t[3],t[4],t[5],0,t[6],t[7],t[8],0,0,0,0,1)}frustum(t){let{left:r,right:n,bottom:i,top:o,near:s=xy,far:a=_y}=t;return a===1/0?az(this,r,n,i,o,s):r4(this,r,n,i,o,s,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return o4(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=xy,far:a=_y}=t;return i4(this,r,n,i,o,s,a),this.check()}orthographic(t){let{fovy:r=rz,aspect:n=nz,focalDistance:i=1,near:o=xy,far:s=_y}=t;m4(r);let a=r/2,c=i*Math.tan(a),l=c*n;return this.ortho({left:-l,right:l,bottom:-c,top:c,near:o,far:s})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return m4(r),n4(this,r,n,i,o),this.check()}determinant(){return KE(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*o,t[6]=this[6]*s,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*o,t[10]=this[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],o=1/n[1],s=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*o,t[2]=this[2]*s,t[3]=this[4]*i,t[4]=this[5]*o,t[5]=this[6]*s,t[6]=this[8]*i,t[7]=this[9]*o,t[8]=this[10]*s,t}transpose(){return HE(this,this),this.check()}invert(){return $E(this,this),this.check()}multiplyLeft(t){return by(this,t,this),this.check()}multiplyRight(t){return by(this,this,t),this.check()}rotateX(t){return JE(this,this,t),this.check()}rotateY(t){return QE(this,this,t),this.check()}rotateZ(t){return e4(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return ZE(this,this,t,r),this.check()}scale(t){return YE(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return XE(this,this,t),this.check()}transform(t,r){return t.length===4?(r=d4(r||[-0,-0,-0,-0],t,this),Fl(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=TE(r||[-0,-0],t,this);break;case 3:i=lm(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Fl(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=AE(r||[-0,-0],t,this);break;case 3:n=am(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Fl(n,t.length),n}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}}});function g4(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function My(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function vy(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],c=r[1],l=r[2],u=r[3];return e[0]=n*u+s*a+i*l-o*c,e[1]=i*u+s*c+o*a-n*l,e[2]=o*u+s*l+n*c-i*a,e[3]=s*u-n*a-i*c-o*l,e}function y4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+s*a,e[1]=i*c+o*a,e[2]=o*c-i*a,e[3]=s*c-n*a,e}function b4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-o*a,e[1]=i*c+s*a,e[2]=o*c+n*a,e[3]=s*c-i*a,e}function w4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=i*c-n*a,e[2]=o*c+s*a,e[3]=s*c-o*a,e}function x4(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function _4(e,t,r,n){let i=t[0],o=t[1],s=t[2],a=t[3],c=r[0],l=r[1],u=r[2],h=r[3],d,m,g,y,b;return d=i*c+o*l+s*u+a*h,d<0&&(d=-d,c=-c,l=-l,u=-u,h=-h),1-d>1e-6?(m=Math.acos(d),b=Math.sin(m),g=Math.sin((1-n)*m)/b,y=Math.sin(n*m)/b):(g=1-n,y=n),e[0]=g*i+y*c,e[1]=g*o+y*l,e[2]=g*s+y*u,e[3]=g*a+y*h,e}function S4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-i*a,e[3]=o*a,e}function M4(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function v4(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[o*3+o]-t[s*3+s]+1),e[i]=.5*n,n=.5/n,e[3]=(t[o*3+s]-t[s*3+o])*n,e[o]=(t[o*3+i]+t[i*3+o])*n,e[s]=(t[s*3+i]+t[i*3+s])*n}return e}var E4,T4,A4,I4,P4,R4,cz,L4,Ey=p(()=>{Ul();mm();E4=s4,T4=a4,A4=f4,I4=h4,P4=c4,R4=l4,cz=u4,L4=(function(){let e=RE(),t=fy(1,0,0),r=fy(0,1,0);return function(n,i,o){let s=hy(i,o);return s<-.999999?(kl(e,t,i),FE(e)<1e-6&&kl(e,r,i),LE(e,e),My(n,e,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(kl(e,i,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+s,cz(n,n))}})()});var Ef,O4=p(()=>{nm();oc();Ey();Ef=class extends Ps{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return v4(this,t),this.check()}fromEuler(t){switch(this.identity(),t.order){case"xyz":return this.rotateX(t.x).rotateY(t.y).rotateZ(t.z);case"yxz":return this.rotateY(t.y).rotateX(t.x).rotateZ(t.z);case"zxy":return this.rotateZ(t.z).rotateX(t.x).rotateY(t.y);case"zyx":return this.rotateZ(t.z).rotateY(t.y).rotateX(t.x);case"yzx":return this.rotateY(t.y).rotateZ(t.z).rotateX(t.x);case"xzy":return this.rotateX(t.x).rotateZ(t.z).rotateY(t.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(t,r){return My(this,t,r),this.check()}identity(){return g4(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Kt(t)}get y(){return this[1]}set y(t){this[1]=Kt(t)}get z(){return this[2]}set z(t){this[2]=Kt(t)}get w(){return this[3]}set w(t){this[3]=Kt(t)}len(){return P4(this)}lengthSquared(){return R4(this)}dot(t){return A4(this,t)}rotationTo(t,r){return L4(this,t,r),this.check()}add(t){return E4(this,this,t),this.check()}calculateW(){return x4(this,this),this.check()}conjugate(){return M4(this,this),this.check()}invert(){return S4(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(I4(this,t,r,n),this.check())}multiplyRight(t){return vy(this,this,t),this.check()}multiplyLeft(t){return vy(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return y4(this,this,t),this.check()}rotateY(t){return b4(this,this,t),this.check()}rotateZ(t){return w4(this,this,t),this.check()}scale(t){return T4(this,this,t),this.check()}slerp(t,r,n){let i,o,s;return arguments.length===2?(i=this,o=t,s=r):(i=t,o=r,s=n),_4(this,i,o,s),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}});function Ay(){return{eastX:0,eastY:1,northZ:1,upX:1,upY:0,upZ:0}}function Iy(e,t,r){let n=e.x,i=e.y,o=e.z,s=t.x,a=t.y,c=t.z;return o!==0?!1:lz(r,n,i,s*i-a*n,s,a,c)}function Py(e,t,r,n,i,o){let s=Ty(r),a=Ty(n),c=Ty(i),l=Math.abs(s),u=Math.abs(a),h=Math.abs(c);if(!l||!u||!h||l===u||l===h||u===h||(l%3+1===u?1:-1)*Math.sign(s*a*c)!==1||!Array.isArray(o)&&o.length<16)return!1;let m=e.eastX,g=e.eastY,y=e.northZ,b=e.upX,w=e.upY,_=e.upZ,S=-_*g,v=_*m,T=t.x,O=t.y,P=t.z,M=(l===1?m:l===2?S:b)*Math.sign(s),U=(l===1?g:l===2?v:w)*Math.sign(s),C=(l===1?0:l===2?y:_)*Math.sign(s),L=(u===1?m:u===2?S:b)*Math.sign(a),A=(u===1?g:u===2?v:w)*Math.sign(a),W=(u===1?0:u===2?y:_)*Math.sign(a),G=(h===1?m:h===2?S:b)*Math.sign(c),E=(h===1?g:h===2?v:w)*Math.sign(c),B=(h===1?0:h===2?y:_)*Math.sign(c);return!Number.isFinite(M)||!Number.isFinite(U)||!Number.isFinite(C)||!Number.isFinite(L)||!Number.isFinite(A)||!Number.isFinite(W)||!Number.isFinite(G)||!Number.isFinite(E)||!Number.isFinite(B)||!Number.isFinite(T)||!Number.isFinite(O)||!Number.isFinite(P)||o instanceof Float32Array&&(!Number.isFinite(Math.fround(M))||!Number.isFinite(Math.fround(U))||!Number.isFinite(Math.fround(C))||!Number.isFinite(Math.fround(L))||!Number.isFinite(Math.fround(A))||!Number.isFinite(Math.fround(W))||!Number.isFinite(Math.fround(G))||!Number.isFinite(Math.fround(E))||!Number.isFinite(Math.fround(B))||!Number.isFinite(Math.fround(T))||!Number.isFinite(Math.fround(O))||!Number.isFinite(Math.fround(P)))?!1:(o[0]=M,o[1]=U,o[2]=C,o[3]=0,o[4]=L,o[5]=A,o[6]=W,o[7]=0,o[8]=G,o[9]=E,o[10]=B,o[11]=0,o[12]=T,o[13]=O,o[14]=P,o[15]=1,!0)}function Ty(e){switch(e){case"east":return 1;case"west":return-1;case"north":return 2;case"south":return-2;case"up":return 3;case"down":return-3;default:return 0}}function lz(e,t,r,n,i,o,s){return!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)?!1:(e.eastX=t,e.eastY=r,e.northZ=n,e.upX=i,e.upY=o,e.upZ=s,!0)}var B4=p(()=>{});function Tf(e,t,r=e){let n=e.x,i=e.y,o=e.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=t,l=Math.sin(i),u=Math.abs(i)===Math.PI/2?0:Math.cos(i),h=a/s,d=c<.9?s/Math.sqrt(1-c*l*l):s/Math.hypot(u,h*l),m=(d+o)*u*Math.cos(n),g=(d+o)*u*Math.sin(n),y=(d*(c<.9?1-c:h*h)+o)*l;return jl(r,m,g,y)}function Af(e,t,r=e){let n=e.x,i=e.y,o=e.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=t,l=Math.atan2(i,n),u=Math.hypot(n,i),h=Math.hypot(n,i,o);if(!(h>0)||!Number.isFinite(h))return!1;if(c===0)return jl(r,u===0?0:l,Math.atan2(o,u),h-s);if(u===0)return jl(r,0,Math.sign(o)*Math.PI/2,Math.abs(o)-a);let d=u/s,m=o/a;if(d*d+m*m<1-16*bm||c>=.9)return Ry(n,i,o,u,s,a,r);let g=o/h,y=u/h,b=1/Math.sqrt(1-c*(2-c)*y*y),w=y*(1-c)*b,_=g*b;for(let S=0;S<30;S++){let v=s/Math.sqrt(1-c*_*_),T=u*w+o*_-v*(1-c*_*_),O=c*v/(v+T);b=1/Math.sqrt(1-O*(2-O)*y*y);let P=y*(1-O)*b,M=g*b;if(Math.abs(M*w-P*_)<=1e-12){if(!Number.isFinite(T))break;return jl(r,l,Math.atan2(M,Math.abs(P)),T)}w=P,_=M}return Ry(n,i,o,u,s,a,r)}function Ry(e,t,r,n,i,o,s){let a=Math.atan2(t,e),c=o/i,l=c*c,u=n/i,h=r/i,d=1-l;if(!(l>0)||c>1)return!1;let m=i*i,g=o*o,y=Number.isFinite(m)&&m>0?(g-l*m+Rs(o,o,g)-l*Rs(i,i,m)-Rs(l,m,l*m))/m:0,b=n*n,w=e*e,_=t*t,S=w+_,v=Number.isFinite(b)&&b>0?(S-b+ym(w,_,S)+Rs(e,e,w)+Rs(t,t,_)-Rs(n,n,b))/(2*n):0,T=i*l,O=n-i,P=O+T,M=v+ym(n,-i,O)+ym(O,T,P)+Rs(i,l,T)+i*y;if(r===0)return P+M<0?!1:jl(s,a,0,O);let U=Math.abs(h)*c,C=0,L=l+Math.hypot(u,h*c);if(!Number.isFinite(L))return!1;let A=Math.max(U,u-d);A>C&&A<L||(A=L/2);let W=-(P+M)/i,G=Math.sqrt(W*(u+d))/d,E=W>0&&Math.abs(r)/G/i*c<=bm*W?Math.atan2(Math.sign(r)*G/c,u/d):void 0;for(let B=0;B<1024&&E===void 0;B++){let N=d+A,D=u/N,R=r/A/i,I=R*c,j=i*A,we=P-j,ne=(we+(ym(P,-j,we)+M-Rs(i,A,j)))/(i*N)*(D+1),Oe=ne+I*I;if(!Number.isFinite(Oe))return!1;Oe>0?C=A:L=A;let oe=-2*(D*D/N+I*I/A),Se=A-Oe/oe,Be=Se>C&&Se<L?Se:C+(L-C)/2;if(Math.abs(Oe)<=4*bm*(Math.abs(ne)+I*I)||L-C<=4*bm*A){E=Math.atan2(R,D);break}A=Be}return E!==void 0&&uz(s,a,E,n,r,i,c)}function ym(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function Rs(e,t,r){let n=134217729*e,i=134217729*t;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-e),s=i-(i-t),a=e-o,c=t-s;return o*s-r+o*c+a*s+a*c}function uz(e,t,r,n,i,o,s){let a=Math.sin(r),c=Math.cos(r);return jl(e,t,r,n*c+i*a-o*Math.hypot(c,s*a))}function jl(e,t,r,n){return!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)?!1:(e.x=t,e.y=r,e.z=n,!0)}var bm,C4=p(()=>{bm=Number.EPSILON});function wm(){return zl??Uint16Array}var zl,D4=p(()=>{zl=globalThis.Float16Array});var N4=p(()=>{D4()});var F4=p(()=>{N4()});var G4=p(()=>{gy()});var k4=p(()=>{wy()});var U4=p(()=>{Ey()});var j4=p(()=>{sm()});var z4=p(()=>{Ul()});var q4=p(()=>{mm()});var Fn=p(()=>{GE();WE();p4();O4();wE();uy();Nl();B4();C4();F4();G4();k4();U4();j4();z4();q4()});var jo,Bte,V4=p(()=>{jo=6356752314245179e-9,Bte={radii:[6378137,6378137,jo],radiiSquared:[6378137*6378137,6378137*6378137,jo*jo],oneOverRadii:[1/6378137,1/6378137,1/jo],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(jo*jo)],maximumRadius:Math.max(6378137,6378137,jo),centerToleranceSquared:.1}});function Ly(e){return e}function zo(e,t=[],r=Ly){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function W4(e,t=[]){return zo(e,t,xt._cartographicRadians?Ly:ay)}function Oy(e,t,r,n){let i=xt._cartographicRadians?Ly:cy,o=i(e),s=i(t);return"longitude"in n?(n.longitude=o,n.latitude=s,n.height=r):"x"in n?(n.x=o,n.y=s,n.z=r):(n[0]=o,n[1]=s,n[2]=r),n}var Nte,H4=p(()=>{Fn();Nte=new J});function co(e,t,r,n,i,o,s){let c=[n,i,o,Math.abs(e),Math.abs(t),Math.abs(r)].map(P=>{let M=P.toString(2),U=M.indexOf(".");return{integer:BigInt("0b"+M.replace(".","")),exponent:U<0?0:U+1-M.length}}),l=Math.min(...c.filter(P=>P.integer!==0n).map(P=>P.exponent)),u=c.map(P=>P.integer<<BigInt(P.exponent-l)),h=u.slice(0,3).map(P=>P*P),d=h.reduce((P,M)=>P<M?P:M),m=h.map(P=>P-d),g=h.map((P,M)=>u[M]*u[M+3]),y=64;if(!g.some((P,M)=>m[M]===0n&&P!==0n)){let P=-1n,M=1n;for(let L=0;L<3;L++){if(m[L]===0n)continue;let A=m[L]*m[L];P=P*A+g[L]*g[L]*M,M*=A}if(P<0n)return!1;if(P===0n)return O(0n,1n);let C=m.filter(L=>L>0n).reduce((L,A)=>L<A?L:A);y=Math.max(64,(2n*(M+P)).toString(2).length-(P*C).toString(2).length+128)}let b=1n<<BigInt(y),w=m.map(P=>P*b),_=g.map(P=>P*b),S=_.map(P=>P*P),v=0n,T=_.reduce((P,M)=>P+M,0n);if(T===0n)return!1;for(let P=0;P<4096;P++){let M=v+T>>1n;if(M===v)return!1;let U=w[0]+M,C=w[1]+M,L=w[2]+M,A=U*U,W=C*C,G=L*L,E=S[0]*W*G+S[1]*A*G+S[2]*A*W-A*W*G;if(E===0n)return O(M,b);if(E>0n?v=M:T=M,v>0n&&T-v<=v>>60n)return O(v+T>>1n,b)}return!1;function O(P,M){let U=h.map((W,G)=>{let E=m[G]*M+P;return E===0n?0:wz(W*u[G+3]*M,E,l)});if(!U.every(Number.isFinite))return!1;let C=Math.sign(e)*U[0],L=Math.sign(t)*U[1],A=Math.sign(r)*U[2];return s.x=C,s.y=L,s.z=A,!0}}function wz(e,t,r){if(e===0n)return 0;let n=52-(e.toString(2).length-t.toString(2).length),i=n>=0?e<<BigInt(n):e,o=n>=0?t:t<<BigInt(-n),s=i/o,a=i%o;(2n*a>o||2n*a===o&&s&1n)&&s++;let c=r-n,l=Math.max(-1022,Math.min(1023,c));return Number(s)*2**l*2**(c-l)}var $4=p(()=>{});function K4(e,t,r,n,i,o,s){let a=Math.min(n,i,o),c=a*a,l=n*n,u=i*i,h=o*o;if(!(a>0)||!(c>0)||!Number.isFinite(Math.max(l,u,h)))return!1;let d=ac(a,a,c),m=l-c,g=u-c,y=h-c,b=qo(l,-c,m)+ac(n,n,l)-d,w=qo(u,-c,g)+ac(i,i,u)-d,_=qo(h,-c,y)+ac(o,o,h)-d,S=n*Math.abs(e),v=i*Math.abs(t),T=o*Math.abs(r);if(c<2**-1022||e!==0&&S<2**-1022||t!==0&&v<2**-1022||r!==0&&T<2**-1022)return co(e,t,r,n,i,o,s);let O=ac(n,Math.abs(e),S),P=ac(i,Math.abs(t),v),M=ac(o,Math.abs(r),T);if(Math.hypot(m===0?S===0?0:1/0:S/(m+b),g===0?v===0?0:1/0:v/(g+w),y===0?T===0?0:1/0:T/(y+_))<=1+64*Number.EPSILON)return co(e,t,r,n,i,o,s);if((e!==0?1:0)+(t!==0?1:0)+(r!==0?1:0)==1)return s.x=e===0?e:Math.sign(e)*n,s.y=t===0?t:Math.sign(t)*i,s.z=r===0?r:Math.sign(r)*o,!0;let C=Math.hypot(m===0?S:0,g===0?v:0,y===0?T:0),L=Math.hypot(S,v,T);if(!(L>0)||!Number.isFinite(L))return co(e,t,r,n,i,o,s);let A=C>0?C:L;for(let W=0;W<512;W++){let G=m+A,E=g+A,B=y+A,N=qo(m,A,G)+b,D=qo(g,A,E)+w,R=qo(y,A,B)+_,I=S/G,j=v/E,we=T/B,_e,ne;I>=j&&I>=we?(_e=By(S,O,m,b,A,G)*(I+1),ne=(j*(1-D/E))**2+(we*(1-R/B))**2):j>=we?(_e=By(v,P,g,w,A,E)*(j+1),ne=(I*(1-N/G))**2+(we*(1-R/B))**2):(_e=By(T,M,y,_,A,B)*(we+1),ne=(I*(1-N/G))**2+(j*(1-D/E))**2);let Oe=-2*(I*I/G+j*j/E+we*we/B),oe=4*Number.EPSILON*(Math.abs(_e)+ne),Se=_e+ne;if(!Number.isFinite(Se))return co(e,t,r,n,i,o,s);if(Math.abs(Se)<=4*Number.EPSILON*(Math.abs(_e)+ne)||L-C<=4*Number.EPSILON*A){let je=oe/Math.abs(Oe);if(!Number.isFinite(Oe)||!(Math.abs(Oe)>0)||je>2e-13*A)return co(e,t,r,n,i,o,s);let Ke=Math.sign(e)*n*(I*(1-N/G)),ft=Math.sign(t)*i*(j*(1-D/E)),ht=Math.sign(r)*o*(we*(1-R/B)),pt=2*je*Math.max(Math.abs(Ke/G),Math.abs(ft/E),Math.abs(ht/B));return!Number.isFinite(pt)||pt>2e-13*Math.max(n,i,o)?co(e,t,r,n,i,o,s):!Number.isFinite(Ke)||!Number.isFinite(ft)||!Number.isFinite(ht)?co(e,t,r,n,i,o,s):(s.x=Ke,s.y=ft,s.z=ht,!0)}Se>0?C=A:L=A;let Be=A-Se/Oe,V=Be>C&&Be<L?Be:C+(L-C)/2;if(V===A)return co(e,t,r,n,i,o,s);A=V}return co(e,t,r,n,i,o,s)}function By(e,t,r,n,i,o){let s=e-r,a=qo(e,-r,s)+t-n,c=s+a,l=qo(s,a,c),u=c-i;return(u+(qo(c,-i,u)+l))/o}function qo(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function ac(e,t,r){let n=134217729*e,i=134217729*t;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-e),s=i-(i-t),a=e-o,c=t-s;return o*s-r+o*c+a*s+a*c}var X4=p(()=>{$4()});function Y4(e,t,r=[]){let n=e,i="x"in e?n.x:e[0],o="x"in e?n.y:e[1],s="x"in e?n.z:e[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(i*i+o*o+s*s))return;let{radii:a}=t;if(K4(i,o,s,a.x,a.y,a.z,xm))return lo(r,xm.x,xm.y,xm.z)}function lo(e,t,r,n){if(ao(e))e[0]=t,e[1]=r,e[2]=n;else{let i=e;i.x=t,i.y=r,i.z=n}return e}var xm,Z4=p(()=>{Fn();X4();xm={x:0,y:0,z:0}});function J4(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0||t>e)throw new Error("Spheroid requires finite positive axes with semiMinorAxis <= semiMajorAxis")}function Mm(e,t,r,n){let i=Math.max(Math.abs(e),Math.abs(t),Math.abs(r));if(!(i>0)||!Number.isFinite(i))return;let o=e/i,s=t/i,a=r/i,c=Math.hypot(o,s,a);return lo(n,o/c,s/c,a/c)}var bn,_m,Sz,di,Sm,Tt,Q4=p(()=>{Fn();Fn();V4();H4();Z4();bn={x:0,y:0,z:0},_m=new J,Sz=new J,di=new J,Sm=new J,Tt=class e{static fromSpheroid(t){let{semiMajorAxis:r,semiMinorAxis:n}=t;return J4(r,n),new e(r,r,n)}constructor(t=0,r=0,n=0){this.centerToleranceSquared=tm.EPSILON1,Ri(Number.isFinite(t)&&t>=0),Ri(Number.isFinite(r)&&r>=0),Ri(Number.isFinite(n)&&n>=0),this.radii=new J(t,r,n),this.radiiSquared=new J(t*t,r*r,n*n),this.radiiToTheFourth=new J(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new J(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new J(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),n!==0&&(this.squaredXOverSquaredZ=(t/n)**2),t===r&&n>0&&n<=t&&Number.isFinite(this.radiiSquared.x)&&this.radiiSquared.z>0&&(this.spheroidGeometry=Object.freeze({semiMajorAxis:t,semiMinorAxis:n,eccentricitySquared:1-(n/t)**2})),Object.freeze(this.radii),Object.freeze(this.radiiSquared),Object.freeze(this.radiiToTheFourth),Object.freeze(this.oneOverRadii),Object.freeze(this.oneOverRadiiSquared),Object.freeze(this)}toSpheroid(){let{x:t,y:r,z:n}=this.radii;if(t!==r)throw new Error("Spheroid requires equal X/Y radii");return J4(t,n),Object.freeze({semiMajorAxis:t,semiMinorAxis:n})}equals(t){return this===t||!!(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=W4(t,Sm),i=n[0],o=n[1],s=n[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)||!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius))return;if(this.spheroidGeometry&&(xt._cartographicRadians||Math.abs(o)<=Math.PI/4))return bn.x=i,bn.y=o,bn.z=s,Tf(bn,this.spheroidGeometry)?lo(r,bn.x,bn.y,bn.z):void 0;let a=Sz;this.geodeticSurfaceNormalCartographic(t,a);let c=a.x,l=a.y,u=a.z,h=this.radii.x,d=this.radii.y,m=this.radii.z,g=Math.hypot(h*c,d*l,m*u),y=h*(h*c/g)+s*c,b=d*(d*l/g)+s*l,w=m*(m*u/g)+s*u;if(!(!Number.isFinite(y)||!Number.isFinite(b)||!Number.isFinite(w)))return lo(r,y,b,w)}cartesianToCartographic(t,r=[0,0,0]){let n=t,i="x"in t?n.x:t[0],o="x"in t?n.y:t[1],s="x"in t?n.z:t[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s))return;if(this.spheroidGeometry&&Number.isFinite(i*i+o*o+s*s)&&Number.isFinite(this.oneOverRadiiSquared.x)&&Number.isFinite(this.oneOverRadiiSquared.z)){bn.x=i,bn.y=o,bn.z=s;let _=this.spheroidGeometry;if(!(s===0&&_.semiMinorAxis<_.semiMajorAxis&&Math.abs(Math.hypot(i,o)-_.semiMajorAxis*_.eccentricitySquared)<=64*Number.EPSILON*_.semiMajorAxis)&&Af(bn,_)){let v=i===0&&o===0?Math.atan2(o,i):bn.x;return Oy(v,bn.y,bn.z,r)}}if(!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius)||!Number.isFinite(1/(this.minimumRadius*this.minimumRadius)))return;Sm.set(i,o,s);let a=this.scaleToGeodeticSurface(Sm,di);if(!a)return;let c=a[0]*this.oneOverRadiiSquared.x,l=a[1]*this.oneOverRadiiSquared.y,u=a[2]*this.oneOverRadiiSquared.z,h=Math.hypot(c,l,u);if(!(h>0)||!Number.isFinite(h))return;let d=c/h,m=l/h,g=u/h,y=Math.atan2(m,d),b=Math.atan2(g,Math.hypot(d,m)),w=(i-a[0])*d+(o-a[1])*m+(s-a[2])*g;return Oy(y,b,w,r)}geocentricSurfaceNormal(t,r=[0,0,0]){zo(t,_m);let n=_m;return Mm(n.x,n.y,n.z,r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=zo(t,Sm),i=xt._cartographicRadians?n[0]:n[0]*Math.PI/180,o=xt._cartographicRadians?n[1]:n[1]*Math.PI/180,s=!xt._cartographicRadians&&Math.abs(n[1])>45,a=(90-Math.abs(n[1]))*Math.PI/180,c=s?Math.sin(a):Math.abs(o)===Math.PI/2?0:Math.cos(o),l=s?Math.sign(n[1])*Math.cos(a):Math.sin(o);return Mm(c*Math.cos(i),c*Math.sin(i),l,r)}geodeticSurfaceNormal(t,r=[0,0,0]){if(!(this.minimumRadius>0))return;zo(t,_m);let n=_m,i=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(n.z));if(!(i>0)||!Number.isFinite(i))return;let o=n.x/i*(this.minimumRadius/this.radii.x)**2,s=n.y/i*(this.minimumRadius/this.radii.y)**2,a=n.z/i*(this.minimumRadius/this.radii.z)**2;if((n.x===0||Math.abs(o)>=2**-1022)&&(n.y===0||Math.abs(s)>=2**-1022)&&(n.z===0||Math.abs(a)>=2**-1022))return Mm(o,s,a,r);let c=n.x===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.x)))),l=n.y===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.y)))),u=n.z===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.z)))),h=Math.min(1023,Math.floor(Math.log2(this.radii.x))),d=Math.min(1023,Math.floor(Math.log2(this.radii.y))),m=Math.min(1023,Math.floor(Math.log2(this.radii.z))),g=Math.max(n.x===0?-1/0:c-2*h,n.y===0?-1/0:l-2*d,n.z===0?-1/0:u-2*m);return Mm(n.x===0?n.x:n.x/2**c/(this.radii.x/2**h)**2*2**(c-2*h-g),n.y===0?n.y:n.y/2**l/(this.radii.y/2**d)**2*2**(l-2*d-g),n.z===0?n.z:n.z/2**u/(this.radii.z/2**m)**2*2**(u-2*m-g),r)}scaleToGeodeticSurface(t,r){return Y4(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){zo(t,di);let n=di,i=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(n.z));if(!(this.minimumRadius>0)||!(i>0)||!Number.isFinite(i))return;let o=n.x*n.x*this.oneOverRadiiSquared.x+n.y*n.y*this.oneOverRadiiSquared.y+n.z*n.z*this.oneOverRadiiSquared.z;if(o>=2**-1022&&Number.isFinite(o)&&i*i>=2**-1022&&Number.isFinite(i*i)){let u=1/Math.sqrt(o);return lo(r,n.x*u,n.y*u,n.z*u)}let s=n.x/i,a=n.y/i,c=n.z/i,l=Math.hypot(s/this.radii.x,a/this.radii.y,c/this.radii.z);if(!(!(l>0)||!Number.isFinite(l)))return lo(r,s/l,a/l,c/l)}transformPositionToScaledSpace(t,r=[0,0,0]){zo(t,di);let n=di.scale(this.oneOverRadii);return lo(r,n.x,n.y,n.z)}transformPositionFromScaledSpace(t,r=[0,0,0]){zo(t,di);let n=di.scale(this.radii);return lo(r,n.x,n.y,n.z)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){if(Ri(this.radii.x===this.radii.y&&this.minimumRadius>0),zo(t,di),!Number.isFinite(di.x)||!Number.isFinite(di.y)||!Number.isFinite(di.z)||!Number.isFinite(r))return;let i=di.z*(1-this.squaredXOverSquaredZ);if(Number.isFinite(i)&&!(Math.abs(i)>=this.radii.z-r))return lo(n,0,0,i)}};Tt.WGS84=new Tt(6378137,6378137,jo)});var er,eT=p(()=>{er={};er.Constants={};er.Math={};er.Accumulator={};(function(e){"use strict";e.WGS84={a:6378137,f:1/298.257223563},e.version={major:2,minor:2,patch:0},e.version_string="2.2.0"})(er.Constants);(function(e){"use strict";e.digits=53,e.epsilon=Math.pow(.5,e.digits-1),e.degree=Math.PI/180,e.sq=function(t){return t*t},e.hypot=function(t,r){return Math.sqrt(t*t+r*r)},e.cbrt=Math.cbrt||function(t){var r=Math.pow(Math.abs(t),.3333333333333333);return t>0?r:t<0?-r:t},e.log1p=Math.log1p||function(t){var r=1+t,n=r-1;return n===0?t:t*Math.log(r)/n},e.atanh=Math.atanh||function(t){var r=Math.abs(t);return r=e.log1p(2*r/(1-r))/2,t>0?r:t<0?-r:t},e.copysign=function(t,r){return Math.abs(t)*(r<0||r===0&&1/r<0?-1:1)},e.sum=function(t,r){var n=t+r,i=n-r,o=n-i,s;return i-=t,o-=r,s=n&&0-(i+o),{s:n,t:s}},e.polyval=function(t,r,n,i){for(var o=t<0?0:r[n++];--t>=0;)o=o*i+r[n++];return o},e.AngRound=function(t){var r=.0625,n=Math.abs(t);return n=n<r?r-(r-n):n,e.copysign(n,t)},e.remainder=function(t,r){return t%=r,t<-r/2?t+r:t<r/2?t:t-r},e.AngNormalize=function(t){var r=e.remainder(t,360);return Math.abs(r)===180?e.copysign(180,t):r},e.LatFix=function(t){return Math.abs(t)>90?NaN:t},e.AngDiff=function(t,r){var n=e.sum(e.remainder(-t,360),e.remainder(r,360)),i,o;return n=e.sum(e.remainder(n.s,360),n.t),i=n.s,o=n.t,(i===0||Math.abs(i)===180)&&(i=e.copysign(i,o===0?r-t:-o)),{d:i,e:o}},e.sincosd=function(t){var r,n,i,o,s,a,c;switch(r=t%360,i=Math.round(r/90),r-=90*i,n=r*this.degree,o=Math.sin(n),s=Math.cos(n),Math.abs(r)===45?(s=Math.sqrt(.5),o=e.copysign(s,n)):Math.abs(r)===30&&(s=Math.sqrt(.75),o=e.copysign(.5,n)),i&3){case 0:a=o,c=s;break;case 1:a=s,c=-o;break;case 2:a=-o,c=-s;break;default:a=-s,c=o;break}return c+=0,a===0&&(a=e.copysign(a,t)),{s:a,c}},e.sincosde=function(t,r){var n,i,o,s,a,c,l;switch(n=t%360,o=Math.round(n/90),n=e.AngRound(n-90*o+r),i=n*this.degree,s=Math.sin(i),a=Math.cos(i),Math.abs(n)===45?(a=Math.sqrt(.5),s=e.copysign(a,i)):Math.abs(n)===30&&(a=Math.sqrt(.75),s=e.copysign(.5,i)),o&3){case 0:c=s,l=a;break;case 1:c=a,l=-s;break;case 2:c=-s,l=-a;break;default:c=-a,l=s;break}return l+=0,c===0&&(c=e.copysign(c,t+r)),{s:c,c:l}},e.atan2d=function(t,r){var n=0,i;switch(Math.abs(t)>Math.abs(r)&&([t,r]=[r,t],n=2),e.copysign(1,r)<0&&(r=-r,++n),i=Math.atan2(t,r)/this.degree,n){case 1:i=e.copysign(180,t)-i;break;case 2:i=90-i;break;case 3:i=-90+i;break;default:break}return i}})(er.Math);(function(e,t){"use strict";e.Accumulator=function(r){this.Set(r)},e.Accumulator.prototype.Set=function(r){r||(r=0),r.constructor===e.Accumulator?(this._s=r._s,this._t=r._t):(this._s=r,this._t=0)},e.Accumulator.prototype.Add=function(r){var n=t.sum(r,this._t),i=t.sum(n.s,this._s);n=n.t,this._s=i.s,this._t=i.t,this._s===0?this._s=n:this._t+=n},e.Accumulator.prototype.Sum=function(r){var n;return r?(n=new e.Accumulator(this),n.Add(r),n._s):this._s},e.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},e.Accumulator.prototype.Remainder=function(r){this._s=t.remainder(this._s,r),this.Add(0)}})(er.Accumulator,er.Math);er.Geodesic={};er.GeodesicLine={};er.PolygonArea={};(function(e,t,r,n,i){"use strict";var o=6,s=o,a=o,c=o,l=c,u,h,d=20,m=d+n.digits+10,g=n.epsilon,y=200*g,b=Math.sqrt(g),w=g,_=1e3*b,S=0,v=31,T=32640,O,P,M,U,C,L,A,W,G;e.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),e.nC1_=o,e.nC1p_=o,e.nC2_=o,e.nC3_=o,e.nC4_=o,u=e.nC3_*(e.nC3_-1)/2,h=e.nC4_*(e.nC4_+1)/2,e.CAP_C1=1,e.CAP_C1p=2,e.CAP_C2=4,e.CAP_C3=8,e.CAP_C4=16,e.NONE=0,e.ARC=64,e.LATITUDE=128|S,e.LONGITUDE=256|e.CAP_C3,e.AZIMUTH=512|S,e.DISTANCE=1024|e.CAP_C1,e.STANDARD=e.LATITUDE|e.LONGITUDE|e.AZIMUTH|e.DISTANCE,e.DISTANCE_IN=2048|e.CAP_C1|e.CAP_C1p,e.REDUCEDLENGTH=4096|e.CAP_C1|e.CAP_C2,e.GEODESICSCALE=8192|e.CAP_C1|e.CAP_C2,e.AREA=16384|e.CAP_C4,e.ALL=T|v,e.LONG_UNROLL=32768,e.OUT_MASK=T|e.LONG_UNROLL,e.SinCosSeries=function(E,B,N,D,R){if(R!==void 0){var I=R/2,j=Math.sin(I),we=Math.cos(I);return-2*e.SinCosSeries(!1,N*we-B*j,B*we+N*j,D.map(function(Be,V){return(V%2?-Be:Be)*Math.sin((2*V+1)*I)}))}var _e=D.length,ne=_e-(E?1:0),Oe=2*(N-B)*(N+B),oe=ne&1?D[--_e]:0,Se=0;for(ne=Math.floor(ne/2);ne--;)Se=Oe*oe-Se+D[--_e],oe=Oe*Se-oe+D[--_e];return E?2*B*N*oe:N*(oe-Se)},O=function(E,B){var N,D=n.sq(E),R=n.sq(B),I=(D+R-1)/6,j,we,_e,ne,Oe,oe,Se,Be,V,je,Ke;return R===0&&I<=0?N=0:(j=D*R/4,we=n.sq(I),_e=I*we,ne=j*(j+2*_e),Oe=I,ne>=0?(oe=j+_e,oe+=oe<0?-Math.sqrt(ne):Math.sqrt(ne),Se=n.cbrt(oe),Oe+=Se+(Se!==0?we/Se:0)):(Be=Math.atan2(Math.sqrt(-ne),-(j+_e)),Oe+=2*I*Math.cos(Be/3)),V=Math.sqrt(n.sq(Oe)+R),je=Oe<0?R/(V-Oe):Oe+V,Ke=(je-R)/(2*V),N=je/(Math.sqrt(je+n.sq(Ke))+Ke)),N},P=[1,4,64,0,256],e.A1m1f=function(E){var B=Math.floor(s/2),N=n.polyval(B,P,0,n.sq(E))/P[B+1];return(N+E)/(1-E)},M=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],e.C1f=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC1_;++I)j=Math.floor((e.nC1_-I)/2),B[I]=D*n.polyval(j,M,R,N)/M[R+j+1],R+=j+2,D*=E},U=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],e.C1pf=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC1p_;++I)j=Math.floor((e.nC1p_-I)/2),B[I]=D*n.polyval(j,U,R,N)/U[R+j+1],R+=j+2,D*=E},C=[-11,-28,-192,0,256],e.A2m1f=function(E){var B=Math.floor(a/2),N=n.polyval(B,C,0,n.sq(E))/C[B+1];return(N-E)/(1+E)},L=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],e.C2f=function(E,B){var N=n.sq(E),D=E,R=0,I,j;for(I=1;I<=e.nC2_;++I)j=Math.floor((e.nC2_-I)/2),B[I]=D*n.polyval(j,L,R,N)/L[R+j+1],R+=j+2,D*=E},e.Geodesic=function(E,B){if(this.a=E,this.f=B,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/n.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(n.sq(this.a)+n.sq(this._b)*(this._e2===0?1:(this._e2>0?n.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*b/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(l),this._C3x=new Array(u),this._C4x=new Array(h),this.A3coeff(),this.C3coeff(),this.C4coeff()},A=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],e.Geodesic.prototype.A3coeff=function(){var E=0,B=0,N,D;for(N=c-1;N>=0;--N)D=Math.min(c-N-1,N),this._A3x[B++]=n.polyval(D,A,E,this._n)/A[E+D+1],E+=D+2},W=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],e.Geodesic.prototype.C3coeff=function(){var E=0,B=0,N,D,R;for(N=1;N<e.nC3_;++N)for(D=e.nC3_-1;D>=N;--D)R=Math.min(e.nC3_-D-1,D),this._C3x[B++]=n.polyval(R,W,E,this._n)/W[E+R+1],E+=R+2},G=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],e.Geodesic.prototype.C4coeff=function(){var E=0,B=0,N,D,R;for(N=0;N<e.nC4_;++N)for(D=e.nC4_-1;D>=N;--D)R=e.nC4_-D-1,this._C4x[B++]=n.polyval(R,G,E,this._n)/G[E+R+1],E+=R+2},e.Geodesic.prototype.A3f=function(E){return n.polyval(l-1,this._A3x,0,E)},e.Geodesic.prototype.C3f=function(E,B){var N=1,D=0,R,I;for(R=1;R<e.nC3_;++R)I=e.nC3_-R-1,N*=E,B[R]=N*n.polyval(I,this._C3x,D,E),D+=I+1},e.Geodesic.prototype.C4f=function(E,B){var N=1,D=0,R,I;for(R=0;R<e.nC4_;++R)I=e.nC4_-R-1,B[R]=N*n.polyval(I,this._C4x,D,E),D+=I+1,N*=E},e.Geodesic.prototype.Lengths=function(E,B,N,D,R,I,j,we,_e,ne,Oe,oe,Se){Oe&=e.OUT_MASK;var Be={},V=0,je=0,Ke=0,ft=0,ht,pt,Lt,Zt,gr;if(Oe&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&(Ke=e.A1m1f(E),e.C1f(E,oe),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(ft=e.A2m1f(E),e.C2f(E,Se),V=Ke-ft,ft=1+ft),Ke=1+Ke),Oe&e.DISTANCE)ht=e.SinCosSeries(!0,I,j,oe)-e.SinCosSeries(!0,N,D,oe),Be.s12b=Ke*(B+ht),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(pt=e.SinCosSeries(!0,I,j,Se)-e.SinCosSeries(!0,N,D,Se),je=V*B+(Ke*ht-ft*pt));else if(Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)){for(Lt=1;Lt<=e.nC2_;++Lt)Se[Lt]=Ke*oe[Lt]-ft*Se[Lt];je=V*B+(e.SinCosSeries(!0,I,j,Se)-e.SinCosSeries(!0,N,D,Se))}return Oe&e.REDUCEDLENGTH?(Be.m0=V,Be.m12b=we*(D*I)-R*(N*j)-D*j*je):Be.m12b=NaN,Oe&e.GEODESICSCALE&&(Zt=D*j+N*I,gr=this._ep2*(_e-ne)*(_e+ne)/(R+we),Be.M12=Zt+(gr*I-j*je)*N/R,Be.M21=Zt-(gr*N-D*je)*I/we),Be},e.Geodesic.prototype.InverseStart=function(E,B,N,D,R,I,j,we,_e,ne,Oe){var oe={},Se=D*B-R*E,Be=R*B+D*E,V,je,Ke,ft,ht,pt,Lt,Zt,gr,Ve,qe,We,zt,yr,Ss,Ms,Qu,Zi,rt,Yr,Sr,dn,Cn;return oe.sig12=-1,V=D*B,V+=R*E,je=Be>=0&&Se<.5&&R*j<.5,je?(ft=n.sq(E+D),ft/=ft+n.sq(B+R),oe.dnm=Math.sqrt(1+this._ep2*ft),Ke=j/(this._f1*oe.dnm),ht=Math.sin(Ke),pt=Math.cos(Ke)):(ht=we,pt=_e),oe.salp1=R*ht,oe.calp1=pt>=0?Se+R*E*n.sq(ht)/(1+pt):V-R*E*n.sq(ht)/(1-pt),Zt=n.hypot(oe.salp1,oe.calp1),gr=E*D+B*R*pt,je&&Zt<this._etol2?(oe.salp2=B*ht,oe.calp2=Se-B*D*(pt>=0?n.sq(ht)/(1+pt):1-pt),Lt=n.hypot(oe.salp2,oe.calp2),oe.salp2/=Lt,oe.calp2/=Lt,oe.sig12=Math.atan2(Zt,gr)):Math.abs(this._n)>.1||gr>=0||Zt>=6*Math.abs(this._n)*Math.PI*n.sq(B)||(Cn=Math.atan2(-we,-_e),this.f>=0?(yr=n.sq(E)*this._ep2,Ss=yr/(2*(1+Math.sqrt(1+yr))+yr),We=this.f*B*this.A3f(Ss)*Math.PI,zt=We*B,Ve=Cn/We,qe=V/zt):(Ms=R*B-D*E,Qu=Math.atan2(V,Ms),Yr=this.Lengths(this._n,Math.PI+Qu,E,-B,N,D,R,I,B,R,e.REDUCEDLENGTH,ne,Oe),Zi=Yr.m12b,rt=Yr.m0,Ve=-1+Zi/(B*R*rt*Math.PI),zt=Ve<-.01?V/Ve:-this.f*n.sq(B)*Math.PI,We=zt/B,qe=j/We),qe>-y&&Ve>-1-_?this.f>=0?(oe.salp1=Math.min(1,-Ve),oe.calp1=-Math.sqrt(1-n.sq(oe.salp1))):(oe.calp1=Math.max(Ve>-y?0:-1,Ve),oe.salp1=Math.sqrt(1-n.sq(oe.calp1))):(Sr=O(Ve,qe),dn=We*(this.f>=0?-Ve*Sr/(1+Sr):-qe*(1+Sr)/Sr),ht=Math.sin(dn),pt=-Math.cos(dn),oe.salp1=R*ht,oe.calp1=V-R*E*n.sq(ht)/(1-pt))),oe.salp1<=0?(oe.salp1=1,oe.calp1=0):(Lt=n.hypot(oe.salp1,oe.calp1),oe.salp1/=Lt,oe.calp1/=Lt),oe},e.Geodesic.prototype.Lambda12=function(E,B,N,D,R,I,j,we,_e,ne,Oe,oe,Se,Be){var V={},je,Ke,ft,ht,pt,Lt,Zt,gr,Ve,qe,We,zt,yr;return E===0&&we===0&&(we=-e.tiny_),Ke=j*B,ft=n.hypot(we,j*E),V.ssig1=E,ht=Ke*E,V.csig1=pt=we*B,je=n.hypot(V.ssig1,V.csig1),V.ssig1/=je,V.csig1/=je,V.salp2=R!==B?Ke/R:j,V.calp2=R!==B||Math.abs(D)!==-E?Math.sqrt(n.sq(we*B)+(B<-E?(R-B)*(B+R):(E-D)*(E+D)))/R:Math.abs(we),V.ssig2=D,Lt=Ke*D,V.csig2=Zt=V.calp2*R,je=n.hypot(V.ssig2,V.csig2),V.ssig2/=je,V.csig2/=je,V.sig12=Math.atan2(Math.max(0,V.csig1*V.ssig2-V.ssig1*V.csig2),V.csig1*V.csig2+V.ssig1*V.ssig2),gr=Math.max(0,pt*Lt-ht*Zt),Ve=pt*Zt+ht*Lt,We=Math.atan2(gr*ne-Ve*_e,Ve*ne+gr*_e),zt=n.sq(ft)*this._ep2,V.eps=zt/(2*(1+Math.sqrt(1+zt))+zt),this.C3f(V.eps,Be),qe=e.SinCosSeries(!0,V.ssig2,V.csig2,Be)-e.SinCosSeries(!0,V.ssig1,V.csig1,Be),V.domg12=-this.f*this.A3f(V.eps)*Ke*(V.sig12+qe),V.lam12=We+V.domg12,Oe&&(V.calp2===0?V.dlam12=-2*this._f1*N/E:(yr=this.Lengths(V.eps,V.sig12,V.ssig1,V.csig1,N,V.ssig2,V.csig2,I,B,R,e.REDUCEDLENGTH,oe,Se),V.dlam12=yr.m12b,V.dlam12*=this._f1/(V.calp2*R))),V},e.Geodesic.prototype.Inverse=function(E,B,N,D,R){var I,j;return R||(R=e.STANDARD),R===e.LONG_UNROLL&&(R|=e.STANDARD),R&=e.OUT_MASK,I=this.InverseInt(E,B,N,D,R),j=I.vals,R&e.AZIMUTH&&(j.azi1=n.atan2d(I.salp1,I.calp1),j.azi2=n.atan2d(I.salp2,I.calp2)),j},e.Geodesic.prototype.InverseInt=function(E,B,N,D,R){var I={},j,we,_e,ne,Oe,oe,Se,Be,V,je,Ke,ft,ht,pt,Lt,Zt,gr,Ve,qe,We,zt,yr,Ss,Ms,Qu,Zi,rt,Yr,Sr,dn,Cn,td,rd,dl,Xa,ef,tf,rf,nf,nd,S1,ml,M1,id,v1,E1,T1,N_,A1,od,I1,sd,F_,of,G_,k_,sf,ad,af,P1,R1,cd,ld,L1,O1;if(I.lat1=E=n.LatFix(E),I.lat2=N=n.LatFix(N),E=n.AngRound(E),N=n.AngRound(N),j=n.AngDiff(B,D),we=j.e,j=j.d,R&e.LONG_UNROLL?(I.lon1=B,I.lon2=B+j+we):(I.lon1=n.AngNormalize(B),I.lon2=n.AngNormalize(D)),_e=n.copysign(1,j),j*=_e,we*=_e,Lt=j*n.degree,ne=n.sincosde(j,we),Zt=ne.s,gr=ne.c,we=180-j-we,Oe=Math.abs(E)<Math.abs(N)||isNaN(N)?-1:1,Oe<0&&(_e*=-1,[N,E]=[E,N]),oe=n.copysign(1,-E),E*=oe,N*=oe,ne=n.sincosd(E),Se=this._f1*ne.s,Be=ne.c,ne=n.hypot(Se,Be),Se/=ne,Be/=ne,Be=Math.max(e.tiny_,Be),ne=n.sincosd(N),V=this._f1*ne.s,je=ne.c,ne=n.hypot(V,je),V/=ne,je/=ne,je=Math.max(e.tiny_,je),Be<-Se?je===Be&&(V=n.copysign(Se,V)):Math.abs(V)===-Se&&(je=Be),ht=Math.sqrt(1+this._ep2*n.sq(Se)),pt=Math.sqrt(1+this._ep2*n.sq(V)),Ss=new Array(e.nC1_+1),Ms=new Array(e.nC2_+1),Qu=new Array(e.nC3_),Zi=E===-90||Zt===0,Zi&&(qe=gr,We=Zt,zt=1,yr=0,Yr=Se,Sr=qe*Be,dn=V,Cn=zt*je,Ve=Math.atan2(Math.max(0,Sr*dn-Yr*Cn),Sr*Cn+Yr*dn),rt=this.Lengths(this._n,Ve,Yr,Sr,ht,dn,Cn,pt,Be,je,R|e.DISTANCE|e.REDUCEDLENGTH,Ss,Ms),Ke=rt.s12b,ft=rt.m12b,R&e.GEODESICSCALE&&(I.M12=rt.M12,I.M21=rt.M21),Ve<b||ft>=0?((Ve<3*e.tiny_||Ve<g&&(Ke<0||ft<0))&&(Ve=ft=Ke=0),ft*=this._b,Ke*=this._b,I.a12=Ve/n.degree):Zi=!1),sf=2,!Zi&&Se===0&&(this.f<=0||we>=this.f*180))qe=zt=0,We=yr=1,Ke=this.a*Lt,Ve=rd=Lt/this._f1,ft=this._b*Math.sin(Ve),R&e.GEODESICSCALE&&(I.M12=I.M21=Math.cos(Ve)),I.a12=j/this._f1;else if(!Zi)if(rt=this.InverseStart(Se,Be,ht,V,je,pt,Lt,Zt,gr,Ss,Ms),Ve=rt.sig12,We=rt.salp1,qe=rt.calp1,Ve>=0)yr=rt.salp2,zt=rt.calp2,dl=rt.dnm,Ke=Ve*this._b*dl,ft=n.sq(dl)*this._b*Math.sin(Ve/dl),R&e.GEODESICSCALE&&(I.M12=I.M21=Math.cos(Ve/dl)),I.a12=Ve/n.degree,rd=Lt/(this._f1*dl);else{for(Xa=0,ef=e.tiny_,tf=1,rf=e.tiny_,nf=-1,nd=!1,S1=!1;rt=this.Lambda12(Se,Be,ht,V,je,pt,We,qe,Zt,gr,Xa<d,Ss,Ms,Qu),ml=rt.lam12,yr=rt.salp2,zt=rt.calp2,Ve=rt.sig12,Yr=rt.ssig1,Sr=rt.csig1,dn=rt.ssig2,Cn=rt.csig2,td=rt.eps,af=rt.domg12,M1=rt.dlam12,!(S1||!(Math.abs(ml)>=(nd?8:1)*g)||Xa==m);++Xa){if(ml>0&&(Xa<d||qe/We>nf/rf)?(rf=We,nf=qe):ml<0&&(Xa<d||qe/We<tf/ef)&&(ef=We,tf=qe),Xa<d&&M1>0&&(id=-ml/M1,Math.abs(id)<Math.PI&&(v1=Math.sin(id),E1=Math.cos(id),T1=We*E1+qe*v1,T1>0))){qe=qe*E1-We*v1,We=T1,ne=n.hypot(We,qe),We/=ne,qe/=ne,nd=Math.abs(ml)<=16*g;continue}We=(ef+rf)/2,qe=(tf+nf)/2,ne=n.hypot(We,qe),We/=ne,qe/=ne,nd=!1,S1=Math.abs(ef-We)+(tf-qe)<w||Math.abs(We-rf)+(qe-nf)<w}N_=R|(R&(e.REDUCEDLENGTH|e.GEODESICSCALE)?e.DISTANCE:e.NONE),rt=this.Lengths(td,Ve,Yr,Sr,ht,dn,Cn,pt,Be,je,N_,Ss,Ms),Ke=rt.s12b,ft=rt.m12b,R&e.GEODESICSCALE&&(I.M12=rt.M12,I.M21=rt.M21),ft*=this._b,Ke*=this._b,I.a12=Ve/n.degree,R&e.AREA&&(L1=Math.sin(af),O1=Math.cos(af),sf=Zt*O1-gr*L1,ad=gr*O1+Zt*L1)}return R&e.DISTANCE&&(I.s12=0+Ke),R&e.REDUCEDLENGTH&&(I.m12=0+ft),R&e.AREA&&(A1=We*Be,od=n.hypot(qe,We*Se),od!==0&&A1!==0?(Yr=Se,Sr=qe*Be,dn=V,Cn=zt*je,sd=n.sq(od)*this._ep2,td=sd/(2*(1+Math.sqrt(1+sd))+sd),F_=n.sq(this.a)*od*A1*this._e2,ne=n.hypot(Yr,Sr),Yr/=ne,Sr/=ne,ne=n.hypot(dn,Cn),dn/=ne,Cn/=ne,of=new Array(e.nC4_),this.C4f(td,of),G_=e.SinCosSeries(!1,Yr,Sr,of),k_=e.SinCosSeries(!1,dn,Cn,of),I.S12=F_*(Ve<.01?e.SinCosSeries(!1,Yr,Sr,of,Ve):k_-G_)):I.S12=0,!Zi&&sf==2&&(sf=Math.sin(rd),ad=Math.cos(rd)),!Zi&&ad>-.7071&&V-Se<1.75?(af=1+ad,P1=1+Be,R1=1+je,I1=2*Math.atan2(sf*(Se*R1+V*P1),af*(Se*V+P1*R1))):(cd=yr*qe-zt*We,ld=zt*qe+yr*We,cd===0&&ld<0&&(cd=e.tiny_*qe,ld=-1),I1=Math.atan2(cd,ld)),I.S12+=this._c2*I1,I.S12*=Oe*_e*oe,I.S12+=0),Oe<0&&([yr,We]=[We,yr],[zt,qe]=[qe,zt],R&e.GEODESICSCALE&&([I.M21,I.M12]=[I.M12,I.M21])),We*=Oe*_e,qe*=Oe*oe,yr*=Oe*_e,zt*=Oe*oe,{vals:I,salp1:We,calp1:qe,salp2:yr,calp2:zt}},e.Geodesic.prototype.GenDirect=function(E,B,N,D,R,I){var j;return I?I===e.LONG_UNROLL&&(I|=e.STANDARD):I=e.STANDARD,D||(I|=e.DISTANCE_IN),j=new t.GeodesicLine(this,E,B,N,I),j.GenPosition(D,R,I)},e.Geodesic.prototype.Direct=function(E,B,N,D,R){return this.GenDirect(E,B,N,!1,D,R)},e.Geodesic.prototype.ArcDirect=function(E,B,N,D,R){return this.GenDirect(E,B,N,!0,D,R)},e.Geodesic.prototype.Line=function(E,B,N,D){return new t.GeodesicLine(this,E,B,N,D)},e.Geodesic.prototype.DirectLine=function(E,B,N,D,R){return this.GenDirectLine(E,B,N,!1,D,R)},e.Geodesic.prototype.ArcDirectLine=function(E,B,N,D,R){return this.GenDirectLine(E,B,N,!0,D,R)},e.Geodesic.prototype.GenDirectLine=function(E,B,N,D,R,I){var j;return I||(I=e.STANDARD|e.DISTANCE_IN),D||(I|=e.DISTANCE_IN),j=new t.GeodesicLine(this,E,B,N,I),j.GenSetDistance(D,R),j},e.Geodesic.prototype.InverseLine=function(E,B,N,D,R){var I,j,we;return R||(R=e.STANDARD|e.DISTANCE_IN),I=this.InverseInt(E,B,N,D,e.ARC),we=n.atan2d(I.salp1,I.calp1),R&(e.OUT_MASK&e.DISTANCE_IN)&&(R|=e.DISTANCE),j=new t.GeodesicLine(this,E,B,we,R,I.salp1,I.calp1),j.SetArc(I.vals.a12),j},e.Geodesic.prototype.Polygon=function(E){return new r.PolygonArea(this,E)},e.WGS84=new e.Geodesic(i.WGS84.a,i.WGS84.f)})(er.Geodesic,er.GeodesicLine,er.PolygonArea,er.Math,er.Constants);(function(e,t,r){"use strict";t.GeodesicLine=function(n,i,o,s,a,c,l){var u,h,d,m,g,y;a||(a=e.STANDARD|e.DISTANCE_IN),this.a=n.a,this.f=n.f,this._b=n._b,this._c2=n._c2,this._f1=n._f1,this.caps=a|e.LATITUDE|e.AZIMUTH|e.LONG_UNROLL,this.lat1=r.LatFix(i),this.lon1=o,typeof c>"u"||typeof l>"u"?(this.azi1=r.AngNormalize(s),u=r.sincosd(r.AngRound(this.azi1)),this.salp1=u.s,this.calp1=u.c):(this.azi1=s,this.salp1=c,this.calp1=l),u=r.sincosd(r.AngRound(this.lat1)),d=this._f1*u.s,h=u.c,u=r.hypot(d,h),d/=u,h/=u,h=Math.max(e.tiny_,h),this._dn1=Math.sqrt(1+n._ep2*r.sq(d)),this._salp0=this.salp1*h,this._calp0=r.hypot(this.calp1,this.salp1*d),this._ssig1=d,this._somg1=this._salp0*d,this._csig1=this._comg1=d!==0||this.calp1!==0?h*this.calp1:1,u=r.hypot(this._ssig1,this._csig1),this._ssig1/=u,this._csig1/=u,this._k2=r.sq(this._calp0)*n._ep2,m=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&e.CAP_C1&&(this._A1m1=e.A1m1f(m),this._C1a=new Array(e.nC1_+1),e.C1f(m,this._C1a),this._B11=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),g=Math.sin(this._B11),y=Math.cos(this._B11),this._stau1=this._ssig1*y+this._csig1*g,this._ctau1=this._csig1*y-this._ssig1*g),this.caps&e.CAP_C1p&&(this._C1pa=new Array(e.nC1p_+1),e.C1pf(m,this._C1pa)),this.caps&e.CAP_C2&&(this._A2m1=e.A2m1f(m),this._C2a=new Array(e.nC2_+1),e.C2f(m,this._C2a),this._B21=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&e.CAP_C3&&(this._C3a=new Array(e.nC3_),n.C3f(m,this._C3a),this._A3c=-this.f*this._salp0*n.A3f(m),this._B31=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&e.CAP_C4&&(this._C4a=new Array(e.nC4_),n.C4f(m,this._C4a),this._A4=r.sq(this.a)*this._calp0*this._salp0*n._e2,this._B41=e.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},t.GeodesicLine.prototype.GenPosition=function(n,i,o,s={}){var a,c,l,u,h,d,m,g,y,b,w,_,S,v,T,O,P,M,U,C,L,A,W,G,E,B,N,D,R;return o?o===e.LONG_UNROLL&&(o|=e.STANDARD):o=e.STANDARD,o&=this.caps&e.OUT_MASK,s.lat1=this.lat1,s.azi1=this.azi1,s.lon1=o&e.LONG_UNROLL?this.lon1:r.AngNormalize(this.lon1),n?s.a12=i:s.s12=i,n||this.caps&e.DISTANCE_IN&e.OUT_MASK?(u=0,h=0,n?(a=i*r.degree,B=r.sincosd(i),c=B.s,l=B.c):(g=i/(this._b*(1+this._A1m1)),y=Math.sin(g),b=Math.cos(g),u=-e.SinCosSeries(!0,this._stau1*b+this._ctau1*y,this._ctau1*b-this._stau1*y,this._C1pa),a=g-(u-this._B11),c=Math.sin(a),l=Math.cos(a),Math.abs(this.f)>.01&&(d=this._ssig1*l+this._csig1*c,m=this._csig1*l-this._ssig1*c,u=e.SinCosSeries(!0,d,m,this._C1a),w=(1+this._A1m1)*(a+(u-this._B11))-i/this._b,a=a-w/Math.sqrt(1+this._k2*r.sq(d)),c=Math.sin(a),l=Math.cos(a))),d=this._ssig1*l+this._csig1*c,m=this._csig1*l-this._ssig1*c,A=Math.sqrt(1+this._k2*r.sq(d)),o&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&((n||Math.abs(this.f)>.01)&&(u=e.SinCosSeries(!0,d,m,this._C1a)),h=(1+this._A1m1)*(u-this._B11)),O=this._calp0*d,P=r.hypot(this._salp0,this._calp0*m),P===0&&(P=m=e.tiny_),C=this._salp0,L=this._calp0*m,n&&o&e.DISTANCE&&(s.s12=this._b*((1+this._A1m1)*a+h)),o&e.LONGITUDE&&(M=this._salp0*d,U=m,T=r.copysign(1,this._salp0),_=o&e.LONG_UNROLL?T*(a-(Math.atan2(d,m)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(T*M,U)-Math.atan2(T*this._somg1,this._comg1))):Math.atan2(M*this._comg1-U*this._somg1,U*this._comg1+M*this._somg1),S=_+this._A3c*(a+(e.SinCosSeries(!0,d,m,this._C3a)-this._B31)),v=S/r.degree,s.lon2=o&e.LONG_UNROLL?this.lon1+v:r.AngNormalize(r.AngNormalize(this.lon1)+r.AngNormalize(v))),o&e.LATITUDE&&(s.lat2=r.atan2d(O,this._f1*P)),o&e.AZIMUTH&&(s.azi2=r.atan2d(C,L)),o&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(W=e.SinCosSeries(!0,d,m,this._C2a),G=(1+this._A2m1)*(W-this._B21),E=(this._A1m1-this._A2m1)*a+(h-G),o&e.REDUCEDLENGTH&&(s.m12=this._b*(A*(this._csig1*d)-this._dn1*(this._ssig1*m)-this._csig1*m*E)),o&e.GEODESICSCALE&&(B=this._k2*(d-this._ssig1)*(d+this._ssig1)/(this._dn1+A),s.M12=l+(B*d-m*E)*this._ssig1/this._dn1,s.M21=l-(B*this._ssig1-this._csig1*E)*d/A)),o&e.AREA&&(N=e.SinCosSeries(!1,d,m,this._C4a),this._calp0===0||this._salp0===0?(D=C*this.calp1-L*this.salp1,R=L*this.calp1+C*this.salp1):(D=this._calp0*this._salp0*(l<=0?this._csig1*(1-l)+c*this._ssig1:c*(this._csig1*c/(1+l)+this._ssig1)),R=r.sq(this._salp0)+r.sq(this._calp0)*this._csig1*m),s.S12=this._c2*Math.atan2(D,R)+this._A4*(Math.abs(a)<.01?e.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a,a):N-this._B41)),n||(s.a12=a/r.degree),s):(s.a12=NaN,s)},t.GeodesicLine.prototype.Position=function(n,i){return this.GenPosition(!1,n,i)},t.GeodesicLine.prototype.ArcPosition=function(n,i){return this.GenPosition(!0,n,i)},t.GeodesicLine.prototype.GenSetDistance=function(n,i){n?this.SetArc(i):this.SetDistance(i)},t.GeodesicLine.prototype.SetDistance=function(n){var i;this.s13=n,i=this.GenPosition(!1,this.s13,e.ARC),this.a13=0+i.a12},t.GeodesicLine.prototype.SetArc=function(n){var i;this.a13=n,i=this.GenPosition(!0,this.a13,e.DISTANCE),this.s13=0+i.s12}})(er.Geodesic,er.GeodesicLine,er.Math)});function tT(e){if(!Number.isFinite(e))throw new Error("Nonfinite axis, azimuth, distance or arc")}function rT({semiMajorAxis:e,semiMinorAxis:t}){return tT(e),tT(t),new Cy.Geodesic(e,(e-t)/e)}var Cy,If,nT=p(()=>{eT();Cy=er.Geodesic;If=Cy.ALL&~Cy.AREA});function sT(e,t,r,n,i,o){let s=oT[t]&&oT[t][r];Ri(s&&(!n||n===s));let a,c,l,u=vz.copy(i);if(!Number.isFinite(u.x)||!Number.isFinite(u.y)||!Number.isFinite(u.z)||!Array.isArray(o)&&o.length<16)throw new Error("Unsupported local frame");let h=Mz*Math.min(1,e.maximumRadius),d=Math.abs(u.x)<=h&&Math.abs(u.y)<=h,m=e.radii;if(m.x===m.y&&m.x>0&&m.z>0&&m.z<=m.x&&(!d||u.z!==0)){let{east:C,up:L}=ql;if(d)C.set(0,1,0),L.set(0,0,Math.sign(u.z));else{let A=Math.max(Math.abs(u.x),Math.abs(u.y));C.set(-u.y/A,u.x/A,0).normalize(),e.geodeticSurfaceNormal(u,L)}if(!Iy(C,L,iT)||!Py(iT,u,t,r,n,o))throw new Error("Unsupported local frame");return o}if(d){let C=Math.sign(u.z);a=Ez.fromArray(Dy[t]),t!=="east"&&t!=="west"&&a.scale(C),c=Tz.fromArray(Dy[r]),r!=="east"&&r!=="west"&&c.scale(C),l=Az.fromArray(Dy[n]),n!=="east"&&n!=="west"&&l.scale(C)}else{let{up:C,east:L,north:A}=ql,W=Math.max(Math.abs(u.x),Math.abs(u.y));L.set(-u.y/W,u.x/W,0).normalize(),e.geodeticSurfaceNormal(u,C),A.copy(C).cross(L);let{down:G,west:E,south:B}=ql;G.copy(C).scale(-1),E.copy(L).scale(-1),B.copy(A).scale(-1),a=ql[t],c=ql[r],l=ql[n]}let g=a.x,y=a.y,b=a.z,w=c.x,_=c.y,S=c.z,v=l.x,T=l.y,O=l.z,P=u.x,M=u.y,U=u.z;return o[0]=g,o[1]=y,o[2]=b,o[3]=0,o[4]=w,o[5]=_,o[6]=S,o[7]=0,o[8]=v,o[9]=T,o[10]=O,o[11]=0,o[12]=P,o[13]=M,o[14]=U,o[15]=1,o}var Mz,vz,iT,oT,Dy,ql,Ez,Tz,Az,aT=p(()=>{Fn();Fn();Mz=1e-14,vz=new J,iT=Ay(),oT={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Dy={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},ql={east:new J,north:new J,up:new J,west:new J,south:new J,down:new J},Ez=new J,Tz=new J,Az=new J});function Ny(e,t,r=new yn){return sT(e,"east","north","up",t,r)}var cT=p(()=>{Fn();aT()});var lT=p(()=>{Q4();cT()});var Fy,Gy,Ls,uT=p(()=>{Fy={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Gy={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635},Ls={...Fy,...Gy}});var fT=p(()=>{uT()});var hT=p(()=>{fT()});var dT=p(()=>{});var mT=p(()=>{});function re(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))return r;let n=e[t];if(typeof n!="string"||!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(n))throw new Error(`Invalid numeric PROJ parameter: +${t}`);let i=Number(n);if(!Number.isFinite(i))throw new Error(`Invalid numeric PROJ parameter: +${t}`);return i}function Pf(e,t){let r=re(e,t,0);if(Math.abs(r)>=90)throw new Error(`+${t} must be between -90 and 90 degrees`);return r*At}function Xt(e,t=!1){if(t||Math.abs(e)<=Math.PI)return e;let r=2*Math.PI;return((e+Math.PI)%r+r)%r-Math.PI}var At,Vt=p(()=>{At=Math.PI/180});function Ot(e,t){let r=[e[0]*t[0],e[0]*t[1],e[1]*t[0],e[1]*t[1]];return[Math.min(...r),Math.max(...r)]}function Rf([e,t]){let r=[Math.sin(e),Math.sin(t)];for(let[n,i]of[[Math.PI/2,1],[-Math.PI/2,-1]])Math.ceil((e-n)/(2*Math.PI))<=Math.floor((t-n)/(2*Math.PI))&&r.push(i);return[Math.min(...r),Math.max(...r)]}function lt(e,t){let r=n=>Math.max(1,Os(n))*1e-12;if(![...e,...t].every(Number.isFinite))throw new Error("Projection rendering bounds are not finite");return[[e[0]-r(e),t[0]-r(t),0],[e[1]+r(e),t[1]+r(t),0]]}function Br(e,t,r=!1){let n=e[0][0]-t,i=e[1][0]-t;if(r)return[n,i];let o=i-n;if(o>=2*Math.PI-1e-12)return[-Math.PI,Math.PI];let s=Xt(n);o>0&&Math.abs(s-Math.PI)<1e-12&&(s=-Math.PI);let a=s+o;return a>Math.PI+1e-12?[-Math.PI,Math.PI]:[s,Math.min(a,Math.PI)]}function Cr(e,t,r,n=!1){let i=Br(t,r,n),o=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],0))],s=i.flatMap(a=>o.map(c=>e(r+a,c)));return lt([Math.min(...s.map(a=>a[0])),Math.max(...s.map(a=>a[0]))],[Math.min(...s.map(a=>a[1])),Math.max(...s.map(a=>a[1]))])}function Vl(e,t,r,n=!1,i=0){let o=Br(t,r,n);if(Os(o)>Math.PI/6+1e-12)throw new Error("Unsupported transverse rendering coverage");let s=[o[0],o[1],Math.max(o[0],Math.min(o[1],0))],a=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],i))],c=s.flatMap(l=>a.map(u=>e(r+l,u)));return lt([Math.min(...c.map(l=>l[0])),Math.max(...c.map(l=>l[0]))],[Math.min(...c.map(l=>l[1])),Math.max(...c.map(l=>l[1]))])}function pT(e,t,r,n=!1){let i=Br(t,r,n),o=[i[0],i[1],Math.max(i[0],Math.min(i[1],0))],s=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],0))],a=o.flatMap(c=>s.map(l=>e(r+c,l)));return lt([Math.min(...a.map(c=>c[0])),Math.max(...a.map(c=>c[0]))],[Math.min(...a.map(c=>c[1])),Math.max(...a.map(c=>c[1]))])}function Wl(e,t,r,n,i,o,s=!1){let a=Fe(Br(t,r,s),n),c=mi(o-e(r,t[0][1])[1],o-e(r,t[1][1])[1]);return lt(Ce([i,i],Ot(c,Rf(a))),Ce([o,o],Fe(Ot(c,vm(a)),-1)))}var mi,Ce,Fe,vm,Os,Bt=p(()=>{Vt();mi=(e,t)=>[Math.min(e,t),Math.max(e,t)],Ce=(e,t)=>[e[0]+t[0],e[1]+t[1]],Fe=(e,t)=>mi(e[0]*t,e[1]*t);vm=e=>Rf([e[0]+Math.PI/2,e[1]+Math.PI/2]),Os=e=>Math.max(Math.abs(e[0]),Math.abs(e[1]))});function Q(e,t,r,n){return[[e,t],[r,n]]}function Li(e){return e>=-180&&e<180?e:((e+180)%360+360)%360-180}function Pz(e,t,r,n){if(![e,t,r,n].every(Number.isFinite)||t<-90||n>90||t>n||r-e<-360||r-e>360+1e-10)throw new Error("Invalid geographic coverage");if(r-e>=360-1e-10)return[-180,t,180,n];let i=Li(r);return[Li(e),t,i===-180&&r>e?180:i,n]}function ky(e){let t=e[2]-e[0];return t<0?t+360:t}function gT(e){let[t,r,n,i]=e;return t<=n?[e]:[[t,r,180,i],[-180,r,n,i]]}function Rz(e,t){let[r,n,i,o]=e,s=Li(t[0]);return t[1]>=n&&t[1]<=o&&(r<=i?s>=r&&s<=i||s===-180&&i===180:s>=r||s<=i)}function Em(e,t){let r=Math.max(e[1],t[1]),n=Math.min(e[3],t[3]);if(r>n)return[];let i=[];for(let s of gT(e))for(let a of gT(t)){let c=Math.max(s[0],a[0]),l=Math.min(s[2],a[2]);c<=l?i.push([c,l]):(s[2]===180&&a[0]===-180||a[2]===180&&s[0]===-180)&&i.push([-180,-180])}i.sort((s,a)=>s[0]-a[0]);let o=[];for(let s of i){let a=o[o.length-1];a&&s[0]<=a[1]?a[1]=Math.max(a[1],s[1]):o.push([...s])}if(o.length>1&&o[0][0]===-180&&o[o.length-1][1]===180){let s=o.shift();return[[o.pop()[0],r,s[1],n],...o.map(([c,l])=>[c,r,l,n])]}return o.map(([s,a])=>[s,r,a,n])}function yT(e,t){let r=Li(t[0]),n=Math.max(e[1],Math.min(e[3],t[1]));if(!Rz(e,[r,n])){let i=Math.abs(Li(r-e[0])),o=Math.abs(Li(r-e[2]));r=i<=o?e[0]:e[2]}return[r,n]}function Bs(e,t=0,r=0){let n=ky(e),i=e[0]*Vo-t,o=i+n*Vo/2,s=Math.round((r-o)/(2*Math.PI))*2*Math.PI;return Q(n===360?r-Math.PI:i+s,e[1]*Vo,n===360?r+Math.PI:i+s+n*Vo,e[3]*Vo)}function Gn(e,t=0){return Pz((e[0][0]+t)/Vo,e[0][1]/Vo,(e[1][0]+t)/Vo,e[1][1]/Vo)}function bT(e){if(!e.length)throw new Error("CRS coverage does not intersect the rendering target");return[[0,1,2].map(t=>Math.min(...e.map(r=>r[0][t]))),[0,1,2].map(t=>Math.max(...e.map(r=>r[1][t])))]}var Vo,Qe=p(()=>{Vo=Math.PI/180});function wT(e,t){if(t)try{let n=e(t);return Uy(n)}catch{}let r=e();return Uy(r)}function Uy(e){var r;let t=e.bounds;if(t.some(n=>n.some(i=>!Number.isFinite(i))))throw new Error("Projection rendering bounds must be finite");return{bounds:t,normalize:(r=e.normalize)==null?void 0:r.bind(e)}}function Cs(e,t=0){return r=>{let n=r.x*Math.PI/180-t,i=r.y*Math.PI/180,o={x:n,y:i,z:r.z};e(o),o.x!==n&&(r.x=(o.x+t)*180/Math.PI),o.y!==i&&(r.y=o.y*180/Math.PI)}}function Tm(e,t){let r=[];for(let n of e){let i=t(n);i!==null&&r.push(Uy(i))}return r.length?r.length===1?r[0]:{bounds:bT(r.map(n=>n.bounds)),normalize(n){var a;let i=n.x,o=n.y,s=1/0;for(let c of r){let l={x:n.x,y:n.y,z:n.z};(a=c.normalize)==null||a.call(c,l);let u=Math.sin((l.y-n.y)*Math.PI/360)**2+Math.cos(n.y*Math.PI/180)*Math.cos(l.y*Math.PI/180)*Math.sin((l.x-n.x)*Math.PI/360)**2;u<s&&(s=u,i=l.x,o=l.y)}n.x=i,n.y=o}}:null}var cc=p(()=>{Qe()});function Am(e,t,r=0,n=!1){let i=ky(t),o=i===360?r-180:t[0]+Math.round((r-t[0]-i/2)/360)*360,s=o+i;if(n){e.x=Math.max(o,Math.min(s,e.x)),e.y=Math.max(t[1],Math.min(t[3],e.y));return}let a=yT(t,[e.x,e.y]),c=a[0];a[0]===Li(e.x)&&e.x>=o&&e.x<=s?c=e.x:(c<o||c>s)&&(c+=Math.round(((o+s)/2-c)/360)*360);let l=c-r;e.x=Math.abs(l)<=180?c:r+Li(l),e.y=a[1]}function ur(e,t,r=0,n=0,i=!1){let o=(r+n)*180/Math.PI;return{get bounds(){return e(Bs(t,n,r))},normalize(s){Am(s,t,o,i)}}}function Lz(e,t,r,n,i){let o=Tm(t,s=>ur(e,s,r,n,i));if(!o)throw new Error("CRS coverage does not intersect the rendering target");return o}function De(e,t,r,n=0,i=!1){let o=(t[0][0]+t[1][0])/2,s=Gn(t,n),a=(o+n)*180/Math.PI;return{...e,longitudeOrigin:o,getRenderingProfile(c){if(!c)return{bounds:r(t),normalize(l){Am(l,s,a,i)}};try{let l=ur(r,c,o,n,i);return{bounds:l.bounds,normalize:l.normalize}}catch{return Lz(r,Em(c,s),o,n,i)}}}}var ut=p(()=>{Qe();cc()});function xT(){return{x:0,y:0,z:0}}var Ds,Im=p(()=>{Ds=class{constructor(){this.point=xT(),this.points=[this.point],this.active=0}get depth(){return this.active}acquire(){var t;let r=this.active++;return(t=this.points)[r]||(t[r]=xT()),this.points[r]}release(t){this.active>0&&this.points[this.active-1]===t&&this.active--}}});function pi(e,t){let r=new Ds,n=(i,o,s)=>{let a=r.acquire();try{return a.x=i,a.y=o,a.z=0,s(a),[a.x,a.y]}finally{r.release(a)}};return{forward(i,o){return n(i,o,e)},inverse(i,o){return n(i,o,t)},forwardInPlace:e,inverseInPlace:t}}function Wo(e,t,r=!1){let n=t?e.inverseInPlace:e.forwardInPlace;if(n)return n.bind(e);if(r){let o=t?e.inverse3D:e.forward3D;return s=>{let a=o.call(e,[s.x,s.y,s.z]);s.x=a[0],s.y=a[1],s.z=a[2]}}let i=t?e.inverse:e.forward;return o=>{let s=i.call(e,o.x,o.y);o.x=s[0],o.y=s[1]}}var lc=p(()=>{Im()});function Ns(e,t,r=0){let n=re(e,t,r);if(t!=="lon_0"&&Math.abs(n)>90)throw new Error("Latitude parameter must be between -90 and 90 degrees: +"+t);return n*At}function Oi(e,t){let r=Object.prototype.hasOwnProperty.call(e,t);if(r&&e[t]!==void 0)throw new Error("Expected a flag without a value: +"+t);return r}function xr({semiMajorAxis:e,eccentricitySquared:t,parameters:r,primeMeridian:n=0}){let i=re(r,"k_0",re(r,"k",1));if(i<=0)throw new Error("Projection scale must be positive");return{primeMeridian:n,a:e,b:e*Math.sqrt(1-t),es:t,e:Math.sqrt(t),ep2:t/(1-t),sphere:t===0,over:Oi(r,"over"),long0:Ns(r,"lon_0"),lat0:Ns(r,"lat_0"),lat1:Ns(r,"lat_1"),lat2:Ns(r,"lat_2",re(r,"lat_1",0)),lat_ts:Ns(r,"lat_ts",NaN),x0:re(r,"x_0",0),y0:re(r,"y_0",0),k0:i}}function Hl(e,t){if(!Object.prototype.hasOwnProperty.call(t,"lat_1"))throw new Error("Conic projections require +lat_1");if(Math.abs(e.lat1+e.lat2)<1e-10||Math.abs(e.lat1)>=Math.PI/2||Math.abs(e.lat2)>=Math.PI/2)throw new Error("Conic standard parallels must not be opposite or at a pole")}function fr(e,t,r,n,i=pi){let o=(s,a)=>{let c=s(t,a);if(!c||typeof c!="object"||!Number.isFinite(c.x)||!Number.isFinite(c.y))throw new Error(e+": coordinate outside projection domain or inverse did not converge");a.x=c.x,a.y=c.y};return i(s=>o(r,s),s=>o(n,s))}function Fs(e,t){let r=Wo(t,!1);return pi(n=>{let i=n.x,o=n.y,s=Math.atan2(Math.sin(i-e.long0),Math.cos(i-e.long0)),a=Math.abs(Math.abs(e.lat0)-Math.PI/2)<1e-10;if(Math.abs(o+e.lat0)<1e-10&&(a||Math.abs(Math.abs(s)-Math.PI)<1e-10))throw new Error("Azimuthal projection is undefined at the antipode");r(n)},Wo(t,!0))}var Er,Ho,kn=p(()=>{lc();Vt();Er=["lon_0","lat_0","x_0","y_0"],Ho=["k","k_0"]});function Bi(e,t){return{...pi(e,t),createForwardFlat(r){return this.forwardInPlace===e?_T(e,!1,r):void 0},createInverseFlat(r){return this.inverseInPlace===t?_T(t,!0,r):void 0}}}function _T(e,t,{inputScale:r,outputScale:n}){let i=new Ds;return(o,s)=>{let a=i.acquire();try{let c=o instanceof Float32Array;for(let l=0;l<o.length;l+=s){if(a.x=o[l],a.y=o[l+1],a.z=s>=3?o[l+2]:0,!Number.isFinite(a.x)||!Number.isFinite(a.y)||!Number.isFinite(a.z))throw new Error("Coordinates must contain finite x, y and optional z values");if(r!==1&&(a.x*=r,a.y*=r),t&&e(a),Math.abs(a.y)>Math.PI/2||!Number.isFinite(a.x)||!Number.isFinite(a.y))throw new Error("Coordinate is outside the geographic domain");if(a.x+=0,a.x-=0,t||e(a),n!==1&&(a.x/=n,a.y/=n),!Number.isFinite(a.x)||!Number.isFinite(a.y))throw new Error("Projection produced non-finite coordinates");if(c&&(Math.abs(a.x)>34028234663852886e22||Math.abs(a.y)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");o[l]=a.x,o[l+1]=a.y}}finally{i.release(a)}}}var $l=p(()=>{lc();Im()});function uc(e){var t=Math.exp(e);return t=(t-1/t)/2,t}var Pm=p(()=>{});function tr(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}var fc=p(()=>{});function ST(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}var MT=p(()=>{});function vT(e){var t=Math.abs(e);return t=ST(t*(1+t/(tr(1,t)+1))),e<0?-t:t}var ET=p(()=>{fc();MT()});function Rm(e,t){for(var r=2*Math.cos(2*t),n=e.length-1,i=e[n],o=0,s;--n>=0;)s=-o+r*i+e[n],o=i,i=s;return t+s*Math.sin(2*t)}var TT=p(()=>{});function AT(e,t){for(var r=2*Math.cos(t),n=e.length-1,i=e[n],o=0,s;--n>=0;)s=-o+r*i+e[n],o=i,i=s;return Math.sin(t)*s}var IT=p(()=>{});function Lf(e){var t=Math.exp(e);return t=(t+1/t)/2,t}var jy=p(()=>{});function zy(e,t,r,n){for(var i=Math.sin(t),o=Math.cos(t),s=uc(r),a=Lf(r),c=2*o*a,l=-2*i*s,u=e.length-1,h=e[u],d=0,m=0,g=0,y,b;--u>=0;)y=m,b=d,m=h,d=g,h=-y+c*m-l*d+e[u],g=-b+l*m+c*d;c=i*a,l=o*s,n.x=c*h-l*g,n.y=c*g+l*h}var PT=p(()=>{Pm();jy()});var F,et,Gs,RT,qy,Vy,Of,Ct=p(()=>{F=Math.PI/2,et=Math.PI/4,Gs=Math.PI*2,RT=3.14159265359,qy=Math.PI/180,Vy=180/Math.PI,Of=Math.PI/(180*3600)});function ks(e){return e<0?-1:1}var Bf=p(()=>{});function k(e,t){return t||Math.abs(e)<=RT?e:e-ks(e)*Gs}var _t=p(()=>{Ct();Bf()});function Oz(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0,e.lat0=e.lat0!==void 0?e.lat0:0,e.k0=e.k0!==void 0?e.k0:1,e.cgb=[],e.cbg=[],e.utg=[],e.gtu=[];var t=e.es/(1+Math.sqrt(1-e.es)),r=t/(2-t),n=r;e.cgb[0]=r*(2+r*(-2/3+r*(-2+r*(116/45+r*(26/45+r*(-2854/675)))))),e.cbg[0]=r*(-2+r*(2/3+r*(4/3+r*(-82/45+r*(32/45+r*(4642/4725)))))),n=n*r,e.cgb[1]=n*(7/3+r*(-8/5+r*(-227/45+r*(2704/315+r*(2323/945))))),e.cbg[1]=n*(5/3+r*(-16/15+r*(-13/9+r*(904/315+r*(-1522/945))))),n=n*r,e.cgb[2]=n*(56/15+r*(-136/35+r*(-1262/105+r*(73814/2835)))),e.cbg[2]=n*(-26/15+r*(34/21+r*(8/5+r*(-12686/2835)))),n=n*r,e.cgb[3]=n*(4279/630+r*(-332/35+r*(-399572/14175))),e.cbg[3]=n*(1237/630+r*(-12/5+r*(-24832/14175))),n=n*r,e.cgb[4]=n*(4174/315+r*(-144838/6237)),e.cbg[4]=n*(-734/315+r*(109598/31185)),n=n*r,e.cgb[5]=n*(601676/22275),e.cbg[5]=n*(444337/155925),n=Math.pow(r,2),e.Qn=e.k0/(1+r)*(1+n*(1/4+n*(1/64+n/256))),e.utg[0]=r*(-.5+r*(2/3+r*(-37/96+r*(1/360+r*(81/512+r*(-96199/604800)))))),e.gtu[0]=r*(.5+r*(-2/3+r*(5/16+r*(41/180+r*(-127/288+r*(7891/37800)))))),e.utg[1]=n*(-1/48+r*(-1/15+r*(437/1440+r*(-46/105+r*(1118711/3870720))))),e.gtu[1]=n*(13/48+r*(-3/5+r*(557/1440+r*(281/630+r*(-1983433/1935360))))),n=n*r,e.utg[2]=n*(-17/480+r*(37/840+r*(209/4480+r*(-5569/90720)))),e.gtu[2]=n*(61/240+r*(-103/140+r*(15061/26880+r*(167603/181440)))),n=n*r,e.utg[3]=n*(-4397/161280+r*(11/504+r*(830251/7257600))),e.gtu[3]=n*(49561/161280+r*(-179/168+r*(6601661/7257600))),n=n*r,e.utg[4]=n*(-4583/161280+r*(108847/3991680)),e.gtu[4]=n*(34729/80640+r*(-3418889/1995840)),n=n*r,e.utg[5]=n*(-20648693/638668800),e.gtu[5]=n*(212378941/319334400);var i=Rm(e.cbg,e.lat0);e.Zb=-e.Qn*(i+AT(e.gtu,2*i))}function LT(e,t){var r=k(t.x-e.long0,e.over),n=t.y;n=Rm(e.cbg,n);var i=Math.sin(n),o=Math.cos(n),s=Math.sin(r),a=Math.cos(r);n=Math.atan2(i,a*o),r=Math.atan2(s*o,tr(i,o*a)),r=vT(Math.tan(r)),zy(e.gtu,2*n,2*r,t),n=n+t.x,r=r+t.y;var c,l;return Math.abs(r)<=2.623395162778?(c=e.a*(e.Qn*r)+e.x0,l=e.a*(e.Qn*n+e.Zb)+e.y0):(c=1/0,l=1/0),t.x=c,t.y=l,t}function OT(e,t){var r=(t.x-e.x0)*(1/e.a),n=(t.y-e.y0)*(1/e.a);n=(n-e.Zb)/e.Qn,r=r/e.Qn;var i,o;if(Math.abs(r)<=2.623395162778){zy(e.utg,2*n,2*r,t),n=n+t.x,r=r+t.y,r=Math.atan(uc(r));var s=Math.sin(n),a=Math.cos(n),c=Math.sin(r),l=Math.cos(r);n=Math.atan2(s*l,tr(c,l*a)),r=Math.atan2(c,l*a),i=k(r+e.long0,e.over),o=Rm(e.cgb,n)}else i=1/0,o=1/0;return t.x=i,t.y=o,t}function BT(e){let t={...e,cgb:[],cbg:[],utg:[],gtu:[],Qn:0,Zb:0};return Oz(t),t}var CT=p(()=>{Pm();fc();ET();TT();IT();PT();_t()});function uo(e){var t=[];t[0]=Bz-e*(Cz+e*(DT+e*(NT+e*FT))),t[1]=e*(Dz-e*(DT+e*(NT+e*FT)));var r=e*e;return t[2]=r*(Nz-e*(Fz+e*Gz)),r*=e,t[3]=r*(kz-e*Uz),t[4]=r*e*jz,t}var Bz,Cz,DT,NT,FT,Dz,Nz,Fz,Gz,kz,Uz,jz,Kl=p(()=>{Bz=1,Cz=.25,DT=.046875,NT=.01953125,FT=.01068115234375,Dz=.75,Nz=.46875,Fz=.013020833333333334,Gz=.007120768229166667,kz=.3645833333333333,Uz=.005696614583333333,jz=.3076171875});function _r(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var hc=p(()=>{});function fo(e,t,r){for(var n=1/(1-t),i=e,o=zz;o;--o){var s=Math.sin(i),a=1-t*s*s;if(a=(_r(i,s,Math.cos(i),r)-e)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<1e-10)return i}return i}var zz,Xl=p(()=>{hc();zz=20});function qz(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0,e.lat0=e.lat0!==void 0?e.lat0:0,e.es&&(e.en=uo(e.es),e.ml0=_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function GT(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o,s,a,c=Math.sin(n),l=Math.cos(n);if(e.es){var h=l*i,d=Math.pow(h,2),m=e.ep2*Math.pow(l,2),g=Math.pow(m,2),y=Math.abs(l)>1e-10?Math.tan(n):0,b=Math.pow(y,2),w=Math.pow(b,2);o=1-e.es*Math.pow(c,2),h=h/Math.sqrt(o);var _=_r(n,c,l,e.en);s=e.a*(e.k0*h*(1+d/6*(1-b+m+d/20*(5-18*b+w+14*m-58*b*m+d/42*(61+179*w-w*b-479*b)))))+e.x0,a=e.a*(e.k0*(_-e.ml0+c*i*h/2*(1+d/12*(5-b+9*m+4*g+d/30*(61+w-58*b+270*m-330*b*m+d/56*(1385+543*w-w*b-3111*b))))))+e.y0}else{var u=l*Math.sin(i);if(Math.abs(Math.abs(u)-1)<1e-10)return 93;if(s=.5*e.a*e.k0*Math.log((1+u)/(1-u))+e.x0,a=l*Math.cos(i)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(a),u>=1){if(u-1>1e-10)return 93;a=0}else a=Math.acos(a);n<0&&(a=-a),a=e.a*e.k0*(a-e.lat0)+e.y0}return t.x=s,t.y=a,t}function kT(e,t){var r,n,i,o,s=(t.x-e.x0)*(1/e.a),a=(t.y-e.y0)*(1/e.a);if(e.es)if(r=e.ml0+a/e.k0,n=fo(r,e.es,e.en),Math.abs(n)<F){var d=Math.sin(n),m=Math.cos(n),g=Math.abs(m)>1e-10?Math.tan(n):0,y=e.ep2*Math.pow(m,2),b=Math.pow(y,2),w=Math.pow(g,2),_=Math.pow(w,2);r=1-e.es*Math.pow(d,2);var S=s*Math.sqrt(r)/e.k0,v=Math.pow(S,2);r=r*g,i=n-r*v/(1-e.es)*.5*(1-v/12*(5+3*w-9*y*w+y-4*b-v/30*(61+90*w-252*y*w+45*_+46*y-v/56*(1385+3633*w+4095*_+1574*_*w)))),o=k(e.long0+S*(1-v/6*(1+2*w+y-v/20*(5+28*w+24*_+8*y*w+6*y-v/42*(61+662*w+1320*_+720*_*w))))/m,e.over)}else i=F*ks(a),o=0;else{var c=Math.exp(s/e.k0),l=.5*(c-1/c),u=e.lat0+a/e.k0,h=Math.cos(u);r=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),i=Math.asin(r),Math.sin(u)<0&&(i=-i),l===0&&h===0?o=0:o=k(Math.atan2(l,h)+e.long0,e.over)}return t.x=o,t.y=i,t}function UT(e){let t={...e,en:[],ml0:0};return qz(t),t}var jT=p(()=>{Kl();hc();Xl();_t();Ct();Bf()});function Lm(e){let t=xr(e),r=n=>De(n,Q(t.long0-Math.PI/6,-Math.PI/2,t.long0+Math.PI/6,Math.PI/2),i=>Vl(n.forward,i,t.long0,t.over),t.primeMeridian,t.over);if(Oi(e.parameters,"approx"))return r({...fr("tmerc +approx",UT(t),GT,kT,Bi)});if(t.sphere)throw new Error("Spherical transverse Mercator requires +approx");return r({...fr("etmerc",BT(t),LT,OT,Bi)})}var Wy,Hy,$y=p(()=>{$l();Bt();Qe();ut();kn();CT();jT();Wy={name:"tmerc",aliases:["Fast_Transverse_Mercator","Fast Transverse Mercator","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger"],parameters:[...Er,...Ho,"approx"],flags:["approx"],create:Lm},Hy={name:"etmerc",aliases:["Extended_Transverse_Mercator","Extended Transverse Mercator"],parameters:[...Er,...Ho,"approx"],flags:["approx"],create:Lm}});var Ky,zT=p(()=>{Bt();Qe();ut();Vt();kn();$y();Ky={name:"utm",aliases:["Universal Transverse Mercator System"],parameters:["zone","south","approx"],flags:["south","approx"],create(e){let t=re(e.parameters,"zone",NaN);if(!Number.isInteger(t)||t<1||t>60)throw new Error("UTM requires an integer +zone from 1 to 60");let r=Oi(e.parameters,"south"),n=Lm({...e,parameters:{...e.parameters,lat_0:"0",lon_0:String(6*t-183),x_0:"500000",y_0:r?"10000000":"0",k_0:"0.9996"}}),i=(6*t-183)*Math.PI/180;return De(n,Q(i-Math.PI/60,r?-80*Math.PI/180:0,i+Math.PI/60,r?0:84*Math.PI/180),o=>Vl(n.forward,o,i),e.primeMeridian??0,Object.prototype.hasOwnProperty.call(e.parameters,"over"))}}});function Yy(e,t){return[Math.cos(t)*Math.cos(e),Math.cos(t)*Math.sin(e),Math.sin(t)]}function Om(e,t,r,n,i){let o=Math.hypot(e,t);if(!o||Math.abs(r)>o+1e-14)return[];let s=Math.atan2(t,e),a=Math.acos(Math.max(-1,Math.min(1,r/o))),c=[];for(let l of[s-a,s+a])for(let u=Math.ceil((n-l)/(2*Math.PI));u<=Math.floor((i-l)/(2*Math.PI));u++)c.push(l+u*2*Math.PI);return c}function Us(e,t,r,n=!0){let[[i,o],[s,a]]=t,c=(i+s)/2,l=r?[Math.cos(r.latitude),0,Math.sin(r.latitude)]:[1,0,0],u=r?Math.cos(r.distance):-1,h=n?-1/0:1/0,d=[NaN,NaN],m=(y,b)=>{if(y=c+Xt(y-c),y<i-1e-12||y>s+1e-12||b<o-1e-12||b>a+1e-12)return;let w=Yy(y,b);if(r&&Xy(l,w)<u-1e-13)return;let _=Xy(e,w);(n?_>h:_<h)&&(h=_,d=[y,b])},g=[i,s,...Om(-e[1],e[0],0,i,s)];for(let y of g){let b=e[0]*Math.cos(y)+e[1]*Math.sin(y);for(let w of[o,a,...Om(e[2],-b,0,o,a)])m(y,w)}if(r){let[y,,b]=l;for(let v of[o,a])for(let T of Om(y*Math.cos(v),0,u-b*Math.sin(v),i,s))m(T,v);for(let v of[i,s])for(let T of Om(y*Math.cos(v),b,u,o,a))m(v,T);let w=Xy(e,l),_=e.map((v,T)=>v-w*l[T]),S=Math.hypot(..._);if(S<=1e-14&&(_=[-l[2],0,l[0]],S=1),S>1e-14)for(let v of[-1,1]){let T=l.map((O,P)=>O*u+v*_[P]*Math.sin(r.distance)/S);m(Math.atan2(T[1],T[0]),Math.atan2(T[2],Math.hypot(T[0],T[1])))}}if(!Number.isFinite(h))throw new Error("CRS coverage does not intersect the rendering domain");return{value:h,point:d}}function dt(e,t,r){return[Us(e,t,r,!1).value,Us(e,t,r).value]}function js(e,t,r,n,i){let o=dt(e,n,i),s=dt(t,n,i).map(c=>c+r);if(s[0]<=0)throw new Error("Projection rendering denominator is not positive");let a=o.flatMap(c=>s.map(l=>c/l));return[!1,!0].map(c=>{let l=Math.min(...a),u=Math.max(...a);for(let h=0;h<60;h++){let d=(l+u)/2,m=e.map((y,b)=>y-d*t[b]);Us(m,n,i,c).value-d*r>0?l=d:u=d}return c?u:l})}var Xy,dc=p(()=>{Vt();Xy=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]});function Vz(e,t,r,n=Math.PI){let i=[-180,-90,180,90],o=(s,a)=>{let c=Bs(s,e.primeMeridian,e.long0),l=Q(c[0][0]-e.long0,c[0][1],c[1][0]-e.long0,c[1][1]),u=[Math.cos(e.lat0),0,Math.sin(e.lat0)],h=a?Us(u,l,void 0,!1).value:-1,m=!a||h<=Math.cos(n)+1e-13?{latitude:e.lat0,distance:t}:void 0,g=ur(()=>r(l,m),s,e.long0,e.primeMeridian),y=Math.abs(Math.cos(e.lat0))<1e-12,b=(Math.PI/2-t)*180/Math.PI,w=m&&!y&&Cs(_=>{let S=Yy(_.x-e.long0,_.y);if(S[0]*Math.cos(e.lat0)+S[2]*Math.sin(e.lat0)>=Math.cos(m.distance)-1e-14)return;if(Math.hypot(S[0]+u[0],S[1],S[2]+u[2])<1e-12){let T=e.lat0+m.distance,O=(l[0][0]+l[1][0])/2,P=O+Xt((Math.cos(T)<0?Math.PI:0)-O),M=Math.atan2(Math.sin(T),Math.abs(Math.cos(T)));if(P>=l[0][0]&&P<=l[1][0]&&M>=l[0][1]&&M<=l[1][1]){_.x=P+e.long0,_.y=M;return}}let v=Us(S,l,m);[_.x,_.y]=[v.point[0]+e.long0,v.point[1]]},e.primeMeridian);return{get bounds(){return r(l,m)},normalize(_){g.normalize(_),m&&y?_.y=e.lat0>0?Math.max(b,_.y):Math.min(-b,_.y):w==null||w(_);let S=(e.long0+e.primeMeridian)*180/Math.PI,v=_.x-S;Math.abs(v)>180&&(_.x=S+Li(v))}}};return s=>o(s??i,!!s)}function wn(e,t,r,n,i=Math.PI){return{...e,longitudeOrigin:t.long0,getRenderingProfile:Vz(t,r,n,i)}}var zs=p(()=>{Qe();ut();dc();Vt();cc()});function Bm(e,t,r,n){let i=[-Math.sin(e.lat0),0,Math.cos(e.lat0)],o=[Math.cos(e.lat0),0,Math.sin(e.lat0)],s=[0,1,0],a=n==="stere"?1:0,c=u=>n==="ortho"?dt(u,t,r):js(u,o,a,t,r),l=e.a*(n==="stere"?2*e.k0:1);return lt(Ce([e.x0,e.x0],Fe(c(s),l)),Ce([e.y0,e.y0],Fe(c(i),l)))}function qT(e,t,r){let n=Math.sin(e.lat0),i=Math.cos(e.lat0),o=dt([0,0,1],t,r);if(Math.abs(n)<1e-15&&(!r||Math.abs(r.distance-Math.PI/2)<1e-15)){let h=m=>{let g=Us([0,1,0],t,r,m);return g.value/Math.sqrt(1-e.es*Math.sin(g.point[1])**2)},d=m=>(1-e.es)*m/Math.sqrt(1-e.es*m*m);return lt(Ce([e.x0,e.x0],Fe([h(!1),h(!0)],e.a*e.k0)),Ce([e.y0,e.y0],Fe([d(o[0]),d(o[1])],e.a*e.k0)))}let s=o[0]<=0&&o[1]>=0?0:Math.min(o[0]**2,o[1]**2),a=Math.max(o[0]**2,o[1]**2),c=mi(1/Math.sqrt(1-e.es*s),1/Math.sqrt(1-e.es*a)),l=e.a*e.k0,u=e.es*n*i/Math.sqrt(1-e.es*n*n);return lt(Ce([e.x0,e.x0],Fe(Ot(dt([0,1,0],t,r),c),l)),Ce([e.y0+l*u,e.y0+l*u],Fe(Ot(dt([-n,0,(1-e.es)*i],t,r),c),l)))}function VT(e,t,r){let n=dt([Math.cos(e.lat0),0,Math.sin(e.lat0)],t,r)[0],i=e.a/Math.sqrt(1-e.es)*Math.acos(Math.max(-1,Math.min(1,n)));return lt([e.x0-i,e.x0+i],[e.y0-i,e.y0+i])}function WT(e,t,r,n,i,o,s){let a=i&&dt([0,0,1],n,i),c=Q(n[0][0],s(a?Math.asin(Math.max(-1,a[0])):n[0][1]),n[1][0],s(a?Math.asin(Math.min(1,a[1])):n[1][1])),l=i&&{latitude:o,distance:Math.PI-(1-e.es)**2*(Math.PI-i.distance)},u=[Math.cos(o),0,Math.sin(o)],h=[-Math.sin(o),0,Math.cos(o)],d=dt(u,c,l),m=[Math.sqrt(2/(1+Math.min(1,d[1]))),d[0]>-1+1e-14?Math.sqrt(2/(1+d[0])):1/0],g=(y,b)=>{let w=dt(y,c,l),_=w[0]===0?0:w[0]*(w[0]<0?m[1]:m[0]),S=w[1]===0?0:w[1]*(w[1]>0?m[1]:m[0]);return Fe([Math.max(-2,_),Math.min(2,S)],e.a*b)};return lt(Ce([e.x0,e.x0],g([0,1,0],t)),Ce([e.y0,e.y0],g(h,r)))}function Cm(e,t,r,n,i,o,s=1,a=e.e*Math.atanh(e.e)){let c=Q(i[0][0]*s,t(i[0][1]),i[1][0]*s,t(i[1][1])),l=2*a+Math.PI*Math.abs(s-1),u=o&&s===1?Math.min(o.distance+l,Math.PI-(1-e.es)*(Math.PI-o.distance)):o&&o.distance+l,h=u&&u<Math.PI?{latitude:r,distance:u}:void 0,d=[Math.cos(r),0,Math.sin(r)],m=[-Math.sin(r),0,Math.cos(r)],y=c[1][0]-c[0][0]>=2*Math.PI?Q(-Math.PI,c[0][1],Math.PI,c[1][1]):c,b=js([0,1,0],d,1,y,h),w=js(m,d,1,y,h);return lt(Ce([e.x0,e.x0],Fe(b,n)),Ce([e.y0,e.y0],Fe(w,n)))}function HT(e,t,r,n,i,o){let s=[Math.cos(e.lat0),0,Math.sin(e.lat0)],a=[-Math.sin(e.lat0),0,Math.cos(e.lat0)],c=[0,1,0],l=Math.cos(n),u=Math.sin(n),h=Math.cos(r),d=Math.sin(r),m=a.map((_,S)=>l*_+u*c[S]),g=c.map((_,S)=>l*_-u*a[S]),y=s.map((_,S)=>-h*_+d*m[S]),b=js(g,y,h*t,i,o),w=js(m,y,h*t,i,o);return lt(Ce([e.x0,e.x0],Fe(b,e.a*(t-1)*h)),Ce([e.y0,e.y0],Fe(w,e.a*(t-1))))}function $T(e,t,r){let n=dt([Math.cos(e.lat0),0,Math.sin(e.lat0)],t,r)[0],i=Math.acos(Math.max(-1,Math.min(1,n))),o=1-e.es,s=e.a*i/Math.sqrt(o),a=Math.cos(i/o);if(!(a>0))throw new Error("Gnomonic rendering coverage approaches its ellipsoidal horizon");let c=s/a;return lt([e.x0-c,e.x0+c],[e.y0-c,e.y0+c])}var qs=p(()=>{Qe();dc();Bt()});function Ci(e,t,r,n,i,o,s){let a=i*r/s,c=n*t-o*r*e/s,l=n*e+o*r*t/s;return Math.atan2(l,Math.hypot(a,c))}var Cf=p(()=>{});function xn(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}var Yl=p(()=>{});function Qr(e,t,r){let n=Math.cos(t);return Math.exp(e*Math.atanh(e*r))*(r>0?n/(1+r):(1-r)/n)}var Df=p(()=>{});function mc(e,t){for(var r=.5*e,n,i,o=F-2*Math.atan(t),s=0;s<=15;s++)if(n=e*Math.sin(o),i=F-2*Math.atan(t*Math.pow((1-n)/(1+n),r))-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}var Dm=p(()=>{Ct()});function KT(e,t,r){return t*=r,Math.tan(.5*(F+e))*Math.pow((1-t)/(1+t),.5*r)}function Wz(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0,e.coslat0=Math.cos(e.lat0),e.sinlat0=Math.sin(e.lat0),e.sphere?!Number.isNaN(e.lat_ts)&&Math.abs(e.coslat0)<=1e-10&&(e.k0=.5*(1+ks(e.lat0)*Math.sin(e.lat_ts))):(Math.abs(e.coslat0)<=1e-10&&(e.lat0>0?e.con=1:e.con=-1),e.cons=Math.sqrt(Math.pow(1+e.e,1+e.e)*Math.pow(1-e.e,1-e.e)),!Number.isNaN(e.lat_ts)&&Math.abs(e.coslat0)<=1e-10&&Math.abs(Math.cos(e.lat_ts))>1e-10&&(e.k0=.5*e.cons*xn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts))/Qr(e.e,e.con*e.lat_ts,e.con*Math.sin(e.lat_ts))),e.ms1=xn(e.e,e.sinlat0,e.coslat0),e.X0=2*Math.atan(KT(e.lat0,e.sinlat0,e.e))-F,e.cosX0=Math.cos(e.X0),e.sinX0=Math.sin(e.X0))}function XT(e,t){var r=t.x,n=t.y,i=Math.sin(n),o=Math.cos(n),s,a,c,l,u,h,d=k(r-e.long0,e.over);if(Math.abs(Math.abs(r-e.long0)-Math.PI)<=1e-10&&Math.abs(n+e.lat0)<=1e-10)return t.x=NaN,t.y=NaN,t;if(e.sphere&&Math.abs(e.coslat0)<=1e-10){let m=e.lat0>0?1:-1,g=2*e.a*e.k0*Math.tan(Math.PI/4-m*n/2);return t.x=e.x0+g*Math.sin(d),t.y=e.y0-m*g*Math.cos(d),t}return e.sphere?(s=2*e.k0/(1+e.sinlat0*i+e.coslat0*o*Math.cos(d)),t.x=e.a*s*o*Math.sin(d)+e.x0,t.y=e.a*s*(e.coslat0*i-e.sinlat0*o*Math.cos(d))+e.y0,t):(a=2*Math.atan(KT(n,i,e.e))-F,l=Math.cos(a),c=Math.sin(a),Math.abs(e.coslat0)<=1e-10?(u=Qr(e.e,n*e.con,e.con*i),h=2*e.a*e.k0*u/e.cons,t.x=e.x0+h*Math.sin(r-e.long0),t.y=e.y0-e.con*h*Math.cos(r-e.long0),t):(Math.abs(e.sinlat0)<1e-10?(s=2*e.a*e.k0/(1+l*Math.cos(d)),t.y=s*c+e.y0):(s=2*e.a*e.k0*e.ms1/(e.cosX0*(1+e.sinX0*c+e.cosX0*l*Math.cos(d))),t.y=s*(e.cosX0*c-e.sinX0*l*Math.cos(d))+e.y0),t.x=s*l*Math.sin(d)+e.x0,t))}function YT(e,t){t.x-=e.x0,t.y-=e.y0;var r,n,i,o,s,a=Math.sqrt(t.x*t.x+t.y*t.y);if(e.sphere){var c=2*Math.atan(a/(2*e.a*e.k0));return r=e.long0,n=e.lat0,a<=1e-10?(t.x=r,t.y=n,t):(n=Ci(e.sinlat0,e.coslat0,Math.sin(c),Math.cos(c),t.x,t.y,a),Math.abs(e.coslat0)<1e-10?e.lat0>0?r=k(e.long0+Math.atan2(t.x,-1*t.y),e.over):r=k(e.long0+Math.atan2(t.x,t.y),e.over):r=k(e.long0+Math.atan2(t.x*Math.sin(c),a*e.coslat0*Math.cos(c)-t.y*e.sinlat0*Math.sin(c)),e.over),t.x=r,t.y=n,t)}else if(Math.abs(e.coslat0)<=1e-10){if(a<=1e-10)return n=e.lat0,r=e.long0,t.x=r,t.y=n,t;t.x*=e.con,t.y*=e.con,i=a*e.cons/(2*e.a*e.k0),n=e.con*mc(e.e,i),r=e.con*k(e.con*e.long0+Math.atan2(t.x,-1*t.y),e.over)}else o=2*Math.atan(a*e.cosX0/(2*e.a*e.k0*e.ms1)),r=e.long0,a<=1e-10?s=e.X0:(s=Ci(e.sinX0,e.cosX0,Math.sin(o),Math.cos(o),t.x,t.y,a),r=k(e.long0+Math.atan2(t.x*Math.sin(o),a*e.cosX0*Math.cos(o)-t.y*e.sinX0*Math.sin(o)),e.over)),n=-1*mc(e.e,Math.tan(.5*(F+s)));return t.x=r,t.y=n,t}function ZT(e){let t={...e,coslat0:0,sinlat0:0,con:0,cons:0,ms1:0,X0:0,cosX0:0,sinX0:0};return Wz(t),t}var JT=p(()=>{Cf();Ct();Bf();Yl();Df();Dm();_t()});var Zy,QT=p(()=>{zs();qs();kn();JT();Zy={name:"stere",aliases:["Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],parameters:[...Er,...Ho,"lat_ts"],create(e){let t=xr(e),r=ZT(t),n=Fs(t,fr("stere",r,XT,YT));return wn(n,t,150*Math.PI/180,(i,o)=>r.sphere?Bm(r,i,o,"stere"):Cm(r,s=>2*Math.atan(Math.tan(Math.PI/4+s/2)*Math.pow((1-r.e*Math.sin(s))/(1+r.e*Math.sin(s)),r.e/2))-Math.PI/2,r.X0,2*r.a*r.k0*(Math.abs(r.coslat0)<1e-10?1/r.cons:r.ms1/r.cosX0),i,o))}}});var Nf=p(()=>{lT();dT();mT()});var Vs=p(()=>{"use strict";vv();Ev();Av();Iv();Cg();Cg();lE()});function e8(e){return!Xz(e,"ftyp",4)||(e[8]&96)===0?null:Hz(e)}function Hz(e){switch($z(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function $z(e,t,r){return String.fromCharCode(...e.slice(t,r))}function Kz(e){return[...e].map(t=>t.charCodeAt(0))}function Xz(e,t,r=0){let n=Kz(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var t8=p(()=>{"use strict"});function Nm(e){let t=Gf(e);return Zz(t)||eq(t)||Jz(t)||Qz(t)||Yz(t)}function Yz(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=e8(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function Zz(e){let t=Gf(e);return t.byteLength>=33&&t.getUint32(0,Un)===2303741511&&t.getUint32(4,Un)===218765834&&t.getUint32(8,Un)===13&&t.getUint32(12,Un)===1229472850?{mimeType:"image/png",width:t.getUint32(16,Un),height:t.getUint32(20,Un)}:null}function Jz(e){let t=Gf(e);return t.byteLength>=10&&t.getUint32(0,Un)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Ff),height:t.getUint16(8,Ff)}:null}function Qz(e){let t=Gf(e);return t.byteLength>=14&&t.getUint16(0,Un)===16973&&t.getUint32(2,Ff)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Ff),height:t.getUint32(22,Ff)}:null}function eq(e){let t=Gf(e);if(!(t.byteLength>=3&&t.getUint16(0,Un)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=tq(),o=2;for(;o+9<t.byteLength;){let s=t.getUint16(o,Un);if(i.has(s))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Un),width:t.getUint16(o+7,Un)};if(!n.has(s))return null;o+=2,o+=t.getUint16(o,Un)}return null}function tq(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Gf(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}var Un,Ff,Jy=p(()=>{"use strict";t8();Un=!1,Ff=!0});var rq,nq,iq,r8,n8=p(()=>{"use strict";Jy();rq=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],nq=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],iq={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:nq,extensions:rq,tests:[e=>!!Nm(new DataView(e))]},r8={...iq,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Zl,Fm=p(()=>{"use strict";Zl="5.0.0-beta.4"});function Jl(e){if(!e)return!1;if(oq.test(e))return!0;for(let t=e.indexOf(".svg");t>=0;t=e.indexOf(".svg",t+4)){let r=e[t+4];if(r===void 0||r==="?"||r==="#")return!0}return!1}function i8(e,t){if(Jl(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Qy(e,t)}function Qy(e,t){if(Jl(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}var oq,Gm=p(()=>{"use strict";oq=/^data:image\/svg\+xml/});async function o8(e,t,r){let n=i8(e,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await sq(o||n,t)}finally{o&&i.revokeObjectURL(o)}}async function sq(e,t){var n;let r=new Image;return r.src=e,(n=t==null?void 0:t.image)!=null&&n.decode&&r.decode?(await r.decode(),r):await new Promise((i,o)=>{try{r.onload=()=>i(r),r.onerror=s=>{let a=s instanceof Error?s.message:"error";o(new Error(a))}}catch(s){o(s)}})}var s8=p(()=>{"use strict";Gm()});async function c8(e,t,r){let n;Jl(r)?n=await o8(e,t,r):n=Qy(e,r);let i=t&&t.imagebitmap;return await u8(n,i)}async function l8(e,t){let r=t&&t.imagebitmap;return await u8(e,r)}async function u8(e,t=null){if((aq(t)||!a8)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),a8=!1}return await createImageBitmap(e)}function aq(e){if(!e)return!0;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var a8,f8=p(()=>{"use strict";Gm();s8();a8=!0});async function h8(e,t){var s,a;let{mimeType:r}=Nm(e)||{},n=(s=globalThis.loaders)==null?void 0:s.parseImageNode;Rl(n);let i=(a=globalThis.loaders)==null?void 0:a.createImageBitmapNode;if(!i)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let o=await n(e,r);return i(o)}var d8=p(()=>{"use strict";Vs();Jy()});async function e2(e,t,r){var i;t=t||{},g8(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Xd||n)return await h8(e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(m8);return await c8(e,t,r==null?void 0:r.url)}async function p8(e,t,r){var i;t=t||{},g8(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Xd||n||Jl(r==null?void 0:r.url)||e.type.startsWith("image/svg+xml"))return await e2(await e.arrayBuffer(),t,r);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(m8);return await l8(e,t)}function g8(e){var r;let t=(r=e.image)==null?void 0:r.type;if(t&&t!=="imagebitmap")throw new Error(cq)}var cq,m8,y8=p(()=>{"use strict";Vs();f8();Gm();d8();cq="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",m8="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var b8={};Jt(b8,{ImageLoaderWithParser:()=>uq});var xoe,lq,uq,w8=p(()=>{"use strict";y8();t2();({preload:xoe,...lq}=$o),uq={...lq,parse:e2,parseBlob:p8}});async function hq(){let{ImageLoaderWithParser:e}=await Promise.resolve().then(()=>(w8(),b8));return e}var fq,$o,t2=p(()=>{"use strict";Fm();n8();fq={image:{}};$o={dataType:null,batchType:null,...r8,version:Zl,options:fq,preload:hq}});function _8(e){let t=gq(e);if(!t)throw new Error("Not an image");return t}function km(e){switch(_8(e)){case"data":return e;case"imagebitmap":return dq(e)?mq(e):x8(e);case"image":return x8(e);default:throw new Error("getImageData")}}function dq(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.isImageBitmapNode;return!!(t!=null&&t(e))}function mq(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.getImageBitmapDataNode;if(!t)throw new Error("getImageData");return t(e)}function x8(e){let t=pq(e.width,e.height),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height)}function pq(e,t){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(e,t);if(typeof document<"u"){let r=document.createElement("canvas");return r.width=e,r.height=t,r}throw new Error("getImageData")}function gq(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var S8=p(()=>{"use strict"});var M8,v8,r2=p(()=>{"use strict";M8={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]},v8={name:"Texture Containers",id:"compressed-texture",module:"images",encoding:"image",format:"compressed-texture",extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0}});function T8(e){if(!Um){e=e||bq()||void 0,Um=new Set;for(let t of yq)for(let r in E8)if(e&&e.getExtension(`${t}${r}`))for(let n of E8[r])Um.add(n)}return Um}function bq(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var yq,E8,Um,A8=p(()=>{"use strict";yq=["","WEBKIT_","MOZ_"],E8={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},Um=null});function P8(e=T8(),t,r={}){let n=new Set(e);if(!t)return xq(n);if(t.isHDR){let i=I8(t);return r.astcHDR&&(i==="astc-4x4"||i==="astc-6x6")&&jm(n,i.slice(5))?i==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(t.codec==="xubc7")return i2(n)?"bc7":"rgba32";if(t.codec.startsWith("xuastc-ldr-")||t.codec.startsWith("astc-ldr-")){let i=I8(t);return i&&jm(n,i.slice(5))?i:n2(n,t,["bc7","bc","etc2","atc"])}return t.codec==="uastc-ldr-4x4"?jm(n,"4x4")?"astc-4x4":n2(n,t,["bc7","bc","etc2","etc1","pvrtc","atc"]):n2(n,t,["etc2","etc1","bc7","bc","pvrtc","atc"])}function xq(e){return jm(e,"4x4")?"astc-4x4":i2(e)?"bc7":R8(e)?{alpha:"bc3",noAlpha:"bc1"}:L8(e)?"etc2":e.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:O8(e)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:B8(e)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function n2(e,t,r){for(let n of r)switch(n){case"bc7":if(i2(e))return"bc7";break;case"bc":if(R8(e))return t.hasAlpha?"bc3":"bc1";break;case"etc2":if(L8(e))return"etc2";break;case"etc1":if(!t.hasAlpha&&e.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(O8(e))return t.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(B8(e))return t.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return t.hasAlpha?"rgba32":"rgb565"}function I8(e){let t=`${e.blockWidth}x${e.blockHeight}`;return wq.includes(t)?`astc-${t}`:null}function jm(e,t){return Ql(e,[`astc-${t}-unorm`,`astc-${t}-unorm-srgb`])}function i2(e){return Ql(e,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function R8(e){return Ql(e,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function L8(e){return Ql(e,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function O8(e){return Ql(e,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function B8(e){return Ql(e,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function Ql(e,t){return t.some(r=>e.has(r))}var wq,C8=p(()=>{"use strict";A8();wq=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function F8(e){Og(e.modules);let t=Bg("basis");return t||(N8||=_q(e),await N8)}async function _q(e){let t=null,r=null;return[t,r]=await Promise.all([await Cl(D8.TRANSCODER,"images",e,null,"basis_transcoder.mjs"),await Cl(D8.TRANSCODER_WASM,"images",e)]),t=t||globalThis.BASIS,await Sq(t,r)}function Sq(e,t){let r={};return t&&(r.wasmBinary=t),Ll(()=>e(r),n=>{let{BasisFile:i,KTX2File:o,getBasisTexFormatBlockHeight:s,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:l}=n;return c(),{BasisFile:i,KTX2File:o,getBasisTexFormatBlockHeight:s,getBasisTexFormatBlockWidth:a,isFormatSupported:l}})}var D8,N8,G8=p(()=>{"use strict";Vs();ic();D8={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function Vm(e){if(e!==void 0)return uA[e]}function fA(e){if(e!==void 0)return Uq[e]}var uA,Uq,y2=p(()=>{"use strict";uA={34836:"rgba32float",33776:"bc1-rgb-unorm-webgl",35916:"bc1-rgb-unorm-srgb-webgl",33777:"bc1-rgba-unorm",35917:"bc1-rgba-unorm-srgb",33778:"bc2-rgba-unorm",35918:"bc2-rgba-unorm-srgb",33779:"bc3-rgba-unorm",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37492:"etc2-rgb8unorm",37494:"etc2-rgb8unorm-srgb",37496:"etc2-rgb8a1unorm",37497:"etc2-rgb8a1unorm-srgb",37493:"etc2-rgba8unorm",37495:"etc2-rgba8unorm-srgb",37488:"eac-r11unorm",37489:"eac-r11snorm",37490:"eac-rg11unorm",37491:"eac-rg11snorm",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",35840:"pvrtc-rgb4unorm-webgl",35842:"pvrtc-rgba4unorm-webgl",35841:"pvrtc-rgb2unorm-webgl",35843:"pvrtc-rgba2unorm-webgl",36196:"etc1-rgb-unorm-webgl",35986:"atc-rgb-unorm-webgl",35987:"atc-rgba-unorm-webgl",34798:"atc-rgbai-unorm-webgl"},Uq=Object.fromEntries(Object.entries(uA).map(([e,t])=>[t,Number(e)]))});function eu(e,t){let r=new Array(t.mipMapLevels),n=t.textureFormat||Vm(t.internalFormat),i=t.internalFormat||fA(t.textureFormat),o=t.width,s=t.height,a=0;for(let c=0;c<t.mipMapLevels;++c){let l=zq(t,o,s,e,c),h={shape:"texture-level",compressed:!0,data:jq(e,c,a,l),width:o,height:s,levelSize:l};i!==void 0&&(h.format=i),n&&(h.textureFormat=n),r[c]=h,o=Math.max(1,o>>1),s=Math.max(1,s>>1),a+=l}return r}function jq(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function zq(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var Wm=p(()=>{"use strict";y2()});function Vq(e){return qq[e]}function hA(e){return Vm(Vq(e))}var qq,dA=p(()=>{"use strict";y2();qq={131:33776,132:35916,133:33777,134:35917,135:33778,136:35918,137:33779,138:35919,139:36283,140:36284,141:36285,142:36286,147:37492,148:37494,149:37496,150:37497,151:37493,152:37495,153:37488,154:37489,155:37490,156:37491,157:37808,158:37840,159:37809,160:37841,161:37810,162:37842,163:37811,164:37843,165:37812,166:37844,167:37813,168:37845,169:37814,170:37846,171:37815,172:37847,173:37816,174:37848,175:37817,176:37849,177:37818,178:37850,179:37819,180:37851,181:37820,182:37852,183:37821,184:37853,1000054e3:35843,1000054001:35842,1000066e3:37808,1000066001:37809,1000066002:37810,1000066003:37811,1000066004:37812,1000066005:37813,1000066006:37814,1000066007:37815,1000066008:37816,1000066009:37817,1000066010:37818,1000066011:37819,1000066012:37820,1000066013:37821}});function Ws(e){if(e.byteLength<b2.byteLength)return!1;let t=new Uint8Array(e,0,b2.byteLength);return b2.every((r,n)=>t[n]===r)}function pA(e){let t=S2(e);if(t.pixelDepth>0)throw new Error("CompressedTextureLoader does not support 3D KTX2 textures");if(t.supercompressionScheme!==Wq)throw new Error(`KTX2 supercompression scheme ${t.supercompressionScheme} requires BasisLoader`);if(t.vkFormat===0)throw new Error("KTX2 vkFormat is undefined; decode this texture with BasisLoader");let r=hA(t.vkFormat);if(!r)throw new Error(`Unsupported KTX2 Vulkan format ${t.vkFormat}`);return eu(t.levels,{mipMapLevels:t.levelCount,width:t.pixelWidth,height:Math.max(1,t.pixelHeight),sizeFunction:n=>n.uncompressedByteLength,textureFormat:r})}function S2(e){if(!Ws(e))throw new Error("Invalid KTX2 identifier");if(e.byteLength<w2)throw new Error("Truncated KTX2 header");let t=new DataView(e),r=Math.max(1,t.getUint32(40,!0)),n=Hq(r,mA,"KTX2 level index");_2(w2,n,e.byteLength,"KTX2 level index");let i={vkFormat:t.getUint32(12,!0),pixelWidth:t.getUint32(20,!0),pixelHeight:t.getUint32(24,!0),pixelDepth:t.getUint32(28,!0),layerCount:t.getUint32(32,!0),faceCount:t.getUint32(36,!0),levelCount:r,supercompressionScheme:t.getUint32(44,!0),levels:[]};if(i.pixelWidth===0)throw new Error("KTX2 texture width must be non-zero");if(i.faceCount!==1&&i.faceCount!==6)throw new Error(`Invalid KTX2 face count ${i.faceCount}`);x2(t.getUint32(48,!0),t.getUint32(52,!0),e.byteLength,"KTX2 data format descriptor"),x2(t.getUint32(56,!0),t.getUint32(60,!0),e.byteLength,"KTX2 key/value data"),x2(kf(t,64,"KTX2 supercompression global data offset"),kf(t,72,"KTX2 supercompression global data length"),e.byteLength,"KTX2 supercompression global data");for(let o=0;o<r;o++){let s=w2+o*mA,a=kf(t,s,`KTX2 level ${o} offset`),c=kf(t,s+8,`KTX2 level ${o} length`),l=kf(t,s+16,`KTX2 level ${o} uncompressed length`);_2(a,c,e.byteLength,`KTX2 level ${o}`),i.levels.push({levelData:new Uint8Array(e,a,c),uncompressedByteLength:l})}return i}function kf(e,t,r){let n=e.getUint32(t,!0),o=e.getUint32(t+4,!0)*4294967296+n;if(!Number.isSafeInteger(o))throw new Error(`${r} exceeds JavaScript's safe integer range`);return o}function Hq(e,t,r){let n=e*t;if(!Number.isSafeInteger(n))throw new Error(`${r} size exceeds JavaScript's safe integer range`);return n}function x2(e,t,r,n){t>0&&_2(e,t,r,n)}function _2(e,t,r,n){if(!Number.isSafeInteger(e)||!Number.isSafeInteger(t)||e<0||t<0)throw new Error(`${n} has an invalid byte range`);let i=e+t;if(!Number.isSafeInteger(i)||i>r)throw new Error(`${n} is outside the KTX2 container`)}var b2,w2,mA,Wq,Hm=p(()=>{"use strict";Wm();dA();b2=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10]),w2=80,mA=24,Wq=0});async function Kq(e){let t=gA,r;gA=new Promise(n=>{r=n}),await t;try{return await e()}finally{r()}}async function $m(e,t={}){return await Kq(async()=>{var o;let r=await F8(nc(t)),n=((o=t.basis)==null?void 0:o.containerFormat)||"auto";if(n==="ktx2"||n==="auto"&&Ws(e)){if(!r.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return Yq(r,e,t)}return Xq(r,e,t)})}function Xq(e,t,r){let n=new e.BasisFile(new Uint8Array(t));try{let i=wA(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let o=[];for(let s=0;s<n.getNumImages();s++){let a=[];for(let c=0;c<n.getNumLevels(s);c++){let l=n.getImageWidth(s,c),u=n.getImageHeight(s,c);a.push(bA(n,i,l,u,r,h=>n.getImageTranscodedSizeInBytes(s,c,h),(h,d)=>n.transcodeImage(h,s,c,d,0,0)))}o.push(a)}return o}finally{n.close(),n.delete()}}function Yq(e,t,r){let n=new e.KTX2File(new Uint8Array(t));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let o=wA(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let s=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let l=0;l<s;l++)for(let u=0;u<a;u++){let h=[];for(let d=0;d<n.getLevels();d++){let m=n.getImageLevelInfo(d,l,u);h.push(bA(n,{...o,hasAlpha:!!m.alphaFlag},m.width,m.height,r,g=>n.getImageTranscodedSizeInBytes(d,l,u,g),(g,y)=>n.transcodeImage(g,d,l,u,y,0,-1,-1)))}c.push(h)}return c}finally{n.close(),n.delete()}}function bA(e,t,r,n,i,o,s){let a=Jq(i,t);Zq(t,M2(i,t));let c=o(a.basisFormat),l=eV(c,a.dataType);if(!s(l,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${M2(i,t)}`);let u=t.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:r,height:n,data:l,compressed:a.compressed,format:u&&a.srgbFormat||a.format,textureFormat:u?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:t.hasAlpha}}function Zq(e,t){let r=t==="bc6h"||t==="rgba16f"||t==="rgb9e5"||t.startsWith("astc-hdr-");if(e.isHDR!==r)throw new Error(`Basis source codec ${e.codec} cannot be transcoded to ${t}`);if(e.codec==="xubc7"&&t!=="bc7"&&t!=="rgba32")throw new Error(`Basis source codec ${e.codec} cannot be transcoded to ${t}`)}function Jq(e,t){let r=M2(e,t),n=yA[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function M2(e,t){var n,i,o;let r=((n=e.basis)==null?void 0:n.format)||"auto";return r==="auto"&&(r=P8((i=e.basis)==null?void 0:i.supportedTextureFormats,t,(o=e.basis)==null?void 0:o.supportedTextureFeatures)),typeof r=="object"&&(r=t.hasAlpha?r.alpha:r.noAlpha),r.toLowerCase()}function wA(e,t){let r=e.getBasisTexFormat(),n=Qq[r];if(!n)throw new Error(`Unsupported Basis source texture format ${r}`);return{codec:n,isHDR:!!e.isHDR(),isSRGB:t?!!e.isSRGB():!1,hasAlpha:!!e.getHasAlpha(),blockWidth:e.getBlockWidth(),blockHeight:e.getBlockHeight()}}function eV(e,t){return t==="uint16"?new Uint16Array(e/Uint16Array.BYTES_PER_ELEMENT):t==="uint32"?new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function Tr(e,t,r){return{basisFormat:e,compressed:!0,format:t,textureFormat:r}}function tu(e,t,r,n,i){return{basisFormat:e,compressed:!1,format:t,textureFormat:r,srgbFormat:n,srgbTextureFormat:i}}function Sn(e,t,r,n){return{...Tr(e,t,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var _n,yA,rse,gA,Qq,v2=p(()=>{"use strict";ic();C8();G8();Hm();_n={"4x4":Sn(10,37808,37840,"4x4"),"5x4":Sn(28,37809,37841,"5x4"),"5x5":Sn(29,37810,37842,"5x5"),"6x5":Sn(30,37811,37843,"6x5"),"6x6":Sn(31,37812,37844,"6x6"),"8x5":Sn(32,37813,37845,"8x5"),"8x6":Sn(33,37814,37846,"8x6"),"8x8":Sn(36,37815,37847,"8x8"),"10x5":Sn(34,37816,37848,"10x5"),"10x6":Sn(35,37817,37849,"10x6"),"10x8":Sn(37,37818,37850,"10x8"),"10x10":Sn(38,37819,37851,"10x10"),"12x10":Sn(39,37820,37852,"12x10"),"12x12":Sn(40,37821,37853,"12x12")},yA={etc1:Tr(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...Tr(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...Tr(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...Tr(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:Tr(4,36283,"bc4-r-unorm"),bc5:Tr(5,36285,"bc5-rg-unorm"),bc7:{...Tr(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":Tr(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":Tr(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":_n["4x4"],"astc-5x4":_n["5x4"],"astc-5x5":_n["5x5"],"astc-6x5":_n["6x5"],"astc-6x6":_n["6x6"],"astc-8x5":_n["8x5"],"astc-8x6":_n["8x6"],"astc-8x8":_n["8x8"],"astc-10x5":_n["10x5"],"astc-10x6":_n["10x6"],"astc-10x8":_n["10x8"],"astc-10x10":_n["10x10"],"astc-12x10":_n["12x10"],"astc-12x12":_n["12x12"],"atc-rgb":Tr(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":Tr(12,34798,"atc-rgbai-unorm-webgl"),rgba32:tu(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:tu(14,36194,"rgb565unorm-webgl"),bgr565:tu(15,36194,"rgb565unorm-webgl"),rgba4444:tu(16,32854,"rgba4unorm-webgl"),"eac-r11":Tr(20,37488,"eac-r11unorm"),"eac-rg11":Tr(21,37490,"eac-rg11unorm"),bc6h:Tr(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":Tr(23,37808,"astc-4x4-unorm"),rgba16f:{...tu(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...tu(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":Tr(27,37812,"astc-6x6-unorm")},rse=Object.freeze(Object.keys(yA)),gA=Promise.resolve();Qq={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var xA={};Jt(xA,{BasisLoaderWithParser:()=>iV,BasisWorkerLoaderWithParser:()=>nV});var ase,tV,cse,rV,nV,iV,_A=p(()=>{"use strict";v2();Km();Km();({preload:ase,...tV}=ho),{preload:cse,...rV}=ho,nV={...tV},iV={...rV,parse:$m}});async function oV(){let{BasisLoaderWithParser:e}=await Promise.resolve().then(()=>(_A(),xA));return e}var ho,Km=p(()=>{"use strict";r2();Fm();ho={...M8,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Zl,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:oV}});function SA(e){return new Uint32Array(e,0,jn.HEADER_LENGTH)[jn.MAGIC_NUMBER_INDEX]===jn.MAGIC_NUMBER}function MA(e){let t=new Int32Array(e,0,jn.HEADER_LENGTH),r=t[jn.HEADER_PF_FOURCC_INDEX];Rl(!!(t[jn.HEADER_PF_FLAGS_INDEX]&jn.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=fV(r),i=sV[n],o=uV[n];Rl(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;t[jn.HEADER_FLAGS_INDEX]&jn.DDSD_MIPMAPCOUNT&&(s=Math.max(1,t[jn.MIPMAPCOUNT_INDEX]));let a=t[jn.HEADER_WIDTH_INDEX],c=t[jn.HEADER_HEIGHT_INDEX],l=t[jn.HEADER_SIZE_INDEX]+4,u=new Uint8Array(e,l);return eu(u,{mipMapLevels:s,width:a,height:c,sizeFunction:o,textureFormat:i})}function vA(e,t){return(e+3>>2)*(t+3>>2)*8}function Xm(e,t){return(e+3>>2)*(t+3>>2)*16}function fV(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var jn,sV,aV,cV,lV,uV,EA=p(()=>{"use strict";Vs();Wm();jn={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},sV={DXT1:"bc1-rgb-unorm-webgl",DXT3:"bc2-rgba-unorm",DXT5:"bc3-rgba-unorm","ATC ":"atc-rgb-unorm-webgl",ATCA:"atc-rgba-unorm-webgl",ATCI:"atc-rgbai-unorm-webgl"},aV=vA,cV=Xm,lV=Xm,uV={DXT1:vA,DXT3:Xm,DXT5:Xm,"ATC ":aV,ATCA:cV,ATCI:lV}});function IA(e){let r=new Uint32Array(e,0,gi.HEADER_LENGTH)[gi.MAGIC_NUMBER_INDEX];return r===gi.MAGIC_NUMBER||r===gi.MAGIC_NUMBER_EXTRA}function PA(e){let t=new Uint32Array(e,0,gi.HEADER_LENGTH),r=t[gi.PIXEL_FORMAT_INDEX],n=t[gi.COLOUR_SPACE_INDEX],i=hV[r]||[],o=i.length>1&&n?i[1]:i[0],s=dV[r],a=t[gi.MIPMAPCOUNT_INDEX],c=t[gi.WIDTH_INDEX],l=t[gi.HEIGHT_INDEX],u=gi.HEADER_SIZE+t[gi.METADATA_SIZE_INDEX],h=new Uint8Array(e,u);return eu(h,{mipMapLevels:a,width:c,height:l,sizeFunction:s,textureFormat:o})}function TA(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function AA(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function Uf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function jf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function mV(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function pV(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function gV(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function yV(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function bV(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function wV(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function xV(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function _V(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function SV(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function MV(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function vV(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function EV(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function TV(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}var gi,hV,dV,RA=p(()=>{"use strict";Wm();gi={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},hV={0:["pvrtc-rgb2unorm-webgl"],1:["pvrtc-rgba2unorm-webgl"],2:["pvrtc-rgb4unorm-webgl"],3:["pvrtc-rgba4unorm-webgl"],6:["etc1-rgb-unorm-webgl"],7:["bc1-rgb-unorm-webgl"],9:["bc2-rgba-unorm"],11:["bc3-rgba-unorm"],22:["etc2-rgb8unorm"],23:["etc2-rgba8unorm"],24:["etc2-rgb8a1unorm"],25:["eac-r11unorm"],26:["eac-rg11unorm"],27:["astc-4x4-unorm","astc-4x4-unorm-srgb"],28:["astc-5x4-unorm","astc-5x4-unorm-srgb"],29:["astc-5x5-unorm","astc-5x5-unorm-srgb"],30:["astc-6x5-unorm","astc-6x5-unorm-srgb"],31:["astc-6x6-unorm","astc-6x6-unorm-srgb"],32:["astc-8x5-unorm","astc-8x5-unorm-srgb"],33:["astc-8x6-unorm","astc-8x6-unorm-srgb"],34:["astc-8x8-unorm","astc-8x8-unorm-srgb"],35:["astc-10x5-unorm","astc-10x5-unorm-srgb"],36:["astc-10x6-unorm","astc-10x6-unorm-srgb"],37:["astc-10x8-unorm","astc-10x8-unorm-srgb"],38:["astc-10x10-unorm","astc-10x10-unorm-srgb"],39:["astc-12x10-unorm","astc-12x10-unorm-srgb"],40:["astc-12x12-unorm","astc-12x12-unorm-srgb"]},dV={0:TA,1:TA,2:AA,3:AA,6:Uf,7:Uf,9:jf,11:jf,22:Uf,23:jf,24:Uf,25:Uf,26:jf,27:jf,28:mV,29:pV,30:gV,31:yV,32:bV,33:wV,34:xV,35:_V,36:SV,37:MV,38:vV,39:EV,40:TV}});function E2(e){if(Ws(e))return pA(e);if(SA(e))return MA(e);if(IA(e))return PA(e);throw new Error("Texture container format not recognized")}var LA=p(()=>{"use strict";Hm();EA();RA()});var OA={};Jt(OA,{CompressedTextureLoaderWithParser:()=>RV,CompressedTextureWorkerLoaderWithParser:()=>PV});var Tse,AV,Ase,IV,PV,RV,BA=p(()=>{"use strict";LA();v2();Hm();Ym();Ym();({preload:Tse,...AV}=Ko),{preload:Ase,...IV}=Ko,PV={...AV},RV={...IV,parse:async(e,t)=>{var r,n;if(t={...t},(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis||Ws(e)){let i=Ws(e)?S2(e):null;return!((n=t==null?void 0:t["compressed-texture"])!=null&&n.useBasis||(i==null?void 0:i.supercompressionScheme)!==0||(i==null?void 0:i.vkFormat)===0)?E2(e):(t.basis={...t.basis,containerFormat:"ktx2"},(await $m(e,t))[0])}return E2(e)}}});async function LV(){let{CompressedTextureLoaderWithParser:e}=await Promise.resolve().then(()=>(BA(),OA));return e}var Ko,Ym=p(()=>{"use strict";r2();Fm();Ko={...v8,dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"images",version:Zl,worker:!0,encoding:"image",format:"compressed-texture",extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{useBasis:!1},basis:{format:"auto",containerFormat:"auto"}},preload:LV}});var zf=p(()=>{"use strict";t2();S8();Km();Ym()});var CA=p(()=>{"use strict"});function NA(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function H(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(h){s(h)}}function c(u){try{l(n.throw(u))}catch(h){s(h)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})}function DA(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(e){return this instanceof Me?(this.v=e,this):new Me(e)}function en(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(m){return function(g){return Promise.resolve(g).then(m,h)}}function a(m,g){n[m]&&(i[m]=function(y){return new Promise(function(b,w){o.push([m,y,b,w])>1||c(m,y)})},g&&(i[m]=g(i[m])))}function c(m,g){try{l(n[m](g))}catch(y){d(o[0][3],y)}}function l(m){m.value instanceof Me?Promise.resolve(m.value.v).then(u,h):d(o[0][2],m)}function u(m){c("next",m)}function h(m){c("throw",m)}function d(m,g){m(g),o.shift(),o.length&&c(o[0][0],o[0][1])}}function ru(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(s){return(r=!r)?{value:Me(e[i](s)),done:!1}:o?o(s):s}:o}}function zn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof DA=="function"?DA(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var Ar=p(()=>{});var FA,nu,OV,qn,Xo=p(()=>{FA=new TextDecoder("utf-8"),nu=FA.decode.bind(FA),OV=new TextEncoder,qn=e=>OV.encode(e)});var BV,GA,hr,tn,Vn,Wn,Mn,Zm,Jm,Qm,ep,tp,kA,qf,UA,rp,jA,Yo=p(()=>{BV=e=>typeof e=="number",GA=e=>typeof e=="boolean",hr=e=>typeof e=="function",tn=e=>e!=null&&Object(e)===e,Vn=e=>tn(e)&&hr(e.then),Wn=e=>tn(e)&&hr(e[Symbol.iterator]),Mn=e=>tn(e)&&hr(e[Symbol.asyncIterator]),Zm=e=>tn(e)&&tn(e.schema),Jm=e=>tn(e)&&"done"in e&&"value"in e,Qm=e=>tn(e)&&hr(e.stat)&&BV(e.fd),ep=e=>tn(e)&&qf(e.body),tp=e=>"_getDOMStream"in e&&"_getNodeStream"in e,kA=e=>tn(e)&&hr(e.abort)&&hr(e.getWriter)&&!tp(e),qf=e=>tn(e)&&hr(e.cancel)&&hr(e.getReader)&&!tp(e),UA=e=>tn(e)&&hr(e.end)&&hr(e.write)&&GA(e.writable)&&!tp(e),rp=e=>tn(e)&&hr(e.read)&&hr(e.pipe)&&GA(e.readable)&&!tp(e),jA=e=>tn(e)&&hr(e.clear)&&hr(e.bytes)&&hr(e.position)&&hr(e.setPosition)&&hr(e.capacity)&&hr(e.getBufferIdentifier)&&hr(e.createLong)});var L2={};Jt(L2,{compareArrayLike:()=>R2,joinUint8Arrays:()=>Hn,memcpy:()=>Vf,rebaseValueOffsets:()=>np,toArrayBufferView:()=>Re,toArrayBufferViewAsyncIterator:()=>Di,toArrayBufferViewIterator:()=>mo,toBigInt64Array:()=>Wf,toBigUint64Array:()=>kV,toFloat32Array:()=>UV,toFloat32ArrayAsyncIterator:()=>rW,toFloat32ArrayIterator:()=>KV,toFloat64Array:()=>jV,toFloat64ArrayAsyncIterator:()=>nW,toFloat64ArrayIterator:()=>XV,toInt16Array:()=>NV,toInt16ArrayAsyncIterator:()=>JV,toInt16ArrayIterator:()=>VV,toInt32Array:()=>pc,toInt32ArrayAsyncIterator:()=>QV,toInt32ArrayIterator:()=>WV,toInt8Array:()=>DV,toInt8ArrayAsyncIterator:()=>ZV,toInt8ArrayIterator:()=>qV,toUint16Array:()=>FV,toUint16ArrayAsyncIterator:()=>eW,toUint16ArrayIterator:()=>HV,toUint32Array:()=>GV,toUint32ArrayAsyncIterator:()=>tW,toUint32ArrayIterator:()=>$V,toUint8Array:()=>se,toUint8ArrayAsyncIterator:()=>P2,toUint8ArrayIterator:()=>I2,toUint8ClampedArray:()=>zV,toUint8ClampedArrayAsyncIterator:()=>iW,toUint8ClampedArrayIterator:()=>YV});function CV(e){let t=e[0]?[e[0]]:[],r,n,i,o;for(let s,a,c=0,l=0,u=e.length;++c<u;){if(s=t[l],a=e[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:r,byteLength:i}=s,{byteOffset:n,byteLength:o}=a,r+i<n||n+o<r){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,r,n-r+o)}return t}function Vf(e,t,r=0,n=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,i));return o.set(s,r),e}function Hn(e,t){let r=CV(e),n=r.reduce((u,h)=>u+h.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,n);for(let u=r.length;++c<u;){if(i=r[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?r[c]=i.subarray(o.length):o.length===i.length&&c++,s?Vf(s,o,a):s=o;break}Vf(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),r.slice(c),n-(s?s.byteLength:0)]}function Re(e,t){let r=Jm(t)?t.value:t;return r instanceof e?e===Uint8Array?new e(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=qn(r)),r instanceof ArrayBuffer?new e(r):r instanceof A2?new e(r):jA(r)?Re(e,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new e(0):new e(r.buffer,r.byteOffset,r.byteLength/e.BYTES_PER_ELEMENT):e.from(r)):new e(0)}function*mo(e,t){let r=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof A2?r(t):Wn(t)?t:r(t);return yield*T2((function*(i){let o=null;do o=i.next(yield Re(e,o));while(!o.done)})(n[Symbol.iterator]())),new e}function Di(e,t){return en(this,arguments,function*(){if(Vn(t))return yield Me(yield Me(yield*ru(zn(Di(e,yield Me(t))))));let n=function(s){return en(this,arguments,function*(){yield yield Me(yield Me(s))})},i=function(s){return en(this,arguments,function*(){yield Me(yield*ru(zn(T2((function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)})(s[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof A2?n(t):Wn(t)?i(t):Mn(t)?t:n(t);return yield Me(yield*ru(zn(T2((function(s){return en(this,arguments,function*(){let a=null;do a=yield Me(s.next(yield yield Me(Re(e,a))));while(!a.done)})})(o[Symbol.asyncIterator]()))))),yield Me(new e)})}function np(e,t,r){if(e!==0){r=r.slice(0,t);let n=typeof r[0]=="bigint"?BigInt(e):e;for(let i=-1,o=r.length;++i<o;)r[i]+=n}return r.subarray(0,t)}function R2(e,t){let r=0,n=e.length;if(n!==t.length)return!1;if(n>0)do if(e[r]!==t[r])return!1;while(++r<n);return!0}var A2,DV,NV,pc,Wf,se,FV,GV,kV,UV,jV,zV,T2,qV,VV,WV,I2,HV,$V,KV,XV,YV,ZV,JV,QV,P2,eW,tW,rW,nW,iW,dr=p(()=>{Ar();Xo();Yo();A2=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;DV=e=>Re(Int8Array,e),NV=e=>Re(Int16Array,e),pc=e=>Re(Int32Array,e),Wf=e=>Re(BigInt64Array,e),se=e=>Re(Uint8Array,e),FV=e=>Re(Uint16Array,e),GV=e=>Re(Uint32Array,e),kV=e=>Re(BigUint64Array,e),UV=e=>Re(Float32Array,e),jV=e=>Re(Float64Array,e),zV=e=>Re(Uint8ClampedArray,e),T2=e=>(e.next(),e);qV=e=>mo(Int8Array,e),VV=e=>mo(Int16Array,e),WV=e=>mo(Int32Array,e),I2=e=>mo(Uint8Array,e),HV=e=>mo(Uint16Array,e),$V=e=>mo(Uint32Array,e),KV=e=>mo(Float32Array,e),XV=e=>mo(Float64Array,e),YV=e=>mo(Uint8ClampedArray,e);ZV=e=>Di(Int8Array,e),JV=e=>Di(Int16Array,e),QV=e=>Di(Int32Array,e),P2=e=>Di(Uint8Array,e),eW=e=>Di(Uint16Array,e),tW=e=>Di(Uint32Array,e),rW=e=>Di(Float32Array,e),nW=e=>Di(Float64Array,e),iW=e=>Di(Uint8ClampedArray,e)});function*oW(e){let t,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?Hn(n,s)[0]:([i,n,a]=Hn(n,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=I2(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){r=!0,typeof l.throw=="function"&&l.throw(u)}finally{r===!1&&typeof l.return=="function"&&l.return(null)}return null}function sW(e){return en(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Hn(i,a)[0]:([o,i,c]=Hn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=P2(e)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(a-c)?yield Me(u.next()):yield Me(u.next(a-c)),!r&&o.byteLength>0&&(i.push(o),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield Me(l()));while(a<c);while(!r)}catch(h){n=!0,typeof u.throw=="function"&&(yield Me(u.throw(h)))}finally{n===!1&&typeof u.return=="function"&&(yield Me(u.return(new Uint8Array(0))))}return yield Me(null)})}function aW(e){return en(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Hn(i,a)[0]:([o,i,c]=Hn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=new B2(e);try{do if({done:r,value:o}=Number.isNaN(a-c)?yield Me(u.read()):yield Me(u.read(a-c)),!r&&o.byteLength>0&&(i.push(se(o)),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield Me(l()));while(a<c);while(!r)}catch(h){n=!0,yield Me(u.cancel(h))}finally{n===!1?yield Me(u.cancel()):e.locked&&u.releaseLock()}return yield Me(null)})}function cW(e){return en(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function h(){return s==="peek"?Hn(l,a)[0]:([u,l,c]=Hn(l,a),u)}if({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0},e.isTTY)return yield yield Me(new Uint8Array(0)),yield Me(null);try{r[0]=O2(e,"end"),r[1]=O2(e,"error");do{if(r[2]=O2(e,"readable"),[n,o]=yield Me(Promise.race(r.map(m=>m[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-c)?(u=se(e.read(a-c)),u.byteLength<a-c&&(u=se(e.read()))):u=se(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield Me(h()));while(a<c)}while(!i)}finally{yield Me(d(r,n==="error"?o:null))}return yield Me(null);function d(m,g){return u=l=null,new Promise((y,b)=>{for(let[w,_]of m)e.off(w,_);try{let w=e.destroy;w&&w.call(e,g),g=void 0}catch(w){g=w||g}finally{g!=null?b(g):y()}})}})}var mr,ip,B2,O2,iu=p(()=>{Ar();dr();mr={fromIterable(e){return ip(oW(e))},fromAsyncIterable(e){return ip(sW(e))},fromDOMStream(e){return ip(aW(e))},fromNodeStream(e){return ip(cW(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},ip=e=>(e.next(),e);B2=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return H(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return H(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=se(r)),r})}},O2=(e,t)=>{let r=i=>n([t,i]),n;return[t,r,new Promise(i=>(n=i)&&e.once(t,r))]}});var it,op=p(()=>{(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(it||(it={}))});var Ze,C2=p(()=>{(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Ze||(Ze={}))});var He,D2=p(()=>{(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(He||(He={}))});var st,N2=p(()=>{(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(st||(st={}))});var q,Hf=p(()=>{(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(q||(q={}))});var ke,F2=p(()=>{(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(ke||(ke={}))});var sp=ae(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.SIZE_PREFIX_LENGTH=po.FILE_IDENTIFIER_LENGTH=po.SIZEOF_INT=po.SIZEOF_SHORT=void 0;po.SIZEOF_SHORT=2;po.SIZEOF_INT=4;po.FILE_IDENTIFIER_LENGTH=4;po.SIZE_PREFIX_LENGTH=4});var G2=ae(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.isLittleEndian=yi.float64=yi.float32=yi.int32=void 0;yi.int32=new Int32Array(2);yi.float32=new Float32Array(yi.int32.buffer);yi.float64=new Float64Array(yi.int32.buffer);yi.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var k2=ae(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.Encoding=void 0;var zA;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(zA||(ap.Encoding=zA={}))});var j2=ae(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.ByteBuffer=void 0;var go=sp(),lW=k2(),vn=G2(),U2=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return vn.int32[0]=this.readInt32(t),vn.float32[0]}readFloat64(t){return vn.int32[vn.isLittleEndian?0:1]=this.readInt32(t),vn.int32[vn.isLittleEndian?1:0]=this.readInt32(t+4),vn.float64[0]}writeInt8(t,r){this.bytes_[t]=r}writeUint8(t,r){this.bytes_[t]=r}writeInt16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeUint16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeInt32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeUint32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeInt64(t,r){this.writeInt32(t,Number(BigInt.asIntN(32,r))),this.writeInt32(t+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(t,r){this.writeUint32(t,Number(BigInt.asUintN(32,r))),this.writeUint32(t+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(t,r){vn.float32[0]=r,this.writeInt32(t,vn.int32[0])}writeFloat64(t,r){vn.float64[0]=r,this.writeInt32(t,vn.int32[vn.isLittleEndian?0:1]),this.writeInt32(t+4,vn.int32[vn.isLittleEndian?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+go.SIZEOF_INT+go.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let r=0;r<go.FILE_IDENTIFIER_LENGTH;r++)t+=String.fromCharCode(this.readInt8(this.position_+go.SIZEOF_INT+r));return t}__offset(t,r){let n=t-this.readInt32(t);return r<this.readInt16(n)?this.readInt16(n+r):0}__union(t,r){return t.bb_pos=r+this.readInt32(r),t.bb=this,t}__string(t,r){t+=this.readInt32(t);let n=this.readInt32(t);t+=go.SIZEOF_INT;let i=this.bytes_.subarray(t,t+n);return r===lW.Encoding.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,r){return typeof t=="string"?this.__string(r):this.__union(t,r)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+go.SIZEOF_INT}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=go.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+go.FILE_IDENTIFIER_LENGTH);for(let r=0;r<go.FILE_IDENTIFIER_LENGTH;r++)if(t.charCodeAt(r)!=this.readInt8(this.position()+go.SIZEOF_INT+r))return!1;return!0}createScalarList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o)}return n}createObjList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o.unpack())}return n}};cp.ByteBuffer=U2});var VA=ae(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.Builder=void 0;var qA=j2(),$n=sp(),z2=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let r;t?r=t:r=1024,this.bb=qA.ByteBuffer.allocate(r),this.space=r}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,r){t>this.minalign&&(this.minalign=t);let n=~(this.bb.capacity()-this.space+r)+1&t-1;for(;this.space<n+t+r;){let i=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(t){for(let r=0;r<t;r++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(t))}addFieldInt16(t,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(t))}addFieldInt32(t,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(t))}addFieldInt64(t,r,n){(this.force_defaults||r!==n)&&(this.addInt64(r),this.slot(t))}addFieldFloat32(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(t))}addFieldFloat64(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(t))}addFieldOffset(t,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(t))}addFieldStruct(t,r,n){r!=n&&(this.nested(r),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let r=t.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=r<<1,i=qA.ByteBuffer.allocate(n);return i.setPosition(n-r),i.bytes().set(t.bytes(),n-r),i}addOffset(t){this.prep($n.SIZEOF_INT,0),this.writeInt32(this.offset()-t+$n.SIZEOF_INT)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let r=0;r<t;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let n=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);let i=2;this.addInt16(t-this.object_start);let o=(n+i)*$n.SIZEOF_SHORT;this.addInt16(o);let s=0,a=this.space;e:for(r=0;r<this.vtables.length;r++){let c=this.bb.capacity()-this.vtables[r];if(o==this.bb.readInt16(c)){for(let l=$n.SIZEOF_SHORT;l<o;l+=$n.SIZEOF_SHORT)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue e;s=this.vtables[r];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,r,n){let i=n?$n.SIZE_PREFIX_LENGTH:0;if(r){let o=r;if(this.prep(this.minalign,$n.SIZEOF_INT+$n.FILE_IDENTIFIER_LENGTH+i),o.length!=$n.FILE_IDENTIFIER_LENGTH)throw new TypeError("FlatBuffers: file identifier must be length "+$n.FILE_IDENTIFIER_LENGTH);for(let s=$n.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,$n.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,r){this.finish(t,r,!0)}requiredField(t,r){let n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(r<this.bb.readInt16(i)&&this.bb.readInt16(i+r)!=0))throw new TypeError("FlatBuffers: field "+r+" must be set")}startVector(t,r,n){this.notNested(),this.vector_num_elems=r,this.prep($n.SIZEOF_INT,t*r),this.prep(n,t*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let r=this.createString(t);return this.string_maps.set(t,r),r}createString(t){if(t==null)return 0;let r;return t instanceof Uint8Array?r=t:r=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length),this.bb.bytes().set(r,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let r=[];for(let n=0;n<t.length;++n){let i=t[n];if(i!==null)r.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(t,r){return r(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};lp.Builder=z2});var ze=ae(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.Encoding=It.ByteBuffer=It.Builder=It.isLittleEndian=It.int32=It.float64=It.float32=It.SIZE_PREFIX_LENGTH=It.SIZEOF_SHORT=It.SIZEOF_INT=It.FILE_IDENTIFIER_LENGTH=void 0;var up=sp();Object.defineProperty(It,"FILE_IDENTIFIER_LENGTH",{enumerable:!0,get:function(){return up.FILE_IDENTIFIER_LENGTH}});Object.defineProperty(It,"SIZEOF_INT",{enumerable:!0,get:function(){return up.SIZEOF_INT}});Object.defineProperty(It,"SIZEOF_SHORT",{enumerable:!0,get:function(){return up.SIZEOF_SHORT}});Object.defineProperty(It,"SIZE_PREFIX_LENGTH",{enumerable:!0,get:function(){return up.SIZE_PREFIX_LENGTH}});var fp=G2();Object.defineProperty(It,"float32",{enumerable:!0,get:function(){return fp.float32}});Object.defineProperty(It,"float64",{enumerable:!0,get:function(){return fp.float64}});Object.defineProperty(It,"int32",{enumerable:!0,get:function(){return fp.int32}});Object.defineProperty(It,"isLittleEndian",{enumerable:!0,get:function(){return fp.isLittleEndian}});var uW=VA();Object.defineProperty(It,"Builder",{enumerable:!0,get:function(){return uW.Builder}});var fW=j2();Object.defineProperty(It,"ByteBuffer",{enumerable:!0,get:function(){return fW.ByteBuffer}});var hW=k2();Object.defineProperty(It,"Encoding",{enumerable:!0,get:function(){return hW.Encoding}})});var gc,q2=p(()=>{(function(e){e[e.BUFFER=0]="BUFFER"})(gc||(gc={}))});var Ir,ou=p(()=>{(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Ir||(Ir={}))});var WA,Zo,V2=p(()=>{WA=me(ze(),1);q2();ou();Zo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBodyCompression(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,r){return t.setPosition(t.position()+WA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Ir.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):gc.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,r){t.addFieldInt8(0,r,Ir.LZ4_FRAME)}static addMethod(t,r){t.addFieldInt8(1,r,gc.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,r,n){return e.startBodyCompression(t),e.addCodec(t,r),e.addMethod(t,n),e.endBodyCompression(t)}}});var su,W2=p(()=>{su=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}}});var au,H2=p(()=>{au=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}}});var HA,Dr,$2=p(()=>{HA=me(ze(),1);V2();W2();H2();Dr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsRecordBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,r){return t.setPosition(t.position()+HA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new au).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new su).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new Zo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(t){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}variadicBufferCountsLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startRecordBatch(t){t.startObject(5)}static addLength(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addNodes(t,r){t.addFieldOffset(1,r,0)}static startNodesVector(t,r){t.startVector(16,r,8)}static addBuffers(t,r){t.addFieldOffset(2,r,0)}static startBuffersVector(t,r){t.startVector(16,r,8)}static addCompression(t,r){t.addFieldOffset(3,r,0)}static addVariadicBufferCounts(t,r){t.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startVariadicBufferCountsVector(t,r){t.startVector(8,r,8)}static endRecordBatch(t){return t.endObject()}}});var $A,Jo,KA=p(()=>{$A=me(ze(),1);$2();Jo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,r){return t.setPosition(t.position()+$A.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Dr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addData(t,r){t.addFieldOffset(1,r,0)}static addIsDelta(t,r){t.addFieldInt8(2,+r,0)}static endDictionaryBatch(t){return t.endObject()}}});var Hs,K2=p(()=>{(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(Hs||(Hs={}))});var $f,XA=p(()=>{(function(e){e[e.DenseArray=0]="DenseArray"})($f||($f={}))});var YA,Ni,hp=p(()=>{YA=me(ze(),1),Ni=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInt(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,r){return t.setPosition(t.position()+YA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,r){t.addFieldInt32(0,r,0)}static addIsSigned(t,r){t.addFieldInt8(1,+r,0)}static endInt(t){return t.endObject()}static createInt(t,r,n){return e.startInt(t),e.addBitWidth(t,r),e.addIsSigned(t,n),e.endInt(t)}}});var ZA,yo,X2=p(()=>{ZA=me(ze(),1);XA();hp();yo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryEncoding(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,r){return t.setPosition(t.position()+ZA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Ni).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):$f.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addIndexType(t,r){t.addFieldOffset(1,r,0)}static addIsOrdered(t,r){t.addFieldInt8(2,+r,0)}static addDictionaryKind(t,r){t.addFieldInt16(3,r,$f.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}});var JA,Dt,cu=p(()=>{JA=me(ze(),1),Dt=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsKeyValue(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,r){return t.setPosition(t.position()+JA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}value(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,r){t.addFieldOffset(0,r,0)}static addValue(t,r){t.addFieldOffset(1,r,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,r,n){return e.startKeyValue(t),e.addKey(t,r),e.addValue(t,n),e.endKeyValue(t)}}});var QA,Kf,eI=p(()=>{QA=me(ze(),1),Kf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,r){return t.setPosition(t.position()+QA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}}});var tI,Xf,rI=p(()=>{tI=me(ze(),1),Xf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinaryView(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinaryView(t,r){return t.setPosition(t.position()+tI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinaryView(t){t.startObject(0)}static endBinaryView(t){return t.endObject()}static createBinaryView(t){return e.startBinaryView(t),e.endBinaryView(t)}}});var nI,Yf,iI=p(()=>{nI=me(ze(),1),Yf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,r){return t.setPosition(t.position()+nI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}}});var oI,$s,Y2=p(()=>{oI=me(ze(),1);N2();$s=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDate(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,r){return t.setPosition(t.position()+oI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):st.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,st.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,r){return e.startDate(t),e.addUnit(t,r),e.endDate(t)}}});var sI,bo,Z2=p(()=>{sI=me(ze(),1),bo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDecimal(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,r){return t.setPosition(t.position()+sI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,r){t.addFieldInt32(0,r,0)}static addScale(t,r){t.addFieldInt32(1,r,0)}static addBitWidth(t,r){t.addFieldInt32(2,r,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,r,n,i){return e.startDecimal(t),e.addPrecision(t,r),e.addScale(t,n),e.addBitWidth(t,i),e.endDecimal(t)}}});var aI,Ks,J2=p(()=>{aI=me(ze(),1);Hf();Ks=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDuration(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,r){return t.setPosition(t.position()+aI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,q.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,r){return e.startDuration(t),e.addUnit(t,r),e.endDuration(t)}}});var cI,Xs,Q2=p(()=>{cI=me(ze(),1),Xs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,r){return t.setPosition(t.position()+cI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,r){return e.startFixedSizeBinary(t),e.addByteWidth(t,r),e.endFixedSizeBinary(t)}}});var lI,Ys,eb=p(()=>{lI=me(ze(),1),Ys=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,r){return t.setPosition(t.position()+lI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,r){return e.startFixedSizeList(t),e.addListSize(t,r),e.endFixedSizeList(t)}}});var uI,Zs,tb=p(()=>{uI=me(ze(),1);D2();Zs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFloatingPoint(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,r){return t.setPosition(t.position()+uI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):He.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,r){t.addFieldInt16(0,r,He.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,r){return e.startFloatingPoint(t),e.addPrecision(t,r),e.endFloatingPoint(t)}}});var fI,Js,rb=p(()=>{fI=me(ze(),1);F2();Js=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInterval(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,r){return t.setPosition(t.position()+fI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ke.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,ke.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,r){return e.startInterval(t),e.addUnit(t,r),e.endInterval(t)}}});var hI,Zf,dI=p(()=>{hI=me(ze(),1),Zf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,r){return t.setPosition(t.position()+hI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}}});var mI,Jf,pI=p(()=>{mI=me(ze(),1),Jf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeList(t,r){return t.setPosition(t.position()+mI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeList(t){t.startObject(0)}static endLargeList(t){return t.endObject()}static createLargeList(t){return e.startLargeList(t),e.endLargeList(t)}}});var gI,Qf,yI=p(()=>{gI=me(ze(),1),Qf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,r){return t.setPosition(t.position()+gI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}}});var bI,eh,wI=p(()=>{bI=me(ze(),1),eh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,r){return t.setPosition(t.position()+bI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}}});var xI,Qs,nb=p(()=>{xI=me(ze(),1),Qs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,r){return t.setPosition(t.position()+xI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,r){t.addFieldInt8(0,+r,0)}static endMap(t){return t.endObject()}static createMap(t,r){return e.startMap(t),e.addKeysSorted(t,r),e.endMap(t)}}});var _I,th,SI=p(()=>{_I=me(ze(),1),th=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,r){return t.setPosition(t.position()+_I.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}}});var MI,rh,vI=p(()=>{MI=me(ze(),1),rh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,r){return t.setPosition(t.position()+MI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}}});var EI,Qo,ib=p(()=>{EI=me(ze(),1);Hf();Qo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTime(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,r){return t.setPosition(t.position()+EI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,q.MILLISECOND)}static addBitWidth(t,r){t.addFieldInt32(1,r,32)}static endTime(t){return t.endObject()}static createTime(t,r,n){return e.startTime(t),e.addUnit(t,r),e.addBitWidth(t,n),e.endTime(t)}}});var TI,es,ob=p(()=>{TI=me(ze(),1);Hf();es=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTimestamp(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,r){return t.setPosition(t.position()+TI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.SECOND}timezone(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,q.SECOND)}static addTimezone(t,r){t.addFieldOffset(1,r,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,r,n){return e.startTimestamp(t),e.addUnit(t,r),e.addTimezone(t,n),e.endTimestamp(t)}}});var AI,Fi,sb=p(()=>{AI=me(ze(),1);C2();Fi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUnion(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,r){return t.setPosition(t.position()+AI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ze.Sparse}typeIds(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,r){t.addFieldInt16(0,r,Ze.Sparse)}static addTypeIds(t,r){t.addFieldOffset(1,r,0)}static createTypeIdsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addInt32(r[n]);return t.endVector()}static startTypeIdsVector(t,r){t.startVector(4,r,4)}static endUnion(t){return t.endObject()}static createUnion(t,r,n){return e.startUnion(t),e.addMode(t,r),e.addTypeIds(t,n),e.endUnion(t)}}});var II,nh,PI=p(()=>{II=me(ze(),1),nh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,r){return t.setPosition(t.position()+II.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}}});var RI,ih,LI=p(()=>{RI=me(ze(),1),ih=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8View(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8View(t,r){return t.setPosition(t.position()+RI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8View(t){t.startObject(0)}static endUtf8View(t){return t.endObject()}static createUtf8View(t){return e.startUtf8View(t),e.endUtf8View(t)}}});var pe,dp=p(()=>{(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded",e[e.BinaryView=23]="BinaryView",e[e.Utf8View=24]="Utf8View",e[e.ListView=25]="ListView",e[e.LargeListView=26]="LargeListView"})(pe||(pe={}))});var OI,Nr,ab=p(()=>{OI=me(ze(),1);X2();cu();dp();Nr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsField(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,r){return t.setPosition(t.position()+OI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):pe.NONE}type(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(t,this.bb_pos+r):null}dictionary(t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new yo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(t,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,r){t.addFieldOffset(0,r,0)}static addNullable(t,r){t.addFieldInt8(1,+r,0)}static addTypeType(t,r){t.addFieldInt8(2,r,pe.NONE)}static addType(t,r){t.addFieldOffset(3,r,0)}static addDictionary(t,r){t.addFieldOffset(4,r,0)}static addChildren(t,r){t.addFieldOffset(5,r,0)}static createChildrenVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startChildrenVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(6,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endField(t){return t.endObject()}}});var BI,En,cb=p(()=>{BI=me(ze(),1);K2();ab();cu();En=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsSchema(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,r){return t.setPosition(t.position()+BI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Hs.Little}fields(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new Nr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,r){t.addFieldInt16(0,r,Hs.Little)}static addFields(t,r){t.addFieldOffset(1,r,0)}static createFieldsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startFieldsVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(2,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static addFeatures(t,r){t.addFieldOffset(3,r,0)}static createFeaturesVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startFeaturesVector(t,r){t.startVector(8,r,8)}static endSchema(t){return t.endObject()}static createSchema(t,r,n,i,o){return e.startSchema(t),e.addEndianness(t,r),e.addFields(t,n),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}}});var Ge,mp=p(()=>{(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(Ge||(Ge={}))});var x,Ne,Nt=p(()=>{op();C2();D2();N2();Hf();F2();mp();(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.BinaryView=23]="BinaryView",e[e.Utf8View=24]="Utf8View",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond",e[e.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(x||(x={}));(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Ne||(Ne={}))});var lb={};Jt(lb,{valueToString:()=>Gi});function Gi(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>Gi(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,r)=>typeof r=="bigint"?`${r}`:r)}var oh=p(()=>{});function Le(e){if(typeof e=="bigint"&&(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function ub(e,t){return Le(e/t)+Le(e%t)/Le(t)}var wo=p(()=>{});var db={};Jt(db,{BN:()=>yc,bigNumToBigInt:()=>DI,bigNumToNumber:()=>hb,bigNumToString:()=>fu,isArrowBigNumSymbol:()=>CI});function ki(e,...t){return t.length===0?Object.setPrototypeOf(Re(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}function lu(...e){return ki.apply(this,e)}function uu(...e){return ki.apply(this,e)}function sh(...e){return ki.apply(this,e)}function hb(e,t){let{buffer:r,byteOffset:n,byteLength:i,signed:o}=e,s=new BigUint64Array(r,n,i/8),a=o&&s.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),l=0;if(a){for(let u of s)c|=(u^mW)*(BigInt(1)<<BigInt(64*l++));c*=BigInt(-1),c-=BigInt(1)}else for(let u of s)c|=u*(BigInt(1)<<BigInt(64*l++));if(typeof t=="number"&&t>0){let u=BigInt("1".padEnd(t+1,"0")),h=c/u,d=a?-(c%u):c%u,m=Le(h),g=`${d}`.padStart(t,"0");return+`${a&&m===0?"-":""}${m}.${g}`}return Le(c)}function fu(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return fb(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return fb(e);t=t.slice();let n=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+n;t[o]=a,n&=s===0?1:0}return`-${fb(t)}`}function DI(e){return e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:fu(e)}function fb(e){let t="",r=new Uint32Array(2),n=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),o=-1,s=n.length-1;do{for(r[0]=n[o=0];o<s;)n[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+n[o];n[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,t=`${r[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var CI,dW,mW,yc,pp=p(()=>{dr();wo();CI=Symbol.for("isArrowBigNum");ki.prototype[CI]=!0;ki.prototype.toJSON=function(){return`"${fu(this)}"`};ki.prototype.valueOf=function(e){return hb(this,e)};ki.prototype.toString=function(){return fu(this)};ki.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return hb(this);case"string":return fu(this);case"default":return DI(this)}return fu(this)};Object.setPrototypeOf(lu.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(uu.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(sh.prototype,Object.create(Uint32Array.prototype));Object.assign(lu.prototype,ki.prototype,{constructor:lu,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(uu.prototype,ki.prototype,{constructor:uu,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(sh.prototype,ki.prototype,{constructor:sh,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});dW=BigInt(4294967296)*BigInt(4294967296),mW=dW-BigInt(1);yc=class e{static new(t,r){switch(r){case!0:return new lu(t);case!1:return new uu(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new lu(t)}return t.byteLength===16?new sh(t):new uu(t)}static signed(t){return new lu(t)}static unsigned(t){return new uu(t)}static decimal(t){return new sh(t)}constructor(t,r){return e.new(t,r)}}});function ti(e){let t=e;switch(e.typeId){case x.Decimal:return e.bitWidth/32;case x.Interval:return t.unit===ke.MONTH_DAY_NANO?4:1+t.unit;case x.BinaryView:case x.Utf8View:return 16;case x.FixedSizeList:return t.listSize;case x.FixedSizeBinary:return t.byteWidth;default:return 1}}var NI,FI,GI,kI,UI,jI,zI,qI,VI,WI,HI,$I,KI,XI,YI,ZI,JI,QI,e6,t6,r6,n6,i6,o6,s6,a6,z,Wt,Pt,Kn,Xn,Yt,Yn,Zn,Jn,rn,Ui,Fr,ji,nn,Qn,Tn,Ee,zi,Gr,on,qi,kr,An,sn,ea,ta,Pr,ra,na,ia,oa,Rr,sa,xo,aa,ca,Ur,la,ua,ah,an,ch,lh,uh,fh,rr,ei,tt,cn,ts,fa,In,Ht,jr,pW,nr,at=p(()=>{wo();Nt();a6=Symbol.for("apache-arrow/DataType"),z=class e{static isDataType(t){return(t==null?void 0:t[a6])===!0}static isNull(t){return(t==null?void 0:t.typeId)===x.Null}static isInt(t){return(t==null?void 0:t.typeId)===x.Int}static isFloat(t){return(t==null?void 0:t.typeId)===x.Float}static isBinary(t){return(t==null?void 0:t.typeId)===x.Binary}static isBinaryView(t){return(t==null?void 0:t.typeId)===x.BinaryView}static isLargeBinary(t){return(t==null?void 0:t.typeId)===x.LargeBinary}static isUtf8(t){return(t==null?void 0:t.typeId)===x.Utf8}static isUtf8View(t){return(t==null?void 0:t.typeId)===x.Utf8View}static isLargeUtf8(t){return(t==null?void 0:t.typeId)===x.LargeUtf8}static isBool(t){return(t==null?void 0:t.typeId)===x.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===x.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===x.Date}static isTime(t){return(t==null?void 0:t.typeId)===x.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===x.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===x.Interval}static isDuration(t){return(t==null?void 0:t.typeId)===x.Duration}static isList(t){return(t==null?void 0:t.typeId)===x.List}static isLargeList(t){return(t==null?void 0:t.typeId)===x.LargeList}static isStruct(t){return(t==null?void 0:t.typeId)===x.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===x.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===x.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===x.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===x.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===x.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===Ze.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===Ze.Sparse}constructor(t){this.typeId=t}};NI=Symbol.toStringTag;z[NI]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[a6]=!0,e[Symbol.toStringTag]="DataType"))(z.prototype);Wt=class extends z{constructor(){super(x.Null)}toString(){return"Null"}};FI=Symbol.toStringTag;Wt[FI]=(e=>e[Symbol.toStringTag]="Null")(Wt.prototype);Pt=class extends z{constructor(t,r){super(x.Int),this.isSigned=t,this.bitWidth=r}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};GI=Symbol.toStringTag;Pt[GI]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Pt.prototype);Kn=class extends Pt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Xn=class extends Pt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Yt=class extends Pt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Yn=class extends Pt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Zn=class extends Pt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Jn=class extends Pt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},rn=class extends Pt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Ui=class extends Pt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Kn.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Xn.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Yt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Yn.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Zn.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Jn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(rn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Ui.prototype,"ArrayType",{value:BigUint64Array});Fr=class extends z{constructor(t){super(x.Float),this.precision=t}get ArrayType(){switch(this.precision){case He.HALF:return Uint16Array;case He.SINGLE:return Float32Array;case He.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};kI=Symbol.toStringTag;Fr[kI]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Fr.prototype);ji=class extends Fr{constructor(){super(He.HALF)}},nn=class extends Fr{constructor(){super(He.SINGLE)}},Qn=class extends Fr{constructor(){super(He.DOUBLE)}};Object.defineProperty(ji.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(nn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Qn.prototype,"ArrayType",{value:Float64Array});Tn=class extends z{constructor(){super(x.Binary)}toString(){return"Binary"}};UI=Symbol.toStringTag;Tn[UI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Tn.prototype);Ee=class extends z{constructor(){super(x.BinaryView)}toString(){return"BinaryView"}};jI=Symbol.toStringTag;Ee.ELEMENT_WIDTH=16;Ee.INLINE_CAPACITY=12;Ee.LENGTH_OFFSET=0;Ee.INLINE_OFFSET=4;Ee.BUFFER_INDEX_OFFSET=8;Ee.BUFFER_OFFSET_OFFSET=12;Ee[jI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="BinaryView"))(Ee.prototype);zi=class extends z{constructor(){super(x.LargeBinary)}toString(){return"LargeBinary"}};zI=Symbol.toStringTag;zi[zI]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(zi.prototype);Gr=class extends z{constructor(){super(x.Utf8)}toString(){return"Utf8"}};qI=Symbol.toStringTag;Gr[qI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Gr.prototype);on=class extends z{constructor(){super(x.Utf8View)}toString(){return"Utf8View"}};VI=Symbol.toStringTag;on.ELEMENT_WIDTH=Ee.ELEMENT_WIDTH;on.INLINE_CAPACITY=Ee.INLINE_CAPACITY;on[VI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8View"))(on.prototype);qi=class extends z{constructor(){super(x.LargeUtf8)}toString(){return"LargeUtf8"}};WI=Symbol.toStringTag;qi[WI]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(qi.prototype);kr=class extends z{constructor(){super(x.Bool)}toString(){return"Bool"}};HI=Symbol.toStringTag;kr[HI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(kr.prototype);An=class extends z{constructor(t,r,n=128){super(x.Decimal),this.scale=t,this.precision=r,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};$I=Symbol.toStringTag;An[$I]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(An.prototype);sn=class extends z{constructor(t){super(x.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${st[this.unit]}>`}get ArrayType(){return this.unit===st.DAY?Int32Array:BigInt64Array}};KI=Symbol.toStringTag;sn[KI]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(sn.prototype);ea=class extends sn{constructor(){super(st.DAY)}},ta=class extends sn{constructor(){super(st.MILLISECOND)}},Pr=class extends z{constructor(t,r){super(x.Time),this.unit=t,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${q[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};XI=Symbol.toStringTag;Pr[XI]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Pr.prototype);ra=class extends Pr{constructor(){super(q.SECOND,32)}},na=class extends Pr{constructor(){super(q.MILLISECOND,32)}},ia=class extends Pr{constructor(){super(q.MICROSECOND,64)}},oa=class extends Pr{constructor(){super(q.NANOSECOND,64)}},Rr=class extends z{constructor(t,r){super(x.Timestamp),this.unit=t,this.timezone=r}toString(){return`Timestamp<${q[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};YI=Symbol.toStringTag;Rr[YI]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(Rr.prototype);sa=class extends Rr{constructor(t){super(q.SECOND,t)}},xo=class extends Rr{constructor(t){super(q.MILLISECOND,t)}},aa=class extends Rr{constructor(t){super(q.MICROSECOND,t)}},ca=class extends Rr{constructor(t){super(q.NANOSECOND,t)}},Ur=class extends z{constructor(t){super(x.Interval),this.unit=t}toString(){return`Interval<${ke[this.unit]}>`}};ZI=Symbol.toStringTag;Ur[ZI]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Ur.prototype);la=class extends Ur{constructor(){super(ke.DAY_TIME)}},ua=class extends Ur{constructor(){super(ke.YEAR_MONTH)}},ah=class extends Ur{constructor(){super(ke.MONTH_DAY_NANO)}},an=class extends z{constructor(t){super(x.Duration),this.unit=t}toString(){return`Duration<${q[this.unit]}>`}};JI=Symbol.toStringTag;an[JI]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(an.prototype);ch=class extends an{constructor(){super(q.SECOND)}},lh=class extends an{constructor(){super(q.MILLISECOND)}},uh=class extends an{constructor(){super(q.MICROSECOND)}},fh=class extends an{constructor(){super(q.NANOSECOND)}},rr=class extends z{constructor(t){super(x.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};QI=Symbol.toStringTag;rr[QI]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(rr.prototype);ei=class extends z{constructor(t){super(x.LargeList),this.children=[t]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};e6=Symbol.toStringTag;ei[e6]=(e=>(e.children=null,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeList"))(ei.prototype);tt=class extends z{constructor(t){super(x.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};t6=Symbol.toStringTag;tt[t6]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(tt.prototype);cn=class extends z{constructor(t,r,n){super(x.Union),this.mode=t,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};r6=Symbol.toStringTag;cn[r6]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(cn.prototype);ts=class extends cn{constructor(t,r){super(Ze.Dense,t,r)}},fa=class extends cn{constructor(t,r){super(Ze.Sparse,t,r)}},In=class extends z{constructor(t){super(x.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};n6=Symbol.toStringTag;In[n6]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(In.prototype);Ht=class extends z{constructor(t,r){super(x.FixedSizeList),this.listSize=t,this.children=[r]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};i6=Symbol.toStringTag;Ht[i6]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(Ht.prototype);jr=class extends z{constructor(t,r=!1){var n,i,o;if(super(x.Map),this.children=[t],this.keysSorted=r,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){let s=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=t==null?void 0:t.type)===null||o===void 0?void 0:o.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};o6=Symbol.toStringTag;jr[o6]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(jr.prototype);pW=(e=>()=>++e)(-1),nr=class extends z{constructor(t,r,n,i){super(x.Dictionary),this.indices=r,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?pW():Le(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};s6=Symbol.toStringTag;nr[s6]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(nr.prototype)});function gW(e,t,r=!0){return typeof t=="number"?hu(e,t,r):typeof t=="string"&&t in x?hu(e,x[t],r):t&&t instanceof z?hu(e,l6(t),r):t!=null&&t.type&&t.type instanceof z?hu(e,l6(t.type),r):hu(e,x.NONE,r)}function hu(e,t,r=!0){let n=null;switch(t){case x.Null:n=e.visitNull;break;case x.Bool:n=e.visitBool;break;case x.Int:n=e.visitInt;break;case x.Int8:n=e.visitInt8||e.visitInt;break;case x.Int16:n=e.visitInt16||e.visitInt;break;case x.Int32:n=e.visitInt32||e.visitInt;break;case x.Int64:n=e.visitInt64||e.visitInt;break;case x.Uint8:n=e.visitUint8||e.visitInt;break;case x.Uint16:n=e.visitUint16||e.visitInt;break;case x.Uint32:n=e.visitUint32||e.visitInt;break;case x.Uint64:n=e.visitUint64||e.visitInt;break;case x.Float:n=e.visitFloat;break;case x.Float16:n=e.visitFloat16||e.visitFloat;break;case x.Float32:n=e.visitFloat32||e.visitFloat;break;case x.Float64:n=e.visitFloat64||e.visitFloat;break;case x.Utf8:n=e.visitUtf8;break;case x.LargeUtf8:n=e.visitLargeUtf8;break;case x.Utf8View:n=e.visitUtf8View||e.visitUtf8;break;case x.Binary:n=e.visitBinary;break;case x.LargeBinary:n=e.visitLargeBinary;break;case x.BinaryView:n=e.visitBinaryView||e.visitBinary;break;case x.FixedSizeBinary:n=e.visitFixedSizeBinary;break;case x.Date:n=e.visitDate;break;case x.DateDay:n=e.visitDateDay||e.visitDate;break;case x.DateMillisecond:n=e.visitDateMillisecond||e.visitDate;break;case x.Timestamp:n=e.visitTimestamp;break;case x.TimestampSecond:n=e.visitTimestampSecond||e.visitTimestamp;break;case x.TimestampMillisecond:n=e.visitTimestampMillisecond||e.visitTimestamp;break;case x.TimestampMicrosecond:n=e.visitTimestampMicrosecond||e.visitTimestamp;break;case x.TimestampNanosecond:n=e.visitTimestampNanosecond||e.visitTimestamp;break;case x.Time:n=e.visitTime;break;case x.TimeSecond:n=e.visitTimeSecond||e.visitTime;break;case x.TimeMillisecond:n=e.visitTimeMillisecond||e.visitTime;break;case x.TimeMicrosecond:n=e.visitTimeMicrosecond||e.visitTime;break;case x.TimeNanosecond:n=e.visitTimeNanosecond||e.visitTime;break;case x.Decimal:n=e.visitDecimal;break;case x.List:n=e.visitList;break;case x.LargeList:n=e.visitLargeList;break;case x.Struct:n=e.visitStruct;break;case x.Union:n=e.visitUnion;break;case x.DenseUnion:n=e.visitDenseUnion||e.visitUnion;break;case x.SparseUnion:n=e.visitSparseUnion||e.visitUnion;break;case x.Dictionary:n=e.visitDictionary;break;case x.Interval:n=e.visitInterval;break;case x.IntervalDayTime:n=e.visitIntervalDayTime||e.visitInterval;break;case x.IntervalYearMonth:n=e.visitIntervalYearMonth||e.visitInterval;break;case x.IntervalMonthDayNano:n=e.visitIntervalMonthDayNano||e.visitInterval;break;case x.Duration:n=e.visitDuration;break;case x.DurationSecond:n=e.visitDurationSecond||e.visitDuration;break;case x.DurationMillisecond:n=e.visitDurationMillisecond||e.visitDuration;break;case x.DurationMicrosecond:n=e.visitDurationMicrosecond||e.visitDuration;break;case x.DurationNanosecond:n=e.visitDurationNanosecond||e.visitDuration;break;case x.FixedSizeList:n=e.visitFixedSizeList;break;case x.Map:n=e.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${x[t]}'`)}function l6(e){switch(e.typeId){case x.Null:return x.Null;case x.Int:{let{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?x.Int8:x.Uint8;case 16:return r?x.Int16:x.Uint16;case 32:return r?x.Int32:x.Uint32;case 64:return r?x.Int64:x.Uint64}return x.Int}case x.Float:switch(e.precision){case He.HALF:return x.Float16;case He.SINGLE:return x.Float32;case He.DOUBLE:return x.Float64}return x.Float;case x.Binary:return x.Binary;case x.LargeBinary:return x.LargeBinary;case x.BinaryView:return x.BinaryView;case x.Utf8:return x.Utf8;case x.LargeUtf8:return x.LargeUtf8;case x.Utf8View:return x.Utf8View;case x.Bool:return x.Bool;case x.Decimal:return x.Decimal;case x.Time:switch(e.unit){case q.SECOND:return x.TimeSecond;case q.MILLISECOND:return x.TimeMillisecond;case q.MICROSECOND:return x.TimeMicrosecond;case q.NANOSECOND:return x.TimeNanosecond}return x.Time;case x.Timestamp:switch(e.unit){case q.SECOND:return x.TimestampSecond;case q.MILLISECOND:return x.TimestampMillisecond;case q.MICROSECOND:return x.TimestampMicrosecond;case q.NANOSECOND:return x.TimestampNanosecond}return x.Timestamp;case x.Date:switch(e.unit){case st.DAY:return x.DateDay;case st.MILLISECOND:return x.DateMillisecond}return x.Date;case x.Interval:switch(e.unit){case ke.DAY_TIME:return x.IntervalDayTime;case ke.YEAR_MONTH:return x.IntervalYearMonth;case ke.MONTH_DAY_NANO:return x.IntervalMonthDayNano}return x.Interval;case x.Duration:switch(e.unit){case q.SECOND:return x.DurationSecond;case q.MILLISECOND:return x.DurationMillisecond;case q.MICROSECOND:return x.DurationMicrosecond;case q.NANOSECOND:return x.DurationNanosecond}return x.Duration;case x.Map:return x.Map;case x.List:return x.List;case x.LargeList:return x.LargeList;case x.Struct:return x.Struct;case x.Union:switch(e.mode){case Ze.Dense:return x.DenseUnion;case Ze.Sparse:return x.SparseUnion}return x.Union;case x.FixedSizeBinary:return x.FixedSizeBinary;case x.FixedSizeList:return x.FixedSizeList;case x.Dictionary:return x.Dictionary}throw new Error(`Unrecognized type '${x[e.typeId]}'`)}var ie,Pn=p(()=>{Nt();at();ie=class{visitMany(t,...r){return t.map((n,i)=>this.visit(n,...r.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,r=!0){return gW(this,t,r)}getVisitFnByTypeId(t,r=!0){return hu(this,t,r)}visitNull(t,...r){return null}visitBool(t,...r){return null}visitInt(t,...r){return null}visitFloat(t,...r){return null}visitUtf8(t,...r){return null}visitLargeUtf8(t,...r){return null}visitUtf8View(t,...r){return null}visitBinary(t,...r){return null}visitLargeBinary(t,...r){return null}visitBinaryView(t,...r){return null}visitFixedSizeBinary(t,...r){return null}visitDate(t,...r){return null}visitTimestamp(t,...r){return null}visitTime(t,...r){return null}visitDecimal(t,...r){return null}visitList(t,...r){return null}visitLargeList(t,...r){return null}visitStruct(t,...r){return null}visitUnion(t,...r){return null}visitDictionary(t,...r){return null}visitInterval(t,...r){return null}visitDuration(t,...r){return null}visitFixedSizeList(t,...r){return null}visitMap(t,...r){return null}};ie.prototype.visitInt8=null;ie.prototype.visitInt16=null;ie.prototype.visitInt32=null;ie.prototype.visitInt64=null;ie.prototype.visitUint8=null;ie.prototype.visitUint16=null;ie.prototype.visitUint32=null;ie.prototype.visitUint64=null;ie.prototype.visitFloat16=null;ie.prototype.visitFloat32=null;ie.prototype.visitFloat64=null;ie.prototype.visitDateDay=null;ie.prototype.visitDateMillisecond=null;ie.prototype.visitTimestampSecond=null;ie.prototype.visitTimestampMillisecond=null;ie.prototype.visitTimestampMicrosecond=null;ie.prototype.visitTimestampNanosecond=null;ie.prototype.visitTimeSecond=null;ie.prototype.visitTimeMillisecond=null;ie.prototype.visitTimeMicrosecond=null;ie.prototype.visitTimeNanosecond=null;ie.prototype.visitDenseUnion=null;ie.prototype.visitSparseUnion=null;ie.prototype.visitIntervalDayTime=null;ie.prototype.visitIntervalYearMonth=null;ie.prototype.visitIntervalMonthDayNano=null;ie.prototype.visitDuration=null;ie.prototype.visitDurationSecond=null;ie.prototype.visitDurationMillisecond=null;ie.prototype.visitDurationMicrosecond=null;ie.prototype.visitDurationNanosecond=null});var mb={};Jt(mb,{float64ToUint16:()=>hh,uint16ToFloat64:()=>gp});function gp(e){let t=(e&31744)>>10,r=(e&1023)/1024,n=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,t-15)*(1+r)}function hh(e){if(e!==e)return 32256;u6[0]=e;let t=(du[1]&2147483648)>>16&65535,r=du[1]&2146435072,n=0;return r>=1089470464?du[0]>0?r=31744:(r=(r&2080374784)>>16,n=(du[1]&1048575)>>10):r<=1056964608?(n=1048576+(du[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(du[1]&1048575)+512>>10),t|r|n&65535}var u6,du,dh=p(()=>{u6=new Float64Array(1),du=new Uint32Array(u6.buffer)});function be(e){return(t,r,n)=>{if(t.setValid(r,n!=null))return e(t,r,n)}}var de,yW,f6,bW,rs,pb,h6,wW,yp,bp,gb,d6,xW,m6,_W,p6,SW,yb,wp,xp,_p,Sp,bb,Mp,vp,Ep,Tp,wb,xb,g6,MW,vW,EW,TW,AW,IW,PW,y6,b6,RW,_b,Ap,Ip,Pp,Rp,Lp,Op,Bp,Sb,LW,Lr,ri=p(()=>{zr();Pn();wo();Xo();dh();Nt();at();de=class extends ie{};yW=(e,t,r)=>{e[t]=Math.floor(r/864e5)},f6=(e,t,r,n)=>{if(r+1<t.length){let i=Le(t[r]),o=Le(t[r+1]);e.set(n.subarray(0,o-i),i)}},bW=({offset:e,values:t},r,n)=>{let i=e+r;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},rs=({values:e},t,r)=>{e[t]=r},pb=({values:e},t,r)=>{e[t]=r},h6=({values:e},t,r)=>{e[t]=hh(r)},wW=(e,t,r)=>{switch(e.type.precision){case He.HALF:return h6(e,t,r);case He.SINGLE:case He.DOUBLE:return pb(e,t,r)}},yp=({values:e},t,r)=>{yW(e,t,r.valueOf())},bp=({values:e},t,r)=>{e[t]=BigInt(r)},gb=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},d6=({values:e,valueOffsets:t},r,n)=>f6(e,t,r,n),xW=e=>{let t=e.variadicBuffers;return(!Array.isArray(t)||Object.isFrozen(t))&&(t=Array.from(t),e.variadicBuffers=t),t},m6=(e,t,r)=>{var n,i,o,s;let a=e.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Ee.ELEMENT_WIDTH,l=t*c,u=l+c;if(l<0||u>a.length)throw new RangeError(`BinaryView index ${t} out of bounds`);a.fill(0,l,u);let h=new DataView(a.buffer,a.byteOffset+l,c),d=r.length;if(h.setInt32(Ee.LENGTH_OFFSET,d,!0),d<=Ee.INLINE_CAPACITY){a.set(r,l+Ee.INLINE_OFFSET);return}let m=((n=r[0])!==null&&n!==void 0?n:0)|((i=r[1])!==null&&i!==void 0?i:0)<<8|((o=r[2])!==null&&o!==void 0?o:0)<<16|((s=r[3])!==null&&s!==void 0?s:0)<<24;h.setUint32(Ee.INLINE_OFFSET,m>>>0,!0);let g=xW(e),y=r.slice(),b=g.push(y)-1;h.setInt32(Ee.BUFFER_INDEX_OFFSET,b,!0),h.setInt32(Ee.BUFFER_OFFSET_OFFSET,0,!0)},_W=(e,t,r)=>{let n=r instanceof Uint8Array?r:new Uint8Array(r);m6(e,t,n)},p6=({values:e,valueOffsets:t},r,n)=>f6(e,t,r,qn(n)),SW=(e,t,r)=>{let n=qn(r);m6(e,t,n)},yb=(e,t,r)=>{e.type.unit===st.DAY?yp(e,t,r):bp(e,t,r)},wp=({values:e},t,r)=>{e[t]=BigInt(r/1e3)},xp=({values:e},t,r)=>{e[t]=BigInt(r)},_p=({values:e},t,r)=>{e[t]=BigInt(r*1e3)},Sp=({values:e},t,r)=>{e[t]=BigInt(r*1e6)},bb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return wp(e,t,r);case q.MILLISECOND:return xp(e,t,r);case q.MICROSECOND:return _p(e,t,r);case q.NANOSECOND:return Sp(e,t,r)}},Mp=({values:e},t,r)=>{e[t]=r},vp=({values:e},t,r)=>{e[t]=r},Ep=({values:e},t,r)=>{e[t]=r},Tp=({values:e},t,r)=>{e[t]=r},wb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return Mp(e,t,r);case q.MILLISECOND:return vp(e,t,r);case q.MICROSECOND:return Ep(e,t,r);case q.NANOSECOND:return Tp(e,t,r)}},xb=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},g6=(e,t,r)=>{let n=e.children[0],i=e.valueOffsets,o=Lr.getVisitFn(n),s=Le(i[t]),a=Le(i[t+1]);if(Array.isArray(r))for(let c=-1,l=s;l<a;)o(n,l++,r[++c]);else for(let c=-1,l=s;l<a;)o(n,l++,r.get(++c))},MW=(e,t,r)=>{let n=e.children[0],{valueOffsets:i}=e,o=Lr.getVisitFn(n),{[t]:s,[t+1]:a}=i,c=r instanceof Map?r.entries():Object.entries(r);for(let l of c)if(o(n,s,l),++s>=a)break},vW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[o]),EW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(o)),TW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(i.name)),AW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[i.name]),IW=(e,t,r)=>{let n=e.type.children.map(o=>Lr.getVisitFn(o.type)),i=r instanceof Map?TW(t,r):r instanceof $?EW(t,r):Array.isArray(r)?vW(t,r):AW(t,r);e.type.children.forEach((o,s)=>i(n[s],e.children[s],o,s))},PW=(e,t,r)=>{e.type.mode===Ze.Dense?y6(e,t,r):b6(e,t,r)},y6=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Lr.visit(i,e.valueOffsets[t],r)},b6=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Lr.visit(i,t,r)},RW=(e,t,r)=>{var n;(n=e.dictionary)===null||n===void 0||n.set(e.values[t],r)},_b=(e,t,r)=>{switch(e.type.unit){case ke.YEAR_MONTH:return Ip(e,t,r);case ke.DAY_TIME:return Ap(e,t,r);case ke.MONTH_DAY_NANO:return Pp(e,t,r)}},Ap=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},Ip=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},Pp=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},Rp=({values:e},t,r)=>{e[t]=r},Lp=({values:e},t,r)=>{e[t]=r},Op=({values:e},t,r)=>{e[t]=r},Bp=({values:e},t,r)=>{e[t]=r},Sb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return Rp(e,t,r);case q.MILLISECOND:return Lp(e,t,r);case q.MICROSECOND:return Op(e,t,r);case q.NANOSECOND:return Bp(e,t,r)}},LW=(e,t,r)=>{let{stride:n}=e,i=e.children[0],o=Lr.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=t*n;++s<n;)o(i,a+s,r[s]);else for(let s=-1,a=t*n;++s<n;)o(i,a+s,r.get(s))};de.prototype.visitBool=be(bW);de.prototype.visitInt=be(rs);de.prototype.visitInt8=be(rs);de.prototype.visitInt16=be(rs);de.prototype.visitInt32=be(rs);de.prototype.visitInt64=be(rs);de.prototype.visitUint8=be(rs);de.prototype.visitUint16=be(rs);de.prototype.visitUint32=be(rs);de.prototype.visitUint64=be(rs);de.prototype.visitFloat=be(wW);de.prototype.visitFloat16=be(h6);de.prototype.visitFloat32=be(pb);de.prototype.visitFloat64=be(pb);de.prototype.visitUtf8=be(p6);de.prototype.visitLargeUtf8=be(p6);de.prototype.visitUtf8View=be(SW);de.prototype.visitBinary=be(d6);de.prototype.visitLargeBinary=be(d6);de.prototype.visitBinaryView=be(_W);de.prototype.visitFixedSizeBinary=be(gb);de.prototype.visitDate=be(yb);de.prototype.visitDateDay=be(yp);de.prototype.visitDateMillisecond=be(bp);de.prototype.visitTimestamp=be(bb);de.prototype.visitTimestampSecond=be(wp);de.prototype.visitTimestampMillisecond=be(xp);de.prototype.visitTimestampMicrosecond=be(_p);de.prototype.visitTimestampNanosecond=be(Sp);de.prototype.visitTime=be(wb);de.prototype.visitTimeSecond=be(Mp);de.prototype.visitTimeMillisecond=be(vp);de.prototype.visitTimeMicrosecond=be(Ep);de.prototype.visitTimeNanosecond=be(Tp);de.prototype.visitDecimal=be(xb);de.prototype.visitList=be(g6);de.prototype.visitLargeList=be(g6);de.prototype.visitStruct=be(IW);de.prototype.visitUnion=be(PW);de.prototype.visitDenseUnion=be(y6);de.prototype.visitSparseUnion=be(b6);de.prototype.visitDictionary=be(RW);de.prototype.visitInterval=be(_b);de.prototype.visitIntervalDayTime=be(Ap);de.prototype.visitIntervalYearMonth=be(Ip);de.prototype.visitIntervalMonthDayNano=be(Pp);de.prototype.visitDuration=be(Sb);de.prototype.visitDurationSecond=be(Rp);de.prototype.visitDurationMillisecond=be(Lp);de.prototype.visitDurationMicrosecond=be(Op);de.prototype.visitDurationNanosecond=be(Bp);de.prototype.visitFixedSizeList=be(LW);de.prototype.visitMap=be(MW);Lr=new de});var Vi,mu,_o,Mb,vb,OW,Cp=p(()=>{oh();bc();ri();Vi=Symbol.for("parent"),mu=Symbol.for("rowIndex"),_o=class{constructor(t,r){return this[Vi]=t,this[mu]=r,new Proxy(this,OW)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[mu],r=this[Vi],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=ir.visit(r.children[o],t);return i}toString(){return`{${[...this].map(([t,r])=>`${Gi(t)}: ${Gi(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Mb(this[Vi],this[mu])}},Mb=class{constructor(t,r){this.childIndex=0,this.children=t.children,this.rowIndex=r,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,ir.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(_o.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Vi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[mu]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});vb=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Vi].type.children.map(r=>r.name)}has(t,r){return t[Vi].type.children.some(n=>n.name===r)}getOwnPropertyDescriptor(t,r){if(t[Vi].type.children.some(n=>n.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[Vi].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=ir.visit(t[Vi].children[n],t[mu]);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[Vi].type.children.findIndex(o=>o.name===r);return i!==-1?(Lr.visit(t[Vi].children[i],t[mu],n),Reflect.set(t,r,n)):Reflect.has(t,r)||typeof r=="symbol"?Reflect.set(t,r,n):!1}},OW=new vb});function ge(e){return(t,r)=>t.getValid(r)?e(t,r):null}var le,BW,pu,CW,DW,w6,NW,x6,_6,ha,FW,S6,GW,M6,v6,kW,E6,UW,jW,zW,qW,T6,A6,I6,P6,VW,R6,L6,O6,B6,WW,HW,C6,$W,KW,XW,D6,N6,YW,ZW,F6,G6,k6,U6,j6,z6,q6,JW,QW,ir,bc=p(()=>{pp();zr();Pn();mh();Cp();wo();Xo();dh();Nt();le=class extends ie{};BW=(e,t)=>864e5*e[t],pu=16,CW=12,DW=(e,t)=>null,w6=(e,t,r)=>{if(r+1>=t.length)return null;let n=Le(t[r]),i=Le(t[r+1]);return e.subarray(n,i)},NW=({offset:e,values:t},r)=>{let n=e+r;return(t[n>>3]&1<<n%8)!==0},x6=({values:e},t)=>BW(e,t),_6=({values:e},t)=>Le(e[t]),ha=({stride:e,values:t},r)=>t[e*r],FW=({stride:e,values:t},r)=>gp(t[e*r]),S6=({values:e},t)=>e[t],GW=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),M6=({values:e,valueOffsets:t},r)=>w6(e,t,r),v6=(e,t)=>{var r;let n=e.values;if(!n)throw new Error("BinaryView data is missing view buffer");let i=t*pu,o=i+pu;if(i<0||o>n.length)throw new Error(`BinaryView data buffer is too short: expected ${pu} bytes, got ${Math.max(0,n.length-i)}`);let s=n.subarray(i,o);if(s.length<pu)throw new Error(`BinaryView data buffer is too short: expected ${pu} bytes, got ${s.length}`);let a=new DataView(n.buffer,s.byteOffset,pu),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=CW)return s.subarray(4,4+c);let l=a.getInt32(8,!0),u=a.getInt32(12,!0),h=(r=e.variadicBuffers)===null||r===void 0?void 0:r[l];if(!h)throw new Error(`BinaryView variadic buffer ${l} is missing`);return h.subarray(u,u+c)},kW=(e,t)=>v6(e,t),E6=({values:e,valueOffsets:t},r)=>{let n=w6(e,t,r);return n!==null?nu(n):null},UW=(e,t)=>{let r=v6(e,t);return nu(r)},jW=({values:e},t)=>e[t],zW=({type:e,values:t},r)=>e.precision!==He.HALF?t[r]:gp(t[r]),qW=(e,t)=>e.type.unit===st.DAY?x6(e,t):_6(e,t),T6=({values:e},t)=>1e3*Le(e[t]),A6=({values:e},t)=>Le(e[t]),I6=({values:e},t)=>ub(e[t],BigInt(1e3)),P6=({values:e},t)=>ub(e[t],BigInt(1e6)),VW=(e,t)=>{switch(e.type.unit){case q.SECOND:return T6(e,t);case q.MILLISECOND:return A6(e,t);case q.MICROSECOND:return I6(e,t);case q.NANOSECOND:return P6(e,t)}},R6=({values:e},t)=>e[t],L6=({values:e},t)=>e[t],O6=({values:e},t)=>e[t],B6=({values:e},t)=>e[t],WW=(e,t)=>{switch(e.type.unit){case q.SECOND:return R6(e,t);case q.MILLISECOND:return L6(e,t);case q.MICROSECOND:return O6(e,t);case q.NANOSECOND:return B6(e,t)}},HW=({values:e,stride:t},r)=>yc.decimal(e.subarray(t*r,t*(r+1))),C6=(e,t)=>{let{valueOffsets:r,stride:n,children:i}=e,o=Le(r[t*n]),s=Le(r[t*n+1]),c=i[0].slice(o,s-o);return new $([c])},$W=(e,t)=>{let{valueOffsets:r,children:n}=e,{[t]:i,[t+1]:o}=r,s=n[0];return new bi(s.slice(i,o-i))},KW=(e,t)=>new _o(e,t),XW=(e,t)=>e.type.mode===Ze.Dense?D6(e,t):N6(e,t),D6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return ir.visit(n,e.valueOffsets[t])},N6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return ir.visit(n,t)},YW=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},ZW=(e,t)=>e.type.unit===ke.MONTH_DAY_NANO?k6(e,t):e.type.unit===ke.DAY_TIME?F6(e,t):G6(e,t),F6=({values:e},t)=>e.subarray(2*t,2*(t+1)),G6=({values:e},t)=>{let r=e[t],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},k6=({values:e},t)=>e.subarray(4*t,4*(t+1)),U6=({values:e},t)=>e[t],j6=({values:e},t)=>e[t],z6=({values:e},t)=>e[t],q6=({values:e},t)=>e[t],JW=(e,t)=>{switch(e.type.unit){case q.SECOND:return U6(e,t);case q.MILLISECOND:return j6(e,t);case q.MICROSECOND:return z6(e,t);case q.NANOSECOND:return q6(e,t)}},QW=(e,t)=>{let{stride:r,children:n}=e,o=n[0].slice(t*r,r);return new $([o])};le.prototype.visitNull=ge(DW);le.prototype.visitBool=ge(NW);le.prototype.visitInt=ge(jW);le.prototype.visitInt8=ge(ha);le.prototype.visitInt16=ge(ha);le.prototype.visitInt32=ge(ha);le.prototype.visitInt64=ge(S6);le.prototype.visitUint8=ge(ha);le.prototype.visitUint16=ge(ha);le.prototype.visitUint32=ge(ha);le.prototype.visitUint64=ge(S6);le.prototype.visitFloat=ge(zW);le.prototype.visitFloat16=ge(FW);le.prototype.visitFloat32=ge(ha);le.prototype.visitFloat64=ge(ha);le.prototype.visitUtf8=ge(E6);le.prototype.visitLargeUtf8=ge(E6);le.prototype.visitUtf8View=ge(UW);le.prototype.visitBinary=ge(M6);le.prototype.visitLargeBinary=ge(M6);le.prototype.visitBinaryView=ge(kW);le.prototype.visitFixedSizeBinary=ge(GW);le.prototype.visitDate=ge(qW);le.prototype.visitDateDay=ge(x6);le.prototype.visitDateMillisecond=ge(_6);le.prototype.visitTimestamp=ge(VW);le.prototype.visitTimestampSecond=ge(T6);le.prototype.visitTimestampMillisecond=ge(A6);le.prototype.visitTimestampMicrosecond=ge(I6);le.prototype.visitTimestampNanosecond=ge(P6);le.prototype.visitTime=ge(WW);le.prototype.visitTimeSecond=ge(R6);le.prototype.visitTimeMillisecond=ge(L6);le.prototype.visitTimeMicrosecond=ge(O6);le.prototype.visitTimeNanosecond=ge(B6);le.prototype.visitDecimal=ge(HW);le.prototype.visitList=ge(C6);le.prototype.visitLargeList=ge(C6);le.prototype.visitStruct=ge(KW);le.prototype.visitUnion=ge(XW);le.prototype.visitDenseUnion=ge(D6);le.prototype.visitSparseUnion=ge(N6);le.prototype.visitDictionary=ge(YW);le.prototype.visitInterval=ge(ZW);le.prototype.visitIntervalDayTime=ge(F6);le.prototype.visitIntervalYearMonth=ge(G6);le.prototype.visitIntervalMonthDayNano=ge(k6);le.prototype.visitDuration=ge(JW);le.prototype.visitDurationSecond=ge(U6);le.prototype.visitDurationMillisecond=ge(j6);le.prototype.visitDurationMicrosecond=ge(z6);le.prototype.visitDurationNanosecond=ge(q6);le.prototype.visitFixedSizeList=ge(QW);le.prototype.visitMap=ge($W);ir=new le});var da,yu,gu,Eb,bi,Tb,Ab,mh=p(()=>{zr();oh();bc();ri();da=Symbol.for("keys"),yu=Symbol.for("vals"),gu=Symbol.for("kKeysAsStrings"),Eb=Symbol.for("_kKeysAsStrings"),bi=class{constructor(t){return this[da]=new $([t.children[0]]).memoize(),this[yu]=t.children[1],new Proxy(this,new Ab)}get[gu](){return this[Eb]||(this[Eb]=Array.from(this[da].toArray(),String))}[Symbol.iterator](){return new Tb(this[da],this[yu])}get size(){return this[da].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[da],r=this[yu],n={};for(let i=-1,o=t.length;++i<o;)n[t.get(i)]=ir.visit(r,i);return n}toString(){return`{${[...this].map(([t,r])=>`${Gi(t)}: ${Gi(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Tb=class{constructor(t,r){this.keys=t,this.vals=r,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),ir.visit(this.vals,t)]})}},Ab=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[gu]}has(t,r){return t[gu].includes(r)}getOwnPropertyDescriptor(t,r){if(t[gu].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[gu].indexOf(r);if(n!==-1){let i=ir.visit(Reflect.get(t,yu),n);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[gu].indexOf(r);return i!==-1?(Lr.visit(Reflect.get(t,yu),i,n),Reflect.set(t,r,n)):Reflect.has(t,r)?Reflect.set(t,r,n):!1}};Object.defineProperties(bi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[da]:{writable:!0,enumerable:!1,configurable:!1,value:null},[yu]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Eb]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Ib={};Jt(Ib,{clampRange:()=>ph,createElementComparator:()=>ma,wrapIndex:()=>wc});function ph(e,t,r,n){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof r!="number"?i:r;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(V6=o,o=s,s=V6),s>i&&(s=i),n?n(e,o,s):[o,s]}function ma(e){if(typeof e!=="object"||e===null)return W6(e)?W6:r=>r===e;if(e instanceof Date){let r=e.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(e)?r=>r?R2(e,r):!1:e instanceof Map?tH(e):Array.isArray(e)?eH(e):e instanceof $?rH(e):nH(e,!0)}function eH(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=ma(e[r]);return Dp(t)}function tH(e){let t=-1,r=[];for(let n of e.values())r[++t]=ma(n);return Dp(r)}function rH(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=ma(e.get(r));return Dp(t)}function nH(e,t=!1){let r=Object.keys(e);if(!t&&r.length===0)return()=>!1;let n=[];for(let i=-1,o=r.length;++i<o;)n[i]=ma(e[r[i]]);return Dp(n,r)}function Dp(e,t){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return iH(e,r);case Map:return H6(e,r,r.keys());case bi:case _o:case Object:case void 0:return H6(e,r,t||Object.keys(r))}return r instanceof $?oH(e,r):!1}}function iH(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t[n]))return!1;return!0}function oH(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t.get(n)))return!1;return!0}function H6(e,t,r){let n=r[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),s=0,a=e.length,c=o.next(),l=n.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=n.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(n.return&&n.return(),i.return&&i.return(),o.return&&o.return(),!1)}var V6,wc,W6,bu=p(()=>{zr();mh();Cp();dr();wc=(e,t)=>e<0?t+e:e,W6=e=>e!==e});var Pb={};Jt(Pb,{BitIterator:()=>So,getBit:()=>Fp,getBool:()=>wu,packBools:()=>_c,popcnt_array:()=>$6,popcnt_bit_range:()=>gh,popcnt_uint32:()=>Np,setBool:()=>sH,truncateBitmap:()=>xc});function wu(e,t,r,n){return(r&1<<n)!==0}function Fp(e,t,r,n){return(r&1<<n)>>n}function sH(e,t,r){return r?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function xc(e,t,r){let n=r.byteLength+7&-8;if(e>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(e%8===0?r.subarray(e>>3):_c(new So(r,e,t,null,wu)).subarray(0,n)),i}return r}function _c(e){let t=[],r=0,n=0,i=0;for(let s of e)s&&(i|=1<<n),++n===8&&(t[r++]=i,i=n=0);(r===0||n>0)&&(t[r++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}function gh(e,t,r){if(r-t<=0)return 0;if(r-t<8){let o=0;for(let s of new So(e,t,r-t,e,Fp))o+=s;return o}let n=r>>3<<3,i=t+(t%8===0?0:8-t%8);return gh(e,t,i)+gh(e,n,r)+$6(e,i>>3,n-i>>3)}function $6(e,t,r){let n=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=r===void 0?e.byteLength:i+r;for(;s-i>=4;)n+=Np(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=Np(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=Np(o.getUint8(i)),i+=1;return n}function Np(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var So,Sc=p(()=>{So=class{constructor(t,r,n,i,o){this.bytes=t,this.length=n,this.context=i,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function te(e){return cH.visit(e)}var aH,K6,ce,Rb,cH,wi=p(()=>{zr();Nt();at();Sc();at();Pn();dr();aH=-1,K6=Symbol.for("apache-arrow/Data"),ce=class e{static isData(t){return(t==null?void 0:t[K6])===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return z.isSparseUnion(t)?this.children.some(r=>r.nullable):z.isDenseUnion(t)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:o}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),t+=this.variadicBuffers.reduce((s,a)=>{var c;return s+((c=a==null?void 0:a.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(z.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,r;return t<=aH&&(r=this.nullBitmap)&&(this._nullCount=t=r.length===0?0:this.length-gh(r,this.offset,this.offset+this.length)),t}constructor(t,r,n,i,o,s=[],a,c=[]){var l;this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let u;o instanceof e?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets,this.variadicBuffers=o.variadicBuffers):(this.stride=ti(t),o&&((u=o[0])&&(this.valueOffsets=u),(u=o[1])&&(this.values=u),(u=o[2])&&(this.nullBitmap=u),(u=o[3])&&(this.typeIds=u)),this.variadicBuffers=c),(l=this.variadicBuffers)!==null&&l!==void 0||(this.variadicBuffers=[])}getValid(t){let{type:r}=this;if(z.isUnion(r)){let n=r,i=this.typeIds[t],o=n.typeIdToChildIndex[i],s=this.children[o],a=this.valueOffsets,c=n.mode===Ze.Dense&&a?Number(a[t]):t;return s.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,r){let n,{type:i}=this;if(z.isUnion(i)){let o=i,s=this.typeIds[t],a=o.typeIdToChildIndex[s],c=this.children[a],l=this.valueOffsets,u=o.mode===Ze.Dense&&l?Number(l[t]):t;n=c.getValid(u),c.setValid(u,r)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+t,l=1<<c%8,u=c>>3;(!o||o.byteLength<=u)&&(o=new Uint8Array((s+a+63&-64)>>3).fill(255),this.nullCount>0?(o.set(xc(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let h=o[u];n=(h&l)!==0,o[u]=r?h|l:h&~l}return n!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(t=this.type,r=this.offset,n=this.length,i=this._nullCount,o=this,s=this.children,a=this.variadicBuffers){return new e(t,r,n,i,o,s,this.dictionary,a)}slice(t,r){let{stride:n,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(t,r,n,i);return this.clone(this.type,this.offset+t,r,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===x.Null)return this.clone(this.type,0,t,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&-8))-1,n>0&&i.set(xc(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Ne.VALIDITY]=i,this.clone(this.type,0,t,n+(t-r),o,this.children,this.variadicBuffers)}_sliceBuffers(t,r,n,i){let o,{buffers:s}=this;if((o=s[Ne.TYPE])&&(s[Ne.TYPE]=o.subarray(t,t+r)),z.isBinaryView(this.type)||z.isUtf8View(this.type)){let a=Ee.ELEMENT_WIDTH;(o=s[Ne.DATA])&&(s[Ne.DATA]=o.subarray(t*a,(t+r)*a))}else(o=s[Ne.OFFSET])&&(s[Ne.OFFSET]=o.subarray(t,t+r+1))||(o=s[Ne.DATA])&&(s[Ne.DATA]=i===6?o:o.subarray(n*t,n*(t+r)));return s}_sliceChildren(t,r,n){return t.map(i=>i.slice(r,n))}};ce.prototype.children=Object.freeze([]);ce.prototype[K6]=!0;Object.defineProperty(ce,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ce&&ce.isData(t)}});Rb=class e extends ie{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:r,["offset"]:n=0,["length"]:i=0}=t;return new ce(r,n,i,i)}visitBool(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitInt(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=pc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitUtf8View(t){var r;let{["type"]:n,["offset"]:i=0}=t,o=Re(n.ArrayType,t.views),s=se(t.nullBitmap),a=(t.variadicBuffers||[]).map(u=>se(u)),c=(r=t.length)!==null&&r!==void 0?r:Math.trunc(o.length/on.ELEMENT_WIDTH),l=t.nullBitmap?-1:0;return new ce(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=Wf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=pc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitBinaryView(t){var r;let{["type"]:n,["offset"]:i=0}=t,o=Re(n.ArrayType,t.views),s=se(t.nullBitmap),a=(t.variadicBuffers||[]).map(u=>se(u)),c=(r=t.length)!==null&&r!==void 0?r:Math.trunc(o.length/Ee.ELEMENT_WIDTH),l=t.nullBitmap?-1:0;return new ce(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=Wf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDate(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitTime(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=se(t.nullBitmap),s=pc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}visitLargeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=se(t.nullBitmap),s=Wf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=se(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=Re(r.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(z.isSparseUnion(r))return new ce(r,n,s,a,[void 0,void 0,void 0,o],i);let c=pc(t.valueOffsets);return new ce(r,n,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.indices.ArrayType,t.data),{["dictionary"]:s=new $([new e().visit({type:r.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.valueType})}=t,o=se(t.nullBitmap),{["length"]:s=i.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new ce(r,n,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.childType})}=t,o=se(t.nullBitmap),s=pc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new ce(r,n,a,c,[s,void 0,o],[i])}},cH=new Rb});function X6(e){return e.some(t=>t.nullable)}function Gp(e){return e.reduce((t,r)=>t+r.nullCount,0)}function kp(e){return e.reduce((t,r,n)=>(t[n+1]=t[n]+r.length,t),new Uint32Array(e.length+1))}function Up(e,t,r,n){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=n)break;if(r>=c+l)continue;if(c>=r&&c+l<=n){i.push(a);continue}let u=Math.max(0,r-c),h=Math.min(n-c,l);i.push(a.slice(u,h-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function Lb(e,t,r,n){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return r<t[s]?n(e,i,r-t[i]):null;o=i+Math.trunc((s-i)*.5),r<t[o]?s=o:i=o}while(i<s)}function bh(e,t){return e.getValid(t)}function xu(e){function t(r,n,i){return e(r[n],i)}return function(r){let n=this.data;return Lb(n,this._offsets,r,t)}}function jp(e){let t;function r(n,i,o){return e(n[i],o,t)}return function(n,i){let o=this.data;t=i;let s=Lb(o,this._offsets,n,r);return t=void 0,s}}function zp(e){let t;function r(n,i,o){let s=o,a=0,c=0;for(let l=i-1,u=n.length;++l<u;){let h=n[l];if(~(a=e(h,t,s)))return c+a;s=0,c+=h.length}return-1}return function(n,i){t=n;let o=this.data,s=typeof i!="number"?r(o,0,0):Lb(o,this._offsets,i,r);return t=void 0,s}}var yh,qp=p(()=>{yh=class{constructor(t=0,r){this.numChunks=t,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function lH(e,t){return t===null&&e.length>0?0:-1}function uH(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(let i of new So(r,e.offset+(t||0),e.length,r,wu)){if(!i)return n;++n}return-1}function xe(e,t,r){if(t===void 0)return-1;if(t===null)switch(e.typeId){case x.Union:break;case x.Dictionary:break;default:return uH(e,r)}let n=ir.getVisitFn(e),i=ma(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}function Y6(e,t,r){let n=ir.getVisitFn(e),i=ma(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}var ue,Mc,Vp=p(()=>{Nt();Pn();bc();Sc();bu();ue=class extends ie{};ue.prototype.visitNull=lH;ue.prototype.visitBool=xe;ue.prototype.visitInt=xe;ue.prototype.visitInt8=xe;ue.prototype.visitInt16=xe;ue.prototype.visitInt32=xe;ue.prototype.visitInt64=xe;ue.prototype.visitUint8=xe;ue.prototype.visitUint16=xe;ue.prototype.visitUint32=xe;ue.prototype.visitUint64=xe;ue.prototype.visitFloat=xe;ue.prototype.visitFloat16=xe;ue.prototype.visitFloat32=xe;ue.prototype.visitFloat64=xe;ue.prototype.visitUtf8=xe;ue.prototype.visitLargeUtf8=xe;ue.prototype.visitUtf8View=xe;ue.prototype.visitBinary=xe;ue.prototype.visitLargeBinary=xe;ue.prototype.visitBinaryView=xe;ue.prototype.visitFixedSizeBinary=xe;ue.prototype.visitDate=xe;ue.prototype.visitDateDay=xe;ue.prototype.visitDateMillisecond=xe;ue.prototype.visitTimestamp=xe;ue.prototype.visitTimestampSecond=xe;ue.prototype.visitTimestampMillisecond=xe;ue.prototype.visitTimestampMicrosecond=xe;ue.prototype.visitTimestampNanosecond=xe;ue.prototype.visitTime=xe;ue.prototype.visitTimeSecond=xe;ue.prototype.visitTimeMillisecond=xe;ue.prototype.visitTimeMicrosecond=xe;ue.prototype.visitTimeNanosecond=xe;ue.prototype.visitDecimal=xe;ue.prototype.visitList=xe;ue.prototype.visitLargeList=xe;ue.prototype.visitStruct=xe;ue.prototype.visitUnion=xe;ue.prototype.visitDenseUnion=Y6;ue.prototype.visitSparseUnion=Y6;ue.prototype.visitDictionary=xe;ue.prototype.visitInterval=xe;ue.prototype.visitIntervalDayTime=xe;ue.prototype.visitIntervalYearMonth=xe;ue.prototype.visitIntervalMonthDayNano=xe;ue.prototype.visitDuration=xe;ue.prototype.visitDurationSecond=xe;ue.prototype.visitDurationMillisecond=xe;ue.prototype.visitDurationMicrosecond=xe;ue.prototype.visitDurationNanosecond=xe;ue.prototype.visitFixedSizeList=xe;ue.prototype.visitMap=xe;Mc=new ue});function ye(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(z.isInt(t)&&t.bitWidth!==64||z.isTime(t)&&t.bitWidth!==64||z.isFloat(t)&&t.precision!==He.HALF))return new yh(e.data.length,n=>{let i=e.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new yh(e.data.length,n=>{let o=e.data[n].length,s=e.slice(r,r+o);return r+=o,new Ob(s)})}var fe,Ob,_u,Wp=p(()=>{Pn();Nt();at();qp();fe=class extends ie{};Ob=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};fe.prototype.visitNull=ye;fe.prototype.visitBool=ye;fe.prototype.visitInt=ye;fe.prototype.visitInt8=ye;fe.prototype.visitInt16=ye;fe.prototype.visitInt32=ye;fe.prototype.visitInt64=ye;fe.prototype.visitUint8=ye;fe.prototype.visitUint16=ye;fe.prototype.visitUint32=ye;fe.prototype.visitUint64=ye;fe.prototype.visitFloat=ye;fe.prototype.visitFloat16=ye;fe.prototype.visitFloat32=ye;fe.prototype.visitFloat64=ye;fe.prototype.visitUtf8=ye;fe.prototype.visitLargeUtf8=ye;fe.prototype.visitUtf8View=ye;fe.prototype.visitBinary=ye;fe.prototype.visitLargeBinary=ye;fe.prototype.visitBinaryView=ye;fe.prototype.visitFixedSizeBinary=ye;fe.prototype.visitDate=ye;fe.prototype.visitDateDay=ye;fe.prototype.visitDateMillisecond=ye;fe.prototype.visitTimestamp=ye;fe.prototype.visitTimestampSecond=ye;fe.prototype.visitTimestampMillisecond=ye;fe.prototype.visitTimestampMicrosecond=ye;fe.prototype.visitTimestampNanosecond=ye;fe.prototype.visitTime=ye;fe.prototype.visitTimeSecond=ye;fe.prototype.visitTimeMillisecond=ye;fe.prototype.visitTimeMicrosecond=ye;fe.prototype.visitTimeNanosecond=ye;fe.prototype.visitDecimal=ye;fe.prototype.visitList=ye;fe.prototype.visitLargeList=ye;fe.prototype.visitStruct=ye;fe.prototype.visitUnion=ye;fe.prototype.visitDenseUnion=ye;fe.prototype.visitSparseUnion=ye;fe.prototype.visitDictionary=ye;fe.prototype.visitInterval=ye;fe.prototype.visitIntervalDayTime=ye;fe.prototype.visitIntervalYearMonth=ye;fe.prototype.visitIntervalMonthDayNano=ye;fe.prototype.visitDuration=ye;fe.prototype.visitDurationSecond=ye;fe.prototype.visitDurationMillisecond=ye;fe.prototype.visitDurationMicrosecond=ye;fe.prototype.visitDurationNanosecond=ye;fe.prototype.visitFixedSizeList=ye;fe.prototype.visitMap=ye;_u=new fe});function Mo(e){if(e){if(e instanceof ce)return new $([e]);if(e instanceof $)return new $(e.data);if(e.type instanceof z)return new $([te(e)]);if(Array.isArray(e))return new $(e.flatMap(t=>fH(t)));if(ArrayBuffer.isView(e)){e instanceof DataView&&(e=new Uint8Array(e.buffer));let t={offset:0,length:e.length,nullCount:-1,data:e};if(e instanceof Int8Array)return new $([te(Object.assign(Object.assign({},t),{type:new Kn}))]);if(e instanceof Int16Array)return new $([te(Object.assign(Object.assign({},t),{type:new Xn}))]);if(e instanceof Int32Array)return new $([te(Object.assign(Object.assign({},t),{type:new Yt}))]);if(e instanceof BigInt64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Yn}))]);if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new $([te(Object.assign(Object.assign({},t),{type:new Zn}))]);if(e instanceof Uint16Array)return new $([te(Object.assign(Object.assign({},t),{type:new Jn}))]);if(e instanceof Uint32Array)return new $([te(Object.assign(Object.assign({},t),{type:new rn}))]);if(e instanceof BigUint64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Ui}))]);if(e instanceof Float32Array)return new $([te(Object.assign(Object.assign({},t),{type:new nn}))]);if(e instanceof Float64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Qn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function fH(e){return e instanceof ce?[e]:e instanceof $?e.data:Mo(e).data}var Z6,J6,Q6,e5,$,Hp,zr=p(()=>{Nt();bu();at();wi();qp();bc();ri();Vp();Wp();at();J6=Symbol.for("apache-arrow/Vector"),Q6={},e5={},$=class e{static isVector(t){return(t==null?void 0:t[J6])===!0}constructor(t){var r,n,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof ce)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l}=Q6[s.typeId],u=o[0];this.isValid=h=>bh(u,h),this.get=h=>a(u,h),this.set=(h,d)=>c(u,h,d),this.indexOf=h=>l(u,h),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,e5[s.typeId]),this._offsets=kp(o);break}this.data=o,this.type=s,this.stride=ti(s),this.numChildren=(i=(n=s.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,r)=>t+r.byteLength,0)}get nullable(){return X6(this.data)}get nullCount(){return Gp(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${x[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(wc(t,this.length))}set(t,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}[Symbol.iterator](){return _u.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(t,r){return new e(ph(this,t,r,({data:n,_offsets:i},o,s)=>Up(n,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:r,length:n,stride:i,ArrayType:o}=this;switch(t.typeId){case x.Int:case x.Float:case x.Decimal:case x.Time:case x.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,n*i);default:return r.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:r})=>r[t])):null}get isMemoized(){return z.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(z.isDictionary(this.type)){let t=new Hp(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return new Hp(this)}unmemoize(){if(z.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return this}};Z6=Symbol.toStringTag;$[Z6]=(e=>{e.type=z.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0,e[J6]=!0;let t=Object.keys(x).map(r=>x[r]).filter(r=>typeof r=="number"&&r!==x.NONE);for(let r of t){let n=ir.getVisitFnByTypeId(r),i=Lr.getVisitFnByTypeId(r),o=Mc.getVisitFnByTypeId(r);Q6[r]={get:n,set:i,indexOf:o},e5[r]=Object.create(e,{isValid:{value:xu(bh)},get:{value:xu(ir.getVisitFnByTypeId(r))},set:{value:jp(Lr.getVisitFnByTypeId(r))},indexOf:{value:zp(Mc.getVisitFnByTypeId(r))}})}return"Vector"})($.prototype);Object.defineProperty($,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$&&$.isVector(t)}});Hp=class e extends ${constructor(t){super(t.data);let r=this.get,n=this.set,i=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(s){let a=o[s];if(a!==void 0)return a;let c=r.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){n.call(this,s,a),o[s]=a}}),Object.defineProperty(this,"slice",{value:(s,a)=>new e(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new $(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function t5(e){if(!e||e.length<=0)return function(i){return!0};let t="",r=e.filter(n=>n===n);return r.length>0&&(t=`
1
+ "use strict";var zD=Object.create;var D1=Object.defineProperty;var qD=Object.getOwnPropertyDescriptor;var VD=Object.getOwnPropertyNames;var WD=Object.getPrototypeOf,HD=Object.prototype.hasOwnProperty;var p=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var ae=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Qt=(e,t)=>{for(var r in t)D1(e,r,{get:t[r],enumerable:!0})},$D=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of VD(t))!HD.call(e,i)&&i!==r&&D1(e,i,{get:()=>t[i],enumerable:!(n=qD(t,i))||n.enumerable});return e};var me=(e,t,r)=>(r=e!=null?zD(WD(e)):{},$D(t||!e||!e.__esModule?D1(r,"default",{value:e,enumerable:!0}):r,e));var tS,wN,xN,_N,SN,MN,vN,EN,TN,AN,IN,PN,RN,LN,ON,f,Ji=p(()=>{tS=e=>typeof e<"u"&&e!==null,wN=e=>typeof e=="object",xN=e=>Object.prototype.toString.call(e)==="[object Object]",_N=e=>typeof e=="function",SN=e=>typeof e=="boolean",MN=e=>e instanceof Buffer,vN=e=>{if(tS(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},EN=e=>e instanceof ArrayBuffer,TN=e=>typeof e=="string"&&e.length>0,AN=e=>typeof e=="number"&&Number.isFinite(e),IN=e=>Number.isInteger(e),PN=(e,t,r)=>e>=t&&e<=r,RN=(e,t)=>t.includes(e),LN=(e,t,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return new Error(`Expected ${t} for ${e} but received ${n} of type ${typeof r}`)},ON=(e,t)=>(t.message=e.message,t),f={defined:tS,object:wN,plainObject:xN,fn:_N,bool:SN,buffer:MN,typedArray:vN,arrayBuffer:EN,string:TN,number:AN,integer:IN,inRange:PN,inArray:RN,invalidParameterError:LN,nativeError:ON}});var iS=ae((PY,nS)=>{"use strict";var rS=()=>process.platform==="linux",md=null,CN=()=>{if(!md)if(rS()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,md=process.report.getReport(),process.report.excludeNetwork=e}else md={};return md};nS.exports={isLinux:rS,getReport:CN}});var sS=ae((RY,oS)=>{"use strict";var bl=require("fs"),BN="/usr/bin/ldd",DN="/proc/self/exe",pd=2048,NN=e=>{let t=bl.openSync(e,"r"),r=Buffer.alloc(pd),n=bl.readSync(t,r,0,pd,0);return bl.close(t,()=>{}),r.subarray(0,n)},FN=e=>new Promise((t,r)=>{bl.open(e,"r",(n,i)=>{if(n)r(n);else{let o=Buffer.alloc(pd);bl.read(i,o,0,pd,0,(s,a)=>{t(o.subarray(0,a)),bl.close(i,()=>{})})}})});oS.exports={LDD_PATH:BN,SELF_PATH:DN,readFileSync:NN,readFile:FN}});var cS=ae((LY,aS)=>{"use strict";var kN=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let i=0;i<n;i++){let o=t+i*r;if(e.readUInt32LE(o)===3){let a=e.readUInt32LE(o+8),c=e.readUInt32LE(o+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};aS.exports={interpreterPath:kN}});var yd=ae((OY,TS)=>{"use strict";var uS=require("child_process"),{isLinux:wl,getReport:fS}=iS(),{LDD_PATH:gd,SELF_PATH:hS,readFile:z1,readFileSync:q1}=sS(),{interpreterPath:dS}=cS(),Qi,eo,to,mS="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",Es="",pS=()=>Es||new Promise(e=>{uS.exec(mS,(t,r)=>{Es=t?" ":r,e(Es)})}),gS=()=>{if(!Es)try{Es=uS.execSync(mS,{encoding:"utf8"})}catch{Es=" "}return Es},Oo="glibc",yS=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Ja="musl",GN=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),bS=()=>{let e=fS();return e.header&&e.header.glibcVersionRuntime?Oo:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(GN)?Ja:null},wS=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(Oo)?Oo:r&&r.includes(Ja)?Ja:null},xS=e=>{if(e){if(e.includes("/ld-musl-"))return Ja;if(e.includes("/ld-linux-"))return Oo}return null},_S=e=>(e=e.toString(),e.includes("musl")?Ja:e.includes("GNU C Library")?Oo:null),UN=async()=>{if(eo!==void 0)return eo;eo=null;try{let e=await z1(gd);eo=_S(e)}catch{}return eo},jN=()=>{if(eo!==void 0)return eo;eo=null;try{let e=q1(gd);eo=_S(e)}catch{}return eo},zN=async()=>{if(Qi!==void 0)return Qi;Qi=null;try{let e=await z1(hS),t=dS(e);Qi=xS(t)}catch{}return Qi},qN=()=>{if(Qi!==void 0)return Qi;Qi=null;try{let e=q1(hS),t=dS(e);Qi=xS(t)}catch{}return Qi},SS=async()=>{let e=null;if(wl()&&(e=await zN(),!e&&(e=await UN(),e||(e=bS()),!e))){let t=await pS();e=wS(t)}return e},MS=()=>{let e=null;if(wl()&&(e=qN(),!e&&(e=jN(),e||(e=bS()),!e))){let t=gS();e=wS(t)}return e},VN=async()=>wl()&&await SS()!==Oo,WN=()=>wl()&&MS()!==Oo,HN=async()=>{if(to!==void 0)return to;to=null;try{let t=(await z1(gd)).match(yS);t&&(to=t[1])}catch{}return to},$N=()=>{if(to!==void 0)return to;to=null;try{let t=q1(gd).match(yS);t&&(to=t[1])}catch{}return to},vS=()=>{let e=fS();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},lS=e=>e.trim().split(/\s+/)[1],ES=e=>{let[t,r,n]=e.split(/[\r\n]+/);return t&&t.includes(Oo)?lS(t):r&&n&&r.includes(Ja)?lS(n):null},KN=async()=>{let e=null;if(wl()&&(e=await HN(),e||(e=vS()),!e)){let t=await pS();e=ES(t)}return e},XN=()=>{let e=null;if(wl()&&(e=$N(),e||(e=vS()),!e)){let t=gS();e=ES(t)}return e};TS.exports={GLIBC:Oo,MUSL:Ja,family:SS,familySync:MS,isNonGlibcLinux:VN,isNonGlibcLinuxSync:WN,version:KN,versionSync:XN}});var xl=ae((CY,AS)=>{"use strict";var YN="2.0.0",ZN=Number.MAX_SAFE_INTEGER||9007199254740991,JN=16,QN=250,eF=["major","premajor","minor","preminor","patch","prepatch","prerelease"];AS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:JN,MAX_SAFE_BUILD_LENGTH:QN,MAX_SAFE_INTEGER:ZN,RELEASE_TYPES:eF,SEMVER_SPEC_VERSION:YN,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var hf=ae((BY,IS)=>{"use strict";var tF=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};IS.exports=tF});var _l=ae((ro,PS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:V1,MAX_SAFE_BUILD_LENGTH:rF,MAX_LENGTH:nF}=xl(),iF=hf();ro=PS.exports={};var oF=ro.re=[],sF=ro.safeRe=[],Y=ro.src=[],aF=ro.safeSrc=[],Z=ro.t={},cF=0,W1="[a-zA-Z0-9-]",lF=[["\\s",1],["\\d",nF],[W1,rF]],uF=e=>{for(let[t,r]of lF)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},Pe=(e,t,r)=>{let n=uF(t),i=cF++;iF(e,i,t),Z[e]=i,Y[i]=t,aF[i]=n,oF[i]=new RegExp(t,r?"g":void 0),sF[i]=new RegExp(n,r?"g":void 0)};Pe("NUMERICIDENTIFIER","0|[1-9]\\d*");Pe("NUMERICIDENTIFIERLOOSE","\\d+");Pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${W1}*`);Pe("MAINVERSION",`(${Y[Z.NUMERICIDENTIFIER]})\\.(${Y[Z.NUMERICIDENTIFIER]})\\.(${Y[Z.NUMERICIDENTIFIER]})`);Pe("MAINVERSIONLOOSE",`(${Y[Z.NUMERICIDENTIFIERLOOSE]})\\.(${Y[Z.NUMERICIDENTIFIERLOOSE]})\\.(${Y[Z.NUMERICIDENTIFIERLOOSE]})`);Pe("PRERELEASEIDENTIFIER",`(?:${Y[Z.NONNUMERICIDENTIFIER]}|${Y[Z.NUMERICIDENTIFIER]})`);Pe("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[Z.NONNUMERICIDENTIFIER]}|${Y[Z.NUMERICIDENTIFIERLOOSE]})`);Pe("PRERELEASE",`(?:-(${Y[Z.PRERELEASEIDENTIFIER]}(?:\\.${Y[Z.PRERELEASEIDENTIFIER]})*))`);Pe("PRERELEASELOOSE",`(?:-?(${Y[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[Z.PRERELEASEIDENTIFIERLOOSE]})*))`);Pe("BUILDIDENTIFIER",`${W1}+`);Pe("BUILD",`(?:\\+(${Y[Z.BUILDIDENTIFIER]}(?:\\.${Y[Z.BUILDIDENTIFIER]})*))`);Pe("FULLPLAIN",`v?${Y[Z.MAINVERSION]}${Y[Z.PRERELEASE]}?${Y[Z.BUILD]}?`);Pe("FULL",`^${Y[Z.FULLPLAIN]}$`);Pe("LOOSEPLAIN",`[v=\\s]*${Y[Z.MAINVERSIONLOOSE]}${Y[Z.PRERELEASELOOSE]}?${Y[Z.BUILD]}?`);Pe("LOOSE",`^${Y[Z.LOOSEPLAIN]}$`);Pe("GTLT","((?:<|>)?=?)");Pe("XRANGEIDENTIFIERLOOSE",`${Y[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Pe("XRANGEIDENTIFIER",`${Y[Z.NUMERICIDENTIFIER]}|x|X|\\*`);Pe("XRANGEPLAIN",`[v=\\s]*(${Y[Z.XRANGEIDENTIFIER]})(?:\\.(${Y[Z.XRANGEIDENTIFIER]})(?:\\.(${Y[Z.XRANGEIDENTIFIER]})(?:${Y[Z.PRERELEASE]})?${Y[Z.BUILD]}?)?)?`);Pe("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[Z.XRANGEIDENTIFIERLOOSE]})(?:${Y[Z.PRERELEASELOOSE]})?${Y[Z.BUILD]}?)?)?`);Pe("XRANGE",`^${Y[Z.GTLT]}\\s*${Y[Z.XRANGEPLAIN]}$`);Pe("XRANGELOOSE",`^${Y[Z.GTLT]}\\s*${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${V1}})(?:\\.(\\d{1,${V1}}))?(?:\\.(\\d{1,${V1}}))?`);Pe("COERCE",`${Y[Z.COERCEPLAIN]}(?:$|[^\\d])`);Pe("COERCEFULL",Y[Z.COERCEPLAIN]+`(?:${Y[Z.PRERELEASE]})?(?:${Y[Z.BUILD]})?(?:$|[^\\d])`);Pe("COERCERTL",Y[Z.COERCE],!0);Pe("COERCERTLFULL",Y[Z.COERCEFULL],!0);Pe("LONETILDE","(?:~>?)");Pe("TILDETRIM",`(\\s*)${Y[Z.LONETILDE]}\\s+`,!0);ro.tildeTrimReplace="$1~";Pe("TILDE",`^${Y[Z.LONETILDE]}${Y[Z.XRANGEPLAIN]}$`);Pe("TILDELOOSE",`^${Y[Z.LONETILDE]}${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("LONECARET","(?:\\^)");Pe("CARETTRIM",`(\\s*)${Y[Z.LONECARET]}\\s+`,!0);ro.caretTrimReplace="$1^";Pe("CARET",`^${Y[Z.LONECARET]}${Y[Z.XRANGEPLAIN]}$`);Pe("CARETLOOSE",`^${Y[Z.LONECARET]}${Y[Z.XRANGEPLAINLOOSE]}$`);Pe("COMPARATORLOOSE",`^${Y[Z.GTLT]}\\s*(${Y[Z.LOOSEPLAIN]})$|^$`);Pe("COMPARATOR",`^${Y[Z.GTLT]}\\s*(${Y[Z.FULLPLAIN]})$|^$`);Pe("COMPARATORTRIM",`(\\s*)${Y[Z.GTLT]}\\s*(${Y[Z.LOOSEPLAIN]}|${Y[Z.XRANGEPLAIN]})`,!0);ro.comparatorTrimReplace="$1$2$3";Pe("HYPHENRANGE",`^\\s*(${Y[Z.XRANGEPLAIN]})\\s+-\\s+(${Y[Z.XRANGEPLAIN]})\\s*$`);Pe("HYPHENRANGELOOSE",`^\\s*(${Y[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[Z.XRANGEPLAINLOOSE]})\\s*$`);Pe("STAR","(<|>)?=?\\s*\\*");Pe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Pe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var bd=ae((DY,RS)=>{"use strict";var fF=Object.freeze({loose:!0}),hF=Object.freeze({}),dF=e=>e?typeof e!="object"?fF:e:hF;RS.exports=dF});var H1=ae((NY,CS)=>{"use strict";var LS=/^[0-9]+$/,OS=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=LS.test(e),n=LS.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},mF=(e,t)=>OS(t,e);CS.exports={compareIdentifiers:OS,rcompareIdentifiers:mF}});var Mr=ae((FY,DS)=>{"use strict";var wd=hf(),{MAX_LENGTH:BS,MAX_SAFE_INTEGER:xd}=xl(),{safeRe:_d,t:Sd}=_l(),pF=bd(),{compareIdentifiers:$1}=H1(),gF=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if($1(e[n],r[n])!==0)return!1;return!0},K1=class e{constructor(t,r){if(r=pF(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>BS)throw new TypeError(`version is longer than ${BS} characters`);wd("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?_d[Sd.LOOSE]:_d[Sd.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>xd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>xd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>xd||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<xd)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(wd("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(wd("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return $1(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(wd("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return $1(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?_d[Sd.PRERELEASELOOSE]:_d[Sd.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];if(n===!1&&(o=[r]),gF(this.prerelease,r)){let s=this.prerelease[r.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};DS.exports=K1});var Ts=ae((kY,FS)=>{"use strict";var NS=Mr(),yF=(e,t,r=!1)=>{if(e instanceof NS)return e;try{return new NS(e,t)}catch(n){if(!r)return null;throw n}};FS.exports=yF});var GS=ae((GY,kS)=>{"use strict";var bF=Ts(),wF=(e,t)=>{let r=bF(e,t);return r?r.version:null};kS.exports=wF});var jS=ae((UY,US)=>{"use strict";var xF=Ts(),_F=(e,t)=>{let r=xF(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};US.exports=_F});var VS=ae((jY,qS)=>{"use strict";var zS=Mr(),SF=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new zS(e instanceof zS?e.version:e,r).inc(t,n,i).version}catch{return null}};qS.exports=SF});var $S=ae((zY,HS)=>{"use strict";var WS=Ts(),MF=(e,t)=>{let r=WS(e,null,!0),n=WS(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};HS.exports=MF});var XS=ae((qY,KS)=>{"use strict";var vF=Mr(),EF=(e,t)=>new vF(e,t).major;KS.exports=EF});var ZS=ae((VY,YS)=>{"use strict";var TF=Mr(),AF=(e,t)=>new TF(e,t).minor;YS.exports=AF});var QS=ae((WY,JS)=>{"use strict";var IF=Mr(),PF=(e,t)=>new IF(e,t).patch;JS.exports=PF});var tM=ae((HY,eM)=>{"use strict";var RF=Ts(),LF=(e,t)=>{let r=RF(e,t);return r&&r.prerelease.length?r.prerelease:null};eM.exports=LF});var fi=ae(($Y,nM)=>{"use strict";var rM=Mr(),OF=(e,t,r)=>new rM(e,r).compare(new rM(t,r));nM.exports=OF});var oM=ae((KY,iM)=>{"use strict";var CF=fi(),BF=(e,t,r)=>CF(t,e,r);iM.exports=BF});var aM=ae((XY,sM)=>{"use strict";var DF=fi(),NF=(e,t)=>DF(e,t,!0);sM.exports=NF});var Md=ae((YY,lM)=>{"use strict";var cM=Mr(),FF=(e,t,r)=>{let n=new cM(e,r),i=new cM(t,r);return n.compare(i)||n.compareBuild(i)};lM.exports=FF});var fM=ae((ZY,uM)=>{"use strict";var kF=Md(),GF=(e,t)=>e.sort((r,n)=>kF(r,n,t));uM.exports=GF});var dM=ae((JY,hM)=>{"use strict";var UF=Md(),jF=(e,t)=>e.sort((r,n)=>UF(n,r,t));hM.exports=jF});var df=ae((QY,mM)=>{"use strict";var zF=fi(),qF=(e,t,r)=>zF(e,t,r)>0;mM.exports=qF});var vd=ae((eZ,pM)=>{"use strict";var VF=fi(),WF=(e,t,r)=>VF(e,t,r)<0;pM.exports=WF});var X1=ae((tZ,gM)=>{"use strict";var HF=fi(),$F=(e,t,r)=>HF(e,t,r)===0;gM.exports=$F});var Y1=ae((rZ,yM)=>{"use strict";var KF=fi(),XF=(e,t,r)=>KF(e,t,r)!==0;yM.exports=XF});var Ed=ae((nZ,bM)=>{"use strict";var YF=fi(),ZF=(e,t,r)=>YF(e,t,r)>=0;bM.exports=ZF});var Td=ae((iZ,wM)=>{"use strict";var JF=fi(),QF=(e,t,r)=>JF(e,t,r)<=0;wM.exports=QF});var Z1=ae((oZ,xM)=>{"use strict";var e7=X1(),t7=Y1(),r7=df(),n7=Ed(),i7=vd(),o7=Td(),s7=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return e7(e,r,n);case"!=":return t7(e,r,n);case">":return r7(e,r,n);case">=":return n7(e,r,n);case"<":return i7(e,r,n);case"<=":return o7(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};xM.exports=s7});var SM=ae((sZ,_M)=>{"use strict";var a7=Mr(),c7=Ts(),{safeRe:Ad,t:Id}=_l(),l7=(e,t)=>{if(e instanceof a7)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Ad[Id.COERCEFULL]:Ad[Id.COERCE]);else{let c=t.includePrerelease?Ad[Id.COERCERTLFULL]:Ad[Id.COERCERTL],l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return c7(`${n}.${i}.${o}${s}${a}`,t)};_M.exports=l7});var vM=ae((aZ,MM)=>{"use strict";var u7=Ts(),f7=xl(),h7=Mr(),d7=(e,t,r)=>{if(!f7.RELEASE_TYPES.includes(t))return null;let n=m7(e,r);return n&&p7(n,t)},m7=(e,t)=>{let r=e instanceof h7?e.version:e;return u7(r,t)},p7=(e,t)=>{if(g7(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},g7=e=>e.startsWith("pre");MM.exports=d7});var TM=ae((cZ,EM)=>{"use strict";var J1=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};EM.exports=J1});var hi=ae((lZ,RM)=>{"use strict";var y7=/\s+/g,Q1=class e{constructor(t,r){if(r=w7(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof eg)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(y7," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!IM(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&I7(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(A7,"");let n=((this.options.includePrerelease&&E7)|(this.options.loose&&T7))+":"+t,i=AM.get(n);if(i)return i;let o=this.options.loose,s=o?Jr[vr.HYPHENRANGELOOSE]:Jr[vr.HYPHENRANGE];t=t.replace(s,G7(this.options.includePrerelease)),Et("hyphen replace",t),t=t.replace(Jr[vr.COMPARATORTRIM],S7),Et("comparator trim",t),t=t.replace(Jr[vr.TILDETRIM],M7),Et("tilde trim",t),t=t.replace(Jr[vr.CARETTRIM],v7),Et("caret trim",t);let a=t.split(" ").map(h=>P7(h,this.options)).join(" ").split(/\s+/).map(h=>k7(h,this.options));o&&(a=a.filter(h=>(Et("loose invalid filter",h,this.options),!!h.match(Jr[vr.COMPARATORLOOSE])))),Et("range list",a);let c=new Map,l=a.map(h=>new eg(h,this.options));for(let h of l){if(IM(h))return[h];c.set(h.value,h)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return AM.set(n,u),u}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>PM(n,r)&&t.set.some(i=>PM(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new x7(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(U7(this.set[r],t,this.options))return!0;return!1}};RM.exports=Q1;var b7=TM(),AM=new b7,w7=bd(),eg=mf(),Et=hf(),x7=Mr(),{safeRe:Jr,src:_7,t:vr,comparatorTrimReplace:S7,tildeTrimReplace:M7,caretTrimReplace:v7}=_l(),{FLAG_INCLUDE_PRERELEASE:E7,FLAG_LOOSE:T7}=xl(),A7=new RegExp(_7[vr.BUILD],"g"),IM=e=>e.value==="<0.0.0-0",I7=e=>e.value==="",PM=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},P7=(e,t)=>(e=e.replace(Jr[vr.BUILD],""),Et("comp",e,t),e=C7(e,t),Et("caret",e),e=L7(e,t),Et("tildes",e),e=D7(e,t),Et("xrange",e),e=F7(e,t),Et("stars",e),e),ar=e=>!e||e.toLowerCase()==="x"||e==="*",R7=(e,t,r)=>ar(e)&&!ar(t)||ar(t)&&r&&!ar(r),L7=(e,t)=>e.trim().split(/\s+/).map(r=>O7(r,t)).join(" "),O7=(e,t)=>{let r=t.loose?Jr[vr.TILDELOOSE]:Jr[vr.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{Et("tilde",e,i,o,s,a,c);let l;return ar(o)?l="":ar(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ar(a)?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c?(Et("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,Et("tilde return",l),l})},C7=(e,t)=>e.trim().split(/\s+/).map(r=>B7(r,t)).join(" "),B7=(e,t)=>{Et("caret",e,t);let r=t.loose?Jr[vr.CARETLOOSE]:Jr[vr.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{Et("caret",e,i,o,s,a,c);let l;return ar(o)?l="":ar(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ar(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(Et("replaceCaret pr",c),o==="0"?s==="0"?l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(Et("no pr"),o==="0"?s==="0"?l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`:l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Et("caret return",l),l})},D7=(e,t)=>(Et("replaceXRanges",e,t),e.split(/\s+/).map(r=>N7(r,t)).join(" ")),N7=(e,t)=>{e=e.trim();let r=t.loose?Jr[vr.XRANGELOOSE]:Jr[vr.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(Et("xRange",e,n,i,o,s,a,c),R7(o,s,a))return e;let l=ar(o),u=l||ar(s),h=u||ar(a),d=h;return i==="="&&d&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&d?(u&&(s=0),a=0,i===">"?(i=">=",u?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",u?o=+o+1:s=+s+1),i==="<"&&(c="-0"),n=`${i+o}.${s}.${a}${c}`):u?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:h&&(n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),Et("xRange return",n),n})},F7=(e,t)=>(Et("replaceStars",e,t),e.trim().replace(Jr[vr.STAR],"")),k7=(e,t)=>(Et("replaceGTE0",e,t),e.trim().replace(Jr[t.includePrerelease?vr.GTE0PRE:vr.GTE0],"")),G7=e=>(t,r,n,i,o,s,a,c,l,u,h,d)=>(ar(n)?r="":ar(i)?r=`>=${n}.0.0${e?"-0":""}`:ar(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,ar(l)?c="":ar(u)?c=`<${+l+1}.0.0-0`:ar(h)?c=`<${l}.${+u+1}.0-0`:d?c=`<=${l}.${u}.${h}-${d}`:e?c=`<${l}.${u}.${+h+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),U7=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Et(e[n].semver),e[n].semver!==eg.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var mf=ae((uZ,NM)=>{"use strict";var pf=Symbol("SemVer ANY"),ng=class e{static get ANY(){return pf}constructor(t,r){if(r=LM(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),rg("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===pf?this.value="":this.value=this.operator+this.semver.version,rg("comp",this)}parse(t){let r=this.options.loose?OM[CM.COMPARATORLOOSE]:OM[CM.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new BM(n[2],this.options.loose):this.semver=pf}toString(){return this.value}test(t){if(rg("Comparator.test",t,this.options.loose),this.semver===pf||t===pf)return!0;if(typeof t=="string")try{t=new BM(t,this.options)}catch{return!1}return tg(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new DM(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new DM(this.value,r).test(t.semver):(r=LM(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||tg(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||tg(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};NM.exports=ng;var LM=bd(),{safeRe:OM,t:CM}=_l(),tg=Z1(),rg=hf(),BM=Mr(),DM=hi()});var gf=ae((fZ,FM)=>{"use strict";var j7=hi(),z7=(e,t,r)=>{try{t=new j7(t,r)}catch{return!1}return t.test(e)};FM.exports=z7});var GM=ae((hZ,kM)=>{"use strict";var q7=hi(),V7=(e,t)=>new q7(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));kM.exports=V7});var jM=ae((dZ,UM)=>{"use strict";var W7=Mr(),H7=hi(),$7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new H7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new W7(n,r))}),n};UM.exports=$7});var qM=ae((mZ,zM)=>{"use strict";var K7=Mr(),X7=hi(),Y7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new X7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new K7(n,r))}),n};zM.exports=Y7});var HM=ae((pZ,WM)=>{"use strict";var ig=Mr(),Z7=hi(),VM=df(),J7=(e,t)=>{e=new Z7(e,t);let r=new ig("0.0.0");if(e.test(r)||(r=new ig("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new ig(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||VM(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||VM(r,o))&&(r=o)}return r&&e.test(r)?r:null};WM.exports=J7});var KM=ae((gZ,$M)=>{"use strict";var Q7=hi(),e9=(e,t)=>{try{return new Q7(e,t).range||"*"}catch{return null}};$M.exports=e9});var Pd=ae((yZ,JM)=>{"use strict";var t9=Mr(),ZM=mf(),{ANY:r9}=ZM,n9=hi(),i9=gf(),XM=df(),YM=vd(),o9=Td(),s9=Ed(),a9=(e,t,r,n)=>{e=new t9(e,n),t=new n9(t,n);let i,o,s,a,c;switch(r){case">":i=XM,o=o9,s=YM,a=">",c=">=";break;case"<":i=YM,o=s9,s=XM,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i9(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],h=null,d=null;if(u.forEach(m=>{m.semver===r9&&(m=new ZM(">=0.0.0")),h=h||m,d=d||m,i(m.semver,h.semver,n)?h=m:s(m.semver,d.semver,n)&&(d=m)}),h.operator===a||h.operator===c||(!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===c&&s(e,d.semver))return!1}return!0};JM.exports=a9});var e3=ae((bZ,QM)=>{"use strict";var c9=Pd(),l9=(e,t,r)=>c9(e,t,">",r);QM.exports=l9});var r3=ae((wZ,t3)=>{"use strict";var u9=Pd(),f9=(e,t,r)=>u9(e,t,"<",r);t3.exports=f9});var o3=ae((xZ,i3)=>{"use strict";var n3=hi(),h9=(e,t,r)=>(e=new n3(e,r),t=new n3(t,r),e.intersects(t,r));i3.exports=h9});var a3=ae((_Z,s3)=>{"use strict";var d9=gf(),m9=fi();s3.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((u,h)=>m9(u,h,r));for(let u of s)d9(u,t,r)?(o=u,i||(i=u)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[u,h]of n)u===h?a.push(u):!h&&u===s[0]?a.push("*"):h?u===s[0]?a.push(`<=${h}`):a.push(`${u} - ${h}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var d3=ae((SZ,h3)=>{"use strict";var c3=hi(),ag=mf(),{ANY:og}=ag,sg=gf(),cg=fi(),p9=(e,t,r={})=>{if(e===t)return!0;e=new c3(e,r),t=new c3(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=y9(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},g9=[new ag(">=0.0.0-0")],l3=[new ag(">=0.0.0")],y9=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===og){if(t.length===1&&t[0].semver===og)return!0;r.includePrerelease?e=g9:e=l3}if(t.length===1&&t[0].semver===og){if(r.includePrerelease)return!0;t=l3}let n=new Set,i,o;for(let m of e)m.operator===">"||m.operator===">="?i=u3(i,m,r):m.operator==="<"||m.operator==="<="?o=f3(o,m,r):n.add(m.semver);if(n.size>1)return null;let s;if(i&&o){if(s=cg(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let m of n){if(i&&!sg(m,String(i),r)||o&&!sg(m,String(o),r))return null;for(let g of t)if(!sg(m,String(g),r))return!1;return!0}let a,c,l,u,h=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;h&&h.prerelease.length===1&&o.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let m of t){if(u=u||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",i){if(d&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch&&(d=!1),m.operator===">"||m.operator===">="){if(a=u3(i,m,r),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(o){if(h&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===h.major&&m.semver.minor===h.minor&&m.semver.patch===h.patch&&(h=!1),m.operator==="<"||m.operator==="<="){if(c=f3(o,m,r),c===m&&c!==o)return!1}else if(o.operator==="<="&&!m.test(o.semver))return!1}if(!m.operator&&(o||i)&&s!==0)return!1}return!(i&&l&&!o&&s!==0||o&&u&&!i&&s!==0||d||h)},u3=(e,t,r)=>{if(!e)return t;let n=cg(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},f3=(e,t,r)=>{if(!e)return t;let n=cg(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};h3.exports=p9});var y3=ae((MZ,g3)=>{"use strict";var lg=_l(),m3=xl(),b9=Mr(),p3=H1(),w9=Ts(),x9=GS(),_9=jS(),S9=VS(),M9=$S(),v9=XS(),E9=ZS(),T9=QS(),A9=tM(),I9=fi(),P9=oM(),R9=aM(),L9=Md(),O9=fM(),C9=dM(),B9=df(),D9=vd(),N9=X1(),F9=Y1(),k9=Ed(),G9=Td(),U9=Z1(),j9=SM(),z9=vM(),q9=mf(),V9=hi(),W9=gf(),H9=GM(),$9=jM(),K9=qM(),X9=HM(),Y9=KM(),Z9=Pd(),J9=e3(),Q9=r3(),ek=o3(),tk=a3(),rk=d3();g3.exports={parse:w9,valid:x9,clean:_9,inc:S9,diff:M9,major:v9,minor:E9,patch:T9,prerelease:A9,compare:I9,rcompare:P9,compareLoose:R9,compareBuild:L9,sort:O9,rsort:C9,gt:B9,lt:D9,eq:N9,neq:F9,gte:k9,lte:G9,cmp:U9,coerce:j9,truncate:z9,Comparator:q9,Range:V9,satisfies:W9,toComparators:H9,maxSatisfying:$9,minSatisfying:K9,minVersion:X9,validRange:Y9,outside:Z9,gtr:J9,ltr:Q9,intersects:ek,simplifyRange:tk,subset:rk,SemVer:b9,re:lg.re,src:lg.src,tokens:lg.t,SEMVER_SPEC_VERSION:m3.SEMVER_SPEC_VERSION,RELEASE_TYPES:m3.RELEASE_TYPES,compareIdentifiers:p3.compareIdentifiers,rcompareIdentifiers:p3.rcompareIdentifiers}});var Co,Rd=p(()=>{Co={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.5","@img/sharp-darwin-x64":"0.35.5","@img/sharp-freebsd-wasm32":"0.35.5","@img/sharp-libvips-darwin-arm64":"1.3.4","@img/sharp-libvips-darwin-x64":"1.3.4","@img/sharp-libvips-linux-arm":"1.3.4","@img/sharp-libvips-linux-arm64":"1.3.4","@img/sharp-libvips-linux-ppc64":"1.3.4","@img/sharp-libvips-linux-riscv64":"1.3.4","@img/sharp-libvips-linux-s390x":"1.3.4","@img/sharp-libvips-linux-x64":"1.3.4","@img/sharp-libvips-linuxmusl-arm64":"1.3.4","@img/sharp-libvips-linuxmusl-x64":"1.3.4","@img/sharp-linux-arm":"0.35.5","@img/sharp-linux-arm64":"0.35.5","@img/sharp-linux-ppc64":"0.35.5","@img/sharp-linux-riscv64":"0.35.5","@img/sharp-linux-s390x":"0.35.5","@img/sharp-linux-x64":"0.35.5","@img/sharp-linuxmusl-arm64":"0.35.5","@img/sharp-linuxmusl-x64":"0.35.5","@img/sharp-webcontainers-wasm32":"0.35.5","@img/sharp-win32-arm64":"0.35.5","@img/sharp-win32-ia32":"0.35.5","@img/sharp-win32-x64":"0.35.5"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.14","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.3","@img/sharp-libvips-dev":"1.3.4","@img/sharp-libvips-dev-wasm32":"1.3.4","@img/sharp-libvips-win32-arm64":"1.3.4","@img/sharp-libvips-win32-ia32":"1.3.4","@img/sharp-libvips-win32-x64":"1.3.4","@types/node":"*",emnapi:"^1.11.3","exif-reader":"^2.0.3",icc:"^4.0.0","node-addon-api":"^8.9.2","node-gyp":"^12.4.0",publint:"^0.3.24","tar-fs":"^3.1.3",tsd:"^0.33.0",yauzl:"^3.4.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.7"},funding:{url:"https://opencollective.com/libvips"}}});var Ml,w3,yf,fg,ik,x3,ok,hg,sk,_3,ak,Sl,ck,lk,uk,fk,S3,hk,b3,dk,mk,M3,pk,gk,v3,ug,yk,Ld,dg=p(()=>{Ml=require("node:child_process"),w3=require("node:crypto"),yf=me(y3(),1),fg=me(yd(),1);Rd();ik=process.env.npm_package_config_libvips||Co.config.libvips,x3=yf.default.coerce(ik).version,ok=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],hg={encoding:"utf8",shell:!0},sk=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},_3=()=>fg.default.isNonGlibcLinuxSync()?fg.default.familySync():"",ak=()=>`${process.platform}${_3()}-${process.arch}`,Sl=()=>{if(S3())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r=="string"?r:_3();return`${t||process.platform}${n}-${e||process.arch}`},ck=()=>{try{return require(`@img/sharp-libvips-dev-${Sl()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},lk=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},uk=()=>{try{return require(`@img/sharp-libvips-dev-${Sl()}/lib`)}catch{try{return require(`@img/sharp-libvips-${Sl()}/lib`)}catch{}}return""},fk=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!yf.default.satisfies(process.versions.node,Co.engines.node))return{found:process.versions.node,expected:Co.engines.node}},S3=()=>{let{CC:e}=process.env;return!!(e!=null&&e.endsWith("/emcc"))},hk=()=>process.platform==="darwin"&&process.arch==="x64"?((0,Ml.spawnSync)("sysctl sysctl.proc_translated",hg).stdout||"").trim()==="sysctl.proc_translated: 1":!1,b3=e=>(0,w3.createHash)("sha512").update(e).digest("hex"),dk=()=>{try{let e=b3(`imgsharp-libvips-${Sl()}`),t=yf.default.coerce(Co.optionalDependencies[`@img/sharp-libvips-${Sl()}`],{includePrerelease:!0}).version;return b3(`${e}npm:${t}`).slice(0,10)}catch{}return""},mk=()=>(0,Ml.spawnSync)(`node-gyp rebuild --directory=src ${S3()?"--nodedir=emscripten":""}`,{...hg,stdio:"inherit"}).status,M3=()=>process.platform!=="win32"?((0,Ml.spawnSync)("pkg-config --modversion vips-cpp",{...hg,env:{...process.env,PKG_CONFIG_PATH:v3()}}).stdout||"").trim():"",pk=()=>{try{let e=((0,Ml.spawnSync)("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch{}},gk=()=>{try{let e=((0,Ml.spawnSync)("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch{}},v3=()=>process.platform!=="win32"?[pk(),gk(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",ug=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),yk=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return ug(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return ug(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(hk())return ug(!1,"Rosetta",e);let t=M3();return!!t&&yf.default.gte(t,x3)},Ld={minimumLibvipsVersion:x3,prebuiltPlatforms:ok,buildPlatformArch:Sl,buildSharpLibvipsIncludeDir:ck,buildSharpLibvipsCPlusPlusDir:lk,buildSharpLibvipsLibDir:uk,isUnsupportedNodeRuntime:fk,runtimePlatformArch:ak,log:sk,yarnLocator:dk,spawnRebuild:mk,globalLibvipsVersion:M3,pkgConfigPath:v3,useGlobalLibvips:yk}});var T3,Od,_k,cr,A3,bk,E3,wk,xk,Bo,yt,As,it,bf=p(()=>{T3=require("node:module"),Od=me(yd(),1);dg();Rd();_k={};cr=(0,T3.createRequire)(_k.url),{version:A3}=Co,{runtimePlatformArch:bk,isUnsupportedNodeRuntime:E3,prebuiltPlatforms:wk,minimumLibvipsVersion:xk}=Ld,Bo=bk(),As=[];try{yt=cr(`../src/build/Release/sharp-${Bo}-${A3}.node`)}catch(e){As.push(e)}if(!yt)try{yt=cr(`../src/build/Release/sharp-wasm32-${A3}.node`)}catch(e){As.push(e)}if(!yt)try{switch(Bo){case"darwin-arm64":yt=cr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":yt=cr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":yt=cr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":yt=cr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":yt=cr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":yt=cr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":yt=cr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":yt=cr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":yt=cr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":yt=cr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":yt=cr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":yt=cr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":yt=cr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":yt=cr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":yt=cr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(yt&&["linux-x64","linuxmusl-x64"].includes(Bo)&&!yt._isUsingX64V2()){let e=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",As.push(e),yt=null}yt&&process.versions.electron&&Bo.startsWith("linux")&&process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(e){As.push(e)}if(!yt)try{yt=cr("@img/sharp-wasm32/sharp.node")}catch(e){As.push(e)}if(!yt){let[e,t,r]=["linux","darwin","win32"].map(o=>Bo.startsWith(o)),n=[`Could not load the "sharp" module using the ${Bo} runtime`];As.forEach(o=>{var s;(s=o.code)!=null&&s.endsWith("MODULE_NOT_FOUND")||n.push(o.code?`${o.code}: ${o.message}`:o.message)});let i=As.map(o=>o.message).join(" ");if(n.push("Possible solutions:"),E3()){let{found:o,expected:s}=E3();n.push("- Please upgrade Node.js:",` Found ${o}`,` Requires ${s}`)}else if(wk.includes(Bo)&&!/libstdc\+\+\.so/.test(i)){let[o,s]=Bo.split("-"),a=o.endsWith("musl")?" --libc=musl":"";n.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${o.replace("musl","")}${a} --cpu=${s} sharp`)}else n.push(`- Manually install libvips >= ${xk}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:o}=cr(`@img/sharp-libvips-${Bo}/package`),s=`${(0,Od.familySync)()} ${(0,Od.versionSync)()}`,a=`${o.musl?"musl":"glibc"} ${o.musl||o.glibc}`;n.push("- Update your OS:",` Found ${s}`,` Requires ${a}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(i)&&n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(i)&&n.push("- Update Homebrew:"," brew update && brew upgrade vips"),As.some(o=>o.code==="ERR_DLOPEN_DISABLED")&&n.push("- Run Node.js without using the --no-addons flag"),r&&/The specified procedure could not be found/.test(i)&&n.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),n.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(n.join(`
2
+ `))}it=yt});function vk(){let e=this.constructor.call(),{debuglog:t,queueListener:r,...n}=this.options;return e.options=structuredClone(n),e.options.debuglog=t,e.options.queueListener=r,this._isStreamInput()&&this._whenStreamInFinished(()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}var I3,Cd,Sk,Mk,Qa,no,P3=p(()=>{I3=me(require("node:util"),1),Cd=me(require("node:stream"),1);Ji();bf();Sk=I3.default.debuglog("sharp"),Mk=e=>{Qa.queue.emit("change",e)},Qa=function(e,t){if(arguments.length===1&&!f.defined(e))throw new Error("Invalid input");return this instanceof Qa?(Cd.default.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:r=>{this.emit("warning",r),Sk(r)},queueListener:Mk},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new Qa(e,t)};Object.setPrototypeOf(Qa.prototype,Cd.default.Duplex.prototype);Object.setPrototypeOf(Qa,Cd.default.Duplex);Object.assign(Qa.prototype,{clone:vk});no=Qa});function R3(e){let t=Tk.filter(r=>f.defined(e[r])).map(r=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function Ak(e,t,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(e))n.file=e;else if(f.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");n.buffer=e}else if(f.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(e,0,e.byteLength)}else if(f.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(f.plainObject(e)&&!f.defined(t))t=e,R3(t)&&(n.buffer=[]);else if(!f.defined(e)&&!f.defined(t)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map(i=>this._createInputDescriptor(i));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${e}' of type ${typeof e}${f.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(f.object(t)){if(f.defined(t.failOn))if(f.string(t.failOn)&&f.inArray(t.failOn,["none","truncated","error","warning"]))n.failOn=t.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(f.defined(t.autoOrient))if(f.bool(t.autoOrient))n.autoOrient=t.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",t.autoOrient);if(f.defined(t.density))if(f.number(t.density)&&f.inRange(t.density,1,1e5))n.density=t.density;else throw f.invalidParameterError("density","number between 1 and 100000",t.density);if(f.defined(t.ignoreIcc))if(f.bool(t.ignoreIcc))n.ignoreIcc=t.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(f.defined(t.limitInputPixels))if(f.bool(t.limitInputPixels))n.limitInputPixels=t.limitInputPixels?16383**2:0;else if(f.integer(t.limitInputPixels)&&f.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=t.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(f.defined(t.limitInputChannels))if(f.bool(t.limitInputChannels))n.limitInputChannels=t.limitInputChannels?5:0;else if(f.integer(t.limitInputChannels)&&f.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=t.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(f.defined(t.unlimited))if(f.bool(t.unlimited))n.unlimited=t.unlimited;else throw f.invalidParameterError("unlimited","boolean",t.unlimited);if(f.defined(t.sequentialRead))if(f.bool(t.sequentialRead))n.sequentialRead=t.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(f.defined(t.raw)){if(f.object(t.raw)&&f.integer(t.raw.width)&&f.inRange(t.raw.width,1,1e8)&&f.integer(t.raw.height)&&f.inRange(t.raw.height,1,1e8)&&f.integer(t.raw.channels)&&f.inRange(t.raw.channels,1,4))switch(n.rawWidth=t.raw.width,n.rawHeight=t.raw.height,n.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:n.rawDepth="uchar";break;case Int8Array:n.rawDepth="char";break;case Uint16Array:n.rawDepth="ushort";break;case Int16Array:n.rawDepth="short";break;case Uint32Array:n.rawDepth="uint";break;case Int32Array:n.rawDepth="int";break;case Float32Array:n.rawDepth="float";break;case Float64Array:n.rawDepth="double";break;default:n.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(n.rawPremultiplied=!1,f.defined(t.raw.premultiplied))if(f.bool(t.raw.premultiplied))n.rawPremultiplied=t.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(n.rawPageHeight=0,f.defined(t.raw.pageHeight))if(f.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);n.rawPageHeight=t.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(f.defined(t.animated))if(f.bool(t.animated))n.pages=t.animated?-1:1;else throw f.invalidParameterError("animated","boolean",t.animated);if(f.defined(t.pages))if(f.integer(t.pages)&&f.inRange(t.pages,-1,1e5))n.pages=t.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(f.defined(t.page))if(f.integer(t.page)&&f.inRange(t.page,0,1e5))n.page=t.page;else throw f.invalidParameterError("page","integer between 0 and 100000",t.page);if(f.object(t.openSlide)&&f.defined(t.openSlide.level))if(f.integer(t.openSlide.level)&&f.inRange(t.openSlide.level,0,256))n.openSlideLevel=t.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(f.defined(t.level))if(f.integer(t.level)&&f.inRange(t.level,0,256))n.openSlideLevel=t.level;else throw f.invalidParameterError("level","integer between 0 and 256",t.level);if(f.object(t.tiff)&&f.defined(t.tiff.subifd))if(f.integer(t.tiff.subifd)&&f.inRange(t.tiff.subifd,-1,1e5))n.tiffSubifd=t.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(f.defined(t.subifd))if(f.integer(t.subifd)&&f.inRange(t.subifd,-1,1e5))n.tiffSubifd=t.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(f.object(t.svg)){if(f.defined(t.svg.stylesheet))if(f.string(t.svg.stylesheet))n.svgStylesheet=t.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(f.defined(t.svg.highBitdepth))if(f.bool(t.svg.highBitdepth))n.svgHighBitdepth=t.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(f.object(t.pdf)&&f.defined(t.pdf.background)?n.pdfBackground=this._getBackgroundColourOption(t.pdf.background):f.defined(t.pdfBackground)&&(n.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),f.object(t.jp2)&&f.defined(t.jp2.oneshot))if(f.bool(t.jp2.oneshot))n.jp2Oneshot=t.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(f.defined(t.create))if(f.object(t.create)&&f.integer(t.create.width)&&f.inRange(t.create.width,1,1e8)&&f.integer(t.create.height)&&f.inRange(t.create.height,1,1e8)&&f.integer(t.create.channels)){if(n.createWidth=t.create.width,n.createHeight=t.create.height,n.createChannels=t.create.channels,n.createPageHeight=0,f.defined(t.create.pageHeight))if(f.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);n.createPageHeight=t.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(f.defined(t.create.noise)){if(!f.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=t.create.noise.type,!f.inRange(t.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(n.createNoiseMean=128,f.defined(t.create.noise.mean))if(f.number(t.create.noise.mean)&&f.inRange(t.create.noise.mean,0,1e4))n.createNoiseMean=t.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(n.createNoiseSigma=30,f.defined(t.create.noise.sigma))if(f.number(t.create.noise.sigma)&&f.inRange(t.create.noise.sigma,0,1e4))n.createNoiseSigma=t.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(f.defined(t.create.background)){if(!f.inRange(t.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);n.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete n.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(f.defined(t.text))if(f.object(t.text)&&f.string(t.text.text)){if(n.textValue=t.text.text,f.defined(t.text.height)&&f.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(f.defined(t.text.font))if(f.string(t.text.font))n.textFont=t.text.font;else throw f.invalidParameterError("text.font","string",t.text.font);if(f.defined(t.text.fontfile))if(f.string(t.text.fontfile))n.textFontfile=t.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",t.text.fontfile);if(f.defined(t.text.width))if(f.integer(t.text.width)&&f.inRange(t.text.width,1,1e6))n.textWidth=t.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(f.defined(t.text.height))if(f.integer(t.text.height)&&f.inRange(t.text.height,1,1e6))n.textHeight=t.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(f.defined(t.text.align))if(f.string(t.text.align)&&f.string(this.constructor.align[t.text.align]))n.textAlign=this.constructor.align[t.text.align];else throw f.invalidParameterError("text.align","valid alignment",t.text.align);if(f.defined(t.text.justify))if(f.bool(t.text.justify))n.textJustify=t.text.justify;else throw f.invalidParameterError("text.justify","boolean",t.text.justify);if(f.defined(t.text.dpi))if(f.integer(t.text.dpi)&&f.inRange(t.text.dpi,1,1e6))n.textDpi=t.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(f.defined(t.text.rgba))if(f.bool(t.text.rgba))n.textRgba=t.text.rgba;else throw f.invalidParameterError("text.rgba","bool",t.text.rgba);if(f.defined(t.text.spacing))if(f.integer(t.text.spacing)&&f.inRange(t.text.spacing,-1e6,1e6))n.textSpacing=t.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(f.defined(t.text.wrap))if(f.string(t.text.wrap)&&f.inArray(t.text.wrap,["word","char","word-char","none"]))n.textWrap=t.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete n.buffer}else throw new Error("Expected a valid string to create an image with text.");if(f.defined(t.join))if(f.defined(this.options.join)){if(f.defined(t.join.animated))if(f.bool(t.join.animated))n.joinAnimated=t.join.animated;else throw f.invalidParameterError("join.animated","boolean",t.join.animated);if(f.defined(t.join.across))if(f.integer(t.join.across)&&f.inRange(t.join.across,1,1e6))n.joinAcross=t.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(f.defined(t.join.shim))if(f.integer(t.join.shim)&&f.inRange(t.join.shim,0,1e6))n.joinShim=t.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(f.defined(t.join.background)&&(n.joinBackground=this._getBackgroundColourOption(t.join.background)),f.defined(t.join.halign))if(f.string(t.join.halign)&&f.string(this.constructor.align[t.join.halign]))n.joinHalign=this.constructor.align[t.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",t.join.halign);if(f.defined(t.join.valign))if(f.string(t.join.valign)&&f.string(this.constructor.align[t.join.valign]))n.joinValign=this.constructor.align[t.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(f.defined(t))throw new Error(`Invalid input options ${t}`);return n}function Ik(e,t,r){Array.isArray(this.options.input.buffer)?f.buffer(e)?(this.options.input.buffer.push(e),r()):r(new Error("Non-Buffer data on Writable Stream")):r(new Error("Unexpected data on Writable Stream"))}function Pk(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function Rk(){return Array.isArray(this.options.input.buffer)}function Lk(e){this.writableFinished?e():this.once("finish",e)}function Ok(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):it.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{it.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}function Ck(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):it.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{it.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}var Ek,Tk,L3,O3=p(()=>{Ji();bf();Ek={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},Tk=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];L3=e=>{Object.assign(e.prototype,{_inputOptionsFromObject:R3,_createInputDescriptor:Ak,_write:Ik,_flattenBufferIn:Pk,_isStreamInput:Rk,_whenStreamInFinished:Lk,metadata:Ok,stats:Ck}),e.align=Ek}});function pg(e){return e.angle%360!==0||e.rotationAngle!==0}function Bd(e){return e.width!==-1||e.height!==-1}function Nk(e,t,r){if(Bd(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),f.defined(e))if(f.object(e)&&!f.defined(r))r=e;else if(f.integer(e)&&f.inRange(e,1,1e8))this.options.width=e;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",e);else this.options.width=-1;if(f.defined(t))if(f.integer(t)&&f.inRange(t,1,1e8))this.options.height=t;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(f.object(r)){if(f.defined(r.width))if(f.integer(r.width)&&f.inRange(r.width,1,1e8))this.options.width=r.width;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",r.width);if(f.defined(r.height))if(f.integer(r.height)&&f.inRange(r.height,1,1e8))this.options.height=r.height;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",r.height);if(f.defined(r.fit)){let n=Dk[r.fit];if(f.string(n))this.options.canvas=n;else throw f.invalidParameterError("fit","valid fit",r.fit)}if(f.defined(r.position)){let n=f.integer(r.position)?r.position:N3[r.position]||D3[r.position]||B3[r.position];if(f.integer(n)&&(f.inRange(n,0,8)||f.inRange(n,16,17)))this.options.position=n;else throw f.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),f.defined(r.kernel))if(f.string(mg[r.kernel]))this.options.kernel=mg[r.kernel];else throw f.invalidParameterError("kernel","valid kernel name",r.kernel);f.defined(r.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",r.withoutEnlargement),f.defined(r.withoutReduction)&&this._setBooleanOption("withoutReduction",r.withoutReduction),f.defined(r.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}return pg(this.options)&&Bd(this.options)&&(this.options.rotateBefore=!0),this}function Fk(e){if(f.integer(e))if(f.inRange(e,1,1e8))this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else throw f.invalidParameterError("extend","integer between 1 and 100000000",e);else if(f.object(e)){if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,0,1e8))this.options.extendTop=e.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",e.top);if(f.defined(e.bottom))if(f.integer(e.bottom)&&f.inRange(e.bottom,0,1e8))this.options.extendBottom=e.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",e.bottom);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,0,1e8))this.options.extendLeft=e.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",e.left);if(f.defined(e.right))if(f.integer(e.right)&&f.inRange(e.right,0,1e8))this.options.extendRight=e.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),f.defined(e.extendWith))if(f.string(C3[e.extendWith]))this.options.extendWith=C3[e.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw f.invalidParameterError("extend","integer or object",e);return this}function kk(e){let t=Bd(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(r){let n=e[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),pg(this.options)&&!Bd(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function Gk(e){if(this.options.trimThreshold=10,f.defined(e))if(f.object(e)){if(f.defined(e.background)&&this._setBackgroundColourOption("trimBackground",e.background),f.defined(e.threshold))if(f.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw f.invalidParameterError("threshold","positive number",e.threshold);if(f.defined(e.lineArt)&&this._setBooleanOption("trimLineArt",e.lineArt),f.defined(e.margin))if(f.integer(e.margin)&&f.inRange(e.margin,0,1e7))this.options.trimMargin=e.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",e.margin)}else throw f.invalidParameterError("trim","object",e);return pg(this.options)&&(this.options.rotateBefore=!0),this}var B3,D3,C3,N3,mg,Bk,Dk,F3,k3=p(()=>{Ji();B3={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},D3={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},C3={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},N3={entropy:16,attention:17},mg={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},Bk={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},Dk={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};F3=e=>{Object.assign(e.prototype,{resize:Nk,extend:Fk,extract:kk,trim:Gk}),e.gravity=B3,e.strategy=N3,e.kernel=mg,e.fit=Bk,e.position=D3}});function Uk(e){if(!Array.isArray(e))throw f.invalidParameterError("images to composite","array",e);return this.options.composite=e.map(t=>{if(!f.object(t))throw f.invalidParameterError("image to composite","object",t);let r=this._inputOptionsFromObject(t),n={input:this._createInputDescriptor(t.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(t.blend))if(f.string(gg[t.blend]))n.blend=gg[t.blend];else throw f.invalidParameterError("blend","valid blend name",t.blend);if(f.defined(t.tile))if(f.bool(t.tile))n.tile=t.tile;else throw f.invalidParameterError("tile","boolean",t.tile);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,-1e8,1e8))n.left=t.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,-1e8,1e8))n.top=t.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(f.defined(t.top)!==f.defined(t.left))throw new Error("Expected both left and top to be set");if(n.hasOffset=f.integer(t.top)&&f.integer(t.left),f.defined(t.gravity))if(f.integer(t.gravity)&&f.inRange(t.gravity,0,8))n.gravity=t.gravity;else if(f.string(t.gravity)&&f.integer(this.constructor.gravity[t.gravity]))n.gravity=this.constructor.gravity[t.gravity];else throw f.invalidParameterError("gravity","valid gravity",t.gravity);if(f.defined(t.premultiplied))if(f.bool(t.premultiplied))n.premultiplied=t.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",t.premultiplied);return n}),this}var gg,G3,U3=p(()=>{Ji();gg={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};G3=e=>{e.prototype.composite=Uk,e.blend=gg}});function jk(e,t){if(!f.defined(e))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),f.integer(e)&&!(e%90))this.options.angle=e;else if(f.number(e))this.options.rotationAngle=e,f.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw f.invalidParameterError("angle","numeric",e);return this}function zk(){return this.options.input.autoOrient=!0,this}function qk(e){return this.options.flip=f.bool(e)?e:!0,this}function Vk(e){return this.options.flop=f.bool(e)?e:!0,this}function Wk(e,t){let n=Array.isArray(e)&&(e.length===4&&e.every(f.number)||e.length===2&&e.every(i=>Array.isArray(i)&&i.length===2))?e.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",e);if(f.defined(t))if(f.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),f.defined(t.idx))if(f.number(t.idx))this.options.affineIdx=t.idx;else throw f.invalidParameterError("options.idx","number",t.idx);if(f.defined(t.idy))if(f.number(t.idy))this.options.affineIdy=t.idy;else throw f.invalidParameterError("options.idy","number",t.idy);if(f.defined(t.odx))if(f.number(t.odx))this.options.affineOdx=t.odx;else throw f.invalidParameterError("options.odx","number",t.odx);if(f.defined(t.ody))if(f.number(t.ody))this.options.affineOdy=t.ody;else throw f.invalidParameterError("options.ody","number",t.ody);if(f.defined(t.interpolator))if(f.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw f.invalidParameterError("options","object",t);return this}function Hk(e){if(f.plainObject(e)){if(f.number(e.sigma)&&f.inRange(e.sigma,1e-6,10))this.options.sharpenSigma=e.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(f.defined(e.m1))if(f.number(e.m1)&&f.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(f.defined(e.m2))if(f.number(e.m2)&&f.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(f.defined(e.x1))if(f.number(e.x1)&&f.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(f.defined(e.y2))if(f.number(e.y2)&&f.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(f.defined(e.y3))if(f.number(e.y3)&&f.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else this.options.sharpenSigma=-1;return this}function $k(e){if(!f.defined(e))this.options.medianSize=3;else if(f.integer(e)&&f.inRange(e,1,1e3))this.options.medianSize=e;else throw f.invalidParameterError("size","integer between 1 and 1000",e);return this}function Kk(e){let t;if(f.number(e))t=e;else if(f.plainObject(e)){if(!f.number(e.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(f.string(j3[e.precision]))this.options.precision=j3[e.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(f.number(e.minAmplitude)&&f.inRange(e.minAmplitude,.001,1))this.options.minAmpl=e.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!f.defined(e))this.options.blurSigma=-1;else if(f.bool(e))this.options.blurSigma=e?-1:0;else if(f.number(t)&&f.inRange(t,.3,1e3))this.options.blurSigma=t;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function Xk(e){if(!f.defined(e))this.options.dilateWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.dilateWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function Yk(e){if(!f.defined(e))this.options.erodeWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.erodeWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function Zk(e){return this.options.flatten=f.bool(e)?e:!0,f.object(e)&&this._setBackgroundColourOption("flattenBackground",e.background),this}function Jk(){return this.options.unflatten=!0,this}function Qk(e,t){if(!f.defined(e))this.options.gamma=2.2;else if(f.number(e)&&f.inRange(e,1,3))this.options.gamma=e;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!f.defined(t))this.options.gammaOut=this.options.gamma;else if(f.number(t)&&f.inRange(t,1,3))this.options.gammaOut=t;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function eG(e){if(this.options.negate=f.bool(e)?e:!0,f.plainObject(e)&&"alpha"in e)if(f.bool(e.alpha))this.options.negateAlpha=e.alpha;else throw f.invalidParameterError("alpha","should be boolean value",e.alpha);return this}function tG(e){if(f.plainObject(e)){if(f.defined(e.lower))if(f.number(e.lower)&&f.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw f.invalidParameterError("lower","number between 0 and 99",e.lower);if(f.defined(e.upper))if(f.number(e.upper)&&f.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw f.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw f.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function rG(e){return this.normalise(e)}function nG(e){if(f.plainObject(e)){if(f.integer(e.width)&&f.inRange(e.width,1,65536))this.options.claheWidth=e.width;else throw f.invalidParameterError("width","integer between 1 and 65536",e.width);if(f.integer(e.height)&&f.inRange(e.height,1,65536))this.options.claheHeight=e.height;else throw f.invalidParameterError("height","integer between 1 and 65536",e.height);if(f.defined(e.maxSlope))if(f.integer(e.maxSlope)&&f.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw f.invalidParameterError("options","plain object",e);return this}function iG(e){if(!f.object(e)||!Array.isArray(e.kernel)||!f.integer(e.width)||!f.integer(e.height)||!f.inRange(e.width,3,1001)||!f.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length||!e.kernel.every(f.number))throw new Error("Invalid convolution kernel");return f.integer(e.scale)||(e.scale=e.kernel.reduce((t,r)=>t+r,0)),e.scale<1&&(e.scale=1),f.integer(e.offset)||(e.offset=0),this.options.convKernel=e,this}function oG(e,t){if(!f.defined(e))this.options.threshold=128;else if(f.bool(e))this.options.threshold=e?128:0;else if(f.integer(e)&&f.inRange(e,0,255))this.options.threshold=e;else throw f.invalidParameterError("threshold","integer between 0 and 255",e);return!f.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function sG(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw f.invalidParameterError("operator","one of: and, or, eor",t);return this}function aG(e,t){if(!f.defined(e)&&f.number(t)?e=1:f.number(e)&&!f.defined(t)&&(t=0),!f.defined(e))this.options.linearA=[];else if(f.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearA=e;else throw f.invalidParameterError("a","number or array of numbers",e);if(!f.defined(t))this.options.linearB=[];else if(f.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearB=t;else throw f.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function cG(e){if(!Array.isArray(e))throw f.invalidParameterError("inputMatrix","array",e);let t=e.length;if(t!==3&&t!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!e.every(n=>Array.isArray(n)&&n.length===t))throw f.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,e);let r=e.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function lG(e){if(!f.plainObject(e))throw f.invalidParameterError("options","plain object",e);if("brightness"in e)if(f.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw f.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(f.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw f.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(f.integer(e.hue))this.options.hue=e.hue%360;else throw f.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(f.number(e.lightness))this.options.lightness=e.lightness;else throw f.invalidParameterError("lightness","number",e.lightness);return this}var j3,z3,q3=p(()=>{Ji();j3={integer:"integer",float:"float",approximate:"approximate"};z3=e=>{Object.assign(e.prototype,{autoOrient:zk,rotate:jk,flip:qk,flop:Vk,affine:Wk,sharpen:Hk,erode:Yk,dilate:Xk,median:$k,blur:Kk,flatten:Zk,unflatten:Jk,gamma:Qk,negate:eG,normalise:tG,normalize:rG,clahe:nG,convolve:iG,threshold:oG,boolean:sG,linear:aG,recomb:cG,modulate:lG})}});var X3=ae((zZ,K3)=>{var _g=Object.defineProperty,uG=Object.getOwnPropertyDescriptor,fG=Object.getOwnPropertyNames,hG=Object.prototype.hasOwnProperty,dG=(e,t)=>{for(var r in t)_g(e,r,{get:t[r],enumerable:!0})},mG=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fG(t))!hG.call(e,i)&&i!==r&&_g(e,i,{get:()=>t[i],enumerable:!(n=uG(t,i))||n.enumerable});return e},pG=e=>mG(_g({},"__esModule",{value:!0}),e),V3={};dG(V3,{default:()=>PG});K3.exports=pG(V3);var yg={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in yg)Object.freeze(yg[e]);var io=Object.freeze(yg),W3=Object.create(null);for(let e in io)Object.hasOwn(io,e)&&(W3[io[e]]=e);var gn={to:{},get:{}};gn.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=gn.get.hsl(e),n="hsl";break}case"hwb":{r=gn.get.hwb(e),n="hwb";break}default:{r=gn.get.rgb(e),n="rgb";break}}return r?{model:n,value:r}:null};gn.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,n=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,o=/^(\w+)$/,s=[0,0,0,1],a,c,l;if(a=e.match(r)){for(l=a[2],a=a[1],c=0;c<3;c++){let u=c*2;s[c]=Number.parseInt(a.slice(u,u+2),16)}l&&(s[3]=Number.parseInt(l,16)/255)}else if(a=e.match(t)){for(a=a[1],l=a[3],c=0;c<3;c++)s[c]=Number.parseInt(a[c]+a[c],16);l&&(s[3]=Number.parseInt(l+l,16)/255)}else if(a=e.match(n)){for(c=0;c<3;c++)s[c]=Number.parseFloat(a[c+1]);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else if(a=e.match(i)){for(c=0;c<3;c++)s[c]=Math.round(Number.parseFloat(a[c+1])*2.55);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else return(a=e.toLowerCase().match(o))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(io,a[1])?(s=io[a[1]].slice(),s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=Is(s[c],0,255);return s[3]=Is(s[3],0,1),s};gn.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=Is(Number.parseFloat(r[2]),0,100),s=Is(Number.parseFloat(r[3]),0,100),a=Is(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};gn.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,o=Is(Number.parseFloat(r[2]),0,100),s=Is(Number.parseFloat(r[3]),0,100),a=Is(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};gn.to.hex=function(...e){return"#"+Dd(e[0])+Dd(e[1])+Dd(e[2])+(e[3]<1?Dd(Math.round(e[3]*255)):"")};gn.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};gn.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"};gn.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};gn.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};gn.to.keyword=function(...e){return W3[e.slice(0,3)]};function Is(e,t,r){return Math.min(Math.max(t,e),r)}function Dd(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var vl=gn,H3={};for(let e of Object.keys(io))H3[io[e]]=e;var X={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},ec=X,Do=(6/29)**3;function Tl(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function Al(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(X)){if(!("channels"in X[e]))throw new Error("missing channels property: "+e);if(!("labels"in X[e]))throw new Error("missing channel labels property: "+e);if(X[e].labels.length!==X[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=X[e];delete X[e].channels,delete X[e].labels,Object.defineProperty(X[e],"channels",{value:t}),Object.defineProperty(X[e],"labels",{value:r})}X.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=o-i,a,c;switch(o){case i:{a=0;break}case t:{a=(r-n)/s;break}case r:{a=2+(n-t)/s;break}case n:{a=4+(t-r)/s;break}}a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+o)/2;return o===i?c=0:l<=.5?c=s/(o+i):c=s/(2-o-i),[a,c*100,l*100]};X.rgb.hsv=function(e){let t,r,n,i,o,s=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(s,a,c),u=l-Math.min(s,a,c),h=function(d){return(l-d)/6/u+1/2};if(u===0)i=0,o=0;else{switch(o=u/l,t=h(s),r=h(a),n=h(c),l){case s:{i=n-r;break}case a:{i=1/3+t-n;break}case c:{i=2/3+r-t;break}}i<0?i+=1:i>1&&(i-=1)}return[i*360,o*100,l*100]};X.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],i=X.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[i,o*100,n*100]};X.rgb.oklab=function(e){let t=Al(e[0]/255),r=Al(e[1]/255),n=Al(e[2]/255),i=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),o=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),s=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n),a=.2104542553*i+.793617785*o-.0040720468*s,c=1.9779984951*i-2.428592205*o+.4505937099*s,l=.0259040371*i+.7827717662*o-.808675766*s;return[a*100,c*100,l*100]};X.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n),o=(1-t-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function gG(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}X.rgb.keyword=function(e){let t=H3[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(io)){let o=io[i],s=gG(e,o);s<r&&(r=s,n=i)}return n};X.keyword.rgb=function(e){return[...io[e]]};X.rgb.xyz=function(e){let t=Al(e[0]/255),r=Al(e[1]/255),n=Al(e[2]/255),i=t*.4124564+r*.3575761+n*.1804375,o=t*.2126729+r*.7151522+n*.072175,s=t*.0193339+r*.119192+n*.9503041;return[i*100,o*100,s*100]};X.rgb.lab=function(e){let t=X.rgb.xyz(e),r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>Do?r**(1/3):7.787*r+16/116,n=n>Do?n**(1/3):7.787*n+16/116,i=i>Do?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};X.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i,o;if(r===0)return o=n*255,[o,o,o];let s=n<.5?n*(1+r):n+r-n*r,a=2*n-s,c=[0,0,0];for(let l=0;l<3;l++)i=t+1/3*-(l-1),i<0&&i++,i>1&&i--,6*i<1?o=a+(s-a)*6*i:2*i<1?o=s:3*i<2?o=a+(s-a)*(2/3-i)*6:o=a,c[l]=o*255;return c};X.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[t,a*100,s*100]};X.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),s=255*n*(1-r),a=255*n*(1-r*o),c=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,c,s];case 1:return[a,n,s];case 2:return[s,n,c];case 3:return[s,a,n];case 4:return[c,s,n];case 5:return[n,s,a]}};X.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[t,o*100,s*100]};X.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*t),a=1-n;o=6*t-s,(s&1)!==0&&(o=1-o);let c=r+o*(a-r),l,u,h;switch(s){default:case 6:case 0:{l=a,u=c,h=r;break}case 1:{l=c,u=a,h=r;break}case 2:{l=r,u=a,h=c;break}case 3:{l=r,u=c,h=a;break}case 4:{l=c,u=r,h=a;break}case 5:{l=a,u=r,h=c;break}}return[l*255,u*255,h*255]};X.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100,o=1-Math.min(1,t*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[o*255,s*255,a*255]};X.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i,o,s;return i=t*3.2404542+r*-1.5371385+n*-.4985314,o=t*-.969266+r*1.8760108+n*.041556,s=t*.0556434+r*-.2040259+n*1.0572252,i=Tl(i),o=Tl(o),s=Tl(s),[i*255,o*255,s*255]};X.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>Do?t**(1/3):7.787*t+16/116,r=r>Do?r**(1/3):7.787*r+16/116,n=n>Do?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(t-r),s=200*(r-n);return[i,o,s]};X.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=Math.cbrt(.8189330101*t+.3618667424*r-.1288597137*n),o=Math.cbrt(.0329845436*t+.9293118715*r+.0361456387*n),s=Math.cbrt(.0482003018*t+.2643662691*r+.633851707*n),a=.2104542553*i+.793617785*o-.0040720468*s,c=1.9779984951*i-2.428592205*o+.4505937099*s,l=.0259040371*i+.7827717662*o-.808675766*s;return[a*100,c*100,l*100]};X.oklab.oklch=function(e){return X.lab.lch(e)};X.oklab.xyz=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(.999999998*t+.396337792*r+.215803758*n)**3,o=(1.000000008*t-.105561342*r-.063854175*n)**3,s=(1.000000055*t-.089484182*r-1.291485538*n)**3,a=1.227013851*i-.55779998*o+.281256149*s,c=-.040580178*i+1.11225687*o-.071676679*s,l=-.076381285*i-.421481978*o+1.58616322*s;return[a*100,c*100,l*100]};X.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(t+.3963377774*r+.2158037573*n)**3,o=(t-.1055613458*r-.0638541728*n)**3,s=(t-.0894841775*r-1.291485548*n)**3,a=Tl(4.0767416621*i-3.3077115913*o+.2309699292*s),c=Tl(-1.2684380046*i+2.6097574011*o-.3413193965*s),l=Tl(-.0041960863*i-.7034186147*o+1.707614701*s);return[a*255,c*255,l*255]};X.oklch.oklab=function(e){return X.lch.lab(e)};X.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],i,o,s;o=(t+16)/116,i=r/500+o,s=o-n/200;let a=o**3,c=i**3,l=s**3;return o=a>Do?a:(o-16/116)/7.787,i=c>Do?c:(i-16/116)/7.787,s=l>Do?l:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};X.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[t,s,i]};X.lch.lab=function(e){let t=e[0],r=e[1],i=e[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[t,o,s]};X.rgb.ansi16=function(e,t=null){let[r,n,i]=e,o=t===null?X.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};X.hsv.ansi16=function(e){return X.rgb.ansi16(X.hsv.rgb(e),e[2])};X.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t>>4===r>>4&&r>>4===n>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};X.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(Math.trunc(e>50)+1)*.5,n=(t&1)*r*255,i=(t>>1&1)*r*255,o=(t>>2&1)*r*255;return[n,i,o]};X.ansi256.rgb=function(e){if(e=e[0],e>=232){let o=(e-232)*10+8;return[o,o,o]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[r,n,i]};X.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};X.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=[...r].map(a=>a+a).join(""));let n=Number.parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};X.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),s=i-o,a,c=s<1?o/(1-s):0;return s<=0?a=0:i===t?a=(r-n)/s%6:i===r?a=2+(n-t)/s:a=4+(t-r)/s,a/=6,a%=1,[a*360,s*100,c*100]};X.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],n*100,i*100]};X.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],n*100,i*100]};X.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=t%1*6,s=o%1,a=1-s,c=0;switch(Math.floor(o)){case 0:{i[0]=1,i[1]=s,i[2]=0;break}case 1:{i[0]=a,i[1]=1,i[2]=0;break}case 2:{i[0]=0,i[1]=1,i[2]=s;break}case 3:{i[0]=0,i[1]=a,i[2]=1;break}case 4:{i[0]=s,i[1]=0,i[2]=1;break}default:i[0]=1,i[1]=0,i[2]=a}return c=(1-r)*n,[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};X.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),i=0;return n>0&&(i=t/n),[e[0],i*100,n*100]};X.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],i*100,n*100]};X.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};X.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,i=n-t,o=0;return i<1&&(o=(n-i)/(1-i)),[e[0],i*100,o*100]};X.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};X.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};X.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};X.gray.hsl=function(e){return[0,0,e[0]]};X.gray.hsv=X.gray.hsl;X.gray.hwb=function(e){return[0,100,e[0]]};X.gray.cmyk=function(e){return[0,0,0,e[0]]};X.gray.lab=function(e){return[e[0],0,0]};X.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n};X.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function yG(){let e={},t=Object.keys(ec);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function bG(e){let t=yG(),r=[e];for(t[e].distance=0;r.length>0;){let n=r.pop(),i=Object.keys(ec[n]);for(let{length:o}=i,s=0;s<o;s++){let a=i[s],c=t[a];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(a))}}return t}function wG(e,t){return function(r){return t(e(r))}}function xG(e,t){let r=[t[e].parent,e],n=ec[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=wG(ec[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}function _G(e){let t=bG(e),r={},n=Object.keys(t);for(let{length:i}=n,o=0;o<i;o++){let s=n[o];t[s].parent!==null&&(r[s]=xG(s,t))}return r}var SG=_G,El={},MG=Object.keys(ec);function vG(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function EG(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=e(r);if(typeof i=="object")for(let{length:o}=i,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}for(let e of MG){El[e]={},Object.defineProperty(El[e],"channels",{value:ec[e].channels}),Object.defineProperty(El[e],"labels",{value:ec[e].labels});let t=SG(e),r=Object.keys(t);for(let n of r){let i=t[n];El[e][n]=EG(i),El[e][n].raw=vG(i)}}var Dn=El,$3=["keyword","gray","hex"],bg={};for(let e of Object.keys(Dn))bg[[...Dn[e].labels].sort().join("")]=e;var wg={};function br(e,t){if(!(this instanceof br))return new br(e,t);if(t&&t in $3&&(t=null),t&&!(t in Dn))throw new Error("Unknown model: "+t);let r,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof br)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){let i=vl.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Dn[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Dn[this.model].channels;let i=Array.prototype.slice.call(e,0,n);this.color=xg(i,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(e);"alpha"in e&&(i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);let o=i.sort().join("");if(!(o in bg))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=bg[o];let{labels:s}=Dn[this.model],a=[];for(r=0;r<s.length;r++)a.push(e[s[r]]);this.color=xg(a)}if(wg[this.model])for(n=Dn[this.model].channels,r=0;r<n;r++){let i=wg[this.model][r];i&&(this.color[r]=i(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}br.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in vl.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return vl.to[t.model](...r)},percentString(e){let t=this.rgb().round(typeof e=="number"?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return vl.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Dn[this.model],{labels:r}=Dn[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new br([...this.color.map(AG(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new br([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:qt("rgb",0,lr(255)),green:qt("rgb",1,lr(255)),blue:qt("rgb",2,lr(255)),hue:qt(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:qt("hsl",1,lr(100)),lightness:qt("hsl",2,lr(100)),saturationv:qt("hsv",1,lr(100)),value:qt("hsv",2,lr(100)),chroma:qt("hcg",1,lr(100)),gray:qt("hcg",2,lr(100)),white:qt("hwb",1,lr(100)),wblack:qt("hwb",2,lr(100)),cyan:qt("cmyk",0,lr(100)),magenta:qt("cmyk",1,lr(100)),yellow:qt("cmyk",2,lr(100)),black:qt("cmyk",3,lr(100)),x:qt("xyz",0,lr(95.047)),y:qt("xyz",1,lr(100)),z:qt("xyz",2,lr(108.833)),l:qt("lab",0,lr(100)),a:qt("lab",1),b:qt("lab",2),keyword(e){return e!==void 0?new br(e):Dn[this.model].keyword(this.color)},hex(e){return e!==void 0?new br(e):vl.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new br(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),vl.to.hex(...t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[r,n]of e.entries()){let i=n/255;t[r]=i<=.04045?i/12.92:((i+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return br.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let r=e.rgb(),n=this.rgb(),i=t===void 0?.5:t,o=2*i-1,s=r.alpha()-n.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,c=1-a;return br.rgb(a*r.red()+c*n.red(),a*r.green()+c*n.green(),a*r.blue()+c*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(let e of Object.keys(Dn)){if($3.includes(e))continue;let{channels:t}=Dn[e];br.prototype[e]=function(...r){return this.model===e?new br(this):r.length>0?new br(r,e):new br([...IG(Dn[this.model][e].raw(this.color)),this.valpha],e)},br[e]=function(...r){let n=r[0];return typeof n=="number"&&(n=xg(r,t)),new br(n,e)}}function TG(e,t){return Number(e.toFixed(t))}function AG(e){return function(t){return TG(t,e)}}function qt(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(wg[n]||=[])[t]=r;return e=e[0],function(n){let i;return n!==void 0?(r&&(n=r(n)),i=this[e](),i.color[t]=n,i):(i=this[e]().color[t],r&&(i=r(i)),i)}}function lr(e){return function(t){return Math.max(0,Math.min(e,t))}}function IG(e){return Array.isArray(e)?e:[e]}function xg(e,t){for(let r=0;r<t;r++)typeof e[r]!="number"&&(e[r]=0);return e}var PG=br});var Z3=ae((qZ,Y3)=>{Y3.exports=X3().default});function RG(e){return this._setBackgroundColourOption("tint",e),this}function LG(e){return this.options.greyscale=f.bool(e)?e:!0,this}function OG(e){return this.greyscale(e)}function CG(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function BG(e){return this.pipelineColourspace(e)}function DG(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function NG(e){return this.toColourspace(e)}function ev(e){if(f.object(e)||f.string(e)&&e.length>=3&&e.length<=200){let t=(0,Q3.default)(e),r=t.red(),n=t.green(),i=t.blue(),o=Math.round(t.alpha()*255);for(let[s,a]of[["red",r],["green",n],["blue",i],["alpha",o]])if(!f.number(a))throw f.invalidParameterError(`background.${s}`,"number",a);return[r,n,i,o]}else throw f.invalidParameterError("background","object or string",e)}function FG(e,t){f.defined(t)&&(this.options[e]=ev(t))}var Q3,J3,tv,rv=p(()=>{Q3=me(Z3(),1);Ji();J3={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};tv=e=>{Object.assign(e.prototype,{tint:RG,greyscale:LG,grayscale:OG,pipelineColourspace:CG,pipelineColorspace:BG,toColourspace:DG,toColorspace:NG,_getBackgroundColourOption:ev,_setBackgroundColourOption:FG}),e.colourspace=J3,e.colorspace=J3}});function GG(){return this.options.removeAlpha=!0,this}function UG(e){if(f.defined(e))if(f.number(e)&&f.inRange(e,0,1))this.options.ensureAlpha=e;else throw f.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function jG(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e)&&(e=t[e]),f.integer(e)&&f.inRange(e,0,4))this.options.extractChannel=e;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function zG(e,t){return Array.isArray(e)?e.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(e,t)),this}function qG(e){if(f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw f.invalidParameterError("boolOp","one of: and, or, eor",e);return this}var kG,nv,iv=p(()=>{Ji();kG={and:"and",or:"or",eor:"eor"};nv=e=>{Object.assign(e.prototype,{removeAlpha:GG,ensureAlpha:UG,extractChannel:jG,joinChannel:zG,bandbool:qG}),e.bool=kG}});function WG(e,t){let r;if(f.string(e)?f.string(this.options.input.file)&&Nd.default.resolve(this.options.input.file)===Nd.default.resolve(e)?r=new Error("Cannot use same file for input and output"):VG.test(Nd.default.extname(e))&&!this.constructor.format.jp2.output.file&&(r=sv()):r=new Error("Missing output file path"),r)if(f.fn(t))t(r);else return Promise.reject(r);else{this.options.fileOut=e;let n=Error();return this._pipeline(t,n)}return this}function HG(e,t){f.object(e)?this._setBooleanOption("resolveWithObject",e.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let r=Error();return this._pipeline(f.fn(e)?e:t,r)}function $G(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function KG(e){if(f.number(e)&&e>0)this.options.withMetadataDensity=e;else throw f.invalidParameterError("density","positive number",e);return this.keepExif()}function XG(){return this.options.keepMetadata|=1,this}function YG(e){if(f.object(e))for(let[t,r]of Object.entries(e))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${t.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${t}.${n}`,"string",i);else throw f.invalidParameterError(t,"object",r);else throw f.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function ZG(e){return this.withExif(e),this.options.withExifMerge=!0,this}function JG(){return this.options.keepMetadata|=8,this}function QG(e,t){if(f.string(e))this.options.withIccProfile=e;else throw f.invalidParameterError("icc","string",e);if(this.keepIccProfile(),f.object(t)&&f.defined(t.attach))if(f.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw f.invalidParameterError("attach","boolean",t.attach);return this}function eU(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function tU(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function rU(){return this.options.keepMetadata|=2,this}function nU(e){if(f.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",e);return this}function iU(){return this.options.keepMetadata|=31,this}function oU(e){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(e)){if(f.defined(e.orientation))if(f.integer(e.orientation)&&f.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(f.defined(e.density))if(f.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw f.invalidParameterError("density","positive number",e.density);f.defined(e.icc)&&this.withIccProfile(e.icc),f.defined(e.exif)&&this.withExifMerge(e.exif)}return this}function sU(e,t){let r=ov.get((f.object(e)&&f.string(e.id)?e.id:e).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...ov.keys()].join(", ")}`,e);return this[r](t)}function aU(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.progressive)&&this._setBooleanOption("jpegProgressive",e.progressive),f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=f.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(f.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),f.defined(e.mozjpeg))if(f.bool(e.mozjpeg))e.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw f.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=f.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;f.defined(r)&&this._setBooleanOption("jpegTrellisQuantisation",r),f.defined(e.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let n=f.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;f.defined(n)&&(this._setBooleanOption("jpegOptimiseScans",n),n&&(this.options.jpegProgressive=!0));let i=f.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(f.defined(i))if(f.integer(i)&&f.inRange(i,0,8))this.options.jpegQuantisationTable=i;else throw f.invalidParameterError("quantisationTable","integer between 0 and 8",i)}return this._updateFormatOut("jpeg",e)}function cU(e){if(f.object(e)){if(f.defined(e.progressive)&&this._setBooleanOption("pngProgressive",e.progressive),f.defined(e.compressionLevel))if(f.integer(e.compressionLevel)&&f.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);f.defined(e.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.pngBitdepth=av(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.palette)?this._setBooleanOption("pngPalette",e.palette):[e.quality,e.effort,e.colours,e.colors,e.dither].some(f.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",e.quality);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function lU(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.alphaQuality))if(f.integer(e.alphaQuality)&&f.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(f.defined(e.lossless)&&this._setBooleanOption("webpLossless",e.lossless),f.defined(e.nearLossless)&&this._setBooleanOption("webpNearLossless",e.nearLossless),f.defined(e.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",e.smartSubsample),f.defined(e.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",e.smartDeblock),f.defined(e.preset))if(f.string(e.preset)&&f.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",e.effort);f.defined(e.minSize)&&this._setBooleanOption("webpMinSize",e.minSize),f.defined(e.mixed)&&this._setBooleanOption("webpMixed",e.mixed),f.defined(e.exact)&&this._setBooleanOption("webpExact",e.exact)}return Sg(e,this.options),this._updateFormatOut("webp",e)}function uU(e){if(f.object(e)){f.defined(e.reuse)&&this._setBooleanOption("gifReuse",e.reuse),f.defined(e.progressive)&&this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.gifBitdepth=av(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(f.defined(e.interFrameMaxError))if(f.number(e.interFrameMaxError)&&f.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(f.defined(e.interPaletteMaxError))if(f.number(e.interPaletteMaxError)&&f.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(f.defined(e.keepDuplicateFrames))if(f.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return Sg(e,this.options),this._updateFormatOut("gif",e)}function fU(e){if(!this.constructor.format.jp2.output.buffer)throw sv();if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function Sg(e,t){if(f.object(e)&&f.defined(e.loop))if(f.integer(e.loop)&&f.inRange(e.loop,0,65535))t.loop=e.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(f.object(e)&&f.defined(e.delay))if(f.integer(e.delay)&&f.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&f.inRange(e.delay.length,1,1e6)&&e.delay.every(f.integer)&&e.delay.every(r=>f.inRange(r,0,65535)))t.delay=e.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function hU(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[1,2,4]))this.options.tiffBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",e.bitdepth);if(f.defined(e.tile)&&this._setBooleanOption("tiffTile",e.tile),f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.tiffTileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.tiffTileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.miniswhite)&&this._setBooleanOption("tiffMiniswhite",e.miniswhite),f.defined(e.pyramid)&&this._setBooleanOption("tiffPyramid",e.pyramid),f.defined(e.xres))if(f.number(e.xres)&&f.inRange(e.xres,.001,1e6))this.options.tiffXres=e.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",e.xres);if(f.defined(e.yres))if(f.number(e.yres)&&f.inRange(e.yres,.001,1e6))this.options.tiffYres=e.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",e.yres);if(f.defined(e.compression))if(f.string(e.compression)&&f.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(f.defined(e.bigtiff)&&this._setBooleanOption("tiffBigtiff",e.bigtiff),f.defined(e.predictor))if(f.string(e.predictor)&&f.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(f.defined(e.resolutionUnit))if(f.string(e.resolutionUnit)&&f.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function dU(e){return this.heif({...e,compression:"av1"})}function mU(e){if(f.object(e)){if(f.string(e.compression)&&f.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",e.compression);if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.heifLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",e.effort);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[8,10,12]))this.options.heifBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth);if(f.defined(e.tune))if(f.string(e.tune)&&f.inArray(e.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&e.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=e.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",e.tune)}else throw f.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function pU(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?.1+(100-e.quality)*.09:53/3e3*e.quality*e.quality-23/20*e.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(f.defined(e.distance))if(f.number(e.distance)&&f.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(f.defined(e.decodingTier))if(f.integer(e.decodingTier)&&f.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",e.effort)}return Sg(e,this.options),this._updateFormatOut("jxl",e)}function gU(e){if(f.object(e)&&f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth);return this._updateFormatOut("raw")}function yU(e){if(f.object(e)){if(f.defined(e.size))if(f.integer(e.size)&&f.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw f.invalidParameterError("size","integer between 1 and 8192",e.size);if(f.defined(e.overlap))if(f.integer(e.overlap)&&f.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(f.defined(e.container))if(f.string(e.container)&&f.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw f.invalidParameterError("container","one of: fs, zip",e.container);if(f.defined(e.layout))if(f.string(e.layout)&&f.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(f.defined(e.angle))if(f.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(f.defined(e.skipBlanks))if(f.integer(e.skipBlanks)&&f.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else f.defined(e.layout)&&e.layout==="google"&&(this.options.tileSkipBlanks=5);let t=f.bool(e.center)?e.center:e.centre;if(f.defined(t)&&this._setBooleanOption("tileCentre",t),f.defined(e.id))if(f.string(e.id))this.options.tileId=e.id;else throw f.invalidParameterError("id","string",e.id);if(f.defined(e.basename))if(f.string(e.basename))this.options.tileBasename=e.basename;else throw f.invalidParameterError("basename","string",e.basename)}if(f.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw f.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function bU(e){if(!f.plainObject(e))throw f.invalidParameterError("options","object",e);if(f.integer(e.seconds)&&f.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function wU(e,t){return f.object(t)&&t.force===!1||(this.options.formatOut=e),this}function xU(e,t){if(f.bool(t))this.options[e]=t;else throw f.invalidParameterError(e,"boolean",t)}function _U(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function SU(e,t){return typeof e=="function"?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)})}):it.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)}),this):this.options.streamOut?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,t)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))})}):it.pipeline(this.options,(r,n,i)=>{r?this.emit("error",f.nativeError(r,t)):(this.emit("info",i),this.push(n)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),it.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}):new Promise((r,n)=>{it.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}var Nd,ov,VG,sv,av,cv,lv=p(()=>{Nd=me(require("node:path"),1);Ji();bf();ov=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),VG=/\.(jp[2x]|j2[kc])$/i,sv=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),av=e=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1);cv=e=>{Object.assign(e.prototype,{toFile:WG,toBuffer:HG,toUint8Array:$G,withDensity:KG,keepExif:XG,withExif:YG,withExifMerge:ZG,keepIccProfile:JG,withIccProfile:QG,keepGainMap:eU,withGainMap:tU,keepXmp:rU,withXmp:nU,keepMetadata:iU,withMetadata:oU,toFormat:sU,jpeg:aU,jp2:fU,png:cU,webp:lU,tiff:hU,avif:dU,heif:mU,jxl:pU,gif:uU,raw:gU,tile:yU,timeout:bU,_updateFormatOut:wU,_setBooleanOption:xU,_read:_U,_pipeline:SU})}});function mv(e){if(f.bool(e))return e?it.cache(50,20,100):it.cache(0,0,0);if(f.object(e)){for(let t of["memory","files","items"]){let r=e[t];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(t,"a positive integer",r)}return it.cache(e.memory,e.files,e.items)}else return it.cache()}function vU(e){return it.concurrency(f.integer(e)?e:null)}function TU(){return it.counters()}function AU(e){return it.simd(f.bool(e)?e:null)}function IU(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))it.block(e.operation,!0);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}function PU(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))it.block(e.operation,!1);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}var fv,hv,dv,wf,RU,Mg,uv,vg,Ps,MU,Il,EU,pv,gv=p(()=>{fv=me(require("node:events"),1),hv=require("node:module"),dv=require("node:os"),wf=me(yd(),1);Ji();dg();bf();Rd();RU={};Mg=(0,hv.createRequire)(RU.url),uv=Ld.runtimePlatformArch(),vg=it.libvipsVersion(),Ps=it.format();Ps.heif.output.alias=["avif","heic"];Ps.jpeg.output.alias=["jpe","jpg"];Ps.tiff.output.alias=["tif"];Ps.jp2.output.alias=["j2c","j2k","jp2","jpx"];MU={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},Il={vips:vg.semver};if(!vg.isGlobal)if(vg.isWasm)try{Il=Mg("@img/sharp-wasm32/versions")}catch{}else try{Il=Mg(`@img/sharp-${uv}/versions`)}catch{try{Il=Mg(`@img/sharp-libvips-${uv}/versions`)}catch{}}Il.sharp=Co.version;Il.heif&&Ps.heif&&(Ps.heif.input.fileSuffix=[".avif"],Ps.heif.output.alias=["avif"]);mv(!0);!process.env.MALLOC_ARENA_MAX&&wf.default.familySync()===wf.default.GLIBC&&!it._isUsingJemalloc()?it.concurrency(1):wf.default.familySync()===wf.default.MUSL&&it.concurrency()===1024&&it.concurrency((0,dv.availableParallelism)());EU=new fv.default.EventEmitter;pv=e=>{e.cache=mv,e.concurrency=vU,e.counters=TU,e.simd=AU,e.format=Ps,e.interpolators=MU,e.versions=Il,e.queue=EU,e.block=IU,e.unblock=PU}});var yv={};Qt(yv,{default:()=>LU});var LU,bv=p(()=>{P3();O3();k3();U3();q3();rv();iv();lv();gv();L3(no);F3(no);G3(no);z3(no);tv(no);nv(no);cv(no);pv(no);LU=no});async function Rl(e,t,r,n){return n._parse(e,t,r,n)}var Lv=p(()=>{"use strict"});function Ll(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Ov=p(()=>{"use strict"});var oo,GU,UU,jU,zU,Zd,Cv,qU,Bv=p(()=>{"use strict";oo={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},GU=oo.self||oo.window||oo.global||{},UU=oo.window||oo.self||oo.global||{},jU=oo.global||oo.self||oo.window||{},zU=oo.document||{},Zd=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),Cv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),qU=Cv&&parseFloat(Cv[1])||0});function Ol(e,t){return new Promise((r,n)=>{let i=!1;function o(a){i||(i=!0,n(a))}function s(a){if(!i){i=!0;try{r(t(a))}catch(c){n(c)}}}try{let a=e(s,o);a==null||a.then(s,o)}catch(a){o(a)}})}var Dv=p(()=>{"use strict"});function Bg(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Dg(e){var r,n;return((n=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:n[e])||null}var Ng=p(()=>{"use strict"});function VU(){let e="5.0.0-beta.6";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=e,e}var Nv,Fv=p(()=>{"use strict";Nv=VU()});function kv(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Gv=p(()=>{"use strict"});var so,fQ,hQ,dQ,mQ,Pi,rc,pQ,Uv,gQ,Fg=p(()=>{"use strict";so={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},fQ=so.self||so.window||so.global||{},hQ=so.window||so.self||so.global||{},dQ=so.global||so.self||so.window||{},mQ=so.document||{},Pi=typeof process!="object"||String(process)!=="[object process]"||process.browser,rc=typeof importScripts=="function",pQ=typeof window<"u"&&typeof window.orientation<"u",Uv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),gQ=Uv&&parseFloat(Uv[1])||0});var kg,jv,zv=p(()=>{kg=require("worker_threads"),jv=kg.parentPort});function nc(e,t=!0,r){let n=r||new Set,i=new Set;function o(s){if(!(!s||typeof s!="object"||i.has(s))){if(i.add(s),qv(s))n.add(s);else if(ArrayBuffer.isView(s))qv(s.buffer)&&n.add(s.buffer);else if(t&&typeof MessageChannel<"u"&&s instanceof MessageChannel)o(s.port1),o(s.port2);else if(t&&s instanceof Map)for(let[a,c]of s)o(a),o(c);else if(t&&s instanceof Set)for(let a of s)o(a);else if(t)for(let a of Object.keys(s))o(s[a])}}return o(e),r===void 0?Array.from(n):[]}function qv(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var Gg=p(()=>{});async function Cl(){return jv}function WU(e){if(!e||typeof e!="object")return null;let t="data"in e&&e.type==="message"?e.data:e;return t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")?t:null}var Jd,Vt,Ug=p(()=>{Gg();zv();Jd=new Map,Vt=class{static async inWorkerThread(){let t=globalThis.WorkerGlobalScope;return typeof t=="function"&&globalThis instanceof t||!!await Cl()}static set onmessage(t){async function r(n){let i=await Cl(),{type:o,payload:s}=i?n:n.data;t(o,s)}Cl().then(n=>{n?(n.on("message",i=>{r(i)}),n.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=r})}static async addEventListener(t){let r=Jd.get(t);r||(r=i=>{let o=WU(i);o&&t(o.type,o.payload)},Jd.set(t,r));let n=await Cl();n?n.on("message",r):globalThis.addEventListener("message",r)}static async removeEventListener(t){let r=Jd.get(t);if(Jd.delete(t),!r)return;let n=await Cl();n?n.off("message",r):globalThis.removeEventListener("message",r)}static async postMessage(t,r,n=!1){let i={source:"loaders.gl",type:t,payload:r},o=n?[]:nc(r),s=await Cl();s?s.postMessage(i,o):globalThis.postMessage(i,o)}}});var Bl,Vv=p(()=>{Bl=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(t){return this.enqueue(t)}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let r=this._settlers.shift();t instanceof Error?r.reject(t):r.resolve({value:t})}else this._values.push(t)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let t=this._values.shift();return t instanceof Error?Promise.reject(t):Promise.resolve({done:!1,value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((t,r)=>{this._settlers.push({resolve:t,reject:r})})}}});var Qd,Wv=p(()=>{Qd=class{constructor(t){if(typeof SharedArrayBuffer>"u"||!(t instanceof SharedArrayBuffer)||t.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=t,this.values=new Int32Array(t)}get snapshot(){return{cancelled:Atomics.load(this.values,0)!==0,completed:Atomics.load(this.values,1),total:Atomics.load(this.values,2),revision:Atomics.load(this.values,3)}}cancel(){Atomics.store(this.values,0,1),Atomics.add(this.values,3,1),Atomics.notify(this.values,0)}throwIfCancelled(){if(Atomics.load(this.values,0)!==0){let t=new Error("Shared worker task was cancelled");throw t.name="AbortError",t}}setProgress(t,r=-1){if(!Number.isInteger(t)||t<0||t>2147483647||!Number.isInteger(r)||r<-1||r>2147483647)throw new RangeError("Shared progress requires nonnegative int32 counts (or total -1)");Atomics.store(this.values,1,t),Atomics.store(this.values,2,r),Atomics.add(this.values,3,1)}}});function jg(e){if(e!==void 0&&e!=="copy"&&e!=="transfer")throw new Error("Invalid worker output ownership")}var Hv=p(()=>{});async function zg(e,t,r){if(!await Vt.inWorkerThread())return;let n={process:KU};Vt.onmessage=async(i,o)=>{var d,m,g,y,b;if(i==="cancel"){ko==null||ko.abort(),Fo==null||Fo.close(),ic==null||ic.close();return}let s=i==="process"||i==="process-in-batches"?new AbortController:void 0;s&&(ko=s);let a=performance.now(),c=i==="process"||i==="process-in-batches"?XU():void 0,l,u=()=>{s==null||s.signal.throwIfAborted(),l==null||l.throwIfCancelled()},h={...n,signal:s==null?void 0:s.signal,sharedState:l,throwIfAborted:u,reportProgress:w=>{!(s!=null&&s.signal.aborted)&&!(l!=null&&l.snapshot.cancelled)&&(c==null||c.report(w))}};try{switch(s&&((d=o.options)!=null&&d.sharedState)&&(l=new Qd(o.options.sharedState),h.sharedState=l),i){case"preload":await(r==null?void 0:r()),Vt.postMessage("done",{});break;case"process":if(u(),jg((m=o.options)==null?void 0:m.outputOwnership),!e)throw new Error("Worker does not support atomic processing");let w=await e(o.input,o.options||{},h,o.context||{});u(),c==null||c.finish(),await Vt.postMessage("done",{result:w,executionMs:performance.now()-a},((g=o.options)==null?void 0:g.outputOwnership)==="copy");break;case"process-in-batches":if(u(),jg((y=o.options)==null?void 0:y.outputOwnership),!t)throw new Error("Worker does not support batched processing");let _=new Bl,S=new Bl;Fo=_,ic=S;try{let M=t($U(_),o.options||{},h,o.context||{});for await(let v of M)u(),await Vt.postMessage("output-batch",{result:v},((b=o.options)==null?void 0:b.outputOwnership)==="copy"),await S.next();u(),c==null||c.finish(),await Vt.postMessage("done",{executionMs:performance.now()-a})}finally{Fo=null,ic=null}break;case"input-batch":if(!Fo)throw new Error("Worker has no active batched processing session");Fo.push(o.input);break;case"input-done":if(!Fo)throw new Error("Worker has no active batched processing session");Fo.close();break;case"output-ack":if(!ic)throw new Error("Worker has no active batched processing session");ic.push(void 0);break;default:}}catch(w){c==null||c.finish((s==null?void 0:s.signal.aborted)||(l==null?void 0:l.snapshot.cancelled));let _=w instanceof Error?w.message:"";await Vt.postMessage("error",{error:_,errorName:w instanceof Error?w.name:"Error"})}finally{s&&ko===s&&(ko=null)}},await Vt.postMessage("ready",{})}async function*$U(e){for(;;){await Vt.postMessage("input-request",{});let t=await e.next();if(t.done)return;yield t.value}}function KU(e,t={},r={}){let n=ko==null?void 0:ko.signal;return n==null||n.throwIfAborted(),new Promise((i,o)=>{let s=HU++,a=()=>{n==null||n.removeEventListener("abort",c),Vt.removeEventListener(l)},c=()=>{a(),o(n==null?void 0:n.reason)},l=(u,h)=>{h.id===s&&(u==="done"?(a(),i(h.result)):u==="error"&&(a(),o(h.error)))};Vt.addEventListener(l).then(async()=>{if(n!=null&&n.aborted){c();return}n==null||n.addEventListener("abort",c,{once:!0}),await Vt.postMessage("process",{id:s,input:e,options:t,context:r})}).catch(u=>{a(),o(u)})})}function XU(){let e,t=!1,r=!1,n=()=>{r=!1,e&&(Vt.postMessage("progress",{progress:e}),e=void 0)};return{report(i){t||(e&&e.phase!==i.phase&&n(),e={...i},r||(r=!0,setTimeout(n,0)))},finish(i=!1){i&&(e=void 0),n(),t=!0}}}var HU,ko,Fo,ic,$v=p(()=>{Wv();Vv();Ug();Hv();HU=0,ko=null,Fo=null,ic=null});var YU,qg,OQ,Kv=p(()=>{Ug();$v();Gg();YU={},qg=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",OQ=qg?`file://${qg.startsWith("/")?"":"/"}${encodeURI(qg).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:YU.url});function Wg(e,t){if(!e.preload)return Promise.resolve();let r=Vg.get(e);return r||(r=Promise.resolve().then(()=>e.preload()).then(()=>{ZU.add(e)}),Vg.set(e,r),r.catch(()=>Vg.delete(e))),JU(r,t)}function JU(e,t){return t?new Promise((r,n)=>{let i=()=>{t.removeEventListener("abort",i),n(t.reason)};t.addEventListener("abort",i,{once:!0}),t.aborted&&i(),e.then(o=>{t.removeEventListener("abort",i),r(o)},o=>{t.removeEventListener("abort",i),n(o)})}):e}var Vg,ZU,Xv=p(()=>{Vg=new WeakMap,ZU=new WeakSet});var Hg,em,Yv=p(()=>{Hg=class extends Error{},em=class{constructor(t){this.options=t,this.nextId=1,this.pending=new Map,this.incoming=new Map}request(t,r,n,i=[]){if(this.failure)return Promise.reject(this.failure.reason);if(n!=null&&n.aborted)return Promise.reject(n.reason);let o=this.nextId++;return new Promise((s,a)=>{let c=()=>{let l=this.pending.get(o);l&&(this.pending.delete(o),l.cleanup(),a(n==null?void 0:n.reason),this.send({source:"math.gl/tasks",kind:"cancel",id:o}))};this.pending.set(o,{resolve:s,reject:a,cleanup:()=>n==null?void 0:n.removeEventListener("abort",c)}),n==null||n.addEventListener("abort",c,{once:!0}),this.send({source:"math.gl/tasks",kind:"request",id:o,operation:t,value:r},i)})}emit(t,r,n=[]){if(this.failure)throw this.failure.reason;this.send({source:"math.gl/tasks",kind:"event",id:0,operation:t,value:r},n)}receive(t){var r,n,i,o,s,a,c,l;if(!(this.failure||(t==null?void 0:t.source)!=="math.gl/tasks")){if(t.kind==="failure"){let u=new Error(((r=t.error)==null?void 0:r.message)??"Task channel failed");this.close(u),(i=(n=this.options).onFailure)==null||i.call(n,u)}else if(t.kind==="result"||t.kind==="error"){let u=this.pending.get(t.id);if(!u)return;if(this.pending.delete(t.id),u.cleanup(),t.kind==="result")u.resolve(t.value);else{let h=new Hg(((o=t.error)==null?void 0:o.message)??"Task request failed");h.name=((s=t.error)==null?void 0:s.name)??"Error",u.reject(h)}}else if(t.kind==="cancel")(a=this.incoming.get(t.id))==null||a.abort(new DOMException("Task request cancelled","AbortError"));else if(t.kind==="event")try{(l=(c=this.options).handleEvent)==null||l.call(c,t.operation,t.value)}catch(u){this.fail(u)}else if(t.kind==="request"){if(this.incoming.has(t.id)){this.fail(new Error("Duplicate task request identifier"));return}let u=new AbortController;this.incoming.set(t.id,u),Promise.resolve().then(()=>(u.signal.throwIfAborted(),this.options.handleRequest(t.operation,t.value,u.signal))).then(h=>{var d,m;!u.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"result",id:t.id,value:h},(m=(d=this.options).getResultTransferList)==null?void 0:m.call(d,h,t.value))}).catch(h=>{!u.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"error",id:t.id,error:{name:h instanceof Error?h.name:"Error",message:h instanceof Error?h.message:String(h)}})}).finally(()=>this.incoming.delete(t.id))}}}close(t=new Error("Task channel closed")){if(!this.failure){this.failure={reason:t};for(let r of this.pending.values())r.cleanup(),r.reject(t);this.pending.clear();for(let r of this.incoming.values())r.abort(t);this.incoming.clear()}}send(t,r=[]){if(!this.failure)try{this.options.send(t,r)}catch(n){this.fail(n)}}fail(t){var r,n;if(!this.failure){this.close(t);try{this.options.send({source:"math.gl/tasks",kind:"failure",id:0,error:{name:t instanceof Error?t.name:"Error",message:t instanceof Error?t.message:String(t)}},[])}catch{}(n=(r=this.options).onFailure)==null||n.call(r,t)}}}});function Dl(e){if(!e||typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype)throw new TypeError("Task payloads must be plain objects with named fields")}function QU(e,t="copy"){if(Dl(e),!["copy","transfer","share"].includes(t))throw new TypeError("Invalid input ownership");let r=nc(e);if(t==="share"&&r.length)throw new TypeError("Share requires shared storage");return structuredClone(e,{transfer:t==="transfer"?r:[]})}function $g(e,t={}){let r=t.signal??new AbortController().signal;return{state:e,signal:r,requestHost:async(n,i,o)=>{if(r.throwIfAborted(),!t.requestHost)throw new Error("No host request handler configured");return t.requestHost(n,i,o)},emitHost:(n,i)=>{var o;r.throwIfAborted(),(o=t.emitHost)==null||o.call(t,n,i)},throwIfAborted:()=>{var n;r.throwIfAborted(),(n=t.throwIfAborted)==null||n.call(t)},reportProgress:n=>{var i;return(i=t.reportProgress)==null?void 0:i.call(t,{...n,phase:n.phase??"process",unit:n.unit??"items"})}}}async function Xg(e){if(!await Vt.inWorkerThread())throw new Error("initializeTaskWorker must run inside a worker");if(Zv)throw new Error("A task is already installed in this worker");Zv=!0;let t=new Kg(e),r,n=new em({getResultTransferList:(o,s)=>s.outputOwnership==="transfer"?nc(o):[],send:(o,s)=>{let a=structuredClone(o,{transfer:s});Vt.postMessage("task-channel",a).catch(c=>n.fail(c))},handleRequest:async(o,s,a)=>{var u;let c=s,l={signal:a,reportProgress:h=>n.emit("task:progress",{id:c.progressId,progress:h}),requestHost:(h,d,m={})=>{let g={operation:h,payload:QU(d,m.inputOwnership),outputOwnership:m.outputOwnership??"copy"};return n.request("task:host-request",g,a,nc(g))},emitHost:(h,d)=>n.emit("task:host-event",{operation:h,payload:d,id:c.progressId})};switch(o){case"initialize":return t.initialize(c.input,l);case"process":return t.process(c.input,c.options,l);case"stream-open":{if(r)throw new Error("A task stream is already open");async function*h(){for(;;){let d=await n.request("task:next-input",{outputOwnership:"transfer"},a);if(d.done)return;yield d.value}}return r=t.stream(h(),c.options,l)[Symbol.asyncIterator](),{}}case"stream-next":if(!r)throw new Error("No active task stream");return r.next();case"stream-close":try{await((u=r==null?void 0:r.return)==null?void 0:u.call(r))}finally{r=void 0}return{};case"destroy":return t.destroy();default:throw new Error("Unknown task channel operation")}}});await Vt.addEventListener((o,s)=>{o==="task-channel"&&n.receive(s)});let i={};return zg(async(o,s,a)=>{switch(o.operation){case"initialize":return t.initialize(o.input,a);case"destroy":return t.destroy();case"stream-options":return i=o.options,{};case"process":return t.process(o.input,o.options,a);default:throw new Error("Unknown task operation")}},async function*(o,s,a){async function*c(){for await(let l of o)Dl(l),yield l}try{yield*t.stream(c(),i,a)}finally{i={}}},()=>Wg(e))}var Kg,Zv,Jv=p(()=>{Kv();Xv();Yv();Kg=class{constructor(t){this.task=t,this.initialized=!1}async initialize(t,r={}){var n,i,o;if(this.initialized)throw new Error("Task is already initialized");return Dl(t),await Wg(this.task,r.signal),(n=r.signal)==null||n.throwIfAborted(),this.state=await((o=(i=this.task).initialize)==null?void 0:o.call(i,t,$g(void 0,r))),this.initialized=!0,{}}async destroy(){var t,r;if(this.initialized){this.initialized=!1;let n=this.state;this.state=void 0,this.task.initialize&&await((r=(t=this.task).destroy)==null?void 0:r.call(t,n))}return{}}async process(t,r,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.process)throw new Error("Task has no atomic processor");Dl(t);let i=await this.task.process(t,r,$g(this.state,n));return Dl(i),i}async*stream(t,r,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.processInBatches)throw new Error("Task has no streaming processor");for await(let i of this.task.processInBatches(t,r,$g(this.state,n)))Dl(i),yield i}};Zv=!1});var Qv=p(()=>{Jv()});var eE=p(()=>{Qv()});var tE={};Qt(tE,{BroadcastChannel:()=>Qe.BroadcastChannel,MessageChannel:()=>Qe.MessageChannel,MessagePort:()=>Qe.MessagePort,NodeWorker:()=>tj,SHARE_ENV:()=>Qe.SHARE_ENV,Worker:()=>Qe.Worker,getEnvironmentData:()=>Qe.getEnvironmentData,isInternalThread:()=>rj,isMainThread:()=>Qe.isMainThread,isMarkedAsUntransferable:()=>Qe.isMarkedAsUntransferable,locks:()=>ij,markAsUncloneable:()=>Qe.markAsUncloneable,markAsUntransferable:()=>Qe.markAsUntransferable,moveMessagePortToContext:()=>Qe.moveMessagePortToContext,parentPort:()=>ej,postMessageToThread:()=>Qe.postMessageToThread,receiveMessageOnPort:()=>Qe.receiveMessageOnPort,resourceLimits:()=>Qe.resourceLimits,setEnvironmentData:()=>Qe.setEnvironmentData,structuredClone:()=>oj,threadId:()=>Qe.threadId,threadName:()=>nj,workerData:()=>Qe.workerData});var Nn,Qe,ej,tj,rj,nj,ij,oj,rE=p(()=>{"use strict";Nn=me(require("worker_threads"),1),Qe=require("worker_threads"),ej=Nn==null?void 0:Nn.parentPort,tj=Nn.Worker,rj=Nn.isInternalThread,nj=Nn.threadName,ij=Nn.locks,oj=Nn.structuredClone});function nE(e){return{...e,phase:e.phase??"process",unit:e.unit??"items"}}async function iE(){var e;if(typeof self<"u"&&typeof document>"u"&&typeof self.postMessage=="function")return!0;if(typeof process<"u"&&((e=process.versions)!=null&&e.node)){let{isMainThread:t}=await Promise.resolve().then(()=>(rE(),tE));return!t}return!1}var oE,sE=p(()=>{"use strict";eE();oE=Xg});function Yg(e,t=!0,r){let n=r||new Set;if(e){if(aE(e))n.add(e);else if(aE(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let i in e)Yg(e[i],t,n)}}return r===void 0?Array.from(n):[]}function aE(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}var cE=p(()=>{"use strict"});async function Zg(e,t){await iE()&&await oE(sj(e,t))}function sj(e,t){return{id:"loaders.gl",initialize:r=>r,destroy:r=>{var n;return(n=r.port)==null?void 0:n.close()},process:async({value:r},n,i)=>{if(!e)throw new Error("Worker does not support atomic processing");return{value:await e(r,n,lE(i),i.state.context)}},...t?{processInBatches:async function*(r,n,i){async function*o(){for await(let s of r)yield s.value}for await(let s of t(o(),n,lE(i),i.state.context))yield{value:s}}}:{}}}function lE(e){let t=0,r=e.state.port;return{signal:e.signal,throwIfAborted:()=>e.throwIfAborted(),reportProgress:n=>e.reportProgress(nE(n)),process:r?(n,i={},o={})=>{e.throwIfAborted();let s=++t;return new Promise((a,c)=>{let l=d=>{if(d.data.identifier===s)if(h(),d.data.error){let m=new Error(d.data.error.message);m.name=d.data.error.name,c(m)}else a(d.data.value)},u=()=>{h(),c(e.signal.reason)},h=()=>{r.removeEventListener("message",l),e.signal.removeEventListener("abort",u)};r.addEventListener("message",l),e.signal.addEventListener("abort",u,{once:!0}),r.start();try{let d={identifier:s,input:n,options:i,context:o};r.postMessage(d,Yg(d))}catch(d){h(),c(d)}})}:void 0}}var uE=p(()=>{"use strict";sE();cE()});function oc(e={}){var i,o;let t=e.useLocalLibraries??((i=e.core)==null?void 0:i.useLocalLibraries),r=aj(e.CDN,(o=e.core)==null?void 0:o.CDN),n=e.modules;return{...t!==void 0?{useLocalLibraries:t}:{},...r!==void 0?{CDN:r}:{},...n!==void 0?{modules:n}:{}}}function aj(e,t){if(typeof e=="string"||e===null)return e;if(typeof t=="string"||t===null)return t}async function Nl(e,t=null,r={},n=null,i=null){var a,c;let o=e;if(t){let l=n||e,u=(a=r.modules)==null?void 0:a[l];if(u!==void 0&&typeof u!="string")return u;e=Qg(e,t,r,n),o=i&&(!(typeof u=="string")||typeof((c=r.modules)==null?void 0:c[i])=="string")?Qg(i,t,r,i):e}let s=cj(e,o,rc);return Jg[s]=Jg[s]||lj(e,o),await Jg[s]}function cj(e,t,r){return r?JSON.stringify([e,t]):e}function Qg(e,t,r={},n=null){if(r!=null&&r.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||e;let i=r.modules||{};if(typeof i[n]=="string")return i[n];if(!r.useLocalLibraries&&e.startsWith("http"))return e;if(!Pi)return`modules/${t}/dist/libs/${n}`;if(r.CDN){if(typeof r.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return kv(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Nv}/dist/libs/${n}`}return rc?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${t}/src/libs/${n}`}async function lj(e,t){if(e.endsWith("wasm"))return await hj(e);if(!Pi){let{requireFromFile:n}=globalThis.loaders||{};try{let i=await(n==null?void 0:n(e));return i||!e.includes("/dist/libs/")?i:await(n==null?void 0:n(e.replace("/dist/libs/","/src/libs/")))}catch(i){if(e.includes("/dist/libs/"))try{return await(n==null?void 0:n(e.replace("/dist/libs/","/src/libs/")))}catch{}return console.error(i),null}}if(rc)return uj(e,t);let r=await dj(e);return fj(r,e)}async function uj(e,t=e){try{importScripts()}catch{let n=await import(new URL(t,globalThis.location.href).href);return n.default??n}return importScripts(e)}function fj(e,t){let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function hj(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};if(Pi||!t||e.startsWith("http"))return await(await fetch(e)).arrayBuffer();try{return await t(e)}catch{if(e.includes("/dist/libs/"))return await t(e.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${e}`)}}async function dj(e){let{readFileAsText:t}=globalThis.loaders||{};if(Pi||!t||e.startsWith("http"))return await(await fetch(e)).text();try{return await t(e)}catch{if(e.includes("/dist/libs/"))return await t(e.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${e}`)}}var Jg,fE=p(()=>{"use strict";Fg();Gv();Fv();Jg={}});var sc=p(()=>{"use strict";Fg();uE();fE()});async function ty(e,t=()=>e){await Zg((r,n,i,o)=>mj(t(n||{}),r,n,i,o),(r,n,i,o)=>hE(t(n||{}),r,n,i,o))}async function mj(e,t,r={},n,i={}){let o=await gj({loader:e,arrayBuffer:t,options:r,context:{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:dE(),_parse:mE(n==null?void 0:n.process)}});return e.serializeWorkerResult?e.serializeWorkerResult(o,r,i):o}async function*hE(e,t,r={},n,i={}){if(!e.parseInBatches)throw new Error(`${e.id} loader does not support batched parsing`);let o=gE(e,r),s=e.parseInBatches(t,o,{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:dE(),_parse:mE(n==null?void 0:n.process)});for await(let a of s)yield e.serializeWorkerBatch?e.serializeWorkerBatch(a,r,i):a}function dE(){let e=t=>()=>{throw new Error(`context.coreApi.${t} is unavailable inside worker loaders.`)};return{fetchFile:async(t,r)=>await fetch(t,r),parseSync:e("parseSync"),parse:e("parse"),parseFile:e("parseFile"),parseInBatches:e("parseInBatches"),load:e("load"),loadInBatches:e("loadInBatches")}}function mE(e){return(t,r,n,i)=>{if(!e)throw new Error("Worker not set up to parse on main thread");let o=pj(r,n,i);return e(t,o.options,{...o.context,...Array.isArray(r)||r&&pE(r)?{_loaderIsArray:Array.isArray(r),_loaderIds:(Array.isArray(r)?r:[r]).map(s=>s.id)}:{}})}}function pj(e,t,r){return t?{options:t,context:ey(r)}:Array.isArray(e)||e&&pE(e)?{options:void 0,context:ey(r)}:e&&!Array.isArray(e)?{options:e}:{options:void 0,context:ey(r)}}function pE(e){return"id"in e&&"extensions"in e}function ey(e){if(!e)return;let{fetch:t,loaders:r,coreApi:n,signal:i,reportProgress:o,_parse:s,_parseSync:a,_parseInBatches:c,...l}=e;return JSON.parse(JSON.stringify(l))}async function gj({loader:e,arrayBuffer:t,options:r,context:n}){let i,o;if(e.parse||e.parseSync)i=t,o=e.parse||e.parseSync;else if(e.parseTextSync)i=new TextDecoder().decode(t),o=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return r=gE(e,r),await o(i,{...r},n,e)}function gE(e,t){var r;return{...t,modules:{...(r=e.options)==null?void 0:r.modules,...t.modules},core:{...t.core,worker:!1}}}var yE=p(()=>{"use strict";sc()});function tm(e={}){if(e.coordinateEpoch!==void 0&&!Number.isFinite(e.coordinateEpoch))throw new Error("Spatial reference coordinate epoch must be a finite decimal year");return Object.freeze({crs:bE(e.crs||{state:"absent",provenance:"unknown"}),vertical:e.vertical?bE(e.vertical):void 0,coordinateEpoch:e.coordinateEpoch,coordinateFrame:e.coordinateFrame||"unknown",coordinateOrder:Object.freeze([...e.coordinateOrder||[]]),units:e.units?Object.freeze([...e.units]):void 0})}function wr(e){if(typeof e=="object")return"projjson";let t=e.trim();return/^[A-Z][A-Z0-9_]*\s*[\[(]/i.test(t)?"wkt":/(?:^|\s)\+?proj=/i.test(t)?"proj-string":/^[A-Z][A-Z0-9._-]*(?::[A-Z0-9._-]+)+$/i.test(t)||/^urn:ogc:def:crs:/i.test(t)||/^https?:\/\//i.test(t)||/^[A-Z][A-Z0-9._-]*$/i.test(t)?"identifier":"opaque"}function bE(e){return e.state==="explicit"||e.state==="default"?Object.freeze({...e,definition:wE(e.definition),alternatives:e.alternatives?Object.freeze(e.alternatives.map(t=>Object.freeze({...t,definition:wE(t.definition)}))):void 0}):Object.freeze({...e})}function wE(e){return typeof e=="string"?e:ry(e)}function ry(e){return Array.isArray(e)?Object.freeze(e.map(t=>ry(t))):e&&typeof e=="object"?Object.freeze(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,ry(r)]))):e}var Fl=p(()=>{});function Sf(e,t){let n={type:"wkt-crs",root:new ny(e).parse()};if(t!=null&&t.strict){let i=ME(n,{profile:t.profile,allowExtensions:!1});if(i.length>0)throw new nm(i)}return n}function ME(e,t){var a;if(!e||e.type!=="wkt-crs"||((a=e.root)==null?void 0:a.type)!=="node")throw new TypeError("validateWKTCRS expects a WKTCRSAst");let r=Aj(e.root.keyword,(t==null?void 0:t.profile)||"auto"),n=Ej[r],i=Tj[r],o=[],s=e.root.keyword.toUpperCase();return n.has(s)||o.push({code:"invalid-root",message:`${e.root.keyword} is not a ${r} root keyword`,path:[],keyword:e.root.keyword}),vE(e.root,[],c=>{let l=c.node.keyword.toUpperCase();!(t!=null&&t.allowExtensions)&&!i.has(l)&&o.push({code:"unknown-keyword",message:`${c.node.keyword} is not defined by the ${r} profile`,path:c.path,keyword:c.node.keyword}),c.node.values.length===0&&o.push({code:"empty-node",message:`${c.node.keyword} must contain at least one value`,path:c.path,keyword:c.node.keyword});let u=Ij(c.node);u&&o.push({code:"invalid-value",message:u,path:c.path,keyword:c.node.keyword})}),o}function Aj(e,t){return t!=="auto"?t:_f.has(e.toUpperCase())?"wkt1":"wkt2:2019"}function Ij(e){let t=e.keyword.toUpperCase(),r=e.values,n=(o,...s)=>!!(r[o]&&s.includes(r[o].type)),i=(o,...s)=>r.length===o&&s.every((a,c)=>n(c,a));if(["ANGLEUNIT","LENGTHUNIT","PARAMETRICUNIT","SCALEUNIT","TIMEUNIT","TEMPORALQUANTITY","UNIT"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${e.keyword} must start with a quoted name and numeric conversion factor`;if(t==="CS"&&!i(2,"enumeration","number"))return`${e.keyword} must contain a coordinate-system type and dimension`;if(t==="BBOX"&&!i(4,"number","number","number","number"))return`${e.keyword} must contain four numeric bounds`;if(["ENSEMBLEACCURACY","EPOCH","COORDEPOCH","FRAMEEPOCH","OPERATIONACCURACY","ORDER"].includes(t)&&!i(1,"number"))return`${e.keyword} must contain one number`;if(["ANCHOR","AREA","CALENDAR","CITATION","REMARK","SCOPE","URI","VERSION"].includes(t)&&!i(1,"string"))return`${e.keyword} must contain one quoted string`;if(["ELLIPSOID","SPHEROID","TRIAXIAL"].includes(t)&&!(r.length>=3&&n(0,"string")&&n(1,"number")&&n(2,"number")))return`${e.keyword} must start with a quoted name and numeric ellipsoid axes`;if(["PARAMETER"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"number")))return`${e.keyword} must start with a quoted name and numeric value`;if(t==="PARAMETERFILE"&&!i(2,"string","string"))return`${e.keyword} must contain a quoted name and file name`;if(["AUTHORITY","ID"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"string","number")))return`${e.keyword} must start with a quoted authority and identifier`;if(["AXIS"].includes(t)&&!(r.length>=2&&n(0,"string")&&n(1,"enumeration")))return`${e.keyword} must start with a quoted name and axis direction`;if(["METHOD","PROJECTION"].includes(t)&&!(r.length>=1&&n(0,"string")))return`${e.keyword} must start with a quoted name`;if(t==="TIMEEXTENT"){let o=s=>n(s,"enumeration","string");if(r.length!==2||!o(0)||!o(1))return`${e.keyword} must contain two date-time or quoted values`}if(t==="VERTICALEXTENT"&&(r.length<2||r.length>3||!n(0,"number")||!n(1,"number")||r.length===3&&!n(2,"node")))return`${e.keyword} must contain two numeric bounds and an optional unit`;if(t==="COORDINATEMETADATA"&&(r.length<1||r.length>2||!n(0,"node")||r.length===2&&(!n(1,"node")||!["EPOCH","COORDEPOCH"].includes(r[1].keyword.toUpperCase()))))return`${e.keyword} must contain a CRS and an optional coordinate epoch`;if(t==="BOUNDCRS"){let o=r.slice(0,3).map(s=>s.type==="node"?s.keyword.toUpperCase():"");if(o[0]!=="SOURCECRS"||o[1]!=="TARGETCRS"||o[2]!=="ABRIDGEDTRANSFORMATION")return`${e.keyword} must start with SOURCECRS, TARGETCRS, and ABRIDGEDTRANSFORMATION`}return["COMPOUNDCRS","CONCATENATEDOPERATION","COORDINATEOPERATION","DERIVEDPROJCRS","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","GEOGCRS","GEOGRAPHICCRS","PARAMETRICCRS","POINTMOTIONOPERATION","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"].includes(t)&&!n(0,"string")?`${e.keyword} must start with a quoted name`:null}function vE(e,t,r){r({node:e,path:t});for(let n=0;n<e.values.length;n++){let i=e.values[n];i.type==="node"&&vE(i,[...t,n],r)}}function Pj(e,t){let r=1,n=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
3
+ `?(r++,n=1):n++;return{line:r,column:n}}var rm,nm,yj,bj,_f,iy,wj,xj,_j,Sj,xE,_E,SE,Mj,vj,Ej,Tj,ny,oy=p(()=>{rm=class extends SyntaxError{constructor(t,r,n){let i=Pj(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="WKTCRSSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}},nm=class extends Error{constructor(t){var r;super(((r=t[0])==null?void 0:r.message)||"WKT validation failed"),this.name="WKTCRSValidationError",this.issues=t}},yj=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?$/,bj=/^[A-Za-z][A-Za-z0-9_]*/,_f=new Set(["COMPD_CS","CONCAT_MT","FITTED_CS","GEOCCS","GEOGCS","INVERSE_MT","LOCAL_CS","PARAM_MT","PASSTHROUGH_MT","PROJCS","VERT_CS"]),iy=new Set([..._f,"AUTHORITY","AXIS","CONCAT_MT","DATUM","INVERSE_MT","LOCAL_DATUM","PARAMETER","PARAM_MT","PASSTHROUGH_MT","PRIMEM","PROJECTION","SPHEROID","TOWGS84","UNIT","VERT_DATUM"]),wj=new Set(_f),xj=new Set([...iy,"EXTENSION"]),_j=new Set([..._f,"COMPDCS","LOCALCS","VERTCS"]),Sj=new Set([...iy,"COMPDCS","LOCALCS","VDATUM","VERTCS"]),xE=new Set(["BOUNDCRS","COMPOUNDCRS","COORDINATEOPERATION","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","PARAMETRICCRS","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"]),_E=new Set([...xE,"CONCATENATEDOPERATION","COORDINATEMETADATA","DERIVEDPROJCRS","GEOGCRS","GEOGRAPHICCRS","POINTMOTIONOPERATION"]),SE=new Set([..._E,"ABRIDGEDTRANSFORMATION","ANCHOR","ANGLEUNIT","AREA","AXIS","BASEENGCRS","BASEGEODCRS","BASEGEOGCRS","BASEPARAMCRS","BASEPROJCRS","BASETIMECRS","BASEVERTCRS","BBOX","BEARING","CALENDAR","CITATION","CONVERSION","COORDEPOCH","CS","DATUM","DERIVINGCONVERSION","DYNAMIC","EDATUM","ELLIPSOID","ENGINEERINGDATUM","ENSEMBLE","ENSEMBLEACCURACY","EPOCH","FRAMEEPOCH","GEODETICDATUM","GEOIDMODEL","ID","INTERPOLATIONCRS","LENGTHUNIT","MEMBER","MERIDIAN","METHOD","MODEL","OPERATIONACCURACY","ORDER","PARAMETER","PARAMETERFILE","PARAMETRICDATUM","PARAMETRICUNIT","PDATUM","PRIMEM","PRIMEMERIDIAN","REMARK","SCALEUNIT","SCOPE","SOURCECRS","STEP","TARGETCRS","TDATUM","TEMPORALQUANTITY","TIMEEXTENT","TIMEORIGIN","TIMEUNIT","TIMEDATUM","TRIAXIAL","TRF","URI","USAGE","VDATUM","VERSION","VERTICALDATUM","VERTICALEXTENT","VELOCITYGRID","VRF"]),Mj=new Set(["BASEGEOGCRS","CALENDAR","CONCATENATEDOPERATION","COORDEPOCH","COORDINATEMETADATA","DERIVEDPROJCRS","DYNAMIC","ENSEMBLE","ENSEMBLEACCURACY","EPOCH","FRAMEEPOCH","GEOGCRS","GEOGRAPHICCRS","GEOIDMODEL","MEMBER","MODEL","POINTMOTIONOPERATION","STEP","TEMPORALQUANTITY","TRF","TRIAXIAL","VELOCITYGRID","VRF"]),vj=new Set([...SE].filter(e=>!Mj.has(e))),Ej={wkt1:_f,gdal:wj,esri:_j,"wkt2:2015":xE,"wkt2:2019":_E},Tj={wkt1:iy,gdal:xj,esri:Sj,"wkt2:2015":vj,"wkt2:2019":SE};ny=class{constructor(t){this.offset=0,this.source=t}parse(){this.skipWhitespace();let t=this.parseNode();return this.skipWhitespace(),this.offset!==this.source.length&&this.fail("Unexpected content after WKT root"),t}parseNode(){let t=this.parseKeyword();return this.parseNodeAfterKeyword(t)}parseNodeAfterKeyword(t){this.skipWhitespace();let r=this.source[this.offset];r!=="["&&r!=="("&&this.fail(`Expected '[' or '(' after ${t}`),this.offset++;let n=r==="["?"bracket":"parenthesis",i=r==="["?"]":")",o=[];if(this.skipWhitespace(),this.source[this.offset]===i)return this.offset++,{type:"node",keyword:t,delimiter:n,values:o};for(;this.offset<this.source.length;){o.push(this.parseValue()),this.skipWhitespace();let s=this.source[this.offset];if(s===","){this.offset++,this.skipWhitespace(),this.source[this.offset]===i&&this.fail("Expected a WKT value after comma");continue}if(s===i)return this.offset++,{type:"node",keyword:t,delimiter:n,values:o};(s==="]"||s===")")&&this.fail(`Expected '${i}' to close ${t}`),this.fail(`Expected ',' or '${i}' in ${t}`)}this.fail(`Unterminated ${t} node`)}parseValue(){if(this.skipWhitespace(),this.source[this.offset]==='"')return this.parseString();let r=this.offset;for(;this.offset<this.source.length&&!/[\s,\[\]()"]/.test(this.source[this.offset]);)this.offset++;r===this.offset&&this.fail("Expected a WKT value");let n=this.source.slice(r,this.offset);return this.source[this.offset]==='"'&&this.fail("Unexpected quote in unquoted WKT value"),this.skipWhitespace(),this.source[this.offset]==="["||this.source[this.offset]==="("?(/^[A-Za-z][A-Za-z0-9_]*$/.test(n)||this.fail(`Invalid WKT keyword '${n}'`),this.parseNodeAfterKeyword(n)):yj.test(n)?{type:"number",value:Number(n),raw:n}:{type:"enumeration",value:n}}parseKeyword(){let t=this.source.slice(this.offset).match(bj);return t||this.fail("Expected a WKT keyword"),this.offset+=t[0].length,t[0]}parseString(){this.offset++;let t="";for(;this.offset<this.source.length;){let r=this.source[this.offset++];if(r==='"'){if(this.source[this.offset]==='"'){t+='"',this.offset++;continue}return{type:"string",value:t}}t+=r}this.fail("Unterminated WKT string")}skipWhitespace(){for(;this.offset<this.source.length&&/\s/.test(this.source[this.offset]);)this.offset++}fail(t){throw new rm(t,this.source,this.offset)}}});function Mf(e){let t=Oj(e);if(t.length===0)throw new Go("PROJ string is empty",e,0);return{type:"proj-string",parameters:t.map(n=>Lj(n.raw,n.offset,e))}}function Lj(e,t,r){let n=e.startsWith("+")?e.slice(1):e;if(!n)throw new Go("Expected a parameter after '+'",r,t);let i=n.indexOf("="),o=i<0?n:n.slice(0,i);if(!o||/[\s+=]/.test(o))throw new Go(`Invalid PROJ parameter name '${o}'`,r,t);if(i<0)return{type:"parameter",name:o};let s=n.slice(i+1),a=Cj(s,r,t+i+1);return{type:"parameter",name:o,value:a,rawValue:s}}function Oj(e){let t=[],r=0;for(;r<e.length;){for(;r<e.length&&/\s/.test(e[r]);)r++;if(r>=e.length)break;let n=r,i=null,o=!1;for(;r<e.length;){let s=e[r];if(o){o=!1,r++;continue}if(s==="\\"&&i){o=!0,r++;continue}if(i){s===i&&(i=null),r++;continue}if((s==='"'||s==="'")&&e[r-1]==="="){i=s,r++;continue}if(/\s/.test(s))break;r++}if(i)throw new Go("Unterminated quoted PROJ value",e,n);t.push({raw:e.slice(n,r),offset:n})}return t}function Cj(e,t,r){if(!e)return"";let n=e[0];if(n!=='"'&&n!=="'"){if((e.includes('"')||e.includes("'"))&&!Rj.test(e))throw new Go("Quote must begin a PROJ parameter value",t,r);return e}if(e[e.length-1]!==n)throw new Go("Unterminated quoted PROJ value",t,r);let i="";for(let o=1;o<e.length-1;o++){let s=e[o];s==="\\"&&o+1<e.length-1?i+=e[++o]:i+=s}return i}function Bj(e,t){let r=1,n=1;for(let i=0;i<t&&i<e.length;i++)e[i]===`
4
+ `?(r++,n=1):n++;return{line:r,column:n}}var Go,Rj,sy=p(()=>{Go=class extends SyntaxError{constructor(t,r,n){let i=Bj(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="PROJStringSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}};Rj=/^[+-]?\d+(?:\.\d*)?d(?:\d+(?:\.\d*)?'(?:\d+(?:\.\d*)?")?)?[NSEW]?$/i});var vf,EE=p(()=>{vf={m:{name:"meters",metersPerUnit:1},mm:{name:"millimeters",metersPerUnit:.001},cm:{name:"centimeters",metersPerUnit:.01},ft:{name:"feet",metersPerUnit:.3048},"us-ft":{name:"us-survey-feet",metersPerUnit:.3048006096012192},fath:{name:"fathoms",metersPerUnit:1.8288},kmi:{name:"nautical-miles",metersPerUnit:1852},"us-ch":{name:"us-survey-chains",metersPerUnit:20.1168402336805},"us-mi":{name:"us-survey-miles",metersPerUnit:1609.34721869444},km:{name:"kilometers",metersPerUnit:1e3},"ind-ft":{name:"indian-feet",metersPerUnit:.30479841},"ind-yd":{name:"indian-yards",metersPerUnit:.91439523},mi:{name:"miles",metersPerUnit:1609.344},yd:{name:"yards",metersPerUnit:.9144},ch:{name:"chains",metersPerUnit:20.1168},link:{name:"links",metersPerUnit:.201168},dm:{name:"decimeters",metersPerUnit:.1},in:{name:"inches",metersPerUnit:.0254},"ind-ch":{name:"indian-chains",metersPerUnit:20.11669506},"us-in":{name:"us-survey-inches",metersPerUnit:.025400050800101},"us-yd":{name:"us-survey-yards",metersPerUnit:.914401828803658}}});function TE(e){return JSON.stringify([e.coordinateFrame,e.projection,Object.keys(e.parameters).sort().map(t=>[t,e.parameters[t]]),[e.ellipsoid.semiMajorAxis,e.ellipsoid.semiMinorAxis],e.axis,[e.xUnit.name,e.xUnit.metersPerUnit,e.xUnit.degreesPerUnit],[e.yUnit.name,e.yUnit.metersPerUnit,e.yUnit.degreesPerUnit],[e.zUnit.name,e.zUnit.metersPerUnit,e.zUnit.degreesPerUnit],e.lossy,e.areaOfUse])}var ay=p(()=>{EE()});var cy=p(()=>{Fl();oy();sy()});var im={};Qt(im,{EPSILON1:()=>Dj,EPSILON10:()=>Vj,EPSILON11:()=>Wj,EPSILON12:()=>Hj,EPSILON13:()=>$j,EPSILON14:()=>Kj,EPSILON15:()=>Xj,EPSILON16:()=>Yj,EPSILON17:()=>Zj,EPSILON18:()=>Jj,EPSILON19:()=>Qj,EPSILON2:()=>Nj,EPSILON20:()=>ez,EPSILON3:()=>Fj,EPSILON4:()=>kj,EPSILON5:()=>Gj,EPSILON6:()=>Uj,EPSILON7:()=>jj,EPSILON8:()=>zj,EPSILON9:()=>qj,PI:()=>iz,PI_OVER_FOUR:()=>rz,PI_OVER_SIX:()=>nz,PI_OVER_TWO:()=>tz,TWO_PI:()=>oz});var Dj,Nj,Fj,kj,Gj,Uj,jj,zj,qj,Vj,Wj,Hj,$j,Kj,Xj,Yj,Zj,Jj,Qj,ez,tz,rz,nz,iz,oz,AE=p(()=>{Dj=.1,Nj=.01,Fj=.001,kj=1e-4,Gj=1e-5,Uj=1e-6,jj=1e-7,zj=1e-8,qj=1e-9,Vj=1e-10,Wj=1e-11,Hj=1e-12,$j=1e-13,Kj=1e-14,Xj=1e-15,Yj=1e-16,Zj=1e-17,Jj=1e-18,Qj=1e-19,ez=1e-20,tz=Math.PI/2,rz=Math.PI/4,nz=Math.PI/6,iz=Math.PI,oz=Math.PI*2});function ly(e,{precision:t=xt.precision}={}){return e=lz(e),`${parseFloat(e.toPrecision(t))}`}function ao(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uy(e){return IE(e)}function fy(e){return PE(e)}function IE(e,t){return RE(e,r=>r*az,t)}function PE(e,t){return RE(e,r=>r*sz,t)}function om(e,t,r){let n=xt.EPSILON;r&&(xt.EPSILON=r);try{if(e===t)return!0;if(ao(e)&&ao(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!om(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=xt.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{xt.EPSILON=n}}function lz(e){return Math.round(e/xt.EPSILON)*xt.EPSILON}function uz(e){return e.clone?e.clone():new Array(e.length)}function RE(e,t,r){if(ao(e)){let n=e;r=r||uz(n);for(let i=0;i<r.length&&i<n.length;++i){let o=typeof e=="number"?e:e[i];r[i]=t(o,i,r)}return r}return t(e)}var sz,az,cz,xt,kl=p(()=>{sz=1/Math.PI*180,az=1/180*Math.PI,cz={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...cz}};xt=globalThis.mathgl.config});var Rs,sm=p(()=>{kl();Rs=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:ao(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toString(){return this.formatString(xt)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+ly(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!om(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let o=t[i],s=typeof r=="number"?r:r[i];this[i]=o+n*(s-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(xt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}}});function fz(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Xt(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function Gl(e,t,r=""){if(xt.debug&&!fz(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}var ac=p(()=>{kl()});var Ul,hy=p(()=>{sm();ac();kl();Ul=class extends Rs{toString(){let t="[";if(xt.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Xt(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}}});function Ri(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var dy=p(()=>{});var am,LE=p(()=>{sm();ac();dy();am=class extends Rs{get x(){return this[0]}set x(t){this[0]=Xt(t)}get y(){return this[1]}set y(t){this[1]=Xt(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Xt(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Xt(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Ri(t>=0&&t<this.ELEMENTS,"index is out of range"),Xt(this[t])}setComponent(t,r){return Ri(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]+=t[n]*r;return this.check()}}});var cm,Dee,OE=p(()=>{cm=typeof Float32Array<"u"?Float32Array:Array,Dee=Math.PI/180});function CE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function BE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var lm=p(()=>{});function DE(e,t,r){let n=t[0],i=t[1],o=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/o,e[1]=(r[1]*n+r[5]*i)/o,e}function um(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o||1;return e[0]=(r[0]*n+r[4]*i+r[8]*o)/s,e[1]=(r[1]*n+r[5]*i+r[9]*o)/s,e[2]=(r[2]*n+r[6]*i+r[10]*o)/s,e}function NE(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function FE(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*o,e[1]=r[1]*n+r[4]*i+r[7]*o,e[2]=r[2]*n+r[5]*i+r[8]*o,e[3]=t[3],e}var fm=p(()=>{});function kE(){let e=new cm(3);return cm!==Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function dz(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function my(e,t,r){let n=new cm(3);return n[0]=e,n[1]=t,n[2]=r,n}function GE(e,t){let r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function py(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function jl(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[0],a=r[1],c=r[2];return e[0]=i*c-o*a,e[1]=o*s-n*c,e[2]=n*a-i*s,e}function hm(e,t,r){let n=t[0],i=t[1],o=t[2],s=r[3]*n+r[7]*i+r[11]*o+r[15];return s=s||1,e[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/s,e[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/s,e}function dm(e,t,r){let n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}function UE(e,t,r){let n=r[0],i=r[1],o=r[2],s=r[3],a=t[0],c=t[1],l=t[2],u=i*l-o*c,h=o*a-n*l,d=n*c-i*a,m=i*d-o*h,g=o*u-n*d,y=n*h-i*u,b=s*2;return u*=b,h*=b,d*=b,m*=2,g*=2,y*=2,e[0]=a+u+m,e[1]=c+h+g,e[2]=l+d+y,e}function jE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function zE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function qE(e,t,r,n){let i=[],o=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function VE(e,t){let r=e[0],n=e[1],i=e[2],o=t[0],s=t[1],a=t[2],c=Math.sqrt((r*r+n*n+i*i)*(o*o+s*s+a*a)),l=c&&py(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var WE,zl=p(()=>{OE();WE=dz});var gy,mm,J,HE=p(()=>{LE();kl();ac();zl();fm();gy=[0,0,0],J=class e extends am{static get ZERO(){return mm||(mm=new e(0,0,0),Object.freeze(mm)),mm}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&ao(t)?this.copy(t):(xt.debug&&(Xt(t),Xt(r),Xt(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return xt.debug&&(Xt(t.x),Xt(t.y),Xt(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Xt(t)}angle(t){return VE(this,t)}cross(t){return jl(this,this,t),this.check()}rotateX({radians:t,origin:r=gy}){return jE(this,this,r,t),this.check()}rotateY({radians:t,origin:r=gy}){return zE(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=gy}){return qE(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return hm(this,this,t),this.check()}transformAsVector(t){return um(this,this,t),this.check()}transformByMatrix3(t){return dm(this,this,t),this.check()}transformByMatrix2(t){return NE(this,this,t),this.check()}transformByQuaternion(t){return UE(this,this,t),this.check()}}});function $E(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function KE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],h=u*s-a*l,d=-u*o+a*c,m=l*o-s*c,g=r*h+n*d+i*m;return g?(g=1/g,e[0]=h*g,e[1]=(-u*n+i*l)*g,e[2]=(a*n-i*s)*g,e[3]=d*g,e[4]=(u*r-i*c)*g,e[5]=(-a*r+i*o)*g,e[6]=m*g,e[7]=(-l*r+n*c)*g,e[8]=(s*r-n*o)*g,e):null}function XE(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],c=e[7],l=e[8];return t*(l*o-s*c)+r*(-l*i+s*a)+n*(c*i-o*a)}function yy(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=r[0],m=r[1],g=r[2],y=r[3],b=r[4],w=r[5],_=r[6],S=r[7],M=r[8];return e[0]=d*n+m*s+g*l,e[1]=d*i+m*a+g*u,e[2]=d*o+m*c+g*h,e[3]=y*n+b*s+w*l,e[4]=y*i+b*a+w*u,e[5]=y*o+b*c+w*h,e[6]=_*n+S*s+M*l,e[7]=_*i+S*a+M*u,e[8]=_*o+S*c+M*h,e}function YE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=r[0],m=r[1];return e[0]=n,e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=c,e[6]=d*n+m*s+l,e[7]=d*i+m*a+u,e[8]=d*o+m*c+h,e}function ZE(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=Math.sin(r),m=Math.cos(r);return e[0]=m*n+d*s,e[1]=m*i+d*a,e[2]=m*o+d*c,e[3]=m*s-d*n,e[4]=m*a-d*i,e[5]=m*c-d*o,e[6]=l,e[7]=u,e[8]=h,e}function by(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function JE(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,h=n*a,d=i*s,m=i*a,g=i*c,y=o*s,b=o*a,w=o*c;return e[0]=1-h-g,e[3]=u-w,e[6]=d+b,e[1]=u+w,e[4]=1-l-g,e[7]=m-y,e[2]=d-b,e[5]=m+y,e[8]=1-l-h,e}var wy=p(()=>{});function gz(){return pm||(pm=new cc([0,0,0,0,0,0,0,0,0]),Object.freeze(pm)),pm}function yz(){return gm||(gm=new cc,Object.freeze(gm)),gm}var xy,pz,cc,pm,gm,QE=p(()=>{hy();ac();fm();wy();lm();zl();(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(xy||(xy={}));pz=Object.freeze([1,0,0,0,1,0,0,0,1]),cc=class extends Ul{static get IDENTITY(){return yz()}static get ZERO(){return gz()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return xy}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(pz)}fromObject(t){return this.check()}fromQuaternion(t){return JE(this,t),this.check()}fromMatrix4(t){return this.set(t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10])}set(t,r,n,i,o,s,a,c,l){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this.check()}setRowMajor(t,r,n,i,o,s,a,c,l){return this[0]=t,this[1]=i,this[2]=a,this[3]=r,this[4]=o,this[5]=c,this[6]=n,this[7]=s,this[8]=l,this.check()}determinant(){return XE(this)}transpose(){return $E(this,this),this.check()}invert(){return KE(this,this),this.check()}multiplyLeft(t){return yy(this,t,this),this.check()}multiplyRight(t){return yy(this,this,t),this.check()}rotate(t){return ZE(this,this,t),this.check()}scale(t){return Array.isArray(t)?by(this,this,t):by(this,this,[t,t]),this.check()}translate(t){return YE(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=CE(r||[-0,-0],t,this);break;case 3:n=dm(r||[-0,-0,-0],t,this);break;case 4:n=FE(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Gl(n,t.length),n}},gm=null});function bz(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function e4(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function t4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=t[4],a=t[5],c=t[6],l=t[7],u=t[8],h=t[9],d=t[10],m=t[11],g=t[12],y=t[13],b=t[14],w=t[15],_=r*a-n*s,S=r*c-i*s,M=r*l-o*s,v=n*c-i*a,C=n*l-o*a,R=i*l-o*c,E=u*y-h*g,j=u*b-d*g,I=u*w-m*g,O=h*b-d*y,A=h*w-m*y,W=d*w-m*b,k=_*W-S*A+M*O+v*I-C*j+R*E;return k?(k=1/k,e[0]=(a*W-c*A+l*O)*k,e[1]=(i*A-n*W-o*O)*k,e[2]=(y*R-b*C+w*v)*k,e[3]=(d*C-h*R-m*v)*k,e[4]=(c*I-s*W-l*j)*k,e[5]=(r*W-i*I+o*j)*k,e[6]=(b*M-g*R-w*S)*k,e[7]=(u*R-d*M+m*S)*k,e[8]=(s*A-a*I+l*E)*k,e[9]=(n*I-r*A-o*E)*k,e[10]=(g*C-y*M+w*_)*k,e[11]=(h*M-u*C-m*_)*k,e[12]=(a*j-s*O-c*E)*k,e[13]=(r*O-n*j+i*E)*k,e[14]=(y*S-g*v-b*_)*k,e[15]=(u*v-h*S+d*_)*k,e):null}function r4(e){let t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],s=e[5],a=e[6],c=e[7],l=e[8],u=e[9],h=e[10],d=e[11],m=e[12],g=e[13],y=e[14],b=e[15],w=t*s-r*o,_=t*a-n*o,S=r*a-n*s,M=l*g-u*m,v=l*y-h*m,C=u*y-h*g,R=t*C-r*v+n*M,E=o*C-s*v+a*M,j=l*S-u*_+h*w,I=m*S-g*_+y*w;return c*R-i*E+b*j-d*I}function _y(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],c=t[5],l=t[6],u=t[7],h=t[8],d=t[9],m=t[10],g=t[11],y=t[12],b=t[13],w=t[14],_=t[15],S=r[0],M=r[1],v=r[2],C=r[3];return e[0]=S*n+M*a+v*h+C*y,e[1]=S*i+M*c+v*d+C*b,e[2]=S*o+M*l+v*m+C*w,e[3]=S*s+M*u+v*g+C*_,S=r[4],M=r[5],v=r[6],C=r[7],e[4]=S*n+M*a+v*h+C*y,e[5]=S*i+M*c+v*d+C*b,e[6]=S*o+M*l+v*m+C*w,e[7]=S*s+M*u+v*g+C*_,S=r[8],M=r[9],v=r[10],C=r[11],e[8]=S*n+M*a+v*h+C*y,e[9]=S*i+M*c+v*d+C*b,e[10]=S*o+M*l+v*m+C*w,e[11]=S*s+M*u+v*g+C*_,S=r[12],M=r[13],v=r[14],C=r[15],e[12]=S*n+M*a+v*h+C*y,e[13]=S*i+M*c+v*d+C*b,e[14]=S*o+M*l+v*m+C*w,e[15]=S*s+M*u+v*g+C*_,e}function n4(e,t,r){let n=r[0],i=r[1],o=r[2],s,a,c,l,u,h,d,m,g,y,b,w;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*o+t[12],e[13]=t[1]*n+t[5]*i+t[9]*o+t[13],e[14]=t[2]*n+t[6]*i+t[10]*o+t[14],e[15]=t[3]*n+t[7]*i+t[11]*o+t[15]):(s=t[0],a=t[1],c=t[2],l=t[3],u=t[4],h=t[5],d=t[6],m=t[7],g=t[8],y=t[9],b=t[10],w=t[11],e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=u,e[5]=h,e[6]=d,e[7]=m,e[8]=g,e[9]=y,e[10]=b,e[11]=w,e[12]=s*n+u*i+g*o+t[12],e[13]=a*n+h*i+y*o+t[13],e[14]=c*n+d*i+b*o+t[14],e[15]=l*n+m*i+w*o+t[15]),e}function i4(e,t,r){let n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function o4(e,t,r,n){let i=n[0],o=n[1],s=n[2],a=Math.sqrt(i*i+o*o+s*s),c,l,u,h,d,m,g,y,b,w,_,S,M,v,C,R,E,j,I,O,A,W,k,T;return a<1e-6?null:(a=1/a,i*=a,o*=a,s*=a,l=Math.sin(r),c=Math.cos(r),u=1-c,h=t[0],d=t[1],m=t[2],g=t[3],y=t[4],b=t[5],w=t[6],_=t[7],S=t[8],M=t[9],v=t[10],C=t[11],R=i*i*u+c,E=o*i*u+s*l,j=s*i*u-o*l,I=i*o*u-s*l,O=o*o*u+c,A=s*o*u+i*l,W=i*s*u+o*l,k=o*s*u-i*l,T=s*s*u+c,e[0]=h*R+y*E+S*j,e[1]=d*R+b*E+M*j,e[2]=m*R+w*E+v*j,e[3]=g*R+_*E+C*j,e[4]=h*I+y*O+S*A,e[5]=d*I+b*O+M*A,e[6]=m*I+w*O+v*A,e[7]=g*I+_*O+C*A,e[8]=h*W+y*k+S*T,e[9]=d*W+b*k+M*T,e[10]=m*W+w*k+v*T,e[11]=g*W+_*k+C*T,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function s4(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[4],s=t[5],a=t[6],c=t[7],l=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+l*n,e[5]=s*i+u*n,e[6]=a*i+h*n,e[7]=c*i+d*n,e[8]=l*i-o*n,e[9]=u*i-s*n,e[10]=h*i-a*n,e[11]=d*i-c*n,e}function a4(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],c=t[3],l=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-l*n,e[1]=s*i-u*n,e[2]=a*i-h*n,e[3]=c*i-d*n,e[8]=o*n+l*i,e[9]=s*n+u*i,e[10]=a*n+h*i,e[11]=c*n+d*i,e}function c4(e,t,r){let n=Math.sin(r),i=Math.cos(r),o=t[0],s=t[1],a=t[2],c=t[3],l=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+l*n,e[1]=s*i+u*n,e[2]=a*i+h*n,e[3]=c*i+d*n,e[4]=l*i-o*n,e[5]=u*i-s*n,e[6]=h*i-a*n,e[7]=d*i-c*n,e}function l4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r+r,a=n+n,c=i+i,l=r*s,u=n*s,h=n*a,d=i*s,m=i*a,g=i*c,y=o*s,b=o*a,w=o*c;return e[0]=1-h-g,e[1]=u+w,e[2]=d-b,e[3]=0,e[4]=u-w,e[5]=1-l-g,e[6]=m+y,e[7]=0,e[8]=d+b,e[9]=m-y,e[10]=1-l-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function u4(e,t,r,n,i,o,s){let a=1/(r-t),c=1/(i-n),l=1/(o-s);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(i+n)*c,e[10]=(s+o)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*l,e[15]=0,e}function wz(e,t,r,n,i){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let s=1/(n-i);e[10]=(i+n)*s,e[14]=2*i*n*s}else e[10]=-1,e[14]=-2*n;return e}function xz(e,t,r,n,i,o,s){let a=1/(t-r),c=1/(n-i),l=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+r)*a,e[13]=(i+n)*c,e[14]=(s+o)*l,e[15]=1,e}function d4(e,t,r,n){let i,o,s,a,c,l,u,h,d,m,g=t[0],y=t[1],b=t[2],w=n[0],_=n[1],S=n[2],M=r[0],v=r[1],C=r[2];return Math.abs(g-M)<1e-6&&Math.abs(y-v)<1e-6&&Math.abs(b-C)<1e-6?bz(e):(h=g-M,d=y-v,m=b-C,i=1/Math.sqrt(h*h+d*d+m*m),h*=i,d*=i,m*=i,o=_*m-S*d,s=S*h-w*m,a=w*d-_*h,i=Math.sqrt(o*o+s*s+a*a),i?(i=1/i,o*=i,s*=i,a*=i):(o=0,s=0,a=0),c=d*a-m*s,l=m*o-h*a,u=h*s-d*o,i=Math.sqrt(c*c+l*l+u*u),i?(i=1/i,c*=i,l*=i,u*=i):(c=0,l=0,u=0),e[0]=o,e[1]=c,e[2]=h,e[3]=0,e[4]=s,e[5]=l,e[6]=d,e[7]=0,e[8]=a,e[9]=u,e[10]=m,e[11]=0,e[12]=-(o*g+s*y+a*b),e[13]=-(c*g+l*y+u*b),e[14]=-(h*g+d*y+m*b),e[15]=1,e)}function Sy(e){if(e.length!==16||Array.from(e).some(i=>!Number.isFinite(i))||e[3]!==0||e[7]!==0||e[11]!==0||e[15]!==1)throw new RangeError("Expected a finite affine matrix");let t=[Math.hypot(e[0],e[1],e[2]),Math.hypot(e[4],e[5],e[6]),Math.hypot(e[8],e[9],e[10])];if(t.some(i=>i===0||!Number.isFinite(i)))throw new RangeError("Singular transform");let r=Array.from({length:9},(i,o)=>e[Math.floor(o/3)*4+o%3]/t[Math.floor(o/3)]);for(let[i,o]of[[0,3],[0,6],[3,6]])if(Math.abs(r[i]*r[o]+r[i+1]*r[o+1]+r[i+2]*r[o+2])>1e-7)throw new RangeError("Sheared transforms do not have a TRS decomposition");if(r[0]*(r[4]*r[8]-r[5]*r[7])-r[3]*(r[1]*r[8]-r[2]*r[7])+r[6]*(r[1]*r[5]-r[2]*r[4])<0){t[0]=-t[0];for(let i=0;i<3;i++)r[i]=-r[i]}return{rotation:r,scale:t,translation:[e[12],e[13],e[14]]}}var f4,h4,ym=p(()=>{f4=wz;h4=xz});function m4(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function p4(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function g4(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function y4(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function b4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=n*s,e[2]=i*s,e[3]=o*s,e}function w4(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function x4(e,t,r,n){let i=t[0],o=t[1],s=t[2],a=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=s+n*(r[2]-s),e[3]=a+n*(r[3]-a),e}function _4(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*s,e}var bm=p(()=>{});function Ez(){return wm||(wm=new yn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(wm)),wm}function Tz(){return xm||(xm=new yn,Object.freeze(xm)),xm}function S4(e){if(e>Math.PI*2)throw Error("expected radians")}function Az(e,t,r,n,i,o){let s=2*o/(r-t),a=2*o/(i-n),c=(r+t)/(r-t),l=(i+n)/(i-n),u=-1,h=-1,d=-2*o;return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=c,e[9]=l,e[10]=u,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}var Ey,Sz,Mz,My,vy,vz,yn,wm,xm,M4=p(()=>{hy();ym();ac();fm();ym();lm();zl();bm();(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Ey||(Ey={}));Sz=45*Math.PI/180,Mz=1,My=.1,vy=500,vz=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),yn=class extends Ul{static get IDENTITY(){return Tz()}static get ZERO(){return Ez()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Ey}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=o,this[5]=s,this[6]=a,this[7]=c,this[8]=l,this[9]=u,this[10]=h,this[11]=d,this[12]=m,this[13]=g,this[14]=y,this[15]=b,this.check()}setRowMajor(t,r,n,i,o,s,a,c,l,u,h,d,m,g,y,b){return this[0]=t,this[1]=o,this[2]=l,this[3]=m,this[4]=r,this[5]=s,this[6]=u,this[7]=g,this[8]=n,this[9]=a,this[10]=h,this[11]=y,this[12]=i,this[13]=c,this[14]=d,this[15]=b,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(vz)}fromObject(t){return this.check()}fromQuaternion(t){return l4(this,t),this.check()}fromMatrix3(t){return this.set(t[0],t[1],t[2],0,t[3],t[4],t[5],0,t[6],t[7],t[8],0,0,0,0,1)}frustum(t){let{left:r,right:n,bottom:i,top:o,near:s=My,far:a=vy}=t;return a===1/0?Az(this,r,n,i,o,s):u4(this,r,n,i,o,s,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return d4(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=My,far:a=vy}=t;return h4(this,r,n,i,o,s,a),this.check()}orthographic(t){let{fovy:r=Sz,aspect:n=Mz,focalDistance:i=1,near:o=My,far:s=vy}=t;S4(r);let a=r/2,c=i*Math.tan(a),l=c*n;return this.ortho({left:-l,right:l,bottom:-c,top:c,near:o,far:s})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:o=500}=t;return S4(r),f4(this,r,n,i,o),this.check()}determinant(){return r4(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){let{rotation:n,scale:i}=Sy(this);if(t=t||new Array(16),r)for(let o=0;o<3;o++)r[o]=i[o];for(let o=0;o<16;o++)t[o]=0;for(let o=0;o<9;o++)t[Math.floor(o/3)*4+o%3]=n[o];return t[15]=1,t}getRotationMatrix3(t,r){let{rotation:n,scale:i}=Sy(this);if(t=t||new Array(9),r)for(let o=0;o<3;o++)r[o]=i[o];for(let o=0;o<9;o++)t[o]=n[o];return t}transpose(){return e4(this,this),this.check()}invert(){return t4(this,this),this.check()}multiplyLeft(t){return _y(this,t,this),this.check()}multiplyRight(t){return _y(this,this,t),this.check()}rotateX(t){return s4(this,this,t),this.check()}rotateY(t){return a4(this,this,t),this.check()}rotateZ(t){return c4(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return o4(this,this,t,r),this.check()}scale(t){return i4(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return n4(this,this,t),this.check()}transform(t,r){return t.length===4?(r=_4(r||[-0,-0,-0,-0],t,this),Gl(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=BE(r||[-0,-0],t,this);break;case 3:i=hm(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Gl(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=DE(r||[-0,-0],t,this);break;case 3:n=um(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Gl(n,t.length),n}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}}});function v4(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Ty(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Ay(e,t,r){let n=t[0],i=t[1],o=t[2],s=t[3],a=r[0],c=r[1],l=r[2],u=r[3];return e[0]=n*u+s*a+i*l-o*c,e[1]=i*u+s*c+o*a-n*l,e[2]=o*u+s*l+n*c-i*a,e[3]=s*u-n*a-i*c-o*l,e}function E4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+s*a,e[1]=i*c+o*a,e[2]=o*c-i*a,e[3]=s*c-n*a,e}function T4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-o*a,e[1]=i*c+s*a,e[2]=o*c+n*a,e[3]=s*c-i*a,e}function A4(e,t,r){r*=.5;let n=t[0],i=t[1],o=t[2],s=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=i*c-n*a,e[2]=o*c+s*a,e[3]=s*c-o*a,e}function I4(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function Iy(e,t,r,n){let i=t[0],o=t[1],s=t[2],a=t[3],c=r[0],l=r[1],u=r[2],h=r[3],d,m,g,y,b;return d=i*c+o*l+s*u+a*h,d<0&&(d=-d,c=-c,l=-l,u=-u,h=-h),1-d>1e-6?(m=Math.acos(d),b=Math.sin(m),g=Math.sin((1-n)*m)/b,y=Math.sin(n*m)/b):(g=1-n,y=n),e[0]=g*i+y*c,e[1]=g*o+y*l,e[2]=g*s+y*u,e[3]=g*a+y*h,e}function P4(e,t){let r=t[0],n=t[1],i=t[2],o=t[3],s=r*r+n*n+i*i+o*o,a=s?1/s:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-i*a,e[3]=o*a,e}function R4(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function L4(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let o=(i+1)%3,s=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[o*3+o]-t[s*3+s]+1),e[i]=.5*n,n=.5/n,e[3]=(t[o*3+s]-t[s*3+o])*n,e[o]=(t[o*3+i]+t[i*3+o])*n,e[s]=(t[s*3+i]+t[i*3+s])*n}return e}function G4(e,t,r,n){if(t.length!==4||r.length!==4||[...Array.from(t),...Array.from(r),n].some(d=>!Number.isFinite(d)))throw new RangeError("Expected finite quaternions and step");if(t.length!==4||n<0)throw new RangeError("Expected quaternions and a nonnegative step");let i=Math.max(...Array.from(t,Math.abs)),o=Math.max(...Array.from(r,Math.abs));if(!i||!o)throw new RangeError("Zero quaternion");let s=Array.from(t,d=>d/i),a=Array.from(r,d=>d/o),c=Math.hypot(...s),l=Math.hypot(...a);for(let d=0;d<4;d++)s[d]/=c,a[d]/=l;let u=s.reduce((d,m,g)=>d+m*a[g],0),h=2*Math.acos(Math.min(1,Math.abs(u)));if(e.length<4)throw new RangeError("Result buffer is too short");return Iy(e,s,a,h===0?0:Math.min(1,n/h)),e}var O4,C4,B4,D4,N4,F4,Iz,k4,_m=p(()=>{zl();bm();O4=m4,C4=p4,B4=w4,D4=x4,N4=g4,F4=y4,Iz=b4,k4=(function(){let e=kE(),t=my(1,0,0),r=my(0,1,0);return function(n,i,o){let s=py(i,o);return s<-.999999?(jl(e,t,i),WE(e)<1e-6&&jl(e,r,i),GE(e,e),Ty(n,e,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(jl(e,i,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+s,Iz(n,n))}})()});var Tf,U4=p(()=>{_m();sm();ac();_m();Tf=class extends Rs{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return L4(this,t),this.check()}fromEuler(t){switch(this.identity(),t.order){case"xyz":return this.rotateX(t.x).rotateY(t.y).rotateZ(t.z);case"yxz":return this.rotateY(t.y).rotateX(t.x).rotateZ(t.z);case"zxy":return this.rotateZ(t.z).rotateX(t.x).rotateY(t.y);case"zyx":return this.rotateZ(t.z).rotateY(t.y).rotateX(t.x);case"yzx":return this.rotateY(t.y).rotateZ(t.z).rotateX(t.x);case"xzy":return this.rotateX(t.x).rotateZ(t.z).rotateY(t.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(t,r){return Ty(this,t,r),this.check()}rotateTowards(t,r){return G4(this,this,t,r)}identity(){return v4(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Xt(t)}get y(){return this[1]}set y(t){this[1]=Xt(t)}get z(){return this[2]}set z(t){this[2]=Xt(t)}get w(){return this[3]}set w(t){this[3]=Xt(t)}len(){return N4(this)}lengthSquared(){return F4(this)}dot(t){return B4(this,t)}rotationTo(t,r){return k4(this,t,r),this.check()}add(t){return O4(this,this,t),this.check()}calculateW(){return I4(this,this),this.check()}conjugate(){return R4(this,this),this.check()}invert(){return P4(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(D4(this,t,r,n),this.check())}multiplyRight(t){return Ay(this,this,t),this.check()}multiplyLeft(t){return Ay(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return E4(this,this,t),this.check()}rotateY(t){return T4(this,this,t),this.check()}rotateZ(t){return A4(this,this,t),this.check()}scale(t){return C4(this,this,t),this.check()}slerp(t,r,n){let i,o,s;return arguments.length===2?(i=this,o=t,s=r):(i=t,o=r,s=n),Iy(this,i,o,s),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}});function Ry(){return{eastX:0,eastY:1,northZ:1,upX:1,upY:0,upZ:0}}function Ly(e,t,r){let n=e.x,i=e.y,o=e.z,s=t.x,a=t.y,c=t.z;return o!==0?!1:Pz(r,n,i,s*i-a*n,s,a,c)}function Oy(e,t,r,n,i,o){let s=Py(r),a=Py(n),c=Py(i),l=Math.abs(s),u=Math.abs(a),h=Math.abs(c);if(!l||!u||!h||l===u||l===h||u===h||(l%3+1===u?1:-1)*Math.sign(s*a*c)!==1||!Array.isArray(o)&&o.length<16)return!1;let m=e.eastX,g=e.eastY,y=e.northZ,b=e.upX,w=e.upY,_=e.upZ,S=-_*g,M=_*m,v=t.x,C=t.y,R=t.z,E=(l===1?m:l===2?S:b)*Math.sign(s),j=(l===1?g:l===2?M:w)*Math.sign(s),I=(l===1?0:l===2?y:_)*Math.sign(s),O=(u===1?m:u===2?S:b)*Math.sign(a),A=(u===1?g:u===2?M:w)*Math.sign(a),W=(u===1?0:u===2?y:_)*Math.sign(a),k=(h===1?m:h===2?S:b)*Math.sign(c),T=(h===1?g:h===2?M:w)*Math.sign(c),B=(h===1?0:h===2?y:_)*Math.sign(c);return!Number.isFinite(E)||!Number.isFinite(j)||!Number.isFinite(I)||!Number.isFinite(O)||!Number.isFinite(A)||!Number.isFinite(W)||!Number.isFinite(k)||!Number.isFinite(T)||!Number.isFinite(B)||!Number.isFinite(v)||!Number.isFinite(C)||!Number.isFinite(R)||o instanceof Float32Array&&(!Number.isFinite(Math.fround(E))||!Number.isFinite(Math.fround(j))||!Number.isFinite(Math.fround(I))||!Number.isFinite(Math.fround(O))||!Number.isFinite(Math.fround(A))||!Number.isFinite(Math.fround(W))||!Number.isFinite(Math.fround(k))||!Number.isFinite(Math.fround(T))||!Number.isFinite(Math.fround(B))||!Number.isFinite(Math.fround(v))||!Number.isFinite(Math.fround(C))||!Number.isFinite(Math.fround(R)))?!1:(o[0]=E,o[1]=j,o[2]=I,o[3]=0,o[4]=O,o[5]=A,o[6]=W,o[7]=0,o[8]=k,o[9]=T,o[10]=B,o[11]=0,o[12]=v,o[13]=C,o[14]=R,o[15]=1,!0)}function Py(e){switch(e){case"east":return 1;case"west":return-1;case"north":return 2;case"south":return-2;case"up":return 3;case"down":return-3;default:return 0}}function Pz(e,t,r,n,i,o,s){return!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)?!1:(e.eastX=t,e.eastY=r,e.northZ=n,e.upX=i,e.upY=o,e.upZ=s,!0)}var j4=p(()=>{});function Af(e,t,r=e){let n=e.x,i=e.y,o=e.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=t,l=Math.sin(i),u=Math.abs(i)===Math.PI/2?0:Math.cos(i),h=a/s,d=c<.9?s/Math.sqrt(1-c*l*l):s/Math.hypot(u,h*l),m=(d+o)*u*Math.cos(n),g=(d+o)*u*Math.sin(n),y=(d*(c<.9?1-c:h*h)+o)*l;return ql(r,m,g,y)}function If(e,t,r=e){let n=e.x,i=e.y,o=e.z,{semiMajorAxis:s,semiMinorAxis:a,eccentricitySquared:c}=t,l=Math.atan2(i,n),u=Math.hypot(n,i),h=Math.hypot(n,i,o);if(!(h>0)||!Number.isFinite(h))return!1;if(c===0)return ql(r,u===0?0:l,Math.atan2(o,u),h-s);if(u===0)return ql(r,0,Math.sign(o)*Math.PI/2,Math.abs(o)-a);let d=u/s,m=o/a;if(d*d+m*m<1-16*Mm||c>=.9)return Cy(n,i,o,u,s,a,r);let g=o/h,y=u/h,b=1/Math.sqrt(1-c*(2-c)*y*y),w=y*(1-c)*b,_=g*b;for(let S=0;S<30;S++){let M=s/Math.sqrt(1-c*_*_),v=u*w+o*_-M*(1-c*_*_),C=c*M/(M+v);b=1/Math.sqrt(1-C*(2-C)*y*y);let R=y*(1-C)*b,E=g*b;if(Math.abs(E*w-R*_)<=1e-12){if(!Number.isFinite(v))break;return ql(r,l,Math.atan2(E,Math.abs(R)),v)}w=R,_=E}return Cy(n,i,o,u,s,a,r)}function Cy(e,t,r,n,i,o,s){let a=Math.atan2(t,e),c=o/i,l=c*c,u=n/i,h=r/i,d=1-l;if(!(l>0)||c>1)return!1;let m=i*i,g=o*o,y=Number.isFinite(m)&&m>0?(g-l*m+Ls(o,o,g)-l*Ls(i,i,m)-Ls(l,m,l*m))/m:0,b=n*n,w=e*e,_=t*t,S=w+_,M=Number.isFinite(b)&&b>0?(S-b+Sm(w,_,S)+Ls(e,e,w)+Ls(t,t,_)-Ls(n,n,b))/(2*n):0,v=i*l,C=n-i,R=C+v,E=M+Sm(n,-i,C)+Sm(C,v,R)+Ls(i,l,v)+i*y;if(r===0)return R+E<0?!1:ql(s,a,0,C);let j=Math.abs(h)*c,I=0,O=l+Math.hypot(u,h*c);if(!Number.isFinite(O))return!1;let A=Math.max(j,u-d);A>I&&A<O||(A=O/2);let W=-(R+E)/i,k=Math.sqrt(W*(u+d))/d,T=W>0&&Math.abs(r)/k/i*c<=Mm*W?Math.atan2(Math.sign(r)*k/c,u/d):void 0;for(let B=0;B<1024&&T===void 0;B++){let N=d+A,D=u/N,L=r/A/i,P=L*c,z=i*A,we=R-z,ne=(we+(Sm(R,-z,we)+E-Ls(i,A,z)))/(i*N)*(D+1),Oe=ne+P*P;if(!Number.isFinite(Oe))return!1;Oe>0?I=A:O=A;let oe=-2*(D*D/N+P*P/A),Se=A-Oe/oe,Ce=Se>I&&Se<O?Se:I+(O-I)/2;if(Math.abs(Oe)<=4*Mm*(Math.abs(ne)+P*P)||O-I<=4*Mm*A){T=Math.atan2(L,D);break}A=Ce}return T!==void 0&&Rz(s,a,T,n,r,i,c)}function Sm(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function Ls(e,t,r){let n=134217729*e,i=134217729*t;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-e),s=i-(i-t),a=e-o,c=t-s;return o*s-r+o*c+a*s+a*c}function Rz(e,t,r,n,i,o,s){let a=Math.sin(r),c=Math.cos(r);return ql(e,t,r,n*c+i*a-o*Math.hypot(c,s*a))}function ql(e,t,r,n){return!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)?!1:(e.x=t,e.y=r,e.z=n,!0)}var Mm,z4=p(()=>{Mm=Number.EPSILON});function vm(){return Vl??Uint16Array}var Vl,q4=p(()=>{Vl=globalThis.Float16Array});var V4=p(()=>{q4()});var W4=p(()=>{V4()});var H4=p(()=>{wy()});var $4=p(()=>{ym()});var K4=p(()=>{_m()});var X4=p(()=>{lm()});var Y4=p(()=>{zl()});var Z4=p(()=>{bm()});var Fn=p(()=>{HE();QE();M4();U4();AE();dy();kl();j4();z4();W4();H4();$4();K4();X4();Y4();Z4()});var Uo,rre,J4=p(()=>{Uo=6356752314245179e-9,rre={radii:[6378137,6378137,Uo],radiiSquared:[6378137*6378137,6378137*6378137,Uo*Uo],oneOverRadii:[1/6378137,1/6378137,1/Uo],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Uo*Uo)],maximumRadius:Math.max(6378137,6378137,Uo),centerToleranceSquared:.1}});function By(e){return e}function jo(e,t=[],r=By){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Q4(e,t=[]){return jo(e,t,xt._cartographicRadians?By:uy)}function Dy(e,t,r,n){let i=xt._cartographicRadians?By:fy,o=i(e),s=i(t);return"longitude"in n?(n.longitude=o,n.latitude=s,n.height=r):"x"in n?(n.x=o,n.y=s,n.z=r):(n[0]=o,n[1]=s,n[2]=r),n}var ore,e8=p(()=>{Fn();ore=new J});function co(e,t,r,n,i,o,s){let c=[n,i,o,Math.abs(e),Math.abs(t),Math.abs(r)].map(R=>{let E=R.toString(2),j=E.indexOf(".");return{integer:BigInt("0b"+E.replace(".","")),exponent:j<0?0:j+1-E.length}}),l=Math.min(...c.filter(R=>R.integer!==0n).map(R=>R.exponent)),u=c.map(R=>R.integer<<BigInt(R.exponent-l)),h=u.slice(0,3).map(R=>R*R),d=h.reduce((R,E)=>R<E?R:E),m=h.map(R=>R-d),g=h.map((R,E)=>u[E]*u[E+3]),y=64;if(!g.some((R,E)=>m[E]===0n&&R!==0n)){let R=-1n,E=1n;for(let O=0;O<3;O++){if(m[O]===0n)continue;let A=m[O]*m[O];R=R*A+g[O]*g[O]*E,E*=A}if(R<0n)return!1;if(R===0n)return C(0n,1n);let I=m.filter(O=>O>0n).reduce((O,A)=>O<A?O:A);y=Math.max(64,(2n*(E+R)).toString(2).length-(R*I).toString(2).length+128)}let b=1n<<BigInt(y),w=m.map(R=>R*b),_=g.map(R=>R*b),S=_.map(R=>R*R),M=0n,v=_.reduce((R,E)=>R+E,0n);if(v===0n)return!1;for(let R=0;R<4096;R++){let E=M+v>>1n;if(E===M)return!1;let j=w[0]+E,I=w[1]+E,O=w[2]+E,A=j*j,W=I*I,k=O*O,T=S[0]*W*k+S[1]*A*k+S[2]*A*W-A*W*k;if(T===0n)return C(E,b);if(T>0n?M=E:v=E,M>0n&&v-M<=M>>60n)return C(M+v>>1n,b)}return!1;function C(R,E){let j=h.map((W,k)=>{let T=m[k]*E+R;return T===0n?0:Gz(W*u[k+3]*E,T,l)});if(!j.every(Number.isFinite))return!1;let I=Math.sign(e)*j[0],O=Math.sign(t)*j[1],A=Math.sign(r)*j[2];return s.x=I,s.y=O,s.z=A,!0}}function Gz(e,t,r){if(e===0n)return 0;let n=52-(e.toString(2).length-t.toString(2).length),i=n>=0?e<<BigInt(n):e,o=n>=0?t:t<<BigInt(-n),s=i/o,a=i%o;(2n*a>o||2n*a===o&&s&1n)&&s++;let c=r-n,l=Math.max(-1022,Math.min(1023,c));return Number(s)*2**l*2**(c-l)}var t8=p(()=>{});function r8(e,t,r,n,i,o,s){let a=Math.min(n,i,o),c=a*a,l=n*n,u=i*i,h=o*o;if(!(a>0)||!(c>0)||!Number.isFinite(Math.max(l,u,h)))return!1;let d=lc(a,a,c),m=l-c,g=u-c,y=h-c,b=zo(l,-c,m)+lc(n,n,l)-d,w=zo(u,-c,g)+lc(i,i,u)-d,_=zo(h,-c,y)+lc(o,o,h)-d,S=n*Math.abs(e),M=i*Math.abs(t),v=o*Math.abs(r);if(c<2**-1022||e!==0&&S<2**-1022||t!==0&&M<2**-1022||r!==0&&v<2**-1022)return co(e,t,r,n,i,o,s);let C=lc(n,Math.abs(e),S),R=lc(i,Math.abs(t),M),E=lc(o,Math.abs(r),v);if(Math.hypot(m===0?S===0?0:1/0:S/(m+b),g===0?M===0?0:1/0:M/(g+w),y===0?v===0?0:1/0:v/(y+_))<=1+64*Number.EPSILON)return co(e,t,r,n,i,o,s);if((e!==0?1:0)+(t!==0?1:0)+(r!==0?1:0)==1)return s.x=e===0?e:Math.sign(e)*n,s.y=t===0?t:Math.sign(t)*i,s.z=r===0?r:Math.sign(r)*o,!0;let I=Math.hypot(m===0?S:0,g===0?M:0,y===0?v:0),O=Math.hypot(S,M,v);if(!(O>0)||!Number.isFinite(O))return co(e,t,r,n,i,o,s);let A=I>0?I:O;for(let W=0;W<512;W++){let k=m+A,T=g+A,B=y+A,N=zo(m,A,k)+b,D=zo(g,A,T)+w,L=zo(y,A,B)+_,P=S/k,z=M/T,we=v/B,_e,ne;P>=z&&P>=we?(_e=Ny(S,C,m,b,A,k)*(P+1),ne=(z*(1-D/T))**2+(we*(1-L/B))**2):z>=we?(_e=Ny(M,R,g,w,A,T)*(z+1),ne=(P*(1-N/k))**2+(we*(1-L/B))**2):(_e=Ny(v,E,y,_,A,B)*(we+1),ne=(P*(1-N/k))**2+(z*(1-D/T))**2);let Oe=-2*(P*P/k+z*z/T+we*we/B),oe=4*Number.EPSILON*(Math.abs(_e)+ne),Se=_e+ne;if(!Number.isFinite(Se))return co(e,t,r,n,i,o,s);if(Math.abs(Se)<=4*Number.EPSILON*(Math.abs(_e)+ne)||O-I<=4*Number.EPSILON*A){let je=oe/Math.abs(Oe);if(!Number.isFinite(Oe)||!(Math.abs(Oe)>0)||je>2e-13*A)return co(e,t,r,n,i,o,s);let Ke=Math.sign(e)*n*(P*(1-N/k)),ft=Math.sign(t)*i*(z*(1-D/T)),ht=Math.sign(r)*o*(we*(1-L/B)),pt=2*je*Math.max(Math.abs(Ke/k),Math.abs(ft/T),Math.abs(ht/B));return!Number.isFinite(pt)||pt>2e-13*Math.max(n,i,o)?co(e,t,r,n,i,o,s):!Number.isFinite(Ke)||!Number.isFinite(ft)||!Number.isFinite(ht)?co(e,t,r,n,i,o,s):(s.x=Ke,s.y=ft,s.z=ht,!0)}Se>0?I=A:O=A;let Ce=A-Se/Oe,V=Ce>I&&Ce<O?Ce:I+(O-I)/2;if(V===A)return co(e,t,r,n,i,o,s);A=V}return co(e,t,r,n,i,o,s)}function Ny(e,t,r,n,i,o){let s=e-r,a=zo(e,-r,s)+t-n,c=s+a,l=zo(s,a,c),u=c-i;return(u+(zo(c,-i,u)+l))/o}function zo(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function lc(e,t,r){let n=134217729*e,i=134217729*t;if(!Number.isFinite(n)||!Number.isFinite(i))return 0;let o=n-(n-e),s=i-(i-t),a=e-o,c=t-s;return o*s-r+o*c+a*s+a*c}var n8=p(()=>{t8()});function i8(e,t,r=[]){let n=e,i="x"in e?n.x:e[0],o="x"in e?n.y:e[1],s="x"in e?n.z:e[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(i*i+o*o+s*s))return;let{radii:a}=t;if(r8(i,o,s,a.x,a.y,a.z,Em))return lo(r,Em.x,Em.y,Em.z)}function lo(e,t,r,n){if(ao(e))e[0]=t,e[1]=r,e[2]=n;else{let i=e;i.x=t,i.y=r,i.z=n}return e}var Em,o8=p(()=>{Fn();n8();Em={x:0,y:0,z:0}});function s8(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0||t>e)throw new Error("Spheroid requires finite positive axes with semiMinorAxis <= semiMajorAxis")}function Im(e,t,r,n){let i=Math.max(Math.abs(e),Math.abs(t),Math.abs(r));if(!(i>0)||!Number.isFinite(i))return;let o=e/i,s=t/i,a=r/i,c=Math.hypot(o,s,a);return lo(n,o/c,s/c,a/c)}var bn,Tm,zz,di,Am,Tt,a8=p(()=>{Fn();Fn();J4();e8();o8();bn={x:0,y:0,z:0},Tm=new J,zz=new J,di=new J,Am=new J,Tt=class e{static fromSpheroid(t){let{semiMajorAxis:r,semiMinorAxis:n}=t;return s8(r,n),new e(r,r,n)}constructor(t=0,r=0,n=0){this.centerToleranceSquared=im.EPSILON1,Ri(Number.isFinite(t)&&t>=0),Ri(Number.isFinite(r)&&r>=0),Ri(Number.isFinite(n)&&n>=0),this.radii=new J(t,r,n),this.radiiSquared=new J(t*t,r*r,n*n),this.radiiToTheFourth=new J(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new J(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new J(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),n!==0&&(this.squaredXOverSquaredZ=(t/n)**2),t===r&&n>0&&n<=t&&Number.isFinite(this.radiiSquared.x)&&this.radiiSquared.z>0&&(this.spheroidGeometry=Object.freeze({semiMajorAxis:t,semiMinorAxis:n,eccentricitySquared:1-(n/t)**2})),Object.freeze(this.radii),Object.freeze(this.radiiSquared),Object.freeze(this.radiiToTheFourth),Object.freeze(this.oneOverRadii),Object.freeze(this.oneOverRadiiSquared),Object.freeze(this)}toSpheroid(){let{x:t,y:r,z:n}=this.radii;if(t!==r)throw new Error("Spheroid requires equal X/Y radii");return s8(t,n),Object.freeze({semiMajorAxis:t,semiMinorAxis:n})}equals(t){return this===t||!!(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=Q4(t,Am),i=n[0],o=n[1],s=n[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s)||!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius))return;if(this.spheroidGeometry&&(xt._cartographicRadians||Math.abs(o)<=Math.PI/4))return bn.x=i,bn.y=o,bn.z=s,Af(bn,this.spheroidGeometry)?lo(r,bn.x,bn.y,bn.z):void 0;let a=zz;this.geodeticSurfaceNormalCartographic(t,a);let c=a.x,l=a.y,u=a.z,h=this.radii.x,d=this.radii.y,m=this.radii.z,g=Math.hypot(h*c,d*l,m*u),y=h*(h*c/g)+s*c,b=d*(d*l/g)+s*l,w=m*(m*u/g)+s*u;if(!(!Number.isFinite(y)||!Number.isFinite(b)||!Number.isFinite(w)))return lo(r,y,b,w)}cartesianToCartographic(t,r=[0,0,0]){let n=t,i="x"in t?n.x:t[0],o="x"in t?n.y:t[1],s="x"in t?n.z:t[2];if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(s))return;if(this.spheroidGeometry&&Number.isFinite(i*i+o*o+s*s)&&Number.isFinite(this.oneOverRadiiSquared.x)&&Number.isFinite(this.oneOverRadiiSquared.z)){bn.x=i,bn.y=o,bn.z=s;let _=this.spheroidGeometry;if(!(s===0&&_.semiMinorAxis<_.semiMajorAxis&&Math.abs(Math.hypot(i,o)-_.semiMajorAxis*_.eccentricitySquared)<=64*Number.EPSILON*_.semiMajorAxis)&&If(bn,_)){let M=i===0&&o===0?Math.atan2(o,i):bn.x;return Dy(M,bn.y,bn.z,r)}}if(!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius)||!Number.isFinite(1/(this.minimumRadius*this.minimumRadius)))return;Am.set(i,o,s);let a=this.scaleToGeodeticSurface(Am,di);if(!a)return;let c=a[0]*this.oneOverRadiiSquared.x,l=a[1]*this.oneOverRadiiSquared.y,u=a[2]*this.oneOverRadiiSquared.z,h=Math.hypot(c,l,u);if(!(h>0)||!Number.isFinite(h))return;let d=c/h,m=l/h,g=u/h,y=Math.atan2(m,d),b=Math.atan2(g,Math.hypot(d,m)),w=(i-a[0])*d+(o-a[1])*m+(s-a[2])*g;return Dy(y,b,w,r)}geocentricSurfaceNormal(t,r=[0,0,0]){jo(t,Tm);let n=Tm;return Im(n.x,n.y,n.z,r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=jo(t,Am),i=xt._cartographicRadians?n[0]:n[0]*Math.PI/180,o=xt._cartographicRadians?n[1]:n[1]*Math.PI/180,s=!xt._cartographicRadians&&Math.abs(n[1])>45,a=(90-Math.abs(n[1]))*Math.PI/180,c=s?Math.sin(a):Math.abs(o)===Math.PI/2?0:Math.cos(o),l=s?Math.sign(n[1])*Math.cos(a):Math.sin(o);return Im(c*Math.cos(i),c*Math.sin(i),l,r)}geodeticSurfaceNormal(t,r=[0,0,0]){if(!(this.minimumRadius>0))return;jo(t,Tm);let n=Tm,i=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(n.z));if(!(i>0)||!Number.isFinite(i))return;let o=n.x/i*(this.minimumRadius/this.radii.x)**2,s=n.y/i*(this.minimumRadius/this.radii.y)**2,a=n.z/i*(this.minimumRadius/this.radii.z)**2;if((n.x===0||Math.abs(o)>=2**-1022)&&(n.y===0||Math.abs(s)>=2**-1022)&&(n.z===0||Math.abs(a)>=2**-1022))return Im(o,s,a,r);let c=n.x===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.x)))),l=n.y===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.y)))),u=n.z===0?0:Math.min(1023,Math.floor(Math.log2(Math.abs(n.z)))),h=Math.min(1023,Math.floor(Math.log2(this.radii.x))),d=Math.min(1023,Math.floor(Math.log2(this.radii.y))),m=Math.min(1023,Math.floor(Math.log2(this.radii.z))),g=Math.max(n.x===0?-1/0:c-2*h,n.y===0?-1/0:l-2*d,n.z===0?-1/0:u-2*m);return Im(n.x===0?n.x:n.x/2**c/(this.radii.x/2**h)**2*2**(c-2*h-g),n.y===0?n.y:n.y/2**l/(this.radii.y/2**d)**2*2**(l-2*d-g),n.z===0?n.z:n.z/2**u/(this.radii.z/2**m)**2*2**(u-2*m-g),r)}scaleToGeodeticSurface(t,r){return i8(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){jo(t,di);let n=di,i=Math.max(Math.abs(n.x),Math.abs(n.y),Math.abs(n.z));if(!(this.minimumRadius>0)||!(i>0)||!Number.isFinite(i))return;let o=n.x*n.x*this.oneOverRadiiSquared.x+n.y*n.y*this.oneOverRadiiSquared.y+n.z*n.z*this.oneOverRadiiSquared.z;if(o>=2**-1022&&Number.isFinite(o)&&i*i>=2**-1022&&Number.isFinite(i*i)){let u=1/Math.sqrt(o);return lo(r,n.x*u,n.y*u,n.z*u)}let s=n.x/i,a=n.y/i,c=n.z/i,l=Math.hypot(s/this.radii.x,a/this.radii.y,c/this.radii.z);if(!(!(l>0)||!Number.isFinite(l)))return lo(r,s/l,a/l,c/l)}transformPositionToScaledSpace(t,r=[0,0,0]){jo(t,di);let n=di.scale(this.oneOverRadii);return lo(r,n.x,n.y,n.z)}transformPositionFromScaledSpace(t,r=[0,0,0]){jo(t,di);let n=di.scale(this.radii);return lo(r,n.x,n.y,n.z)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){if(Ri(this.radii.x===this.radii.y&&this.minimumRadius>0),jo(t,di),!Number.isFinite(di.x)||!Number.isFinite(di.y)||!Number.isFinite(di.z)||!Number.isFinite(r))return;let i=di.z*(1-this.squaredXOverSquaredZ);if(Number.isFinite(i)&&!(Math.abs(i)>=this.radii.z-r))return lo(n,0,0,i)}};Tt.WGS84=new Tt(6378137,6378137,Uo)});var er,c8=p(()=>{er={};er.Constants={};er.Math={};er.Accumulator={};(function(e){"use strict";e.WGS84={a:6378137,f:1/298.257223563},e.version={major:2,minor:2,patch:0},e.version_string="2.2.0"})(er.Constants);(function(e){"use strict";e.digits=53,e.epsilon=Math.pow(.5,e.digits-1),e.degree=Math.PI/180,e.sq=function(t){return t*t},e.hypot=function(t,r){return Math.sqrt(t*t+r*r)},e.cbrt=Math.cbrt||function(t){var r=Math.pow(Math.abs(t),.3333333333333333);return t>0?r:t<0?-r:t},e.log1p=Math.log1p||function(t){var r=1+t,n=r-1;return n===0?t:t*Math.log(r)/n},e.atanh=Math.atanh||function(t){var r=Math.abs(t);return r=e.log1p(2*r/(1-r))/2,t>0?r:t<0?-r:t},e.copysign=function(t,r){return Math.abs(t)*(r<0||r===0&&1/r<0?-1:1)},e.sum=function(t,r){var n=t+r,i=n-r,o=n-i,s;return i-=t,o-=r,s=n&&0-(i+o),{s:n,t:s}},e.polyval=function(t,r,n,i){for(var o=t<0?0:r[n++];--t>=0;)o=o*i+r[n++];return o},e.AngRound=function(t){var r=.0625,n=Math.abs(t);return n=n<r?r-(r-n):n,e.copysign(n,t)},e.remainder=function(t,r){return t%=r,t<-r/2?t+r:t<r/2?t:t-r},e.AngNormalize=function(t){var r=e.remainder(t,360);return Math.abs(r)===180?e.copysign(180,t):r},e.LatFix=function(t){return Math.abs(t)>90?NaN:t},e.AngDiff=function(t,r){var n=e.sum(e.remainder(-t,360),e.remainder(r,360)),i,o;return n=e.sum(e.remainder(n.s,360),n.t),i=n.s,o=n.t,(i===0||Math.abs(i)===180)&&(i=e.copysign(i,o===0?r-t:-o)),{d:i,e:o}},e.sincosd=function(t){var r,n,i,o,s,a,c;switch(r=t%360,i=Math.round(r/90),r-=90*i,n=r*this.degree,o=Math.sin(n),s=Math.cos(n),Math.abs(r)===45?(s=Math.sqrt(.5),o=e.copysign(s,n)):Math.abs(r)===30&&(s=Math.sqrt(.75),o=e.copysign(.5,n)),i&3){case 0:a=o,c=s;break;case 1:a=s,c=-o;break;case 2:a=-o,c=-s;break;default:a=-s,c=o;break}return c+=0,a===0&&(a=e.copysign(a,t)),{s:a,c}},e.sincosde=function(t,r){var n,i,o,s,a,c,l;switch(n=t%360,o=Math.round(n/90),n=e.AngRound(n-90*o+r),i=n*this.degree,s=Math.sin(i),a=Math.cos(i),Math.abs(n)===45?(a=Math.sqrt(.5),s=e.copysign(a,i)):Math.abs(n)===30&&(a=Math.sqrt(.75),s=e.copysign(.5,i)),o&3){case 0:c=s,l=a;break;case 1:c=a,l=-s;break;case 2:c=-s,l=-a;break;default:c=-a,l=s;break}return l+=0,c===0&&(c=e.copysign(c,t+r)),{s:c,c:l}},e.atan2d=function(t,r){var n=0,i;switch(Math.abs(t)>Math.abs(r)&&([t,r]=[r,t],n=2),e.copysign(1,r)<0&&(r=-r,++n),i=Math.atan2(t,r)/this.degree,n){case 1:i=e.copysign(180,t)-i;break;case 2:i=90-i;break;case 3:i=-90+i;break;default:break}return i}})(er.Math);(function(e,t){"use strict";e.Accumulator=function(r){this.Set(r)},e.Accumulator.prototype.Set=function(r){r||(r=0),r.constructor===e.Accumulator?(this._s=r._s,this._t=r._t):(this._s=r,this._t=0)},e.Accumulator.prototype.Add=function(r){var n=t.sum(r,this._t),i=t.sum(n.s,this._s);n=n.t,this._s=i.s,this._t=i.t,this._s===0?this._s=n:this._t+=n},e.Accumulator.prototype.Sum=function(r){var n;return r?(n=new e.Accumulator(this),n.Add(r),n._s):this._s},e.Accumulator.prototype.Negate=function(){this._s*=-1,this._t*=-1},e.Accumulator.prototype.Remainder=function(r){this._s=t.remainder(this._s,r),this.Add(0)}})(er.Accumulator,er.Math);er.Geodesic={};er.GeodesicLine={};er.PolygonArea={};(function(e,t,r,n,i){"use strict";var o=6,s=o,a=o,c=o,l=c,u,h,d=20,m=d+n.digits+10,g=n.epsilon,y=200*g,b=Math.sqrt(g),w=g,_=1e3*b,S=0,M=31,v=32640,C,R,E,j,I,O,A,W,k;e.tiny_=Math.sqrt(Number.MIN_VALUE/Number.EPSILON),e.nC1_=o,e.nC1p_=o,e.nC2_=o,e.nC3_=o,e.nC4_=o,u=e.nC3_*(e.nC3_-1)/2,h=e.nC4_*(e.nC4_+1)/2,e.CAP_C1=1,e.CAP_C1p=2,e.CAP_C2=4,e.CAP_C3=8,e.CAP_C4=16,e.NONE=0,e.ARC=64,e.LATITUDE=128|S,e.LONGITUDE=256|e.CAP_C3,e.AZIMUTH=512|S,e.DISTANCE=1024|e.CAP_C1,e.STANDARD=e.LATITUDE|e.LONGITUDE|e.AZIMUTH|e.DISTANCE,e.DISTANCE_IN=2048|e.CAP_C1|e.CAP_C1p,e.REDUCEDLENGTH=4096|e.CAP_C1|e.CAP_C2,e.GEODESICSCALE=8192|e.CAP_C1|e.CAP_C2,e.AREA=16384|e.CAP_C4,e.ALL=v|M,e.LONG_UNROLL=32768,e.OUT_MASK=v|e.LONG_UNROLL,e.SinCosSeries=function(T,B,N,D,L){if(L!==void 0){var P=L/2,z=Math.sin(P),we=Math.cos(P);return-2*e.SinCosSeries(!1,N*we-B*z,B*we+N*z,D.map(function(Ce,V){return(V%2?-Ce:Ce)*Math.sin((2*V+1)*P)}))}var _e=D.length,ne=_e-(T?1:0),Oe=2*(N-B)*(N+B),oe=ne&1?D[--_e]:0,Se=0;for(ne=Math.floor(ne/2);ne--;)Se=Oe*oe-Se+D[--_e],oe=Oe*Se-oe+D[--_e];return T?2*B*N*oe:N*(oe-Se)},C=function(T,B){var N,D=n.sq(T),L=n.sq(B),P=(D+L-1)/6,z,we,_e,ne,Oe,oe,Se,Ce,V,je,Ke;return L===0&&P<=0?N=0:(z=D*L/4,we=n.sq(P),_e=P*we,ne=z*(z+2*_e),Oe=P,ne>=0?(oe=z+_e,oe+=oe<0?-Math.sqrt(ne):Math.sqrt(ne),Se=n.cbrt(oe),Oe+=Se+(Se!==0?we/Se:0)):(Ce=Math.atan2(Math.sqrt(-ne),-(z+_e)),Oe+=2*P*Math.cos(Ce/3)),V=Math.sqrt(n.sq(Oe)+L),je=Oe<0?L/(V-Oe):Oe+V,Ke=(je-L)/(2*V),N=je/(Math.sqrt(je+n.sq(Ke))+Ke)),N},R=[1,4,64,0,256],e.A1m1f=function(T){var B=Math.floor(s/2),N=n.polyval(B,R,0,n.sq(T))/R[B+1];return(N+T)/(1-T)},E=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],e.C1f=function(T,B){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=e.nC1_;++P)z=Math.floor((e.nC1_-P)/2),B[P]=D*n.polyval(z,E,L,N)/E[L+z+1],L+=z+2,D*=T},j=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],e.C1pf=function(T,B){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=e.nC1p_;++P)z=Math.floor((e.nC1p_-P)/2),B[P]=D*n.polyval(z,j,L,N)/j[L+z+1],L+=z+2,D*=T},I=[-11,-28,-192,0,256],e.A2m1f=function(T){var B=Math.floor(a/2),N=n.polyval(B,I,0,n.sq(T))/I[B+1];return(N-T)/(1+T)},O=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],e.C2f=function(T,B){var N=n.sq(T),D=T,L=0,P,z;for(P=1;P<=e.nC2_;++P)z=Math.floor((e.nC2_-P)/2),B[P]=D*n.polyval(z,O,L,N)/O[L+z+1],L+=z+2,D*=T},e.Geodesic=function(T,B){if(this.a=T,this.f=B,this._f1=1-this.f,this._e2=this.f*(2-this.f),this._ep2=this._e2/n.sq(this._f1),this._n=this.f/(2-this.f),this._b=this.a*this._f1,this._c2=(n.sq(this.a)+n.sq(this._b)*(this._e2===0?1:(this._e2>0?n.atanh(Math.sqrt(this._e2)):Math.atan(Math.sqrt(-this._e2)))/Math.sqrt(Math.abs(this._e2))))/2,this._etol2=.1*b/Math.sqrt(Math.max(.001,Math.abs(this.f))*Math.min(1,1-this.f/2)/2),!(isFinite(this.a)&&this.a>0))throw new Error("Equatorial radius is not positive");if(!(isFinite(this._b)&&this._b>0))throw new Error("Polar semi-axis is not positive");this._A3x=new Array(l),this._C3x=new Array(u),this._C4x=new Array(h),this.A3coeff(),this.C3coeff(),this.C4coeff()},A=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],e.Geodesic.prototype.A3coeff=function(){var T=0,B=0,N,D;for(N=c-1;N>=0;--N)D=Math.min(c-N-1,N),this._A3x[B++]=n.polyval(D,A,T,this._n)/A[T+D+1],T+=D+2},W=[3,128,2,5,128,-1,3,3,64,-1,0,1,8,-1,1,4,5,256,1,3,128,-3,-2,3,64,1,-3,2,32,7,512,-10,9,384,5,-9,5,192,7,512,-14,7,512,21,2560],e.Geodesic.prototype.C3coeff=function(){var T=0,B=0,N,D,L;for(N=1;N<e.nC3_;++N)for(D=e.nC3_-1;D>=N;--D)L=Math.min(e.nC3_-D-1,D),this._C3x[B++]=n.polyval(L,W,T,this._n)/W[T+L+1],T+=L+2},k=[97,15015,1088,156,45045,-224,-4784,1573,45045,-10656,14144,-4576,-858,45045,64,624,-4576,6864,-3003,15015,100,208,572,3432,-12012,30030,45045,1,9009,-2944,468,135135,5792,1040,-1287,135135,5952,-11648,9152,-2574,135135,-64,-624,4576,-6864,3003,135135,8,10725,1856,-936,225225,-8448,4992,-1144,225225,-1440,4160,-4576,1716,225225,-136,63063,1024,-208,105105,3584,-3328,1144,315315,-128,135135,-2560,832,405405,128,99099],e.Geodesic.prototype.C4coeff=function(){var T=0,B=0,N,D,L;for(N=0;N<e.nC4_;++N)for(D=e.nC4_-1;D>=N;--D)L=e.nC4_-D-1,this._C4x[B++]=n.polyval(L,k,T,this._n)/k[T+L+1],T+=L+2},e.Geodesic.prototype.A3f=function(T){return n.polyval(l-1,this._A3x,0,T)},e.Geodesic.prototype.C3f=function(T,B){var N=1,D=0,L,P;for(L=1;L<e.nC3_;++L)P=e.nC3_-L-1,N*=T,B[L]=N*n.polyval(P,this._C3x,D,T),D+=P+1},e.Geodesic.prototype.C4f=function(T,B){var N=1,D=0,L,P;for(L=0;L<e.nC4_;++L)P=e.nC4_-L-1,B[L]=N*n.polyval(P,this._C4x,D,T),D+=P+1,N*=T},e.Geodesic.prototype.Lengths=function(T,B,N,D,L,P,z,we,_e,ne,Oe,oe,Se){Oe&=e.OUT_MASK;var Ce={},V=0,je=0,Ke=0,ft=0,ht,pt,Lt,Jt,gr;if(Oe&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&(Ke=e.A1m1f(T),e.C1f(T,oe),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(ft=e.A2m1f(T),e.C2f(T,Se),V=Ke-ft,ft=1+ft),Ke=1+Ke),Oe&e.DISTANCE)ht=e.SinCosSeries(!0,P,z,oe)-e.SinCosSeries(!0,N,D,oe),Ce.s12b=Ke*(B+ht),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(pt=e.SinCosSeries(!0,P,z,Se)-e.SinCosSeries(!0,N,D,Se),je=V*B+(Ke*ht-ft*pt));else if(Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)){for(Lt=1;Lt<=e.nC2_;++Lt)Se[Lt]=Ke*oe[Lt]-ft*Se[Lt];je=V*B+(e.SinCosSeries(!0,P,z,Se)-e.SinCosSeries(!0,N,D,Se))}return Oe&e.REDUCEDLENGTH?(Ce.m0=V,Ce.m12b=we*(D*P)-L*(N*z)-D*z*je):Ce.m12b=NaN,Oe&e.GEODESICSCALE&&(Jt=D*z+N*P,gr=this._ep2*(_e-ne)*(_e+ne)/(L+we),Ce.M12=Jt+(gr*P-z*je)*N/L,Ce.M21=Jt-(gr*N-D*je)*P/we),Ce},e.Geodesic.prototype.InverseStart=function(T,B,N,D,L,P,z,we,_e,ne,Oe){var oe={},Se=D*B-L*T,Ce=L*B+D*T,V,je,Ke,ft,ht,pt,Lt,Jt,gr,Ve,qe,We,zt,yr,Ms,vs,tf,Zi,nt,Yr,Sr,dn,Bn;return oe.sig12=-1,V=D*B,V+=L*T,je=Ce>=0&&Se<.5&&L*z<.5,je?(ft=n.sq(T+D),ft/=ft+n.sq(B+L),oe.dnm=Math.sqrt(1+this._ep2*ft),Ke=z/(this._f1*oe.dnm),ht=Math.sin(Ke),pt=Math.cos(Ke)):(ht=we,pt=_e),oe.salp1=L*ht,oe.calp1=pt>=0?Se+L*T*n.sq(ht)/(1+pt):V-L*T*n.sq(ht)/(1-pt),Jt=n.hypot(oe.salp1,oe.calp1),gr=T*D+B*L*pt,je&&Jt<this._etol2?(oe.salp2=B*ht,oe.calp2=Se-B*D*(pt>=0?n.sq(ht)/(1+pt):1-pt),Lt=n.hypot(oe.salp2,oe.calp2),oe.salp2/=Lt,oe.calp2/=Lt,oe.sig12=Math.atan2(Jt,gr)):Math.abs(this._n)>.1||gr>=0||Jt>=6*Math.abs(this._n)*Math.PI*n.sq(B)||(Bn=Math.atan2(-we,-_e),this.f>=0?(yr=n.sq(T)*this._ep2,Ms=yr/(2*(1+Math.sqrt(1+yr))+yr),We=this.f*B*this.A3f(Ms)*Math.PI,zt=We*B,Ve=Bn/We,qe=V/zt):(vs=L*B-D*T,tf=Math.atan2(V,vs),Yr=this.Lengths(this._n,Math.PI+tf,T,-B,N,D,L,P,B,L,e.REDUCEDLENGTH,ne,Oe),Zi=Yr.m12b,nt=Yr.m0,Ve=-1+Zi/(B*L*nt*Math.PI),zt=Ve<-.01?V/Ve:-this.f*n.sq(B)*Math.PI,We=zt/B,qe=z/We),qe>-y&&Ve>-1-_?this.f>=0?(oe.salp1=Math.min(1,-Ve),oe.calp1=-Math.sqrt(1-n.sq(oe.salp1))):(oe.calp1=Math.max(Ve>-y?0:-1,Ve),oe.salp1=Math.sqrt(1-n.sq(oe.calp1))):(Sr=C(Ve,qe),dn=We*(this.f>=0?-Ve*Sr/(1+Sr):-qe*(1+Sr)/Sr),ht=Math.sin(dn),pt=-Math.cos(dn),oe.salp1=L*ht,oe.calp1=V-L*T*n.sq(ht)/(1-pt))),oe.salp1<=0?(oe.salp1=1,oe.calp1=0):(Lt=n.hypot(oe.salp1,oe.calp1),oe.salp1/=Lt,oe.calp1/=Lt),oe},e.Geodesic.prototype.Lambda12=function(T,B,N,D,L,P,z,we,_e,ne,Oe,oe,Se,Ce){var V={},je,Ke,ft,ht,pt,Lt,Jt,gr,Ve,qe,We,zt,yr;return T===0&&we===0&&(we=-e.tiny_),Ke=z*B,ft=n.hypot(we,z*T),V.ssig1=T,ht=Ke*T,V.csig1=pt=we*B,je=n.hypot(V.ssig1,V.csig1),V.ssig1/=je,V.csig1/=je,V.salp2=L!==B?Ke/L:z,V.calp2=L!==B||Math.abs(D)!==-T?Math.sqrt(n.sq(we*B)+(B<-T?(L-B)*(B+L):(T-D)*(T+D)))/L:Math.abs(we),V.ssig2=D,Lt=Ke*D,V.csig2=Jt=V.calp2*L,je=n.hypot(V.ssig2,V.csig2),V.ssig2/=je,V.csig2/=je,V.sig12=Math.atan2(Math.max(0,V.csig1*V.ssig2-V.ssig1*V.csig2),V.csig1*V.csig2+V.ssig1*V.ssig2),gr=Math.max(0,pt*Lt-ht*Jt),Ve=pt*Jt+ht*Lt,We=Math.atan2(gr*ne-Ve*_e,Ve*ne+gr*_e),zt=n.sq(ft)*this._ep2,V.eps=zt/(2*(1+Math.sqrt(1+zt))+zt),this.C3f(V.eps,Ce),qe=e.SinCosSeries(!0,V.ssig2,V.csig2,Ce)-e.SinCosSeries(!0,V.ssig1,V.csig1,Ce),V.domg12=-this.f*this.A3f(V.eps)*Ke*(V.sig12+qe),V.lam12=We+V.domg12,Oe&&(V.calp2===0?V.dlam12=-2*this._f1*N/T:(yr=this.Lengths(V.eps,V.sig12,V.ssig1,V.csig1,N,V.ssig2,V.csig2,P,B,L,e.REDUCEDLENGTH,oe,Se),V.dlam12=yr.m12b,V.dlam12*=this._f1/(V.calp2*L))),V},e.Geodesic.prototype.Inverse=function(T,B,N,D,L){var P,z;return L||(L=e.STANDARD),L===e.LONG_UNROLL&&(L|=e.STANDARD),L&=e.OUT_MASK,P=this.InverseInt(T,B,N,D,L),z=P.vals,L&e.AZIMUTH&&(z.azi1=n.atan2d(P.salp1,P.calp1),z.azi2=n.atan2d(P.salp2,P.calp2)),z},e.Geodesic.prototype.InverseInt=function(T,B,N,D,L){var P={},z,we,_e,ne,Oe,oe,Se,Ce,V,je,Ke,ft,ht,pt,Lt,Jt,gr,Ve,qe,We,zt,yr,Ms,vs,tf,Zi,nt,Yr,Sr,dn,Bn,nd,id,ml,Ya,rf,nf,of,sf,od,v1,pl,E1,sd,T1,A1,I1,q_,P1,ad,R1,cd,V_,af,W_,H_,cf,ld,lf,L1,O1,ud,fd,C1,B1;if(P.lat1=T=n.LatFix(T),P.lat2=N=n.LatFix(N),T=n.AngRound(T),N=n.AngRound(N),z=n.AngDiff(B,D),we=z.e,z=z.d,L&e.LONG_UNROLL?(P.lon1=B,P.lon2=B+z+we):(P.lon1=n.AngNormalize(B),P.lon2=n.AngNormalize(D)),_e=n.copysign(1,z),z*=_e,we*=_e,Lt=z*n.degree,ne=n.sincosde(z,we),Jt=ne.s,gr=ne.c,we=180-z-we,Oe=Math.abs(T)<Math.abs(N)||isNaN(N)?-1:1,Oe<0&&(_e*=-1,[N,T]=[T,N]),oe=n.copysign(1,-T),T*=oe,N*=oe,ne=n.sincosd(T),Se=this._f1*ne.s,Ce=ne.c,ne=n.hypot(Se,Ce),Se/=ne,Ce/=ne,Ce=Math.max(e.tiny_,Ce),ne=n.sincosd(N),V=this._f1*ne.s,je=ne.c,ne=n.hypot(V,je),V/=ne,je/=ne,je=Math.max(e.tiny_,je),Ce<-Se?je===Ce&&(V=n.copysign(Se,V)):Math.abs(V)===-Se&&(je=Ce),ht=Math.sqrt(1+this._ep2*n.sq(Se)),pt=Math.sqrt(1+this._ep2*n.sq(V)),Ms=new Array(e.nC1_+1),vs=new Array(e.nC2_+1),tf=new Array(e.nC3_),Zi=T===-90||Jt===0,Zi&&(qe=gr,We=Jt,zt=1,yr=0,Yr=Se,Sr=qe*Ce,dn=V,Bn=zt*je,Ve=Math.atan2(Math.max(0,Sr*dn-Yr*Bn),Sr*Bn+Yr*dn),nt=this.Lengths(this._n,Ve,Yr,Sr,ht,dn,Bn,pt,Ce,je,L|e.DISTANCE|e.REDUCEDLENGTH,Ms,vs),Ke=nt.s12b,ft=nt.m12b,L&e.GEODESICSCALE&&(P.M12=nt.M12,P.M21=nt.M21),Ve<b||ft>=0?((Ve<3*e.tiny_||Ve<g&&(Ke<0||ft<0))&&(Ve=ft=Ke=0),ft*=this._b,Ke*=this._b,P.a12=Ve/n.degree):Zi=!1),cf=2,!Zi&&Se===0&&(this.f<=0||we>=this.f*180))qe=zt=0,We=yr=1,Ke=this.a*Lt,Ve=id=Lt/this._f1,ft=this._b*Math.sin(Ve),L&e.GEODESICSCALE&&(P.M12=P.M21=Math.cos(Ve)),P.a12=z/this._f1;else if(!Zi)if(nt=this.InverseStart(Se,Ce,ht,V,je,pt,Lt,Jt,gr,Ms,vs),Ve=nt.sig12,We=nt.salp1,qe=nt.calp1,Ve>=0)yr=nt.salp2,zt=nt.calp2,ml=nt.dnm,Ke=Ve*this._b*ml,ft=n.sq(ml)*this._b*Math.sin(Ve/ml),L&e.GEODESICSCALE&&(P.M12=P.M21=Math.cos(Ve/ml)),P.a12=Ve/n.degree,id=Lt/(this._f1*ml);else{for(Ya=0,rf=e.tiny_,nf=1,of=e.tiny_,sf=-1,od=!1,v1=!1;nt=this.Lambda12(Se,Ce,ht,V,je,pt,We,qe,Jt,gr,Ya<d,Ms,vs,tf),pl=nt.lam12,yr=nt.salp2,zt=nt.calp2,Ve=nt.sig12,Yr=nt.ssig1,Sr=nt.csig1,dn=nt.ssig2,Bn=nt.csig2,nd=nt.eps,lf=nt.domg12,E1=nt.dlam12,!(v1||!(Math.abs(pl)>=(od?8:1)*g)||Ya==m);++Ya){if(pl>0&&(Ya<d||qe/We>sf/of)?(of=We,sf=qe):pl<0&&(Ya<d||qe/We<nf/rf)&&(rf=We,nf=qe),Ya<d&&E1>0&&(sd=-pl/E1,Math.abs(sd)<Math.PI&&(T1=Math.sin(sd),A1=Math.cos(sd),I1=We*A1+qe*T1,I1>0))){qe=qe*A1-We*T1,We=I1,ne=n.hypot(We,qe),We/=ne,qe/=ne,od=Math.abs(pl)<=16*g;continue}We=(rf+of)/2,qe=(nf+sf)/2,ne=n.hypot(We,qe),We/=ne,qe/=ne,od=!1,v1=Math.abs(rf-We)+(nf-qe)<w||Math.abs(We-of)+(qe-sf)<w}q_=L|(L&(e.REDUCEDLENGTH|e.GEODESICSCALE)?e.DISTANCE:e.NONE),nt=this.Lengths(nd,Ve,Yr,Sr,ht,dn,Bn,pt,Ce,je,q_,Ms,vs),Ke=nt.s12b,ft=nt.m12b,L&e.GEODESICSCALE&&(P.M12=nt.M12,P.M21=nt.M21),ft*=this._b,Ke*=this._b,P.a12=Ve/n.degree,L&e.AREA&&(C1=Math.sin(lf),B1=Math.cos(lf),cf=Jt*B1-gr*C1,ld=gr*B1+Jt*C1)}return L&e.DISTANCE&&(P.s12=0+Ke),L&e.REDUCEDLENGTH&&(P.m12=0+ft),L&e.AREA&&(P1=We*Ce,ad=n.hypot(qe,We*Se),ad!==0&&P1!==0?(Yr=Se,Sr=qe*Ce,dn=V,Bn=zt*je,cd=n.sq(ad)*this._ep2,nd=cd/(2*(1+Math.sqrt(1+cd))+cd),V_=n.sq(this.a)*ad*P1*this._e2,ne=n.hypot(Yr,Sr),Yr/=ne,Sr/=ne,ne=n.hypot(dn,Bn),dn/=ne,Bn/=ne,af=new Array(e.nC4_),this.C4f(nd,af),W_=e.SinCosSeries(!1,Yr,Sr,af),H_=e.SinCosSeries(!1,dn,Bn,af),P.S12=V_*(Ve<.01?e.SinCosSeries(!1,Yr,Sr,af,Ve):H_-W_)):P.S12=0,!Zi&&cf==2&&(cf=Math.sin(id),ld=Math.cos(id)),!Zi&&ld>-.7071&&V-Se<1.75?(lf=1+ld,L1=1+Ce,O1=1+je,R1=2*Math.atan2(cf*(Se*O1+V*L1),lf*(Se*V+L1*O1))):(ud=yr*qe-zt*We,fd=zt*qe+yr*We,ud===0&&fd<0&&(ud=e.tiny_*qe,fd=-1),R1=Math.atan2(ud,fd)),P.S12+=this._c2*R1,P.S12*=Oe*_e*oe,P.S12+=0),Oe<0&&([yr,We]=[We,yr],[zt,qe]=[qe,zt],L&e.GEODESICSCALE&&([P.M21,P.M12]=[P.M12,P.M21])),We*=Oe*_e,qe*=Oe*oe,yr*=Oe*_e,zt*=Oe*oe,{vals:P,salp1:We,calp1:qe,salp2:yr,calp2:zt}},e.Geodesic.prototype.GenDirect=function(T,B,N,D,L,P){var z;return P?P===e.LONG_UNROLL&&(P|=e.STANDARD):P=e.STANDARD,D||(P|=e.DISTANCE_IN),z=new t.GeodesicLine(this,T,B,N,P),z.GenPosition(D,L,P)},e.Geodesic.prototype.Direct=function(T,B,N,D,L){return this.GenDirect(T,B,N,!1,D,L)},e.Geodesic.prototype.ArcDirect=function(T,B,N,D,L){return this.GenDirect(T,B,N,!0,D,L)},e.Geodesic.prototype.Line=function(T,B,N,D){return new t.GeodesicLine(this,T,B,N,D)},e.Geodesic.prototype.DirectLine=function(T,B,N,D,L){return this.GenDirectLine(T,B,N,!1,D,L)},e.Geodesic.prototype.ArcDirectLine=function(T,B,N,D,L){return this.GenDirectLine(T,B,N,!0,D,L)},e.Geodesic.prototype.GenDirectLine=function(T,B,N,D,L,P){var z;return P||(P=e.STANDARD|e.DISTANCE_IN),D||(P|=e.DISTANCE_IN),z=new t.GeodesicLine(this,T,B,N,P),z.GenSetDistance(D,L),z},e.Geodesic.prototype.InverseLine=function(T,B,N,D,L){var P,z,we;return L||(L=e.STANDARD|e.DISTANCE_IN),P=this.InverseInt(T,B,N,D,e.ARC),we=n.atan2d(P.salp1,P.calp1),L&(e.OUT_MASK&e.DISTANCE_IN)&&(L|=e.DISTANCE),z=new t.GeodesicLine(this,T,B,we,L,P.salp1,P.calp1),z.SetArc(P.vals.a12),z},e.Geodesic.prototype.Polygon=function(T){return new r.PolygonArea(this,T)},e.WGS84=new e.Geodesic(i.WGS84.a,i.WGS84.f)})(er.Geodesic,er.GeodesicLine,er.PolygonArea,er.Math,er.Constants);(function(e,t,r){"use strict";t.GeodesicLine=function(n,i,o,s,a,c,l){var u,h,d,m,g,y;a||(a=e.STANDARD|e.DISTANCE_IN),this.a=n.a,this.f=n.f,this._b=n._b,this._c2=n._c2,this._f1=n._f1,this.caps=a|e.LATITUDE|e.AZIMUTH|e.LONG_UNROLL,this.lat1=r.LatFix(i),this.lon1=o,typeof c>"u"||typeof l>"u"?(this.azi1=r.AngNormalize(s),u=r.sincosd(r.AngRound(this.azi1)),this.salp1=u.s,this.calp1=u.c):(this.azi1=s,this.salp1=c,this.calp1=l),u=r.sincosd(r.AngRound(this.lat1)),d=this._f1*u.s,h=u.c,u=r.hypot(d,h),d/=u,h/=u,h=Math.max(e.tiny_,h),this._dn1=Math.sqrt(1+n._ep2*r.sq(d)),this._salp0=this.salp1*h,this._calp0=r.hypot(this.calp1,this.salp1*d),this._ssig1=d,this._somg1=this._salp0*d,this._csig1=this._comg1=d!==0||this.calp1!==0?h*this.calp1:1,u=r.hypot(this._ssig1,this._csig1),this._ssig1/=u,this._csig1/=u,this._k2=r.sq(this._calp0)*n._ep2,m=this._k2/(2*(1+Math.sqrt(1+this._k2))+this._k2),this.caps&e.CAP_C1&&(this._A1m1=e.A1m1f(m),this._C1a=new Array(e.nC1_+1),e.C1f(m,this._C1a),this._B11=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C1a),g=Math.sin(this._B11),y=Math.cos(this._B11),this._stau1=this._ssig1*y+this._csig1*g,this._ctau1=this._csig1*y-this._ssig1*g),this.caps&e.CAP_C1p&&(this._C1pa=new Array(e.nC1p_+1),e.C1pf(m,this._C1pa)),this.caps&e.CAP_C2&&(this._A2m1=e.A2m1f(m),this._C2a=new Array(e.nC2_+1),e.C2f(m,this._C2a),this._B21=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C2a)),this.caps&e.CAP_C3&&(this._C3a=new Array(e.nC3_),n.C3f(m,this._C3a),this._A3c=-this.f*this._salp0*n.A3f(m),this._B31=e.SinCosSeries(!0,this._ssig1,this._csig1,this._C3a)),this.caps&e.CAP_C4&&(this._C4a=new Array(e.nC4_),n.C4f(m,this._C4a),this._A4=r.sq(this.a)*this._calp0*this._salp0*n._e2,this._B41=e.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a)),this.a13=this.s13=NaN},t.GeodesicLine.prototype.GenPosition=function(n,i,o,s={}){var a,c,l,u,h,d,m,g,y,b,w,_,S,M,v,C,R,E,j,I,O,A,W,k,T,B,N,D,L;return o?o===e.LONG_UNROLL&&(o|=e.STANDARD):o=e.STANDARD,o&=this.caps&e.OUT_MASK,s.lat1=this.lat1,s.azi1=this.azi1,s.lon1=o&e.LONG_UNROLL?this.lon1:r.AngNormalize(this.lon1),n?s.a12=i:s.s12=i,n||this.caps&e.DISTANCE_IN&e.OUT_MASK?(u=0,h=0,n?(a=i*r.degree,B=r.sincosd(i),c=B.s,l=B.c):(g=i/(this._b*(1+this._A1m1)),y=Math.sin(g),b=Math.cos(g),u=-e.SinCosSeries(!0,this._stau1*b+this._ctau1*y,this._ctau1*b-this._stau1*y,this._C1pa),a=g-(u-this._B11),c=Math.sin(a),l=Math.cos(a),Math.abs(this.f)>.01&&(d=this._ssig1*l+this._csig1*c,m=this._csig1*l-this._ssig1*c,u=e.SinCosSeries(!0,d,m,this._C1a),w=(1+this._A1m1)*(a+(u-this._B11))-i/this._b,a=a-w/Math.sqrt(1+this._k2*r.sq(d)),c=Math.sin(a),l=Math.cos(a))),d=this._ssig1*l+this._csig1*c,m=this._csig1*l-this._ssig1*c,A=Math.sqrt(1+this._k2*r.sq(d)),o&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&((n||Math.abs(this.f)>.01)&&(u=e.SinCosSeries(!0,d,m,this._C1a)),h=(1+this._A1m1)*(u-this._B11)),C=this._calp0*d,R=r.hypot(this._salp0,this._calp0*m),R===0&&(R=m=e.tiny_),I=this._salp0,O=this._calp0*m,n&&o&e.DISTANCE&&(s.s12=this._b*((1+this._A1m1)*a+h)),o&e.LONGITUDE&&(E=this._salp0*d,j=m,v=r.copysign(1,this._salp0),_=o&e.LONG_UNROLL?v*(a-(Math.atan2(d,m)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(v*E,j)-Math.atan2(v*this._somg1,this._comg1))):Math.atan2(E*this._comg1-j*this._somg1,j*this._comg1+E*this._somg1),S=_+this._A3c*(a+(e.SinCosSeries(!0,d,m,this._C3a)-this._B31)),M=S/r.degree,s.lon2=o&e.LONG_UNROLL?this.lon1+M:r.AngNormalize(r.AngNormalize(this.lon1)+r.AngNormalize(M))),o&e.LATITUDE&&(s.lat2=r.atan2d(C,this._f1*R)),o&e.AZIMUTH&&(s.azi2=r.atan2d(I,O)),o&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(W=e.SinCosSeries(!0,d,m,this._C2a),k=(1+this._A2m1)*(W-this._B21),T=(this._A1m1-this._A2m1)*a+(h-k),o&e.REDUCEDLENGTH&&(s.m12=this._b*(A*(this._csig1*d)-this._dn1*(this._ssig1*m)-this._csig1*m*T)),o&e.GEODESICSCALE&&(B=this._k2*(d-this._ssig1)*(d+this._ssig1)/(this._dn1+A),s.M12=l+(B*d-m*T)*this._ssig1/this._dn1,s.M21=l-(B*this._ssig1-this._csig1*T)*d/A)),o&e.AREA&&(N=e.SinCosSeries(!1,d,m,this._C4a),this._calp0===0||this._salp0===0?(D=I*this.calp1-O*this.salp1,L=O*this.calp1+I*this.salp1):(D=this._calp0*this._salp0*(l<=0?this._csig1*(1-l)+c*this._ssig1:c*(this._csig1*c/(1+l)+this._ssig1)),L=r.sq(this._salp0)+r.sq(this._calp0)*this._csig1*m),s.S12=this._c2*Math.atan2(D,L)+this._A4*(Math.abs(a)<.01?e.SinCosSeries(!1,this._ssig1,this._csig1,this._C4a,a):N-this._B41)),n||(s.a12=a/r.degree),s):(s.a12=NaN,s)},t.GeodesicLine.prototype.Position=function(n,i){return this.GenPosition(!1,n,i)},t.GeodesicLine.prototype.ArcPosition=function(n,i){return this.GenPosition(!0,n,i)},t.GeodesicLine.prototype.GenSetDistance=function(n,i){n?this.SetArc(i):this.SetDistance(i)},t.GeodesicLine.prototype.SetDistance=function(n){var i;this.s13=n,i=this.GenPosition(!1,this.s13,e.ARC),this.a13=0+i.a12},t.GeodesicLine.prototype.SetArc=function(n){var i;this.a13=n,i=this.GenPosition(!0,this.a13,e.DISTANCE),this.s13=0+i.s12}})(er.Geodesic,er.GeodesicLine,er.Math)});function l8(e){if(!Number.isFinite(e))throw new Error("Nonfinite axis, azimuth, distance or arc")}function u8({semiMajorAxis:e,semiMinorAxis:t}){return l8(e),l8(t),new Fy.Geodesic(e,(e-t)/e)}var Fy,Pf,f8=p(()=>{c8();Fy=er.Geodesic;Pf=Fy.ALL&~Fy.AREA});function m8(e,t,r,n,i,o){let s=d8[t]&&d8[t][r];Ri(s&&(!n||n===s));let a,c,l,u=Vz.copy(i);if(!Number.isFinite(u.x)||!Number.isFinite(u.y)||!Number.isFinite(u.z)||!Array.isArray(o)&&o.length<16)throw new Error("Unsupported local frame");let h=qz*Math.min(1,e.maximumRadius),d=Math.abs(u.x)<=h&&Math.abs(u.y)<=h,m=e.radii;if(m.x===m.y&&m.x>0&&m.z>0&&m.z<=m.x&&(!d||u.z!==0)){let{east:I,up:O}=Wl;if(d)I.set(0,1,0),O.set(0,0,Math.sign(u.z));else{let A=Math.max(Math.abs(u.x),Math.abs(u.y));I.set(-u.y/A,u.x/A,0).normalize(),e.geodeticSurfaceNormal(u,O)}if(!Ly(I,O,h8)||!Oy(h8,u,t,r,n,o))throw new Error("Unsupported local frame");return o}if(d){let I=Math.sign(u.z);a=Wz.fromArray(ky[t]),t!=="east"&&t!=="west"&&a.scale(I),c=Hz.fromArray(ky[r]),r!=="east"&&r!=="west"&&c.scale(I),l=$z.fromArray(ky[n]),n!=="east"&&n!=="west"&&l.scale(I)}else{let{up:I,east:O,north:A}=Wl,W=Math.max(Math.abs(u.x),Math.abs(u.y));O.set(-u.y/W,u.x/W,0).normalize(),e.geodeticSurfaceNormal(u,I),A.copy(I).cross(O);let{down:k,west:T,south:B}=Wl;k.copy(I).scale(-1),T.copy(O).scale(-1),B.copy(A).scale(-1),a=Wl[t],c=Wl[r],l=Wl[n]}let g=a.x,y=a.y,b=a.z,w=c.x,_=c.y,S=c.z,M=l.x,v=l.y,C=l.z,R=u.x,E=u.y,j=u.z;return o[0]=g,o[1]=y,o[2]=b,o[3]=0,o[4]=w,o[5]=_,o[6]=S,o[7]=0,o[8]=M,o[9]=v,o[10]=C,o[11]=0,o[12]=R,o[13]=E,o[14]=j,o[15]=1,o}var qz,Vz,h8,d8,ky,Wl,Wz,Hz,$z,p8=p(()=>{Fn();Fn();qz=1e-14,Vz=new J,h8=Ry(),d8={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ky={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Wl={east:new J,north:new J,up:new J,west:new J,south:new J,down:new J},Wz=new J,Hz=new J,$z=new J});function Gy(e,t,r=new yn){return m8(e,"east","north","up",t,r)}var g8=p(()=>{Fn();p8()});var y8=p(()=>{a8();g8()});var Uy,jy,Os,b8=p(()=>{Uy={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},jy={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635},Os={...Uy,...jy}});var w8=p(()=>{b8()});var x8=p(()=>{w8()});var _8=p(()=>{});var S8=p(()=>{});function re(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))return r;let n=e[t];if(typeof n!="string"||!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i.test(n))throw new Error(`Invalid numeric PROJ parameter: +${t}`);let i=Number(n);if(!Number.isFinite(i))throw new Error(`Invalid numeric PROJ parameter: +${t}`);return i}function Rf(e,t){let r=re(e,t,0);if(Math.abs(r)>=90)throw new Error(`+${t} must be between -90 and 90 degrees`);return r*At}function Yt(e,t=!1){if(t||Math.abs(e)<=Math.PI)return e;let r=2*Math.PI;return((e+Math.PI)%r+r)%r-Math.PI}var At,Wt=p(()=>{At=Math.PI/180});function Ot(e,t){let r=[e[0]*t[0],e[0]*t[1],e[1]*t[0],e[1]*t[1]];return[Math.min(...r),Math.max(...r)]}function Lf([e,t]){let r=[Math.sin(e),Math.sin(t)];for(let[n,i]of[[Math.PI/2,1],[-Math.PI/2,-1]])Math.ceil((e-n)/(2*Math.PI))<=Math.floor((t-n)/(2*Math.PI))&&r.push(i);return[Math.min(...r),Math.max(...r)]}function lt(e,t){let r=n=>Math.max(1,Cs(n))*1e-12;if(![...e,...t].every(Number.isFinite))throw new Error("Projection rendering bounds are not finite");return[[e[0]-r(e),t[0]-r(t),0],[e[1]+r(e),t[1]+r(t),0]]}function Cr(e,t,r=!1){let n=e[0][0]-t,i=e[1][0]-t;if(r)return[n,i];let o=i-n;if(o>=2*Math.PI-1e-12)return[-Math.PI,Math.PI];let s=Yt(n);o>0&&Math.abs(s-Math.PI)<1e-12&&(s=-Math.PI);let a=s+o;return a>Math.PI+1e-12?[-Math.PI,Math.PI]:[s,Math.min(a,Math.PI)]}function Br(e,t,r,n=!1){let i=Cr(t,r,n),o=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],0))],s=i.flatMap(a=>o.map(c=>e(r+a,c)));return lt([Math.min(...s.map(a=>a[0])),Math.max(...s.map(a=>a[0]))],[Math.min(...s.map(a=>a[1])),Math.max(...s.map(a=>a[1]))])}function Hl(e,t,r,n=!1,i=0){let o=Cr(t,r,n);if(Cs(o)>Math.PI/6+1e-12)throw new Error("Unsupported transverse rendering coverage");let s=[o[0],o[1],Math.max(o[0],Math.min(o[1],0))],a=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],i))],c=s.flatMap(l=>a.map(u=>e(r+l,u)));return lt([Math.min(...c.map(l=>l[0])),Math.max(...c.map(l=>l[0]))],[Math.min(...c.map(l=>l[1])),Math.max(...c.map(l=>l[1]))])}function M8(e,t,r,n=!1){let i=Cr(t,r,n),o=[i[0],i[1],Math.max(i[0],Math.min(i[1],0))],s=[t[0][1],t[1][1],Math.max(t[0][1],Math.min(t[1][1],0))],a=o.flatMap(c=>s.map(l=>e(r+c,l)));return lt([Math.min(...a.map(c=>c[0])),Math.max(...a.map(c=>c[0]))],[Math.min(...a.map(c=>c[1])),Math.max(...a.map(c=>c[1]))])}function $l(e,t,r,n,i,o,s=!1){let a=Fe(Cr(t,r,s),n),c=mi(o-e(r,t[0][1])[1],o-e(r,t[1][1])[1]);return lt(Be([i,i],Ot(c,Lf(a))),Be([o,o],Fe(Ot(c,Pm(a)),-1)))}var mi,Be,Fe,Pm,Cs,Ct=p(()=>{Wt();mi=(e,t)=>[Math.min(e,t),Math.max(e,t)],Be=(e,t)=>[e[0]+t[0],e[1]+t[1]],Fe=(e,t)=>mi(e[0]*t,e[1]*t);Pm=e=>Lf([e[0]+Math.PI/2,e[1]+Math.PI/2]),Cs=e=>Math.max(Math.abs(e[0]),Math.abs(e[1]))});function Q(e,t,r,n){return[[e,t],[r,n]]}function Li(e){return e>=-180&&e<180?e:((e+180)%360+360)%360-180}function Xz(e,t,r,n){if(![e,t,r,n].every(Number.isFinite)||t<-90||n>90||t>n||r-e<-360||r-e>360+1e-10)throw new Error("Invalid geographic coverage");if(r-e>=360-1e-10)return[-180,t,180,n];let i=Li(r);return[Li(e),t,i===-180&&r>e?180:i,n]}function zy(e){let t=e[2]-e[0];return t<0?t+360:t}function v8(e){let[t,r,n,i]=e;return t<=n?[e]:[[t,r,180,i],[-180,r,n,i]]}function Yz(e,t){let[r,n,i,o]=e,s=Li(t[0]);return t[1]>=n&&t[1]<=o&&(r<=i?s>=r&&s<=i||s===-180&&i===180:s>=r||s<=i)}function Rm(e,t){let r=Math.max(e[1],t[1]),n=Math.min(e[3],t[3]);if(r>n)return[];let i=[];for(let s of v8(e))for(let a of v8(t)){let c=Math.max(s[0],a[0]),l=Math.min(s[2],a[2]);c<=l?i.push([c,l]):(s[2]===180&&a[0]===-180||a[2]===180&&s[0]===-180)&&i.push([-180,-180])}i.sort((s,a)=>s[0]-a[0]);let o=[];for(let s of i){let a=o[o.length-1];a&&s[0]<=a[1]?a[1]=Math.max(a[1],s[1]):o.push([...s])}if(o.length>1&&o[0][0]===-180&&o[o.length-1][1]===180){let s=o.shift();return[[o.pop()[0],r,s[1],n],...o.map(([c,l])=>[c,r,l,n])]}return o.map(([s,a])=>[s,r,a,n])}function E8(e,t){let r=Li(t[0]),n=Math.max(e[1],Math.min(e[3],t[1]));if(!Yz(e,[r,n])){let i=Math.abs(Li(r-e[0])),o=Math.abs(Li(r-e[2]));r=i<=o?e[0]:e[2]}return[r,n]}function Bs(e,t=0,r=0){let n=zy(e),i=e[0]*qo-t,o=i+n*qo/2,s=Math.round((r-o)/(2*Math.PI))*2*Math.PI;return Q(n===360?r-Math.PI:i+s,e[1]*qo,n===360?r+Math.PI:i+s+n*qo,e[3]*qo)}function kn(e,t=0){return Xz((e[0][0]+t)/qo,e[0][1]/qo,(e[1][0]+t)/qo,e[1][1]/qo)}function T8(e){if(!e.length)throw new Error("CRS coverage does not intersect the rendering target");return[[0,1,2].map(t=>Math.min(...e.map(r=>r[0][t]))),[0,1,2].map(t=>Math.max(...e.map(r=>r[1][t])))]}var qo,et=p(()=>{qo=Math.PI/180});function A8(e,t){if(t)try{let n=e(t);return qy(n)}catch{}let r=e();return qy(r)}function qy(e){var r;let t=e.bounds;if(t.some(n=>n.some(i=>!Number.isFinite(i))))throw new Error("Projection rendering bounds must be finite");return{bounds:t,normalize:(r=e.normalize)==null?void 0:r.bind(e)}}function Ds(e,t=0){return r=>{let n=r.x*Math.PI/180-t,i=r.y*Math.PI/180,o={x:n,y:i,z:r.z};e(o),o.x!==n&&(r.x=(o.x+t)*180/Math.PI),o.y!==i&&(r.y=o.y*180/Math.PI)}}function Lm(e,t){let r=[];for(let n of e){let i=t(n);i!==null&&r.push(qy(i))}return r.length?r.length===1?r[0]:{bounds:T8(r.map(n=>n.bounds)),normalize(n){var a;let i=n.x,o=n.y,s=1/0;for(let c of r){let l={x:n.x,y:n.y,z:n.z};(a=c.normalize)==null||a.call(c,l);let u=Math.sin((l.y-n.y)*Math.PI/360)**2+Math.cos(n.y*Math.PI/180)*Math.cos(l.y*Math.PI/180)*Math.sin((l.x-n.x)*Math.PI/360)**2;u<s&&(s=u,i=l.x,o=l.y)}n.x=i,n.y=o}}:null}var uc=p(()=>{et()});function Om(e,t,r=0,n=!1){let i=zy(t),o=i===360?r-180:t[0]+Math.round((r-t[0]-i/2)/360)*360,s=o+i;if(n){e.x=Math.max(o,Math.min(s,e.x)),e.y=Math.max(t[1],Math.min(t[3],e.y));return}let a=E8(t,[e.x,e.y]),c=a[0];a[0]===Li(e.x)&&e.x>=o&&e.x<=s?c=e.x:(c<o||c>s)&&(c+=Math.round(((o+s)/2-c)/360)*360);let l=c-r;e.x=Math.abs(l)<=180?c:r+Li(l),e.y=a[1]}function ur(e,t,r=0,n=0,i=!1){let o=(r+n)*180/Math.PI;return{get bounds(){return e(Bs(t,n,r))},normalize(s){Om(s,t,o,i)}}}function Zz(e,t,r,n,i){let o=Lm(t,s=>ur(e,s,r,n,i));if(!o)throw new Error("CRS coverage does not intersect the rendering target");return o}function De(e,t,r,n=0,i=!1){let o=(t[0][0]+t[1][0])/2,s=kn(t,n),a=(o+n)*180/Math.PI;return{...e,longitudeOrigin:o,getRenderingProfile(c){if(!c)return{bounds:r(t),normalize(l){Om(l,s,a,i)}};try{let l=ur(r,c,o,n,i);return{bounds:l.bounds,normalize:l.normalize}}catch{return Zz(r,Rm(c,s),o,n,i)}}}}var ut=p(()=>{et();uc()});function I8(){return{x:0,y:0,z:0}}var Ns,Cm=p(()=>{Ns=class{constructor(){this.point=I8(),this.points=[this.point],this.active=0}get depth(){return this.active}acquire(){var t;let r=this.active++;return(t=this.points)[r]||(t[r]=I8()),this.points[r]}release(t){this.active>0&&this.points[this.active-1]===t&&this.active--}}});function pi(e,t){let r=new Ns,n=(i,o,s)=>{let a=r.acquire();try{return a.x=i,a.y=o,a.z=0,s(a),[a.x,a.y]}finally{r.release(a)}};return{forward(i,o){return n(i,o,e)},inverse(i,o){return n(i,o,t)},forwardInPlace:e,inverseInPlace:t}}function Vo(e,t,r=!1){let n=t?e.inverseInPlace:e.forwardInPlace;if(n)return n.bind(e);if(r){let o=t?e.inverse3D:e.forward3D;return s=>{let a=o.call(e,[s.x,s.y,s.z]);s.x=a[0],s.y=a[1],s.z=a[2]}}let i=t?e.inverse:e.forward;return o=>{let s=i.call(e,o.x,o.y);o.x=s[0],o.y=s[1]}}var fc=p(()=>{Cm()});function Fs(e,t,r=0){let n=re(e,t,r);if(t!=="lon_0"&&Math.abs(n)>90)throw new Error("Latitude parameter must be between -90 and 90 degrees: +"+t);return n*At}function Oi(e,t){let r=Object.prototype.hasOwnProperty.call(e,t);if(r&&e[t]!==void 0)throw new Error("Expected a flag without a value: +"+t);return r}function xr({semiMajorAxis:e,eccentricitySquared:t,parameters:r,primeMeridian:n=0}){let i=re(r,"k_0",re(r,"k",1));if(i<=0)throw new Error("Projection scale must be positive");return{primeMeridian:n,a:e,b:e*Math.sqrt(1-t),es:t,e:Math.sqrt(t),ep2:t/(1-t),sphere:t===0,over:Oi(r,"over"),long0:Fs(r,"lon_0"),lat0:Fs(r,"lat_0"),lat1:Fs(r,"lat_1"),lat2:Fs(r,"lat_2",re(r,"lat_1",0)),lat_ts:Fs(r,"lat_ts",NaN),x0:re(r,"x_0",0),y0:re(r,"y_0",0),k0:i}}function Kl(e,t){if(!Object.prototype.hasOwnProperty.call(t,"lat_1"))throw new Error("Conic projections require +lat_1");if(Math.abs(e.lat1+e.lat2)<1e-10||Math.abs(e.lat1)>=Math.PI/2||Math.abs(e.lat2)>=Math.PI/2)throw new Error("Conic standard parallels must not be opposite or at a pole")}function fr(e,t,r,n,i=pi){let o=(s,a)=>{let c=s(t,a);if(!c||typeof c!="object"||!Number.isFinite(c.x)||!Number.isFinite(c.y))throw new Error(e+": coordinate outside projection domain or inverse did not converge");a.x=c.x,a.y=c.y};return i(s=>o(r,s),s=>o(n,s))}function ks(e,t){let r=Vo(t,!1);return pi(n=>{let i=n.x,o=n.y,s=Math.atan2(Math.sin(i-e.long0),Math.cos(i-e.long0)),a=Math.abs(Math.abs(e.lat0)-Math.PI/2)<1e-10;if(Math.abs(o+e.lat0)<1e-10&&(a||Math.abs(Math.abs(s)-Math.PI)<1e-10))throw new Error("Azimuthal projection is undefined at the antipode");r(n)},Vo(t,!0))}var Er,Wo,Gn=p(()=>{fc();Wt();Er=["lon_0","lat_0","x_0","y_0"],Wo=["k","k_0"]});function Ci(e,t){return{...pi(e,t),createForwardFlat(r){return this.forwardInPlace===e?P8(e,!1,r):void 0},createInverseFlat(r){return this.inverseInPlace===t?P8(t,!0,r):void 0}}}function P8(e,t,{inputScale:r,outputScale:n}){let i=new Ns;return(o,s)=>{let a=i.acquire();try{let c=o instanceof Float32Array;for(let l=0;l<o.length;l+=s){if(a.x=o[l],a.y=o[l+1],a.z=s>=3?o[l+2]:0,!Number.isFinite(a.x)||!Number.isFinite(a.y)||!Number.isFinite(a.z))throw new Error("Coordinates must contain finite x, y and optional z values");if(r!==1&&(a.x*=r,a.y*=r),t&&e(a),Math.abs(a.y)>Math.PI/2||!Number.isFinite(a.x)||!Number.isFinite(a.y))throw new Error("Coordinate is outside the geographic domain");if(a.x+=0,a.x-=0,t||e(a),n!==1&&(a.x/=n,a.y/=n),!Number.isFinite(a.x)||!Number.isFinite(a.y))throw new Error("Projection produced non-finite coordinates");if(c&&(Math.abs(a.x)>34028234663852886e22||Math.abs(a.y)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");o[l]=a.x,o[l+1]=a.y}}finally{i.release(a)}}}var Xl=p(()=>{fc();Cm()});function hc(e){var t=Math.exp(e);return t=(t-1/t)/2,t}var Bm=p(()=>{});function tr(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}var dc=p(()=>{});function R8(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}var L8=p(()=>{});function O8(e){var t=Math.abs(e);return t=R8(t*(1+t/(tr(1,t)+1))),e<0?-t:t}var C8=p(()=>{dc();L8()});function Dm(e,t){for(var r=2*Math.cos(2*t),n=e.length-1,i=e[n],o=0,s;--n>=0;)s=-o+r*i+e[n],o=i,i=s;return t+s*Math.sin(2*t)}var B8=p(()=>{});function D8(e,t){for(var r=2*Math.cos(t),n=e.length-1,i=e[n],o=0,s;--n>=0;)s=-o+r*i+e[n],o=i,i=s;return Math.sin(t)*s}var N8=p(()=>{});function Of(e){var t=Math.exp(e);return t=(t+1/t)/2,t}var Vy=p(()=>{});function Wy(e,t,r,n){for(var i=Math.sin(t),o=Math.cos(t),s=hc(r),a=Of(r),c=2*o*a,l=-2*i*s,u=e.length-1,h=e[u],d=0,m=0,g=0,y,b;--u>=0;)y=m,b=d,m=h,d=g,h=-y+c*m-l*d+e[u],g=-b+l*m+c*d;c=i*a,l=o*s,n.x=c*h-l*g,n.y=c*g+l*h}var F8=p(()=>{Bm();Vy()});var F,tt,Gs,k8,Hy,$y,Cf,Bt=p(()=>{F=Math.PI/2,tt=Math.PI/4,Gs=Math.PI*2,k8=3.14159265359,Hy=Math.PI/180,$y=180/Math.PI,Cf=Math.PI/(180*3600)});function Us(e){return e<0?-1:1}var Bf=p(()=>{});function G(e,t){return t||Math.abs(e)<=k8?e:e-Us(e)*Gs}var _t=p(()=>{Bt();Bf()});function Jz(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0,e.lat0=e.lat0!==void 0?e.lat0:0,e.k0=e.k0!==void 0?e.k0:1,e.cgb=[],e.cbg=[],e.utg=[],e.gtu=[];var t=e.es/(1+Math.sqrt(1-e.es)),r=t/(2-t),n=r;e.cgb[0]=r*(2+r*(-2/3+r*(-2+r*(116/45+r*(26/45+r*(-2854/675)))))),e.cbg[0]=r*(-2+r*(2/3+r*(4/3+r*(-82/45+r*(32/45+r*(4642/4725)))))),n=n*r,e.cgb[1]=n*(7/3+r*(-8/5+r*(-227/45+r*(2704/315+r*(2323/945))))),e.cbg[1]=n*(5/3+r*(-16/15+r*(-13/9+r*(904/315+r*(-1522/945))))),n=n*r,e.cgb[2]=n*(56/15+r*(-136/35+r*(-1262/105+r*(73814/2835)))),e.cbg[2]=n*(-26/15+r*(34/21+r*(8/5+r*(-12686/2835)))),n=n*r,e.cgb[3]=n*(4279/630+r*(-332/35+r*(-399572/14175))),e.cbg[3]=n*(1237/630+r*(-12/5+r*(-24832/14175))),n=n*r,e.cgb[4]=n*(4174/315+r*(-144838/6237)),e.cbg[4]=n*(-734/315+r*(109598/31185)),n=n*r,e.cgb[5]=n*(601676/22275),e.cbg[5]=n*(444337/155925),n=Math.pow(r,2),e.Qn=e.k0/(1+r)*(1+n*(1/4+n*(1/64+n/256))),e.utg[0]=r*(-.5+r*(2/3+r*(-37/96+r*(1/360+r*(81/512+r*(-96199/604800)))))),e.gtu[0]=r*(.5+r*(-2/3+r*(5/16+r*(41/180+r*(-127/288+r*(7891/37800)))))),e.utg[1]=n*(-1/48+r*(-1/15+r*(437/1440+r*(-46/105+r*(1118711/3870720))))),e.gtu[1]=n*(13/48+r*(-3/5+r*(557/1440+r*(281/630+r*(-1983433/1935360))))),n=n*r,e.utg[2]=n*(-17/480+r*(37/840+r*(209/4480+r*(-5569/90720)))),e.gtu[2]=n*(61/240+r*(-103/140+r*(15061/26880+r*(167603/181440)))),n=n*r,e.utg[3]=n*(-4397/161280+r*(11/504+r*(830251/7257600))),e.gtu[3]=n*(49561/161280+r*(-179/168+r*(6601661/7257600))),n=n*r,e.utg[4]=n*(-4583/161280+r*(108847/3991680)),e.gtu[4]=n*(34729/80640+r*(-3418889/1995840)),n=n*r,e.utg[5]=n*(-20648693/638668800),e.gtu[5]=n*(212378941/319334400);var i=Dm(e.cbg,e.lat0);e.Zb=-e.Qn*(i+D8(e.gtu,2*i))}function G8(e,t){var r=G(t.x-e.long0,e.over),n=t.y;n=Dm(e.cbg,n);var i=Math.sin(n),o=Math.cos(n),s=Math.sin(r),a=Math.cos(r);n=Math.atan2(i,a*o),r=Math.atan2(s*o,tr(i,o*a)),r=O8(Math.tan(r)),Wy(e.gtu,2*n,2*r,t),n=n+t.x,r=r+t.y;var c,l;return Math.abs(r)<=2.623395162778?(c=e.a*(e.Qn*r)+e.x0,l=e.a*(e.Qn*n+e.Zb)+e.y0):(c=1/0,l=1/0),t.x=c,t.y=l,t}function U8(e,t){var r=(t.x-e.x0)*(1/e.a),n=(t.y-e.y0)*(1/e.a);n=(n-e.Zb)/e.Qn,r=r/e.Qn;var i,o;if(Math.abs(r)<=2.623395162778){Wy(e.utg,2*n,2*r,t),n=n+t.x,r=r+t.y,r=Math.atan(hc(r));var s=Math.sin(n),a=Math.cos(n),c=Math.sin(r),l=Math.cos(r);n=Math.atan2(s*l,tr(c,l*a)),r=Math.atan2(c,l*a),i=G(r+e.long0,e.over),o=Dm(e.cgb,n)}else i=1/0,o=1/0;return t.x=i,t.y=o,t}function j8(e){let t={...e,cgb:[],cbg:[],utg:[],gtu:[],Qn:0,Zb:0};return Jz(t),t}var z8=p(()=>{Bm();dc();C8();B8();N8();F8();_t()});function uo(e){var t=[];t[0]=Qz-e*(eq+e*(q8+e*(V8+e*W8))),t[1]=e*(tq-e*(q8+e*(V8+e*W8)));var r=e*e;return t[2]=r*(rq-e*(nq+e*iq)),r*=e,t[3]=r*(oq-e*sq),t[4]=r*e*aq,t}var Qz,eq,q8,V8,W8,tq,rq,nq,iq,oq,sq,aq,Yl=p(()=>{Qz=1,eq=.25,q8=.046875,V8=.01953125,W8=.01068115234375,tq=.75,rq=.46875,nq=.013020833333333334,iq=.007120768229166667,oq=.3645833333333333,sq=.005696614583333333,aq=.3076171875});function _r(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var mc=p(()=>{});function fo(e,t,r){for(var n=1/(1-t),i=e,o=cq;o;--o){var s=Math.sin(i),a=1-t*s*s;if(a=(_r(i,s,Math.cos(i),r)-e)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<1e-10)return i}return i}var cq,Zl=p(()=>{mc();cq=20});function lq(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0,e.lat0=e.lat0!==void 0?e.lat0:0,e.es&&(e.en=uo(e.es),e.ml0=_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function H8(e,t){var r=t.x,n=t.y,i=G(r-e.long0,e.over),o,s,a,c=Math.sin(n),l=Math.cos(n);if(e.es){var h=l*i,d=Math.pow(h,2),m=e.ep2*Math.pow(l,2),g=Math.pow(m,2),y=Math.abs(l)>1e-10?Math.tan(n):0,b=Math.pow(y,2),w=Math.pow(b,2);o=1-e.es*Math.pow(c,2),h=h/Math.sqrt(o);var _=_r(n,c,l,e.en);s=e.a*(e.k0*h*(1+d/6*(1-b+m+d/20*(5-18*b+w+14*m-58*b*m+d/42*(61+179*w-w*b-479*b)))))+e.x0,a=e.a*(e.k0*(_-e.ml0+c*i*h/2*(1+d/12*(5-b+9*m+4*g+d/30*(61+w-58*b+270*m-330*b*m+d/56*(1385+543*w-w*b-3111*b))))))+e.y0}else{var u=l*Math.sin(i);if(Math.abs(Math.abs(u)-1)<1e-10)return 93;if(s=.5*e.a*e.k0*Math.log((1+u)/(1-u))+e.x0,a=l*Math.cos(i)/Math.sqrt(1-Math.pow(u,2)),u=Math.abs(a),u>=1){if(u-1>1e-10)return 93;a=0}else a=Math.acos(a);n<0&&(a=-a),a=e.a*e.k0*(a-e.lat0)+e.y0}return t.x=s,t.y=a,t}function $8(e,t){var r,n,i,o,s=(t.x-e.x0)*(1/e.a),a=(t.y-e.y0)*(1/e.a);if(e.es)if(r=e.ml0+a/e.k0,n=fo(r,e.es,e.en),Math.abs(n)<F){var d=Math.sin(n),m=Math.cos(n),g=Math.abs(m)>1e-10?Math.tan(n):0,y=e.ep2*Math.pow(m,2),b=Math.pow(y,2),w=Math.pow(g,2),_=Math.pow(w,2);r=1-e.es*Math.pow(d,2);var S=s*Math.sqrt(r)/e.k0,M=Math.pow(S,2);r=r*g,i=n-r*M/(1-e.es)*.5*(1-M/12*(5+3*w-9*y*w+y-4*b-M/30*(61+90*w-252*y*w+45*_+46*y-M/56*(1385+3633*w+4095*_+1574*_*w)))),o=G(e.long0+S*(1-M/6*(1+2*w+y-M/20*(5+28*w+24*_+8*y*w+6*y-M/42*(61+662*w+1320*_+720*_*w))))/m,e.over)}else i=F*Us(a),o=0;else{var c=Math.exp(s/e.k0),l=.5*(c-1/c),u=e.lat0+a/e.k0,h=Math.cos(u);r=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),i=Math.asin(r),Math.sin(u)<0&&(i=-i),l===0&&h===0?o=0:o=G(Math.atan2(l,h)+e.long0,e.over)}return t.x=o,t.y=i,t}function K8(e){let t={...e,en:[],ml0:0};return lq(t),t}var X8=p(()=>{Yl();mc();Zl();_t();Bt();Bf()});function Nm(e){let t=xr(e),r=n=>De(n,Q(t.long0-Math.PI/6,-Math.PI/2,t.long0+Math.PI/6,Math.PI/2),i=>Hl(n.forward,i,t.long0,t.over),t.primeMeridian,t.over);if(Oi(e.parameters,"approx"))return r({...fr("tmerc +approx",K8(t),H8,$8,Ci)});if(t.sphere)throw new Error("Spherical transverse Mercator requires +approx");return r({...fr("etmerc",j8(t),G8,U8,Ci)})}var Ky,Xy,Yy=p(()=>{Xl();Ct();et();ut();Gn();z8();X8();Ky={name:"tmerc",aliases:["Fast_Transverse_Mercator","Fast Transverse Mercator","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger"],parameters:[...Er,...Wo,"approx"],flags:["approx"],create:Nm},Xy={name:"etmerc",aliases:["Extended_Transverse_Mercator","Extended Transverse Mercator"],parameters:[...Er,...Wo,"approx"],flags:["approx"],create:Nm}});var Zy,Y8=p(()=>{Ct();et();ut();Wt();Gn();Yy();Zy={name:"utm",aliases:["Universal Transverse Mercator System"],parameters:["zone","south","approx"],flags:["south","approx"],create(e){let t=re(e.parameters,"zone",NaN);if(!Number.isInteger(t)||t<1||t>60)throw new Error("UTM requires an integer +zone from 1 to 60");let r=Oi(e.parameters,"south"),n=Nm({...e,parameters:{...e.parameters,lat_0:"0",lon_0:String(6*t-183),x_0:"500000",y_0:r?"10000000":"0",k_0:"0.9996"}}),i=(6*t-183)*Math.PI/180;return De(n,Q(i-Math.PI/60,r?-80*Math.PI/180:0,i+Math.PI/60,r?0:84*Math.PI/180),o=>Hl(n.forward,o,i),e.primeMeridian??0,Object.prototype.hasOwnProperty.call(e.parameters,"over"))}}});function Qy(e,t){return[Math.cos(t)*Math.cos(e),Math.cos(t)*Math.sin(e),Math.sin(t)]}function Fm(e,t,r,n,i){let o=Math.hypot(e,t);if(!o||Math.abs(r)>o+1e-14)return[];let s=Math.atan2(t,e),a=Math.acos(Math.max(-1,Math.min(1,r/o))),c=[];for(let l of[s-a,s+a])for(let u=Math.ceil((n-l)/(2*Math.PI));u<=Math.floor((i-l)/(2*Math.PI));u++)c.push(l+u*2*Math.PI);return c}function js(e,t,r,n=!0){let[[i,o],[s,a]]=t,c=(i+s)/2,l=r?[Math.cos(r.latitude),0,Math.sin(r.latitude)]:[1,0,0],u=r?Math.cos(r.distance):-1,h=n?-1/0:1/0,d=[NaN,NaN],m=(y,b)=>{if(y=c+Yt(y-c),y<i-1e-12||y>s+1e-12||b<o-1e-12||b>a+1e-12)return;let w=Qy(y,b);if(r&&Jy(l,w)<u-1e-13)return;let _=Jy(e,w);(n?_>h:_<h)&&(h=_,d=[y,b])},g=[i,s,...Fm(-e[1],e[0],0,i,s)];for(let y of g){let b=e[0]*Math.cos(y)+e[1]*Math.sin(y);for(let w of[o,a,...Fm(e[2],-b,0,o,a)])m(y,w)}if(r){let[y,,b]=l;for(let M of[o,a])for(let v of Fm(y*Math.cos(M),0,u-b*Math.sin(M),i,s))m(v,M);for(let M of[i,s])for(let v of Fm(y*Math.cos(M),b,u,o,a))m(M,v);let w=Jy(e,l),_=e.map((M,v)=>M-w*l[v]),S=Math.hypot(..._);if(S<=1e-14&&(_=[-l[2],0,l[0]],S=1),S>1e-14)for(let M of[-1,1]){let v=l.map((C,R)=>C*u+M*_[R]*Math.sin(r.distance)/S);m(Math.atan2(v[1],v[0]),Math.atan2(v[2],Math.hypot(v[0],v[1])))}}if(!Number.isFinite(h))throw new Error("CRS coverage does not intersect the rendering domain");return{value:h,point:d}}function dt(e,t,r){return[js(e,t,r,!1).value,js(e,t,r).value]}function zs(e,t,r,n,i){let o=dt(e,n,i),s=dt(t,n,i).map(c=>c+r);if(s[0]<=0)throw new Error("Projection rendering denominator is not positive");let a=o.flatMap(c=>s.map(l=>c/l));return[!1,!0].map(c=>{let l=Math.min(...a),u=Math.max(...a);for(let h=0;h<60;h++){let d=(l+u)/2,m=e.map((y,b)=>y-d*t[b]);js(m,n,i,c).value-d*r>0?l=d:u=d}return c?u:l})}var Jy,pc=p(()=>{Wt();Jy=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]});function uq(e,t,r,n=Math.PI){let i=[-180,-90,180,90],o=(s,a)=>{let c=Bs(s,e.primeMeridian,e.long0),l=Q(c[0][0]-e.long0,c[0][1],c[1][0]-e.long0,c[1][1]),u=[Math.cos(e.lat0),0,Math.sin(e.lat0)],h=a?js(u,l,void 0,!1).value:-1,m=!a||h<=Math.cos(n)+1e-13?{latitude:e.lat0,distance:t}:void 0,g=ur(()=>r(l,m),s,e.long0,e.primeMeridian),y=Math.abs(Math.cos(e.lat0))<1e-12,b=(Math.PI/2-t)*180/Math.PI,w=m&&!y&&Ds(_=>{let S=Qy(_.x-e.long0,_.y);if(S[0]*Math.cos(e.lat0)+S[2]*Math.sin(e.lat0)>=Math.cos(m.distance)-1e-14)return;if(Math.hypot(S[0]+u[0],S[1],S[2]+u[2])<1e-12){let v=e.lat0+m.distance,C=(l[0][0]+l[1][0])/2,R=C+Yt((Math.cos(v)<0?Math.PI:0)-C),E=Math.atan2(Math.sin(v),Math.abs(Math.cos(v)));if(R>=l[0][0]&&R<=l[1][0]&&E>=l[0][1]&&E<=l[1][1]){_.x=R+e.long0,_.y=E;return}}let M=js(S,l,m);[_.x,_.y]=[M.point[0]+e.long0,M.point[1]]},e.primeMeridian);return{get bounds(){return r(l,m)},normalize(_){g.normalize(_),m&&y?_.y=e.lat0>0?Math.max(b,_.y):Math.min(-b,_.y):w==null||w(_);let S=(e.long0+e.primeMeridian)*180/Math.PI,M=_.x-S;Math.abs(M)>180&&(_.x=S+Li(M))}}};return s=>o(s??i,!!s)}function wn(e,t,r,n,i=Math.PI){return{...e,longitudeOrigin:t.long0,getRenderingProfile:uq(t,r,n,i)}}var qs=p(()=>{et();ut();pc();Wt();uc()});function km(e,t,r,n){let i=[-Math.sin(e.lat0),0,Math.cos(e.lat0)],o=[Math.cos(e.lat0),0,Math.sin(e.lat0)],s=[0,1,0],a=n==="stere"?1:0,c=u=>n==="ortho"?dt(u,t,r):zs(u,o,a,t,r),l=e.a*(n==="stere"?2*e.k0:1);return lt(Be([e.x0,e.x0],Fe(c(s),l)),Be([e.y0,e.y0],Fe(c(i),l)))}function Z8(e,t,r){let n=Math.sin(e.lat0),i=Math.cos(e.lat0),o=dt([0,0,1],t,r);if(Math.abs(n)<1e-15&&(!r||Math.abs(r.distance-Math.PI/2)<1e-15)){let h=m=>{let g=js([0,1,0],t,r,m);return g.value/Math.sqrt(1-e.es*Math.sin(g.point[1])**2)},d=m=>(1-e.es)*m/Math.sqrt(1-e.es*m*m);return lt(Be([e.x0,e.x0],Fe([h(!1),h(!0)],e.a*e.k0)),Be([e.y0,e.y0],Fe([d(o[0]),d(o[1])],e.a*e.k0)))}let s=o[0]<=0&&o[1]>=0?0:Math.min(o[0]**2,o[1]**2),a=Math.max(o[0]**2,o[1]**2),c=mi(1/Math.sqrt(1-e.es*s),1/Math.sqrt(1-e.es*a)),l=e.a*e.k0,u=e.es*n*i/Math.sqrt(1-e.es*n*n);return lt(Be([e.x0,e.x0],Fe(Ot(dt([0,1,0],t,r),c),l)),Be([e.y0+l*u,e.y0+l*u],Fe(Ot(dt([-n,0,(1-e.es)*i],t,r),c),l)))}function J8(e,t,r){let n=dt([Math.cos(e.lat0),0,Math.sin(e.lat0)],t,r)[0],i=e.a/Math.sqrt(1-e.es)*Math.acos(Math.max(-1,Math.min(1,n)));return lt([e.x0-i,e.x0+i],[e.y0-i,e.y0+i])}function Q8(e,t,r,n,i,o,s){let a=i&&dt([0,0,1],n,i),c=Q(n[0][0],s(a?Math.asin(Math.max(-1,a[0])):n[0][1]),n[1][0],s(a?Math.asin(Math.min(1,a[1])):n[1][1])),l=i&&{latitude:o,distance:Math.PI-(1-e.es)**2*(Math.PI-i.distance)},u=[Math.cos(o),0,Math.sin(o)],h=[-Math.sin(o),0,Math.cos(o)],d=dt(u,c,l),m=[Math.sqrt(2/(1+Math.min(1,d[1]))),d[0]>-1+1e-14?Math.sqrt(2/(1+d[0])):1/0],g=(y,b)=>{let w=dt(y,c,l),_=w[0]===0?0:w[0]*(w[0]<0?m[1]:m[0]),S=w[1]===0?0:w[1]*(w[1]>0?m[1]:m[0]);return Fe([Math.max(-2,_),Math.min(2,S)],e.a*b)};return lt(Be([e.x0,e.x0],g([0,1,0],t)),Be([e.y0,e.y0],g(h,r)))}function Gm(e,t,r,n,i,o,s=1,a=e.e*Math.atanh(e.e)){let c=Q(i[0][0]*s,t(i[0][1]),i[1][0]*s,t(i[1][1])),l=2*a+Math.PI*Math.abs(s-1),u=o&&s===1?Math.min(o.distance+l,Math.PI-(1-e.es)*(Math.PI-o.distance)):o&&o.distance+l,h=u&&u<Math.PI?{latitude:r,distance:u}:void 0,d=[Math.cos(r),0,Math.sin(r)],m=[-Math.sin(r),0,Math.cos(r)],y=c[1][0]-c[0][0]>=2*Math.PI?Q(-Math.PI,c[0][1],Math.PI,c[1][1]):c,b=zs([0,1,0],d,1,y,h),w=zs(m,d,1,y,h);return lt(Be([e.x0,e.x0],Fe(b,n)),Be([e.y0,e.y0],Fe(w,n)))}function eT(e,t,r,n,i,o){let s=[Math.cos(e.lat0),0,Math.sin(e.lat0)],a=[-Math.sin(e.lat0),0,Math.cos(e.lat0)],c=[0,1,0],l=Math.cos(n),u=Math.sin(n),h=Math.cos(r),d=Math.sin(r),m=a.map((_,S)=>l*_+u*c[S]),g=c.map((_,S)=>l*_-u*a[S]),y=s.map((_,S)=>-h*_+d*m[S]),b=zs(g,y,h*t,i,o),w=zs(m,y,h*t,i,o);return lt(Be([e.x0,e.x0],Fe(b,e.a*(t-1)*h)),Be([e.y0,e.y0],Fe(w,e.a*(t-1))))}function tT(e,t,r){let n=dt([Math.cos(e.lat0),0,Math.sin(e.lat0)],t,r)[0],i=Math.acos(Math.max(-1,Math.min(1,n))),o=1-e.es,s=e.a*i/Math.sqrt(o),a=Math.cos(i/o);if(!(a>0))throw new Error("Gnomonic rendering coverage approaches its ellipsoidal horizon");let c=s/a;return lt([e.x0-c,e.x0+c],[e.y0-c,e.y0+c])}var Vs=p(()=>{et();pc();Ct()});function Bi(e,t,r,n,i,o,s){let a=i*r/s,c=n*t-o*r*e/s,l=n*e+o*r*t/s;return Math.atan2(l,Math.hypot(a,c))}var Df=p(()=>{});function xn(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}var Jl=p(()=>{});function Qr(e,t,r){let n=Math.cos(t);return Math.exp(e*Math.atanh(e*r))*(r>0?n/(1+r):(1-r)/n)}var Nf=p(()=>{});function gc(e,t){for(var r=.5*e,n,i,o=F-2*Math.atan(t),s=0;s<=15;s++)if(n=e*Math.sin(o),i=F-2*Math.atan(t*Math.pow((1-n)/(1+n),r))-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}var Um=p(()=>{Bt()});function rT(e,t,r){return t*=r,Math.tan(.5*(F+e))*Math.pow((1-t)/(1+t),.5*r)}function fq(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0,e.coslat0=Math.cos(e.lat0),e.sinlat0=Math.sin(e.lat0),e.sphere?!Number.isNaN(e.lat_ts)&&Math.abs(e.coslat0)<=1e-10&&(e.k0=.5*(1+Us(e.lat0)*Math.sin(e.lat_ts))):(Math.abs(e.coslat0)<=1e-10&&(e.lat0>0?e.con=1:e.con=-1),e.cons=Math.sqrt(Math.pow(1+e.e,1+e.e)*Math.pow(1-e.e,1-e.e)),!Number.isNaN(e.lat_ts)&&Math.abs(e.coslat0)<=1e-10&&Math.abs(Math.cos(e.lat_ts))>1e-10&&(e.k0=.5*e.cons*xn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts))/Qr(e.e,e.con*e.lat_ts,e.con*Math.sin(e.lat_ts))),e.ms1=xn(e.e,e.sinlat0,e.coslat0),e.X0=2*Math.atan(rT(e.lat0,e.sinlat0,e.e))-F,e.cosX0=Math.cos(e.X0),e.sinX0=Math.sin(e.X0))}function nT(e,t){var r=t.x,n=t.y,i=Math.sin(n),o=Math.cos(n),s,a,c,l,u,h,d=G(r-e.long0,e.over);if(Math.abs(Math.abs(r-e.long0)-Math.PI)<=1e-10&&Math.abs(n+e.lat0)<=1e-10)return t.x=NaN,t.y=NaN,t;if(e.sphere&&Math.abs(e.coslat0)<=1e-10){let m=e.lat0>0?1:-1,g=2*e.a*e.k0*Math.tan(Math.PI/4-m*n/2);return t.x=e.x0+g*Math.sin(d),t.y=e.y0-m*g*Math.cos(d),t}return e.sphere?(s=2*e.k0/(1+e.sinlat0*i+e.coslat0*o*Math.cos(d)),t.x=e.a*s*o*Math.sin(d)+e.x0,t.y=e.a*s*(e.coslat0*i-e.sinlat0*o*Math.cos(d))+e.y0,t):(a=2*Math.atan(rT(n,i,e.e))-F,l=Math.cos(a),c=Math.sin(a),Math.abs(e.coslat0)<=1e-10?(u=Qr(e.e,n*e.con,e.con*i),h=2*e.a*e.k0*u/e.cons,t.x=e.x0+h*Math.sin(r-e.long0),t.y=e.y0-e.con*h*Math.cos(r-e.long0),t):(Math.abs(e.sinlat0)<1e-10?(s=2*e.a*e.k0/(1+l*Math.cos(d)),t.y=s*c+e.y0):(s=2*e.a*e.k0*e.ms1/(e.cosX0*(1+e.sinX0*c+e.cosX0*l*Math.cos(d))),t.y=s*(e.cosX0*c-e.sinX0*l*Math.cos(d))+e.y0),t.x=s*l*Math.sin(d)+e.x0,t))}function iT(e,t){t.x-=e.x0,t.y-=e.y0;var r,n,i,o,s,a=Math.sqrt(t.x*t.x+t.y*t.y);if(e.sphere){var c=2*Math.atan(a/(2*e.a*e.k0));return r=e.long0,n=e.lat0,a<=1e-10?(t.x=r,t.y=n,t):(n=Bi(e.sinlat0,e.coslat0,Math.sin(c),Math.cos(c),t.x,t.y,a),Math.abs(e.coslat0)<1e-10?e.lat0>0?r=G(e.long0+Math.atan2(t.x,-1*t.y),e.over):r=G(e.long0+Math.atan2(t.x,t.y),e.over):r=G(e.long0+Math.atan2(t.x*Math.sin(c),a*e.coslat0*Math.cos(c)-t.y*e.sinlat0*Math.sin(c)),e.over),t.x=r,t.y=n,t)}else if(Math.abs(e.coslat0)<=1e-10){if(a<=1e-10)return n=e.lat0,r=e.long0,t.x=r,t.y=n,t;t.x*=e.con,t.y*=e.con,i=a*e.cons/(2*e.a*e.k0),n=e.con*gc(e.e,i),r=e.con*G(e.con*e.long0+Math.atan2(t.x,-1*t.y),e.over)}else o=2*Math.atan(a*e.cosX0/(2*e.a*e.k0*e.ms1)),r=e.long0,a<=1e-10?s=e.X0:(s=Bi(e.sinX0,e.cosX0,Math.sin(o),Math.cos(o),t.x,t.y,a),r=G(e.long0+Math.atan2(t.x*Math.sin(o),a*e.cosX0*Math.cos(o)-t.y*e.sinX0*Math.sin(o)),e.over)),n=-1*gc(e.e,Math.tan(.5*(F+s)));return t.x=r,t.y=n,t}function oT(e){let t={...e,coslat0:0,sinlat0:0,con:0,cons:0,ms1:0,X0:0,cosX0:0,sinX0:0};return fq(t),t}var sT=p(()=>{Df();Bt();Bf();Jl();Nf();Um();_t()});var e2,aT=p(()=>{qs();Vs();Gn();sT();e2={name:"stere",aliases:["Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],parameters:[...Er,...Wo,"lat_ts"],create(e){let t=xr(e),r=oT(t),n=ks(t,fr("stere",r,nT,iT));return wn(n,t,150*Math.PI/180,(i,o)=>r.sphere?km(r,i,o,"stere"):Gm(r,s=>2*Math.atan(Math.tan(Math.PI/4+s/2)*Math.pow((1-r.e*Math.sin(s))/(1+r.e*Math.sin(s)),r.e/2))-Math.PI/2,r.X0,2*r.a*r.k0*(Math.abs(r.coslat0)<1e-10?1/r.cons:r.ms1/r.cosX0),i,o))}}});var Ff=p(()=>{y8();_8();S8()});var Ws=p(()=>{"use strict";Lv();Ov();Bv();Dv();Ng();Ng();yE()});function cT(e){return!pq(e,"ftyp",4)||(e[8]&96)===0?null:hq(e)}function hq(e){switch(dq(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function dq(e,t,r){return String.fromCharCode(...e.slice(t,r))}function mq(e){return[...e].map(t=>t.charCodeAt(0))}function pq(e,t,r=0){let n=mq(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var lT=p(()=>{"use strict"});function jm(e){let t=Gf(e);return yq(t)||xq(t)||bq(t)||wq(t)||gq(t)}function gq(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=cT(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function yq(e){let t=Gf(e);return t.byteLength>=33&&t.getUint32(0,Un)===2303741511&&t.getUint32(4,Un)===218765834&&t.getUint32(8,Un)===13&&t.getUint32(12,Un)===1229472850?{mimeType:"image/png",width:t.getUint32(16,Un),height:t.getUint32(20,Un)}:null}function bq(e){let t=Gf(e);return t.byteLength>=10&&t.getUint32(0,Un)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,kf),height:t.getUint16(8,kf)}:null}function wq(e){let t=Gf(e);return t.byteLength>=14&&t.getUint16(0,Un)===16973&&t.getUint32(2,kf)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,kf),height:t.getUint32(22,kf)}:null}function xq(e){let t=Gf(e);if(!(t.byteLength>=3&&t.getUint16(0,Un)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=_q(),o=2;for(;o+9<t.byteLength;){let s=t.getUint16(o,Un);if(i.has(s))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Un),width:t.getUint16(o+7,Un)};if(!n.has(s))return null;o+=2,o+=t.getUint16(o,Un)}return null}function _q(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Gf(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}var Un,kf,t2=p(()=>{"use strict";lT();Un=!1,kf=!0});var Sq,Mq,vq,uT,fT=p(()=>{"use strict";t2();Sq=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Mq=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],vq={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:Mq,extensions:Sq,tests:[e=>!!jm(new DataView(e))]},uT={...vq,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Ql,zm=p(()=>{"use strict";Ql="5.0.0-beta.6"});function eu(e){if(!e)return!1;if(Eq.test(e))return!0;for(let t=e.indexOf(".svg");t>=0;t=e.indexOf(".svg",t+4)){let r=e[t+4];if(r===void 0||r==="?"||r==="#")return!0}return!1}function hT(e,t){if(eu(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return r2(e,t)}function r2(e,t){if(eu(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}var Eq,qm=p(()=>{"use strict";Eq=/^data:image\/svg\+xml/});async function dT(e,t,r){let n=hT(e,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Tq(o||n,t)}finally{o&&i.revokeObjectURL(o)}}async function Tq(e,t){var n;let r=new Image;return r.src=e,(n=t==null?void 0:t.image)!=null&&n.decode&&r.decode?(await r.decode(),r):await new Promise((i,o)=>{try{r.onload=()=>i(r),r.onerror=s=>{let a=s instanceof Error?s.message:"error";o(new Error(a))}}catch(s){o(s)}})}var mT=p(()=>{"use strict";qm()});async function gT(e,t,r){let n;eu(r)?n=await dT(e,t,r):n=r2(e,r);let i=t&&t.imagebitmap;return await bT(n,i)}async function yT(e,t){let r=t&&t.imagebitmap;return await bT(e,r)}async function bT(e,t=null){if((Aq(t)||!pT)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),pT=!1}return await createImageBitmap(e)}function Aq(e){if(!e)return!0;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var pT,wT=p(()=>{"use strict";qm();mT();pT=!0});async function xT(e,t){var s,a;let{mimeType:r}=jm(e)||{},n=(s=globalThis.loaders)==null?void 0:s.parseImageNode;Ll(n);let i=(a=globalThis.loaders)==null?void 0:a.createImageBitmapNode;if(!i)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let o=await n(e,r);return i(o)}var _T=p(()=>{"use strict";Ws();t2()});async function n2(e,t,r){var i;t=t||{},vT(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Zd||n)return await xT(e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(ST);return await gT(e,t,r==null?void 0:r.url)}async function MT(e,t,r){var i;t=t||{},vT(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Zd||n||eu(r==null?void 0:r.url)||e.type.startsWith("image/svg+xml"))return await n2(await e.arrayBuffer(),t,r);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(ST);return await yT(e,t)}function vT(e){var r;let t=(r=e.image)==null?void 0:r.type;if(t&&t!=="imagebitmap")throw new Error(Iq)}var Iq,ST,ET=p(()=>{"use strict";Ws();wT();qm();_T();Iq="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",ST="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var TT={};Qt(TT,{ImageLoaderWithParser:()=>Rq});var qoe,Pq,Rq,AT=p(()=>{"use strict";ET();i2();({preload:qoe,...Pq}=Ho),Rq={...Pq,parse:n2,parseBlob:MT}});async function Oq(){let{ImageLoaderWithParser:e}=await Promise.resolve().then(()=>(AT(),TT));return e}var Lq,Ho,i2=p(()=>{"use strict";zm();fT();Lq={image:{}};Ho={dataType:null,batchType:null,...uT,version:Ql,options:Lq,preload:Oq}});function PT(e){let t=Nq(e);if(!t)throw new Error("Not an image");return t}function Vm(e){switch(PT(e)){case"data":return e;case"imagebitmap":return Cq(e)?Bq(e):IT(e);case"image":return IT(e);default:throw new Error("getImageData")}}function Cq(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.isImageBitmapNode;return!!(t!=null&&t(e))}function Bq(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.getImageBitmapDataNode;if(!t)throw new Error("getImageData");return t(e)}function IT(e){let t=Dq(e.width,e.height),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height)}function Dq(e,t){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(e,t);if(typeof document<"u"){let r=document.createElement("canvas");return r.width=e,r.height=t,r}throw new Error("getImageData")}function Nq(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var RT=p(()=>{"use strict"});var LT,OT,o2=p(()=>{"use strict";LT={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]},OT={name:"Texture Containers",id:"compressed-texture",module:"images",encoding:"image",format:"compressed-texture",extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0}});function BT(e){if(!Wm){e=e||kq()||void 0,Wm=new Set;for(let t of Fq)for(let r in CT)if(e&&e.getExtension(`${t}${r}`))for(let n of CT[r])Wm.add(n)}return Wm}function kq(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Fq,CT,Wm,DT=p(()=>{"use strict";Fq=["","WEBKIT_","MOZ_"],CT={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},Wm=null});function FT(e=BT(),t,r={}){let n=new Set(e);if(!t)return Uq(n);if(t.isHDR){let i=NT(t);return r.astcHDR&&(i==="astc-4x4"||i==="astc-6x6")&&Hm(n,i.slice(5))?i==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(t.codec==="xubc7")return a2(n)?"bc7":"rgba32";if(t.codec.startsWith("xuastc-ldr-")||t.codec.startsWith("astc-ldr-")){let i=NT(t);return i&&Hm(n,i.slice(5))?i:s2(n,t,["bc7","bc","etc2","atc"])}return t.codec==="uastc-ldr-4x4"?Hm(n,"4x4")?"astc-4x4":s2(n,t,["bc7","bc","etc2","etc1","pvrtc","atc"]):s2(n,t,["etc2","etc1","bc7","bc","pvrtc","atc"])}function Uq(e){return Hm(e,"4x4")?"astc-4x4":a2(e)?"bc7":kT(e)?{alpha:"bc3",noAlpha:"bc1"}:GT(e)?"etc2":e.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:UT(e)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:jT(e)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function s2(e,t,r){for(let n of r)switch(n){case"bc7":if(a2(e))return"bc7";break;case"bc":if(kT(e))return t.hasAlpha?"bc3":"bc1";break;case"etc2":if(GT(e))return"etc2";break;case"etc1":if(!t.hasAlpha&&e.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(UT(e))return t.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(jT(e))return t.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return t.hasAlpha?"rgba32":"rgb565"}function NT(e){let t=`${e.blockWidth}x${e.blockHeight}`;return Gq.includes(t)?`astc-${t}`:null}function Hm(e,t){return tu(e,[`astc-${t}-unorm`,`astc-${t}-unorm-srgb`])}function a2(e){return tu(e,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function kT(e){return tu(e,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function GT(e){return tu(e,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function UT(e){return tu(e,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function jT(e){return tu(e,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function tu(e,t){return t.some(r=>e.has(r))}var Gq,zT=p(()=>{"use strict";DT();Gq=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function WT(e){Bg(e.modules);let t=Dg("basis");return t||(VT||=jq(e),await VT)}async function jq(e){let t=null,r=null;return[t,r]=await Promise.all([await Nl(qT.TRANSCODER,"images",e,null,"basis_transcoder.mjs"),await Nl(qT.TRANSCODER_WASM,"images",e)]),t=t||globalThis.BASIS,await zq(t,r)}function zq(e,t){let r={};return t&&(r.wasmBinary=t),Ol(()=>e(r),n=>{let{BasisFile:i,KTX2File:o,getBasisTexFormatBlockHeight:s,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:l}=n;return c(),{BasisFile:i,KTX2File:o,getBasisTexFormatBlockHeight:s,getBasisTexFormatBlockWidth:a,isFormatSupported:l}})}var qT,VT,HT=p(()=>{"use strict";Ws();sc();qT={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function Xm(e){if(e!==void 0)return bA[e]}function wA(e){if(e!==void 0)return sV[e]}var bA,sV,x2=p(()=>{"use strict";bA={34836:"rgba32float",33776:"bc1-rgb-unorm-webgl",35916:"bc1-rgb-unorm-srgb-webgl",33777:"bc1-rgba-unorm",35917:"bc1-rgba-unorm-srgb",33778:"bc2-rgba-unorm",35918:"bc2-rgba-unorm-srgb",33779:"bc3-rgba-unorm",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37492:"etc2-rgb8unorm",37494:"etc2-rgb8unorm-srgb",37496:"etc2-rgb8a1unorm",37497:"etc2-rgb8a1unorm-srgb",37493:"etc2-rgba8unorm",37495:"etc2-rgba8unorm-srgb",37488:"eac-r11unorm",37489:"eac-r11snorm",37490:"eac-rg11unorm",37491:"eac-rg11snorm",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",35840:"pvrtc-rgb4unorm-webgl",35842:"pvrtc-rgba4unorm-webgl",35841:"pvrtc-rgb2unorm-webgl",35843:"pvrtc-rgba2unorm-webgl",36196:"etc1-rgb-unorm-webgl",35986:"atc-rgb-unorm-webgl",35987:"atc-rgba-unorm-webgl",34798:"atc-rgbai-unorm-webgl"},sV=Object.fromEntries(Object.entries(bA).map(([e,t])=>[t,Number(e)]))});function ru(e,t){let r=new Array(t.mipMapLevels),n=t.textureFormat||Xm(t.internalFormat),i=t.internalFormat||wA(t.textureFormat),o=t.width,s=t.height,a=0;for(let c=0;c<t.mipMapLevels;++c){let l=cV(t,o,s,e,c),h={shape:"texture-level",compressed:!0,data:aV(e,c,a,l),width:o,height:s,levelSize:l};i!==void 0&&(h.format=i),n&&(h.textureFormat=n),r[c]=h,o=Math.max(1,o>>1),s=Math.max(1,s>>1),a+=l}return r}function aV(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function cV(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var Ym=p(()=>{"use strict";x2()});function uV(e){return lV[e]}function xA(e){return Xm(uV(e))}var lV,_A=p(()=>{"use strict";x2();lV={131:33776,132:35916,133:33777,134:35917,135:33778,136:35918,137:33779,138:35919,139:36283,140:36284,141:36285,142:36286,147:37492,148:37494,149:37496,150:37497,151:37493,152:37495,153:37488,154:37489,155:37490,156:37491,157:37808,158:37840,159:37809,160:37841,161:37810,162:37842,163:37811,164:37843,165:37812,166:37844,167:37813,168:37845,169:37814,170:37846,171:37815,172:37847,173:37816,174:37848,175:37817,176:37849,177:37818,178:37850,179:37819,180:37851,181:37820,182:37852,183:37821,184:37853,1000054e3:35843,1000054001:35842,1000066e3:37808,1000066001:37809,1000066002:37810,1000066003:37811,1000066004:37812,1000066005:37813,1000066006:37814,1000066007:37815,1000066008:37816,1000066009:37817,1000066010:37818,1000066011:37819,1000066012:37820,1000066013:37821}});function Hs(e){if(e.byteLength<_2.byteLength)return!1;let t=new Uint8Array(e,0,_2.byteLength);return _2.every((r,n)=>t[n]===r)}function MA(e){let t=E2(e);if(t.pixelDepth>0)throw new Error("CompressedTextureLoader does not support 3D KTX2 textures");if(t.supercompressionScheme!==fV)throw new Error(`KTX2 supercompression scheme ${t.supercompressionScheme} requires BasisLoader`);if(t.vkFormat===0)throw new Error("KTX2 vkFormat is undefined; decode this texture with BasisLoader");let r=xA(t.vkFormat);if(!r)throw new Error(`Unsupported KTX2 Vulkan format ${t.vkFormat}`);return ru(t.levels,{mipMapLevels:t.levelCount,width:t.pixelWidth,height:Math.max(1,t.pixelHeight),sizeFunction:n=>n.uncompressedByteLength,textureFormat:r})}function E2(e){if(!Hs(e))throw new Error("Invalid KTX2 identifier");if(e.byteLength<S2)throw new Error("Truncated KTX2 header");let t=new DataView(e),r=Math.max(1,t.getUint32(40,!0)),n=hV(r,SA,"KTX2 level index");v2(S2,n,e.byteLength,"KTX2 level index");let i={vkFormat:t.getUint32(12,!0),pixelWidth:t.getUint32(20,!0),pixelHeight:t.getUint32(24,!0),pixelDepth:t.getUint32(28,!0),layerCount:t.getUint32(32,!0),faceCount:t.getUint32(36,!0),levelCount:r,supercompressionScheme:t.getUint32(44,!0),levels:[]};if(i.pixelWidth===0)throw new Error("KTX2 texture width must be non-zero");if(i.faceCount!==1&&i.faceCount!==6)throw new Error(`Invalid KTX2 face count ${i.faceCount}`);M2(t.getUint32(48,!0),t.getUint32(52,!0),e.byteLength,"KTX2 data format descriptor"),M2(t.getUint32(56,!0),t.getUint32(60,!0),e.byteLength,"KTX2 key/value data"),M2(Uf(t,64,"KTX2 supercompression global data offset"),Uf(t,72,"KTX2 supercompression global data length"),e.byteLength,"KTX2 supercompression global data");for(let o=0;o<r;o++){let s=S2+o*SA,a=Uf(t,s,`KTX2 level ${o} offset`),c=Uf(t,s+8,`KTX2 level ${o} length`),l=Uf(t,s+16,`KTX2 level ${o} uncompressed length`);v2(a,c,e.byteLength,`KTX2 level ${o}`),i.levels.push({levelData:new Uint8Array(e,a,c),uncompressedByteLength:l})}return i}function Uf(e,t,r){let n=e.getUint32(t,!0),o=e.getUint32(t+4,!0)*4294967296+n;if(!Number.isSafeInteger(o))throw new Error(`${r} exceeds JavaScript's safe integer range`);return o}function hV(e,t,r){let n=e*t;if(!Number.isSafeInteger(n))throw new Error(`${r} size exceeds JavaScript's safe integer range`);return n}function M2(e,t,r,n){t>0&&v2(e,t,r,n)}function v2(e,t,r,n){if(!Number.isSafeInteger(e)||!Number.isSafeInteger(t)||e<0||t<0)throw new Error(`${n} has an invalid byte range`);let i=e+t;if(!Number.isSafeInteger(i)||i>r)throw new Error(`${n} is outside the KTX2 container`)}var _2,S2,SA,fV,Zm=p(()=>{"use strict";Ym();_A();_2=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10]),S2=80,SA=24,fV=0});async function mV(e){let t=vA,r;vA=new Promise(n=>{r=n}),await t;try{return await e()}finally{r()}}async function Jm(e,t={}){return await mV(async()=>{var o;let r=await WT(oc(t)),n=((o=t.basis)==null?void 0:o.containerFormat)||"auto";if(n==="ktx2"||n==="auto"&&Hs(e)){if(!r.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return gV(r,e,t)}return pV(r,e,t)})}function pV(e,t,r){let n=new e.BasisFile(new Uint8Array(t));try{let i=AA(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let o=[];for(let s=0;s<n.getNumImages();s++){let a=[];for(let c=0;c<n.getNumLevels(s);c++){let l=n.getImageWidth(s,c),u=n.getImageHeight(s,c);a.push(TA(n,i,l,u,r,h=>n.getImageTranscodedSizeInBytes(s,c,h),(h,d)=>n.transcodeImage(h,s,c,d,0,0)))}o.push(a)}return o}finally{n.close(),n.delete()}}function gV(e,t,r){let n=new e.KTX2File(new Uint8Array(t));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let o=AA(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let s=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let l=0;l<s;l++)for(let u=0;u<a;u++){let h=[];for(let d=0;d<n.getLevels();d++){let m=n.getImageLevelInfo(d,l,u);h.push(TA(n,{...o,hasAlpha:!!m.alphaFlag},m.width,m.height,r,g=>n.getImageTranscodedSizeInBytes(d,l,u,g),(g,y)=>n.transcodeImage(g,d,l,u,y,0,-1,-1)))}c.push(h)}return c}finally{n.close(),n.delete()}}function TA(e,t,r,n,i,o,s){let a=bV(i,t);yV(t,T2(i,t));let c=o(a.basisFormat),l=xV(c,a.dataType);if(!s(l,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${T2(i,t)}`);let u=t.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:r,height:n,data:l,compressed:a.compressed,format:u&&a.srgbFormat||a.format,textureFormat:u?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:t.hasAlpha}}function yV(e,t){let r=t==="bc6h"||t==="rgba16f"||t==="rgb9e5"||t.startsWith("astc-hdr-");if(e.isHDR!==r)throw new Error(`Basis source codec ${e.codec} cannot be transcoded to ${t}`);if(e.codec==="xubc7"&&t!=="bc7"&&t!=="rgba32")throw new Error(`Basis source codec ${e.codec} cannot be transcoded to ${t}`)}function bV(e,t){let r=T2(e,t),n=EA[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function T2(e,t){var n,i,o;let r=((n=e.basis)==null?void 0:n.format)||"auto";return r==="auto"&&(r=FT((i=e.basis)==null?void 0:i.supportedTextureFormats,t,(o=e.basis)==null?void 0:o.supportedTextureFeatures)),typeof r=="object"&&(r=t.hasAlpha?r.alpha:r.noAlpha),r.toLowerCase()}function AA(e,t){let r=e.getBasisTexFormat(),n=wV[r];if(!n)throw new Error(`Unsupported Basis source texture format ${r}`);return{codec:n,isHDR:!!e.isHDR(),isSRGB:t?!!e.isSRGB():!1,hasAlpha:!!e.getHasAlpha(),blockWidth:e.getBlockWidth(),blockHeight:e.getBlockHeight()}}function xV(e,t){return t==="uint16"?new Uint16Array(e/Uint16Array.BYTES_PER_ELEMENT):t==="uint32"?new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function Tr(e,t,r){return{basisFormat:e,compressed:!0,format:t,textureFormat:r}}function nu(e,t,r,n,i){return{basisFormat:e,compressed:!1,format:t,textureFormat:r,srgbFormat:n,srgbTextureFormat:i}}function Sn(e,t,r,n){return{...Tr(e,t,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var _n,EA,Ese,vA,wV,A2=p(()=>{"use strict";sc();zT();HT();Zm();_n={"4x4":Sn(10,37808,37840,"4x4"),"5x4":Sn(28,37809,37841,"5x4"),"5x5":Sn(29,37810,37842,"5x5"),"6x5":Sn(30,37811,37843,"6x5"),"6x6":Sn(31,37812,37844,"6x6"),"8x5":Sn(32,37813,37845,"8x5"),"8x6":Sn(33,37814,37846,"8x6"),"8x8":Sn(36,37815,37847,"8x8"),"10x5":Sn(34,37816,37848,"10x5"),"10x6":Sn(35,37817,37849,"10x6"),"10x8":Sn(37,37818,37850,"10x8"),"10x10":Sn(38,37819,37851,"10x10"),"12x10":Sn(39,37820,37852,"12x10"),"12x12":Sn(40,37821,37853,"12x12")},EA={etc1:Tr(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...Tr(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...Tr(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...Tr(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:Tr(4,36283,"bc4-r-unorm"),bc5:Tr(5,36285,"bc5-rg-unorm"),bc7:{...Tr(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":Tr(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":Tr(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":_n["4x4"],"astc-5x4":_n["5x4"],"astc-5x5":_n["5x5"],"astc-6x5":_n["6x5"],"astc-6x6":_n["6x6"],"astc-8x5":_n["8x5"],"astc-8x6":_n["8x6"],"astc-8x8":_n["8x8"],"astc-10x5":_n["10x5"],"astc-10x6":_n["10x6"],"astc-10x8":_n["10x8"],"astc-10x10":_n["10x10"],"astc-12x10":_n["12x10"],"astc-12x12":_n["12x12"],"atc-rgb":Tr(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":Tr(12,34798,"atc-rgbai-unorm-webgl"),rgba32:nu(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:nu(14,36194,"rgb565unorm-webgl"),bgr565:nu(15,36194,"rgb565unorm-webgl"),rgba4444:nu(16,32854,"rgba4unorm-webgl"),"eac-r11":Tr(20,37488,"eac-r11unorm"),"eac-rg11":Tr(21,37490,"eac-rg11unorm"),bc6h:Tr(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":Tr(23,37808,"astc-4x4-unorm"),rgba16f:{...nu(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...nu(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":Tr(27,37812,"astc-6x6-unorm")},Ese=Object.freeze(Object.keys(EA)),vA=Promise.resolve();wV={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var IA={};Qt(IA,{BasisLoaderWithParser:()=>vV,BasisWorkerLoaderWithParser:()=>MV});var Rse,_V,Lse,SV,MV,vV,PA=p(()=>{"use strict";A2();Qm();Qm();({preload:Rse,..._V}=ho),{preload:Lse,...SV}=ho,MV={..._V},vV={...SV,parse:Jm}});async function EV(){let{BasisLoaderWithParser:e}=await Promise.resolve().then(()=>(PA(),IA));return e}var ho,Qm=p(()=>{"use strict";o2();zm();ho={...LT,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Ql,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:EV}});function RA(e){return new Uint32Array(e,0,jn.HEADER_LENGTH)[jn.MAGIC_NUMBER_INDEX]===jn.MAGIC_NUMBER}function LA(e){let t=new Int32Array(e,0,jn.HEADER_LENGTH),r=t[jn.HEADER_PF_FOURCC_INDEX];Ll(!!(t[jn.HEADER_PF_FLAGS_INDEX]&jn.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=LV(r),i=TV[n],o=RV[n];Ll(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;t[jn.HEADER_FLAGS_INDEX]&jn.DDSD_MIPMAPCOUNT&&(s=Math.max(1,t[jn.MIPMAPCOUNT_INDEX]));let a=t[jn.HEADER_WIDTH_INDEX],c=t[jn.HEADER_HEIGHT_INDEX],l=t[jn.HEADER_SIZE_INDEX]+4,u=new Uint8Array(e,l);return ru(u,{mipMapLevels:s,width:a,height:c,sizeFunction:o,textureFormat:i})}function OA(e,t){return(e+3>>2)*(t+3>>2)*8}function ep(e,t){return(e+3>>2)*(t+3>>2)*16}function LV(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var jn,TV,AV,IV,PV,RV,CA=p(()=>{"use strict";Ws();Ym();jn={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},TV={DXT1:"bc1-rgb-unorm-webgl",DXT3:"bc2-rgba-unorm",DXT5:"bc3-rgba-unorm","ATC ":"atc-rgb-unorm-webgl",ATCA:"atc-rgba-unorm-webgl",ATCI:"atc-rgbai-unorm-webgl"},AV=OA,IV=ep,PV=ep,RV={DXT1:OA,DXT3:ep,DXT5:ep,"ATC ":AV,ATCA:IV,ATCI:PV}});function NA(e){let r=new Uint32Array(e,0,gi.HEADER_LENGTH)[gi.MAGIC_NUMBER_INDEX];return r===gi.MAGIC_NUMBER||r===gi.MAGIC_NUMBER_EXTRA}function FA(e){let t=new Uint32Array(e,0,gi.HEADER_LENGTH),r=t[gi.PIXEL_FORMAT_INDEX],n=t[gi.COLOUR_SPACE_INDEX],i=OV[r]||[],o=i.length>1&&n?i[1]:i[0],s=CV[r],a=t[gi.MIPMAPCOUNT_INDEX],c=t[gi.WIDTH_INDEX],l=t[gi.HEIGHT_INDEX],u=gi.HEADER_SIZE+t[gi.METADATA_SIZE_INDEX],h=new Uint8Array(e,u);return ru(h,{mipMapLevels:a,width:c,height:l,sizeFunction:s,textureFormat:o})}function BA(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function DA(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function jf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function zf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function BV(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function DV(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function NV(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function FV(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function kV(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function GV(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function UV(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function jV(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function zV(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function qV(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function VV(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function WV(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function HV(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}var gi,OV,CV,kA=p(()=>{"use strict";Ym();gi={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},OV={0:["pvrtc-rgb2unorm-webgl"],1:["pvrtc-rgba2unorm-webgl"],2:["pvrtc-rgb4unorm-webgl"],3:["pvrtc-rgba4unorm-webgl"],6:["etc1-rgb-unorm-webgl"],7:["bc1-rgb-unorm-webgl"],9:["bc2-rgba-unorm"],11:["bc3-rgba-unorm"],22:["etc2-rgb8unorm"],23:["etc2-rgba8unorm"],24:["etc2-rgb8a1unorm"],25:["eac-r11unorm"],26:["eac-rg11unorm"],27:["astc-4x4-unorm","astc-4x4-unorm-srgb"],28:["astc-5x4-unorm","astc-5x4-unorm-srgb"],29:["astc-5x5-unorm","astc-5x5-unorm-srgb"],30:["astc-6x5-unorm","astc-6x5-unorm-srgb"],31:["astc-6x6-unorm","astc-6x6-unorm-srgb"],32:["astc-8x5-unorm","astc-8x5-unorm-srgb"],33:["astc-8x6-unorm","astc-8x6-unorm-srgb"],34:["astc-8x8-unorm","astc-8x8-unorm-srgb"],35:["astc-10x5-unorm","astc-10x5-unorm-srgb"],36:["astc-10x6-unorm","astc-10x6-unorm-srgb"],37:["astc-10x8-unorm","astc-10x8-unorm-srgb"],38:["astc-10x10-unorm","astc-10x10-unorm-srgb"],39:["astc-12x10-unorm","astc-12x10-unorm-srgb"],40:["astc-12x12-unorm","astc-12x12-unorm-srgb"]},CV={0:BA,1:BA,2:DA,3:DA,6:jf,7:jf,9:zf,11:zf,22:jf,23:zf,24:jf,25:jf,26:zf,27:zf,28:BV,29:DV,30:NV,31:FV,32:kV,33:GV,34:UV,35:jV,36:zV,37:qV,38:VV,39:WV,40:HV}});function I2(e){if(Hs(e))return MA(e);if(RA(e))return LA(e);if(NA(e))return FA(e);throw new Error("Texture container format not recognized")}var GA=p(()=>{"use strict";Zm();CA();kA()});var UA={};Qt(UA,{CompressedTextureLoaderWithParser:()=>YV,CompressedTextureWorkerLoaderWithParser:()=>XV});var Xse,$V,Yse,KV,XV,YV,jA=p(()=>{"use strict";GA();A2();Zm();tp();tp();({preload:Xse,...$V}=$o),{preload:Yse,...KV}=$o,XV={...$V},YV={...KV,parse:async(e,t)=>{var r,n;if(t={...t},(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis||Hs(e)){let i=Hs(e)?E2(e):null;return!((n=t==null?void 0:t["compressed-texture"])!=null&&n.useBasis||(i==null?void 0:i.supercompressionScheme)!==0||(i==null?void 0:i.vkFormat)===0)?I2(e):(t.basis={...t.basis,containerFormat:"ktx2"},(await Jm(e,t))[0])}return I2(e)}}});async function ZV(){let{CompressedTextureLoaderWithParser:e}=await Promise.resolve().then(()=>(jA(),UA));return e}var $o,tp=p(()=>{"use strict";o2();zm();$o={...OT,dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"images",version:Ql,worker:!0,encoding:"image",format:"compressed-texture",extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{useBasis:!1},basis:{format:"auto",containerFormat:"auto"}},preload:ZV}});var qf=p(()=>{"use strict";i2();RT();Qm();tp()});var zA=p(()=>{"use strict"});function VA(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function H(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(h){s(h)}}function c(u){try{l(n.throw(u))}catch(h){s(h)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})}function qA(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(e){return this instanceof Me?(this.v=e,this):new Me(e)}function en(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(m){return function(g){return Promise.resolve(g).then(m,h)}}function a(m,g){n[m]&&(i[m]=function(y){return new Promise(function(b,w){o.push([m,y,b,w])>1||c(m,y)})},g&&(i[m]=g(i[m])))}function c(m,g){try{l(n[m](g))}catch(y){d(o[0][3],y)}}function l(m){m.value instanceof Me?Promise.resolve(m.value.v).then(u,h):d(o[0][2],m)}function u(m){c("next",m)}function h(m){c("throw",m)}function d(m,g){m(g),o.shift(),o.length&&c(o[0][0],o[0][1])}}function iu(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(s){return(r=!r)?{value:Me(e[i](s)),done:!1}:o?o(s):s}:o}}function zn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof qA=="function"?qA(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),i(a,c,s.done,s.value)})}}function i(o,s,a,c){Promise.resolve(c).then(function(l){o({value:l,done:a})},s)}}var Ar=p(()=>{});var WA,ou,JV,qn,Ko=p(()=>{WA=new TextDecoder("utf-8"),ou=WA.decode.bind(WA),JV=new TextEncoder,qn=e=>JV.encode(e)});var QV,HA,hr,tn,Vn,Wn,Mn,rp,np,ip,op,sp,$A,Vf,KA,ap,XA,Xo=p(()=>{QV=e=>typeof e=="number",HA=e=>typeof e=="boolean",hr=e=>typeof e=="function",tn=e=>e!=null&&Object(e)===e,Vn=e=>tn(e)&&hr(e.then),Wn=e=>tn(e)&&hr(e[Symbol.iterator]),Mn=e=>tn(e)&&hr(e[Symbol.asyncIterator]),rp=e=>tn(e)&&tn(e.schema),np=e=>tn(e)&&"done"in e&&"value"in e,ip=e=>tn(e)&&hr(e.stat)&&QV(e.fd),op=e=>tn(e)&&Vf(e.body),sp=e=>"_getDOMStream"in e&&"_getNodeStream"in e,$A=e=>tn(e)&&hr(e.abort)&&hr(e.getWriter)&&!sp(e),Vf=e=>tn(e)&&hr(e.cancel)&&hr(e.getReader)&&!sp(e),KA=e=>tn(e)&&hr(e.end)&&hr(e.write)&&HA(e.writable)&&!sp(e),ap=e=>tn(e)&&hr(e.read)&&hr(e.pipe)&&HA(e.readable)&&!sp(e),XA=e=>tn(e)&&hr(e.clear)&&hr(e.bytes)&&hr(e.position)&&hr(e.setPosition)&&hr(e.capacity)&&hr(e.getBufferIdentifier)&&hr(e.createLong)});var B2={};Qt(B2,{compareArrayLike:()=>C2,joinUint8Arrays:()=>Hn,memcpy:()=>Wf,rebaseValueOffsets:()=>cp,toArrayBufferView:()=>Re,toArrayBufferViewAsyncIterator:()=>Di,toArrayBufferViewIterator:()=>mo,toBigInt64Array:()=>Hf,toBigUint64Array:()=>oW,toFloat32Array:()=>sW,toFloat32ArrayAsyncIterator:()=>SW,toFloat32ArrayIterator:()=>mW,toFloat64Array:()=>aW,toFloat64ArrayAsyncIterator:()=>MW,toFloat64ArrayIterator:()=>pW,toInt16Array:()=>rW,toInt16ArrayAsyncIterator:()=>bW,toInt16ArrayIterator:()=>uW,toInt32Array:()=>yc,toInt32ArrayAsyncIterator:()=>wW,toInt32ArrayIterator:()=>fW,toInt8Array:()=>tW,toInt8ArrayAsyncIterator:()=>yW,toInt8ArrayIterator:()=>lW,toUint16Array:()=>nW,toUint16ArrayAsyncIterator:()=>xW,toUint16ArrayIterator:()=>hW,toUint32Array:()=>iW,toUint32ArrayAsyncIterator:()=>_W,toUint32ArrayIterator:()=>dW,toUint8Array:()=>se,toUint8ArrayAsyncIterator:()=>O2,toUint8ArrayIterator:()=>L2,toUint8ClampedArray:()=>cW,toUint8ClampedArrayAsyncIterator:()=>vW,toUint8ClampedArrayIterator:()=>gW});function eW(e){let t=e[0]?[e[0]]:[],r,n,i,o;for(let s,a,c=0,l=0,u=e.length;++c<u;){if(s=t[l],a=e[c],!s||!a||s.buffer!==a.buffer||a.byteOffset<s.byteOffset){a&&(t[++l]=a);continue}if({byteOffset:r,byteLength:i}=s,{byteOffset:n,byteLength:o}=a,r+i<n||n+o<r){a&&(t[++l]=a);continue}t[l]=new Uint8Array(s.buffer,r,n-r+o)}return t}function Wf(e,t,r=0,n=t.byteLength){let i=e.byteLength,o=new Uint8Array(e.buffer,e.byteOffset,i),s=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,i));return o.set(s,r),e}function Hn(e,t){let r=eW(e),n=r.reduce((u,h)=>u+h.byteLength,0),i,o,s,a=0,c=-1,l=Math.min(t||Number.POSITIVE_INFINITY,n);for(let u=r.length;++c<u;){if(i=r[c],o=i.subarray(0,Math.min(i.length,l-a)),l<=a+o.length){o.length<i.length?r[c]=i.subarray(o.length):o.length===i.length&&c++,s?Wf(s,o,a):s=o;break}Wf(s||(s=new Uint8Array(l)),o,a),a+=o.length}return[s||new Uint8Array(0),r.slice(c),n-(s?s.byteLength:0)]}function Re(e,t){let r=np(t)?t.value:t;return r instanceof e?e===Uint8Array?new e(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=qn(r)),r instanceof ArrayBuffer?new e(r):r instanceof R2?new e(r):XA(r)?Re(e,r.bytes()):ArrayBuffer.isView(r)?r.byteLength<=0?new e(0):new e(r.buffer,r.byteOffset,r.byteLength/e.BYTES_PER_ELEMENT):e.from(r)):new e(0)}function*mo(e,t){let r=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof R2?r(t):Wn(t)?t:r(t);return yield*P2((function*(i){let o=null;do o=i.next(yield Re(e,o));while(!o.done)})(n[Symbol.iterator]())),new e}function Di(e,t){return en(this,arguments,function*(){if(Vn(t))return yield Me(yield Me(yield*iu(zn(Di(e,yield Me(t))))));let n=function(s){return en(this,arguments,function*(){yield yield Me(yield Me(s))})},i=function(s){return en(this,arguments,function*(){yield Me(yield*iu(zn(P2((function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)})(s[Symbol.iterator]())))))})},o=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof R2?n(t):Wn(t)?i(t):Mn(t)?t:n(t);return yield Me(yield*iu(zn(P2((function(s){return en(this,arguments,function*(){let a=null;do a=yield Me(s.next(yield yield Me(Re(e,a))));while(!a.done)})})(o[Symbol.asyncIterator]()))))),yield Me(new e)})}function cp(e,t,r){if(e!==0){r=r.slice(0,t);let n=typeof r[0]=="bigint"?BigInt(e):e;for(let i=-1,o=r.length;++i<o;)r[i]+=n}return r.subarray(0,t)}function C2(e,t){let r=0,n=e.length;if(n!==t.length)return!1;if(n>0)do if(e[r]!==t[r])return!1;while(++r<n);return!0}var R2,tW,rW,yc,Hf,se,nW,iW,oW,sW,aW,cW,P2,lW,uW,fW,L2,hW,dW,mW,pW,gW,yW,bW,wW,O2,xW,_W,SW,MW,vW,dr=p(()=>{Ar();Ko();Xo();R2=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;tW=e=>Re(Int8Array,e),rW=e=>Re(Int16Array,e),yc=e=>Re(Int32Array,e),Hf=e=>Re(BigInt64Array,e),se=e=>Re(Uint8Array,e),nW=e=>Re(Uint16Array,e),iW=e=>Re(Uint32Array,e),oW=e=>Re(BigUint64Array,e),sW=e=>Re(Float32Array,e),aW=e=>Re(Float64Array,e),cW=e=>Re(Uint8ClampedArray,e),P2=e=>(e.next(),e);lW=e=>mo(Int8Array,e),uW=e=>mo(Int16Array,e),fW=e=>mo(Int32Array,e),L2=e=>mo(Uint8Array,e),hW=e=>mo(Uint16Array,e),dW=e=>mo(Uint32Array,e),mW=e=>mo(Float32Array,e),pW=e=>mo(Float64Array,e),gW=e=>mo(Uint8ClampedArray,e);yW=e=>Di(Int8Array,e),bW=e=>Di(Int16Array,e),wW=e=>Di(Int32Array,e),O2=e=>Di(Uint8Array,e),xW=e=>Di(Uint16Array,e),_W=e=>Di(Uint32Array,e),SW=e=>Di(Float32Array,e),MW=e=>Di(Float64Array,e),vW=e=>Di(Uint8ClampedArray,e)});function*EW(e){let t,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?Hn(n,s)[0]:([i,n,a]=Hn(n,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=L2(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(s-a)?l.next():l.next(s-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||s<=a)do({cmd:o,size:s}=yield c());while(s<a);while(!t)}catch(u){r=!0,typeof l.throw=="function"&&l.throw(u)}finally{r===!1&&typeof l.return=="function"&&l.return(null)}return null}function TW(e){return en(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Hn(i,a)[0]:([o,i,c]=Hn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=O2(e)[Symbol.asyncIterator]();try{do if({done:r,value:o}=Number.isNaN(a-c)?yield Me(u.next()):yield Me(u.next(a-c)),!r&&o.byteLength>0&&(i.push(o),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield Me(l()));while(a<c);while(!r)}catch(h){n=!0,typeof u.throw=="function"&&(yield Me(u.throw(h)))}finally{n===!1&&typeof u.return=="function"&&(yield Me(u.return(new Uint8Array(0))))}return yield Me(null)})}function AW(e){return en(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Hn(i,a)[0]:([o,i,c]=Hn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=new N2(e);try{do if({done:r,value:o}=Number.isNaN(a-c)?yield Me(u.read()):yield Me(u.read(a-c)),!r&&o.byteLength>0&&(i.push(se(o)),c+=o.byteLength),r||a<=c)do({cmd:s,size:a}=yield yield Me(l()));while(a<c);while(!r)}catch(h){n=!0,yield Me(u.cancel(h))}finally{n===!1?yield Me(u.cancel()):e.locked&&u.releaseLock()}return yield Me(null)})}function IW(e){return en(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function h(){return s==="peek"?Hn(l,a)[0]:([u,l,c]=Hn(l,a),u)}if({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0},e.isTTY)return yield yield Me(new Uint8Array(0)),yield Me(null);try{r[0]=D2(e,"end"),r[1]=D2(e,"error");do{if(r[2]=D2(e,"readable"),[n,o]=yield Me(Promise.race(r.map(m=>m[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-c)?(u=se(e.read(a-c)),u.byteLength<a-c&&(u=se(e.read()))):u=se(e.read()),u.byteLength>0&&(l.push(u),c+=u.byteLength)),i||a<=c)do({cmd:s,size:a}=yield yield Me(h()));while(a<c)}while(!i)}finally{yield Me(d(r,n==="error"?o:null))}return yield Me(null);function d(m,g){return u=l=null,new Promise((y,b)=>{for(let[w,_]of m)e.off(w,_);try{let w=e.destroy;w&&w.call(e,g),g=void 0}catch(w){g=w||g}finally{g!=null?b(g):y()}})}})}var mr,lp,N2,D2,su=p(()=>{Ar();dr();mr={fromIterable(e){return lp(EW(e))},fromAsyncIterable(e){return lp(TW(e))},fromDOMStream(e){return lp(AW(e))},fromNodeStream(e){return lp(IW(e))},toDOMStream(e,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(e,t){throw new Error('"toNodeStream" not available in this environment')}},lp=e=>(e.next(),e);N2=class{constructor(t){this.source=t,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return H(this,void 0,void 0,function*(){let{reader:r,source:n}=this;r&&(yield r.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return H(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};let r=yield this.reader.read();return!r.done&&(r.value=se(r)),r})}},D2=(e,t)=>{let r=i=>n([t,i]),n;return[t,r,new Promise(i=>(n=i)&&e.once(t,r))]}});var ot,up=p(()=>{(function(e){e[e.V1=0]="V1",e[e.V2=1]="V2",e[e.V3=2]="V3",e[e.V4=3]="V4",e[e.V5=4]="V5"})(ot||(ot={}))});var Ze,F2=p(()=>{(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Ze||(Ze={}))});var He,k2=p(()=>{(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(He||(He={}))});var st,G2=p(()=>{(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(st||(st={}))});var q,$f=p(()=>{(function(e){e[e.SECOND=0]="SECOND",e[e.MILLISECOND=1]="MILLISECOND",e[e.MICROSECOND=2]="MICROSECOND",e[e.NANOSECOND=3]="NANOSECOND"})(q||(q={}))});var Ge,U2=p(()=>{(function(e){e[e.YEAR_MONTH=0]="YEAR_MONTH",e[e.DAY_TIME=1]="DAY_TIME",e[e.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Ge||(Ge={}))});var fp=ae(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.SIZE_PREFIX_LENGTH=po.FILE_IDENTIFIER_LENGTH=po.SIZEOF_INT=po.SIZEOF_SHORT=void 0;po.SIZEOF_SHORT=2;po.SIZEOF_INT=4;po.FILE_IDENTIFIER_LENGTH=4;po.SIZE_PREFIX_LENGTH=4});var j2=ae(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.isLittleEndian=yi.float64=yi.float32=yi.int32=void 0;yi.int32=new Int32Array(2);yi.float32=new Float32Array(yi.int32.buffer);yi.float64=new Float64Array(yi.int32.buffer);yi.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var z2=ae(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.Encoding=void 0;var YA;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(YA||(hp.Encoding=YA={}))});var V2=ae(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.ByteBuffer=void 0;var go=fp(),PW=z2(),vn=j2(),q2=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return vn.int32[0]=this.readInt32(t),vn.float32[0]}readFloat64(t){return vn.int32[vn.isLittleEndian?0:1]=this.readInt32(t),vn.int32[vn.isLittleEndian?1:0]=this.readInt32(t+4),vn.float64[0]}writeInt8(t,r){this.bytes_[t]=r}writeUint8(t,r){this.bytes_[t]=r}writeInt16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeUint16(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8}writeInt32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeUint32(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24}writeInt64(t,r){this.writeInt32(t,Number(BigInt.asIntN(32,r))),this.writeInt32(t+4,Number(BigInt.asIntN(32,r>>BigInt(32))))}writeUint64(t,r){this.writeUint32(t,Number(BigInt.asUintN(32,r))),this.writeUint32(t+4,Number(BigInt.asUintN(32,r>>BigInt(32))))}writeFloat32(t,r){vn.float32[0]=r,this.writeInt32(t,vn.int32[0])}writeFloat64(t,r){vn.float64[0]=r,this.writeInt32(t,vn.int32[vn.isLittleEndian?0:1]),this.writeInt32(t+4,vn.int32[vn.isLittleEndian?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+go.SIZEOF_INT+go.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let r=0;r<go.FILE_IDENTIFIER_LENGTH;r++)t+=String.fromCharCode(this.readInt8(this.position_+go.SIZEOF_INT+r));return t}__offset(t,r){let n=t-this.readInt32(t);return r<this.readInt16(n)?this.readInt16(n+r):0}__union(t,r){return t.bb_pos=r+this.readInt32(r),t.bb=this,t}__string(t,r){t+=this.readInt32(t);let n=this.readInt32(t);t+=go.SIZEOF_INT;let i=this.bytes_.subarray(t,t+n);return r===PW.Encoding.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,r){return typeof t=="string"?this.__string(r):this.__union(t,r)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+go.SIZEOF_INT}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=go.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+go.FILE_IDENTIFIER_LENGTH);for(let r=0;r<go.FILE_IDENTIFIER_LENGTH;r++)if(t.charCodeAt(r)!=this.readInt8(this.position()+go.SIZEOF_INT+r))return!1;return!0}createScalarList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o)}return n}createObjList(t,r){let n=[];for(let i=0;i<r;++i){let o=t(i);o!==null&&n.push(o.unpack())}return n}};dp.ByteBuffer=q2});var JA=ae(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.Builder=void 0;var ZA=V2(),$n=fp(),W2=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let r;t?r=t:r=1024,this.bb=ZA.ByteBuffer.allocate(r),this.space=r}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,r){t>this.minalign&&(this.minalign=t);let n=~(this.bb.capacity()-this.space+r)+1&t-1;for(;this.space<n+t+r;){let i=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}pad(t){for(let r=0;r<t;r++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(t))}addFieldInt16(t,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(t))}addFieldInt32(t,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(t))}addFieldInt64(t,r,n){(this.force_defaults||r!==n)&&(this.addInt64(r),this.slot(t))}addFieldFloat32(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(t))}addFieldFloat64(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(t))}addFieldOffset(t,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(t))}addFieldStruct(t,r,n){r!=n&&(this.nested(r),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let r=t.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=r<<1,i=ZA.ByteBuffer.allocate(n);return i.setPosition(n-r),i.bytes().set(t.bytes(),n-r),i}addOffset(t){this.prep($n.SIZEOF_INT,0),this.writeInt32(this.offset()-t+$n.SIZEOF_INT)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let r=0;r<t;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let t=this.offset(),r=this.vtable_in_use-1;for(;r>=0&&this.vtable[r]==0;r--);let n=r+1;for(;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);let i=2;this.addInt16(t-this.object_start);let o=(n+i)*$n.SIZEOF_SHORT;this.addInt16(o);let s=0,a=this.space;e:for(r=0;r<this.vtables.length;r++){let c=this.bb.capacity()-this.vtables[r];if(o==this.bb.readInt16(c)){for(let l=$n.SIZEOF_SHORT;l<o;l+=$n.SIZEOF_SHORT)if(this.bb.readInt16(a+l)!=this.bb.readInt16(c+l))continue e;s=this.vtables[r];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,r,n){let i=n?$n.SIZE_PREFIX_LENGTH:0;if(r){let o=r;if(this.prep(this.minalign,$n.SIZEOF_INT+$n.FILE_IDENTIFIER_LENGTH+i),o.length!=$n.FILE_IDENTIFIER_LENGTH)throw new TypeError("FlatBuffers: file identifier must be length "+$n.FILE_IDENTIFIER_LENGTH);for(let s=$n.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,$n.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,r){this.finish(t,r,!0)}requiredField(t,r){let n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(r<this.bb.readInt16(i)&&this.bb.readInt16(i+r)!=0))throw new TypeError("FlatBuffers: field "+r+" must be set")}startVector(t,r,n){this.notNested(),this.vector_num_elems=r,this.prep($n.SIZEOF_INT,t*r),this.prep(n,t*r)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let r=this.createString(t);return this.string_maps.set(t,r),r}createString(t){if(t==null)return 0;let r;return t instanceof Uint8Array?r=t:r=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length),this.bb.bytes().set(r,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let r=[];for(let n=0;n<t.length;++n){let i=t[n];if(i!==null)r.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return r}createStructOffsetList(t,r){return r(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};mp.Builder=W2});var ze=ae(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.Encoding=It.ByteBuffer=It.Builder=It.isLittleEndian=It.int32=It.float64=It.float32=It.SIZE_PREFIX_LENGTH=It.SIZEOF_SHORT=It.SIZEOF_INT=It.FILE_IDENTIFIER_LENGTH=void 0;var pp=fp();Object.defineProperty(It,"FILE_IDENTIFIER_LENGTH",{enumerable:!0,get:function(){return pp.FILE_IDENTIFIER_LENGTH}});Object.defineProperty(It,"SIZEOF_INT",{enumerable:!0,get:function(){return pp.SIZEOF_INT}});Object.defineProperty(It,"SIZEOF_SHORT",{enumerable:!0,get:function(){return pp.SIZEOF_SHORT}});Object.defineProperty(It,"SIZE_PREFIX_LENGTH",{enumerable:!0,get:function(){return pp.SIZE_PREFIX_LENGTH}});var gp=j2();Object.defineProperty(It,"float32",{enumerable:!0,get:function(){return gp.float32}});Object.defineProperty(It,"float64",{enumerable:!0,get:function(){return gp.float64}});Object.defineProperty(It,"int32",{enumerable:!0,get:function(){return gp.int32}});Object.defineProperty(It,"isLittleEndian",{enumerable:!0,get:function(){return gp.isLittleEndian}});var RW=JA();Object.defineProperty(It,"Builder",{enumerable:!0,get:function(){return RW.Builder}});var LW=V2();Object.defineProperty(It,"ByteBuffer",{enumerable:!0,get:function(){return LW.ByteBuffer}});var OW=z2();Object.defineProperty(It,"Encoding",{enumerable:!0,get:function(){return OW.Encoding}})});var bc,H2=p(()=>{(function(e){e[e.BUFFER=0]="BUFFER"})(bc||(bc={}))});var Ir,au=p(()=>{(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Ir||(Ir={}))});var QA,Yo,$2=p(()=>{QA=me(ze(),1);H2();au();Yo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBodyCompression(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,r){return t.setPosition(t.position()+QA.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}codec(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):Ir.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):bc.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,r){t.addFieldInt8(0,r,Ir.LZ4_FRAME)}static addMethod(t,r){t.addFieldInt8(1,r,bc.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,r,n){return e.startBodyCompression(t),e.addCodec(t,r),e.addMethod(t,n),e.endBodyCompression(t)}}});var cu,K2=p(()=>{cu=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(t,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}}});var lu,X2=p(()=>{lu=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(t,r,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(r??0)),t.offset()}}});var eI,Dr,Y2=p(()=>{eI=me(ze(),1);$2();K2();X2();Dr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsRecordBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,r){return t.setPosition(t.position()+eI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new lu).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new cu).__init(this.bb.__vector(this.bb_pos+n)+t*16,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){let r=this.bb.__offset(this.bb_pos,10);return r?(t||new Yo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}variadicBufferCounts(t){let r=this.bb.__offset(this.bb_pos,12);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}variadicBufferCountsLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startRecordBatch(t){t.startObject(5)}static addLength(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addNodes(t,r){t.addFieldOffset(1,r,0)}static startNodesVector(t,r){t.startVector(16,r,8)}static addBuffers(t,r){t.addFieldOffset(2,r,0)}static startBuffersVector(t,r){t.startVector(16,r,8)}static addCompression(t,r){t.addFieldOffset(3,r,0)}static addVariadicBufferCounts(t,r){t.addFieldOffset(4,r,0)}static createVariadicBufferCountsVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startVariadicBufferCountsVector(t,r){t.startVector(8,r,8)}static endRecordBatch(t){return t.endObject()}}});var tI,Zo,rI=p(()=>{tI=me(ze(),1);Y2();Zo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryBatch(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,r){return t.setPosition(t.position()+tI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Dr).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addData(t,r){t.addFieldOffset(1,r,0)}static addIsDelta(t,r){t.addFieldInt8(2,+r,0)}static endDictionaryBatch(t){return t.endObject()}}});var $s,Z2=p(()=>{(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})($s||($s={}))});var Kf,nI=p(()=>{(function(e){e[e.DenseArray=0]="DenseArray"})(Kf||(Kf={}))});var iI,Ni,yp=p(()=>{iI=me(ze(),1),Ni=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInt(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,r){return t.setPosition(t.position()+iI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startInt(t){t.startObject(2)}static addBitWidth(t,r){t.addFieldInt32(0,r,0)}static addIsSigned(t,r){t.addFieldInt8(1,+r,0)}static endInt(t){return t.endObject()}static createInt(t,r,n){return e.startInt(t),e.addBitWidth(t,r),e.addIsSigned(t,n),e.endInt(t)}}});var oI,yo,J2=p(()=>{oI=me(ze(),1);nI();yp();yo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDictionaryEncoding(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,r){return t.setPosition(t.position()+oI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}indexType(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new Ni).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Kf.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,r){t.addFieldInt64(0,r,BigInt("0"))}static addIndexType(t,r){t.addFieldOffset(1,r,0)}static addIsOrdered(t,r){t.addFieldInt8(2,+r,0)}static addDictionaryKind(t,r){t.addFieldInt16(3,r,Kf.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}});var sI,Dt,uu=p(()=>{sI=me(ze(),1),Dt=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsKeyValue(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,r){return t.setPosition(t.position()+sI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}value(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,r){t.addFieldOffset(0,r,0)}static addValue(t,r){t.addFieldOffset(1,r,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,r,n){return e.startKeyValue(t),e.addKey(t,r),e.addValue(t,n),e.endKeyValue(t)}}});var aI,Xf,cI=p(()=>{aI=me(ze(),1),Xf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,r){return t.setPosition(t.position()+aI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}}});var lI,Yf,uI=p(()=>{lI=me(ze(),1),Yf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBinaryView(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinaryView(t,r){return t.setPosition(t.position()+lI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinaryView(t){t.startObject(0)}static endBinaryView(t){return t.endObject()}static createBinaryView(t){return e.startBinaryView(t),e.endBinaryView(t)}}});var fI,Zf,hI=p(()=>{fI=me(ze(),1),Zf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,r){return t.setPosition(t.position()+fI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}}});var dI,Ks,Q2=p(()=>{dI=me(ze(),1);G2();Ks=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDate(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,r){return t.setPosition(t.position()+dI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):st.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,st.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,r){return e.startDate(t),e.addUnit(t,r),e.endDate(t)}}});var mI,bo,eb=p(()=>{mI=me(ze(),1),bo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDecimal(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,r){return t.setPosition(t.position()+mI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):128}static startDecimal(t){t.startObject(3)}static addPrecision(t,r){t.addFieldInt32(0,r,0)}static addScale(t,r){t.addFieldInt32(1,r,0)}static addBitWidth(t,r){t.addFieldInt32(2,r,128)}static endDecimal(t){return t.endObject()}static createDecimal(t,r,n,i){return e.startDecimal(t),e.addPrecision(t,r),e.addScale(t,n),e.addBitWidth(t,i),e.endDecimal(t)}}});var pI,Xs,tb=p(()=>{pI=me(ze(),1);$f();Xs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsDuration(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(t,r){return t.setPosition(t.position()+pI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,q.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,r){return e.startDuration(t),e.addUnit(t,r),e.endDuration(t)}}});var gI,Ys,rb=p(()=>{gI=me(ze(),1),Ys=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,r){return t.setPosition(t.position()+gI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,r){return e.startFixedSizeBinary(t),e.addByteWidth(t,r),e.endFixedSizeBinary(t)}}});var yI,Zs,nb=p(()=>{yI=me(ze(),1),Zs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFixedSizeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,r){return t.setPosition(t.position()+yI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,r){t.addFieldInt32(0,r,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,r){return e.startFixedSizeList(t),e.addListSize(t,r),e.endFixedSizeList(t)}}});var bI,Js,ib=p(()=>{bI=me(ze(),1);k2();Js=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFloatingPoint(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,r){return t.setPosition(t.position()+bI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):He.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,r){t.addFieldInt16(0,r,He.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,r){return e.startFloatingPoint(t),e.addPrecision(t,r),e.endFloatingPoint(t)}}});var wI,Qs,ob=p(()=>{wI=me(ze(),1);U2();Qs=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsInterval(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,r){return t.setPosition(t.position()+wI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ge.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,Ge.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,r){return e.startInterval(t),e.addUnit(t,r),e.endInterval(t)}}});var xI,Jf,_I=p(()=>{xI=me(ze(),1),Jf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,r){return t.setPosition(t.position()+xI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}}});var SI,Qf,MI=p(()=>{SI=me(ze(),1),Qf=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeList(t,r){return t.setPosition(t.position()+SI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeList(t){t.startObject(0)}static endLargeList(t){return t.endObject()}static createLargeList(t){return e.startLargeList(t),e.endLargeList(t)}}});var vI,eh,EI=p(()=>{vI=me(ze(),1),eh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsLargeUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,r){return t.setPosition(t.position()+vI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}}});var TI,th,AI=p(()=>{TI=me(ze(),1),th=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,r){return t.setPosition(t.position()+TI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}}});var II,ea,sb=p(()=>{II=me(ze(),1),ea=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,r){return t.setPosition(t.position()+II.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startMap(t){t.startObject(1)}static addKeysSorted(t,r){t.addFieldInt8(0,+r,0)}static endMap(t){return t.endObject()}static createMap(t,r){return e.startMap(t),e.addKeysSorted(t,r),e.endMap(t)}}});var PI,rh,RI=p(()=>{PI=me(ze(),1),rh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,r){return t.setPosition(t.position()+PI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}}});var LI,nh,OI=p(()=>{LI=me(ze(),1),nh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,r){return t.setPosition(t.position()+LI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}}});var CI,Jo,ab=p(()=>{CI=me(ze(),1);$f();Jo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTime(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,r){return t.setPosition(t.position()+CI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,q.MILLISECOND)}static addBitWidth(t,r){t.addFieldInt32(1,r,32)}static endTime(t){return t.endObject()}static createTime(t,r,n){return e.startTime(t),e.addUnit(t,r),e.addBitWidth(t,n),e.endTime(t)}}});var BI,Qo,cb=p(()=>{BI=me(ze(),1);$f();Qo=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsTimestamp(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,r){return t.setPosition(t.position()+BI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}unit(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):q.SECOND}timezone(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.__string(this.bb_pos+r,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(t,r){t.addFieldInt16(0,r,q.SECOND)}static addTimezone(t,r){t.addFieldOffset(1,r,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,r,n){return e.startTimestamp(t),e.addUnit(t,r),e.addTimezone(t,n),e.endTimestamp(t)}}});var DI,Fi,lb=p(()=>{DI=me(ze(),1);F2();Fi=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUnion(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,r){return t.setPosition(t.position()+DI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}mode(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ze.Sparse}typeIds(t){let r=this.bb.__offset(this.bb_pos,6);return r?this.bb.readInt32(this.bb.__vector(this.bb_pos+r)+t*4):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(t,r){t.addFieldInt16(0,r,Ze.Sparse)}static addTypeIds(t,r){t.addFieldOffset(1,r,0)}static createTypeIdsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addInt32(r[n]);return t.endVector()}static startTypeIdsVector(t,r){t.startVector(4,r,4)}static endUnion(t){return t.endObject()}static createUnion(t,r,n){return e.startUnion(t),e.addMode(t,r),e.addTypeIds(t,n),e.endUnion(t)}}});var NI,ih,FI=p(()=>{NI=me(ze(),1),ih=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,r){return t.setPosition(t.position()+NI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}}});var kI,oh,GI=p(()=>{kI=me(ze(),1),oh=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsUtf8View(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8View(t,r){return t.setPosition(t.position()+kI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8View(t){t.startObject(0)}static endUtf8View(t){return t.endObject()}static createUtf8View(t){return e.startUtf8View(t),e.endUtf8View(t)}}});var pe,bp=p(()=>{(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.FloatingPoint=3]="FloatingPoint",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct_=13]="Struct_",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.RunEndEncoded=22]="RunEndEncoded",e[e.BinaryView=23]="BinaryView",e[e.Utf8View=24]="Utf8View",e[e.ListView=25]="ListView",e[e.LargeListView=26]="LargeListView"})(pe||(pe={}))});var UI,Nr,ub=p(()=>{UI=me(ze(),1);J2();uu();bp();Nr=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsField(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,r){return t.setPosition(t.position()+UI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}name(t){let r=this.bb.__offset(this.bb_pos,4);return r?this.bb.__string(this.bb_pos+r,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):pe.NONE}type(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.__union(t,this.bb_pos+r):null}dictionary(t){let r=this.bb.__offset(this.bb_pos,12);return r?(t||new yo).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}children(t,r){let n=this.bb.__offset(this.bb_pos,14);return n?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,16);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,r){t.addFieldOffset(0,r,0)}static addNullable(t,r){t.addFieldInt8(1,+r,0)}static addTypeType(t,r){t.addFieldInt8(2,r,pe.NONE)}static addType(t,r){t.addFieldOffset(3,r,0)}static addDictionary(t,r){t.addFieldOffset(4,r,0)}static addChildren(t,r){t.addFieldOffset(5,r,0)}static createChildrenVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startChildrenVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(6,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endField(t){return t.endObject()}}});var jI,En,fb=p(()=>{jI=me(ze(),1);Z2();ub();uu();En=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsSchema(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,r){return t.setPosition(t.position()+jI.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):$s.Little}fields(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new Nr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let r=this.bb.__offset(this.bb_pos,10);return r?this.bb.readInt64(this.bb.__vector(this.bb_pos+r)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,r){t.addFieldInt16(0,r,$s.Little)}static addFields(t,r){t.addFieldOffset(1,r,0)}static createFieldsVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startFieldsVector(t,r){t.startVector(4,r,4)}static addCustomMetadata(t,r){t.addFieldOffset(2,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static addFeatures(t,r){t.addFieldOffset(3,r,0)}static createFeaturesVector(t,r){t.startVector(8,r.length,8);for(let n=r.length-1;n>=0;n--)t.addInt64(r[n]);return t.endVector()}static startFeaturesVector(t,r){t.startVector(8,r,8)}static endSchema(t){return t.endObject()}static createSchema(t,r,n,i,o){return e.startSchema(t),e.addEndianness(t,r),e.addFields(t,n),e.addCustomMetadata(t,i),e.addFeatures(t,o),e.endSchema(t)}}});var ke,wp=p(()=>{(function(e){e[e.NONE=0]="NONE",e[e.Schema=1]="Schema",e[e.DictionaryBatch=2]="DictionaryBatch",e[e.RecordBatch=3]="RecordBatch",e[e.Tensor=4]="Tensor",e[e.SparseTensor=5]="SparseTensor"})(ke||(ke={}))});var x,Ne,Nt=p(()=>{up();F2();k2();G2();$f();U2();wp();(function(e){e[e.NONE=0]="NONE",e[e.Null=1]="Null",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Binary=4]="Binary",e[e.Utf8=5]="Utf8",e[e.Bool=6]="Bool",e[e.Decimal=7]="Decimal",e[e.Date=8]="Date",e[e.Time=9]="Time",e[e.Timestamp=10]="Timestamp",e[e.Interval=11]="Interval",e[e.List=12]="List",e[e.Struct=13]="Struct",e[e.Union=14]="Union",e[e.FixedSizeBinary=15]="FixedSizeBinary",e[e.FixedSizeList=16]="FixedSizeList",e[e.Map=17]="Map",e[e.Duration=18]="Duration",e[e.LargeBinary=19]="LargeBinary",e[e.LargeUtf8=20]="LargeUtf8",e[e.LargeList=21]="LargeList",e[e.BinaryView=23]="BinaryView",e[e.Utf8View=24]="Utf8View",e[e.Dictionary=-1]="Dictionary",e[e.Int8=-2]="Int8",e[e.Int16=-3]="Int16",e[e.Int32=-4]="Int32",e[e.Int64=-5]="Int64",e[e.Uint8=-6]="Uint8",e[e.Uint16=-7]="Uint16",e[e.Uint32=-8]="Uint32",e[e.Uint64=-9]="Uint64",e[e.Float16=-10]="Float16",e[e.Float32=-11]="Float32",e[e.Float64=-12]="Float64",e[e.DateDay=-13]="DateDay",e[e.DateMillisecond=-14]="DateMillisecond",e[e.TimestampSecond=-15]="TimestampSecond",e[e.TimestampMillisecond=-16]="TimestampMillisecond",e[e.TimestampMicrosecond=-17]="TimestampMicrosecond",e[e.TimestampNanosecond=-18]="TimestampNanosecond",e[e.TimeSecond=-19]="TimeSecond",e[e.TimeMillisecond=-20]="TimeMillisecond",e[e.TimeMicrosecond=-21]="TimeMicrosecond",e[e.TimeNanosecond=-22]="TimeNanosecond",e[e.DenseUnion=-23]="DenseUnion",e[e.SparseUnion=-24]="SparseUnion",e[e.IntervalDayTime=-25]="IntervalDayTime",e[e.IntervalYearMonth=-26]="IntervalYearMonth",e[e.DurationSecond=-27]="DurationSecond",e[e.DurationMillisecond=-28]="DurationMillisecond",e[e.DurationMicrosecond=-29]="DurationMicrosecond",e[e.DurationNanosecond=-30]="DurationNanosecond",e[e.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(x||(x={}));(function(e){e[e.OFFSET=0]="OFFSET",e[e.DATA=1]="DATA",e[e.VALIDITY=2]="VALIDITY",e[e.TYPE=3]="TYPE"})(Ne||(Ne={}))});var hb={};Qt(hb,{valueToString:()=>ki});function ki(e){if(e===null)return"null";if(e===void 0)return"undefined";switch(typeof e){case"number":return`${e}`;case"bigint":return`${e}`;case"string":return`"${e}"`}return typeof e[Symbol.toPrimitive]=="function"?e[Symbol.toPrimitive]("string"):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(t=>ki(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,r)=>typeof r=="bigint"?`${r}`:r)}var sh=p(()=>{});function Le(e){if(typeof e=="bigint"&&(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER))throw new TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function db(e,t){return Le(e/t)+Le(e%t)/Le(t)}var wo=p(()=>{});var gb={};Qt(gb,{BN:()=>wc,bigNumToBigInt:()=>qI,bigNumToNumber:()=>pb,bigNumToString:()=>du,isArrowBigNumSymbol:()=>zI});function Gi(e,...t){return t.length===0?Object.setPrototypeOf(Re(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}function fu(...e){return Gi.apply(this,e)}function hu(...e){return Gi.apply(this,e)}function ah(...e){return Gi.apply(this,e)}function pb(e,t){let{buffer:r,byteOffset:n,byteLength:i,signed:o}=e,s=new BigUint64Array(r,n,i/8),a=o&&s.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),l=0;if(a){for(let u of s)c|=(u^BW)*(BigInt(1)<<BigInt(64*l++));c*=BigInt(-1),c-=BigInt(1)}else for(let u of s)c|=u*(BigInt(1)<<BigInt(64*l++));if(typeof t=="number"&&t>0){let u=BigInt("1".padEnd(t+1,"0")),h=c/u,d=a?-(c%u):c%u,m=Le(h),g=`${d}`.padStart(t,"0");return+`${a&&m===0?"-":""}${m}.${g}`}return Le(c)}function du(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return mb(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return mb(e);t=t.slice();let n=1;for(let o=0;o<t.length;o++){let s=t[o],a=~s+n;t[o]=a,n&=s===0?1:0}return`-${mb(t)}`}function qI(e){return e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:du(e)}function mb(e){let t="",r=new Uint32Array(2),n=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),o=-1,s=n.length-1;do{for(r[0]=n[o=0];o<s;)n[o++]=r[1]=r[0]/10,r[0]=(r[0]-r[1]*10<<16)+n[o];n[o]=r[1]=r[0]/10,r[0]=r[0]-r[1]*10,t=`${r[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var zI,CW,BW,wc,xp=p(()=>{dr();wo();zI=Symbol.for("isArrowBigNum");Gi.prototype[zI]=!0;Gi.prototype.toJSON=function(){return`"${du(this)}"`};Gi.prototype.valueOf=function(e){return pb(this,e)};Gi.prototype.toString=function(){return du(this)};Gi.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return pb(this);case"string":return du(this);case"default":return qI(this)}return du(this)};Object.setPrototypeOf(fu.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(hu.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ah.prototype,Object.create(Uint32Array.prototype));Object.assign(fu.prototype,Gi.prototype,{constructor:fu,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(hu.prototype,Gi.prototype,{constructor:hu,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ah.prototype,Gi.prototype,{constructor:ah,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});CW=BigInt(4294967296)*BigInt(4294967296),BW=CW-BigInt(1);wc=class e{static new(t,r){switch(r){case!0:return new fu(t);case!1:return new hu(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new fu(t)}return t.byteLength===16?new ah(t):new hu(t)}static signed(t){return new fu(t)}static unsigned(t){return new hu(t)}static decimal(t){return new ah(t)}constructor(t,r){return e.new(t,r)}}});function ti(e){let t=e;switch(e.typeId){case x.Decimal:return e.bitWidth/32;case x.Interval:return t.unit===Ge.MONTH_DAY_NANO?4:1+t.unit;case x.BinaryView:case x.Utf8View:return 16;case x.FixedSizeList:return t.listSize;case x.FixedSizeBinary:return t.byteWidth;default:return 1}}var VI,WI,HI,$I,KI,XI,YI,ZI,JI,QI,e6,t6,r6,n6,i6,o6,s6,a6,c6,l6,u6,f6,h6,d6,m6,p6,U,Ht,Pt,Kn,Xn,Zt,Yn,Zn,Jn,rn,Ui,Fr,ji,nn,Qn,Tn,Ee,zi,kr,on,qi,Gr,An,sn,ta,ra,Pr,na,ia,oa,sa,Rr,aa,xo,ca,la,Ur,ua,fa,ch,an,lh,uh,fh,hh,rr,ei,Je,cn,es,ha,In,$t,jr,DW,nr,at=p(()=>{wo();Nt();p6=Symbol.for("apache-arrow/DataType"),U=class e{static isDataType(t){return(t==null?void 0:t[p6])===!0}static isNull(t){return(t==null?void 0:t.typeId)===x.Null}static isInt(t){return(t==null?void 0:t.typeId)===x.Int}static isFloat(t){return(t==null?void 0:t.typeId)===x.Float}static isBinary(t){return(t==null?void 0:t.typeId)===x.Binary}static isBinaryView(t){return(t==null?void 0:t.typeId)===x.BinaryView}static isLargeBinary(t){return(t==null?void 0:t.typeId)===x.LargeBinary}static isUtf8(t){return(t==null?void 0:t.typeId)===x.Utf8}static isUtf8View(t){return(t==null?void 0:t.typeId)===x.Utf8View}static isLargeUtf8(t){return(t==null?void 0:t.typeId)===x.LargeUtf8}static isBool(t){return(t==null?void 0:t.typeId)===x.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===x.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===x.Date}static isTime(t){return(t==null?void 0:t.typeId)===x.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===x.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===x.Interval}static isDuration(t){return(t==null?void 0:t.typeId)===x.Duration}static isList(t){return(t==null?void 0:t.typeId)===x.List}static isLargeList(t){return(t==null?void 0:t.typeId)===x.LargeList}static isStruct(t){return(t==null?void 0:t.typeId)===x.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===x.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===x.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===x.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===x.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===x.Dictionary}static isDenseUnion(t){return e.isUnion(t)&&t.mode===Ze.Dense}static isSparseUnion(t){return e.isUnion(t)&&t.mode===Ze.Sparse}constructor(t){this.typeId=t}};VI=Symbol.toStringTag;U[VI]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[p6]=!0,e[Symbol.toStringTag]="DataType"))(U.prototype);Ht=class extends U{constructor(){super(x.Null)}toString(){return"Null"}};WI=Symbol.toStringTag;Ht[WI]=(e=>e[Symbol.toStringTag]="Null")(Ht.prototype);Pt=class extends U{constructor(t,r){super(x.Int),this.isSigned=t,this.bitWidth=r}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};HI=Symbol.toStringTag;Pt[HI]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(Pt.prototype);Kn=class extends Pt{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Xn=class extends Pt{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Zt=class extends Pt{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Yn=class extends Pt{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Zn=class extends Pt{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Jn=class extends Pt{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},rn=class extends Pt{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Ui=class extends Pt{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Kn.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Xn.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Zt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Yn.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Zn.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Jn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(rn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Ui.prototype,"ArrayType",{value:BigUint64Array});Fr=class extends U{constructor(t){super(x.Float),this.precision=t}get ArrayType(){switch(this.precision){case He.HALF:return Uint16Array;case He.SINGLE:return Float32Array;case He.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};$I=Symbol.toStringTag;Fr[$I]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Fr.prototype);ji=class extends Fr{constructor(){super(He.HALF)}},nn=class extends Fr{constructor(){super(He.SINGLE)}},Qn=class extends Fr{constructor(){super(He.DOUBLE)}};Object.defineProperty(ji.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(nn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Qn.prototype,"ArrayType",{value:Float64Array});Tn=class extends U{constructor(){super(x.Binary)}toString(){return"Binary"}};KI=Symbol.toStringTag;Tn[KI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(Tn.prototype);Ee=class extends U{constructor(){super(x.BinaryView)}toString(){return"BinaryView"}};XI=Symbol.toStringTag;Ee.ELEMENT_WIDTH=16;Ee.INLINE_CAPACITY=12;Ee.LENGTH_OFFSET=0;Ee.INLINE_OFFSET=4;Ee.BUFFER_INDEX_OFFSET=8;Ee.BUFFER_OFFSET_OFFSET=12;Ee[XI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="BinaryView"))(Ee.prototype);zi=class extends U{constructor(){super(x.LargeBinary)}toString(){return"LargeBinary"}};YI=Symbol.toStringTag;zi[YI]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(zi.prototype);kr=class extends U{constructor(){super(x.Utf8)}toString(){return"Utf8"}};ZI=Symbol.toStringTag;kr[ZI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(kr.prototype);on=class extends U{constructor(){super(x.Utf8View)}toString(){return"Utf8View"}};JI=Symbol.toStringTag;on.ELEMENT_WIDTH=Ee.ELEMENT_WIDTH;on.INLINE_CAPACITY=Ee.INLINE_CAPACITY;on[JI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8View"))(on.prototype);qi=class extends U{constructor(){super(x.LargeUtf8)}toString(){return"LargeUtf8"}};QI=Symbol.toStringTag;qi[QI]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(qi.prototype);Gr=class extends U{constructor(){super(x.Bool)}toString(){return"Bool"}};e6=Symbol.toStringTag;Gr[e6]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Gr.prototype);An=class extends U{constructor(t,r,n=128){super(x.Decimal),this.scale=t,this.precision=r,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};t6=Symbol.toStringTag;An[t6]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(An.prototype);sn=class extends U{constructor(t){super(x.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${st[this.unit]}>`}get ArrayType(){return this.unit===st.DAY?Int32Array:BigInt64Array}};r6=Symbol.toStringTag;sn[r6]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(sn.prototype);ta=class extends sn{constructor(){super(st.DAY)}},ra=class extends sn{constructor(){super(st.MILLISECOND)}},Pr=class extends U{constructor(t,r){super(x.Time),this.unit=t,this.bitWidth=r}toString(){return`Time${this.bitWidth}<${q[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};n6=Symbol.toStringTag;Pr[n6]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Pr.prototype);na=class extends Pr{constructor(){super(q.SECOND,32)}},ia=class extends Pr{constructor(){super(q.MILLISECOND,32)}},oa=class extends Pr{constructor(){super(q.MICROSECOND,64)}},sa=class extends Pr{constructor(){super(q.NANOSECOND,64)}},Rr=class extends U{constructor(t,r){super(x.Timestamp),this.unit=t,this.timezone=r}toString(){return`Timestamp<${q[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};i6=Symbol.toStringTag;Rr[i6]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(Rr.prototype);aa=class extends Rr{constructor(t){super(q.SECOND,t)}},xo=class extends Rr{constructor(t){super(q.MILLISECOND,t)}},ca=class extends Rr{constructor(t){super(q.MICROSECOND,t)}},la=class extends Rr{constructor(t){super(q.NANOSECOND,t)}},Ur=class extends U{constructor(t){super(x.Interval),this.unit=t}toString(){return`Interval<${Ge[this.unit]}>`}};o6=Symbol.toStringTag;Ur[o6]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(Ur.prototype);ua=class extends Ur{constructor(){super(Ge.DAY_TIME)}},fa=class extends Ur{constructor(){super(Ge.YEAR_MONTH)}},ch=class extends Ur{constructor(){super(Ge.MONTH_DAY_NANO)}},an=class extends U{constructor(t){super(x.Duration),this.unit=t}toString(){return`Duration<${q[this.unit]}>`}};s6=Symbol.toStringTag;an[s6]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(an.prototype);lh=class extends an{constructor(){super(q.SECOND)}},uh=class extends an{constructor(){super(q.MILLISECOND)}},fh=class extends an{constructor(){super(q.MICROSECOND)}},hh=class extends an{constructor(){super(q.NANOSECOND)}},rr=class extends U{constructor(t){super(x.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};a6=Symbol.toStringTag;rr[a6]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(rr.prototype);ei=class extends U{constructor(t){super(x.LargeList),this.children=[t]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};c6=Symbol.toStringTag;ei[c6]=(e=>(e.children=null,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeList"))(ei.prototype);Je=class extends U{constructor(t){super(x.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};l6=Symbol.toStringTag;Je[l6]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(Je.prototype);cn=class extends U{constructor(t,r,n){super(x.Union),this.mode=t,this.children=n,this.typeIds=r=Int32Array.from(r),this.typeIdToChildIndex=r.reduce((i,o,s)=>(i[o]=s)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};u6=Symbol.toStringTag;cn[u6]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(cn.prototype);es=class extends cn{constructor(t,r){super(Ze.Dense,t,r)}},ha=class extends cn{constructor(t,r){super(Ze.Sparse,t,r)}},In=class extends U{constructor(t){super(x.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};f6=Symbol.toStringTag;In[f6]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(In.prototype);$t=class extends U{constructor(t,r){super(x.FixedSizeList),this.listSize=t,this.children=[r]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};h6=Symbol.toStringTag;$t[h6]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))($t.prototype);jr=class extends U{constructor(t,r=!1){var n,i,o;if(super(x.Map),this.children=[t],this.keysSorted=r,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){let s=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];s&&(s.name="key");let a=(o=t==null?void 0:t.type)===null||o===void 0?void 0:o.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};d6=Symbol.toStringTag;jr[d6]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(jr.prototype);DW=(e=>()=>++e)(-1),nr=class extends U{constructor(t,r,n,i){super(x.Dictionary),this.indices=r,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?DW():Le(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};m6=Symbol.toStringTag;nr[m6]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(nr.prototype)});function NW(e,t,r=!0){return typeof t=="number"?mu(e,t,r):typeof t=="string"&&t in x?mu(e,x[t],r):t&&t instanceof U?mu(e,y6(t),r):t!=null&&t.type&&t.type instanceof U?mu(e,y6(t.type),r):mu(e,x.NONE,r)}function mu(e,t,r=!0){let n=null;switch(t){case x.Null:n=e.visitNull;break;case x.Bool:n=e.visitBool;break;case x.Int:n=e.visitInt;break;case x.Int8:n=e.visitInt8||e.visitInt;break;case x.Int16:n=e.visitInt16||e.visitInt;break;case x.Int32:n=e.visitInt32||e.visitInt;break;case x.Int64:n=e.visitInt64||e.visitInt;break;case x.Uint8:n=e.visitUint8||e.visitInt;break;case x.Uint16:n=e.visitUint16||e.visitInt;break;case x.Uint32:n=e.visitUint32||e.visitInt;break;case x.Uint64:n=e.visitUint64||e.visitInt;break;case x.Float:n=e.visitFloat;break;case x.Float16:n=e.visitFloat16||e.visitFloat;break;case x.Float32:n=e.visitFloat32||e.visitFloat;break;case x.Float64:n=e.visitFloat64||e.visitFloat;break;case x.Utf8:n=e.visitUtf8;break;case x.LargeUtf8:n=e.visitLargeUtf8;break;case x.Utf8View:n=e.visitUtf8View||e.visitUtf8;break;case x.Binary:n=e.visitBinary;break;case x.LargeBinary:n=e.visitLargeBinary;break;case x.BinaryView:n=e.visitBinaryView||e.visitBinary;break;case x.FixedSizeBinary:n=e.visitFixedSizeBinary;break;case x.Date:n=e.visitDate;break;case x.DateDay:n=e.visitDateDay||e.visitDate;break;case x.DateMillisecond:n=e.visitDateMillisecond||e.visitDate;break;case x.Timestamp:n=e.visitTimestamp;break;case x.TimestampSecond:n=e.visitTimestampSecond||e.visitTimestamp;break;case x.TimestampMillisecond:n=e.visitTimestampMillisecond||e.visitTimestamp;break;case x.TimestampMicrosecond:n=e.visitTimestampMicrosecond||e.visitTimestamp;break;case x.TimestampNanosecond:n=e.visitTimestampNanosecond||e.visitTimestamp;break;case x.Time:n=e.visitTime;break;case x.TimeSecond:n=e.visitTimeSecond||e.visitTime;break;case x.TimeMillisecond:n=e.visitTimeMillisecond||e.visitTime;break;case x.TimeMicrosecond:n=e.visitTimeMicrosecond||e.visitTime;break;case x.TimeNanosecond:n=e.visitTimeNanosecond||e.visitTime;break;case x.Decimal:n=e.visitDecimal;break;case x.List:n=e.visitList;break;case x.LargeList:n=e.visitLargeList;break;case x.Struct:n=e.visitStruct;break;case x.Union:n=e.visitUnion;break;case x.DenseUnion:n=e.visitDenseUnion||e.visitUnion;break;case x.SparseUnion:n=e.visitSparseUnion||e.visitUnion;break;case x.Dictionary:n=e.visitDictionary;break;case x.Interval:n=e.visitInterval;break;case x.IntervalDayTime:n=e.visitIntervalDayTime||e.visitInterval;break;case x.IntervalYearMonth:n=e.visitIntervalYearMonth||e.visitInterval;break;case x.IntervalMonthDayNano:n=e.visitIntervalMonthDayNano||e.visitInterval;break;case x.Duration:n=e.visitDuration;break;case x.DurationSecond:n=e.visitDurationSecond||e.visitDuration;break;case x.DurationMillisecond:n=e.visitDurationMillisecond||e.visitDuration;break;case x.DurationMicrosecond:n=e.visitDurationMicrosecond||e.visitDuration;break;case x.DurationNanosecond:n=e.visitDurationNanosecond||e.visitDuration;break;case x.FixedSizeList:n=e.visitFixedSizeList;break;case x.Map:n=e.visitMap;break}if(typeof n=="function")return n;if(!r)return()=>null;throw new Error(`Unrecognized type '${x[t]}'`)}function y6(e){switch(e.typeId){case x.Null:return x.Null;case x.Int:{let{bitWidth:t,isSigned:r}=e;switch(t){case 8:return r?x.Int8:x.Uint8;case 16:return r?x.Int16:x.Uint16;case 32:return r?x.Int32:x.Uint32;case 64:return r?x.Int64:x.Uint64}return x.Int}case x.Float:switch(e.precision){case He.HALF:return x.Float16;case He.SINGLE:return x.Float32;case He.DOUBLE:return x.Float64}return x.Float;case x.Binary:return x.Binary;case x.LargeBinary:return x.LargeBinary;case x.BinaryView:return x.BinaryView;case x.Utf8:return x.Utf8;case x.LargeUtf8:return x.LargeUtf8;case x.Utf8View:return x.Utf8View;case x.Bool:return x.Bool;case x.Decimal:return x.Decimal;case x.Time:switch(e.unit){case q.SECOND:return x.TimeSecond;case q.MILLISECOND:return x.TimeMillisecond;case q.MICROSECOND:return x.TimeMicrosecond;case q.NANOSECOND:return x.TimeNanosecond}return x.Time;case x.Timestamp:switch(e.unit){case q.SECOND:return x.TimestampSecond;case q.MILLISECOND:return x.TimestampMillisecond;case q.MICROSECOND:return x.TimestampMicrosecond;case q.NANOSECOND:return x.TimestampNanosecond}return x.Timestamp;case x.Date:switch(e.unit){case st.DAY:return x.DateDay;case st.MILLISECOND:return x.DateMillisecond}return x.Date;case x.Interval:switch(e.unit){case Ge.DAY_TIME:return x.IntervalDayTime;case Ge.YEAR_MONTH:return x.IntervalYearMonth;case Ge.MONTH_DAY_NANO:return x.IntervalMonthDayNano}return x.Interval;case x.Duration:switch(e.unit){case q.SECOND:return x.DurationSecond;case q.MILLISECOND:return x.DurationMillisecond;case q.MICROSECOND:return x.DurationMicrosecond;case q.NANOSECOND:return x.DurationNanosecond}return x.Duration;case x.Map:return x.Map;case x.List:return x.List;case x.LargeList:return x.LargeList;case x.Struct:return x.Struct;case x.Union:switch(e.mode){case Ze.Dense:return x.DenseUnion;case Ze.Sparse:return x.SparseUnion}return x.Union;case x.FixedSizeBinary:return x.FixedSizeBinary;case x.FixedSizeList:return x.FixedSizeList;case x.Dictionary:return x.Dictionary}throw new Error(`Unrecognized type '${x[e.typeId]}'`)}var ie,Pn=p(()=>{Nt();at();ie=class{visitMany(t,...r){return t.map((n,i)=>this.visit(n,...r.map(o=>o[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,r=!0){return NW(this,t,r)}getVisitFnByTypeId(t,r=!0){return mu(this,t,r)}visitNull(t,...r){return null}visitBool(t,...r){return null}visitInt(t,...r){return null}visitFloat(t,...r){return null}visitUtf8(t,...r){return null}visitLargeUtf8(t,...r){return null}visitUtf8View(t,...r){return null}visitBinary(t,...r){return null}visitLargeBinary(t,...r){return null}visitBinaryView(t,...r){return null}visitFixedSizeBinary(t,...r){return null}visitDate(t,...r){return null}visitTimestamp(t,...r){return null}visitTime(t,...r){return null}visitDecimal(t,...r){return null}visitList(t,...r){return null}visitLargeList(t,...r){return null}visitStruct(t,...r){return null}visitUnion(t,...r){return null}visitDictionary(t,...r){return null}visitInterval(t,...r){return null}visitDuration(t,...r){return null}visitFixedSizeList(t,...r){return null}visitMap(t,...r){return null}};ie.prototype.visitInt8=null;ie.prototype.visitInt16=null;ie.prototype.visitInt32=null;ie.prototype.visitInt64=null;ie.prototype.visitUint8=null;ie.prototype.visitUint16=null;ie.prototype.visitUint32=null;ie.prototype.visitUint64=null;ie.prototype.visitFloat16=null;ie.prototype.visitFloat32=null;ie.prototype.visitFloat64=null;ie.prototype.visitDateDay=null;ie.prototype.visitDateMillisecond=null;ie.prototype.visitTimestampSecond=null;ie.prototype.visitTimestampMillisecond=null;ie.prototype.visitTimestampMicrosecond=null;ie.prototype.visitTimestampNanosecond=null;ie.prototype.visitTimeSecond=null;ie.prototype.visitTimeMillisecond=null;ie.prototype.visitTimeMicrosecond=null;ie.prototype.visitTimeNanosecond=null;ie.prototype.visitDenseUnion=null;ie.prototype.visitSparseUnion=null;ie.prototype.visitIntervalDayTime=null;ie.prototype.visitIntervalYearMonth=null;ie.prototype.visitIntervalMonthDayNano=null;ie.prototype.visitDuration=null;ie.prototype.visitDurationSecond=null;ie.prototype.visitDurationMillisecond=null;ie.prototype.visitDurationMicrosecond=null;ie.prototype.visitDurationNanosecond=null});var yb={};Qt(yb,{float64ToUint16:()=>dh,uint16ToFloat64:()=>_p});function _p(e){let t=(e&31744)>>10,r=(e&1023)/1024,n=Math.pow(-1,(e&32768)>>15);switch(t){case 31:return n*(r?Number.NaN:1/0);case 0:return n*(r?6103515625e-14*r:0)}return n*Math.pow(2,t-15)*(1+r)}function dh(e){if(e!==e)return 32256;b6[0]=e;let t=(pu[1]&2147483648)>>16&65535,r=pu[1]&2146435072,n=0;return r>=1089470464?pu[0]>0?r=31744:(r=(r&2080374784)>>16,n=(pu[1]&1048575)>>10):r<=1056964608?(n=1048576+(pu[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(pu[1]&1048575)+512>>10),t|r|n&65535}var b6,pu,mh=p(()=>{b6=new Float64Array(1),pu=new Uint32Array(b6.buffer)});function be(e){return(t,r,n)=>{if(t.setValid(r,n!=null))return e(t,r,n)}}var he,FW,w6,kW,ts,bb,x6,GW,Sp,Mp,wb,_6,UW,S6,jW,M6,zW,xb,vp,Ep,Tp,Ap,_b,Ip,Pp,Rp,Lp,Sb,Mb,v6,qW,VW,WW,HW,$W,KW,XW,E6,T6,YW,vb,Op,Cp,Bp,Dp,Np,Fp,kp,Eb,ZW,Lr,ri=p(()=>{zr();Pn();wo();Ko();mh();Nt();at();he=class extends ie{};FW=(e,t,r)=>{e[t]=Math.floor(r/864e5)},w6=(e,t,r,n)=>{if(r+1<t.length){let i=Le(t[r]),o=Le(t[r+1]);e.set(n.subarray(0,o-i),i)}},kW=({offset:e,values:t},r,n)=>{let i=e+r;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},ts=({values:e},t,r)=>{e[t]=r},bb=({values:e},t,r)=>{e[t]=r},x6=({values:e},t,r)=>{e[t]=dh(r)},GW=(e,t,r)=>{switch(e.type.precision){case He.HALF:return x6(e,t,r);case He.SINGLE:case He.DOUBLE:return bb(e,t,r)}},Sp=({values:e},t,r)=>{FW(e,t,r.valueOf())},Mp=({values:e},t,r)=>{e[t]=BigInt(r)},wb=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},_6=({values:e,valueOffsets:t},r,n)=>w6(e,t,r,n),UW=e=>{let t=e.variadicBuffers;return(!Array.isArray(t)||Object.isFrozen(t))&&(t=Array.from(t),e.variadicBuffers=t),t},S6=(e,t,r)=>{var n,i,o,s;let a=e.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Ee.ELEMENT_WIDTH,l=t*c,u=l+c;if(l<0||u>a.length)throw new RangeError(`BinaryView index ${t} out of bounds`);a.fill(0,l,u);let h=new DataView(a.buffer,a.byteOffset+l,c),d=r.length;if(h.setInt32(Ee.LENGTH_OFFSET,d,!0),d<=Ee.INLINE_CAPACITY){a.set(r,l+Ee.INLINE_OFFSET);return}let m=((n=r[0])!==null&&n!==void 0?n:0)|((i=r[1])!==null&&i!==void 0?i:0)<<8|((o=r[2])!==null&&o!==void 0?o:0)<<16|((s=r[3])!==null&&s!==void 0?s:0)<<24;h.setUint32(Ee.INLINE_OFFSET,m>>>0,!0);let g=UW(e),y=r.slice(),b=g.push(y)-1;h.setInt32(Ee.BUFFER_INDEX_OFFSET,b,!0),h.setInt32(Ee.BUFFER_OFFSET_OFFSET,0,!0)},jW=(e,t,r)=>{let n=r instanceof Uint8Array?r:new Uint8Array(r);S6(e,t,n)},M6=({values:e,valueOffsets:t},r,n)=>w6(e,t,r,qn(n)),zW=(e,t,r)=>{let n=qn(r);S6(e,t,n)},xb=(e,t,r)=>{e.type.unit===st.DAY?Sp(e,t,r):Mp(e,t,r)},vp=({values:e},t,r)=>{e[t]=BigInt(r/1e3)},Ep=({values:e},t,r)=>{e[t]=BigInt(r)},Tp=({values:e},t,r)=>{e[t]=BigInt(r*1e3)},Ap=({values:e},t,r)=>{e[t]=BigInt(r*1e6)},_b=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return vp(e,t,r);case q.MILLISECOND:return Ep(e,t,r);case q.MICROSECOND:return Tp(e,t,r);case q.NANOSECOND:return Ap(e,t,r)}},Ip=({values:e},t,r)=>{e[t]=r},Pp=({values:e},t,r)=>{e[t]=r},Rp=({values:e},t,r)=>{e[t]=r},Lp=({values:e},t,r)=>{e[t]=r},Sb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return Ip(e,t,r);case q.MILLISECOND:return Pp(e,t,r);case q.MICROSECOND:return Rp(e,t,r);case q.NANOSECOND:return Lp(e,t,r)}},Mb=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},v6=(e,t,r)=>{let n=e.children[0],i=e.valueOffsets,o=Lr.getVisitFn(n),s=Le(i[t]),a=Le(i[t+1]);if(Array.isArray(r))for(let c=-1,l=s;l<a;)o(n,l++,r[++c]);else for(let c=-1,l=s;l<a;)o(n,l++,r.get(++c))},qW=(e,t,r)=>{let n=e.children[0],{valueOffsets:i}=e,o=Lr.getVisitFn(n),{[t]:s,[t+1]:a}=i,c=r instanceof Map?r.entries():Object.entries(r);for(let l of c)if(o(n,s,l),++s>=a)break},VW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[o]),WW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(o)),HW=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(i.name)),$W=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[i.name]),KW=(e,t,r)=>{let n=e.type.children.map(o=>Lr.getVisitFn(o.type)),i=r instanceof Map?HW(t,r):r instanceof $?WW(t,r):Array.isArray(r)?VW(t,r):$W(t,r);e.type.children.forEach((o,s)=>i(n[s],e.children[s],o,s))},XW=(e,t,r)=>{e.type.mode===Ze.Dense?E6(e,t,r):T6(e,t,r)},E6=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Lr.visit(i,e.valueOffsets[t],r)},T6=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Lr.visit(i,t,r)},YW=(e,t,r)=>{var n;(n=e.dictionary)===null||n===void 0||n.set(e.values[t],r)},vb=(e,t,r)=>{switch(e.type.unit){case Ge.YEAR_MONTH:return Cp(e,t,r);case Ge.DAY_TIME:return Op(e,t,r);case Ge.MONTH_DAY_NANO:return Bp(e,t,r)}},Op=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},Cp=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},Bp=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},Dp=({values:e},t,r)=>{e[t]=r},Np=({values:e},t,r)=>{e[t]=r},Fp=({values:e},t,r)=>{e[t]=r},kp=({values:e},t,r)=>{e[t]=r},Eb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return Dp(e,t,r);case q.MILLISECOND:return Np(e,t,r);case q.MICROSECOND:return Fp(e,t,r);case q.NANOSECOND:return kp(e,t,r)}},ZW=(e,t,r)=>{let{stride:n}=e,i=e.children[0],o=Lr.getVisitFn(i);if(Array.isArray(r))for(let s=-1,a=t*n;++s<n;)o(i,a+s,r[s]);else for(let s=-1,a=t*n;++s<n;)o(i,a+s,r.get(s))};he.prototype.visitBool=be(kW);he.prototype.visitInt=be(ts);he.prototype.visitInt8=be(ts);he.prototype.visitInt16=be(ts);he.prototype.visitInt32=be(ts);he.prototype.visitInt64=be(ts);he.prototype.visitUint8=be(ts);he.prototype.visitUint16=be(ts);he.prototype.visitUint32=be(ts);he.prototype.visitUint64=be(ts);he.prototype.visitFloat=be(GW);he.prototype.visitFloat16=be(x6);he.prototype.visitFloat32=be(bb);he.prototype.visitFloat64=be(bb);he.prototype.visitUtf8=be(M6);he.prototype.visitLargeUtf8=be(M6);he.prototype.visitUtf8View=be(zW);he.prototype.visitBinary=be(_6);he.prototype.visitLargeBinary=be(_6);he.prototype.visitBinaryView=be(jW);he.prototype.visitFixedSizeBinary=be(wb);he.prototype.visitDate=be(xb);he.prototype.visitDateDay=be(Sp);he.prototype.visitDateMillisecond=be(Mp);he.prototype.visitTimestamp=be(_b);he.prototype.visitTimestampSecond=be(vp);he.prototype.visitTimestampMillisecond=be(Ep);he.prototype.visitTimestampMicrosecond=be(Tp);he.prototype.visitTimestampNanosecond=be(Ap);he.prototype.visitTime=be(Sb);he.prototype.visitTimeSecond=be(Ip);he.prototype.visitTimeMillisecond=be(Pp);he.prototype.visitTimeMicrosecond=be(Rp);he.prototype.visitTimeNanosecond=be(Lp);he.prototype.visitDecimal=be(Mb);he.prototype.visitList=be(v6);he.prototype.visitLargeList=be(v6);he.prototype.visitStruct=be(KW);he.prototype.visitUnion=be(XW);he.prototype.visitDenseUnion=be(E6);he.prototype.visitSparseUnion=be(T6);he.prototype.visitDictionary=be(YW);he.prototype.visitInterval=be(vb);he.prototype.visitIntervalDayTime=be(Op);he.prototype.visitIntervalYearMonth=be(Cp);he.prototype.visitIntervalMonthDayNano=be(Bp);he.prototype.visitDuration=be(Eb);he.prototype.visitDurationSecond=be(Dp);he.prototype.visitDurationMillisecond=be(Np);he.prototype.visitDurationMicrosecond=be(Fp);he.prototype.visitDurationNanosecond=be(kp);he.prototype.visitFixedSizeList=be(ZW);he.prototype.visitMap=be(qW);Lr=new he});var Vi,gu,_o,Tb,Ab,JW,Gp=p(()=>{sh();xc();ri();Vi=Symbol.for("parent"),gu=Symbol.for("rowIndex"),_o=class{constructor(t,r){return this[Vi]=t,this[gu]=r,new Proxy(this,JW)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[gu],r=this[Vi],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=ir.visit(r.children[o],t);return i}toString(){return`{${[...this].map(([t,r])=>`${ki(t)}: ${ki(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Tb(this[Vi],this[gu])}},Tb=class{constructor(t,r){this.childIndex=0,this.children=t.children,this.rowIndex=r,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,ir.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(_o.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Vi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[gu]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});Ab=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Vi].type.children.map(r=>r.name)}has(t,r){return t[Vi].type.children.some(n=>n.name===r)}getOwnPropertyDescriptor(t,r){if(t[Vi].type.children.some(n=>n.name===r))return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[Vi].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=ir.visit(t[Vi].children[n],t[gu]);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[Vi].type.children.findIndex(o=>o.name===r);return i!==-1?(Lr.visit(t[Vi].children[i],t[gu],n),Reflect.set(t,r,n)):Reflect.has(t,r)||typeof r=="symbol"?Reflect.set(t,r,n):!1}},JW=new Ab});function ge(e){return(t,r)=>t.getValid(r)?e(t,r):null}var ce,QW,yu,eH,tH,A6,rH,I6,P6,da,nH,R6,iH,L6,O6,oH,C6,sH,aH,cH,lH,B6,D6,N6,F6,uH,k6,G6,U6,j6,fH,hH,z6,dH,mH,pH,q6,V6,gH,yH,W6,H6,$6,K6,X6,Y6,Z6,bH,wH,ir,xc=p(()=>{xp();zr();Pn();ph();Gp();wo();Ko();mh();Nt();ce=class extends ie{};QW=(e,t)=>864e5*e[t],yu=16,eH=12,tH=(e,t)=>null,A6=(e,t,r)=>{if(r+1>=t.length)return null;let n=Le(t[r]),i=Le(t[r+1]);return e.subarray(n,i)},rH=({offset:e,values:t},r)=>{let n=e+r;return(t[n>>3]&1<<n%8)!==0},I6=({values:e},t)=>QW(e,t),P6=({values:e},t)=>Le(e[t]),da=({stride:e,values:t},r)=>t[e*r],nH=({stride:e,values:t},r)=>_p(t[e*r]),R6=({values:e},t)=>e[t],iH=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),L6=({values:e,valueOffsets:t},r)=>A6(e,t,r),O6=(e,t)=>{var r;let n=e.values;if(!n)throw new Error("BinaryView data is missing view buffer");let i=t*yu,o=i+yu;if(i<0||o>n.length)throw new Error(`BinaryView data buffer is too short: expected ${yu} bytes, got ${Math.max(0,n.length-i)}`);let s=n.subarray(i,o);if(s.length<yu)throw new Error(`BinaryView data buffer is too short: expected ${yu} bytes, got ${s.length}`);let a=new DataView(n.buffer,s.byteOffset,yu),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=eH)return s.subarray(4,4+c);let l=a.getInt32(8,!0),u=a.getInt32(12,!0),h=(r=e.variadicBuffers)===null||r===void 0?void 0:r[l];if(!h)throw new Error(`BinaryView variadic buffer ${l} is missing`);return h.subarray(u,u+c)},oH=(e,t)=>O6(e,t),C6=({values:e,valueOffsets:t},r)=>{let n=A6(e,t,r);return n!==null?ou(n):null},sH=(e,t)=>{let r=O6(e,t);return ou(r)},aH=({values:e},t)=>e[t],cH=({type:e,values:t},r)=>e.precision!==He.HALF?t[r]:_p(t[r]),lH=(e,t)=>e.type.unit===st.DAY?I6(e,t):P6(e,t),B6=({values:e},t)=>1e3*Le(e[t]),D6=({values:e},t)=>Le(e[t]),N6=({values:e},t)=>db(e[t],BigInt(1e3)),F6=({values:e},t)=>db(e[t],BigInt(1e6)),uH=(e,t)=>{switch(e.type.unit){case q.SECOND:return B6(e,t);case q.MILLISECOND:return D6(e,t);case q.MICROSECOND:return N6(e,t);case q.NANOSECOND:return F6(e,t)}},k6=({values:e},t)=>e[t],G6=({values:e},t)=>e[t],U6=({values:e},t)=>e[t],j6=({values:e},t)=>e[t],fH=(e,t)=>{switch(e.type.unit){case q.SECOND:return k6(e,t);case q.MILLISECOND:return G6(e,t);case q.MICROSECOND:return U6(e,t);case q.NANOSECOND:return j6(e,t)}},hH=({values:e,stride:t},r)=>wc.decimal(e.subarray(t*r,t*(r+1))),z6=(e,t)=>{let{valueOffsets:r,stride:n,children:i}=e,o=Le(r[t*n]),s=Le(r[t*n+1]),c=i[0].slice(o,s-o);return new $([c])},dH=(e,t)=>{let{valueOffsets:r,children:n}=e,{[t]:i,[t+1]:o}=r,s=n[0];return new bi(s.slice(i,o-i))},mH=(e,t)=>new _o(e,t),pH=(e,t)=>e.type.mode===Ze.Dense?q6(e,t):V6(e,t),q6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return ir.visit(n,e.valueOffsets[t])},V6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return ir.visit(n,t)},gH=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},yH=(e,t)=>e.type.unit===Ge.MONTH_DAY_NANO?$6(e,t):e.type.unit===Ge.DAY_TIME?W6(e,t):H6(e,t),W6=({values:e},t)=>e.subarray(2*t,2*(t+1)),H6=({values:e},t)=>{let r=e[t],n=new Int32Array(2);return n[0]=Math.trunc(r/12),n[1]=Math.trunc(r%12),n},$6=({values:e},t)=>e.subarray(4*t,4*(t+1)),K6=({values:e},t)=>e[t],X6=({values:e},t)=>e[t],Y6=({values:e},t)=>e[t],Z6=({values:e},t)=>e[t],bH=(e,t)=>{switch(e.type.unit){case q.SECOND:return K6(e,t);case q.MILLISECOND:return X6(e,t);case q.MICROSECOND:return Y6(e,t);case q.NANOSECOND:return Z6(e,t)}},wH=(e,t)=>{let{stride:r,children:n}=e,o=n[0].slice(t*r,r);return new $([o])};ce.prototype.visitNull=ge(tH);ce.prototype.visitBool=ge(rH);ce.prototype.visitInt=ge(aH);ce.prototype.visitInt8=ge(da);ce.prototype.visitInt16=ge(da);ce.prototype.visitInt32=ge(da);ce.prototype.visitInt64=ge(R6);ce.prototype.visitUint8=ge(da);ce.prototype.visitUint16=ge(da);ce.prototype.visitUint32=ge(da);ce.prototype.visitUint64=ge(R6);ce.prototype.visitFloat=ge(cH);ce.prototype.visitFloat16=ge(nH);ce.prototype.visitFloat32=ge(da);ce.prototype.visitFloat64=ge(da);ce.prototype.visitUtf8=ge(C6);ce.prototype.visitLargeUtf8=ge(C6);ce.prototype.visitUtf8View=ge(sH);ce.prototype.visitBinary=ge(L6);ce.prototype.visitLargeBinary=ge(L6);ce.prototype.visitBinaryView=ge(oH);ce.prototype.visitFixedSizeBinary=ge(iH);ce.prototype.visitDate=ge(lH);ce.prototype.visitDateDay=ge(I6);ce.prototype.visitDateMillisecond=ge(P6);ce.prototype.visitTimestamp=ge(uH);ce.prototype.visitTimestampSecond=ge(B6);ce.prototype.visitTimestampMillisecond=ge(D6);ce.prototype.visitTimestampMicrosecond=ge(N6);ce.prototype.visitTimestampNanosecond=ge(F6);ce.prototype.visitTime=ge(fH);ce.prototype.visitTimeSecond=ge(k6);ce.prototype.visitTimeMillisecond=ge(G6);ce.prototype.visitTimeMicrosecond=ge(U6);ce.prototype.visitTimeNanosecond=ge(j6);ce.prototype.visitDecimal=ge(hH);ce.prototype.visitList=ge(z6);ce.prototype.visitLargeList=ge(z6);ce.prototype.visitStruct=ge(mH);ce.prototype.visitUnion=ge(pH);ce.prototype.visitDenseUnion=ge(q6);ce.prototype.visitSparseUnion=ge(V6);ce.prototype.visitDictionary=ge(gH);ce.prototype.visitInterval=ge(yH);ce.prototype.visitIntervalDayTime=ge(W6);ce.prototype.visitIntervalYearMonth=ge(H6);ce.prototype.visitIntervalMonthDayNano=ge($6);ce.prototype.visitDuration=ge(bH);ce.prototype.visitDurationSecond=ge(K6);ce.prototype.visitDurationMillisecond=ge(X6);ce.prototype.visitDurationMicrosecond=ge(Y6);ce.prototype.visitDurationNanosecond=ge(Z6);ce.prototype.visitFixedSizeList=ge(wH);ce.prototype.visitMap=ge(dH);ir=new ce});var ma,wu,bu,Ib,bi,Pb,Rb,ph=p(()=>{zr();sh();xc();ri();ma=Symbol.for("keys"),wu=Symbol.for("vals"),bu=Symbol.for("kKeysAsStrings"),Ib=Symbol.for("_kKeysAsStrings"),bi=class{constructor(t){return this[ma]=new $([t.children[0]]).memoize(),this[wu]=t.children[1],new Proxy(this,new Rb)}get[bu](){return this[Ib]||(this[Ib]=Array.from(this[ma].toArray(),String))}[Symbol.iterator](){return new Pb(this[ma],this[wu])}get size(){return this[ma].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[ma],r=this[wu],n={};for(let i=-1,o=t.length;++i<o;)n[t.get(i)]=ir.visit(r,i);return n}toString(){return`{${[...this].map(([t,r])=>`${ki(t)}: ${ki(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Pb=class{constructor(t,r){this.keys=t,this.vals=r,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){let t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),ir.visit(this.vals,t)]})}},Rb=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[bu]}has(t,r){return t[bu].includes(r)}getOwnPropertyDescriptor(t,r){if(t[bu].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[bu].indexOf(r);if(n!==-1){let i=ir.visit(Reflect.get(t,wu),n);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[bu].indexOf(r);return i!==-1?(Lr.visit(Reflect.get(t,wu),i,n),Reflect.set(t,r,n)):Reflect.has(t,r)?Reflect.set(t,r,n):!1}};Object.defineProperties(bi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ma]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wu]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ib]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Lb={};Qt(Lb,{clampRange:()=>gh,createElementComparator:()=>pa,wrapIndex:()=>_c});function gh(e,t,r,n){let{length:i=0}=e,o=typeof t!="number"?0:t,s=typeof r!="number"?i:r;return o<0&&(o=(o%i+i)%i),s<0&&(s=(s%i+i)%i),s<o&&(J6=o,o=s,s=J6),s>i&&(s=i),n?n(e,o,s):[o,s]}function pa(e){if(typeof e!=="object"||e===null)return Q6(e)?Q6:r=>r===e;if(e instanceof Date){let r=e.valueOf();return n=>n instanceof Date?n.valueOf()===r:!1}return ArrayBuffer.isView(e)?r=>r?C2(e,r):!1:e instanceof Map?_H(e):Array.isArray(e)?xH(e):e instanceof $?SH(e):MH(e,!0)}function xH(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=pa(e[r]);return Up(t)}function _H(e){let t=-1,r=[];for(let n of e.values())r[++t]=pa(n);return Up(r)}function SH(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=pa(e.get(r));return Up(t)}function MH(e,t=!1){let r=Object.keys(e);if(!t&&r.length===0)return()=>!1;let n=[];for(let i=-1,o=r.length;++i<o;)n[i]=pa(e[r[i]]);return Up(n,r)}function Up(e,t){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return vH(e,r);case Map:return e5(e,r,r.keys());case bi:case _o:case Object:case void 0:return e5(e,r,t||Object.keys(r))}return r instanceof $?EH(e,r):!1}}function vH(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t[n]))return!1;return!0}function EH(e,t){let r=e.length;if(t.length!==r)return!1;for(let n=-1;++n<r;)if(!e[n](t.get(n)))return!1;return!0}function e5(e,t,r){let n=r[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),o=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),s=0,a=e.length,c=o.next(),l=n.next(),u=i.next();for(;s<a&&!l.done&&!u.done&&!c.done&&!(l.value!==u.value||!e[s](c.value));++s,l=n.next(),u=i.next(),c=o.next());return s===a&&l.done&&u.done&&c.done?!0:(n.return&&n.return(),i.return&&i.return(),o.return&&o.return(),!1)}var J6,_c,Q6,xu=p(()=>{zr();ph();Gp();dr();_c=(e,t)=>e<0?t+e:e,Q6=e=>e!==e});var Ob={};Qt(Ob,{BitIterator:()=>So,getBit:()=>zp,getBool:()=>_u,packBools:()=>Mc,popcnt_array:()=>t5,popcnt_bit_range:()=>yh,popcnt_uint32:()=>jp,setBool:()=>TH,truncateBitmap:()=>Sc});function _u(e,t,r,n){return(r&1<<n)!==0}function zp(e,t,r,n){return(r&1<<n)>>n}function TH(e,t,r){return r?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function Sc(e,t,r){let n=r.byteLength+7&-8;if(e>0||r.byteLength<n){let i=new Uint8Array(n);return i.set(e%8===0?r.subarray(e>>3):Mc(new So(r,e,t,null,_u)).subarray(0,n)),i}return r}function Mc(e){let t=[],r=0,n=0,i=0;for(let s of e)s&&(i|=1<<n),++n===8&&(t[r++]=i,i=n=0);(r===0||n>0)&&(t[r++]=i);let o=new Uint8Array(t.length+7&-8);return o.set(t),o}function yh(e,t,r){if(r-t<=0)return 0;if(r-t<8){let o=0;for(let s of new So(e,t,r-t,e,zp))o+=s;return o}let n=r>>3<<3,i=t+(t%8===0?0:8-t%8);return yh(e,t,i)+yh(e,n,r)+t5(e,i>>3,n-i>>3)}function t5(e,t,r){let n=0,i=Math.trunc(t),o=new DataView(e.buffer,e.byteOffset,e.byteLength),s=r===void 0?e.byteLength:i+r;for(;s-i>=4;)n+=jp(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=jp(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=jp(o.getUint8(i)),i+=1;return n}function jp(e){let t=Math.trunc(e);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var So,vc=p(()=>{So=class{constructor(t,r,n,i,o){this.bytes=t,this.length=n,this.context=i,this.get=o,this.bit=r%8,this.byteIndex=r>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function te(e){return IH.visit(e)}var AH,r5,de,Cb,IH,wi=p(()=>{zr();Nt();at();vc();at();Pn();dr();AH=-1,r5=Symbol.for("apache-arrow/Data"),de=class e{static isData(t){return(t==null?void 0:t[r5])===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return U.isSparseUnion(t)?this.children.some(r=>r.nullable):U.isDenseUnion(t)?this.children.some(r=>r.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:r,values:n,nullBitmap:i,typeIds:o}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),t+=this.variadicBuffers.reduce((s,a)=>{var c;return s+((c=a==null?void 0:a.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((s,a)=>s+a.byteLength,t)}get nullCount(){if(U.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,r;return t<=AH&&(r=this.nullBitmap)&&(this._nullCount=t=r.length===0?0:this.length-yh(r,this.offset,this.offset+this.length)),t}constructor(t,r,n,i,o,s=[],a,c=[]){var l;this.type=t,this.children=s,this.dictionary=a,this.offset=Math.floor(Math.max(r||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let u;o instanceof e?(this.stride=o.stride,this.values=o.values,this.typeIds=o.typeIds,this.nullBitmap=o.nullBitmap,this.valueOffsets=o.valueOffsets,this.variadicBuffers=o.variadicBuffers):(this.stride=ti(t),o&&((u=o[0])&&(this.valueOffsets=u),(u=o[1])&&(this.values=u),(u=o[2])&&(this.nullBitmap=u),(u=o[3])&&(this.typeIds=u)),this.variadicBuffers=c),(l=this.variadicBuffers)!==null&&l!==void 0||(this.variadicBuffers=[])}getValid(t){let{type:r}=this;if(U.isUnion(r)){let n=r,i=this.typeIds[t],o=n.typeIdToChildIndex[i],s=this.children[o],a=this.valueOffsets,c=n.mode===Ze.Dense&&a?Number(a[t]):t;return s.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,r){let n,{type:i}=this;if(U.isUnion(i)){let o=i,s=this.typeIds[t],a=o.typeIdToChildIndex[s],c=this.children[a],l=this.valueOffsets,u=o.mode===Ze.Dense&&l?Number(l[t]):t;n=c.getValid(u),c.setValid(u,r)}else{let{nullBitmap:o}=this,{offset:s,length:a}=this,c=s+t,l=1<<c%8,u=c>>3;(!o||o.byteLength<=u)&&(o=new Uint8Array((s+a+63&-64)>>3).fill(255),this.nullCount>0?(o.set(Sc(s,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:o})):Object.assign(this,{nullBitmap:o,_nullCount:0}));let h=o[u];n=(h&l)!==0,o[u]=r?h|l:h&~l}return n!==!!r&&(this._nullCount=this.nullCount+(r?-1:1)),r}clone(t=this.type,r=this.offset,n=this.length,i=this._nullCount,o=this,s=this.children,a=this.variadicBuffers){return new e(t,r,n,i,o,s,this.dictionary,a)}slice(t,r){let{stride:n,typeId:i,children:o}=this,s=+(this._nullCount===0)-1,a=i===16?n:1,c=this._sliceBuffers(t,r,n,i);return this.clone(this.type,this.offset+t,r,s,c,o.length===0||this.valueOffsets?o:this._sliceChildren(o,a*t,a*r),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===x.Null)return this.clone(this.type,0,t,0,this.buffers,this.children,this.variadicBuffers);let{length:r,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,r>>3);i[r>>3]=(1<<r-(r&-8))-1,n>0&&i.set(Sc(this.offset,r,this.nullBitmap),0);let o=this.buffers;return o[Ne.VALIDITY]=i,this.clone(this.type,0,t,n+(t-r),o,this.children,this.variadicBuffers)}_sliceBuffers(t,r,n,i){let o,{buffers:s}=this;if((o=s[Ne.TYPE])&&(s[Ne.TYPE]=o.subarray(t,t+r)),U.isBinaryView(this.type)||U.isUtf8View(this.type)){let a=Ee.ELEMENT_WIDTH;(o=s[Ne.DATA])&&(s[Ne.DATA]=o.subarray(t*a,(t+r)*a))}else(o=s[Ne.OFFSET])&&(s[Ne.OFFSET]=o.subarray(t,t+r+1))||(o=s[Ne.DATA])&&(s[Ne.DATA]=i===6?o:o.subarray(n*t,n*(t+r)));return s}_sliceChildren(t,r,n){return t.map(i=>i.slice(r,n))}};de.prototype.children=Object.freeze([]);de.prototype[r5]=!0;Object.defineProperty(de,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===de&&de.isData(t)}});Cb=class e extends ie{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:r,["offset"]:n=0,["length"]:i=0}=t;return new de(r,n,i,i)}visitBool(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitInt(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitFloat(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=yc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new de(r,n,a,c,[s,i,o])}visitUtf8View(t){var r;let{["type"]:n,["offset"]:i=0}=t,o=Re(n.ArrayType,t.views),s=se(t.nullBitmap),a=(t.variadicBuffers||[]).map(u=>se(u)),c=(r=t.length)!==null&&r!==void 0?r:Math.trunc(o.length/on.ELEMENT_WIDTH),l=t.nullBitmap?-1:0;return new de(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeUtf8(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=Hf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new de(r,n,a,c,[s,i,o])}visitBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=yc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new de(r,n,a,c,[s,i,o])}visitBinaryView(t){var r;let{["type"]:n,["offset"]:i=0}=t,o=Re(n.ArrayType,t.views),s=se(t.nullBitmap),a=(t.variadicBuffers||[]).map(u=>se(u)),c=(r=t.length)!==null&&r!==void 0?r:Math.trunc(o.length/Ee.ELEMENT_WIDTH),l=t.nullBitmap?-1:0;return new de(n,i,c,l,[void 0,o,s],[],void 0,a)}visitLargeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.data),o=se(t.nullBitmap),s=Hf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new de(r,n,a,c,[s,i,o])}visitFixedSizeBinary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitDate(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitTimestamp(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitTime(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitDecimal(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=se(t.nullBitmap),s=yc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new de(r,n,a,c,[s,void 0,o],[i])}visitLargeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i}=t,o=se(t.nullBitmap),s=Hf(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new de(r,n,a,c,[s,void 0,o],[i])}visitStruct(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=se(t.nullBitmap),{length:s=i.reduce((c,{length:l})=>Math.max(c,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,void 0,o],i)}visitUnion(t){let{["type"]:r,["offset"]:n=0,["children"]:i=[]}=t,o=Re(r.ArrayType,t.typeIds),{["length"]:s=o.length,["nullCount"]:a=-1}=t;if(U.isSparseUnion(r))return new de(r,n,s,a,[void 0,void 0,void 0,o],i);let c=yc(t.valueOffsets);return new de(r,n,s,a,[c,void 0,void 0,o],i)}visitDictionary(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.indices.ArrayType,t.data),{["dictionary"]:s=new $([new e().visit({type:r.dictionary})])}=t,{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new de(r,n,a,c,[void 0,o,i],[],s)}visitInterval(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitDuration(t){let{["type"]:r,["offset"]:n=0}=t,i=se(t.nullBitmap),o=Re(r.ArrayType,t.data),{["length"]:s=o.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,o,i])}visitFixedSizeList(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.valueType})}=t,o=se(t.nullBitmap),{["length"]:s=i.length/ti(r),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new de(r,n,s,a,[void 0,void 0,o],[i])}visitMap(t){let{["type"]:r,["offset"]:n=0,["child"]:i=new e().visit({type:r.childType})}=t,o=se(t.nullBitmap),s=yc(t.valueOffsets),{["length"]:a=s.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new de(r,n,a,c,[s,void 0,o],[i])}},IH=new Cb});function n5(e){return e.some(t=>t.nullable)}function qp(e){return e.reduce((t,r)=>t+r.nullCount,0)}function Vp(e){return e.reduce((t,r,n)=>(t[n+1]=t[n]+r.length,t),new Uint32Array(e.length+1))}function Wp(e,t,r,n){let i=[];for(let o=-1,s=e.length;++o<s;){let a=e[o],c=t[o],{length:l}=a;if(c>=n)break;if(r>=c+l)continue;if(c>=r&&c+l<=n){i.push(a);continue}let u=Math.max(0,r-c),h=Math.min(n-c,l);i.push(a.slice(u,h-u))}return i.length===0&&i.push(e[0].slice(0,0)),i}function Bb(e,t,r,n){let i=0,o=0,s=t.length-1;do{if(i>=s-1)return r<t[s]?n(e,i,r-t[i]):null;o=i+Math.trunc((s-i)*.5),r<t[o]?s=o:i=o}while(i<s)}function wh(e,t){return e.getValid(t)}function Su(e){function t(r,n,i){return e(r[n],i)}return function(r){let n=this.data;return Bb(n,this._offsets,r,t)}}function Hp(e){let t;function r(n,i,o){return e(n[i],o,t)}return function(n,i){let o=this.data;t=i;let s=Bb(o,this._offsets,n,r);return t=void 0,s}}function $p(e){let t;function r(n,i,o){let s=o,a=0,c=0;for(let l=i-1,u=n.length;++l<u;){let h=n[l];if(~(a=e(h,t,s)))return c+a;s=0,c+=h.length}return-1}return function(n,i){t=n;let o=this.data,s=typeof i!="number"?r(o,0,0):Bb(o,this._offsets,i,r);return t=void 0,s}}var bh,Kp=p(()=>{bh=class{constructor(t=0,r){this.numChunks=t,this.getChunkIterator=r,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let t=this.chunkIterator.next();if(!t.done)return t;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function PH(e,t){return t===null&&e.length>0?0:-1}function RH(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(let i of new So(r,e.offset+(t||0),e.length,r,_u)){if(!i)return n;++n}return-1}function xe(e,t,r){if(t===void 0)return-1;if(t===null)switch(e.typeId){case x.Union:break;case x.Dictionary:break;default:return RH(e,r)}let n=ir.getVisitFn(e),i=pa(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}function i5(e,t,r){let n=ir.getVisitFn(e),i=pa(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}var le,Ec,Xp=p(()=>{Nt();Pn();xc();vc();xu();le=class extends ie{};le.prototype.visitNull=PH;le.prototype.visitBool=xe;le.prototype.visitInt=xe;le.prototype.visitInt8=xe;le.prototype.visitInt16=xe;le.prototype.visitInt32=xe;le.prototype.visitInt64=xe;le.prototype.visitUint8=xe;le.prototype.visitUint16=xe;le.prototype.visitUint32=xe;le.prototype.visitUint64=xe;le.prototype.visitFloat=xe;le.prototype.visitFloat16=xe;le.prototype.visitFloat32=xe;le.prototype.visitFloat64=xe;le.prototype.visitUtf8=xe;le.prototype.visitLargeUtf8=xe;le.prototype.visitUtf8View=xe;le.prototype.visitBinary=xe;le.prototype.visitLargeBinary=xe;le.prototype.visitBinaryView=xe;le.prototype.visitFixedSizeBinary=xe;le.prototype.visitDate=xe;le.prototype.visitDateDay=xe;le.prototype.visitDateMillisecond=xe;le.prototype.visitTimestamp=xe;le.prototype.visitTimestampSecond=xe;le.prototype.visitTimestampMillisecond=xe;le.prototype.visitTimestampMicrosecond=xe;le.prototype.visitTimestampNanosecond=xe;le.prototype.visitTime=xe;le.prototype.visitTimeSecond=xe;le.prototype.visitTimeMillisecond=xe;le.prototype.visitTimeMicrosecond=xe;le.prototype.visitTimeNanosecond=xe;le.prototype.visitDecimal=xe;le.prototype.visitList=xe;le.prototype.visitLargeList=xe;le.prototype.visitStruct=xe;le.prototype.visitUnion=xe;le.prototype.visitDenseUnion=i5;le.prototype.visitSparseUnion=i5;le.prototype.visitDictionary=xe;le.prototype.visitInterval=xe;le.prototype.visitIntervalDayTime=xe;le.prototype.visitIntervalYearMonth=xe;le.prototype.visitIntervalMonthDayNano=xe;le.prototype.visitDuration=xe;le.prototype.visitDurationSecond=xe;le.prototype.visitDurationMillisecond=xe;le.prototype.visitDurationMicrosecond=xe;le.prototype.visitDurationNanosecond=xe;le.prototype.visitFixedSizeList=xe;le.prototype.visitMap=xe;Ec=new le});function ye(e){let{type:t}=e;if(e.nullCount===0&&e.stride===1&&(U.isInt(t)&&t.bitWidth!==64||U.isTime(t)&&t.bitWidth!==64||U.isFloat(t)&&t.precision!==He.HALF))return new bh(e.data.length,n=>{let i=e.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new bh(e.data.length,n=>{let o=e.data[n].length,s=e.slice(r,r+o);return r+=o,new Db(s)})}var ue,Db,Mu,Yp=p(()=>{Pn();Nt();at();Kp();ue=class extends ie{};Db=class{constructor(t){this.vector=t,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};ue.prototype.visitNull=ye;ue.prototype.visitBool=ye;ue.prototype.visitInt=ye;ue.prototype.visitInt8=ye;ue.prototype.visitInt16=ye;ue.prototype.visitInt32=ye;ue.prototype.visitInt64=ye;ue.prototype.visitUint8=ye;ue.prototype.visitUint16=ye;ue.prototype.visitUint32=ye;ue.prototype.visitUint64=ye;ue.prototype.visitFloat=ye;ue.prototype.visitFloat16=ye;ue.prototype.visitFloat32=ye;ue.prototype.visitFloat64=ye;ue.prototype.visitUtf8=ye;ue.prototype.visitLargeUtf8=ye;ue.prototype.visitUtf8View=ye;ue.prototype.visitBinary=ye;ue.prototype.visitLargeBinary=ye;ue.prototype.visitBinaryView=ye;ue.prototype.visitFixedSizeBinary=ye;ue.prototype.visitDate=ye;ue.prototype.visitDateDay=ye;ue.prototype.visitDateMillisecond=ye;ue.prototype.visitTimestamp=ye;ue.prototype.visitTimestampSecond=ye;ue.prototype.visitTimestampMillisecond=ye;ue.prototype.visitTimestampMicrosecond=ye;ue.prototype.visitTimestampNanosecond=ye;ue.prototype.visitTime=ye;ue.prototype.visitTimeSecond=ye;ue.prototype.visitTimeMillisecond=ye;ue.prototype.visitTimeMicrosecond=ye;ue.prototype.visitTimeNanosecond=ye;ue.prototype.visitDecimal=ye;ue.prototype.visitList=ye;ue.prototype.visitLargeList=ye;ue.prototype.visitStruct=ye;ue.prototype.visitUnion=ye;ue.prototype.visitDenseUnion=ye;ue.prototype.visitSparseUnion=ye;ue.prototype.visitDictionary=ye;ue.prototype.visitInterval=ye;ue.prototype.visitIntervalDayTime=ye;ue.prototype.visitIntervalYearMonth=ye;ue.prototype.visitIntervalMonthDayNano=ye;ue.prototype.visitDuration=ye;ue.prototype.visitDurationSecond=ye;ue.prototype.visitDurationMillisecond=ye;ue.prototype.visitDurationMicrosecond=ye;ue.prototype.visitDurationNanosecond=ye;ue.prototype.visitFixedSizeList=ye;ue.prototype.visitMap=ye;Mu=new ue});function Mo(e){if(e){if(e instanceof de)return new $([e]);if(e instanceof $)return new $(e.data);if(e.type instanceof U)return new $([te(e)]);if(Array.isArray(e))return new $(e.flatMap(t=>LH(t)));if(ArrayBuffer.isView(e)){e instanceof DataView&&(e=new Uint8Array(e.buffer));let t={offset:0,length:e.length,nullCount:-1,data:e};if(e instanceof Int8Array)return new $([te(Object.assign(Object.assign({},t),{type:new Kn}))]);if(e instanceof Int16Array)return new $([te(Object.assign(Object.assign({},t),{type:new Xn}))]);if(e instanceof Int32Array)return new $([te(Object.assign(Object.assign({},t),{type:new Zt}))]);if(e instanceof BigInt64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Yn}))]);if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new $([te(Object.assign(Object.assign({},t),{type:new Zn}))]);if(e instanceof Uint16Array)return new $([te(Object.assign(Object.assign({},t),{type:new Jn}))]);if(e instanceof Uint32Array)return new $([te(Object.assign(Object.assign({},t),{type:new rn}))]);if(e instanceof BigUint64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Ui}))]);if(e instanceof Float32Array)return new $([te(Object.assign(Object.assign({},t),{type:new nn}))]);if(e instanceof Float64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Qn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function LH(e){return e instanceof de?[e]:e instanceof $?e.data:Mo(e).data}var o5,s5,a5,c5,$,Zp,zr=p(()=>{Nt();xu();at();wi();Kp();xc();ri();Xp();Yp();at();s5=Symbol.for("apache-arrow/Vector"),a5={},c5={},$=class e{static isVector(t){return(t==null?void 0:t[s5])===!0}constructor(t){var r,n,i;let o=t[0]instanceof e?t.flatMap(a=>a.data):t;if(o.length===0||o.some(a=>!(a instanceof de)))throw new TypeError("Vector constructor expects an Array of Data instances.");let s=(r=o[0])===null||r===void 0?void 0:r.type;switch(o.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:l}=a5[s.typeId],u=o[0];this.isValid=h=>wh(u,h),this.get=h=>a(u,h),this.set=(h,d)=>c(u,h,d),this.indexOf=h=>l(u,h),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,c5[s.typeId]),this._offsets=Vp(o);break}this.data=o,this.type=s,this.stride=ti(s),this.numChildren=(i=(n=s.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,r)=>t+r.byteLength,0)}get nullable(){return n5(this.data)}get nullCount(){return qp(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${x[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(_c(t,this.length))}set(t,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}[Symbol.iterator](){return Mu.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(r=>r.data).flat(Number.POSITIVE_INFINITY)))}slice(t,r){return new e(gh(this,t,r,({data:n,_offsets:i},o,s)=>Wp(n,i,o,s)))}toJSON(){return[...this]}toArray(){let{type:t,data:r,length:n,stride:i,ArrayType:o}=this;switch(t.typeId){case x.Int:case x.Float:case x.Decimal:case x.Time:case x.Timestamp:switch(r.length){case 0:return new o;case 1:return r[0].values.subarray(0,n*i);default:return r.reduce((s,{values:a,length:c})=>(s.array.set(a.subarray(0,c*i),s.offset),s.offset+=c*i,s),{array:new o(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var r;return this.getChildAt((r=this.type.children)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new e(this.data.map(({children:r})=>r[t])):null}get isMemoized(){return U.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(U.isDictionary(this.type)){let t=new Zp(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return new Zp(this)}unmemoize(){if(U.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return this}};o5=Symbol.toStringTag;$[o5]=(e=>{e.type=U.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0,e[s5]=!0;let t=Object.keys(x).map(r=>x[r]).filter(r=>typeof r=="number"&&r!==x.NONE);for(let r of t){let n=ir.getVisitFnByTypeId(r),i=Lr.getVisitFnByTypeId(r),o=Ec.getVisitFnByTypeId(r);a5[r]={get:n,set:i,indexOf:o},c5[r]=Object.create(e,{isValid:{value:Su(wh)},get:{value:Su(ir.getVisitFnByTypeId(r))},set:{value:Hp(Lr.getVisitFnByTypeId(r))},indexOf:{value:$p(Ec.getVisitFnByTypeId(r))}})}return"Vector"})($.prototype);Object.defineProperty($,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$&&$.isVector(t)}});Zp=class e extends ${constructor(t){super(t.data);let r=this.get,n=this.set,i=this.slice,o=new Array(this.length);Object.defineProperty(this,"get",{value(s){let a=o[s];if(a!==void 0)return a;let c=r.call(this,s);return o[s]=c,c}}),Object.defineProperty(this,"set",{value(s,a){n.call(this,s,a),o[s]=a}}),Object.defineProperty(this,"slice",{value:(s,a)=>new e(i.call(this,s,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new $(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function l5(e){if(!e||e.length<=0)return function(i){return!0};let t="",r=e.filter(n=>n===n);return r.length>0&&(t=`
5
5
  switch (x) {${r.map(n=>`
6
- case ${hH(n)}:`).join("")}
6
+ case ${OH(n)}:`).join("")}
7
7
  return false;
8
8
  }`),e.length!==r.length&&(t=`if (x !== x) return false;
9
9
  ${t}`),new Function("x",`${t}
10
- return true;`)}function hH(e){return typeof e!="bigint"?Gi(e):`${Gi(e)}n`}var r5=p(()=>{oh()});function Bb(e,t){let r=Math.ceil(e)*t-1;return(r-r%64+64||64)/t}function n5(e,t=0){return e.length>=t?e.subarray(0,t):Vf(new e.constructor(t),e,0)}var Rn,ns,Su,pa,Wi=p(()=>{dr();Rn=class{constructor(t,r=0,n=1){this.length=Math.ceil(r/n),this.buffer=new t(this.length),this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,r){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?Bb(n*1,this.BYTES_PER_ELEMENT):Bb(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Bb(t*this.stride,this.BYTES_PER_ELEMENT);let r=n5(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=n5(this.buffer,t)}},ns=class extends Rn{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,r){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=r,this}},Su=class extends ns{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,r){let{buffer:n}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=n[i]>>o&1;return r?s===0&&(n[i]|=1<<o,++this.numValid):s===1&&(n[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},pa=class extends ns{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,r){let n=this.length-1,i=this.reserve(t-n+1).buffer;return n<t++&&n>=0&&i.fill(i[n],n,t),i[t]=i[t-1]+r,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}}});var ct,or,qr,bt=p(()=>{zr();wi();mh();at();r5();Wi();ct=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:r}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=r,this.stride=ti(t),this._nulls=new Su,r&&r.length>0&&(this._isValid=t5(r))}toVector(){return new $([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:r,_values:n,_nulls:i,_typeIds:o,children:s}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,r){return this.setValid(t,this.isValid(r))&&this.setValue(t,r),this}setValue(t,r){this._setValue(this,t,r)}setValid(t,r){return this.length=this._nulls.set(t,+r).length,r}addChild(t,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,r,n,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:h}=this;(r=c==null?void 0:c.flush(s))?i=l==null?void 0:l.flush(s):(i=l==null?void 0:l.flush(s))?t=u==null?void 0:u.flush(l.last()):t=u==null?void 0:u.flush(s),a>0&&(n=h==null?void 0:h.flush(s));let d=this.children.map(m=>m.flush());return this.clear(),te({type:o,length:s,nullCount:a,children:d,child:d[0],data:t,typeIds:r,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,r,n,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(r=this._values)===null||r===void 0||r.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};ct.prototype.length=1;ct.prototype.stride=1;ct.prototype.children=null;ct.prototype.finished=!1;ct.prototype.nullValues=null;ct.prototype._isValid=()=>!0;or=class extends ct{constructor(t){super(t),this._values=new ns(this.ArrayType,0,this.stride)}setValue(t,r){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,r)}},qr=class extends ct{constructor(t){super(t),this._pendingLength=0,this._offsets=new pa(t.type)}setValue(t,r){let n=this._pending||(this._pending=new Map),i=n.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=r instanceof bi?r[da].length:r.length,n.set(t,r)}setValid(t,r){return super.setValid(t,r)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let t=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,r),this}}});var vc,Cb=p(()=>{vc=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,r,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(r??0)),t.offset()}}});var i5,ni,o5=p(()=>{i5=me(ze(),1);Cb();cu();op();cb();ni=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFooter(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,r){return t.setPosition(t.position()+i5.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):it.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new En).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new vc).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new vc).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,it.V1)}static addSchema(t,r){t.addFieldOffset(1,r,0)}static addDictionaries(t,r){t.addFieldOffset(2,r,0)}static startDictionariesVector(t,r){t.startVector(24,r,8)}static addRecordBatches(t,r){t.addFieldOffset(3,r,0)}static startRecordBatchesVector(t,r){t.startVector(24,r,8)}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,r){t.finish(r)}static finishSizePrefixedFooterBuffer(t,r){t.finish(r,void 0,!0)}}});function $p(e,t){return new Map([...e||new Map,...t||new Map])}function Db(e,t=new Map){for(let r=-1,n=e.length;++r<n;){let o=e[r].type;if(z.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&Db(o.children,t)}return t}var s5,a5,ve,ee,Vr=p(()=>{Nt();at();s5=Symbol.for("apache-arrow/Schema"),a5=Symbol.for("apache-arrow/Field"),ve=class e{static isSchema(t){return(t==null?void 0:t[s5])===!0}constructor(t=[],r,n,i=it.V5){this.fields=t||[],this.metadata=r||new Map,n||(n=Db(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,r)=>`${r}: ${t}`).join(", ")} }>`}select(t){let r=new Set(t),n=this.fields.filter(i=>r.has(i.name));return new e(n,this.metadata)}selectAt(t){let r=t.map(n=>this.fields[n]).filter(Boolean);return new e(r,this.metadata)}assign(...t){let r=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),n=[...this.fields],i=$p($p(new Map,this.metadata),r.metadata),o=r.fields.filter(a=>{let c=n.findIndex(l=>l.name===a.name);return~c?(n[c]=a.clone({metadata:$p($p(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=Db(o,new Map);return new e([...n,...o],i,new Map([...this.dictionaries,...s]))}};ve.prototype.fields=null;ve.prototype.metadata=null;ve.prototype.dictionaries=null;ve.prototype[s5]=!0;Object.defineProperty(ve,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ve&&ve.isSchema(t)}});ee=class e{static isField(t){return(t==null?void 0:t[a5])===!0}static new(...t){let[r,n,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:r}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${r}`,n,i,o)}constructor(t,r,n=!1,i){this.name=t,this.type=r,this.nullable=n,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[r,n,i,o]=t;return!t[0]||typeof t[0]!="object"?[r=this.name,n=this.type,i=this.nullable,o=this.metadata]=t:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(r,n,i,o)}};ee.prototype.type=null;ee.prototype.name=null;ee.prototype.nullable=null;ee.prototype.metadata=null;ee.prototype[a5]=!0;Object.defineProperty(ee,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ee&&ee.isField(t)}})});var Kp,dH,mH,is,Nb,Hi,Fb=p(()=>{Cb();o5();Kp=me(ze(),1);Vr();Nt();dr();wo();dH=Kp.Builder,mH=Kp.ByteBuffer,is=class{static decode(t){t=new mH(se(t));let r=ni.getRootAsFooter(t),n=ve.decode(r.schema(),new Map,r.version());return new Nb(n,r)}static encode(t){let r=new dH,n=ve.encode(r,t.schema);ni.startRecordBatchesVector(r,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Hi.encode(r,s);let i=r.endVector();ni.startDictionariesVector(r,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Hi.encode(r,s);let o=r.endVector();return ni.startFooter(r),ni.addSchema(r,n),ni.addVersion(r,it.V5),ni.addRecordBatches(r,i),ni.addDictionaries(r,o),ni.finishFooterBuffer(r,ni.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,r=it.V5,n,i){this.schema=t,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,r=-1,n=this.numRecordBatches;++r<n;)(t=this.getRecordBatch(r))&&(yield t)}*dictionaryBatches(){for(let t,r=-1,n=this.numDictionaries;++r<n;)(t=this.getDictionaryBatch(r))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}},Nb=class extends is{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,r){super(t,r.version()),this._footer=r}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let r=this._footer.recordBatches(t);if(r)return Hi.decode(r)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let r=this._footer.dictionaries(t);if(r)return Hi.decode(r)}return null}},Hi=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,r){let{metaDataLength:n}=r,i=BigInt(r.offset),o=BigInt(r.bodyLength);return vc.createBlock(t,i,n,o)}constructor(t,r,n){this.metaDataLength=t,this.offset=Le(n),this.bodyLength=Le(r)}}});var c5,ii,l5=p(()=>{c5=me(ze(),1);cu();mp();op();ii=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMessage(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,r){return t.setPosition(t.position()+c5.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):it.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):Ge.NONE}header(t){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(t,this.bb_pos+r):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,it.V1)}static addHeaderType(t,r){t.addFieldInt8(1,r,Ge.NONE)}static addHeader(t,r){t.addFieldOffset(2,r,0)}static addBodyLength(t,r){t.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,r){t.finish(r)}static finishSizePrefixedMessageBuffer(t,r){t.finish(r,void 0,!0)}static createMessage(t,r,n,i,o,s){return e.startMessage(t),e.addVersion(t,r),e.addHeaderType(t,n),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}}});var Gb,Xp,u5=p(()=>{Pn();SI();hp();tb();eI();rI();dI();iI();PI();LI();yI();Z2();Y2();ib();ob();rb();J2();wI();pI();vI();sb();X2();Q2();eb();nb();Gb=class extends ie{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return th.startNull(r),th.endNull(r)}visitInt(t,r){return Ni.startInt(r),Ni.addBitWidth(r,t.bitWidth),Ni.addIsSigned(r,t.isSigned),Ni.endInt(r)}visitFloat(t,r){return Zs.startFloatingPoint(r),Zs.addPrecision(r,t.precision),Zs.endFloatingPoint(r)}visitBinary(t,r){return Kf.startBinary(r),Kf.endBinary(r)}visitBinaryView(t,r){return Xf.startBinaryView(r),Xf.endBinaryView(r)}visitLargeBinary(t,r){return Zf.startLargeBinary(r),Zf.endLargeBinary(r)}visitBool(t,r){return Yf.startBool(r),Yf.endBool(r)}visitUtf8(t,r){return nh.startUtf8(r),nh.endUtf8(r)}visitUtf8View(t,r){return ih.startUtf8View(r),ih.endUtf8View(r)}visitLargeUtf8(t,r){return Qf.startLargeUtf8(r),Qf.endLargeUtf8(r)}visitDecimal(t,r){return bo.startDecimal(r),bo.addScale(r,t.scale),bo.addPrecision(r,t.precision),bo.addBitWidth(r,t.bitWidth),bo.endDecimal(r)}visitDate(t,r){return $s.startDate(r),$s.addUnit(r,t.unit),$s.endDate(r)}visitTime(t,r){return Qo.startTime(r),Qo.addUnit(r,t.unit),Qo.addBitWidth(r,t.bitWidth),Qo.endTime(r)}visitTimestamp(t,r){let n=t.timezone&&r.createString(t.timezone)||void 0;return es.startTimestamp(r),es.addUnit(r,t.unit),n!==void 0&&es.addTimezone(r,n),es.endTimestamp(r)}visitInterval(t,r){return Js.startInterval(r),Js.addUnit(r,t.unit),Js.endInterval(r)}visitDuration(t,r){return Ks.startDuration(r),Ks.addUnit(r,t.unit),Ks.endDuration(r)}visitList(t,r){return eh.startList(r),eh.endList(r)}visitLargeList(t,r){return Jf.startLargeList(r),Jf.endLargeList(r)}visitStruct(t,r){return rh.startStruct_(r),rh.endStruct_(r)}visitUnion(t,r){Fi.startTypeIdsVector(r,t.typeIds.length);let n=Fi.createTypeIdsVector(r,t.typeIds);return Fi.startUnion(r),Fi.addMode(r,t.mode),Fi.addTypeIds(r,n),Fi.endUnion(r)}visitDictionary(t,r){let n=this.visit(t.indices,r);return yo.startDictionaryEncoding(r),yo.addId(r,BigInt(t.id)),yo.addIsOrdered(r,t.isOrdered),n!==void 0&&yo.addIndexType(r,n),yo.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return Xs.startFixedSizeBinary(r),Xs.addByteWidth(r,t.byteWidth),Xs.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return Ys.startFixedSizeList(r),Ys.addListSize(r,t.listSize),Ys.endFixedSizeList(r)}visitMap(t,r){return Qs.startMap(r),Qs.addKeysSorted(r,t.keysSorted),Qs.endMap(r)}},Xp=new Gb});function m5(e,t=new Map){return new ve(pH(e,t),Yp(e.metadata),t)}function kb(e){return new sr(e.count,g5(e.columns),y5(e.columns),null,b5(e.columns))}function p5(e){return new Wr(kb(e.data),e.id,e.isDelta)}function pH(e,t){return(e.fields||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function f5(e,t){return(e.children||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function g5(e){return(e||[]).reduce((t,r)=>[...t,new xi(r.count,gH(r.VALIDITY)),...g5(r.children)],[])}function y5(e,t=[]){for(let r=-1,n=(e||[]).length;++r<n;){let i=e[r];if(i.VALIDITY&&t.push(new $t(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new $t(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new $t(t.length,i.OFFSET.length)),i.DATA&&t.push(new $t(t.length,i.DATA.length)),i.VIEWS&&t.push(new $t(t.length,i.VIEWS.length)),i.VARIADIC_DATA_BUFFERS)for(let o of i.VARIADIC_DATA_BUFFERS)t.push(new $t(t.length,o.length));t=y5(i.children,t)}return t}function gH(e){return(e||[]).reduce((t,r)=>t+ +(r===0),0)}function b5(e){return(e||[]).reduce((t,r)=>[...t,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...b5(r.children)],[])}function w5(e,t){let r,n,i,o,s,a;return!t||!(o=e.dictionary)?(s=d5(e,f5(e,t)),i=new ee(e.name,s,e.nullable,Yp(e.metadata))):t.has(r=o.id)?(n=(n=o.indexType)?h5(n):new Yt,a=new nr(t.get(r),n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,Yp(e.metadata))):(n=(n=o.indexType)?h5(n):new Yt,t.set(r,s=d5(e,f5(e,t))),a=new nr(s,n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,Yp(e.metadata))),i||null}function Yp(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function h5(e){return new Pt(e.isSigned,e.bitWidth)}function d5(e,t){let r=e.type.name;switch(r){case"NONE":return new Wt;case"null":return new Wt;case"binary":return new Tn;case"largebinary":return new zi;case"binaryview":return new Ee;case"utf8":return new Gr;case"largeutf8":return new qi;case"utf8view":return new on;case"bool":return new kr;case"list":return new rr((t||[])[0]);case"largelist":return new ei((t||[])[0]);case"struct":return new tt(t||[]);case"struct_":return new tt(t||[])}switch(r){case"int":{let n=e.type;return new Pt(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=e.type;return new Fr(He[n.precision])}case"decimal":{let n=e.type;return new An(n.scale,n.precision,n.bitWidth)}case"date":{let n=e.type;return new sn(st[n.unit])}case"time":{let n=e.type;return new Pr(q[n.unit],n.bitWidth)}case"timestamp":{let n=e.type;return new Rr(q[n.unit],n.timezone)}case"interval":{let n=e.type;return new Ur(ke[n.unit])}case"duration":{let n=e.type;return new an(q[n.unit])}case"union":{let n=e.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new cn(Ze[s],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=e.type;return new In(n.byteWidth)}case"fixedsizelist":{let n=e.type;return new Ht(n.listSize,(t||[])[0])}case"map":{let n=e.type;return new jr((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var x5=p(()=>{Vr();at();ga();Nt()});function wH(e,t){return(()=>{switch(t){case Ge.Schema:return ve.fromJSON(e);case Ge.RecordBatch:return sr.fromJSON(e);case Ge.DictionaryBatch:return Wr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Ge[t]}, type: ${t} }`)})}function xH(e,t){return(()=>{switch(t){case Ge.Schema:return ve.decode(e.header(new En),new Map,e.version());case Ge.RecordBatch:return sr.decode(e.header(new Dr),e.version());case Ge.DictionaryBatch:return Wr.decode(e.header(new Jo),e.version())}throw new Error(`Unrecognized Message type: { name: ${Ge[t]}, type: ${t} }`)})}function _H(e,t=new Map,r=it.V5){let n=PH(e,t);return new ve(n,Zp(e),t,r)}function SH(e,t=it.V5){return new sr(e.length(),TH(e),AH(e,t),v5(e.compression()),IH(e))}function MH(e,t=it.V5){return new Wr(sr.decode(e.data(),t),e.id(),e.isDelta())}function vH(e){return new $t(e.offset(),e.length())}function EH(e){return new xi(e.length(),e.nullCount())}function TH(e){let t=[];for(let r,n=-1,i=-1,o=e.nodesLength();++n<o;)(r=e.nodes(n))&&(t[++i]=xi.decode(r));return t}function AH(e,t){let r=[];for(let n,i=-1,o=-1,s=e.buffersLength();++i<s;)(n=e.buffers(i))&&(t<it.V4&&(n.bb_pos+=8*(i+1)),r[++o]=$t.decode(n));return r}function IH(e){let t=[],r=Math.trunc(e.variadicBufferCountsLength());for(let n=0;n<r;++n)t.push(Le(e.variadicBufferCounts(n)));return t}function PH(e,t){let r=[];for(let n,i=-1,o=-1,s=e.fieldsLength();++i<s;)(n=e.fields(i))&&(r[++o]=ee.decode(n,t));return r}function _5(e,t){let r=[];for(let n,i=-1,o=-1,s=e.childrenLength();++i<s;)(n=e.children(i))&&(r[++o]=ee.decode(n,t));return r}function RH(e,t){let r,n,i,o,s,a;return!t||!(a=e.dictionary())?(i=M5(e,_5(e,t)),n=new ee(e.name(),i,e.nullable(),Zp(e))):t.has(r=Le(a.id()))?(o=(o=a.indexType())?S5(o):new Yt,s=new nr(t.get(r),o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),Zp(e))):(o=(o=a.indexType())?S5(o):new Yt,t.set(r,i=M5(e,_5(e,t))),s=new nr(i,o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),Zp(e))),n||null}function Zp(e){let t=new Map;if(e)for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function LH(e){let t=new Map;for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function S5(e){return new Pt(e.isSigned(),e.bitWidth())}function M5(e,t){let r=e.typeType();switch(r){case pe.NONE:return new Wt;case pe.Null:return new Wt;case pe.Binary:return new Tn;case pe.LargeBinary:return new zi;case pe.BinaryView:return new Ee;case pe.Utf8:return new Gr;case pe.LargeUtf8:return new qi;case pe.Utf8View:return new on;case pe.Bool:return new kr;case pe.List:return new rr((t||[])[0]);case pe.LargeList:return new ei((t||[])[0]);case pe.Struct_:return new tt(t||[])}switch(r){case pe.Int:{let n=e.type(new Ni);return new Pt(n.isSigned(),n.bitWidth())}case pe.FloatingPoint:{let n=e.type(new Zs);return new Fr(n.precision())}case pe.Decimal:{let n=e.type(new bo);return new An(n.scale(),n.precision(),n.bitWidth())}case pe.Date:{let n=e.type(new $s);return new sn(n.unit())}case pe.Time:{let n=e.type(new Qo);return new Pr(n.unit(),n.bitWidth())}case pe.Timestamp:{let n=e.type(new es);return new Rr(n.unit(),n.timezone())}case pe.Interval:{let n=e.type(new Js);return new Ur(n.unit())}case pe.Duration:{let n=e.type(new Ks);return new an(n.unit())}case pe.Union:{let n=e.type(new Fi);return new cn(n.mode(),n.typeIdsArray()||[],t||[])}case pe.FixedSizeBinary:{let n=e.type(new Xs);return new In(n.byteWidth())}case pe.FixedSizeList:{let n=e.type(new Ys);return new Ht(n.listSize(),(t||[])[0])}case pe.Map:{let n=e.type(new Qs);return new jr((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${pe[r]}" (${r})`)}function v5(e){return e?new Ec(e.codec(),e.method()):null}function OH(e,t){let r=t.fields.map(o=>ee.encode(e,o));En.startFieldsVector(e,r.length);let n=En.createFieldsVector(e,r),i=t.metadata&&t.metadata.size>0?En.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return Dt.startKeyValue(e),Dt.addKey(e,a),Dt.addValue(e,c),Dt.endKeyValue(e)})):-1;return En.startSchema(e),En.addFields(e,n),En.addEndianness(e,GH?Hs.Little:Hs.Big),i!==-1&&En.addCustomMetadata(e,i),En.endSchema(e)}function BH(e,t){let r=-1,n=-1,i=-1,o=t.type,s=t.typeId;z.isDictionary(o)?(s=o.dictionary.typeId,i=Xp.visit(o,e),n=Xp.visit(o.dictionary,e)):n=Xp.visit(o,e);let a=(o.children||[]).map(u=>ee.encode(e,u)),c=Nr.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Nr.createCustomMetadataVector(e,[...t.metadata].map(([u,h])=>{let d=e.createString(`${u}`),m=e.createString(`${h}`);return Dt.startKeyValue(e),Dt.addKey(e,d),Dt.addValue(e,m),Dt.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),Nr.startField(e),Nr.addType(e,n),Nr.addTypeType(e,s),Nr.addChildren(e,c),Nr.addNullable(e,!!t.nullable),r!==-1&&Nr.addName(e,r),i!==-1&&Nr.addDictionary(e,i),l!==-1&&Nr.addCustomMetadata(e,l),Nr.endField(e)}function CH(e,t){let r=t.nodes||[],n=t.buffers||[],i=t.variadicBufferCounts||[];Dr.startNodesVector(e,r.length);for(let l of r.slice().reverse())xi.encode(e,l);let o=e.endVector();Dr.startBuffersVector(e,n.length);for(let l of n.slice().reverse())$t.encode(e,l);let s=e.endVector(),a=null;t.compression!==null&&(a=E5(e,t.compression));let c=-1;return i.length>0&&(c=Dr.createVariadicBufferCountsVector(e,i.map(BigInt))),Dr.startRecordBatch(e),Dr.addLength(e,BigInt(t.length)),Dr.addNodes(e,o),Dr.addBuffers(e,s),t.compression!==null&&a&&Dr.addCompression(e,a),c!==-1&&Dr.addVariadicBufferCounts(e,c),Dr.endRecordBatch(e)}function E5(e,t){return Zo.startBodyCompression(e),Zo.addCodec(e,t.type),Zo.addMethod(e,t.method),Zo.endBodyCompression(e)}function DH(e,t){let r=sr.encode(e,t.data);return Jo.startDictionaryBatch(e),Jo.addId(e,BigInt(t.id)),Jo.addIsDelta(e,t.isDelta),Jo.addData(e,r),Jo.endDictionaryBatch(e)}function NH(e,t){return au.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function FH(e,t){return su.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var Jp,yH,bH,Hr,sr,Wr,$t,xi,Ec,GH,ga=p(()=>{Jp=me(ze(),1);cb();hp();$2();KA();W2();ab();H2();dp();cu();K2();tb();Z2();Y2();ib();ob();rb();J2();sb();Q2();eb();nb();l5();V2();q2();Vr();dr();wo();Nt();u5();x5();at();yH=Jp.Builder,bH=Jp.ByteBuffer,Hr=class e{static fromJSON(t,r){let n=new e(0,it.V5,r);return n._createHeader=wH(t,r),n}static decode(t){t=new bH(se(t));let r=ii.getRootAsMessage(t),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=LH(r),a=new e(n,i,o,void 0,s);return a._createHeader=xH(r,o),a}static encode(t){let r=new yH,n=-1;t.isSchema()?n=ve.encode(r,t.header()):t.isRecordBatch()?n=sr.encode(r,t.header()):t.isDictionaryBatch()&&(n=Wr.encode(r,t.header()));let i=t.metadata&&t.metadata.size>0?ii.createCustomMetadataVector(r,[...t.metadata].map(([o,s])=>{let a=r.createString(`${o}`),c=r.createString(`${s}`);return Dt.startKeyValue(r),Dt.addKey(r,a),Dt.addValue(r,c),Dt.endKeyValue(r)})):-1;return ii.startMessage(r),ii.addVersion(r,it.V5),ii.addHeader(r,n),ii.addHeaderType(r,t.headerType),ii.addBodyLength(r,BigInt(t.bodyLength)),i!==-1&&ii.addCustomMetadata(r,i),ii.finishMessageBuffer(r,ii.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof ve)return new e(0,it.V5,Ge.Schema,t);if(t instanceof sr)return new e(r,it.V5,Ge.RecordBatch,t,t.metadata);if(t instanceof Wr)return new e(r,it.V5,Ge.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===Ge.Schema}isRecordBatch(){return this.headerType===Ge.RecordBatch}isDictionaryBatch(){return this.headerType===Ge.DictionaryBatch}constructor(t,r,n,i,o){this._version=r,this._headerType=n,this.body=new Uint8Array(0),this._compression=i==null?void 0:i.compression,i&&(this._createHeader=()=>i),this._bodyLength=Le(t),this._metadata=o||new Map}},sr=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(t,r,n,i,o=[],s){this._nodes=r,this._buffers=n,this._length=Le(t),this._compression=i,this._variadicBufferCounts=o,this._metadata=s||new Map}},Wr=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,r,n=!1){this._data=t,this._isDelta=n,this._id=Le(r)}},$t=class{constructor(t,r){this.offset=Le(t),this.length=Le(r)}},xi=class{constructor(t,r){this.length=Le(t),this.nullCount=Le(r)}},Ec=class{constructor(t,r=gc.BUFFER){this.type=t,this.method=r}};ee.encode=BH;ee.decode=RH;ee.fromJSON=w5;ve.encode=OH;ve.decode=_H;ve.fromJSON=m5;sr.encode=CH;sr.decode=SH;sr.fromJSON=kb;Wr.encode=DH;Wr.decode=MH;Wr.fromJSON=p5;xi.encode=NH;xi.decode=EH;$t.encode=FH;$t.decode=vH;Ec.encode=E5;Ec.decode=v5;GH=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})()});var St,wh,Tc,Qp,xh=p(()=>{Ar();iu();St=Object.freeze({done:!0,value:void 0}),wh=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Tc=class{tee(){return this._getDOMStream().tee()}pipe(t,r){return this._getNodeStream().pipe(t,r)}pipeTo(t,r){return this._getDOMStream().pipeTo(t,r)}pipeThrough(t,r){return this._getDOMStream().pipeThrough(t,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},Qp=class extends Tc{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(St);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return mr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return mr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return H(this,void 0,void 0,function*(){return yield this.abort(t),St})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),St})}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve(St)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var Ln,_i,$r,Ub,os,vo=p(()=>{Ar();iu();Xo();xh();dr();Yo();Ln=class extends Qp{write(t){if((t=se(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?nu(this.toUint8Array(!0)):this.toUint8Array(!1).then(nu)}toUint8Array(t=!1){return t?Hn(this._values)[0]:H(this,void 0,void 0,function*(){var r,n,i,o;let s=[],a=0;try{for(var c=!0,l=zn(this),u;u=yield l.next(),r=u.done,!r;c=!0){o=u.value,c=!1;let h=o;s.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!c&&!r&&(i=l.return)&&(yield i.call(l))}finally{if(n)throw n.error}}return Hn(s,a)[0]})}},_i=class{constructor(t){t&&(this.source=new Ub(mr.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},$r=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Ln?this.source=new os(mr.fromAsyncIterable(t)):rp(t)?this.source=new os(mr.fromNodeStream(t)):qf(t)?this.source=new os(mr.fromDOMStream(t)):ep(t)?this.source=new os(mr.fromDOMStream(t.body)):Wn(t)?this.source=new os(mr.fromIterable(t)):Vn(t)?this.source=new os(mr.fromAsyncIterable(t)):Mn(t)&&(this.source=new os(mr.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},Ub=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,r="read"){return this.source.next({cmd:r,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||St)}return(t){return Object.create(this.source.return&&this.source.return(t)||St)}},os=class{constructor(t){this.source=t,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return H(this,arguments,void 0,function*(r,n="read"){return yield this.source.next({cmd:n,size:r})})}throw(t){return H(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(t))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(t){return H(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(t))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var _h,ya,jb=p(()=>{Ar();vo();dr();_h=class extends _i{constructor(t,r){super(),this.position=0,this.buffer=se(t),this.size=r===void 0?this.buffer.byteLength:r}readInt32(t){let{buffer:r,byteOffset:n}=this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),r.subarray(i,this.position)):null}readAt(t,r){let n=this.buffer,i=Math.min(this.size,t+r);return n?n.subarray(t,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},ya=class extends $r{constructor(t,r){super(),this.position=0,this._handle=t,typeof r=="number"?this.size=r:this._pending=H(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return H(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)})}seek(t){return H(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(n,o+Math.min(n-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield r.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,r){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&t+r<i){let o=Math.min(i,t+r),s=new Uint8Array(o-t);return(yield n.read(s,0,r,t)).buffer}return new Uint8Array(r)})}close(){return H(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}});var qb={};Jt(qb,{BaseInt64:()=>Sh,Int128:()=>Mh,Int64:()=>ss,Uint64:()=>Ft});function Mu(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var vu,zb,Sh,Ft,ss,Mh,Vb=p(()=>{vu=8,zb=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Sh=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=r[3]*n[3];this.buffer[0]=i&65535;let o=i>>>16;return i=r[2]*n[3],o+=i,i=r[3]*n[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(t){let r=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Mu(this.buffer[1])} ${Mu(this.buffer[0])}`}},Ft=class e extends Sh{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.length,i=new e(r);for(let o=0;o<n;){let s=vu<n-o?vu:n-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([zb[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},ss=class e extends Sh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let r=this.buffer[1]<<0,n=t.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<t.buffer[0]}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=vu<i-s?vu:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([zb[a],0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},Mh=class e{constructor(t){this.buffer=t}high(){return new ss(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new ss(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let r=new Ft(new Uint32Array([this.buffer[3],0])),n=new Ft(new Uint32Array([this.buffer[2],0])),i=new Ft(new Uint32Array([this.buffer[1],0])),o=new Ft(new Uint32Array([this.buffer[0],0])),s=new Ft(new Uint32Array([t.buffer[3],0])),a=new Ft(new Uint32Array([t.buffer[2],0])),c=new Ft(new Uint32Array([t.buffer[1],0])),l=new Ft(new Uint32Array([t.buffer[0],0])),u=Ft.multiply(o,l);this.buffer[0]=u.low();let h=new Ft(new Uint32Array([u.high(),0]));return u=Ft.multiply(i,l),h.plus(u),u=Ft.multiply(o,c),h.plus(u),this.buffer[1]=h.low(),this.buffer[3]=h.lessThan(u)?1:0,this.buffer[2]=h.high(),new Ft(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Ft.multiply(n,l)).plus(Ft.multiply(i,c)).plus(Ft.multiply(o,a)),this.buffer[3]+=Ft.multiply(r,l).plus(Ft.multiply(n,c)).plus(Ft.multiply(i,a)).plus(Ft.multiply(o,s)).low(),this}plus(t){let r=new Uint32Array(4);return r[3]=this.buffer[3]+t.buffer[3]>>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${Mu(this.buffer[3])} ${Mu(this.buffer[2])} ${Mu(this.buffer[1])} ${Mu(this.buffer[0])}`}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=vu<i-s?vu:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([zb[a],0,0,0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*4);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+16*n,4));return r}}});var Xb={};Jt(Xb,{toIntervalDayTimeInt32Array:()=>Wb,toIntervalDayTimeObjects:()=>$b,toIntervalMonthDayNanoInt32Array:()=>Hb,toIntervalMonthDayNanoObjects:()=>Kb});function Wb(e){var t,r;let n=e.length,i=new Int32Array(n*2);for(let o=0,s=0;o<n;o++){let a=e[o];i[s++]=(t=a.days)!==null&&t!==void 0?t:0,i[s++]=(r=a.milliseconds)!==null&&r!==void 0?r:0}return i}function Hb(e){var t,r;let n=e.length,i=new Int32Array(n*4);for(let o=0,s=0;o<n;o++){let a=e[o];i[s++]=(t=a.months)!==null&&t!==void 0?t:0,i[s++]=(r=a.days)!==null&&r!==void 0?r:0;let c=a.nanoseconds;if(c){let l=BigInt(c);i[s++]=Number(l&BigInt(4294967295))>>>0,i[s++]=Number(l>>BigInt(32))>>>0}else s+=2}return i}function $b(e){let t=e.length,r=new Array(t/2);for(let n=0,i=0;n<t;n+=2)r[i++]={days:e[n],milliseconds:e[n+1]};return r}function Kb(e,t){let r=e.length,n=new Array(r/4);for(let i=0,o=0;i<r;i+=4){let s=BigInt(e[i+3])<<BigInt(32)|BigInt(e[i+2]>>>0);n[o++]={months:e[i],days:e[i+1],nanoseconds:t?`${s}`:s}}return n}var e0=p(()=>{});function A5(e){let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r>>1]=Number.parseInt(e.slice(r,r+2),16);return t}function kH(e){return A5(e.join(""))}function I5(e,t){let r=new Uint8Array(e.length*16),n=new DataView(r.buffer);for(let[i,o]of e.entries()){let s=i*16,a=o.SIZE;if(n.setInt32(s,a,!0),o.INLINED!==void 0){let c=t(o.INLINED);for(let l=0;l<c.length&&l<12;l++)r[s+4+l]=c[l]}else{let c=o.PREFIX_HEX;for(let l=0;l<8&&l<c.length;l+=2)r[s+4+(l>>1)]=Number.parseInt(c.slice(l,l+2),16);n.setInt32(s+8,o.BUFFER_INDEX,!0),n.setInt32(s+12,o.OFFSET,!0)}}return r}function UH(e){return I5(e,t=>{let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n>>1]=Number.parseInt(t.slice(n,n+2),16);return r})}function jH(e){return I5(e,t=>new TextEncoder().encode(t))}var Eu,t0,r0,P5=p(()=>{wi();Vr();at();Pn();Sc();Xo();Vb();Nt();dr();e0();Eu=class extends ie{constructor(t,r,n,i,o=it.V5,s=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=t,this.nodes=r,this.buffers=n,this.dictionaries=i,this.metadataVersion=o,this.variadicBufferCounts=s}visit(t){return super.visit(t instanceof ee?t.type:t)}visitNull(t,{length:r}=this.nextFieldNode()){return te({type:t,length:r})}visitBool(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitUtf8View(t,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(t,n),o=this.readData(t),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:t,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinaryView(t,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(t,n),o=this.readData(t),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:t,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitFixedSizeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitLargeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<it.V5&&this.readNullBitmap(t,n),t.mode===Ze.Sparse?this.visitSparseUnion(t,{length:r,nullCount:n}):this.visitDenseUnion(t,{length:r,nullCount:n})}visitDenseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,r,n=this.nextBufferRange()){return r>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,r){return this.readData(t,r)}readTypeIds(t,r){return this.readData(t,r)}readData(t,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readVariadicBuffers(t){return Array.from({length:t},()=>this.readData(null))}nextVariadicBufferCount(){var t;return(t=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&t!==void 0?t:0}readDictionary(t){return this.dictionaries.get(t.id)}},t0=class extends Eu{constructor(t,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.sources=t}readNullBitmap(t,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):_c(this.sources[n])}readOffsets(t,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(t.OffsetArrayType,this.sources[r]))}readTypeIds(t,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(t.ArrayType,this.sources[r]))}readData(t,{offset:r}=this.nextBufferRange()){let{sources:n}=this;if(z.isTimestamp(t))return Re(Uint8Array,ss.convertArray(n[r]));if((z.isInt(t)||z.isTime(t))&&t.bitWidth===64||z.isDuration(t))return Re(Uint8Array,ss.convertArray(n[r]));if(z.isDate(t)&&t.unit===st.MILLISECOND)return Re(Uint8Array,ss.convertArray(n[r]));if(z.isDecimal(t))return Re(Uint8Array,Mh.convertArray(n[r]));if(z.isBinary(t)||z.isLargeBinary(t)||z.isFixedSizeBinary(t))return kH(n[r]);if(z.isBinaryView(t))return UH(n[r]);if(z.isUtf8View(t))return jH(n[r]);if(z.isBool(t))return _c(n[r]);if(z.isUtf8(t)||z.isLargeUtf8(t))return qn(n[r].join(""));if(z.isInterval(t))switch(t.unit){case ke.DAY_TIME:return Wb(n[r]);case ke.MONTH_DAY_NANO:return Hb(n[r]);default:break}return Re(Uint8Array,Re(t.ArrayType,n[r].map(i=>+i)))}readVariadicBuffers(t){let r=[];for(let n=0;n<t;n++){let{offset:i}=this.nextBufferRange(),o=this.sources[i];r.push(A5(o))}return r}};r0=class extends Eu{constructor(t,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.bodyChunks=t}readData(t,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var as,n0=p(()=>{Wi();bt();dr();as=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,se(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,0);else{let c=a.length;i.set(a,o),n.set(s,c),o+=c}}}});var cs,i0=p(()=>{dr();Wi();bt();cs=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,se(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,BigInt(0));else{let c=a.length;i.set(a,o),n.set(s,BigInt(c)),o+=c}}}});var Ac,Yb=p(()=>{Wi();bt();Ac=class extends ct{constructor(t){super(t),this._values=new Su}setValue(t,r){this._values.set(t,+r)}}});var Eo,ba,wa,Zb=p(()=>{bt();ri();Eo=class extends or{};Eo.prototype._setValue=yb;ba=class extends Eo{};ba.prototype._setValue=yp;wa=class extends Eo{};wa.prototype._setValue=bp});var xa,Jb=p(()=>{bt();ri();xa=class extends or{};xa.prototype._setValue=xb});var Ic,Qb=p(()=>{at();bt();Tu();Ic=class extends ct{constructor({type:t,nullValues:r,dictionaryHashFunction:n}){super({type:new nr(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=oi({type:this.type.indices,nullValues:r}),this.dictionary=oi({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,r){let n=this.indices;return r=n.setValid(t,r),this.length=n.length,r}setValue(t,r){let n=this._keysToIndices,i=this.valueToKey(r),o=n[i];return o===void 0&&(n[i]=o=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}});var _a,ew=p(()=>{bt();ri();_a=class extends or{};_a.prototype._setValue=gb});var Pc,tw=p(()=>{Vr();bt();at();Pc=class extends ct{setValue(t,r){let[n]=this.children,i=t*this.stride;for(let o=-1,s=this.stride;++o<s;)n.set(i+o,r[o])}setValid(t,r){return super.setValid(t,r)||this.children[0].setValid((t+1)*this.stride-1,!1),r}addChild(t,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(t);return this.type=new Ht(this.type.listSize,new ee(r,t.type,!0)),n}}});var To,Rc,Lc,Oc,rw=p(()=>{dh();bt();To=class extends or{setValue(t,r){this._values.set(t,r)}},Rc=class extends To{setValue(t,r){super.setValue(t,hh(r))}},Lc=class extends To{},Oc=class extends To{}});var $i,Sa,Ma,va,nw=p(()=>{bt();ri();$i=class extends or{};$i.prototype._setValue=_b;Sa=class extends $i{};Sa.prototype._setValue=Ap;Ma=class extends $i{};Ma.prototype._setValue=Ip;va=class extends $i{};va.prototype._setValue=Pp});var Si,Ea,Ta,Aa,Ia,iw=p(()=>{bt();ri();Si=class extends or{};Si.prototype._setValue=Sb;Ea=class extends Si{};Ea.prototype._setValue=Rp;Ta=class extends Si{};Ta.prototype._setValue=Lp;Aa=class extends Si{};Aa.prototype._setValue=Op;Ia=class extends Si{};Ia.prototype._setValue=Bp});var ln,Bc,Cc,Dc,Nc,Fc,Gc,kc,Uc,ow=p(()=>{bt();ln=class extends or{setValue(t,r){this._values.set(t,r)}},Bc=class extends ln{},Cc=class extends ln{},Dc=class extends ln{},Nc=class extends ln{},Fc=class extends ln{},Gc=class extends ln{},kc=class extends ln{},Uc=class extends ln{}});var jc,sw=p(()=>{Vr();at();Wi();bt();jc=class extends qr{constructor(t){super(t),this._offsets=new pa(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new rr(new ee(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,0);else{let s=o,a=s.length,c=r.set(i,a).buffer[i];for(let l=-1;++l<a;)n.set(c+l,s[l])}}}});var zc,aw=p(()=>{Vr();at();Wi();wo();bt();zc=class extends qr{constructor(t){super(t),this._offsets=new pa(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ei(new ee(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,BigInt(0));else{let s=o,a=s.length,c=Le(r.set(i,BigInt(a)).buffer[i]);for(let l=-1;++l<a;)n.set(c+l,s[l])}}}});var qc,cw=p(()=>{Vr();at();bt();qc=class extends qr{set(t,r){return super.set(t,r)}setValue(t,r){let n=r instanceof Map?r:new Map(Object.entries(r)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=n.size,i.set(t,n)}addChild(t,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new jr(new ee(r,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(o===void 0)r.set(i,0);else{let{[i]:s,[i+1]:a}=r.set(i,o.size).buffer;for(let c of o.entries())if(n.set(s,c),++s>=a)break}}}});var Vc,lw=p(()=>{bt();Vc=class extends ct{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}}});var Wc,uw=p(()=>{Vr();bt();at();Wc=class extends ct{setValue(t,r){let{children:n,type:i}=this;switch(Array.isArray(r)||r.constructor){case!0:return i.children.forEach((o,s)=>n[s].set(t,r[s]));case Map:return i.children.forEach((o,s)=>n[s].set(t,r.get(o.name)));default:return i.children.forEach((o,s)=>n[s].set(t,r[o.name]))}}setValid(t,r){return super.setValid(t,r)||this.children.forEach(n=>n.setValid(t,r)),r}addChild(t,r=`${this.numChildren}`){let n=this.children.push(t);return this.type=new tt([...this.type.children,new ee(r,t.type,!0)]),n}}});var Mi,Pa,Ra,La,Oa,fw=p(()=>{bt();ri();Mi=class extends or{};Mi.prototype._setValue=bb;Pa=class extends Mi{};Pa.prototype._setValue=wp;Ra=class extends Mi{};Ra.prototype._setValue=xp;La=class extends Mi{};La.prototype._setValue=_p;Oa=class extends Mi{};Oa.prototype._setValue=Sp});var vi,Ba,Ca,Da,Na,hw=p(()=>{bt();ri();vi=class extends or{};vi.prototype._setValue=wb;Ba=class extends vi{};Ba.prototype._setValue=Mp;Ca=class extends vi{};Ca.prototype._setValue=vp;Da=class extends vi{};Da.prototype._setValue=Ep;Na=class extends vi{};Na.prototype._setValue=Tp});var ls,Hc,$c,dw=p(()=>{Vr();Wi();bt();at();ls=class extends ct{constructor(t){super(t),this._typeIds=new ns(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,r){return this.set(this.length,t,r)}set(t,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,t)),this.setValue(t,r,n),this}setValue(t,r,n){this._typeIds.set(t,n);let i=this.type.typeIdToChildIndex[n],o=this.children[i];o==null||o.set(t,r),this.length=Math.max(t+1,this.length)}addChild(t,r=`${this.children.length}`){let n=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new ee(r,t.type)];return this.type=new cn(o,[...s,n],a),n}_valueToChildTypeId(t,r,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},Hc=class extends ls{},$c=class extends ls{constructor(t){super(t),this._offsets=new ns(Int32Array)}setValue(t,r,n){let i=this._typeIds.set(t,n).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o==null||o.set(s,r),this.length=Math.max(t+1,this.length)}}});var Fa,mw=p(()=>{Xo();n0();Wi();bt();Fa=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,qn(r))}_flushPending(t,r){}};Fa.prototype._flushPending=as.prototype._flushPending});var Ga,pw=p(()=>{Xo();Wi();bt();i0();Ga=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,qn(r))}_flushPending(t,r){}};Ga.prototype._flushPending=cs.prototype._flushPending});var us,o0=p(()=>{at();bt();Wi();dr();wi();us=class extends ct{constructor(t){super(t),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Rn(Uint8Array)}get byteLength(){let t=0;this._views&&(t+=this._views.byteLength),this._nulls&&(t+=this._nulls.byteLength);for(let r of this._variadicBuffers)t+=r.byteLength;return this._currentBuffer&&(t+=this._currentBuffer.byteLength),t}setValue(t,r){return this.writeBinaryValue(t,this.encodeValue(r))}writeBinaryValue(t,r){let n=r.length,i=(t+1)*Ee.ELEMENT_WIDTH,o=this._views.length;i>o&&this._views.reserve(i-o);let s=this._views.buffer,a=t*Ee.ELEMENT_WIDTH,c=new DataView(s.buffer,s.byteOffset+a,Ee.ELEMENT_WIDTH);if(c.setInt32(Ee.LENGTH_OFFSET,n,!0),n<=Ee.INLINE_CAPACITY){s.set(r,a+Ee.INLINE_OFFSET);for(let l=n;l<Ee.INLINE_CAPACITY;l++)s[a+Ee.INLINE_OFFSET+l]=0}else{let l=new DataView(r.buffer,r.byteOffset,Math.min(4,n));c.setUint32(Ee.INLINE_OFFSET,l.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+n>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new Rn(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(r,this._currentBufferOffset),c.setInt32(Ee.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(Ee.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(t){return se(t)}setValid(t,r){let n=(t+1)*Ee.ELEMENT_WIDTH,i=this._views.length;n>i&&this._views.reserve(n-i);let o=super.setValid(t,r);if(!o){let s=this._views.buffer,a=t*Ee.ELEMENT_WIDTH;for(let c=0;c<Ee.ELEMENT_WIDTH;c++)s[a+c]=0}return o}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:t,length:r,nullCount:n,_views:i,_nulls:o}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let s=i.flush(r*Ee.ELEMENT_WIDTH),a=n>0?o.flush(r):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),te({type:t,length:r,nullCount:n,nullBitmap:a,views:s,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var Kc,gw=p(()=>{o0();Xo();Kc=class extends us{constructor(t){super(t)}setValue(t,r){return this.writeBinaryValue(t,qn(r))}}});var yw,R5,L5=p(()=>{Pn();n0();i0();Yb();Zb();Jb();Qb();ew();tw();rw();nw();iw();ow();sw();aw();cw();lw();uw();fw();hw();dw();mw();pw();o0();gw();yw=class extends ie{visitNull(){return Vc}visitBool(){return Ac}visitInt(){return ln}visitInt8(){return Bc}visitInt16(){return Cc}visitInt32(){return Dc}visitInt64(){return Nc}visitUint8(){return Fc}visitUint16(){return Gc}visitUint32(){return kc}visitUint64(){return Uc}visitFloat(){return To}visitFloat16(){return Rc}visitFloat32(){return Lc}visitFloat64(){return Oc}visitUtf8(){return Fa}visitLargeUtf8(){return Ga}visitBinary(){return as}visitLargeBinary(){return cs}visitFixedSizeBinary(){return _a}visitDate(){return Eo}visitDateDay(){return ba}visitDateMillisecond(){return wa}visitTimestamp(){return Mi}visitTimestampSecond(){return Pa}visitTimestampMillisecond(){return Ra}visitTimestampMicrosecond(){return La}visitTimestampNanosecond(){return Oa}visitTime(){return vi}visitTimeSecond(){return Ba}visitTimeMillisecond(){return Ca}visitTimeMicrosecond(){return Da}visitTimeNanosecond(){return Na}visitDecimal(){return xa}visitList(){return jc}visitLargeList(){return zc}visitStruct(){return Wc}visitUnion(){return ls}visitDenseUnion(){return $c}visitSparseUnion(){return Hc}visitDictionary(){return Ic}visitInterval(){return $i}visitIntervalDayTime(){return Sa}visitIntervalYearMonth(){return Ma}visitIntervalMonthDayNano(){return va}visitDuration(){return Si}visitDurationSecond(){return Ea}visitDurationMillisecond(){return Ta}visitDurationMicrosecond(){return Aa}visitDurationNanosecond(){return Ia}visitFixedSizeList(){return Pc}visitMap(){return qc}visitBinaryView(){return us}visitUtf8View(){return Kc}},R5=new yw});function un(e,t){return t instanceof e.constructor}function fs(e,t){return e===t||un(e,t)}function hs(e,t){return e===t||un(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function s0(e,t){return e===t||un(e,t)&&e.precision===t.precision}function zH(e,t){return e===t||un(e,t)&&e.byteWidth===t.byteWidth}function bw(e,t){return e===t||un(e,t)&&e.unit===t.unit}function vh(e,t){return e===t||un(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Eh(e,t){return e===t||un(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function O5(e,t){return e===t||un(e,t)&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function qH(e,t){return e===t||un(e,t)&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function ww(e,t){return e===t||un(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&Ao.compareManyFields(e.children,t.children)}function VH(e,t){return e===t||un(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Ao.visit(e.indices,t.indices)&&Ao.visit(e.dictionary,t.dictionary)}function a0(e,t){return e===t||un(e,t)&&e.unit===t.unit}function Th(e,t){return e===t||un(e,t)&&e.unit===t.unit}function WH(e,t){return e===t||un(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function HH(e,t){return e===t||un(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function Xc(e,t){return Ao.compareSchemas(e,t)}function B5(e,t){return Ao.compareFields(e,t)}function c0(e,t){return Ao.visit(e,t)}var he,Ao,Ah=p(()=>{Pn();he=class extends ie{compareSchemas(t,r){return t===r||r instanceof t.constructor&&this.compareManyFields(t.fields,r.fields)}compareManyFields(t,r){return t===r||Array.isArray(t)&&Array.isArray(r)&&t.length===r.length&&t.every((n,i)=>this.compareFields(n,r[i]))}compareFields(t,r){return t===r||r instanceof t.constructor&&t.name===r.name&&t.nullable===r.nullable&&this.visit(t.type,r.type)}};he.prototype.visitNull=fs;he.prototype.visitBool=fs;he.prototype.visitInt=hs;he.prototype.visitInt8=hs;he.prototype.visitInt16=hs;he.prototype.visitInt32=hs;he.prototype.visitInt64=hs;he.prototype.visitUint8=hs;he.prototype.visitUint16=hs;he.prototype.visitUint32=hs;he.prototype.visitUint64=hs;he.prototype.visitFloat=s0;he.prototype.visitFloat16=s0;he.prototype.visitFloat32=s0;he.prototype.visitFloat64=s0;he.prototype.visitUtf8=fs;he.prototype.visitLargeUtf8=fs;he.prototype.visitUtf8View=fs;he.prototype.visitBinary=fs;he.prototype.visitLargeBinary=fs;he.prototype.visitBinaryView=fs;he.prototype.visitFixedSizeBinary=zH;he.prototype.visitDate=bw;he.prototype.visitDateDay=bw;he.prototype.visitDateMillisecond=bw;he.prototype.visitTimestamp=vh;he.prototype.visitTimestampSecond=vh;he.prototype.visitTimestampMillisecond=vh;he.prototype.visitTimestampMicrosecond=vh;he.prototype.visitTimestampNanosecond=vh;he.prototype.visitTime=Eh;he.prototype.visitTimeSecond=Eh;he.prototype.visitTimeMillisecond=Eh;he.prototype.visitTimeMicrosecond=Eh;he.prototype.visitTimeNanosecond=Eh;he.prototype.visitDecimal=fs;he.prototype.visitList=O5;he.prototype.visitLargeList=O5;he.prototype.visitStruct=qH;he.prototype.visitUnion=ww;he.prototype.visitDenseUnion=ww;he.prototype.visitSparseUnion=ww;he.prototype.visitDictionary=VH;he.prototype.visitInterval=a0;he.prototype.visitIntervalDayTime=a0;he.prototype.visitIntervalYearMonth=a0;he.prototype.visitIntervalMonthDayNano=a0;he.prototype.visitDuration=Th;he.prototype.visitDurationSecond=Th;he.prototype.visitDurationMillisecond=Th;he.prototype.visitDurationMicrosecond=Th;he.prototype.visitDurationNanosecond=Th;he.prototype.visitFixedSizeList=WH;he.prototype.visitMap=HH;Ao=new he});function oi(e){let t=e.type,r=new(R5.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let n=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(n)?((s,a)=>n[a]||i):(({name:s})=>n[s]||i);for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);r.children.push(oi(Object.assign(Object.assign({},l),{type:c})))}}return r}function Au(e,t){if(e instanceof ce||e instanceof $||e.type instanceof z||ArrayBuffer.isView(e))return Mo(e);let r={type:t??l0(e),nullValues:[null]},n=[...u0(r)(e)],i=n.length===1?n[0]:n.reduce((o,s)=>o.concat(s));return z.isDictionary(i.type)?i.memoize():i}function xw(e){let t=Au(e),r=new $e(new ve(t.type.children),t.data[0]);return new ot(r)}function l0(e){if(e.length===0)return new Wt;let t=0,r=0,n=0,i=0,o=0,s=0,a=0,c=0;for(let l of e){if(l==null){++t;continue}switch(typeof l){case"bigint":++s;continue;case"boolean":++a;continue;case"number":++i;continue;case"string":++o;continue;case"object":Array.isArray(l)?++r:Object.prototype.toString.call(l)==="[object Date]"?++c:++n;continue}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}if(i+t===e.length)return new Qn;if(o+t===e.length)return new nr(new Gr,new Yt);if(s+t===e.length)return new Yn;if(a+t===e.length)return new kr;if(c+t===e.length)return new xo;if(r+t===e.length){let l=e,u=l0(l[l.findIndex(h=>h!=null)]);if(l.every(h=>h==null||c0(u,l0(h))))return new rr(new ee("",u,!0))}else if(n+t===e.length){let l=new Map;for(let u of e)for(let h of Object.keys(u))!l.has(h)&&u[h]!=null&&l.set(h,new ee(h,l0([u[h]]),!0));return new tt([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function u0(e){let{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=e,n=t!=="bytes"?"length":"byteLength";return function*(i){let o=0,s=oi(e);for(let a of i)s.append(a)[n]>=r&&++o&&(yield s.toVector());(s.finish().length>0||o===0)&&(yield s.toVector())}}function _w(e){let{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=e,n=t!=="bytes"?"length":"byteLength";return function(i){return en(this,arguments,function*(){var o,s,a,c;let l=0,u=oi(e);try{for(var h=!0,d=zn(i),m;m=yield Me(d.next()),o=m.done,!o;h=!0){c=m.value,h=!1;let g=c;u.append(g)[n]>=r&&++l&&(yield yield Me(u.toVector()))}}catch(g){s={error:g}}finally{try{!h&&!o&&(a=d.return)&&(yield Me(a.call(d)))}finally{if(s)throw s.error}}(u.finish().length>0||l===0)&&(yield yield Me(u.toVector()))})}}var Tu=p(()=>{Ar();Vr();at();wi();zr();L5();Yc();ds();Ah()});function f0(e,t){return $H(e,t.map(r=>r.data.concat()))}function $H(e,t){let r=[...e.fields],n=[],i={numBatches:t.reduce((h,d)=>Math.max(h,d.length),0)},o=0,s=0,a=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=t[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=KH(r,s,u,t,i),s>0&&(n[o++]=te({type:new tt(r),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(r),n.map(h=>new $e(e,h))]}function KH(e,t,r,n,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let l=r[a],u=l==null?void 0:l.length;if(u>=t)u===t?r[a]=l:(r[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(l.slice(t,u-t))));else{let h=e[a];e[a]=h.clone({nullable:!0}),r[a]=(o=l==null?void 0:l._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:te({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return r}var C5=p(()=>{wi();at();ds()});function Sw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=Mo(i);return new ot(t)}function Mw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=Au(i);return new ot(t)}var D5,N5,ot,Yc=p(()=>{Nt();wi();Tu();zr();Vr();at();Ah();C5();qp();bc();ri();Vp();Wp();bu();ds();N5=Symbol.for("apache-arrow/Table"),ot=class e{static isTable(t){return(t==null?void 0:t[N5])===!0}constructor(...t){var r,n;if(t.length===0)return this.batches=[],this.schema=new ve([]),this._offsets=[0],this;let i,o;t[0]instanceof ve&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof $e)return[c];if(c instanceof e)return c.batches;if(c instanceof ce){if(c.type instanceof tt)return[new $e(new ve(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>s(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>s(l));if(typeof c=="object"){let l=Object.keys(c),u=l.map(m=>new $([c[m]])),h=i??new ve(l.map((m,g)=>new ee(String(m),u[g].type,u[g].nullable))),[,d]=f0(h,u);return d.length===0?[new $e(c)]:d}}}return[]},a=t.flatMap(c=>s(c));if(i=(n=i??((r=a[0])===null||r===void 0?void 0:r.schema))!==null&&n!==void 0?n:new ve([]),!(i instanceof ve))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof $e))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Xc(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??kp(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,r)=>t+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Gp(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(wc(t,this.numRows))}set(t,r){}indexOf(t,r){return-1}[Symbol.iterator](){return this.batches.length>0?_u.visit(new $(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
10
+ return true;`)}function OH(e){return typeof e!="bigint"?ki(e):`${ki(e)}n`}var u5=p(()=>{sh()});function Nb(e,t){let r=Math.ceil(e)*t-1;return(r-r%64+64||64)/t}function f5(e,t=0){return e.length>=t?e.subarray(0,t):Wf(new e.constructor(t),e,0)}var Rn,rs,vu,ga,Wi=p(()=>{dr();Rn=class{constructor(t,r=0,n=1){this.length=Math.ceil(r/n),this.buffer=new t(this.length),this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,r){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let r=this.stride,n=this.length*r,i=this.buffer.length;n>=i&&this._resize(i===0?Nb(n*1,this.BYTES_PER_ELEMENT):Nb(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Nb(t*this.stride,this.BYTES_PER_ELEMENT);let r=f5(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=f5(this.buffer,t)}},rs=class extends Rn{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,r){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=r,this}},vu=class extends rs{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,r){let{buffer:n}=this.reserve(t-this.length+1),i=t>>3,o=t%8,s=n[i]>>o&1;return r?s===0&&(n[i]|=1<<o,++this.numValid):s===1&&(n[i]&=~(1<<o),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},ga=class extends rs{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,r){let n=this.length-1,i=this.reserve(t-n+1).buffer;return n<t++&&n>=0&&i.fill(i[n],n,t),i[t]=i[t-1]+r,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}}});var ct,or,qr,bt=p(()=>{zr();wi();ph();at();u5();Wi();ct=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:r}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=r,this.stride=ti(t),this._nulls=new vu,r&&r.length>0&&(this._isValid=l5(r))}toVector(){return new $([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0,{_offsets:r,_values:n,_nulls:i,_typeIds:o,children:s}=this;return r&&(t+=r.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),o&&(t+=o.byteLength),s.reduce((a,c)=>a+c.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((r,n)=>r+n.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,r){return this.setValid(t,this.isValid(r))&&this.setValue(t,r),this}setValue(t,r){this._setValue(this,t,r)}setValid(t,r){return this.length=this._nulls.set(t,+r).length,r}addChild(t,r=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(t){return this.children[t]||null}flush(){let t,r,n,i,{type:o,length:s,nullCount:a,_typeIds:c,_offsets:l,_values:u,_nulls:h}=this;(r=c==null?void 0:c.flush(s))?i=l==null?void 0:l.flush(s):(i=l==null?void 0:l.flush(s))?t=u==null?void 0:u.flush(l.last()):t=u==null?void 0:u.flush(s),a>0&&(n=h==null?void 0:h.flush(s));let d=this.children.map(m=>m.flush());return this.clear(),te({type:o,length:s,nullCount:a,children:d,child:d[0],data:t,typeIds:r,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,r,n,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(r=this._values)===null||r===void 0||r.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let o of this.children)o.clear();return this}};ct.prototype.length=1;ct.prototype.stride=1;ct.prototype.children=null;ct.prototype.finished=!1;ct.prototype.nullValues=null;ct.prototype._isValid=()=>!0;or=class extends ct{constructor(t){super(t),this._values=new rs(this.ArrayType,0,this.stride)}setValue(t,r){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,r)}},qr=class extends ct{constructor(t){super(t),this._pendingLength=0,this._offsets=new ga(t.type)}setValue(t,r){let n=this._pending||(this._pending=new Map),i=n.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=r instanceof bi?r[ma].length:r.length,n.set(t,r)}setValid(t,r){return super.setValid(t,r)?!0:((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let t=this._pending,r=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,r),this}}});var Tc,Fb=p(()=>{Tc=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,r,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(r??0)),t.offset()}}});var h5,ni,d5=p(()=>{h5=me(ze(),1);Fb();uu();up();fb();ni=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsFooter(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,r){return t.setPosition(t.position()+h5.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ot.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new En).__init(this.bb.__indirect(this.bb_pos+r),this.bb):null}dictionaries(t,r){let n=this.bb.__offset(this.bb_pos,8);return n?(r||new Tc).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,r){let n=this.bb.__offset(this.bb_pos,10);return n?(r||new Tc).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,ot.V1)}static addSchema(t,r){t.addFieldOffset(1,r,0)}static addDictionaries(t,r){t.addFieldOffset(2,r,0)}static startDictionariesVector(t,r){t.startVector(24,r,8)}static addRecordBatches(t,r){t.addFieldOffset(3,r,0)}static startRecordBatchesVector(t,r){t.startVector(24,r,8)}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,r){t.finish(r)}static finishSizePrefixedFooterBuffer(t,r){t.finish(r,void 0,!0)}}});function Jp(e,t){return new Map([...e||new Map,...t||new Map])}function kb(e,t=new Map){for(let r=-1,n=e.length;++r<n;){let o=e[r].type;if(U.isDictionary(o)){if(!t.has(o.id))t.set(o.id,o.dictionary);else if(t.get(o.id)!==o.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&kb(o.children,t)}return t}var m5,p5,ve,ee,Vr=p(()=>{Nt();at();m5=Symbol.for("apache-arrow/Schema"),p5=Symbol.for("apache-arrow/Field"),ve=class e{static isSchema(t){return(t==null?void 0:t[m5])===!0}constructor(t=[],r,n,i=ot.V5){this.fields=t||[],this.metadata=r||new Map,n||(n=kb(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,r)=>`${r}: ${t}`).join(", ")} }>`}select(t){let r=new Set(t),n=this.fields.filter(i=>r.has(i.name));return new e(n,this.metadata)}selectAt(t){let r=t.map(n=>this.fields[n]).filter(Boolean);return new e(r,this.metadata)}assign(...t){let r=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),n=[...this.fields],i=Jp(Jp(new Map,this.metadata),r.metadata),o=r.fields.filter(a=>{let c=n.findIndex(l=>l.name===a.name);return~c?(n[c]=a.clone({metadata:Jp(Jp(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=kb(o,new Map);return new e([...n,...o],i,new Map([...this.dictionaries,...s]))}};ve.prototype.fields=null;ve.prototype.metadata=null;ve.prototype.dictionaries=null;ve.prototype[m5]=!0;Object.defineProperty(ve,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ve&&ve.isSchema(t)}});ee=class e{static isField(t){return(t==null?void 0:t[p5])===!0}static new(...t){let[r,n,i,o]=t;return t[0]&&typeof t[0]=="object"&&({name:r}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),o===void 0&&(o=t[0].metadata)),new e(`${r}`,n,i,o)}constructor(t,r,n=!1,i){this.name=t,this.type=r,this.nullable=n,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[r,n,i,o]=t;return!t[0]||typeof t[0]!="object"?[r=this.name,n=this.type,i=this.nullable,o=this.metadata]=t:{name:r=this.name,type:n=this.type,nullable:i=this.nullable,metadata:o=this.metadata}=t[0],e.new(r,n,i,o)}};ee.prototype.type=null;ee.prototype.name=null;ee.prototype.nullable=null;ee.prototype.metadata=null;ee.prototype[p5]=!0;Object.defineProperty(ee,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ee&&ee.isField(t)}})});var Qp,CH,BH,ns,Gb,Hi,Ub=p(()=>{Fb();d5();Qp=me(ze(),1);Vr();Nt();dr();wo();CH=Qp.Builder,BH=Qp.ByteBuffer,ns=class{static decode(t){t=new BH(se(t));let r=ni.getRootAsFooter(t),n=ve.decode(r.schema(),new Map,r.version());return new Gb(n,r)}static encode(t){let r=new CH,n=ve.encode(r,t.schema);ni.startRecordBatchesVector(r,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Hi.encode(r,s);let i=r.endVector();ni.startDictionariesVector(r,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Hi.encode(r,s);let o=r.endVector();return ni.startFooter(r),ni.addSchema(r,n),ni.addVersion(r,ot.V5),ni.addRecordBatches(r,i),ni.addDictionaries(r,o),ni.finishFooterBuffer(r,ni.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,r=ot.V5,n,i){this.schema=t,this.version=r,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,r=-1,n=this.numRecordBatches;++r<n;)(t=this.getRecordBatch(r))&&(yield t)}*dictionaryBatches(){for(let t,r=-1,n=this.numDictionaries;++r<n;)(t=this.getDictionaryBatch(r))&&(yield t)}getRecordBatch(t){return t>=0&&t<this.numRecordBatches&&this._recordBatches[t]||null}getDictionaryBatch(t){return t>=0&&t<this.numDictionaries&&this._dictionaryBatches[t]||null}},Gb=class extends ns{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,r){super(t,r.version()),this._footer=r}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let r=this._footer.recordBatches(t);if(r)return Hi.decode(r)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let r=this._footer.dictionaries(t);if(r)return Hi.decode(r)}return null}},Hi=class e{static decode(t){return new e(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,r){let{metaDataLength:n}=r,i=BigInt(r.offset),o=BigInt(r.bodyLength);return Tc.createBlock(t,i,n,o)}constructor(t,r,n){this.metaDataLength=t,this.offset=Le(n),this.bodyLength=Le(r)}}});var g5,ii,y5=p(()=>{g5=me(ze(),1);uu();wp();up();ii=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,r){return this.bb_pos=t,this.bb=r,this}static getRootAsMessage(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,r){return t.setPosition(t.position()+g5.SIZE_PREFIX_LENGTH),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ot.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):ke.NONE}header(t){let r=this.bb.__offset(this.bb_pos,8);return r?this.bb.__union(t,this.bb_pos+r):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,r){let n=this.bb.__offset(this.bb_pos,12);return n?(r||new Dt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,r){t.addFieldInt16(0,r,ot.V1)}static addHeaderType(t,r){t.addFieldInt8(1,r,ke.NONE)}static addHeader(t,r){t.addFieldOffset(2,r,0)}static addBodyLength(t,r){t.addFieldInt64(3,r,BigInt("0"))}static addCustomMetadata(t,r){t.addFieldOffset(4,r,0)}static createCustomMetadataVector(t,r){t.startVector(4,r.length,4);for(let n=r.length-1;n>=0;n--)t.addOffset(r[n]);return t.endVector()}static startCustomMetadataVector(t,r){t.startVector(4,r,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,r){t.finish(r)}static finishSizePrefixedMessageBuffer(t,r){t.finish(r,void 0,!0)}static createMessage(t,r,n,i,o,s){return e.startMessage(t),e.addVersion(t,r),e.addHeaderType(t,n),e.addHeader(t,i),e.addBodyLength(t,o),e.addCustomMetadata(t,s),e.endMessage(t)}}});var jb,e0,b5=p(()=>{Pn();RI();yp();ib();cI();uI();_I();hI();FI();GI();EI();eb();Q2();ab();cb();ob();tb();AI();MI();OI();lb();J2();rb();nb();sb();jb=class extends ie{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return rh.startNull(r),rh.endNull(r)}visitInt(t,r){return Ni.startInt(r),Ni.addBitWidth(r,t.bitWidth),Ni.addIsSigned(r,t.isSigned),Ni.endInt(r)}visitFloat(t,r){return Js.startFloatingPoint(r),Js.addPrecision(r,t.precision),Js.endFloatingPoint(r)}visitBinary(t,r){return Xf.startBinary(r),Xf.endBinary(r)}visitBinaryView(t,r){return Yf.startBinaryView(r),Yf.endBinaryView(r)}visitLargeBinary(t,r){return Jf.startLargeBinary(r),Jf.endLargeBinary(r)}visitBool(t,r){return Zf.startBool(r),Zf.endBool(r)}visitUtf8(t,r){return ih.startUtf8(r),ih.endUtf8(r)}visitUtf8View(t,r){return oh.startUtf8View(r),oh.endUtf8View(r)}visitLargeUtf8(t,r){return eh.startLargeUtf8(r),eh.endLargeUtf8(r)}visitDecimal(t,r){return bo.startDecimal(r),bo.addScale(r,t.scale),bo.addPrecision(r,t.precision),bo.addBitWidth(r,t.bitWidth),bo.endDecimal(r)}visitDate(t,r){return Ks.startDate(r),Ks.addUnit(r,t.unit),Ks.endDate(r)}visitTime(t,r){return Jo.startTime(r),Jo.addUnit(r,t.unit),Jo.addBitWidth(r,t.bitWidth),Jo.endTime(r)}visitTimestamp(t,r){let n=t.timezone&&r.createString(t.timezone)||void 0;return Qo.startTimestamp(r),Qo.addUnit(r,t.unit),n!==void 0&&Qo.addTimezone(r,n),Qo.endTimestamp(r)}visitInterval(t,r){return Qs.startInterval(r),Qs.addUnit(r,t.unit),Qs.endInterval(r)}visitDuration(t,r){return Xs.startDuration(r),Xs.addUnit(r,t.unit),Xs.endDuration(r)}visitList(t,r){return th.startList(r),th.endList(r)}visitLargeList(t,r){return Qf.startLargeList(r),Qf.endLargeList(r)}visitStruct(t,r){return nh.startStruct_(r),nh.endStruct_(r)}visitUnion(t,r){Fi.startTypeIdsVector(r,t.typeIds.length);let n=Fi.createTypeIdsVector(r,t.typeIds);return Fi.startUnion(r),Fi.addMode(r,t.mode),Fi.addTypeIds(r,n),Fi.endUnion(r)}visitDictionary(t,r){let n=this.visit(t.indices,r);return yo.startDictionaryEncoding(r),yo.addId(r,BigInt(t.id)),yo.addIsOrdered(r,t.isOrdered),n!==void 0&&yo.addIndexType(r,n),yo.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return Ys.startFixedSizeBinary(r),Ys.addByteWidth(r,t.byteWidth),Ys.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return Zs.startFixedSizeList(r),Zs.addListSize(r,t.listSize),Zs.endFixedSizeList(r)}visitMap(t,r){return ea.startMap(r),ea.addKeysSorted(r,t.keysSorted),ea.endMap(r)}},e0=new jb});function S5(e,t=new Map){return new ve(DH(e,t),t0(e.metadata),t)}function zb(e){return new sr(e.count,v5(e.columns),E5(e.columns),null,T5(e.columns))}function M5(e){return new Wr(zb(e.data),e.id,e.isDelta)}function DH(e,t){return(e.fields||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function w5(e,t){return(e.children||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function v5(e){return(e||[]).reduce((t,r)=>[...t,new xi(r.count,NH(r.VALIDITY)),...v5(r.children)],[])}function E5(e,t=[]){for(let r=-1,n=(e||[]).length;++r<n;){let i=e[r];if(i.VALIDITY&&t.push(new Kt(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new Kt(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new Kt(t.length,i.OFFSET.length)),i.DATA&&t.push(new Kt(t.length,i.DATA.length)),i.VIEWS&&t.push(new Kt(t.length,i.VIEWS.length)),i.VARIADIC_DATA_BUFFERS)for(let o of i.VARIADIC_DATA_BUFFERS)t.push(new Kt(t.length,o.length));t=E5(i.children,t)}return t}function NH(e){return(e||[]).reduce((t,r)=>t+ +(r===0),0)}function T5(e){return(e||[]).reduce((t,r)=>[...t,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...T5(r.children)],[])}function A5(e,t){let r,n,i,o,s,a;return!t||!(o=e.dictionary)?(s=_5(e,w5(e,t)),i=new ee(e.name,s,e.nullable,t0(e.metadata))):t.has(r=o.id)?(n=(n=o.indexType)?x5(n):new Zt,a=new nr(t.get(r),n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,t0(e.metadata))):(n=(n=o.indexType)?x5(n):new Zt,t.set(r,s=_5(e,w5(e,t))),a=new nr(s,n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,t0(e.metadata))),i||null}function t0(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function x5(e){return new Pt(e.isSigned,e.bitWidth)}function _5(e,t){let r=e.type.name;switch(r){case"NONE":return new Ht;case"null":return new Ht;case"binary":return new Tn;case"largebinary":return new zi;case"binaryview":return new Ee;case"utf8":return new kr;case"largeutf8":return new qi;case"utf8view":return new on;case"bool":return new Gr;case"list":return new rr((t||[])[0]);case"largelist":return new ei((t||[])[0]);case"struct":return new Je(t||[]);case"struct_":return new Je(t||[])}switch(r){case"int":{let n=e.type;return new Pt(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=e.type;return new Fr(He[n.precision])}case"decimal":{let n=e.type;return new An(n.scale,n.precision,n.bitWidth)}case"date":{let n=e.type;return new sn(st[n.unit])}case"time":{let n=e.type;return new Pr(q[n.unit],n.bitWidth)}case"timestamp":{let n=e.type;return new Rr(q[n.unit],n.timezone)}case"interval":{let n=e.type;return new Ur(Ge[n.unit])}case"duration":{let n=e.type;return new an(q[n.unit])}case"union":{let n=e.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new cn(Ze[s],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=e.type;return new In(n.byteWidth)}case"fixedsizelist":{let n=e.type;return new $t(n.listSize,(t||[])[0])}case"map":{let n=e.type;return new jr((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var I5=p(()=>{Vr();at();ya();Nt()});function GH(e,t){return(()=>{switch(t){case ke.Schema:return ve.fromJSON(e);case ke.RecordBatch:return sr.fromJSON(e);case ke.DictionaryBatch:return Wr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${ke[t]}, type: ${t} }`)})}function UH(e,t){return(()=>{switch(t){case ke.Schema:return ve.decode(e.header(new En),new Map,e.version());case ke.RecordBatch:return sr.decode(e.header(new Dr),e.version());case ke.DictionaryBatch:return Wr.decode(e.header(new Zo),e.version())}throw new Error(`Unrecognized Message type: { name: ${ke[t]}, type: ${t} }`)})}function jH(e,t=new Map,r=ot.V5){let n=XH(e,t);return new ve(n,r0(e),t,r)}function zH(e,t=ot.V5){return new sr(e.length(),HH(e),$H(e,t),O5(e.compression()),KH(e))}function qH(e,t=ot.V5){return new Wr(sr.decode(e.data(),t),e.id(),e.isDelta())}function VH(e){return new Kt(e.offset(),e.length())}function WH(e){return new xi(e.length(),e.nullCount())}function HH(e){let t=[];for(let r,n=-1,i=-1,o=e.nodesLength();++n<o;)(r=e.nodes(n))&&(t[++i]=xi.decode(r));return t}function $H(e,t){let r=[];for(let n,i=-1,o=-1,s=e.buffersLength();++i<s;)(n=e.buffers(i))&&(t<ot.V4&&(n.bb_pos+=8*(i+1)),r[++o]=Kt.decode(n));return r}function KH(e){let t=[],r=Math.trunc(e.variadicBufferCountsLength());for(let n=0;n<r;++n)t.push(Le(e.variadicBufferCounts(n)));return t}function XH(e,t){let r=[];for(let n,i=-1,o=-1,s=e.fieldsLength();++i<s;)(n=e.fields(i))&&(r[++o]=ee.decode(n,t));return r}function P5(e,t){let r=[];for(let n,i=-1,o=-1,s=e.childrenLength();++i<s;)(n=e.children(i))&&(r[++o]=ee.decode(n,t));return r}function YH(e,t){let r,n,i,o,s,a;return!t||!(a=e.dictionary())?(i=L5(e,P5(e,t)),n=new ee(e.name(),i,e.nullable(),r0(e))):t.has(r=Le(a.id()))?(o=(o=a.indexType())?R5(o):new Zt,s=new nr(t.get(r),o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),r0(e))):(o=(o=a.indexType())?R5(o):new Zt,t.set(r,i=L5(e,P5(e,t))),s=new nr(i,o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),r0(e))),n||null}function r0(e){let t=new Map;if(e)for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function ZH(e){let t=new Map;for(let r,n,i=-1,o=Math.trunc(e.customMetadataLength());++i<o;)(r=e.customMetadata(i))&&(n=r.key())!=null&&t.set(n,r.value());return t}function R5(e){return new Pt(e.isSigned(),e.bitWidth())}function L5(e,t){let r=e.typeType();switch(r){case pe.NONE:return new Ht;case pe.Null:return new Ht;case pe.Binary:return new Tn;case pe.LargeBinary:return new zi;case pe.BinaryView:return new Ee;case pe.Utf8:return new kr;case pe.LargeUtf8:return new qi;case pe.Utf8View:return new on;case pe.Bool:return new Gr;case pe.List:return new rr((t||[])[0]);case pe.LargeList:return new ei((t||[])[0]);case pe.Struct_:return new Je(t||[])}switch(r){case pe.Int:{let n=e.type(new Ni);return new Pt(n.isSigned(),n.bitWidth())}case pe.FloatingPoint:{let n=e.type(new Js);return new Fr(n.precision())}case pe.Decimal:{let n=e.type(new bo);return new An(n.scale(),n.precision(),n.bitWidth())}case pe.Date:{let n=e.type(new Ks);return new sn(n.unit())}case pe.Time:{let n=e.type(new Jo);return new Pr(n.unit(),n.bitWidth())}case pe.Timestamp:{let n=e.type(new Qo);return new Rr(n.unit(),n.timezone())}case pe.Interval:{let n=e.type(new Qs);return new Ur(n.unit())}case pe.Duration:{let n=e.type(new Xs);return new an(n.unit())}case pe.Union:{let n=e.type(new Fi);return new cn(n.mode(),n.typeIdsArray()||[],t||[])}case pe.FixedSizeBinary:{let n=e.type(new Ys);return new In(n.byteWidth())}case pe.FixedSizeList:{let n=e.type(new Zs);return new $t(n.listSize(),(t||[])[0])}case pe.Map:{let n=e.type(new ea);return new jr((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${pe[r]}" (${r})`)}function O5(e){return e?new Ac(e.codec(),e.method()):null}function JH(e,t){let r=t.fields.map(o=>ee.encode(e,o));En.startFieldsVector(e,r.length);let n=En.createFieldsVector(e,r),i=t.metadata&&t.metadata.size>0?En.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return Dt.startKeyValue(e),Dt.addKey(e,a),Dt.addValue(e,c),Dt.endKeyValue(e)})):-1;return En.startSchema(e),En.addFields(e,n),En.addEndianness(e,i$?$s.Little:$s.Big),i!==-1&&En.addCustomMetadata(e,i),En.endSchema(e)}function QH(e,t){let r=-1,n=-1,i=-1,o=t.type,s=t.typeId;U.isDictionary(o)?(s=o.dictionary.typeId,i=e0.visit(o,e),n=e0.visit(o.dictionary,e)):n=e0.visit(o,e);let a=(o.children||[]).map(u=>ee.encode(e,u)),c=Nr.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Nr.createCustomMetadataVector(e,[...t.metadata].map(([u,h])=>{let d=e.createString(`${u}`),m=e.createString(`${h}`);return Dt.startKeyValue(e),Dt.addKey(e,d),Dt.addValue(e,m),Dt.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),Nr.startField(e),Nr.addType(e,n),Nr.addTypeType(e,s),Nr.addChildren(e,c),Nr.addNullable(e,!!t.nullable),r!==-1&&Nr.addName(e,r),i!==-1&&Nr.addDictionary(e,i),l!==-1&&Nr.addCustomMetadata(e,l),Nr.endField(e)}function e$(e,t){let r=t.nodes||[],n=t.buffers||[],i=t.variadicBufferCounts||[];Dr.startNodesVector(e,r.length);for(let l of r.slice().reverse())xi.encode(e,l);let o=e.endVector();Dr.startBuffersVector(e,n.length);for(let l of n.slice().reverse())Kt.encode(e,l);let s=e.endVector(),a=null;t.compression!==null&&(a=C5(e,t.compression));let c=-1;return i.length>0&&(c=Dr.createVariadicBufferCountsVector(e,i.map(BigInt))),Dr.startRecordBatch(e),Dr.addLength(e,BigInt(t.length)),Dr.addNodes(e,o),Dr.addBuffers(e,s),t.compression!==null&&a&&Dr.addCompression(e,a),c!==-1&&Dr.addVariadicBufferCounts(e,c),Dr.endRecordBatch(e)}function C5(e,t){return Yo.startBodyCompression(e),Yo.addCodec(e,t.type),Yo.addMethod(e,t.method),Yo.endBodyCompression(e)}function t$(e,t){let r=sr.encode(e,t.data);return Zo.startDictionaryBatch(e),Zo.addId(e,BigInt(t.id)),Zo.addIsDelta(e,t.isDelta),Zo.addData(e,r),Zo.endDictionaryBatch(e)}function r$(e,t){return lu.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function n$(e,t){return cu.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var n0,FH,kH,Hr,sr,Wr,Kt,xi,Ac,i$,ya=p(()=>{n0=me(ze(),1);fb();yp();Y2();rI();K2();ub();X2();bp();uu();Z2();ib();eb();Q2();ab();cb();ob();tb();lb();rb();nb();sb();y5();$2();H2();Vr();dr();wo();Nt();b5();I5();at();FH=n0.Builder,kH=n0.ByteBuffer,Hr=class e{static fromJSON(t,r){let n=new e(0,ot.V5,r);return n._createHeader=GH(t,r),n}static decode(t){t=new kH(se(t));let r=ii.getRootAsMessage(t),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=ZH(r),a=new e(n,i,o,void 0,s);return a._createHeader=UH(r,o),a}static encode(t){let r=new FH,n=-1;t.isSchema()?n=ve.encode(r,t.header()):t.isRecordBatch()?n=sr.encode(r,t.header()):t.isDictionaryBatch()&&(n=Wr.encode(r,t.header()));let i=t.metadata&&t.metadata.size>0?ii.createCustomMetadataVector(r,[...t.metadata].map(([o,s])=>{let a=r.createString(`${o}`),c=r.createString(`${s}`);return Dt.startKeyValue(r),Dt.addKey(r,a),Dt.addValue(r,c),Dt.endKeyValue(r)})):-1;return ii.startMessage(r),ii.addVersion(r,ot.V5),ii.addHeader(r,n),ii.addHeaderType(r,t.headerType),ii.addBodyLength(r,BigInt(t.bodyLength)),i!==-1&&ii.addCustomMetadata(r,i),ii.finishMessageBuffer(r,ii.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof ve)return new e(0,ot.V5,ke.Schema,t);if(t instanceof sr)return new e(r,ot.V5,ke.RecordBatch,t,t.metadata);if(t instanceof Wr)return new e(r,ot.V5,ke.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===ke.Schema}isRecordBatch(){return this.headerType===ke.RecordBatch}isDictionaryBatch(){return this.headerType===ke.DictionaryBatch}constructor(t,r,n,i,o){this._version=r,this._headerType=n,this.body=new Uint8Array(0),this._compression=i==null?void 0:i.compression,i&&(this._createHeader=()=>i),this._bodyLength=Le(t),this._metadata=o||new Map}},sr=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(t,r,n,i,o=[],s){this._nodes=r,this._buffers=n,this._length=Le(t),this._compression=i,this._variadicBufferCounts=o,this._metadata=s||new Map}},Wr=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,r,n=!1){this._data=t,this._isDelta=n,this._id=Le(r)}},Kt=class{constructor(t,r){this.offset=Le(t),this.length=Le(r)}},xi=class{constructor(t,r){this.length=Le(t),this.nullCount=Le(r)}},Ac=class{constructor(t,r=bc.BUFFER){this.type=t,this.method=r}};ee.encode=QH;ee.decode=YH;ee.fromJSON=A5;ve.encode=JH;ve.decode=jH;ve.fromJSON=S5;sr.encode=e$;sr.decode=zH;sr.fromJSON=zb;Wr.encode=t$;Wr.decode=qH;Wr.fromJSON=M5;xi.encode=r$;xi.decode=WH;Kt.encode=n$;Kt.decode=VH;Ac.encode=C5;Ac.decode=O5;i$=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})()});var St,xh,Ic,i0,_h=p(()=>{Ar();su();St=Object.freeze({done:!0,value:void 0}),xh=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Ic=class{tee(){return this._getDOMStream().tee()}pipe(t,r){return this._getNodeStream().pipe(t,r)}pipeTo(t,r){return this._getDOMStream().pipeTo(t,r)}pipeThrough(t,r){return this._getDOMStream().pipeThrough(t,r)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},i0=class extends Ic{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){let{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(St);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return mr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return mr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return H(this,void 0,void 0,function*(){return yield this.abort(t),St})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),St})}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((r,n)=>{this.resolvers.push({resolve:r,reject:n})}):Promise.resolve(St)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var Ln,_i,$r,qb,is,vo=p(()=>{Ar();su();Ko();_h();dr();Xo();Ln=class extends i0{write(t){if((t=se(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?ou(this.toUint8Array(!0)):this.toUint8Array(!1).then(ou)}toUint8Array(t=!1){return t?Hn(this._values)[0]:H(this,void 0,void 0,function*(){var r,n,i,o;let s=[],a=0;try{for(var c=!0,l=zn(this),u;u=yield l.next(),r=u.done,!r;c=!0){o=u.value,c=!1;let h=o;s.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!c&&!r&&(i=l.return)&&(yield i.call(l))}finally{if(n)throw n.error}}return Hn(s,a)[0]})}},_i=class{constructor(t){t&&(this.source=new qb(mr.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},$r=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Ln?this.source=new is(mr.fromAsyncIterable(t)):ap(t)?this.source=new is(mr.fromNodeStream(t)):Vf(t)?this.source=new is(mr.fromDOMStream(t)):op(t)?this.source=new is(mr.fromDOMStream(t.body)):Wn(t)?this.source=new is(mr.fromIterable(t)):Vn(t)?this.source=new is(mr.fromAsyncIterable(t)):Mn(t)&&(this.source=new is(mr.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}},qb=class{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,r="read"){return this.source.next({cmd:r,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||St)}return(t){return Object.create(this.source.return&&this.source.return(t)||St)}},is=class{constructor(t){this.source=t,this._closedPromise=new Promise(r=>this._closedPromiseResolve=r)}cancel(t){return H(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return H(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return H(this,arguments,void 0,function*(r,n="read"){return yield this.source.next({cmd:n,size:r})})}throw(t){return H(this,void 0,void 0,function*(){let r=this.source.throw&&(yield this.source.throw(t))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}return(t){return H(this,void 0,void 0,function*(){let r=this.source.return&&(yield this.source.return(t))||St;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var Sh,ba,Vb=p(()=>{Ar();vo();dr();Sh=class extends _i{constructor(t,r){super(),this.position=0,this.buffer=se(t),this.size=r===void 0?this.buffer.byteLength:r}readInt32(t){let{buffer:r,byteOffset:n}=this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:r,size:n,position:i}=this;return r&&i<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),r.subarray(i,this.position)):null}readAt(t,r){let n=this.buffer,i=Math.min(this.size,t+r);return n?n.subarray(t,i):new Uint8Array(r)}close(){this.buffer&&(this.buffer=null)}throw(t){return this.close(),{done:!0,value:t}}return(t){return this.close(),{done:!0,value:t}}},ba=class extends $r{constructor(t,r){super(),this.position=0,this._handle=t,typeof r=="number"?this.size=r:this._pending=H(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return H(this,void 0,void 0,function*(){let{buffer:r,byteOffset:n}=yield this.readAt(t,4);return new DataView(r,n).getInt32(0,!0)})}seek(t){return H(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(t,this.size),t<this.size})}read(t){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:r,size:n,position:i}=this;if(r&&i<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let o=i,s=0,a=0,c=Math.min(n,o+Math.min(n-o,t)),l=new Uint8Array(Math.max(0,(this.position=c)-o));for(;(o+=a)<c&&(s+=a)<l.byteLength;)({bytesRead:a}=yield r.read(l,s,l.byteLength-s,o));return l}return null})}readAt(t,r){return H(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&t+r<i){let o=Math.min(i,t+r),s=new Uint8Array(o-t);return(yield n.read(s,0,r,t)).buffer}return new Uint8Array(r)})}close(){return H(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}});var Hb={};Qt(Hb,{BaseInt64:()=>Mh,Int128:()=>vh,Int64:()=>os,Uint64:()=>Ft});function Eu(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var Tu,Wb,Mh,Ft,os,vh,$b=p(()=>{Tu=8,Wb=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Mh=class{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){let r=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=r[3]*n[3];this.buffer[0]=i&65535;let o=i>>>16;return i=r[2]*n[3],o+=i,i=r[3]*n[2]>>>0,o+=i,this.buffer[0]+=o<<16,this.buffer[1]=o>>>0<i?65536:0,this.buffer[1]+=o>>>16,this.buffer[1]+=r[1]*n[3]+r[2]*n[2]+r[3]*n[1],this.buffer[1]+=r[0]*n[3]+r[1]*n[2]+r[2]*n[1]+r[3]*n[0]<<16,this}_plus(t){let r=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],r<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=r}lessThan(t){return this.buffer[1]<t.buffer[1]||this.buffer[1]===t.buffer[1]&&this.buffer[0]<t.buffer[0]}equals(t){return this.buffer[1]===t.buffer[1]&&this.buffer[0]==t.buffer[0]}greaterThan(t){return t.lessThan(this)}hex(){return`${Eu(this.buffer[1])} ${Eu(this.buffer[0])}`}},Ft=class e extends Mh{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.length,i=new e(r);for(let o=0;o<n;){let s=Tu<n-o?Tu:n-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([Wb[s],0]));i.times(c),i.plus(a),o+=s}return i}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},os=class e extends Mh{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(t){return this._times(t),this}plus(t){return this._plus(t),this}lessThan(t){let r=this.buffer[1]<<0,n=t.buffer[1]<<0;return r<n||r===n&&this.buffer[0]<t.buffer[0]}static from(t,r=new Uint32Array(2)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(2)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(2)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=Tu<i-s?Tu:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([Wb[a],0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+2*n*4,2));return r}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}},vh=class e{constructor(t){this.buffer=t}high(){return new os(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new os(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(t){let r=new Ft(new Uint32Array([this.buffer[3],0])),n=new Ft(new Uint32Array([this.buffer[2],0])),i=new Ft(new Uint32Array([this.buffer[1],0])),o=new Ft(new Uint32Array([this.buffer[0],0])),s=new Ft(new Uint32Array([t.buffer[3],0])),a=new Ft(new Uint32Array([t.buffer[2],0])),c=new Ft(new Uint32Array([t.buffer[1],0])),l=new Ft(new Uint32Array([t.buffer[0],0])),u=Ft.multiply(o,l);this.buffer[0]=u.low();let h=new Ft(new Uint32Array([u.high(),0]));return u=Ft.multiply(i,l),h.plus(u),u=Ft.multiply(o,c),h.plus(u),this.buffer[1]=h.low(),this.buffer[3]=h.lessThan(u)?1:0,this.buffer[2]=h.high(),new Ft(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Ft.multiply(n,l)).plus(Ft.multiply(i,c)).plus(Ft.multiply(o,a)),this.buffer[3]+=Ft.multiply(r,l).plus(Ft.multiply(n,c)).plus(Ft.multiply(i,a)).plus(Ft.multiply(o,s)).low(),this}plus(t){let r=new Uint32Array(4);return r[3]=this.buffer[3]+t.buffer[3]>>>0,r[2]=this.buffer[2]+t.buffer[2]>>>0,r[1]=this.buffer[1]+t.buffer[1]>>>0,r[0]=this.buffer[0]+t.buffer[0]>>>0,r[0]<this.buffer[0]>>>0&&++r[1],r[1]<this.buffer[1]>>>0&&++r[2],r[2]<this.buffer[2]>>>0&&++r[3],this.buffer[3]=r[3],this.buffer[2]=r[2],this.buffer[1]=r[1],this.buffer[0]=r[0],this}hex(){return`${Eu(this.buffer[3])} ${Eu(this.buffer[2])} ${Eu(this.buffer[1])} ${Eu(this.buffer[0])}`}static multiply(t,r){return new e(new Uint32Array(t.buffer)).times(r)}static add(t,r){return new e(new Uint32Array(t.buffer)).plus(r)}static from(t,r=new Uint32Array(4)){return e.fromString(typeof t=="string"?t:t.toString(),r)}static fromNumber(t,r=new Uint32Array(4)){return e.fromString(t.toString(),r)}static fromString(t,r=new Uint32Array(4)){let n=t.startsWith("-"),i=t.length,o=new e(r);for(let s=n?1:0;s<i;){let a=Tu<i-s?Tu:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([Wb[a],0,0,0]));o.times(l),o.plus(c),s+=a}return n?o.negate():o}static convertArray(t){let r=new Uint32Array(t.length*4);for(let n=-1,i=t.length;++n<i;)e.from(t[n],new Uint32Array(r.buffer,r.byteOffset+16*n,4));return r}}});var Jb={};Qt(Jb,{toIntervalDayTimeInt32Array:()=>Kb,toIntervalDayTimeObjects:()=>Yb,toIntervalMonthDayNanoInt32Array:()=>Xb,toIntervalMonthDayNanoObjects:()=>Zb});function Kb(e){var t,r;let n=e.length,i=new Int32Array(n*2);for(let o=0,s=0;o<n;o++){let a=e[o];i[s++]=(t=a.days)!==null&&t!==void 0?t:0,i[s++]=(r=a.milliseconds)!==null&&r!==void 0?r:0}return i}function Xb(e){var t,r;let n=e.length,i=new Int32Array(n*4);for(let o=0,s=0;o<n;o++){let a=e[o];i[s++]=(t=a.months)!==null&&t!==void 0?t:0,i[s++]=(r=a.days)!==null&&r!==void 0?r:0;let c=a.nanoseconds;if(c){let l=BigInt(c);i[s++]=Number(l&BigInt(4294967295))>>>0,i[s++]=Number(l>>BigInt(32))>>>0}else s+=2}return i}function Yb(e){let t=e.length,r=new Array(t/2);for(let n=0,i=0;n<t;n+=2)r[i++]={days:e[n],milliseconds:e[n+1]};return r}function Zb(e,t){let r=e.length,n=new Array(r/4);for(let i=0,o=0;i<r;i+=4){let s=BigInt(e[i+3])<<BigInt(32)|BigInt(e[i+2]>>>0);n[o++]={months:e[i],days:e[i+1],nanoseconds:t?`${s}`:s}}return n}var o0=p(()=>{});function D5(e){let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)t[r>>1]=Number.parseInt(e.slice(r,r+2),16);return t}function o$(e){return D5(e.join(""))}function N5(e,t){let r=new Uint8Array(e.length*16),n=new DataView(r.buffer);for(let[i,o]of e.entries()){let s=i*16,a=o.SIZE;if(n.setInt32(s,a,!0),o.INLINED!==void 0){let c=t(o.INLINED);for(let l=0;l<c.length&&l<12;l++)r[s+4+l]=c[l]}else{let c=o.PREFIX_HEX;for(let l=0;l<8&&l<c.length;l+=2)r[s+4+(l>>1)]=Number.parseInt(c.slice(l,l+2),16);n.setInt32(s+8,o.BUFFER_INDEX,!0),n.setInt32(s+12,o.OFFSET,!0)}}return r}function s$(e){return N5(e,t=>{let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n>>1]=Number.parseInt(t.slice(n,n+2),16);return r})}function a$(e){return N5(e,t=>new TextEncoder().encode(t))}var Au,s0,a0,F5=p(()=>{wi();Vr();at();Pn();vc();Ko();$b();Nt();dr();o0();Au=class extends ie{constructor(t,r,n,i,o=ot.V5,s=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=t,this.nodes=r,this.buffers=n,this.dictionaries=i,this.metadataVersion=o,this.variadicBufferCounts=s}visit(t){return super.visit(t instanceof ee?t.type:t)}visitNull(t,{length:r}=this.nextFieldNode()){return te({type:t,length:r})}visitBool(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitUtf8View(t,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(t,n),o=this.readData(t),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:t,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinaryView(t,{length:r,nullCount:n}=this.nextFieldNode()){let i=this.readNullBitmap(t,n),o=this.readData(t),s=this.readVariadicBuffers(this.nextVariadicBufferCount());return te({type:t,length:r,nullCount:n,nullBitmap:i,views:o,variadicBuffers:s})}visitFixedSizeBinary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitLargeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<ot.V5&&this.readNullBitmap(t,n),t.mode===Ze.Sparse?this.visitSparseUnion(t,{length:r,nullCount:n}):this.visitDenseUnion(t,{length:r,nullCount:n})}visitDenseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:r,nullCount:n}=this.nextFieldNode()){return te({type:t,length:r,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,r,n=this.nextBufferRange()){return r>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,r){return this.readData(t,r)}readTypeIds(t,r){return this.readData(t,r)}readData(t,{length:r,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+r)}readVariadicBuffers(t){return Array.from({length:t},()=>this.readData(null))}nextVariadicBufferCount(){var t;return(t=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&t!==void 0?t:0}readDictionary(t){return this.dictionaries.get(t.id)}},s0=class extends Au{constructor(t,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.sources=t}readNullBitmap(t,r,{offset:n}=this.nextBufferRange()){return r<=0?new Uint8Array(0):Mc(this.sources[n])}readOffsets(t,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(t.OffsetArrayType,this.sources[r]))}readTypeIds(t,{offset:r}=this.nextBufferRange()){return Re(Uint8Array,Re(t.ArrayType,this.sources[r]))}readData(t,{offset:r}=this.nextBufferRange()){let{sources:n}=this;if(U.isTimestamp(t))return Re(Uint8Array,os.convertArray(n[r]));if((U.isInt(t)||U.isTime(t))&&t.bitWidth===64||U.isDuration(t))return Re(Uint8Array,os.convertArray(n[r]));if(U.isDate(t)&&t.unit===st.MILLISECOND)return Re(Uint8Array,os.convertArray(n[r]));if(U.isDecimal(t))return Re(Uint8Array,vh.convertArray(n[r]));if(U.isBinary(t)||U.isLargeBinary(t)||U.isFixedSizeBinary(t))return o$(n[r]);if(U.isBinaryView(t))return s$(n[r]);if(U.isUtf8View(t))return a$(n[r]);if(U.isBool(t))return Mc(n[r]);if(U.isUtf8(t)||U.isLargeUtf8(t))return qn(n[r].join(""));if(U.isInterval(t))switch(t.unit){case Ge.DAY_TIME:return Kb(n[r]);case Ge.MONTH_DAY_NANO:return Xb(n[r]);default:break}return Re(Uint8Array,Re(t.ArrayType,n[r].map(i=>+i)))}readVariadicBuffers(t){let r=[];for(let n=0;n<t;n++){let{offset:i}=this.nextBufferRange(),o=this.sources[i];r.push(D5(o))}return r}};a0=class extends Au{constructor(t,r,n,i,o,s=[]){super(new Uint8Array(0),r,n,i,o,s),this.bodyChunks=t}readData(t,r=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var ss,c0=p(()=>{Wi();bt();dr();ss=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,se(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,0);else{let c=a.length;i.set(a,o),n.set(s,c),o+=c}}}});var as,l0=p(()=>{dr();Wi();bt();as=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,se(r))}_flushPending(t,r){let n=this._offsets,i=this._values.reserve(r).buffer,o=0;for(let[s,a]of t)if(a===void 0)n.set(s,BigInt(0));else{let c=a.length;i.set(a,o),n.set(s,BigInt(c)),o+=c}}}});var Pc,Qb=p(()=>{Wi();bt();Pc=class extends ct{constructor(t){super(t),this._values=new vu}setValue(t,r){this._values.set(t,+r)}}});var Eo,wa,xa,ew=p(()=>{bt();ri();Eo=class extends or{};Eo.prototype._setValue=xb;wa=class extends Eo{};wa.prototype._setValue=Sp;xa=class extends Eo{};xa.prototype._setValue=Mp});var _a,tw=p(()=>{bt();ri();_a=class extends or{};_a.prototype._setValue=Mb});var Rc,rw=p(()=>{at();bt();Iu();Rc=class extends ct{constructor({type:t,nullValues:r,dictionaryHashFunction:n}){super({type:new nr(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=oi({type:this.type.indices,nullValues:r}),this.dictionary=oi({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,r){let n=this.indices;return r=n.setValid(t,r),this.length=n.length,r}setValue(t,r){let n=this._keysToIndices,i=this.valueToKey(r),o=n[i];return o===void 0&&(n[i]=o=this._dictionaryOffset+this.dictionary.append(r).length-1),this.indices.setValue(t,o)}flush(){let t=this.type,r=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=r?r.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}});var Sa,nw=p(()=>{bt();ri();Sa=class extends or{};Sa.prototype._setValue=wb});var Lc,iw=p(()=>{Vr();bt();at();Lc=class extends ct{setValue(t,r){let[n]=this.children,i=t*this.stride;for(let o=-1,s=this.stride;++o<s;)n.set(i+o,r[o])}setValid(t,r){return super.setValid(t,r)||this.children[0].setValid((t+1)*this.stride-1,!1),r}addChild(t,r="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(t);return this.type=new $t(this.type.listSize,new ee(r,t.type,!0)),n}}});var To,Oc,Cc,Bc,ow=p(()=>{mh();bt();To=class extends or{setValue(t,r){this._values.set(t,r)}},Oc=class extends To{setValue(t,r){super.setValue(t,dh(r))}},Cc=class extends To{},Bc=class extends To{}});var $i,Ma,va,Ea,sw=p(()=>{bt();ri();$i=class extends or{};$i.prototype._setValue=vb;Ma=class extends $i{};Ma.prototype._setValue=Op;va=class extends $i{};va.prototype._setValue=Cp;Ea=class extends $i{};Ea.prototype._setValue=Bp});var Si,Ta,Aa,Ia,Pa,aw=p(()=>{bt();ri();Si=class extends or{};Si.prototype._setValue=Eb;Ta=class extends Si{};Ta.prototype._setValue=Dp;Aa=class extends Si{};Aa.prototype._setValue=Np;Ia=class extends Si{};Ia.prototype._setValue=Fp;Pa=class extends Si{};Pa.prototype._setValue=kp});var ln,Dc,Nc,Fc,kc,Gc,Uc,jc,zc,cw=p(()=>{bt();ln=class extends or{setValue(t,r){this._values.set(t,r)}},Dc=class extends ln{},Nc=class extends ln{},Fc=class extends ln{},kc=class extends ln{},Gc=class extends ln{},Uc=class extends ln{},jc=class extends ln{},zc=class extends ln{}});var qc,lw=p(()=>{Vr();at();Wi();bt();qc=class extends qr{constructor(t){super(t),this._offsets=new ga(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new rr(new ee(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,0);else{let s=o,a=s.length,c=r.set(i,a).buffer[i];for(let l=-1;++l<a;)n.set(c+l,s[l])}}}});var Vc,uw=p(()=>{Vr();at();Wi();wo();bt();Vc=class extends qr{constructor(t){super(t),this._offsets=new ga(t.type)}addChild(t,r="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new ei(new ee(r,t.type,!0)),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(typeof o>"u")r.set(i,BigInt(0));else{let s=o,a=s.length,c=Le(r.set(i,BigInt(a)).buffer[i]);for(let l=-1;++l<a;)n.set(c+l,s[l])}}}});var Wc,fw=p(()=>{Vr();at();bt();Wc=class extends qr{set(t,r){return super.set(t,r)}setValue(t,r){let n=r instanceof Map?r:new Map(Object.entries(r)),i=this._pending||(this._pending=new Map),o=i.get(t);o&&(this._pendingLength-=o.size),this._pendingLength+=n.size,i.set(t,n)}addChild(t,r=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new jr(new ee(r,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let r=this._offsets,[n]=this.children;for(let[i,o]of t)if(o===void 0)r.set(i,0);else{let{[i]:s,[i+1]:a}=r.set(i,o.size).buffer;for(let c of o.entries())if(n.set(s,c),++s>=a)break}}}});var Hc,hw=p(()=>{bt();Hc=class extends ct{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}}});var $c,dw=p(()=>{Vr();bt();at();$c=class extends ct{setValue(t,r){let{children:n,type:i}=this;switch(Array.isArray(r)||r.constructor){case!0:return i.children.forEach((o,s)=>n[s].set(t,r[s]));case Map:return i.children.forEach((o,s)=>n[s].set(t,r.get(o.name)));default:return i.children.forEach((o,s)=>n[s].set(t,r[o.name]))}}setValid(t,r){return super.setValid(t,r)||this.children.forEach(n=>n.setValid(t,r)),r}addChild(t,r=`${this.numChildren}`){let n=this.children.push(t);return this.type=new Je([...this.type.children,new ee(r,t.type,!0)]),n}}});var Mi,Ra,La,Oa,Ca,mw=p(()=>{bt();ri();Mi=class extends or{};Mi.prototype._setValue=_b;Ra=class extends Mi{};Ra.prototype._setValue=vp;La=class extends Mi{};La.prototype._setValue=Ep;Oa=class extends Mi{};Oa.prototype._setValue=Tp;Ca=class extends Mi{};Ca.prototype._setValue=Ap});var vi,Ba,Da,Na,Fa,pw=p(()=>{bt();ri();vi=class extends or{};vi.prototype._setValue=Sb;Ba=class extends vi{};Ba.prototype._setValue=Ip;Da=class extends vi{};Da.prototype._setValue=Pp;Na=class extends vi{};Na.prototype._setValue=Rp;Fa=class extends vi{};Fa.prototype._setValue=Lp});var cs,Kc,Xc,gw=p(()=>{Vr();Wi();bt();at();cs=class extends ct{constructor(t){super(t),this._typeIds=new rs(Int8Array,0,1),typeof t.valueToChildTypeId=="function"&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,r){return this.set(this.length,t,r)}set(t,r,n){return n===void 0&&(n=this._valueToChildTypeId(this,r,t)),this.setValue(t,r,n),this}setValue(t,r,n){this._typeIds.set(t,n);let i=this.type.typeIdToChildIndex[n],o=this.children[i];o==null||o.set(t,r),this.length=Math.max(t+1,this.length)}addChild(t,r=`${this.children.length}`){let n=this.children.push(t),{type:{children:i,mode:o,typeIds:s}}=this,a=[...i,new ee(r,t.type)];return this.type=new cn(o,[...s,n],a),n}_valueToChildTypeId(t,r,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},Kc=class extends cs{},Xc=class extends cs{constructor(t){super(t),this._offsets=new rs(Int32Array)}setValue(t,r,n){let i=this._typeIds.set(t,n).buffer[t],o=this.getChildAt(this.type.typeIdToChildIndex[i]),s=this._offsets.set(t,o.length).buffer[t];o==null||o.set(s,r),this.length=Math.max(t+1,this.length)}}});var ka,yw=p(()=>{Ko();c0();Wi();bt();ka=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,qn(r))}_flushPending(t,r){}};ka.prototype._flushPending=ss.prototype._flushPending});var Ga,bw=p(()=>{Ko();Wi();bt();l0();Ga=class extends qr{constructor(t){super(t),this._values=new Rn(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,r){return super.setValue(t,qn(r))}_flushPending(t,r){}};Ga.prototype._flushPending=as.prototype._flushPending});var ls,u0=p(()=>{at();bt();Wi();dr();wi();ls=class extends ct{constructor(t){super(t),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Rn(Uint8Array)}get byteLength(){let t=0;this._views&&(t+=this._views.byteLength),this._nulls&&(t+=this._nulls.byteLength);for(let r of this._variadicBuffers)t+=r.byteLength;return this._currentBuffer&&(t+=this._currentBuffer.byteLength),t}setValue(t,r){return this.writeBinaryValue(t,this.encodeValue(r))}writeBinaryValue(t,r){let n=r.length,i=(t+1)*Ee.ELEMENT_WIDTH,o=this._views.length;i>o&&this._views.reserve(i-o);let s=this._views.buffer,a=t*Ee.ELEMENT_WIDTH,c=new DataView(s.buffer,s.byteOffset+a,Ee.ELEMENT_WIDTH);if(c.setInt32(Ee.LENGTH_OFFSET,n,!0),n<=Ee.INLINE_CAPACITY){s.set(r,a+Ee.INLINE_OFFSET);for(let l=n;l<Ee.INLINE_CAPACITY;l++)s[a+Ee.INLINE_OFFSET+l]=0}else{let l=new DataView(r.buffer,r.byteOffset,Math.min(4,n));c.setUint32(Ee.INLINE_OFFSET,l.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+n>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new Rn(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(r,this._currentBufferOffset),c.setInt32(Ee.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(Ee.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(t){return se(t)}setValid(t,r){let n=(t+1)*Ee.ELEMENT_WIDTH,i=this._views.length;n>i&&this._views.reserve(n-i);let o=super.setValid(t,r);if(!o){let s=this._views.buffer,a=t*Ee.ELEMENT_WIDTH;for(let c=0;c<Ee.ELEMENT_WIDTH;c++)s[a+c]=0}return o}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:t,length:r,nullCount:n,_views:i,_nulls:o}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let s=i.flush(r*Ee.ELEMENT_WIDTH),a=n>0?o.flush(r):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),te({type:t,length:r,nullCount:n,nullBitmap:a,views:s,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var Yc,ww=p(()=>{u0();Ko();Yc=class extends ls{constructor(t){super(t)}setValue(t,r){return this.writeBinaryValue(t,qn(r))}}});var xw,k5,G5=p(()=>{Pn();c0();l0();Qb();ew();tw();rw();nw();iw();ow();sw();aw();cw();lw();uw();fw();hw();dw();mw();pw();gw();yw();bw();u0();ww();xw=class extends ie{visitNull(){return Hc}visitBool(){return Pc}visitInt(){return ln}visitInt8(){return Dc}visitInt16(){return Nc}visitInt32(){return Fc}visitInt64(){return kc}visitUint8(){return Gc}visitUint16(){return Uc}visitUint32(){return jc}visitUint64(){return zc}visitFloat(){return To}visitFloat16(){return Oc}visitFloat32(){return Cc}visitFloat64(){return Bc}visitUtf8(){return ka}visitLargeUtf8(){return Ga}visitBinary(){return ss}visitLargeBinary(){return as}visitFixedSizeBinary(){return Sa}visitDate(){return Eo}visitDateDay(){return wa}visitDateMillisecond(){return xa}visitTimestamp(){return Mi}visitTimestampSecond(){return Ra}visitTimestampMillisecond(){return La}visitTimestampMicrosecond(){return Oa}visitTimestampNanosecond(){return Ca}visitTime(){return vi}visitTimeSecond(){return Ba}visitTimeMillisecond(){return Da}visitTimeMicrosecond(){return Na}visitTimeNanosecond(){return Fa}visitDecimal(){return _a}visitList(){return qc}visitLargeList(){return Vc}visitStruct(){return $c}visitUnion(){return cs}visitDenseUnion(){return Xc}visitSparseUnion(){return Kc}visitDictionary(){return Rc}visitInterval(){return $i}visitIntervalDayTime(){return Ma}visitIntervalYearMonth(){return va}visitIntervalMonthDayNano(){return Ea}visitDuration(){return Si}visitDurationSecond(){return Ta}visitDurationMillisecond(){return Aa}visitDurationMicrosecond(){return Ia}visitDurationNanosecond(){return Pa}visitFixedSizeList(){return Lc}visitMap(){return Wc}visitBinaryView(){return ls}visitUtf8View(){return Yc}},k5=new xw});function un(e,t){return t instanceof e.constructor}function us(e,t){return e===t||un(e,t)}function fs(e,t){return e===t||un(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function f0(e,t){return e===t||un(e,t)&&e.precision===t.precision}function c$(e,t){return e===t||un(e,t)&&e.byteWidth===t.byteWidth}function _w(e,t){return e===t||un(e,t)&&e.unit===t.unit}function Eh(e,t){return e===t||un(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Th(e,t){return e===t||un(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function U5(e,t){return e===t||un(e,t)&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function l$(e,t){return e===t||un(e,t)&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function Sw(e,t){return e===t||un(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&Ao.compareManyFields(e.children,t.children)}function u$(e,t){return e===t||un(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Ao.visit(e.indices,t.indices)&&Ao.visit(e.dictionary,t.dictionary)}function h0(e,t){return e===t||un(e,t)&&e.unit===t.unit}function Ah(e,t){return e===t||un(e,t)&&e.unit===t.unit}function f$(e,t){return e===t||un(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function h$(e,t){return e===t||un(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Ao.compareManyFields(e.children,t.children)}function Zc(e,t){return Ao.compareSchemas(e,t)}function j5(e,t){return Ao.compareFields(e,t)}function d0(e,t){return Ao.visit(e,t)}var fe,Ao,Ih=p(()=>{Pn();fe=class extends ie{compareSchemas(t,r){return t===r||r instanceof t.constructor&&this.compareManyFields(t.fields,r.fields)}compareManyFields(t,r){return t===r||Array.isArray(t)&&Array.isArray(r)&&t.length===r.length&&t.every((n,i)=>this.compareFields(n,r[i]))}compareFields(t,r){return t===r||r instanceof t.constructor&&t.name===r.name&&t.nullable===r.nullable&&this.visit(t.type,r.type)}};fe.prototype.visitNull=us;fe.prototype.visitBool=us;fe.prototype.visitInt=fs;fe.prototype.visitInt8=fs;fe.prototype.visitInt16=fs;fe.prototype.visitInt32=fs;fe.prototype.visitInt64=fs;fe.prototype.visitUint8=fs;fe.prototype.visitUint16=fs;fe.prototype.visitUint32=fs;fe.prototype.visitUint64=fs;fe.prototype.visitFloat=f0;fe.prototype.visitFloat16=f0;fe.prototype.visitFloat32=f0;fe.prototype.visitFloat64=f0;fe.prototype.visitUtf8=us;fe.prototype.visitLargeUtf8=us;fe.prototype.visitUtf8View=us;fe.prototype.visitBinary=us;fe.prototype.visitLargeBinary=us;fe.prototype.visitBinaryView=us;fe.prototype.visitFixedSizeBinary=c$;fe.prototype.visitDate=_w;fe.prototype.visitDateDay=_w;fe.prototype.visitDateMillisecond=_w;fe.prototype.visitTimestamp=Eh;fe.prototype.visitTimestampSecond=Eh;fe.prototype.visitTimestampMillisecond=Eh;fe.prototype.visitTimestampMicrosecond=Eh;fe.prototype.visitTimestampNanosecond=Eh;fe.prototype.visitTime=Th;fe.prototype.visitTimeSecond=Th;fe.prototype.visitTimeMillisecond=Th;fe.prototype.visitTimeMicrosecond=Th;fe.prototype.visitTimeNanosecond=Th;fe.prototype.visitDecimal=us;fe.prototype.visitList=U5;fe.prototype.visitLargeList=U5;fe.prototype.visitStruct=l$;fe.prototype.visitUnion=Sw;fe.prototype.visitDenseUnion=Sw;fe.prototype.visitSparseUnion=Sw;fe.prototype.visitDictionary=u$;fe.prototype.visitInterval=h0;fe.prototype.visitIntervalDayTime=h0;fe.prototype.visitIntervalYearMonth=h0;fe.prototype.visitIntervalMonthDayNano=h0;fe.prototype.visitDuration=Ah;fe.prototype.visitDurationSecond=Ah;fe.prototype.visitDurationMillisecond=Ah;fe.prototype.visitDurationMicrosecond=Ah;fe.prototype.visitDurationNanosecond=Ah;fe.prototype.visitFixedSizeList=f$;fe.prototype.visitMap=h$;Ao=new fe});function oi(e){let t=e.type,r=new(k5.getVisitFn(t)())(e);if(t.children&&t.children.length>0){let n=e.children||[],i={nullValues:e.nullValues},o=Array.isArray(n)?((s,a)=>n[a]||i):(({name:s})=>n[s]||i);for(let[s,a]of t.children.entries()){let{type:c}=a,l=o(a,s);r.children.push(oi(Object.assign(Object.assign({},l),{type:c})))}}return r}function Pu(e,t){if(e instanceof de||e instanceof $||e.type instanceof U||ArrayBuffer.isView(e))return Mo(e);let r={type:t??m0(e),nullValues:[null]},n=[...p0(r)(e)],i=n.length===1?n[0]:n.reduce((o,s)=>o.concat(s));return U.isDictionary(i.type)?i.memoize():i}function Mw(e){let t=Pu(e),r=new $e(new ve(t.type.children),t.data[0]);return new rt(r)}function m0(e){if(e.length===0)return new Ht;let t=0,r=0,n=0,i=0,o=0,s=0,a=0,c=0;for(let l of e){if(l==null){++t;continue}switch(typeof l){case"bigint":++s;continue;case"boolean":++a;continue;case"number":++i;continue;case"string":++o;continue;case"object":Array.isArray(l)?++r:Object.prototype.toString.call(l)==="[object Date]"?++c:++n;continue}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}if(i+t===e.length)return new Qn;if(o+t===e.length)return new nr(new kr,new Zt);if(s+t===e.length)return new Yn;if(a+t===e.length)return new Gr;if(c+t===e.length)return new xo;if(r+t===e.length){let l=e,u=m0(l[l.findIndex(h=>h!=null)]);if(l.every(h=>h==null||d0(u,m0(h))))return new rr(new ee("",u,!0))}else if(n+t===e.length){let l=new Map;for(let u of e)for(let h of Object.keys(u))!l.has(h)&&u[h]!=null&&l.set(h,new ee(h,m0([u[h]]),!0));return new Je([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function p0(e){let{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=e,n=t!=="bytes"?"length":"byteLength";return function*(i){let o=0,s=oi(e);for(let a of i)s.append(a)[n]>=r&&++o&&(yield s.toVector());(s.finish().length>0||o===0)&&(yield s.toVector())}}function vw(e){let{["queueingStrategy"]:t="count"}=e,{["highWaterMark"]:r=t!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=e,n=t!=="bytes"?"length":"byteLength";return function(i){return en(this,arguments,function*(){var o,s,a,c;let l=0,u=oi(e);try{for(var h=!0,d=zn(i),m;m=yield Me(d.next()),o=m.done,!o;h=!0){c=m.value,h=!1;let g=c;u.append(g)[n]>=r&&++l&&(yield yield Me(u.toVector()))}}catch(g){s={error:g}}finally{try{!h&&!o&&(a=d.return)&&(yield Me(a.call(d)))}finally{if(s)throw s.error}}(u.finish().length>0||l===0)&&(yield yield Me(u.toVector()))})}}var Iu=p(()=>{Ar();Vr();at();wi();zr();G5();Jc();hs();Ih()});function g0(e,t){return d$(e,t.map(r=>r.data.concat()))}function d$(e,t){let r=[...e.fields],n=[],i={numBatches:t.reduce((h,d)=>Math.max(h,d.length),0)},o=0,s=0,a=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(s=Number.POSITIVE_INFINITY,a=-1;++a<c;)u[a]=l=t[a].shift(),s=Math.min(s,l?l.length:s);Number.isFinite(s)&&(u=m$(r,s,u,t,i),s>0&&(n[o++]=te({type:new Je(r),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(r),n.map(h=>new $e(e,h))]}function m$(e,t,r,n,i){var o;let s=(t+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let l=r[a],u=l==null?void 0:l.length;if(u>=t)u===t?r[a]=l:(r[a]=l.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(l.slice(t,u-t))));else{let h=e[a];e[a]=h.clone({nullable:!0}),r[a]=(o=l==null?void 0:l._changeLengthAndBackfillNullBitmap(t))!==null&&o!==void 0?o:te({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(s)})}}return r}var z5=p(()=>{wi();at();hs()});function Ew(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=Mo(i);return new rt(t)}function Tw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=Pu(i);return new rt(t)}var q5,V5,rt,Jc=p(()=>{Nt();wi();Iu();zr();Vr();at();Ih();z5();Kp();xc();ri();Xp();Yp();xu();hs();V5=Symbol.for("apache-arrow/Table"),rt=class e{static isTable(t){return(t==null?void 0:t[V5])===!0}constructor(...t){var r,n;if(t.length===0)return this.batches=[],this.schema=new ve([]),this._offsets=[0],this;let i,o;t[0]instanceof ve&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(o=t.pop());let s=c=>{if(c){if(c instanceof $e)return[c];if(c instanceof e)return c.batches;if(c instanceof de){if(c.type instanceof Je)return[new $e(new ve(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(l=>s(l));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(l=>s(l));if(typeof c=="object"){let l=Object.keys(c),u=l.map(m=>new $([c[m]])),h=i??new ve(l.map((m,g)=>new ee(String(m),u[g].type,u[g].nullable))),[,d]=g0(h,u);return d.length===0?[new $e(c)]:d}}}return[]},a=t.flatMap(c=>s(c));if(i=(n=i??((r=a[0])===null||r===void 0?void 0:r.schema))!==null&&n!==void 0?n:new ve([]),!(i instanceof ve))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof $e))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Zc(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??Vp(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,r)=>t+r.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=qp(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(_c(t,this.numRows))}set(t,r){}indexOf(t,r){return-1}[Symbol.iterator](){return this.batches.length>0?Mu.visit(new $(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
11
11
  ${this.toArray().join(`,
12
12
  `)}
13
- ]`}concat(...t){let r=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new e(r,n.map(i=>new $e(r,i)))}slice(t,r){let n=this.schema;[t,r]=ph({length:this.numRows},t,r);let i=Up(this.data,this._offsets,t,r);return new e(n,i.map(o=>new $e(n,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let r=this.data.map(n=>n.children[t]);if(r.length===0){let{type:n}=this.schema.fields[t],i=te({type:n,length:0,nullCount:0});r.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new $(r)}return null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){r||(r=new $([te({type:new Wt,length:this.numRows})]));let o=n.fields.slice(),s=o[t].clone({type:r.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,r],[n,i]=f0(n,a)}return new e(n,i)}select(t){let r=this.schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(t){let r=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new e(r,n)}assign(t){let r=this.schema.fields,[n,i]=t.schema.fields.reduce((a,c,l)=>{let[u,h]=a,d=r.findIndex(m=>m.name===c.name);return~d?h[d]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...r.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...f0(o,s))}};D5=Symbol.toStringTag;ot[D5]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[N5]=!0,e.isValid=xu(bh),e.get=xu(ir.getVisitFn(x.Struct)),e.set=jp(Lr.getVisitFn(x.Struct)),e.indexOf=zp(Mc.getVisitFn(x.Struct)),"Table"))(ot.prototype);Object.defineProperty(ot,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ot&&ot.isTable(t)}})});function F5(e,t,r=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...e.fields],o=[...t],s=(r+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==r)&&(i[a]=c.clone({nullable:!0}),o[a]=(n=l==null?void 0:l._changeLengthAndBackfillNullBitmap(r))!==null&&n!==void 0?n:te({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),te({type:new tt(i),length:r,children:o})]}function U5(e,t,r=new Map){var n,i;if(((n=e==null?void 0:e.length)!==null&&n!==void 0?n:0)>0&&(e==null?void 0:e.length)===(t==null?void 0:t.length))for(let o=-1,s=e.length;++o<s;){let{type:a}=e[o],c=t[o];for(let l of[c,...((i=c==null?void 0:c.dictionary)===null||i===void 0?void 0:i.data)||[]])U5(a.children,l==null?void 0:l.children,r);if(z.isDictionary(a)){let{id:l}=a;if(!r.has(l))c!=null&&c.dictionary&&r.set(l,c.dictionary);else if(r.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var G5,k5,$e,Zc,ds=p(()=>{wi();Yc();zr();Vr();at();bu();bc();ri();Vp();Wp();k5=Symbol.for("apache-arrow/RecordBatch"),$e=class e{static isRecordBatch(t){return(t==null?void 0:t[k5])===!0}constructor(...t){switch(t.length){case 3:case 2:{if([this.schema]=t,!(this.schema instanceof ve))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=te({nullCount:0,type:new tt(this.schema.fields),children:this.schema.fields.map(r=>te({type:r.type,nullCount:0}))}),this._metadata=new Map]=t,!(this.data instanceof ce))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=F5(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=t,{fields:n,children:i,length:o}=Object.keys(r).reduce((c,l,u)=>(c.children[u]=r[l],c.length=Math.max(c.length,r[l].length),c.fields[u]=ee.new({name:l,type:r[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new ve(n),a=te({type:new tt(n),length:o,children:i,nullCount:0});[this.schema,this.data]=F5(s,a.children,o),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=U5(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return ir.visit(this.data,t)}at(t){return this.get(wc(t,this.numRows))}set(t,r){return Lr.visit(this.data,t,r)}indexOf(t,r){return Mc.visit(this.data,t,r)}[Symbol.iterator](){return _u.visit(new $([this.data]))}toArray(){return[...this]}concat(...t){return new ot(this.schema,[this,...t])}slice(t,r){let[n]=new $([this.data]).slice(t,r).data;return new e(this.schema,n,this._metadata)}getChild(t){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new $([this.data.children[t]]):null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=this.data;if(t>-1&&t<this.numCols){r||(r=new $([te({type:new Wt,length:this.numRows})]));let o=n.fields.slice(),s=i.children.slice(),a=o[t].clone({type:r.type});[o[t],s[t]]=[a,r.data[0]],n=new ve(o,new Map(this.schema.metadata)),i=te({type:new tt(o),length:i.length,children:s})}return new e(n,i,this._metadata)}select(t){let r=this.schema.select(t),n=new tt(r.fields),i=[];for(let o of t){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new e(r,te({type:n,length:this.numRows,children:i}),this._metadata)}selectAt(t){let r=this.schema.selectAt(t),n=t.map(o=>this.data.children[o]).filter(Boolean),i=te({type:new tt(r.fields),length:this.numRows,children:n});return new e(r,i,this._metadata)}};G5=Symbol.toStringTag;$e[G5]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[k5]=!0,"RecordBatch"))($e.prototype);Object.defineProperty($e,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$e&&$e.isRecordBatch(t)}});Zc=class extends $e{constructor(t,r){let n=t.fields.map(o=>te({type:o.type})),i=te({type:new tt(t.fields),length:0,nullCount:0,children:n});super(t,i,r||new Map)}}});function d0(e,t=0){for(let r=-1,n=Iu.length;++r<n;)if(Iu[r]!==e[t+r])return!1;return!0}var Ew,Tw,Aw,j5,z5,ka,Jc,Qc,h0,vw,Iu,Pu,Iw,q5,m0=p(()=>{Ar();Nt();Ew=me(ze(),1);ga();Yo();jb();dr();vo();xh();Tw=e=>`Expected ${Ge[e]} Message in stream, but was null or length 0.`,Aw=e=>`Header pointer of flatbuffer-encoded ${Ge[e]} Message is null or length 0.`,j5=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,z5=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,ka=class{constructor(t){this.source=t instanceof _i?t:new _i(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?St:t.value===-1&&(t=this.readMetadataLength()).done?St:(t=this.readMetadata(t.value)).done?St:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Tw(t));return r.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let r=se(this.source.read(t));if(r.byteLength<t)throw new Error(z5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(t=!1){let r=Ge.Schema,n=this.readMessage(r),i=n==null?void 0:n.header();if(t&&!i)throw new Error(Aw(r));return i}readMetadataLength(){let t=this.source.read(h0),r=t&&new Ew.ByteBuffer(t),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(t){let r=this.source.read(t);if(!r)return St;if(r.byteLength<t)throw new Error(j5(t,r.byteLength));return{done:!1,value:Hr.decode(r)}}},Jc=class{constructor(t,r){this.source=t instanceof $r?t:Qm(t)?new ya(t,r):new $r(t)}[Symbol.asyncIterator](){return this}next(){return H(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?St:t.value===-1&&(t=yield this.readMetadataLength()).done?St:(t=yield this.readMetadata(t.value)).done?St:t})}throw(t){return H(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return H(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return H(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Tw(t));return r.value})}readMessageBody(t){return H(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let r=se(yield this.source.read(t));if(r.byteLength<t)throw new Error(z5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return H(this,arguments,void 0,function*(t=!1){let r=Ge.Schema,n=yield this.readMessage(r),i=n==null?void 0:n.header();if(t&&!i)throw new Error(Aw(r));return i})}readMetadataLength(){return H(this,void 0,void 0,function*(){let t=yield this.source.read(h0),r=t&&new Ew.ByteBuffer(t),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(t){return H(this,void 0,void 0,function*(){let r=yield this.source.read(t);if(!r)return St;if(r.byteLength<t)throw new Error(j5(t,r.byteLength));return{done:!1,value:Hr.decode(r)}})}},Qc=class extends ka{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof wh?t:new wh(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Hr.fromJSON(t.schema,Ge.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let r=t.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:Hr.fromJSON(r,Ge.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let r=t.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:Hr.fromJSON(r,Ge.RecordBatch)}}return this._body=[],St}readMessageBody(t){return r(this._body);function r(n){return(n||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...o.VIEWS&&[o.VIEWS]||[],...o.VARIADIC_DATA_BUFFERS||[],...r(o.children)],[])}}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Tw(t));return r.value}readSchema(){let t=Ge.Schema,r=this.readMessage(t),n=r==null?void 0:r.header();if(!r||!n)throw new Error(Aw(t));return n}},h0=4,vw="ARROW1",Iu=new Uint8Array(vw.length);for(let e=0;e<vw.length;e+=1)Iu[e]=vw.codePointAt(e);Pu=Iu.length,Iw=Pu+h0,q5=Pu*2+h0});var Pw,Rw,V5,W5=p(()=>{ou();Pw=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(r);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)&&this._hasValidVersion(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.LZ4_FRAME_MAGIC.every((r,n)=>t[n]===r)}_hasValidVersion(t){return(t[4]&192)>>6===1}},Rw=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(r);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.ZSTD_MAGIC.every((r,n)=>t[n]===r)}},V5={[Ir.LZ4_FRAME]:new Pw,[Ir.ZSTD]:new Rw}});var Lw,Ua,p0=p(()=>{ou();W5();Lw=class{constructor(){this.registry={}}set(t,r){if(r!=null&&r.encode&&typeof r.encode=="function"&&!V5[t].isValidCodecEncode(r))throw new Error(`Encoder for ${Ir[t]} is not valid.`);this.registry[t]=r}get(t){var r;return((r=this.registry)===null||r===void 0?void 0:r[t])||null}},Ua=new Lw});function Y5(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*H5(e){let t=pr.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function $5(e){return en(this,arguments,function*(){let r=yield Me(pr.from(e));try{if(!(yield Me(r.open({autoDestroy:!1}))).closed)do yield yield Me(r);while(!(yield Me(r.reset().open())).closed)}finally{yield Me(r.cancel())}})}function YH(e){return new Ki(new Bw(e))}function ZH(e){let t=e.peek(Pu+7&-8);return t&&t.byteLength>=4?d0(t)?new ps(new y0(e.read())):new Ki(new Lu(e)):new Ki(new Lu((function*(){})()))}function JH(e){return H(this,void 0,void 0,function*(){let t=yield e.peek(Pu+7&-8);return t&&t.byteLength>=4?d0(t)?new ps(new y0(yield e.read())):new ms(new Ou(e)):new ms(new Ou((function(){return en(this,arguments,function*(){})})()))})}function QH(e){return H(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new ya(e,t);return t>=q5&&d0(yield r.readAt(0,Pu+7&-8))?new Ru(new Ow(r)):new ms(new Ou(r))})}var X5,pr,Ki,ms,ps,Ru,g0,Lu,Ou,y0,Ow,Bw,el=p(()=>{Ar();wi();zr();at();Nt();Fb();iu();ga();vo();jb();P5();ds();xh();m0();Yo();p0();wo();X5=me(ze(),1),pr=class e extends Tc{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let r=this._impl.open(t);return Vn(r)?r.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return mr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return mr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:Zm(t)?YH(t):Qm(t)?QH(t):Vn(t)?H(this,void 0,void 0,function*(){return yield e.from(yield t)}):ep(t)||qf(t)||rp(t)||Mn(t)?JH(new $r(t)):ZH(new _i(t))}static readAll(t){return t instanceof e?t.isSync()?H5(t):$5(t):Zm(t)||ArrayBuffer.isView(t)||Wn(t)||Jm(t)?H5(t):$5(t)}},Ki=class extends pr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return en(this,arguments,function*(){yield Me(yield*ru(zn(this[Symbol.iterator]())))})}},ms=class extends pr{constructor(t){super(t),this._impl=t}readAll(){return H(this,void 0,void 0,function*(){var t,r,n,i;let o=new Array;try{for(var s=!0,a=zn(this),c;c=yield a.next(),t=c.done,!t;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){r={error:l}}finally{try{!s&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},ps=class extends Ki{constructor(t){super(t),this._impl=t}},Ru=class extends ms{constructor(t){super(t),this._impl=t}},g0=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,r,n){let i;if(t.compression!=null){let s=Ua.get(t.compression.type);if(s!=null&&s.decode&&typeof s.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(t,r,s);i=this._loadCompressedVectors(t,a,this.schema.fields),t=new sr(t.length,t.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else i=this._loadVectors(t,r,this.schema.fields);let o=te({type:new tt(this.schema.fields),length:t.length,children:i});return new $e(this.schema,o,n)}_loadDictionaryBatch(t,r){let{id:n,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(n),c=s.dictionaries.get(n),l;if(t.data.compression!=null){let u=Ua.get(t.data.compression.type);if(u!=null&&u.decode&&typeof u.decode=="function"){let{decommpressedBody:h,buffers:d}=this._decompressBuffers(t.data,r,u);l=this._loadCompressedVectors(t.data,h,[c]),t=new Wr(new sr(t.data.length,t.data.nodes,d,null,t.data.variadicBufferCounts),n,i)}else throw new Error("Dictionary batch is compressed but codec not found")}else l=this._loadVectors(t.data,r,[c]);return(a&&i?a.concat(new $(l)):new $(l)).memoize()}_loadVectors(t,r,n){return new Eu(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(t,r,n){return new r0(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_decompressBuffers(t,r,n){let i=[],o=[],s=0;for(let{offset:a,length:c}of t.buffers){if(c===0){i.push(new Uint8Array(0)),o.push(new $t(s,0));continue}let l=new X5.ByteBuffer(r.subarray(a,a+c)),u=Le(l.readInt64(0)),h=l.bytes().subarray(8),d=u===-1?h:n.decode(h);i.push(d);let m=(s+7&-8)-s;s+=m,o.push(new $t(s,d.length)),s+=d.length}return{decommpressedBody:i,buffers:o}}},Lu=class extends g0{constructor(t,r){super(r),this._reader=Zm(t)?new Qc(this._handle=t):new ka(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=Y5(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):St}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):St}next(){if(this.closed)return St;let t,{_reader:r}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,t.metadata)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Zc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Ou=class extends g0{constructor(t,r){super(r),this._reader=new Jc(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return H(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return H(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Y5(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):St})}return(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):St})}next(){return H(this,void 0,void 0,function*(){if(this.closed)return St;let t,{_reader:r}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,t.metadata)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Zc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},y0=class extends Lu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,r){super(t instanceof _h?t:new _h(t),r)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(Ge.RecordBatch);if(i!=null&&i.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s,i.metadata)}}return null}_readDictionaryBatch(t){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(Ge.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}}_readFooter(){let{_handle:t}=this,r=t.size-Iw,n=t.readInt32(r),i=t.readAt(r-n,n);return is.decode(i)}_readNextMessageAndValidate(t){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}},Ow=class extends Ou{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(t instanceof ya?t:new ya(t,n),i)}isFile(){return!0}isAsync(){return!0}open(t){let r=Object.create(null,{open:{get:()=>super.open}});return H(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,t)})}readRecordBatch(t){return H(this,void 0,void 0,function*(){var r;if(this.closed)return null;this._footer||(yield this.open());let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(Ge.RecordBatch);if(i!=null&&i.isRecordBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s,i.metadata)}}return null})}_readDictionaryBatch(t){return H(this,void 0,void 0,function*(){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(Ge.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}})}_readFooter(){return H(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let r=t.size-Iw,n=yield t.readInt32(r),i=yield t.readAt(r-n,n);return is.decode(i)})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(t)}return null})}},Bw=class extends Lu{constructor(t,r){super(t,r)}_loadVectors(t,r,n){return new t0(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}}});function si(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new $t(this._byteLength,t)),this._byteLength+=t,this}function e$(e){var t;let{type:r,length:n,typeIds:i,valueOffsets:o}=e;if(si.call(this,i),r.mode===Ze.Sparse)return Cw.call(this,e);if(r.mode===Ze.Dense){if(e.offset<=0)return si.call(this,o),Cw.call(this,e);{let s=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let l,u,h=-1;++h<n;)(l=i[h])!==void 0&&((u=a[l])===void 0&&(u=a[l]=o[h]),s[h]=o[h]-u,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);si.call(this,s),this.visitMany(e.children.map((l,u)=>{let h=r.typeIds[u],d=a[h],m=c[h];return l.slice(d,Math.min(n,m))}))}}return this}function t$(e){let t;return e.nullCount>=e.length?si.call(this,new Uint8Array(e.length+7>>3)):(t=e.values)instanceof Uint8Array?si.call(this,xc(e.offset,e.length,t)):si.call(this,_c(e.values))}function gs(e){return si.call(this,e.values.subarray(0,e.length*e.stride))}function b0(e){let{length:t,values:r,valueOffsets:n}=e,i=Le(n[0]),o=Le(n[t]),s=Math.min(o-i,r.byteLength-i);return si.call(this,np(-i,t+1,n)),si.call(this,r.subarray(i,i+s)),this}function Z5(e){let{offset:t,length:r,stride:n,values:i,variadicBuffers:o=[]}=e;if(!i)throw new Error("BinaryView data is missing view buffer");let s=t*n,a=s+r*n;si.call(this,i.subarray(s,a));for(let c of o)si.call(this,c);return this._variadicBufferCounts.push(o.length),this}function w0(e){let{length:t,valueOffsets:r}=e;if(r){let n=Le(r[0]),i=Le(r[t]);return si.call(this,np(-n,t+1,r)),this.visit(e.children[0].slice(n,i-n))}return this.visit(e.children[0])}function Cw(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}var Mt,J5=p(()=>{zr();Pn();Nt();ds();dr();Sc();ga();at();wo();Mt=class e extends ie{static assemble(...t){let r=i=>i.flatMap(o=>Array.isArray(o)?r(o):o instanceof $e?o.data.children:o.data),n=new e;return n.visitMany(r(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(t){if(t instanceof $)return this.visitMany(t.data),this;let{type:r}=t;if(!z.isDictionary(r)){let{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(z.isUnion(r))this.nodes.push(new xi(n,0));else{let{nullCount:i}=t;z.isNull(r)||si.call(this,i<=0?new Uint8Array(0):xc(t.offset,n,t.nullBitmap)),this.nodes.push(new xi(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Mt.prototype.visitBool=t$;Mt.prototype.visitInt=gs;Mt.prototype.visitFloat=gs;Mt.prototype.visitUtf8=b0;Mt.prototype.visitLargeUtf8=b0;Mt.prototype.visitUtf8View=Z5;Mt.prototype.visitBinary=b0;Mt.prototype.visitLargeBinary=b0;Mt.prototype.visitBinaryView=Z5;Mt.prototype.visitFixedSizeBinary=gs;Mt.prototype.visitDate=gs;Mt.prototype.visitTimestamp=gs;Mt.prototype.visitTime=gs;Mt.prototype.visitDecimal=gs;Mt.prototype.visitList=w0;Mt.prototype.visitLargeList=w0;Mt.prototype.visitStruct=Cw;Mt.prototype.visitUnion=e$;Mt.prototype.visitInterval=gs;Mt.prototype.visitDuration=gs;Mt.prototype.visitFixedSizeList=w0;Mt.prototype.visitMap=w0});var x0,Q5=p(()=>{Pn();dp();Nt();x0=class extends ie{visit(t){return t==null?void 0:super.visit(t)}visitNull({typeId:t}){return{name:pe[t].toLowerCase()}}visitInt({typeId:t,bitWidth:r,isSigned:n}){return{name:pe[t].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:t,precision:r}){return{name:pe[t].toLowerCase(),precision:He[r]}}visitBinary({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeBinary({typeId:t}){return{name:pe[t].toLowerCase()}}visitBinaryView({typeId:t}){return{name:pe[t].toLowerCase()}}visitBool({typeId:t}){return{name:pe[t].toLowerCase()}}visitUtf8({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeUtf8({typeId:t}){return{name:pe[t].toLowerCase()}}visitUtf8View({typeId:t}){return{name:pe[t].toLowerCase()}}visitDecimal({typeId:t,scale:r,precision:n,bitWidth:i}){return{name:pe[t].toLowerCase(),scale:r,precision:n,bitWidth:i}}visitDate({typeId:t,unit:r}){return{name:pe[t].toLowerCase(),unit:st[r]}}visitTime({typeId:t,unit:r,bitWidth:n}){return{name:pe[t].toLowerCase(),unit:q[r],bitWidth:n}}visitTimestamp({typeId:t,timezone:r,unit:n}){return{name:pe[t].toLowerCase(),unit:q[n],timezone:r}}visitInterval({typeId:t,unit:r}){return{name:pe[t].toLowerCase(),unit:ke[r]}}visitDuration({typeId:t,unit:r}){return{name:pe[t].toLocaleLowerCase(),unit:q[r]}}visitList({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeList({typeId:t}){return{name:pe[t].toLowerCase()}}visitStruct({typeId:t}){return{name:pe[t].toLowerCase()}}visitUnion({typeId:t,mode:r,typeIds:n}){return{name:pe[t].toLowerCase(),mode:Ze[r].toUpperCase(),typeIds:[...n]}}visitDictionary(t){return this.visit(t.dictionary)}visitFixedSizeBinary({typeId:t,byteWidth:r}){return{name:pe[t].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:t,listSize:r}){return{name:pe[t].toLowerCase(),listSize:r}}visitMap({typeId:t,keysSorted:r}){return{name:pe[t].toLowerCase(),keysSorted:r}}}});function*Dw(e){for(let t of e)yield t.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*ys(e,t){let r=new Uint32Array(e.buffer,e.byteOffset,e.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,i=r.length/t;++n<i;)yield`${yc.new(r.subarray((n+0)*t,(n+1)*t),!1)}`}function eP(e,t){let n=e.values,i=new DataView(n.buffer,n.byteOffset,n.byteLength),o=n.byteLength/16,s=d=>Array.from(d).map(m=>("0"+(m&255).toString(16)).slice(-2)).join("").toUpperCase(),a=Array.from({length:o},(d,m)=>{let g=m*16,y=i.getInt32(g,!0);return[g,y]}).map(([d,m])=>m>12?{SIZE:m,PREFIX_HEX:s(n.subarray(d+4,d+8)),BUFFER_INDEX:i.getInt32(d+8,!0),OFFSET:i.getInt32(d+12,!0)}:{SIZE:m,INLINED:t(n.subarray(d+4,d+4+m))}),c=[...new Set(a.map(d=>d.BUFFER_INDEX).filter(d=>d!==void 0))],l=c.map(d=>s(e.variadicBuffers[d])),u=new Map(c.map((d,m)=>[d,m]));return{VIEWS:a.map(d=>d.BUFFER_INDEX!==void 0?Object.assign(Object.assign({},d),{BUFFER_INDEX:u.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:l}}var Ih,tP=p(()=>{pp();zr();Pn();Nt();Nt();Sc();e0();at();Ih=class e extends ie{static assemble(...t){let r=new e;return t.map(({schema:n,data:i})=>r.visitMany(n.fields,i.children))}visit({name:t},r){let{length:n}=r,{offset:i,nullCount:o,nullBitmap:s}=r,a=z.isDictionary(r.type)?r.type.indices:r.type,c=Object.assign([],r.buffers,{[Ne.VALIDITY]:void 0});return Object.assign({name:t,count:n,VALIDITY:z.isNull(a)||z.isUnion(a)?void 0:o<=0?Array.from({length:n},()=>1):[...new So(s,i,n,null,Fp)]},super.visit(r.clone(a,i,n,0,c)))}visitNull(){return{}}visitBool({values:t,offset:r,length:n}){return{DATA:[...new So(t,r,n,null,wu)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...ys(t.values,2)]}}visitFloat(t){return{DATA:[...t.values]}}visitUtf8(t){return{DATA:[...new $([t])],OFFSET:[...t.valueOffsets]}}visitLargeUtf8(t){return{DATA:[...new $([t])],OFFSET:[...ys(t.valueOffsets,2)]}}visitBinary(t){return{DATA:[...Dw(new $([t]))],OFFSET:[...t.valueOffsets]}}visitLargeBinary(t){return{DATA:[...Dw(new $([t]))],OFFSET:[...ys(t.valueOffsets,2)]}}visitBinaryView(t){return eP(t,r=>Array.from(r).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(t){return eP(t,r=>Array.from(r).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(t){return{DATA:[...Dw(new $([t]))]}}visitDate(t){return{DATA:t.type.unit===st.DAY?[...t.values]:[...ys(t.values,2)]}}visitTimestamp(t){return{DATA:[...ys(t.values,2)]}}visitTime(t){return{DATA:t.type.unit<q.MICROSECOND?[...t.values]:[...ys(t.values,2)]}}visitDecimal(t){return{DATA:[...ys(t.values,4)]}}visitList(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}visitLargeList(t){return{OFFSET:[...ys(t.valueOffsets,2)],children:this.visitMany(t.type.children,t.children)}}visitStruct(t){return{children:this.visitMany(t.type.children,t.children)}}visitUnion(t){return{TYPE_ID:[...t.typeIds],OFFSET:t.type.mode===Ze.Dense?[...t.valueOffsets]:void 0,children:this.visitMany(t.type.children,t.children)}}visitInterval(t){switch(t.type.unit){case ke.YEAR_MONTH:return{DATA:[...t.values]};case ke.DAY_TIME:return{DATA:$b(t.values)};case ke.MONTH_DAY_NANO:return{DATA:Kb(t.values,!0)}}}visitDuration(t){return{DATA:[...ys(t.values,2)]}}visitFixedSizeList(t){return{children:this.visitMany(t.type.children,t.children)}}visitMap(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}}});function Nw(e,t){let r=t;t instanceof ot&&(r=t.batches,e.reset(void 0,t.schema));for(let n of r)e.write(n);return e.finish()}function Fw(e,t){return H(this,void 0,void 0,function*(){var r,n,i,o,s,a,c;try{for(r=!0,n=zn(t);i=yield n.next(),o=i.done,!o;r=!0){c=i.value,r=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!r&&!o&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return e.finish()})}function nP({name:e,type:t,nullable:r}){let n=new x0;return{name:e,nullable:r,type:n.visit(t),children:(t.children||[]).map(i=>nP(i)),dictionary:z.isDictionary(t)?{id:t.id,isOrdered:t.isOrdered,indexType:n.visit(t.indices)}:void 0}}function r$(e,t,r=!1){let[n]=Ih.assemble(new $e({[t]:e}));return JSON.stringify({id:t,isDelta:r,data:{count:e.length,columns:n}},null,2)}function n$(e){let[t]=Ih.assemble(e);return JSON.stringify({count:e.numRows,columns:t},null,2)}var rP,Ei,bs,ws,Ph,Rh=p(()=>{Ar();Yc();m0();zr();at();ga();ga();Fb();Nt();Ah();vo();J5();Q5();tP();dr();ds();xh();Yo();ou();p0();rP=me(ze(),1),Ei=class extends Tc{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}constructor(t){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new Ln,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,tn(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1,t.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(Ir).includes(t.compressionType))this._compression=new Ec(t.compressionType);else{let r=Object.values(Ir).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${t.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Vn(t)?t.then(r=>this.writeAll(r)):Mn(t)?Fw(this,t):Nw(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,r=null){return t===this._sink||t instanceof Ln?this._sink=t:(this._sink=new Ln,t&&kA(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&UA(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!Xc(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(t){let r=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof ot&&!(r=t.schema))return this.finish()&&void 0;if(t instanceof $e&&!(r=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!Xc(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof $e?t instanceof Zc||this._writeRecordBatch(t):t instanceof ot?this.writeAll(t.batches):Wn(t)&&this.writeAll(t)}_writeMessage(t,r=8){let n=r-1,i=Hr.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+n&~n,c=a-o-s;return t.headerType===Ge.RecordBatch?this._recordBatchBlocks.push(new Hi(a,t.bodyLength,this._position)):t.headerType===Ge.DictionaryBatch&&this._dictionaryBlocks.push(new Hi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){let r=se(t);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(t){return this._writeMessage(Hr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Iu)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=this._assembleRecordBatch(t),a=new sr(t.numRows,n,i,this._compression,s,t.metadata),c=Hr.from(a,r);return this._writeDictionaries(t)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=Mt.assemble(t);return this._compression!=null&&({byteLength:r,bufferRegions:i,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}}_compressBodyBuffers(t){let r=Ua.get(this._compression.type);if(!(r!=null&&r.encode)||typeof r.encode!="function")throw new Error(`Codec for compression type "${Ir[this._compression.type]}" has invalid encode method`);let n=0,i=[],o=[];for(let a of t){let c=se(a);if(c.length===0){i.push(new Uint8Array(0),new Uint8Array(0)),o.push(new $t(n,0));continue}let l=r.encode(c),u=l.length<c.length,h=u?l:c,d=u?h.length:-1,m=new rP.ByteBuffer(new Uint8Array(8));m.writeInt64(0,BigInt(d)),i.push(m.bytes(),new Uint8Array(h));let g=(n+7&-8)-n;n+=g;let y=8+h.length;o.push(new $t(n,y)),n+=y}let s=(n+7&-8)-n;return n+=s,{byteLength:n,bufferRegions:o,buffers:i}}_writeDictionaryBatch(t,r,n=!1){let{byteLength:i,nodes:o,bufferRegions:s,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new $([t])),l=new sr(t.length,o,s,this._compression,c),u=new Wr(l,r,n),h=Hr.from(u,i);return this._writeMessage(h)._writeBodyBuffers(a)}_writeBodyBuffers(t){let r=this._compression!=null?2:1,n=new Array(r);for(let i=0;i<t.length;i+=r){let o=0;for(let a=-1;++a<r;)n[a]=t[i+a],o+=n[a].byteLength;if(o===0)continue;for(let a of n)this._write(a);let s=(o+7&-8)-o;s>0&&this._writePadding(s)}return this}_writeDictionaries(t){var r,n;for(let[i,o]of t.dictionaries){let s=(r=o==null?void 0:o.data)!==null&&r!==void 0?r:[],a=this._seenDictionaries.get(i),c=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==s[0])for(let[l,u]of s.entries())this._writeDictionaryBatch(u,i,l>0);else if(c<s.length)for(let l of s.slice(c))this._writeDictionaryBatch(l,i,!0);this._seenDictionaries.set(i,o),this._dictionaryDeltaOffsets.set(i,s.length)}return this}},bs=class e extends Ei{static writeAll(t,r){let n=new e(r);return Vn(t)?t.then(i=>n.writeAll(i)):Mn(t)?Fw(n,t):Nw(n,t)}},ws=class e extends Ei{static writeAll(t,r){let n=new e(r);return Vn(t)?t.then(i=>n.writeAll(i)):Mn(t)?Fw(n,t):Nw(n,t)}constructor(t){super(t),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,r,n=!1){if(!n&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,r,n)}_writeFooter(t){let r=is.encode(new is(t,it.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}},Ph=class e extends Ei{static writeAll(t){return new e().writeAll(t)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(t){return this}_writeSchema(t){return this._write(`{
14
- "schema": ${JSON.stringify({fields:t.fields.map(r=>nP(r))},null,2)}`)}_writeDictionaries(t){return t.dictionaries.size>0&&this._recordBatchesWithDictionaries.push(t),this}_writeDictionaryBatch(t,r,n=!1){return this._write(this._dictionaryBlocks.length===0?" ":`,
15
- `),this._write(r$(t,r,n)),this._dictionaryBlocks.push(new Hi(0,0,0)),this}_writeRecordBatch(t){return this._writeDictionaries(t),this._recordBatches.push(t),this}close(){if(this._recordBatchesWithDictionaries.length>0){this._write(`,
13
+ ]`}concat(...t){let r=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new e(r,n.map(i=>new $e(r,i)))}slice(t,r){let n=this.schema;[t,r]=gh({length:this.numRows},t,r);let i=Wp(this.data,this._offsets,t,r);return new e(n,i.map(o=>new $e(n,o)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(r=>r.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){let r=this.data.map(n=>n.children[t]);if(r.length===0){let{type:n}=this.schema.fields[t],i=te({type:n,length:0,nullCount:0});r.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new $(r)}return null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){r||(r=new $([te({type:new Ht,length:this.numRows})]));let o=n.fields.slice(),s=o[t].clone({type:r.type}),a=this.schema.fields.map((c,l)=>this.getChildAt(l));[o[t],a[t]]=[s,r],[n,i]=g0(n,a)}return new e(n,i)}select(t){let r=this.schema.fields.reduce((n,i,o)=>n.set(i.name,o),new Map);return this.selectAt(t.map(n=>r.get(n)).filter(n=>n>-1))}selectAt(t){let r=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new e(r,n)}assign(t){let r=this.schema.fields,[n,i]=t.schema.fields.reduce((a,c,l)=>{let[u,h]=a,d=r.findIndex(m=>m.name===c.name);return~d?h[d]=l:u.push(l),a},[[],[]]),o=this.schema.assign(t.schema),s=[...r.map((a,c)=>[c,i[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new e(...g0(o,s))}};q5=Symbol.toStringTag;rt[q5]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[V5]=!0,e.isValid=Su(wh),e.get=Su(ir.getVisitFn(x.Struct)),e.set=Hp(Lr.getVisitFn(x.Struct)),e.indexOf=$p(Ec.getVisitFn(x.Struct)),"Table"))(rt.prototype);Object.defineProperty(rt,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===rt&&rt.isTable(t)}})});function W5(e,t,r=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...e.fields],o=[...t],s=(r+63&-64)>>3;for(let[a,c]of e.fields.entries()){let l=t[a];(!l||l.length!==r)&&(i[a]=c.clone({nullable:!0}),o[a]=(n=l==null?void 0:l._changeLengthAndBackfillNullBitmap(r))!==null&&n!==void 0?n:te({type:c.type,length:r,nullCount:r,nullBitmap:new Uint8Array(s)}))}return[e.assign(i),te({type:new Je(i),length:r,children:o})]}function K5(e,t,r=new Map){var n,i;if(((n=e==null?void 0:e.length)!==null&&n!==void 0?n:0)>0&&(e==null?void 0:e.length)===(t==null?void 0:t.length))for(let o=-1,s=e.length;++o<s;){let{type:a}=e[o],c=t[o];for(let l of[c,...((i=c==null?void 0:c.dictionary)===null||i===void 0?void 0:i.data)||[]])K5(a.children,l==null?void 0:l.children,r);if(U.isDictionary(a)){let{id:l}=a;if(!r.has(l))c!=null&&c.dictionary&&r.set(l,c.dictionary);else if(r.get(l)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return r}var H5,$5,$e,Qc,hs=p(()=>{wi();Jc();zr();Vr();at();xu();xc();ri();Xp();Yp();$5=Symbol.for("apache-arrow/RecordBatch"),$e=class e{static isRecordBatch(t){return(t==null?void 0:t[$5])===!0}constructor(...t){switch(t.length){case 3:case 2:{if([this.schema]=t,!(this.schema instanceof ve))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=te({nullCount:0,type:new Je(this.schema.fields),children:this.schema.fields.map(r=>te({type:r.type,nullCount:0}))}),this._metadata=new Map]=t,!(this.data instanceof de))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=W5(this.schema,this.data.children,this.data.length);break}case 1:{let[r]=t,{fields:n,children:i,length:o}=Object.keys(r).reduce((c,l,u)=>(c.children[u]=r[l],c.length=Math.max(c.length,r[l].length),c.fields[u]=ee.new({name:l,type:r[l].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),s=new ve(n),a=te({type:new Je(n),length:o,children:i,nullCount:0});[this.schema,this.data]=W5(s,a.children,o),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=K5(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return ir.visit(this.data,t)}at(t){return this.get(_c(t,this.numRows))}set(t,r){return Lr.visit(this.data,t,r)}indexOf(t,r){return Ec.visit(this.data,t,r)}[Symbol.iterator](){return Mu.visit(new $([this.data]))}toArray(){return[...this]}concat(...t){return new rt(this.schema,[this,...t])}slice(t,r){let[n]=new $([this.data]).slice(t,r).data;return new e(this.schema,n,this._metadata)}getChild(t){var r;return this.getChildAt((r=this.schema.fields)===null||r===void 0?void 0:r.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new $([this.data.children[t]]):null}setChild(t,r){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),r)}setChildAt(t,r){let n=this.schema,i=this.data;if(t>-1&&t<this.numCols){r||(r=new $([te({type:new Ht,length:this.numRows})]));let o=n.fields.slice(),s=i.children.slice(),a=o[t].clone({type:r.type});[o[t],s[t]]=[a,r.data[0]],n=new ve(o,new Map(this.schema.metadata)),i=te({type:new Je(o),length:i.length,children:s})}return new e(n,i,this._metadata)}select(t){let r=this.schema.select(t),n=new Je(r.fields),i=[];for(let o of t){let s=this.schema.fields.findIndex(a=>a.name===o);~s&&(i[s]=this.data.children[s])}return new e(r,te({type:n,length:this.numRows,children:i}),this._metadata)}selectAt(t){let r=this.schema.selectAt(t),n=t.map(o=>this.data.children[o]).filter(Boolean),i=te({type:new Je(r.fields),length:this.numRows,children:n});return new e(r,i,this._metadata)}};H5=Symbol.toStringTag;$e[H5]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[$5]=!0,"RecordBatch"))($e.prototype);Object.defineProperty($e,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$e&&$e.isRecordBatch(t)}});Qc=class extends $e{constructor(t,r){let n=t.fields.map(o=>te({type:o.type})),i=te({type:new Je(t.fields),length:0,nullCount:0,children:n});super(t,i,r||new Map)}}});function b0(e,t=0){for(let r=-1,n=Ru.length;++r<n;)if(Ru[r]!==e[t+r])return!1;return!0}var Iw,Pw,Rw,X5,Y5,Ua,el,tl,y0,Aw,Ru,Lu,Lw,Z5,w0=p(()=>{Ar();Nt();Iw=me(ze(),1);ya();Xo();Vb();dr();vo();_h();Pw=e=>`Expected ${ke[e]} Message in stream, but was null or length 0.`,Rw=e=>`Header pointer of flatbuffer-encoded ${ke[e]} Message is null or length 0.`,X5=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Y5=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,Ua=class{constructor(t){this.source=t instanceof _i?t:new _i(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?St:t.value===-1&&(t=this.readMetadataLength()).done?St:(t=this.readMetadata(t.value)).done?St:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Pw(t));return r.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let r=se(this.source.read(t));if(r.byteLength<t)throw new Error(Y5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()}readSchema(t=!1){let r=ke.Schema,n=this.readMessage(r),i=n==null?void 0:n.header();if(t&&!i)throw new Error(Rw(r));return i}readMetadataLength(){let t=this.source.read(y0),r=t&&new Iw.ByteBuffer(t),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}}readMetadata(t){let r=this.source.read(t);if(!r)return St;if(r.byteLength<t)throw new Error(X5(t,r.byteLength));return{done:!1,value:Hr.decode(r)}}},el=class{constructor(t,r){this.source=t instanceof $r?t:ip(t)?new ba(t,r):new $r(t)}[Symbol.asyncIterator](){return this}next(){return H(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?St:t.value===-1&&(t=yield this.readMetadataLength()).done?St:(t=yield this.readMetadata(t.value)).done?St:t})}throw(t){return H(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return H(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return H(this,void 0,void 0,function*(){let r;if((r=yield this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Pw(t));return r.value})}readMessageBody(t){return H(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let r=se(yield this.source.read(t));if(r.byteLength<t)throw new Error(Y5(t,r.byteLength));return r.byteOffset%8===0&&r.byteOffset+r.byteLength<=r.buffer.byteLength?r:r.slice()})}readSchema(){return H(this,arguments,void 0,function*(t=!1){let r=ke.Schema,n=yield this.readMessage(r),i=n==null?void 0:n.header();if(t&&!i)throw new Error(Rw(r));return i})}readMetadataLength(){return H(this,void 0,void 0,function*(){let t=yield this.source.read(y0),r=t&&new Iw.ByteBuffer(t),n=(r==null?void 0:r.readInt32(0))||0;return{done:n===0,value:n}})}readMetadata(t){return H(this,void 0,void 0,function*(){let r=yield this.source.read(t);if(!r)return St;if(r.byteLength<t)throw new Error(X5(t,r.byteLength));return{done:!1,value:Hr.decode(r)}})}},tl=class extends Ua{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof xh?t:new xh(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Hr.fromJSON(t.schema,ke.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let r=t.dictionaries[this._dictionaryIndex++];return this._body=r.data.columns,{done:!1,value:Hr.fromJSON(r,ke.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let r=t.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:Hr.fromJSON(r,ke.RecordBatch)}}return this._body=[],St}readMessageBody(t){return r(this._body);function r(n){return(n||[]).reduce((i,o)=>[...i,...o.VALIDITY&&[o.VALIDITY]||[],...o.TYPE_ID&&[o.TYPE_ID]||[],...o.OFFSET&&[o.OFFSET]||[],...o.DATA&&[o.DATA]||[],...o.VIEWS&&[o.VIEWS]||[],...o.VARIADIC_DATA_BUFFERS||[],...r(o.children)],[])}}readMessage(t){let r;if((r=this.next()).done)return null;if(t!=null&&r.value.headerType!==t)throw new Error(Pw(t));return r.value}readSchema(){let t=ke.Schema,r=this.readMessage(t),n=r==null?void 0:r.header();if(!r||!n)throw new Error(Rw(t));return n}},y0=4,Aw="ARROW1",Ru=new Uint8Array(Aw.length);for(let e=0;e<Aw.length;e+=1)Ru[e]=Aw.codePointAt(e);Lu=Ru.length,Lw=Lu+y0,Z5=Lu*2+y0});var Ow,Cw,J5,Q5=p(()=>{au();Ow=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(r);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)&&this._hasValidVersion(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.LZ4_FRAME_MAGIC.every((r,n)=>t[n]===r)}_hasValidVersion(t){return(t[4]&192)>>6===1}},Cw=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(t){let r=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(r);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.ZSTD_MAGIC.every((r,n)=>t[n]===r)}},J5={[Ir.LZ4_FRAME]:new Ow,[Ir.ZSTD]:new Cw}});var Bw,ja,x0=p(()=>{au();Q5();Bw=class{constructor(){this.registry={}}set(t,r){if(r!=null&&r.encode&&typeof r.encode=="function"&&!J5[t].isValidCodecEncode(r))throw new Error(`Encoder for ${Ir[t]} is not valid.`);this.registry[t]=r}get(t){var r;return((r=this.registry)===null||r===void 0?void 0:r[t])||null}},ja=new Bw});function iP(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*eP(e){let t=pr.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function tP(e){return en(this,arguments,function*(){let r=yield Me(pr.from(e));try{if(!(yield Me(r.open({autoDestroy:!1}))).closed)do yield yield Me(r);while(!(yield Me(r.reset().open())).closed)}finally{yield Me(r.cancel())}})}function g$(e){return new Ki(new Nw(e))}function y$(e){let t=e.peek(Lu+7&-8);return t&&t.byteLength>=4?b0(t)?new ms(new S0(e.read())):new Ki(new Cu(e)):new Ki(new Cu((function*(){})()))}function b$(e){return H(this,void 0,void 0,function*(){let t=yield e.peek(Lu+7&-8);return t&&t.byteLength>=4?b0(t)?new ms(new S0(yield e.read())):new ds(new Bu(e)):new ds(new Bu((function(){return en(this,arguments,function*(){})})()))})}function w$(e){return H(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new ba(e,t);return t>=Z5&&b0(yield r.readAt(0,Lu+7&-8))?new Ou(new Dw(r)):new ds(new Bu(r))})}var nP,pr,Ki,ds,ms,Ou,_0,Cu,Bu,S0,Dw,Nw,rl=p(()=>{Ar();wi();zr();at();Nt();Ub();su();ya();vo();Vb();F5();hs();_h();w0();Xo();x0();wo();nP=me(ze(),1),pr=class e extends Ic{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){let r=this._impl.open(t);return Vn(r)?r.then(()=>this):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return mr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return mr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof e?t:rp(t)?g$(t):ip(t)?w$(t):Vn(t)?H(this,void 0,void 0,function*(){return yield e.from(yield t)}):op(t)||Vf(t)||ap(t)||Mn(t)?b$(new $r(t)):y$(new _i(t))}static readAll(t){return t instanceof e?t.isSync()?eP(t):tP(t):rp(t)||ArrayBuffer.isView(t)||Wn(t)||np(t)?eP(t):tP(t)}},Ki=class extends pr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return en(this,arguments,function*(){yield Me(yield*iu(zn(this[Symbol.iterator]())))})}},ds=class extends pr{constructor(t){super(t),this._impl=t}readAll(){return H(this,void 0,void 0,function*(){var t,r,n,i;let o=new Array;try{for(var s=!0,a=zn(this),c;c=yield a.next(),t=c.done,!t;s=!0){i=c.value,s=!1;let l=i;o.push(l)}}catch(l){r={error:l}}finally{try{!s&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(r)throw r.error}}return o})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},ms=class extends Ki{constructor(t){super(t),this._impl=t}},Ou=class extends ds{constructor(t){super(t),this._impl=t}},_0=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,r,n){let i;if(t.compression!=null){let s=ja.get(t.compression.type);if(s!=null&&s.decode&&typeof s.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(t,r,s);i=this._loadCompressedVectors(t,a,this.schema.fields),t=new sr(t.length,t.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else i=this._loadVectors(t,r,this.schema.fields);let o=te({type:new Je(this.schema.fields),length:t.length,children:i});return new $e(this.schema,o,n)}_loadDictionaryBatch(t,r){let{id:n,isDelta:i}=t,{dictionaries:o,schema:s}=this,a=o.get(n),c=s.dictionaries.get(n),l;if(t.data.compression!=null){let u=ja.get(t.data.compression.type);if(u!=null&&u.decode&&typeof u.decode=="function"){let{decommpressedBody:h,buffers:d}=this._decompressBuffers(t.data,r,u);l=this._loadCompressedVectors(t.data,h,[c]),t=new Wr(new sr(t.data.length,t.data.nodes,d,null,t.data.variadicBufferCounts),n,i)}else throw new Error("Dictionary batch is compressed but codec not found")}else l=this._loadVectors(t.data,r,[c]);return(a&&i?a.concat(new $(l)):new $(l)).memoize()}_loadVectors(t,r,n){return new Au(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(t,r,n){return new a0(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_decompressBuffers(t,r,n){let i=[],o=[],s=0;for(let{offset:a,length:c}of t.buffers){if(c===0){i.push(new Uint8Array(0)),o.push(new Kt(s,0));continue}let l=new nP.ByteBuffer(r.subarray(a,a+c)),u=Le(l.readInt64(0)),h=l.bytes().subarray(8),d=u===-1?h:n.decode(h);i.push(d);let m=(s+7&-8)-s;s+=m,o.push(new Kt(s,d.length)),s+=d.length}return{decommpressedBody:i,buffers:o}}},Cu=class extends _0{constructor(t,r){super(r),this._reader=rp(t)?new tl(this._handle=t):new Ua(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=iP(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):St}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):St}next(){if(this.closed)return St;let t,{_reader:r}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,t.metadata)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Qc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Bu=class extends _0{constructor(t,r){super(r),this._reader=new el(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return H(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return H(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=iP(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):St})}return(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):St})}next(){return H(this,void 0,void 0,function*(){if(this.closed)return St;let t,{_reader:r}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i,t.metadata)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=yield r.readMessageBody(t.bodyLength),o=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,o)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Qc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},S0=class extends Cu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,r){super(t instanceof Sh?t:new Sh(t),r)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let r of this._footer.dictionaryBatches())r&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var r;if(this.closed)return null;this._footer||this.open();let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(ke.RecordBatch);if(i!=null&&i.isRecordBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s,i.metadata)}}return null}_readDictionaryBatch(t){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(ke.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let o=i.header(),s=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}}_readFooter(){let{_handle:t}=this,r=t.size-Lw,n=t.readInt32(r),i=t.readAt(r-n,n);return ns.decode(i)}_readNextMessageAndValidate(t){var r;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}},Dw=class extends Bu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...r){let n=typeof r[0]!="number"?r.shift():void 0,i=r[0]instanceof Map?r.shift():void 0;super(t instanceof ba?t:new ba(t,n),i)}isFile(){return!0}isAsync(){return!0}open(t){let r=Object.create(null,{open:{get:()=>super.open}});return H(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield r.open.call(this,t)})}readRecordBatch(t){return H(this,void 0,void 0,function*(){var r;if(this.closed)return null;this._footer||(yield this.open());let n=(r=this._footer)===null||r===void 0?void 0:r.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(ke.RecordBatch);if(i!=null&&i.isRecordBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(o,s,i.metadata)}}return null})}_readDictionaryBatch(t){return H(this,void 0,void 0,function*(){var r;let n=(r=this._footer)===null||r===void 0?void 0:r.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(ke.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){let o=i.header(),s=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(o,s);this.dictionaries.set(o.id,a)}}})}_readFooter(){return H(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let r=t.size-Lw,n=yield t.readInt32(r),i=yield t.readAt(r-n,n);return ns.decode(i)})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let r=this._footer.getRecordBatch(this._recordBatchIndex);if(r&&(yield this._handle.seek(r.offset)))return yield this._reader.readMessage(t)}return null})}},Nw=class extends Cu{constructor(t,r){super(t,r)}_loadVectors(t,r,n){return new s0(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}}});function si(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new Kt(this._byteLength,t)),this._byteLength+=t,this}function x$(e){var t;let{type:r,length:n,typeIds:i,valueOffsets:o}=e;if(si.call(this,i),r.mode===Ze.Sparse)return Fw.call(this,e);if(r.mode===Ze.Dense){if(e.offset<=0)return si.call(this,o),Fw.call(this,e);{let s=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let l,u,h=-1;++h<n;)(l=i[h])!==void 0&&((u=a[l])===void 0&&(u=a[l]=o[h]),s[h]=o[h]-u,c[l]=((t=c[l])!==null&&t!==void 0?t:0)+1);si.call(this,s),this.visitMany(e.children.map((l,u)=>{let h=r.typeIds[u],d=a[h],m=c[h];return l.slice(d,Math.min(n,m))}))}}return this}function _$(e){let t;return e.nullCount>=e.length?si.call(this,new Uint8Array(e.length+7>>3)):(t=e.values)instanceof Uint8Array?si.call(this,Sc(e.offset,e.length,t)):si.call(this,Mc(e.values))}function ps(e){return si.call(this,e.values.subarray(0,e.length*e.stride))}function M0(e){let{length:t,values:r,valueOffsets:n}=e,i=Le(n[0]),o=Le(n[t]),s=Math.min(o-i,r.byteLength-i);return si.call(this,cp(-i,t+1,n)),si.call(this,r.subarray(i,i+s)),this}function oP(e){let{offset:t,length:r,stride:n,values:i,variadicBuffers:o=[]}=e;if(!i)throw new Error("BinaryView data is missing view buffer");let s=t*n,a=s+r*n;si.call(this,i.subarray(s,a));for(let c of o)si.call(this,c);return this._variadicBufferCounts.push(o.length),this}function v0(e){let{length:t,valueOffsets:r}=e;if(r){let n=Le(r[0]),i=Le(r[t]);return si.call(this,cp(-n,t+1,r)),this.visit(e.children[0].slice(n,i-n))}return this.visit(e.children[0])}function Fw(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}var Mt,sP=p(()=>{zr();Pn();Nt();hs();dr();vc();ya();at();wo();Mt=class e extends ie{static assemble(...t){let r=i=>i.flatMap(o=>Array.isArray(o)?r(o):o instanceof $e?o.data.children:o.data),n=new e;return n.visitMany(r(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(t){if(t instanceof $)return this.visitMany(t.data),this;let{type:r}=t;if(!U.isDictionary(r)){let{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(U.isUnion(r))this.nodes.push(new xi(n,0));else{let{nullCount:i}=t;U.isNull(r)||si.call(this,i<=0?new Uint8Array(0):Sc(t.offset,n,t.nullBitmap)),this.nodes.push(new xi(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Mt.prototype.visitBool=_$;Mt.prototype.visitInt=ps;Mt.prototype.visitFloat=ps;Mt.prototype.visitUtf8=M0;Mt.prototype.visitLargeUtf8=M0;Mt.prototype.visitUtf8View=oP;Mt.prototype.visitBinary=M0;Mt.prototype.visitLargeBinary=M0;Mt.prototype.visitBinaryView=oP;Mt.prototype.visitFixedSizeBinary=ps;Mt.prototype.visitDate=ps;Mt.prototype.visitTimestamp=ps;Mt.prototype.visitTime=ps;Mt.prototype.visitDecimal=ps;Mt.prototype.visitList=v0;Mt.prototype.visitLargeList=v0;Mt.prototype.visitStruct=Fw;Mt.prototype.visitUnion=x$;Mt.prototype.visitInterval=ps;Mt.prototype.visitDuration=ps;Mt.prototype.visitFixedSizeList=v0;Mt.prototype.visitMap=v0});var E0,aP=p(()=>{Pn();bp();Nt();E0=class extends ie{visit(t){return t==null?void 0:super.visit(t)}visitNull({typeId:t}){return{name:pe[t].toLowerCase()}}visitInt({typeId:t,bitWidth:r,isSigned:n}){return{name:pe[t].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:t,precision:r}){return{name:pe[t].toLowerCase(),precision:He[r]}}visitBinary({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeBinary({typeId:t}){return{name:pe[t].toLowerCase()}}visitBinaryView({typeId:t}){return{name:pe[t].toLowerCase()}}visitBool({typeId:t}){return{name:pe[t].toLowerCase()}}visitUtf8({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeUtf8({typeId:t}){return{name:pe[t].toLowerCase()}}visitUtf8View({typeId:t}){return{name:pe[t].toLowerCase()}}visitDecimal({typeId:t,scale:r,precision:n,bitWidth:i}){return{name:pe[t].toLowerCase(),scale:r,precision:n,bitWidth:i}}visitDate({typeId:t,unit:r}){return{name:pe[t].toLowerCase(),unit:st[r]}}visitTime({typeId:t,unit:r,bitWidth:n}){return{name:pe[t].toLowerCase(),unit:q[r],bitWidth:n}}visitTimestamp({typeId:t,timezone:r,unit:n}){return{name:pe[t].toLowerCase(),unit:q[n],timezone:r}}visitInterval({typeId:t,unit:r}){return{name:pe[t].toLowerCase(),unit:Ge[r]}}visitDuration({typeId:t,unit:r}){return{name:pe[t].toLocaleLowerCase(),unit:q[r]}}visitList({typeId:t}){return{name:pe[t].toLowerCase()}}visitLargeList({typeId:t}){return{name:pe[t].toLowerCase()}}visitStruct({typeId:t}){return{name:pe[t].toLowerCase()}}visitUnion({typeId:t,mode:r,typeIds:n}){return{name:pe[t].toLowerCase(),mode:Ze[r].toUpperCase(),typeIds:[...n]}}visitDictionary(t){return this.visit(t.dictionary)}visitFixedSizeBinary({typeId:t,byteWidth:r}){return{name:pe[t].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:t,listSize:r}){return{name:pe[t].toLowerCase(),listSize:r}}visitMap({typeId:t,keysSorted:r}){return{name:pe[t].toLowerCase(),keysSorted:r}}}});function*kw(e){for(let t of e)yield t.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*gs(e,t){let r=new Uint32Array(e.buffer,e.byteOffset,e.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,i=r.length/t;++n<i;)yield`${wc.new(r.subarray((n+0)*t,(n+1)*t),!1)}`}function cP(e,t){let n=e.values,i=new DataView(n.buffer,n.byteOffset,n.byteLength),o=n.byteLength/16,s=d=>Array.from(d).map(m=>("0"+(m&255).toString(16)).slice(-2)).join("").toUpperCase(),a=Array.from({length:o},(d,m)=>{let g=m*16,y=i.getInt32(g,!0);return[g,y]}).map(([d,m])=>m>12?{SIZE:m,PREFIX_HEX:s(n.subarray(d+4,d+8)),BUFFER_INDEX:i.getInt32(d+8,!0),OFFSET:i.getInt32(d+12,!0)}:{SIZE:m,INLINED:t(n.subarray(d+4,d+4+m))}),c=[...new Set(a.map(d=>d.BUFFER_INDEX).filter(d=>d!==void 0))],l=c.map(d=>s(e.variadicBuffers[d])),u=new Map(c.map((d,m)=>[d,m]));return{VIEWS:a.map(d=>d.BUFFER_INDEX!==void 0?Object.assign(Object.assign({},d),{BUFFER_INDEX:u.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:l}}var Ph,lP=p(()=>{xp();zr();Pn();Nt();Nt();vc();o0();at();Ph=class e extends ie{static assemble(...t){let r=new e;return t.map(({schema:n,data:i})=>r.visitMany(n.fields,i.children))}visit({name:t},r){let{length:n}=r,{offset:i,nullCount:o,nullBitmap:s}=r,a=U.isDictionary(r.type)?r.type.indices:r.type,c=Object.assign([],r.buffers,{[Ne.VALIDITY]:void 0});return Object.assign({name:t,count:n,VALIDITY:U.isNull(a)||U.isUnion(a)?void 0:o<=0?Array.from({length:n},()=>1):[...new So(s,i,n,null,zp)]},super.visit(r.clone(a,i,n,0,c)))}visitNull(){return{}}visitBool({values:t,offset:r,length:n}){return{DATA:[...new So(t,r,n,null,_u)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...gs(t.values,2)]}}visitFloat(t){return{DATA:[...t.values]}}visitUtf8(t){return{DATA:[...new $([t])],OFFSET:[...t.valueOffsets]}}visitLargeUtf8(t){return{DATA:[...new $([t])],OFFSET:[...gs(t.valueOffsets,2)]}}visitBinary(t){return{DATA:[...kw(new $([t]))],OFFSET:[...t.valueOffsets]}}visitLargeBinary(t){return{DATA:[...kw(new $([t]))],OFFSET:[...gs(t.valueOffsets,2)]}}visitBinaryView(t){return cP(t,r=>Array.from(r).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(t){return cP(t,r=>Array.from(r).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(t){return{DATA:[...kw(new $([t]))]}}visitDate(t){return{DATA:t.type.unit===st.DAY?[...t.values]:[...gs(t.values,2)]}}visitTimestamp(t){return{DATA:[...gs(t.values,2)]}}visitTime(t){return{DATA:t.type.unit<q.MICROSECOND?[...t.values]:[...gs(t.values,2)]}}visitDecimal(t){return{DATA:[...gs(t.values,4)]}}visitList(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}visitLargeList(t){return{OFFSET:[...gs(t.valueOffsets,2)],children:this.visitMany(t.type.children,t.children)}}visitStruct(t){return{children:this.visitMany(t.type.children,t.children)}}visitUnion(t){return{TYPE_ID:[...t.typeIds],OFFSET:t.type.mode===Ze.Dense?[...t.valueOffsets]:void 0,children:this.visitMany(t.type.children,t.children)}}visitInterval(t){switch(t.type.unit){case Ge.YEAR_MONTH:return{DATA:[...t.values]};case Ge.DAY_TIME:return{DATA:Yb(t.values)};case Ge.MONTH_DAY_NANO:return{DATA:Zb(t.values,!0)}}}visitDuration(t){return{DATA:[...gs(t.values,2)]}}visitFixedSizeList(t){return{children:this.visitMany(t.type.children,t.children)}}visitMap(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}}});function Gw(e,t){let r=t;t instanceof rt&&(r=t.batches,e.reset(void 0,t.schema));for(let n of r)e.write(n);return e.finish()}function Uw(e,t){return H(this,void 0,void 0,function*(){var r,n,i,o,s,a,c;try{for(r=!0,n=zn(t);i=yield n.next(),o=i.done,!o;r=!0){c=i.value,r=!1;let l=c;e.write(l)}}catch(l){s={error:l}}finally{try{!r&&!o&&(a=n.return)&&(yield a.call(n))}finally{if(s)throw s.error}}return e.finish()})}function fP({name:e,type:t,nullable:r}){let n=new E0;return{name:e,nullable:r,type:n.visit(t),children:(t.children||[]).map(i=>fP(i)),dictionary:U.isDictionary(t)?{id:t.id,isOrdered:t.isOrdered,indexType:n.visit(t.indices)}:void 0}}function S$(e,t,r=!1){let[n]=Ph.assemble(new $e({[t]:e}));return JSON.stringify({id:t,isDelta:r,data:{count:e.length,columns:n}},null,2)}function M$(e){let[t]=Ph.assemble(e);return JSON.stringify({count:e.numRows,columns:t},null,2)}var uP,Ei,ys,bs,Rh,Lh=p(()=>{Ar();Jc();w0();zr();at();ya();ya();Ub();Nt();Ih();vo();sP();aP();lP();dr();hs();_h();Xo();au();x0();uP=me(ze(),1),Ei=class extends Ic{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,r){throw new Error('"throughDOM" not available in this environment')}constructor(t){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new Ln,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,tn(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1,t.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(Ir).includes(t.compressionType))this._compression=new Ac(t.compressionType);else{let r=Object.values(Ir).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${t.compressionType} Available types: ${r.join(", ")}`)}}else this._compression=null}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Vn(t)?t.then(r=>this.writeAll(r)):Mn(t)?Uw(this,t):Gw(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,r=null){return t===this._sink||t instanceof Ln?this._sink=t:(this._sink=new Ln,t&&$A(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&KA(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!r||!Zc(r,this._schema))&&(r==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=r,this._writeSchema(r))),this}write(t){let r=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof rt&&!(r=t.schema))return this.finish()&&void 0;if(t instanceof $e&&!(r=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(r&&!Zc(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof $e?t instanceof Qc||this._writeRecordBatch(t):t instanceof rt?this.writeAll(t.batches):Wn(t)&&this.writeAll(t)}_writeMessage(t,r=8){let n=r-1,i=Hr.encode(t),o=i.byteLength,s=this._writeLegacyIpcFormat?4:8,a=o+s+n&~n,c=a-o-s;return t.headerType===ke.RecordBatch?this._recordBatchBlocks.push(new Hi(a,t.bodyLength,this._position)):t.headerType===ke.DictionaryBatch&&this._dictionaryBlocks.push(new Hi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-s)),o>0&&this._write(i),this._writePadding(c)}_write(t){if(this._started){let r=se(t);r&&r.byteLength>0&&(this._sink.write(r),this._position+=r.byteLength)}return this}_writeSchema(t){return this._writeMessage(Hr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Ru)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=this._assembleRecordBatch(t),a=new sr(t.numRows,n,i,this._compression,s,t.metadata),c=Hr.from(a,r);return this._writeDictionaries(t)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=Mt.assemble(t);return this._compression!=null&&({byteLength:r,bufferRegions:i,buffers:o}=this._compressBodyBuffers(o)),{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}}_compressBodyBuffers(t){let r=ja.get(this._compression.type);if(!(r!=null&&r.encode)||typeof r.encode!="function")throw new Error(`Codec for compression type "${Ir[this._compression.type]}" has invalid encode method`);let n=0,i=[],o=[];for(let a of t){let c=se(a);if(c.length===0){i.push(new Uint8Array(0),new Uint8Array(0)),o.push(new Kt(n,0));continue}let l=r.encode(c),u=l.length<c.length,h=u?l:c,d=u?h.length:-1,m=new uP.ByteBuffer(new Uint8Array(8));m.writeInt64(0,BigInt(d)),i.push(m.bytes(),new Uint8Array(h));let g=(n+7&-8)-n;n+=g;let y=8+h.length;o.push(new Kt(n,y)),n+=y}let s=(n+7&-8)-n;return n+=s,{byteLength:n,bufferRegions:o,buffers:i}}_writeDictionaryBatch(t,r,n=!1){let{byteLength:i,nodes:o,bufferRegions:s,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new $([t])),l=new sr(t.length,o,s,this._compression,c),u=new Wr(l,r,n),h=Hr.from(u,i);return this._writeMessage(h)._writeBodyBuffers(a)}_writeBodyBuffers(t){let r=this._compression!=null?2:1,n=new Array(r);for(let i=0;i<t.length;i+=r){let o=0;for(let a=-1;++a<r;)n[a]=t[i+a],o+=n[a].byteLength;if(o===0)continue;for(let a of n)this._write(a);let s=(o+7&-8)-o;s>0&&this._writePadding(s)}return this}_writeDictionaries(t){var r,n;for(let[i,o]of t.dictionaries){let s=(r=o==null?void 0:o.data)!==null&&r!==void 0?r:[],a=this._seenDictionaries.get(i),c=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==s[0])for(let[l,u]of s.entries())this._writeDictionaryBatch(u,i,l>0);else if(c<s.length)for(let l of s.slice(c))this._writeDictionaryBatch(l,i,!0);this._seenDictionaries.set(i,o),this._dictionaryDeltaOffsets.set(i,s.length)}return this}},ys=class e extends Ei{static writeAll(t,r){let n=new e(r);return Vn(t)?t.then(i=>n.writeAll(i)):Mn(t)?Uw(n,t):Gw(n,t)}},bs=class e extends Ei{static writeAll(t,r){let n=new e(r);return Vn(t)?t.then(i=>n.writeAll(i)):Mn(t)?Uw(n,t):Gw(n,t)}constructor(t){super(t),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,r,n=!1){if(!n&&this._seenDictionaries.has(r))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,r,n)}_writeFooter(t){let r=ns.encode(new ns(t,ot.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}},Rh=class e extends Ei{static writeAll(t){return new e().writeAll(t)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(t){return this}_writeSchema(t){return this._write(`{
14
+ "schema": ${JSON.stringify({fields:t.fields.map(r=>fP(r))},null,2)}`)}_writeDictionaries(t){return t.dictionaries.size>0&&this._recordBatchesWithDictionaries.push(t),this}_writeDictionaryBatch(t,r,n=!1){return this._write(this._dictionaryBlocks.length===0?" ":`,
15
+ `),this._write(S$(t,r,n)),this._dictionaryBlocks.push(new Hi(0,0,0)),this}_writeRecordBatch(t){return this._writeDictionaries(t),this._recordBatches.push(t),this}close(){if(this._recordBatchesWithDictionaries.length>0){this._write(`,
16
16
  "dictionaries": [
17
17
  `);for(let t of this._recordBatchesWithDictionaries)super._writeDictionaries(t);this._write(`
18
18
  ]`)}if(this._recordBatches.length>0){for(let t=-1,r=this._recordBatches.length;++t<r;)this._write(t===0?`,
19
19
  "batches": [
20
20
  `:`,
21
- `),this._write(n$(this._recordBatches[t])),this._recordBatchBlocks.push(new Hi(0,0,0));this._write(`
21
+ `),this._write(M$(this._recordBatches[t])),this._recordBatchBlocks.push(new Hi(0,0,0));this._write(`
22
22
  ]`)}return this._schema&&this._write(`
23
- }`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function iP(e,t){if(Mn(e))return new kw(e[Symbol.asyncIterator](),t);if(Wn(e))return new Gw(e[Symbol.iterator](),t);throw new Error("toNodeStream() must be called with an Iterable or AsyncIterable")}var Uw,Gw,kw,oP=p(()=>{Ar();Uw=require("node:stream");Yo();Gw=class extends Uw.Readable{constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(t){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&(this._pulling=this._pull(t,r))}_destroy(t,r){let n=this._iterator,i;n&&(i=t!=null&&n.throw||n.return),i==null||i.call(n,t),r&&r(null)}_pull(t,r){let n=this._bytesMode,i=null;for(;this.readable&&!(i=r.next(n?t:null)).done&&(t!=null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable}},kw=class extends Uw.Readable{constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(t){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){return this._pulling=yield this._pull(t,r)})}_destroy(t,r){let n=this._iterator,i;n&&(i=t!=null&&n.throw||n.return),i!=null&&i.call(n,t).then(()=>r&&r(null))||r&&r(null)}_pull(t,r){return H(this,void 0,void 0,function*(){let n=this._bytesMode,i=null;for(;this.readable&&!(i=yield r.next(n?t:null)).done&&(t!=null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable})}}});function aP(e){return new jw(oi(e),e)}var sP,jw,i$,o$,cP=p(()=>{sP=require("node:stream");Tu();jw=class extends sP.Duplex{constructor(t,r){let{queueingStrategy:n="count",autoDestroy:i=!0}=r,{highWaterMark:o=n!=="bytes"?1e3:Math.pow(2,14)}=r;super({autoDestroy:i,highWaterMark:1,allowHalfOpen:!0,writableObjectMode:!0,readableObjectMode:!0}),this._numChunks=0,this._finished=!1,this._builder=t,this._desiredSize=o,this._getSize=n!=="bytes"?i$:o$}_read(t){this._maybeFlush(this._builder,this._desiredSize=t)}_final(t){this._maybeFlush(this._builder.finish(),this._desiredSize),t&&t()}_write(t,r,n){let i=this._maybeFlush(this._builder.append(t),this._desiredSize);return n&&n(),i}_destroy(t,r){this._builder.clear(),r&&r(t)}_maybeFlush(t,r){return this._getSize(t)>=r&&++this._numChunks&&this.push(t.toVector()),t.finished?((t.length>0||this._numChunks===0)&&++this._numChunks&&this.push(t.toVector()),!this._finished&&(this._finished=!0)&&this.push(null),!1):this._getSize(t)<this.writableHighWaterMark}},i$=e=>e.length,o$=e=>e.byteLength});function uP(e){return new zw(e)}var lP,zw,fP=p(()=>{Ar();lP=require("node:stream");vo();el();zw=class extends lP.Duplex{constructor(t){super(Object.assign(Object.assign({allowHalfOpen:!1},t),{readableObjectMode:!0,writableObjectMode:!1})),this._pulling=!1,this._autoDestroy=!0,this._reader=null,this._pulling=!1,this._asyncQueue=new Ln,this._autoDestroy=t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:!0}_final(t){let r=this._asyncQueue;r==null||r.close(),t&&t()}_write(t,r,n){let i=this._asyncQueue;return i==null||i.write(t),n&&n(),!0}_read(t){let r=this._asyncQueue;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){this._reader||(this._reader=yield this._open(r)),this._pulling=yield this._pull(t,this._reader)})}_destroy(t,r){let n=this._asyncQueue;n&&(t?n.abort(t):n.close()),r(this._asyncQueue=this._reader=null)}_open(t){return H(this,void 0,void 0,function*(){return yield(yield pr.from(t)).open({autoDestroy:this._autoDestroy})})}_pull(t,r){return H(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next()).done&&!(!this.push(n.value)||t!=null&&--t<=0););return(!this.readable||n!=null&&n.done&&(r.autoDestroy||(yield r.reset().open()).closed))&&(this.push(null),yield r.cancel()),!this.readable})}}});function dP(e){return new qw(new this(e))}var hP,qw,mP=p(()=>{Ar();hP=require("node:stream");vo();qw=class extends hP.Duplex{constructor(t,r){super(Object.assign(Object.assign({allowHalfOpen:!1},r),{writableObjectMode:!0,readableObjectMode:!1})),this._pulling=!1,this._writer=t,this._reader=new $r(t)}_final(t){let r=this._writer;r==null||r.close(),t&&t()}_write(t,r,n){let i=this._writer;return i==null||i.write(t),n&&n(),!0}_read(t){let r=this._reader;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){return this._pulling=yield this._pull(t,r)})}_destroy(t,r){let n=this._writer;n&&(t?n.abort(t):n.close()),r(this._reader=this._writer=null)}_pull(t,r){return H(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next(t||null)).done&&(t!=null&&n.value&&(t-=n.value.byteLength),!(!this.push(n.value)||t<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null),yield r.cancel()),!this.readable})}}});function pP(e,t){if(Mn(e))return a$(e,t);if(Wn(e))return s$(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function s$(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,r||(r=e[Symbol.iterator]()))},pull(s){r?o(s,r):s.close()},cancel(){r!=null&&r.return&&r.return(),r=null}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=se(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function a$(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return H(this,void 0,void 0,function*(){yield o(s,r||(r=e[Symbol.asyncIterator]()))})},pull(s){return H(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return H(this,void 0,void 0,function*(){r!=null&&r.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){return H(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=se(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}var gP=p(()=>{Ar();dr();Yo()});function wP(e){return new Vw(e)}var Vw,yP,bP,xP=p(()=>{Ar();Tu();Vw=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,o=NA(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=oi(o),this._getSize=i!=="bytes"?yP:bP;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:s,size:i!=="bytes"?yP:bP}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-r}_maybeFlush(t,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(t,r){this._bufferedSize=0,this._controller=null,r==null?t.close():t.enqueue(r)}},yP=e=>{var t;return(t=e==null?void 0:e.length)!==null&&t!==void 0?t:0},bP=e=>{var t;return(t=e==null?void 0:e.byteLength)!==null&&t!==void 0?t:0}});function _0(e,t){let r=new Ln,n=null,i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield r.close()})},start(a){return H(this,void 0,void 0,function*(){yield s(a,n||(n=yield o()))})},pull(a){return H(this,void 0,void 0,function*(){n?yield s(a,n):a.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return H(this,void 0,void 0,function*(){return yield(yield pr.from(r)).open(t)})}function s(a,c){return H(this,void 0,void 0,function*(){let l=a.desiredSize,u=null;for(;!(u=yield c.next()).done;)if(a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}var _P=p(()=>{Ar();vo();el()});function S0(e,t){let r=new this(e),n=new $r(r),i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield n.cancel()})},pull(s){return H(this,void 0,void 0,function*(){yield o(s)})},start(s){return H(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(r,e),readable:i};function o(s){return H(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield n.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}var SP=p(()=>{Ar();vo()});function Lh(e){let t=pr.from(e);return Vn(t)?t.then(r=>Lh(r)):t.isAsync()?t.readAll().then(r=>new ot(r)):new ot(t.readAll())}function M0(e,t="stream",r=null){let n={compressionType:r};return(t==="stream"?bs:ws).writeAll(e,n).toUint8Array(!0)}var MP=p(()=>{Yc();Yo();el();Rh()});var Ww={};Jt(Ww,{isArrowData:()=>A0,isArrowDataType:()=>T0,isArrowField:()=>E0,isArrowRecordBatch:()=>P0,isArrowSchema:()=>v0,isArrowTable:()=>R0,isArrowVector:()=>I0});function v0(e){return ve.isSchema(e)}function E0(e){return ee.isField(e)}function T0(e){return z.isDataType(e)}function A0(e){return ce.isData(e)}function I0(e){return $.isVector(e)}function P0(e){return $e.isRecordBatch(e)}function R0(e){return ot.isTable(e)}var Hw=p(()=>{Vr();at();wi();zr();ds();Yc()});var vP,$w=p(()=>{mp();ou();Nt();wi();at();Yc();zr();Pn();Vr();mh();Cp();bt();Tu();Yb();lw();Zb();Jb();Qb();ew();rw();ow();hw();fw();nw();iw();mw();gw();pw();n0();o0();i0();sw();aw();tw();cw();uw();dw();vo();el();Rh();MP();p0();m0();ga();ds();Hw();pp();Vb();Sc();dh();dr();bu();oh();e0();Hw();Ah();vP=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},db),qb),Pb),mb),L2),Ib),lb),Xb),Ww),{compareSchemas:Xc,compareFields:B5,compareTypes:c0})});var EP=p(()=>{iu();bt();el();Rh();gP();xP();_P();SP();$w();$w();mr.toDOMStream=pP;ct.throughDOM=wP;pr.throughDOM=_0;ps.throughDOM=_0;Ki.throughDOM=_0;Ei.throughDOM=S0;ws.throughDOM=S0;bs.throughDOM=S0});var ja={};Jt(ja,{AsyncByteQueue:()=>Ln,AsyncByteStream:()=>$r,AsyncMessageReader:()=>Jc,AsyncRecordBatchFileReader:()=>Ru,AsyncRecordBatchStreamReader:()=>ms,Binary:()=>Tn,BinaryBuilder:()=>as,BinaryView:()=>Ee,BinaryViewBuilder:()=>us,Bool:()=>kr,BoolBuilder:()=>Ac,BufferType:()=>Ne,Builder:()=>ct,ByteStream:()=>_i,CompressionType:()=>Ir,Data:()=>ce,DataType:()=>z,DateBuilder:()=>Eo,DateDay:()=>ea,DateDayBuilder:()=>ba,DateMillisecond:()=>ta,DateMillisecondBuilder:()=>wa,DateUnit:()=>st,Date_:()=>sn,Decimal:()=>An,DecimalBuilder:()=>xa,DenseUnion:()=>ts,DenseUnionBuilder:()=>$c,Dictionary:()=>nr,DictionaryBuilder:()=>Ic,Duration:()=>an,DurationBuilder:()=>Si,DurationMicrosecond:()=>uh,DurationMicrosecondBuilder:()=>Aa,DurationMillisecond:()=>lh,DurationMillisecondBuilder:()=>Ta,DurationNanosecond:()=>fh,DurationNanosecondBuilder:()=>Ia,DurationSecond:()=>ch,DurationSecondBuilder:()=>Ea,Field:()=>ee,FixedSizeBinary:()=>In,FixedSizeBinaryBuilder:()=>_a,FixedSizeList:()=>Ht,FixedSizeListBuilder:()=>Pc,Float:()=>Fr,Float16:()=>ji,Float16Builder:()=>Rc,Float32:()=>nn,Float32Builder:()=>Lc,Float64:()=>Qn,Float64Builder:()=>Oc,FloatBuilder:()=>To,Int:()=>Pt,Int16:()=>Xn,Int16Builder:()=>Cc,Int32:()=>Yt,Int32Builder:()=>Dc,Int64:()=>Yn,Int64Builder:()=>Nc,Int8:()=>Kn,Int8Builder:()=>Bc,IntBuilder:()=>ln,Interval:()=>Ur,IntervalBuilder:()=>$i,IntervalDayTime:()=>la,IntervalDayTimeBuilder:()=>Sa,IntervalMonthDayNano:()=>ah,IntervalMonthDayNanoBuilder:()=>va,IntervalUnit:()=>ke,IntervalYearMonth:()=>ua,IntervalYearMonthBuilder:()=>Ma,JSONMessageReader:()=>Qc,LargeBinary:()=>zi,LargeBinaryBuilder:()=>cs,LargeList:()=>ei,LargeListBuilder:()=>zc,LargeUtf8:()=>qi,LargeUtf8Builder:()=>Ga,List:()=>rr,ListBuilder:()=>jc,MapBuilder:()=>qc,MapRow:()=>bi,Map_:()=>jr,Message:()=>Hr,MessageHeader:()=>Ge,MessageReader:()=>ka,MetadataVersion:()=>it,Null:()=>Wt,NullBuilder:()=>Vc,Precision:()=>He,RecordBatch:()=>$e,RecordBatchFileReader:()=>ps,RecordBatchFileWriter:()=>ws,RecordBatchJSONWriter:()=>Ph,RecordBatchReader:()=>pr,RecordBatchStreamReader:()=>Ki,RecordBatchStreamWriter:()=>bs,RecordBatchWriter:()=>Ei,Schema:()=>ve,SparseUnion:()=>fa,SparseUnionBuilder:()=>Hc,Struct:()=>tt,StructBuilder:()=>Wc,StructRow:()=>_o,Table:()=>ot,Time:()=>Pr,TimeBuilder:()=>vi,TimeMicrosecond:()=>ia,TimeMicrosecondBuilder:()=>Da,TimeMillisecond:()=>na,TimeMillisecondBuilder:()=>Ca,TimeNanosecond:()=>oa,TimeNanosecondBuilder:()=>Na,TimeSecond:()=>ra,TimeSecondBuilder:()=>Ba,TimeUnit:()=>q,Timestamp:()=>Rr,TimestampBuilder:()=>Mi,TimestampMicrosecond:()=>aa,TimestampMicrosecondBuilder:()=>La,TimestampMillisecond:()=>xo,TimestampMillisecondBuilder:()=>Ra,TimestampNanosecond:()=>ca,TimestampNanosecondBuilder:()=>Oa,TimestampSecond:()=>sa,TimestampSecondBuilder:()=>Pa,Type:()=>x,Uint16:()=>Jn,Uint16Builder:()=>Gc,Uint32:()=>rn,Uint32Builder:()=>kc,Uint64:()=>Ui,Uint64Builder:()=>Uc,Uint8:()=>Zn,Uint8Builder:()=>Fc,Union:()=>cn,UnionBuilder:()=>ls,UnionMode:()=>Ze,Utf8:()=>Gr,Utf8Builder:()=>Fa,Utf8View:()=>on,Utf8ViewBuilder:()=>Kc,Vector:()=>$,Visitor:()=>ie,builderThroughAsyncIterable:()=>_w,builderThroughIterable:()=>u0,compressionRegistry:()=>Ua,isArrowData:()=>A0,isArrowDataType:()=>T0,isArrowField:()=>E0,isArrowRecordBatch:()=>P0,isArrowSchema:()=>v0,isArrowTable:()=>R0,isArrowVector:()=>I0,makeBuilder:()=>oi,makeData:()=>te,makeTable:()=>Sw,makeVector:()=>Mo,tableFromArrays:()=>Mw,tableFromIPC:()=>Lh,tableFromJSON:()=>xw,tableToIPC:()=>M0,util:()=>vP,vectorFromArray:()=>Au});var tl=p(()=>{iu();bt();el();Rh();oP();cP();fP();mP();EP();mr.toNodeStream=iP;ct.throughNode=aP;pr.throughNode=uP;Ei.throughNode=dP});function L0(e){return{fields:e.fields.map(t=>rl(t)),metadata:RP(e.metadata)}}function PP(e,t){return new ve(e.fields.map(r=>Io(r,t)),O0(e.metadata))}function RP(e){return Object.fromEntries(e)}function O0(e){return e?new Map(Object.entries(e)):new Map}function rl(e){return{name:e.name,type:B0(e.type),nullable:e.nullable,metadata:RP(e.metadata)}}function Io(e,t){return new ee(e.name,Bu(e.type,t),e.nullable,O0(e.metadata))}function B0(e){if(TP(e,"BinaryView"))return"binary-view";if(TP(e,"Utf8View"))return"utf8-view";if(c$(e,"LargeList"))return{type:"large-list",children:[rl(e.valueField)]};switch(e.constructor){case Wt:return"null";case Tn:return"binary";case In:return{type:"fixed-size-binary",byteWidth:e.byteWidth};case kr:return"bool";case Pt:let t=e;return`${t.isSigned?"":"u"}int${t.bitWidth}`;case Kn:return"int8";case Xn:return"int16";case Yt:return"int32";case Yn:return"int64";case Zn:return"uint8";case Jn:return"uint16";case rn:return"uint32";case Ui:return"uint64";case Fr:switch(e.precision){case He.HALF:return"float16";case He.SINGLE:return"float32";case He.DOUBLE:return"float64";default:return"float16"}case ji:return"float16";case nn:return"float32";case Qn:return"float64";case Gr:return"utf8";case An:let n=e;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case sn:return e.unit===st.DAY?"date-day":"date-millisecond";case ea:return"date-day";case ta:return"date-millisecond";case Pr:switch(e.unit){case q.SECOND:return"time-second";case q.MILLISECOND:return"time-millisecond";case q.MICROSECOND:return"time-microsecond";case q.NANOSECOND:return"time-nanosecond";default:return"time-second"}case na:return"time-millisecond";case ra:return"time-second";case ia:return"time-microsecond";case oa:return"time-nanosecond";case Rr:switch(e.unit){case q.SECOND:return"timestamp-second";case q.MILLISECOND:return"timestamp-millisecond";case q.MICROSECOND:return"timestamp-microsecond";case q.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case sa:return"timestamp-second";case xo:return"timestamp-millisecond";case aa:return"timestamp-microsecond";case ca:return"timestamp-nanosecond";case Ur:switch(e.unit){case ke.DAY_TIME:return"interval-daytime";case ke.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case la:return"interval-daytime";case ua:return"interval-yearmonth";case jr:let c=e;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(y=>rl(y))};case rr:let u=e.valueField;return{type:"list",children:[rl(u)]};case Ht:let h=e;return{type:"fixed-size-list",listSize:h.listSize,children:[rl(h.children[0])]};case tt:return{type:"struct",children:e.children.map(y=>rl(y))};case fa:case ts:let m=e;return{type:m instanceof ts?"dense-union":"sparse-union",typeIds:m.typeIds,children:m.children.map(y=>rl(y)),typeIdToChildIndex:{...m.typeIdToChildIndex}};case nr:let g=e;return{type:"dictionary",id:g.id,indices:l$(g.indices),dictionary:B0(g.dictionary),isOrdered:g.isOrdered};default:throw new Error(`arrow type not supported: ${e.constructor.name}`)}}function Bu(e,t){if(typeof e=="object")switch(e.type){case"decimal":return new An(e.scale,e.precision,e.bitWidth);case"map":{let r=e.children.map(n=>Io(n,t));return new jr(r[0],e.keysSorted)}case"list":{let r=Io(e.children[0],t);return new rr(r)}case"large-list":{let r=Io(e.children[0],t),n=Oh("LargeList");if(!n)throw new Error("LargeList requires an Apache Arrow runtime that exports the LargeList constructor");return new n(r)}case"fixed-size-list":{let r=Io(e.children[0],t);return new Ht(e.listSize,r)}case"fixed-size-binary":return new In(e.byteWidth);case"struct":{let r=e.children.map(n=>Io(n,t));return new tt(r)}case"sparse-union":case"dense-union":{let r=e.children.map(n=>Io(n,t));return e.type==="dense-union"?new ts(e.typeIds,r):new fa(e.typeIds,r)}case"dictionary":return new nr(Bu(e.dictionary,t),f$(e.indices),e.id,e.isOrdered);default:throw new Error("array type not supported")}switch(e){case"null":return new Wt;case"binary":return AP("BinaryView",new Tn,t);case"binary-view":return IP("BinaryView");case"bool":return new kr;case"int8":return new Kn;case"int16":return new Xn;case"int32":return new Yt;case"int64":return new Yn;case"uint8":return new Zn;case"uint16":return new Jn;case"uint32":return new rn;case"uint64":return new Ui;case"float16":return new ji;case"float32":return new nn;case"float64":return new Qn;case"utf8":return AP("Utf8View",new Gr,t);case"utf8-view":return IP("Utf8View");case"date-day":return new ea;case"date-millisecond":return new ta;case"time-second":return new ra;case"time-millisecond":return new na;case"time-microsecond":return new ia;case"time-nanosecond":return new oa;case"timestamp-second":return new sa;case"timestamp-millisecond":return new xo;case"timestamp-microsecond":return new aa;case"timestamp-nanosecond":return new ca;case"interval-daytime":return new la;case"interval-yearmonth":return new ua;default:throw new Error("array type not supported")}}function Oh(e){return ja[e]}function TP(e,t){let r=Oh(t);if(r&&e instanceof r)return!0;let n=z,i=t==="BinaryView"?n.isBinaryView:n.isUtf8View;return!!(i!=null&&i(e))}function c$(e,t){let r=Oh(t);return!!(r&&e instanceof r)}function AP(e,t,r){let n=(r==null?void 0:r.viewTypes)||"never";if(n==="never")return t;let i=Oh(e);if(i)return new i;if(n==="require")throw new Error(`${e} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return t}function IP(e){let t=Oh(e);if(!t)throw new Error(`${e} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new t}function l$(e){if(e instanceof Pt){let r=`${e.isSigned?"int":"uint"}${e.bitWidth}`;if(u$(r))return r}switch(e.constructor){case Kn:return"int8";case Xn:return"int16";case Yt:return"int32";case Zn:return"uint8";case Jn:return"uint16";case rn:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${e.constructor.name}`)}}function u$(e){return["int8","int16","int32","uint8","uint16","uint32"].includes(e)}function f$(e){switch(e){case"int8":return new Kn;case"int16":return new Xn;case"int32":return new Yt;case"uint8":return new Zn;case"uint16":return new Jn;case"uint32":return new rn;default:throw new Error(`schema dictionary index type not supported: ${e}`)}}var C0=p(()=>{"use strict";tl()});function LP(e,t={}){let r={...t,copies:new WeakMap};return h$(e)?p$(e,r):d$(e)?OP(e,r):m$(e)?BP(e,r):N0(e,r)}function h$(e){return"batches"in e}function d$(e){return"schema"in e&&"data"in e&&!Array.isArray(e.data)}function m$(e){return"data"in e&&Array.isArray(e.data)}function p$(e,t){let r=e.batches.map(n=>OP(n,t));return new ot(e.schema,r)}function OP(e,t){return new $e(e.schema,N0(e.data,t))}function N0(e,t){let r=e.children.map(o=>N0(o,t)),n=e.dictionary?BP(e.dictionary,t):void 0,i={[Ne.OFFSET]:D0(e.buffers[Ne.OFFSET],t),[Ne.DATA]:D0(e.buffers[Ne.DATA],t),[Ne.VALIDITY]:D0(e.buffers[Ne.VALIDITY],t),[Ne.TYPE]:D0(e.buffers[Ne.TYPE],t)};return new ce(e.type,e.offset,e.length,e._nullCount,i,r,n)}function BP(e,t){return new $(e.data.map(r=>N0(r,t)))}function D0(e,t){if(!g$(e)||t.copy==="none"||t.copy!=="all"&&e.byteOffset===0&&e.byteLength===e.buffer.byteLength)return e;let r=t.copies.get(e);return r||(r=e.slice(),t.copies.set(e,r)),r}function g$(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Kw=p(()=>{"use strict";tl()});function y$(e,t){let r=LP(e,t);return{shape:"arrow-table",transport:"arrow-js",schema:L0(r.schema),batches:r.batches.map(n=>_$(n))}}function b$(e){let t=PP(e.schema),r=e.batches.map(n=>new $e(t,Yw(n.data)));return new ot(t,r)}function CP(e,t){var i;if(!w$(e))return e;let r=t,n=((i=r==null?void 0:r.core)==null?void 0:i.workerTransferBufferCopy)??(r==null?void 0:r.workerTransferBufferCopy);return{...e,data:y$(e.data,n?{copy:n}:void 0)}}function DP(e){return x$(e)?{...e,data:b$(e.data)}:e}function w$(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&typeof t.data=="object"&&"batches"in t.data)}function x$(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&t.data.transport==="arrow-js"&&Array.isArray(t.data.batches))}function _$(e){return{data:Xw(e.data)}}function Xw(e){return{type:B0(e.type),offset:e.offset,length:e.length,nullCount:e._nullCount,buffers:{[Ne.OFFSET]:e.buffers[Ne.OFFSET],[Ne.DATA]:e.buffers[Ne.DATA],[Ne.VALIDITY]:e.buffers[Ne.VALIDITY],[Ne.TYPE]:e.buffers[Ne.TYPE]},children:e.children.map(t=>Xw(t)),dictionary:e.dictionary?S$(e.dictionary):void 0}}function S$(e){return{data:e.data.map(t=>Xw(t))}}function Yw(e){let t=e.children.map(n=>Yw(n)),r=e.dictionary?M$(e.dictionary):void 0;return new ce(Bu(e.type),e.offset,e.length,e.nullCount,e.buffers,t,r)}function M$(e){return new $(e.data.map(t=>Yw(t)))}var NP=p(()=>{"use strict";tl();C0();Kw()});var FP=p(()=>{"use strict";NP();Kw()});function v$(e,t="float32"){return e instanceof Date?"date-millisecond":typeof e=="number"?t:typeof e=="boolean"?"bool":typeof e=="string"?"utf8":"null"}function GP(e){let t=Zw(e);return t!=="null"?{type:t,nullable:!1}:e.length>0?(t=v$(e[0]),{type:t,nullable:!0}):{type:"null",nullable:!0}}function Zw(e){if(typeof Float16Array<"u"&&e instanceof Float16Array)return"float16";switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var Jw=p(()=>{"use strict"});function Qw(e){let t=e==null?void 0:e.POSITION;if(!t||!("value"in t)||!t.value.length)return null;let r=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0,c=t.value,l=c.length;for(let u=0;u<l;u+=3){let h=c[u],d=c[u+1],m=c[u+2];r=h<r?h:r,n=d<n?d:n,i=m<i?m:i,o=h>o?h:o,s=d>s?d:s,a=m>a?m:a}return[[r,n,i],[o,s,a]]}var kP=p(()=>{"use strict"});function UP(e){let t=wm();return new t(e)}function nl(e){return!!(zl&&e instanceof zl)}function jP(e,t,r){nl(e)?e[t]=r:e[t]=zP(r)}function Bh(e){return nl(e)?new Uint16Array(e.buffer,e.byteOffset,e.length):e}function ex(e,t){let r=UP(e.length);for(let n=0;n<e.length;n++)jP(r,n,e[n]/t);return r}function zP(e){if(!Number.isFinite(e))return e===1/0?31744:e===-1/0?64512:32256;let t=e<0||Object.is(e,-0)?32768:0,r=Math.abs(e);if(r===0)return t;if(r>=65520)return t|31744;if(r>=65504)return t|31743;let n=Math.floor(Math.log2(r));if(n<-14)return t|Math.round(r/2**-24);let i=n+15,o=Math.round((r/2**n-1)*1024);return o===1024?t|i+1<<10:t|i<<10|o}var qP=p(()=>{"use strict";Fn()});var F0,tx,VP=p(()=>{"use strict";tl();F0=new ve([new ee("POSITION",new Ht(3,new ee("value",new nn,!1)),!1)]),tx=new ve([...F0.fields,new ee("indices",new rr(new ee("item",new rn,!1)),!0)])});var Ch=p(()=>{"use strict";qP();VP()});function rx(e,t,r){let n=E$(e,t,r);return new $([n])}function E$(e,t,r){let n=T$(e,t,r),i=n.children[0].type,o=r==="float16"&&nl(e)?Bh(e):e,s={[Ne.DATA]:o},a=new ce(i,0,o.length,0,s);return new ce(n,0,o.length/t,0,void 0,[a])}function T$(e,t,r){let n=r||GP(e).type,i=Bu(n);return new Ht(t,new ee("value",i,!1))}var WP=p(()=>{"use strict";Ch();tl();Jw();C0()});function nx(e,t){switch(t){case"columnar-table":return A$(e);case"arrow-table":return I$(e);default:throw new Error(t)}}function A$(e){let t={},r=KP(e);for(let[n,i]of Object.entries(e.attributes))t[n]=i.value;return{shape:"columnar-table",schema:e.schema,data:t,topology:e.topology,indices:r?e.indices:void 0}}function I$(e,t){var r;return $P(e.attributes,{schema:e.schema,topology:e.topology,mode:e.mode,boundingBox:(r=e.header)==null?void 0:r.boundingBox,indices:KP(e)?e.indices:void 0})}function $P(e,t={}){var c,l,u;let r=[],n={},i=R$(e);for(let h of i){let d=e[h],{value:m,size:g=1}=d,y=P$(m,g,d.componentType);if(n[h]=y,r.push(L$(t.schema,h,y,d.componentType)),h==="POSITION"&&((l=(c=t.indices)==null?void 0:c.value)!=null&&l.length)){let b=tx.fields.find(w=>w.name==="indices");n.indices=B$(t.indices.value,y.length,b.type),r.push(b)}}let o=new ve(r,C$(t)),s=((u=n[i[0]])==null?void 0:u.length)===0?new ot(o):new ot(o,n);return{shape:"arrow-table",schema:L0(s.schema),data:s,topology:t.topology||"point-list",indices:t.indices}}function P$(e,t,r){if(r==="float16"){let n=nl(e)?Bh(e):e;if(t===1){let i=new ce(new ji,0,n.length,0,{[Ne.DATA]:n});return new $([i])}return rx(e,t,r)}return t===1?Mo(e):rx(e,t)}function R$(e){let t=Object.keys(e),r=HP.filter(i=>i in e),n=t.filter(i=>!HP.includes(i));return[...r,...n]}function KP(e){var t,r;return!!((r=(t=e.indices)==null?void 0:t.value)!=null&&r.length)}function L$(e,t,r,n){if(t==="POSITION"&&O$(r)){let o=F0.fields[0],s=e==null?void 0:e.fields.find(c=>c.name===t);if(!(s!=null&&s.metadata))return o;let a=new Map(o.metadata);for(let[c,l]of Object.entries(s.metadata))a.set(c,l);return new ee(o.name,o.type,o.nullable,a)}let i=e==null?void 0:e.fields.find(o=>o.name===t);if(n==="float16"){let o=new Map(Object.entries((i==null?void 0:i.metadata)||{}));return o.set("componentType","float16"),new ee(t,r.type,!1,o)}if(i&&i.type.toString()!==r.type.toString()){let o=Io(i);return new ee(t,r.type,o.nullable,o.metadata)}return i?Io(i):new ee(t,r.type,!1)}function O$(e){return e.type instanceof Ht&&e.type.listSize===3&&e.type.children[0].type instanceof nn}function B$(e,t,r){let n=r,i=e instanceof Uint32Array?e:Uint32Array.from(e),o=new Int32Array(t+1);t>0&&o.fill(i.length,1);let s=new Uint8Array(Math.ceil(t/8));t>0&&(s[0]=1);let a=new ce(n.children[0].type,0,i.length,0,{[Ne.DATA]:i}),c=new ce(n,0,t,Math.max(0,t-1),{[Ne.OFFSET]:o,[Ne.VALIDITY]:s},[a]);return new $([c])}function C$(e){var r;let t={...(r=e.schema)==null?void 0:r.metadata};return e.topology&&(t.topology||=e.topology),Number.isFinite(e.mode)&&(t.mode||=String(e.mode)),e.boundingBox&&(t.boundingBox||=JSON.stringify(e.boundingBox)),O0(t)}var HP,XP=p(()=>{"use strict";Ch();Ch();tl();WP();C0();HP=["POSITION"]});function ix(e,t,r){let n=t.componentType||Zw(t.value),i=r||G0(t),o=t.size===1?n:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]};return{name:e,type:o,nullable:!1,metadata:i}}function G0(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),e.componentType&&(t.componentType=e.componentType),e.transform&&(t["loaders.gl.transform"]=JSON.stringify(e.transform)),t}var YP=p(()=>{"use strict";Jw()});var k0=p(()=>{"use strict";kP();XP();YP()});var ZP,JP=p(()=>{"use strict";ZP="5.0.0-beta.4"});var QP,eR=p(()=>{"use strict";QP={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var tR,rR=p(()=>{"use strict";tR={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function Dh(e,t=null,r={},n=null,i=null){var o;if(Pi&&r.useLocalLibraries&&!r.CDN&&n&&((o=r.modules)==null?void 0:o[n])===void 0){let s=tc?"./libs":`modules/${t}/dist/libs`;r={...r,modules:{[n]:`${s}/${n}`,...i?{[i]:`${s}/${i}`}:{},...r.modules}}}return await Cl(e,t,r,n,i)}var nR=p(()=>{"use strict";ic()});var D$,N$,Nh,iR,Gt,Fh,oR=p(()=>{"use strict";D$="1.5.7",N$="8786740086a9f4d83f44aa83badfbea4dce7a1b5",Nh=`https://www.gstatic.com/draco/versioned/decoders/${D$}`,iR=`https://cdn.jsdelivr.net/gh/google/draco@${N$}/javascript`,Gt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},Fh={[Gt.DECODER]:`${Nh}/${Gt.DECODER}`,[Gt.DECODER_WASM]:`${Nh}/${Gt.DECODER_WASM}`,[Gt.GLTF_DECODER]:`${Nh}/${Gt.GLTF_DECODER}`,[Gt.GLTF_DECODER_WASM]:`${Nh}/${Gt.GLTF_DECODER_WASM}`,[Gt.FALLBACK_DECODER]:`${Nh}/${Gt.FALLBACK_DECODER}`,[Gt.ENCODER]:`${iR}/${Gt.ENCODER}`,[Gt.ENCODER_WASM]:`${iR}/${Gt.ENCODER_WASM}`}});async function U0(e={},t,r="full"){let n=U$(e);return n?await ox(n):await F$(e,t==="js"?"javascript":t,r)}async function F$(e={},t,r="full"){let n=z$(`${t}:${r}`,e),i=sR.get(n);return i||(i=G$(e,t,r),sR.set(n,i)),await i}async function ox(e){let t=j$(e),r=aR.get(t);return r||(r=Ll(()=>t.createDecoderModule({}),n=>({draco:n})),aR.set(t,r)),await r}async function G$(e,t,r){try{return await lR(e,t,r)}catch(n){if(t==="javascript")throw n;try{return await lR(e,"javascript","full")}catch(i){throw new AggregateError([n,i],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function lR(e,t,r){let n=cR.then(()=>k$(e,t,r));return cR=n.then(()=>{},()=>{}),await n}async function k$(e,t,r){if(t==="javascript"){let s;try{s=await Dh(Fh[Gt.FALLBACK_DECODER],"scene",e,Gt.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Pi||e.useLocalLibraries)throw c;s=await Dh(Fh[Gt.FALLBACK_DECODER],"scene",{...e,useLocalLibraries:!0},Gt.FALLBACK_DECODER,"draco_decoder.mjs")}let a=hR(s,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await fR(a)}let n,i;try{[n,i]=await uR(e,r)}catch(s){if(Pi||e.useLocalLibraries)throw s;[n,i]=await uR({...e,useLocalLibraries:!0},r)}let o=hR(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await fR(o,i)}async function uR(e,t){let r=t==="gltf"?Gt.GLTF_DECODER:Gt.DECODER,n=t==="gltf"?Gt.GLTF_DECODER_WASM:Gt.DECODER_WASM;return await Promise.all([Dh(Fh[r],"scene",e,r,t==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),Dh(Fh[n],"scene",e,n)])}function fR(e,t){if(typeof e!="function")throw new Error("Draco module initializer could not be loaded");return Ll(r=>e({...t?{wasmBinary:t}:{},onModuleLoaded:r}),r=>({draco:r}))}function hR(e,t){if(typeof e=="function")return e;if(e&&typeof e=="object"){let r=e,n=r[t]||r.default;return typeof n=="function"?n:void 0}}function U$(e){var r;let t=(r=e.modules)==null?void 0:r.draco3d;if(t){if(typeof t!="object"&&typeof t!="function")throw new Error("Invalid draco3d module");return t}}function j$(e){let t=e;if(typeof(t==null?void 0:t.createDecoderModule)!="function")throw new Error("Invalid draco3d decoder module");return t}function z$(e,t){let r=Object.entries(t.modules||{}).filter(([n])=>n!=="draco3d").map(([n,i])=>`${n}:${String(i)}`).sort().join("|");return[e,t.useLocalLibraries?"local":"remote",t.CDN||"",r].join("|")}var sR,aR,cR,j0=p(()=>{"use strict";Vs();nR();oR();sR=new Map,aR=new WeakMap;cR=Promise.resolve()});function mR(e,t,r){let n=pR(t.metadata),i=[],o=q$(t.attributes);for(let s in e){let a=e[s],c=dR(s,a,o[s]);i.push(c)}if(r){let s=dR("indices",r);i.push(s)}return{fields:i,metadata:n}}function q$(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function dR(e,t,r){let n={...G0(t),...r?pR(r.metadata):{}};return ix(e,t,n)}function pR(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var gR=p(()=>{"use strict";k0()});function $$(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function K$(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function X$(e){let t=e.size(),r=new Uint32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function Y$(e,t){if(!Object.prototype.hasOwnProperty.call(t,e))return e;let r=/^(.*)_([0-9]+)$/.exec(e),n=r?r[1]:e,i=r?BigInt(r[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(t,`${n}_${i}`);)i++;return`${n}_${i}`}function Z$(e){var t;if(e.quantization_transform){let{quantization_bits:r,min_values:n,range:i}=e.quantization_transform;if(r!==void 0&&n&&i!==void 0)return{type:"quantization",bits:r,origin:Array.from(n),range:i}}if(((t=e.octahedron_transform)==null?void 0:t.quantization_bits)!==void 0)return{type:"octahedron",bits:e.octahedron_transform.quantization_bits}}function J$(e){if(e.includeAttributes&&e.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function Q$(e,t){for(let r of e.includeAttributes||e.excludeAttributes||[])if(!t.includes(r))throw new Error(`DracoLoader: selected attribute "${r}" does not exist`)}function eK(e){var a;let t=Qw(e);if(!t)throw new Error("Decoded mesh is missing positions");let r=e.POSITION;if(((a=r==null?void 0:r.transform)==null?void 0:a.type)!=="quantization")return t;let{bits:n,origin:i,range:o}=r.transform,s=o/(2**n-1);return t.map(c=>c.map((l,u)=>i[u]+l*s))}var yR,V$,W$,H$,Gh,bR=p(()=>{"use strict";k0();gR();yR={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},V$={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},W$=2,H$=4,Gh=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){J$(r);let n=ArrayBuffer.isView(t)?new Int8Array(t.buffer,t.byteOffset,t.byteLength):new Int8Array(t);this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),o=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,s=null;try{switch(i){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeArrayToMesh(n,n.byteLength,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){let d=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(o,i,r),c=this._getMeshData(o,a,r),l=eK(c.attributes),u=mR(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:l},...c,schema:u}}finally{s&&this.draco.destroy(s),o&&this.draco.destroy(o)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),o=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:o}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let o=this.decoder.GetAttribute(t,i),s=this._getAttributeMetadata(t,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(o,r);c&&(n[o.unique_id()].octahedron_transform=c)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:4,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={},o={},a=Object.values(t.attributes).sort((c,l)=>c.attribute_index-l.attribute_index).map(c=>{let l=this._deduceAttributeName(c,n),u=Y$(l,o);return o[u]=!0,c.name=u,{attributeName:u,loaderAttribute:c}});Q$(n,Object.keys(o));for(let{attributeName:c,loaderAttribute:l}of a){if(!this._shouldExtractAttribute(c,l,n))continue;let u=this._getAttributeValues(r,l);if(u){let{value:h,size:d}=u;i[c]={value:h,size:d,byteOffset:l.byte_offset,byteStride:l.byte_stride,normalized:l.normalized,transform:Z$(l)}}}return i}_shouldExtractAttribute(t,r,n){var i,o;if(r.attribute_type===this.draco.POSITION){if((i=n.excludeAttributes)!=null&&i.includes(t))throw new Error(`DracoLoader: position attribute "${t}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(t)?!1:!((o=n.excludeAttributes)!=null&&o.includes(t))}_getTriangleListIndices(t){let n=t.num_faces()*3,i=t.num_points()<=65536,o=n*(i?W$:H$),s=this.draco._malloc(o);try{if(i){if(!this.decoder.GetTrianglesUInt16Array(t,o,s))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,s,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(t,o,s))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),X$(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=V$[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let i=r.num_components,s=t.num_points()*i,a=s*n.BYTES_PER_ELEMENT,c=$$(this.draco,n),l,u=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(t,r.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(t,h,c,a,u))throw new Error(`DRACO: Failed to decode attribute ${r.unique_id}.`);l=new n(this.draco.HEAPU8.buffer,u,s).slice()}finally{this.draco._free(u)}return{value:l,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=r.attributeNameEntry||"name";if(t.metadata[i]){let s=t.metadata[i].string;return s==="COLOR"?"COLOR_0":s==="TEX_COORD"?"TEXCOORD_0":s}let o=t.attribute_type;for(let s in yR)if(this.draco[s]===o)return yR[s];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(t,i);r[o]=this._getDracoMetadataField(t,o)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=K$(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:Float32Array.from({length:t.num_components()},(a,c)=>s.min_value(c))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeOctahedronTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}}});async function Cu(e,t,r,n){var a,c;let i=(n==null?void 0:n.reportProgress)||(t==null?void 0:t.onProgress);i==null||i({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:o}=await r();(a=(t==null?void 0:t.signal)||(n==null?void 0:n.signal))==null||a.throwIfAborted();let s=new Gh(o);try{let l=s.parseSync(e,t==null?void 0:t.draco);return i==null||i({phase:"decode",completed:1,total:1,unit:"tasks"}),((c=t==null?void 0:t.draco)==null?void 0:c.shape)==="arrow-table"?nx(l,"arrow-table"):l}finally{s.destroy()}}var z0=p(()=>{"use strict";k0();bR()});var cye,tK,rK,wR=p(()=>{"use strict";ic();j0();z0();kh();({preload:cye,...tK}=Ti),rK={...tK,parse:async(e,t,r)=>await Cu(e,t,async()=>{var n;return await U0(nc(t),"wasm",(n=t==null?void 0:t.draco)==null?void 0:n.decoderProfile)},r)}});var xR={};Jt(xR,{DracoWASMLoaderWithParser:()=>rK});var _R=p(()=>{"use strict";wR()});var pye,nK,iK,SR=p(()=>{"use strict";ic();j0();z0();kh();({preload:pye,...nK}=Ti),iK={...nK,parse:async(e,t,r)=>await Cu(e,t,async()=>await U0(nc(t),"js"),r)}});var MR={};Jt(MR,{DracoJavaScriptLoaderWithParser:()=>iK});var vR=p(()=>{"use strict";SR()});function aK(e){var r;let t=(r=e==null?void 0:e.modules)==null?void 0:r.draco3d;if(!t)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return t}var _ye,oK,sK,ER=p(()=>{"use strict";j0();z0();kh();({preload:_ye,...oK}=Ti),sK={...oK,parse:async(e,t,r)=>await Cu(e,t,async()=>await ox(aK(t)),r)}});var TR={};Jt(TR,{Draco3DLoaderWithParser:()=>sK});var AR=p(()=>{"use strict";ER()});async function cK(e,t){var n;let r=t;switch(lK(r)){case"wasm":{let{DracoWASMLoaderWithParser:i}=await Promise.resolve().then(()=>(_R(),xR));return i}case"javascript":{let{DracoJavaScriptLoaderWithParser:i}=await Promise.resolve().then(()=>(vR(),MR));return i}case"draco3d":{let{Draco3DLoaderWithParser:i}=await Promise.resolve().then(()=>(AR(),TR));return i}default:throw new Error(`DracoLoader: unsupported backend "${(n=r==null?void 0:r.draco)==null?void 0:n.backend}"`)}}function lK(e){var t;return(t=e==null?void 0:e.draco)!=null&&t.backend?e.draco.backend==="js"?"javascript":e.draco.backend:Ti.options.draco.backend}var Ti,kh=p(()=>{"use strict";FP();JP();eR();rR();Ti={dataType:null,batchType:null,...QP,version:ZP,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:CP,deserializeWorkerResult:DP,options:{draco:tR},preload:cK}});var sx=p(()=>{"use strict";CA();kh()});function Uh(e){let t=e.trim().toUpperCase(),r=t.match(/(?:\/DEF\/CRS\/|URN:OGC:DEF:CRS:)([A-Z0-9_-]+)(?:\/|::)(?:[^/:]*[/:])?([A-Z0-9_.-]+)$/);return r?`${r[1]}:${r[2]}`:t}var Du,q0,ax=p(()=>{"use strict";Du="EPSG:4326",q0="EPSG:4978"});function Po(e){var r,n;if(typeof e=="string"){let i=wr(e);return i==="wkt"?fK(e):i==="proj-string"?hK(e):uK(e)||"projected"}let t=e;return t.type==="BoundCRS"&&t.source_crs?Po(t.source_crs):t.type==="CompoundCRS"&&((r=t.components)!=null&&r[0])?Po(t.components[0]):String(t.type).includes("Projected")?"projected":String(t.type).includes("Geographic")?"geographic":String(t.type).includes("Geodetic")?((n=t.coordinate_system)==null?void 0:n.subtype)==="Cartesian"?"geocentric":"geographic":"unknown"}function uK(e){if(typeof e!="string")return;let t=Uh(e);if(t===q0)return"geocentric";if(t===Du||t==="OGC:CRS84")return"geographic";let r=/^EPSG:(\d+)$/.exec(t);if(!r)return;let n=Number(r[1]);if(n===7789)return"geocentric";if(n===4490||n===4979)return"geographic";if(n===3857||n>=32601&&n<=32660||n>=32701&&n<=32760)return"projected"}function fK(e){let t;try{t=_f(e).root}catch{return"unknown"}switch(t.keyword.toUpperCase()){case"GEOCCS":return"geocentric";case"GEOGCS":case"GEOGCRS":case"GEOGRAPHICCRS":case"GEOGRAPHIC2DCRS":case"GEOGRAPHIC3DCRS":return"geographic";case"PROJCS":case"PROJCRS":case"PROJECTEDCRS":return"projected";case"GEODCRS":case"GEODETICCRS":{let r=t.values.find(i=>i.type==="node"&&i.keyword.toUpperCase()==="CS"),n=r==null?void 0:r.values[0];return(n==null?void 0:n.type)!=="enumeration"&&(n==null?void 0:n.type)!=="string"?"unknown":n.value.toUpperCase()==="CARTESIAN"?"geocentric":n.value.toUpperCase()==="ELLIPSOIDAL"?"geographic":"unknown"}default:return"unknown"}}function hK(e){var t;try{let r=(t=Sf(e).parameters.find(n=>n.name.toLowerCase()==="proj"))==null?void 0:t.value;switch(r==null?void 0:r.toLowerCase()){case"longlat":case"latlong":return"geographic";case"geocent":return"geocentric";default:return r?"projected":"unknown"}}catch{return"unknown"}}var cx=p(()=>{"use strict";oy();ax()});function V0(e,t={}){let r=t.sourceCrs!==void 0,n=t.sourceCrs||e.sourceCrs,i=t.outputCoordinates||"auto",o=t.targetCrs||(i==="ecef"?"EPSG:4978":void 0),s=t.targetHeightReference||"native",a=e.verticalUnitScale??1,c=e.elevationUnitScale??1,l=e.elevationOffset||0,u=e.elevationMode==="onTheGround"||e.elevationMode==="relativeToGround"||e.elevationMode==="relativeToScene",h=e.elevationMode==="relativeToScene"?!!t.sceneElevationProvider:!u||!!t.terrainElevationProvider,d=a!==1||c!==1||e.elevationMode!==void 0&&(u||e.elevationMode==="absoluteHeight"&&l!==0),m=s!=="native"&&s!==e.heightReference,g=!!o||s!=="native"||i!=="auto"||d,y=i!=="target-crs"||!!o,b=!m||(e.heightReference||"unknown")!=="unknown",w=Number.isFinite(a)&&a>0&&Number.isFinite(c)&&c>0,_=!!n&&g&&y&&b&&w&&h&&i!=="local-enu",S=r?"caller-override":e.provenance||"unknown",v=r&&n?Po(n):e.coordinateFrame,T=r?"explicit":e.sourceCrsState||(n?S==="format-default"?"default":"explicit":"absent"),O=Jd({crs:n?{state:T==="default"?"default":"explicit",definition:n,representation:!r&&e.sourceCrsRepresentation||wr(n),provenance:S,alternatives:r?void 0:e.sourceCrsAlternatives}:{state:T==="unknown"?"unknown":"absent",provenance:S},vertical:e.verticalCrs?{state:"explicit",definition:e.verticalCrs,representation:wr(e.verticalCrs),provenance:e.provenance||"metadata"}:void 0,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,coordinateFrame:v,coordinateOrder:mK(e.axisOrder),units:r?void 0:e.units}),P=lx(O.crs),M=O.vertical?lx(O.vertical):void 0,U=o?dK(o):void 0;return Object.freeze({...O,sourceCrs:P,verticalCrs:M,verticalUnitScale:a,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,heightReference:e.heightReference||"unknown",elevationMode:e.elevationMode,elevationOffset:e.elevationOffset,elevationUnit:e.elevationUnit,elevationUnitScale:c,coordinateFrame:v||"unknown",axisOrder:e.axisOrder||"unknown",provenance:S,targetCrs:U,targetHeightReference:s,outputCoordinates:i,status:g?_?"transformable":"unresolved":"native",warnings:Object.freeze([...e.warnings||[]])})}function lx(e){return e.state==="explicit"||e.state==="default"?e.definition:void 0}function dK(e){let t=Jd({crs:{state:"explicit",definition:e,representation:wr(e),provenance:"caller-override"}}),r=lx(t.crs);if(!r)throw new Error("Failed to normalize a known target CRS definition");return r}function mK(e){switch(e){case"xy":return["x","y"];case"yx":return["y","x"];case"xyz":return["x","y","z"];default:return[]}}function IR(e){if(e.status!=="transformable"&&e.status!=="transformed")throw new Error("Only a transformable spatial reference can be marked as transformed");return Object.freeze({...e,status:"transformed"})}var PR=p(()=>{"use strict";oy();cx()});function RR(e){if(!e)return;let t=e.trim().toLowerCase().replaceAll("_","-"),r=gK[t]||t;return pK[r]}var pK,gK,LR=p(()=>{"use strict";pK=Object.freeze({meter:1,millimeter:.001,centimeter:.01,decimeter:.1,kilometer:1e3,foot:.3048,yard:.9144,mile:1609.344,"us-foot":.3048006096012192,"us-inch":.0254000508001016,"us-yard":.9144018288036576,"us-mile":1609.3472186944373,"clarke-foot":.3047972654,"clarke-yard":.9143917962,"clarke-link":.201166195164,"sears-yard":.914398414616,"sears-foot":.304799471539,"sears-chain":20.1167651216,"sears-1922-truncated-chain":20.116756,"benoit-1895-b-chain":20.1167824944,"indian-yard":.914398530744,"indian-1937-yard":.91439523,"gold-coast-foot":.304799710181}),gK=Object.freeze({m:"meter",metre:"meter",meters:"meter",metres:"meter",mm:"millimeter",millimetre:"millimeter",millimeters:"millimeter",millimetres:"millimeter",cm:"centimeter",centimetre:"centimeter",centimeters:"centimeter",centimetres:"centimeter",dm:"decimeter",decimetre:"decimeter",decimeters:"decimeter",decimetres:"decimeter",km:"kilometer",kilometre:"kilometer",kilometers:"kilometer",kilometres:"kilometer",ft:"foot",feet:"foot","us-survey-foot":"us-foot","us-survey-feet":"us-foot",yd:"yard",yards:"yard",mi:"mile",miles:"mile"})});function OR(e){return{input:new Float64Array(e),output:new Float64Array(e)}}function jh(e){return e instanceof Float32Array||e instanceof Float64Array}function BR(e){return typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function ux(e,t,r,n,i,o){return(e.buffer===n.buffer||BR(e.buffer)&&BR(n.buffer))&&t<o&&i<r}function W0(e,t,r,n){return e<t+n?0:Math.floor((e-t-n)/r)+1}var H0,CR=p(()=>{H0=class{constructor(t){var o,s;this.depth=0;let r=t.dimension??2,n=t.inputOffset??0,i=t.outputOffset??0;if(!Number.isSafeInteger(r)||r<2||!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||t.inputStride!==void 0&&(!Number.isSafeInteger(t.inputStride)||t.inputStride<1)||t.outputStride!==void 0&&(!Number.isSafeInteger(t.outputStride)||t.outputStride<1)||typeof((o=t.projection)==null?void 0:o.projectToSync)!="function"||typeof((s=t.projection)==null?void 0:s.unprojectToSync)!="function")throw new Error("Invalid projection buffer transform or layout");this.dimension=r,this.projection=t.projection,this.inputOffset=n,this.outputOffset=i,this.inputStride=t.inputStride,this.outputStride=t.outputStride,this.scratch=[OR(r)]}projectFlatTo(t,r,n,i=0,o){return this.flat(t,r,n,i,!1,o)}unprojectFlatTo(t,r,n,i=0,o){return this.flat(t,r,n,i,!0,o)}projectColumnsTo(t,r,n,i=0,o){return this.columns(t,r,n,i,!1,o)}unprojectColumnsTo(t,r,n,i=0,o){return this.columns(t,r,n,i,!0,o)}range(t,r,n){let i=r??Math.max(0,t-n);if(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(n+i)||n+i>t)throw new Error("Invalid projection buffer record range");return i}epochStorage(t,r,n){if(t!==void 0){if(typeof t=="number"){if(!Number.isFinite(t))throw new Error("Coordinate epoch must be finite")}else if(!jh(t)||t.length<r+n)throw new Error("Epoch buffer requires one value per addressed record")}}aliases(t,r,n,i,o,s,a){if(!i)return;let c=t.byteOffset+(this.inputOffset+n*o)*t.BYTES_PER_ELEMENT,l=c+((i-1)*o+a)*t.BYTES_PER_ELEMENT,u=r.byteOffset+(this.outputOffset+n*s)*r.BYTES_PER_ELEMENT,h=u+((i-1)*s+a)*r.BYTES_PER_ELEMENT,d=t.buffer===r.buffer&&t.constructor===r.constructor&&c===u&&o===s;if(ux(t,c,l,r,u,h)&&!d)throw new Error("Projection input/output ranges overlap without an exact in-place mapping")}epochAlias(t,r,n,i,o,s){if(typeof t!="object"||!t||!i)return;let a=t.byteOffset+n*t.BYTES_PER_ELEMENT,c=a+i*t.BYTES_PER_ELEMENT,l=r.byteOffset+(this.outputOffset+n*o)*r.BYTES_PER_ELEMENT,u=l+((i-1)*o+s)*r.BYTES_PER_ELEMENT;if(ux(t,a,c,r,l,u))throw new Error("Epoch and output buffers must not overlap")}acquire(){var t;let r=this.depth++;return(t=this.scratch)[r]||(t[r]=OR(this.dimension)),this.scratch[r]}transform(t,r,n){if(n!==void 0&&!Number.isFinite(n))throw new Error("Coordinate epoch must be finite");r?this.projection.unprojectToSync(t.input,t.output,n):this.projection.projectToSync(t.input,t.output,n)}floatRange(t,r){for(let n=0;n<this.dimension;n++){let i=t[n];if(n<3&&!Number.isFinite(i)||r&&Number.isFinite(i)&&Math.abs(i)>34028234663852886e22)throw new Error("Projection output is nonfinite or exceeds Float32 range")}}flat(t,r,n,i,o,s){if(!jh(t)||!jh(r))throw new Error("Projection buffers require Float32Array or Float64Array");let a=this.inputStride??this.dimension,c=this.outputStride??this.dimension;if(a<this.dimension||c<this.dimension)throw new Error("Interleaved stride must contain every ordinate");let l=this.range(W0(t.length,this.inputOffset,a,this.dimension),n,i);if(i+l>W0(r.length,this.outputOffset,c,this.dimension))throw new Error("Projection output buffer is too short");this.epochStorage(s,i,l),this.aliases(t,r,i,l,a,c,this.dimension),this.epochAlias(s,r,i,l,c,this.dimension);let u=this.acquire();try{let h=typeof s=="number"?void 0:s,d=r instanceof Float32Array;for(let m=i;m<i+l;m++){let g=this.inputOffset+m*a,y=this.outputOffset+m*c;for(let b=0;b<this.dimension;b++)u.input[b]=t[g+b];this.transform(u,o,h?h[m]:s),this.floatRange(u.output,d);for(let b=0;b<this.dimension;b++)r[y+b]=u.output[b]}return r}finally{this.depth--}}columns(t,r,n,i,o,s){if(t.length!==this.dimension||r.length!==this.dimension)throw new Error("Projection columns must match dimension");let a=this.inputStride??1,c=this.outputStride??1,l=Number.MAX_SAFE_INTEGER;for(let d=0;d<this.dimension;d++){if(!jh(t[d])||!jh(r[d]))throw new Error("Projection columns require floating typed arrays");l=Math.min(l,W0(t[d].length,this.inputOffset,a,1))}let u=this.range(l,n,i);this.epochStorage(s,i,u);for(let d=0;d<this.dimension;d++){if(i+u>W0(r[d].length,this.outputOffset,c,1))throw new Error("Projection output column is too short");this.epochAlias(s,r[d],i,u,c,1);for(let m=0;m<this.dimension;m++)this.aliases(t[d],r[m],i,u,a,c,1);for(let m=0;m<d&&u;m++){let g=r[d].byteOffset+(this.outputOffset+i*c)*r[d].BYTES_PER_ELEMENT,y=r[m].byteOffset+(this.outputOffset+i*c)*r[m].BYTES_PER_ELEMENT;if(ux(r[d],g,g+((u-1)*c+1)*r[d].BYTES_PER_ELEMENT,r[m],y,y+((u-1)*c+1)*r[m].BYTES_PER_ELEMENT))throw new Error("Projection output columns overlap")}}let h=this.acquire();try{let d=typeof s=="number"?void 0:s;for(let m=i;m<i+u;m++){let g=this.inputOffset+m*a,y=this.outputOffset+m*c;for(let b=0;b<this.dimension;b++)h.input[b]=t[b][g];this.transform(h,o,d?d[m]:s);for(let b=0;b<this.dimension;b++){let w=h.output[b];if(b<3&&!Number.isFinite(w)||r[b]instanceof Float32Array&&Number.isFinite(w)&&Math.abs(w)>34028234663852886e22)throw new Error("Projection output is nonfinite or exceeds Float32 range")}for(let b=0;b<this.dimension;b++)r[b][y]=h.output[b]}return r}finally{this.depth--}}}});function DR(){return{bounds:[[-1,-1,0],[1,1,0]]}}var NR=p(()=>{});function hx(){let e=globalThis;return e[fx]||(e[fx]=new WeakMap),e[fx]}function FR(e){var t;return"create"in e?e:(t=hx().get(e))==null?void 0:t.implementation}function GR(e){if("create"in e)return Promise.resolve(e);let t=hx().get(e);if(t||(t={load:()=>e.preload()},hx().set(e,t)),t.implementation)return Promise.resolve(t.implementation);let r=t;return r.pending||(r.pending=Promise.resolve().then(r.load).then(n=>{let i=s=>s.toLowerCase().replace(/[\s_-]/g,""),o=new Set([n.name,...n.aliases||[]].map(i));if(typeof n.create!="function"||![e.name,...e.aliases||[]].every(s=>o.has(i(s))))throw new Error("Loaded projection does not match descriptor: "+e.name);return r.implementation=n,n}).catch(n=>{throw r.pending=void 0,n})),r.pending}var fx,kR=p(()=>{fx=Symbol.for("@math.gl/projection/projection-implementations")});function il(e,t,r){if(!(Array.isArray(e)||e instanceof Float32Array||e instanceof Float64Array))throw new Error("Scalar input requires a number array, Float32Array or Float64Array");if(!(Array.isArray(t)||t instanceof Float32Array||t instanceof Float64Array)||t.length<r)throw new Error("Scalar output requires a preallocated number array, Float32Array or Float64Array with sufficient capacity");if(e===t||Array.isArray(e)||Array.isArray(t))return;let n=e,i=t,o=typeof SharedArrayBuffer<"u"&&n.buffer instanceof SharedArrayBuffer&&i.buffer instanceof SharedArrayBuffer;if((n.buffer===i.buffer||o)&&n.byteOffset<i.byteOffset+r*i.BYTES_PER_ELEMENT&&i.byteOffset<n.byteOffset+n.byteLength)throw new Error("Scalar input/output views overlap; use the same view for in-place projection")}function zh(e,t,r,n){if(t instanceof Float32Array){if(Math.abs(r.x)>$0||Math.abs(r.y)>$0||n>=3&&Math.abs(r.z)>$0)throw new Error("Projected coordinate exceeds Float32 range");for(let i=3;i<e.length;i++){let o=e[i];if(Number.isFinite(o)&&Math.abs(o)>$0)throw new Error("Trailing ordinate exceeds Float32 range")}}for(let i=3;i<e.length;i++)t[i]=e[i];return t[0]=r.x,t[1]=r.y,n>=3&&(t[2]=r.z),t}var $0,dx=p(()=>{$0=34028234663852886e22});function Ue(e){throw new ai("missing-transform-stage",e)}var UR,jR,ai,za=p(()=>{jR=Symbol.for("@math.gl/projection/TypeScriptCRSError"),ai=class e extends Error{static[(UR=jR,Symbol.hasInstance)](t){return this!==e?Function.prototype[Symbol.hasInstance].call(this,t):t instanceof Error&&t[jR]===!0}constructor(t,r){super(r),this.reason=t,this[UR]=!0,this.name="TypeScriptCRSError"}}});function qh(e,t){if(typeof e=="string"||"type"in e)return{definition:e,lossy:!1};let r=e,n="crs"in r?r:void 0,i="crs"in r?r.crs:r;if(i.state!=="explicit"&&i.state!=="default")throw new ai("unknown-syntax","Cannot transform an "+i.state+" CRS reference");let o=!1;return(n==null?void 0:n.coordinateEpoch)!==void 0&&Ue("Coordinate epochs require a time-dependent transformation"),n!=null&&n.vertical&&n.vertical.state!=="absent"&&(t.mode!=="horizontal"&&Ue("A separately declared vertical CRS requires explicit horizontal extraction"),o=!0),{definition:i.definition,spatialReference:n,lossy:o}}function zR(e,t){var o;if(!t)return e;if(t.coordinateFrame!=="unknown"&&t.coordinateFrame!==e.kind)throw new Error("SpatialReference coordinate frame disagrees with its CRS");let r=t.coordinateOrder,n=e.kind==="geocentric"?{x:"e",y:"n",z:"u"}:{longitude:"e",lon:"e",latitude:"n",lat:"n",easting:"e",northing:"n",height:"u",altitude:"u",x:"e",y:"n",z:"u"},i;if(r.length&&(i=r.slice(0,3).map(s=>n[s.toLowerCase()]||"?").join(""),i.length===2&&(i+="u"),(i.length!==3||!i.includes("e")||!i.includes("n")||!i.includes("u"))&&Ue("Unsupported SpatialReference coordinate order"),(r.length>4||r.length>3&&!["m","measure"].includes(r[3]))&&Ue("Unsupported fourth coordinate component")),(o=t.units)!=null&&o.length){let s={m:1,meter:1,metre:1,meters:1,metres:1,km:1e3,ft:.3048,"us-ft":.3048006096012192,degree:Math.PI/180,degrees:Math.PI/180,radian:1,radians:1,grad:Math.PI/200};for(let a=0;a<Math.min(t.units.length,3);a++){let c=(i||"enu")[a]==="u",l=e.kind==="geocentric"?e.toMeter:c?e.verticalUnit:e.kind==="geographic"?e.angularUnit:e.toMeter;(Math.abs((s[t.units[a]]??NaN)-l)>1e-12||s[t.units[a]]===void 0)&&Ue("SpatialReference units disagree with its CRS")}}return Object.freeze({...e,storedAxis:i})}var mx=p(()=>{za()});function Nu(e){var i;if(!((i=e.datumCatalogs)!=null&&i.length))return px;let t=WR.get(e);if((t==null?void 0:t.catalogs)===e.datumCatalogs)return t.definitions;let r=Object.assign(Object.create(null),px),n=new Map(Object.entries(px).map(([o,s])=>[ol(o),{definition:s,owner:-1}]));return e.datumCatalogs.forEach((o,s)=>{if(!o.name||!o.datums)throw new Error("Invalid datum catalogue plugin");for(let[a,c]of Object.entries(o.datums)){let l=ol(a);if(!l||l==="none"||!c||["ellipse","towgs84","nadgrids"].some(h=>c[h]!==void 0&&typeof c[h]!="string"))throw new Error("Invalid datum definition: "+a);let u=n.get(l);if(u&&(u.owner!==s||u.definition.ellipse!==c.ellipse||u.definition.towgs84!==c.towgs84||u.definition.nadgrids!==c.nadgrids))throw new Error("Conflicting datum registration: "+a);n.set(l,{definition:c,owner:s}),r[a]=c}}),WR.set(e,{catalogs:e.datumCatalogs,definitions:r}),r}var qR,VR,px,WR,ol,K0=p(()=>{qR={towgs84:"0,0,0",ellipse:"WGS84"},VR={towgs84:"0,0,0",ellipse:"GRS80"},px={wgs84:qR,WGS84:qR,nad83:VR,North_American_Datum_1983:VR},WR=new WeakMap,ol=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var yK,HR,$R=p(()=>{yK={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,b:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS72:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},HR=yK});var On,KR,XR=p(()=>{On={};On.greenwich=0;On.lisbon=-9.131906111111;On.paris=2.337229166667;On.bogota=-74.080916666667;On.madrid=-3.687938888889;On.rome=12.452333333333;On.bern=7.439583333333;On.jakarta=106.807719444444;On.ferro=-17.666666666667;On.brussels=4.367975;On.stockholm=18.058277777778;On.athens=23.7163375;On.oslo=10.722916666667;KR=On});function gx(e,t){let r=Object.keys(e).find(n=>ZR(n)===ZR(t));return r===void 0?void 0:e[r]}function JR(e){if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(e)){let r=Number(e);if(Number.isFinite(r))return r}if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?r$/i.test(e)){let r=Number(e.slice(0,-1))/At;if(Number.isFinite(r))return r}let t=/^([+-]?)(\d+(?:\.\d*)?)(?:d(?:(\d+(?:\.\d*)?)'(?:(\d+(?:\.\d*)?)")?)?)?([NSEW])?$/i.exec(e);if(t&&(/d/i.test(e)||t[5])){let r=Number(t[3]||0),n=Number(t[4]||0);if(r<60&&n<60){let i=t[1]==="-"?-1:1,o=/[SW]/i.test(t[5]||"")?-1:1,s=i*o*(Number(t[2])+r/60+n/3600);if(Number.isFinite(s))return s}}throw new Error("Invalid angular parameter: "+e)}function yx(e,t={}){let r=e,n=t.aliases||{},i=new Set;for(;typeof r=="string"&&(Ro(n,r)||Ro(YR,r));){if(i.has(r))throw new Error("Circular CRS alias: "+r);i.add(r),r=Ro(n,r)?n[r]:YR[r]}if(typeof r=="string"){let o=/^EPSG:(326|327)(\d{2})$/.exec(r);o&&Number(o[2])>=1&&Number(o[2])<=60&&(r="+proj=utm +datum=WGS84 +zone="+Number(o[2])+(o[1]==="327"?" +south":"")),(r==="EPSG:5041"||r==="EPSG:5042")&&(r="+proj=stere +datum=WGS84 +lat_0="+(r==="EPSG:5041"?90:-90)+" +k_0=0.994 +x_0=2000000 +y_0=2000000")}return r}function xs(e,t={}){var U;let r=Nu(t),n=qh(e,t),i=yx(n.definition,t),o;if(wr(i)==="proj-string"&&typeof i=="string"){let C=Object.create(null);for(let L of Sf(i).parameters){if(Ro(C,L.name))throw new Error("Duplicate PROJ parameter: +"+L.name);C[L.name]=L.value}o={parameters:C}}else{let C=(U=t.parsers)==null?void 0:U.find(L=>L.canParse(i));if(!C){let L=["wkt","projjson"].includes(wr(i));throw new ai(L?"missing-parser":"unknown-syntax",wr(i)==="identifier"?"Unsupported CRS definition: "+i+"; resolve it first":"Unsupported CRS definition; register a WKT or PROJJSON parser for structured definitions")}o=C.parse(i,t)}let s={...o.parameters};for(let C of["lon_0","lat_0","lat_1","lat_2","lat_ts","lon_wrap","lon_1","lon_2","lonc","alpha","gamma","tilt","azi","o_alpha","o_lon_c","o_lat_c","o_lon_p","o_lat_p","o_lon_1","o_lat_1","o_lon_2","o_lat_2"])s[C]!==void 0&&(s[C]=String(JR(s[C])));let a=s.proj,c=a==null?void 0:a.toLowerCase(),l=c==="geocentric"?"geocent":["longlat","latlong","latlon","lonlat","identity","geocent"].includes(c)?c:a;if(!l)throw new Error("CRS requires +proj");let u=["longlat","latlong","latlon","lonlat"].includes(l)?"geographic":l==="geocent"?"geocentric":l==="identity"?"identity":"projected",h=s.datum,d=h&&h!=="none"?gx(r,h):void 0;h&&h!=="none"&&!d&&Ue("Unknown datum: "+h+"; register a datumCatalogs plugin");let m=eL(s,d==null?void 0:d.ellipse),g=s.nadgrids??(d==null?void 0:d.nadgrids),y=g===void 0?void 0:g.split(",").map(C=>{let L=C.startsWith("@"),A=L?C.slice(1):C;if(!A||/\s/.test(A))throw new Error("Invalid datum grid name");return Object.freeze({name:A,optional:L})}),b=s.towgs84??(d==null?void 0:d.towgs84),w;if(b!==void 0&&(w=b.split(",").map(C=>re({value:C},"value",NaN)),![3,7].includes(w.length)||w.some(C=>!Number.isFinite(C))||w.length===7&&w[6]<=-1e6))throw new Error("+towgs84 requires three or seven finite values and positive scale");h==="none"&&(w=void 0),y&&h!=="none"&&(w=[0,0,0]);let _=g==="@null"||g==="null"?eL({ellps:"WGS84"}):m,S=s.axis||"enu";if(S.length!==3||!/[ew]/.test(S)||!/[ns]/.test(S)||!/[ud]/.test(S))throw new Error("Invalid axis: "+S);let v=o.angularUnit??At;if(u==="geographic"&&(s.units&&s.units!=="degrees"||Ro(s,"to_meter")))throw new Error("Geographic coordinates must use angular units");if(u!=="geographic"&&s.units==="degrees")throw new Error("Linear coordinates require linear units");let T=QR(s,"units","to_meter"),O=o.verticalUnit??QR(s,"vunits","vto_meter");if(!(O>0)||!Number.isFinite(O))throw new Error("Invalid vertical unit");if(!(v>0)||!Number.isFinite(v))throw new Error("Invalid angular unit");let P=s.pm,M=P===void 0?0:(gx(KR,P)??JR(P))*At;return zR(Object.freeze({kind:u,projection:l,parameters:Object.freeze(s),ellipsoid:m,datum:Object.freeze({ellipsoid:_,towgs84:w&&Object.freeze(w),grids:h==="none"||g==="@null"||g==="null"?void 0:y&&Object.freeze(y)}),areaOfUse:o.areaOfUse,angularUnit:v,toMeter:T,verticalUnit:O,primeMeridian:M,axis:S,longitudeWrap:s.lon_wrap===void 0?void 0:Number(s.lon_wrap)*At,lossy:!!(o.lossy||n.lossy)}),n.spatialReference)}function QR(e,t,r){let n=e[t],i=Mf;if(t==="vunits"&&n==="degrees")throw new Error("Height requires linear units");if(n&&!["m","degrees"].includes(n)&&!Ro(i,n))throw new Error("Unsupported units: "+n);let o=re(e,r,n&&i[n]?i[n].metersPerUnit:1);if(!(o>0))throw new Error("+"+r+" must be positive");return o}function eL(e,t){let r=t||e.ellps||"WGS84",n=gx(HR,r);if(!n)throw new Error("Unsupported ellipsoid: "+r);let i=re(e,"a",n.a),o=re(e,"f",NaN),s=re(e,"rf",Number.isNaN(o)?n.rf||0:o===0?0:1/o),a=re(e,"b",s?i*(1-1/s):Ro(e,"f")||Ro(e,"rf")||Ro(e,"a")?i:n.b||i),c=re(e,"R",0);if(i<=0||a<=0||a>i||s<0||s>0&&s<=1||Ro(e,"R")&&c<=0||!Number.isNaN(o)&&(o<0||o>=1))throw new Error("Invalid ellipsoid dimensions");return Object.freeze({semiMajorAxis:c||i,semiMinorAxis:c||a,eccentricitySquared:c?0:1-(a/i)**2})}var YR,X0,tL,Ro,ZR,Fu=p(()=>{Dl();ny();mx();Vt();K0();$R();XR();iy();za();YR={WGS84:"+proj=longlat +datum=WGS84","EPSG:4326":"+proj=longlat +datum=WGS84","EPSG:4269":"+proj=longlat +datum=NAD83","EPSG:4978":"+proj=geocent +datum=WGS84","EPSG:4979":"+proj=longlat +datum=WGS84","EPSG:3857":"+proj=merc +a=6378137 +b=6378137 +nadgrids=@null +units=m","EPSG:3785":"EPSG:3857",GOOGLE:"EPSG:3857","EPSG:900913":"EPSG:3857","EPSG:102113":"EPSG:3857"},X0=["proj","datum","ellps","a","b","rf","f","R","units","to_meter","vunits","vto_meter","no_defs","type","title","towgs84","nadgrids","geoidgrids","axis","pm","over","lon_wrap"],tL=["no_defs","over"],Ro=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ZR=e=>e.toLowerCase().replace(/[\s_-]/g,"")});function J0(e,t){if(Math.abs(e.y)>Math.PI/2)throw new Error("Latitude outside geocentric domain");if(!Tf(e,t))throw new Error("Geocentric coordinate must be finite")}function Q0(e,t){let r=e.x,n=e.y,i=e.z,{semiMajorAxis:o,semiMinorAxis:s,eccentricitySquared:a}=t;if(r===0&&n===0&&i===0)throw new Error("Geodetic coordinates are undefined at the Earth center");if(a!==0&&Math.abs(r)<1e-12*o&&Math.abs(n)<1e-12*o&&Math.hypot(r,n)<1e-12*o){if(!Number.isFinite(Math.hypot(r,n,i)))throw new Error("Geocentric radius must be finite");e.x=0,e.y=Math.sign(i)*Math.PI/2,e.z=Math.abs(i)-s;return}if(!Af(e,t))throw Number.isFinite(Math.hypot(r,n,i))?new Error("Geocentric inverse did not converge"):new Error("Geocentric radius must be finite")}function rL(e,t){let r=e[0],n=e[1],i=e[2],o=(e[3]||0)*bx,s=(e[4]||0)*bx,a=(e[5]||0)*bx,c=1+(e[6]||0)/1e6;return t?l=>{let u=(l.x-r)/c,h=(l.y-n)/c,d=(l.z-i)/c;l.x=u+a*h-s*d,l.y=-a*u+h+o*d,l.z=s*u-o*h+d}:l=>{let u=l.x,h=l.y,d=l.z;l.x=c*(u-a*h+s*d)+r,l.y=c*(a*u+h-o*d)+n,l.z=c*(-s*u+o*h+d)+i}}function Z0(e){var t;return!!((t=e.towgs84)!=null&&t.some(r=>r!==0))}function xx(e,t){if(!(!e.towgs84||!t.towgs84)){if(e.grids||t.grids){if(e.grids&&t.grids&&e.ellipsoid.semiMajorAxis===t.ellipsoid.semiMajorAxis&&e.ellipsoid.eccentricitySquared===t.ellipsoid.eccentricitySquared&&e.grids.length===t.grids.length&&e.grids.every((n,i)=>n.name===t.grids[i].name&&n.optional===t.grids[i].optional&&n.grid===t.grids[i].grid))return;let r=xx(e.grids?Y0:e,t.grids?Y0:t);return n=>{e.grids&&nL(n,e,!1),r==null||r(n),t.grids&&nL(n,t,!0)}}if(Z0(e)||Z0(t)){let r=wx(e,Y0),n=wx(Y0,t);return i=>{r==null||r(i),n==null||n(i)}}return wx(e,t)}}function wx(e,t){if(!e.towgs84||!t.towgs84)return;let r=e.ellipsoid,n=t.ellipsoid,i=!0;for(let a=0;a<7;a++)(e.towgs84[a]||0)!==(t.towgs84[a]||0)&&(i=!1);if(r.semiMajorAxis===n.semiMajorAxis&&Math.abs(r.eccentricitySquared-n.eccentricitySquared)<=5e-11&&i)return;let o=Z0(e)?rL(e.towgs84,!1):void 0,s=Z0(t)?rL(t.towgs84,!0):void 0;return a=>{J0(a,r),o==null||o(a),s==null||s(a),Q0(a,n)}}function nL(e,t,r){for(let n of t.grids){if(n.name==="null")return;if(!n.grid){if(n.optional)continue;throw new Error("Required datum grid is not registered: "+n.name)}let i=!1;if(n.grid.shiftInPlace)i=n.grid.shiftInPlace(e,r);else{let o=n.grid.shift(e.x,e.y,r);o&&(e.x=o[0],e.y=o[1],i=!0)}if(i){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||Math.abs(e.y)>Math.PI/2)throw new Error("Datum grid produced a coordinate outside the geographic domain");return}}throw new Error("No datum grid covers coordinate: "+t.grids.map(n=>n.name).join(","))}function iL(e,t){let r={x:e[0],y:e[1],z:e[2]};return J0(r,t),[r.x,r.y,r.z]}function oL(e,t){let r={x:e[0],y:e[1],z:e[2]};return Q0(r,t),[r.x,r.y,r.z]}var bx,Y0,_x=p(()=>{Fn();bx=Math.PI/(180*3600),Y0={ellipsoid:{semiMajorAxis:6378137,semiMinorAxis:6356752314245179e-9,eccentricitySquared:.0066943799901413165},towgs84:[0,0,0]}});function qa(e,t=0){let r=re(e,"lon_wrap",0)*At;return n=>ur(i=>{let o=Br(i,r);return[[r+o[0],i[0][1],0],[r+o[1],i[1][1],0]]},n??[-180,-90,180,90],r,t)}var Vh=p(()=>{Vt();ut();Bt()});function sL(e,t={}){if(e===void 0)return;let r=[];for(let n of e.split(",")){let i=n.startsWith("@"),o=i?n.slice(1):n;if(!o||/\s/.test(o))throw new Error("Invalid vertical grid name");if(o==="null"){r.push(null);break}let s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){if(typeof s.getOffset!="function")throw new Error("Invalid vertical grid: "+o);r.push(s.getOffset.bind(s))}else i||Ue("Required vertical grid is not registered: "+o)}return(n,i)=>{for(let o of r){if(!o)return 0;let s=o(n,i);if(s!==void 0){if(!Number.isFinite(s))throw new Error("Vertical grid returned a non-finite offset");return s}}throw new Error("No vertical grid covers this coordinate")}}var aL=p(()=>{za()});function cL(e){let t=hL(e.projections||[]),r=new Set;for(let n of[e.from??"WGS84",e.to??"WGS84"]){let i=xs(n,e);if(["geographic","identity"].includes(i.kind))continue;let o=t.get(t1(i.projection));if(!o)throw new ai("missing-plugin","Projection plugin is not registered: "+i.projection);r.add(o)}return[...r]}function hL(e){let t=new Map;for(let r of e)for(let n of new Set([r.name,...r.aliases||[]].map(t1))){if(!n||["longlat","latlong","latlon","lonlat","identity"].includes(n)||t.has(n))throw new Error("Duplicate or reserved projection plugin: "+n);t.set(n,r)}return t}function lL(e,t,r){var m;let n=xs(e,r),i=t.get(t1(n.projection));if(!["geographic","identity"].includes(n.kind)&&!i)throw new ai("missing-plugin","Projection plugin is not registered: "+n.projection);let o=new Set([...X0,...(i==null?void 0:i.parameters)||[]]);for(let g of Object.keys(n.parameters)){if(!o.has(g))throw new ai("missing-transform-stage","Unsupported PROJ parameter: +"+g);let y=tL.includes(g)||((m=i==null?void 0:i.flags)==null?void 0:m.includes(g));if(y&&n.parameters[g]!==void 0)throw new Error("Expected a flag without a value: +"+g);if(!y&&!n.parameters[g])throw new Error("PROJ parameter requires a value: +"+g)}if(n.parameters.type&&n.parameters.type!=="crs")throw new Error("Only +type=crs is supported");let s=t1(n.projection)==="fasttransversemercator"?Object.freeze({...n.parameters,approx:void 0}):n.parameters,a=i==null?void 0:i.create({...n.ellipsoid,parameters:s,primeMeridian:n.primeMeridian});if(n.kind==="geocentric"&&(!(a!=null&&a.forward3D)||!(a!=null&&a.inverse3D)))throw new Error("Geocentric plugin must implement 3D operations");let c=n.datum.grids,l=(c==null?void 0:c.findIndex(g=>g.name==="null"))??-1,u=c==null?void 0:c.slice(0,l<0?void 0:l+1).map(g=>{let y=Object.prototype.hasOwnProperty.call(r.datumGrids||{},g.name)?r.datumGrids[g.name]:void 0;if(y&&typeof y.shift!="function")throw new Error("Invalid prepared datum grid: "+g.name);return Object.freeze({...g,grid:y})});for(let g of u||[]){if(g.name==="null")break;!g.optional&&!g.grid&&Ue("Required datum grid is not registered: "+g.name)}let h=u?Object.freeze({...n.datum,grids:Object.freeze(u)}):n.datum,d=sL(n.parameters.geoidgrids,r.verticalGrids);return d&&(n.kind==="geocentric"||n.kind==="identity"||n.lossy)&&Ue("Vertical grids require a non-lossy geographic or projected CRS"),{...n,datum:h,implementation:a,verticalGrid:d}}function Sx(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function uL(e,t){if(e==="enu")return;let r=[0,0,0],n=[0,0,0];for(let i=0;i<3;i++){let o=e[i],s="ew".includes(o)?0:"ns".includes(o)?1:2;r[t?i:s]=t?s:i,n[t?i:s]="wsd".includes(o)?-1:1}return i=>{let o=i.x,s=i.y,a=i.z;i.x=n[0]*(r[0]===0?o:r[0]===1?s:a),i.y=n[1]*(r[1]===0?o:r[1]===1?s:a),i.z=n[2]*(r[2]===0?o:r[2]===1?s:a)}}function fL(e,t,r){var v,T,O,P;let n=e.storedAxis||(r?e.axis:"enu"),i=t.storedAxis||(r?t.axis:"enu"),o=uL(n,!1),s=uL(i,!0),a=e.implementation&&Wo(e.implementation,!0,e.kind==="geocentric"),c=t.implementation&&Wo(t.implementation,!1,t.kind==="geocentric"),l=xx(e.datum,t.datum),u=e.lossy||t.lossy,h=e.kind==="geocentric",d=e.kind==="geographic"?e.angularUnit:e.toMeter,m=t.kind==="geographic"?t.angularUnit:t.toMeter,g=h?1:e.verticalUnit,y=t.kind==="geocentric"?m:t.verticalUnit,b=e.primeMeridian,w=t.primeMeridian,_=t.kind==="geographic"?t.longitudeWrap:void 0,S;if(!l&&!e.verticalGrid&&!t.verticalGrid&&!u&&!o&&!s&&!b&&!w&&e.verticalUnit===1&&t.verticalUnit===1&&_===void 0){let M=Object.freeze({inputScale:d,outputScale:m});e.kind==="geographic"&&t.kind==="projected"&&(S=(T=(v=t.implementation)==null?void 0:v.createForwardFlat)==null?void 0:T.call(v,M)),e.kind==="projected"&&t.kind==="geographic"&&(S=(P=(O=e.implementation)==null?void 0:O.createInverseFlat)==null?void 0:P.call(O,M))}return{flat:S,requiresInputZ:!!(e.verticalGrid||t.verticalGrid)||e.kind==="geocentric"||/[ud]/.test(n.slice(0,2))||/[ud]/.test(i.slice(0,2)),geocentricOutput:t.kind==="geocentric",run(M){if(!Sx(M))throw new Error("Coordinates must contain finite x, y and optional z values");o==null||o(M);let U=M.z;if(u&&(M.z=0),d!==1&&(M.x*=d,M.y*=d,h&&(M.z*=d)),a==null||a(M),g!==1&&(M.z*=g),Math.abs(M.y)>Math.PI/2||!Sx(M))throw new Error("Coordinate is outside the geographic domain");if(M.x+=b,e.verticalGrid&&(M.z+=e.verticalGrid(M.x,M.y)),l==null||l(M),t.verticalGrid&&(M.z-=t.verticalGrid(M.x,M.y)),M.x-=w,_!==void 0&&(M.x=_+Xt(M.x-_)),c==null||c(M),m!==1&&(M.x/=m,M.y/=m),y!==1&&(M.z/=y),u&&(M.z=U),s==null||s(M),!Sx(M))throw new Error("Projection produced non-finite coordinates")}}}function Gu(e,t,r,n){if(e.length<2)throw new Error("Coordinates must contain finite x, y and optional z values");if(e.length<3&&t.requiresInputZ)throw new Error("This transform requires three ordinates");let i=Math.max(e.length,t.geocentricOutput?3:2),o=r.acquire();try{if(o.x=e[0],o.y=e[1],o.z=e.length>=3?e[2]:0,t.run(o),n)return zh(e,n,o,i);let s=e.slice();return s[0]=o.x,s[1]=o.y,(e.length>=3||t.geocentricOutput)&&(s[2]=o.z),s}finally{r.release(o)}}function e1(e,t,r,n){if(!(e instanceof Float32Array||e instanceof Float64Array))throw new Error("In-place projection requires a Float32Array or Float64Array");if(!Number.isSafeInteger(t)||t<2||e.length%t!==0)throw new Error("Dimension must be an integer >= 2 and divide the typed array length");if(t<3&&(r.requiresInputZ||r.geocentricOutput))throw new Error("This transform requires a dimension of at least 3");if(r.flat)return r.flat(e,t),e;let i=n.acquire();try{let o=e instanceof Float32Array;for(let s=0;s<e.length;s+=t){if(i.x=e[s],i.y=e[s+1],i.z=t>=3?e[s+2]:0,r.run(i),o&&(Math.abs(i.x)>34028234663852886e22||Math.abs(i.y)>34028234663852886e22||t>=3&&Math.abs(i.z)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");e[s]=i.x,e[s+1]=i.y,t>=3&&(e[s+2]=i.z)}return e}finally{n.release(i)}}var Wh,t1,dL=p(()=>{cc();NR();kR();lc();Im();dx();Fu();za();_x();Vt();Vh();aL();Wh=class e{static async create(t={}){let r=await Promise.all(cL(t).map(GR));return new e({...t,projections:r})}get targetProfile(){return this.getTargetRenderingProfile(this.targetCoverage)}getTargetRenderingProfile(t){return this.targetRenderingProfile&&wT(this.targetRenderingProfile,t)}constructor(t={}){var i,o,s;this.coordinateScratch=new Ds,this.targetLongitudeOrigin=0;let r=t.projections||[],n=hL(r);if(r.some(a=>!("create"in a))){let a=xs(t.from??"WGS84",t),c=xs(t.to??"WGS84",t);this.lossy=a.lossy||c.lossy,this.deferred={options:{...t,projections:[...r]}}}else{let a=t,c=n,l=lL(a.from??"WGS84",c,a),u=lL(a.to??"WGS84",c,a);this.targetRenderingProfile=((o=(i=u.implementation)==null?void 0:i.getRenderingProfile)==null?void 0:o.bind(u.implementation))??(u.kind==="geographic"?qa(u.parameters,u.primeMeridian):u.kind==="identity"?DR:void 0),this.targetCoverage=u.areaOfUse,this.targetLongitudeOrigin=((s=u.implementation)==null?void 0:s.longitudeOrigin)??(u.kind==="geographic"?u.longitudeWrap??0:0),this.lossy=l.lossy||u.lossy,this.lossy&&(l.kind==="geocentric"||u.kind==="geocentric")&&Ue("Horizontal extraction cannot supply ellipsoidal height for geocentric coordinates"),this.lossy&&(l.verticalGrid||u.verticalGrid)&&Ue("Horizontal extraction cannot be combined with vertical grids"),this.forwardTransform=fL(l,u,!!t.enforceAxis),this.inverseTransform=fL(u,l,!!t.enforceAxis)}this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectTo=this.projectTo.bind(this),this.unprojectTo=this.unprojectTo.bind(this),this.projectToSync=this.projectToSync.bind(this),this.unprojectToSync=this.unprojectToSync.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this),this.projectSync=this.projectSync.bind(this),this.unprojectSync=this.unprojectSync.bind(this),this.projectFlatSync=this.projectFlatSync.bind(this),this.unprojectFlatSync=this.unprojectFlatSync.bind(this)}load(){let t=this.deferred;return t?t.implementation?Promise.resolve(t.implementation):(t.pending||(t.pending=e.create(t.options).then(r=>(t.implementation=r,r)).catch(r=>{throw t.pending=void 0,r})),t.pending):Promise.resolve(this)}loadSync(){let t=this.deferred;if(!t)return this;if(!t.implementation){let r=cL(t.options).map(n=>{let i=FR(n);if(!i)throw new Error("Projection is not preloaded: "+n.name+". Call preload() first.");return i});t.implementation=new e({...t.options,projections:r})}return t.implementation}projectSync(t){return this.deferred?this.loadSync().project(t):Gu(t,this.forwardTransform,this.coordinateScratch)}unprojectSync(t){return this.deferred?this.loadSync().unproject(t):Gu(t,this.inverseTransform,this.coordinateScratch)}projectFlatSync(t,r=2){return this.deferred?this.loadSync().projectFlat(t,r):e1(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlatSync(t,r=2){return this.deferred?this.loadSync().unprojectFlat(t,r):e1(t,r,this.inverseTransform,this.coordinateScratch)}async preload(){await this.load()}project(t){return this.deferred?this.projectLoaded(t,!1):Gu(t,this.forwardTransform,this.coordinateScratch)}unproject(t){return this.deferred?this.projectLoaded(t,!0):Gu(t,this.inverseTransform,this.coordinateScratch)}projectTo(t,r){return this.deferred?this.projectToLoaded(t,r,!1):this.projectToSync(t,r)}unprojectTo(t,r){return this.deferred?this.projectToLoaded(t,r,!0):this.unprojectToSync(t,r)}projectToSync(t,r){return this.deferred?this.loadSync().projectTo(t,r):(il(t,r,Math.max(t.length,this.forwardTransform.geocentricOutput?3:2)),Gu(t,this.forwardTransform,this.coordinateScratch,r))}unprojectToSync(t,r){return this.deferred?this.loadSync().unprojectTo(t,r):(il(t,r,Math.max(t.length,this.inverseTransform.geocentricOutput?3:2)),Gu(t,this.inverseTransform,this.coordinateScratch,r))}projectToLoaded(t,r,n){il(t,r,t.length);let i=t.slice();return this.load().then(o=>n?o.unprojectTo(i,r):o.projectTo(i,r))}projectLoaded(t,r){let n=t.slice();return this.load().then(i=>r?i.unproject(n):i.project(n))}projectFlat(t,r=2){return this.deferred?this.load().then(i=>i.projectFlat(t,r)):e1(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlat(t,r=2){return this.deferred?this.load().then(i=>i.unprojectFlat(t,r)):e1(t,r,this.inverseTransform,this.coordinateScratch)}};t1=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var r1,mL=p(()=>{r1=class{constructor(t){this.sample=t,this.result=[0,0,0],this.samples=Array.from({length:4},()=>[0,0,0]),this.coarse=[0,0,0],this.fine=[0,0,0]}evaluate(t,r,n=1e-6){if(!this.difference(t,this.coarse)||!this.difference(t/2,this.fine))return!1;let i=n*Math.max(r,Math.abs(this.fine[0]),Math.abs(this.fine[1]),Math.abs(this.fine[2]));for(let o=0;o<3;o++)if(Math.abs(this.coarse[o]-this.fine[o])>i||(this.fine[o]+=(this.fine[o]-this.coarse[o])/15,!Number.isFinite(this.fine[o])))return!1;for(let o=0;o<3;o++)this.result[o]=this.fine[o];return!0}difference(t,r){let[n,i,o,s]=this.samples;if(!this.sample(-2*t,n)||!this.sample(-t,i)||!this.sample(t,o)||!this.sample(2*t,s))return!1;for(let a=0;a<3;a++)if(r[a]=(n[a]-s[a]+8*(o[a]-i[a]))/(12*t),!Number.isFinite(r[a]))return!1;return!0}}});function Mx(e){if(e.length!==3||e.some(t=>!Number.isFinite(t)||t<=0))throw new Error("Invalid CRS rendering scale");return e}function gL(e,t,r,n){if(e.kind==="geocentric")return Mx([e.toMeter,e.toMeter,e.toMeter]);if(e.kind==="identity")return Mx([...r].map(g=>/[ud]/.test(g)?e.verticalUnit:e.toMeter));let i=[0,0,0],o=[0,0,0],s=[0,0,0],a=[0,0,0],c=Array.from({length:3},()=>[0,0,0]),l=0,u=0,h=0,d=!1,m=new r1((g,y)=>{for(let _=0;_<3;_++)o[_]=i[_];o[l]+=g,t.unprojectTo(o,a);let b=a[0]-s[0],w=Math.abs(b)<=180?b:((b+180)%360+360)%360-180;return Math.abs(a[1])>=90?!1:(y[0]=w*u,y[1]=(a[1]-s[1])*h,y[2]=a[2]-s[2],y.every(Number.isFinite))});return g=>{if(d||g.length<2)return null;d=!0;let y;try{if(i[0]=g[0],i[1]=g[1],i[2]=g[2]??0,!i.every(Number.isFinite))return null;t.unprojectTo(i,s);let b=s[1]*Hh,w=pL.semiMajorAxis,_=pL.eccentricitySquared,S=1-_*Math.sin(b)**2;if(u=w*Math.cos(b)/Math.sqrt(S)*Hh,h=w*(1-_)/S**1.5*Hh,!(u>w*Hh*1e-8)||!(h>0))return null;let v=((s[0]-n+180)%360+360)%360-180;if((e.kind==="geographic"?e.longitudeWrap!==void 0:!Object.prototype.hasOwnProperty.call(e.parameters,"over"))&&Math.abs(v)+2/u>=180||Math.abs(s[1])+2/h>=90)return null;for(l=0;l<3;l++){let O=r[l],P=/[ud]/.test(O)?e.verticalUnit:e.kind==="geographic"?(/[ew]/.test(O)?u:h)*e.angularUnit/Hh:e.toMeter;if(!m.evaluate(1/P,P))return null;for(let M=0;M<3;M++)c[l][M]=m.result[M]}if(y=c.map(O=>Math.hypot(...O)),e.kind==="projected"){let O=c[r.search(/[ew]/)],P=c[r.search(/[ns]/)],M=Math.abs(O[0]*P[1]-O[1]*P[0])/e.toMeter**2;y[r.search(/[ud]/)]=e.verticalUnit*Math.sqrt(M)}}catch{return null}finally{d=!1}return Mx(y)}}var Hh,pL,yL=p(()=>{mL();Fu();Hh=Math.PI/180,pL=xs("WGS84").ellipsoid});async function SL(e,t,r,n={},i=!1,o){let s=typeof t=="string"?t:JSON.parse(JSON.stringify(t)),a={enforceAxis:r.enforceAxis,mode:r.mode,...n,converters:n.converters&&[...n.converters]},c=o?await o(s,{...r,...a}):s,l=xs(c,{...r,...a}),u=await e.createProjectionAsync({...a,from:"WGS84",to:c}),h=l.storedAxis||(a.enforceAxis?l.axis:"enu"),d=_L(l.kind==="geographic"?l.angularUnit:l.toMeter,l.kind==="geographic"),m=_L(l.verticalUnit,!1),g=[...h].map(M=>l.kind!=="geocentric"&&/[ud]/.test(M)?m:d),y=u.targetProfile;if(!y)throw new Error("Projection must define a rendering profile for CRS retrieval");let b=(u.targetLongitudeOrigin+l.primeMeridian)*180/Math.PI,w=_K(y,l,h),_=xK(y.normalize),S=gL(l,u,h,b),v=[...new Set(["WGS84",...a.converters||[]])];if(v.some(M=>typeof M!="string"||!M.trim()))throw new Error("Converter source CRS must be a nonempty string");let T=await Promise.all(v.map(async M=>{if(M==="WGS84")return[M,wL(u,_)];let[U,C]=await Promise.all([e.createProjectionAsync({...a,from:M,to:c}),e.createProjectionAsync({...a,from:"WGS84",to:M})]);return[M,wL(U,wK(C,_))]})),O=Object.assign(Object.create(null),Object.fromEntries(T)),P={coordinateFrame:l.kind,projection:l.projection,parameters:l.parameters,ellipsoid:{semiMajorAxis:l.ellipsoid.semiMajorAxis,semiMinorAxis:l.ellipsoid.semiMinorAxis},axis:h,xUnit:g[0],yUnit:g[1],zUnit:g[2],areaOfUse:l.areaOfUse,lossy:l.lossy};return{...P,signature:i&&typeof c=="string"&&!a.enforceAxis&&!l.lossy?c:bE(P),renderingBounds:w,renderingScale:S,getRenderingScale:M=>typeof S=="function"?S(M):S,converter:O}}function wL(e,t){return{from:xL(e.project.bind(e),e.projectTo.bind(e)),to:xL(e.unproject.bind(e),e.unprojectTo.bind(e)),normalize:t}}function wK(e,t){function r(n,i){i!==void 0&&il(n,i,n.length);let o=e.unproject(Array.from(n)),[s,a,c]=o;return t(o,o),o[0]===s&&o[1]===a&&o[2]===c?i===void 0?Array.from(n):zh(n,i,{x:n[0],y:n[1],z:n[2]??0},n.length):i===void 0?e.project(o):e.projectTo(o,i)}return r}function xL(e,t){function r(n,i){return i===void 0?e(Array.isArray(n)?n:Array.from(n)):t(n,i)}return r}function xK(e){function t(r,n){let i=n??new Array(r.length);il(r,i,r.length);let o=r[0],s=r[1],a=r[2]??0;if(r.length<2||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(a))throw new Error("Normalization requires finite longitude, latitude and altitude");let c={x:o,y:s,z:a};return e==null||e(c),zh(r,i,c,r.length)}return t}function _K(e,t,r){let n=t.kind==="geographic"?t.angularUnit:t.toMeter,i=[n,n,t.kind==="geocentric"?t.toMeter:t.verticalUnit],o=e.bounds,s=[...r].map(a=>{let c=/[ew]/.test(a)?0:/[ns]/.test(a)?1:2,l=o[0][c]/i[c],u=o[1][c]/i[c];return/[wsd]/.test(a)?[-u,-l]:[l,u]});return[[s[0][0],s[1][0],s[2][0]],[s[0][1],s[1][1],s[2][1]]]}function _L(e,t){let r=t?bL:bK,n=Object.keys(r).find(i=>r[i]===e)||"custom";return t?{name:n,degreesPerUnit:e/bL.degrees}:{name:n,metersPerUnit:e}}var bL,bK,ML=p(()=>{Fu();yL();dx();iy();bL={degrees:Math.PI/180,radians:1,gradians:Math.PI/200},bK={...Object.fromEntries(Object.values(Mf).map(e=>[e.name,e.metersPerUnit]))}});function vL(e){return{...e,projections:e.projections&&[...e.projections],parsers:e.parsers&&[...e.parsers],datumCatalogs:e.datumCatalogs&&[...e.datumCatalogs],aliases:e.aliases&&JSON.parse(JSON.stringify(e.aliases)),datumGrids:e.datumGrids&&{...e.datumGrids},verticalGrids:e.verticalGrids&&{...e.verticalGrids}}}function $h(e){return!!(e.projections||e.parsers||e.datumCatalogs||e.aliases||e.datumGrids||e.verticalGrids||e.resolver)}var vx=p(()=>{});async function TL(e){let t={...e,from:EL(e.from??"WGS84"),to:EL(e.to??"WGS84")},[r,n]=await Promise.all([n1(t.from,t),n1(t.to,t)]);return{...t,from:r,to:n}}async function n1(e,t){var u;let r=qh(e,t),n=yx(r.definition,t),i=typeof e=="string"||"type"in e?void 0:"crs"in e?e.crs:e,o=n===r.definition&&i?i.representation:wr(n);if(o!=="identifier"||(u=t.parsers)!=null&&u.some(h=>h.canParse(n)))return e;let s=await t.resolver.resolve({state:"explicit",provenance:(i==null?void 0:i.provenance)??"unknown",definition:n,representation:o}),a=qh(s.input,t).definition;if(!i)return a;let c=e,l={...i,definition:a,representation:wr(a),alternatives:[{definition:i.definition,representation:i.representation},...i.alternatives??[]]};return"crs"in c?{...c,crs:l}:l}function EL(e){return typeof e=="string"?e:JSON.parse(JSON.stringify(e))}var AL=p(()=>{Dl();Fu();mx()});var i1,IL=p(()=>{ML();vx();AL();dL();vx();i1=class{constructor(t={}){this.options=vL(t),this.useDefinitionSignature=!$h(t)}getCRS(t,r={}){return SL(this,t,this.options,r,this.useDefinitionSignature,this.options.resolver?n1:void 0)}createProjection(t={}){return new Wh({...this.options,...t})}async createProjectionAsync(t={}){let r={...this.options,...t};return Wh.create(r.resolver?await TL(r):r)}}});var PL=p(()=>{});var Ex,RL=p(()=>{$l();Vt();Qe();ut();Bt();Ex={name:"merc",aliases:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A"],parameters:["lon_0","lat_ts","k","k_0","x_0","y_0"],create({semiMajorAxis:e,eccentricitySquared:t,parameters:r,primeMeridian:n=0}){let i=Math.sqrt(t),o=Object.prototype.hasOwnProperty.call(r,"over"),s=re(r,"lon_0",0)*At,a=re(r,"x_0",0),c=re(r,"y_0",0),l=re(r,"k_0",re(r,"k",1));if(Object.prototype.hasOwnProperty.call(r,"lat_ts")){let g=Pf(r,"lat_ts");l=Math.cos(g)/Math.sqrt(1-t*Math.sin(g)**2)}if(l<=0)throw new Error("Mercator scale must be positive");let u=e*l,h=Math.atan(Math.sinh(Math.PI)),d=u*Math.PI,m=u*(Math.PI-i*Math.atanh(i*Math.sin(h)));return{longitudeOrigin:s,getRenderingProfile(g){if(g){let b=g[1]<=-90||g[3]>=90,w=[g[0],b?Math.max(-h*180/Math.PI,Math.min(h*180/Math.PI,g[1])):g[1],g[2],b?Math.max(-h*180/Math.PI,Math.min(h*180/Math.PI,g[3])):g[3]],_=S=>c+u*(Math.asinh(Math.tan(S))-i*Math.atanh(i*Math.sin(S)));return ur(S=>lt(Ce([a,a],Fe(Br(S,s,o),u)),[_(S[0][1]),_(S[1][1])]),w,s,n,o)}let y=[[a-d,c-m,0],[a+d,c+m,0]];return{bounds:y,normalize:ur(()=>y,Gn(Q(s-Math.PI,-h,s+Math.PI,h),n),s,n,o).normalize}},...Bi(g=>{let y=g.x,b=g.y;if(Math.abs(b)>=Math.PI/2)throw new Error("Mercator is undefined at the poles");let w=Math.asinh(Math.tan(b));g.x=a+u*Xt(y-s,o),g.y=c+u*(i===0?w+0:w-i*Math.atanh(i*Math.sin(b)))},g=>{let y=g.x,w=(g.y-c)/u,_=Math.atan(Math.sinh(w));if(i===0){g.x=Xt(s+(y-a)/u,o),g.y=_+0;return}for(let S=0;S<30;S++){let v=Math.atan(Math.sinh(w+i*Math.atanh(i*Math.sin(_))));if(Math.abs(v-_)<1e-13){g.x=Xt(s+(y-a)/u,o),g.y=v;return}_=v}throw new Error("Mercator inverse did not converge")})}}}});var Tx,LL=p(()=>{lc();Vt();Qe();ut();Bt();Tx={name:"eqc",aliases:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical"],parameters:["lon_0","lat_0","lat_ts","x_0","y_0"],create({semiMajorAxis:e,parameters:t,primeMeridian:r=0}){let n=Object.prototype.hasOwnProperty.call(t,"over"),i=re(t,"lon_0",0)*At,o=Pf(t,"lat_0"),s=Math.cos(Pf(t,"lat_ts")),a=re(t,"x_0",0),c=re(t,"y_0",0),l=e*Math.abs(s)*Math.PI;return{longitudeOrigin:i,getRenderingProfile(u){if(u)return ur(d=>lt(Ce([a,a],Fe(Br(d,i,n),e*s)),[c+e*(d[0][1]-o),c+e*(d[1][1]-o)]),u,i,r,n);let h=[[a-l,c+e*(-Math.PI/2-o),0],[a+l,c+e*(Math.PI/2-o),0]];return{bounds:h,normalize:ur(()=>h,Gn(Q(i-Math.PI,-(Math.PI/2),i+Math.PI,Math.PI/2),r),i,r,n).normalize}},...pi(u=>{u.x=a+e*s*Xt(u.x-i,n),u.y=c+e*(u.y-o)},u=>{u.x=Xt(i+(u.x-a)/(e*s),n),u.y=o+(u.y-c)/e})}}}});function SK(e){if(e.k0||(e.k0=1),e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,!(Math.abs(e.lat1+e.lat2)<1e-10)){var t=e.b/e.a;e.e=Math.sqrt(1-t*t);var r=Math.sin(e.lat1),n=Math.cos(e.lat1),i=xn(e.e,r,n),o=Qr(e.e,e.lat1,r),s=Math.sin(e.lat2),a=Math.cos(e.lat2),c=xn(e.e,s,a),l=Qr(e.e,e.lat2,s),u=Qr(e.e,e.lat0,Math.sin(e.lat0));Math.abs(e.lat1-e.lat2)>1e-10?e.ns=Math.log(i/c)/Math.log(o/l):e.ns=r,Number.isNaN(e.ns)&&(e.ns=r),e.f0=i/(e.ns*Math.pow(o,e.ns)),e.rh=Math.abs(Math.abs(e.lat0)-F)<1e-10?0:e.a*e.f0*Math.pow(u,e.ns)}}function OL(e,t){var r=t.x,n=t.y,i=Math.abs(Math.abs(n)-F),o,s;if(i>1e-10)o=e.sphere?1/Math.tan(Math.PI/4+n/2):Qr(e.e,n,Math.sin(n)),s=e.a*e.f0*Math.pow(o,e.ns);else{if(i=n*e.ns,i<=0)return null;s=0}var a=e.ns*k(r-e.long0,e.over);return t.x=e.k0*(s*Math.sin(a))+e.x0,t.y=e.k0*(e.rh-s*Math.cos(a))+e.y0,t}function BL(e,t){var r,n,i,o,s,a=(t.x-e.x0)/e.k0,c=e.rh-(t.y-e.y0)/e.k0;e.ns>0?(r=Math.sqrt(a*a+c*c),n=1):(r=-Math.sqrt(a*a+c*c),n=-1);var l=0;if(r!==0&&(l=Math.atan2(n*a,n*c)),r!==0||e.ns>0){if(n=1/e.ns,i=Math.pow(r/(e.a*e.f0),n),o=mc(e.e,i),o===-9999)return null}else o=-F;return s=k(l/e.ns+e.long0,e.over),t.x=s,t.y=o,t}function CL(e){let t={...e,ns:0,f0:0,rh:0};return SK(t),t}var DL=p(()=>{Yl();Df();_t();Dm();Ct()});var Ax,NL=p(()=>{Bt();Qe();ut();$l();kn();DL();Ax={name:"lcc",aliases:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],parameters:[...Er,...Ho,"lat_1","lat_2"],create(e){let t=xr(e);Hl(t,e.parameters);let r=CL(t),n=fr("lcc",r,OL,BL),i={...Bi(o=>{let s=o.y;if(Math.abs(s)===Math.PI/2&&s*r.ns<0)throw new Error("Lambert conformal conic is undefined at the opposite pole");n.forwardInPlace(o)},n.inverseInPlace)};return De(i,Q(t.long0-Math.PI,r.ns>0?-Math.PI/3:-Math.PI/2,t.long0+Math.PI,r.ns>0?Math.PI/2:Math.PI/3),o=>Wl(i.forward,o,t.long0,r.ns,r.x0,r.y0+r.k0*r.rh,t.over),t.primeMeridian,t.over)}}});function fn(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var Kh=p(()=>{});function o1(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));let n=4*Number.EPSILON*r;if(Math.abs(t)>r+n)return NaN;if(Math.abs(Math.abs(t)-r)<=n)return t<0?-1*F:F;for(var i=Math.asin(.5*t),o,s,a,c,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),c=e*s,o=Math.pow(1-c*c,2)/(2*a)*(t/(1-e*e)-s/(1-c*c)+.5/e*Math.log((1-c)/(1+c))),i+=o,Math.abs(o)<=1e-10)return i;return NaN}var Ix=p(()=>{Ct()});function MK(e){Math.abs(e.lat1+e.lat2)<1e-10||(e.temp=e.b/e.a,e.es=1-Math.pow(e.temp,2),e.e3=Math.sqrt(e.es),e.sin_po=Math.sin(e.lat1),e.cos_po=Math.cos(e.lat1),e.t1=e.sin_po,e.con=e.sin_po,e.ms1=xn(e.e3,e.sin_po,e.cos_po),e.qs1=fn(e.e3,e.sin_po),e.sin_po=Math.sin(e.lat2),e.cos_po=Math.cos(e.lat2),e.t2=e.sin_po,e.ms2=xn(e.e3,e.sin_po,e.cos_po),e.qs2=fn(e.e3,e.sin_po),e.sin_po=Math.sin(e.lat0),e.cos_po=Math.cos(e.lat0),e.t3=e.sin_po,e.qs0=fn(e.e3,e.sin_po),Math.abs(e.lat1-e.lat2)>1e-10?e.ns0=(e.ms1*e.ms1-e.ms2*e.ms2)/(e.qs2-e.qs1):e.ns0=e.con,e.c=e.ms1*e.ms1+e.ns0*e.qs1,e.rh=e.a*Math.sqrt(e.c-e.ns0*e.qs0)/e.ns0)}function FL(e,t){var r=t.x,n=t.y;e.sin_phi=Math.sin(n),e.cos_phi=Math.cos(n);var i=fn(e.e3,e.sin_phi),o=e.a*Math.sqrt(e.c-e.ns0*i)/e.ns0,s=e.ns0*k(r-e.long0,e.over),a=o*Math.sin(s)+e.x0,c=e.rh-o*Math.cos(s)+e.y0;return t.x=a,t.y=c,t}function GL(e,t){var r,n,i,o,s,a;if(t.x-=e.x0,t.y=e.rh-t.y+e.y0,e.ns0>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),o=0,r!==0&&(o=Math.atan2(i*t.x,i*t.y)),i=r*e.ns0/e.a,e.sphere){let c=(e.c-i*i)/(2*e.ns0);if(Math.abs(c)>1+8*Number.EPSILON)return null;a=Math.asin(Math.max(-1,Math.min(1,c)))}else{n=(e.c-i*i)/e.ns0;let c=fn(e.e3,1);a=Math.abs(Math.abs(n)-c)<=16*Number.EPSILON*c?Math.sign(n)*Math.PI/2:o1(e.e3,n)}return s=k(o/e.ns0+e.long0,e.over),t.x=s,t.y=a,t}function kL(e){let t={...e,temp:0,e3:0,sin_po:0,cos_po:0,t1:0,con:0,ms1:0,qs1:0,t2:0,ms2:0,qs2:0,t3:0,qs0:0,ns0:0,c:0,rh:0,sin_phi:0,cos_phi:0};return MK(t),t}var UL=p(()=>{Yl();Kh();_t();Ix()});var Px,jL=p(()=>{$l();Bt();Qe();ut();kn();UL();Px={name:"aea",aliases:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers"],parameters:[...Er,"lat_1","lat_2"],create(e){let t=xr(e);Hl(t,e.parameters);let r=kL(t),n={...fr("aea",r,FL,GL,Bi)};return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Wl(n.forward,i,t.long0,r.ns0,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function _s(e){return Math.abs(e)<=F?e:e-ks(e)*Math.PI}var Xh=p(()=>{Ct();Bf()});function vK(e){Math.abs(e.lat1+e.lat2)<1e-10||(e.temp=e.b/e.a,e.es=1-Math.pow(e.temp,2),e.e=Math.sqrt(e.es),e.en=uo(e.es),e.sin_phi=Math.sin(e.lat1),e.cos_phi=Math.cos(e.lat1),e.ms1=xn(e.e,e.sin_phi,e.cos_phi),e.ml1=_r(e.lat1,Math.sin(e.lat1),Math.cos(e.lat1),e.en),Math.abs(e.lat1-e.lat2)<1e-10?e.ns=e.sin_phi:(e.sin_phi=Math.sin(e.lat2),e.cos_phi=Math.cos(e.lat2),e.ms2=xn(e.e,e.sin_phi,e.cos_phi),e.ml2=_r(e.lat2,Math.sin(e.lat2),Math.cos(e.lat2),e.en),e.ns=(e.ms1-e.ms2)/(e.ml2-e.ml1)),e.g=e.ml1+e.ms1/e.ns,e.ml0=_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en),e.rh=e.a*(e.g-e.ml0))}function zL(e,t){var r=t.x,n=t.y,i;if(e.sphere)i=e.a*(e.g-n);else{var o=_r(n,Math.sin(n),Math.cos(n),e.en);i=e.a*(e.g-o)}var s=e.ns*k(r-e.long0,e.over),a=e.x0+i*Math.sin(s),c=e.y0+e.rh-i*Math.cos(s);return t.x=a,t.y=c,t}function qL(e,t){t.x-=e.x0,t.y=e.rh-t.y+e.y0;var r,n,i,o;e.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1);var s=0;if(n!==0&&(s=Math.atan2(r*t.x,r*t.y)),e.sphere)return o=k(e.long0+s/e.ns,e.over),i=_s(e.g-n/e.a),t.x=o,t.y=i,t;var a=e.g-n/e.a;return i=fo(a,e.es,e.en),o=k(e.long0+s/e.ns,e.over),t.x=o,t.y=i,t}function VL(e){let t={...e,temp:0,en:[],sin_phi:0,cos_phi:0,ms1:0,ml1:0,ns:0,ms2:0,ml2:0,g:0,ml0:0,rh:0};return vK(t),t}var WL=p(()=>{Kl();hc();Xl();Yl();_t();Xh()});var Rx,HL=p(()=>{$l();Bt();Qe();ut();kn();WL();Rx={name:"eqdc",aliases:["Equidistant_Conic"],parameters:[...Er,"lat_1","lat_2"],create(e){let t=xr(e);Hl(t,e.parameters);let r=VL(t),n=fr("eqdc",r,zL,qL,Bi);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Wl(n.forward,i,t.long0,r.ns,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function Va(e,t){let r=Math.abs(Math.sin(t)),n=Math.cos(t),i=n*n/(1+r);if(e===0)return 2*i;let o=e*e;return i*(1+o*r)/(1-o*r*r)+(1-o)/e*Math.atanh(e*i/(1-o*r))}function Lx(e,t,r){if(r===0||e===0)return r;let n=Va(e,r)/t;return Math.atan2(Math.sign(r)*(1-n),Math.sqrt(n*(2-n)))}function Ox(e,t,r){if(e===0||r===0||Math.abs(r)===Math.PI/2)return r;let n=Math.abs(Math.sin(r)),i=Math.cos(r),o=t*i*i/(1+n),s=Math.abs(r),a=e*e,c=0,l=Math.PI/2;for(let u=0;u<48;u++){let h=Math.sin(s),d=1-a*h*h,m=2*(1-a)*Math.cos(s)/(d*d),g=Va(e,s)-o,y=g/m;if(Math.abs(y)<2e-15)return Math.sign(r)*s;g>0?c=s:l=s;let b=s+y;s=b>c&&b<l?b:(c+l)/2}throw new Error("Authalic latitude inverse did not converge")}var Bx=p(()=>{});function EK(e){var t=Math.abs(e.lat0);if(Math.abs(t-F)<1e-10?e.mode=e.lat0<0?Xi:Lo:Math.abs(t)<1e-10?e.mode=Ai:e.mode=hn,e.es>0){var r;switch(e.qp=fn(e.e,1),e.mmf=.5/(1-e.es),e.mode){case Lo:e.dd=1;break;case Xi:e.dd=1;break;case Ai:e.rq=Math.sqrt(.5*e.qp),e.dd=1/e.rq,e.xmf=1,e.ymf=.5*e.qp;break;case hn:e.rq=Math.sqrt(.5*e.qp),r=Math.sin(e.lat0),e.sinb1=fn(e.e,r)/e.qp,e.cosb1=Math.sqrt(1-e.sinb1*e.sinb1),e.dd=Math.cos(e.lat0)/(Math.sqrt(1-e.es*r*r)*e.rq*e.cosb1),e.xmf=e.rq,e.ymf=e.xmf/e.dd,e.xmf*=e.dd;break}}else e.mode===hn&&(e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0))}function $L(e,t){var r,n,i,o,s,a,c,l,u,h,d=t.x,m=t.y;if(d=k(d-e.long0,e.over),e.sphere){if(s=Math.sin(m),h=Math.cos(m),i=Math.cos(d),e.mode===hn||e.mode===Ai){if(n=e.mode===Ai?1+h*i:1+e.sinph0*s+e.cosph0*h*i,n<=1e-10)return null;n=Math.sqrt(2/n),r=n*h*Math.sin(d),n*=e.mode===Ai?s:e.cosph0*s-e.sinph0*h*i}else if(e.mode===Lo||e.mode===Xi){if(e.mode===Lo&&(i=-i),Math.abs(m+e.lat0)<1e-10)return null;n=et-m*.5,n=2*(e.mode===Xi?Math.cos(n):Math.sin(n)),r=n*Math.sin(d),n*=i}}else{if(c=0,l=0,u=0,i=Math.cos(d),o=Math.sin(d),s=Math.sin(m),a=fn(e.e,s),e.mode===hn||e.mode===Ai){c=a/e.qp;let g=Va(e.e,m)/e.qp;l=Math.sqrt(g*(2-g))}switch(e.mode){case hn:u=1+e.sinb1*c+e.cosb1*l*i;break;case Ai:u=1+l*i;break;case Lo:u=F+m,a=m>=0?Va(e.e,m):2*e.qp-Va(e.e,m);break;case Xi:u=m-F,a=m<=0?Va(e.e,m):2*e.qp-Va(e.e,m);break}if(Math.abs(u)<1e-10)return null;switch(e.mode){case hn:case Ai:u=Math.sqrt(2/u),e.mode===hn?n=e.ymf*u*(e.cosb1*c-e.sinb1*l*i):(u=Math.sqrt(2/(1+l*i)),n=u*c*e.ymf),r=e.xmf*u*l*o;break;case Lo:case Xi:a>=0?(u=Math.sqrt(a),r=u*o,n=i*(e.mode===Xi?u:-u)):r=n=0;break}}return t.x=e.a*r+e.x0,t.y=e.a*n+e.y0,t}function KL(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.x/e.a,n=t.y/e.a,i,o,s,a,c,l,u;if(e.sphere){var h=0,d,m=0;if(d=Math.sqrt(r*r+n*n),o=d*.5,o>1+8*Number.EPSILON)return null;switch(o=2*Math.asin(Math.min(1,o)),(e.mode===hn||e.mode===Ai)&&(m=Math.sin(o),h=Math.cos(o)),e.mode){case Ai:o=Math.abs(d)<=1e-10?0:Ci(0,1,m,h,r,n,d),r*=m,n=h*d;break;case hn:o=Math.abs(d)<=1e-10?e.lat0:Ci(e.sinph0,e.cosph0,m,h,r,n,d),r*=m*e.cosph0,n=(h-Math.sin(o)*e.sinph0)*d;break;case Lo:n=-n,o=F-o;break;case Xi:o-=F;break}i=n===0&&(e.mode===Ai||e.mode===hn)?0:Math.atan2(r,n)}else{if(u=0,e.mode===hn||e.mode===Ai){if(r/=e.dd,n*=e.dd,l=Math.sqrt(r*r+n*n),l<1e-10)return t.x=e.long0,t.y=e.lat0,t;let g=.5*l/e.rq;if(g>1+8*Number.EPSILON)return null;a=2*Math.asin(Math.min(1,g)),s=Math.cos(a),a=Math.sin(a);let y=Ci(e.mode===hn?e.sinb1:0,e.mode===hn?e.cosb1:1,a,s,r,n,l);o=Ox(e.e,e.qp,y),r*=a,e.mode===hn?(u=s*e.sinb1+n*a*e.cosb1/l,c=e.qp*u,n=l*e.cosb1*s-n*e.sinb1*a):(u=n*a/l,c=e.qp*u,n=l*s)}else if(e.mode===Lo||e.mode===Xi){if(e.mode===Lo&&(n=-n),c=r*r+n*n,!c)return t.x=e.long0,t.y=e.lat0,t;u=1-c/e.qp,e.mode===Xi&&(u=-u)}if(i=Math.atan2(r,n),Math.abs(u)>1+8*Number.EPSILON)return null;if(e.mode===Lo||e.mode===Xi){let g=Math.max(0,Math.min(2,c/e.qp)),y=Math.atan2(u,Math.sqrt(g*(2-g)));o=Ox(e.e,e.qp,y)}}return t.x=k(e.long0+i,e.over),t.y=o,t}function XL(e){let t={...e,mode:0,qp:0,mmf:0,dd:0,rq:0,xmf:0,ymf:0,sinb1:0,cosb1:0,sinph0:0,cosph0:0};return EK(t),t}var Xi,Lo,Ai,hn,YL=p(()=>{Ct();Kh();_t();Bx();Cf();Xi=1,Lo=2,Ai=3,hn=4});var Cx,ZL=p(()=>{Bx();zs();qs();kn();YL();Cx={name:"laea",aliases:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area"],parameters:Er,create(e){let t=xr(e),r=XL(t);return wn(Fs(t,fr("laea",r,$L,KL)),t,Math.PI*179/180,(n,i)=>WT(t,t.sphere?1:r.xmf||Math.sqrt(r.qp/2),t.sphere?1:r.ymf||Math.sqrt(r.qp/2),n,i,t.sphere?t.lat0:Lx(t.e,r.qp,t.lat0),t.sphere?o=>o:o=>Lx(t.e,r.qp,o)))}}});function s1(e,t){return Math.pow((1-e)/(1+e),t)}var JL=p(()=>{});function AK(e){var t=Math.sin(e.lat0),r=Math.cos(e.lat0);r*=r,e.rc=Math.sqrt(1-e.es)/(1-e.es*t*t),e.C=Math.sqrt(1+e.es*r*r/(1-e.es)),e.phic0=Math.asin(t/e.C),e.ratexp=.5*e.C*e.e,e.K=Math.tan(.5*e.phic0+et)/(Math.pow(Math.tan(.5*e.lat0+et),e.C)*s1(e.e*t,e.ratexp))}function QL(e,t){var r=t.x,n=t.y;return t.y=2*Math.atan(e.K*Math.pow(Math.tan(.5*n+et),e.C)*s1(e.e*Math.sin(n),e.ratexp))-F,t.x=e.C*r,t}function eO(e,t){for(var r=1e-14,n=t.x/e.C,i=t.y,o=Math.pow(Math.tan(.5*i+et)/e.K,1/e.C),s=TK;s>0&&(i=2*Math.atan(o*s1(e.e*Math.sin(t.y),-.5*e.e))-F,!(Math.abs(i-t.y)<r));--s)t.y=i;return s?(t.x=n,t.y=i,t):null}function tO(e){let t={...e,rc:0,C:0,phic0:0,ratexp:0,K:0};return AK(t),t}var TK,rO=p(()=>{JL();Ct();TK=20});function IK(e){e.rc&&(e.sinc0=Math.sin(e.phic0),e.cosc0=Math.cos(e.phic0),e.R2=2*e.rc)}function nO(e,t){var r,n,i,o;return t.x=k(t.x-e.long0,e.over),QL(e,t),r=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),o=e.k0*e.R2/(1+e.sinc0*r+e.cosc0*n*i),t.x=o*n*Math.sin(t.x),t.y=o*(e.cosc0*r-e.sinc0*n*i),t.x=e.a*t.x+e.x0,t.y=e.a*t.y+e.y0,t}function iO(e,t){var r,n,i,o,s;if(t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,t.x/=e.k0,t.y/=e.k0,s=tr(t.x,t.y),s){var a=2*Math.atan2(s,e.R2);r=Math.sin(a),n=Math.cos(a),o=Ci(e.sinc0,e.cosc0,r,n,t.x,t.y,s),i=Math.atan2(t.x*r,s*e.cosc0*n-t.y*e.sinc0*r)}else o=e.phic0,i=0;if(t.x=i,t.y=o,!eO(e,t))throw new Error("Oblique stereographic inverse did not converge");return t.x=k(t.x+e.long0,e.over),t}function oO(e){let t={...tO(e),sinc0:0,cosc0:0,R2:0};return IK(t),t}var sO=p(()=>{Cf();rO();_t();fc()});var Dx,aO=p(()=>{zs();qs();kn();sO();Dx={name:"sterea",aliases:["Stereographic_North_Pole","Oblique_Stereographic","Oblique Stereographic Alternative","Double_Stereographic"],parameters:[...Er,...Ho],create(e){let t=xr(e);if(Math.abs(t.lat0)===Math.PI/2)throw new Error("sterea requires a non-polar origin; use stere at the poles");let r=oO(t);return wn(Fs(t,fr("sterea",r,nO,iO)),t,Math.PI*150/180,(n,i)=>Cm(t,o=>2*Math.atan(r.K*Math.pow(Math.tan(Math.PI/4+o/2),r.C)*Math.pow((1-t.e*Math.sin(o))/(1+t.e*Math.sin(o)),r.ratexp))-Math.PI/2,r.phic0,t.a*t.k0*r.R2,n,i,r.C,Math.abs(Math.log(r.C))+Math.abs(Math.log(r.K))+r.C*t.e*Math.atanh(t.e)))}}});function Nx(e,t){let r=1-e*Math.sin(t)**2;return(1-e)/(r*Math.sqrt(r))}function a1(e,t,r,n){return Nx(e,t-r*n)+Nx(e,t+r*n)}function ci(e,t,r,n){let i=(n-r)/8,o=0;for(let s=0;s<4;s++){let a=r+(2*s+1)*i;o+=i*(.362683783378362*a1(t,a,i,.1834346424956498)+.3137066458778873*a1(t,a,i,.525532409916329)+.2223810344533745*a1(t,a,i,.7966664774136267)+.1012285362903763*a1(t,a,i,.9602898564975363))}return e*o}function Fx(e,t,r){let n=Math.PI/2,i=ci(e,t,0,n);if(!Number.isFinite(r)||Math.abs(r)>i)return NaN;let o=-n,s=n,a=r/i*n;for(let c=0;c<48;c++){let l=ci(e,t,0,a)-r;if(Math.abs(l)<=8*Number.EPSILON*e)return a;l>0?s=a:o=a;let u=a-l/(e*Nx(t,a));a=u>o&&u<s?u:(o+s)/2}return NaN}var Gx=p(()=>{});function cO(e,t,r,n,i,o,s){let a=n-t,c=Math.atan((1-o)*Math.tan(e)),l=Math.atan((1-o)*Math.tan(r)),u=Math.sin(c),h=Math.cos(c),d=Math.sin(l),m=Math.cos(l),g=a,y,b=100,w,_,S,v,T,O,P,M,U,C,L,A,W,G;do{if(w=Math.sin(g),_=Math.cos(g),S=Math.sqrt(m*w*(m*w)+(h*d-u*m*_)*(h*d-u*m*_)),S===0){s.x=0,s.y=0;return}v=u*d+h*m*_,T=Math.atan2(S,v),O=h*m*w/S,P=1-O*O,M=P!==0?v-2*u*d/P:0,U=o/16*P*(4+o*(4-3*P)),y=g,g=a+(1-U)*o*O*(T+U*S*(M+U*v*(-1+2*M*M)))}while(Math.abs(g-y)>1e-12&&--b>0);if(b===0){s.x=NaN,s.y=NaN;return}C=P*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),L=1+C/16384*(4096+C*(-768+C*(320-175*C))),A=C/1024*(256+C*(-128+C*(74-47*C))),W=A*S*(M+A/4*(v*(-1+2*M*M)-A/6*M*(-3+4*S*S)*(-3+4*M*M))),G=i*(1-o)*L*(T-W);let E=Math.atan2(m*w,h*d-u*m*_);s.x=E,s.y=G}function lO(e,t,r,n,i,o,s){let a=Math.atan((1-o)*Math.tan(e)),c=Math.sin(a),l=Math.cos(a),u=Math.sin(r),h=Math.cos(r),d=Math.atan2(c,l*h),m=l*u,g=1-m*m,y=g*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),b=1+y/16384*(4096+y*(-768+y*(320-175*y))),w=y/1024*(256+y*(-128+y*(74-47*y))),_=n/(i*(1-o)*b),S,v=100,T,O,P,M;do T=Math.cos(2*d+_),O=Math.sin(_),P=Math.cos(_),M=w*O*(T+w/4*(P*(-1+2*T*T)-w/6*T*(-3+4*O*O)*(-3+4*T*T))),S=_,_=n/(i*(1-o)*b)+M;while(Math.abs(_-S)>1e-12&&--v>0);if(v===0){s.x=NaN,s.y=NaN;return}let U=c*O-l*P*h,C=Math.atan2(c*P+l*O*h,(1-o)*Math.sqrt(m*m+U*U)),L=Math.atan2(O*u,l*P-c*O*h),A=o/16*g*(4+o*(4-3*g)),W=L-(1-A)*o*m*(_+A*O*(T+A*P*(-1+2*T*T))),G=t+W;s.x=G,s.y=C}var uO=p(()=>{});function PK(e){e.sin_p12=Math.sin(e.lat0),e.cos_p12=Math.cos(e.lat0),e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.f=e.es/(1+Math.sqrt(1-e.es))}function fO(e,t){var r=t.x,n=t.y,i=Math.sin(t.y),o=Math.cos(t.y),s=k(r-e.long0,e.over),a,c,l,u,h;if(e.sphere)return Math.abs(e.sin_p12-1)<=1e-10?(t.x=e.x0+e.a*(F-n)*Math.sin(s),t.y=e.y0-e.a*(F-n)*Math.cos(s),t):Math.abs(e.sin_p12+1)<=1e-10?(t.x=e.x0+e.a*(F+n)*Math.sin(s),t.y=e.y0+e.a*(F+n)*Math.cos(s),t):(u=e.sin_p12*i+e.cos_p12*o*Math.cos(s),c=Math.acos(u),l=c?c/Math.sin(c):1,t.x=e.x0+e.a*l*o*Math.sin(s),t.y=e.y0+e.a*l*(e.cos_p12*i-e.sin_p12*o*Math.cos(s)),t);if(Math.abs(e.sin_p12-1)<=1e-10)return a=ci(e.a,e.es,n,F),t.x=e.x0+a*Math.sin(s),t.y=e.y0-a*Math.cos(s),t;if(Math.abs(e.sin_p12+1)<=1e-10)return a=ci(e.a,e.es,-F,n),t.x=e.x0+a*Math.sin(s),t.y=e.y0+a*Math.cos(s),t;{if(Math.abs(s)<1e-10&&Math.abs(n-e.lat0)<1e-10)return t.x=e.x0,t.y=e.y0,t;cO(e.lat0,e.long0,n,r,e.a,e.f,t),h=t.x;let d=t.y;return t.x=e.x0+d*Math.sin(h),t.y=e.y0+d*Math.cos(h),t}}function hO(e,t){t.x-=e.x0,t.y-=e.y0;var r,n,i,o,s,a,c,l,u,h,d;if(e.sphere){if(r=Math.sqrt(t.x*t.x+t.y*t.y),r>2*F*e.a)return null;if(n=r/e.a,i=Math.sin(n),o=Math.cos(n),s=e.long0,Math.abs(r)<=1e-10)a=e.lat0;else if(a=Ci(e.sin_p12,e.cos_p12,i,o,t.x,t.y,r),c=Math.abs(e.lat0)-F,Math.abs(c)<=1e-10)if(e.lat0>=0){if(!Number.isFinite(a))return null;s=k(e.long0+Math.atan2(t.x,-t.y),e.over)}else s=k(e.long0-Math.atan2(-t.x,t.y),e.over);else s=k(e.long0+Math.atan2(t.x*i,r*e.cos_p12*o-t.y*e.sin_p12*i),e.over);return t.x=s,t.y=a,t}else return Math.abs(e.sin_p12-1)<=1e-10?(l=ci(e.a,e.es,0,F),r=Math.sqrt(t.x*t.x+t.y*t.y),u=l-r,a=Fx(e.a,e.es,u),Number.isFinite(a)?(s=k(e.long0+Math.atan2(t.x,-1*t.y),e.over),t.x=s,t.y=a,t):null):Math.abs(e.sin_p12+1)<=1e-10?(l=ci(e.a,e.es,0,F),r=Math.sqrt(t.x*t.x+t.y*t.y),u=r-l,a=Fx(e.a,e.es,u),Number.isFinite(a)?(s=k(e.long0+Math.atan2(t.x,t.y),e.over),t.x=s,t.y=a,t):null):(h=Math.atan2(t.x,t.y),d=Math.sqrt(t.x*t.x+t.y*t.y),lO(e.lat0,e.long0,h,d,e.a,e.f,t),t)}function dO(e){let t={...e,sin_p12:0,cos_p12:0,f:0};return PK(t),t}var mO=p(()=>{Cf();_t();Ct();Gx();uO()});var kx,pO=p(()=>{zs();qs();kn();mO();kx={name:"aeqd",aliases:["Azimuthal_Equidistant"],parameters:Er,create(e){let t=xr(e),r=dO(t);return wn(Fs(t,fr("aeqd",r,fO,hO)),t,Math.PI*179/180,(n,i)=>VT(t,n,i))}}});var Ux,gO=p(()=>{Vh();_x();Ux={name:"geocent",aliases:["Geocentric","geocentric","Geocent"],parameters:[],create({semiMajorAxis:e,semiMinorAxis:t,eccentricitySquared:r,primeMeridian:n=0}){let i={semiMajorAxis:e,eccentricitySquared:r,semiMinorAxis:t??e*Math.sqrt(1-r)};return{getRenderingProfile:()=>({bounds:[[-e,-e,-i.semiMinorAxis],[e,e,i.semiMinorAxis]],normalize:qa({},n)().normalize}),forward(){throw new Error("Geocentric projection requires the 3D pipeline")},inverse(){throw new Error("Geocentric projection requires the 3D pipeline")},forwardInPlace:o=>J0(o,i),inverseInPlace:o=>Q0(o,i),forward3D:o=>iL(o,i),inverse3D:o=>oL(o,i)}}}});function yO(e,t,r){let n=Os(Br(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]),s=Math.max(Math.abs(e.a*(e.es?e.am1:e.cphi1)+e.y0-o[0]),Math.abs(e.a*(e.es?e.am1:e.cphi1)+e.y0-o[1])),a=Math.min(s,i*n),c=Math.min(2*s,i*n);return lt([e.x0-a,e.x0+a],[o[0]-c,o[1]+c])}function bO(e,t,r){let n=Os(Br(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=i*n*n/4,s=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return e.sphere&&(r[0][1]-e.lat0<-Math.PI/2||r[1][1]-e.lat0>Math.PI/2)&&(s=[e.y0-e.a*Math.PI/2,e.y0+e.a*Math.PI/2]),lt([e.x0-i*n,e.x0+i*n],[s[0]-o,s[1]+o])}function wO(e,t,r){let n=Os(Br(r,e.long0,e.over));if(e.sphere&&n>Math.PI/2)throw new Error("Unsupported Cassini rendering coverage");let i=e.a/Math.sqrt(1-e.es),o=e.es/(1-e.es),s=e.sphere?e.a*Math.asin(Math.min(1,Math.sin(Math.min(n,Math.PI/2)))):i*(n+n**3/6+(9+8*o)*n**5/120),a=e.sphere?e.a*n:i*(n*n/4+(6+6*o)*n**4/24),c=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return lt([e.x0-s,e.x0+s],[c[0]-a,c[1]+a])}function jx(e,t){return t[0]<=0&&t[1]>=0?[-1/0,1/0]:Ot(e,mi(1/t[0],1/t[1]))}function xO(e,t){let r=l=>{let u=e.alpha*(Math.asinh(Math.tan(l))-e.e*Math.atanh(e.e*Math.sin(l)))+e.K;return Math.asin(Math.tanh(u))},n=Q((t[0][0]-e.long0)*e.alpha,r(t[0][1]),(t[1][0]-e.long0)*e.alpha,r(t[1][1])),i=dt([-Math.sin(e.b0),0,Math.cos(e.b0)],n);if(Os(i)>=1-1e-14)throw new Error("Swiss oblique Mercator coverage reaches a rotated pole");let o=dt([0,1,0],n),s=dt([Math.cos(e.b0),0,Math.sin(e.b0)],n),a=jx(o,s).map(Math.atan),c=i.map(l=>Math.atanh(Math.max(-1+Number.EPSILON,Math.min(1-Number.EPSILON,l))));return lt(Ce([e.x0,e.x0],Fe(a,e.R)),Ce([e.y0,e.y0],Fe(c,e.R)))}function _O(e,t){let r=g=>Math.log(e.E)-e.B*Math.log(Qr(e.e,g,Math.sin(g))),n=mi(r(t[0][1]),r(t[1][1])),i=Fe([t[0][0]-e.lam0,t[1][0]-e.lam0],e.B),o=Q(i[0],Math.asin(Math.tanh(n[0])),i[1],Math.asin(Math.tanh(n[1]))),s=dt([0,-e.cosgam,e.singam],o),a=Fe(mi(-Math.atanh(s[0]),-Math.atanh(s[1])),e.ArB),c=Ce(Fe([Math.sinh(n[0]),Math.sinh(n[1])],e.cosgam),Fe(Rf(i),e.singam)),l=vm(i),u=l[0]>0?jx(c,l).map(Math.atan):[-Math.PI,Math.PI],h=Fe(u,e.ArB),d,m;return e.no_rot?(d=h,m=a):(h=Ce(h,[-e.u_0,-e.u_0]),d=Ce(Fe(a,e.cosrot),Fe(h,e.sinrot)),m=Ce(Fe(h,e.cosrot),Fe(a,-e.sinrot))),lt(Ce([e.x0,e.x0],Fe(d,e.a)),Ce([e.y0,e.y0],Fe(m,e.a)))}function SO(e,t){let r=m=>2*(Math.atan(e.k*Math.pow(Math.tan(m/2+e.s45),e.alfa)/Math.pow((1+e.e*Math.sin(m))/(1-e.e*Math.sin(m)),e.alfa*e.e/2))-e.s45),n=Fe(Br(t,e.long0,e.over),-e.alfa),i=Q(n[0],r(t[0][1]),n[1],r(t[1][1])),o=dt([Math.sin(e.ad),0,Math.cos(e.ad)],i),s=[Math.sqrt(Math.max(Number.EPSILON,1-Os(o)**2)),1],a=dt([0,1,0],i),c=jx(a,s),l=Fe(c.map(m=>Math.asin(Math.max(-1,Math.min(1,m)))),e.n),u=m=>e.ro0*Math.pow(Math.tan(e.s0/2+e.s45)/Math.tan(Math.asin(m)/2+e.s45),e.n),h=mi(u(o[0]),u(o[1])),d=e.czech?1:-1;return lt(Ce([e.x0,e.x0],Fe(Ot(h,Rf(l)),d)),Ce([e.y0,e.y0],Fe(Ot(h,vm(l)),d)))}function MO(e,t){let r=Fe([t[0][1]-e.lat0,t[1][1]-e.lat0],1e-5/Of),n=Br(t,e.long0,e.over),i=[0,0];for(let l=10;l>=1;l--)i=Ce([e.A[l],e.A[l]],Ot(i,r));i=Ot(i,r);let o=[0,0],s=[0,0];for(let l=6;l>=1;l--){let u=Ce(Ot(o,i),Fe(Ot(s,n),-1)),h=Ce(Ot(o,n),Ot(s,i));o=Ce(u,[e.B_re[l],e.B_re[l]]),s=Ce(h,[e.B_im[l],e.B_im[l]])}let a=Ce(Ot(o,i),Fe(Ot(s,n),-1)),c=Ce(Ot(o,n),Ot(s,i));return lt(Ce([e.x0,e.x0],Fe(c,e.a)),Ce([e.y0,e.y0],Fe(a,e.a)))}var Wa=p(()=>{Qe();dc();Bt();Df();Ct()});function Ae(e){let t=xr(e);return{...t,x0:0,y0:0,lat_ts:Number.isNaN(t.lat_ts)?0:t.lat_ts}}function kt(e,t){return{...e,x0:re(t.parameters,"x_0",0),y0:re(t.parameters,"y_0",0)}}function Ie(e,t,r,n,i,o){let s=fr(e,r,n,i),a=re(t.parameters,"x_0",0),c=re(t.parameters,"y_0",0);return pi(l=>{o==null||o(l.x,l.y),s.forwardInPlace(l),l.x+=a,l.y+=c},l=>{l.x-=a,l.y-=c,s.inverseInPlace(l)})}function Ha(e,t=0,r=!1){return(n,i)=>{let o=Math.sin(e.lat0)*Math.sin(i)+Math.cos(e.lat0)*Math.cos(i)*Math.cos(n-e.long0);if(r?o<t-1e-14:o<=t+1e-14)throw new Error("Coordinate is outside the visible projection horizon")}}var Ut=p(()=>{lc();kn();Vt()});function RK(e){var t;if(e.phi1=e.lat1,Math.abs(e.phi1)<Yh)throw new Error;e.es?(e.en=uo(e.es),e.am1=Math.sin(e.phi1),t=Math.cos(e.phi1),e.m1=_r(e.phi1,e.am1,t,e.en),e.am1=t/(Math.sqrt(1-e.es*e.am1*e.am1)*e.am1)):Math.abs(e.phi1)+Yh>=F?e.cphi1=0:e.cphi1=1/Math.tan(e.phi1)}function LK(e,t){var r=k(t.x-(e.long0||0),e.over),n=t.y,i,o,s;return o=Math.sin(n),s=Math.cos(n),i=e.am1+e.m1-_r(n,o,s,e.en),o=s*r/(i*Math.sqrt(1-e.es*o*o)),t.x=i*Math.sin(o),t.y=e.am1-i*Math.cos(o),t.x=e.a*t.x+(e.x0||0),t.y=e.a*t.y+(e.y0||0),t}function OK(e,t){t.x=(t.x-(e.x0||0))/e.a,t.y=(t.y-(e.y0||0))/e.a;var r,n,i,o;if(t.y=e.am1-t.y,n=tr(t.x,t.y),e.phi1<0&&(n=-n),o=fo(e.am1+e.m1-n,e.es,e.en),r=Math.abs(o),r<F)r=Math.sin(o),i=n*Math.atan2(Math.sign(e.phi1)*t.x,Math.sign(e.phi1)*t.y)*Math.sqrt(1-e.es*r*r)/Math.cos(o);else if(Math.abs(r-F)<=Yh)i=0;else throw new Error;return t.x=k(i+(e.long0||0),e.over),t.y=_s(o),t}function BK(e,t){var r=k(t.x-(e.long0||0),e.over),n=t.y,i,o;return o=e.cphi1+e.phi1-n,Math.abs(o)>Yh?(i=r*Math.cos(n)/o,t.x=o*Math.sin(i),t.y=e.cphi1-o*Math.cos(i)):t.x=t.y=0,t.x=e.a*t.x+(e.x0||0),t.y=e.a*t.y+(e.y0||0),t}function CK(e,t){t.x=(t.x-(e.x0||0))/e.a,t.y=(t.y-(e.y0||0))/e.a;var r,n;t.y=e.cphi1-t.y;var i=tr(t.x,t.y);if(e.phi1<0&&(i=-i),n=e.cphi1+e.phi1-i,Math.abs(n)>F)throw new Error;return Math.abs(Math.abs(n)-F)<=Yh?r=0:r=i*Math.atan2(Math.sign(e.phi1)*t.x,Math.sign(e.phi1)*t.y)/Math.cos(n),t.x=k(r+(e.long0||0),e.over),t.y=_s(n),t}function vO(e,t){return e.es?LK(e,t):BK(e,t)}function EO(e,t){return e.es?OK(e,t):CK(e,t)}function TO(e,t={}){let r={...e,phi1:0,en:[],m1:0,am1:0,cphi1:0,...t};return RK(r),r}var Yh,AO=p(()=>{Xh();_t();fc();Kl();Xl();hc();Ct();Yh=1e-10});var zx,IO=p(()=>{Wa();Qe();ut();Ut();AO();zx={name:"bonne",aliases:["Bonne (Werner lat_1=90)"],parameters:["lon_0","x_0","y_0","lat_1"],create(e){let t=Ae(e);if(!Object.prototype.hasOwnProperty.call(e.parameters,"lat_1")||Math.abs(t.lat1)<1e-10)throw new Error("Bonne requires a nonzero lat_1");let r=TO(t),n=Ie("bonne",e,r,vO,EO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>yO(kt(r,e),n.forward,i),t.primeMeridian,t.over)}}});function ku(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}var qx=p(()=>{});function DK(e){e.sphere||(e.en=uo(e.es),e.ml0=e.a*_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function Wx(e,t){var r,n,i=t.x,o=t.y;if(i=k(i-e.long0,e.over),e.sphere)r=e.a*Math.asin(Math.cos(o)*Math.sin(i)),n=e.a*(Math.atan2(Math.tan(o),Math.cos(i))-e.lat0);else{var s=Math.sin(o),a=Math.cos(o),c=ku(e.a,e.e,s),l=Math.tan(o)*Math.tan(o),u=i*Math.cos(o),h=u*u,d=e.es*a*a/(1-e.es),m=e.a*_r(o,s,a,e.en);r=c*u*(1-h*l*(1/6+(8-l+8*d)*h/120)),n=m-e.ml0+c*s/a*h*(.5+(5-l+6*d)*h/24)}return t.x=r+e.x0,t.y=n+e.y0,t}function PO(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.x/e.a,n=t.y/e.a,i,o;if(e.sphere){var s=n+e.lat0;i=Math.asin(Math.sin(s)*Math.cos(r)),o=Math.atan2(Math.tan(r),Math.cos(s))}else{var a=e.ml0/e.a+n,c=fo(a,e.es,e.en);if(Math.abs(Math.abs(c)-F)<=1e-10)return t.x=e.long0,t.y=Math.sign(c)*F,t;var l=ku(e.a,e.e,Math.sin(c)),u=l*l*l/e.a/e.a*(1-e.es),h=Math.pow(Math.tan(c),2),d=r*e.a/l,m=d*d;i=c-l*Math.tan(c)/u*d*d*(.5-(1+3*h)*d*d/24),o=d*(1-m*(h/3-(1+3*h)*h*m/15))/Math.cos(c)}if(!e.sphere){let g=t.x+e.x0,y=t.y+e.y0,b=e.scratch,w=!1;for(let _=0;_<12;_++){Vx(e,o,i);let S=b.x-g,v=b.y-y;if(Math.max(Math.abs(S),Math.abs(v))<1e-7){w=!0;break}let T=1e-7,O=i>F-T?-T:T,P=b.x,M=b.y;Vx(e,o+T,i);let U=(b.x-P)/T,C=(b.y-M)/T;Vx(e,o,i+O);let L=(b.x-P)/O,A=(b.y-M)/O,W=U*A-L*C;if(!Number.isFinite(W)||Math.abs(W)<1e-12||(o-=(A*S-L*v)/W,i-=(U*v-C*S)/W,!Number.isFinite(o)||Math.abs(i)>F))break}if(!w)throw new Error("Cassini inverse did not converge")}return t.x=k(o+e.long0,e.over),t.y=_s(i),t}function Vx(e,t,r){e.scratch.x=t+e.long0,e.scratch.y=r,Wx(e,e.scratch)}function RO(e,t={}){let r={...e,en:[],scratch:{x:0,y:0},ml0:0,...t};return DK(r),r}var LO=p(()=>{Kl();hc();Xl();qx();_t();Xh();Ct()});var Hx,OO=p(()=>{Wa();Qe();ut();Ut();LO();Hx={name:"cass",aliases:["Cassini","Cassini_Soldner"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=RO(t),n=Ie("cass",e,r,Wx,PO);return De(n,Q(t.long0-Math.PI/6,-Math.PI/2+1e-8,t.long0+Math.PI/6,Math.PI/2-1e-8),i=>wO(kt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function NK(e){e.sphere||(e.k0=xn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts)))}function BO(e,t){var r=t.x,n=t.y,i,o,s=k(r-e.long0,e.over);if(e.sphere)i=e.x0+e.a*s*Math.cos(e.lat_ts),o=e.y0+e.a*Math.sin(n)/Math.cos(e.lat_ts);else{var a=fn(e.e,Math.sin(n));i=e.x0+e.a*e.k0*s,o=e.y0+e.a*a*.5/e.k0}return t.x=i,t.y=o,t}function CO(e,t){t.x-=e.x0,t.y-=e.y0;var r,n;return e.sphere?(r=k(e.long0+t.x/e.a/Math.cos(e.lat_ts),e.over),n=Math.asin(t.y/e.a*Math.cos(e.lat_ts))):(n=o1(e.e,2*t.y*e.k0/e.a),r=k(e.long0+t.x/(e.a*e.k0),e.over)),t.x=r,t.y=n,t}function DO(e,t={}){let r={...e,...t};return NK(r),r}var NO=p(()=>{_t();Kh();Yl();Ix()});var $x,FO=p(()=>{Bt();Qe();ut();Ut();NO();$x={name:"cea",aliases:[],parameters:["lon_0","x_0","y_0","lat_ts"],create(e){let t=Ae(e);if(Math.abs(t.lat_ts)>=Math.PI/2)throw new Error("CEA standard parallel must be away from the poles");let r=DO(t),n=Ie("cea",e,r,BO,CO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function sl(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}var c1=p(()=>{});function GK(e){e.long0=e.long0||0,e.sphere?(e.n=1,e.m=0,e.es=0,e.C_y=Math.sqrt((e.m+1)/e.n),e.C_x=e.C_y/(e.m+1)):e.en=uo(e.es)}function l1(e,t){var r,n,i=t.x,o=t.y;if(i=k(i-e.long0,e.over),e.sphere){if(!e.m)o=e.n!==1?Math.asin(e.n*Math.sin(o)):o;else for(var s=e.n*Math.sin(o),a=FK;a;--a){var c=(e.m*o+Math.sin(o)-s)/(e.m+Math.cos(o));if(o-=c,Math.abs(c)<1e-10)break}r=e.a*e.C_x*i*(e.m+Math.cos(o)),n=e.a*e.C_y*o}else{var l=Math.sin(o),u=Math.cos(o);n=e.a*_r(o,l,u,e.en),r=e.a*i*u/Math.sqrt(1-e.es*l*l)}return t.x=r,t.y=n,t}function u1(e,t){var r,n,i,o;if(t.x-=e.x0,i=t.x/e.a,t.y-=e.y0,r=t.y/e.a,e.sphere){if(r/=e.C_y,i=i/(e.C_x*(e.m+Math.cos(r))),e.m){let s=(e.m*r+Math.sin(r))/e.n;if(Math.abs(s)>1+8*Number.EPSILON)return null;r=sl(s)}else e.n!==1&&(r=sl(Math.sin(r)/e.n));i=k(i+e.long0,e.over),r=_s(r)}else r=fo(t.y/e.a,e.es,e.en),o=Math.abs(r),o<F?(o=Math.sin(r),n=e.long0+t.x*Math.sqrt(1-e.es*o*o)/(e.a*Math.cos(r)),i=k(n,e.over)):o-1e-10<F&&(i=e.long0);return t.x=i,t.y=r,t}function GO(e,t={}){let r={...e,en:[],n:0,m:0,C_y:0,C_x:0,...t};return GK(r),r}var FK,Kx=p(()=>{_t();Xh();Kl();hc();Xl();Ct();c1();FK=20});function kK(e){e.sphere=!0,e.b=e.a,e.m=1,e.n=2.5707963267948966,e.es=0,e.C_y=Math.sqrt((e.m+1)/e.n),e.C_x=e.C_y/(e.m+1)}function jO(e,t={}){let r={...e,m:0,n:0,C_y:0,C_x:0,en:[],...t};return kK(r),r}var kO,UO,zO=p(()=>{Kx();kO=l1,UO=u1});var Xx,qO=p(()=>{Bt();Qe();ut();Ut();zO();Xx={name:"eck6",aliases:["Eckert_VI"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=jO(t),n=Ie("eck6",e,r,kO,UO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function Yx(e){var t,r=[];return r[0]=e*UK,t=e*e,r[0]+=t*jK,r[1]=t*qK,t*=e,r[0]+=t*zK,r[1]+=t*VK,r[2]=t*WK,r}var UK,jK,zK,qK,VK,WK,VO=p(()=>{UK=.3333333333333333,jK=.17222222222222222,zK=.10257936507936508,qK=.06388888888888888,VK=.0664021164021164,WK=.016415012942191543});function Zx(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var WO=p(()=>{});function HK(e){e.long0=e.long0!==void 0?e.long0:0,e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.es!==0&&(e.apa=Yx(e.es),e.qp=fn(e.e,1),e.rqda=Math.sqrt(.5*e.qp))}function HO(e,t){var r=k(t.x-e.long0,e.over),n=t.y,i=Math.sin(n);e.es!==0&&(i=fn(e.e,i)/e.qp);var o=Math.asin(f1*i),s=o*o,a=s*s*s;return t.x=r*Math.cos(o)/(f1*(Uu+3*ju*s+a*(7*zu+9*qu*s))),t.y=o*(Uu+ju*s+a*(zu+qu*s)),e.es!==0&&(t.x*=e.rqda,t.y*=e.rqda),t.x=e.a*t.x+e.x0,t.y=e.a*t.y+e.y0,t}function $O(e,t){t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,e.es!==0&&(t.x/=e.rqda,t.y/=e.rqda);let r=Math.PI/3,n=r*r,i=r*(Uu+ju*n+n**3*(zu+qu*n));if(Math.abs(t.y)>i+8*Number.EPSILON*i)return null;var o=1e-9,s=12,a=t.y,c,l,u,h,d,m;for(m=0;m<s&&(c=a*a,l=c*c*c,u=a*(Uu+ju*c+l*(zu+qu*c))-t.y,h=Uu+3*ju*c+l*(7*zu+9*qu*c),a-=d=u/h,!(Math.abs(d)<o));++m);c=a*a,l=c*c*c,t.x=f1*t.x*(Uu+3*ju*c+l*(7*zu+9*qu*c))/Math.cos(a);let g=Math.sin(a)/f1,y=8*Number.EPSILON;return Math.abs(g)>1+y?null:(t.y=Math.abs(g)>=1-y?Math.sign(g)*Math.PI/2:Math.asin(g),e.es!==0&&(t.y=Zx(t.y,e.apa)),t.x=k(t.x+e.long0,e.over),t)}function KO(e,t={}){let r={...e,apa:[],qp:0,rqda:0,...t};return HK(r),r}var Uu,ju,zu,qu,f1,XO=p(()=>{_t();Kh();VO();WO();Uu=1.340264,ju=-.081106,zu=893e-6,qu=.003796,f1=Math.sqrt(3)/2});var Jx,YO=p(()=>{Vt();Ut();XO();Qe();ut();Bt();Jx={name:"eqearth",aliases:["Equal Earth","Equal_Earth"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=e.primeMeridian??0,n=KO(t),i=Ie("eqearth",e,n,HO,$O),o=Math.sqrt(e.eccentricitySquared),s=e.semiMajorAxis*(o?Math.sqrt((1+(1-o*o)*Math.atanh(o)/o)/2):1),a=Math.PI/3,c=a*a,l=c**3,u=s*Math.PI/(Math.sqrt(3)/2*1.340264),h=re(e.parameters,"x_0",0),d=re(e.parameters,"y_0",0),m=s*a*(1.340264-.081106*c+l*(893e-6+.003796*c));return{...i,longitudeOrigin:t.long0,getRenderingProfile(g){if(g)return ur(b=>Cr(i.forward,b,t.long0,t.over),g,t.long0,r,t.over);let y=[[h-u,d-m,0],[h+u,d+m,0]];return{bounds:y,normalize:ur(()=>y,Gn(Q(t.long0-Math.PI,-(Math.PI/2),t.long0+Math.PI,Math.PI/2),r),t.long0,r,t.over).normalize}}}}}});function $K(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0}function ZO(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o=e.x0+e.a*i*Math.cos(e.lat0),s=e.y0+e.a*n;return e.t1=o,e.t2=Math.cos(e.lat0),t.x=o,t.y=s,t}function JO(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.y/e.a;Math.abs(r)>Math.PI/2&&Math.abs(r)<=Math.PI/2+8*Number.EPSILON&&(r=Math.sign(r)*Math.PI/2);var n=k(e.long0+t.x/(e.a*Math.cos(e.lat0)),e.over);return t.x=n,t.y=r,t}function QO(e,t={}){let r={...e,t2:0,t1:0,...t};return $K(r),r}var eB=p(()=>{_t()});var Qx,tB=p(()=>{Bt();Qe();ut();Ut();eB();Qx={name:"equi",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Equirectangular standard parallel must be away from the poles");let r=QO(t),n=Ie("equi",e,r,ZO,JO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function rB(e,t,r=!1){let n=1+t/e.a,i=n/(1+1e-10),o=h=>Math.acos(Math.min(1,Math.sqrt(1-e.es*Math.sin(h)**2)/(i*Math.cos(h)))),s=h=>{let d=(i*Math.cos(h))**2;return Math.asin(Math.sqrt(Math.max(0,(d-1)/(d-e.es))))},a=t*Math.asin(1/n),c=t*Math.atan(Math.sqrt((1-e.es)/(n*n-1))),l=(h,d)=>{let m=Math.max(h[0][1],Math.min(h[1][1],0)),g=o(m),y=Math.max(h[0][0]-e.long0,-g),b=Math.min(h[1][0]-e.long0,g),w=s(Math.max(y,Math.min(b,0))),_=Math.max(h[0][1],-w),S=Math.min(h[1][1],w);if(b<y||S<_)return null;let v=Q(y,_,b,S),T=Gn(Q(y+e.long0,_,b+e.long0,S),e.primeMeridian),O=(e.long0+e.primeMeridian)*180/Math.PI,P=Cs(M=>{let U=Math.max(y,Math.min(b,Xt(M.x-e.long0))),C=s(U),L=Math.max(Math.max(_,-C),Math.min(Math.min(S,C),M.y));U!==M.x-e.long0&&(M.x=U+e.long0),M.y=L},e.primeMeridian);return{get bounds(){if(!d)return lt([e.x0-a,e.x0+a],[e.y0-c,e.y0+c]);let M=dt([0,0,1],v),U=[1,1/Math.sqrt(1-e.es*Math.max(M[0]**2,M[1]**2))],C=Ot(dt([1,0,0],v),U),L=Ot(dt([0,1,0],v),U),A=Ot(M,[1-e.es,(1-e.es)*U[1]]),W=[n-Math.min(1,C[1]),n-Math.max(1/n,C[0])],G=(E,B,N,D)=>{let R=B[0]<=0&&B[1]>=0?0:Math.min(Math.abs(B[0]),Math.abs(B[1])),I=D?[Math.hypot(W[0],R),Math.hypot(W[1],Math.max(Math.abs(B[0]),Math.abs(B[1])))]:W,j=E.flatMap(we=>I.map(_e=>t*Math.atan(we/_e)));return[Math.max(-N,Math.min(...j)),Math.min(N,Math.max(...j))]};return lt(Ce([e.x0,e.x0],G(L,A,a,r)),Ce([e.y0,e.y0],G(A,L,c,!r)))},normalize(M){Am(M,T,O),P(M)}}},u=Gn(Q(e.long0-o(0),-s(0),e.long0+o(0),s(0)),e.primeMeridian);return h=>{let d=h?Em(h,u):[u],m=Tm(d,g=>l(Bs(g,e.primeMeridian,e.long0),!!h));if(!m)throw new Error("CRS coverage does not intersect the satellite limb");return m}}var nB=p(()=>{Qe();cc();ut();Vt();dc();Bt()});function KK(e){if(e.flip_axis=e.sweep==="x"?1:0,e.h=Number(e.h),e.radius_g_1=e.h/e.a,e.radius_g_1<=0||e.radius_g_1>1e10)throw new Error;if(e.radius_g=1+e.radius_g_1,e.C=e.radius_g*e.radius_g-1,e.es!==0){var t=1-e.es,r=1/t;e.radius_p=Math.sqrt(t),e.radius_p2=t,e.radius_p_inv2=r,e.shape="ellipse"}else e.radius_p=1,e.radius_p2=1,e.radius_p_inv2=1,e.shape="sphere"}function iB(e,t){var r=t.x,n=t.y,i,o,s,a;if(r=r-e.long0,e.shape==="ellipse"){n=Math.atan(e.radius_p2*Math.tan(n));var c=e.radius_p/tr(e.radius_p*Math.cos(n),Math.sin(n));if(o=c*Math.cos(r)*Math.cos(n),s=c*Math.sin(r)*Math.cos(n),a=c*Math.sin(n),(e.radius_g-o)*o-s*s-a*a*e.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=e.radius_g-o,e.flip_axis?(t.x=e.radius_g_1*Math.atan(s/tr(a,i)),t.y=e.radius_g_1*Math.atan(a/i)):(t.x=e.radius_g_1*Math.atan(s/i),t.y=e.radius_g_1*Math.atan(a/tr(s,i)))}else e.shape==="sphere"&&(i=Math.cos(n),o=Math.cos(r)*i,s=Math.sin(r)*i,a=Math.sin(n),i=e.radius_g-o,e.flip_axis?(t.x=e.radius_g_1*Math.atan(s/tr(a,i)),t.y=e.radius_g_1*Math.atan(a/i)):(t.x=e.radius_g_1*Math.atan(s/i),t.y=e.radius_g_1*Math.atan(a/tr(s,i))));return t.x=t.x*e.a,t.y=t.y*e.a,t}function oB(e,t){var r=-1,n=0,i=0,o,s,a,c;if(t.x=t.x/e.a,t.y=t.y/e.a,e.shape==="ellipse"){e.flip_axis?(i=Math.tan(t.y/e.radius_g_1),n=Math.tan(t.x/e.radius_g_1)*tr(1,i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*tr(1,n));var l=i/e.radius_p;if(o=n*n+l*l+r*r,s=2*e.radius_g*r,a=s*s-4*o*e.C,a<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=(-s-Math.sqrt(a))/(2*o),r=e.radius_g+c*r,n*=c,i*=c,t.x=Math.atan2(n,r),t.y=Math.atan(i*Math.cos(t.x)/r),t.y=Math.atan(e.radius_p_inv2*Math.tan(t.y))}else if(e.shape==="sphere"){if(e.flip_axis?(i=Math.tan(t.y/e.radius_g_1),n=Math.tan(t.x/e.radius_g_1)*Math.sqrt(1+i*i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*Math.sqrt(1+n*n)),o=n*n+i*i+r*r,s=2*e.radius_g*r,a=s*s-4*o*e.C,a<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=(-s-Math.sqrt(a))/(2*o),r=e.radius_g+c*r,n*=c,i*=c,t.x=Math.atan2(n,r),t.y=Math.atan(i*Math.cos(t.x)/r)}return t.x=t.x+e.long0,t}function sB(e,t={}){let r={...e,flip_axis:0,sweep:"",h:0,radius_g_1:0,radius_g:0,C:0,radius_p:0,radius_p2:0,radius_p_inv2:0,shape:"",...t};return KK(r),r}var aB=p(()=>{fc()});var e_,cB=p(()=>{nB();Ut();aB();Vt();e_={name:"geos",aliases:["Geostationary Satellite View","Geostationary_Satellite"],parameters:["lon_0","x_0","y_0","h","sweep"],create(e){let t=Ae(e),r=re(e.parameters,"h",NaN);if(!Number.isFinite(r)||r<=0)throw new Error("Geostationary projection requires positive h");let n=e.parameters.sweep||"y";if(!["x","y"].includes(n))throw new Error("Geostationary sweep must be x or y");let i=sB(t,{h:r,sweep:n});return{...Ie("geos",e,i,iB,oB,t.sphere?Ha({...t,lat0:0},1/(1+r/t.a),!0):void 0),longitudeOrigin:t.long0,getRenderingProfile:rB(kt(t,e),r,n==="x")}}}});function lB(e){return{engine:rT({semiMajorAxis:1,semiMinorAxis:Math.sqrt(1-e.es)}),latitude:e.lat0*al}}function uB(e,t,r){let n=t.engine.Inverse(t.latitude,0,r.y*al,k(r.x-e.long0,e.over)*al,If);if(!(n.M12>0))throw new Error("Coordinate is outside the ellipsoidal gnomonic horizon");let i=e.a*n.m12/n.M12,o=n.azi1/al;return r.x=e.x0+i*Math.sin(o),r.y=e.y0+i*Math.cos(o),r}function fB(e,t,r){let n=(r.x-e.x0)/e.a,i=(r.y-e.y0)/e.a,o=Math.hypot(n,i);if(o===0)return r.x=e.long0,r.y=e.lat0,r;let s=t.engine.Line(t.latitude,0,Math.atan2(n,i)*al,If),a=o<=1,c=a?o:1/o,l=Math.atan(o);for(let u=0;u<20;u++){let h=s.Position(l,If),d=a?(h.m12-c*h.M12)*h.M12:(c*h.m12-h.M12)*h.m12;if(!Number.isFinite(d))break;if(l-=d,Math.abs(d)<1e-14){let m=s.Position(l,If);if(!(m.M12>0))break;return r.x=k(e.long0+m.lon2/al,e.over),r.y=m.lat2/al,r}}throw new Error("Ellipsoidal gnomonic inverse did not converge")}var al,hB=p(()=>{nT();_t();al=180/Math.PI});function XK(e){e.sphere||(e.ellipsoid=lB(e)),e.sin_p14=Math.sin(e.lat0),e.cos_p14=Math.cos(e.lat0),e.infinity_dist=1e3*e.a,e.rc=1}function dB(e,t){if(e.ellipsoid)return uB(e,e.ellipsoid,t);var r,n,i,o,s,a,c,l,u=t.x,h=t.y;return i=k(u-e.long0,e.over),r=Math.sin(h),n=Math.cos(h),o=Math.cos(i),a=e.sin_p14*r+e.cos_p14*n*o,s=1,a>0||Math.abs(a)<=1e-10?(c=e.x0+e.a*s*n*Math.sin(i)/a,l=e.y0+e.a*s*(e.cos_p14*r-e.sin_p14*n*o)/a):(c=e.x0+e.infinity_dist*n*Math.sin(i),l=e.y0+e.infinity_dist*(e.cos_p14*r-e.sin_p14*n*o)),t.x=c,t.y=l,t}function mB(e,t){if(e.ellipsoid)return fB(e,e.ellipsoid,t);var r,n,i,o,s,a;return t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,t.x/=e.k0,t.y/=e.k0,r=Math.sqrt(t.x*t.x+t.y*t.y),r?(o=Math.atan2(r,e.rc),n=Math.sin(o),i=Math.cos(o),a=sl(i*e.sin_p14+t.y*n*e.cos_p14/r),s=Math.atan2(t.x*n,r*e.cos_p14*i-t.y*e.sin_p14*n),s=k(e.long0+s,e.over)):(a=e.lat0,s=e.long0),t.x=s,t.y=a,t}function pB(e,t={}){let r={...e,sin_p14:0,cos_p14:0,infinity_dist:0,rc:0,phic0:0,...t};return XK(r),r}var gB=p(()=>{hB();_t();c1()});var t_,yB=p(()=>{zs();qs();Ut();gB();t_={name:"gnom",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=pB(t);return wn(Ie("gnom",e,r,dB,mB,t.sphere?Ha(t):void 0),t,Math.min(Math.PI*80/180,(1-t.es)*Math.PI*.45),(n,i)=>t.sphere?Bm(kt(t,e),n,i,"gnom"):$T(kt(t,e),n,i),(1-t.es)*Math.PI/2)}}});function r_(e,t){return 2*Math.atan(e*Math.exp(t))-F}var bB=p(()=>{Ct()});function h1(e,t){var r=r_(1,t),n=0,i=0;let o=0;do{if(++o>50)throw new Error("Isometric latitude inverse did not converge");n=r,i=e*Math.sin(n),r=r_(Math.exp(e*Math.log((1+i)/(1-i))/2),t)}while(Math.abs(r-n)>1e-12);return r}var n_=p(()=>{bB()});function Vu(e,t,r){if(Math.abs(t)>F)return Number.NaN;if(t===F)return Number.POSITIVE_INFINITY;if(t===-1*F)return Number.NEGATIVE_INFINITY;var n=e*r;return Math.log(Math.tan((F+t)/2))+e*Math.log((1-n)/(1+n))/2}var wB=p(()=>{Ct()});function YK(e){e.k0||(e.k0=1);var t=e.b/e.a;e.e=Math.sqrt(1-t*t),e.lc=e.long0,e.rs=Math.sqrt(1+e.e*e.e*Math.pow(Math.cos(e.lat0),4)/(1-e.e*e.e));var r=Math.sin(e.lat0),n=Math.asin(r/e.rs),i=Math.sin(n);e.cp=Vu(0,n,i)-e.rs*Vu(e.e,e.lat0,r),e.n2=e.k0*e.a*Math.sqrt(1-e.e*e.e)/(1-e.e*e.e*r*r),e.xs=e.x0,e.ys=e.y0-e.n2*n}function xB(e,t){var r=t.x,n=t.y,i=e.rs*(r-e.lc),o=e.cp+e.rs*Vu(e.e,n,Math.sin(n)),s=Math.asin(Math.sin(i)/Lf(o)),a=Vu(0,s,Math.sin(s));return t.x=e.xs+e.n2*a,t.y=e.ys+e.n2*Math.atan(uc(o)/Math.cos(i)),t}function _B(e,t){var r=t.x,n=t.y,i=Math.atan(uc((r-e.xs)/e.n2)/Math.cos((n-e.ys)/e.n2)),o=Math.asin(Math.sin((n-e.ys)/e.n2)/Lf((r-e.xs)/e.n2)),s=Vu(0,o,Math.sin(o));return t.x=e.lc+i/e.rs,t.y=h1(e.e,(s-e.cp)/e.rs),t}function SB(e,t={}){let r={...e,lc:0,rs:0,cp:0,n2:0,xs:0,ys:0,...t};return YK(r),r}var MB=p(()=>{wB();Pm();jy();n_()});var i_,vB=p(()=>{Bt();n_();Qe();ut();Ut();MB();i_={name:"gstmerc",aliases:["gstmerg"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=SB(t),n=Ie("gstmerc",e,r,xB,_B);return De(n,Q(t.long0-Math.PI/6,-Math.PI/3,t.long0+Math.PI/6,Math.PI/3),i=>Vl(n.forward,i,t.long0,t.over,h1(r.e,-r.cp/r.rs)),t.primeMeridian,t.over)}}});function ZK(e){e.a=6377397155e-3,e.es=.006674372230614,e.e=Math.sqrt(e.es),e.s45=Math.PI/4,e.s90=2*e.s45,e.fi0=e.lat0,e.e2=e.es,e.e=Math.sqrt(e.e2),e.alfa=Math.sqrt(1+e.e2*Math.pow(Math.cos(e.fi0),4)/(1-e.e2)),e.uq=1.04216856380474,e.u0=Math.asin(Math.sin(e.fi0)/e.alfa),e.g=Math.pow((1+e.e*Math.sin(e.fi0))/(1-e.e*Math.sin(e.fi0)),e.alfa*e.e/2),e.k=Math.tan(e.u0/2+e.s45)/Math.pow(Math.tan(e.fi0/2+e.s45),e.alfa)*e.g,e.k1=e.k0,e.n0=e.a*Math.sqrt(1-e.e2)/(1-e.e2*Math.pow(Math.sin(e.fi0),2)),e.s0=1.37008346281555,e.n=Math.sin(e.s0),e.ro0=e.k1*e.n0/Math.tan(e.s0),e.ad=e.s90-e.uq}function EB(e,t){var r,n,i,o,s,a,c,l=t.x,u=t.y,h=k(l-e.long0,e.over);return r=Math.pow((1+e.e*Math.sin(u))/(1-e.e*Math.sin(u)),e.alfa*e.e/2),n=2*(Math.atan(e.k*Math.pow(Math.tan(u/2+e.s45),e.alfa)/r)-e.s45),i=-h*e.alfa,o=Math.asin(Math.cos(e.ad)*Math.sin(n)+Math.sin(e.ad)*Math.cos(n)*Math.cos(i)),s=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(o)),a=e.n*s,c=e.ro0*Math.pow(Math.tan(e.s0/2+e.s45),e.n)/Math.pow(Math.tan(o/2+e.s45),e.n),t.y=c*Math.cos(a)/1,t.x=c*Math.sin(a)/1,e.czech||(t.y*=-1,t.x*=-1),t}function TB(e,t){var r,n,i,o,s,a,c,l,u=t.x;t.x=t.y,t.y=u,e.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.x),o=s/Math.sin(e.s0),i=2*(Math.atan(Math.pow(e.ro0/a,1/e.n)*Math.tan(e.s0/2+e.s45))-e.s45),r=Math.asin(Math.cos(e.ad)*Math.sin(i)-Math.sin(e.ad)*Math.cos(i)*Math.cos(o)),n=Math.asin(Math.cos(i)*Math.sin(o)/Math.cos(r)),t.x=e.long0-n/e.alfa,c=r,l=0;var h=0;do t.y=2*(Math.atan(Math.pow(e.k,-1/e.alfa)*Math.pow(Math.tan(r/2+e.s45),1/e.alfa)*Math.pow((1+e.e*Math.sin(c))/(1-e.e*Math.sin(c)),e.e/2))-e.s45),Math.abs(c-t.y)<1e-10&&(l=1),c=t.y,h+=1;while(l===0&&h<15);return h>=15?null:t}function AB(e,t={}){let r={...e,s45:0,s90:0,fi0:0,e2:0,alfa:0,uq:0,u0:0,g:0,k:0,k1:0,n0:0,s0:0,n:0,ro0:0,ad:0,czech:!1,...t};return ZK(r),r}var IB=p(()=>{_t()});var o_,PB=p(()=>{Wa();Qe();ut();Ut();IB();Vt();kn();o_={name:"krovak",aliases:["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0","czech","alpha","lat_ts"],flags:["czech"],create(e){let t=re(e.parameters,"alpha",30.28813972222222),r=re(e.parameters,"lat_ts",78.5);if(![30.28813972222222,30.28813975277778].some(s=>Math.abs(t-s)<=1e-10))throw new Error("Krovak requires its fixed cone-axis co-latitude");if(Math.abs(r-78.5)>1e-10)throw new Error("Krovak requires its fixed 78.5 degree pseudo standard parallel");let n=Ae(e);n.lat0=Ns(e.parameters,"lat_0",49.5),n.long0=Ns(e.parameters,"lon_0",24.83333333333333),n.k0=re(e.parameters,"k_0",re(e.parameters,"k",.9999));let i=AB(n,{czech:Oi(e.parameters,"czech")}),o=Ie("krovak",e,i,EB,TB);return De(o,Q(n.long0-Math.PI/12,Math.max(-Math.PI/2+1e-8,n.lat0-Math.PI/36),n.long0+Math.PI/12,Math.min(Math.PI/2-1e-8,n.lat0+Math.PI/36)),s=>SO(kt(i,e),s),n.primeMeridian,n.over)}}});function RB(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o=e.x0+e.a*i,s=e.y0+e.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=o,t.y=s,t}function LB(e,t){t.x-=e.x0,t.y-=e.y0;var r=k(e.long0+t.x/e.a,e.over),n=2.5*(Math.atan(Math.exp(.8*t.y/e.a))-Math.PI/4);return t.x=r,t.y=n,t}function OB(e,t={}){let r={...e,...t};return r}var BB=p(()=>{_t()});var s_,CB=p(()=>{Bt();Qe();ut();Ut();BB();s_={name:"mill",aliases:["Miller_Cylindrical"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=OB(t),n=Ie("mill",e,r,RB,LB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function JK(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0}function DB(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over);let o=Math.sin(Math.abs(n)),s=Math.cos(n),a=Math.abs(n)===Math.PI/2?0:Math.PI*s*s/(1+o),c=Math.cbrt(6*a),l=0,u=Math.PI;c=Math.min(c,u);for(let m=0;m<32&&c>0;m++){let g=GB(c)-a,y=g/(2*Math.sin(c/2)**2);if(Math.abs(y)<=16*Number.EPSILON*c)break;g>0?u=c:l=c;let b=c-y;if(b===c||u-l<=8*Number.EPSILON*Math.max(1,c))break;if(c=b>=l&&b<=u?b:(l+u)/2,m===31)throw new Error("Mollweide forward did not converge")}var h=2*Math.SQRT2/Math.PI*e.a*i*Math.sin(c/2)+e.x0,d=Math.sign(n)*Math.SQRT2*e.a*Math.cos(c/2)+e.y0;return t.x=h,t.y=d,t}function NB(e,t){let r=t.x-e.x0,n=(t.y-e.y0)/(Math.SQRT2*e.a);if(Math.abs(n)>1+8*Number.EPSILON)return null;let i=r/(2*Math.SQRT2*e.a),o=i*i+n*n;if(!e.over&&o>1+8*Number.EPSILON)return null;let s=2*Math.acos(Math.min(1,Math.abs(n))),a=Math.sin(s/2);if(!e.over&&Math.abs(o-1)<=8*Number.EPSILON&&(a=Math.min(1,Math.abs(i)),s=2*Math.asin(a)),a===0&&Math.abs(r)>8*Number.EPSILON*e.a)return null;let c=a===0?0:Math.PI*i/a;var l=k(e.long0+c,e.over),u=Math.sign(n)*(Math.PI/2-2*Math.asin(Math.sqrt(GB(s)/(2*Math.PI))));return t.x=l,t.y=u,t}function FB(e,t={}){let r={...e,...t};return JK(r),r}function GB(e){if(e>.5)return e-Math.sin(e);let t=e*e;return e*t*(1/6+t*(-1/120+t*(1/5040+t*(-1/362880+t*(1/39916800+t*(-1/6227020800+t/1307674368e3))))))}var kB=p(()=>{_t()});var a_,UB=p(()=>{Bt();Qe();ut();Ut();kB();a_={name:"moll",aliases:["Mollweide"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=FB(t),n=Ie("moll",e,r,DB,NB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function QK(e){e.A=[],e.A[1]=.6399175073,e.A[2]=-.1358797613,e.A[3]=.063294409,e.A[4]=-.02526853,e.A[5]=.0117879,e.A[6]=-.0055161,e.A[7]=.0026906,e.A[8]=-.001333,e.A[9]=67e-5,e.A[10]=-34e-5,e.B_re=[],e.B_im=[],e.B_re[1]=.7557853228,e.B_im[1]=0,e.B_re[2]=.249204646,e.B_im[2]=.003371507,e.B_re[3]=-.001541739,e.B_im[3]=.04105856,e.B_re[4]=-.10162907,e.B_im[4]=.01727609,e.B_re[5]=-.26623489,e.B_im[5]=-.36249218,e.B_re[6]=-.6870983,e.B_im[6]=-1.1651967,e.C_re=[],e.C_im=[],e.C_re[1]=1.3231270439,e.C_im[1]=0,e.C_re[2]=-.577245789,e.C_im[2]=-.007809598,e.C_re[3]=.508307513,e.C_im[3]=-.112208952,e.C_re[4]=-.15094762,e.C_im[4]=.18200602,e.C_re[5]=1.01418179,e.C_im[5]=1.64497696,e.C_re[6]=1.9660549,e.C_im[6]=2.5127645,e.D=[],e.D[1]=1.5627014243,e.D[2]=.5185406398,e.D[3]=-.03333098,e.D[4]=-.1052906,e.D[5]=-.0368594,e.D[6]=.007317,e.D[7]=.0122,e.D[8]=.00394,e.D[9]=-.0013}function jB(e,t){var r,n=t.x,i=t.y,o=i-e.lat0,s=n-e.long0,a=o/Of*1e-5,c=s,l=1,u=0;for(r=1;r<=10;r++)l=l*a,u=u+e.A[r]*l;var h=u,d=c,m=1,g=0,y,b,w=0,_=0;for(r=1;r<=6;r++)y=m*h-g*d,b=g*h+m*d,m=y,g=b,w=w+e.B_re[r]*m-e.B_im[r]*g,_=_+e.B_im[r]*m+e.B_re[r]*g;return t.x=_*e.a+e.x0,t.y=w*e.a+e.y0,t}function zB(e,t){var r,n=t.x,i=t.y,o=n-e.x0,s=i-e.y0,a=s/e.a,c=o/e.a,l=1,u=0,h,d,m=0,g=0;for(r=1;r<=6;r++)h=l*a-u*c,d=u*a+l*c,l=h,u=d,m=m+e.C_re[r]*l-e.C_im[r]*u,g=g+e.C_im[r]*l+e.C_re[r]*u;for(var y=0;y<e.iterations;y++){var b=m,w=g,_,S,v=a,T=c;for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,v=v+(r-1)*(e.B_re[r]*b-e.B_im[r]*w),T=T+(r-1)*(e.B_im[r]*b+e.B_re[r]*w);b=1,w=0;var O=e.B_re[1],P=e.B_im[1];for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,O=O+r*(e.B_re[r]*b-e.B_im[r]*w),P=P+r*(e.B_im[r]*b+e.B_re[r]*w);var M=O*O+P*P;m=(v*O+T*P)/M,g=(T*O-v*P)/M}var U=m,C=g,L=1,A=0;for(r=1;r<=9;r++)L=L*U,A=A+e.D[r]*L;var W=e.lat0+A*Of*1e5,G=e.long0+C;return t.x=G,t.y=W,t}function qB(e,t={}){let r={...e,A:[],B_re:[],B_im:[],C_re:[],C_im:[],D:[],iterations:1,...t};return QK(r),r}var VB=p(()=>{Ct()});var c_,WB=p(()=>{Wa();Qe();ut();Ut();VB();Vt();c_={name:"nzmg",aliases:["New_Zealand_Map_Grid"],parameters:["lon_0","x_0","y_0","lat_0","iterations"],create(e){let t=Ae(e),r=re(e.parameters,"iterations",1);if(!Number.isInteger(r)||r<0||r>10)throw new Error("NZMG iterations must be an integer from 0 to 10");if(!Object.prototype.hasOwnProperty.call(e.parameters,"lat_0")||!Object.prototype.hasOwnProperty.call(e.parameters,"lon_0"))throw new Error("NZMG requires lat_0 and lon_0");let n=qB(t,{iterations:r}),i=Ie("nzmg",e,n,jB,zB);return De(i,Q(t.long0-Math.PI/22.5,Math.max(-Math.PI/2,t.lat0-Math.PI/22.5),t.long0+Math.PI/22.5,Math.min(Math.PI/2,t.lat0+Math.PI/22.5)),o=>MO(kt(n,e),o),t.primeMeridian,t.over)}}});function eX(e){return e.no_uoff||e.no_off||["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(e.projName.toLowerCase().replace(/[ _-]/g,""))}function tX(e){var t,r,n,i,o,s,a,c,l,u,h=0,d,m=0,g=0,y=0,b=0,w=0,_=0;e.k0||(e.k0=1),e.no_off=eX(e),e.no_rot=e.no_rot;var S=!1;Number.isFinite(e.alpha)&&(S=!0);var v=!1;if(Number.isFinite(e.rectified_grid_angle)&&(v=!0),S&&(_=e.alpha),v&&(h=e.rectified_grid_angle,S||(_=0,S=!0)),S||v)m=e.longc;else if(g=e.long1,b=e.lat1,y=e.long2,w=e.lat2,Math.abs(b-w)<=Wu||Math.abs(b)<=Wu||Math.abs(Math.abs(b)-F)<=Wu||Math.abs(Math.abs(e.lat0)-F)<=Wu||Math.abs(Math.abs(w)-F)<=Wu)throw new Error;var T=1-e.es;if(r=Math.sqrt(T),Math.abs(e.lat0)>1e-10?(c=Math.sin(e.lat0),n=Math.cos(e.lat0),t=1-e.es*c*c,e.B=n*n,e.B=Math.sqrt(1+e.es*e.B*e.B/T),e.A=e.B*e.k0*r/t,i=e.B*r/(n*Math.sqrt(t)),o=i*i-1,o<=0?o=0:(o=Math.sqrt(o),e.lat0<0&&(o=-o)),e.E=o+=i,e.E*=Math.pow(Qr(e.e,e.lat0,c),e.B)):(e.B=1/r,e.A=e.k0,e.E=i=o=1),S||v){S?(d=Math.asin(Math.sin(_)/i),v||(h=_)):(d=h,_=Math.asin(i*Math.sin(d)));let O=.5*(o-1/o)*Math.tan(d);i>1&&Math.abs(Math.cos(_))<=8*Number.EPSILON?O=Math.sign(e.lat0)*Math.sign(Math.sin(_)):Math.abs(O)>1&&Math.abs(O)<=1+8*Number.EPSILON&&(O=Math.sign(O)),e.lam0=m-Math.asin(O)/e.B}else s=Math.pow(Qr(e.e,b,Math.sin(b)),e.B),a=Math.pow(Qr(e.e,w,Math.sin(w)),e.B),o=e.E/s,l=(a-s)/(a+s),u=e.E*e.E,u=(u-a*s)/(u+a*s),t=g-y,t<-Math.PI?y-=Gs:t>Math.PI&&(y+=Gs),e.lam0=k(.5*(g+y)-Math.atan(u*Math.tan(.5*e.B*(g-y))/l)/e.B,e.over),d=Math.atan(2*Math.sin(e.B*k(g-e.lam0,e.over))/(o-1/o)),h=_=Math.asin(i*Math.sin(d));e.singam=Math.sin(d),e.cosgam=Math.cos(d),e.sinrot=Math.sin(h),e.cosrot=Math.cos(h),e.rB=1/e.B,e.ArB=e.A*e.rB,e.BrA=1/e.ArB,e.no_off?e.u_0=0:(e.u_0=Math.abs(e.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(_))),e.lat0<0&&(e.u_0=-e.u_0)),o=.5*d,e.v_pole_n=e.ArB*Math.log(Math.tan(et-o)),e.v_pole_s=e.ArB*Math.log(Math.tan(et+o))}function HB(e,t){var r=t,n,i,o,s,a,c,l,u;if(t.x=t.x-e.lam0,Math.abs(Math.abs(t.y)-F)>1e-10){if(a=e.E/Math.pow(Qr(e.e,t.y,Math.sin(t.y)),e.B),c=1/a,n=.5*(a-c),i=.5*(a+c),s=Math.sin(e.B*t.x),o=(n*e.singam-s*e.cosgam)/i,Math.abs(Math.abs(o)-1)<1e-10)throw new Error;u=.5*e.ArB*Math.log((1-o)/(1+o)),c=Math.cos(e.B*t.x),Math.abs(c)<Wu?l=e.A*t.x:l=e.ArB*Math.atan2(n*e.cosgam+s*e.singam,c)}else u=t.y>0?e.v_pole_n:e.v_pole_s,l=e.ArB*t.y;return e.no_rot?(r.x=l,r.y=u):(l-=e.u_0,r.x=u*e.cosrot+l*e.sinrot,r.y=l*e.cosrot-u*e.sinrot),r.x=e.a*r.x+e.x0,r.y=e.a*r.y+e.y0,r}function $B(e,t){var r,n,i,o,s,a,c,l=t;if(t.x=(t.x-e.x0)*(1/e.a),t.y=(t.y-e.y0)*(1/e.a),e.no_rot?(n=t.y,r=t.x):(n=t.x*e.cosrot-t.y*e.sinrot,r=t.y*e.cosrot+t.x*e.sinrot+e.u_0),i=Math.exp(-e.BrA*n),o=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(e.BrA*r),c=(a*e.cosgam+o*e.singam)/s,Math.abs(Math.abs(c)-1)<1e-10)l.x=0,l.y=c<0?-F:F;else{if(l.y=e.E/Math.sqrt((1+c)/(1-c)),l.y=mc(e.e,Math.pow(l.y,1/e.B)),l.y===1/0)throw new Error;l.x=-e.rB*Math.atan2(o*e.cosgam-a*e.singam,Math.cos(e.BrA*r))}return l.x+=e.lam0,l}function KB(e,t={}){let r={...e,no_off:!1,no_rot:!1,alpha:NaN,rectified_grid_angle:NaN,longc:0,long1:0,long2:0,B:0,A:0,E:0,lam0:0,singam:0,cosgam:0,sinrot:0,cosrot:0,rB:0,ArB:0,BrA:0,u_0:0,v_pole_n:0,v_pole_s:0,no_uoff:!1,projName:"",...t};return tX(r),r}var Wu,XB=p(()=>{Df();_t();Dm();Ct();Wu=1e-7});var l_,YB=p(()=>{Wa();Qe();ut();Ut();XB();Vt();kn();l_={name:"omerc",aliases:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0","alpha","gamma","lonc","lon_1","lon_2","lat_1","lat_2","no_off","no_uoff","no_rot"],flags:["no_off","no_uoff","no_rot"],create(e){let t=Ae(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Oblique Mercator origin must be away from the poles");let n=Object.prototype.hasOwnProperty.call(e.parameters,"alpha")||Object.prototype.hasOwnProperty.call(e.parameters,"gamma")?["lonc"]:["lon_1","lat_1","lon_2","lat_2"];for(let s of n)if(!Object.prototype.hasOwnProperty.call(e.parameters,s))throw new Error("Oblique Mercator requires "+s);let i=KB(t,{projName:e.parameters.proj||"omerc",alpha:re(e.parameters,"alpha",NaN)*Math.PI/180,rectified_grid_angle:re(e.parameters,"gamma",NaN)*Math.PI/180,longc:re(e.parameters,"lonc",0)*Math.PI/180,long1:re(e.parameters,"lon_1",0)*Math.PI/180,long2:re(e.parameters,"lon_2",0)*Math.PI/180,no_off:Oi(e.parameters,"no_off"),no_uoff:Oi(e.parameters,"no_uoff"),no_rot:Oi(e.parameters,"no_rot")}),o=Ie("omerc",e,i,HB,$B);return De(o,Q(i.lam0-Math.PI/18,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/18),i.lam0+Math.PI/18,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/18)),s=>_O(kt(i,e),s),t.primeMeridian,t.over)}}});function ZB(e){let t=Math.sin(e.lat0),r=Math.cos(e.lat0),n=1/Math.sqrt(1-e.es*t*t);return{...e,sin0:t,cos0:r,originY:-e.es*n*t*r}}function JB(e,t){let r=k(t.x-e.long0,e.over),n=Math.sin(t.y),i=Math.cos(t.y),o=1/Math.sqrt(1-e.es*n*n);return t.x=e.x0+e.a*e.k0*o*i*Math.sin(r),t.y=e.y0+e.a*e.k0*(o*((1-e.es)*n*e.cos0-i*Math.cos(r)*e.sin0)-e.originY),t}function QB(e,t){let r=(t.x-e.x0)/(e.a*e.k0),n=(t.y-e.y0)/(e.a*e.k0)+e.originY,i=1-e.es,o=e.cos0*e.cos0+e.sin0*e.sin0/i,s=n*e.sin0*e.cos0*e.es/i,a=r*r+n*n*(e.sin0*e.sin0+e.cos0*e.cos0/i)-1,c=s*s-o*a;if(c<-32*Number.EPSILON*o)throw new Error("Coordinate is outside the orthographic ellipse");let l=(-s+Math.sqrt(Math.max(0,c)))/o,u=l*e.cos0-n*e.sin0,h=l*e.sin0+n*e.cos0;return t.x=k(e.long0+Math.atan2(r,u),e.over),t.y=Math.atan2(h,i*Math.hypot(u,r)),t}var eC=p(()=>{_t()});var u_,tC=p(()=>{zs();qs();Ut();eC();u_={name:"ortho",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=ZB(t);return wn(Ie("ortho",e,r,JB,QB,Ha(t,0,!0)),t,Math.PI/2,(n,i)=>qT(kt(t,e),n,i),Math.PI/2)}}});function rX(e){e.meridianPole=ci(e.a,e.es,0,Math.PI/2),e.poleRadius=e.a/Math.sqrt(1-e.es),e.ml0=ci(e.a,e.es,0,e.lat0)}function iC(e,t){var r=t.x,n=t.y,i,o,s,a=k(r-e.long0,e.over);if(s=a*Math.sin(n),e.sphere)n===0?(i=e.a*a,o=-1*e.a*e.lat0):(i=e.a*Math.sin(s)/Math.tan(n),o=e.a*(n-e.lat0+2*Math.sin(s/2)**2/Math.tan(n)));else if(n===0)i=e.a*a,o=-1*e.ml0;else{var c=ku(e.a,e.e,Math.sin(n))/Math.tan(n);i=c*Math.sin(s),o=ci(e.a,e.es,e.lat0,n)+c*(2*Math.sin(s/2)**2)}return t.x=i+e.x0,t.y=o+e.y0,t}function oC(e,t){var r,n,i,o,s,a,c,l,u;i=t.x-e.x0,o=t.y-e.y0;let h=o+(e.sphere?e.a*e.lat0:e.ml0),d=h<0?-1:1,g=(e.sphere?e.a*Math.PI/2:e.meridianPole)-d*h,y=Math.hypot(i,g);if(y/e.a<1e-6)return t.x=k(e.long0+Math.atan2(i,g),e.over),t.y=d*(Math.PI/2-y/e.poleRadius),t;if(e.sphere)if(Math.abs(o+e.a*e.lat0)<=1e-10)r=k(i/e.a+e.long0,e.over),n=0;else{a=e.lat0+o/e.a,c=i*i/e.a/e.a+a*a,l=a;var b;for(s=rC;s;--s)if(b=Math.tan(l),u=-1*(a*(l*b+1)-l-.5*(l*l+c)*b)/((l-a)/b-1),l+=u,Math.abs(u)<=1e-14){n=l;break}if(n=nC(e,n===void 0?l:n,i,o),n===void 0)return null;l=n,r=k(e.long0+Math.asin(i*Math.tan(l)/e.a)/Math.sin(n),e.over)}else if(Math.abs(o+e.ml0)<=1e-10)n=0,r=k(e.long0+i/e.a,e.over);else{a=(e.ml0+o)/e.a,c=i*i/e.a/e.a+a*a,l=a;var w,_,S,v,T;for(s=rC;s;--s)if(T=e.e*Math.sin(l),w=Math.sqrt(1-T*T)*Math.tan(l),_=ci(e.a,e.es,0,l),S=(1-e.es)/Math.pow(1-T*T,1.5),v=_/e.a,u=(a*(w*v+1)-v-.5*w*(v*v+c))/(e.es*Math.sin(2*l)*(v*v+c-2*a*v)/(4*w)+(a-v)*(w*S-2/Math.sin(2*l))-S),l-=u,Math.abs(u)<=1e-14){n=l;break}if(n=nC(e,n===void 0?l:n,i,o),n===void 0)return null;l=n,w=Math.sqrt(1-e.es*Math.pow(Math.sin(n),2))*Math.tan(n),r=k(e.long0+Math.asin(i*w/e.a)/Math.sin(n),e.over)}return t.x=r,t.y=n,t}function sC(e,t={}){let r={...e,ml0:0,meridianPole:0,poleRadius:0,...t};return rX(r),r}function nC(e,t,r,n){for(let i=0;i<8;i++){if(!Number.isFinite(t)||Math.abs(t)>=Math.PI/2)return;let o=Math.sin(t),s=Math.cos(t),a=1-e.es*o*o,c=e.sphere?e.a:ku(e.a,e.e,o),l=c/Math.tan(t),u=Math.asin(r/l),h=l*Math.sin(u),d=2*Math.sin(u/2)**2,m=e.sphere?e.a*(t-e.lat0):ci(e.a,e.es,e.lat0,t),g=l*d,b=m+g-n;if(Math.abs(h-r)<=64*Number.EPSILON*Math.max(e.a,Math.abs(r))&&Math.abs(b)<=64*Number.EPSILON*Math.max(Math.abs(n),Math.abs(m),Math.abs(g),e.a*Math.max(Math.abs(t),Math.abs(e.lat0))))return t;let w=e.sphere?e.a:e.a*(1-e.es)/Math.pow(a,1.5),_=c*((e.sphere?0:e.es*s*s/a)-1/(o*o)),S=w+_*(-d/Math.cos(u)),v=b/S;if(!Number.isFinite(v)||Math.abs(v)>1e-6)return;t-=v}}var rC,aC=p(()=>{_t();qx();Gx();rC=20});var f_,cC=p(()=>{Wa();Qe();ut();Ut();aC();f_={name:"poly",aliases:["Polyconic","American_Polyconic"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=sC(t),n=Ie("poly",e,r,iC,oC);return De(n,Q(t.long0-Math.PI/6,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/2+1e-8),t.long0+Math.PI/6,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/2-1e-8)),i=>bO(kt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function nX(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0,e.lat_ts=e.lat_ts||0,e.lat0>=F-et/2?e.face=jt.TOP:e.lat0<=-(F-et/2)?e.face=jt.BOTTOM:Math.abs(e.long0)<=et?e.face=jt.FRONT:Math.abs(e.long0)<=F+et?e.face=e.long0>0?jt.RIGHT:jt.LEFT:e.face=jt.BACK,e.es!==0&&(e.one_minus_f=1-(e.a-e.b)/e.a,e.one_minus_f_squared=e.one_minus_f*e.one_minus_f)}function lC(e,t){var r=t,n,i,o,s,a,c,l=0;if(t.x-=e.long0,e.es!==0?n=Math.atan(e.one_minus_f_squared*Math.tan(t.y)):n=t.y,i=t.x,e.face===jt.TOP)s=F-n,i>=et&&i<=F+et?(l=mt.AREA_0,o=i-F):i>F+et||i<=-(F+et)?(l=mt.AREA_1,o=i>0?i-Math.PI:i+Math.PI):i>-(F+et)&&i<=-et?(l=mt.AREA_2,o=i+F):(l=mt.AREA_3,o=i);else if(e.face===jt.BOTTOM)s=F+n,i>=et&&i<=F+et?(l=mt.AREA_0,o=-i+F):i<et&&i>=-et?(l=mt.AREA_1,o=-i):i<-et&&i>=-(F+et)?(l=mt.AREA_2,o=-i-F):(l=mt.AREA_3,o=i>0?-i+Math.PI:-i-Math.PI);else{var u,h,d,m,g,y,b;e.face===jt.RIGHT?i=Hu(i,+F):e.face===jt.BACK?i=Hu(i,+Math.PI):e.face===jt.LEFT&&(i=Hu(i,-F)),m=Math.sin(n),g=Math.cos(n),y=Math.sin(i),b=Math.cos(i),u=g*b,h=g*y,d=m,e.face===jt.FRONT?(s=Math.atan2(Math.hypot(h,d),u),o=d1(s,d,h)):e.face===jt.RIGHT?(s=Math.atan2(Math.hypot(u,d),h),o=d1(s,d,-u)):e.face===jt.BACK?(s=Math.atan2(Math.hypot(h,d),-u),o=d1(s,d,-h)):e.face===jt.LEFT?(s=Math.atan2(Math.hypot(u,d),-h),o=d1(s,d,u)):s=o=0,Math.abs(o)<=et?l=mt.AREA_0:o>et&&o<=F+et?(l=mt.AREA_1,o-=F):o>F+et||o<=-(F+et)?(l=mt.AREA_2,o=o>=0?o-Math.PI:o+Math.PI):(l=mt.AREA_3,o+=F)}return c=Math.atan(12/Math.PI*(o+Math.acos(Math.sin(o)*Math.cos(et))-F)),a=Math.sqrt(2*Math.sin(s/2)**2/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(o))))),l===mt.AREA_1?c+=F:l===mt.AREA_2?c+=Math.PI:l===mt.AREA_3&&(c+=1.5*Math.PI),r.x=a*Math.cos(c),r.y=a*Math.sin(c),r.x=r.x*e.a+e.x0,r.y=r.y*e.a+e.y0,t}function uC(e,t){var r=0,n=0,i,o,s,a,c,l,u,h,d=0;t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d=mt.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d=mt.AREA_1,i-=F):t.x<0&&-t.x>=Math.abs(t.y)?(d=mt.AREA_2,i=i<0?i+Math.PI:i-Math.PI):(d=mt.AREA_3,i+=F),h=Math.PI/12*Math.tan(i),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),c=Math.atan(a),o=Math.cos(i),s=Math.hypot(t.x,t.y);let m=o*o*s*s*(1-Math.cos(Math.atan(1/Math.cos(c))));if(l=1-m,l<-1?l=-1:l>1&&(l=1),e.face===jt.TOP)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=F-u,d===mt.AREA_0?r=c+F:d===mt.AREA_1?r=c<0?c+Math.PI:c-Math.PI:d===mt.AREA_2?r=c-F:r=c;else if(e.face===jt.BOTTOM)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=u-F,d===mt.AREA_0?r=-c+F:d===mt.AREA_1?r=-c:d===mt.AREA_2?r=-c-F:r=c<0?-c-Math.PI:-c+Math.PI;else{var g,y,b;g=l;let w=Math.sqrt(Math.max(0,m*(2-m)));b=w*Math.sin(c),y=w*Math.cos(c),d===mt.AREA_1?(h=y,y=-b,b=h):d===mt.AREA_2?(y=-y,b=-b):d===mt.AREA_3&&(h=y,y=b,b=-h),e.face===jt.RIGHT?(h=g,g=-y,y=h):e.face===jt.BACK?(g=-g,y=-y):e.face===jt.LEFT&&(h=g,g=y,y=-h),n=Math.atan2(b,Math.hypot(g,y)),r=Math.atan2(y,g),e.face===jt.RIGHT?r=Hu(r,-F):e.face===jt.BACK?r=Hu(r,-Math.PI):e.face===jt.LEFT&&(r=Hu(r,+F))}return e.es!==0&&(n=Math.atan2(Math.sin(n),e.one_minus_f_squared*Math.cos(n))),r+=e.long0,t.x=r,t.y=n,t}function d1(e,t,r){return e===0?0:Math.atan2(t,r)}function Hu(e,t){var r=e+t;return r<-Math.PI?r+=Gs:r>+Math.PI&&(r-=Gs),r}function fC(e,t={}){let r={...e,face:0,one_minus_f:0,one_minus_f_squared:0,...t};return nX(r),r}var jt,mt,hC=p(()=>{Ct();jt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},mt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4}});var h_,dC=p(()=>{cc();Vh();Ut();Vt();hC();Qe();ut();dc();Bt();h_={name:"qsc",aliases:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=e.primeMeridian??0,n=fC(t),i=Ie("qsc",e,n,lC,uC),o=re(e.parameters,"x_0",0),s=re(e.parameters,"y_0",0);return{...i,longitudeOrigin:t.long0,getRenderingProfile(a){if(a)return ur(h=>{let d=w=>t.es?Math.atan((1-t.es)*Math.tan(w)):w,m=Q(h[0][0]-t.long0,d(h[0][1]),h[1][0]-t.long0,d(h[1][1])),g=n.face===5?[0,0,1]:n.face===6?[0,0,-1]:[1,0,0],y=dt(g,m)[0],b=t.a*Math.sqrt((1-y)/(.5*(1-Math.SQRT1_2)));return lt([o-b,o+b],[s-b,s+b])},a,t.long0,r);let c=[[o-t.a,s-t.a,0],[o+t.a,s+t.a,0]],l=qa(e.parameters,r)().normalize,u=Cs(h=>{let[d,m]=i.forward(h.x,h.y);Math.abs(d-o)<=t.a&&Math.abs(m-s)<=t.a||([h.x,h.y]=i.inverse(o+Math.max(-t.a,Math.min(t.a,d-o)),s+Math.max(-t.a,Math.min(t.a,m-s))))},r);return{bounds:c,normalize(h){l(h),u(h)}}}}}}});function sX(e,t,r,n,i){for(var o=r;i;--i){var s=(m1(e,o)-t)/oX(e,o);if(o-=s,Math.abs(s)<n)break}return o}function aX(e){e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.es=0}function yC(e,t){var r=k(t.x-e.long0,e.over),n=Math.abs(t.y),i=Math.floor(n*gC+1e-15);i<0?i=0:i>=cl&&(i=cl),n=Vy*(n-iX*i);var o=m1($u[i],n)*r,s=m1($a[i],n);return t.y<0&&(s=-s),t.x=o*e.a*mC+e.x0,t.y=s*e.a*pC+e.y0,t}function bC(e,t){var r=t.y,n=t;n.x=(n.x-e.x0)/(e.a*mC),n.y=Math.abs(r-e.y0)/(e.a*pC);for(let a=0;a<=cl;a++)if(Math.abs(n.y-$a[a][0])<=8*Number.EPSILON)return n.x=k(n.x/$u[a][0]+e.long0,e.over),n.y=(r<e.y0?-1:1)*a*5*qy,n;if(n.y>=1)n.x/=$u[cl][0],n.y=r<0?-F:F;else{var i=Math.floor(n.y*cl);for(i<0?i=0:i>=cl&&(i=cl-1);;)if($a[i][0]>n.y)--i;else if($a[i+1][0]<=n.y)++i;else break;var o=$a[i],s=5*(n.y-o[0])/($a[i+1][0]-o[0]);s=sX(o,n.y,s,1e-10,100),n.x/=m1($u[i],s),n.y=(5*i+s)*qy,r<0&&(n.y=-n.y)}return n.x=k(n.x+e.long0,e.over),n}function wC(e,t={}){let r={...e,...t};return aX(r),r}var $u,$a,mC,pC,gC,iX,cl,m1,oX,xC=p(()=>{Ct();_t();$u=[[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]],$a=[[-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]];$u=$u.map(e=>e.map(Math.fround));$a=$a.map(e=>e.map(Math.fround));mC=.8487,pC=1.3523,gC=Vy/5,iX=1/gC,cl=18,m1=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},oX=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])}});var d_,_C=p(()=>{Bt();Qe();ut();Ut();xC();d_={name:"robin",aliases:["Robinson"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=wC(t),n=Ie("robin",e,r,yC,bC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});var m_,SC=p(()=>{Bt();Qe();ut();Ut();Kx();m_={name:"sinu",aliases:["Sinusoidal"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=GO(t),n=Ie("sinu",e,r,l1,u1);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Cr(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function cX(e){e.k0||(e.k0=1);var t=e.lat0;e.lambda0=e.long0;var r=Math.sin(t),n=e.a,i=e.rf,o=1/i,s=2*o-Math.pow(o,2);e.e=Math.sqrt(s);var a=e.e;e.R=e.k0*n*Math.sqrt(1-s)/(1-s*Math.pow(r,2)),e.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(t),4)),e.b0=Math.asin(r/e.alpha);var c=Math.log(Math.tan(Math.PI/4+e.b0/2)),l=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+a*r)/(1-a*r));e.K=c-e.alpha*l+e.alpha*a/2*u}function MC(e,t){let r=e.e*Math.sin(t.y),n=2*Math.atan(Math.exp(e.alpha*(Math.log(Math.tan(Math.PI/4+t.y/2))-e.e/2*Math.log((1+r)/(1-r)))+e.K))-Math.PI/2,i=e.alpha*(t.x-e.lambda0),o=Math.cos(n),s=Math.asin(Math.cos(e.b0)*Math.sin(n)-Math.sin(e.b0)*o*Math.cos(i)),a=Math.asin(o*Math.sin(i)/Math.cos(s));return t.x=e.x0+e.R*a,t.y=e.y0+e.R*Math.log(Math.tan(Math.PI/4+s/2)),t}function vC(e,t){let r=(t.x-e.x0)/e.R,n=2*(Math.atan(Math.exp((t.y-e.y0)/e.R))-Math.PI/4),i=Math.asin(Math.cos(e.b0)*Math.sin(n)+Math.sin(e.b0)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),s=(e.K-Math.log(Math.tan(Math.PI/4+i/2)))/e.alpha;for(let a=0;a<6;a++){let c=e.e*Math.sin(i),l=(s+Math.log(Math.tan(Math.PI/4+i/2))-e.e/2*Math.log((1+c)/(1-c)))*(1-c*c)*Math.cos(i)/(1-e.es);if(i-=l,Math.abs(l)<1e-10)return t.x=e.lambda0+o/e.alpha,t.y=i,t}return null}function EC(e,t={}){let r={...e,lambda0:0,rf:0,R:0,alpha:0,b0:0,K:0,...t};return cX(r),r}var TC=p(()=>{});var p_,AC=p(()=>{Wa();Qe();ut();Ut();TC();p_={name:"somerc",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=EC(t,{rf:t.a===t.b?1/0:1/(1-t.b/t.a)}),n=Ie("somerc",e,r,MC,vC);return De(n,Q(t.long0-Math.PI/18,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/18),t.long0+Math.PI/18,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/18)),i=>xO(kt(r,e),i),t.primeMeridian,t.over)}}});function lX(e){if(Math.abs(Math.abs(e.lat0)-F)<1e-10?e.mode=e.lat0<0?Kr.S_POLE:Kr.N_POLE:Math.abs(e.lat0)<1e-10?e.mode=Kr.EQUIT:(e.mode=Kr.OBLIQ,e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0)),e.pn1=e.h/e.a,e.pn1<=0||e.pn1>1e10)throw new Error("Invalid height");e.p=1+e.pn1,e.rp=1/e.p,e.h1=1/e.pn1,e.pfact=(e.p+1)*e.h1,e.es=0;var t=e.tilt,r=e.azi;e.cg=Math.cos(r),e.sg=Math.sin(r),e.cw=Math.cos(t),e.sw=Math.sin(t)}function IC(e,t){t.x-=e.long0;var r=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),o,s;switch(e.mode){case Kr.OBLIQ:s=e.sinph0*r+e.cosph0*n*i;break;case Kr.EQUIT:s=n*i;break;case Kr.S_POLE:s=-r;break;case Kr.N_POLE:s=r;break}switch(s=e.pn1/(e.p-s),o=s*n*Math.sin(t.x),e.mode){case Kr.OBLIQ:s*=e.cosph0*r-e.sinph0*n*i;break;case Kr.EQUIT:s*=r;break;case Kr.N_POLE:s*=-(n*i);break;case Kr.S_POLE:s*=n*i;break}var a,c;return a=s*e.cg+o*e.sg,c=1/(a*e.sw*e.h1+e.cw),o=(o*e.cg-s*e.sg)*e.cw*c,s=a*c,t.x=o*e.a,t.y=s*e.a,t}function PC(e,t){t.x/=e.a,t.y/=e.a;var r=t.x,n=t.y,i,o,s;s=1/(e.pn1-t.y*e.sw),i=e.pn1*t.x*s,o=e.pn1*t.y*e.cw*s,t.x=i*e.cg+o*e.sg,t.y=o*e.cg-i*e.sg;var a=tr(t.x,t.y);if(Math.abs(a)<1e-10)r=0,n=e.lat0;else{var c,l;switch(l=1-a*a*e.pfact,l=(e.p-Math.sqrt(l))/(e.pn1/a+a/e.pn1),c=Math.sqrt(1-l*l),e.mode){case Kr.OBLIQ:n=Math.asin(c*e.sinph0+t.y*l*e.cosph0/a),t.y=(c-e.sinph0*Math.sin(n))*a,t.x*=l*e.cosph0;break;case Kr.EQUIT:n=Math.asin(t.y*l/a),t.y=c*a,t.x*=l;break;case Kr.N_POLE:n=Math.asin(c),t.y=-t.y;break;case Kr.S_POLE:n=-Math.asin(c);break}r=Math.atan2(t.x,t.y)}return t.x=r+e.long0,t.y=n,t}function RC(e,t={}){let r={...e,mode:0,sinph0:0,cosph0:0,pn1:0,h:0,p:0,rp:0,h1:0,pfact:0,tilt:0,azi:0,cg:0,sg:0,cw:0,sw:0,...t};return lX(r),r}var Kr,LC=p(()=>{Ct();fc();Kr={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3}});var g_,OC=p(()=>{zs();qs();Ut();LC();Vt();g_={name:"tpers",aliases:["Tilted_Perspective"],parameters:["lon_0","x_0","y_0","lat_0","h","tilt","azi"],create(e){let t=Ae(e),r=re(e.parameters,"h",1e5),n=re(e.parameters,"tilt",0)*Math.PI/180,i=re(e.parameters,"azi",0)*Math.PI/180;if(Math.abs(n)>=Math.PI/2)throw new Error("Perspective tilt must be between -90 and 90 degrees");let o=RC(t,{h:r,tilt:n,azi:i}),s=1+r/t.a,a=Math.acos(1/s),c=Math.abs(n),l=s*Math.cos(c)<1?c-Math.acos(s*Math.cos(c)):a,u=Math.min(a,l)*(1-1e-10);return wn(Ie("tpers",e,o,IC,PC,Ha(t,1/(1+r/t.a))),t,u,(h,d)=>HT(kt(t,e),s,n,i,h,d),a)}}});function uX(e){e.R=e.a}function BC(e,t){var r=t.x,n=t.y,i=k(r-e.long0,e.over),o,s;if(Math.abs(n)<=1e-10)return o=e.x0+e.R*i,s=e.y0,t.x=o,t.y=s,t;var a=sl(2*Math.abs(n/Math.PI));if(Math.abs(i)<=1e-10||Math.abs(Math.abs(n)-F)<=1e-10)return o=e.x0,n>=0?s=e.y0+Math.PI*e.R*Math.tan(.5*a):s=e.y0+Math.PI*e.R*-Math.tan(.5*a),t.x=o,t.y=s,t;var c=.5*Math.abs(Math.PI/i-i/Math.PI),l=c*c,u=Math.sin(a),h=Math.cos(a),d=h/(u-2*Math.sin(a/2)**2),m=d*d,g=d*(2/u-1),y=g*g,b=Math.sqrt(l*(d-y)*(d-y)-(y+l)*(m-y)),w=Math.PI*e.R*(y-m)/(b-c*(d-y));i<0&&(w=-w),o=e.x0+w;var _=l+d;return w=Math.PI*e.R*(l*(2*d-1)+m)/(g*_+c*Math.sqrt((y+l)*(l+1)-_*_)),n>=0?s=e.y0+w:s=e.y0-w,t.x=o,t.y=s,t}function CC(e,t){var r,n,i,o,s,a,c,l,u,h,d,m,g;return t.x-=e.x0,t.y-=e.y0,Math.abs(t.y)<1e-10?(t.x=k(e.long0+t.x/e.R,e.over),t.y=0,t):(d=Math.PI*e.R,i=t.x/d,o=t.y/d,s=i*i+o*o,a=-Math.abs(o)*(1+s),c=a-2*o*o+i*i,l=-2*a+1+2*o*o+s*s,g=o*o/l+(2*c*c*c/l/l/l-9*a*c/l/l)/27,u=(a-c*c/3/l)/l,h=2*Math.sqrt(-u/3),d=3*g/u/h,Math.abs(d)>1&&(d>=0?d=1:d=-1),m=Math.acos(d)/3,t.y>=0?n=(-h*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI:n=-(-h*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI,Math.abs(i)<1e-10?r=e.long0:r=k(e.long0+2*Math.PI*i/(Math.sqrt(1+2*(i*i-o*o)+s*s)+1-s),e.over),t.x=r,t.y=n,t)}function DC(e,t={}){let r={...e,R:0,...t};return uX(r),r}var NC=p(()=>{_t();Ct();c1()});var y_,FC=p(()=>{Bt();Qe();ut();Ut();NC();y_={name:"vandg",aliases:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=DC(t),n=Ie("vandg",e,r,BC,CC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>pT(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function fX(e){let t=[["o_alpha","o_lon_c","o_lat_c"],["o_lat_p","o_lon_p"],["o_lon_1","o_lat_1","o_lon_2","o_lat_2"]],r=t.find(c=>c.some(l=>w_(e,l)));if(!r)throw new Error("Oblique transformation requires a rotation parameter set");for(let c of r){if(!w_(e,c))throw new Error("Oblique transformation requires "+c);if(c.includes("lat")&&Math.abs(Yi(e,c))>Math.PI/2)throw new Error("Invalid rotation latitude: "+c)}if(r===t[0]){let c=Yi(e,"o_alpha"),l=Yi(e,"o_lon_c"),u=Yi(e,"o_lat_c");if(Math.abs(u)>=Math.PI/2-1e-10)throw new Error("Rotation center must be away from the poles");return{lamp:l+Math.atan2(-Math.cos(c),-Math.sin(c)*Math.sin(u)),phip:Math.asin(Math.cos(u)*Math.sin(c))}}if(r===t[1])return{lamp:Yi(e,"o_lon_p"),phip:Yi(e,"o_lat_p")};let n=Yi(e,"o_lon_1"),i=Yi(e,"o_lat_1"),o=Yi(e,"o_lon_2"),s=Yi(e,"o_lat_2");if(Math.abs(i)>=Math.PI/2-1e-10||Math.abs(s)>=Math.PI/2-1e-10||Math.abs(i)<1e-10||Math.abs(i-s)<1e-10)throw new Error("Invalid new-equator reference points");let a=Math.atan2(Math.cos(i)*Math.sin(s)*Math.cos(n)-Math.sin(i)*Math.cos(s)*Math.cos(o),Math.sin(i)*Math.cos(s)*Math.sin(o)-Math.cos(i)*Math.sin(s)*Math.sin(n));return{lamp:a,phip:Math.atan(-Math.cos(a-n)/Math.tan(i))}}function p1(e){let t=e==="longlat";if(!t&&["obtran","geocent"].includes(b_(e.name)))throw new Error("Cannot wrap a composite or geocentric projection");return{name:"ob_tran",aliases:["General Oblique Transformation","General_Oblique_Transformation"],parameters:[...GC,"lon_0",...t?[]:e.parameters],flags:t?[]:e.flags,create(r){var P;let{parameters:n}=r,i=n.o_proj,o=t?["longlat","latlong","lonlat","latlon","identity"]:[e.name,...e.aliases||[]];if(i&&!o.map(b_).includes(b_(i)))throw new ai("missing-plugin","Oblique transformation dependency does not match +o_proj="+i);let{lamp:s,phip:a}=fX(n),c=Math.cos(a),l=Math.sin(a),u=Math.abs(a)>1e-10,h=Yi(n,"lon_0"),d=w_(n,"over"),m={...n,proj:t?"longlat":i||e.name,lon_0:"0"};for(let M of GC)delete m[M];let g=t?pi(M=>{M.x*=180/Math.PI,M.y*=180/Math.PI},M=>{M.x*=Math.PI/180,M.y*=Math.PI/180}):e.create({...r,parameters:Object.freeze(m),primeMeridian:0}),y=Wo(g,!1),b=Wo(g,!0),w=M=>Math.asin(Math.max(-1,Math.min(1,M))),_=M=>{let U=M.x,C=M.y,L=Xt(U-h,d),A=Math.cos(L),W=Math.sin(C),G=Math.cos(C),E=Xt(Math.atan2(G*Math.sin(L),u?l*G*A+c*W:W)+s),B=w(u?l*W-c*G*A:-G*A);M.x=E,M.y=B},S=M=>{let U=M.x,C=M.y,L=U-s,A=Math.cos(L),W=Math.sin(C),G=Math.cos(C),E=Math.atan2(G*Math.sin(L),u?l*G*A-c*W:-W),B=w(u?l*W+c*G*A:G*A);M.x=Xt(E+h),M.y=B},v=pi(M=>{_(M),y(M)},M=>{b(M),S(M)}),T=t?qa(m):(P=g.getRenderingProfile)==null?void 0:P.bind(g);if(!T)return v;let O=(M,U)=>{let C=U&&ur(()=>M.bounds,U,h,r.primeMeridian??0,d),L=Cs(A=>{var D;let W=A.x,G=A.y;_(A);let E=A.x*180/Math.PI,B=A.y*180/Math.PI,N={x:E,y:B,z:A.z};if((D=M.normalize)==null||D.call(M,N),N.x===E&&N.y===B){A.x=W,A.y=G;return}A.x=N.x*Math.PI/180,A.y=N.y*Math.PI/180,S(A),d&&(A.x+=Math.round((W-A.x)/(2*Math.PI))*2*Math.PI)},r.primeMeridian??0);return{get bounds(){let A=M.bounds,W=G=>[G[0]*180/Math.PI,G[1]*180/Math.PI,G[2]];return t?[W(A[0]),W(A[1])]:A},normalize(A){C==null||C.normalize(A),L(A)}}};return{...v,longitudeOrigin:h,getRenderingProfile(M){if(!M)return O(T());let U=Bs(M,r.primeMeridian??0,h),C=Q(U[0][0]-h,U[0][1],U[1][0]-h,U[1][1]),L=dt(u?[-c,0,l]:[-1,0,0],C),A=u?[l,0,c]:[0,0,1],G=dt(A,C)[0]>0?js([0,1,0],A,0,C).map(Math.atan):[-Math.PI,Math.PI];return O(T(Gn(Q(G[0]+s,w(L[0]),G[1]+s,w(L[1])))),M)}}}}}var GC,b_,w_,Yi,kC=p(()=>{lc();Vh();Vt();cc();za();ut();Qe();dc();GC=["o_proj","o_alpha","o_lon_c","o_lat_c","o_lon_p","o_lat_p","o_lon_1","o_lat_1","o_lon_2","o_lat_2"],b_=e=>e.toLowerCase().replace(/[ _-]/g,""),w_=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Yi=(e,t)=>re(e,t,0)*Math.PI/180});function Rt(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Expected a CRS object");return e}function Zh(e){return Array.isArray(e)?e:[]}function Xr(e){return String(e||"").toLowerCase().replace(/[^a-z0-9]/g,"")}function Or(e){if(typeof e!="number"||!Number.isFinite(e))throw new Error("Expected a finite CRS parameter");return e}function Bn(e,t){if(e===void 0)return t;if(typeof e=="object"){let i=Or(Rt(e).conversion_factor);if(i<=0)throw new Error("Unit conversion factor must be positive");return i}let n={metre:1,meter:1,degree:At,radian:1,grad:Math.PI/200,gon:Math.PI/200,foot:.3048,ussurveyfoot:1200/3937,kilometre:1e3,arcsecond:At/3600,partspermillion:1e-6,unity:1}[Xr(e)];return n||Ue("Unsupported CRS unit: "+String(e)),n}function ll(e,t){var M,U,C;let r=String(e.type),n=gX(e.bbox);if(r==="CompoundCRS"){t.mode!=="horizontal"&&Ue("CompoundCRS requires explicit horizontal extraction");let L=Zh(e.components).map(Rt).filter(W=>["ProjectedCRS","GeographicCRS","GeodeticCRS","BoundCRS"].includes(String(W.type)));if(L.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");let A=ll(L[0],t);return{...A,areaOfUse:n??A.areaOfUse,lossy:!0}}if(r==="BoundCRS"){let L=ll(Rt(e.source_crs),t),A=ll(Rt(e.target_crs),t);(A.parameters.datum!=="WGS84"||!["longlat","geocent"].includes(A.parameters.proj)||Number(A.parameters.pm||0)!==0||A.parameters.towgs84||Number(A.parameters.a)!==6378137||!(Math.abs(Number(A.parameters.rf)-298.257223563)<=1e-9||Math.abs(Number(A.parameters.b)-6356752314245179e-9)<=1e-6))&&Ue("BoundCRS requires a WGS84 target");let W=Rt(e.transformation),G=Xr(Rt(W.method).name),E=G==="geocentrictranslations"||/^geocentrictranslationsgeog[23]ddomain$/.test(G),B=/^positionvector(?:transformation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(G),N=/^coordinateframe(?:rotation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(G);!E&&!B&&!N&&Ue("Unsupported BoundCRS transformation: "+G);let D=["xaxistranslation","yaxistranslation","zaxistranslation","xaxisrotation","yaxisrotation","zaxisrotation","scaledifference"],R=new Array(E?3:7).fill(void 0);for(let j of Zh(W.parameters)){let we=Rt(j),_e=D.indexOf(Xr(we.name));(_e<0||_e>=R.length||R[_e]!==void 0)&&Ue("Unsupported or duplicate Helmert parameter: "+String(we.name));let ne=_e<3?1:_e<6?At/3600:1e-6;R[_e]=Or(we.value)*Bn(we.unit,ne)/ne*(N&&_e>=3&&_e<6?-1:1)}if(R.some(j=>j===void 0))throw new Error("Incomplete BoundCRS Helmert transformation");let I={...L.parameters,towgs84:R.join(",")};return delete I.datum,{...L,parameters:I,areaOfUse:n??L.areaOfUse}}["ProjectedCRS","GeographicCRS","GeodeticCRS"].includes(r)||Ue("Unsupported CRS type: "+r);let i=r==="ProjectedCRS"?Rt(e.base_crs):e,o=Rt(i.datum||i.datum_ensemble);(o.type==="DynamicGeodeticReferenceFrame"||o.frame_reference_epoch!==void 0||e.coordinate_epoch!==void 0)&&Ue("Time-dependent datum transformations are not implemented");let s=Rt(o.ellipsoid),a=Or(s.semi_major_axis??s.radius),c={proj:"longlat",a:String(a*Bn(s.unit,1))};if(s.inverse_flattening!==void 0)c.rf=String(Or(s.inverse_flattening));else if(s.semi_minor_axis!==void 0)c.b=String(Or(s.semi_minor_axis)*Bn(s.unit,1));else if(s.radius!==void 0)c.b=c.a;else throw new Error("Ellipsoid requires inverse flattening or semi-minor axis");let l=Nu(t),u=String(o.name||""),h=Xr(u),d=Object.keys(l),m=d.find(L=>ol(L)===ol(u)),g=m?[m]:d.filter(L=>Xr(L)===h||Xr(L)===h.replace(/^d/,"")),y=g[0],b=l[y];if(b&&g.some(L=>{let A=l[L];return A.ellipse!==b.ellipse||A.towgs84!==b.towgs84||A.nadgrids!==b.nadgrids}))throw new Error("Ambiguous structured datum name: "+u);if(h&&(c.datum=y||u),y&&ol(y)==="wgs84"&&(c.datum="WGS84"),y&&["nad83","northamericandatum1983"].includes(ol(y))&&(c.datum="NAD83"),!y){["wgs84","worldgeodeticsystem1984","worldgeodeticsystem1984ensemble","dwgs1984","wgs1984"].includes(h)&&(c.datum="WGS84"),["nad83","northamericandatum1983","dnorthamerican1983"].includes(h)&&(c.datum="NAD83"),["nad27","northamericandatum1927","dnorthamerican1927"].includes(h)&&(c.datum="NAD27");let A={newzealand1949:"nzgd49",belge1972:"rnb72"}[h.replace(/^d/,"")];A&&(c.datum=A)}if(r==="ProjectedCRS"&&i.id){let L=Rt(i.id),A=String(L.authority)+"_"+String(L.code);Object.prototype.hasOwnProperty.call(l,A)&&(c.datum=A)}o.towgs84!==void 0&&(c.towgs84=Zh(o.towgs84).map(Or).join(","),delete c.datum);let w=e.coordinate_system?Rt(e.coordinate_system):{},_=Zh(w.axis).map(Rt),S=Xr(w.subtype)==="cartesian"&&r==="GeodeticCRS";r!=="ProjectedCRS"&&!S&&w.subtype&&Xr(w.subtype)!=="ellipsoidal"&&Ue("Unsupported coordinate system subtype"),S&&(c.proj="geocent");let v=Bn(i.angular_unit,At),T=Bn((M=_[0])==null?void 0:M.unit,r==="ProjectedCRS"||S?1:v);_[1]&&Bn(_[1].unit,T)!==T&&Ue("Mixed horizontal axis units are not supported"),S&&_[2]&&Bn(_[2].unit,T)!==T&&Ue("Mixed geocentric axis units are not supported");let O=i.prime_meridian||o.prime_meridian;if(O){let L=Rt(O);c.pm=String(Or(L.longitude)*Bn(L.unit,v)/At)}if(r==="ProjectedCRS"){let L=Rt(e.conversion),A=Xr(Rt(L.method).name),W=Zh(L.parameters).map(Rt),G=A==="stereographicnorthpole"&&!W.some(D=>Xr(D.name).startsWith("scalefactor")),E=G?"stere":hX[A],B=W.filter(D=>["xscale","yscale","xyplanerotation"].includes(Xr(D.name)));if(B.length){let D={xscale:-1,yscale:1,xyplanerotation:90};(E!=="krovak"||B.length!==3||new Set(B.map(R=>Xr(R.name))).size!==3||B.some(R=>{let I=Xr(R.name),j=I==="xyplanerotation"?Bn(R.unit,v)/At:Bn(R.unit,1);return Math.abs(Or(R.value)*j-D[I])>1e-10}))&&Ue("Unsupported ESRI Krovak axis adjustment")}(!E||E.startsWith("unsupported"))&&Ue("Unsupported projection method: "+String(Rt(L.method).name)),c.proj=E==="webmerc"?"merc":E;let N=!1;for(let D of W){let R=Xr(D.name);if(B.includes(D)||R==="auxiliaryspheretype"&&E==="webmerc"&&D.value===0)continue;if(R==="semiminor"&&E==="webmerc"){if(N)throw new Error("Duplicate conversion parameter: semi_minor");N=!0;let ne=Or(D.value)*Bn(D.unit,1);Math.abs(ne-Number(c.a))>4*Number.EPSILON*Number(c.a)&&Ue("Pseudo-Mercator semi_minor must equal the semi-major axis");continue}let I=((U=mX[E])==null?void 0:U[R])||dX[R];if(I||Ue("Unsupported conversion parameter: "+String(D.name)),I==="lat_1"&&A==="stereographicnorthpole"&&!G?I="lat_0":I==="lat_1"&&["merc","webmerc","eqc","stere","cea"].includes(E)&&(I="lat_ts"),c[I]!==void 0)throw new Error("Duplicate conversion parameter: "+I);if(["merc","webmerc"].includes(E)&&I==="lat_0"&&D.value===0)continue;let j=I.startsWith("lat")||I.startsWith("lon")||I==="alpha"||I==="gamma",we=I==="x_0"||I==="y_0",_e=Or(D.value)*Bn(D.unit,j?v:we?T:1)/(j?At:1);I.startsWith("lat")&&Math.abs(Math.abs(_e)-90)<=4*Number.EPSILON*90&&(_e=Math.sign(_e)*90),c[I]=String(_e)}if(E==="omerc"&&["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(A)&&(c.no_uoff=void 0),E==="omerc"&&c.lon_0!==void 0&&c.lonc!==void 0&&(Math.abs(Number(c.lon_0)-Number(c.lonc))>1e-10&&Ue("Oblique Mercator central meridian conflicts with projection centre"),delete c.lon_0),A==="stereographicnorthpole"&&Math.abs(Number(c.lat_0))===90&&(c.proj="stere"),E==="lcc"&&c.lat_1===void 0&&(c.lat_1=c.lat_0),A==="polarstereographic"&&c.lat_0!==void 0){if(c.lat_ts!==void 0)throw new Error("Duplicate polar stereographic latitude of true scale");c.lat_ts=c.lat_0,delete c.lat_0}E==="stere"&&(A.includes("polar")||A==="stereographicsouthpole"||G)&&c.lat_0===void 0&&(c.lat_0=Number(c.lat_ts||90)<0?"-90":"90"),E==="webmerc"&&(c.b=c.a,delete c.rf,c.nadgrids="@null")}let P=_.map(L=>yX(L,c,r==="ProjectedCRS")).join("");return P.length===2&&(P+="u"),!S&&/[ud]/.test(P.slice(0,2))&&Ue("Structured CRS vertical-first axes require an explicit PROJ axis definition"),P&&(c.axis=P),(r==="ProjectedCRS"||S)&&(c.to_meter=String(T)),{parameters:c,areaOfUse:n,angularUnit:r==="ProjectedCRS"||S?v:T,verticalUnit:S?1:Bn((C=_[2])==null?void 0:C.unit,1)}}function gX(e){let t;if(e!==void 0){let r=Rt(e),n=Or(r.west_longitude),i=Or(r.south_latitude),o=Or(r.east_longitude),s=Or(r.north_latitude);if(n<-180||n>180||o<-180||o>180||i<-90||s>90||i>=s||n===o)throw new Error("Invalid CRS geographic bounding box");t=[n,i,o,s]}return t}function yX(e,t,r){var a;let n=String(e.direction),i=e.meridian,o=/^(north|south) along ([+-]?(?:\d+(?:\.\d*)?|\.\d+)) deg(?: (east|west))?$/i.exec(n);if(o){if(i!==void 0)throw new Error("Duplicate axis meridian");n=o[1],i={longitude:Number(o[2])*(((a=o[3])==null?void 0:a.toLowerCase())==="west"?-1:1)}}if(i!==void 0){let c=Number(t.lat_0),l=c===90;(!r||t.proj!=="stere"||Math.abs(c)!==90||Xr(n)!==(l?"south":"north"))&&Ue("Axis meridians require an outward-facing polar stereographic axis");let u=Rt(i).longitude,h=typeof u=="number"?Or(u):Or(Rt(u).value)*Bn(Rt(u).unit,At)/At,d=Or((h-Number(t.lon_0||0))/90);Math.abs(d-Math.round(d))>1e-12&&Ue("Non-cardinal axis meridians require an orientation operation");let m=(Math.round(d)%4+4)%4;return(l?"senw":"nesw")[m]}let s=pX[Xr(n)];return s||Ue("Unsupported axis direction: "+n),s}var hX,dX,mX,pX,x_=p(()=>{K0();Vt();za();hX={hotineobliquemercator:"omerc",hotineobliquemercatorvarianta:"omerc",hotineobliquemercatorvariantb:"omerc",hotineobliquemercatorazimuthnaturalorigin:"omerc",hotineobliquemercatorazimuthcenter:"omerc",obliquemercator:"omerc",krovak:"krovak",krovaknorthorientated:"krovak",quadrilateralizedsphericalcube:"qsc",transversemercator:"tmerc",transversemercatorsouthorientated:"unsupported-south-tmerc",mercator:"merc",mercator1sp:"merc",mercator2sp:"merc",mercatorvarianta:"merc",mercatorvariantb:"merc",mercatorauxiliarysphere:"webmerc",popularvisualisationpseudomercator:"webmerc",lambertconformalconic:"lcc",lambertconformalconic1sp:"lcc",lambertconformalconic2sp:"lcc",lambertconicconformal1sp:"lcc",lambertconicconformal2sp:"lcc",albers:"aea",albersconicequalarea:"aea",albersequalarea:"aea",equidistantconic:"eqdc",lambertazimuthalequalarea:"laea",stereographic:"stere",stereographicnorthpole:"sterea",stereographicsouthpole:"stere",polarstereographic:"stere",polarstereographicvarianta:"stere",polarstereographicvariantb:"stere",obliquestereographic:"sterea",doublestereographic:"sterea",azimuthalequidistant:"aeqd",modifiedazimuthalequidistant:"aeqd",equidistantcylindrical:"eqc",equidistantcylindricalspherical:"eqc",equirectangular:"eqc",platecarree:"eqc",bonne:"bonne",cassinisoldner:"cass",cassini:"cass",cylindricalequalarea:"cea",lambertcylindricalequalarea:"cea",eckertvi:"eck6",equalearth:"eqearth",millercylindrical:"mill",mollweide:"moll",robinson:"robin",sinusoidal:"sinu",vandergrinten:"vandg",vandergrinteni:"vandg",gnomonic:"gnom",orthographic:"ortho",polyconic:"poly",americanpolyconic:"poly",newzealandmapgrid:"nzmg",gaussschreibertransversemercator:"gstmerc"},dX={centralmeridian:"lon_0",longitudeoforigin:"lon_0",longitudeofcenter:"lon_0",longitudeofnaturalorigin:"lon_0",longitudeoffalseorigin:"lon_0",longitudeofprojectioncentre:"lon_0",straightverticalpolelongitude:"lon_0",longitudeoforiginmeridian:"lon_0",latitudeoforigin:"lat_0",latitudeofcenter:"lat_0",latitudeofnaturalorigin:"lat_0",latitudeoffalseorigin:"lat_0",latitudeofprojectioncentre:"lat_0",standardparallel1:"lat_1",latitudeof1ststandardparallel:"lat_1",standardparallel2:"lat_2",latitudeof2ndstandardparallel:"lat_2",latitudeofstandardparallel:"lat_ts",scalefactor:"k_0",scalefactoratnaturalorigin:"k_0",scalefactoratprojectionorigin:"k_0",falseeasting:"x_0",falsenorthing:"y_0",eastingatfalseorigin:"x_0",northingatfalseorigin:"y_0"},mX={omerc:{longitudeofcenter:"lonc",longitudeofprojectioncentre:"lonc",azimuth:"alpha",azimuthatprojectioncentre:"alpha",rectifiedgridangle:"gamma",anglefromrectifiedtoskewgrid:"gamma",scalefactoratprojectioncentre:"k_0",eastingatprojectioncentre:"x_0",northingatprojectioncentre:"y_0"},krovak:{azimuth:"alpha",colatitudeofconeaxis:"alpha",pseudostandardparallel1:"lat_ts",latitudeofpseudostandardparallel:"lat_ts",scalefactoronpseudostandardparallel:"k_0"}},pX={east:"e",west:"w",north:"n",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"}});function g1(e,...t){return e.values.filter(r=>r.type==="node"&&t.includes(r.keyword.toUpperCase()))}function vt(e,...t){return g1(e,...t)[0]}function wt(e,t=0){let r=e.values[t];return r&&r.type!=="node"?r.value:void 0}function ul(e){return e?{name:wt(e),conversion_factor:wt(e,1)}:void 0}function bX(e,t){let r=wt(e,1);if(t&&String(r).toLowerCase()==="unknown"){let n=String(wt(e)).toLowerCase(),i=/^(easting|northing|westing|southing)(?:\s*\([a-z]\))?$/.exec(n);if(i)return{easting:"east",northing:"north",westing:"west",southing:"south"}[i[1]]}return r}function wX(e){let t=vt(e,"MERIDIAN");if(t)return{longitude:{value:wt(t),unit:ul(vt(t,"ANGLEUNIT"))}}}function UC(e){let t=vt(e,"METHOD","PROJECTION");if(!t)throw new Error("WKT conversion requires a METHOD or PROJECTION");return vt(e,"PARAMETERFILE")&&Ue("Grid-based WKT operation is not implemented"),{method:{name:wt(t)},parameters:g1(e,"PARAMETER").map(r=>({name:wt(r),value:wt(r,1),unit:ul(vt(r,"ANGLEUNIT","LENGTHUNIT","SCALEUNIT"))}))}}function Jh(e){let t=e.keyword.toUpperCase();if(t==="COMPD_CS"||t==="COMPOUNDCRS")return{type:"CompoundCRS",components:g1(e,"PROJCS","PROJCRS","GEOGCS","GEOGCRS","GEODCRS","BOUNDCRS","VERT_CS","VERTCRS").map(Jh)};if(t==="BOUNDCRS"){let d=vt(e,"SOURCECRS"),m=vt(e,"TARGETCRS"),g=vt(e,"ABRIDGEDTRANSFORMATION");if(!d||!m||!g)throw new Error("Incomplete WKT BoundCRS");let y=_=>{let S=_.values.find(v=>v.type==="node");if(!S)throw new Error("Missing bound CRS component");return S},b=UC(g),w=b.parameters;for(let _ of w)String(_.name).toLowerCase()==="scale difference"&&_.unit===void 0&&(_.value=(Number(_.value)-1)*1e6);return{type:"BoundCRS",source_crs:Jh(y(d)),target_crs:Jh(y(m)),transformation:b}}if(["VERT_CS","VERTCRS"].includes(t))return{type:"VerticalCRS"};let r=["PROJCS","PROJCRS","PROJECTEDCRS"].includes(t),n=["GEOGCS","GEOGCRS","GEODCRS","GEODETICCRS","GEOGRAPHICCRS","BASEGEOGCRS","BASEGEODCRS","GEOCCS"].includes(t);!r&&!n&&Ue("Unsupported WKT CRS: "+t),vt(e,"DYNAMIC","DERIVINGCONVERSION","VELOCITYGRID","EXTENSION")&&Ue("Unsupported WKT dynamic/extension operation");let i=vt(e,"CS"),o=t==="GEOCCS"||String(wt(i||e)).toLowerCase()==="cartesian"&&!r,s=vt(e,r||o?"LENGTHUNIT":"ANGLEUNIT","UNIT"),a=g1(e,"AXIS").sort((d,m)=>Number(wt(vt(d,"ORDER")||d))-Number(wt(vt(m,"ORDER")||m))).map((d,m)=>({name:wt(d),direction:t==="GEOCCS"?["geocentricX","geocentricY","geocentricZ"][m]:bX(d,r),unit:ul(vt(d,"ANGLEUNIT","LENGTHUNIT")||(!o&&!r&&/^(up|down)$/i.test(String(wt(d,1)))?void 0:s)),meridian:wX(d)}));if(!a.length)for(let d of o?["geocentricX","geocentricY","geocentricZ"]:["east","north"])a.push({name:d,direction:d,unit:ul(s),meridian:void 0});let c=t==="GEOGCS"?void 0:vt(e,"ID"),l={type:r?"ProjectedCRS":o?"GeodeticCRS":"GeographicCRS",name:wt(e),id:c?{authority:wt(c),code:wt(c,1)}:void 0,coordinate_system:{subtype:r||o?"Cartesian":"ellipsoidal",axis:a}},u=vt(e,"USAGE"),h=vt(u||e,"BBOX");if(h&&(l.bbox={south_latitude:wt(h,0),west_longitude:wt(h,1),north_latitude:wt(h,2),east_longitude:wt(h,3)}),r){let d=vt(e,"GEOGCS","BASEGEOGCRS","BASEGEODCRS","GEODCRS","GEOGCRS");if(!d)throw new Error("Projected WKT requires a base geographic CRS");l.base_crs=Jh(d),l.conversion=UC(vt(e,"CONVERSION")||e)}else{let d=vt(e,"DATUM","GEODETICDATUM","ENSEMBLE");if(!d)throw new Error("WKT requires a geodetic datum");vt(d,"EXTENSION","DYNAMIC")&&Ue("Unsupported datum extension");let m=vt(d,"SPHEROID","ELLIPSOID");if(!m)throw new Error("WKT datum requires an ellipsoid");let g=vt(d,"TOWGS84");l.datum={name:wt(d),ellipsoid:{name:wt(m),semi_major_axis:wt(m,1),inverse_flattening:wt(m,2),unit:ul(vt(m,"LENGTHUNIT"))},towgs84:g==null?void 0:g.values.map((b,w)=>wt(g,w))};let y=vt(e,"PRIMEM");y&&(l.prime_meridian={name:wt(y),longitude:wt(y,1),unit:ul(vt(y,"ANGLEUNIT")||(o?void 0:s))}),l.angular_unit=o?void 0:ul(s)}return l}var __,jC=p(()=>{Dl();ry();za();x_();__={name:"wkt",canParse:e=>wr(e)==="wkt",parse(e,t){if(typeof e!="string")throw new Error("Expected serialized WKT");return ll(Jh(_f(e).root),t)}}});var S_,zC=p(()=>{Dl();x_();S_={name:"projjson",canParse:e=>wr(e)==="projjson",parse:(e,t)=>ll(Rt(e),t)}});var q3e,V3e,W3e,qC=p(()=>{q3e=new Float64Array(0),V3e=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,W3e={deg:Math.PI/180,rad:1,m:1,ft:.3048,"us-ft":1200/3937}});var M_=p(()=>{PL();RL();LL();NL();jL();HL();ZL();QT();aO();pO();$y();zT();gO();IO();OO();FO();qO();YO();tB();cB();yB();vB();PB();CB();UB();WB();YB();tC();cC();dC();_C();SC();AC();OC();FC();kC();jC();zC();qC()});var y1,VC,WC=p(()=>{y1={ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clrk80ign",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-0.008393,0.000749,-0.010276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"372.87,149.23,585.29"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(let e in y1){let t=y1[e];t.datumName&&(y1[t.datumName]=t)}VC=y1});var HC,$C=p(()=>{WC();HC=Object.freeze({name:"regional-datums",datums:Object.freeze(VC)})});function xX(e){return{...e,parse(t,r){let n=e.parse(t,r),i=n.parameters.datum,o=s=>s.toLowerCase().replace(/[\s_-]/g,"");if(i&&!Object.keys(Nu(r)).some(s=>o(s)===o(i))){let s={...n.parameters};return delete s.datum,{...n,parameters:s}}return n}}}function SX(){if(b1)return b1;let e=[Ex,Tx,Ax,Px,Rx,Cx,Zy,Dx,kx,Wy,Hy,Ky,Ux,zx,Hx,$x,Xx,Jx,Qx,e_,t_,i_,o_,s_,a_,c_,l_,u_,f_,h_,d_,m_,p_,g_,y_],t=i=>i.toLowerCase().replace(/[\s_-]/g,""),r=p1("longlat"),n={name:r.name,aliases:r.aliases,parameters:[...new Set([...r.parameters,...e.flatMap(i=>i.parameters)])],flags:[...new Set(e.flatMap(i=>i.flags||[]))],create(i){let o=i.parameters.o_proj;if(!o)throw new Error("Oblique transformation requires +o_proj");let s=["longlat","latlong","latlon","lonlat","identity"].includes(t(o))?"longlat":e.find(l=>[l.name,...l.aliases||[]].some(u=>t(u)===t(o)));if(!s)throw new Error("Unknown oblique transformation projection: "+o);let a=p1(s),c=new Set([...X0,...a.parameters]);for(let l of Object.keys(i.parameters))if(!c.has(l))throw new Error("Unsupported PROJ parameter: +"+l);return a.create(i)}};return b1=[...e,n],b1}var _X,b1,Ku,MX,KC=p(()=>{IL();$C();K0();M_();Fu();_X=[__,S_].map(xX);Ku=class extends i1{constructor(t={}){super({...t,projections:t.projections??SX(),parsers:t.parsers??_X,datumCatalogs:t.datumCatalogs??[HC]}),this.useDefinitionSignature=!$h(t)}},MX=new Ku});var XC=p(()=>{M_();KC()});function YC(){return EX}function ZC(e){return vX.get(e)}var vX,EX,JC=p(()=>{"use strict";XC();vX=new Map,EX=new Ku});function TX(e,t,r){let n=[];for(let i=0;i<3;i++){let o=t.slice(),s=t.slice();o[i]+=r,s[i]-=r;let a=e.transformPosition(o),c=e.transformPosition(s);n.push([(a[0]-c[0])/(2*r),(a[1]-c[1])/(2*r),(a[2]-c[2])/(2*r)])}return n}function AX(e,t){let[r,n,i]=e,o=r[0]*(n[1]*i[2]-n[2]*i[1])-n[0]*(r[1]*i[2]-r[2]*i[1])+i[0]*(r[1]*n[2]-r[2]*n[1]);return!Number.isFinite(o)||Math.abs(o)<1e-15?t:[[n[1]*i[2]-n[2]*i[1],r[2]*i[1]-r[1]*i[2],r[1]*n[2]-r[2]*n[1]],[n[2]*i[0]-n[0]*i[2],r[0]*i[2]-r[2]*i[0],r[2]*n[0]-r[0]*n[2]],[n[0]*i[1]-n[1]*i[0],r[1]*i[0]-r[0]*i[1],r[0]*n[1]-r[1]*n[0]]].map(a=>(a[0]*t[0]+a[1]*t[1]+a[2]*t[2])/o)}function Qh(e){if(!e)throw new Error("Cannot construct a projection because the CRS is unknown");if(typeof e!="string"&&e.type==="CompoundCRS"){let t=e.components.filter(r=>r.type!=="VerticalCRS");if(t.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");return Qh(t[0])}return e}function IX(e){if(e.outputCoordinates==="local-enu")throw new Error("local-enu output requires a dataset-derived local origin and must be created by a tileset source");if(e.outputCoordinates==="target-crs"&&!e.targetCrs)throw new Error("target-crs output requires targetCrs");if(!e.sourceCrs&&e.status==="unresolved")throw new Error("Cannot transform coordinates because the source CRS is unknown");if(Xu(e)&&e.heightReference==="unknown")throw new Error("Cannot convert heights because the source height reference is unknown");if(e.coordinateFrame==="geocentric"&&!v_(e.sourceCrs))throw new Error("Only EPSG:4978 geocentric coordinates are supported by the current spatial transformer");if(e.status==="unresolved")throw new Error("The requested spatial output cannot be resolved from the available metadata")}function v_(e){return typeof e=="string"&&Uh(e)===q0}function QC(e){if(typeof e!="string")return!1;let t=Uh(e);return t===Du||t==="EPSG:4979"||t==="OGC:CRS84"}function Xu(e){let t=e.targetHeightReference;return t!=="native"&&t!==e.heightReference}function PX(e){return typeof e=="string"?ZC(e):e}function RX(e,t,r,n){if(r===n||n==="native")return e;if(r==="orthometric"&&n==="ellipsoidal")return e+t;if(r==="ellipsoidal"&&n==="orthometric")return e-t;throw new Error(`Unsupported height conversion from ${r} to ${n}`)}var fl,E_=p(()=>{"use strict";Fn();Nf();CR();JC();ax();cx();fl=class{spatialReference;horizontalProjection;horizontalProjectionBuffer;geographicProjection;heightOutputProjection;sourceIsGeocentric;outputIsGeocentric;sourceIsGeographic;outputIsGeographic;geoid;constructor(t,r={}){this.spatialReference=t;let n=YC();IX(t);let i=t.targetCrs||t.sourceCrs;if(this.sourceIsGeocentric=v_(t.sourceCrs),this.outputIsGeocentric=v_(i),this.sourceIsGeographic=QC(t.sourceCrs),this.outputIsGeographic=QC(i),t.sourceCrs&&t.targetCrs&&!this.sourceIsGeocentric&&!this.outputIsGeocentric&&(this.horizontalProjection=n.createProjection({from:Qh(t.sourceCrs),to:Qh(t.targetCrs),enforceAxis:!1}),Xu(t)||(this.horizontalProjectionBuffer=new H0({projection:this.horizontalProjection,dimension:3}))),(Xu(t)||this.sourceIsGeocentric||this.outputIsGeocentric)&&(!this.sourceIsGeographic&&!this.sourceIsGeocentric&&(this.geographicProjection=n.createProjection({from:Qh(t.sourceCrs),to:Du,enforceAxis:!1})),!this.outputIsGeographic&&!this.outputIsGeocentric&&(this.heightOutputProjection=n.createProjection({from:Du,to:Qh(i),enforceAxis:!1}))),Xu(t)&&(this.geoid=PX(r.geoidModel),!this.geoid)){let o=typeof r.geoidModel=="string"?` "${r.geoidModel}"`:"";throw new Error(`Height conversion requires a registered geoid model${o}; call registerGeoidModel() or pass a parsed Geoid instance`)}}transformPosition(t){if(t.length<2)throw new Error("A spatial coordinate must contain at least x and y components");let r=[...t];if(Xu(this.spatialReference)||this.sourceIsGeocentric||this.outputIsGeocentric){if(r.length<3||!Number.isFinite(r[2]))throw new Error("Three-dimensional CRS conversion requires a finite z coordinate");let n=this.toGeographic(r);if(Xu(this.spatialReference)){let o=this.geoid.getHeight(n[1],n[0]);n[2]=RX(n[2],o,this.spatialReference.heightReference,this.spatialReference.targetHeightReference)}let i=this.fromGeographic(n);return r.splice(0,i.length,...i),r}if(this.horizontalProjection){let n=this.horizontalProjection.projectSync(r.slice(0,3));r.splice(0,n.length,...n)}return r}transformPositions(t){if(t.length%3!==0)throw new Error("Packed spatial positions must contain a multiple of three components");let r=new Float64Array(t.length);if(this.horizontalProjectionBuffer&&(r.set(t),r.every(Number.isFinite)))return this.horizontalProjectionBuffer.projectFlatTo(r,r);for(let n=0;n<t.length;n+=3){let i=this.transformPosition([Number(t[n]),Number(t[n+1]),Number(t[n+2])]);r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2]}return r}transformNormals(t,r){if(t.length!==r.length||t.length%3!==0)throw new Error("Spatial normals and positions must have matching xyz component counts");let n=new Float32Array(t.length),i=1e-5;for(let o=0;o<t.length;o+=3){let s=[Number(r[o]),Number(r[o+1]),Number(r[o+2])],a=[Number(t[o]),Number(t[o+1]),Number(t[o+2])],c=TX(this,s,i),l=AX(c,a),u=Math.hypot(...l);u>0&&Number.isFinite(u)?(n[o]=l[0]/u,n[o+1]=l[1]/u,n[o+2]=l[2]/u):(n[o]=a[0],n[o+1]=a[1],n[o+2]=a[2])}return n}toGeographic(t){return this.sourceIsGeocentric?Array.from(Tt.WGS84.cartesianToCartographic(new J(t))):this.sourceIsGeographic?t.slice(0,3):this.geographicProjection.projectSync(t.slice(0,3))}fromGeographic(t){return this.outputIsGeocentric?Array.from(Tt.WGS84.cartographicToCartesian(new J(t))):this.outputIsGeographic?t.slice(0,3):this.heightOutputProjection.projectSync(t.slice(0,3))}}});function LX(e,t){return e==="relativeToScene"?t.sceneElevationProvider:Yu(e)?t.terrainElevationProvider:void 0}function Yu(e){return e==="onTheGround"||e==="relativeToGround"||e==="relativeToScene"}function T_(e){if(e.length%3!==0)throw new Error("I3S position arrays must contain complete XYZ tuples");let t=[];for(let r=0;r<e.length;r+=3)t.push([e[r],e[r+1],e[r+2]]);return t}function OX(e){let t=Ka(e);return{west:t[0]*180/Math.PI,south:t[1]*180/Math.PI,east:t[2]*180/Math.PI,north:t[3]*180/Math.PI}}function eD(e){if(!e.length)throw new Error("I3S spatial transformation requires at least one bound sample");let t=e.map(o=>Tt.WGS84.cartographicToCartesian(new J(o))),r=new J;for(let o of t)r.add(o);r.scale(1/t.length);let n=0;for(let o of t)n=Math.max(n,new J(o).subtract(r).magnitude());let i=Tt.WGS84.cartesianToCartographic(r);return[i[0],i[1],i[2],n]}function tD(e,t,r,n){let i=e.obb;if(i){let c=Array.from(i.center).slice(0,3);c[2]*=n;let l=Array.from(i.halfSize).slice(0,3),u=new Ef().fromArray(Array.from(i.quaternion)),h=[new J([l[0],0,0]).transformByQuaternion(u),new J([0,l[1],0]).transformByQuaternion(u),new J([0,0,l[2]]).transformByQuaternion(u)];if(t==="geographic"){let d=r.transformPosition(c),m=Tt.WGS84.cartographicToCartesian(new J(d)),g=e.normalReferenceFrame==="vertex-reference-frame"?h.map(y=>iD(y,d)):h;return rD().map(y=>{let b=new J(m);for(let w=0;w<3;w++)b.add(new J(g[w]).scale(y[w]));return Array.from(Tt.WGS84.cartesianToCartographic(b))})}return rD().map(d=>{let m=new J(c);for(let g=0;g<3;g++)m.add(new J(h[g]).scale(d[g]));return Array.from(m)})}let o=e.mbs?Array.from(e.mbs):[];if(o.length<4)return[];let s=o.slice(0,3);s[2]*=n;let a=o[3];if(t==="geographic"){let c=r.transformPosition(s),l=Tt.WGS84.cartographicToCartesian(new J(c));return nD().map(u=>Array.from(Tt.WGS84.cartesianToCartographic(new J(l).add(new J(u).scale(a)))))}return nD().map(c=>Array.from(new J(s).add(new J(c).scale(a))))}function rD(){return[-1,1].flatMap(e=>[-1,1].flatMap(t=>[-1,1].map(r=>[e,t,r])))}function nD(){return[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]}function BX(){return[new J([1,0,0]),new J([0,1,0]),new J([0,0,1])]}function iD(e,t){let r=t[0]*Math.PI/180,n=t[1]*Math.PI/180,i=new J([-Math.sin(r),Math.cos(r),0]),o=new J([-Math.sin(n)*Math.cos(r),-Math.sin(n)*Math.sin(r),Math.cos(n)]),s=new J([Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]);return i.scale(e[0]).add(o.scale(e[1])).add(s.scale(e[2]))}function CX(e,t){let r=t[0]*Math.PI/180,n=t[1]*Math.PI/180,i=new J([-Math.sin(r),Math.cos(r),0]),o=new J([-Math.sin(n)*Math.cos(r),-Math.sin(n)*Math.sin(r),Math.cos(n)]),s=new J([Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]);return new J([i.dot(e),o.dot(e),s.dot(e)])}function hl(e){let t=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(let o of e)for(let s=0;s<3;s++)t[s]=Math.min(t[s],o[s]),r[s]=Math.max(r[s],o[s]);let n=t.map((o,s)=>(o+r[s])/2),i=t.map((o,s)=>(r[s]-o)/2);return[n[0],n[1],n[2],i[0],0,0,0,i[1],0,0,0,i[2]]}function Ka(e){let t=e[0][0],r=1/0,n=-1/0,i=1/0,o=-1/0,s=1/0,a=-1/0;for(let c of e){let l=t+A_(c[0]-t);r=Math.min(r,l),n=Math.max(n,l),i=Math.min(i,c[1]),o=Math.max(o,c[1]),s=Math.min(s,c[2]),a=Math.max(a,c[2])}return[A_(r)*Math.PI/180,i*Math.PI/180,A_(n)*Math.PI/180,o*Math.PI/180,s,a]}function A_(e){return((e+180)%360+360)%360-180}var ed,oD=p(()=>{"use strict";Fn();Nf();E_();PR();LR();ed=class{spatialReference;targetCoordinateFrame;positionTransformer;sourceToGeographicTransformer;geographicToTargetTransformer;sourceCoordinateFrame;sourceVerticalUnitScale;elevationMode;elevationOffset;elevationProvider;providerUnitScale;providerHeightTransformer;constructor(t,r={}){var a;if(t.status!=="transformable"&&t.status!=="transformed")throw new Error("I3SSpatialTransformer requires a requested, transformable spatial output");let n=t.targetCrs||t.sourceCrs;if(!n)throw new Error("I3S spatial transformation requires a target CRS");if(this.positionTransformer=new fl(t,r),this.sourceCoordinateFrame=t.coordinateFrame,this.sourceVerticalUnitScale=t.verticalUnitScale,this.elevationMode=t.elevationMode,this.elevationOffset=(t.elevationOffset||0)*t.elevationUnitScale,this.elevationProvider=LX(this.elevationMode,r),this.elevationProvider&&(typeof this.elevationProvider.sampleElevations!="function"||typeof this.elevationProvider.getElevationRange!="function"))throw new Error("An I3S elevation provider must implement sampleElevations() and getElevationRange()");let i=RR(((a=this.elevationProvider)==null?void 0:a.unit)||"meter");if(this.elevationProvider&&i===void 0)throw new Error(`Unsupported elevation-provider unit ${this.elevationProvider.unit}`);this.providerUnitScale=i||1,this.targetCoordinateFrame=Po(n),this.spatialReference=IR(t);let o=V0({sourceCrs:t.sourceCrs,heightReference:t.heightReference,coordinateFrame:t.coordinateFrame,axisOrder:t.axisOrder,provenance:t.provenance},{targetCrs:"EPSG:4326"});if(this.sourceToGeographicTransformer=new fl(o),Yu(this.elevationMode)){if(!this.elevationProvider){let l=this.elevationMode==="relativeToScene"?"scene":"terrain";throw new Error(`I3S elevation mode ${this.elevationMode} requires a ${l} elevation provider`)}if(t.heightReference==="unknown")throw new Error(`I3S elevation mode ${this.elevationMode} requires a known source height reference`);let c=this.elevationProvider.heightReference||t.heightReference;if(c!==t.heightReference){if(t.heightReference!=="ellipsoidal"&&t.heightReference!=="orthometric")throw new Error("Converting elevation-provider heights requires an ellipsoidal or orthometric source height reference");let l=V0({sourceCrs:"EPSG:4326",heightReference:c,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"caller-override"},{targetCrs:"EPSG:4326",targetHeightReference:t.heightReference,geoidModel:r.geoidModel});this.providerHeightTransformer=new fl(l,r)}}let s=V0({sourceCrs:"EPSG:4326",heightReference:t.heightReference,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"format-default"},{targetCrs:n,targetHeightReference:t.targetHeightReference,geoidModel:r.geoidModel});this.geographicToTargetTransformer=new fl(s,r)}transformPosition(t){let r=this.placeSourcePositionsSync(t),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformPositionAsync(t){let r=await this.placeSourcePositions(t),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPlacedPosition(t){let r=this.positionTransformer.transformPosition([t[0],t[1],t[2]]);return[r[0],r[1],r[2]]}transformSourcePositionToGeographic(t){let r=this.placeSourcePositionsSync(t),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformSourcePositionToGeographicAsync(t){let r=await this.placeSourcePositions(t),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPositions(t,r){let n=this.placeSourcePositionsSync(t),i=this.placeSourcePositionsSync(r);return this.transformPlacedPositions(n,i)}async transformPositionsAsync(t,r){let n=new Float64Array(t.length+3);n.set(Array.from(t),0),n.set(Array.from(r).slice(0,3),t.length);let i=await this.placeSourcePositions(n);return this.transformPlacedPositions(i.subarray(0,t.length),i.subarray(t.length))}async transformGeometryAsync(t,r,n="earth-centered"){if(t.length%3||r&&r.length!==t.length)throw new Error("Conversion positions and normals must contain matching finite xyz triples");for(let o=0;o<t.length;o++)if(!Number.isFinite(t[o])||r&&!Number.isFinite(r[o]))throw new Error("Conversion positions and normals must contain matching finite xyz triples");if(!["earth-centered","vertex-reference-frame"].includes(n))throw new Error("Unsupported I3S normal reference frame");let i=await this.placeSourcePositions(t);return{positions:this.positionTransformer.transformPositions(i),normals:r?this.transformNormals(r,i,n):void 0}}transformPlacedPositions(t,r){let n=this.transformPlacedPosition(r),i=new Float32Array(t.length),o=Float64Array.from(t);for(let c=0;c<t.length;c+=3){let l=this.transformPlacedPosition([t[c],t[c+1],t[c+2]]);i[c]=l[0]-n[0],i[c+1]=l[1]-n[1],i[c+2]=l[2]-n[2]}let s=this.targetCoordinateFrame==="geographic",a=s?new yn:new yn().translate(n);return{positions:i,sourcePositions:o,origin:n,cartographicOrigin:s?n:[0,0,0],coordinateSystem:s?"lnglat-offsets":"cartesian",modelMatrix:a}}transformNormals(t,r,n="earth-centered"){if(t.length!==r.length||t.length%3)throw new Error("I3S normals and positions must have matching xyz component counts");let i=new Float32Array(t.length);if(n==="earth-centered"&&(this.spatialReference.targetCrs||this.spatialReference.sourceCrs)==="EPSG:4978"){for(let o=0;o<t.length;o+=3){let s=Math.hypot(t[o],t[o+1],t[o+2]);for(let a=0;a<3;a++)i[o+a]=s?t[o+a]/s:t[o+a]}return i}for(let o=0;o<t.length;o+=3){let s=this.sourceToGeographicTransformer.transformPosition([r[o],r[o+1],r[o+2]]),a=new J([t[o],t[o+1],t[o+2]]).normalize(),c=n==="earth-centered"?a:iD(a,s),l=this.transformEcefNormal(c,s);i.set(l,o)}return i}transformBoundingVolume(t){let n=this.getGeographicBoundSamples(t).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Ka(n)}:{box:hl(n)}}async transformBoundingVolumeAsync(t){let n=(await this.getGeographicBoundSamplesAsync(t)).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Ka(n)}:{box:hl(n)}}transformBoundingVolumeToGeographic(t){return{region:Ka(this.getGeographicBoundSamples(t))}}async transformBoundingVolumeToGeographicAsync(t){return{region:Ka(await this.getGeographicBoundSamplesAsync(t))}}transformBoundingVolumeToGeocentric(t){let r=this.getGeographicBoundSamples(t).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:hl(r)}}async transformBoundingVolumeToGeocentricAsync(t){let r=(await this.getGeographicBoundSamplesAsync(t)).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:hl(r)}}transformBoundingSphereToGeographic(t){var s,a;let r=(s=t.mbs)!=null&&s.length?Array.from(t.mbs).slice(0,3):t.obb?Array.from(t.obb.center).slice(0,3):null;if(!r)throw new Error("I3S spatial transformation requires an MBS or OBB bound");let n=this.placeSourcePositionsSync(r),i=this.sourceToGeographicTransformer.transformPosition(Array.from(n)),o=(a=t.mbs)!=null&&a.length?t.mbs[3]:Math.hypot(...Array.from(t.obb.halfSize).slice(0,3));return[i[0],i[1],i[2],o]}async transformBoundingSphereToGeographicAsync(t){return eD(await this.getGeographicBoundSamplesAsync(t))}async transformBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(o=>Array.from(Tt.WGS84.cartographicToCartesian(new J(o)))),i=r.map(o=>this.geographicToTargetTransformer.transformPosition(o));return{boundingVolume:{box:hl(n)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Ka(i)}:{box:hl(i)},i3sLodMbs:Yu(this.elevationMode)?eD(r):this.transformBoundingSphereToGeographic(t)}}async transformPointCloudBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(i=>this.geographicToTargetTransformer.transformPosition(i));return{boundingVolume:{region:Ka(r)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Ka(n)}:{box:hl(n)}}}getGeographicBoundSamples(t){let r=tD(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");let n=this.placeSourcePositionsSync(r.flat(),!0),i=T_(n);return this.sourceCoordinateFrame==="geographic"?i:i.map(o=>this.sourceToGeographicTransformer.transformPosition(o))}async getGeographicBoundSamplesAsync(t){let r=tD(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");if(Yu(this.elevationMode)){let i=this.sourceCoordinateFrame==="geographic"?r:r.map(o=>this.sourceToGeographicTransformer.transformPosition(o));return await this.placeGeographicBoundSamples(i)}let n=T_(await this.placeSourcePositions(r.flat(),!0));return this.sourceCoordinateFrame==="geographic"?n:n.map(i=>this.sourceToGeographicTransformer.transformPosition(i))}async placeGeographicBoundSamples(t){let n=await this.elevationProvider.getElevationRange(OX(t)),i=n.minimum*this.providerUnitScale,o=n.maximum*this.providerUnitScale;if(!Number.isFinite(i)||!Number.isFinite(o)||i>o)throw new Error("Elevation provider returned an invalid range; minimum and maximum must be finite and ordered");let s=t.map(u=>u[2]),a=Math.min(...s),c=Math.max(...s),l=[];for(let[u,h]of t){let d=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([u,h,i])[2]:i,m=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([u,h,o])[2]:o,g=Math.min(d,m),y=Math.max(d,m),b=this.elevationMode==="onTheGround"?g:g+a+this.elevationOffset,w=this.elevationMode==="onTheGround"?y:y+c+this.elevationOffset;l.push([u,h,b],[u,h,w])}return l}placeSourcePositionsSync(t,r=!1){if(Yu(this.elevationMode))throw new Error(`I3S elevation mode ${this.elevationMode} requires asynchronous surface placement`);let n=Float64Array.from(t),i=this.elevationMode==="absoluteHeight"?this.elevationOffset:0;for(let o=2;o<n.length;o+=3)n[o]=n[o]*(r?1:this.sourceVerticalUnitScale)+i;return n}async placeSourcePositions(t,r=!1){if(!Yu(this.elevationMode))return this.placeSourcePositionsSync(t,r);let n=Float64Array.from(t),i=T_(n).map(s=>{let a=this.sourceToGeographicTransformer.transformPosition(s);return[a[0],a[1]]}),o=await this.elevationProvider.sampleElevations(i);if(o.length!==i.length)throw new Error(`Elevation provider returned ${o.length} heights for ${i.length} positions`);for(let s=0;s<i.length;s++){let a=o[s]*this.providerUnitScale;if(!Number.isFinite(a))throw new Error(`Elevation provider returned a non-finite height at index ${s}`);let[c,l]=i[s],u=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([c,l,a])[2]:a,h=n[s*3+2]*(r?1:this.sourceVerticalUnitScale);n[s*3+2]=this.elevationMode==="onTheGround"?u:u+h+this.elevationOffset}return n}transformEcefNormal(t,r){if(this.targetCoordinateFrame==="geocentric")return t.normalize();if(this.targetCoordinateFrame==="geographic")return CX(t,r).normalize();let n=Tt.WGS84.cartographicToCartesian(new J(r)),i=[];for(let s of BX()){let a=Tt.WGS84.cartesianToCartographic(new J(n).add(s)),c=Tt.WGS84.cartesianToCartographic(new J(n).subtract(s)),l=this.geographicToTargetTransformer.transformPosition(a),u=this.geographicToTargetTransformer.transformPosition(c);i.push((l[0]-u[0])/2,(l[1]-u[1])/2,(l[2]-u[2])/2)}let o=new sc(i);if(Math.abs(o.determinant())<1e-12)throw new Error("Cannot transform an I3S normal through a singular local projection");return o.invert().transpose(),new J(t).transformByMatrix3(o).normalize()}}});var sD=p(()=>{"use strict";E_();oD()});function aD(e,t=null){return I_(e,t?{token:t}:void 0)}function I_(e,t){if(!t||Object.keys(t).length===0||/^(?:data|blob):/i.test(e))return e;let r=e.indexOf("#"),n=r>=0?e.slice(r):"",i=r>=0?e.slice(0,r):e,o=i.indexOf("?"),s=o>=0?i.slice(0,o):i,a=o>=0?i.slice(o+1):"",c=new URLSearchParams(a),l=new URLSearchParams;for(let[h,d]of Object.entries(t))c.has(h)||l.set(h,String(d));let u=l.toString();return`${s}${o>=0?`?${a}`:""}${u?`${o>=0?"&":"?"}${u}`:""}${n}`}var cD=p(()=>{"use strict"});function P_(e){switch(e){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}function Zu(e){switch(e){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var lD,w1,R_=p(()=>{"use strict";hT();lD={UInt8:Ls.UNSIGNED_BYTE,UInt16:Ls.UNSIGNED_SHORT,Float32:Ls.FLOAT,UInt32:Ls.UNSIGNED_INT,UInt64:Ls.DOUBLE};w1={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"}});function O_(e,t){if(!e)throw new Error(`parseI3STileContent requires LoaderContext to ${t}. Nested I3S parsing must run through parseFromContext().`);return e}function DX(e){switch(e){case"ktx-etc2":case"dds":return Ko;case"ktx2":return ho;default:return $o}}async function mD(e,t,r,n,i){var h,d;let o=((h=n==null?void 0:n.i3s)==null?void 0:h.geometryMode)??"render";if(o!=="render"&&o!=="source")throw new Error("Unsupported I3S geometry mode");let s={geometryMode:o,attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new yn,coordinateSystem:"meter-offsets",byteLength:0,texture:null,topology:t.layerType==="Point"?"point-list":"triangle-list",pointRenderer:t.pointRenderer,pointSymbol:t.pointSymbol},a=i?O_(i,"parse nested resources"):null,c=(d=t.textureUrls)!=null&&d.length?t.textureUrls:t.textureUrl?[{textureSetDefinitionId:eY(t.materialDefinition),textureUrl:t.textureUrl,textureFormat:t.textureFormat||"jpg"}]:[],l={};for(let m of c)try{let g=await FX(m.textureUrl,m.textureFormat,t,n,a||i);g&&(l[m.textureSetDefinitionId]=g)}catch(g){console.warn(g)}let u=Object.values(l)[0]||null;return s.texture=u,Object.keys(l).length>0&&(s.textures=l),s.material=ZX(t.materialDefinition,l,u),s.material&&(s.texture=null),await GX(e,s,t,r,n,i)}async function FX(e,t,r,n,i){var m;let o=n==null?void 0:n.i3s,s=I_(aD(e,o==null?void 0:o.token),n==null?void 0:n.searchParams),a=DX(t),l=await((i==null?void 0:i.fetch)||fetch)(s);if(!l.ok)throw new Error(`Failed to load I3S texture: ${l.status} ${l.statusText}`);let u=await l.arrayBuffer();if(!((m=n==null?void 0:n.i3s)!=null&&m.decodeTextures))return u;let h=O_(i,"decode texture payloads");if(a===$o){let g={...r.textureLoaderOptions};try{let y=await Pl(u,$o,g,h);return km(y)}catch{let b=await Pl(u,a,g,h);return km(b)}}let d=await Pl(u,a,r.textureLoaderOptions,h);return a===ho&&(d=d[0]),{compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}async function GX(e,t,r,n,i,o){var m,g,y,b,w,_;let s=e.byteLength,a,c,l=0,u=0,h;if(r.isDracoGeometry){let S=O_(o,"decode Draco geometry"),v=await Pl(e,Ti,{draco:{shape:"mesh",attributeNameEntry:NX}},S);c=((m=v.header)==null?void 0:m.vertexCount)??0,h=(g=v.indices)==null?void 0:g.value;let{POSITION:T,NORMAL:O,COLOR_0:P,["feature-index"]:M,["uv-region"]:U}=v.attributes;if(a={position:T,normal:O,color:P,uvRegion:U,id:M},UX(a,v.attributes),t.geometryMode==="source")for(let[L,A]of Object.entries(v.attributes))!["POSITION","NORMAL","COLOR_0","feature-index","uv-region"].includes(L)&&!/^TEXCOORD_\d+$/.test(L)&&(a[L]=A);VX(a,v);let C=nY(M);C&&(rY(a,C),t.drawRanges=qX(a.id.value,h,t.topology))}else{let S=n.store.defaultGeometrySchema;if(!S)throw new Error("Uncompressed I3S geometry requires store.defaultGeometrySchema");let{vertexAttributes:v,ordering:T,featureAttributes:O,featureAttributeOrder:P}=S,M=HX(e,S);l=M.byteOffset,c=M.vertexCount,u=M.featureCount;let{attributes:U,byteOffset:C}=fD(e,l,v,c,T),{attributes:L,byteOffset:A}=fD(e,C,O,u,P),W=kX(e,A);W&&(t.meshSegmentation=W),t.drawRanges=zX(L),tY(L),a=WX(U,L)}let d=n.spatialReference;if(t.geometryMode==="source"){if(a.position.size!==3||a.position.transform||a.position.normalized||(a.position.byteStride??0)!==0||(a.position.byteOffset??0)!==0||a.position.value.length!==c*3||r.mbs.length<3||r.mbs.slice(0,3).some(v=>!Number.isFinite(v)))throw new Error("Source I3S geometry requires packed xyz values and a finite source origin");let S=L_(a.position.value,a.position.metadata,r.mbs);if(S.some(v=>!Number.isFinite(v)))throw new Error("Source I3S positions must be finite");a.position={value:S,size:3},t.origin=[0,0,0],t.cartographicOrigin=[0,0,0],t.coordinateSystem=d!=null&&d.sourceCrs&&Po(d.sourceCrs)==="geographic"?"lnglat":"cartesian",t.spatialReference=d?Object.freeze({...d,status:"native",targetCrs:void 0,targetHeightReference:"native",outputCoordinates:"auto"}):void 0,t.normalReferenceFrame=n.store.normalReferenceFrame||"earth-centered",t.sourceAttributes=a}else if((d==null?void 0:d.status)==="transformable"||(d==null?void 0:d.status)==="transformed"){let S=new ed(d,n.spatialOptions||((y=i==null?void 0:i.i3s)==null?void 0:y.spatial)),v=L_(a.position.value,a.position.metadata,r.mbs),T=await S.transformPositionsAsync(v,r.mbs);a.position.value=T.positions,(b=a.normal)!=null&&b.value&&(a.normal.value=S.transformNormals(a.normal.value,T.sourcePositions,n.store.normalReferenceFrame)),t.modelMatrix=T.modelMatrix,t.coordinateSystem=T.coordinateSystem,t.origin=T.origin,t.cartographicOrigin=T.cartographicOrigin,t.spatialReference=S.spatialReference}else if(!((w=i==null?void 0:i.i3s)!=null&&w.coordinateSystem)||i.i3s.coordinateSystem===w1.METER_OFFSETS){let S=KX(a.position,r);t.modelMatrix=S.invert(),t.coordinateSystem="meter-offsets"}else t.modelMatrix=YX(a.position),t.coordinateSystem="lnglat-offsets";t.attributes={positions:a.position,normals:a.normal,colors:uD(a.color,((_=i==null?void 0:i.i3s)==null?void 0:_.colorFormat)||"uint8norm"),uvRegions:uD(a.uvRegion||a.region)},jX(t.attributes,a),t.indices=h||null,a.id&&a.id.value&&(t.featureIds=a.id.value);for(let S in t.attributes)t.attributes[S]||delete t.attributes[S];return t.vertexCount=c,t.byteLength=s,t}function kX(e,t){return t<e.byteLength?e.slice(t):void 0}function UX(e,t){for(let[r,n]of Object.entries(t)){let i=/^TEXCOORD_(\d+)$/.exec(r);i&&(e[`uv${Number(i[1])}`]=n)}}function jX(e,t){for(let[r,n]of Object.entries(t)){let i=/^uv(\d+)$/.exec(r);if(!i||!n)continue;let o=Number(i[1]);e[o===0?"texCoords":`texCoords${o}`]=n}}function zX(e){var o,s;let t=(o=e.id)==null?void 0:o.value,r=(s=e.faceRange)==null?void 0:s.value;if(!t||!r)return;let n=[],i=Math.min(t.length,Math.floor(r.length/2));for(let a=0;a<i;a++){let c=Number(r[a*2]),l=Number(r[a*2+1]);if(l<c)continue;let u=l-c+1;n.push({featureId:Number(t[a]),firstPrimitive:c,primitiveCount:u,firstVertex:c*3,vertexCount:u*3})}return n.length?n:void 0}function qX(e,t,r){let n=r==="point-list"?1:3,i=(t==null?void 0:t.length)||e.length,o=Math.floor(i/n);if(!o)return;let s=[];for(let a=0;a<o;a++){let c=a*n,l=t?Number(t[c]):c,u=Number(e[l]),h=s[s.length-1];(h==null?void 0:h.featureId)===u?(h.primitiveCount++,h.vertexCount+=n):s.push({featureId:u,firstPrimitive:a,primitiveCount:1,firstVertex:c,vertexCount:n})}return s}function VX(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function WX(e,t){return{...e,...t}}function uD(e,t="uint8norm"){return e&&(t==="float16"&&!e.componentType?{...e,value:ex(e.value,255),normalized:!1,componentType:"float16"}:t==="float32"&&!e.componentType?{...e,value:Float32Array.from(e.value,r=>r/255),normalized:!1}:{...e,normalized:!0})}function HX(e,t){let r=0,n=0,i=0;for(let{property:o,type:s}of t.header){let a=P_(s);switch(o){case"vertexCount".toString():n=new a(e,0,4)[0],r+=Zu(s);break;case"featureCount".toString():i=new a(e,4,4)[0],r+=Zu(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function fD(e,t,r,n,i){let o={};for(let s of i)if(r[s]){let{valueType:a,valuesPerElement:c}=r[s];if(t+n*c*Zu(a)<=e.byteLength){let l=e.slice(t),u;if(a==="UInt64")u=$X(l,n*c,Zu(a));else{let h=P_(a);u=new h(l,0,n*c)}o[s]={value:u,type:lD[a],size:c},s==="color"&&(o.color.normalized=!0),t=t+n*c*Zu(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:t}}function $X(e,t,r){let n=[],i=new DataView(e),o=0;for(let s=0;s<t;s++){let a=i.getUint32(o,!0),c=i.getUint32(o+4,!0),l=a+2**32*c;n.push(l),o+=r}return new Float64Array(n)}function KX(e,t){let r=t.mbs,n=e.value,i=e.metadata,o=new yn,s=new J(r[0],r[1],r[2]),a=new J;return Tt.WGS84.cartographicToCartesian(s,a),Ny(Tt.WGS84,a,o),e.value=XX(n,i,s),o}function L_(e,t={},r){var s,a;let n=new Float64Array(e.length),i=((s=t["i3s-scale_x"])==null?void 0:s.double)??1,o=((a=t["i3s-scale_y"])==null?void 0:a.double)??1;for(let c=0;c<n.length;c+=3)n[c]=e[c]*i+r[0],n[c+1]=e[c+1]*o+r[1],n[c+2]=e[c+2]+r[2];return n}function XX(e,t={},r){let n=L_(e,t,r);for(let i=0;i<n.length;i+=3)Tt.WGS84.cartographicToCartesian(n.subarray(i,i+3),x1),n[i]=x1.x,n[i+1]=x1.y,n[i+2]=x1.z;return n}function YX(e){var o,s;let t=e.metadata,r=((o=t==null?void 0:t["i3s-scale_x"])==null?void 0:o.double)||1,n=((s=t==null?void 0:t["i3s-scale_y"])==null?void 0:s.double)||1,i=new yn;return i[0]=r,i[5]=n,i}function ZX(e,t={},r){var o;let n=[e==null?void 0:e.emissiveFactor,(o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.baseColorFactor].some(s=>s==null?void 0:s.some(a=>a>1))?255:1,i;return e?i={...e,normalTexture:e.normalTexture?{...e.normalTexture}:void 0,occlusionTexture:e.occlusionTexture?{...e.occlusionTexture}:void 0,emissiveTexture:e.emissiveTexture?{...e.emissiveTexture}:void 0,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness,baseColorTexture:e.pbrMetallicRoughness.baseColorTexture?{...e.pbrMetallicRoughness.baseColorTexture}:void 0,metallicRoughnessTexture:e.pbrMetallicRoughness.metallicRoughnessTexture?{...e.pbrMetallicRoughness.metallicRoughnessTexture}:void 0}:{baseColorFactor:[n,n,n,n]}}:(i={pbrMetallicRoughness:{}},r?i.pbrMetallicRoughness.baseColorTexture={texCoord:0,textureSetDefinitionId:0}:i.pbrMetallicRoughness.baseColorFactor=[n,n,n,n]),i.alphaCutoff=i.alphaCutoff??.25,i.alphaMode&&(i.alphaMode=i.alphaMode.toUpperCase()),i.emissiveFactor&&(i.emissiveFactor=hD(i.emissiveFactor,n)),i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorFactor&&(i.pbrMetallicRoughness.baseColorFactor=hD(i.pbrMetallicRoughness.baseColorFactor,n)),Object.keys(t).length>0?QX(i,t):r&&JX(i,r),i}function hD(e,t){let r=[...e];for(let n=0;n<e.length;n++){let i=e[n]/t;r[n]=n<3?i<=.04045?i/12.92:((i+.055)/1.055)**2.4:i}return r}function JX(e,t){if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture){let r=e.pbrMetallicRoughness.baseColorTexture;e.pbrMetallicRoughness.baseColorTexture={...r,texture:Ju(t,r)}}else if(e.emissiveTexture){let r=e.emissiveTexture;e.emissiveTexture={...r,texture:Ju(t,r)}}else if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture){let r=e.pbrMetallicRoughness.metallicRoughnessTexture;e.pbrMetallicRoughness.metallicRoughnessTexture={...r,texture:Ju(t,r)}}else if(e.normalTexture){let r=e.normalTexture;e.normalTexture={...r,texture:Ju(t,r)}}else if(e.occlusionTexture){let r=e.occlusionTexture;e.occlusionTexture={...r,texture:Ju(t,r)}}}function QX(e,t){var n,i;let r=[(n=e.pbrMetallicRoughness)==null?void 0:n.baseColorTexture,(i=e.pbrMetallicRoughness)==null?void 0:i.metallicRoughnessTexture,e.normalTexture,e.occlusionTexture,e.emissiveTexture];for(let o of r){if(!o)continue;let s=t[o.textureSetDefinitionId];s&&(o.texture=Ju(s,o))}}function Ju(e,t){let r=dD(t.wrapS),n=dD(t.wrapT),i=r||n?{wrapS:r||10497,wrapT:n||10497}:void 0;return i?{source:{image:e},sampler:i}:{source:{image:e}}}function dD(e){switch(e){case"none":return 33071;case"mirror":return 33648;case"repeat":return 10497;default:return}}function eY(e){var t,r,n,i,o,s,a;return((r=(t=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:t.baseColorTexture)==null?void 0:r.textureSetDefinitionId)??((i=(n=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:n.metallicRoughnessTexture)==null?void 0:i.textureSetDefinitionId)??((o=e==null?void 0:e.normalTexture)==null?void 0:o.textureSetDefinitionId)??((s=e==null?void 0:e.occlusionTexture)==null?void 0:s.textureSetDefinitionId)??((a=e==null?void 0:e.emissiveTexture)==null?void 0:a.textureSetDefinitionId)??0}function tY(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,o=i[i.length-1]+1,s=new Float64Array(o*3),a=0,c=0;for(let l=1;l<i.length;l+=2){let u=Number(n[a]),h=i[l],d=i[l-1],m=h-d+1,g=c+m*3;s.fill(u,c,g),a++,c=g}e.id.value=s}function rY(e,t){let r=e.id.value,n=new Float64Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function nY(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var x1,NX,pD=p(()=>{"use strict";Ch();Fn();Nf();Nf();Vs();zf();sx();zf();sD();cD();R_();x1=new J([0,0,0]);NX="i3s-attribute-type"});var _1,B_,IEe,gD,PEe,REe,LEe,OEe,BEe,yD=p(()=>{"use strict";_1=(e,t,r,n)=>({name:e,id:t,module:"tiles-3d",encoding:"binary",format:r,extensions:n,mimeTypes:["application/octet-stream"],binary:!0}),B_=(e,t,r)=>({name:e,id:t,module:"tiles-3d",encoding:"json",format:r,extensions:["json"],mimeTypes:["application/json"],text:!0}),IEe=_1("I3S","i3s","i3s",["bin"]),gD=_1("I3S Content","i3s-content","i3s-content",["bin"]),PEe=_1("I3S Attribute","i3s-attribute","i3s-attribute",["bin"]),REe=_1("I3S LEPCC","i3s-lepcc","i3s-lepcc",["bin"]),LEe=B_("I3S Node Page","i3s-node-page","i3s-node-page"),OEe=B_("ArcGIS Web Scene","arcgis-web-scene","arcgis-web-scene"),BEe=B_("I3S Building Scene Layer","i3s-building-scene-layer","i3s-building-scene-layer")});var bD,wD=p(()=>{"use strict";R_();bD={token:void 0,isTileset:"auto",isTileHeader:"auto",tile:void 0,tileset:void 0,_tileOptions:void 0,_tilesetOptions:void 0,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,attributeValues:"legacy",colorFormat:"uint8norm",geometryMode:"render",coordinateSystem:w1.METER_OFFSETS}});var iY,xD,_D=p(()=>{"use strict";yD();wD();iY="5.0.0-beta.4",xD={...gD,dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"tiles-3d",worker:!0,workerSourceNode:"i3s/workers/i3s-content-worker-node.ts",version:iY,mimeTypes:["application/octet-stream"],preload:async()=>(await Promise.resolve().then(()=>(C_(),SD))).I3SContentLoaderWithParser,extensions:["bin"],options:{i3s:bD,"i3s-content":{}}}});var SD={};Jt(SD,{I3SContentLoaderWithParser:()=>D_});async function sY(e,t,r){let{tile:n,_tileOptions:i,tileset:o,_tilesetOptions:s}=(t==null?void 0:t.i3s)||{},a=i||n,c=s||o;return!a||!c?null:await mD(e,a,c,t,r)}var WEe,oY,D_,C_=p(()=>{"use strict";zf();sx();zf();pD();_D();({preload:WEe,...oY}=xD),D_={...oY,subloaders:{ImageLoader:$o,DracoLoader:Ti,BasisLoader:ho,CompressedTextureLoader:Ko},parse:sY}});var U_=typeof process!="object"||String(process)!=="[object process]"||process.browser;var j_={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]};globalThis["encoding-indexes"]=j_||{};function Te(e,t,r){return t<=e&&e<=r}function PD(e,t){return e.indexOf(t)!==-1}var Oo=Math.floor;function fd(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function RD(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var o=t.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=o&1023,c=s&1023;i.push(65536+(a<<10)+c),n+=1}else i.push(65533)}n+=1}return i}function LD(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function ui(e){return 0<=e&&e<=127}var li=ui,Ye=-1;function G1(e){this.tokens=[].slice.call(e),this.tokens.reverse()}G1.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Ye},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var gt=-1;function Xe(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ii(e){throw TypeError("The code point "+e+" could not be encoded.")}function OD(){}OD.prototype={handler:function(e,t){}};function BD(){}BD.prototype={handler:function(e,t){}};function N1(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(F1,e)?F1[e]:null}var z_=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],F1={};z_.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){F1[r]=t})})});var mn={},pn={};function pl(e,t){return t&&t[e]||null}function gl(e,t){var r=t.indexOf(e);return r===-1?null:r}function Zr(e){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][e]}function CD(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Zr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[0]<=e)t=o[0],r=o[1];else break}return r+e-t}function DD(e){if(e===59335)return 7457;var t=0,r=0,n=Zr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[1]<=e)t=o[1],r=o[0];else break}return r+e-t}function ND(e){C1=C1||Zr("jis0208").map(function(r,n){return Te(n,8272,8835)?null:r});var t=C1;return t.indexOf(e)}var C1;function FD(e){D1=D1||Zr("big5").map(function(r,n){return n<5024?null:r});var t=D1;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):gl(e,t)}var D1,q_="utf-8";function Ya(e,t){if(!(this instanceof Ya))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):q_,t=fd(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=N1(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!pn[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,t.fatal&&(n._error_mode="fatal"),t.ignoreBOM&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(Ya.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Ya.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Ya.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Ya.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=fd(r),this._do_not_flush||(this._decoder=pn[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!r.stream;for(var i=new G1(n),o=[],s;;){var a=i.read();if(a===Ye||(s=this._decoder.handler(i,a),s===gt))break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}if(!this._do_not_flush){do{if(s=this._decoder.handler(i,i.read()),s===gt)break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}while(!i.endOfStream());this._decoder=null}function c(l){return PD(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),LD(l)}return c.call(this,o)};function cf(e,t){if(!(this instanceof cf))throw TypeError("Called as a function. Did you forget 'new'?");t=fd(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=t.fatal?"fatal":"replacement";var r=this;if(t.NONSTANDARD_allowLegacyEncoding){e=e!==void 0?String(e):q_;var n=N1(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!mn[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=N1("utf-8"),e!==void 0&&"console"in globalThis;return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(cf.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});cf.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=fd(r),this._do_not_flush||(this._encoder=mn[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=!!r.stream;for(var n=new G1(RD(t)),i=[],o;;){var s=n.read();if(s===Ye||(o=this._encoder.handler(n,s),o===gt))break;Array.isArray(o)?i.push.apply(i,o):i.push(o)}if(!this._do_not_flush){for(;o=this._encoder.handler(n,n.read()),o!==gt;)Array.isArray(o)?i.push.apply(i,o):i.push(o);this._encoder=null}return new Uint8Array(i)};function GD(e){var t=e.fatal,r=0,n=0,i=0,o=128,s=191;this.handler=function(a,c){if(c===Ye&&i!==0)return i=0,Xe(t);if(c===Ye)return gt;if(i===0){if(Te(c,0,127))return c;if(Te(c,194,223))i=1,r=c&31;else if(Te(c,224,239))c===224&&(o=160),c===237&&(s=159),i=2,r=c&15;else if(Te(c,240,244))c===240&&(o=144),c===244&&(s=143),i=3,r=c&7;else return Xe(t);return null}if(!Te(c,o,s))return r=i=n=0,o=128,s=191,a.prepend(c),Xe(t);if(o=128,s=191,r=r<<6|c&63,n+=1,n!==i)return null;var l=r;return r=i=n=0,l}}function kD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i,o;Te(n,128,2047)?(i=1,o=192):Te(n,2048,65535)?(i=2,o=224):Te(n,65536,1114111)&&(i=3,o=240);for(var s=[(n>>6*i)+o];i>0;){var a=n>>6*(i-1);s.push(128|a&63),i-=1}return s}}mn["UTF-8"]=function(e){return new kD(e)};pn["UTF-8"]=function(e){return new GD(e)};function UD(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(ui(i))return i;var o=e[i-128];return o===null?Xe(r):o}}function jD(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(li(i))return i;var o=gl(i,e);return o===null&&Ii(i),o+128}}(function(){"encoding-indexes"in globalThis&&z_.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Zr(r.toLowerCase());pn[r]=function(i){return new UD(n,i)},mn[r]=function(i){return new jD(n,i)}})})})();pn.GBK=function(e){return new V_(e)};mn.GBK=function(e){return new W_(e,!0)};function V_(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(o,s){if(s===Ye&&r===0&&n===0&&i===0)return gt;s===Ye&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Xe(t));var a;if(i!==0){a=null,Te(s,48,57)&&(a=CD((((r-129)*10+n-48)*126+i-129)*10+s-48));var c=[n,i,s];return r=0,n=0,i=0,a===null?(o.prepend(c),Xe(t)):a}if(n!==0)return Te(s,129,254)?(i=s,null):(o.prepend([n,s]),r=0,n=0,Xe(t));if(r!==0){if(Te(s,48,57))return n=s,null;var l=r,u=null;r=0;var h=s<127?64:65;return(Te(s,64,126)||Te(s,128,254))&&(u=(l-129)*190+(s-h)),a=u===null?null:pl(u,Zr("gb18030")),a===null&&ui(s)&&o.prepend(s),a===null?Xe(t):a}return ui(s)?s:s===128?8364:Te(s,129,254)?(r=s,null):Xe(t)}}function W_(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(li(i))return i;if(i===58853)return Ii(i);if(t&&i===8364)return 128;var o=gl(i,Zr("gb18030"));if(o!==null){var s=Oo(o/190)+129,a=o%190,c=a<63?64:65;return[s,a+c]}if(t)return Ii(i);o=DD(i);var l=Oo(o/10/126/10);o=o-l*10*126*10;var u=Oo(o/10/126);o=o-u*10*126;var h=Oo(o/10),d=o-h*10;return[l+129,u+48,h+129,d+48]}}mn.gb18030=function(e){return new W_(e)};pn.gb18030=function(e){return new V_(e)};function zD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:98;switch((Te(i,64,126)||Te(i,161,254))&&(s=(o-129)*157+(i-a)),s){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=s===null?null:pl(s,Zr("big5"));return c===null&&ui(i)&&n.prepend(i),c===null?Xe(t):c}return ui(i)?i:Te(i,129,254)?(r=i,null):Xe(t)}}function qD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i=FD(n);if(i===null)return Ii(n);var o=Oo(i/157)+129;if(o<161)return Ii(n);var s=i%157,a=s<63?64:98;return[o,s+a]}}mn.Big5=function(e){return new qD(e)};pn.Big5=function(e){return new zD(e)};function VD(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,o){if(o===Ye&&n!==0)return n=0,Xe(t);if(o===Ye&&n===0)return gt;if(n===142&&Te(o,161,223))return n=0,65216+o;if(n===143&&Te(o,161,254))return r=!0,n=o,null;if(n!==0){var s=n;n=0;var a=null;return Te(s,161,254)&&Te(o,161,254)&&(a=pl((s-161)*94+(o-161),Zr(r?"jis0212":"jis0208"))),r=!1,Te(o,161,254)||i.prepend(o),a===null?Xe(t):a}return ui(o)?o:o===142||o===143||Te(o,161,254)?(n=o,null):Xe(t)}}function WD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;if(n===165)return 92;if(n===8254)return 126;if(Te(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=gl(n,Zr("jis0208"));if(i===null)return Ii(n);var o=Oo(i/94)+161,s=i%94+161;return[o,s]}}mn["EUC-JP"]=function(e){return new WD(e)};pn["EUC-JP"]=function(e){return new VD(e)};function HD(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,o=0,s=!1;this.handler=function(a,c){switch(n){default:case r.ASCII:return c===27?(n=r.EscapeStart,null):Te(c,0,127)&&c!==14&&c!==15&&c!==27?(s=!1,c):c===Ye?gt:(s=!1,Xe(t));case r.Roman:return c===27?(n=r.EscapeStart,null):c===92?(s=!1,165):c===126?(s=!1,8254):Te(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(s=!1,c):c===Ye?gt:(s=!1,Xe(t));case r.Katakana:return c===27?(n=r.EscapeStart,null):Te(c,33,95)?(s=!1,65344+c):c===Ye?gt:(s=!1,Xe(t));case r.LeadByte:return c===27?(n=r.EscapeStart,null):Te(c,33,126)?(s=!1,o=c,n=r.TrailByte,null):c===Ye?gt:(s=!1,Xe(t));case r.TrailByte:if(c===27)return n=r.EscapeStart,Xe(t);if(Te(c,33,126)){n=r.LeadByte;var l=(o-33)*94+c-33,u=pl(l,Zr("jis0208"));return u===null?Xe(t):u}return c===Ye?(n=r.LeadByte,a.prepend(c),Xe(t)):(n=r.LeadByte,Xe(t));case r.EscapeStart:return c===36||c===40?(o=c,n=r.Escape,null):(a.prepend(c),s=!1,n=i,Xe(t));case r.Escape:var h=o;o=0;var d=null;if(h===40&&c===66&&(d=r.ASCII),h===40&&c===74&&(d=r.Roman),h===40&&c===73&&(d=r.Katakana),h===36&&(c===64||c===66)&&(d=r.LeadByte),d!==null){n=n=d;var m=s;return s=!0,m?Xe(t):null}return a.prepend([h,c]),s=!1,n=i,Xe(t)}}}function $D(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,o){if(o===Ye&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if(o===Ye&&n===r.ASCII)return gt;if((n===r.ASCII||n===r.Roman)&&(o===14||o===15||o===27))return Ii(65533);if(n===r.ASCII&&li(o))return o;if(n===r.Roman&&(li(o)&&o!==92&&o!==126||o===165||o===8254)){if(li(o))return o;if(o===165)return 92;if(o===8254)return 126}if(li(o)&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if((o===165||o===8254)&&n!==r.Roman)return i.prepend(o),n=r.Roman,[27,40,74];o===8722&&(o=65293);var s=gl(o,Zr("jis0208"));if(s===null)return Ii(o);if(n!==r.jis0208)return i.prepend(o),n=r.jis0208,[27,36,66];var a=Oo(s/94)+33,c=s%94+33;return[a,c]}}mn["ISO-2022-JP"]=function(e){return new $D(e)};pn["ISO-2022-JP"]=function(e){return new HD(e)};function KD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:65,c=o<160?129:193;if((Te(i,64,126)||Te(i,128,252))&&(s=(o-c)*188+i-a),Te(s,8836,10715))return 48508+s;var l=s===null?null:pl(s,Zr("jis0208"));return l===null&&ui(i)&&n.prepend(i),l===null?Xe(t):l}return ui(i)||i===128?i:Te(i,161,223)?65216+i:Te(i,129,159)||Te(i,224,252)?(r=i,null):Xe(t)}}function XD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(Te(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=ND(n);if(i===null)return Ii(n);var o=Oo(i/188),s=o<31?129:193,a=i%188,c=a<63?64:65;return[o+s,a+c]}}mn.Shift_JIS=function(e){return new XD(e)};pn.Shift_JIS=function(e){return new KD(e)};function YD(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0,Te(i,65,254)&&(s=(o-129)*190+(i-65));var a=s===null?null:pl(s,Zr("euc-kr"));return s===null&&ui(i)&&n.prepend(i),a===null?Xe(t):a}return ui(i)?i:Te(i,129,254)?(r=i,null):Xe(t)}}function ZD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i=gl(n,Zr("euc-kr"));if(i===null)return Ii(n);var o=Oo(i/190)+129,s=i%190+65;return[o,s]}}mn["EUC-KR"]=function(e){return new ZD(e)};pn["EUC-KR"]=function(e){return new YD(e)};function ud(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function H_(e,t){var r=t.fatal,n=null,i=null;this.handler=function(o,s){if(s===Ye&&(n!==null||i!==null))return Xe(r);if(s===Ye&&n===null&&i===null)return gt;if(n===null)return n=s,null;var a;if(e?a=(n<<8)+s:a=(s<<8)+n,n=null,i!==null){var c=i;return i=null,Te(a,56320,57343)?65536+(c-55296)*1024+(a-56320):(o.prepend(ud(a,e)),Xe(r))}return Te(a,55296,56319)?(i=a,null):Te(a,56320,57343)?Xe(r):a}}function $_(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(Te(i,0,65535))return ud(i,e);var o=ud((i-65536>>10)+55296,e),s=ud((i-65536&1023)+56320,e);return o.concat(s)}}mn["UTF-16BE"]=function(e){return new $_(!0,e)};pn["UTF-16BE"]=function(e){return new H_(!0,e)};mn["UTF-16LE"]=function(e){return new $_(!1,e)};pn["UTF-16LE"]=function(e){return new H_(!1,e)};function JD(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?gt:ui(n)?n:63360+n-128}}function QD(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?gt:li(n)?n:Te(n,63360,63487)?n-63360+128:Ii(n)}}mn["x-user-defined"]=function(e){return new QD(e)};pn["x-user-defined"]=function(e){return new JD(e)};function lf(e){return Buffer.from(e).toString("base64")}function k1(e){return Buffer.from(e,"base64").toString("ascii")}async function Dd(){try{return(await Promise.resolve().then(()=>(fv(),uv))).default}catch(e){throw new Error("Node image decoding and encoding require the optional 'sharp' package. Install it with 'npm install sharp'.",{cause:e})}}var Nd=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg+xml"];async function Fd(e,t){let r=await Dd(),{data:n,info:i}=await r(Buffer.from(e),{animated:!0}).toColourspace("srgb").ensureAlpha().raw().toBuffer({resolveWithObject:!0}),o=i.width,s=i.pageHeight||i.height,a=i.pages||1;return{shape:a>1?[a,o,s,4]:[o,s,4],data:new Uint8Array(n),width:o,height:s,components:4,layers:[a]}}function dv(e){return e instanceof ArrayBuffer?e:(ArrayBuffer.isView(e),Gd(e))}function Gd(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:r,byteLength:n}=e;return t instanceof ArrayBuffer&&r===0&&n===t.byteLength?t:hv(t,r,n)}return hv(e)}function hv(e,t=0,r=e.byteLength-t){let n=new Uint8Array(r);return n.set(new Uint8Array(e,t,r)),n.buffer}async function Mg(e,t={}){let r=await Dd(),n=(t.type||"jpeg").toLowerCase().replace(/^image\//,""),i=n==="jpg"?"jpeg":n,o=await r(Buffer.from(e.data),{raw:{width:e.width,height:e.height,channels:4}}).toFormat(i).toBuffer();return dv(o)}var Il=class{width;height;data;constructor(t){if(!t||!t.data||!t.width||!t.height)throw new Error("NodeImageBitmap requires decoded image data");this.width=t.width,this.height=t.height,this.data=t.data}close(){this.width=0,this.height=0,this.data=null}_getImageData(){if(!this.data)throw new Error("ImageBitmap is closed");return{data:this.data,width:this.width,height:this.height}}};function vg(e){return e instanceof Il}function mv(e){return new Il(e)}function Eg(e){if(!vg(e))throw new Error("getImageBitmapData");return e._getImageData()}var dU="",mU=new Map;function kd(e){for(let[t,r]of mU)e.startsWith(t)&&(e=e.replace(t,r));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${dU}${e}`),e}var Fo=me(require("fs"),1),ec=class{handle;size;bigsize;url;constructor(t,r,n){t=kd(t),this.handle=Fo.default.openSync(t,r,n);let i=Fo.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{Fo.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{Fo.default.ftruncate(this.handle,t,i=>{i?n(i):(this.bigsize=BigInt(t),this.size=Number(this.bigsize),r())})})}async append(t){return new Promise((r,n)=>{Fo.default.appendFile(this.handle,t,i=>{i?n(i):(this.bigsize=this.bigsize+BigInt(t.length),this.size=Number(this.bigsize),r())})})}async stat(){return await new Promise((t,r)=>Fo.default.fstat(this.handle,{bigint:!0},(n,i)=>{let o={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(o)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),o=0,s=new Uint8Array(n),a;for(;r>0;){let c=await pU(this.handle,s,0,r,i);if(c===0)break;o+=c,i+=BigInt(c),r-=c,a!==void 0&&(a+=c)}return o<r?n.slice(0,o):n}async write(t,r=0,n=t.byteLength){return new Promise((i,o)=>{let s=Number(r),a=new Uint8Array(t,Number(r),n);Fo.default.write(this.handle,a,0,n,s,(c,l)=>c?o(c):i(l))})}};async function pU(e,t,r,n,i){return await new Promise((o,s)=>Fo.default.read(e,t,r,n,i,(a,c)=>a?s(a):o(c)))}var zd=me(require("fs/promises"),1);var Ag=me(require("fs"),1),Tg=require("stream");var Ud=me(require("zlib"),1);function pv(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(Ud.default.createBrotliDecompress());case"gzip":return e.pipe(Ud.default.createGunzip());case"deflate":return e.pipe(Ud.default.createDeflate());default:return e}}var gU=e=>typeof e=="boolean",gv=e=>typeof e=="function",yU=e=>e!==null&&typeof e=="object",bU=e=>yU(e)&&gv(e.read)&&gv(e.pipe)&&gU(e.readable);async function jd(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=kd(n);let i=new Headers;e.endsWith(".gz")&&i.set("content-encoding","gzip"),e.endsWith(".br")&&i.set("content-encoding","br");try{let o=await new Promise((h,d)=>{let m=Ag.default.createReadStream(n,{encoding:null});m.once("readable",()=>h(m)),m.on("error",g=>d(g))}),s=o;bU(o)?s=pv(o,i):typeof o=="string"?s=Tg.Readable.from([new TextEncoder().encode(o)]):s=Tg.Readable.from([o||new ArrayBuffer(0)]);let a=200,c="OK",l=wU(n),u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:e}),u}catch(o){let s=o.message,a=400,c=s,l={},u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:e}),u}}function wU(e){let t={};if(!t["content-length"]){let r=Ag.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var qd=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await zd.default.readdir(t,r)}async stat(t){let r=await zd.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await zd.default.unlink(t)}async fetch(t,r){return await jd(t,r)}async openReadableFile(t,r="r"){return new ec(t,r)}async openWritableFile(t,r="w",n){return new ec(t,r,n)}};var bf=me(require("crypto"),1),Vd=class{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(this.options=t,this.hashBatches=this.hashBatches.bind(this),!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async preload(){}async hash(t,r){var i,o,s,a;let n=(s=(o=(i=this.options)==null?void 0:i.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase();try{if(!bf.createHash)throw new Error("crypto.createHash not available");let c=(a=bf.createHash)==null?void 0:a(n),l=new Uint8Array(t);return c.update(l).digest("base64")}catch(c){throw Error(`${n} hash not available. ${c}`)}}async*hashBatches(t,r="base64"){var o,s,a,c,l,u,h;if(!bf.createHash)throw new Error("crypto.createHash not available");let n=(c=bf.createHash)==null?void 0:c((a=(s=(o=this.options)==null?void 0:o.crypto)==null?void 0:s.algorithm)==null?void 0:a.toLowerCase());for await(let d of t){let m=new Uint8Array(d);n.update(m),yield d}let i=n.digest(r);(h=(u=(l=this.options)==null?void 0:l.crypto)==null?void 0:u.onEnd)==null||h.call(u,{hash:i})}};var Sv=require("node:process"),Mv=require("node:stream/web");var Wd=require("node:stream");function yv(e,t){let r=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator](),n=!1,i={async next(){var c;try{let l=await r.next();return l.done?(await((c=r.return)==null?void 0:c.call(r)),{done:!0,value:void 0}):{done:!1,value:new Uint8Array(l.value)}}catch(l){throw n=!0,l}},async return(c){var l;return await((l=r.return)==null?void 0:l.call(r,c)),{done:!0,value:void 0}},async throw(c){return r.throw&&await r.throw(c),{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}},o=(t==null?void 0:t.objectMode)??!1,s=Wd.Readable.from(i,{highWaterMark:(0,Wd.getDefaultHighWaterMark)(o),...t,objectMode:o}),a=s._destroy;return s._destroy=function(c,l){a.call(this,c,u=>{l(!n&&u===c?null:u)})},s}var Hd=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${lf(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};function bv(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Hd),global}var Ig=me(require("module"),1),Pg=me(require("path"),1),Kd=me(require("fs"),1),Rg=require("node:url");async function wv(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Gd(Kd.default.readFileSync(Lg(e)))}async function xv(e){return e.startsWith("http")?await(await fetch(e)).text():Kd.default.readFileSync(Lg(e),"utf8")}async function _v(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return $d(i)}let t=Lg(e),r=Kd.default.readFileSync(t,"utf8");return $d(r,t)}function $d(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t.startsWith("file:")&&(t=(0,Rg.fileURLToPath)(t)),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=Ig.default._nodeModulePaths(Pg.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),o=new Ig.default(t,i);return o.filename=t,o.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),o._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(o),1),o.exports}function Lg(e){return e.startsWith("file:")?(0,Rg.fileURLToPath)(e):Pg.default.resolve(e)}var NJ=parseInt(Sv.versions.node.split(".")[0]),kJ=globalThis.Blob,UJ=globalThis.File;bv();U_&&console.error("loaders.gl: The @loaders.gl/core/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=yv;globalThis.loaders.NodeFile=ec;globalThis.loaders.NodeFileSystem=qd;globalThis.loaders.fetchNode=jd;globalThis.loaders.NodeHash=Vd;globalThis.TextEncoder||(globalThis.TextEncoder=cf);globalThis.TextDecoder||(globalThis.TextDecoder=Ya);globalThis.ReadableStream||(globalThis.ReadableStream=Mv.ReadableStream);!("atob"in globalThis)&&lf&&(globalThis.atob=lf);!("btoa"in globalThis)&&k1&&(globalThis.btoa=k1);globalThis.loaders.encodeImageNode=Mg;globalThis.loaders.parseImageNode=Fd;globalThis.loaders.imageFormatsNode=Nd;globalThis.loaders.createImageBitmapNode=mv;globalThis.loaders.getImageBitmapDataNode=Eg;globalThis.loaders.isImageBitmapNode=vg;globalThis.ImageBitmap||(globalThis.ImageBitmap=Il);"getImageBitmapData"in globalThis||(globalThis.getImageBitmapData=Eg);globalThis._parseImageNode=Fd;globalThis._imageFormatsNode=Nd;globalThis.loaders.readFileAsArrayBuffer=wv;globalThis.loaders.readFileAsText=xv;globalThis.loaders.requireFromFile=_v;globalThis.loaders.requireFromString=$d;Vs();C_();Jg(D_);
23
+ }`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function hP(e,t){if(Mn(e))return new zw(e[Symbol.asyncIterator](),t);if(Wn(e))return new jw(e[Symbol.iterator](),t);throw new Error("toNodeStream() must be called with an Iterable or AsyncIterable")}var qw,jw,zw,dP=p(()=>{Ar();qw=require("node:stream");Xo();jw=class extends qw.Readable{constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(t){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&(this._pulling=this._pull(t,r))}_destroy(t,r){let n=this._iterator,i;n&&(i=t!=null&&n.throw||n.return),i==null||i.call(n,t),r&&r(null)}_pull(t,r){let n=this._bytesMode,i=null;for(;this.readable&&!(i=r.next(n?t:null)).done&&(t!=null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable}},zw=class extends qw.Readable{constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}_read(t){let r=this._iterator;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){return this._pulling=yield this._pull(t,r)})}_destroy(t,r){let n=this._iterator,i;n&&(i=t!=null&&n.throw||n.return),i!=null&&i.call(n,t).then(()=>r&&r(null))||r&&r(null)}_pull(t,r){return H(this,void 0,void 0,function*(){let n=this._bytesMode,i=null;for(;this.readable&&!(i=yield r.next(n?t:null)).done&&(t!=null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(i.value)||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&r.return&&r.return(),!this.readable})}}});function pP(e){return new Vw(oi(e),e)}var mP,Vw,v$,E$,gP=p(()=>{mP=require("node:stream");Iu();Vw=class extends mP.Duplex{constructor(t,r){let{queueingStrategy:n="count",autoDestroy:i=!0}=r,{highWaterMark:o=n!=="bytes"?1e3:Math.pow(2,14)}=r;super({autoDestroy:i,highWaterMark:1,allowHalfOpen:!0,writableObjectMode:!0,readableObjectMode:!0}),this._numChunks=0,this._finished=!1,this._builder=t,this._desiredSize=o,this._getSize=n!=="bytes"?v$:E$}_read(t){this._maybeFlush(this._builder,this._desiredSize=t)}_final(t){this._maybeFlush(this._builder.finish(),this._desiredSize),t&&t()}_write(t,r,n){let i=this._maybeFlush(this._builder.append(t),this._desiredSize);return n&&n(),i}_destroy(t,r){this._builder.clear(),r&&r(t)}_maybeFlush(t,r){return this._getSize(t)>=r&&++this._numChunks&&this.push(t.toVector()),t.finished?((t.length>0||this._numChunks===0)&&++this._numChunks&&this.push(t.toVector()),!this._finished&&(this._finished=!0)&&this.push(null),!1):this._getSize(t)<this.writableHighWaterMark}},v$=e=>e.length,E$=e=>e.byteLength});function bP(e){return new Ww(e)}var yP,Ww,wP=p(()=>{Ar();yP=require("node:stream");vo();rl();Ww=class extends yP.Duplex{constructor(t){super(Object.assign(Object.assign({allowHalfOpen:!1},t),{readableObjectMode:!0,writableObjectMode:!1})),this._pulling=!1,this._autoDestroy=!0,this._reader=null,this._pulling=!1,this._asyncQueue=new Ln,this._autoDestroy=t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:!0}_final(t){let r=this._asyncQueue;r==null||r.close(),t&&t()}_write(t,r,n){let i=this._asyncQueue;return i==null||i.write(t),n&&n(),!0}_read(t){let r=this._asyncQueue;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){this._reader||(this._reader=yield this._open(r)),this._pulling=yield this._pull(t,this._reader)})}_destroy(t,r){let n=this._asyncQueue;n&&(t?n.abort(t):n.close()),r(this._asyncQueue=this._reader=null)}_open(t){return H(this,void 0,void 0,function*(){return yield(yield pr.from(t)).open({autoDestroy:this._autoDestroy})})}_pull(t,r){return H(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next()).done&&!(!this.push(n.value)||t!=null&&--t<=0););return(!this.readable||n!=null&&n.done&&(r.autoDestroy||(yield r.reset().open()).closed))&&(this.push(null),yield r.cancel()),!this.readable})}}});function _P(e){return new Hw(new this(e))}var xP,Hw,SP=p(()=>{Ar();xP=require("node:stream");vo();Hw=class extends xP.Duplex{constructor(t,r){super(Object.assign(Object.assign({allowHalfOpen:!1},r),{writableObjectMode:!0,readableObjectMode:!1})),this._pulling=!1,this._writer=t,this._reader=new $r(t)}_final(t){let r=this._writer;r==null||r.close(),t&&t()}_write(t,r,n){let i=this._writer;return i==null||i.write(t),n&&n(),!0}_read(t){let r=this._reader;r&&!this._pulling&&(this._pulling=!0)&&H(this,void 0,void 0,function*(){return this._pulling=yield this._pull(t,r)})}_destroy(t,r){let n=this._writer;n&&(t?n.abort(t):n.close()),r(this._reader=this._writer=null)}_pull(t,r){return H(this,void 0,void 0,function*(){let n=null;for(;this.readable&&!(n=yield r.next(t||null)).done&&(t!=null&&n.value&&(t-=n.value.byteLength),!(!this.push(n.value)||t<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null),yield r.cancel()),!this.readable})}}});function MP(e,t){if(Mn(e))return A$(e,t);if(Wn(e))return T$(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function T$(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){o(s,r||(r=e[Symbol.iterator]()))},pull(s){r?o(s,r):s.close()},cancel(){r!=null&&r.return&&r.return(),r=null}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){let c,l=null,u=s.desiredSize||null;for(;!(l=a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=se(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()}}function A$(e,t){let r=null,n=(t==null?void 0:t.type)==="bytes"||!1,i=(t==null?void 0:t.highWaterMark)||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(s){return H(this,void 0,void 0,function*(){yield o(s,r||(r=e[Symbol.asyncIterator]()))})},pull(s){return H(this,void 0,void 0,function*(){r?yield o(s,r):s.close()})},cancel(){return H(this,void 0,void 0,function*(){r!=null&&r.return&&(yield r.return()),r=null})}}),Object.assign({highWaterMark:n?i:void 0},t));function o(s,a){return H(this,void 0,void 0,function*(){let c,l=null,u=s.desiredSize||null;for(;!(l=yield a.next(n?u:null)).done;)if(ArrayBuffer.isView(l.value)&&(c=se(l.value))&&(u!=null&&n&&(u=u-c.byteLength+1),l.value=c),s.enqueue(l.value),u!=null&&--u<=0)return;s.close()})}}var vP=p(()=>{Ar();dr();Xo()});function AP(e){return new $w(e)}var $w,EP,TP,IP=p(()=>{Ar();Iu();$w=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,o=VA(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=oi(o),this._getSize=i!=="bytes"?EP:TP;let{["highWaterMark"]:s=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},r),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:s,size:i!=="bytes"?EP:TP}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(t){let r=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-r}_maybeFlush(t,r){r!=null&&(this._bufferedSize>=r.desiredSize&&++this._numChunks&&this._enqueue(r,t.toVector()),t.finished&&((t.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(r,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(r,null)))}_enqueue(t,r){this._bufferedSize=0,this._controller=null,r==null?t.close():t.enqueue(r)}},EP=e=>{var t;return(t=e==null?void 0:e.length)!==null&&t!==void 0?t:0},TP=e=>{var t;return(t=e==null?void 0:e.byteLength)!==null&&t!==void 0?t:0}});function T0(e,t){let r=new Ln,n=null,i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield r.close()})},start(a){return H(this,void 0,void 0,function*(){yield s(a,n||(n=yield o()))})},pull(a){return H(this,void 0,void 0,function*(){n?yield s(a,n):a.close()})}});return{writable:new WritableStream(r,Object.assign({highWaterMark:Math.pow(2,14)},e)),readable:i};function o(){return H(this,void 0,void 0,function*(){return yield(yield pr.from(r)).open(t)})}function s(a,c){return H(this,void 0,void 0,function*(){let l=a.desiredSize,u=null;for(;!(u=yield c.next()).done;)if(a.enqueue(u.value),l!=null&&--l<=0)return;a.close()})}}var PP=p(()=>{Ar();vo();rl()});function A0(e,t){let r=new this(e),n=new $r(r),i=new ReadableStream({cancel(){return H(this,void 0,void 0,function*(){yield n.cancel()})},pull(s){return H(this,void 0,void 0,function*(){yield o(s)})},start(s){return H(this,void 0,void 0,function*(){yield o(s)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(r,e),readable:i};function o(s){return H(this,void 0,void 0,function*(){let a=null,c=s.desiredSize;for(;a=yield n.read(c||null);)if(s.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;s.close()})}}var RP=p(()=>{Ar();vo()});function Du(e){let t=pr.from(e);return Vn(t)?t.then(r=>Du(r)):t.isAsync()?t.readAll().then(r=>new rt(r)):new rt(t.readAll())}function Oh(e,t="stream",r=null){let n={compressionType:r};return(t==="stream"?ys:bs).writeAll(e,n).toUint8Array(!0)}var LP=p(()=>{Jc();Xo();rl();Lh()});var Kw={};Qt(Kw,{isArrowData:()=>L0,isArrowDataType:()=>R0,isArrowField:()=>P0,isArrowRecordBatch:()=>C0,isArrowSchema:()=>I0,isArrowTable:()=>B0,isArrowVector:()=>O0});function I0(e){return ve.isSchema(e)}function P0(e){return ee.isField(e)}function R0(e){return U.isDataType(e)}function L0(e){return de.isData(e)}function O0(e){return $.isVector(e)}function C0(e){return $e.isRecordBatch(e)}function B0(e){return rt.isTable(e)}var Xw=p(()=>{Vr();at();wi();zr();hs();Jc()});var OP,Yw=p(()=>{wp();au();Nt();wi();at();Jc();zr();Pn();Vr();ph();Gp();bt();Iu();Qb();hw();ew();tw();rw();nw();ow();cw();pw();mw();sw();aw();yw();ww();bw();c0();u0();l0();lw();uw();iw();fw();dw();gw();vo();rl();Lh();LP();x0();w0();ya();hs();Xw();xp();$b();vc();mh();dr();xu();sh();o0();Xw();Ih();OP=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},gb),Hb),Ob),yb),B2),Lb),hb),Jb),Kw),{compareSchemas:Zc,compareFields:j5,compareTypes:d0})});var CP=p(()=>{su();bt();rl();Lh();vP();IP();PP();RP();Yw();Yw();mr.toDOMStream=MP;ct.throughDOM=AP;pr.throughDOM=T0;ms.throughDOM=T0;Ki.throughDOM=T0;Ei.throughDOM=A0;bs.throughDOM=A0;ys.throughDOM=A0});var ws={};Qt(ws,{AsyncByteQueue:()=>Ln,AsyncByteStream:()=>$r,AsyncMessageReader:()=>el,AsyncRecordBatchFileReader:()=>Ou,AsyncRecordBatchStreamReader:()=>ds,Binary:()=>Tn,BinaryBuilder:()=>ss,BinaryView:()=>Ee,BinaryViewBuilder:()=>ls,Bool:()=>Gr,BoolBuilder:()=>Pc,BufferType:()=>Ne,Builder:()=>ct,ByteStream:()=>_i,CompressionType:()=>Ir,Data:()=>de,DataType:()=>U,DateBuilder:()=>Eo,DateDay:()=>ta,DateDayBuilder:()=>wa,DateMillisecond:()=>ra,DateMillisecondBuilder:()=>xa,DateUnit:()=>st,Date_:()=>sn,Decimal:()=>An,DecimalBuilder:()=>_a,DenseUnion:()=>es,DenseUnionBuilder:()=>Xc,Dictionary:()=>nr,DictionaryBuilder:()=>Rc,Duration:()=>an,DurationBuilder:()=>Si,DurationMicrosecond:()=>fh,DurationMicrosecondBuilder:()=>Ia,DurationMillisecond:()=>uh,DurationMillisecondBuilder:()=>Aa,DurationNanosecond:()=>hh,DurationNanosecondBuilder:()=>Pa,DurationSecond:()=>lh,DurationSecondBuilder:()=>Ta,Field:()=>ee,FixedSizeBinary:()=>In,FixedSizeBinaryBuilder:()=>Sa,FixedSizeList:()=>$t,FixedSizeListBuilder:()=>Lc,Float:()=>Fr,Float16:()=>ji,Float16Builder:()=>Oc,Float32:()=>nn,Float32Builder:()=>Cc,Float64:()=>Qn,Float64Builder:()=>Bc,FloatBuilder:()=>To,Int:()=>Pt,Int16:()=>Xn,Int16Builder:()=>Nc,Int32:()=>Zt,Int32Builder:()=>Fc,Int64:()=>Yn,Int64Builder:()=>kc,Int8:()=>Kn,Int8Builder:()=>Dc,IntBuilder:()=>ln,Interval:()=>Ur,IntervalBuilder:()=>$i,IntervalDayTime:()=>ua,IntervalDayTimeBuilder:()=>Ma,IntervalMonthDayNano:()=>ch,IntervalMonthDayNanoBuilder:()=>Ea,IntervalUnit:()=>Ge,IntervalYearMonth:()=>fa,IntervalYearMonthBuilder:()=>va,JSONMessageReader:()=>tl,LargeBinary:()=>zi,LargeBinaryBuilder:()=>as,LargeList:()=>ei,LargeListBuilder:()=>Vc,LargeUtf8:()=>qi,LargeUtf8Builder:()=>Ga,List:()=>rr,ListBuilder:()=>qc,MapBuilder:()=>Wc,MapRow:()=>bi,Map_:()=>jr,Message:()=>Hr,MessageHeader:()=>ke,MessageReader:()=>Ua,MetadataVersion:()=>ot,Null:()=>Ht,NullBuilder:()=>Hc,Precision:()=>He,RecordBatch:()=>$e,RecordBatchFileReader:()=>ms,RecordBatchFileWriter:()=>bs,RecordBatchJSONWriter:()=>Rh,RecordBatchReader:()=>pr,RecordBatchStreamReader:()=>Ki,RecordBatchStreamWriter:()=>ys,RecordBatchWriter:()=>Ei,Schema:()=>ve,SparseUnion:()=>ha,SparseUnionBuilder:()=>Kc,Struct:()=>Je,StructBuilder:()=>$c,StructRow:()=>_o,Table:()=>rt,Time:()=>Pr,TimeBuilder:()=>vi,TimeMicrosecond:()=>oa,TimeMicrosecondBuilder:()=>Na,TimeMillisecond:()=>ia,TimeMillisecondBuilder:()=>Da,TimeNanosecond:()=>sa,TimeNanosecondBuilder:()=>Fa,TimeSecond:()=>na,TimeSecondBuilder:()=>Ba,TimeUnit:()=>q,Timestamp:()=>Rr,TimestampBuilder:()=>Mi,TimestampMicrosecond:()=>ca,TimestampMicrosecondBuilder:()=>Oa,TimestampMillisecond:()=>xo,TimestampMillisecondBuilder:()=>La,TimestampNanosecond:()=>la,TimestampNanosecondBuilder:()=>Ca,TimestampSecond:()=>aa,TimestampSecondBuilder:()=>Ra,Type:()=>x,Uint16:()=>Jn,Uint16Builder:()=>Uc,Uint32:()=>rn,Uint32Builder:()=>jc,Uint64:()=>Ui,Uint64Builder:()=>zc,Uint8:()=>Zn,Uint8Builder:()=>Gc,Union:()=>cn,UnionBuilder:()=>cs,UnionMode:()=>Ze,Utf8:()=>kr,Utf8Builder:()=>ka,Utf8View:()=>on,Utf8ViewBuilder:()=>Yc,Vector:()=>$,Visitor:()=>ie,builderThroughAsyncIterable:()=>vw,builderThroughIterable:()=>p0,compressionRegistry:()=>ja,isArrowData:()=>L0,isArrowDataType:()=>R0,isArrowField:()=>P0,isArrowRecordBatch:()=>C0,isArrowSchema:()=>I0,isArrowTable:()=>B0,isArrowVector:()=>O0,makeBuilder:()=>oi,makeData:()=>te,makeTable:()=>Ew,makeVector:()=>Mo,tableFromArrays:()=>Tw,tableFromIPC:()=>Du,tableFromJSON:()=>Mw,tableToIPC:()=>Oh,util:()=>OP,vectorFromArray:()=>Pu});var za=p(()=>{su();bt();rl();Lh();dP();gP();wP();SP();CP();mr.toNodeStream=hP;ct.throughNode=pP;pr.throughNode=bP;Ei.throughNode=_P});function D0(e){return e.variadicBuffers??[]}function N0(e,t,r,n,i,o,s,a){return Reflect.construct(de,[e,t,r,n,i,o,s,a])}var Zw=p(()=>{za()});function BP(e,t={}){let r={...t,copies:new WeakMap};return I$(e)?L$(e,r):P$(e)?DP(e,r):R$(e)?NP(e,r):F0(e,r)}function I$(e){return"batches"in e}function P$(e){return"schema"in e&&"data"in e&&!Array.isArray(e.data)}function R$(e){return"data"in e&&Array.isArray(e.data)}function L$(e,t){let r=e.batches.map(n=>DP(n,t));return new rt(e.schema,r)}function DP(e,t){return new $e(e.schema,F0(e.data,t))}function F0(e,t){let r=e.children.map(o=>F0(o,t)),n=e.dictionary?NP(e.dictionary,t):void 0,i={[Ne.OFFSET]:Ch(e.buffers[Ne.OFFSET],t),[Ne.DATA]:Ch(e.buffers[Ne.DATA],t),[Ne.VALIDITY]:Ch(e.buffers[Ne.VALIDITY],t),[Ne.TYPE]:Ch(e.buffers[Ne.TYPE],t)};return N0(e.type,e.offset,e.length,e._nullCount,i,r,n,D0(e).map(o=>Ch(o,t)))}function NP(e,t){return new $(e.data.map(r=>F0(r,t)))}function Ch(e,t){if(!O$(e)||t.copy==="none"||t.copy!=="all"&&e.byteOffset===0&&e.byteLength===e.buffer.byteLength)return e;let r=t.copies.get(e);return r||(r=e instanceof Uint8Array?new Uint8Array(e):e.slice(),t.copies.set(e,r)),r}function O$(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Jw=p(()=>{za();Zw()});var FP=p(()=>{});var kP=p(()=>{});var GP=p(()=>{});var UP=p(()=>{});function jP(e,t){let r=BP(e,t);return{transport:"arrow-js",version:1,schema:Oh(new rt(r.schema,[])),metadataVersion:r.schema.metadataVersion,batches:r.batches.map(n=>Qw(n.data))}}function zP(e){if(e.transport!=="arrow-js"||e.version!==1)throw new Error("Unsupported Arrow column-buffer transport protocol.");let t=Du(e.schema).schema,r=new ve(t.fields,t.metadata,t.dictionaries,e.metadataVersion),n=new Je(r.fields),i=e.batches.map(o=>new $e(r,ex(o,n)));return new rt(r,i)}function Qw(e){var t;return{offset:e.offset,length:e.length,nullCount:e.nullCount,buffers:{[Ne.OFFSET]:e.buffers[Ne.OFFSET],[Ne.DATA]:e.buffers[Ne.DATA],[Ne.VALIDITY]:e.buffers[Ne.VALIDITY],[Ne.TYPE]:e.buffers[Ne.TYPE]},children:e.children.map(r=>Qw(r)),variadicBuffers:D0(e),dictionary:(t=e.dictionary)==null?void 0:t.data.map(r=>Qw(r))}}function ex(e,t){let r=e.children.map((i,o)=>ex(i,t.children[o].type)),n=e.dictionary&&U.isDictionary(t)?new $(e.dictionary.map(i=>ex(i,t.dictionary))):void 0;return N0(t,e.offset,e.length,e.nullCount,e.buffers,r,n,e.variadicBuffers)}var qP=p(()=>{za();Zw();Jw()});var VP=p(()=>{kP();FP();GP();UP();Jw();qP()});var WP=p(()=>{VP()});function HP(e,t){var i;if(!C$(e))return e;let r=t,n=((i=r==null?void 0:r.core)==null?void 0:i.workerTransferBufferCopy)??(r==null?void 0:r.workerTransferBufferCopy);return{...e,data:jP(e.data,n?{copy:n}:void 0)}}function $P(e){return B$(e)?{...e,data:zP(e.data)}:e}function C$(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&typeof t.data=="object"&&"batches"in t.data)}function B$(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&t.data.transport==="arrow-js"&&Array.isArray(t.data.batches))}var KP=p(()=>{"use strict";WP()});function D$(e,t="float32"){return e instanceof Date?"date-millisecond":typeof e=="number"?t:typeof e=="boolean"?"bool":typeof e=="string"?"utf8":"null"}function XP(e){let t=tx(e);return t!=="null"?{type:t,nullable:!1}:e.length>0?(t=D$(e[0]),{type:t,nullable:!0}):{type:"null",nullable:!0}}function tx(e){if(typeof Float16Array<"u"&&e instanceof Float16Array)return"float16";switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var rx=p(()=>{"use strict"});function QP(e){return{fields:e.fields.map(t=>nl(t)),metadata:eR(e.metadata)}}function eR(e){return Object.fromEntries(e)}function nx(e){return e?new Map(Object.entries(e)):new Map}function nl(e){return{name:e.name,type:tR(e.type),nullable:e.nullable,metadata:eR(e.metadata)}}function xs(e,t){return new ee(e.name,k0(e.type,t),e.nullable,nx(e.metadata))}function tR(e){if(YP(e,"BinaryView"))return"binary-view";if(YP(e,"Utf8View"))return"utf8-view";if(N$(e,"LargeList"))return{type:"large-list",children:[nl(e.valueField)]};switch(e.constructor){case Ht:return"null";case Tn:return"binary";case In:return{type:"fixed-size-binary",byteWidth:e.byteWidth};case Gr:return"bool";case Pt:let t=e;return`${t.isSigned?"":"u"}int${t.bitWidth}`;case Kn:return"int8";case Xn:return"int16";case Zt:return"int32";case Yn:return"int64";case Zn:return"uint8";case Jn:return"uint16";case rn:return"uint32";case Ui:return"uint64";case Fr:switch(e.precision){case He.HALF:return"float16";case He.SINGLE:return"float32";case He.DOUBLE:return"float64";default:return"float16"}case ji:return"float16";case nn:return"float32";case Qn:return"float64";case kr:return"utf8";case An:let n=e;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case sn:return e.unit===st.DAY?"date-day":"date-millisecond";case ta:return"date-day";case ra:return"date-millisecond";case Pr:switch(e.unit){case q.SECOND:return"time-second";case q.MILLISECOND:return"time-millisecond";case q.MICROSECOND:return"time-microsecond";case q.NANOSECOND:return"time-nanosecond";default:return"time-second"}case ia:return"time-millisecond";case na:return"time-second";case oa:return"time-microsecond";case sa:return"time-nanosecond";case Rr:switch(e.unit){case q.SECOND:return"timestamp-second";case q.MILLISECOND:return"timestamp-millisecond";case q.MICROSECOND:return"timestamp-microsecond";case q.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case aa:return"timestamp-second";case xo:return"timestamp-millisecond";case ca:return"timestamp-microsecond";case la:return"timestamp-nanosecond";case Ur:switch(e.unit){case Ge.DAY_TIME:return"interval-daytime";case Ge.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case ua:return"interval-daytime";case fa:return"interval-yearmonth";case jr:let c=e;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(y=>nl(y))};case rr:let u=e.valueField;return{type:"list",children:[nl(u)]};case $t:let h=e;return{type:"fixed-size-list",listSize:h.listSize,children:[nl(h.children[0])]};case Je:return{type:"struct",children:e.children.map(y=>nl(y))};case ha:case es:let m=e;return{type:m instanceof es?"dense-union":"sparse-union",typeIds:m.typeIds,children:m.children.map(y=>nl(y)),typeIdToChildIndex:{...m.typeIdToChildIndex}};case nr:let g=e;return{type:"dictionary",id:g.id,indices:F$(g.indices),dictionary:tR(g.dictionary),isOrdered:g.isOrdered};default:throw new Error(`arrow type not supported: ${e.constructor.name}`)}}function k0(e,t){if(typeof e=="object")switch(e.type){case"decimal":return new An(e.scale,e.precision,e.bitWidth);case"map":{let r=e.children.map(n=>xs(n,t));return new jr(r[0],e.keysSorted)}case"list":{let r=xs(e.children[0],t);return new rr(r)}case"large-list":{let r=xs(e.children[0],t),n=Bh("LargeList");if(!n)throw new Error("LargeList requires an Apache Arrow runtime that exports the LargeList constructor");return new n(r)}case"fixed-size-list":{let r=xs(e.children[0],t);return new $t(e.listSize,r)}case"fixed-size-binary":return new In(e.byteWidth);case"struct":{let r=e.children.map(n=>xs(n,t));return new Je(r)}case"sparse-union":case"dense-union":{let r=e.children.map(n=>xs(n,t));return e.type==="dense-union"?new es(e.typeIds,r):new ha(e.typeIds,r)}case"dictionary":return new nr(k0(e.dictionary,t),G$(e.indices),e.id,e.isOrdered);default:throw new Error("array type not supported")}switch(e){case"null":return new Ht;case"binary":return ZP("BinaryView",new Tn,t);case"binary-view":return JP("BinaryView");case"bool":return new Gr;case"int8":return new Kn;case"int16":return new Xn;case"int32":return new Zt;case"int64":return new Yn;case"uint8":return new Zn;case"uint16":return new Jn;case"uint32":return new rn;case"uint64":return new Ui;case"float16":return new ji;case"float32":return new nn;case"float64":return new Qn;case"utf8":return ZP("Utf8View",new kr,t);case"utf8-view":return JP("Utf8View");case"date-day":return new ta;case"date-millisecond":return new ra;case"time-second":return new na;case"time-millisecond":return new ia;case"time-microsecond":return new oa;case"time-nanosecond":return new sa;case"timestamp-second":return new aa;case"timestamp-millisecond":return new xo;case"timestamp-microsecond":return new ca;case"timestamp-nanosecond":return new la;case"interval-daytime":return new ua;case"interval-yearmonth":return new fa;default:throw new Error("array type not supported")}}function Bh(e){return ws[e]}function YP(e,t){let r=Bh(t);if(r&&e instanceof r)return!0;let n=U,i=t==="BinaryView"?n.isBinaryView:n.isUtf8View;return!!(i!=null&&i(e))}function N$(e,t){let r=Bh(t);return!!(r&&e instanceof r)}function ZP(e,t,r){let n=(r==null?void 0:r.viewTypes)||"never";if(n==="never")return t;let i=Bh(e);if(i)return new i;if(n==="require")throw new Error(`${e} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return t}function JP(e){let t=Bh(e);if(!t)throw new Error(`${e} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new t}function F$(e){if(e instanceof Pt){let r=`${e.isSigned?"int":"uint"}${e.bitWidth}`;if(k$(r))return r}switch(e.constructor){case Kn:return"int8";case Xn:return"int16";case Zt:return"int32";case Zn:return"uint8";case Jn:return"uint16";case rn:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${e.constructor.name}`)}}function k$(e){return["int8","int16","int32","uint8","uint16","uint32"].includes(e)}function G$(e){switch(e){case"int8":return new Kn;case"int16":return new Xn;case"int32":return new Zt;case"uint8":return new Zn;case"uint16":return new Jn;case"uint32":return new rn;default:throw new Error(`schema dictionary index type not supported: ${e}`)}}var ix=p(()=>{"use strict";za()});function ox(e){let t=e==null?void 0:e.POSITION;if(!t||!("value"in t)||!t.value.length)return null;let r=1/0,n=1/0,i=1/0,o=-1/0,s=-1/0,a=-1/0,c=t.value,l=c.length;for(let u=0;u<l;u+=3){let h=c[u],d=c[u+1],m=c[u+2];r=h<r?h:r,n=d<n?d:n,i=m<i?m:i,o=h>o?h:o,s=d>s?d:s,a=m>a?m:a}return[[r,n,i],[o,s,a]]}var rR=p(()=>{"use strict"});function nR(e){let t=vm();return new t(e)}function il(e){return!!(Vl&&e instanceof Vl)}function iR(e,t,r){il(e)?e[t]=r:e[t]=oR(r)}function Dh(e){return il(e)?new Uint16Array(e.buffer,e.byteOffset,e.length):e}function sx(e,t){let r=nR(e.length);for(let n=0;n<e.length;n++)iR(r,n,e[n]/t);return r}function oR(e){if(!Number.isFinite(e))return e===1/0?31744:e===-1/0?64512:32256;let t=e<0||Object.is(e,-0)?32768:0,r=Math.abs(e);if(r===0)return t;if(r>=65520)return t|31744;if(r>=65504)return t|31743;let n=Math.floor(Math.log2(r));if(n<-14)return t|Math.round(r/2**-24);let i=n+15,o=Math.round((r/2**n-1)*1024);return o===1024?t|i+1<<10:t|i<<10|o}var sR=p(()=>{"use strict";Fn()});var G0,ax,aR=p(()=>{"use strict";za();G0=new ve([new ee("POSITION",new $t(3,new ee("value",new nn,!1)),!1)]),ax=new ve([...G0.fields,new ee("indices",new rr(new ee("item",new rn,!1)),!0)])});var Nh=p(()=>{"use strict";sR();aR()});function cx(e,t,r){let n=U$(e,t,r);return new $([n])}function U$(e,t,r){let n=j$(e,t,r),i=n.children[0].type,o=r==="float16"&&il(e)?Dh(e):e,s={[Ne.DATA]:o},a=new de(i,0,o.length,0,s);return new de(n,0,o.length/t,0,void 0,[a])}function j$(e,t,r){let n=r||XP(e).type,i=k0(n);return new $t(t,new ee("value",i,!1))}var cR=p(()=>{"use strict";Nh();za();rx();ix()});function lx(e,t){switch(t){case"columnar-table":return z$(e);case"arrow-table":return q$(e);default:throw new Error(t)}}function z$(e){let t={},r=fR(e);for(let[n,i]of Object.entries(e.attributes))t[n]=i.value;return{shape:"columnar-table",schema:e.schema,data:t,topology:e.topology,indices:r?e.indices:void 0}}function q$(e,t){var r;return uR(e.attributes,{schema:e.schema,topology:e.topology,mode:e.mode,boundingBox:(r=e.header)==null?void 0:r.boundingBox,indices:fR(e)?e.indices:void 0})}function uR(e,t={}){var c,l,u;let r=[],n={},i=W$(e);for(let h of i){let d=e[h],{value:m,size:g=1}=d,y=V$(m,g,d.componentType);if(n[h]=y,r.push(H$(t.schema,h,y,d.componentType)),h==="POSITION"&&((l=(c=t.indices)==null?void 0:c.value)!=null&&l.length)){let b=ax.fields.find(w=>w.name==="indices");n.indices=K$(t.indices.value,y.length,b.type),r.push(b)}}let o=new ve(r,X$(t)),s=((u=n[i[0]])==null?void 0:u.length)===0?new rt(o):new rt(o,n);return{shape:"arrow-table",schema:QP(s.schema),data:s,topology:t.topology||"point-list",indices:t.indices}}function V$(e,t,r){if(r==="float16"){let n=il(e)?Dh(e):e;if(t===1){let i=new de(new ji,0,n.length,0,{[Ne.DATA]:n});return new $([i])}return cx(e,t,r)}return t===1?Mo(e):cx(e,t)}function W$(e){let t=Object.keys(e),r=lR.filter(i=>i in e),n=t.filter(i=>!lR.includes(i));return[...r,...n]}function fR(e){var t,r;return!!((r=(t=e.indices)==null?void 0:t.value)!=null&&r.length)}function H$(e,t,r,n){if(t==="POSITION"&&$$(r)){let o=G0.fields[0],s=e==null?void 0:e.fields.find(c=>c.name===t);if(!(s!=null&&s.metadata))return o;let a=new Map(o.metadata);for(let[c,l]of Object.entries(s.metadata))a.set(c,l);return new ee(o.name,o.type,o.nullable,a)}let i=e==null?void 0:e.fields.find(o=>o.name===t);if(n==="float16"){let o=new Map(Object.entries((i==null?void 0:i.metadata)||{}));return o.set("componentType","float16"),new ee(t,r.type,!1,o)}if(i&&i.type.toString()!==r.type.toString()){let o=xs(i);return new ee(t,r.type,o.nullable,o.metadata)}return i?xs(i):new ee(t,r.type,!1)}function $$(e){return e.type instanceof $t&&e.type.listSize===3&&e.type.children[0].type instanceof nn}function K$(e,t,r){let n=r,i=e instanceof Uint32Array?e:Uint32Array.from(e),o=new Int32Array(t+1);t>0&&o.fill(i.length,1);let s=new Uint8Array(Math.ceil(t/8));t>0&&(s[0]=1);let a=new de(n.children[0].type,0,i.length,0,{[Ne.DATA]:i}),c=new de(n,0,t,Math.max(0,t-1),{[Ne.OFFSET]:o,[Ne.VALIDITY]:s},[a]);return new $([c])}function X$(e){var r;let t={...(r=e.schema)==null?void 0:r.metadata};return e.topology&&(t.topology||=e.topology),Number.isFinite(e.mode)&&(t.mode||=String(e.mode)),e.boundingBox&&(t.boundingBox||=JSON.stringify(e.boundingBox)),nx(t)}var lR,hR=p(()=>{"use strict";Nh();Nh();za();cR();ix();lR=["POSITION"]});function ux(e,t,r){let n=t.componentType||tx(t.value),i=r||U0(t),o=t.size===1?n:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]};return{name:e,type:o,nullable:!1,metadata:i}}function U0(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),e.componentType&&(t.componentType=e.componentType),e.transform&&(t["loaders.gl.transform"]=JSON.stringify(e.transform)),t}var dR=p(()=>{"use strict";rx()});var j0=p(()=>{"use strict";rR();hR();dR()});var mR,pR=p(()=>{"use strict";mR="5.0.0-beta.6"});var gR,yR=p(()=>{"use strict";gR={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var bR,wR=p(()=>{"use strict";bR={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function Fh(e,t=null,r={},n=null,i=null){var o;if(Pi&&r.useLocalLibraries&&!r.CDN&&n&&((o=r.modules)==null?void 0:o[n])===void 0){let s=rc?"./libs":`modules/${t}/dist/libs`;r={...r,modules:{[n]:`${s}/${n}`,...i?{[i]:`${s}/${i}`}:{},...r.modules}}}return await Nl(e,t,r,n,i)}var xR=p(()=>{"use strict";sc()});var Y$,Z$,kh,_R,kt,Gh,SR=p(()=>{"use strict";Y$="1.5.7",Z$="8786740086a9f4d83f44aa83badfbea4dce7a1b5",kh=`https://www.gstatic.com/draco/versioned/decoders/${Y$}`,_R=`https://cdn.jsdelivr.net/gh/google/draco@${Z$}/javascript`,kt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},Gh={[kt.DECODER]:`${kh}/${kt.DECODER}`,[kt.DECODER_WASM]:`${kh}/${kt.DECODER_WASM}`,[kt.GLTF_DECODER]:`${kh}/${kt.GLTF_DECODER}`,[kt.GLTF_DECODER_WASM]:`${kh}/${kt.GLTF_DECODER_WASM}`,[kt.FALLBACK_DECODER]:`${kh}/${kt.FALLBACK_DECODER}`,[kt.ENCODER]:`${_R}/${kt.ENCODER}`,[kt.ENCODER_WASM]:`${_R}/${kt.ENCODER_WASM}`}});async function z0(e={},t,r="full"){let n=tK(e);return n?await fx(n):await J$(e,t==="js"?"javascript":t,r)}async function J$(e={},t,r="full"){let n=nK(`${t}:${r}`,e),i=MR.get(n);return i||(i=Q$(e,t,r),MR.set(n,i)),await i}async function fx(e){let t=rK(e),r=vR.get(t);return r||(r=Ol(()=>t.createDecoderModule({}),n=>({draco:n})),vR.set(t,r)),await r}async function Q$(e,t,r){try{return await TR(e,t,r)}catch(n){if(t==="javascript")throw n;try{return await TR(e,"javascript","full")}catch(i){throw new AggregateError([n,i],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function TR(e,t,r){let n=ER.then(()=>eK(e,t,r));return ER=n.then(()=>{},()=>{}),await n}async function eK(e,t,r){if(t==="javascript"){let s;try{s=await Fh(Gh[kt.FALLBACK_DECODER],"scene",e,kt.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Pi||e.useLocalLibraries)throw c;s=await Fh(Gh[kt.FALLBACK_DECODER],"scene",{...e,useLocalLibraries:!0},kt.FALLBACK_DECODER,"draco_decoder.mjs")}let a=PR(s,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await IR(a)}let n,i;try{[n,i]=await AR(e,r)}catch(s){if(Pi||e.useLocalLibraries)throw s;[n,i]=await AR({...e,useLocalLibraries:!0},r)}let o=PR(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await IR(o,i)}async function AR(e,t){let r=t==="gltf"?kt.GLTF_DECODER:kt.DECODER,n=t==="gltf"?kt.GLTF_DECODER_WASM:kt.DECODER_WASM;return await Promise.all([Fh(Gh[r],"scene",e,r,t==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),Fh(Gh[n],"scene",e,n)])}function IR(e,t){if(typeof e!="function")throw new Error("Draco module initializer could not be loaded");return Ol(r=>e({...t?{wasmBinary:t}:{},onModuleLoaded:r}),r=>({draco:r}))}function PR(e,t){if(typeof e=="function")return e;if(e&&typeof e=="object"){let r=e,n=r[t]||r.default;return typeof n=="function"?n:void 0}}function tK(e){var r;let t=(r=e.modules)==null?void 0:r.draco3d;if(t){if(typeof t!="object"&&typeof t!="function")throw new Error("Invalid draco3d module");return t}}function rK(e){let t=e;if(typeof(t==null?void 0:t.createDecoderModule)!="function")throw new Error("Invalid draco3d decoder module");return t}function nK(e,t){let r=Object.entries(t.modules||{}).filter(([n])=>n!=="draco3d").map(([n,i])=>`${n}:${String(i)}`).sort().join("|");return[e,t.useLocalLibraries?"local":"remote",t.CDN||"",r].join("|")}var MR,vR,ER,q0=p(()=>{"use strict";Ws();xR();SR();MR=new Map,vR=new WeakMap;ER=Promise.resolve()});function LR(e,t,r){let n=OR(t.metadata),i=[],o=iK(t.attributes);for(let s in e){let a=e[s],c=RR(s,a,o[s]);i.push(c)}if(r){let s=RR("indices",r);i.push(s)}return{fields:i,metadata:n}}function iK(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function RR(e,t,r){let n={...U0(t),...r?OR(r.metadata):{}};return ux(e,t,n)}function OR(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var CR=p(()=>{"use strict";j0()});function cK(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function lK(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function uK(e){let t=e.size(),r=new Uint32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function fK(e,t){if(!Object.prototype.hasOwnProperty.call(t,e))return e;let r=/^(.*)_([0-9]+)$/.exec(e),n=r?r[1]:e,i=r?BigInt(r[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(t,`${n}_${i}`);)i++;return`${n}_${i}`}function hK(e){var t;if(e.quantization_transform){let{quantization_bits:r,min_values:n,range:i}=e.quantization_transform;if(r!==void 0&&n&&i!==void 0)return{type:"quantization",bits:r,origin:Array.from(n),range:i}}if(((t=e.octahedron_transform)==null?void 0:t.quantization_bits)!==void 0)return{type:"octahedron",bits:e.octahedron_transform.quantization_bits}}function dK(e){if(e.includeAttributes&&e.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function mK(e,t){for(let r of e.includeAttributes||e.excludeAttributes||[])if(!t.includes(r))throw new Error(`DracoLoader: selected attribute "${r}" does not exist`)}function pK(e){var a;let t=ox(e);if(!t)throw new Error("Decoded mesh is missing positions");let r=e.POSITION;if(((a=r==null?void 0:r.transform)==null?void 0:a.type)!=="quantization")return t;let{bits:n,origin:i,range:o}=r.transform,s=o/(2**n-1);return t.map(c=>c.map((l,u)=>i[u]+l*s))}var BR,oK,sK,aK,Uh,DR=p(()=>{"use strict";j0();CR();BR={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},oK={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},sK=2,aK=4,Uh=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){dK(r);let n=ArrayBuffer.isView(t)?new Int8Array(t.buffer,t.byteOffset,t.byteLength):new Int8Array(t);this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),o=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,s=null;try{switch(i){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeArrayToMesh(n,n.byteLength,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){let d=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(o,i,r),c=this._getMeshData(o,a,r),l=pK(c.attributes),u=LR(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:l},...c,schema:u}}finally{s&&this.draco.destroy(s),o&&this.draco.destroy(o)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),o=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:o}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let o=this.decoder.GetAttribute(t,i),s=this._getAttributeMetadata(t,i);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:i,metadata:s};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(o,r);c&&(n[o.unique_id()].octahedron_transform=c)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:4,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={},o={},a=Object.values(t.attributes).sort((c,l)=>c.attribute_index-l.attribute_index).map(c=>{let l=this._deduceAttributeName(c,n),u=fK(l,o);return o[u]=!0,c.name=u,{attributeName:u,loaderAttribute:c}});mK(n,Object.keys(o));for(let{attributeName:c,loaderAttribute:l}of a){if(!this._shouldExtractAttribute(c,l,n))continue;let u=this._getAttributeValues(r,l);if(u){let{value:h,size:d}=u;i[c]={value:h,size:d,byteOffset:l.byte_offset,byteStride:l.byte_stride,normalized:l.normalized,transform:hK(l)}}}return i}_shouldExtractAttribute(t,r,n){var i,o;if(r.attribute_type===this.draco.POSITION){if((i=n.excludeAttributes)!=null&&i.includes(t))throw new Error(`DracoLoader: position attribute "${t}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(t)?!1:!((o=n.excludeAttributes)!=null&&o.includes(t))}_getTriangleListIndices(t){let n=t.num_faces()*3,i=t.num_points()<=65536,o=n*(i?sK:aK),s=this.draco._malloc(o);try{if(i){if(!this.decoder.GetTrianglesUInt16Array(t,o,s))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,s,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(t,o,s))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),uK(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=oK[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let i=r.num_components,s=t.num_points()*i,a=s*n.BYTES_PER_ELEMENT,c=cK(this.draco,n),l,u=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(t,r.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(t,h,c,a,u))throw new Error(`DRACO: Failed to decode attribute ${r.unique_id}.`);l=new n(this.draco.HEAPU8.buffer,u,s).slice()}finally{this.draco._free(u)}return{value:l,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[s,a]of Object.entries(r.extraAttributes||{}))if(a===n)return s;let i=r.attributeNameEntry||"name";if(t.metadata[i]){let s=t.metadata[i].string;return s==="COLOR"?"COLOR_0":s==="TEX_COORD"?"TEXCOORD_0":s}let o=t.attribute_type;for(let s in BR)if(this.draco[s]===o)return BR[s];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let o=this.metadataQuerier.GetEntryName(t,i);r[o]=this._getDracoMetadataField(t,o)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=lK(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let o of i)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeQuantizationTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits(),range:s.range(),min_values:Float32Array.from({length:t.num_components()},(a,c)=>s.min_value(c))}}finally{this.draco.destroy(s)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(s=>this.draco[s]).includes(i)){let s=new this.draco.AttributeOctahedronTransform;try{if(s.InitFromAttribute(t))return{quantization_bits:s.quantization_bits()}}finally{this.draco.destroy(s)}}return null}}});async function Nu(e,t,r,n){var a,c;let i=(n==null?void 0:n.reportProgress)||(t==null?void 0:t.onProgress);i==null||i({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:o}=await r();(a=(t==null?void 0:t.signal)||(n==null?void 0:n.signal))==null||a.throwIfAborted();let s=new Uh(o);try{let l=s.parseSync(e,t==null?void 0:t.draco);return i==null||i({phase:"decode",completed:1,total:1,unit:"tasks"}),((c=t==null?void 0:t.draco)==null?void 0:c.shape)==="arrow-table"?lx(l,"arrow-table"):l}finally{s.destroy()}}var V0=p(()=>{"use strict";j0();DR()});var Wye,gK,yK,NR=p(()=>{"use strict";sc();q0();V0();jh();({preload:Wye,...gK}=Ti),yK={...gK,parse:async(e,t,r)=>await Nu(e,t,async()=>{var n;return await z0(oc(t),"wasm",(n=t==null?void 0:t.draco)==null?void 0:n.decoderProfile)},r)}});var FR={};Qt(FR,{DracoWASMLoaderWithParser:()=>yK});var kR=p(()=>{"use strict";NR()});var Jye,bK,wK,GR=p(()=>{"use strict";sc();q0();V0();jh();({preload:Jye,...bK}=Ti),wK={...bK,parse:async(e,t,r)=>await Nu(e,t,async()=>await z0(oc(t),"js"),r)}});var UR={};Qt(UR,{DracoJavaScriptLoaderWithParser:()=>wK});var jR=p(()=>{"use strict";GR()});function SK(e){var r;let t=(r=e==null?void 0:e.modules)==null?void 0:r.draco3d;if(!t)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return t}var i2e,xK,_K,zR=p(()=>{"use strict";q0();V0();jh();({preload:i2e,...xK}=Ti),_K={...xK,parse:async(e,t,r)=>await Nu(e,t,async()=>await fx(SK(t)),r)}});var qR={};Qt(qR,{Draco3DLoaderWithParser:()=>_K});var VR=p(()=>{"use strict";zR()});async function MK(e,t){var n;let r=t;switch(vK(r)){case"wasm":{let{DracoWASMLoaderWithParser:i}=await Promise.resolve().then(()=>(kR(),FR));return i}case"javascript":{let{DracoJavaScriptLoaderWithParser:i}=await Promise.resolve().then(()=>(jR(),UR));return i}case"draco3d":{let{Draco3DLoaderWithParser:i}=await Promise.resolve().then(()=>(VR(),qR));return i}default:throw new Error(`DracoLoader: unsupported backend "${(n=r==null?void 0:r.draco)==null?void 0:n.backend}"`)}}function vK(e){var t;return(t=e==null?void 0:e.draco)!=null&&t.backend?e.draco.backend==="js"?"javascript":e.draco.backend:Ti.options.draco.backend}var Ti,jh=p(()=>{"use strict";KP();pR();yR();wR();Ti={dataType:null,batchType:null,...gR,version:mR,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:HP,deserializeWorkerResult:$P,options:{draco:bR},preload:MK}});var hx=p(()=>{"use strict";zA();jh()});function zh(e){let t=e.trim().toUpperCase(),r=t.match(/(?:\/DEF\/CRS\/|URN:OGC:DEF:CRS:)([A-Z0-9_-]+)(?:\/|::)(?:[^/:]*[/:])?([A-Z0-9_.-]+)$/);return r?`${r[1]}:${r[2]}`:t}var Fu,W0,dx=p(()=>{"use strict";Fu="EPSG:4326",W0="EPSG:4978"});function Io(e){var r,n;if(typeof e=="string"){let i=wr(e);return i==="wkt"?TK(e):i==="proj-string"?AK(e):EK(e)||"projected"}let t=e;return t.type==="BoundCRS"&&t.source_crs?Io(t.source_crs):t.type==="CompoundCRS"&&((r=t.components)!=null&&r[0])?Io(t.components[0]):String(t.type).includes("Projected")?"projected":String(t.type).includes("Geographic")?"geographic":String(t.type).includes("Geodetic")?((n=t.coordinate_system)==null?void 0:n.subtype)==="Cartesian"?"geocentric":"geographic":"unknown"}function EK(e){if(typeof e!="string")return;let t=zh(e);if(t===W0)return"geocentric";if(t===Fu||t==="OGC:CRS84")return"geographic";let r=/^EPSG:(\d+)$/.exec(t);if(!r)return;let n=Number(r[1]);if(n===7789)return"geocentric";if(n===4490||n===4979)return"geographic";if(n===3857||n>=32601&&n<=32660||n>=32701&&n<=32760)return"projected"}function TK(e){let t;try{t=Sf(e).root}catch{return"unknown"}switch(t.keyword.toUpperCase()){case"GEOCCS":return"geocentric";case"GEOGCS":case"GEOGCRS":case"GEOGRAPHICCRS":case"GEOGRAPHIC2DCRS":case"GEOGRAPHIC3DCRS":return"geographic";case"PROJCS":case"PROJCRS":case"PROJECTEDCRS":return"projected";case"GEODCRS":case"GEODETICCRS":{let r=t.values.find(i=>i.type==="node"&&i.keyword.toUpperCase()==="CS"),n=r==null?void 0:r.values[0];return(n==null?void 0:n.type)!=="enumeration"&&(n==null?void 0:n.type)!=="string"?"unknown":n.value.toUpperCase()==="CARTESIAN"?"geocentric":n.value.toUpperCase()==="ELLIPSOIDAL"?"geographic":"unknown"}default:return"unknown"}}function AK(e){var t;try{let r=(t=Mf(e).parameters.find(n=>n.name.toLowerCase()==="proj"))==null?void 0:t.value;switch(r==null?void 0:r.toLowerCase()){case"longlat":case"latlong":return"geographic";case"geocent":return"geocentric";default:return r?"projected":"unknown"}}catch{return"unknown"}}var mx=p(()=>{"use strict";cy();dx()});function H0(e,t={}){let r=t.sourceCrs!==void 0,n=t.sourceCrs||e.sourceCrs,i=t.outputCoordinates||"auto",o=t.targetCrs||(i==="ecef"?"EPSG:4978":void 0),s=t.targetHeightReference||"native",a=e.verticalUnitScale??1,c=e.elevationUnitScale??1,l=e.elevationOffset||0,u=e.elevationMode==="onTheGround"||e.elevationMode==="relativeToGround"||e.elevationMode==="relativeToScene",h=e.elevationMode==="relativeToScene"?!!t.sceneElevationProvider:!u||!!t.terrainElevationProvider,d=a!==1||c!==1||e.elevationMode!==void 0&&(u||e.elevationMode==="absoluteHeight"&&l!==0),m=s!=="native"&&s!==e.heightReference,g=!!o||s!=="native"||i!=="auto"||d,y=i!=="target-crs"||!!o,b=!m||(e.heightReference||"unknown")!=="unknown",w=Number.isFinite(a)&&a>0&&Number.isFinite(c)&&c>0,_=!!n&&g&&y&&b&&w&&h&&i!=="local-enu",S=r?"caller-override":e.provenance||"unknown",M=r&&n?Io(n):e.coordinateFrame,v=r?"explicit":e.sourceCrsState||(n?S==="format-default"?"default":"explicit":"absent"),C=tm({crs:n?{state:v==="default"?"default":"explicit",definition:n,representation:!r&&e.sourceCrsRepresentation||wr(n),provenance:S,alternatives:r?void 0:e.sourceCrsAlternatives}:{state:v==="unknown"?"unknown":"absent",provenance:S},vertical:e.verticalCrs?{state:"explicit",definition:e.verticalCrs,representation:wr(e.verticalCrs),provenance:e.provenance||"metadata"}:void 0,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,coordinateFrame:M,coordinateOrder:PK(e.axisOrder),units:r?void 0:e.units}),R=px(C.crs),E=C.vertical?px(C.vertical):void 0,j=o?IK(o):void 0;return Object.freeze({...C,sourceCrs:R,verticalCrs:E,verticalUnitScale:a,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,heightReference:e.heightReference||"unknown",elevationMode:e.elevationMode,elevationOffset:e.elevationOffset,elevationUnit:e.elevationUnit,elevationUnitScale:c,coordinateFrame:M||"unknown",axisOrder:e.axisOrder||"unknown",provenance:S,targetCrs:j,targetHeightReference:s,outputCoordinates:i,status:g?_?"transformable":"unresolved":"native",warnings:Object.freeze([...e.warnings||[]])})}function px(e){return e.state==="explicit"||e.state==="default"?e.definition:void 0}function IK(e){let t=tm({crs:{state:"explicit",definition:e,representation:wr(e),provenance:"caller-override"}}),r=px(t.crs);if(!r)throw new Error("Failed to normalize a known target CRS definition");return r}function PK(e){switch(e){case"xy":return["x","y"];case"yx":return["y","x"];case"xyz":return["x","y","z"];default:return[]}}function WR(e){if(e.status!=="transformable"&&e.status!=="transformed")throw new Error("Only a transformable spatial reference can be marked as transformed");return Object.freeze({...e,status:"transformed"})}var HR=p(()=>{"use strict";cy();mx()});function $R(e){if(!e)return;let t=e.trim().toLowerCase().replaceAll("_","-"),r=LK[t]||t;return RK[r]}var RK,LK,KR=p(()=>{"use strict";RK=Object.freeze({meter:1,millimeter:.001,centimeter:.01,decimeter:.1,kilometer:1e3,foot:.3048,yard:.9144,mile:1609.344,"us-foot":.3048006096012192,"us-inch":.0254000508001016,"us-yard":.9144018288036576,"us-mile":1609.3472186944373,"clarke-foot":.3047972654,"clarke-yard":.9143917962,"clarke-link":.201166195164,"sears-yard":.914398414616,"sears-foot":.304799471539,"sears-chain":20.1167651216,"sears-1922-truncated-chain":20.116756,"benoit-1895-b-chain":20.1167824944,"indian-yard":.914398530744,"indian-1937-yard":.91439523,"gold-coast-foot":.304799710181}),LK=Object.freeze({m:"meter",metre:"meter",meters:"meter",metres:"meter",mm:"millimeter",millimetre:"millimeter",millimeters:"millimeter",millimetres:"millimeter",cm:"centimeter",centimetre:"centimeter",centimeters:"centimeter",centimetres:"centimeter",dm:"decimeter",decimetre:"decimeter",decimeters:"decimeter",decimetres:"decimeter",km:"kilometer",kilometre:"kilometer",kilometers:"kilometer",kilometres:"kilometer",ft:"foot",feet:"foot","us-survey-foot":"us-foot","us-survey-feet":"us-foot",yd:"yard",yards:"yard",mi:"mile",miles:"mile"})});function XR(e){return{input:new Float64Array(e),output:new Float64Array(e)}}function qh(e){return e instanceof Float32Array||e instanceof Float64Array}function YR(e){return typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function gx(e,t,r,n,i,o){return(e.buffer===n.buffer||YR(e.buffer)&&YR(n.buffer))&&t<o&&i<r}function $0(e,t,r,n){return e<t+n?0:Math.floor((e-t-n)/r)+1}var K0,ZR=p(()=>{K0=class{constructor(t){var o,s;this.depth=0;let r=t.dimension??2,n=t.inputOffset??0,i=t.outputOffset??0;if(!Number.isSafeInteger(r)||r<2||!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||t.inputStride!==void 0&&(!Number.isSafeInteger(t.inputStride)||t.inputStride<1)||t.outputStride!==void 0&&(!Number.isSafeInteger(t.outputStride)||t.outputStride<1)||typeof((o=t.projection)==null?void 0:o.projectToSync)!="function"||typeof((s=t.projection)==null?void 0:s.unprojectToSync)!="function")throw new Error("Invalid projection buffer transform or layout");this.dimension=r,this.projection=t.projection,this.inputOffset=n,this.outputOffset=i,this.inputStride=t.inputStride,this.outputStride=t.outputStride,this.scratch=[XR(r)]}projectFlatTo(t,r,n,i=0,o){return this.flat(t,r,n,i,!1,o)}unprojectFlatTo(t,r,n,i=0,o){return this.flat(t,r,n,i,!0,o)}projectColumnsTo(t,r,n,i=0,o){return this.columns(t,r,n,i,!1,o)}unprojectColumnsTo(t,r,n,i=0,o){return this.columns(t,r,n,i,!0,o)}range(t,r,n){let i=r??Math.max(0,t-n);if(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(n+i)||n+i>t)throw new Error("Invalid projection buffer record range");return i}epochStorage(t,r,n){if(t!==void 0){if(typeof t=="number"){if(!Number.isFinite(t))throw new Error("Coordinate epoch must be finite")}else if(!qh(t)||t.length<r+n)throw new Error("Epoch buffer requires one value per addressed record")}}aliases(t,r,n,i,o,s,a){if(!i)return;let c=t.byteOffset+(this.inputOffset+n*o)*t.BYTES_PER_ELEMENT,l=c+((i-1)*o+a)*t.BYTES_PER_ELEMENT,u=r.byteOffset+(this.outputOffset+n*s)*r.BYTES_PER_ELEMENT,h=u+((i-1)*s+a)*r.BYTES_PER_ELEMENT,d=t.buffer===r.buffer&&t.constructor===r.constructor&&c===u&&o===s;if(gx(t,c,l,r,u,h)&&!d)throw new Error("Projection input/output ranges overlap without an exact in-place mapping")}epochAlias(t,r,n,i,o,s){if(typeof t!="object"||!t||!i)return;let a=t.byteOffset+n*t.BYTES_PER_ELEMENT,c=a+i*t.BYTES_PER_ELEMENT,l=r.byteOffset+(this.outputOffset+n*o)*r.BYTES_PER_ELEMENT,u=l+((i-1)*o+s)*r.BYTES_PER_ELEMENT;if(gx(t,a,c,r,l,u))throw new Error("Epoch and output buffers must not overlap")}acquire(){var t;let r=this.depth++;return(t=this.scratch)[r]||(t[r]=XR(this.dimension)),this.scratch[r]}transform(t,r,n){if(n!==void 0&&!Number.isFinite(n))throw new Error("Coordinate epoch must be finite");r?this.projection.unprojectToSync(t.input,t.output,n):this.projection.projectToSync(t.input,t.output,n)}floatRange(t,r){for(let n=0;n<this.dimension;n++){let i=t[n];if(n<3&&!Number.isFinite(i)||r&&Number.isFinite(i)&&Math.abs(i)>34028234663852886e22)throw new Error("Projection output is nonfinite or exceeds Float32 range")}}flat(t,r,n,i,o,s){if(!qh(t)||!qh(r))throw new Error("Projection buffers require Float32Array or Float64Array");let a=this.inputStride??this.dimension,c=this.outputStride??this.dimension;if(a<this.dimension||c<this.dimension)throw new Error("Interleaved stride must contain every ordinate");let l=this.range($0(t.length,this.inputOffset,a,this.dimension),n,i);if(i+l>$0(r.length,this.outputOffset,c,this.dimension))throw new Error("Projection output buffer is too short");this.epochStorage(s,i,l),this.aliases(t,r,i,l,a,c,this.dimension),this.epochAlias(s,r,i,l,c,this.dimension);let u=this.acquire();try{let h=typeof s=="number"?void 0:s,d=r instanceof Float32Array;for(let m=i;m<i+l;m++){let g=this.inputOffset+m*a,y=this.outputOffset+m*c;for(let b=0;b<this.dimension;b++)u.input[b]=t[g+b];this.transform(u,o,h?h[m]:s),this.floatRange(u.output,d);for(let b=0;b<this.dimension;b++)r[y+b]=u.output[b]}return r}finally{this.depth--}}columns(t,r,n,i,o,s){if(t.length!==this.dimension||r.length!==this.dimension)throw new Error("Projection columns must match dimension");let a=this.inputStride??1,c=this.outputStride??1,l=Number.MAX_SAFE_INTEGER;for(let d=0;d<this.dimension;d++){if(!qh(t[d])||!qh(r[d]))throw new Error("Projection columns require floating typed arrays");l=Math.min(l,$0(t[d].length,this.inputOffset,a,1))}let u=this.range(l,n,i);this.epochStorage(s,i,u);for(let d=0;d<this.dimension;d++){if(i+u>$0(r[d].length,this.outputOffset,c,1))throw new Error("Projection output column is too short");this.epochAlias(s,r[d],i,u,c,1);for(let m=0;m<this.dimension;m++)this.aliases(t[d],r[m],i,u,a,c,1);for(let m=0;m<d&&u;m++){let g=r[d].byteOffset+(this.outputOffset+i*c)*r[d].BYTES_PER_ELEMENT,y=r[m].byteOffset+(this.outputOffset+i*c)*r[m].BYTES_PER_ELEMENT;if(gx(r[d],g,g+((u-1)*c+1)*r[d].BYTES_PER_ELEMENT,r[m],y,y+((u-1)*c+1)*r[m].BYTES_PER_ELEMENT))throw new Error("Projection output columns overlap")}}let h=this.acquire();try{let d=typeof s=="number"?void 0:s;for(let m=i;m<i+u;m++){let g=this.inputOffset+m*a,y=this.outputOffset+m*c;for(let b=0;b<this.dimension;b++)h.input[b]=t[b][g];this.transform(h,o,d?d[m]:s);for(let b=0;b<this.dimension;b++){let w=h.output[b];if(b<3&&!Number.isFinite(w)||r[b]instanceof Float32Array&&Number.isFinite(w)&&Math.abs(w)>34028234663852886e22)throw new Error("Projection output is nonfinite or exceeds Float32 range")}for(let b=0;b<this.dimension;b++)r[b][y]=h.output[b]}return r}finally{this.depth--}}}});function JR(){return{bounds:[[-1,-1,0],[1,1,0]]}}var QR=p(()=>{});function bx(){let e=globalThis;return e[yx]||(e[yx]=new WeakMap),e[yx]}function eL(e){var t;return"create"in e?e:(t=bx().get(e))==null?void 0:t.implementation}function tL(e){if("create"in e)return Promise.resolve(e);let t=bx().get(e);if(t||(t={load:()=>e.preload()},bx().set(e,t)),t.implementation)return Promise.resolve(t.implementation);let r=t;return r.pending||(r.pending=Promise.resolve().then(r.load).then(n=>{let i=s=>s.toLowerCase().replace(/[\s_-]/g,""),o=new Set([n.name,...n.aliases||[]].map(i));if(typeof n.create!="function"||![e.name,...e.aliases||[]].every(s=>o.has(i(s))))throw new Error("Loaded projection does not match descriptor: "+e.name);return r.implementation=n,n}).catch(n=>{throw r.pending=void 0,n})),r.pending}var yx,rL=p(()=>{yx=Symbol.for("@math.gl/projection/projection-implementations")});function ol(e,t,r){if(!(Array.isArray(e)||e instanceof Float32Array||e instanceof Float64Array))throw new Error("Scalar input requires a number array, Float32Array or Float64Array");if(!(Array.isArray(t)||t instanceof Float32Array||t instanceof Float64Array)||t.length<r)throw new Error("Scalar output requires a preallocated number array, Float32Array or Float64Array with sufficient capacity");if(e===t||Array.isArray(e)||Array.isArray(t))return;let n=e,i=t,o=typeof SharedArrayBuffer<"u"&&n.buffer instanceof SharedArrayBuffer&&i.buffer instanceof SharedArrayBuffer;if((n.buffer===i.buffer||o)&&n.byteOffset<i.byteOffset+r*i.BYTES_PER_ELEMENT&&i.byteOffset<n.byteOffset+n.byteLength)throw new Error("Scalar input/output views overlap; use the same view for in-place projection")}function Vh(e,t,r,n){if(t instanceof Float32Array){if(Math.abs(r.x)>X0||Math.abs(r.y)>X0||n>=3&&Math.abs(r.z)>X0)throw new Error("Projected coordinate exceeds Float32 range");for(let i=3;i<e.length;i++){let o=e[i];if(Number.isFinite(o)&&Math.abs(o)>X0)throw new Error("Trailing ordinate exceeds Float32 range")}}for(let i=3;i<e.length;i++)t[i]=e[i];return t[0]=r.x,t[1]=r.y,n>=3&&(t[2]=r.z),t}var X0,wx=p(()=>{X0=34028234663852886e22});function Ue(e){throw new ai("missing-transform-stage",e)}var nL,iL,ai,qa=p(()=>{iL=Symbol.for("@math.gl/projection/TypeScriptCRSError"),ai=class e extends Error{static[(nL=iL,Symbol.hasInstance)](t){return this!==e?Function.prototype[Symbol.hasInstance].call(this,t):t instanceof Error&&t[iL]===!0}constructor(t,r){super(r),this.reason=t,this[nL]=!0,this.name="TypeScriptCRSError"}}});function Wh(e,t){if(typeof e=="string"||"type"in e)return{definition:e,lossy:!1};let r=e,n="crs"in r?r:void 0,i="crs"in r?r.crs:r;if(i.state!=="explicit"&&i.state!=="default")throw new ai("unknown-syntax","Cannot transform an "+i.state+" CRS reference");let o=!1;return(n==null?void 0:n.coordinateEpoch)!==void 0&&Ue("Coordinate epochs require a time-dependent transformation"),n!=null&&n.vertical&&n.vertical.state!=="absent"&&(t.mode!=="horizontal"&&Ue("A separately declared vertical CRS requires explicit horizontal extraction"),o=!0),{definition:i.definition,spatialReference:n,lossy:o}}function oL(e,t){var o;if(!t)return e;if(t.coordinateFrame!=="unknown"&&t.coordinateFrame!==e.kind)throw new Error("SpatialReference coordinate frame disagrees with its CRS");let r=t.coordinateOrder,n=e.kind==="geocentric"?{x:"e",y:"n",z:"u"}:{longitude:"e",lon:"e",latitude:"n",lat:"n",easting:"e",northing:"n",height:"u",altitude:"u",x:"e",y:"n",z:"u"},i;if(r.length&&(i=r.slice(0,3).map(s=>n[s.toLowerCase()]||"?").join(""),i.length===2&&(i+="u"),(i.length!==3||!i.includes("e")||!i.includes("n")||!i.includes("u"))&&Ue("Unsupported SpatialReference coordinate order"),(r.length>4||r.length>3&&!["m","measure"].includes(r[3]))&&Ue("Unsupported fourth coordinate component")),(o=t.units)!=null&&o.length){let s={m:1,meter:1,metre:1,meters:1,metres:1,km:1e3,ft:.3048,"us-ft":.3048006096012192,degree:Math.PI/180,degrees:Math.PI/180,radian:1,radians:1,grad:Math.PI/200};for(let a=0;a<Math.min(t.units.length,3);a++){let c=(i||"enu")[a]==="u",l=e.kind==="geocentric"?e.toMeter:c?e.verticalUnit:e.kind==="geographic"?e.angularUnit:e.toMeter;(Math.abs((s[t.units[a]]??NaN)-l)>1e-12||s[t.units[a]]===void 0)&&Ue("SpatialReference units disagree with its CRS")}}return Object.freeze({...e,storedAxis:i})}var xx=p(()=>{qa()});function ku(e){var i;if(!((i=e.datumCatalogs)!=null&&i.length))return _x;let t=cL.get(e);if((t==null?void 0:t.catalogs)===e.datumCatalogs)return t.definitions;let r=Object.assign(Object.create(null),_x),n=new Map(Object.entries(_x).map(([o,s])=>[sl(o),{definition:s,owner:-1}]));return e.datumCatalogs.forEach((o,s)=>{if(!o.name||!o.datums)throw new Error("Invalid datum catalogue plugin");for(let[a,c]of Object.entries(o.datums)){let l=sl(a);if(!l||l==="none"||!c||["ellipse","towgs84","nadgrids"].some(h=>c[h]!==void 0&&typeof c[h]!="string"))throw new Error("Invalid datum definition: "+a);let u=n.get(l);if(u&&(u.owner!==s||u.definition.ellipse!==c.ellipse||u.definition.towgs84!==c.towgs84||u.definition.nadgrids!==c.nadgrids))throw new Error("Conflicting datum registration: "+a);n.set(l,{definition:c,owner:s}),r[a]=c}}),cL.set(e,{catalogs:e.datumCatalogs,definitions:r}),r}var sL,aL,_x,cL,sl,Y0=p(()=>{sL={towgs84:"0,0,0",ellipse:"WGS84"},aL={towgs84:"0,0,0",ellipse:"GRS80"},_x={wgs84:sL,WGS84:sL,nad83:aL,North_American_Datum_1983:aL},cL=new WeakMap,sl=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var OK,lL,uL=p(()=>{OK={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,b:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS72:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},lL=OK});var On,fL,hL=p(()=>{On={};On.greenwich=0;On.lisbon=-9.131906111111;On.paris=2.337229166667;On.bogota=-74.080916666667;On.madrid=-3.687938888889;On.rome=12.452333333333;On.bern=7.439583333333;On.jakarta=106.807719444444;On.ferro=-17.666666666667;On.brussels=4.367975;On.stockholm=18.058277777778;On.athens=23.7163375;On.oslo=10.722916666667;fL=On});function Sx(e,t){let r=Object.keys(e).find(n=>mL(n)===mL(t));return r===void 0?void 0:e[r]}function pL(e){if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(e)){let r=Number(e);if(Number.isFinite(r))return r}if(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?r$/i.test(e)){let r=Number(e.slice(0,-1))/At;if(Number.isFinite(r))return r}let t=/^([+-]?)(\d+(?:\.\d*)?)(?:d(?:(\d+(?:\.\d*)?)'(?:(\d+(?:\.\d*)?)")?)?)?([NSEW])?$/i.exec(e);if(t&&(/d/i.test(e)||t[5])){let r=Number(t[3]||0),n=Number(t[4]||0);if(r<60&&n<60){let i=t[1]==="-"?-1:1,o=/[SW]/i.test(t[5]||"")?-1:1,s=i*o*(Number(t[2])+r/60+n/3600);if(Number.isFinite(s))return s}}throw new Error("Invalid angular parameter: "+e)}function Mx(e,t={}){let r=e,n=t.aliases||{},i=new Set;for(;typeof r=="string"&&(Po(n,r)||Po(dL,r));){if(i.has(r))throw new Error("Circular CRS alias: "+r);i.add(r),r=Po(n,r)?n[r]:dL[r]}if(typeof r=="string"){let o=/^EPSG:(326|327)(\d{2})$/.exec(r);o&&Number(o[2])>=1&&Number(o[2])<=60&&(r="+proj=utm +datum=WGS84 +zone="+Number(o[2])+(o[1]==="327"?" +south":"")),(r==="EPSG:5041"||r==="EPSG:5042")&&(r="+proj=stere +datum=WGS84 +lat_0="+(r==="EPSG:5041"?90:-90)+" +k_0=0.994 +x_0=2000000 +y_0=2000000")}return r}function _s(e,t={}){var j;let r=ku(t),n=Wh(e,t),i=Mx(n.definition,t),o;if(wr(i)==="proj-string"&&typeof i=="string"){let I=Object.create(null);for(let O of Mf(i).parameters){if(Po(I,O.name))throw new Error("Duplicate PROJ parameter: +"+O.name);I[O.name]=O.value}o={parameters:I}}else{let I=(j=t.parsers)==null?void 0:j.find(O=>O.canParse(i));if(!I){let O=["wkt","projjson"].includes(wr(i));throw new ai(O?"missing-parser":"unknown-syntax",wr(i)==="identifier"?"Unsupported CRS definition: "+i+"; resolve it first":"Unsupported CRS definition; register a WKT or PROJJSON parser for structured definitions")}o=I.parse(i,t)}let s={...o.parameters};for(let I of["lon_0","lat_0","lat_1","lat_2","lat_ts","lon_wrap","lon_1","lon_2","lonc","alpha","gamma","tilt","azi","o_alpha","o_lon_c","o_lat_c","o_lon_p","o_lat_p","o_lon_1","o_lat_1","o_lon_2","o_lat_2"])s[I]!==void 0&&(s[I]=String(pL(s[I])));let a=s.proj,c=a==null?void 0:a.toLowerCase(),l=c==="geocentric"?"geocent":["longlat","latlong","latlon","lonlat","identity","geocent"].includes(c)?c:a;if(!l)throw new Error("CRS requires +proj");let u=["longlat","latlong","latlon","lonlat"].includes(l)?"geographic":l==="geocent"?"geocentric":l==="identity"?"identity":"projected",h=s.datum,d=h&&h!=="none"?Sx(r,h):void 0;h&&h!=="none"&&!d&&Ue("Unknown datum: "+h+"; register a datumCatalogs plugin");let m=yL(s,d==null?void 0:d.ellipse),g=s.nadgrids??(d==null?void 0:d.nadgrids),y=g===void 0?void 0:g.split(",").map(I=>{let O=I.startsWith("@"),A=O?I.slice(1):I;if(!A||/\s/.test(A))throw new Error("Invalid datum grid name");return Object.freeze({name:A,optional:O})}),b=s.towgs84??(d==null?void 0:d.towgs84),w;if(b!==void 0&&(w=b.split(",").map(I=>re({value:I},"value",NaN)),![3,7].includes(w.length)||w.some(I=>!Number.isFinite(I))||w.length===7&&w[6]<=-1e6))throw new Error("+towgs84 requires three or seven finite values and positive scale");h==="none"&&(w=void 0),y&&h!=="none"&&(w=[0,0,0]);let _=g==="@null"||g==="null"?yL({ellps:"WGS84"}):m,S=s.axis||"enu";if(S.length!==3||!/[ew]/.test(S)||!/[ns]/.test(S)||!/[ud]/.test(S))throw new Error("Invalid axis: "+S);let M=o.angularUnit??At;if(u==="geographic"&&(s.units&&s.units!=="degrees"||Po(s,"to_meter")))throw new Error("Geographic coordinates must use angular units");if(u!=="geographic"&&s.units==="degrees")throw new Error("Linear coordinates require linear units");let v=gL(s,"units","to_meter"),C=o.verticalUnit??gL(s,"vunits","vto_meter");if(!(C>0)||!Number.isFinite(C))throw new Error("Invalid vertical unit");if(!(M>0)||!Number.isFinite(M))throw new Error("Invalid angular unit");let R=s.pm,E=R===void 0?0:(Sx(fL,R)??pL(R))*At;return oL(Object.freeze({kind:u,projection:l,parameters:Object.freeze(s),ellipsoid:m,datum:Object.freeze({ellipsoid:_,towgs84:w&&Object.freeze(w),grids:h==="none"||g==="@null"||g==="null"?void 0:y&&Object.freeze(y)}),areaOfUse:o.areaOfUse,angularUnit:M,toMeter:v,verticalUnit:C,primeMeridian:E,axis:S,longitudeWrap:s.lon_wrap===void 0?void 0:Number(s.lon_wrap)*At,lossy:!!(o.lossy||n.lossy)}),n.spatialReference)}function gL(e,t,r){let n=e[t],i=vf;if(t==="vunits"&&n==="degrees")throw new Error("Height requires linear units");if(n&&!["m","degrees"].includes(n)&&!Po(i,n))throw new Error("Unsupported units: "+n);let o=re(e,r,n&&i[n]?i[n].metersPerUnit:1);if(!(o>0))throw new Error("+"+r+" must be positive");return o}function yL(e,t){let r=t||e.ellps||"WGS84",n=Sx(lL,r);if(!n)throw new Error("Unsupported ellipsoid: "+r);let i=re(e,"a",n.a),o=re(e,"f",NaN),s=re(e,"rf",Number.isNaN(o)?n.rf||0:o===0?0:1/o),a=re(e,"b",s?i*(1-1/s):Po(e,"f")||Po(e,"rf")||Po(e,"a")?i:n.b||i),c=re(e,"R",0);if(i<=0||a<=0||a>i||s<0||s>0&&s<=1||Po(e,"R")&&c<=0||!Number.isNaN(o)&&(o<0||o>=1))throw new Error("Invalid ellipsoid dimensions");return Object.freeze({semiMajorAxis:c||i,semiMinorAxis:c||a,eccentricitySquared:c?0:1-(a/i)**2})}var dL,Z0,bL,Po,mL,Gu=p(()=>{Fl();sy();xx();Wt();Y0();uL();hL();ay();qa();dL={WGS84:"+proj=longlat +datum=WGS84","EPSG:4326":"+proj=longlat +datum=WGS84","EPSG:4269":"+proj=longlat +datum=NAD83","EPSG:4978":"+proj=geocent +datum=WGS84","EPSG:4979":"+proj=longlat +datum=WGS84","EPSG:3857":"+proj=merc +a=6378137 +b=6378137 +nadgrids=@null +units=m","EPSG:3785":"EPSG:3857",GOOGLE:"EPSG:3857","EPSG:900913":"EPSG:3857","EPSG:102113":"EPSG:3857"},Z0=["proj","datum","ellps","a","b","rf","f","R","units","to_meter","vunits","vto_meter","no_defs","type","title","towgs84","nadgrids","geoidgrids","axis","pm","over","lon_wrap"],bL=["no_defs","over"],Po=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),mL=e=>e.toLowerCase().replace(/[\s_-]/g,"")});function e1(e,t){if(Math.abs(e.y)>Math.PI/2)throw new Error("Latitude outside geocentric domain");if(!Af(e,t))throw new Error("Geocentric coordinate must be finite")}function t1(e,t){let r=e.x,n=e.y,i=e.z,{semiMajorAxis:o,semiMinorAxis:s,eccentricitySquared:a}=t;if(r===0&&n===0&&i===0)throw new Error("Geodetic coordinates are undefined at the Earth center");if(a!==0&&Math.abs(r)<1e-12*o&&Math.abs(n)<1e-12*o&&Math.hypot(r,n)<1e-12*o){if(!Number.isFinite(Math.hypot(r,n,i)))throw new Error("Geocentric radius must be finite");e.x=0,e.y=Math.sign(i)*Math.PI/2,e.z=Math.abs(i)-s;return}if(!If(e,t))throw Number.isFinite(Math.hypot(r,n,i))?new Error("Geocentric inverse did not converge"):new Error("Geocentric radius must be finite")}function wL(e,t){let r=e[0],n=e[1],i=e[2],o=(e[3]||0)*vx,s=(e[4]||0)*vx,a=(e[5]||0)*vx,c=1+(e[6]||0)/1e6;return t?l=>{let u=(l.x-r)/c,h=(l.y-n)/c,d=(l.z-i)/c;l.x=u+a*h-s*d,l.y=-a*u+h+o*d,l.z=s*u-o*h+d}:l=>{let u=l.x,h=l.y,d=l.z;l.x=c*(u-a*h+s*d)+r,l.y=c*(a*u+h-o*d)+n,l.z=c*(-s*u+o*h+d)+i}}function Q0(e){var t;return!!((t=e.towgs84)!=null&&t.some(r=>r!==0))}function Tx(e,t){if(!(!e.towgs84||!t.towgs84)){if(e.grids||t.grids){if(e.grids&&t.grids&&e.ellipsoid.semiMajorAxis===t.ellipsoid.semiMajorAxis&&e.ellipsoid.eccentricitySquared===t.ellipsoid.eccentricitySquared&&e.grids.length===t.grids.length&&e.grids.every((n,i)=>n.name===t.grids[i].name&&n.optional===t.grids[i].optional&&n.grid===t.grids[i].grid))return;let r=Tx(e.grids?J0:e,t.grids?J0:t);return n=>{e.grids&&xL(n,e,!1),r==null||r(n),t.grids&&xL(n,t,!0)}}if(Q0(e)||Q0(t)){let r=Ex(e,J0),n=Ex(J0,t);return i=>{r==null||r(i),n==null||n(i)}}return Ex(e,t)}}function Ex(e,t){if(!e.towgs84||!t.towgs84)return;let r=e.ellipsoid,n=t.ellipsoid,i=!0;for(let a=0;a<7;a++)(e.towgs84[a]||0)!==(t.towgs84[a]||0)&&(i=!1);if(r.semiMajorAxis===n.semiMajorAxis&&Math.abs(r.eccentricitySquared-n.eccentricitySquared)<=5e-11&&i)return;let o=Q0(e)?wL(e.towgs84,!1):void 0,s=Q0(t)?wL(t.towgs84,!0):void 0;return a=>{e1(a,r),o==null||o(a),s==null||s(a),t1(a,n)}}function xL(e,t,r){for(let n of t.grids){if(n.name==="null")return;if(!n.grid){if(n.optional)continue;throw new Error("Required datum grid is not registered: "+n.name)}let i=!1;if(n.grid.shiftInPlace)i=n.grid.shiftInPlace(e,r);else{let o=n.grid.shift(e.x,e.y,r);o&&(e.x=o[0],e.y=o[1],i=!0)}if(i){if(!Number.isFinite(e.x)||!Number.isFinite(e.y)||Math.abs(e.y)>Math.PI/2)throw new Error("Datum grid produced a coordinate outside the geographic domain");return}}throw new Error("No datum grid covers coordinate: "+t.grids.map(n=>n.name).join(","))}function _L(e,t){let r={x:e[0],y:e[1],z:e[2]};return e1(r,t),[r.x,r.y,r.z]}function SL(e,t){let r={x:e[0],y:e[1],z:e[2]};return t1(r,t),[r.x,r.y,r.z]}var vx,J0,Ax=p(()=>{Fn();vx=Math.PI/(180*3600),J0={ellipsoid:{semiMajorAxis:6378137,semiMinorAxis:6356752314245179e-9,eccentricitySquared:.0066943799901413165},towgs84:[0,0,0]}});function Va(e,t=0){let r=re(e,"lon_wrap",0)*At;return n=>ur(i=>{let o=Cr(i,r);return[[r+o[0],i[0][1],0],[r+o[1],i[1][1],0]]},n??[-180,-90,180,90],r,t)}var Hh=p(()=>{Wt();ut();Ct()});function ML(e,t={}){if(e===void 0)return;let r=[];for(let n of e.split(",")){let i=n.startsWith("@"),o=i?n.slice(1):n;if(!o||/\s/.test(o))throw new Error("Invalid vertical grid name");if(o==="null"){r.push(null);break}let s=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(s){if(typeof s.getOffset!="function")throw new Error("Invalid vertical grid: "+o);r.push(s.getOffset.bind(s))}else i||Ue("Required vertical grid is not registered: "+o)}return(n,i)=>{for(let o of r){if(!o)return 0;let s=o(n,i);if(s!==void 0){if(!Number.isFinite(s))throw new Error("Vertical grid returned a non-finite offset");return s}}throw new Error("No vertical grid covers this coordinate")}}var vL=p(()=>{qa()});function Ix(e){let t=Object.freeze({...e.ellipsoid});return Object.freeze({kind:e.kind,projection:e.projection,parameters:Object.freeze(Object.fromEntries(Object.entries(e.parameters).map(([r,n])=>[r,n??null]))),ellipsoid:t,datum:Object.freeze({ellipsoid:Object.freeze({...e.datum.ellipsoid}),towgs84:e.datum.towgs84&&Object.freeze([...e.datum.towgs84]),grids:e.datum.grids&&Object.freeze(e.datum.grids.map(r=>Object.freeze({name:r.name,optional:r.optional,loaded:!!r.grid})))}),angularUnit:e.angularUnit,toMeter:e.toMeter,verticalUnit:e.verticalUnit,primeMeridian:e.primeMeridian,axis:e.axis,storedAxis:e.storedAxis,longitudeWrap:e.longitudeWrap,areaOfUse:e.areaOfUse&&Object.freeze([...e.areaOfUse]),lossy:e.lossy,algorithm:e.algorithm&&Object.freeze({...e.algorithm})})}function EL(e,t,r,n){let i=[];return e.algorithm||i.push("source-algorithm"),t.algorithm||i.push("target-algorithm"),(e.datum.grids||t.datum.grids||e.parameters.geoidgrids||t.parameters.geoidgrids)&&i.push("grid-resource"),Object.freeze({version:1,source:e,target:t,forward:r,inverse:n,lossy:e.lossy||t.lossy,complete:i.length===0,opaqueReasons:Object.freeze(i)})}var TL=p(()=>{});function AL(e){let t=LL(e.projections||[]),r=new Set;for(let n of[e.from??"WGS84",e.to??"WGS84"]){let i=_s(n,e);if(["geographic","identity"].includes(i.kind))continue;let o=t.get(n1(i.projection));if(!o)throw new ai("missing-plugin","Projection plugin is not registered: "+i.projection);r.add(o)}return[...r]}function LL(e){let t=new Map;for(let r of e)for(let n of new Set([r.name,...r.aliases||[]].map(n1))){if(!n||["longlat","latlong","latlon","lonlat","identity"].includes(n)||t.has(n))throw new Error("Duplicate or reserved projection plugin: "+n);t.set(n,r)}return t}function IL(e,t,r){var g;let n=_s(e,r),i=t.get(n1(n.projection));if(!["geographic","identity"].includes(n.kind)&&!i)throw new ai("missing-plugin","Projection plugin is not registered: "+n.projection);let o=new Set([...Z0,...(i==null?void 0:i.parameters)||[]]);for(let y of Object.keys(n.parameters)){if(!o.has(y))throw new ai("missing-transform-stage","Unsupported PROJ parameter: +"+y);let b=bL.includes(y)||((g=i==null?void 0:i.flags)==null?void 0:g.includes(y));if(b&&n.parameters[y]!==void 0)throw new Error("Expected a flag without a value: +"+y);if(!b&&!n.parameters[y])throw new Error("PROJ parameter requires a value: +"+y)}if(n.parameters.type&&n.parameters.type!=="crs")throw new Error("Only +type=crs is supported");let s=n1(n.projection)==="fasttransversemercator"?Object.freeze({...n.parameters,approx:void 0}):n.parameters,a=i==null?void 0:i.create({...n.ellipsoid,parameters:s,primeMeridian:n.primeMeridian});if(n.kind==="geocentric"&&(!(a!=null&&a.forward3D)||!(a!=null&&a.inverse3D)))throw new Error("Geocentric plugin must implement 3D operations");let c=n.datum.grids,l=(c==null?void 0:c.findIndex(y=>y.name==="null"))??-1,u=c==null?void 0:c.slice(0,l<0?void 0:l+1).map(y=>{let b=Object.prototype.hasOwnProperty.call(r.datumGrids||{},y.name)?r.datumGrids[y.name]:void 0;if(b&&typeof b.shift!="function")throw new Error("Invalid prepared datum grid: "+y.name);return Object.freeze({...y,grid:b})});for(let y of u||[]){if(y.name==="null")break;!y.optional&&!y.grid&&Ue("Required datum grid is not registered: "+y.name)}let h=u?Object.freeze({...n.datum,grids:Object.freeze(u)}):n.datum,d=ML(n.parameters.geoidgrids,r.verticalGrids);d&&(n.kind==="geocentric"||n.kind==="identity"||n.lossy)&&Ue("Vertical grids require a non-lossy geographic or projected CRS");let m=i?i.semantics:{id:"@math.gl/geospatial/"+n.kind,version:1};return{...n,datum:h,implementation:a,verticalGrid:d,algorithm:m}}function Px(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function PL(e,t){if(e==="enu")return;let r=[0,0,0],n=[0,0,0];for(let i=0;i<3;i++){let o=e[i],s="ew".includes(o)?0:"ns".includes(o)?1:2;r[t?i:s]=t?s:i,n[t?i:s]="wsd".includes(o)?-1:1}return i=>{let o=i.x,s=i.y,a=i.z;i.x=n[0]*(r[0]===0?o:r[0]===1?s:a),i.y=n[1]*(r[1]===0?o:r[1]===1?s:a),i.z=n[2]*(r[2]===0?o:r[2]===1?s:a)}}function RL(e,t,r){var C,R,E,j;let n=e.storedAxis||(r?e.axis:"enu"),i=t.storedAxis||(r?t.axis:"enu"),o=PL(n,!1),s=PL(i,!0),a=e.implementation&&Vo(e.implementation,!0,e.kind==="geocentric"),c=t.implementation&&Vo(t.implementation,!1,t.kind==="geocentric"),l=Tx(e.datum,t.datum),u=e.lossy||t.lossy,h=e.kind==="geocentric",d=e.kind==="geographic"?e.angularUnit:e.toMeter,m=t.kind==="geographic"?t.angularUnit:t.toMeter,g=h?1:e.verticalUnit,y=t.kind==="geocentric"?m:t.verticalUnit,b=e.primeMeridian,w=t.primeMeridian,_=t.kind==="geographic"?t.longitudeWrap:void 0,S;if(!l&&!e.verticalGrid&&!t.verticalGrid&&!u&&!o&&!s&&!b&&!w&&e.verticalUnit===1&&t.verticalUnit===1&&_===void 0){let I=Object.freeze({inputScale:d,outputScale:m});e.kind==="geographic"&&t.kind==="projected"&&(S=(R=(C=t.implementation)==null?void 0:C.createForwardFlat)==null?void 0:R.call(C,I)),e.kind==="projected"&&t.kind==="geographic"&&(S=(j=(E=e.implementation)==null?void 0:E.createInverseFlat)==null?void 0:j.call(E,I))}let M=!!(e.verticalGrid||t.verticalGrid)||e.kind==="geocentric"||/[ud]/.test(n.slice(0,2))||/[ud]/.test(i.slice(0,2)),v=[];return o&&v.push("input-axis"),u&&v.push("discard-height"),d!==1&&v.push("input-scale"),a&&v.push("source-inverse"),g!==1&&v.push("input-height-scale"),v.push("geographic-domain-check"),b&&v.push("source-prime-meridian"),e.verticalGrid&&v.push("source-vertical-grid"),l&&v.push("datum"),t.verticalGrid&&v.push("target-vertical-grid"),w&&v.push("target-prime-meridian"),_!==void 0&&v.push("longitude-wrap"),c&&v.push("target-forward"),m!==1&&v.push("output-scale"),y!==1&&v.push("output-height-scale"),u&&v.push("restore-height"),s&&v.push("output-axis"),{description:Object.freeze({inputAxis:n,outputAxis:i,requiresInputZ:M,geocentricOutput:t.kind==="geocentric",stages:Object.freeze(v)}),flat:S,requiresInputZ:M,geocentricOutput:t.kind==="geocentric",run(I){if(!Px(I))throw new Error("Coordinates must contain finite x, y and optional z values");o==null||o(I);let O=I.z;if(u&&(I.z=0),d!==1&&(I.x*=d,I.y*=d,h&&(I.z*=d)),a==null||a(I),g!==1&&(I.z*=g),Math.abs(I.y)>Math.PI/2||!Px(I))throw new Error("Coordinate is outside the geographic domain");if(I.x+=b,e.verticalGrid&&(I.z+=e.verticalGrid(I.x,I.y)),l==null||l(I),t.verticalGrid&&(I.z-=t.verticalGrid(I.x,I.y)),I.x-=w,_!==void 0&&(I.x=_+Yt(I.x-_)),c==null||c(I),m!==1&&(I.x/=m,I.y/=m),y!==1&&(I.z/=y),u&&(I.z=O),s==null||s(I),!Px(I))throw new Error("Projection produced non-finite coordinates")}}}function Uu(e,t,r,n){if(e.length<2)throw new Error("Coordinates must contain finite x, y and optional z values");if(e.length<3&&t.requiresInputZ)throw new Error("This transform requires three ordinates");let i=Math.max(e.length,t.geocentricOutput?3:2),o=r.acquire();try{if(o.x=e[0],o.y=e[1],o.z=e.length>=3?e[2]:0,t.run(o),n)return Vh(e,n,o,i);let s=e.slice();return s[0]=o.x,s[1]=o.y,(e.length>=3||t.geocentricOutput)&&(s[2]=o.z),s}finally{r.release(o)}}function r1(e,t,r,n){if(!(e instanceof Float32Array||e instanceof Float64Array))throw new Error("In-place projection requires a Float32Array or Float64Array");if(!Number.isSafeInteger(t)||t<2||e.length%t!==0)throw new Error("Dimension must be an integer >= 2 and divide the typed array length");if(t<3&&(r.requiresInputZ||r.geocentricOutput))throw new Error("This transform requires a dimension of at least 3");if(r.flat)return r.flat(e,t),e;let i=n.acquire();try{let o=e instanceof Float32Array;for(let s=0;s<e.length;s+=t){if(i.x=e[s],i.y=e[s+1],i.z=t>=3?e[s+2]:0,r.run(i),o&&(Math.abs(i.x)>34028234663852886e22||Math.abs(i.y)>34028234663852886e22||t>=3&&Math.abs(i.z)>34028234663852886e22))throw new Error("Projected coordinate exceeds Float32 range");e[s]=i.x,e[s+1]=i.y,t>=3&&(e[s+2]=i.z)}return e}finally{n.release(i)}}var $h,n1,OL=p(()=>{uc();QR();rL();fc();Cm();wx();Gu();qa();Ax();Wt();Hh();vL();TL();$h=class e{static async create(t={}){let r=await Promise.all(AL(t).map(tL));return new e({...t,projections:r})}get targetProfile(){return this.getTargetRenderingProfile(this.targetCoverage)}getTargetRenderingProfile(t){return this.targetRenderingProfile&&A8(this.targetRenderingProfile,t)}get description(){var t,r;return((r=(t=this.deferred)==null?void 0:t.implementation)==null?void 0:r.description)??this.resolvedDescription}constructor(t={}){var i,o,s;this.coordinateScratch=new Ns,this.targetLongitudeOrigin=0;let r=t.projections||[],n=LL(r);if(r.some(a=>!("create"in a))){let a=_s(t.from??"WGS84",t),c=_s(t.to??"WGS84",t);this.lossy=a.lossy||c.lossy,this.deferred={options:{...t,projections:[...r]}}}else{let a=t,c=n,l=IL(a.from??"WGS84",c,a),u=IL(a.to??"WGS84",c,a);this.targetRenderingProfile=((o=(i=u.implementation)==null?void 0:i.getRenderingProfile)==null?void 0:o.bind(u.implementation))??(u.kind==="geographic"?Va(u.parameters,u.primeMeridian):u.kind==="identity"?JR:void 0),this.targetCoverage=u.areaOfUse,this.targetLongitudeOrigin=((s=u.implementation)==null?void 0:s.longitudeOrigin)??(u.kind==="geographic"?u.longitudeWrap??0:0),this.lossy=l.lossy||u.lossy,this.lossy&&(l.kind==="geocentric"||u.kind==="geocentric")&&Ue("Horizontal extraction cannot supply ellipsoidal height for geocentric coordinates"),this.lossy&&(l.verticalGrid||u.verticalGrid)&&Ue("Horizontal extraction cannot be combined with vertical grids"),this.forwardTransform=RL(l,u,!!t.enforceAxis),this.inverseTransform=RL(u,l,!!t.enforceAxis),this.resolvedDescription=EL(Ix(l),Ix(u),this.forwardTransform.description,this.inverseTransform.description)}this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectTo=this.projectTo.bind(this),this.unprojectTo=this.unprojectTo.bind(this),this.projectToSync=this.projectToSync.bind(this),this.unprojectToSync=this.unprojectToSync.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this),this.projectSync=this.projectSync.bind(this),this.unprojectSync=this.unprojectSync.bind(this),this.projectFlatSync=this.projectFlatSync.bind(this),this.unprojectFlatSync=this.unprojectFlatSync.bind(this)}load(){let t=this.deferred;return t?t.implementation?Promise.resolve(t.implementation):(t.pending||(t.pending=e.create(t.options).then(r=>(t.implementation=r,r)).catch(r=>{throw t.pending=void 0,r})),t.pending):Promise.resolve(this)}loadSync(){let t=this.deferred;if(!t)return this;if(!t.implementation){let r=AL(t.options).map(n=>{let i=eL(n);if(!i)throw new Error("Projection is not preloaded: "+n.name+". Call preload() first.");return i});t.implementation=new e({...t.options,projections:r})}return t.implementation}projectSync(t){return this.deferred?this.loadSync().project(t):Uu(t,this.forwardTransform,this.coordinateScratch)}unprojectSync(t){return this.deferred?this.loadSync().unproject(t):Uu(t,this.inverseTransform,this.coordinateScratch)}projectFlatSync(t,r=2){return this.deferred?this.loadSync().projectFlat(t,r):r1(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlatSync(t,r=2){return this.deferred?this.loadSync().unprojectFlat(t,r):r1(t,r,this.inverseTransform,this.coordinateScratch)}async preload(){await this.load()}project(t){return this.deferred?this.projectLoaded(t,!1):Uu(t,this.forwardTransform,this.coordinateScratch)}unproject(t){return this.deferred?this.projectLoaded(t,!0):Uu(t,this.inverseTransform,this.coordinateScratch)}projectTo(t,r){return this.deferred?this.projectToLoaded(t,r,!1):this.projectToSync(t,r)}unprojectTo(t,r){return this.deferred?this.projectToLoaded(t,r,!0):this.unprojectToSync(t,r)}projectToSync(t,r){return this.deferred?this.loadSync().projectTo(t,r):(ol(t,r,Math.max(t.length,this.forwardTransform.geocentricOutput?3:2)),Uu(t,this.forwardTransform,this.coordinateScratch,r))}unprojectToSync(t,r){return this.deferred?this.loadSync().unprojectTo(t,r):(ol(t,r,Math.max(t.length,this.inverseTransform.geocentricOutput?3:2)),Uu(t,this.inverseTransform,this.coordinateScratch,r))}projectToLoaded(t,r,n){ol(t,r,t.length);let i=t.slice();return this.load().then(o=>n?o.unprojectTo(i,r):o.projectTo(i,r))}projectLoaded(t,r){let n=t.slice();return this.load().then(i=>r?i.unproject(n):i.project(n))}projectFlat(t,r=2){return this.deferred?this.load().then(i=>i.projectFlat(t,r)):r1(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlat(t,r=2){return this.deferred?this.load().then(i=>i.unprojectFlat(t,r)):r1(t,r,this.inverseTransform,this.coordinateScratch)}};n1=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var i1,CL=p(()=>{i1=class{constructor(t){this.sample=t,this.result=[0,0,0],this.samples=Array.from({length:4},()=>[0,0,0]),this.coarse=[0,0,0],this.fine=[0,0,0]}evaluate(t,r,n=1e-6){if(!this.difference(t,this.coarse)||!this.difference(t/2,this.fine))return!1;let i=n*Math.max(r,Math.abs(this.fine[0]),Math.abs(this.fine[1]),Math.abs(this.fine[2]));for(let o=0;o<3;o++)if(Math.abs(this.coarse[o]-this.fine[o])>i||(this.fine[o]+=(this.fine[o]-this.coarse[o])/15,!Number.isFinite(this.fine[o])))return!1;for(let o=0;o<3;o++)this.result[o]=this.fine[o];return!0}difference(t,r){let[n,i,o,s]=this.samples;if(!this.sample(-2*t,n)||!this.sample(-t,i)||!this.sample(t,o)||!this.sample(2*t,s))return!1;for(let a=0;a<3;a++)if(r[a]=(n[a]-s[a]+8*(o[a]-i[a]))/(12*t),!Number.isFinite(r[a]))return!1;return!0}}});function Rx(e){if(e.length!==3||e.some(t=>!Number.isFinite(t)||t<=0))throw new Error("Invalid CRS rendering scale");return e}function DL(e,t,r,n){if(e.kind==="geocentric")return Rx([e.toMeter,e.toMeter,e.toMeter]);if(e.kind==="identity")return Rx([...r].map(g=>/[ud]/.test(g)?e.verticalUnit:e.toMeter));let i=[0,0,0],o=[0,0,0],s=[0,0,0],a=[0,0,0],c=Array.from({length:3},()=>[0,0,0]),l=0,u=0,h=0,d=!1,m=new i1((g,y)=>{for(let _=0;_<3;_++)o[_]=i[_];o[l]+=g,t.unprojectTo(o,a);let b=a[0]-s[0],w=Math.abs(b)<=180?b:((b+180)%360+360)%360-180;return Math.abs(a[1])>=90?!1:(y[0]=w*u,y[1]=(a[1]-s[1])*h,y[2]=a[2]-s[2],y.every(Number.isFinite))});return g=>{if(d||g.length<2)return null;d=!0;let y;try{if(i[0]=g[0],i[1]=g[1],i[2]=g[2]??0,!i.every(Number.isFinite))return null;t.unprojectTo(i,s);let b=s[1]*Kh,w=BL.semiMajorAxis,_=BL.eccentricitySquared,S=1-_*Math.sin(b)**2;if(u=w*Math.cos(b)/Math.sqrt(S)*Kh,h=w*(1-_)/S**1.5*Kh,!(u>w*Kh*1e-8)||!(h>0))return null;let M=((s[0]-n+180)%360+360)%360-180;if((e.kind==="geographic"?e.longitudeWrap!==void 0:!Object.prototype.hasOwnProperty.call(e.parameters,"over"))&&Math.abs(M)+2/u>=180||Math.abs(s[1])+2/h>=90)return null;for(l=0;l<3;l++){let C=r[l],R=/[ud]/.test(C)?e.verticalUnit:e.kind==="geographic"?(/[ew]/.test(C)?u:h)*e.angularUnit/Kh:e.toMeter;if(!m.evaluate(1/R,R))return null;for(let E=0;E<3;E++)c[l][E]=m.result[E]}if(y=c.map(C=>Math.hypot(...C)),e.kind==="projected"){let C=c[r.search(/[ew]/)],R=c[r.search(/[ns]/)],E=Math.abs(C[0]*R[1]-C[1]*R[0])/e.toMeter**2;y[r.search(/[ud]/)]=e.verticalUnit*Math.sqrt(E)}}catch{return null}finally{d=!1}return Rx(y)}}var Kh,BL,NL=p(()=>{CL();Gu();Kh=Math.PI/180,BL=_s("WGS84").ellipsoid});async function jL(e,t,r,n={},i=!1,o){let s=typeof t=="string"?t:JSON.parse(JSON.stringify(t)),a={enforceAxis:r.enforceAxis,mode:r.mode,...n,converters:n.converters&&[...n.converters]},c=o?await o(s,{...r,...a}):s,l=_s(c,{...r,...a}),u=await e.createProjectionAsync({...a,from:"WGS84",to:c}),h=l.storedAxis||(a.enforceAxis?l.axis:"enu"),d=UL(l.kind==="geographic"?l.angularUnit:l.toMeter,l.kind==="geographic"),m=UL(l.verticalUnit,!1),g=[...h].map(E=>l.kind!=="geocentric"&&/[ud]/.test(E)?m:d),y=u.targetProfile;if(!y)throw new Error("Projection must define a rendering profile for CRS retrieval");let b=(u.targetLongitudeOrigin+l.primeMeridian)*180/Math.PI,w=NK(y,l,h),_=DK(y.normalize),S=DL(l,u,h,b),M=[...new Set(["WGS84",...a.converters||[]])];if(M.some(E=>typeof E!="string"||!E.trim()))throw new Error("Converter source CRS must be a nonempty string");let v=await Promise.all(M.map(async E=>{if(E==="WGS84")return[E,kL(u,_)];let[j,I]=await Promise.all([e.createProjectionAsync({...a,from:E,to:c}),e.createProjectionAsync({...a,from:"WGS84",to:E})]);return[E,kL(j,BK(I,_))]})),C=Object.assign(Object.create(null),Object.fromEntries(v)),R={coordinateFrame:l.kind,projection:l.projection,parameters:l.parameters,ellipsoid:{semiMajorAxis:l.ellipsoid.semiMajorAxis,semiMinorAxis:l.ellipsoid.semiMinorAxis},axis:h,xUnit:g[0],yUnit:g[1],zUnit:g[2],areaOfUse:l.areaOfUse,lossy:l.lossy};return{...R,signature:i&&typeof c=="string"&&!a.enforceAxis&&!l.lossy?c:TE(R),renderingBounds:w,renderingScale:S,getRenderingScale:E=>typeof S=="function"?S(E):S,converter:C}}function kL(e,t){return{from:GL(e.project.bind(e),e.projectTo.bind(e)),to:GL(e.unproject.bind(e),e.unprojectTo.bind(e)),normalize:t}}function BK(e,t){function r(n,i){i!==void 0&&ol(n,i,n.length);let o=e.unproject(Array.from(n)),[s,a,c]=o;return t(o,o),o[0]===s&&o[1]===a&&o[2]===c?i===void 0?Array.from(n):Vh(n,i,{x:n[0],y:n[1],z:n[2]??0},n.length):i===void 0?e.project(o):e.projectTo(o,i)}return r}function GL(e,t){function r(n,i){return i===void 0?e(Array.isArray(n)?n:Array.from(n)):t(n,i)}return r}function DK(e){function t(r,n){let i=n??new Array(r.length);ol(r,i,r.length);let o=r[0],s=r[1],a=r[2]??0;if(r.length<2||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(a))throw new Error("Normalization requires finite longitude, latitude and altitude");let c={x:o,y:s,z:a};return e==null||e(c),Vh(r,i,c,r.length)}return t}function NK(e,t,r){let n=t.kind==="geographic"?t.angularUnit:t.toMeter,i=[n,n,t.kind==="geocentric"?t.toMeter:t.verticalUnit],o=e.bounds,s=[...r].map(a=>{let c=/[ew]/.test(a)?0:/[ns]/.test(a)?1:2,l=o[0][c]/i[c],u=o[1][c]/i[c];return/[wsd]/.test(a)?[-u,-l]:[l,u]});return[[s[0][0],s[1][0],s[2][0]],[s[0][1],s[1][1],s[2][1]]]}function UL(e,t){let r=t?FL:CK,n=Object.keys(r).find(i=>r[i]===e)||"custom";return t?{name:n,degreesPerUnit:e/FL.degrees}:{name:n,metersPerUnit:e}}var FL,CK,zL=p(()=>{Gu();NL();wx();ay();FL={degrees:Math.PI/180,radians:1,gradians:Math.PI/200},CK={...Object.fromEntries(Object.values(vf).map(e=>[e.name,e.metersPerUnit]))}});function qL(e){return{...e,projections:e.projections&&[...e.projections],parsers:e.parsers&&[...e.parsers],datumCatalogs:e.datumCatalogs&&[...e.datumCatalogs],aliases:e.aliases&&JSON.parse(JSON.stringify(e.aliases)),datumGrids:e.datumGrids&&{...e.datumGrids},verticalGrids:e.verticalGrids&&{...e.verticalGrids}}}function Xh(e){return!!(e.projections||e.parsers||e.datumCatalogs||e.aliases||e.datumGrids||e.verticalGrids||e.resolver)}var Lx=p(()=>{});async function WL(e){let t={...e,from:VL(e.from??"WGS84"),to:VL(e.to??"WGS84")},[r,n]=await Promise.all([o1(t.from,t),o1(t.to,t)]);return{...t,from:r,to:n}}async function o1(e,t){var u;let r=Wh(e,t),n=Mx(r.definition,t),i=typeof e=="string"||"type"in e?void 0:"crs"in e?e.crs:e,o=n===r.definition&&i?i.representation:wr(n);if(o!=="identifier"||(u=t.parsers)!=null&&u.some(h=>h.canParse(n)))return e;let s=await t.resolver.resolve({state:"explicit",provenance:(i==null?void 0:i.provenance)??"unknown",definition:n,representation:o}),a=Wh(s.input,t).definition;if(!i)return a;let c=e,l={...i,definition:a,representation:wr(a),alternatives:[{definition:i.definition,representation:i.representation},...i.alternatives??[]]};return"crs"in c?{...c,crs:l}:l}function VL(e){return typeof e=="string"?e:JSON.parse(JSON.stringify(e))}var HL=p(()=>{Fl();Gu();xx()});var s1,$L=p(()=>{zL();Lx();HL();OL();Lx();s1=class{constructor(t={}){this.options=qL(t),this.useDefinitionSignature=!Xh(t)}getCRS(t,r={}){return jL(this,t,this.options,r,this.useDefinitionSignature,this.options.resolver?o1:void 0)}createProjection(t={}){return new $h({...this.options,...t})}async createProjectionAsync(t={}){let r={...this.options,...t};return $h.create(r.resolver?await WL(r):r)}}});var KL=p(()=>{});var Ox,XL=p(()=>{Xl();Wt();et();ut();Ct();Ox={name:"merc",semantics:{id:"@math.gl/geospatial/merc",version:1},aliases:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A"],parameters:["lon_0","lat_ts","k","k_0","x_0","y_0"],create({semiMajorAxis:e,eccentricitySquared:t,parameters:r,primeMeridian:n=0}){let i=Math.sqrt(t),o=Object.prototype.hasOwnProperty.call(r,"over"),s=re(r,"lon_0",0)*At,a=re(r,"x_0",0),c=re(r,"y_0",0),l=re(r,"k_0",re(r,"k",1));if(Object.prototype.hasOwnProperty.call(r,"lat_ts")){let g=Rf(r,"lat_ts");l=Math.cos(g)/Math.sqrt(1-t*Math.sin(g)**2)}if(l<=0)throw new Error("Mercator scale must be positive");let u=e*l,h=Math.atan(Math.sinh(Math.PI)),d=u*Math.PI,m=u*(Math.PI-i*Math.atanh(i*Math.sin(h)));return{longitudeOrigin:s,getRenderingProfile(g){if(g){let b=g[1]<=-90||g[3]>=90,w=[g[0],b?Math.max(-h*180/Math.PI,Math.min(h*180/Math.PI,g[1])):g[1],g[2],b?Math.max(-h*180/Math.PI,Math.min(h*180/Math.PI,g[3])):g[3]],_=S=>c+u*(Math.asinh(Math.tan(S))-i*Math.atanh(i*Math.sin(S)));return ur(S=>lt(Be([a,a],Fe(Cr(S,s,o),u)),[_(S[0][1]),_(S[1][1])]),w,s,n,o)}let y=[[a-d,c-m,0],[a+d,c+m,0]];return{bounds:y,normalize:ur(()=>y,kn(Q(s-Math.PI,-h,s+Math.PI,h),n),s,n,o).normalize}},...Ci(g=>{let y=g.x,b=g.y;if(Math.abs(b)>=Math.PI/2)throw new Error("Mercator is undefined at the poles");let w=Math.asinh(Math.tan(b));g.x=a+u*Yt(y-s,o),g.y=c+u*(i===0?w+0:w-i*Math.atanh(i*Math.sin(b)))},g=>{let y=g.x,w=(g.y-c)/u,_=Math.atan(Math.sinh(w));if(i===0){g.x=Yt(s+(y-a)/u,o),g.y=_+0;return}for(let S=0;S<30;S++){let M=Math.atan(Math.sinh(w+i*Math.atanh(i*Math.sin(_))));if(Math.abs(M-_)<1e-13){g.x=Yt(s+(y-a)/u,o),g.y=M;return}_=M}throw new Error("Mercator inverse did not converge")})}}}});var Cx,YL=p(()=>{fc();Wt();et();ut();Ct();Cx={name:"eqc",semantics:{id:"@math.gl/geospatial/eqc",version:1},aliases:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical"],parameters:["lon_0","lat_0","lat_ts","x_0","y_0"],create({semiMajorAxis:e,parameters:t,primeMeridian:r=0}){let n=Object.prototype.hasOwnProperty.call(t,"over"),i=re(t,"lon_0",0)*At,o=Rf(t,"lat_0"),s=Math.cos(Rf(t,"lat_ts")),a=re(t,"x_0",0),c=re(t,"y_0",0),l=e*Math.abs(s)*Math.PI;return{longitudeOrigin:i,getRenderingProfile(u){if(u)return ur(d=>lt(Be([a,a],Fe(Cr(d,i,n),e*s)),[c+e*(d[0][1]-o),c+e*(d[1][1]-o)]),u,i,r,n);let h=[[a-l,c+e*(-Math.PI/2-o),0],[a+l,c+e*(Math.PI/2-o),0]];return{bounds:h,normalize:ur(()=>h,kn(Q(i-Math.PI,-(Math.PI/2),i+Math.PI,Math.PI/2),r),i,r,n).normalize}},...pi(u=>{u.x=a+e*s*Yt(u.x-i,n),u.y=c+e*(u.y-o)},u=>{u.x=Yt(i+(u.x-a)/(e*s),n),u.y=o+(u.y-c)/e})}}}});function FK(e){if(e.k0||(e.k0=1),e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,!(Math.abs(e.lat1+e.lat2)<1e-10)){var t=e.b/e.a;e.e=Math.sqrt(1-t*t);var r=Math.sin(e.lat1),n=Math.cos(e.lat1),i=xn(e.e,r,n),o=Qr(e.e,e.lat1,r),s=Math.sin(e.lat2),a=Math.cos(e.lat2),c=xn(e.e,s,a),l=Qr(e.e,e.lat2,s),u=Qr(e.e,e.lat0,Math.sin(e.lat0));Math.abs(e.lat1-e.lat2)>1e-10?e.ns=Math.log(i/c)/Math.log(o/l):e.ns=r,Number.isNaN(e.ns)&&(e.ns=r),e.f0=i/(e.ns*Math.pow(o,e.ns)),e.rh=Math.abs(Math.abs(e.lat0)-F)<1e-10?0:e.a*e.f0*Math.pow(u,e.ns)}}function ZL(e,t){var r=t.x,n=t.y,i=Math.abs(Math.abs(n)-F),o,s;if(i>1e-10)o=e.sphere?1/Math.tan(Math.PI/4+n/2):Qr(e.e,n,Math.sin(n)),s=e.a*e.f0*Math.pow(o,e.ns);else{if(i=n*e.ns,i<=0)return null;s=0}var a=e.ns*G(r-e.long0,e.over);return t.x=e.k0*(s*Math.sin(a))+e.x0,t.y=e.k0*(e.rh-s*Math.cos(a))+e.y0,t}function JL(e,t){var r,n,i,o,s,a=(t.x-e.x0)/e.k0,c=e.rh-(t.y-e.y0)/e.k0;e.ns>0?(r=Math.sqrt(a*a+c*c),n=1):(r=-Math.sqrt(a*a+c*c),n=-1);var l=0;if(r!==0&&(l=Math.atan2(n*a,n*c)),r!==0||e.ns>0){if(n=1/e.ns,i=Math.pow(r/(e.a*e.f0),n),o=gc(e.e,i),o===-9999)return null}else o=-F;return s=G(l/e.ns+e.long0,e.over),t.x=s,t.y=o,t}function QL(e){let t={...e,ns:0,f0:0,rh:0};return FK(t),t}var eO=p(()=>{Jl();Nf();_t();Um();Bt()});var Bx,tO=p(()=>{Ct();et();ut();Xl();Gn();eO();Bx={name:"lcc",aliases:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],parameters:[...Er,...Wo,"lat_1","lat_2"],create(e){let t=xr(e);Kl(t,e.parameters);let r=QL(t),n=fr("lcc",r,ZL,JL),i={...Ci(o=>{let s=o.y;if(Math.abs(s)===Math.PI/2&&s*r.ns<0)throw new Error("Lambert conformal conic is undefined at the opposite pole");n.forwardInPlace(o)},n.inverseInPlace)};return De(i,Q(t.long0-Math.PI,r.ns>0?-Math.PI/3:-Math.PI/2,t.long0+Math.PI,r.ns>0?Math.PI/2:Math.PI/3),o=>$l(i.forward,o,t.long0,r.ns,r.x0,r.y0+r.k0*r.rh,t.over),t.primeMeridian,t.over)}}});function fn(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var Yh=p(()=>{});function a1(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));let n=4*Number.EPSILON*r;if(Math.abs(t)>r+n)return NaN;if(Math.abs(Math.abs(t)-r)<=n)return t<0?-1*F:F;for(var i=Math.asin(.5*t),o,s,a,c,l=0;l<30;l++)if(s=Math.sin(i),a=Math.cos(i),c=e*s,o=Math.pow(1-c*c,2)/(2*a)*(t/(1-e*e)-s/(1-c*c)+.5/e*Math.log((1-c)/(1+c))),i+=o,Math.abs(o)<=1e-10)return i;return NaN}var Dx=p(()=>{Bt()});function kK(e){Math.abs(e.lat1+e.lat2)<1e-10||(e.temp=e.b/e.a,e.es=1-Math.pow(e.temp,2),e.e3=Math.sqrt(e.es),e.sin_po=Math.sin(e.lat1),e.cos_po=Math.cos(e.lat1),e.t1=e.sin_po,e.con=e.sin_po,e.ms1=xn(e.e3,e.sin_po,e.cos_po),e.qs1=fn(e.e3,e.sin_po),e.sin_po=Math.sin(e.lat2),e.cos_po=Math.cos(e.lat2),e.t2=e.sin_po,e.ms2=xn(e.e3,e.sin_po,e.cos_po),e.qs2=fn(e.e3,e.sin_po),e.sin_po=Math.sin(e.lat0),e.cos_po=Math.cos(e.lat0),e.t3=e.sin_po,e.qs0=fn(e.e3,e.sin_po),Math.abs(e.lat1-e.lat2)>1e-10?e.ns0=(e.ms1*e.ms1-e.ms2*e.ms2)/(e.qs2-e.qs1):e.ns0=e.con,e.c=e.ms1*e.ms1+e.ns0*e.qs1,e.rh=e.a*Math.sqrt(e.c-e.ns0*e.qs0)/e.ns0)}function rO(e,t){var r=t.x,n=t.y;e.sin_phi=Math.sin(n),e.cos_phi=Math.cos(n);var i=fn(e.e3,e.sin_phi),o=e.a*Math.sqrt(e.c-e.ns0*i)/e.ns0,s=e.ns0*G(r-e.long0,e.over),a=o*Math.sin(s)+e.x0,c=e.rh-o*Math.cos(s)+e.y0;return t.x=a,t.y=c,t}function nO(e,t){var r,n,i,o,s,a;if(t.x-=e.x0,t.y=e.rh-t.y+e.y0,e.ns0>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),o=0,r!==0&&(o=Math.atan2(i*t.x,i*t.y)),i=r*e.ns0/e.a,e.sphere){let c=(e.c-i*i)/(2*e.ns0);if(Math.abs(c)>1+8*Number.EPSILON)return null;a=Math.asin(Math.max(-1,Math.min(1,c)))}else{n=(e.c-i*i)/e.ns0;let c=fn(e.e3,1);a=Math.abs(Math.abs(n)-c)<=16*Number.EPSILON*c?Math.sign(n)*Math.PI/2:a1(e.e3,n)}return s=G(o/e.ns0+e.long0,e.over),t.x=s,t.y=a,t}function iO(e){let t={...e,temp:0,e3:0,sin_po:0,cos_po:0,t1:0,con:0,ms1:0,qs1:0,t2:0,ms2:0,qs2:0,t3:0,qs0:0,ns0:0,c:0,rh:0,sin_phi:0,cos_phi:0};return kK(t),t}var oO=p(()=>{Jl();Yh();_t();Dx()});var Nx,sO=p(()=>{Xl();Ct();et();ut();Gn();oO();Nx={name:"aea",aliases:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers"],parameters:[...Er,"lat_1","lat_2"],create(e){let t=xr(e);Kl(t,e.parameters);let r=iO(t),n={...fr("aea",r,rO,nO,Ci)};return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>$l(n.forward,i,t.long0,r.ns0,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function Ss(e){return Math.abs(e)<=F?e:e-Us(e)*Math.PI}var Zh=p(()=>{Bt();Bf()});function GK(e){Math.abs(e.lat1+e.lat2)<1e-10||(e.temp=e.b/e.a,e.es=1-Math.pow(e.temp,2),e.e=Math.sqrt(e.es),e.en=uo(e.es),e.sin_phi=Math.sin(e.lat1),e.cos_phi=Math.cos(e.lat1),e.ms1=xn(e.e,e.sin_phi,e.cos_phi),e.ml1=_r(e.lat1,Math.sin(e.lat1),Math.cos(e.lat1),e.en),Math.abs(e.lat1-e.lat2)<1e-10?e.ns=e.sin_phi:(e.sin_phi=Math.sin(e.lat2),e.cos_phi=Math.cos(e.lat2),e.ms2=xn(e.e,e.sin_phi,e.cos_phi),e.ml2=_r(e.lat2,Math.sin(e.lat2),Math.cos(e.lat2),e.en),e.ns=(e.ms1-e.ms2)/(e.ml2-e.ml1)),e.g=e.ml1+e.ms1/e.ns,e.ml0=_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en),e.rh=e.a*(e.g-e.ml0))}function aO(e,t){var r=t.x,n=t.y,i;if(e.sphere)i=e.a*(e.g-n);else{var o=_r(n,Math.sin(n),Math.cos(n),e.en);i=e.a*(e.g-o)}var s=e.ns*G(r-e.long0,e.over),a=e.x0+i*Math.sin(s),c=e.y0+e.rh-i*Math.cos(s);return t.x=a,t.y=c,t}function cO(e,t){t.x-=e.x0,t.y=e.rh-t.y+e.y0;var r,n,i,o;e.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1);var s=0;if(n!==0&&(s=Math.atan2(r*t.x,r*t.y)),e.sphere)return o=G(e.long0+s/e.ns,e.over),i=Ss(e.g-n/e.a),t.x=o,t.y=i,t;var a=e.g-n/e.a;return i=fo(a,e.es,e.en),o=G(e.long0+s/e.ns,e.over),t.x=o,t.y=i,t}function lO(e){let t={...e,temp:0,en:[],sin_phi:0,cos_phi:0,ms1:0,ml1:0,ns:0,ms2:0,ml2:0,g:0,ml0:0,rh:0};return GK(t),t}var uO=p(()=>{Yl();mc();Zl();Jl();_t();Zh()});var Fx,fO=p(()=>{Xl();Ct();et();ut();Gn();uO();Fx={name:"eqdc",aliases:["Equidistant_Conic"],parameters:[...Er,"lat_1","lat_2"],create(e){let t=xr(e);Kl(t,e.parameters);let r=lO(t),n=fr("eqdc",r,aO,cO,Ci);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>$l(n.forward,i,t.long0,r.ns,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function Wa(e,t){let r=Math.abs(Math.sin(t)),n=Math.cos(t),i=n*n/(1+r);if(e===0)return 2*i;let o=e*e;return i*(1+o*r)/(1-o*r*r)+(1-o)/e*Math.atanh(e*i/(1-o*r))}function kx(e,t,r){if(r===0||e===0)return r;let n=Wa(e,r)/t;return Math.atan2(Math.sign(r)*(1-n),Math.sqrt(n*(2-n)))}function Gx(e,t,r){if(e===0||r===0||Math.abs(r)===Math.PI/2)return r;let n=Math.abs(Math.sin(r)),i=Math.cos(r),o=t*i*i/(1+n),s=Math.abs(r),a=e*e,c=0,l=Math.PI/2;for(let u=0;u<48;u++){let h=Math.sin(s),d=1-a*h*h,m=2*(1-a)*Math.cos(s)/(d*d),g=Wa(e,s)-o,y=g/m;if(Math.abs(y)<2e-15)return Math.sign(r)*s;g>0?c=s:l=s;let b=s+y;s=b>c&&b<l?b:(c+l)/2}throw new Error("Authalic latitude inverse did not converge")}var Ux=p(()=>{});function UK(e){var t=Math.abs(e.lat0);if(Math.abs(t-F)<1e-10?e.mode=e.lat0<0?Xi:Ro:Math.abs(t)<1e-10?e.mode=Ai:e.mode=hn,e.es>0){var r;switch(e.qp=fn(e.e,1),e.mmf=.5/(1-e.es),e.mode){case Ro:e.dd=1;break;case Xi:e.dd=1;break;case Ai:e.rq=Math.sqrt(.5*e.qp),e.dd=1/e.rq,e.xmf=1,e.ymf=.5*e.qp;break;case hn:e.rq=Math.sqrt(.5*e.qp),r=Math.sin(e.lat0),e.sinb1=fn(e.e,r)/e.qp,e.cosb1=Math.sqrt(1-e.sinb1*e.sinb1),e.dd=Math.cos(e.lat0)/(Math.sqrt(1-e.es*r*r)*e.rq*e.cosb1),e.xmf=e.rq,e.ymf=e.xmf/e.dd,e.xmf*=e.dd;break}}else e.mode===hn&&(e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0))}function hO(e,t){var r,n,i,o,s,a,c,l,u,h,d=t.x,m=t.y;if(d=G(d-e.long0,e.over),e.sphere){if(s=Math.sin(m),h=Math.cos(m),i=Math.cos(d),e.mode===hn||e.mode===Ai){if(n=e.mode===Ai?1+h*i:1+e.sinph0*s+e.cosph0*h*i,n<=1e-10)return null;n=Math.sqrt(2/n),r=n*h*Math.sin(d),n*=e.mode===Ai?s:e.cosph0*s-e.sinph0*h*i}else if(e.mode===Ro||e.mode===Xi){if(e.mode===Ro&&(i=-i),Math.abs(m+e.lat0)<1e-10)return null;n=tt-m*.5,n=2*(e.mode===Xi?Math.cos(n):Math.sin(n)),r=n*Math.sin(d),n*=i}}else{if(c=0,l=0,u=0,i=Math.cos(d),o=Math.sin(d),s=Math.sin(m),a=fn(e.e,s),e.mode===hn||e.mode===Ai){c=a/e.qp;let g=Wa(e.e,m)/e.qp;l=Math.sqrt(g*(2-g))}switch(e.mode){case hn:u=1+e.sinb1*c+e.cosb1*l*i;break;case Ai:u=1+l*i;break;case Ro:u=F+m,a=m>=0?Wa(e.e,m):2*e.qp-Wa(e.e,m);break;case Xi:u=m-F,a=m<=0?Wa(e.e,m):2*e.qp-Wa(e.e,m);break}if(Math.abs(u)<1e-10)return null;switch(e.mode){case hn:case Ai:u=Math.sqrt(2/u),e.mode===hn?n=e.ymf*u*(e.cosb1*c-e.sinb1*l*i):(u=Math.sqrt(2/(1+l*i)),n=u*c*e.ymf),r=e.xmf*u*l*o;break;case Ro:case Xi:a>=0?(u=Math.sqrt(a),r=u*o,n=i*(e.mode===Xi?u:-u)):r=n=0;break}}return t.x=e.a*r+e.x0,t.y=e.a*n+e.y0,t}function dO(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.x/e.a,n=t.y/e.a,i,o,s,a,c,l,u;if(e.sphere){var h=0,d,m=0;if(d=Math.sqrt(r*r+n*n),o=d*.5,o>1+8*Number.EPSILON)return null;switch(o=2*Math.asin(Math.min(1,o)),(e.mode===hn||e.mode===Ai)&&(m=Math.sin(o),h=Math.cos(o)),e.mode){case Ai:o=Math.abs(d)<=1e-10?0:Bi(0,1,m,h,r,n,d),r*=m,n=h*d;break;case hn:o=Math.abs(d)<=1e-10?e.lat0:Bi(e.sinph0,e.cosph0,m,h,r,n,d),r*=m*e.cosph0,n=(h-Math.sin(o)*e.sinph0)*d;break;case Ro:n=-n,o=F-o;break;case Xi:o-=F;break}i=n===0&&(e.mode===Ai||e.mode===hn)?0:Math.atan2(r,n)}else{if(u=0,e.mode===hn||e.mode===Ai){if(r/=e.dd,n*=e.dd,l=Math.sqrt(r*r+n*n),l<1e-10)return t.x=e.long0,t.y=e.lat0,t;let g=.5*l/e.rq;if(g>1+8*Number.EPSILON)return null;a=2*Math.asin(Math.min(1,g)),s=Math.cos(a),a=Math.sin(a);let y=Bi(e.mode===hn?e.sinb1:0,e.mode===hn?e.cosb1:1,a,s,r,n,l);o=Gx(e.e,e.qp,y),r*=a,e.mode===hn?(u=s*e.sinb1+n*a*e.cosb1/l,c=e.qp*u,n=l*e.cosb1*s-n*e.sinb1*a):(u=n*a/l,c=e.qp*u,n=l*s)}else if(e.mode===Ro||e.mode===Xi){if(e.mode===Ro&&(n=-n),c=r*r+n*n,!c)return t.x=e.long0,t.y=e.lat0,t;u=1-c/e.qp,e.mode===Xi&&(u=-u)}if(i=Math.atan2(r,n),Math.abs(u)>1+8*Number.EPSILON)return null;if(e.mode===Ro||e.mode===Xi){let g=Math.max(0,Math.min(2,c/e.qp)),y=Math.atan2(u,Math.sqrt(g*(2-g)));o=Gx(e.e,e.qp,y)}}return t.x=G(e.long0+i,e.over),t.y=o,t}function mO(e){let t={...e,mode:0,qp:0,mmf:0,dd:0,rq:0,xmf:0,ymf:0,sinb1:0,cosb1:0,sinph0:0,cosph0:0};return UK(t),t}var Xi,Ro,Ai,hn,pO=p(()=>{Bt();Yh();_t();Ux();Df();Xi=1,Ro=2,Ai=3,hn=4});var jx,gO=p(()=>{Ux();qs();Vs();Gn();pO();jx={name:"laea",aliases:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area"],parameters:Er,create(e){let t=xr(e),r=mO(t);return wn(ks(t,fr("laea",r,hO,dO)),t,Math.PI*179/180,(n,i)=>Q8(t,t.sphere?1:r.xmf||Math.sqrt(r.qp/2),t.sphere?1:r.ymf||Math.sqrt(r.qp/2),n,i,t.sphere?t.lat0:kx(t.e,r.qp,t.lat0),t.sphere?o=>o:o=>kx(t.e,r.qp,o)))}}});function c1(e,t){return Math.pow((1-e)/(1+e),t)}var yO=p(()=>{});function zK(e){var t=Math.sin(e.lat0),r=Math.cos(e.lat0);r*=r,e.rc=Math.sqrt(1-e.es)/(1-e.es*t*t),e.C=Math.sqrt(1+e.es*r*r/(1-e.es)),e.phic0=Math.asin(t/e.C),e.ratexp=.5*e.C*e.e,e.K=Math.tan(.5*e.phic0+tt)/(Math.pow(Math.tan(.5*e.lat0+tt),e.C)*c1(e.e*t,e.ratexp))}function bO(e,t){var r=t.x,n=t.y;return t.y=2*Math.atan(e.K*Math.pow(Math.tan(.5*n+tt),e.C)*c1(e.e*Math.sin(n),e.ratexp))-F,t.x=e.C*r,t}function wO(e,t){for(var r=1e-14,n=t.x/e.C,i=t.y,o=Math.pow(Math.tan(.5*i+tt)/e.K,1/e.C),s=jK;s>0&&(i=2*Math.atan(o*c1(e.e*Math.sin(t.y),-.5*e.e))-F,!(Math.abs(i-t.y)<r));--s)t.y=i;return s?(t.x=n,t.y=i,t):null}function xO(e){let t={...e,rc:0,C:0,phic0:0,ratexp:0,K:0};return zK(t),t}var jK,_O=p(()=>{yO();Bt();jK=20});function qK(e){e.rc&&(e.sinc0=Math.sin(e.phic0),e.cosc0=Math.cos(e.phic0),e.R2=2*e.rc)}function SO(e,t){var r,n,i,o;return t.x=G(t.x-e.long0,e.over),bO(e,t),r=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),o=e.k0*e.R2/(1+e.sinc0*r+e.cosc0*n*i),t.x=o*n*Math.sin(t.x),t.y=o*(e.cosc0*r-e.sinc0*n*i),t.x=e.a*t.x+e.x0,t.y=e.a*t.y+e.y0,t}function MO(e,t){var r,n,i,o,s;if(t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,t.x/=e.k0,t.y/=e.k0,s=tr(t.x,t.y),s){var a=2*Math.atan2(s,e.R2);r=Math.sin(a),n=Math.cos(a),o=Bi(e.sinc0,e.cosc0,r,n,t.x,t.y,s),i=Math.atan2(t.x*r,s*e.cosc0*n-t.y*e.sinc0*r)}else o=e.phic0,i=0;if(t.x=i,t.y=o,!wO(e,t))throw new Error("Oblique stereographic inverse did not converge");return t.x=G(t.x+e.long0,e.over),t}function vO(e){let t={...xO(e),sinc0:0,cosc0:0,R2:0};return qK(t),t}var EO=p(()=>{Df();_O();_t();dc()});var zx,TO=p(()=>{qs();Vs();Gn();EO();zx={name:"sterea",aliases:["Stereographic_North_Pole","Oblique_Stereographic","Oblique Stereographic Alternative","Double_Stereographic"],parameters:[...Er,...Wo],create(e){let t=xr(e);if(Math.abs(t.lat0)===Math.PI/2)throw new Error("sterea requires a non-polar origin; use stere at the poles");let r=vO(t);return wn(ks(t,fr("sterea",r,SO,MO)),t,Math.PI*150/180,(n,i)=>Gm(t,o=>2*Math.atan(r.K*Math.pow(Math.tan(Math.PI/4+o/2),r.C)*Math.pow((1-t.e*Math.sin(o))/(1+t.e*Math.sin(o)),r.ratexp))-Math.PI/2,r.phic0,t.a*t.k0*r.R2,n,i,r.C,Math.abs(Math.log(r.C))+Math.abs(Math.log(r.K))+r.C*t.e*Math.atanh(t.e)))}}});function qx(e,t){let r=1-e*Math.sin(t)**2;return(1-e)/(r*Math.sqrt(r))}function l1(e,t,r,n){return qx(e,t-r*n)+qx(e,t+r*n)}function ci(e,t,r,n){let i=(n-r)/8,o=0;for(let s=0;s<4;s++){let a=r+(2*s+1)*i;o+=i*(.362683783378362*l1(t,a,i,.1834346424956498)+.3137066458778873*l1(t,a,i,.525532409916329)+.2223810344533745*l1(t,a,i,.7966664774136267)+.1012285362903763*l1(t,a,i,.9602898564975363))}return e*o}function Vx(e,t,r){let n=Math.PI/2,i=ci(e,t,0,n);if(!Number.isFinite(r)||Math.abs(r)>i)return NaN;let o=-n,s=n,a=r/i*n;for(let c=0;c<48;c++){let l=ci(e,t,0,a)-r;if(Math.abs(l)<=8*Number.EPSILON*e)return a;l>0?s=a:o=a;let u=a-l/(e*qx(t,a));a=u>o&&u<s?u:(o+s)/2}return NaN}var Wx=p(()=>{});function AO(e,t,r,n,i,o,s){let a=n-t,c=Math.atan((1-o)*Math.tan(e)),l=Math.atan((1-o)*Math.tan(r)),u=Math.sin(c),h=Math.cos(c),d=Math.sin(l),m=Math.cos(l),g=a,y,b=100,w,_,S,M,v,C,R,E,j,I,O,A,W,k;do{if(w=Math.sin(g),_=Math.cos(g),S=Math.sqrt(m*w*(m*w)+(h*d-u*m*_)*(h*d-u*m*_)),S===0){s.x=0,s.y=0;return}M=u*d+h*m*_,v=Math.atan2(S,M),C=h*m*w/S,R=1-C*C,E=R!==0?M-2*u*d/R:0,j=o/16*R*(4+o*(4-3*R)),y=g,g=a+(1-j)*o*C*(v+j*S*(E+j*M*(-1+2*E*E)))}while(Math.abs(g-y)>1e-12&&--b>0);if(b===0){s.x=NaN,s.y=NaN;return}I=R*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),O=1+I/16384*(4096+I*(-768+I*(320-175*I))),A=I/1024*(256+I*(-128+I*(74-47*I))),W=A*S*(E+A/4*(M*(-1+2*E*E)-A/6*E*(-3+4*S*S)*(-3+4*E*E))),k=i*(1-o)*O*(v-W);let T=Math.atan2(m*w,h*d-u*m*_);s.x=T,s.y=k}function IO(e,t,r,n,i,o,s){let a=Math.atan((1-o)*Math.tan(e)),c=Math.sin(a),l=Math.cos(a),u=Math.sin(r),h=Math.cos(r),d=Math.atan2(c,l*h),m=l*u,g=1-m*m,y=g*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),b=1+y/16384*(4096+y*(-768+y*(320-175*y))),w=y/1024*(256+y*(-128+y*(74-47*y))),_=n/(i*(1-o)*b),S,M=100,v,C,R,E;do v=Math.cos(2*d+_),C=Math.sin(_),R=Math.cos(_),E=w*C*(v+w/4*(R*(-1+2*v*v)-w/6*v*(-3+4*C*C)*(-3+4*v*v))),S=_,_=n/(i*(1-o)*b)+E;while(Math.abs(_-S)>1e-12&&--M>0);if(M===0){s.x=NaN,s.y=NaN;return}let j=c*C-l*R*h,I=Math.atan2(c*R+l*C*h,(1-o)*Math.sqrt(m*m+j*j)),O=Math.atan2(C*u,l*R-c*C*h),A=o/16*g*(4+o*(4-3*g)),W=O-(1-A)*o*m*(_+A*C*(v+A*R*(-1+2*v*v))),k=t+W;s.x=k,s.y=I}var PO=p(()=>{});function VK(e){e.sin_p12=Math.sin(e.lat0),e.cos_p12=Math.cos(e.lat0),e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.f=e.es/(1+Math.sqrt(1-e.es))}function RO(e,t){var r=t.x,n=t.y,i=Math.sin(t.y),o=Math.cos(t.y),s=G(r-e.long0,e.over),a,c,l,u,h;if(e.sphere)return Math.abs(e.sin_p12-1)<=1e-10?(t.x=e.x0+e.a*(F-n)*Math.sin(s),t.y=e.y0-e.a*(F-n)*Math.cos(s),t):Math.abs(e.sin_p12+1)<=1e-10?(t.x=e.x0+e.a*(F+n)*Math.sin(s),t.y=e.y0+e.a*(F+n)*Math.cos(s),t):(u=e.sin_p12*i+e.cos_p12*o*Math.cos(s),c=Math.acos(u),l=c?c/Math.sin(c):1,t.x=e.x0+e.a*l*o*Math.sin(s),t.y=e.y0+e.a*l*(e.cos_p12*i-e.sin_p12*o*Math.cos(s)),t);if(Math.abs(e.sin_p12-1)<=1e-10)return a=ci(e.a,e.es,n,F),t.x=e.x0+a*Math.sin(s),t.y=e.y0-a*Math.cos(s),t;if(Math.abs(e.sin_p12+1)<=1e-10)return a=ci(e.a,e.es,-F,n),t.x=e.x0+a*Math.sin(s),t.y=e.y0+a*Math.cos(s),t;{if(Math.abs(s)<1e-10&&Math.abs(n-e.lat0)<1e-10)return t.x=e.x0,t.y=e.y0,t;AO(e.lat0,e.long0,n,r,e.a,e.f,t),h=t.x;let d=t.y;return t.x=e.x0+d*Math.sin(h),t.y=e.y0+d*Math.cos(h),t}}function LO(e,t){t.x-=e.x0,t.y-=e.y0;var r,n,i,o,s,a,c,l,u,h,d;if(e.sphere){if(r=Math.sqrt(t.x*t.x+t.y*t.y),r>2*F*e.a)return null;if(n=r/e.a,i=Math.sin(n),o=Math.cos(n),s=e.long0,Math.abs(r)<=1e-10)a=e.lat0;else if(a=Bi(e.sin_p12,e.cos_p12,i,o,t.x,t.y,r),c=Math.abs(e.lat0)-F,Math.abs(c)<=1e-10)if(e.lat0>=0){if(!Number.isFinite(a))return null;s=G(e.long0+Math.atan2(t.x,-t.y),e.over)}else s=G(e.long0-Math.atan2(-t.x,t.y),e.over);else s=G(e.long0+Math.atan2(t.x*i,r*e.cos_p12*o-t.y*e.sin_p12*i),e.over);return t.x=s,t.y=a,t}else return Math.abs(e.sin_p12-1)<=1e-10?(l=ci(e.a,e.es,0,F),r=Math.sqrt(t.x*t.x+t.y*t.y),u=l-r,a=Vx(e.a,e.es,u),Number.isFinite(a)?(s=G(e.long0+Math.atan2(t.x,-1*t.y),e.over),t.x=s,t.y=a,t):null):Math.abs(e.sin_p12+1)<=1e-10?(l=ci(e.a,e.es,0,F),r=Math.sqrt(t.x*t.x+t.y*t.y),u=r-l,a=Vx(e.a,e.es,u),Number.isFinite(a)?(s=G(e.long0+Math.atan2(t.x,t.y),e.over),t.x=s,t.y=a,t):null):(h=Math.atan2(t.x,t.y),d=Math.sqrt(t.x*t.x+t.y*t.y),IO(e.lat0,e.long0,h,d,e.a,e.f,t),t)}function OO(e){let t={...e,sin_p12:0,cos_p12:0,f:0};return VK(t),t}var CO=p(()=>{Df();_t();Bt();Wx();PO()});var Hx,BO=p(()=>{qs();Vs();Gn();CO();Hx={name:"aeqd",aliases:["Azimuthal_Equidistant"],parameters:Er,create(e){let t=xr(e),r=OO(t);return wn(ks(t,fr("aeqd",r,RO,LO)),t,Math.PI*179/180,(n,i)=>J8(t,n,i))}}});var $x,DO=p(()=>{Hh();Ax();$x={name:"geocent",aliases:["Geocentric","geocentric","Geocent"],parameters:[],create({semiMajorAxis:e,semiMinorAxis:t,eccentricitySquared:r,primeMeridian:n=0}){let i={semiMajorAxis:e,eccentricitySquared:r,semiMinorAxis:t??e*Math.sqrt(1-r)};return{getRenderingProfile:()=>({bounds:[[-e,-e,-i.semiMinorAxis],[e,e,i.semiMinorAxis]],normalize:Va({},n)().normalize}),forward(){throw new Error("Geocentric projection requires the 3D pipeline")},inverse(){throw new Error("Geocentric projection requires the 3D pipeline")},forwardInPlace:o=>e1(o,i),inverseInPlace:o=>t1(o,i),forward3D:o=>_L(o,i),inverse3D:o=>SL(o,i)}}}});function NO(e,t,r){let n=Cs(Cr(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]),s=Math.max(Math.abs(e.a*(e.es?e.am1:e.cphi1)+e.y0-o[0]),Math.abs(e.a*(e.es?e.am1:e.cphi1)+e.y0-o[1])),a=Math.min(s,i*n),c=Math.min(2*s,i*n);return lt([e.x0-a,e.x0+a],[o[0]-c,o[1]+c])}function FO(e,t,r){let n=Cs(Cr(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=i*n*n/4,s=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return e.sphere&&(r[0][1]-e.lat0<-Math.PI/2||r[1][1]-e.lat0>Math.PI/2)&&(s=[e.y0-e.a*Math.PI/2,e.y0+e.a*Math.PI/2]),lt([e.x0-i*n,e.x0+i*n],[s[0]-o,s[1]+o])}function kO(e,t,r){let n=Cs(Cr(r,e.long0,e.over));if(e.sphere&&n>Math.PI/2)throw new Error("Unsupported Cassini rendering coverage");let i=e.a/Math.sqrt(1-e.es),o=e.es/(1-e.es),s=e.sphere?e.a*Math.asin(Math.min(1,Math.sin(Math.min(n,Math.PI/2)))):i*(n+n**3/6+(9+8*o)*n**5/120),a=e.sphere?e.a*n:i*(n*n/4+(6+6*o)*n**4/24),c=mi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return lt([e.x0-s,e.x0+s],[c[0]-a,c[1]+a])}function Kx(e,t){return t[0]<=0&&t[1]>=0?[-1/0,1/0]:Ot(e,mi(1/t[0],1/t[1]))}function GO(e,t){let r=l=>{let u=e.alpha*(Math.asinh(Math.tan(l))-e.e*Math.atanh(e.e*Math.sin(l)))+e.K;return Math.asin(Math.tanh(u))},n=Q((t[0][0]-e.long0)*e.alpha,r(t[0][1]),(t[1][0]-e.long0)*e.alpha,r(t[1][1])),i=dt([-Math.sin(e.b0),0,Math.cos(e.b0)],n);if(Cs(i)>=1-1e-14)throw new Error("Swiss oblique Mercator coverage reaches a rotated pole");let o=dt([0,1,0],n),s=dt([Math.cos(e.b0),0,Math.sin(e.b0)],n),a=Kx(o,s).map(Math.atan),c=i.map(l=>Math.atanh(Math.max(-1+Number.EPSILON,Math.min(1-Number.EPSILON,l))));return lt(Be([e.x0,e.x0],Fe(a,e.R)),Be([e.y0,e.y0],Fe(c,e.R)))}function UO(e,t){let r=g=>Math.log(e.E)-e.B*Math.log(Qr(e.e,g,Math.sin(g))),n=mi(r(t[0][1]),r(t[1][1])),i=Fe([t[0][0]-e.lam0,t[1][0]-e.lam0],e.B),o=Q(i[0],Math.asin(Math.tanh(n[0])),i[1],Math.asin(Math.tanh(n[1]))),s=dt([0,-e.cosgam,e.singam],o),a=Fe(mi(-Math.atanh(s[0]),-Math.atanh(s[1])),e.ArB),c=Be(Fe([Math.sinh(n[0]),Math.sinh(n[1])],e.cosgam),Fe(Lf(i),e.singam)),l=Pm(i),u=l[0]>0?Kx(c,l).map(Math.atan):[-Math.PI,Math.PI],h=Fe(u,e.ArB),d,m;return e.no_rot?(d=h,m=a):(h=Be(h,[-e.u_0,-e.u_0]),d=Be(Fe(a,e.cosrot),Fe(h,e.sinrot)),m=Be(Fe(h,e.cosrot),Fe(a,-e.sinrot))),lt(Be([e.x0,e.x0],Fe(d,e.a)),Be([e.y0,e.y0],Fe(m,e.a)))}function jO(e,t){let r=m=>2*(Math.atan(e.k*Math.pow(Math.tan(m/2+e.s45),e.alfa)/Math.pow((1+e.e*Math.sin(m))/(1-e.e*Math.sin(m)),e.alfa*e.e/2))-e.s45),n=Fe(Cr(t,e.long0,e.over),-e.alfa),i=Q(n[0],r(t[0][1]),n[1],r(t[1][1])),o=dt([Math.sin(e.ad),0,Math.cos(e.ad)],i),s=[Math.sqrt(Math.max(Number.EPSILON,1-Cs(o)**2)),1],a=dt([0,1,0],i),c=Kx(a,s),l=Fe(c.map(m=>Math.asin(Math.max(-1,Math.min(1,m)))),e.n),u=m=>e.ro0*Math.pow(Math.tan(e.s0/2+e.s45)/Math.tan(Math.asin(m)/2+e.s45),e.n),h=mi(u(o[0]),u(o[1])),d=e.czech?1:-1;return lt(Be([e.x0,e.x0],Fe(Ot(h,Lf(l)),d)),Be([e.y0,e.y0],Fe(Ot(h,Pm(l)),d)))}function zO(e,t){let r=Fe([t[0][1]-e.lat0,t[1][1]-e.lat0],1e-5/Cf),n=Cr(t,e.long0,e.over),i=[0,0];for(let l=10;l>=1;l--)i=Be([e.A[l],e.A[l]],Ot(i,r));i=Ot(i,r);let o=[0,0],s=[0,0];for(let l=6;l>=1;l--){let u=Be(Ot(o,i),Fe(Ot(s,n),-1)),h=Be(Ot(o,n),Ot(s,i));o=Be(u,[e.B_re[l],e.B_re[l]]),s=Be(h,[e.B_im[l],e.B_im[l]])}let a=Be(Ot(o,i),Fe(Ot(s,n),-1)),c=Be(Ot(o,n),Ot(s,i));return lt(Be([e.x0,e.x0],Fe(c,e.a)),Be([e.y0,e.y0],Fe(a,e.a)))}var Ha=p(()=>{et();pc();Ct();Nf();Bt()});function Ae(e){let t=xr(e);return{...t,x0:0,y0:0,lat_ts:Number.isNaN(t.lat_ts)?0:t.lat_ts}}function Gt(e,t){return{...e,x0:re(t.parameters,"x_0",0),y0:re(t.parameters,"y_0",0)}}function Ie(e,t,r,n,i,o){let s=fr(e,r,n,i),a=re(t.parameters,"x_0",0),c=re(t.parameters,"y_0",0);return pi(l=>{o==null||o(l.x,l.y),s.forwardInPlace(l),l.x+=a,l.y+=c},l=>{l.x-=a,l.y-=c,s.inverseInPlace(l)})}function $a(e,t=0,r=!1){return(n,i)=>{let o=Math.sin(e.lat0)*Math.sin(i)+Math.cos(e.lat0)*Math.cos(i)*Math.cos(n-e.long0);if(r?o<t-1e-14:o<=t+1e-14)throw new Error("Coordinate is outside the visible projection horizon")}}var Ut=p(()=>{fc();Gn();Wt()});function WK(e){var t;if(e.phi1=e.lat1,Math.abs(e.phi1)<Jh)throw new Error;e.es?(e.en=uo(e.es),e.am1=Math.sin(e.phi1),t=Math.cos(e.phi1),e.m1=_r(e.phi1,e.am1,t,e.en),e.am1=t/(Math.sqrt(1-e.es*e.am1*e.am1)*e.am1)):Math.abs(e.phi1)+Jh>=F?e.cphi1=0:e.cphi1=1/Math.tan(e.phi1)}function HK(e,t){var r=G(t.x-(e.long0||0),e.over),n=t.y,i,o,s;return o=Math.sin(n),s=Math.cos(n),i=e.am1+e.m1-_r(n,o,s,e.en),o=s*r/(i*Math.sqrt(1-e.es*o*o)),t.x=i*Math.sin(o),t.y=e.am1-i*Math.cos(o),t.x=e.a*t.x+(e.x0||0),t.y=e.a*t.y+(e.y0||0),t}function $K(e,t){t.x=(t.x-(e.x0||0))/e.a,t.y=(t.y-(e.y0||0))/e.a;var r,n,i,o;if(t.y=e.am1-t.y,n=tr(t.x,t.y),e.phi1<0&&(n=-n),o=fo(e.am1+e.m1-n,e.es,e.en),r=Math.abs(o),r<F)r=Math.sin(o),i=n*Math.atan2(Math.sign(e.phi1)*t.x,Math.sign(e.phi1)*t.y)*Math.sqrt(1-e.es*r*r)/Math.cos(o);else if(Math.abs(r-F)<=Jh)i=0;else throw new Error;return t.x=G(i+(e.long0||0),e.over),t.y=Ss(o),t}function KK(e,t){var r=G(t.x-(e.long0||0),e.over),n=t.y,i,o;return o=e.cphi1+e.phi1-n,Math.abs(o)>Jh?(i=r*Math.cos(n)/o,t.x=o*Math.sin(i),t.y=e.cphi1-o*Math.cos(i)):t.x=t.y=0,t.x=e.a*t.x+(e.x0||0),t.y=e.a*t.y+(e.y0||0),t}function XK(e,t){t.x=(t.x-(e.x0||0))/e.a,t.y=(t.y-(e.y0||0))/e.a;var r,n;t.y=e.cphi1-t.y;var i=tr(t.x,t.y);if(e.phi1<0&&(i=-i),n=e.cphi1+e.phi1-i,Math.abs(n)>F)throw new Error;return Math.abs(Math.abs(n)-F)<=Jh?r=0:r=i*Math.atan2(Math.sign(e.phi1)*t.x,Math.sign(e.phi1)*t.y)/Math.cos(n),t.x=G(r+(e.long0||0),e.over),t.y=Ss(n),t}function qO(e,t){return e.es?HK(e,t):KK(e,t)}function VO(e,t){return e.es?$K(e,t):XK(e,t)}function WO(e,t={}){let r={...e,phi1:0,en:[],m1:0,am1:0,cphi1:0,...t};return WK(r),r}var Jh,HO=p(()=>{Zh();_t();dc();Yl();Zl();mc();Bt();Jh=1e-10});var Xx,$O=p(()=>{Ha();et();ut();Ut();HO();Xx={name:"bonne",aliases:["Bonne (Werner lat_1=90)"],parameters:["lon_0","x_0","y_0","lat_1"],create(e){let t=Ae(e);if(!Object.prototype.hasOwnProperty.call(e.parameters,"lat_1")||Math.abs(t.lat1)<1e-10)throw new Error("Bonne requires a nonzero lat_1");let r=WO(t),n=Ie("bonne",e,r,qO,VO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>NO(Gt(r,e),n.forward,i),t.primeMeridian,t.over)}}});function ju(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}var Yx=p(()=>{});function YK(e){e.sphere||(e.en=uo(e.es),e.ml0=e.a*_r(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function Jx(e,t){var r,n,i=t.x,o=t.y;if(i=G(i-e.long0,e.over),e.sphere)r=e.a*Math.asin(Math.cos(o)*Math.sin(i)),n=e.a*(Math.atan2(Math.tan(o),Math.cos(i))-e.lat0);else{var s=Math.sin(o),a=Math.cos(o),c=ju(e.a,e.e,s),l=Math.tan(o)*Math.tan(o),u=i*Math.cos(o),h=u*u,d=e.es*a*a/(1-e.es),m=e.a*_r(o,s,a,e.en);r=c*u*(1-h*l*(1/6+(8-l+8*d)*h/120)),n=m-e.ml0+c*s/a*h*(.5+(5-l+6*d)*h/24)}return t.x=r+e.x0,t.y=n+e.y0,t}function KO(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.x/e.a,n=t.y/e.a,i,o;if(e.sphere){var s=n+e.lat0;i=Math.asin(Math.sin(s)*Math.cos(r)),o=Math.atan2(Math.tan(r),Math.cos(s))}else{var a=e.ml0/e.a+n,c=fo(a,e.es,e.en);if(Math.abs(Math.abs(c)-F)<=1e-10)return t.x=e.long0,t.y=Math.sign(c)*F,t;var l=ju(e.a,e.e,Math.sin(c)),u=l*l*l/e.a/e.a*(1-e.es),h=Math.pow(Math.tan(c),2),d=r*e.a/l,m=d*d;i=c-l*Math.tan(c)/u*d*d*(.5-(1+3*h)*d*d/24),o=d*(1-m*(h/3-(1+3*h)*h*m/15))/Math.cos(c)}if(!e.sphere){let g=t.x+e.x0,y=t.y+e.y0,b=e.scratch,w=!1;for(let _=0;_<12;_++){Zx(e,o,i);let S=b.x-g,M=b.y-y;if(Math.max(Math.abs(S),Math.abs(M))<1e-7){w=!0;break}let v=1e-7,C=i>F-v?-v:v,R=b.x,E=b.y;Zx(e,o+v,i);let j=(b.x-R)/v,I=(b.y-E)/v;Zx(e,o,i+C);let O=(b.x-R)/C,A=(b.y-E)/C,W=j*A-O*I;if(!Number.isFinite(W)||Math.abs(W)<1e-12||(o-=(A*S-O*M)/W,i-=(j*M-I*S)/W,!Number.isFinite(o)||Math.abs(i)>F))break}if(!w)throw new Error("Cassini inverse did not converge")}return t.x=G(o+e.long0,e.over),t.y=Ss(i),t}function Zx(e,t,r){e.scratch.x=t+e.long0,e.scratch.y=r,Jx(e,e.scratch)}function XO(e,t={}){let r={...e,en:[],scratch:{x:0,y:0},ml0:0,...t};return YK(r),r}var YO=p(()=>{Yl();mc();Zl();Yx();_t();Zh();Bt()});var Qx,ZO=p(()=>{Ha();et();ut();Ut();YO();Qx={name:"cass",aliases:["Cassini","Cassini_Soldner"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=XO(t),n=Ie("cass",e,r,Jx,KO);return De(n,Q(t.long0-Math.PI/6,-Math.PI/2+1e-8,t.long0+Math.PI/6,Math.PI/2-1e-8),i=>kO(Gt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function ZK(e){e.sphere||(e.k0=xn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts)))}function JO(e,t){var r=t.x,n=t.y,i,o,s=G(r-e.long0,e.over);if(e.sphere)i=e.x0+e.a*s*Math.cos(e.lat_ts),o=e.y0+e.a*Math.sin(n)/Math.cos(e.lat_ts);else{var a=fn(e.e,Math.sin(n));i=e.x0+e.a*e.k0*s,o=e.y0+e.a*a*.5/e.k0}return t.x=i,t.y=o,t}function QO(e,t){t.x-=e.x0,t.y-=e.y0;var r,n;return e.sphere?(r=G(e.long0+t.x/e.a/Math.cos(e.lat_ts),e.over),n=Math.asin(t.y/e.a*Math.cos(e.lat_ts))):(n=a1(e.e,2*t.y*e.k0/e.a),r=G(e.long0+t.x/(e.a*e.k0),e.over)),t.x=r,t.y=n,t}function eC(e,t={}){let r={...e,...t};return ZK(r),r}var tC=p(()=>{_t();Yh();Jl();Dx()});var e_,rC=p(()=>{Ct();et();ut();Ut();tC();e_={name:"cea",aliases:[],parameters:["lon_0","x_0","y_0","lat_ts"],create(e){let t=Ae(e);if(Math.abs(t.lat_ts)>=Math.PI/2)throw new Error("CEA standard parallel must be away from the poles");let r=eC(t),n=Ie("cea",e,r,JO,QO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function al(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}var u1=p(()=>{});function QK(e){e.long0=e.long0||0,e.sphere?(e.n=1,e.m=0,e.es=0,e.C_y=Math.sqrt((e.m+1)/e.n),e.C_x=e.C_y/(e.m+1)):e.en=uo(e.es)}function f1(e,t){var r,n,i=t.x,o=t.y;if(i=G(i-e.long0,e.over),e.sphere){if(!e.m)o=e.n!==1?Math.asin(e.n*Math.sin(o)):o;else for(var s=e.n*Math.sin(o),a=JK;a;--a){var c=(e.m*o+Math.sin(o)-s)/(e.m+Math.cos(o));if(o-=c,Math.abs(c)<1e-10)break}r=e.a*e.C_x*i*(e.m+Math.cos(o)),n=e.a*e.C_y*o}else{var l=Math.sin(o),u=Math.cos(o);n=e.a*_r(o,l,u,e.en),r=e.a*i*u/Math.sqrt(1-e.es*l*l)}return t.x=r,t.y=n,t}function h1(e,t){var r,n,i,o;if(t.x-=e.x0,i=t.x/e.a,t.y-=e.y0,r=t.y/e.a,e.sphere){if(r/=e.C_y,i=i/(e.C_x*(e.m+Math.cos(r))),e.m){let s=(e.m*r+Math.sin(r))/e.n;if(Math.abs(s)>1+8*Number.EPSILON)return null;r=al(s)}else e.n!==1&&(r=al(Math.sin(r)/e.n));i=G(i+e.long0,e.over),r=Ss(r)}else r=fo(t.y/e.a,e.es,e.en),o=Math.abs(r),o<F?(o=Math.sin(r),n=e.long0+t.x*Math.sqrt(1-e.es*o*o)/(e.a*Math.cos(r)),i=G(n,e.over)):o-1e-10<F&&(i=e.long0);return t.x=i,t.y=r,t}function nC(e,t={}){let r={...e,en:[],n:0,m:0,C_y:0,C_x:0,...t};return QK(r),r}var JK,t_=p(()=>{_t();Zh();Yl();mc();Zl();Bt();u1();JK=20});function eX(e){e.sphere=!0,e.b=e.a,e.m=1,e.n=2.5707963267948966,e.es=0,e.C_y=Math.sqrt((e.m+1)/e.n),e.C_x=e.C_y/(e.m+1)}function sC(e,t={}){let r={...e,m:0,n:0,C_y:0,C_x:0,en:[],...t};return eX(r),r}var iC,oC,aC=p(()=>{t_();iC=f1,oC=h1});var r_,cC=p(()=>{Ct();et();ut();Ut();aC();r_={name:"eck6",aliases:["Eckert_VI"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=sC(t),n=Ie("eck6",e,r,iC,oC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function n_(e){var t,r=[];return r[0]=e*tX,t=e*e,r[0]+=t*rX,r[1]=t*iX,t*=e,r[0]+=t*nX,r[1]+=t*oX,r[2]=t*sX,r}var tX,rX,nX,iX,oX,sX,lC=p(()=>{tX=.3333333333333333,rX=.17222222222222222,nX=.10257936507936508,iX=.06388888888888888,oX=.0664021164021164,sX=.016415012942191543});function i_(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var uC=p(()=>{});function aX(e){e.long0=e.long0!==void 0?e.long0:0,e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.es!==0&&(e.apa=n_(e.es),e.qp=fn(e.e,1),e.rqda=Math.sqrt(.5*e.qp))}function fC(e,t){var r=G(t.x-e.long0,e.over),n=t.y,i=Math.sin(n);e.es!==0&&(i=fn(e.e,i)/e.qp);var o=Math.asin(d1*i),s=o*o,a=s*s*s;return t.x=r*Math.cos(o)/(d1*(zu+3*qu*s+a*(7*Vu+9*Wu*s))),t.y=o*(zu+qu*s+a*(Vu+Wu*s)),e.es!==0&&(t.x*=e.rqda,t.y*=e.rqda),t.x=e.a*t.x+e.x0,t.y=e.a*t.y+e.y0,t}function hC(e,t){t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,e.es!==0&&(t.x/=e.rqda,t.y/=e.rqda);let r=Math.PI/3,n=r*r,i=r*(zu+qu*n+n**3*(Vu+Wu*n));if(Math.abs(t.y)>i+8*Number.EPSILON*i)return null;var o=1e-9,s=12,a=t.y,c,l,u,h,d,m;for(m=0;m<s&&(c=a*a,l=c*c*c,u=a*(zu+qu*c+l*(Vu+Wu*c))-t.y,h=zu+3*qu*c+l*(7*Vu+9*Wu*c),a-=d=u/h,!(Math.abs(d)<o));++m);c=a*a,l=c*c*c,t.x=d1*t.x*(zu+3*qu*c+l*(7*Vu+9*Wu*c))/Math.cos(a);let g=Math.sin(a)/d1,y=8*Number.EPSILON;return Math.abs(g)>1+y?null:(t.y=Math.abs(g)>=1-y?Math.sign(g)*Math.PI/2:Math.asin(g),e.es!==0&&(t.y=i_(t.y,e.apa)),t.x=G(t.x+e.long0,e.over),t)}function dC(e,t={}){let r={...e,apa:[],qp:0,rqda:0,...t};return aX(r),r}var zu,qu,Vu,Wu,d1,mC=p(()=>{_t();Yh();lC();uC();zu=1.340264,qu=-.081106,Vu=893e-6,Wu=.003796,d1=Math.sqrt(3)/2});var o_,pC=p(()=>{Wt();Ut();mC();et();ut();Ct();o_={name:"eqearth",aliases:["Equal Earth","Equal_Earth"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=e.primeMeridian??0,n=dC(t),i=Ie("eqearth",e,n,fC,hC),o=Math.sqrt(e.eccentricitySquared),s=e.semiMajorAxis*(o?Math.sqrt((1+(1-o*o)*Math.atanh(o)/o)/2):1),a=Math.PI/3,c=a*a,l=c**3,u=s*Math.PI/(Math.sqrt(3)/2*1.340264),h=re(e.parameters,"x_0",0),d=re(e.parameters,"y_0",0),m=s*a*(1.340264-.081106*c+l*(893e-6+.003796*c));return{...i,longitudeOrigin:t.long0,getRenderingProfile(g){if(g)return ur(b=>Br(i.forward,b,t.long0,t.over),g,t.long0,r,t.over);let y=[[h-u,d-m,0],[h+u,d+m,0]];return{bounds:y,normalize:ur(()=>y,kn(Q(t.long0-Math.PI,-(Math.PI/2),t.long0+Math.PI,Math.PI/2),r),t.long0,r,t.over).normalize}}}}}});function cX(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0}function gC(e,t){var r=t.x,n=t.y,i=G(r-e.long0,e.over),o=e.x0+e.a*i*Math.cos(e.lat0),s=e.y0+e.a*n;return e.t1=o,e.t2=Math.cos(e.lat0),t.x=o,t.y=s,t}function yC(e,t){t.x-=e.x0,t.y-=e.y0;var r=t.y/e.a;Math.abs(r)>Math.PI/2&&Math.abs(r)<=Math.PI/2+8*Number.EPSILON&&(r=Math.sign(r)*Math.PI/2);var n=G(e.long0+t.x/(e.a*Math.cos(e.lat0)),e.over);return t.x=n,t.y=r,t}function bC(e,t={}){let r={...e,t2:0,t1:0,...t};return cX(r),r}var wC=p(()=>{_t()});var s_,xC=p(()=>{Ct();et();ut();Ut();wC();s_={name:"equi",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Equirectangular standard parallel must be away from the poles");let r=bC(t),n=Ie("equi",e,r,gC,yC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function _C(e,t,r=!1){let n=1+t/e.a,i=n/(1+1e-10),o=h=>Math.acos(Math.min(1,Math.sqrt(1-e.es*Math.sin(h)**2)/(i*Math.cos(h)))),s=h=>{let d=(i*Math.cos(h))**2;return Math.asin(Math.sqrt(Math.max(0,(d-1)/(d-e.es))))},a=t*Math.asin(1/n),c=t*Math.atan(Math.sqrt((1-e.es)/(n*n-1))),l=(h,d)=>{let m=Math.max(h[0][1],Math.min(h[1][1],0)),g=o(m),y=Math.max(h[0][0]-e.long0,-g),b=Math.min(h[1][0]-e.long0,g),w=s(Math.max(y,Math.min(b,0))),_=Math.max(h[0][1],-w),S=Math.min(h[1][1],w);if(b<y||S<_)return null;let M=Q(y,_,b,S),v=kn(Q(y+e.long0,_,b+e.long0,S),e.primeMeridian),C=(e.long0+e.primeMeridian)*180/Math.PI,R=Ds(E=>{let j=Math.max(y,Math.min(b,Yt(E.x-e.long0))),I=s(j),O=Math.max(Math.max(_,-I),Math.min(Math.min(S,I),E.y));j!==E.x-e.long0&&(E.x=j+e.long0),E.y=O},e.primeMeridian);return{get bounds(){if(!d)return lt([e.x0-a,e.x0+a],[e.y0-c,e.y0+c]);let E=dt([0,0,1],M),j=[1,1/Math.sqrt(1-e.es*Math.max(E[0]**2,E[1]**2))],I=Ot(dt([1,0,0],M),j),O=Ot(dt([0,1,0],M),j),A=Ot(E,[1-e.es,(1-e.es)*j[1]]),W=[n-Math.min(1,I[1]),n-Math.max(1/n,I[0])],k=(T,B,N,D)=>{let L=B[0]<=0&&B[1]>=0?0:Math.min(Math.abs(B[0]),Math.abs(B[1])),P=D?[Math.hypot(W[0],L),Math.hypot(W[1],Math.max(Math.abs(B[0]),Math.abs(B[1])))]:W,z=T.flatMap(we=>P.map(_e=>t*Math.atan(we/_e)));return[Math.max(-N,Math.min(...z)),Math.min(N,Math.max(...z))]};return lt(Be([e.x0,e.x0],k(O,A,a,r)),Be([e.y0,e.y0],k(A,O,c,!r)))},normalize(E){Om(E,v,C),R(E)}}},u=kn(Q(e.long0-o(0),-s(0),e.long0+o(0),s(0)),e.primeMeridian);return h=>{let d=h?Rm(h,u):[u],m=Lm(d,g=>l(Bs(g,e.primeMeridian,e.long0),!!h));if(!m)throw new Error("CRS coverage does not intersect the satellite limb");return m}}var SC=p(()=>{et();uc();ut();Wt();pc();Ct()});function lX(e){if(e.flip_axis=e.sweep==="x"?1:0,e.h=Number(e.h),e.radius_g_1=e.h/e.a,e.radius_g_1<=0||e.radius_g_1>1e10)throw new Error;if(e.radius_g=1+e.radius_g_1,e.C=e.radius_g*e.radius_g-1,e.es!==0){var t=1-e.es,r=1/t;e.radius_p=Math.sqrt(t),e.radius_p2=t,e.radius_p_inv2=r,e.shape="ellipse"}else e.radius_p=1,e.radius_p2=1,e.radius_p_inv2=1,e.shape="sphere"}function MC(e,t){var r=t.x,n=t.y,i,o,s,a;if(r=r-e.long0,e.shape==="ellipse"){n=Math.atan(e.radius_p2*Math.tan(n));var c=e.radius_p/tr(e.radius_p*Math.cos(n),Math.sin(n));if(o=c*Math.cos(r)*Math.cos(n),s=c*Math.sin(r)*Math.cos(n),a=c*Math.sin(n),(e.radius_g-o)*o-s*s-a*a*e.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=e.radius_g-o,e.flip_axis?(t.x=e.radius_g_1*Math.atan(s/tr(a,i)),t.y=e.radius_g_1*Math.atan(a/i)):(t.x=e.radius_g_1*Math.atan(s/i),t.y=e.radius_g_1*Math.atan(a/tr(s,i)))}else e.shape==="sphere"&&(i=Math.cos(n),o=Math.cos(r)*i,s=Math.sin(r)*i,a=Math.sin(n),i=e.radius_g-o,e.flip_axis?(t.x=e.radius_g_1*Math.atan(s/tr(a,i)),t.y=e.radius_g_1*Math.atan(a/i)):(t.x=e.radius_g_1*Math.atan(s/i),t.y=e.radius_g_1*Math.atan(a/tr(s,i))));return t.x=t.x*e.a,t.y=t.y*e.a,t}function vC(e,t){var r=-1,n=0,i=0,o,s,a,c;if(t.x=t.x/e.a,t.y=t.y/e.a,e.shape==="ellipse"){e.flip_axis?(i=Math.tan(t.y/e.radius_g_1),n=Math.tan(t.x/e.radius_g_1)*tr(1,i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*tr(1,n));var l=i/e.radius_p;if(o=n*n+l*l+r*r,s=2*e.radius_g*r,a=s*s-4*o*e.C,a<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=(-s-Math.sqrt(a))/(2*o),r=e.radius_g+c*r,n*=c,i*=c,t.x=Math.atan2(n,r),t.y=Math.atan(i*Math.cos(t.x)/r),t.y=Math.atan(e.radius_p_inv2*Math.tan(t.y))}else if(e.shape==="sphere"){if(e.flip_axis?(i=Math.tan(t.y/e.radius_g_1),n=Math.tan(t.x/e.radius_g_1)*Math.sqrt(1+i*i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*Math.sqrt(1+n*n)),o=n*n+i*i+r*r,s=2*e.radius_g*r,a=s*s-4*o*e.C,a<0)return t.x=Number.NaN,t.y=Number.NaN,t;c=(-s-Math.sqrt(a))/(2*o),r=e.radius_g+c*r,n*=c,i*=c,t.x=Math.atan2(n,r),t.y=Math.atan(i*Math.cos(t.x)/r)}return t.x=t.x+e.long0,t}function EC(e,t={}){let r={...e,flip_axis:0,sweep:"",h:0,radius_g_1:0,radius_g:0,C:0,radius_p:0,radius_p2:0,radius_p_inv2:0,shape:"",...t};return lX(r),r}var TC=p(()=>{dc()});var a_,AC=p(()=>{SC();Ut();TC();Wt();a_={name:"geos",aliases:["Geostationary Satellite View","Geostationary_Satellite"],parameters:["lon_0","x_0","y_0","h","sweep"],create(e){let t=Ae(e),r=re(e.parameters,"h",NaN);if(!Number.isFinite(r)||r<=0)throw new Error("Geostationary projection requires positive h");let n=e.parameters.sweep||"y";if(!["x","y"].includes(n))throw new Error("Geostationary sweep must be x or y");let i=EC(t,{h:r,sweep:n});return{...Ie("geos",e,i,MC,vC,t.sphere?$a({...t,lat0:0},1/(1+r/t.a),!0):void 0),longitudeOrigin:t.long0,getRenderingProfile:_C(Gt(t,e),r,n==="x")}}}});function IC(e){return{engine:u8({semiMajorAxis:1,semiMinorAxis:Math.sqrt(1-e.es)}),latitude:e.lat0*cl}}function PC(e,t,r){let n=t.engine.Inverse(t.latitude,0,r.y*cl,G(r.x-e.long0,e.over)*cl,Pf);if(!(n.M12>0))throw new Error("Coordinate is outside the ellipsoidal gnomonic horizon");let i=e.a*n.m12/n.M12,o=n.azi1/cl;return r.x=e.x0+i*Math.sin(o),r.y=e.y0+i*Math.cos(o),r}function RC(e,t,r){let n=(r.x-e.x0)/e.a,i=(r.y-e.y0)/e.a,o=Math.hypot(n,i);if(o===0)return r.x=e.long0,r.y=e.lat0,r;let s=t.engine.Line(t.latitude,0,Math.atan2(n,i)*cl,Pf),a=o<=1,c=a?o:1/o,l=Math.atan(o);for(let u=0;u<20;u++){let h=s.Position(l,Pf),d=a?(h.m12-c*h.M12)*h.M12:(c*h.m12-h.M12)*h.m12;if(!Number.isFinite(d))break;if(l-=d,Math.abs(d)<1e-14){let m=s.Position(l,Pf);if(!(m.M12>0))break;return r.x=G(e.long0+m.lon2/cl,e.over),r.y=m.lat2/cl,r}}throw new Error("Ellipsoidal gnomonic inverse did not converge")}var cl,LC=p(()=>{f8();_t();cl=180/Math.PI});function uX(e){e.sphere||(e.ellipsoid=IC(e)),e.sin_p14=Math.sin(e.lat0),e.cos_p14=Math.cos(e.lat0),e.infinity_dist=1e3*e.a,e.rc=1}function OC(e,t){if(e.ellipsoid)return PC(e,e.ellipsoid,t);var r,n,i,o,s,a,c,l,u=t.x,h=t.y;return i=G(u-e.long0,e.over),r=Math.sin(h),n=Math.cos(h),o=Math.cos(i),a=e.sin_p14*r+e.cos_p14*n*o,s=1,a>0||Math.abs(a)<=1e-10?(c=e.x0+e.a*s*n*Math.sin(i)/a,l=e.y0+e.a*s*(e.cos_p14*r-e.sin_p14*n*o)/a):(c=e.x0+e.infinity_dist*n*Math.sin(i),l=e.y0+e.infinity_dist*(e.cos_p14*r-e.sin_p14*n*o)),t.x=c,t.y=l,t}function CC(e,t){if(e.ellipsoid)return RC(e,e.ellipsoid,t);var r,n,i,o,s,a;return t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,t.x/=e.k0,t.y/=e.k0,r=Math.sqrt(t.x*t.x+t.y*t.y),r?(o=Math.atan2(r,e.rc),n=Math.sin(o),i=Math.cos(o),a=al(i*e.sin_p14+t.y*n*e.cos_p14/r),s=Math.atan2(t.x*n,r*e.cos_p14*i-t.y*e.sin_p14*n),s=G(e.long0+s,e.over)):(a=e.lat0,s=e.long0),t.x=s,t.y=a,t}function BC(e,t={}){let r={...e,sin_p14:0,cos_p14:0,infinity_dist:0,rc:0,phic0:0,...t};return uX(r),r}var DC=p(()=>{LC();_t();u1()});var c_,NC=p(()=>{qs();Vs();Ut();DC();c_={name:"gnom",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=BC(t);return wn(Ie("gnom",e,r,OC,CC,t.sphere?$a(t):void 0),t,Math.min(Math.PI*80/180,(1-t.es)*Math.PI*.45),(n,i)=>t.sphere?km(Gt(t,e),n,i,"gnom"):tT(Gt(t,e),n,i),(1-t.es)*Math.PI/2)}}});function l_(e,t){return 2*Math.atan(e*Math.exp(t))-F}var FC=p(()=>{Bt()});function m1(e,t){var r=l_(1,t),n=0,i=0;let o=0;do{if(++o>50)throw new Error("Isometric latitude inverse did not converge");n=r,i=e*Math.sin(n),r=l_(Math.exp(e*Math.log((1+i)/(1-i))/2),t)}while(Math.abs(r-n)>1e-12);return r}var u_=p(()=>{FC()});function Hu(e,t,r){if(Math.abs(t)>F)return Number.NaN;if(t===F)return Number.POSITIVE_INFINITY;if(t===-1*F)return Number.NEGATIVE_INFINITY;var n=e*r;return Math.log(Math.tan((F+t)/2))+e*Math.log((1-n)/(1+n))/2}var kC=p(()=>{Bt()});function fX(e){e.k0||(e.k0=1);var t=e.b/e.a;e.e=Math.sqrt(1-t*t),e.lc=e.long0,e.rs=Math.sqrt(1+e.e*e.e*Math.pow(Math.cos(e.lat0),4)/(1-e.e*e.e));var r=Math.sin(e.lat0),n=Math.asin(r/e.rs),i=Math.sin(n);e.cp=Hu(0,n,i)-e.rs*Hu(e.e,e.lat0,r),e.n2=e.k0*e.a*Math.sqrt(1-e.e*e.e)/(1-e.e*e.e*r*r),e.xs=e.x0,e.ys=e.y0-e.n2*n}function GC(e,t){var r=t.x,n=t.y,i=e.rs*(r-e.lc),o=e.cp+e.rs*Hu(e.e,n,Math.sin(n)),s=Math.asin(Math.sin(i)/Of(o)),a=Hu(0,s,Math.sin(s));return t.x=e.xs+e.n2*a,t.y=e.ys+e.n2*Math.atan(hc(o)/Math.cos(i)),t}function UC(e,t){var r=t.x,n=t.y,i=Math.atan(hc((r-e.xs)/e.n2)/Math.cos((n-e.ys)/e.n2)),o=Math.asin(Math.sin((n-e.ys)/e.n2)/Of((r-e.xs)/e.n2)),s=Hu(0,o,Math.sin(o));return t.x=e.lc+i/e.rs,t.y=m1(e.e,(s-e.cp)/e.rs),t}function jC(e,t={}){let r={...e,lc:0,rs:0,cp:0,n2:0,xs:0,ys:0,...t};return fX(r),r}var zC=p(()=>{kC();Bm();Vy();u_()});var f_,qC=p(()=>{Ct();u_();et();ut();Ut();zC();f_={name:"gstmerc",aliases:["gstmerg"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=jC(t),n=Ie("gstmerc",e,r,GC,UC);return De(n,Q(t.long0-Math.PI/6,-Math.PI/3,t.long0+Math.PI/6,Math.PI/3),i=>Hl(n.forward,i,t.long0,t.over,m1(r.e,-r.cp/r.rs)),t.primeMeridian,t.over)}}});function hX(e){e.a=6377397155e-3,e.es=.006674372230614,e.e=Math.sqrt(e.es),e.s45=Math.PI/4,e.s90=2*e.s45,e.fi0=e.lat0,e.e2=e.es,e.e=Math.sqrt(e.e2),e.alfa=Math.sqrt(1+e.e2*Math.pow(Math.cos(e.fi0),4)/(1-e.e2)),e.uq=1.04216856380474,e.u0=Math.asin(Math.sin(e.fi0)/e.alfa),e.g=Math.pow((1+e.e*Math.sin(e.fi0))/(1-e.e*Math.sin(e.fi0)),e.alfa*e.e/2),e.k=Math.tan(e.u0/2+e.s45)/Math.pow(Math.tan(e.fi0/2+e.s45),e.alfa)*e.g,e.k1=e.k0,e.n0=e.a*Math.sqrt(1-e.e2)/(1-e.e2*Math.pow(Math.sin(e.fi0),2)),e.s0=1.37008346281555,e.n=Math.sin(e.s0),e.ro0=e.k1*e.n0/Math.tan(e.s0),e.ad=e.s90-e.uq}function VC(e,t){var r,n,i,o,s,a,c,l=t.x,u=t.y,h=G(l-e.long0,e.over);return r=Math.pow((1+e.e*Math.sin(u))/(1-e.e*Math.sin(u)),e.alfa*e.e/2),n=2*(Math.atan(e.k*Math.pow(Math.tan(u/2+e.s45),e.alfa)/r)-e.s45),i=-h*e.alfa,o=Math.asin(Math.cos(e.ad)*Math.sin(n)+Math.sin(e.ad)*Math.cos(n)*Math.cos(i)),s=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(o)),a=e.n*s,c=e.ro0*Math.pow(Math.tan(e.s0/2+e.s45),e.n)/Math.pow(Math.tan(o/2+e.s45),e.n),t.y=c*Math.cos(a)/1,t.x=c*Math.sin(a)/1,e.czech||(t.y*=-1,t.x*=-1),t}function WC(e,t){var r,n,i,o,s,a,c,l,u=t.x;t.x=t.y,t.y=u,e.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.x),o=s/Math.sin(e.s0),i=2*(Math.atan(Math.pow(e.ro0/a,1/e.n)*Math.tan(e.s0/2+e.s45))-e.s45),r=Math.asin(Math.cos(e.ad)*Math.sin(i)-Math.sin(e.ad)*Math.cos(i)*Math.cos(o)),n=Math.asin(Math.cos(i)*Math.sin(o)/Math.cos(r)),t.x=e.long0-n/e.alfa,c=r,l=0;var h=0;do t.y=2*(Math.atan(Math.pow(e.k,-1/e.alfa)*Math.pow(Math.tan(r/2+e.s45),1/e.alfa)*Math.pow((1+e.e*Math.sin(c))/(1-e.e*Math.sin(c)),e.e/2))-e.s45),Math.abs(c-t.y)<1e-10&&(l=1),c=t.y,h+=1;while(l===0&&h<15);return h>=15?null:t}function HC(e,t={}){let r={...e,s45:0,s90:0,fi0:0,e2:0,alfa:0,uq:0,u0:0,g:0,k:0,k1:0,n0:0,s0:0,n:0,ro0:0,ad:0,czech:!1,...t};return hX(r),r}var $C=p(()=>{_t()});var h_,KC=p(()=>{Ha();et();ut();Ut();$C();Wt();Gn();h_={name:"krovak",aliases:["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0","czech","alpha","lat_ts"],flags:["czech"],create(e){let t=re(e.parameters,"alpha",30.28813972222222),r=re(e.parameters,"lat_ts",78.5);if(![30.28813972222222,30.28813975277778].some(s=>Math.abs(t-s)<=1e-10))throw new Error("Krovak requires its fixed cone-axis co-latitude");if(Math.abs(r-78.5)>1e-10)throw new Error("Krovak requires its fixed 78.5 degree pseudo standard parallel");let n=Ae(e);n.lat0=Fs(e.parameters,"lat_0",49.5),n.long0=Fs(e.parameters,"lon_0",24.83333333333333),n.k0=re(e.parameters,"k_0",re(e.parameters,"k",.9999));let i=HC(n,{czech:Oi(e.parameters,"czech")}),o=Ie("krovak",e,i,VC,WC);return De(o,Q(n.long0-Math.PI/12,Math.max(-Math.PI/2+1e-8,n.lat0-Math.PI/36),n.long0+Math.PI/12,Math.min(Math.PI/2-1e-8,n.lat0+Math.PI/36)),s=>jO(Gt(i,e),s),n.primeMeridian,n.over)}}});function XC(e,t){var r=t.x,n=t.y,i=G(r-e.long0,e.over),o=e.x0+e.a*i,s=e.y0+e.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=o,t.y=s,t}function YC(e,t){t.x-=e.x0,t.y-=e.y0;var r=G(e.long0+t.x/e.a,e.over),n=2.5*(Math.atan(Math.exp(.8*t.y/e.a))-Math.PI/4);return t.x=r,t.y=n,t}function ZC(e,t={}){let r={...e,...t};return r}var JC=p(()=>{_t()});var d_,QC=p(()=>{Ct();et();ut();Ut();JC();d_={name:"mill",aliases:["Miller_Cylindrical"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=ZC(t),n=Ie("mill",e,r,XC,YC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function dX(e){e.x0=e.x0!==void 0?e.x0:0,e.y0=e.y0!==void 0?e.y0:0,e.long0=e.long0!==void 0?e.long0:0}function eB(e,t){var r=t.x,n=t.y,i=G(r-e.long0,e.over);let o=Math.sin(Math.abs(n)),s=Math.cos(n),a=Math.abs(n)===Math.PI/2?0:Math.PI*s*s/(1+o),c=Math.cbrt(6*a),l=0,u=Math.PI;c=Math.min(c,u);for(let m=0;m<32&&c>0;m++){let g=nB(c)-a,y=g/(2*Math.sin(c/2)**2);if(Math.abs(y)<=16*Number.EPSILON*c)break;g>0?u=c:l=c;let b=c-y;if(b===c||u-l<=8*Number.EPSILON*Math.max(1,c))break;if(c=b>=l&&b<=u?b:(l+u)/2,m===31)throw new Error("Mollweide forward did not converge")}var h=2*Math.SQRT2/Math.PI*e.a*i*Math.sin(c/2)+e.x0,d=Math.sign(n)*Math.SQRT2*e.a*Math.cos(c/2)+e.y0;return t.x=h,t.y=d,t}function tB(e,t){let r=t.x-e.x0,n=(t.y-e.y0)/(Math.SQRT2*e.a);if(Math.abs(n)>1+8*Number.EPSILON)return null;let i=r/(2*Math.SQRT2*e.a),o=i*i+n*n;if(!e.over&&o>1+8*Number.EPSILON)return null;let s=2*Math.acos(Math.min(1,Math.abs(n))),a=Math.sin(s/2);if(!e.over&&Math.abs(o-1)<=8*Number.EPSILON&&(a=Math.min(1,Math.abs(i)),s=2*Math.asin(a)),a===0&&Math.abs(r)>8*Number.EPSILON*e.a)return null;let c=a===0?0:Math.PI*i/a;var l=G(e.long0+c,e.over),u=Math.sign(n)*(Math.PI/2-2*Math.asin(Math.sqrt(nB(s)/(2*Math.PI))));return t.x=l,t.y=u,t}function rB(e,t={}){let r={...e,...t};return dX(r),r}function nB(e){if(e>.5)return e-Math.sin(e);let t=e*e;return e*t*(1/6+t*(-1/120+t*(1/5040+t*(-1/362880+t*(1/39916800+t*(-1/6227020800+t/1307674368e3))))))}var iB=p(()=>{_t()});var m_,oB=p(()=>{Ct();et();ut();Ut();iB();m_={name:"moll",aliases:["Mollweide"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=rB(t),n=Ie("moll",e,r,eB,tB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function mX(e){e.A=[],e.A[1]=.6399175073,e.A[2]=-.1358797613,e.A[3]=.063294409,e.A[4]=-.02526853,e.A[5]=.0117879,e.A[6]=-.0055161,e.A[7]=.0026906,e.A[8]=-.001333,e.A[9]=67e-5,e.A[10]=-34e-5,e.B_re=[],e.B_im=[],e.B_re[1]=.7557853228,e.B_im[1]=0,e.B_re[2]=.249204646,e.B_im[2]=.003371507,e.B_re[3]=-.001541739,e.B_im[3]=.04105856,e.B_re[4]=-.10162907,e.B_im[4]=.01727609,e.B_re[5]=-.26623489,e.B_im[5]=-.36249218,e.B_re[6]=-.6870983,e.B_im[6]=-1.1651967,e.C_re=[],e.C_im=[],e.C_re[1]=1.3231270439,e.C_im[1]=0,e.C_re[2]=-.577245789,e.C_im[2]=-.007809598,e.C_re[3]=.508307513,e.C_im[3]=-.112208952,e.C_re[4]=-.15094762,e.C_im[4]=.18200602,e.C_re[5]=1.01418179,e.C_im[5]=1.64497696,e.C_re[6]=1.9660549,e.C_im[6]=2.5127645,e.D=[],e.D[1]=1.5627014243,e.D[2]=.5185406398,e.D[3]=-.03333098,e.D[4]=-.1052906,e.D[5]=-.0368594,e.D[6]=.007317,e.D[7]=.0122,e.D[8]=.00394,e.D[9]=-.0013}function sB(e,t){var r,n=t.x,i=t.y,o=i-e.lat0,s=n-e.long0,a=o/Cf*1e-5,c=s,l=1,u=0;for(r=1;r<=10;r++)l=l*a,u=u+e.A[r]*l;var h=u,d=c,m=1,g=0,y,b,w=0,_=0;for(r=1;r<=6;r++)y=m*h-g*d,b=g*h+m*d,m=y,g=b,w=w+e.B_re[r]*m-e.B_im[r]*g,_=_+e.B_im[r]*m+e.B_re[r]*g;return t.x=_*e.a+e.x0,t.y=w*e.a+e.y0,t}function aB(e,t){var r,n=t.x,i=t.y,o=n-e.x0,s=i-e.y0,a=s/e.a,c=o/e.a,l=1,u=0,h,d,m=0,g=0;for(r=1;r<=6;r++)h=l*a-u*c,d=u*a+l*c,l=h,u=d,m=m+e.C_re[r]*l-e.C_im[r]*u,g=g+e.C_im[r]*l+e.C_re[r]*u;for(var y=0;y<e.iterations;y++){var b=m,w=g,_,S,M=a,v=c;for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,M=M+(r-1)*(e.B_re[r]*b-e.B_im[r]*w),v=v+(r-1)*(e.B_im[r]*b+e.B_re[r]*w);b=1,w=0;var C=e.B_re[1],R=e.B_im[1];for(r=2;r<=6;r++)_=b*m-w*g,S=w*m+b*g,b=_,w=S,C=C+r*(e.B_re[r]*b-e.B_im[r]*w),R=R+r*(e.B_im[r]*b+e.B_re[r]*w);var E=C*C+R*R;m=(M*C+v*R)/E,g=(v*C-M*R)/E}var j=m,I=g,O=1,A=0;for(r=1;r<=9;r++)O=O*j,A=A+e.D[r]*O;var W=e.lat0+A*Cf*1e5,k=e.long0+I;return t.x=k,t.y=W,t}function cB(e,t={}){let r={...e,A:[],B_re:[],B_im:[],C_re:[],C_im:[],D:[],iterations:1,...t};return mX(r),r}var lB=p(()=>{Bt()});var p_,uB=p(()=>{Ha();et();ut();Ut();lB();Wt();p_={name:"nzmg",aliases:["New_Zealand_Map_Grid"],parameters:["lon_0","x_0","y_0","lat_0","iterations"],create(e){let t=Ae(e),r=re(e.parameters,"iterations",1);if(!Number.isInteger(r)||r<0||r>10)throw new Error("NZMG iterations must be an integer from 0 to 10");if(!Object.prototype.hasOwnProperty.call(e.parameters,"lat_0")||!Object.prototype.hasOwnProperty.call(e.parameters,"lon_0"))throw new Error("NZMG requires lat_0 and lon_0");let n=cB(t,{iterations:r}),i=Ie("nzmg",e,n,sB,aB);return De(i,Q(t.long0-Math.PI/22.5,Math.max(-Math.PI/2,t.lat0-Math.PI/22.5),t.long0+Math.PI/22.5,Math.min(Math.PI/2,t.lat0+Math.PI/22.5)),o=>zO(Gt(n,e),o),t.primeMeridian,t.over)}}});function pX(e){return e.no_uoff||e.no_off||["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(e.projName.toLowerCase().replace(/[ _-]/g,""))}function gX(e){var t,r,n,i,o,s,a,c,l,u,h=0,d,m=0,g=0,y=0,b=0,w=0,_=0;e.k0||(e.k0=1),e.no_off=pX(e),e.no_rot=e.no_rot;var S=!1;Number.isFinite(e.alpha)&&(S=!0);var M=!1;if(Number.isFinite(e.rectified_grid_angle)&&(M=!0),S&&(_=e.alpha),M&&(h=e.rectified_grid_angle,S||(_=0,S=!0)),S||M)m=e.longc;else if(g=e.long1,b=e.lat1,y=e.long2,w=e.lat2,Math.abs(b-w)<=$u||Math.abs(b)<=$u||Math.abs(Math.abs(b)-F)<=$u||Math.abs(Math.abs(e.lat0)-F)<=$u||Math.abs(Math.abs(w)-F)<=$u)throw new Error;var v=1-e.es;if(r=Math.sqrt(v),Math.abs(e.lat0)>1e-10?(c=Math.sin(e.lat0),n=Math.cos(e.lat0),t=1-e.es*c*c,e.B=n*n,e.B=Math.sqrt(1+e.es*e.B*e.B/v),e.A=e.B*e.k0*r/t,i=e.B*r/(n*Math.sqrt(t)),o=i*i-1,o<=0?o=0:(o=Math.sqrt(o),e.lat0<0&&(o=-o)),e.E=o+=i,e.E*=Math.pow(Qr(e.e,e.lat0,c),e.B)):(e.B=1/r,e.A=e.k0,e.E=i=o=1),S||M){S?(d=Math.asin(Math.sin(_)/i),M||(h=_)):(d=h,_=Math.asin(i*Math.sin(d)));let C=.5*(o-1/o)*Math.tan(d);i>1&&Math.abs(Math.cos(_))<=8*Number.EPSILON?C=Math.sign(e.lat0)*Math.sign(Math.sin(_)):Math.abs(C)>1&&Math.abs(C)<=1+8*Number.EPSILON&&(C=Math.sign(C)),e.lam0=m-Math.asin(C)/e.B}else s=Math.pow(Qr(e.e,b,Math.sin(b)),e.B),a=Math.pow(Qr(e.e,w,Math.sin(w)),e.B),o=e.E/s,l=(a-s)/(a+s),u=e.E*e.E,u=(u-a*s)/(u+a*s),t=g-y,t<-Math.PI?y-=Gs:t>Math.PI&&(y+=Gs),e.lam0=G(.5*(g+y)-Math.atan(u*Math.tan(.5*e.B*(g-y))/l)/e.B,e.over),d=Math.atan(2*Math.sin(e.B*G(g-e.lam0,e.over))/(o-1/o)),h=_=Math.asin(i*Math.sin(d));e.singam=Math.sin(d),e.cosgam=Math.cos(d),e.sinrot=Math.sin(h),e.cosrot=Math.cos(h),e.rB=1/e.B,e.ArB=e.A*e.rB,e.BrA=1/e.ArB,e.no_off?e.u_0=0:(e.u_0=Math.abs(e.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(_))),e.lat0<0&&(e.u_0=-e.u_0)),o=.5*d,e.v_pole_n=e.ArB*Math.log(Math.tan(tt-o)),e.v_pole_s=e.ArB*Math.log(Math.tan(tt+o))}function fB(e,t){var r=t,n,i,o,s,a,c,l,u;if(t.x=t.x-e.lam0,Math.abs(Math.abs(t.y)-F)>1e-10){if(a=e.E/Math.pow(Qr(e.e,t.y,Math.sin(t.y)),e.B),c=1/a,n=.5*(a-c),i=.5*(a+c),s=Math.sin(e.B*t.x),o=(n*e.singam-s*e.cosgam)/i,Math.abs(Math.abs(o)-1)<1e-10)throw new Error;u=.5*e.ArB*Math.log((1-o)/(1+o)),c=Math.cos(e.B*t.x),Math.abs(c)<$u?l=e.A*t.x:l=e.ArB*Math.atan2(n*e.cosgam+s*e.singam,c)}else u=t.y>0?e.v_pole_n:e.v_pole_s,l=e.ArB*t.y;return e.no_rot?(r.x=l,r.y=u):(l-=e.u_0,r.x=u*e.cosrot+l*e.sinrot,r.y=l*e.cosrot-u*e.sinrot),r.x=e.a*r.x+e.x0,r.y=e.a*r.y+e.y0,r}function hB(e,t){var r,n,i,o,s,a,c,l=t;if(t.x=(t.x-e.x0)*(1/e.a),t.y=(t.y-e.y0)*(1/e.a),e.no_rot?(n=t.y,r=t.x):(n=t.x*e.cosrot-t.y*e.sinrot,r=t.y*e.cosrot+t.x*e.sinrot+e.u_0),i=Math.exp(-e.BrA*n),o=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(e.BrA*r),c=(a*e.cosgam+o*e.singam)/s,Math.abs(Math.abs(c)-1)<1e-10)l.x=0,l.y=c<0?-F:F;else{if(l.y=e.E/Math.sqrt((1+c)/(1-c)),l.y=gc(e.e,Math.pow(l.y,1/e.B)),l.y===1/0)throw new Error;l.x=-e.rB*Math.atan2(o*e.cosgam-a*e.singam,Math.cos(e.BrA*r))}return l.x+=e.lam0,l}function dB(e,t={}){let r={...e,no_off:!1,no_rot:!1,alpha:NaN,rectified_grid_angle:NaN,longc:0,long1:0,long2:0,B:0,A:0,E:0,lam0:0,singam:0,cosgam:0,sinrot:0,cosrot:0,rB:0,ArB:0,BrA:0,u_0:0,v_pole_n:0,v_pole_s:0,no_uoff:!1,projName:"",...t};return gX(r),r}var $u,mB=p(()=>{Nf();_t();Um();Bt();$u=1e-7});var g_,pB=p(()=>{Ha();et();ut();Ut();mB();Wt();Gn();g_={name:"omerc",aliases:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0","alpha","gamma","lonc","lon_1","lon_2","lat_1","lat_2","no_off","no_uoff","no_rot"],flags:["no_off","no_uoff","no_rot"],create(e){let t=Ae(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Oblique Mercator origin must be away from the poles");let n=Object.prototype.hasOwnProperty.call(e.parameters,"alpha")||Object.prototype.hasOwnProperty.call(e.parameters,"gamma")?["lonc"]:["lon_1","lat_1","lon_2","lat_2"];for(let s of n)if(!Object.prototype.hasOwnProperty.call(e.parameters,s))throw new Error("Oblique Mercator requires "+s);let i=dB(t,{projName:e.parameters.proj||"omerc",alpha:re(e.parameters,"alpha",NaN)*Math.PI/180,rectified_grid_angle:re(e.parameters,"gamma",NaN)*Math.PI/180,longc:re(e.parameters,"lonc",0)*Math.PI/180,long1:re(e.parameters,"lon_1",0)*Math.PI/180,long2:re(e.parameters,"lon_2",0)*Math.PI/180,no_off:Oi(e.parameters,"no_off"),no_uoff:Oi(e.parameters,"no_uoff"),no_rot:Oi(e.parameters,"no_rot")}),o=Ie("omerc",e,i,fB,hB);return De(o,Q(i.lam0-Math.PI/18,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/18),i.lam0+Math.PI/18,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/18)),s=>UO(Gt(i,e),s),t.primeMeridian,t.over)}}});function gB(e){let t=Math.sin(e.lat0),r=Math.cos(e.lat0),n=1/Math.sqrt(1-e.es*t*t);return{...e,sin0:t,cos0:r,originY:-e.es*n*t*r}}function yB(e,t){let r=G(t.x-e.long0,e.over),n=Math.sin(t.y),i=Math.cos(t.y),o=1/Math.sqrt(1-e.es*n*n);return t.x=e.x0+e.a*e.k0*o*i*Math.sin(r),t.y=e.y0+e.a*e.k0*(o*((1-e.es)*n*e.cos0-i*Math.cos(r)*e.sin0)-e.originY),t}function bB(e,t){let r=(t.x-e.x0)/(e.a*e.k0),n=(t.y-e.y0)/(e.a*e.k0)+e.originY,i=1-e.es,o=e.cos0*e.cos0+e.sin0*e.sin0/i,s=n*e.sin0*e.cos0*e.es/i,a=r*r+n*n*(e.sin0*e.sin0+e.cos0*e.cos0/i)-1,c=s*s-o*a;if(c<-32*Number.EPSILON*o)throw new Error("Coordinate is outside the orthographic ellipse");let l=(-s+Math.sqrt(Math.max(0,c)))/o,u=l*e.cos0-n*e.sin0,h=l*e.sin0+n*e.cos0;return t.x=G(e.long0+Math.atan2(r,u),e.over),t.y=Math.atan2(h,i*Math.hypot(u,r)),t}var wB=p(()=>{_t()});var y_,xB=p(()=>{qs();Vs();Ut();wB();y_={name:"ortho",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=gB(t);return wn(Ie("ortho",e,r,yB,bB,$a(t,0,!0)),t,Math.PI/2,(n,i)=>Z8(Gt(t,e),n,i),Math.PI/2)}}});function yX(e){e.meridianPole=ci(e.a,e.es,0,Math.PI/2),e.poleRadius=e.a/Math.sqrt(1-e.es),e.ml0=ci(e.a,e.es,0,e.lat0)}function MB(e,t){var r=t.x,n=t.y,i,o,s,a=G(r-e.long0,e.over);if(s=a*Math.sin(n),e.sphere)n===0?(i=e.a*a,o=-1*e.a*e.lat0):(i=e.a*Math.sin(s)/Math.tan(n),o=e.a*(n-e.lat0+2*Math.sin(s/2)**2/Math.tan(n)));else if(n===0)i=e.a*a,o=-1*e.ml0;else{var c=ju(e.a,e.e,Math.sin(n))/Math.tan(n);i=c*Math.sin(s),o=ci(e.a,e.es,e.lat0,n)+c*(2*Math.sin(s/2)**2)}return t.x=i+e.x0,t.y=o+e.y0,t}function vB(e,t){var r,n,i,o,s,a,c,l,u;i=t.x-e.x0,o=t.y-e.y0;let h=o+(e.sphere?e.a*e.lat0:e.ml0),d=h<0?-1:1,g=(e.sphere?e.a*Math.PI/2:e.meridianPole)-d*h,y=Math.hypot(i,g);if(y/e.a<1e-6)return t.x=G(e.long0+Math.atan2(i,g),e.over),t.y=d*(Math.PI/2-y/e.poleRadius),t;if(e.sphere)if(Math.abs(o+e.a*e.lat0)<=1e-10)r=G(i/e.a+e.long0,e.over),n=0;else{a=e.lat0+o/e.a,c=i*i/e.a/e.a+a*a,l=a;var b;for(s=_B;s;--s)if(b=Math.tan(l),u=-1*(a*(l*b+1)-l-.5*(l*l+c)*b)/((l-a)/b-1),l+=u,Math.abs(u)<=1e-14){n=l;break}if(n=SB(e,n===void 0?l:n,i,o),n===void 0)return null;l=n,r=G(e.long0+Math.asin(i*Math.tan(l)/e.a)/Math.sin(n),e.over)}else if(Math.abs(o+e.ml0)<=1e-10)n=0,r=G(e.long0+i/e.a,e.over);else{a=(e.ml0+o)/e.a,c=i*i/e.a/e.a+a*a,l=a;var w,_,S,M,v;for(s=_B;s;--s)if(v=e.e*Math.sin(l),w=Math.sqrt(1-v*v)*Math.tan(l),_=ci(e.a,e.es,0,l),S=(1-e.es)/Math.pow(1-v*v,1.5),M=_/e.a,u=(a*(w*M+1)-M-.5*w*(M*M+c))/(e.es*Math.sin(2*l)*(M*M+c-2*a*M)/(4*w)+(a-M)*(w*S-2/Math.sin(2*l))-S),l-=u,Math.abs(u)<=1e-14){n=l;break}if(n=SB(e,n===void 0?l:n,i,o),n===void 0)return null;l=n,w=Math.sqrt(1-e.es*Math.pow(Math.sin(n),2))*Math.tan(n),r=G(e.long0+Math.asin(i*w/e.a)/Math.sin(n),e.over)}return t.x=r,t.y=n,t}function EB(e,t={}){let r={...e,ml0:0,meridianPole:0,poleRadius:0,...t};return yX(r),r}function SB(e,t,r,n){for(let i=0;i<8;i++){if(!Number.isFinite(t)||Math.abs(t)>=Math.PI/2)return;let o=Math.sin(t),s=Math.cos(t),a=1-e.es*o*o,c=e.sphere?e.a:ju(e.a,e.e,o),l=c/Math.tan(t),u=Math.asin(r/l),h=l*Math.sin(u),d=2*Math.sin(u/2)**2,m=e.sphere?e.a*(t-e.lat0):ci(e.a,e.es,e.lat0,t),g=l*d,b=m+g-n;if(Math.abs(h-r)<=64*Number.EPSILON*Math.max(e.a,Math.abs(r))&&Math.abs(b)<=64*Number.EPSILON*Math.max(Math.abs(n),Math.abs(m),Math.abs(g),e.a*Math.max(Math.abs(t),Math.abs(e.lat0))))return t;let w=e.sphere?e.a:e.a*(1-e.es)/Math.pow(a,1.5),_=c*((e.sphere?0:e.es*s*s/a)-1/(o*o)),S=w+_*(-d/Math.cos(u)),M=b/S;if(!Number.isFinite(M)||Math.abs(M)>1e-6)return;t-=M}}var _B,TB=p(()=>{_t();Yx();Wx();_B=20});var b_,AB=p(()=>{Ha();et();ut();Ut();TB();b_={name:"poly",aliases:["Polyconic","American_Polyconic"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=EB(t),n=Ie("poly",e,r,MB,vB);return De(n,Q(t.long0-Math.PI/6,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/2+1e-8),t.long0+Math.PI/6,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/2-1e-8)),i=>FO(Gt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function bX(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0,e.lat_ts=e.lat_ts||0,e.lat0>=F-tt/2?e.face=jt.TOP:e.lat0<=-(F-tt/2)?e.face=jt.BOTTOM:Math.abs(e.long0)<=tt?e.face=jt.FRONT:Math.abs(e.long0)<=F+tt?e.face=e.long0>0?jt.RIGHT:jt.LEFT:e.face=jt.BACK,e.es!==0&&(e.one_minus_f=1-(e.a-e.b)/e.a,e.one_minus_f_squared=e.one_minus_f*e.one_minus_f)}function IB(e,t){var r=t,n,i,o,s,a,c,l=0;if(t.x-=e.long0,e.es!==0?n=Math.atan(e.one_minus_f_squared*Math.tan(t.y)):n=t.y,i=t.x,e.face===jt.TOP)s=F-n,i>=tt&&i<=F+tt?(l=mt.AREA_0,o=i-F):i>F+tt||i<=-(F+tt)?(l=mt.AREA_1,o=i>0?i-Math.PI:i+Math.PI):i>-(F+tt)&&i<=-tt?(l=mt.AREA_2,o=i+F):(l=mt.AREA_3,o=i);else if(e.face===jt.BOTTOM)s=F+n,i>=tt&&i<=F+tt?(l=mt.AREA_0,o=-i+F):i<tt&&i>=-tt?(l=mt.AREA_1,o=-i):i<-tt&&i>=-(F+tt)?(l=mt.AREA_2,o=-i-F):(l=mt.AREA_3,o=i>0?-i+Math.PI:-i-Math.PI);else{var u,h,d,m,g,y,b;e.face===jt.RIGHT?i=Ku(i,+F):e.face===jt.BACK?i=Ku(i,+Math.PI):e.face===jt.LEFT&&(i=Ku(i,-F)),m=Math.sin(n),g=Math.cos(n),y=Math.sin(i),b=Math.cos(i),u=g*b,h=g*y,d=m,e.face===jt.FRONT?(s=Math.atan2(Math.hypot(h,d),u),o=p1(s,d,h)):e.face===jt.RIGHT?(s=Math.atan2(Math.hypot(u,d),h),o=p1(s,d,-u)):e.face===jt.BACK?(s=Math.atan2(Math.hypot(h,d),-u),o=p1(s,d,-h)):e.face===jt.LEFT?(s=Math.atan2(Math.hypot(u,d),-h),o=p1(s,d,u)):s=o=0,Math.abs(o)<=tt?l=mt.AREA_0:o>tt&&o<=F+tt?(l=mt.AREA_1,o-=F):o>F+tt||o<=-(F+tt)?(l=mt.AREA_2,o=o>=0?o-Math.PI:o+Math.PI):(l=mt.AREA_3,o+=F)}return c=Math.atan(12/Math.PI*(o+Math.acos(Math.sin(o)*Math.cos(tt))-F)),a=Math.sqrt(2*Math.sin(s/2)**2/(Math.cos(c)*Math.cos(c))/(1-Math.cos(Math.atan(1/Math.cos(o))))),l===mt.AREA_1?c+=F:l===mt.AREA_2?c+=Math.PI:l===mt.AREA_3&&(c+=1.5*Math.PI),r.x=a*Math.cos(c),r.y=a*Math.sin(c),r.x=r.x*e.a+e.x0,r.y=r.y*e.a+e.y0,t}function PB(e,t){var r=0,n=0,i,o,s,a,c,l,u,h,d=0;t.x=(t.x-e.x0)/e.a,t.y=(t.y-e.y0)/e.a,i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d=mt.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d=mt.AREA_1,i-=F):t.x<0&&-t.x>=Math.abs(t.y)?(d=mt.AREA_2,i=i<0?i+Math.PI:i-Math.PI):(d=mt.AREA_3,i+=F),h=Math.PI/12*Math.tan(i),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),c=Math.atan(a),o=Math.cos(i),s=Math.hypot(t.x,t.y);let m=o*o*s*s*(1-Math.cos(Math.atan(1/Math.cos(c))));if(l=1-m,l<-1?l=-1:l>1&&(l=1),e.face===jt.TOP)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=F-u,d===mt.AREA_0?r=c+F:d===mt.AREA_1?r=c<0?c+Math.PI:c-Math.PI:d===mt.AREA_2?r=c-F:r=c;else if(e.face===jt.BOTTOM)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=u-F,d===mt.AREA_0?r=-c+F:d===mt.AREA_1?r=-c:d===mt.AREA_2?r=-c-F:r=c<0?-c-Math.PI:-c+Math.PI;else{var g,y,b;g=l;let w=Math.sqrt(Math.max(0,m*(2-m)));b=w*Math.sin(c),y=w*Math.cos(c),d===mt.AREA_1?(h=y,y=-b,b=h):d===mt.AREA_2?(y=-y,b=-b):d===mt.AREA_3&&(h=y,y=b,b=-h),e.face===jt.RIGHT?(h=g,g=-y,y=h):e.face===jt.BACK?(g=-g,y=-y):e.face===jt.LEFT&&(h=g,g=y,y=-h),n=Math.atan2(b,Math.hypot(g,y)),r=Math.atan2(y,g),e.face===jt.RIGHT?r=Ku(r,-F):e.face===jt.BACK?r=Ku(r,-Math.PI):e.face===jt.LEFT&&(r=Ku(r,+F))}return e.es!==0&&(n=Math.atan2(Math.sin(n),e.one_minus_f_squared*Math.cos(n))),r+=e.long0,t.x=r,t.y=n,t}function p1(e,t,r){return e===0?0:Math.atan2(t,r)}function Ku(e,t){var r=e+t;return r<-Math.PI?r+=Gs:r>+Math.PI&&(r-=Gs),r}function RB(e,t={}){let r={...e,face:0,one_minus_f:0,one_minus_f_squared:0,...t};return bX(r),r}var jt,mt,LB=p(()=>{Bt();jt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},mt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4}});var w_,OB=p(()=>{uc();Hh();Ut();Wt();LB();et();ut();pc();Ct();w_={name:"qsc",aliases:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Ae(e),r=e.primeMeridian??0,n=RB(t),i=Ie("qsc",e,n,IB,PB),o=re(e.parameters,"x_0",0),s=re(e.parameters,"y_0",0);return{...i,longitudeOrigin:t.long0,getRenderingProfile(a){if(a)return ur(h=>{let d=w=>t.es?Math.atan((1-t.es)*Math.tan(w)):w,m=Q(h[0][0]-t.long0,d(h[0][1]),h[1][0]-t.long0,d(h[1][1])),g=n.face===5?[0,0,1]:n.face===6?[0,0,-1]:[1,0,0],y=dt(g,m)[0],b=t.a*Math.sqrt((1-y)/(.5*(1-Math.SQRT1_2)));return lt([o-b,o+b],[s-b,s+b])},a,t.long0,r);let c=[[o-t.a,s-t.a,0],[o+t.a,s+t.a,0]],l=Va(e.parameters,r)().normalize,u=Ds(h=>{let[d,m]=i.forward(h.x,h.y);Math.abs(d-o)<=t.a&&Math.abs(m-s)<=t.a||([h.x,h.y]=i.inverse(o+Math.max(-t.a,Math.min(t.a,d-o)),s+Math.max(-t.a,Math.min(t.a,m-s))))},r);return{bounds:c,normalize(h){l(h),u(h)}}}}}}});function _X(e,t,r,n,i){for(var o=r;i;--i){var s=(g1(e,o)-t)/xX(e,o);if(o-=s,Math.abs(s)<n)break}return o}function SX(e){e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.es=0}function NB(e,t){var r=G(t.x-e.long0,e.over),n=Math.abs(t.y),i=Math.floor(n*DB+1e-15);i<0?i=0:i>=ll&&(i=ll),n=$y*(n-wX*i);var o=g1(Xu[i],n)*r,s=g1(Ka[i],n);return t.y<0&&(s=-s),t.x=o*e.a*CB+e.x0,t.y=s*e.a*BB+e.y0,t}function FB(e,t){var r=t.y,n=t;n.x=(n.x-e.x0)/(e.a*CB),n.y=Math.abs(r-e.y0)/(e.a*BB);for(let a=0;a<=ll;a++)if(Math.abs(n.y-Ka[a][0])<=8*Number.EPSILON)return n.x=G(n.x/Xu[a][0]+e.long0,e.over),n.y=(r<e.y0?-1:1)*a*5*Hy,n;if(n.y>=1)n.x/=Xu[ll][0],n.y=r<0?-F:F;else{var i=Math.floor(n.y*ll);for(i<0?i=0:i>=ll&&(i=ll-1);;)if(Ka[i][0]>n.y)--i;else if(Ka[i+1][0]<=n.y)++i;else break;var o=Ka[i],s=5*(n.y-o[0])/(Ka[i+1][0]-o[0]);s=_X(o,n.y,s,1e-10,100),n.x/=g1(Xu[i],s),n.y=(5*i+s)*Hy,r<0&&(n.y=-n.y)}return n.x=G(n.x+e.long0,e.over),n}function kB(e,t={}){let r={...e,...t};return SX(r),r}var Xu,Ka,CB,BB,DB,wX,ll,g1,xX,GB=p(()=>{Bt();_t();Xu=[[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]],Ka=[[-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]];Xu=Xu.map(e=>e.map(Math.fround));Ka=Ka.map(e=>e.map(Math.fround));CB=.8487,BB=1.3523,DB=$y/5,wX=1/DB,ll=18,g1=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},xX=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])}});var x_,UB=p(()=>{Ct();et();ut();Ut();GB();x_={name:"robin",aliases:["Robinson"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=kB(t),n=Ie("robin",e,r,NB,FB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});var __,jB=p(()=>{Ct();et();ut();Ut();t_();__={name:"sinu",aliases:["Sinusoidal"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=nC(t),n=Ie("sinu",e,r,f1,h1);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>Br(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function MX(e){e.k0||(e.k0=1);var t=e.lat0;e.lambda0=e.long0;var r=Math.sin(t),n=e.a,i=e.rf,o=1/i,s=2*o-Math.pow(o,2);e.e=Math.sqrt(s);var a=e.e;e.R=e.k0*n*Math.sqrt(1-s)/(1-s*Math.pow(r,2)),e.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(t),4)),e.b0=Math.asin(r/e.alpha);var c=Math.log(Math.tan(Math.PI/4+e.b0/2)),l=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+a*r)/(1-a*r));e.K=c-e.alpha*l+e.alpha*a/2*u}function zB(e,t){let r=e.e*Math.sin(t.y),n=2*Math.atan(Math.exp(e.alpha*(Math.log(Math.tan(Math.PI/4+t.y/2))-e.e/2*Math.log((1+r)/(1-r)))+e.K))-Math.PI/2,i=e.alpha*(t.x-e.lambda0),o=Math.cos(n),s=Math.asin(Math.cos(e.b0)*Math.sin(n)-Math.sin(e.b0)*o*Math.cos(i)),a=Math.asin(o*Math.sin(i)/Math.cos(s));return t.x=e.x0+e.R*a,t.y=e.y0+e.R*Math.log(Math.tan(Math.PI/4+s/2)),t}function qB(e,t){let r=(t.x-e.x0)/e.R,n=2*(Math.atan(Math.exp((t.y-e.y0)/e.R))-Math.PI/4),i=Math.asin(Math.cos(e.b0)*Math.sin(n)+Math.sin(e.b0)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),s=(e.K-Math.log(Math.tan(Math.PI/4+i/2)))/e.alpha;for(let a=0;a<6;a++){let c=e.e*Math.sin(i),l=(s+Math.log(Math.tan(Math.PI/4+i/2))-e.e/2*Math.log((1+c)/(1-c)))*(1-c*c)*Math.cos(i)/(1-e.es);if(i-=l,Math.abs(l)<1e-10)return t.x=e.lambda0+o/e.alpha,t.y=i,t}return null}function VB(e,t={}){let r={...e,lambda0:0,rf:0,R:0,alpha:0,b0:0,K:0,...t};return MX(r),r}var WB=p(()=>{});var S_,HB=p(()=>{Ha();et();ut();Ut();WB();S_={name:"somerc",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Ae(e),r=VB(t,{rf:t.a===t.b?1/0:1/(1-t.b/t.a)}),n=Ie("somerc",e,r,zB,qB);return De(n,Q(t.long0-Math.PI/18,Math.max(-Math.PI/2+1e-8,t.lat0-Math.PI/18),t.long0+Math.PI/18,Math.min(Math.PI/2-1e-8,t.lat0+Math.PI/18)),i=>GO(Gt(r,e),i),t.primeMeridian,t.over)}}});function vX(e){if(Math.abs(Math.abs(e.lat0)-F)<1e-10?e.mode=e.lat0<0?Kr.S_POLE:Kr.N_POLE:Math.abs(e.lat0)<1e-10?e.mode=Kr.EQUIT:(e.mode=Kr.OBLIQ,e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0)),e.pn1=e.h/e.a,e.pn1<=0||e.pn1>1e10)throw new Error("Invalid height");e.p=1+e.pn1,e.rp=1/e.p,e.h1=1/e.pn1,e.pfact=(e.p+1)*e.h1,e.es=0;var t=e.tilt,r=e.azi;e.cg=Math.cos(r),e.sg=Math.sin(r),e.cw=Math.cos(t),e.sw=Math.sin(t)}function $B(e,t){t.x-=e.long0;var r=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),o,s;switch(e.mode){case Kr.OBLIQ:s=e.sinph0*r+e.cosph0*n*i;break;case Kr.EQUIT:s=n*i;break;case Kr.S_POLE:s=-r;break;case Kr.N_POLE:s=r;break}switch(s=e.pn1/(e.p-s),o=s*n*Math.sin(t.x),e.mode){case Kr.OBLIQ:s*=e.cosph0*r-e.sinph0*n*i;break;case Kr.EQUIT:s*=r;break;case Kr.N_POLE:s*=-(n*i);break;case Kr.S_POLE:s*=n*i;break}var a,c;return a=s*e.cg+o*e.sg,c=1/(a*e.sw*e.h1+e.cw),o=(o*e.cg-s*e.sg)*e.cw*c,s=a*c,t.x=o*e.a,t.y=s*e.a,t}function KB(e,t){t.x/=e.a,t.y/=e.a;var r=t.x,n=t.y,i,o,s;s=1/(e.pn1-t.y*e.sw),i=e.pn1*t.x*s,o=e.pn1*t.y*e.cw*s,t.x=i*e.cg+o*e.sg,t.y=o*e.cg-i*e.sg;var a=tr(t.x,t.y);if(Math.abs(a)<1e-10)r=0,n=e.lat0;else{var c,l;switch(l=1-a*a*e.pfact,l=(e.p-Math.sqrt(l))/(e.pn1/a+a/e.pn1),c=Math.sqrt(1-l*l),e.mode){case Kr.OBLIQ:n=Math.asin(c*e.sinph0+t.y*l*e.cosph0/a),t.y=(c-e.sinph0*Math.sin(n))*a,t.x*=l*e.cosph0;break;case Kr.EQUIT:n=Math.asin(t.y*l/a),t.y=c*a,t.x*=l;break;case Kr.N_POLE:n=Math.asin(c),t.y=-t.y;break;case Kr.S_POLE:n=-Math.asin(c);break}r=Math.atan2(t.x,t.y)}return t.x=r+e.long0,t.y=n,t}function XB(e,t={}){let r={...e,mode:0,sinph0:0,cosph0:0,pn1:0,h:0,p:0,rp:0,h1:0,pfact:0,tilt:0,azi:0,cg:0,sg:0,cw:0,sw:0,...t};return vX(r),r}var Kr,YB=p(()=>{Bt();dc();Kr={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3}});var M_,ZB=p(()=>{qs();Vs();Ut();YB();Wt();M_={name:"tpers",aliases:["Tilted_Perspective"],parameters:["lon_0","x_0","y_0","lat_0","h","tilt","azi"],create(e){let t=Ae(e),r=re(e.parameters,"h",1e5),n=re(e.parameters,"tilt",0)*Math.PI/180,i=re(e.parameters,"azi",0)*Math.PI/180;if(Math.abs(n)>=Math.PI/2)throw new Error("Perspective tilt must be between -90 and 90 degrees");let o=XB(t,{h:r,tilt:n,azi:i}),s=1+r/t.a,a=Math.acos(1/s),c=Math.abs(n),l=s*Math.cos(c)<1?c-Math.acos(s*Math.cos(c)):a,u=Math.min(a,l)*(1-1e-10);return wn(Ie("tpers",e,o,$B,KB,$a(t,1/(1+r/t.a))),t,u,(h,d)=>eT(Gt(t,e),s,n,i,h,d),a)}}});function EX(e){e.R=e.a}function JB(e,t){var r=t.x,n=t.y,i=G(r-e.long0,e.over),o,s;if(Math.abs(n)<=1e-10)return o=e.x0+e.R*i,s=e.y0,t.x=o,t.y=s,t;var a=al(2*Math.abs(n/Math.PI));if(Math.abs(i)<=1e-10||Math.abs(Math.abs(n)-F)<=1e-10)return o=e.x0,n>=0?s=e.y0+Math.PI*e.R*Math.tan(.5*a):s=e.y0+Math.PI*e.R*-Math.tan(.5*a),t.x=o,t.y=s,t;var c=.5*Math.abs(Math.PI/i-i/Math.PI),l=c*c,u=Math.sin(a),h=Math.cos(a),d=h/(u-2*Math.sin(a/2)**2),m=d*d,g=d*(2/u-1),y=g*g,b=Math.sqrt(l*(d-y)*(d-y)-(y+l)*(m-y)),w=Math.PI*e.R*(y-m)/(b-c*(d-y));i<0&&(w=-w),o=e.x0+w;var _=l+d;return w=Math.PI*e.R*(l*(2*d-1)+m)/(g*_+c*Math.sqrt((y+l)*(l+1)-_*_)),n>=0?s=e.y0+w:s=e.y0-w,t.x=o,t.y=s,t}function QB(e,t){var r,n,i,o,s,a,c,l,u,h,d,m,g;return t.x-=e.x0,t.y-=e.y0,Math.abs(t.y)<1e-10?(t.x=G(e.long0+t.x/e.R,e.over),t.y=0,t):(d=Math.PI*e.R,i=t.x/d,o=t.y/d,s=i*i+o*o,a=-Math.abs(o)*(1+s),c=a-2*o*o+i*i,l=-2*a+1+2*o*o+s*s,g=o*o/l+(2*c*c*c/l/l/l-9*a*c/l/l)/27,u=(a-c*c/3/l)/l,h=2*Math.sqrt(-u/3),d=3*g/u/h,Math.abs(d)>1&&(d>=0?d=1:d=-1),m=Math.acos(d)/3,t.y>=0?n=(-h*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI:n=-(-h*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI,Math.abs(i)<1e-10?r=e.long0:r=G(e.long0+2*Math.PI*i/(Math.sqrt(1+2*(i*i-o*o)+s*s)+1-s),e.over),t.x=r,t.y=n,t)}function eD(e,t={}){let r={...e,R:0,...t};return EX(r),r}var tD=p(()=>{_t();Bt();u1()});var v_,rD=p(()=>{Ct();et();ut();Ut();tD();v_={name:"vandg",aliases:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten"],parameters:["lon_0","x_0","y_0"],create(e){let t=Ae(e),r=eD(t),n=Ie("vandg",e,r,JB,QB);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>M8(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function TX(e){let t=[["o_alpha","o_lon_c","o_lat_c"],["o_lat_p","o_lon_p"],["o_lon_1","o_lat_1","o_lon_2","o_lat_2"]],r=t.find(c=>c.some(l=>T_(e,l)));if(!r)throw new Error("Oblique transformation requires a rotation parameter set");for(let c of r){if(!T_(e,c))throw new Error("Oblique transformation requires "+c);if(c.includes("lat")&&Math.abs(Yi(e,c))>Math.PI/2)throw new Error("Invalid rotation latitude: "+c)}if(r===t[0]){let c=Yi(e,"o_alpha"),l=Yi(e,"o_lon_c"),u=Yi(e,"o_lat_c");if(Math.abs(u)>=Math.PI/2-1e-10)throw new Error("Rotation center must be away from the poles");return{lamp:l+Math.atan2(-Math.cos(c),-Math.sin(c)*Math.sin(u)),phip:Math.asin(Math.cos(u)*Math.sin(c))}}if(r===t[1])return{lamp:Yi(e,"o_lon_p"),phip:Yi(e,"o_lat_p")};let n=Yi(e,"o_lon_1"),i=Yi(e,"o_lat_1"),o=Yi(e,"o_lon_2"),s=Yi(e,"o_lat_2");if(Math.abs(i)>=Math.PI/2-1e-10||Math.abs(s)>=Math.PI/2-1e-10||Math.abs(i)<1e-10||Math.abs(i-s)<1e-10)throw new Error("Invalid new-equator reference points");let a=Math.atan2(Math.cos(i)*Math.sin(s)*Math.cos(n)-Math.sin(i)*Math.cos(s)*Math.cos(o),Math.sin(i)*Math.cos(s)*Math.sin(o)-Math.cos(i)*Math.sin(s)*Math.sin(n));return{lamp:a,phip:Math.atan(-Math.cos(a-n)/Math.tan(i))}}function y1(e){let t=e==="longlat";if(!t&&["obtran","geocent"].includes(E_(e.name)))throw new Error("Cannot wrap a composite or geocentric projection");return{name:"ob_tran",aliases:["General Oblique Transformation","General_Oblique_Transformation"],parameters:[...nD,"lon_0",...t?[]:e.parameters],flags:t?[]:e.flags,create(r){var R;let{parameters:n}=r,i=n.o_proj,o=t?["longlat","latlong","lonlat","latlon","identity"]:[e.name,...e.aliases||[]];if(i&&!o.map(E_).includes(E_(i)))throw new ai("missing-plugin","Oblique transformation dependency does not match +o_proj="+i);let{lamp:s,phip:a}=TX(n),c=Math.cos(a),l=Math.sin(a),u=Math.abs(a)>1e-10,h=Yi(n,"lon_0"),d=T_(n,"over"),m={...n,proj:t?"longlat":i||e.name,lon_0:"0"};for(let E of nD)delete m[E];let g=t?pi(E=>{E.x*=180/Math.PI,E.y*=180/Math.PI},E=>{E.x*=Math.PI/180,E.y*=Math.PI/180}):e.create({...r,parameters:Object.freeze(m),primeMeridian:0}),y=Vo(g,!1),b=Vo(g,!0),w=E=>Math.asin(Math.max(-1,Math.min(1,E))),_=E=>{let j=E.x,I=E.y,O=Yt(j-h,d),A=Math.cos(O),W=Math.sin(I),k=Math.cos(I),T=Yt(Math.atan2(k*Math.sin(O),u?l*k*A+c*W:W)+s),B=w(u?l*W-c*k*A:-k*A);E.x=T,E.y=B},S=E=>{let j=E.x,I=E.y,O=j-s,A=Math.cos(O),W=Math.sin(I),k=Math.cos(I),T=Math.atan2(k*Math.sin(O),u?l*k*A-c*W:-W),B=w(u?l*W+c*k*A:k*A);E.x=Yt(T+h),E.y=B},M=pi(E=>{_(E),y(E)},E=>{b(E),S(E)}),v=t?Va(m):(R=g.getRenderingProfile)==null?void 0:R.bind(g);if(!v)return M;let C=(E,j)=>{let I=j&&ur(()=>E.bounds,j,h,r.primeMeridian??0,d),O=Ds(A=>{var D;let W=A.x,k=A.y;_(A);let T=A.x*180/Math.PI,B=A.y*180/Math.PI,N={x:T,y:B,z:A.z};if((D=E.normalize)==null||D.call(E,N),N.x===T&&N.y===B){A.x=W,A.y=k;return}A.x=N.x*Math.PI/180,A.y=N.y*Math.PI/180,S(A),d&&(A.x+=Math.round((W-A.x)/(2*Math.PI))*2*Math.PI)},r.primeMeridian??0);return{get bounds(){let A=E.bounds,W=k=>[k[0]*180/Math.PI,k[1]*180/Math.PI,k[2]];return t?[W(A[0]),W(A[1])]:A},normalize(A){I==null||I.normalize(A),O(A)}}};return{...M,longitudeOrigin:h,getRenderingProfile(E){if(!E)return C(v());let j=Bs(E,r.primeMeridian??0,h),I=Q(j[0][0]-h,j[0][1],j[1][0]-h,j[1][1]),O=dt(u?[-c,0,l]:[-1,0,0],I),A=u?[l,0,c]:[0,0,1],k=dt(A,I)[0]>0?zs([0,1,0],A,0,I).map(Math.atan):[-Math.PI,Math.PI];return C(v(kn(Q(k[0]+s,w(O[0]),k[1]+s,w(O[1])))),E)}}}}}var nD,E_,T_,Yi,iD=p(()=>{fc();Hh();Wt();uc();qa();ut();et();pc();nD=["o_proj","o_alpha","o_lon_c","o_lat_c","o_lon_p","o_lat_p","o_lon_1","o_lat_1","o_lon_2","o_lat_2"],E_=e=>e.toLowerCase().replace(/[ _-]/g,""),T_=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Yi=(e,t)=>re(e,t,0)*Math.PI/180});function Rt(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Expected a CRS object");return e}function Qh(e){return Array.isArray(e)?e:[]}function Xr(e){return String(e||"").toLowerCase().replace(/[^a-z0-9]/g,"")}function Or(e){if(typeof e!="number"||!Number.isFinite(e))throw new Error("Expected a finite CRS parameter");return e}function Cn(e,t){if(e===void 0)return t;if(typeof e=="object"){let i=Or(Rt(e).conversion_factor);if(i<=0)throw new Error("Unit conversion factor must be positive");return i}let n={metre:1,meter:1,degree:At,radian:1,grad:Math.PI/200,gon:Math.PI/200,foot:.3048,ussurveyfoot:1200/3937,kilometre:1e3,arcsecond:At/3600,partspermillion:1e-6,unity:1}[Xr(e)];return n||Ue("Unsupported CRS unit: "+String(e)),n}function ul(e,t){var E,j,I;let r=String(e.type),n=LX(e.bbox);if(r==="CompoundCRS"){t.mode!=="horizontal"&&Ue("CompoundCRS requires explicit horizontal extraction");let O=Qh(e.components).map(Rt).filter(W=>["ProjectedCRS","GeographicCRS","GeodeticCRS","BoundCRS"].includes(String(W.type)));if(O.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");let A=ul(O[0],t);return{...A,areaOfUse:n??A.areaOfUse,lossy:!0}}if(r==="BoundCRS"){let O=ul(Rt(e.source_crs),t),A=ul(Rt(e.target_crs),t);(A.parameters.datum!=="WGS84"||!["longlat","geocent"].includes(A.parameters.proj)||Number(A.parameters.pm||0)!==0||A.parameters.towgs84||Number(A.parameters.a)!==6378137||!(Math.abs(Number(A.parameters.rf)-298.257223563)<=1e-9||Math.abs(Number(A.parameters.b)-6356752314245179e-9)<=1e-6))&&Ue("BoundCRS requires a WGS84 target");let W=Rt(e.transformation),k=Xr(Rt(W.method).name),T=k==="geocentrictranslations"||/^geocentrictranslationsgeog[23]ddomain$/.test(k),B=/^positionvector(?:transformation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(k),N=/^coordinateframe(?:rotation)?(?:geog[23]ddomain|geocentricdomain)?$/.test(k);!T&&!B&&!N&&Ue("Unsupported BoundCRS transformation: "+k);let D=["xaxistranslation","yaxistranslation","zaxistranslation","xaxisrotation","yaxisrotation","zaxisrotation","scaledifference"],L=new Array(T?3:7).fill(void 0);for(let z of Qh(W.parameters)){let we=Rt(z),_e=D.indexOf(Xr(we.name));(_e<0||_e>=L.length||L[_e]!==void 0)&&Ue("Unsupported or duplicate Helmert parameter: "+String(we.name));let ne=_e<3?1:_e<6?At/3600:1e-6;L[_e]=Or(we.value)*Cn(we.unit,ne)/ne*(N&&_e>=3&&_e<6?-1:1)}if(L.some(z=>z===void 0))throw new Error("Incomplete BoundCRS Helmert transformation");let P={...O.parameters,towgs84:L.join(",")};return delete P.datum,{...O,parameters:P,areaOfUse:n??O.areaOfUse}}["ProjectedCRS","GeographicCRS","GeodeticCRS"].includes(r)||Ue("Unsupported CRS type: "+r);let i=r==="ProjectedCRS"?Rt(e.base_crs):e,o=Rt(i.datum||i.datum_ensemble);(o.type==="DynamicGeodeticReferenceFrame"||o.frame_reference_epoch!==void 0||e.coordinate_epoch!==void 0)&&Ue("Time-dependent datum transformations are not implemented");let s=Rt(o.ellipsoid),a=Or(s.semi_major_axis??s.radius),c={proj:"longlat",a:String(a*Cn(s.unit,1))};if(s.inverse_flattening!==void 0)c.rf=String(Or(s.inverse_flattening));else if(s.semi_minor_axis!==void 0)c.b=String(Or(s.semi_minor_axis)*Cn(s.unit,1));else if(s.radius!==void 0)c.b=c.a;else throw new Error("Ellipsoid requires inverse flattening or semi-minor axis");let l=ku(t),u=String(o.name||""),h=Xr(u),d=Object.keys(l),m=d.find(O=>sl(O)===sl(u)),g=m?[m]:d.filter(O=>Xr(O)===h||Xr(O)===h.replace(/^d/,"")),y=g[0],b=l[y];if(b&&g.some(O=>{let A=l[O];return A.ellipse!==b.ellipse||A.towgs84!==b.towgs84||A.nadgrids!==b.nadgrids}))throw new Error("Ambiguous structured datum name: "+u);if(h&&(c.datum=y||u),y&&sl(y)==="wgs84"&&(c.datum="WGS84"),y&&["nad83","northamericandatum1983"].includes(sl(y))&&(c.datum="NAD83"),!y){["wgs84","worldgeodeticsystem1984","worldgeodeticsystem1984ensemble","dwgs1984","wgs1984"].includes(h)&&(c.datum="WGS84"),["nad83","northamericandatum1983","dnorthamerican1983"].includes(h)&&(c.datum="NAD83"),["nad27","northamericandatum1927","dnorthamerican1927"].includes(h)&&(c.datum="NAD27");let A={newzealand1949:"nzgd49",belge1972:"rnb72"}[h.replace(/^d/,"")];A&&(c.datum=A)}if(r==="ProjectedCRS"&&i.id){let O=Rt(i.id),A=String(O.authority)+"_"+String(O.code);Object.prototype.hasOwnProperty.call(l,A)&&(c.datum=A)}o.towgs84!==void 0&&(c.towgs84=Qh(o.towgs84).map(Or).join(","),delete c.datum);let w=e.coordinate_system?Rt(e.coordinate_system):{},_=Qh(w.axis).map(Rt),S=Xr(w.subtype)==="cartesian"&&r==="GeodeticCRS";r!=="ProjectedCRS"&&!S&&w.subtype&&Xr(w.subtype)!=="ellipsoidal"&&Ue("Unsupported coordinate system subtype"),S&&(c.proj="geocent");let M=Cn(i.angular_unit,At),v=Cn((E=_[0])==null?void 0:E.unit,r==="ProjectedCRS"||S?1:M);_[1]&&Cn(_[1].unit,v)!==v&&Ue("Mixed horizontal axis units are not supported"),S&&_[2]&&Cn(_[2].unit,v)!==v&&Ue("Mixed geocentric axis units are not supported");let C=i.prime_meridian||o.prime_meridian;if(C){let O=Rt(C);c.pm=String(Or(O.longitude)*Cn(O.unit,M)/At)}if(r==="ProjectedCRS"){let O=Rt(e.conversion),A=Xr(Rt(O.method).name),W=Qh(O.parameters).map(Rt),k=A==="stereographicnorthpole"&&!W.some(D=>Xr(D.name).startsWith("scalefactor")),T=k?"stere":AX[A],B=W.filter(D=>["xscale","yscale","xyplanerotation"].includes(Xr(D.name)));if(B.length){let D={xscale:-1,yscale:1,xyplanerotation:90};(T!=="krovak"||B.length!==3||new Set(B.map(L=>Xr(L.name))).size!==3||B.some(L=>{let P=Xr(L.name),z=P==="xyplanerotation"?Cn(L.unit,M)/At:Cn(L.unit,1);return Math.abs(Or(L.value)*z-D[P])>1e-10}))&&Ue("Unsupported ESRI Krovak axis adjustment")}(!T||T.startsWith("unsupported"))&&Ue("Unsupported projection method: "+String(Rt(O.method).name)),c.proj=T==="webmerc"?"merc":T;let N=!1;for(let D of W){let L=Xr(D.name);if(B.includes(D)||L==="auxiliaryspheretype"&&T==="webmerc"&&D.value===0)continue;if(L==="semiminor"&&T==="webmerc"){if(N)throw new Error("Duplicate conversion parameter: semi_minor");N=!0;let ne=Or(D.value)*Cn(D.unit,1);Math.abs(ne-Number(c.a))>4*Number.EPSILON*Number(c.a)&&Ue("Pseudo-Mercator semi_minor must equal the semi-major axis");continue}let P=((j=PX[T])==null?void 0:j[L])||IX[L];if(P||Ue("Unsupported conversion parameter: "+String(D.name)),P==="lat_1"&&A==="stereographicnorthpole"&&!k?P="lat_0":P==="lat_1"&&["merc","webmerc","eqc","stere","cea"].includes(T)&&(P="lat_ts"),c[P]!==void 0)throw new Error("Duplicate conversion parameter: "+P);if(["merc","webmerc"].includes(T)&&P==="lat_0"&&D.value===0)continue;let z=P.startsWith("lat")||P.startsWith("lon")||P==="alpha"||P==="gamma",we=P==="x_0"||P==="y_0",_e=Or(D.value)*Cn(D.unit,z?M:we?v:1)/(z?At:1);P.startsWith("lat")&&Math.abs(Math.abs(_e)-90)<=4*Number.EPSILON*90&&(_e=Math.sign(_e)*90),c[P]=String(_e)}if(T==="omerc"&&["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(A)&&(c.no_uoff=void 0),T==="omerc"&&c.lon_0!==void 0&&c.lonc!==void 0&&(Math.abs(Number(c.lon_0)-Number(c.lonc))>1e-10&&Ue("Oblique Mercator central meridian conflicts with projection centre"),delete c.lon_0),A==="stereographicnorthpole"&&Math.abs(Number(c.lat_0))===90&&(c.proj="stere"),T==="lcc"&&c.lat_1===void 0&&(c.lat_1=c.lat_0),A==="polarstereographic"&&c.lat_0!==void 0){if(c.lat_ts!==void 0)throw new Error("Duplicate polar stereographic latitude of true scale");c.lat_ts=c.lat_0,delete c.lat_0}T==="stere"&&(A.includes("polar")||A==="stereographicsouthpole"||k)&&c.lat_0===void 0&&(c.lat_0=Number(c.lat_ts||90)<0?"-90":"90"),T==="webmerc"&&(c.b=c.a,delete c.rf,c.nadgrids="@null")}let R=_.map(O=>OX(O,c,r==="ProjectedCRS")).join("");return R.length===2&&(R+="u"),!S&&/[ud]/.test(R.slice(0,2))&&Ue("Structured CRS vertical-first axes require an explicit PROJ axis definition"),R&&(c.axis=R),(r==="ProjectedCRS"||S)&&(c.to_meter=String(v)),{parameters:c,areaOfUse:n,angularUnit:r==="ProjectedCRS"||S?M:v,verticalUnit:S?1:Cn((I=_[2])==null?void 0:I.unit,1)}}function LX(e){let t;if(e!==void 0){let r=Rt(e),n=Or(r.west_longitude),i=Or(r.south_latitude),o=Or(r.east_longitude),s=Or(r.north_latitude);if(n<-180||n>180||o<-180||o>180||i<-90||s>90||i>=s||n===o)throw new Error("Invalid CRS geographic bounding box");t=[n,i,o,s]}return t}function OX(e,t,r){var a;let n=String(e.direction),i=e.meridian,o=/^(north|south) along ([+-]?(?:\d+(?:\.\d*)?|\.\d+)) deg(?: (east|west))?$/i.exec(n);if(o){if(i!==void 0)throw new Error("Duplicate axis meridian");n=o[1],i={longitude:Number(o[2])*(((a=o[3])==null?void 0:a.toLowerCase())==="west"?-1:1)}}if(i!==void 0){let c=Number(t.lat_0),l=c===90;(!r||t.proj!=="stere"||Math.abs(c)!==90||Xr(n)!==(l?"south":"north"))&&Ue("Axis meridians require an outward-facing polar stereographic axis");let u=Rt(i).longitude,h=typeof u=="number"?Or(u):Or(Rt(u).value)*Cn(Rt(u).unit,At)/At,d=Or((h-Number(t.lon_0||0))/90);Math.abs(d-Math.round(d))>1e-12&&Ue("Non-cardinal axis meridians require an orientation operation");let m=(Math.round(d)%4+4)%4;return(l?"senw":"nesw")[m]}let s=RX[Xr(n)];return s||Ue("Unsupported axis direction: "+n),s}var AX,IX,PX,RX,A_=p(()=>{Y0();Wt();qa();AX={hotineobliquemercator:"omerc",hotineobliquemercatorvarianta:"omerc",hotineobliquemercatorvariantb:"omerc",hotineobliquemercatorazimuthnaturalorigin:"omerc",hotineobliquemercatorazimuthcenter:"omerc",obliquemercator:"omerc",krovak:"krovak",krovaknorthorientated:"krovak",quadrilateralizedsphericalcube:"qsc",transversemercator:"tmerc",transversemercatorsouthorientated:"unsupported-south-tmerc",mercator:"merc",mercator1sp:"merc",mercator2sp:"merc",mercatorvarianta:"merc",mercatorvariantb:"merc",mercatorauxiliarysphere:"webmerc",popularvisualisationpseudomercator:"webmerc",lambertconformalconic:"lcc",lambertconformalconic1sp:"lcc",lambertconformalconic2sp:"lcc",lambertconicconformal1sp:"lcc",lambertconicconformal2sp:"lcc",albers:"aea",albersconicequalarea:"aea",albersequalarea:"aea",equidistantconic:"eqdc",lambertazimuthalequalarea:"laea",stereographic:"stere",stereographicnorthpole:"sterea",stereographicsouthpole:"stere",polarstereographic:"stere",polarstereographicvarianta:"stere",polarstereographicvariantb:"stere",obliquestereographic:"sterea",doublestereographic:"sterea",azimuthalequidistant:"aeqd",modifiedazimuthalequidistant:"aeqd",equidistantcylindrical:"eqc",equidistantcylindricalspherical:"eqc",equirectangular:"eqc",platecarree:"eqc",bonne:"bonne",cassinisoldner:"cass",cassini:"cass",cylindricalequalarea:"cea",lambertcylindricalequalarea:"cea",eckertvi:"eck6",equalearth:"eqearth",millercylindrical:"mill",mollweide:"moll",robinson:"robin",sinusoidal:"sinu",vandergrinten:"vandg",vandergrinteni:"vandg",gnomonic:"gnom",orthographic:"ortho",polyconic:"poly",americanpolyconic:"poly",newzealandmapgrid:"nzmg",gaussschreibertransversemercator:"gstmerc"},IX={centralmeridian:"lon_0",longitudeoforigin:"lon_0",longitudeofcenter:"lon_0",longitudeofnaturalorigin:"lon_0",longitudeoffalseorigin:"lon_0",longitudeofprojectioncentre:"lon_0",straightverticalpolelongitude:"lon_0",longitudeoforiginmeridian:"lon_0",latitudeoforigin:"lat_0",latitudeofcenter:"lat_0",latitudeofnaturalorigin:"lat_0",latitudeoffalseorigin:"lat_0",latitudeofprojectioncentre:"lat_0",standardparallel1:"lat_1",latitudeof1ststandardparallel:"lat_1",standardparallel2:"lat_2",latitudeof2ndstandardparallel:"lat_2",latitudeofstandardparallel:"lat_ts",scalefactor:"k_0",scalefactoratnaturalorigin:"k_0",scalefactoratprojectionorigin:"k_0",falseeasting:"x_0",falsenorthing:"y_0",eastingatfalseorigin:"x_0",northingatfalseorigin:"y_0"},PX={omerc:{longitudeofcenter:"lonc",longitudeofprojectioncentre:"lonc",azimuth:"alpha",azimuthatprojectioncentre:"alpha",rectifiedgridangle:"gamma",anglefromrectifiedtoskewgrid:"gamma",scalefactoratprojectioncentre:"k_0",eastingatprojectioncentre:"x_0",northingatprojectioncentre:"y_0"},krovak:{azimuth:"alpha",colatitudeofconeaxis:"alpha",pseudostandardparallel1:"lat_ts",latitudeofpseudostandardparallel:"lat_ts",scalefactoronpseudostandardparallel:"k_0"}},RX={east:"e",west:"w",north:"n",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"}});function b1(e,...t){return e.values.filter(r=>r.type==="node"&&t.includes(r.keyword.toUpperCase()))}function vt(e,...t){return b1(e,...t)[0]}function wt(e,t=0){let r=e.values[t];return r&&r.type!=="node"?r.value:void 0}function fl(e){return e?{name:wt(e),conversion_factor:wt(e,1)}:void 0}function CX(e,t){let r=wt(e,1);if(t&&String(r).toLowerCase()==="unknown"){let n=String(wt(e)).toLowerCase(),i=/^(easting|northing|westing|southing)(?:\s*\([a-z]\))?$/.exec(n);if(i)return{easting:"east",northing:"north",westing:"west",southing:"south"}[i[1]]}return r}function BX(e){let t=vt(e,"MERIDIAN");if(t)return{longitude:{value:wt(t),unit:fl(vt(t,"ANGLEUNIT"))}}}function oD(e){let t=vt(e,"METHOD","PROJECTION");if(!t)throw new Error("WKT conversion requires a METHOD or PROJECTION");return vt(e,"PARAMETERFILE")&&Ue("Grid-based WKT operation is not implemented"),{method:{name:wt(t)},parameters:b1(e,"PARAMETER").map(r=>({name:wt(r),value:wt(r,1),unit:fl(vt(r,"ANGLEUNIT","LENGTHUNIT","SCALEUNIT"))}))}}function ed(e){let t=e.keyword.toUpperCase();if(t==="COMPD_CS"||t==="COMPOUNDCRS")return{type:"CompoundCRS",components:b1(e,"PROJCS","PROJCRS","GEOGCS","GEOGCRS","GEODCRS","BOUNDCRS","VERT_CS","VERTCRS").map(ed)};if(t==="BOUNDCRS"){let d=vt(e,"SOURCECRS"),m=vt(e,"TARGETCRS"),g=vt(e,"ABRIDGEDTRANSFORMATION");if(!d||!m||!g)throw new Error("Incomplete WKT BoundCRS");let y=_=>{let S=_.values.find(M=>M.type==="node");if(!S)throw new Error("Missing bound CRS component");return S},b=oD(g),w=b.parameters;for(let _ of w)String(_.name).toLowerCase()==="scale difference"&&_.unit===void 0&&(_.value=(Number(_.value)-1)*1e6);return{type:"BoundCRS",source_crs:ed(y(d)),target_crs:ed(y(m)),transformation:b}}if(["VERT_CS","VERTCRS"].includes(t))return{type:"VerticalCRS"};let r=["PROJCS","PROJCRS","PROJECTEDCRS"].includes(t),n=["GEOGCS","GEOGCRS","GEODCRS","GEODETICCRS","GEOGRAPHICCRS","BASEGEOGCRS","BASEGEODCRS","GEOCCS"].includes(t);!r&&!n&&Ue("Unsupported WKT CRS: "+t),vt(e,"DYNAMIC","DERIVINGCONVERSION","VELOCITYGRID","EXTENSION")&&Ue("Unsupported WKT dynamic/extension operation");let i=vt(e,"CS"),o=t==="GEOCCS"||String(wt(i||e)).toLowerCase()==="cartesian"&&!r,s=vt(e,r||o?"LENGTHUNIT":"ANGLEUNIT","UNIT"),a=b1(e,"AXIS").sort((d,m)=>Number(wt(vt(d,"ORDER")||d))-Number(wt(vt(m,"ORDER")||m))).map((d,m)=>({name:wt(d),direction:t==="GEOCCS"?["geocentricX","geocentricY","geocentricZ"][m]:CX(d,r),unit:fl(vt(d,"ANGLEUNIT","LENGTHUNIT")||(!o&&!r&&/^(up|down)$/i.test(String(wt(d,1)))?void 0:s)),meridian:BX(d)}));if(!a.length)for(let d of o?["geocentricX","geocentricY","geocentricZ"]:["east","north"])a.push({name:d,direction:d,unit:fl(s),meridian:void 0});let c=t==="GEOGCS"?void 0:vt(e,"ID"),l={type:r?"ProjectedCRS":o?"GeodeticCRS":"GeographicCRS",name:wt(e),id:c?{authority:wt(c),code:wt(c,1)}:void 0,coordinate_system:{subtype:r||o?"Cartesian":"ellipsoidal",axis:a}},u=vt(e,"USAGE"),h=vt(u||e,"BBOX");if(h&&(l.bbox={south_latitude:wt(h,0),west_longitude:wt(h,1),north_latitude:wt(h,2),east_longitude:wt(h,3)}),r){let d=vt(e,"GEOGCS","BASEGEOGCRS","BASEGEODCRS","GEODCRS","GEOGCRS");if(!d)throw new Error("Projected WKT requires a base geographic CRS");l.base_crs=ed(d),l.conversion=oD(vt(e,"CONVERSION")||e)}else{let d=vt(e,"DATUM","GEODETICDATUM","ENSEMBLE");if(!d)throw new Error("WKT requires a geodetic datum");vt(d,"EXTENSION","DYNAMIC")&&Ue("Unsupported datum extension");let m=vt(d,"SPHEROID","ELLIPSOID");if(!m)throw new Error("WKT datum requires an ellipsoid");let g=vt(d,"TOWGS84");l.datum={name:wt(d),ellipsoid:{name:wt(m),semi_major_axis:wt(m,1),inverse_flattening:wt(m,2),unit:fl(vt(m,"LENGTHUNIT"))},towgs84:g==null?void 0:g.values.map((b,w)=>wt(g,w))};let y=vt(e,"PRIMEM");y&&(l.prime_meridian={name:wt(y),longitude:wt(y,1),unit:fl(vt(y,"ANGLEUNIT")||(o?void 0:s))}),l.angular_unit=o?void 0:fl(s)}return l}var I_,sD=p(()=>{Fl();oy();qa();A_();I_={name:"wkt",canParse:e=>wr(e)==="wkt",parse(e,t){if(typeof e!="string")throw new Error("Expected serialized WKT");return ul(ed(Sf(e).root),t)}}});var P_,aD=p(()=>{Fl();A_();P_={name:"projjson",canParse:e=>wr(e)==="projjson",parse:(e,t)=>ul(Rt(e),t)}});var Ive,Pve,Rve,cD=p(()=>{Ive=new Float64Array(0),Pve=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,Rve={deg:Math.PI/180,rad:1,m:1,ft:.3048,"us-ft":1200/3937}});var R_=p(()=>{KL();XL();YL();tO();sO();fO();gO();aT();TO();BO();Yy();Y8();DO();$O();ZO();rC();cC();pC();xC();AC();NC();qC();KC();QC();oB();uB();pB();xB();AB();OB();UB();jB();HB();ZB();rD();iD();sD();aD();cD()});var w1,lD,uD=p(()=>{w1={ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clrk80ign",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-0.008393,0.000749,-0.010276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"372.87,149.23,585.29"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(let e in w1){let t=w1[e];t.datumName&&(w1[t.datumName]=t)}lD=w1});var fD,hD=p(()=>{uD();fD=Object.freeze({name:"regional-datums",datums:Object.freeze(lD)})});function DX(e){return{...e,parse(t,r){let n=e.parse(t,r),i=n.parameters.datum,o=s=>s.toLowerCase().replace(/[\s_-]/g,"");if(i&&!Object.keys(ku(r)).some(s=>o(s)===o(i))){let s={...n.parameters};return delete s.datum,{...n,parameters:s}}return n}}}function FX(){if(x1)return x1;let e=[Ox,Cx,Bx,Nx,Fx,jx,e2,zx,Hx,Ky,Xy,Zy,$x,Xx,Qx,e_,r_,o_,s_,a_,c_,f_,h_,d_,m_,p_,g_,y_,b_,w_,x_,__,S_,M_,v_],t=i=>i.toLowerCase().replace(/[\s_-]/g,""),r=y1("longlat"),n={name:r.name,aliases:r.aliases,parameters:[...new Set([...r.parameters,...e.flatMap(i=>i.parameters)])],flags:[...new Set(e.flatMap(i=>i.flags||[]))],create(i){let o=i.parameters.o_proj;if(!o)throw new Error("Oblique transformation requires +o_proj");let s=["longlat","latlong","latlon","lonlat","identity"].includes(t(o))?"longlat":e.find(l=>[l.name,...l.aliases||[]].some(u=>t(u)===t(o)));if(!s)throw new Error("Unknown oblique transformation projection: "+o);let a=y1(s),c=new Set([...Z0,...a.parameters]);for(let l of Object.keys(i.parameters))if(!c.has(l))throw new Error("Unsupported PROJ parameter: +"+l);return a.create(i)}};return x1=[...e,n],x1}var NX,x1,Yu,kX,dD=p(()=>{$L();hD();Y0();R_();Gu();NX=[I_,P_].map(DX);Yu=class extends s1{constructor(t={}){super({...t,projections:t.projections??FX(),parsers:t.parsers??NX,datumCatalogs:t.datumCatalogs??[fD]}),this.useDefinitionSignature=!Xh(t)}},kX=new Yu});var mD=p(()=>{R_();dD()});function pD(){return UX}function gD(e){return GX.get(e)}var GX,UX,yD=p(()=>{"use strict";mD();GX=new Map,UX=new Yu});function jX(e,t,r){let n=[];for(let i=0;i<3;i++){let o=t.slice(),s=t.slice();o[i]+=r,s[i]-=r;let a=e.transformPosition(o),c=e.transformPosition(s);n.push([(a[0]-c[0])/(2*r),(a[1]-c[1])/(2*r),(a[2]-c[2])/(2*r)])}return n}function zX(e,t){let[r,n,i]=e,o=r[0]*(n[1]*i[2]-n[2]*i[1])-n[0]*(r[1]*i[2]-r[2]*i[1])+i[0]*(r[1]*n[2]-r[2]*n[1]);return!Number.isFinite(o)||Math.abs(o)<1e-15?t:[[n[1]*i[2]-n[2]*i[1],r[2]*i[1]-r[1]*i[2],r[1]*n[2]-r[2]*n[1]],[n[2]*i[0]-n[0]*i[2],r[0]*i[2]-r[2]*i[0],r[2]*n[0]-r[0]*n[2]],[n[0]*i[1]-n[1]*i[0],r[1]*i[0]-r[0]*i[1],r[0]*n[1]-r[1]*n[0]]].map(a=>(a[0]*t[0]+a[1]*t[1]+a[2]*t[2])/o)}function td(e){if(!e)throw new Error("Cannot construct a projection because the CRS is unknown");if(typeof e!="string"&&e.type==="CompoundCRS"){let t=e.components.filter(r=>r.type!=="VerticalCRS");if(t.length!==1)throw new Error("CompoundCRS requires exactly one horizontal component");return td(t[0])}return e}function qX(e){if(e.outputCoordinates==="local-enu")throw new Error("local-enu output requires a dataset-derived local origin and must be created by a tileset source");if(e.outputCoordinates==="target-crs"&&!e.targetCrs)throw new Error("target-crs output requires targetCrs");if(!e.sourceCrs&&e.status==="unresolved")throw new Error("Cannot transform coordinates because the source CRS is unknown");if(Zu(e)&&e.heightReference==="unknown")throw new Error("Cannot convert heights because the source height reference is unknown");if(e.coordinateFrame==="geocentric"&&!L_(e.sourceCrs))throw new Error("Only EPSG:4978 geocentric coordinates are supported by the current spatial transformer");if(e.status==="unresolved")throw new Error("The requested spatial output cannot be resolved from the available metadata")}function L_(e){return typeof e=="string"&&zh(e)===W0}function bD(e){if(typeof e!="string")return!1;let t=zh(e);return t===Fu||t==="EPSG:4979"||t==="OGC:CRS84"}function Zu(e){let t=e.targetHeightReference;return t!=="native"&&t!==e.heightReference}function VX(e){return typeof e=="string"?gD(e):e}function WX(e,t,r,n){if(r===n||n==="native")return e;if(r==="orthometric"&&n==="ellipsoidal")return e+t;if(r==="ellipsoidal"&&n==="orthometric")return e-t;throw new Error(`Unsupported height conversion from ${r} to ${n}`)}var hl,O_=p(()=>{"use strict";Fn();Ff();ZR();yD();dx();mx();hl=class{spatialReference;horizontalProjection;horizontalProjectionBuffer;geographicProjection;heightOutputProjection;sourceIsGeocentric;outputIsGeocentric;sourceIsGeographic;outputIsGeographic;geoid;constructor(t,r={}){this.spatialReference=t;let n=pD();qX(t);let i=t.targetCrs||t.sourceCrs;if(this.sourceIsGeocentric=L_(t.sourceCrs),this.outputIsGeocentric=L_(i),this.sourceIsGeographic=bD(t.sourceCrs),this.outputIsGeographic=bD(i),t.sourceCrs&&t.targetCrs&&!this.sourceIsGeocentric&&!this.outputIsGeocentric&&(this.horizontalProjection=n.createProjection({from:td(t.sourceCrs),to:td(t.targetCrs),enforceAxis:!1}),Zu(t)||(this.horizontalProjectionBuffer=new K0({projection:this.horizontalProjection,dimension:3}))),(Zu(t)||this.sourceIsGeocentric||this.outputIsGeocentric)&&(!this.sourceIsGeographic&&!this.sourceIsGeocentric&&(this.geographicProjection=n.createProjection({from:td(t.sourceCrs),to:Fu,enforceAxis:!1})),!this.outputIsGeographic&&!this.outputIsGeocentric&&(this.heightOutputProjection=n.createProjection({from:Fu,to:td(i),enforceAxis:!1}))),Zu(t)&&(this.geoid=VX(r.geoidModel),!this.geoid)){let o=typeof r.geoidModel=="string"?` "${r.geoidModel}"`:"";throw new Error(`Height conversion requires a registered geoid model${o}; call registerGeoidModel() or pass a parsed Geoid instance`)}}transformPosition(t){if(t.length<2)throw new Error("A spatial coordinate must contain at least x and y components");let r=[...t];if(Zu(this.spatialReference)||this.sourceIsGeocentric||this.outputIsGeocentric){if(r.length<3||!Number.isFinite(r[2]))throw new Error("Three-dimensional CRS conversion requires a finite z coordinate");let n=this.toGeographic(r);if(Zu(this.spatialReference)){let o=this.geoid.getHeight(n[1],n[0]);n[2]=WX(n[2],o,this.spatialReference.heightReference,this.spatialReference.targetHeightReference)}let i=this.fromGeographic(n);return r.splice(0,i.length,...i),r}if(this.horizontalProjection){let n=this.horizontalProjection.projectSync(r.slice(0,3));r.splice(0,n.length,...n)}return r}transformPositions(t){if(t.length%3!==0)throw new Error("Packed spatial positions must contain a multiple of three components");let r=new Float64Array(t.length);if(this.horizontalProjectionBuffer&&(r.set(t),r.every(Number.isFinite)))return this.horizontalProjectionBuffer.projectFlatTo(r,r);for(let n=0;n<t.length;n+=3){let i=this.transformPosition([Number(t[n]),Number(t[n+1]),Number(t[n+2])]);r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2]}return r}transformNormals(t,r){if(t.length!==r.length||t.length%3!==0)throw new Error("Spatial normals and positions must have matching xyz component counts");let n=new Float32Array(t.length),i=1e-5;for(let o=0;o<t.length;o+=3){let s=[Number(r[o]),Number(r[o+1]),Number(r[o+2])],a=[Number(t[o]),Number(t[o+1]),Number(t[o+2])],c=jX(this,s,i),l=zX(c,a),u=Math.hypot(...l);u>0&&Number.isFinite(u)?(n[o]=l[0]/u,n[o+1]=l[1]/u,n[o+2]=l[2]/u):(n[o]=a[0],n[o+1]=a[1],n[o+2]=a[2])}return n}toGeographic(t){return this.sourceIsGeocentric?Array.from(Tt.WGS84.cartesianToCartographic(new J(t))):this.sourceIsGeographic?t.slice(0,3):this.geographicProjection.projectSync(t.slice(0,3))}fromGeographic(t){return this.outputIsGeocentric?Array.from(Tt.WGS84.cartographicToCartesian(new J(t))):this.outputIsGeographic?t.slice(0,3):this.heightOutputProjection.projectSync(t.slice(0,3))}}});function HX(e,t){return e==="relativeToScene"?t.sceneElevationProvider:Ju(e)?t.terrainElevationProvider:void 0}function Ju(e){return e==="onTheGround"||e==="relativeToGround"||e==="relativeToScene"}function C_(e){if(e.length%3!==0)throw new Error("I3S position arrays must contain complete XYZ tuples");let t=[];for(let r=0;r<e.length;r+=3)t.push([e[r],e[r+1],e[r+2]]);return t}function $X(e){let t=Xa(e);return{west:t[0]*180/Math.PI,south:t[1]*180/Math.PI,east:t[2]*180/Math.PI,north:t[3]*180/Math.PI}}function wD(e){if(!e.length)throw new Error("I3S spatial transformation requires at least one bound sample");let t=e.map(o=>Tt.WGS84.cartographicToCartesian(new J(o))),r=new J;for(let o of t)r.add(o);r.scale(1/t.length);let n=0;for(let o of t)n=Math.max(n,new J(o).subtract(r).magnitude());let i=Tt.WGS84.cartesianToCartographic(r);return[i[0],i[1],i[2],n]}function xD(e,t,r,n){let i=e.obb;if(i){let c=Array.from(i.center).slice(0,3);c[2]*=n;let l=Array.from(i.halfSize).slice(0,3),u=new Tf().fromArray(Array.from(i.quaternion)),h=[new J([l[0],0,0]).transformByQuaternion(u),new J([0,l[1],0]).transformByQuaternion(u),new J([0,0,l[2]]).transformByQuaternion(u)];if(t==="geographic"){let d=r.transformPosition(c),m=Tt.WGS84.cartographicToCartesian(new J(d)),g=e.normalReferenceFrame==="vertex-reference-frame"?h.map(y=>MD(y,d)):h;return _D().map(y=>{let b=new J(m);for(let w=0;w<3;w++)b.add(new J(g[w]).scale(y[w]));return Array.from(Tt.WGS84.cartesianToCartographic(b))})}return _D().map(d=>{let m=new J(c);for(let g=0;g<3;g++)m.add(new J(h[g]).scale(d[g]));return Array.from(m)})}let o=e.mbs?Array.from(e.mbs):[];if(o.length<4)return[];let s=o.slice(0,3);s[2]*=n;let a=o[3];if(t==="geographic"){let c=r.transformPosition(s),l=Tt.WGS84.cartographicToCartesian(new J(c));return SD().map(u=>Array.from(Tt.WGS84.cartesianToCartographic(new J(l).add(new J(u).scale(a)))))}return SD().map(c=>Array.from(new J(s).add(new J(c).scale(a))))}function _D(){return[-1,1].flatMap(e=>[-1,1].flatMap(t=>[-1,1].map(r=>[e,t,r])))}function SD(){return[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]}function KX(){return[new J([1,0,0]),new J([0,1,0]),new J([0,0,1])]}function MD(e,t){let r=t[0]*Math.PI/180,n=t[1]*Math.PI/180,i=new J([-Math.sin(r),Math.cos(r),0]),o=new J([-Math.sin(n)*Math.cos(r),-Math.sin(n)*Math.sin(r),Math.cos(n)]),s=new J([Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]);return i.scale(e[0]).add(o.scale(e[1])).add(s.scale(e[2]))}function XX(e,t){let r=t[0]*Math.PI/180,n=t[1]*Math.PI/180,i=new J([-Math.sin(r),Math.cos(r),0]),o=new J([-Math.sin(n)*Math.cos(r),-Math.sin(n)*Math.sin(r),Math.cos(n)]),s=new J([Math.cos(n)*Math.cos(r),Math.cos(n)*Math.sin(r),Math.sin(n)]);return new J([i.dot(e),o.dot(e),s.dot(e)])}function dl(e){let t=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(let o of e)for(let s=0;s<3;s++)t[s]=Math.min(t[s],o[s]),r[s]=Math.max(r[s],o[s]);let n=t.map((o,s)=>(o+r[s])/2),i=t.map((o,s)=>(r[s]-o)/2);return[n[0],n[1],n[2],i[0],0,0,0,i[1],0,0,0,i[2]]}function Xa(e){let t=e[0][0],r=1/0,n=-1/0,i=1/0,o=-1/0,s=1/0,a=-1/0;for(let c of e){let l=t+B_(c[0]-t);r=Math.min(r,l),n=Math.max(n,l),i=Math.min(i,c[1]),o=Math.max(o,c[1]),s=Math.min(s,c[2]),a=Math.max(a,c[2])}return[B_(r)*Math.PI/180,i*Math.PI/180,B_(n)*Math.PI/180,o*Math.PI/180,s,a]}function B_(e){return((e+180)%360+360)%360-180}var rd,vD=p(()=>{"use strict";Fn();Ff();O_();HR();KR();rd=class{spatialReference;targetCoordinateFrame;positionTransformer;sourceToGeographicTransformer;geographicToTargetTransformer;sourceCoordinateFrame;sourceVerticalUnitScale;elevationMode;elevationOffset;elevationProvider;providerUnitScale;providerHeightTransformer;constructor(t,r={}){var a;if(t.status!=="transformable"&&t.status!=="transformed")throw new Error("I3SSpatialTransformer requires a requested, transformable spatial output");let n=t.targetCrs||t.sourceCrs;if(!n)throw new Error("I3S spatial transformation requires a target CRS");if(this.positionTransformer=new hl(t,r),this.sourceCoordinateFrame=t.coordinateFrame,this.sourceVerticalUnitScale=t.verticalUnitScale,this.elevationMode=t.elevationMode,this.elevationOffset=(t.elevationOffset||0)*t.elevationUnitScale,this.elevationProvider=HX(this.elevationMode,r),this.elevationProvider&&(typeof this.elevationProvider.sampleElevations!="function"||typeof this.elevationProvider.getElevationRange!="function"))throw new Error("An I3S elevation provider must implement sampleElevations() and getElevationRange()");let i=$R(((a=this.elevationProvider)==null?void 0:a.unit)||"meter");if(this.elevationProvider&&i===void 0)throw new Error(`Unsupported elevation-provider unit ${this.elevationProvider.unit}`);this.providerUnitScale=i||1,this.targetCoordinateFrame=Io(n),this.spatialReference=WR(t);let o=H0({sourceCrs:t.sourceCrs,heightReference:t.heightReference,coordinateFrame:t.coordinateFrame,axisOrder:t.axisOrder,provenance:t.provenance},{targetCrs:"EPSG:4326"});if(this.sourceToGeographicTransformer=new hl(o),Ju(this.elevationMode)){if(!this.elevationProvider){let l=this.elevationMode==="relativeToScene"?"scene":"terrain";throw new Error(`I3S elevation mode ${this.elevationMode} requires a ${l} elevation provider`)}if(t.heightReference==="unknown")throw new Error(`I3S elevation mode ${this.elevationMode} requires a known source height reference`);let c=this.elevationProvider.heightReference||t.heightReference;if(c!==t.heightReference){if(t.heightReference!=="ellipsoidal"&&t.heightReference!=="orthometric")throw new Error("Converting elevation-provider heights requires an ellipsoidal or orthometric source height reference");let l=H0({sourceCrs:"EPSG:4326",heightReference:c,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"caller-override"},{targetCrs:"EPSG:4326",targetHeightReference:t.heightReference,geoidModel:r.geoidModel});this.providerHeightTransformer=new hl(l,r)}}let s=H0({sourceCrs:"EPSG:4326",heightReference:t.heightReference,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"format-default"},{targetCrs:n,targetHeightReference:t.targetHeightReference,geoidModel:r.geoidModel});this.geographicToTargetTransformer=new hl(s,r)}transformPosition(t){let r=this.placeSourcePositionsSync(t),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformPositionAsync(t){let r=await this.placeSourcePositions(t),n=this.positionTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPlacedPosition(t){let r=this.positionTransformer.transformPosition([t[0],t[1],t[2]]);return[r[0],r[1],r[2]]}transformSourcePositionToGeographic(t){let r=this.placeSourcePositionsSync(t),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}async transformSourcePositionToGeographicAsync(t){let r=await this.placeSourcePositions(t),n=this.sourceToGeographicTransformer.transformPosition([r[0],r[1],r[2]]);return[n[0],n[1],n[2]]}transformPositions(t,r){let n=this.placeSourcePositionsSync(t),i=this.placeSourcePositionsSync(r);return this.transformPlacedPositions(n,i)}async transformPositionsAsync(t,r){let n=new Float64Array(t.length+3);n.set(Array.from(t),0),n.set(Array.from(r).slice(0,3),t.length);let i=await this.placeSourcePositions(n);return this.transformPlacedPositions(i.subarray(0,t.length),i.subarray(t.length))}async transformGeometryAsync(t,r,n="earth-centered"){if(t.length%3||r&&r.length!==t.length)throw new Error("Conversion positions and normals must contain matching finite xyz triples");for(let o=0;o<t.length;o++)if(!Number.isFinite(t[o])||r&&!Number.isFinite(r[o]))throw new Error("Conversion positions and normals must contain matching finite xyz triples");if(!["earth-centered","vertex-reference-frame"].includes(n))throw new Error("Unsupported I3S normal reference frame");let i=await this.placeSourcePositions(t);return{positions:this.positionTransformer.transformPositions(i),normals:r?this.transformNormals(r,i,n):void 0}}transformPlacedPositions(t,r){let n=this.transformPlacedPosition(r),i=new Float32Array(t.length),o=Float64Array.from(t);for(let c=0;c<t.length;c+=3){let l=this.transformPlacedPosition([t[c],t[c+1],t[c+2]]);i[c]=l[0]-n[0],i[c+1]=l[1]-n[1],i[c+2]=l[2]-n[2]}let s=this.targetCoordinateFrame==="geographic",a=s?new yn:new yn().translate(n);return{positions:i,sourcePositions:o,origin:n,cartographicOrigin:s?n:[0,0,0],coordinateSystem:s?"lnglat-offsets":"cartesian",modelMatrix:a}}transformNormals(t,r,n="earth-centered"){if(t.length!==r.length||t.length%3)throw new Error("I3S normals and positions must have matching xyz component counts");let i=new Float32Array(t.length);if(n==="earth-centered"&&(this.spatialReference.targetCrs||this.spatialReference.sourceCrs)==="EPSG:4978"){for(let o=0;o<t.length;o+=3){let s=Math.hypot(t[o],t[o+1],t[o+2]);for(let a=0;a<3;a++)i[o+a]=s?t[o+a]/s:t[o+a]}return i}for(let o=0;o<t.length;o+=3){let s=this.sourceToGeographicTransformer.transformPosition([r[o],r[o+1],r[o+2]]),a=new J([t[o],t[o+1],t[o+2]]).normalize(),c=n==="earth-centered"?a:MD(a,s),l=this.transformEcefNormal(c,s);i.set(l,o)}return i}transformBoundingVolume(t){let n=this.getGeographicBoundSamples(t).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Xa(n)}:{box:dl(n)}}async transformBoundingVolumeAsync(t){let n=(await this.getGeographicBoundSamplesAsync(t)).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Xa(n)}:{box:dl(n)}}transformBoundingVolumeToGeographic(t){return{region:Xa(this.getGeographicBoundSamples(t))}}async transformBoundingVolumeToGeographicAsync(t){return{region:Xa(await this.getGeographicBoundSamplesAsync(t))}}transformBoundingVolumeToGeocentric(t){let r=this.getGeographicBoundSamples(t).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:dl(r)}}async transformBoundingVolumeToGeocentricAsync(t){let r=(await this.getGeographicBoundSamplesAsync(t)).map(n=>Array.from(Tt.WGS84.cartographicToCartesian(new J(n))));return{box:dl(r)}}transformBoundingSphereToGeographic(t){var s,a;let r=(s=t.mbs)!=null&&s.length?Array.from(t.mbs).slice(0,3):t.obb?Array.from(t.obb.center).slice(0,3):null;if(!r)throw new Error("I3S spatial transformation requires an MBS or OBB bound");let n=this.placeSourcePositionsSync(r),i=this.sourceToGeographicTransformer.transformPosition(Array.from(n)),o=(a=t.mbs)!=null&&a.length?t.mbs[3]:Math.hypot(...Array.from(t.obb.halfSize).slice(0,3));return[i[0],i[1],i[2],o]}async transformBoundingSphereToGeographicAsync(t){return wD(await this.getGeographicBoundSamplesAsync(t))}async transformBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(o=>Array.from(Tt.WGS84.cartographicToCartesian(new J(o)))),i=r.map(o=>this.geographicToTargetTransformer.transformPosition(o));return{boundingVolume:{box:dl(n)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Xa(i)}:{box:dl(i)},i3sLodMbs:Ju(this.elevationMode)?wD(r):this.transformBoundingSphereToGeographic(t)}}async transformPointCloudBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(i=>this.geographicToTargetTransformer.transformPosition(i));return{boundingVolume:{region:Xa(r)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Xa(n)}:{box:dl(n)}}}getGeographicBoundSamples(t){let r=xD(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");let n=this.placeSourcePositionsSync(r.flat(),!0),i=C_(n);return this.sourceCoordinateFrame==="geographic"?i:i.map(o=>this.sourceToGeographicTransformer.transformPosition(o))}async getGeographicBoundSamplesAsync(t){let r=xD(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");if(Ju(this.elevationMode)){let i=this.sourceCoordinateFrame==="geographic"?r:r.map(o=>this.sourceToGeographicTransformer.transformPosition(o));return await this.placeGeographicBoundSamples(i)}let n=C_(await this.placeSourcePositions(r.flat(),!0));return this.sourceCoordinateFrame==="geographic"?n:n.map(i=>this.sourceToGeographicTransformer.transformPosition(i))}async placeGeographicBoundSamples(t){let n=await this.elevationProvider.getElevationRange($X(t)),i=n.minimum*this.providerUnitScale,o=n.maximum*this.providerUnitScale;if(!Number.isFinite(i)||!Number.isFinite(o)||i>o)throw new Error("Elevation provider returned an invalid range; minimum and maximum must be finite and ordered");let s=t.map(u=>u[2]),a=Math.min(...s),c=Math.max(...s),l=[];for(let[u,h]of t){let d=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([u,h,i])[2]:i,m=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([u,h,o])[2]:o,g=Math.min(d,m),y=Math.max(d,m),b=this.elevationMode==="onTheGround"?g:g+a+this.elevationOffset,w=this.elevationMode==="onTheGround"?y:y+c+this.elevationOffset;l.push([u,h,b],[u,h,w])}return l}placeSourcePositionsSync(t,r=!1){if(Ju(this.elevationMode))throw new Error(`I3S elevation mode ${this.elevationMode} requires asynchronous surface placement`);let n=Float64Array.from(t),i=this.elevationMode==="absoluteHeight"?this.elevationOffset:0;for(let o=2;o<n.length;o+=3)n[o]=n[o]*(r?1:this.sourceVerticalUnitScale)+i;return n}async placeSourcePositions(t,r=!1){if(!Ju(this.elevationMode))return this.placeSourcePositionsSync(t,r);let n=Float64Array.from(t),i=C_(n).map(s=>{let a=this.sourceToGeographicTransformer.transformPosition(s);return[a[0],a[1]]}),o=await this.elevationProvider.sampleElevations(i);if(o.length!==i.length)throw new Error(`Elevation provider returned ${o.length} heights for ${i.length} positions`);for(let s=0;s<i.length;s++){let a=o[s]*this.providerUnitScale;if(!Number.isFinite(a))throw new Error(`Elevation provider returned a non-finite height at index ${s}`);let[c,l]=i[s],u=this.providerHeightTransformer?this.providerHeightTransformer.transformPosition([c,l,a])[2]:a,h=n[s*3+2]*(r?1:this.sourceVerticalUnitScale);n[s*3+2]=this.elevationMode==="onTheGround"?u:u+h+this.elevationOffset}return n}transformEcefNormal(t,r){if(this.targetCoordinateFrame==="geocentric")return t.normalize();if(this.targetCoordinateFrame==="geographic")return XX(t,r).normalize();let n=Tt.WGS84.cartographicToCartesian(new J(r)),i=[];for(let s of KX()){let a=Tt.WGS84.cartesianToCartographic(new J(n).add(s)),c=Tt.WGS84.cartesianToCartographic(new J(n).subtract(s)),l=this.geographicToTargetTransformer.transformPosition(a),u=this.geographicToTargetTransformer.transformPosition(c);i.push((l[0]-u[0])/2,(l[1]-u[1])/2,(l[2]-u[2])/2)}let o=new cc(i);if(Math.abs(o.determinant())<1e-12)throw new Error("Cannot transform an I3S normal through a singular local projection");return o.invert().transpose(),new J(t).transformByMatrix3(o).normalize()}}});var ED=p(()=>{"use strict";O_();vD()});function TD(e,t=null){return D_(e,t?{token:t}:void 0)}function D_(e,t){if(!t||Object.keys(t).length===0||/^(?:data|blob):/i.test(e))return e;let r=e.indexOf("#"),n=r>=0?e.slice(r):"",i=r>=0?e.slice(0,r):e,o=i.indexOf("?"),s=o>=0?i.slice(0,o):i,a=o>=0?i.slice(o+1):"",c=new URLSearchParams(a),l=new URLSearchParams;for(let[h,d]of Object.entries(t))c.has(h)||l.set(h,String(d));let u=l.toString();return`${s}${o>=0?`?${a}`:""}${u?`${o>=0?"&":"?"}${u}`:""}${n}`}var AD=p(()=>{"use strict"});function N_(e){switch(e){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}function Qu(e){switch(e){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var ID,_1,F_=p(()=>{"use strict";x8();ID={UInt8:Os.UNSIGNED_BYTE,UInt16:Os.UNSIGNED_SHORT,Float32:Os.FLOAT,UInt32:Os.UNSIGNED_INT,UInt64:Os.DOUBLE};_1={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"}});function G_(e,t){if(!e)throw new Error(`parseI3STileContent requires LoaderContext to ${t}. Nested I3S parsing must run through parseFromContext().`);return e}function YX(e){switch(e){case"ktx-etc2":case"dds":return $o;case"ktx2":return ho;default:return Ho}}async function CD(e,t,r,n,i){var h,d;let o=((h=n==null?void 0:n.i3s)==null?void 0:h.geometryMode)??"render";if(o!=="render"&&o!=="source")throw new Error("Unsupported I3S geometry mode");let s={geometryMode:o,attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new yn,coordinateSystem:"meter-offsets",byteLength:0,texture:null,topology:t.layerType==="Point"?"point-list":"triangle-list",pointRenderer:t.pointRenderer,pointSymbol:t.pointSymbol},a=i?G_(i,"parse nested resources"):null,c=(d=t.textureUrls)!=null&&d.length?t.textureUrls:t.textureUrl?[{textureSetDefinitionId:pY(t.materialDefinition),textureUrl:t.textureUrl,textureFormat:t.textureFormat||"jpg"}]:[],l={};for(let m of c)try{let g=await JX(m.textureUrl,m.textureFormat,t,n,a||i);g&&(l[m.textureSetDefinitionId]=g)}catch(g){console.warn(g)}let u=Object.values(l)[0]||null;return s.texture=u,Object.keys(l).length>0&&(s.textures=l),s.material=hY(t.materialDefinition,l,u),s.material&&(s.texture=null),await QX(e,s,t,r,n,i)}async function JX(e,t,r,n,i){var m;let o=n==null?void 0:n.i3s,s=D_(TD(e,o==null?void 0:o.token),n==null?void 0:n.searchParams),a=YX(t),l=await((i==null?void 0:i.fetch)||fetch)(s);if(!l.ok)throw new Error(`Failed to load I3S texture: ${l.status} ${l.statusText}`);let u=await l.arrayBuffer();if(!((m=n==null?void 0:n.i3s)!=null&&m.decodeTextures))return u;let h=G_(i,"decode texture payloads");if(a===Ho){let g={...r.textureLoaderOptions};try{let y=await Rl(u,Ho,g,h);return Vm(y)}catch{let b=await Rl(u,a,g,h);return Vm(b)}}let d=await Rl(u,a,r.textureLoaderOptions,h);return a===ho&&(d=d[0]),{compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}async function QX(e,t,r,n,i,o){var m,g,y,b,w,_;let s=e.byteLength,a,c,l=0,u=0,h;if(r.isDracoGeometry){let S=G_(o,"decode Draco geometry"),M=await Rl(e,Ti,{draco:{shape:"mesh",attributeNameEntry:ZX}},S);c=((m=M.header)==null?void 0:m.vertexCount)??0,h=(g=M.indices)==null?void 0:g.value;let{POSITION:v,NORMAL:C,COLOR_0:R,["feature-index"]:E,["uv-region"]:j}=M.attributes;if(a={position:v,normal:C,color:R,uvRegion:j,id:E},tY(a,M.attributes),t.geometryMode==="source")for(let[O,A]of Object.entries(M.attributes))!["POSITION","NORMAL","COLOR_0","feature-index","uv-region"].includes(O)&&!/^TEXCOORD_\d+$/.test(O)&&(a[O]=A);oY(a,M);let I=bY(E);I&&(yY(a,I),t.drawRanges=iY(a.id.value,h,t.topology))}else{let S=n.store.defaultGeometrySchema;if(!S)throw new Error("Uncompressed I3S geometry requires store.defaultGeometrySchema");let{vertexAttributes:M,ordering:v,featureAttributes:C,featureAttributeOrder:R}=S,E=aY(e,S);l=E.byteOffset,c=E.vertexCount,u=E.featureCount;let{attributes:j,byteOffset:I}=RD(e,l,M,c,v),{attributes:O,byteOffset:A}=RD(e,I,C,u,R),W=eY(e,A);W&&(t.meshSegmentation=W),t.drawRanges=nY(O),gY(O),a=sY(j,O)}let d=n.spatialReference;if(t.geometryMode==="source"){if(a.position.size!==3||a.position.transform||a.position.normalized||(a.position.byteStride??0)!==0||(a.position.byteOffset??0)!==0||a.position.value.length!==c*3||r.mbs.length<3||r.mbs.slice(0,3).some(M=>!Number.isFinite(M)))throw new Error("Source I3S geometry requires packed xyz values and a finite source origin");let S=k_(a.position.value,a.position.metadata,r.mbs);if(S.some(M=>!Number.isFinite(M)))throw new Error("Source I3S positions must be finite");a.position={value:S,size:3},t.origin=[0,0,0],t.cartographicOrigin=[0,0,0],t.coordinateSystem=d!=null&&d.sourceCrs&&Io(d.sourceCrs)==="geographic"?"lnglat":"cartesian",t.spatialReference=d?Object.freeze({...d,status:"native",targetCrs:void 0,targetHeightReference:"native",outputCoordinates:"auto"}):void 0,t.normalReferenceFrame=n.store.normalReferenceFrame||"earth-centered",t.sourceAttributes=a}else if((d==null?void 0:d.status)==="transformable"||(d==null?void 0:d.status)==="transformed"){let S=new rd(d,n.spatialOptions||((y=i==null?void 0:i.i3s)==null?void 0:y.spatial)),M=k_(a.position.value,a.position.metadata,r.mbs),v=await S.transformPositionsAsync(M,r.mbs);a.position.value=v.positions,(b=a.normal)!=null&&b.value&&(a.normal.value=S.transformNormals(a.normal.value,v.sourcePositions,n.store.normalReferenceFrame)),t.modelMatrix=v.modelMatrix,t.coordinateSystem=v.coordinateSystem,t.origin=v.origin,t.cartographicOrigin=v.cartographicOrigin,t.spatialReference=S.spatialReference}else if(!((w=i==null?void 0:i.i3s)!=null&&w.coordinateSystem)||i.i3s.coordinateSystem===_1.METER_OFFSETS){let S=lY(a.position,r);t.modelMatrix=S.invert(),t.coordinateSystem="meter-offsets"}else t.modelMatrix=fY(a.position),t.coordinateSystem="lnglat-offsets";t.attributes={positions:a.position,normals:a.normal,colors:PD(a.color,((_=i==null?void 0:i.i3s)==null?void 0:_.colorFormat)||"uint8norm"),uvRegions:PD(a.uvRegion||a.region)},rY(t.attributes,a),t.indices=h||null,a.id&&a.id.value&&(t.featureIds=a.id.value);for(let S in t.attributes)t.attributes[S]||delete t.attributes[S];return t.vertexCount=c,t.byteLength=s,t}function eY(e,t){return t<e.byteLength?e.slice(t):void 0}function tY(e,t){for(let[r,n]of Object.entries(t)){let i=/^TEXCOORD_(\d+)$/.exec(r);i&&(e[`uv${Number(i[1])}`]=n)}}function rY(e,t){for(let[r,n]of Object.entries(t)){let i=/^uv(\d+)$/.exec(r);if(!i||!n)continue;let o=Number(i[1]);e[o===0?"texCoords":`texCoords${o}`]=n}}function nY(e){var o,s;let t=(o=e.id)==null?void 0:o.value,r=(s=e.faceRange)==null?void 0:s.value;if(!t||!r)return;let n=[],i=Math.min(t.length,Math.floor(r.length/2));for(let a=0;a<i;a++){let c=Number(r[a*2]),l=Number(r[a*2+1]);if(l<c)continue;let u=l-c+1;n.push({featureId:Number(t[a]),firstPrimitive:c,primitiveCount:u,firstVertex:c*3,vertexCount:u*3})}return n.length?n:void 0}function iY(e,t,r){let n=r==="point-list"?1:3,i=(t==null?void 0:t.length)||e.length,o=Math.floor(i/n);if(!o)return;let s=[];for(let a=0;a<o;a++){let c=a*n,l=t?Number(t[c]):c,u=Number(e[l]),h=s[s.length-1];(h==null?void 0:h.featureId)===u?(h.primitiveCount++,h.vertexCount+=n):s.push({featureId:u,firstPrimitive:a,primitiveCount:1,firstVertex:c,vertexCount:n})}return s}function oY(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function sY(e,t){return{...e,...t}}function PD(e,t="uint8norm"){return e&&(t==="float16"&&!e.componentType?{...e,value:sx(e.value,255),normalized:!1,componentType:"float16"}:t==="float32"&&!e.componentType?{...e,value:Float32Array.from(e.value,r=>r/255),normalized:!1}:{...e,normalized:!0})}function aY(e,t){let r=0,n=0,i=0;for(let{property:o,type:s}of t.header){let a=N_(s);switch(o){case"vertexCount".toString():n=new a(e,0,4)[0],r+=Qu(s);break;case"featureCount".toString():i=new a(e,4,4)[0],r+=Qu(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function RD(e,t,r,n,i){let o={};for(let s of i)if(r[s]){let{valueType:a,valuesPerElement:c}=r[s];if(t+n*c*Qu(a)<=e.byteLength){let l=e.slice(t),u;if(a==="UInt64")u=cY(l,n*c,Qu(a));else{let h=N_(a);u=new h(l,0,n*c)}o[s]={value:u,type:ID[a],size:c},s==="color"&&(o.color.normalized=!0),t=t+n*c*Qu(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:t}}function cY(e,t,r){let n=[],i=new DataView(e),o=0;for(let s=0;s<t;s++){let a=i.getUint32(o,!0),c=i.getUint32(o+4,!0),l=a+2**32*c;n.push(l),o+=r}return new Float64Array(n)}function lY(e,t){let r=t.mbs,n=e.value,i=e.metadata,o=new yn,s=new J(r[0],r[1],r[2]),a=new J;return Tt.WGS84.cartographicToCartesian(s,a),Gy(Tt.WGS84,a,o),e.value=uY(n,i,s),o}function k_(e,t={},r){var s,a;let n=new Float64Array(e.length),i=((s=t["i3s-scale_x"])==null?void 0:s.double)??1,o=((a=t["i3s-scale_y"])==null?void 0:a.double)??1;for(let c=0;c<n.length;c+=3)n[c]=e[c]*i+r[0],n[c+1]=e[c+1]*o+r[1],n[c+2]=e[c+2]+r[2];return n}function uY(e,t={},r){let n=k_(e,t,r);for(let i=0;i<n.length;i+=3)Tt.WGS84.cartographicToCartesian(n.subarray(i,i+3),S1),n[i]=S1.x,n[i+1]=S1.y,n[i+2]=S1.z;return n}function fY(e){var o,s;let t=e.metadata,r=((o=t==null?void 0:t["i3s-scale_x"])==null?void 0:o.double)||1,n=((s=t==null?void 0:t["i3s-scale_y"])==null?void 0:s.double)||1,i=new yn;return i[0]=r,i[5]=n,i}function hY(e,t={},r){var o;let n=[e==null?void 0:e.emissiveFactor,(o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.baseColorFactor].some(s=>s==null?void 0:s.some(a=>a>1))?255:1,i;return e?i={...e,normalTexture:e.normalTexture?{...e.normalTexture}:void 0,occlusionTexture:e.occlusionTexture?{...e.occlusionTexture}:void 0,emissiveTexture:e.emissiveTexture?{...e.emissiveTexture}:void 0,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness,baseColorTexture:e.pbrMetallicRoughness.baseColorTexture?{...e.pbrMetallicRoughness.baseColorTexture}:void 0,metallicRoughnessTexture:e.pbrMetallicRoughness.metallicRoughnessTexture?{...e.pbrMetallicRoughness.metallicRoughnessTexture}:void 0}:{baseColorFactor:[n,n,n,n]}}:(i={pbrMetallicRoughness:{}},r?i.pbrMetallicRoughness.baseColorTexture={texCoord:0,textureSetDefinitionId:0}:i.pbrMetallicRoughness.baseColorFactor=[n,n,n,n]),i.alphaCutoff=i.alphaCutoff??.25,i.alphaMode&&(i.alphaMode=i.alphaMode.toUpperCase()),i.emissiveFactor&&(i.emissiveFactor=LD(i.emissiveFactor,n)),i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorFactor&&(i.pbrMetallicRoughness.baseColorFactor=LD(i.pbrMetallicRoughness.baseColorFactor,n)),Object.keys(t).length>0?mY(i,t):r&&dY(i,r),i}function LD(e,t){let r=[...e];for(let n=0;n<e.length;n++){let i=e[n]/t;r[n]=n<3?i<=.04045?i/12.92:((i+.055)/1.055)**2.4:i}return r}function dY(e,t){if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture){let r=e.pbrMetallicRoughness.baseColorTexture;e.pbrMetallicRoughness.baseColorTexture={...r,texture:ef(t,r)}}else if(e.emissiveTexture){let r=e.emissiveTexture;e.emissiveTexture={...r,texture:ef(t,r)}}else if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture){let r=e.pbrMetallicRoughness.metallicRoughnessTexture;e.pbrMetallicRoughness.metallicRoughnessTexture={...r,texture:ef(t,r)}}else if(e.normalTexture){let r=e.normalTexture;e.normalTexture={...r,texture:ef(t,r)}}else if(e.occlusionTexture){let r=e.occlusionTexture;e.occlusionTexture={...r,texture:ef(t,r)}}}function mY(e,t){var n,i;let r=[(n=e.pbrMetallicRoughness)==null?void 0:n.baseColorTexture,(i=e.pbrMetallicRoughness)==null?void 0:i.metallicRoughnessTexture,e.normalTexture,e.occlusionTexture,e.emissiveTexture];for(let o of r){if(!o)continue;let s=t[o.textureSetDefinitionId];s&&(o.texture=ef(s,o))}}function ef(e,t){let r=OD(t.wrapS),n=OD(t.wrapT),i=r||n?{wrapS:r||10497,wrapT:n||10497}:void 0;return i?{source:{image:e},sampler:i}:{source:{image:e}}}function OD(e){switch(e){case"none":return 33071;case"mirror":return 33648;case"repeat":return 10497;default:return}}function pY(e){var t,r,n,i,o,s,a;return((r=(t=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:t.baseColorTexture)==null?void 0:r.textureSetDefinitionId)??((i=(n=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:n.metallicRoughnessTexture)==null?void 0:i.textureSetDefinitionId)??((o=e==null?void 0:e.normalTexture)==null?void 0:o.textureSetDefinitionId)??((s=e==null?void 0:e.occlusionTexture)==null?void 0:s.textureSetDefinitionId)??((a=e==null?void 0:e.emissiveTexture)==null?void 0:a.textureSetDefinitionId)??0}function gY(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,o=i[i.length-1]+1,s=new Float64Array(o*3),a=0,c=0;for(let l=1;l<i.length;l+=2){let u=Number(n[a]),h=i[l],d=i[l-1],m=h-d+1,g=c+m*3;s.fill(u,c,g),a++,c=g}e.id.value=s}function yY(e,t){let r=e.id.value,n=new Float64Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function bY(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var S1,ZX,BD=p(()=>{"use strict";Nh();Fn();Ff();Ff();Ws();qf();hx();qf();ED();AD();F_();S1=new J([0,0,0]);ZX="i3s-attribute-type"});var M1,U_,d4e,DD,m4e,p4e,g4e,y4e,b4e,ND=p(()=>{"use strict";M1=(e,t,r,n)=>({name:e,id:t,module:"tiles-3d",encoding:"binary",format:r,extensions:n,mimeTypes:["application/octet-stream"],binary:!0}),U_=(e,t,r)=>({name:e,id:t,module:"tiles-3d",encoding:"json",format:r,extensions:["json"],mimeTypes:["application/json"],text:!0}),d4e=M1("I3S","i3s","i3s",["bin"]),DD=M1("I3S Content","i3s-content","i3s-content",["bin"]),m4e=M1("I3S Attribute","i3s-attribute","i3s-attribute",["bin"]),p4e=M1("I3S LEPCC","i3s-lepcc","i3s-lepcc",["bin"]),g4e=U_("I3S Node Page","i3s-node-page","i3s-node-page"),y4e=U_("ArcGIS Web Scene","arcgis-web-scene","arcgis-web-scene"),b4e=U_("I3S Building Scene Layer","i3s-building-scene-layer","i3s-building-scene-layer")});var FD,kD=p(()=>{"use strict";F_();FD={token:void 0,isTileset:"auto",isTileHeader:"auto",tile:void 0,tileset:void 0,_tileOptions:void 0,_tilesetOptions:void 0,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,attributeValues:"legacy",colorFormat:"uint8norm",geometryMode:"render",coordinateSystem:_1.METER_OFFSETS}});var wY,GD,UD=p(()=>{"use strict";ND();kD();wY="5.0.0-beta.6",GD={...DD,dataType:null,batchType:null,name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"tiles-3d",worker:!0,workerSourceNode:"i3s/workers/i3s-content-worker-node.ts",version:wY,mimeTypes:["application/octet-stream"],preload:async()=>(await Promise.resolve().then(()=>(j_(),jD))).I3SContentLoaderWithParser,extensions:["bin"],options:{i3s:FD,"i3s-content":{}}}});var jD={};Qt(jD,{I3SContentLoaderWithParser:()=>z_});async function _Y(e,t,r){let{tile:n,_tileOptions:i,tileset:o,_tilesetOptions:s}=(t==null?void 0:t.i3s)||{},a=i||n,c=s||o;return!a||!c?null:await CD(e,a,c,t,r)}var R4e,xY,z_,j_=p(()=>{"use strict";qf();hx();qf();BD();UD();({preload:R4e,...xY}=GD),z_={...xY,subloaders:{ImageLoader:Ho,DracoLoader:Ti,BasisLoader:ho,CompressedTextureLoader:$o},parse:_Y}});var $_=typeof process!="object"||String(process)!=="[object process]"||process.browser;var K_={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]};globalThis["encoding-indexes"]=K_||{};function Te(e,t,r){return t<=e&&e<=r}function KD(e,t){return e.indexOf(t)!==-1}var Lo=Math.floor;function dd(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function XD(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var o=t.charCodeAt(n);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(n===r-1)i.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var a=o&1023,c=s&1023;i.push(65536+(a<<10)+c),n+=1}else i.push(65533)}n+=1}return i}function YD(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function ui(e){return 0<=e&&e<=127}var li=ui,Ye=-1;function U1(e){this.tokens=[].slice.call(e),this.tokens.reverse()}U1.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Ye},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var gt=-1;function Xe(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ii(e){throw TypeError("The code point "+e+" could not be encoded.")}function ZD(){}ZD.prototype={handler:function(e,t){}};function JD(){}JD.prototype={handler:function(e,t){}};function k1(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(G1,e)?G1[e]:null}var X_=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],G1={};X_.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){G1[r]=t})})});var mn={},pn={};function gl(e,t){return t&&t[e]||null}function yl(e,t){var r=t.indexOf(e);return r===-1?null:r}function Zr(e){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][e]}function QD(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Zr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[0]<=e)t=o[0],r=o[1];else break}return r+e-t}function eN(e){if(e===59335)return 7457;var t=0,r=0,n=Zr("gb18030-ranges"),i;for(i=0;i<n.length;++i){var o=n[i];if(o[1]<=e)t=o[1],r=o[0];else break}return r+e-t}function tN(e){N1=N1||Zr("jis0208").map(function(r,n){return Te(n,8272,8835)?null:r});var t=N1;return t.indexOf(e)}var N1;function rN(e){F1=F1||Zr("big5").map(function(r,n){return n<5024?null:r});var t=F1;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):yl(e,t)}var F1,Y_="utf-8";function Za(e,t){if(!(this instanceof Za))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):Y_,t=dd(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=k1(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!pn[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,t.fatal&&(n._error_mode="fatal"),t.ignoreBOM&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(Za.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Za.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Za.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Za.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=dd(r),this._do_not_flush||(this._decoder=pn[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!r.stream;for(var i=new U1(n),o=[],s;;){var a=i.read();if(a===Ye||(s=this._decoder.handler(i,a),s===gt))break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}if(!this._do_not_flush){do{if(s=this._decoder.handler(i,i.read()),s===gt)break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}while(!i.endOfStream());this._decoder=null}function c(l){return KD(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),YD(l)}return c.call(this,o)};function uf(e,t){if(!(this instanceof uf))throw TypeError("Called as a function. Did you forget 'new'?");t=dd(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=t.fatal?"fatal":"replacement";var r=this;if(t.NONSTANDARD_allowLegacyEncoding){e=e!==void 0?String(e):Y_;var n=k1(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!mn[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=k1("utf-8"),e!==void 0&&"console"in globalThis;return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(uf.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});uf.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=dd(r),this._do_not_flush||(this._encoder=mn[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=!!r.stream;for(var n=new U1(XD(t)),i=[],o;;){var s=n.read();if(s===Ye||(o=this._encoder.handler(n,s),o===gt))break;Array.isArray(o)?i.push.apply(i,o):i.push(o)}if(!this._do_not_flush){for(;o=this._encoder.handler(n,n.read()),o!==gt;)Array.isArray(o)?i.push.apply(i,o):i.push(o);this._encoder=null}return new Uint8Array(i)};function nN(e){var t=e.fatal,r=0,n=0,i=0,o=128,s=191;this.handler=function(a,c){if(c===Ye&&i!==0)return i=0,Xe(t);if(c===Ye)return gt;if(i===0){if(Te(c,0,127))return c;if(Te(c,194,223))i=1,r=c&31;else if(Te(c,224,239))c===224&&(o=160),c===237&&(s=159),i=2,r=c&15;else if(Te(c,240,244))c===240&&(o=144),c===244&&(s=143),i=3,r=c&7;else return Xe(t);return null}if(!Te(c,o,s))return r=i=n=0,o=128,s=191,a.prepend(c),Xe(t);if(o=128,s=191,r=r<<6|c&63,n+=1,n!==i)return null;var l=r;return r=i=n=0,l}}function iN(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i,o;Te(n,128,2047)?(i=1,o=192):Te(n,2048,65535)?(i=2,o=224):Te(n,65536,1114111)&&(i=3,o=240);for(var s=[(n>>6*i)+o];i>0;){var a=n>>6*(i-1);s.push(128|a&63),i-=1}return s}}mn["UTF-8"]=function(e){return new iN(e)};pn["UTF-8"]=function(e){return new nN(e)};function oN(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(ui(i))return i;var o=e[i-128];return o===null?Xe(r):o}}function sN(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(li(i))return i;var o=yl(i,e);return o===null&&Ii(i),o+128}}(function(){"encoding-indexes"in globalThis&&X_.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Zr(r.toLowerCase());pn[r]=function(i){return new oN(n,i)},mn[r]=function(i){return new sN(n,i)}})})})();pn.GBK=function(e){return new Z_(e)};mn.GBK=function(e){return new J_(e,!0)};function Z_(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(o,s){if(s===Ye&&r===0&&n===0&&i===0)return gt;s===Ye&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Xe(t));var a;if(i!==0){a=null,Te(s,48,57)&&(a=QD((((r-129)*10+n-48)*126+i-129)*10+s-48));var c=[n,i,s];return r=0,n=0,i=0,a===null?(o.prepend(c),Xe(t)):a}if(n!==0)return Te(s,129,254)?(i=s,null):(o.prepend([n,s]),r=0,n=0,Xe(t));if(r!==0){if(Te(s,48,57))return n=s,null;var l=r,u=null;r=0;var h=s<127?64:65;return(Te(s,64,126)||Te(s,128,254))&&(u=(l-129)*190+(s-h)),a=u===null?null:gl(u,Zr("gb18030")),a===null&&ui(s)&&o.prepend(s),a===null?Xe(t):a}return ui(s)?s:s===128?8364:Te(s,129,254)?(r=s,null):Xe(t)}}function J_(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(li(i))return i;if(i===58853)return Ii(i);if(t&&i===8364)return 128;var o=yl(i,Zr("gb18030"));if(o!==null){var s=Lo(o/190)+129,a=o%190,c=a<63?64:65;return[s,a+c]}if(t)return Ii(i);o=eN(i);var l=Lo(o/10/126/10);o=o-l*10*126*10;var u=Lo(o/10/126);o=o-u*10*126;var h=Lo(o/10),d=o-h*10;return[l+129,u+48,h+129,d+48]}}mn.gb18030=function(e){return new J_(e)};pn.gb18030=function(e){return new Z_(e)};function aN(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:98;switch((Te(i,64,126)||Te(i,161,254))&&(s=(o-129)*157+(i-a)),s){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=s===null?null:gl(s,Zr("big5"));return c===null&&ui(i)&&n.prepend(i),c===null?Xe(t):c}return ui(i)?i:Te(i,129,254)?(r=i,null):Xe(t)}}function cN(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i=rN(n);if(i===null)return Ii(n);var o=Lo(i/157)+129;if(o<161)return Ii(n);var s=i%157,a=s<63?64:98;return[o,s+a]}}mn.Big5=function(e){return new cN(e)};pn.Big5=function(e){return new aN(e)};function lN(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,o){if(o===Ye&&n!==0)return n=0,Xe(t);if(o===Ye&&n===0)return gt;if(n===142&&Te(o,161,223))return n=0,65216+o;if(n===143&&Te(o,161,254))return r=!0,n=o,null;if(n!==0){var s=n;n=0;var a=null;return Te(s,161,254)&&Te(o,161,254)&&(a=gl((s-161)*94+(o-161),Zr(r?"jis0212":"jis0208"))),r=!1,Te(o,161,254)||i.prepend(o),a===null?Xe(t):a}return ui(o)?o:o===142||o===143||Te(o,161,254)?(n=o,null):Xe(t)}}function uN(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;if(n===165)return 92;if(n===8254)return 126;if(Te(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=yl(n,Zr("jis0208"));if(i===null)return Ii(n);var o=Lo(i/94)+161,s=i%94+161;return[o,s]}}mn["EUC-JP"]=function(e){return new uN(e)};pn["EUC-JP"]=function(e){return new lN(e)};function fN(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,o=0,s=!1;this.handler=function(a,c){switch(n){default:case r.ASCII:return c===27?(n=r.EscapeStart,null):Te(c,0,127)&&c!==14&&c!==15&&c!==27?(s=!1,c):c===Ye?gt:(s=!1,Xe(t));case r.Roman:return c===27?(n=r.EscapeStart,null):c===92?(s=!1,165):c===126?(s=!1,8254):Te(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(s=!1,c):c===Ye?gt:(s=!1,Xe(t));case r.Katakana:return c===27?(n=r.EscapeStart,null):Te(c,33,95)?(s=!1,65344+c):c===Ye?gt:(s=!1,Xe(t));case r.LeadByte:return c===27?(n=r.EscapeStart,null):Te(c,33,126)?(s=!1,o=c,n=r.TrailByte,null):c===Ye?gt:(s=!1,Xe(t));case r.TrailByte:if(c===27)return n=r.EscapeStart,Xe(t);if(Te(c,33,126)){n=r.LeadByte;var l=(o-33)*94+c-33,u=gl(l,Zr("jis0208"));return u===null?Xe(t):u}return c===Ye?(n=r.LeadByte,a.prepend(c),Xe(t)):(n=r.LeadByte,Xe(t));case r.EscapeStart:return c===36||c===40?(o=c,n=r.Escape,null):(a.prepend(c),s=!1,n=i,Xe(t));case r.Escape:var h=o;o=0;var d=null;if(h===40&&c===66&&(d=r.ASCII),h===40&&c===74&&(d=r.Roman),h===40&&c===73&&(d=r.Katakana),h===36&&(c===64||c===66)&&(d=r.LeadByte),d!==null){n=n=d;var m=s;return s=!0,m?Xe(t):null}return a.prepend([h,c]),s=!1,n=i,Xe(t)}}}function hN(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,o){if(o===Ye&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if(o===Ye&&n===r.ASCII)return gt;if((n===r.ASCII||n===r.Roman)&&(o===14||o===15||o===27))return Ii(65533);if(n===r.ASCII&&li(o))return o;if(n===r.Roman&&(li(o)&&o!==92&&o!==126||o===165||o===8254)){if(li(o))return o;if(o===165)return 92;if(o===8254)return 126}if(li(o)&&n!==r.ASCII)return i.prepend(o),n=r.ASCII,[27,40,66];if((o===165||o===8254)&&n!==r.Roman)return i.prepend(o),n=r.Roman,[27,40,74];o===8722&&(o=65293);var s=yl(o,Zr("jis0208"));if(s===null)return Ii(o);if(n!==r.jis0208)return i.prepend(o),n=r.jis0208,[27,36,66];var a=Lo(s/94)+33,c=s%94+33;return[a,c]}}mn["ISO-2022-JP"]=function(e){return new hN(e)};pn["ISO-2022-JP"]=function(e){return new fN(e)};function dN(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:65,c=o<160?129:193;if((Te(i,64,126)||Te(i,128,252))&&(s=(o-c)*188+i-a),Te(s,8836,10715))return 48508+s;var l=s===null?null:gl(s,Zr("jis0208"));return l===null&&ui(i)&&n.prepend(i),l===null?Xe(t):l}return ui(i)||i===128?i:Te(i,161,223)?65216+i:Te(i,129,159)||Te(i,224,252)?(r=i,null):Xe(t)}}function mN(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(Te(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=tN(n);if(i===null)return Ii(n);var o=Lo(i/188),s=o<31?129:193,a=i%188,c=a<63?64:65;return[o+s,a+c]}}mn.Shift_JIS=function(e){return new mN(e)};pn.Shift_JIS=function(e){return new dN(e)};function pN(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Ye&&r!==0)return r=0,Xe(t);if(i===Ye&&r===0)return gt;if(r!==0){var o=r,s=null;r=0,Te(i,65,254)&&(s=(o-129)*190+(i-65));var a=s===null?null:gl(s,Zr("euc-kr"));return s===null&&ui(i)&&n.prepend(i),a===null?Xe(t):a}return ui(i)?i:Te(i,129,254)?(r=i,null):Xe(t)}}function gN(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return gt;if(li(n))return n;var i=yl(n,Zr("euc-kr"));if(i===null)return Ii(n);var o=Lo(i/190)+129,s=i%190+65;return[o,s]}}mn["EUC-KR"]=function(e){return new gN(e)};pn["EUC-KR"]=function(e){return new pN(e)};function hd(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function Q_(e,t){var r=t.fatal,n=null,i=null;this.handler=function(o,s){if(s===Ye&&(n!==null||i!==null))return Xe(r);if(s===Ye&&n===null&&i===null)return gt;if(n===null)return n=s,null;var a;if(e?a=(n<<8)+s:a=(s<<8)+n,n=null,i!==null){var c=i;return i=null,Te(a,56320,57343)?65536+(c-55296)*1024+(a-56320):(o.prepend(hd(a,e)),Xe(r))}return Te(a,55296,56319)?(i=a,null):Te(a,56320,57343)?Xe(r):a}}function eS(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return gt;if(Te(i,0,65535))return hd(i,e);var o=hd((i-65536>>10)+55296,e),s=hd((i-65536&1023)+56320,e);return o.concat(s)}}mn["UTF-16BE"]=function(e){return new eS(!0,e)};pn["UTF-16BE"]=function(e){return new Q_(!0,e)};mn["UTF-16LE"]=function(e){return new eS(!1,e)};pn["UTF-16LE"]=function(e){return new Q_(!1,e)};function yN(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?gt:ui(n)?n:63360+n-128}}function bN(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?gt:li(n)?n:Te(n,63360,63487)?n-63360+128:Ii(n)}}mn["x-user-defined"]=function(e){return new bN(e)};pn["x-user-defined"]=function(e){return new yN(e)};function ff(e){return Buffer.from(e).toString("base64")}function j1(e){return Buffer.from(e,"base64").toString("ascii")}async function Fd(){try{return(await Promise.resolve().then(()=>(bv(),yv))).default}catch(e){throw new Error("Node image decoding and encoding require the optional 'sharp' package. Install it with 'npm install sharp'.",{cause:e})}}var kd=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg+xml"];async function Gd(e,t){let r=await Fd(),{data:n,info:i}=await r(Buffer.from(e),{animated:!0}).toColourspace("srgb").ensureAlpha().raw().toBuffer({resolveWithObject:!0}),o=i.width,s=i.pageHeight||i.height,a=i.pages||1;return{shape:a>1?[a,o,s,4]:[o,s,4],data:new Uint8Array(n),width:o,height:s,components:4,layers:[a]}}function xv(e){return e instanceof ArrayBuffer?e:(ArrayBuffer.isView(e),Ud(e))}function Ud(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:r,byteLength:n}=e;return t instanceof ArrayBuffer&&r===0&&n===t.byteLength?t:wv(t,r,n)}return wv(e)}function wv(e,t=0,r=e.byteLength-t){let n=new Uint8Array(r);return n.set(new Uint8Array(e,t,r)),n.buffer}async function Eg(e,t={}){let r=await Fd(),n=(t.type||"jpeg").toLowerCase().replace(/^image\//,""),i=n==="jpg"?"jpeg":n,o=await r(Buffer.from(e.data),{raw:{width:e.width,height:e.height,channels:4}}).toFormat(i).toBuffer();return xv(o)}var Pl=class{width;height;data;constructor(t){if(!t||!t.data||!t.width||!t.height)throw new Error("NodeImageBitmap requires decoded image data");this.width=t.width,this.height=t.height,this.data=t.data}close(){this.width=0,this.height=0,this.data=null}_getImageData(){if(!this.data)throw new Error("ImageBitmap is closed");return{data:this.data,width:this.width,height:this.height}}};function Tg(e){return e instanceof Pl}function _v(e){return new Pl(e)}function Ag(e){if(!Tg(e))throw new Error("getImageBitmapData");return e._getImageData()}var OU="",CU=new Map;function jd(e){for(let[t,r]of CU)e.startsWith(t)&&(e=e.replace(t,r));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${OU}${e}`),e}var No=me(require("fs"),1),tc=class{handle;size;bigsize;url;constructor(t,r,n){t=jd(t),this.handle=No.default.openSync(t,r,n);let i=No.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{No.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{No.default.ftruncate(this.handle,t,i=>{i?n(i):(this.bigsize=BigInt(t),this.size=Number(this.bigsize),r())})})}async append(t){return new Promise((r,n)=>{No.default.appendFile(this.handle,t,i=>{i?n(i):(this.bigsize=this.bigsize+BigInt(t.length),this.size=Number(this.bigsize),r())})})}async stat(){return await new Promise((t,r)=>No.default.fstat(this.handle,{bigint:!0},(n,i)=>{let o={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(o)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),o=0,s=new Uint8Array(n),a;for(;r>0;){let c=await BU(this.handle,s,0,r,i);if(c===0)break;o+=c,i+=BigInt(c),r-=c,a!==void 0&&(a+=c)}return o<r?n.slice(0,o):n}async write(t,r=0,n=t.byteLength){return new Promise((i,o)=>{let s=Number(r),a=new Uint8Array(t,Number(r),n);No.default.write(this.handle,a,0,n,s,(c,l)=>c?o(c):i(l))})}};async function BU(e,t,r,n,i){return await new Promise((o,s)=>No.default.read(e,t,r,n,i,(a,c)=>a?s(a):o(c)))}var Vd=me(require("fs/promises"),1);var Pg=me(require("fs"),1),Ig=require("stream");var zd=me(require("zlib"),1);function Sv(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(zd.default.createBrotliDecompress());case"gzip":return e.pipe(zd.default.createGunzip());case"deflate":return e.pipe(zd.default.createDeflate());default:return e}}var DU=e=>typeof e=="boolean",Mv=e=>typeof e=="function",NU=e=>e!==null&&typeof e=="object",FU=e=>NU(e)&&Mv(e.read)&&Mv(e.pipe)&&DU(e.readable);async function qd(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=jd(n);let i=new Headers;e.endsWith(".gz")&&i.set("content-encoding","gzip"),e.endsWith(".br")&&i.set("content-encoding","br");try{let o=await new Promise((h,d)=>{let m=Pg.default.createReadStream(n,{encoding:null});m.once("readable",()=>h(m)),m.on("error",g=>d(g))}),s=o;FU(o)?s=Sv(o,i):typeof o=="string"?s=Ig.Readable.from([new TextEncoder().encode(o)]):s=Ig.Readable.from([o||new ArrayBuffer(0)]);let a=200,c="OK",l=kU(n),u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:e}),u}catch(o){let s=o.message,a=400,c=s,l={},u=new Response(s,{headers:l,status:a,statusText:c});return Object.defineProperty(u,"url",{value:e}),u}}function kU(e){let t={};if(!t["content-length"]){let r=Pg.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var Wd=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await Vd.default.readdir(t,r)}async stat(t){let r=await Vd.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await Vd.default.unlink(t)}async fetch(t,r){return await qd(t,r)}async openReadableFile(t,r="r"){return new tc(t,r)}async openWritableFile(t,r="w",n){return new tc(t,r,n)}};var xf=me(require("crypto"),1),Hd=class{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(this.options=t,this.hashBatches=this.hashBatches.bind(this),!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async preload(){}async hash(t,r){var i,o,s,a;let n=(s=(o=(i=this.options)==null?void 0:i.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase();try{if(!xf.createHash)throw new Error("crypto.createHash not available");let c=(a=xf.createHash)==null?void 0:a(n),l=new Uint8Array(t);return c.update(l).digest("base64")}catch(c){throw Error(`${n} hash not available. ${c}`)}}async*hashBatches(t,r="base64"){var o,s,a,c,l,u,h;if(!xf.createHash)throw new Error("crypto.createHash not available");let n=(c=xf.createHash)==null?void 0:c((a=(s=(o=this.options)==null?void 0:o.crypto)==null?void 0:s.algorithm)==null?void 0:a.toLowerCase());for await(let d of t){let m=new Uint8Array(d);n.update(m),yield d}let i=n.digest(r);(h=(u=(l=this.options)==null?void 0:l.crypto)==null?void 0:u.onEnd)==null||h.call(u,{hash:i})}};var Pv=require("node:process"),Rv=require("node:stream/web");var $d=require("node:stream");function vv(e,t){let r=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator](),n=!1,i={async next(){var c;try{let l=await r.next();return l.done?(await((c=r.return)==null?void 0:c.call(r)),{done:!0,value:void 0}):{done:!1,value:new Uint8Array(l.value)}}catch(l){throw n=!0,l}},async return(c){var l;return await((l=r.return)==null?void 0:l.call(r,c)),{done:!0,value:void 0}},async throw(c){return r.throw&&await r.throw(c),{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}},o=(t==null?void 0:t.objectMode)??!1,s=$d.Readable.from(i,{highWaterMark:(0,$d.getDefaultHighWaterMark)(o),...t,objectMode:o}),a=s._destroy;return s._destroy=function(c,l){a.call(this,c,u=>{l(!n&&u===c?null:u)})},s}var Kd=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${ff(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};function Ev(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Kd),global}var Rg=me(require("module"),1),Lg=me(require("path"),1),Yd=me(require("fs"),1),Og=require("node:url");async function Tv(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Ud(Yd.default.readFileSync(Cg(e)))}async function Av(e){return e.startsWith("http")?await(await fetch(e)).text():Yd.default.readFileSync(Cg(e),"utf8")}async function Iv(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return Xd(i)}let t=Cg(e),r=Yd.default.readFileSync(t,"utf8");return Xd(r,t)}function Xd(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t.startsWith("file:")&&(t=(0,Og.fileURLToPath)(t)),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=Rg.default._nodeModulePaths(Lg.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),o=new Rg.default(t,i);return o.filename=t,o.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),o._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(o),1),o.exports}function Cg(e){return e.startsWith("file:")?(0,Og.fileURLToPath)(e):Lg.default.resolve(e)}var ZJ=parseInt(Pv.versions.node.split(".")[0]),eQ=globalThis.Blob,tQ=globalThis.File;Ev();$_&&console.error("loaders.gl: The @loaders.gl/core/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=vv;globalThis.loaders.NodeFile=tc;globalThis.loaders.NodeFileSystem=Wd;globalThis.loaders.fetchNode=qd;globalThis.loaders.NodeHash=Hd;globalThis.TextEncoder||(globalThis.TextEncoder=uf);globalThis.TextDecoder||(globalThis.TextDecoder=Za);globalThis.ReadableStream||(globalThis.ReadableStream=Rv.ReadableStream);!("atob"in globalThis)&&ff&&(globalThis.atob=ff);!("btoa"in globalThis)&&j1&&(globalThis.btoa=j1);globalThis.loaders.encodeImageNode=Eg;globalThis.loaders.parseImageNode=Gd;globalThis.loaders.imageFormatsNode=kd;globalThis.loaders.createImageBitmapNode=_v;globalThis.loaders.getImageBitmapDataNode=Ag;globalThis.loaders.isImageBitmapNode=Tg;globalThis.ImageBitmap||(globalThis.ImageBitmap=Pl);"getImageBitmapData"in globalThis||(globalThis.getImageBitmapData=Ag);globalThis._parseImageNode=Gd;globalThis._imageFormatsNode=kd;globalThis.loaders.readFileAsArrayBuffer=Tv;globalThis.loaders.readFileAsText=Av;globalThis.loaders.requireFromFile=Iv;globalThis.loaders.requireFromString=Xd;Ws();j_();ty(z_);
24
24
  /*! Bundled license information:
25
25
 
26
26
  sharp/dist/is.mjs: