@loaders.gl/tiles-3d 5.0.0-beta.2 → 5.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) 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 +1393 -962
  4. package/dist/3d-tiles/dist.min.js +37 -37
  5. package/dist/3d-tiles/index.cjs +989 -987
  6. package/dist/3d-tiles/index.cjs.map +3 -3
  7. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
  8. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js +12 -8
  9. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js.map +1 -1
  10. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js +5 -1
  11. package/dist/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
  12. package/dist/3d-tiles/lib/utils/version.js +1 -1
  13. package/dist/3d-tiles-archive-writer.cjs +1 -1
  14. package/dist/cesium-ion-loader-with-parser.cjs +983 -981
  15. package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
  16. package/dist/copc/copc-source-loader.js +2 -2
  17. package/dist/copc/copc-source-loader.js.map +1 -1
  18. package/dist/copc/copc-writer.js +1 -1
  19. package/dist/copc/index.cjs +365 -170
  20. package/dist/copc/index.cjs.map +3 -3
  21. package/dist/dist.dev.js +231 -38
  22. package/dist/dist.min.js +10 -10
  23. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  24. package/dist/i3s/dist.dev.js +6591 -1184
  25. package/dist/i3s/dist.min.js +55 -47
  26. package/dist/i3s/i3s-attribute-loader.js +1 -1
  27. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  28. package/dist/i3s/i3s-content-loader.js +1 -1
  29. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  30. package/dist/i3s/i3s-loader.js +1 -1
  31. package/dist/i3s/i3s-node-page-loader.js +1 -1
  32. package/dist/i3s/i3s-slpk-loader.js +1 -1
  33. package/dist/i3s/i3s-slpk-writer.js +1 -1
  34. package/dist/i3s/index.cjs +4763 -1136
  35. package/dist/i3s/index.cjs.map +3 -3
  36. package/dist/i3s-content-worker-node.js +11 -11
  37. package/dist/i3s-content-worker-node.js.map +4 -4
  38. package/dist/i3s-content-worker.js +1148 -391
  39. package/dist/i3s-lepcc-worker-node.js +609 -44
  40. package/dist/i3s-lepcc-worker-node.js.map +4 -4
  41. package/dist/i3s-lepcc-worker.js +575 -40
  42. package/dist/i3s-mesh-writer.cjs +8880 -5253
  43. package/dist/i3s-mesh-writer.cjs.map +3 -3
  44. package/dist/i3s-slpk-writer.cjs +1 -1
  45. package/dist/index.cjs +1 -1
  46. package/dist/point-cloud-tile-source-loader-types.js +1 -1
  47. package/dist/point-cloud-tile-source-loader.cjs +1 -1
  48. package/dist/potree/dist.dev.js +310 -110
  49. package/dist/potree/dist.min.js +31 -31
  50. package/dist/potree/index.cjs +19 -166
  51. package/dist/potree/index.cjs.map +3 -3
  52. package/dist/potree/potree-bin-loader.js +1 -1
  53. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  54. package/dist/potree/potree-loader-types.js +1 -1
  55. package/dist/potree/potree-source-loader.js +1 -1
  56. package/dist/potree/potree-writer.js +1 -1
  57. package/dist/potree-loader.cjs +1 -1
  58. package/package.json +13 -13
  59. package/src/3d-tiles/lib/classes/tile-3d-batch-table.ts +12 -8
  60. package/src/3d-tiles/lib/parsers/parse-3d-tile-instanced-model.ts +4 -1
  61. package/src/copc/copc-source-loader.ts +1 -1
@@ -1,26 +1,26 @@
1
- "use strict";var QC=Object.create;var L1=Object.defineProperty;var eD=Object.getOwnPropertyDescriptor;var tD=Object.getOwnPropertyNames;var rD=Object.getPrototypeOf,nD=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}},ir=(e,t)=>{for(var r in t)L1(e,r,{get:t[r],enumerable:!0})},iD=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tD(t))!nD.call(e,i)&&i!==r&&L1(e,i,{get:()=>t[i],enumerable:!(n=eD(t,i))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?QC(rD(e)):{},iD(t||!e||!e.__esModule?L1(r,"default",{value:e,enumerable:!0}):r,e));var D_,RD,LD,OD,BD,CD,DD,ND,FD,GD,kD,UD,jD,zD,qD,f,Yi=p(()=>{D_=e=>typeof e<"u"&&e!==null,RD=e=>typeof e=="object",LD=e=>Object.prototype.toString.call(e)==="[object Object]",OD=e=>typeof e=="function",BD=e=>typeof e=="boolean",CD=e=>e instanceof Buffer,DD=e=>{if(D_(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},ND=e=>e instanceof ArrayBuffer,FD=e=>typeof e=="string"&&e.length>0,GD=e=>typeof e=="number"&&Number.isFinite(e),kD=e=>Number.isInteger(e),UD=(e,t,r)=>e>=t&&e<=r,jD=(e,t)=>t.includes(e),zD=(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}`)},qD=(e,t)=>(t.message=e.message,t),f={defined:D_,object:RD,plainObject:LD,fn:OD,bool:BD,buffer:CD,typedArray:DD,arrayBuffer:ND,string:FD,number:GD,integer:kD,inRange:UD,inArray:jD,invalidParameterError:zD,nativeError:qD}});var G_=ae((DX,F_)=>{"use strict";var N_=()=>process.platform==="linux",ud=null,VD=()=>{if(!ud)if(N_()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,ud=process.report.getReport(),process.report.excludeNetwork=e}else ud={};return ud};F_.exports={isLinux:N_,getReport:VD}});var U_=ae((NX,k_)=>{"use strict";var pl=require("fs"),WD="/usr/bin/ldd",HD="/proc/self/exe",fd=2048,$D=e=>{let t=pl.openSync(e,"r"),r=Buffer.alloc(fd),n=pl.readSync(t,r,0,fd,0);return pl.close(t,()=>{}),r.subarray(0,n)},KD=e=>new Promise((t,r)=>{pl.open(e,"r",(n,i)=>{if(n)r(n);else{let o=Buffer.alloc(fd);pl.read(i,o,0,fd,0,(s,a)=>{t(o.subarray(0,a)),pl.close(i,()=>{})})}})});k_.exports={LDD_PATH:WD,SELF_PATH:HD,readFileSync:$D,readFile:KD}});var z_=ae((FX,j_)=>{"use strict";var XD=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};j_.exports={interpreterPath:XD}});var dd=ae((GX,sS)=>{"use strict";var V_=require("child_process"),{isLinux:gl,getReport:W_}=G_(),{LDD_PATH:hd,SELF_PATH:H_,readFile:G1,readFileSync:k1}=U_(),{interpreterPath:$_}=z_(),Zi,Ji,Qi,K_="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",Ss="",X_=()=>Ss||new Promise(e=>{V_.exec(K_,(t,r)=>{Ss=t?" ":r,e(Ss)})}),Y_=()=>{if(!Ss)try{Ss=V_.execSync(K_,{encoding:"utf8"})}catch{Ss=" "}return Ss},Lo="glibc",Z_=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Xa="musl",YD=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),J_=()=>{let e=W_();return e.header&&e.header.glibcVersionRuntime?Lo:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(YD)?Xa:null},Q_=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(Lo)?Lo:r&&r.includes(Xa)?Xa:null},eS=e=>{if(e){if(e.includes("/ld-musl-"))return Xa;if(e.includes("/ld-linux-"))return Lo}return null},tS=e=>(e=e.toString(),e.includes("musl")?Xa:e.includes("GNU C Library")?Lo:null),ZD=async()=>{if(Ji!==void 0)return Ji;Ji=null;try{let e=await G1(hd);Ji=tS(e)}catch{}return Ji},JD=()=>{if(Ji!==void 0)return Ji;Ji=null;try{let e=k1(hd);Ji=tS(e)}catch{}return Ji},QD=async()=>{if(Zi!==void 0)return Zi;Zi=null;try{let e=await G1(H_),t=$_(e);Zi=eS(t)}catch{}return Zi},eN=()=>{if(Zi!==void 0)return Zi;Zi=null;try{let e=k1(H_),t=$_(e);Zi=eS(t)}catch{}return Zi},rS=async()=>{let e=null;if(gl()&&(e=await QD(),!e&&(e=await ZD(),e||(e=J_()),!e))){let t=await X_();e=Q_(t)}return e},nS=()=>{let e=null;if(gl()&&(e=eN(),!e&&(e=JD(),e||(e=J_()),!e))){let t=Y_();e=Q_(t)}return e},tN=async()=>gl()&&await rS()!==Lo,rN=()=>gl()&&nS()!==Lo,nN=async()=>{if(Qi!==void 0)return Qi;Qi=null;try{let t=(await G1(hd)).match(Z_);t&&(Qi=t[1])}catch{}return Qi},iN=()=>{if(Qi!==void 0)return Qi;Qi=null;try{let t=k1(hd).match(Z_);t&&(Qi=t[1])}catch{}return Qi},iS=()=>{let e=W_();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},q_=e=>e.trim().split(/\s+/)[1],oS=e=>{let[t,r,n]=e.split(/[\r\n]+/);return t&&t.includes(Lo)?q_(t):r&&n&&r.includes(Xa)?q_(n):null},oN=async()=>{let e=null;if(gl()&&(e=await nN(),e||(e=iS()),!e)){let t=await X_();e=oS(t)}return e},sN=()=>{let e=null;if(gl()&&(e=iN(),e||(e=iS()),!e)){let t=Y_();e=oS(t)}return e};sS.exports={GLIBC:Lo,MUSL:Xa,family:rS,familySync:nS,isNonGlibcLinux:tN,isNonGlibcLinuxSync:rN,version:oN,versionSync:sN}});var yl=ae((kX,aS)=>{"use strict";var aN="2.0.0",cN=Number.MAX_SAFE_INTEGER||9007199254740991,lN=16,uN=250,fN=["major","premajor","minor","preminor","patch","prepatch","prerelease"];aS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:lN,MAX_SAFE_BUILD_LENGTH:uN,MAX_SAFE_INTEGER:cN,RELEASE_TYPES:fN,SEMVER_SPEC_VERSION:aN,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cf=ae((UX,cS)=>{"use strict";var hN=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};cS.exports=hN});var bl=ae((eo,lS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:U1,MAX_SAFE_BUILD_LENGTH:dN,MAX_LENGTH:mN}=yl(),pN=cf();eo=lS.exports={};var gN=eo.re=[],yN=eo.safeRe=[],Y=eo.src=[],bN=eo.safeSrc=[],Z=eo.t={},wN=0,j1="[a-zA-Z0-9-]",xN=[["\\s",1],["\\d",mN],[j1,dN]],_N=e=>{for(let[t,r]of xN)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},Pe=(e,t,r)=>{let n=_N(t),i=wN++;pN(e,i,t),Z[e]=i,Y[i]=t,bN[i]=n,gN[i]=new RegExp(t,r?"g":void 0),yN[i]=new RegExp(n,r?"g":void 0)};Pe("NUMERICIDENTIFIER","0|[1-9]\\d*");Pe("NUMERICIDENTIFIERLOOSE","\\d+");Pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${j1}*`);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",`${j1}+`);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,${U1}})(?:\\.(\\d{1,${U1}}))?(?:\\.(\\d{1,${U1}}))?`);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);eo.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);eo.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);eo.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 md=ae((jX,uS)=>{"use strict";var SN=Object.freeze({loose:!0}),MN=Object.freeze({}),vN=e=>e?typeof e!="object"?SN:e:MN;uS.exports=vN});var z1=ae((zX,dS)=>{"use strict";var fS=/^[0-9]+$/,hS=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=fS.test(e),n=fS.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},EN=(e,t)=>hS(t,e);dS.exports={compareIdentifiers:hS,rcompareIdentifiers:EN}});var _r=ae((qX,pS)=>{"use strict";var pd=cf(),{MAX_LENGTH:mS,MAX_SAFE_INTEGER:gd}=yl(),{safeRe:yd,t:bd}=bl(),AN=md(),{compareIdentifiers:q1}=z1(),TN=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(q1(e[n],r[n])!==0)return!1;return!0},V1=class e{constructor(t,r){if(r=AN(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>mS)throw new TypeError(`version is longer than ${mS} characters`);pd("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?yd[bd.LOOSE]:yd[bd.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>gd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>gd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>gd||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<gd)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(pd("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(pd("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 q1(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(pd("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 q1(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?yd[bd.PRERELEASELOOSE]:yd[bd.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]),TN(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}};pS.exports=V1});var Ms=ae((VX,yS)=>{"use strict";var gS=_r(),IN=(e,t,r=!1)=>{if(e instanceof gS)return e;try{return new gS(e,t)}catch(n){if(!r)return null;throw n}};yS.exports=IN});var wS=ae((WX,bS)=>{"use strict";var PN=Ms(),RN=(e,t)=>{let r=PN(e,t);return r?r.version:null};bS.exports=RN});var _S=ae((HX,xS)=>{"use strict";var LN=Ms(),ON=(e,t)=>{let r=LN(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};xS.exports=ON});var vS=ae(($X,MS)=>{"use strict";var SS=_r(),BN=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new SS(e instanceof SS?e.version:e,r).inc(t,n,i).version}catch{return null}};MS.exports=BN});var TS=ae((KX,AS)=>{"use strict";var ES=Ms(),CN=(e,t)=>{let r=ES(e,null,!0),n=ES(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"};AS.exports=CN});var PS=ae((XX,IS)=>{"use strict";var DN=_r(),NN=(e,t)=>new DN(e,t).major;IS.exports=NN});var LS=ae((YX,RS)=>{"use strict";var FN=_r(),GN=(e,t)=>new FN(e,t).minor;RS.exports=GN});var BS=ae((ZX,OS)=>{"use strict";var kN=_r(),UN=(e,t)=>new kN(e,t).patch;OS.exports=UN});var DS=ae((JX,CS)=>{"use strict";var jN=Ms(),zN=(e,t)=>{let r=jN(e,t);return r&&r.prerelease.length?r.prerelease:null};CS.exports=zN});var li=ae((QX,FS)=>{"use strict";var NS=_r(),qN=(e,t,r)=>new NS(e,r).compare(new NS(t,r));FS.exports=qN});var kS=ae((eY,GS)=>{"use strict";var VN=li(),WN=(e,t,r)=>VN(t,e,r);GS.exports=WN});var jS=ae((tY,US)=>{"use strict";var HN=li(),$N=(e,t)=>HN(e,t,!0);US.exports=$N});var wd=ae((rY,qS)=>{"use strict";var zS=_r(),KN=(e,t,r)=>{let n=new zS(e,r),i=new zS(t,r);return n.compare(i)||n.compareBuild(i)};qS.exports=KN});var WS=ae((nY,VS)=>{"use strict";var XN=wd(),YN=(e,t)=>e.sort((r,n)=>XN(r,n,t));VS.exports=YN});var $S=ae((iY,HS)=>{"use strict";var ZN=wd(),JN=(e,t)=>e.sort((r,n)=>ZN(n,r,t));HS.exports=JN});var lf=ae((oY,KS)=>{"use strict";var QN=li(),eF=(e,t,r)=>QN(e,t,r)>0;KS.exports=eF});var xd=ae((sY,XS)=>{"use strict";var tF=li(),rF=(e,t,r)=>tF(e,t,r)<0;XS.exports=rF});var W1=ae((aY,YS)=>{"use strict";var nF=li(),iF=(e,t,r)=>nF(e,t,r)===0;YS.exports=iF});var H1=ae((cY,ZS)=>{"use strict";var oF=li(),sF=(e,t,r)=>oF(e,t,r)!==0;ZS.exports=sF});var _d=ae((lY,JS)=>{"use strict";var aF=li(),cF=(e,t,r)=>aF(e,t,r)>=0;JS.exports=cF});var Sd=ae((uY,QS)=>{"use strict";var lF=li(),uF=(e,t,r)=>lF(e,t,r)<=0;QS.exports=uF});var $1=ae((fY,eM)=>{"use strict";var fF=W1(),hF=H1(),dF=lf(),mF=_d(),pF=xd(),gF=Sd(),yF=(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 fF(e,r,n);case"!=":return hF(e,r,n);case">":return dF(e,r,n);case">=":return mF(e,r,n);case"<":return pF(e,r,n);case"<=":return gF(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};eM.exports=yF});var rM=ae((hY,tM)=>{"use strict";var bF=_r(),wF=Ms(),{safeRe:Md,t:vd}=bl(),xF=(e,t)=>{if(e instanceof bF)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?Md[vd.COERCEFULL]:Md[vd.COERCE]);else{let c=t.includePrerelease?Md[vd.COERCERTLFULL]:Md[vd.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 wF(`${n}.${i}.${o}${s}${a}`,t)};tM.exports=xF});var iM=ae((dY,nM)=>{"use strict";var _F=Ms(),SF=yl(),MF=_r(),vF=(e,t,r)=>{if(!SF.RELEASE_TYPES.includes(t))return null;let n=EF(e,r);return n&&AF(n,t)},EF=(e,t)=>{let r=e instanceof MF?e.version:e;return _F(r,t)},AF=(e,t)=>{if(TF(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()},TF=e=>e.startsWith("pre");nM.exports=vF});var sM=ae((mY,oM)=>{"use strict";var K1=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}};oM.exports=K1});var ui=ae((pY,uM)=>{"use strict";var IF=/\s+/g,X1=class e{constructor(t,r){if(r=RF(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Y1)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(IF," "),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=>!cM(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&&kF(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(GF,"");let n=((this.options.includePrerelease&&NF)|(this.options.loose&&FF))+":"+t,i=aM.get(n);if(i)return i;let o=this.options.loose,s=o?Zr[Sr.HYPHENRANGELOOSE]:Zr[Sr.HYPHENRANGE];t=t.replace(s,YF(this.options.includePrerelease)),vt("hyphen replace",t),t=t.replace(Zr[Sr.COMPARATORTRIM],BF),vt("comparator trim",t),t=t.replace(Zr[Sr.TILDETRIM],CF),vt("tilde trim",t),t=t.replace(Zr[Sr.CARETTRIM],DF),vt("caret trim",t);let a=t.split(" ").map(h=>UF(h,this.options)).join(" ").split(/\s+/).map(h=>XF(h,this.options));o&&(a=a.filter(h=>(vt("loose invalid filter",h,this.options),!!h.match(Zr[Sr.COMPARATORLOOSE])))),vt("range list",a);let c=new Map,l=a.map(h=>new Y1(h,this.options));for(let h of l){if(cM(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=>lM(n,r)&&t.set.some(i=>lM(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 LF(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(ZF(this.set[r],t,this.options))return!0;return!1}};uM.exports=X1;var PF=sM(),aM=new PF,RF=md(),Y1=uf(),vt=cf(),LF=_r(),{safeRe:Zr,src:OF,t:Sr,comparatorTrimReplace:BF,tildeTrimReplace:CF,caretTrimReplace:DF}=bl(),{FLAG_INCLUDE_PRERELEASE:NF,FLAG_LOOSE:FF}=yl(),GF=new RegExp(OF[Sr.BUILD],"g"),cM=e=>e.value==="<0.0.0-0",kF=e=>e.value==="",lM=(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},UF=(e,t)=>(e=e.replace(Zr[Sr.BUILD],""),vt("comp",e,t),e=VF(e,t),vt("caret",e),e=zF(e,t),vt("tildes",e),e=HF(e,t),vt("xrange",e),e=KF(e,t),vt("stars",e),e),or=e=>!e||e.toLowerCase()==="x"||e==="*",jF=(e,t,r)=>or(e)&&!or(t)||or(t)&&r&&!or(r),zF=(e,t)=>e.trim().split(/\s+/).map(r=>qF(r,t)).join(" "),qF=(e,t)=>{let r=t.loose?Zr[Sr.TILDELOOSE]:Zr[Sr.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{vt("tilde",e,i,o,s,a,c);let l;return or(o)?l="":or(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:or(a)?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c?(vt("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`):l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`,vt("tilde return",l),l})},VF=(e,t)=>e.trim().split(/\s+/).map(r=>WF(r,t)).join(" "),WF=(e,t)=>{vt("caret",e,t);let r=t.loose?Zr[Sr.CARETLOOSE]:Zr[Sr.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{vt("caret",e,i,o,s,a,c);let l;return or(o)?l="":or(s)?l=`>=${o}.0.0${n} <${+o+1}.0.0-0`:or(a)?o==="0"?l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(vt("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`):(vt("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`),vt("caret return",l),l})},HF=(e,t)=>(vt("replaceXRanges",e,t),e.split(/\s+/).map(r=>$F(r,t)).join(" ")),$F=(e,t)=>{e=e.trim();let r=t.loose?Zr[Sr.XRANGELOOSE]:Zr[Sr.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(vt("xRange",e,n,i,o,s,a,c),jF(o,s,a))return e;let l=or(o),u=l||or(s),h=u||or(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`),vt("xRange return",n),n})},KF=(e,t)=>(vt("replaceStars",e,t),e.trim().replace(Zr[Sr.STAR],"")),XF=(e,t)=>(vt("replaceGTE0",e,t),e.trim().replace(Zr[t.includePrerelease?Sr.GTE0PRE:Sr.GTE0],"")),YF=e=>(t,r,n,i,o,s,a,c,l,u,h,d)=>(or(n)?r="":or(i)?r=`>=${n}.0.0${e?"-0":""}`:or(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,or(l)?c="":or(u)?c=`<${+l+1}.0.0-0`:or(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()),ZF=(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(vt(e[n].semver),e[n].semver!==Y1.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 uf=ae((gY,gM)=>{"use strict";var ff=Symbol("SemVer ANY"),Q1=class e{static get ANY(){return ff}constructor(t,r){if(r=fM(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),J1("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===ff?this.value="":this.value=this.operator+this.semver.version,J1("comp",this)}parse(t){let r=this.options.loose?hM[dM.COMPARATORLOOSE]:hM[dM.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 mM(n[2],this.options.loose):this.semver=ff}toString(){return this.value}test(t){if(J1("Comparator.test",t,this.options.loose),this.semver===ff||t===ff)return!0;if(typeof t=="string")try{t=new mM(t,this.options)}catch{return!1}return Z1(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 pM(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new pM(this.value,r).test(t.semver):(r=fM(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("=")||Z1(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Z1(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};gM.exports=Q1;var fM=md(),{safeRe:hM,t:dM}=bl(),Z1=$1(),J1=cf(),mM=_r(),pM=ui()});var hf=ae((yY,yM)=>{"use strict";var JF=ui(),QF=(e,t,r)=>{try{t=new JF(t,r)}catch{return!1}return t.test(e)};yM.exports=QF});var wM=ae((bY,bM)=>{"use strict";var e7=ui(),t7=(e,t)=>new e7(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));bM.exports=t7});var _M=ae((wY,xM)=>{"use strict";var r7=_r(),n7=ui(),i7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new n7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new r7(n,r))}),n};xM.exports=i7});var MM=ae((xY,SM)=>{"use strict";var o7=_r(),s7=ui(),a7=(e,t,r)=>{let n=null,i=null,o=null;try{o=new s7(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new o7(n,r))}),n};SM.exports=a7});var AM=ae((_Y,EM)=>{"use strict";var eg=_r(),c7=ui(),vM=lf(),l7=(e,t)=>{e=new c7(e,t);let r=new eg("0.0.0");if(e.test(r)||(r=new eg("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 eg(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};EM.exports=l7});var IM=ae((SY,TM)=>{"use strict";var u7=ui(),f7=(e,t)=>{try{return new u7(e,t).range||"*"}catch{return null}};TM.exports=f7});var Ed=ae((MY,OM)=>{"use strict";var h7=_r(),LM=uf(),{ANY:d7}=LM,m7=ui(),p7=hf(),PM=lf(),RM=xd(),g7=Sd(),y7=_d(),b7=(e,t,r,n)=>{e=new h7(e,n),t=new m7(t,n);let i,o,s,a,c;switch(r){case">":i=PM,o=g7,s=RM,a=">",c=">=";break;case"<":i=RM,o=y7,s=PM,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(p7(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===d7&&(m=new LM(">=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};OM.exports=b7});var CM=ae((vY,BM)=>{"use strict";var w7=Ed(),x7=(e,t,r)=>w7(e,t,">",r);BM.exports=x7});var NM=ae((EY,DM)=>{"use strict";var _7=Ed(),S7=(e,t,r)=>_7(e,t,"<",r);DM.exports=S7});var kM=ae((AY,GM)=>{"use strict";var FM=ui(),M7=(e,t,r)=>(e=new FM(e,r),t=new FM(t,r),e.intersects(t,r));GM.exports=M7});var jM=ae((TY,UM)=>{"use strict";var v7=hf(),E7=li();UM.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((u,h)=>E7(u,h,r));for(let u of s)v7(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 $M=ae((IY,HM)=>{"use strict";var zM=ui(),ng=uf(),{ANY:tg}=ng,rg=hf(),ig=li(),A7=(e,t,r={})=>{if(e===t)return!0;e=new zM(e,r),t=new zM(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=I7(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},T7=[new ng(">=0.0.0-0")],qM=[new ng(">=0.0.0")],I7=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===tg){if(t.length===1&&t[0].semver===tg)return!0;r.includePrerelease?e=T7:e=qM}if(t.length===1&&t[0].semver===tg){if(r.includePrerelease)return!0;t=qM}let n=new Set,i,o;for(let m of e)m.operator===">"||m.operator===">="?i=VM(i,m,r):m.operator==="<"||m.operator==="<="?o=WM(o,m,r):n.add(m.semver);if(n.size>1)return null;let s;if(i&&o){if(s=ig(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&&!rg(m,String(i),r)||o&&!rg(m,String(o),r))return null;for(let g of t)if(!rg(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=VM(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=WM(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)},VM=(e,t,r)=>{if(!e)return t;let n=ig(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},WM=(e,t,r)=>{if(!e)return t;let n=ig(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};HM.exports=A7});var ZM=ae((PY,YM)=>{"use strict";var og=bl(),KM=yl(),P7=_r(),XM=z1(),R7=Ms(),L7=wS(),O7=_S(),B7=vS(),C7=TS(),D7=PS(),N7=LS(),F7=BS(),G7=DS(),k7=li(),U7=kS(),j7=jS(),z7=wd(),q7=WS(),V7=$S(),W7=lf(),H7=xd(),$7=W1(),K7=H1(),X7=_d(),Y7=Sd(),Z7=$1(),J7=rM(),Q7=iM(),e9=uf(),t9=ui(),r9=hf(),n9=wM(),i9=_M(),o9=MM(),s9=AM(),a9=IM(),c9=Ed(),l9=CM(),u9=NM(),f9=kM(),h9=jM(),d9=$M();YM.exports={parse:R7,valid:L7,clean:O7,inc:B7,diff:C7,major:D7,minor:N7,patch:F7,prerelease:G7,compare:k7,rcompare:U7,compareLoose:j7,compareBuild:z7,sort:q7,rsort:V7,gt:W7,lt:H7,eq:$7,neq:K7,gte:X7,lte:Y7,cmp:Z7,coerce:J7,truncate:Q7,Comparator:e9,Range:t9,satisfies:r9,toComparators:n9,maxSatisfying:i9,minSatisfying:o9,minVersion:s9,validRange:a9,outside:c9,gtr:l9,ltr:u9,intersects:f9,simplifyRange:h9,subset:d9,SemVer:P7,re:og.re,src:og.src,tokens:og.t,SEMVER_SPEC_VERSION:KM.SEMVER_SPEC_VERSION,RELEASE_TYPES:KM.RELEASE_TYPES,compareIdentifiers:XM.compareIdentifiers,rcompareIdentifiers:XM.rcompareIdentifiers}});var Oo,Ad=p(()=>{Oo={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 xl,QM,df,ag,p9,e3,g9,cg,y9,t3,b9,wl,w9,x9,_9,S9,r3,M9,JM,v9,E9,n3,A9,T9,i3,sg,I9,Td,lg=p(()=>{xl=require("node:child_process"),QM=require("node:crypto"),df=pe(ZM(),1),ag=pe(dd(),1);Ad();p9=process.env.npm_package_config_libvips||Oo.config.libvips,e3=df.default.coerce(p9).version,g9=["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"],cg={encoding:"utf8",shell:!0},y9=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},t3=()=>ag.default.isNonGlibcLinuxSync()?ag.default.familySync():"",b9=()=>`${process.platform}${t3()}-${process.arch}`,wl=()=>{if(r3())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r=="string"?r:t3();return`${t||process.platform}${n}-${e||process.arch}`},w9=()=>{try{return require(`@img/sharp-libvips-dev-${wl()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},x9=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},_9=()=>{try{return require(`@img/sharp-libvips-dev-${wl()}/lib`)}catch{try{return require(`@img/sharp-libvips-${wl()}/lib`)}catch{}}return""},S9=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!df.default.satisfies(process.versions.node,Oo.engines.node))return{found:process.versions.node,expected:Oo.engines.node}},r3=()=>{let{CC:e}=process.env;return!!(e!=null&&e.endsWith("/emcc"))},M9=()=>process.platform==="darwin"&&process.arch==="x64"?((0,xl.spawnSync)("sysctl sysctl.proc_translated",cg).stdout||"").trim()==="sysctl.proc_translated: 1":!1,JM=e=>(0,QM.createHash)("sha512").update(e).digest("hex"),v9=()=>{try{let e=JM(`imgsharp-libvips-${wl()}`),t=df.default.coerce(Oo.optionalDependencies[`@img/sharp-libvips-${wl()}`],{includePrerelease:!0}).version;return JM(`${e}npm:${t}`).slice(0,10)}catch{}return""},E9=()=>(0,xl.spawnSync)(`node-gyp rebuild --directory=src ${r3()?"--nodedir=emscripten":""}`,{...cg,stdio:"inherit"}).status,n3=()=>process.platform!=="win32"?((0,xl.spawnSync)("pkg-config --modversion vips-cpp",{...cg,env:{...process.env,PKG_CONFIG_PATH:i3()}}).stdout||"").trim():"",A9=()=>{try{let e=((0,xl.spawnSync)("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch{}},T9=()=>{try{let e=((0,xl.spawnSync)("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch{}},i3=()=>process.platform!=="win32"?[A9(),T9(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",sg=(e,t,r)=>(r&&r(`Detected ${t}, skipping search for globally-installed libvips`),e),I9=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return sg(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return sg(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(M9())return sg(!1,"Rosetta",e);let t=n3();return!!t&&df.default.gte(t,e3)},Td={minimumLibvipsVersion:e3,prebuiltPlatforms:g9,buildPlatformArch:wl,buildSharpLibvipsIncludeDir:w9,buildSharpLibvipsCPlusPlusDir:x9,buildSharpLibvipsLibDir:_9,isUnsupportedNodeRuntime:S9,runtimePlatformArch:b9,log:y9,yarnLocator:v9,spawnRebuild:E9,globalLibvipsVersion:n3,pkgConfigPath:i3,useGlobalLibvips:I9}});var s3,Id,O9,sr,a3,P9,o3,R9,L9,Bo,gt,vs,rt,mf=p(()=>{s3=require("node:module"),Id=pe(dd(),1);lg();Ad();O9={};sr=(0,s3.createRequire)(O9.url),{version:a3}=Oo,{runtimePlatformArch:P9,isUnsupportedNodeRuntime:o3,prebuiltPlatforms:R9,minimumLibvipsVersion:L9}=Td,Bo=P9(),vs=[];try{gt=sr(`../src/build/Release/sharp-${Bo}-${a3}.node`)}catch(e){vs.push(e)}if(!gt)try{gt=sr(`../src/build/Release/sharp-wasm32-${a3}.node`)}catch(e){vs.push(e)}if(!gt)try{switch(Bo){case"darwin-arm64":gt=sr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":gt=sr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":gt=sr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":gt=sr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":gt=sr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":gt=sr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":gt=sr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":gt=sr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":gt=sr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":gt=sr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":gt=sr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":gt=sr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":gt=sr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":gt=sr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":gt=sr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(gt&&["linux-x64","linuxmusl-x64"].includes(Bo)&&!gt._isUsingX64V2()){let e=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",vs.push(e),gt=null}gt&&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){vs.push(e)}if(!gt)try{gt=sr("@img/sharp-wasm32/sharp.node")}catch(e){vs.push(e)}if(!gt){let[e,t,r]=["linux","darwin","win32"].map(o=>Bo.startsWith(o)),n=[`Could not load the "sharp" module using the ${Bo} runtime`];vs.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=vs.map(o=>o.message).join(" ");if(n.push("Possible solutions:"),o3()){let{found:o,expected:s}=o3();n.push("- Please upgrade Node.js:",` Found ${o}`,` Requires ${s}`)}else if(R9.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 >= ${L9}`," 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}=sr(`@img/sharp-libvips-${Bo}/package`),s=`${(0,Id.familySync)()} ${(0,Id.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"),vs.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
- `))}rt=gt});function D9(){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 c3,Pd,B9,C9,Ya,to,l3=p(()=>{c3=pe(require("node:util"),1),Pd=pe(require("node:stream"),1);Yi();mf();B9=c3.default.debuglog("sharp"),C9=e=>{Ya.queue.emit("change",e)},Ya=function(e,t){if(arguments.length===1&&!f.defined(e))throw new Error("Invalid input");return this instanceof Ya?(Pd.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),B9(r)},queueListener:C9},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new Ya(e,t)};Object.setPrototypeOf(Ya.prototype,Pd.default.Duplex.prototype);Object.setPrototypeOf(Ya,Pd.default.Duplex);Object.assign(Ya.prototype,{clone:D9});to=Ya});function u3(e){let t=F9.filter(r=>f.defined(e[r])).map(r=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function G9(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,u3(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 k9(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 U9(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function j9(){return Array.isArray(this.options.input.buffer)}function z9(e){this.writableFinished?e():this.once("finish",e)}function q9(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.metadata(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):rt.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(),rt.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{rt.metadata(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}function V9(e){let t=Error();return f.fn(e)?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.stats(this.options,(r,n)=>{r?e(f.nativeError(r,t)):e(null,n)})}):rt.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(),rt.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}):new Promise((r,n)=>{rt.stats(this.options,(i,o)=>{i?n(f.nativeError(i,t)):r(o)})})}var N9,F9,f3,h3=p(()=>{Yi();mf();N9={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},F9=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];f3=e=>{Object.assign(e.prototype,{_inputOptionsFromObject:u3,_createInputDescriptor:G9,_write:k9,_flattenBufferIn:U9,_isStreamInput:j9,_whenStreamInFinished:z9,metadata:q9,stats:V9}),e.align=N9}});function fg(e){return e.angle%360!==0||e.rotationAngle!==0}function Rd(e){return e.width!==-1||e.height!==-1}function $9(e,t,r){if(Rd(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=H9[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:g3[r.position]||p3[r.position]||m3[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(ug[r.kernel]))this.options.kernel=ug[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 fg(this.options)&&Rd(this.options)&&(this.options.rotateBefore=!0),this}function K9(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(d3[e.extendWith]))this.options.extendWith=d3[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 X9(e){let t=Rd(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),fg(this.options)&&!Rd(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function Y9(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 fg(this.options)&&(this.options.rotateBefore=!0),this}var m3,p3,d3,g3,ug,W9,H9,y3,b3=p(()=>{Yi();m3={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},p3={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},d3={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},g3={entropy:16,attention:17},ug={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},W9={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},H9={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};y3=e=>{Object.assign(e.prototype,{resize:$9,extend:K9,extract:X9,trim:Y9}),e.gravity=m3,e.strategy=g3,e.kernel=ug,e.fit=W9,e.position=p3}});function Z9(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(hg[t.blend]))n.blend=hg[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 hg,w3,x3=p(()=>{Yi();hg={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"};w3=e=>{e.prototype.composite=Z9,e.blend=hg}});function J9(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 Q9(){return this.options.input.autoOrient=!0,this}function eG(e){return this.options.flip=f.bool(e)?e:!0,this}function tG(e){return this.options.flop=f.bool(e)?e:!0,this}function rG(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 nG(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 oG(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(_3[e.precision]))this.options.precision=_3[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 sG(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 aG(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 cG(e){return this.options.flatten=f.bool(e)?e:!0,f.object(e)&&this._setBackgroundColourOption("flattenBackground",e.background),this}function lG(){return this.options.unflatten=!0,this}function uG(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 fG(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 hG(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 dG(e){return this.normalise(e)}function mG(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 pG(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 gG(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 yG(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 bG(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 wG(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 xG(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 _3,S3,M3=p(()=>{Yi();_3={integer:"integer",float:"float",approximate:"approximate"};S3=e=>{Object.assign(e.prototype,{autoOrient:Q9,rotate:J9,flip:eG,flop:tG,affine:rG,sharpen:nG,erode:aG,dilate:sG,median:iG,blur:oG,flatten:cG,unflatten:lG,gamma:uG,negate:fG,normalise:hG,normalize:dG,clahe:mG,convolve:pG,threshold:gG,boolean:yG,linear:bG,recomb:wG,modulate:xG})}});var P3=ae((KY,I3)=>{var yg=Object.defineProperty,_G=Object.getOwnPropertyDescriptor,SG=Object.getOwnPropertyNames,MG=Object.prototype.hasOwnProperty,vG=(e,t)=>{for(var r in t)yg(e,r,{get:t[r],enumerable:!0})},EG=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of SG(t))!MG.call(e,i)&&i!==r&&yg(e,i,{get:()=>t[i],enumerable:!(n=_G(t,i))||n.enumerable});return e},AG=e=>EG(yg({},"__esModule",{value:!0}),e),v3={};vG(v3,{default:()=>UG});I3.exports=AG(v3);var dg={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 dg)Object.freeze(dg[e]);var ro=Object.freeze(dg),E3=Object.create(null);for(let e in ro)Object.hasOwn(ro,e)&&(E3[ro[e]]=e);var pn={to:{},get:{}};pn.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=pn.get.hsl(e),n="hsl";break}case"hwb":{r=pn.get.hwb(e),n="hwb";break}default:{r=pn.get.rgb(e),n="rgb";break}}return r?{model:n,value:r}:null};pn.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(ro,a[1])?(s=ro[a[1]].slice(),s[3]=1,s):null:null;for(c=0;c<3;c++)s[c]=Es(s[c],0,255);return s[3]=Es(s[3],0,1),s};pn.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=Es(Number.parseFloat(r[2]),0,100),s=Es(Number.parseFloat(r[3]),0,100),a=Es(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};pn.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=Es(Number.parseFloat(r[2]),0,100),s=Es(Number.parseFloat(r[3]),0,100),a=Es(Number.isNaN(n)?1:n,0,1);return[i,o,s,a]}return null};pn.to.hex=function(...e){return"#"+Ld(e[0])+Ld(e[1])+Ld(e[2])+(e[3]<1?Ld(Math.round(e[3]*255)):"")};pn.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]+")"};pn.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]+")"};pn.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]+")"};pn.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};pn.to.keyword=function(...e){return E3[e.slice(0,3)]};function Es(e,t,r){return Math.min(Math.max(t,e),r)}function Ld(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var _l=pn,A3={};for(let e of Object.keys(ro))A3[ro[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"]}},Za=X,Co=(6/29)**3;function Ml(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function vl(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=vl(e[0]/255),r=vl(e[1]/255),n=vl(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 TG(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=A3[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(ro)){let o=ro[i],s=TG(e,o);s<r&&(r=s,n=i)}return n};X.keyword.rgb=function(e){return[...ro[e]]};X.rgb.xyz=function(e){let t=vl(e[0]/255),r=vl(e[1]/255),n=vl(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>Co?r**(1/3):7.787*r+16/116,n=n>Co?n**(1/3):7.787*n+16/116,i=i>Co?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=Ml(i),o=Ml(o),s=Ml(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>Co?t**(1/3):7.787*t+16/116,r=r>Co?r**(1/3):7.787*r+16/116,n=n>Co?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=Ml(4.0767416621*i-3.3077115913*o+.2309699292*s),c=Ml(-1.2684380046*i+2.6097574011*o-.3413193965*s),l=Ml(-.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>Co?a:(o-16/116)/7.787,i=c>Co?c:(i-16/116)/7.787,s=l>Co?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 IG(){let e={},t=Object.keys(Za);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function PG(e){let t=IG(),r=[e];for(t[e].distance=0;r.length>0;){let n=r.pop(),i=Object.keys(Za[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 RG(e,t){return function(r){return t(e(r))}}function LG(e,t){let r=[t[e].parent,e],n=Za[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=RG(Za[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}function OG(e){let t=PG(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]=LG(s,t))}return r}var BG=OG,Sl={},CG=Object.keys(Za);function DG(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 NG(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 CG){Sl[e]={},Object.defineProperty(Sl[e],"channels",{value:Za[e].channels}),Object.defineProperty(Sl[e],"labels",{value:Za[e].labels});let t=BG(e),r=Object.keys(t);for(let n of r){let i=t[n];Sl[e][n]=NG(i),Sl[e][n].raw=DG(i)}}var Cn=Sl,T3=["keyword","gray","hex"],mg={};for(let e of Object.keys(Cn))mg[[...Cn[e].labels].sort().join("")]=e;var pg={};function gr(e,t){if(!(this instanceof gr))return new gr(e,t);if(t&&t in T3&&(t=null),t&&!(t in Cn))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 gr)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){let i=_l.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Cn[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=Cn[this.model].channels;let i=Array.prototype.slice.call(e,0,n);this.color=gg(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 mg))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=mg[o];let{labels:s}=Cn[this.model],a=[];for(r=0;r<s.length;r++)a.push(e[s[r]]);this.color=gg(a)}if(pg[this.model])for(n=Cn[this.model].channels,r=0;r<n;r++){let i=pg[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)}gr.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in _l.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return _l.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 _l.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Cn[this.model],{labels:r}=Cn[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 gr([...this.color.map(GG(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new gr([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:zt("rgb",0,ar(255)),green:zt("rgb",1,ar(255)),blue:zt("rgb",2,ar(255)),hue:zt(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:zt("hsl",1,ar(100)),lightness:zt("hsl",2,ar(100)),saturationv:zt("hsv",1,ar(100)),value:zt("hsv",2,ar(100)),chroma:zt("hcg",1,ar(100)),gray:zt("hcg",2,ar(100)),white:zt("hwb",1,ar(100)),wblack:zt("hwb",2,ar(100)),cyan:zt("cmyk",0,ar(100)),magenta:zt("cmyk",1,ar(100)),yellow:zt("cmyk",2,ar(100)),black:zt("cmyk",3,ar(100)),x:zt("xyz",0,ar(95.047)),y:zt("xyz",1,ar(100)),z:zt("xyz",2,ar(108.833)),l:zt("lab",0,ar(100)),a:zt("lab",1),b:zt("lab",2),keyword(e){return e!==void 0?new gr(e):Cn[this.model].keyword(this.color)},hex(e){return e!==void 0?new gr(e):_l.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new gr(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();return r.length===1&&(r="0"+r),_l.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 gr.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 gr.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(Cn)){if(T3.includes(e))continue;let{channels:t}=Cn[e];gr.prototype[e]=function(...r){return this.model===e?new gr(this):r.length>0?new gr(r,e):new gr([...kG(Cn[this.model][e].raw(this.color)),this.valpha],e)},gr[e]=function(...r){let n=r[0];return typeof n=="number"&&(n=gg(r,t)),new gr(n,e)}}function FG(e,t){return Number(e.toFixed(t))}function GG(e){return function(t){return FG(t,e)}}function zt(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(pg[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 ar(e){return function(t){return Math.max(0,Math.min(e,t))}}function kG(e){return Array.isArray(e)?e:[e]}function gg(e,t){for(let r=0;r<t;r++)typeof e[r]!="number"&&(e[r]=0);return e}var UG=gr});var L3=ae((XY,R3)=>{R3.exports=P3().default});function jG(e){return this._setBackgroundColourOption("tint",e),this}function zG(e){return this.options.greyscale=f.bool(e)?e:!0,this}function qG(e){return this.greyscale(e)}function VG(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function WG(e){return this.pipelineColourspace(e)}function HG(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function $G(e){return this.toColourspace(e)}function C3(e){if(f.object(e)||f.string(e)&&e.length>=3&&e.length<=200){let t=(0,B3.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 KG(e,t){f.defined(t)&&(this.options[e]=C3(t))}var B3,O3,D3,N3=p(()=>{B3=pe(L3(),1);Yi();O3={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};D3=e=>{Object.assign(e.prototype,{tint:jG,greyscale:zG,grayscale:qG,pipelineColourspace:VG,pipelineColorspace:WG,toColourspace:HG,toColorspace:$G,_getBackgroundColourOption:C3,_setBackgroundColourOption:KG}),e.colourspace=O3,e.colorspace=O3}});function YG(){return this.options.removeAlpha=!0,this}function ZG(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 QG(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 ek(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 XG,F3,G3=p(()=>{Yi();XG={and:"and",or:"or",eor:"eor"};F3=e=>{Object.assign(e.prototype,{removeAlpha:YG,ensureAlpha:ZG,extractChannel:JG,joinChannel:QG,bandbool:ek}),e.bool=XG}});function rk(e,t){let r;if(f.string(e)?f.string(this.options.input.file)&&Od.default.resolve(this.options.input.file)===Od.default.resolve(e)?r=new Error("Cannot use same file for input and output"):tk.test(Od.default.extname(e))&&!this.constructor.format.jp2.output.file&&(r=U3()):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 nk(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 ok(e){if(f.number(e)&&e>0)this.options.withMetadataDensity=e;else throw f.invalidParameterError("density","positive number",e);return this.keepExif()}function sk(){return this.options.keepMetadata|=1,this}function ak(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 ck(e){return this.withExif(e),this.options.withExifMerge=!0,this}function lk(){return this.options.keepMetadata|=8,this}function uk(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 fk(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function hk(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function dk(){return this.options.keepMetadata|=2,this}function mk(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 pk(){return this.options.keepMetadata|=31,this}function gk(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 yk(e,t){let r=k3.get((f.object(e)&&f.string(e.id)?e.id:e).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...k3.keys()].join(", ")}`,e);return this[r](t)}function bk(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 wk(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=j3(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 xk(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 bg(e,this.options),this._updateFormatOut("webp",e)}function _k(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=j3(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 bg(e,this.options),this._updateFormatOut("gif",e)}function Sk(e){if(!this.constructor.format.jp2.output.buffer)throw U3();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 bg(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 Mk(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 vk(e){return this.heif({...e,compression:"av1"})}function Ek(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 Ak(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 bg(e,this.options),this._updateFormatOut("jxl",e)}function Tk(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 Ik(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 Pk(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 Rk(e,t){return f.object(t)&&t.force===!1||(this.options.formatOut=e),this}function Lk(e,t){if(f.bool(t))this.options[e]=t;else throw f.invalidParameterError(e,"boolean",t)}function Ok(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function Bk(e,t){return typeof e=="function"?(this._isStreamInput()?this._whenStreamInFinished(()=>{this._flattenBufferIn(),rt.pipeline(this.options,(r,n,i)=>{r?e(f.nativeError(r,t)):e(null,n,i)})}):rt.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(),rt.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"))})}):rt.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(),rt.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)=>{rt.pipeline(this.options,(i,o,s)=>{i?n(f.nativeError(i,t)):this.options.resolveWithObject?r({data:o,info:s}):r(o)})})}var Od,k3,tk,U3,j3,z3,q3=p(()=>{Od=pe(require("node:path"),1);Yi();mf();k3=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"]]),tk=/\.(jp[2x]|j2[kc])$/i,U3=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),j3=e=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1);z3=e=>{Object.assign(e.prototype,{toFile:rk,toBuffer:nk,toUint8Array:ik,withDensity:ok,keepExif:sk,withExif:ak,withExifMerge:ck,keepIccProfile:lk,withIccProfile:uk,keepGainMap:fk,withGainMap:hk,keepXmp:dk,withXmp:mk,keepMetadata:pk,withMetadata:gk,toFormat:yk,jpeg:bk,jp2:Sk,png:wk,webp:xk,tiff:Mk,avif:vk,heif:Ek,jxl:Ak,gif:_k,raw:Tk,tile:Ik,timeout:Pk,_updateFormatOut:Rk,_setBooleanOption:Lk,_read:Ok,_pipeline:Bk})}});function K3(e){if(f.bool(e))return e?rt.cache(50,20,100):rt.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 rt.cache(e.memory,e.files,e.items)}else return rt.cache()}function Dk(e){return rt.concurrency(f.integer(e)?e:null)}function Fk(){return rt.counters()}function Gk(e){return rt.simd(f.bool(e)?e:null)}function kk(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))rt.block(e.operation,!0);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}function Uk(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))rt.block(e.operation,!1);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}var W3,H3,$3,pf,jk,wg,V3,xg,As,Ck,El,Nk,X3,Y3=p(()=>{W3=pe(require("node:events"),1),H3=require("node:module"),$3=require("node:os"),pf=pe(dd(),1);Yi();lg();mf();Ad();jk={};wg=(0,H3.createRequire)(jk.url),V3=Td.runtimePlatformArch(),xg=rt.libvipsVersion(),As=rt.format();As.heif.output.alias=["avif","heic"];As.jpeg.output.alias=["jpe","jpg"];As.tiff.output.alias=["tif"];As.jp2.output.alias=["j2c","j2k","jp2","jpx"];Ck={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},El={vips:xg.semver};if(!xg.isGlobal)if(xg.isWasm)try{El=wg("@img/sharp-wasm32/versions")}catch{}else try{El=wg(`@img/sharp-${V3}/versions`)}catch{try{El=wg(`@img/sharp-libvips-${V3}/versions`)}catch{}}El.sharp=Oo.version;El.heif&&As.heif&&(As.heif.input.fileSuffix=[".avif"],As.heif.output.alias=["avif"]);K3(!0);!process.env.MALLOC_ARENA_MAX&&pf.default.familySync()===pf.default.GLIBC&&!rt._isUsingJemalloc()?rt.concurrency(1):pf.default.familySync()===pf.default.MUSL&&rt.concurrency()===1024&&rt.concurrency((0,$3.availableParallelism)());Nk=new W3.default.EventEmitter;X3=e=>{e.cache=K3,e.concurrency=Dk,e.counters=Fk,e.simd=Gk,e.format=As,e.interpolators=Ck,e.versions=El,e.queue=Nk,e.block=kk,e.unblock=Uk}});var Z3={};ir(Z3,{default:()=>zk});var zk,J3=p(()=>{l3();h3();b3();x3();M3();N3();G3();q3();Y3();f3(to);y3(to);w3(to);S3(to);D3(to);F3(to);z3(to);X3(to);zk=to});async function Tl(e,t,r,n){return n._parse(e,t,r,n)}var fv=p(()=>{"use strict"});function Il(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var hv=p(()=>{"use strict"});var no,Yk,Zk,Jk,Qk,$d,dv,eU,mv=p(()=>{"use strict";no={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Yk=no.self||no.window||no.global||{},Zk=no.window||no.self||no.global||{},Jk=no.global||no.self||no.window||{},Qk=no.document||{},$d=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),dv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),eU=dv&&parseFloat(dv[1])||0});function Pl(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 pv=p(()=>{"use strict"});function Rg(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Lg(e){var r,n;return((n=(r=globalThis.loaders)==null?void 0:r.modules)==null?void 0:n[e])||null}var Og=p(()=>{"use strict"});function tU(){let e="5.0.0-beta.2";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=e,e}var gv,yv=p(()=>{"use strict";gv=tU()});function bv(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var wv=p(()=>{"use strict"});var io,yJ,bJ,wJ,xJ,Ti,Qa,_J,xv,SJ,Bg=p(()=>{"use strict";io={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},yJ=io.self||io.window||io.global||{},bJ=io.window||io.self||io.global||{},wJ=io.global||io.self||io.window||{},xJ=io.document||{},Ti=typeof process!="object"||String(process)!=="[object process]"||process.browser,Qa=typeof importScripts=="function",_J=typeof window<"u"&&typeof window.orientation<"u",xv=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),SJ=xv&&parseFloat(xv[1])||0});var Cg,_v,Sv=p(()=>{Cg=require("worker_threads"),_v=Cg.parentPort});function vv(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),Mv(s))n.add(s);else if(ArrayBuffer.isView(s))Mv(s.buffer)&&n.add(s.buffer);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 Mv(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 Ev=p(()=>{});async function Rl(){return _v}function rU(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 Kd,Mr,Av=p(()=>{Ev();Sv();Kd=new Map,Mr=class{static async inWorkerThread(){let t=globalThis.WorkerGlobalScope;return typeof t=="function"&&globalThis instanceof t||!!await Rl()}static set onmessage(t){async function r(n){let i=await Rl(),{type:o,payload:s}=i?n:n.data;t(o,s)}Rl().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=Kd.get(t);r||(r=i=>{let o=rU(i);o&&t(o.type,o.payload)},Kd.set(t,r));let n=await Rl();n?n.on("message",r):globalThis.addEventListener("message",r)}static async removeEventListener(t){let r=Kd.get(t);if(Kd.delete(t),!r)return;let n=await Rl();n?n.off("message",r):globalThis.removeEventListener("message",r)}static async postMessage(t,r){let n={source:"loaders.gl",type:t,payload:r},i=vv(r),o=await Rl();o?o.postMessage(n,i):globalThis.postMessage(n,i)}}});var Ll,Tv=p(()=>{Ll=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 Xd,Iv=p(()=>{Xd=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)}}});async function yf(e,t){if(!await Mr.inWorkerThread())return;let r={process:oU};Mr.onmessage=async(n,i)=>{var h;if(n==="cancel"){Fo==null||Fo.abort(),No==null||No.close(),ec==null||ec.close();return}let o=n==="process"||n==="process-in-batches"?new AbortController:void 0;o&&(Fo=o);let s=performance.now(),a=n==="process"||n==="process-in-batches"?sU():void 0,c,l=()=>{o==null||o.signal.throwIfAborted(),c==null||c.throwIfCancelled()},u={...r,signal:o==null?void 0:o.signal,sharedState:c,throwIfAborted:l,reportProgress:d=>{!(o!=null&&o.signal.aborted)&&!(c!=null&&c.snapshot.cancelled)&&(a==null||a.report(d))}};try{switch(o&&((h=i.options)!=null&&h.sharedState)&&(c=new Xd(i.options.sharedState),u.sharedState=c),n){case"preload":Mr.postMessage("done",{});break;case"process":if(l(),!e)throw new Error("Worker does not support atomic processing");let d=await e(i.input,i.options||{},u,i.context||{});l(),a==null||a.finish(),await Mr.postMessage("done",{result:d,executionMs:performance.now()-s});break;case"process-in-batches":if(l(),!t)throw new Error("Worker does not support batched processing");let m=new Ll,g=new Ll;No=m,ec=g;try{let y=t(iU(m),i.options||{},u,i.context||{});for await(let b of y)l(),await Mr.postMessage("output-batch",{result:b}),await g.next();l(),a==null||a.finish(),await Mr.postMessage("done",{executionMs:performance.now()-s})}finally{No=null,ec=null}break;case"input-batch":if(!No)throw new Error("Worker has no active batched processing session");No.push(i.input);break;case"input-done":if(!No)throw new Error("Worker has no active batched processing session");No.close();break;case"output-ack":if(!ec)throw new Error("Worker has no active batched processing session");ec.push(void 0);break;default:}}catch(d){a==null||a.finish((o==null?void 0:o.signal.aborted)||(c==null?void 0:c.snapshot.cancelled));let m=d instanceof Error?d.message:"";await Mr.postMessage("error",{error:m,errorName:d instanceof Error?d.name:"Error"})}finally{o&&Fo===o&&(Fo=null)}},await Mr.postMessage("ready",{})}async function*iU(e){for(;;){await Mr.postMessage("input-request",{});let t=await e.next();if(t.done)return;yield t.value}}function oU(e,t={},r={}){let n=Fo==null?void 0:Fo.signal;return n==null||n.throwIfAborted(),new Promise((i,o)=>{let s=nU++,a=()=>{n==null||n.removeEventListener("abort",c),Mr.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)))};Mr.addEventListener(l).then(async()=>{if(n!=null&&n.aborted){c();return}n==null||n.addEventListener("abort",c,{once:!0}),await Mr.postMessage("process",{id:s,input:e,options:t,context:r})}).catch(u=>{a(),o(u)})})}function sU(){let e,t=!1,r=!1,n=()=>{r=!1,e&&(Mr.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 nU,Fo,No,ec,Pv=p(()=>{Iv();Tv();Av();nU=0,Fo=null,No=null,ec=null});var aU,Dg,DJ,Rv=p(()=>{Pv();aU={},Dg=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",DJ=Dg?`file://${Dg.startsWith("/")?"":"/"}${encodeURI(Dg).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:aU.url});var Lv=p(()=>{Rv()});var Ov=p(()=>{"use strict";Lv()});function tc(e={}){var i,o;let t=e.useLocalLibraries??((i=e.core)==null?void 0:i.useLocalLibraries),r=cU(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 cU(e,t){if(typeof e=="string"||e===null)return e;if(typeof t=="string"||t===null)return t}async function Ol(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=Fg(e,t,r,n),o=i&&(!(typeof u=="string")||typeof((c=r.modules)==null?void 0:c[i])=="string")?Fg(i,t,r,i):e}let s=lU(e,o,Qa);return Ng[s]=Ng[s]||uU(e,o),await Ng[s]}function lU(e,t,r){return r?JSON.stringify([e,t]):e}function Fg(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(!Ti)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 bv(r.CDN.startsWith("http")),`${r.CDN}/${t}@${gv}/dist/libs/${n}`}return Qa?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${t}/src/libs/${n}`}async function uU(e,t){if(e.endsWith("wasm"))return await dU(e);if(!Ti){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(Qa)return fU(e,t);let r=await mU(e);return hU(r,e)}async function fU(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 hU(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 dU(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};if(Ti||!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 mU(e){let{readFileAsText:t}=globalThis.loaders||{};if(Ti||!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 Ng,Bv=p(()=>{"use strict";Bg();wv();yv();Ng={}});var rc=p(()=>{"use strict";Bg();Ov();Bv()});async function kg(e,t=()=>e){await yf((r,n,i,o)=>pU(t(n||{}),r,n,i,o),(r,n,i,o)=>Cv(t(n||{}),r,n,i,o))}async function pU(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:Dv(),_parse:Nv(n==null?void 0:n.process)}});return e.serializeWorkerResult?e.serializeWorkerResult(o,r,i):o}async function*Cv(e,t,r={},n,i={}){if(!e.parseInBatches)throw new Error(`${e.id} loader does not support batched parsing`);let o=Gv(e,r),s=e.parseInBatches(t,o,{...i,reportProgress:n==null?void 0:n.reportProgress,coreApi:Dv(),_parse:Nv(n==null?void 0:n.process)});for await(let a of s)yield e.serializeWorkerBatch?e.serializeWorkerBatch(a,r,i):a}function Dv(){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 Nv(e){return(t,r,n,i)=>{if(!e)throw new Error("Worker not set up to parse on main thread");let o=gU(r,n,i);return e(t,o.options,{...o.context,...Array.isArray(r)||r&&Fv(r)?{_loaderIsArray:Array.isArray(r),_loaderIds:(Array.isArray(r)?r:[r]).map(s=>s.id)}:{}})}}function gU(e,t,r){return t?{options:t,context:Gg(r)}:Array.isArray(e)||e&&Fv(e)?{options:void 0,context:Gg(r)}:e&&!Array.isArray(e)?{options:e}:{options:void 0,context:Gg(r)}}function Fv(e){return"id"in e&&"extensions"in e}function Gg(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=Gv(e,r),await o(i,{...r},n,e)}function Gv(e,t){var r;return{...t,modules:{...(r=e.options)==null?void 0:r.modules,...t.modules},core:{...t.core,worker:!1}}}var kv=p(()=>{"use strict";rc()});function Yd(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:Uv(e.crs||{state:"absent",provenance:"unknown"}),vertical:e.vertical?Uv(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 yr(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 Uv(e){return e.state==="explicit"||e.state==="default"?Object.freeze({...e,definition:jv(e.definition),alternatives:e.alternatives?Object.freeze(e.alternatives.map(t=>Object.freeze({...t,definition:jv(t.definition)}))):void 0}):Object.freeze({...e})}function jv(e){return typeof e=="string"?e:Ug(e)}function Ug(e){return Array.isArray(e)?Object.freeze(e.map(t=>Ug(t))):e&&typeof e=="object"?Object.freeze(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Ug(r)]))):e}var Bl=p(()=>{});function wf(e,t){let n={type:"wkt-crs",root:new jg(e).parse()};if(t!=null&&t.strict){let i=Wv(n,{profile:t.profile,allowExtensions:!1});if(i.length>0)throw new Jd(i)}return n}function Wv(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=IU(e.root.keyword,(t==null?void 0:t.profile)||"auto"),n=AU[r],i=TU[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}),Hv(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=PU(c.node);u&&o.push({code:"invalid-value",message:u,path:c.path,keyword:c.node.keyword})}),o}function IU(e,t){return t!=="auto"?t:bf.has(e.toUpperCase())?"wkt1":"wkt2:2019"}function PU(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 Hv(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"&&Hv(i,[...t,n],r)}}function RU(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 Zd,Jd,bU,wU,bf,zg,xU,_U,SU,MU,zv,qv,Vv,vU,EU,AU,TU,jg,qg=p(()=>{Zd=class extends SyntaxError{constructor(t,r,n){let i=RU(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="WKTCRSSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}},Jd=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}},bU=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?$/,wU=/^[A-Za-z][A-Za-z0-9_]*/,bf=new Set(["COMPD_CS","CONCAT_MT","FITTED_CS","GEOCCS","GEOGCS","INVERSE_MT","LOCAL_CS","PARAM_MT","PASSTHROUGH_MT","PROJCS","VERT_CS"]),zg=new Set([...bf,"AUTHORITY","AXIS","CONCAT_MT","DATUM","INVERSE_MT","LOCAL_DATUM","PARAMETER","PARAM_MT","PASSTHROUGH_MT","PRIMEM","PROJECTION","SPHEROID","TOWGS84","UNIT","VERT_DATUM"]),xU=new Set(bf),_U=new Set([...zg,"EXTENSION"]),SU=new Set([...bf,"COMPDCS","LOCALCS","VERTCS"]),MU=new Set([...zg,"COMPDCS","LOCALCS","VDATUM","VERTCS"]),zv=new Set(["BOUNDCRS","COMPOUNDCRS","COORDINATEOPERATION","ENGCRS","ENGINEERINGCRS","GEODCRS","GEODETICCRS","PARAMETRICCRS","PROJCRS","PROJECTEDCRS","TIMECRS","VERTCRS","VERTICALCRS"]),qv=new Set([...zv,"CONCATENATEDOPERATION","COORDINATEMETADATA","DERIVEDPROJCRS","GEOGCRS","GEOGRAPHICCRS","POINTMOTIONOPERATION"]),Vv=new Set([...qv,"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"]),vU=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"]),EU=new Set([...Vv].filter(e=>!vU.has(e))),AU={wkt1:bf,gdal:xU,esri:SU,"wkt2:2015":zv,"wkt2:2019":qv},TU={wkt1:zg,gdal:_U,esri:MU,"wkt2:2015":EU,"wkt2:2019":Vv};jg=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)):bU.test(n)?{type:"number",value:Number(n),raw:n}:{type:"enumeration",value:n}}parseKeyword(){let t=this.source.slice(this.offset).match(wU);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 Zd(t,this.source,this.offset)}}});function xf(e){let t=BU(e);if(t.length===0)throw new Go("PROJ string is empty",e,0);return{type:"proj-string",parameters:t.map(n=>OU(n.raw,n.offset,e))}}function OU(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=CU(s,r,t+i+1);return{type:"parameter",name:o,value:a,rawValue:s}}function BU(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 CU(e,t,r){if(!e)return"";let n=e[0];if(n!=='"'&&n!=="'"){if((e.includes('"')||e.includes("'"))&&!LU.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 DU(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,LU,Vg=p(()=>{Go=class extends SyntaxError{constructor(t,r,n){let i=DU(r,n);super(`${t} at ${i.line}:${i.column}`),this.name="PROJStringSyntaxError",this.offset=n,this.line=i.line,this.column=i.column}};LU=/^[+-]?\d+(?:\.\d*)?d(?:\d+(?:\.\d*)?'(?:\d+(?:\.\d*)?")?)?[NSEW]?$/i});var _f,$v=p(()=>{_f={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 Kv(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 Wg=p(()=>{$v()});var Hg=p(()=>{Bl();qg();Vg()});var Qd={};ir(Qd,{EPSILON1:()=>NU,EPSILON10:()=>WU,EPSILON11:()=>HU,EPSILON12:()=>$U,EPSILON13:()=>KU,EPSILON14:()=>XU,EPSILON15:()=>YU,EPSILON16:()=>ZU,EPSILON17:()=>JU,EPSILON18:()=>QU,EPSILON19:()=>ej,EPSILON2:()=>FU,EPSILON20:()=>tj,EPSILON3:()=>GU,EPSILON4:()=>kU,EPSILON5:()=>UU,EPSILON6:()=>jU,EPSILON7:()=>zU,EPSILON8:()=>qU,EPSILON9:()=>VU,PI:()=>oj,PI_OVER_FOUR:()=>nj,PI_OVER_SIX:()=>ij,PI_OVER_TWO:()=>rj,TWO_PI:()=>sj});var NU,FU,GU,kU,UU,jU,zU,qU,VU,WU,HU,$U,KU,XU,YU,ZU,JU,QU,ej,tj,rj,nj,ij,oj,sj,Xv=p(()=>{NU=.1,FU=.01,GU=.001,kU=1e-4,UU=1e-5,jU=1e-6,zU=1e-7,qU=1e-8,VU=1e-9,WU=1e-10,HU=1e-11,$U=1e-12,KU=1e-13,XU=1e-14,YU=1e-15,ZU=1e-16,JU=1e-17,QU=1e-18,ej=1e-19,tj=1e-20,rj=Math.PI/2,nj=Math.PI/4,ij=Math.PI/6,oj=Math.PI,sj=Math.PI*2});function $g(e,{precision:t=wt.precision}={}){return e=uj(e),`${parseFloat(e.toPrecision(t))}`}function oo(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Kg(e){return Yv(e)}function Xg(e){return Zv(e)}function Yv(e,t){return Jv(e,r=>r*cj,t)}function Zv(e,t){return Jv(e,r=>r*aj,t)}function em(e,t,r){let n=wt.EPSILON;r&&(wt.EPSILON=r);try{if(e===t)return!0;if(oo(e)&&oo(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!em(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)<=wt.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{wt.EPSILON=n}}function uj(e){return Math.round(e/wt.EPSILON)*wt.EPSILON}function fj(e){return e.clone?e.clone():new Array(e.length)}function Jv(e,t,r){if(oo(e)){let n=e;r=r||fj(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 aj,cj,lj,wt,Cl=p(()=>{aj=1/Math.PI*180,cj=1/180*Math.PI,lj={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...lj}};wt=globalThis.mathgl.config});var Ts,tm=p(()=>{Cl();Ts=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:oo(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toString(){return this.formatString(wt)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+$g(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(!em(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(wt.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 hj(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 $t(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function Dl(e,t,r=""){if(wt.debug&&!hj(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}var nc=p(()=>{Cl()});var Nl,Yg=p(()=>{tm();nc();Cl();Nl=class extends Ts{toString(){let t="[";if(wt.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]=$t(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 Ii(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var Zg=p(()=>{});var rm,Qv=p(()=>{tm();nc();Zg();rm=class extends Ts{get x(){return this[0]}set x(t){this[0]=$t(t)}get y(){return this[1]}set y(t){this[1]=$t(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 $t(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return $t(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 Ii(t>=0&&t<this.ELEMENTS,"index is out of range"),$t(this[t])}setComponent(t,r){return Ii(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 nm,vQ,eE=p(()=>{nm=typeof Float32Array<"u"?Float32Array:Array,vQ=Math.PI/180});function tE(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 rE(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 im=p(()=>{});function nE(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 om(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 oE(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 sm=p(()=>{});function sE(){let e=new nm(3);return nm!==Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function mj(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function Jg(e,t,r){let n=new nm(3);return n[0]=e,n[1]=t,n[2]=r,n}function aE(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 Qg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fl(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 am(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 cm(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 cE(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 lE(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 uE(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 fE(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 hE(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&&Qg(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var dE,Gl=p(()=>{eE();dE=mj});var ey,lm,J,mE=p(()=>{Qv();Cl();nc();Gl();sm();ey=[0,0,0],J=class e extends rm{static get ZERO(){return lm||(lm=new e(0,0,0),Object.freeze(lm)),lm}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&oo(t)?this.copy(t):(wt.debug&&($t(t),$t(r),$t(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 wt.debug&&($t(t.x),$t(t.y),$t(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]=$t(t)}angle(t){return hE(this,t)}cross(t){return Fl(this,this,t),this.check()}rotateX({radians:t,origin:r=ey}){return lE(this,this,r,t),this.check()}rotateY({radians:t,origin:r=ey}){return uE(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=ey}){return fE(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return am(this,this,t),this.check()}transformAsVector(t){return om(this,this,t),this.check()}transformByMatrix3(t){return cm(this,this,t),this.check()}transformByMatrix2(t){return iE(this,this,t),this.check()}transformByQuaternion(t){return cE(this,this,t),this.check()}}});function pE(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 gE(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 yE(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 ty(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],S=r[6],M=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]=S*n+M*s+v*l,e[7]=S*i+M*a+v*u,e[8]=S*o+M*c+v*h,e}function bE(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 wE(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 ry(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 xE(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 ny=p(()=>{});function yj(){return um||(um=new ic([0,0,0,0,0,0,0,0,0]),Object.freeze(um)),um}function bj(){return fm||(fm=new ic,Object.freeze(fm)),fm}var iy,gj,ic,um,fm,_E=p(()=>{Yg();nc();sm();ny();im();Gl();(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"})(iy||(iy={}));gj=Object.freeze([1,0,0,0,1,0,0,0,1]),ic=class extends Nl{static get IDENTITY(){return bj()}static get ZERO(){return yj()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return iy}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(gj)}fromObject(t){return this.check()}fromQuaternion(t){return xE(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 yE(this)}transpose(){return pE(this,this),this.check()}invert(){return gE(this,this),this.check()}multiplyLeft(t){return ty(this,t,this),this.check()}multiplyRight(t){return ty(this,this,t),this.check()}rotate(t){return wE(this,this,t),this.check()}scale(t){return Array.isArray(t)?ry(this,this,t):ry(this,this,[t,t]),this.check()}translate(t){return bE(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=tE(r||[-0,-0],t,this);break;case 3:n=cm(r||[-0,-0,-0],t,this);break;case 4:n=oE(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Dl(n,t.length),n}},fm=null});function wj(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 SE(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 ME(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],S=r*a-n*s,M=r*c-i*s,v=r*l-o*s,T=n*c-i*a,O=n*l-o*a,P=i*l-o*c,_=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=S*W-M*A+v*L+T*C-O*U+P*_;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*M)*G,e[7]=(u*P-d*v+m*M)*G,e[8]=(s*A-a*C+l*_)*G,e[9]=(n*C-r*A-o*_)*G,e[10]=(g*O-y*v+w*S)*G,e[11]=(h*v-u*O-m*S)*G,e[12]=(a*U-s*L-c*_)*G,e[13]=(r*L-n*U+i*_)*G,e[14]=(y*M-g*T-b*S)*G,e[15]=(u*T-h*M+d*S)*G,e):null}function vE(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,S=t*a-n*o,M=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,_=o*O-s*T+a*v,U=l*M-u*S+h*w,C=m*M-g*S+y*w;return c*P-i*_+b*U-d*C}function oy(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],S=t[15],M=r[0],v=r[1],T=r[2],O=r[3];return e[0]=M*n+v*a+T*h+O*y,e[1]=M*i+v*c+T*d+O*b,e[2]=M*o+v*l+T*m+O*w,e[3]=M*s+v*u+T*g+O*S,M=r[4],v=r[5],T=r[6],O=r[7],e[4]=M*n+v*a+T*h+O*y,e[5]=M*i+v*c+T*d+O*b,e[6]=M*o+v*l+T*m+O*w,e[7]=M*s+v*u+T*g+O*S,M=r[8],v=r[9],T=r[10],O=r[11],e[8]=M*n+v*a+T*h+O*y,e[9]=M*i+v*c+T*d+O*b,e[10]=M*o+v*l+T*m+O*w,e[11]=M*s+v*u+T*g+O*S,M=r[12],v=r[13],T=r[14],O=r[15],e[12]=M*n+v*a+T*h+O*y,e[13]=M*i+v*c+T*d+O*b,e[14]=M*o+v*l+T*m+O*w,e[15]=M*s+v*u+T*g+O*S,e}function EE(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 AE(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 TE(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,T,O,P,_,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],S=t[7],M=t[8],v=t[9],T=t[10],O=t[11],P=i*i*u+c,_=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*U,e[1]=d*P+b*_+v*U,e[2]=m*P+w*_+T*U,e[3]=g*P+S*_+O*U,e[4]=h*C+y*L+M*A,e[5]=d*C+b*L+v*A,e[6]=m*C+w*L+T*A,e[7]=g*C+S*L+O*A,e[8]=h*W+y*G+M*E,e[9]=d*W+b*G+v*E,e[10]=m*W+w*G+T*E,e[11]=g*W+S*G+O*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function IE(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 PE(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 RE(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 LE(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 OE(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 xj(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 _j(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 DE(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],S=n[1],M=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?wj(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=S*m-M*d,s=M*h-w*m,a=w*d-S*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 BE,CE,sy=p(()=>{BE=xj;CE=_j});function NE(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 FE(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 GE(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 kE(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function UE(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 jE(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function zE(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 qE(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 hm=p(()=>{});function Aj(){return dm||(dm=new gn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(dm)),dm}function Tj(){return mm||(mm=new gn,Object.freeze(mm)),mm}function VE(e){if(e>Math.PI*2)throw Error("expected radians")}function Ij(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 ly,Mj,vj,ay,cy,Ej,gn,dm,mm,WE=p(()=>{Yg();nc();sm();sy();im();Gl();hm();(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"})(ly||(ly={}));Mj=45*Math.PI/180,vj=1,ay=.1,cy=500,Ej=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),gn=class extends Nl{static get IDENTITY(){return Tj()}static get ZERO(){return Aj()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return ly}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(Ej)}fromObject(t){return this.check()}fromQuaternion(t){return LE(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=ay,far:a=cy}=t;return a===1/0?Ij(this,r,n,i,o,s):OE(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 DE(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:o,near:s=ay,far:a=cy}=t;return CE(this,r,n,i,o,s,a),this.check()}orthographic(t){let{fovy:r=Mj,aspect:n=vj,focalDistance:i=1,near:o=ay,far:s=cy}=t;VE(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 VE(r),BE(this,r,n,i,o),this.check()}determinant(){return vE(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 SE(this,this),this.check()}invert(){return ME(this,this),this.check()}multiplyLeft(t){return oy(this,t,this),this.check()}multiplyRight(t){return oy(this,this,t),this.check()}rotateX(t){return IE(this,this,t),this.check()}rotateY(t){return PE(this,this,t),this.check()}rotateZ(t){return RE(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return TE(this,this,t,r),this.check()}scale(t){return AE(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return EE(this,this,t),this.check()}transform(t,r){return t.length===4?(r=qE(r||[-0,-0,-0,-0],t,this),Dl(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=rE(r||[-0,-0],t,this);break;case 3:i=am(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Dl(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=nE(r||[-0,-0],t,this);break;case 3:n=om(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Dl(n,t.length),n}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}}});function HE(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function uy(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 fy(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 $E(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 KE(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 XE(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 YE(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 ZE(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 JE(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 QE(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function e4(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 t4,r4,n4,i4,o4,s4,Pj,a4,hy=p(()=>{Gl();hm();t4=NE,r4=FE,n4=jE,i4=zE,o4=GE,s4=kE,Pj=UE,a4=(function(){let e=sE(),t=Jg(1,0,0),r=Jg(0,1,0);return function(n,i,o){let s=Qg(i,o);return s<-.999999?(Fl(e,t,i),dE(e)<1e-6&&Fl(e,r,i),aE(e,e),uy(n,e,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Fl(e,i,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+s,Pj(n,n))}})()});var Mf,c4=p(()=>{tm();nc();hy();Mf=class extends Ts{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 e4(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 uy(this,t,r),this.check()}identity(){return HE(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]=$t(t)}get y(){return this[1]}set y(t){this[1]=$t(t)}get z(){return this[2]}set z(t){this[2]=$t(t)}get w(){return this[3]}set w(t){this[3]=$t(t)}len(){return o4(this)}lengthSquared(){return s4(this)}dot(t){return n4(this,t)}rotationTo(t,r){return a4(this,t,r),this.check()}add(t){return t4(this,this,t),this.check()}calculateW(){return YE(this,this),this.check()}conjugate(){return QE(this,this),this.check()}invert(){return JE(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 fy(this,this,t),this.check()}multiplyLeft(t){return fy(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 $E(this,this,t),this.check()}rotateY(t){return KE(this,this,t),this.check()}rotateZ(t){return XE(this,this,t),this.check()}scale(t){return r4(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),ZE(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 my(){return{eastX:0,eastY:1,northZ:1,upX:1,upY:0,upZ:0}}function py(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:Rj(r,n,i,s*i-a*n,s,a,c)}function gy(e,t,r,n,i,o){let s=dy(r),a=dy(n),c=dy(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,S=e.upZ,M=-S*g,v=S*m,T=t.x,O=t.y,P=t.z,_=(l===1?m:l===2?M:b)*Math.sign(s),U=(l===1?g:l===2?v:w)*Math.sign(s),C=(l===1?0:l===2?y:S)*Math.sign(s),L=(u===1?m:u===2?M:b)*Math.sign(a),A=(u===1?g:u===2?v:w)*Math.sign(a),W=(u===1?0:u===2?y:S)*Math.sign(a),G=(h===1?m:h===2?M:b)*Math.sign(c),E=(h===1?g:h===2?v:w)*Math.sign(c),B=(h===1?0:h===2?y:S)*Math.sign(c);return!Number.isFinite(_)||!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(_))||!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]=_,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 dy(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 Rj(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 l4=p(()=>{});function vf(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 kl(r,m,g,y)}function Ef(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 kl(r,u===0?0:l,Math.atan2(o,u),h-s);if(u===0)return kl(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*gm||c>=.9)return yy(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,S=g*b;for(let M=0;M<30;M++){let v=s/Math.sqrt(1-c*S*S),T=u*w+o*S-v*(1-c*S*S),O=c*v/(v+T);b=1/Math.sqrt(1-O*(2-O)*y*y);let P=y*(1-O)*b,_=g*b;if(Math.abs(_*w-P*S)<=1e-12){if(!Number.isFinite(T))break;return kl(r,l,Math.atan2(_,Math.abs(P)),T)}w=P,S=_}return yy(n,i,o,u,s,a,r)}function yy(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+Is(o,o,g)-l*Is(i,i,m)-Is(l,m,l*m))/m:0,b=n*n,w=e*e,S=t*t,M=w+S,v=Number.isFinite(b)&&b>0?(M-b+pm(w,S,M)+Is(e,e,w)+Is(t,t,S)-Is(n,n,b))/(2*n):0,T=i*l,O=n-i,P=O+T,_=v+pm(n,-i,O)+pm(O,T,P)+Is(i,l,T)+i*y;if(r===0)return P+_<0?!1:kl(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+_)/i,G=Math.sqrt(W*(u+d))/d,E=W>0&&Math.abs(r)/G/i*c<=gm*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+(pm(P,-j,we)+_-Is(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*gm*(Math.abs(ne)+I*I)||L-C<=4*gm*A){E=Math.atan2(R,D);break}A=Be}return E!==void 0&&Lj(s,a,E,n,r,i,c)}function pm(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function Is(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 Lj(e,t,r,n,i,o,s){let a=Math.sin(r),c=Math.cos(r);return kl(e,t,r,n*c+i*a-o*Math.hypot(c,s*a))}function kl(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 gm,u4=p(()=>{gm=Number.EPSILON});function ym(){return Ul??Uint16Array}var Ul,f4=p(()=>{Ul=globalThis.Float16Array});var h4=p(()=>{f4()});var d4=p(()=>{h4()});var m4=p(()=>{ny()});var p4=p(()=>{sy()});var g4=p(()=>{hy()});var y4=p(()=>{im()});var b4=p(()=>{Gl()});var w4=p(()=>{hm()});var Dn=p(()=>{mE();_E();WE();c4();Xv();Zg();Cl();l4();u4();d4();m4();p4();g4();y4();b4();w4()});var ko,qee,x4=p(()=>{ko=6356752314245179e-9,qee={radii:[6378137,6378137,ko],radiiSquared:[6378137*6378137,6378137*6378137,ko*ko],oneOverRadii:[1/6378137,1/6378137,1/ko],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(ko*ko)],maximumRadius:Math.max(6378137,6378137,ko),centerToleranceSquared:.1}});function by(e){return e}function Uo(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 _4(e,t=[]){return Uo(e,t,wt._cartographicRadians?by:Kg)}function wy(e,t,r,n){let i=wt._cartographicRadians?by:Xg,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 Hee,S4=p(()=>{Dn();Hee=new J});function so(e,t,r,n,i,o,s){let c=[n,i,o,Math.abs(e),Math.abs(t),Math.abs(r)].map(P=>{let _=P.toString(2),U=_.indexOf(".");return{integer:BigInt("0b"+_.replace(".","")),exponent:U<0?0:U+1-_.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,_)=>P<_?P:_),m=h.map(P=>P-d),g=h.map((P,_)=>u[_]*u[_+3]),y=64;if(!g.some((P,_)=>m[_]===0n&&P!==0n)){let P=-1n,_=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]*_,_*=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*(_+P)).toString(2).length-(P*C).toString(2).length+128)}let b=1n<<BigInt(y),w=m.map(P=>P*b),S=g.map(P=>P*b),M=S.map(P=>P*P),v=0n,T=S.reduce((P,_)=>P+_,0n);if(T===0n)return!1;for(let P=0;P<4096;P++){let _=v+T>>1n;if(_===v)return!1;let U=w[0]+_,C=w[1]+_,L=w[2]+_,A=U*U,W=C*C,G=L*L,E=M[0]*W*G+M[1]*A*G+M[2]*A*W-A*W*G;if(E===0n)return O(_,b);if(E>0n?v=_:T=_,v>0n&&T-v<=v>>60n)return O(v+T>>1n,b)}return!1;function O(P,_){let U=h.map((W,G)=>{let E=m[G]*_+P;return E===0n?0:Uj(W*u[G+3]*_,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 Uj(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 M4=p(()=>{});function v4(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=oc(a,a,c),m=l-c,g=u-c,y=h-c,b=jo(l,-c,m)+oc(n,n,l)-d,w=jo(u,-c,g)+oc(i,i,u)-d,S=jo(h,-c,y)+oc(o,o,h)-d,M=n*Math.abs(e),v=i*Math.abs(t),T=o*Math.abs(r);if(c<2**-1022||e!==0&&M<2**-1022||t!==0&&v<2**-1022||r!==0&&T<2**-1022)return so(e,t,r,n,i,o,s);let O=oc(n,Math.abs(e),M),P=oc(i,Math.abs(t),v),_=oc(o,Math.abs(r),T);if(Math.hypot(m===0?M===0?0:1/0:M/(m+b),g===0?v===0?0:1/0:v/(g+w),y===0?T===0?0:1/0:T/(y+S))<=1+64*Number.EPSILON)return so(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?M:0,g===0?v:0,y===0?T:0),L=Math.hypot(M,v,T);if(!(L>0)||!Number.isFinite(L))return so(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=jo(m,A,G)+b,D=jo(g,A,E)+w,R=jo(y,A,B)+S,I=M/G,j=v/E,we=T/B,_e,ne;I>=j&&I>=we?(_e=xy(M,O,m,b,A,G)*(I+1),ne=(j*(1-D/E))**2+(we*(1-R/B))**2):j>=we?(_e=xy(v,P,g,w,A,E)*(j+1),ne=(I*(1-N/G))**2+(we*(1-R/B))**2):(_e=xy(T,_,y,S,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 so(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 so(e,t,r,n,i,o,s);let Ke=Math.sign(e)*n*(I*(1-N/G)),ut=Math.sign(t)*i*(j*(1-D/E)),ft=Math.sign(r)*o*(we*(1-R/B)),mt=2*je*Math.max(Math.abs(Ke/G),Math.abs(ut/E),Math.abs(ft/B));return!Number.isFinite(mt)||mt>2e-13*Math.max(n,i,o)?so(e,t,r,n,i,o,s):!Number.isFinite(Ke)||!Number.isFinite(ut)||!Number.isFinite(ft)?so(e,t,r,n,i,o,s):(s.x=Ke,s.y=ut,s.z=ft,!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 so(e,t,r,n,i,o,s);A=V}return so(e,t,r,n,i,o,s)}function xy(e,t,r,n,i,o){let s=e-r,a=jo(e,-r,s)+t-n,c=s+a,l=jo(s,a,c),u=c-i;return(u+(jo(c,-i,u)+l))/o}function jo(e,t,r){let n=r-e;return e-(r-n)+(t-n)}function oc(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 E4=p(()=>{M4()});function A4(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(v4(i,o,s,a.x,a.y,a.z,bm))return ao(r,bm.x,bm.y,bm.z)}function ao(e,t,r,n){if(oo(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 bm,T4=p(()=>{Dn();E4();bm={x:0,y:0,z:0}});function I4(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 _m(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 ao(n,o/c,s/c,a/c)}var yn,wm,qj,fi,xm,Et,P4=p(()=>{Dn();Dn();x4();S4();T4();yn={x:0,y:0,z:0},wm=new J,qj=new J,fi=new J,xm=new J,Et=class e{static fromSpheroid(t){let{semiMajorAxis:r,semiMinorAxis:n}=t;return I4(r,n),new e(r,r,n)}constructor(t=0,r=0,n=0){this.centerToleranceSquared=Qd.EPSILON1,Ii(Number.isFinite(t)&&t>=0),Ii(Number.isFinite(r)&&r>=0),Ii(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 I4(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=_4(t,xm),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&&(wt._cartographicRadians||Math.abs(o)<=Math.PI/4))return yn.x=i,yn.y=o,yn.z=s,vf(yn,this.spheroidGeometry)?ao(r,yn.x,yn.y,yn.z):void 0;let a=qj;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 ao(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)){yn.x=i,yn.y=o,yn.z=s;let S=this.spheroidGeometry;if(!(s===0&&S.semiMinorAxis<S.semiMajorAxis&&Math.abs(Math.hypot(i,o)-S.semiMajorAxis*S.eccentricitySquared)<=64*Number.EPSILON*S.semiMajorAxis)&&Ef(yn,S)){let v=i===0&&o===0?Math.atan2(o,i):yn.x;return wy(v,yn.y,yn.z,r)}}if(!(this.minimumRadius>0)||!Number.isFinite(this.maximumRadius*this.maximumRadius)||!Number.isFinite(1/(this.minimumRadius*this.minimumRadius)))return;xm.set(i,o,s);let a=this.scaleToGeodeticSurface(xm,fi);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 wy(y,b,w,r)}geocentricSurfaceNormal(t,r=[0,0,0]){Uo(t,wm);let n=wm;return _m(n.x,n.y,n.z,r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=Uo(t,xm),i=wt._cartographicRadians?n[0]:n[0]*Math.PI/180,o=wt._cartographicRadians?n[1]:n[1]*Math.PI/180,s=!wt._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 _m(c*Math.cos(i),c*Math.sin(i),l,r)}geodeticSurfaceNormal(t,r=[0,0,0]){if(!(this.minimumRadius>0))return;Uo(t,wm);let n=wm,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 _m(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 _m(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 A4(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){Uo(t,fi);let n=fi,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 ao(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 ao(r,s/l,a/l,c/l)}transformPositionToScaledSpace(t,r=[0,0,0]){Uo(t,fi);let n=fi.scale(this.oneOverRadii);return ao(r,n.x,n.y,n.z)}transformPositionFromScaledSpace(t,r=[0,0,0]){Uo(t,fi);let n=fi.scale(this.radii);return ao(r,n.x,n.y,n.z)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){if(Ii(this.radii.x===this.radii.y&&this.minimumRadius>0),Uo(t,fi),!Number.isFinite(fi.x)||!Number.isFinite(fi.y)||!Number.isFinite(fi.z)||!Number.isFinite(r))return;let i=fi.z*(1-this.squaredXOverSquaredZ);if(Number.isFinite(i)&&!(Math.abs(i)>=this.radii.z-r))return ao(n,0,0,i)}};Et.WGS84=new Et(6378137,6378137,ko)});var Zt,R4=p(()=>{Zt={};Zt.Constants={};Zt.Math={};Zt.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"})(Zt.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}})(Zt.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)}})(Zt.Accumulator,Zt.Math);Zt.Geodesic={};Zt.GeodesicLine={};Zt.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,S=1e3*b,M=0,v=31,T=32640,O,P,_,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|M,e.LONGITUDE=256|e.CAP_C3,e.AZIMUTH=512|M,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)},_=[-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,_,R,N)/_[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,ut=0,ft,mt,Rt,Yt,mr;if(Oe&(e.DISTANCE|e.REDUCEDLENGTH|e.GEODESICSCALE)&&(Ke=e.A1m1f(E),e.C1f(E,oe),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(ut=e.A2m1f(E),e.C2f(E,Se),V=Ke-ut,ut=1+ut),Ke=1+Ke),Oe&e.DISTANCE)ft=e.SinCosSeries(!0,I,j,oe)-e.SinCosSeries(!0,N,D,oe),Be.s12b=Ke*(B+ft),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(mt=e.SinCosSeries(!0,I,j,Se)-e.SinCosSeries(!0,N,D,Se),je=V*B+(Ke*ft-ut*mt));else if(Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)){for(Rt=1;Rt<=e.nC2_;++Rt)Se[Rt]=Ke*oe[Rt]-ut*Se[Rt];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&&(Yt=D*j+N*I,mr=this._ep2*(_e-ne)*(_e+ne)/(R+we),Be.M12=Yt+(mr*I-j*je)*N/R,Be.M21=Yt-(mr*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,ut,ft,mt,Rt,Yt,mr,Ve,qe,We,jt,pr,xs,_s,Zu,Xi,tt,Xr,xr,hn,Bn;return oe.sig12=-1,V=D*B,V+=R*E,je=Be>=0&&Se<.5&&R*j<.5,je?(ut=n.sq(E+D),ut/=ut+n.sq(B+R),oe.dnm=Math.sqrt(1+this._ep2*ut),Ke=j/(this._f1*oe.dnm),ft=Math.sin(Ke),mt=Math.cos(Ke)):(ft=we,mt=_e),oe.salp1=R*ft,oe.calp1=mt>=0?Se+R*E*n.sq(ft)/(1+mt):V-R*E*n.sq(ft)/(1-mt),Yt=n.hypot(oe.salp1,oe.calp1),mr=E*D+B*R*mt,je&&Yt<this._etol2?(oe.salp2=B*ft,oe.calp2=Se-B*D*(mt>=0?n.sq(ft)/(1+mt):1-mt),Rt=n.hypot(oe.salp2,oe.calp2),oe.salp2/=Rt,oe.calp2/=Rt,oe.sig12=Math.atan2(Yt,mr)):Math.abs(this._n)>.1||mr>=0||Yt>=6*Math.abs(this._n)*Math.PI*n.sq(B)||(Bn=Math.atan2(-we,-_e),this.f>=0?(pr=n.sq(E)*this._ep2,xs=pr/(2*(1+Math.sqrt(1+pr))+pr),We=this.f*B*this.A3f(xs)*Math.PI,jt=We*B,Ve=Bn/We,qe=V/jt):(_s=R*B-D*E,Zu=Math.atan2(V,_s),Xr=this.Lengths(this._n,Math.PI+Zu,E,-B,N,D,R,I,B,R,e.REDUCEDLENGTH,ne,Oe),Xi=Xr.m12b,tt=Xr.m0,Ve=-1+Xi/(B*R*tt*Math.PI),jt=Ve<-.01?V/Ve:-this.f*n.sq(B)*Math.PI,We=jt/B,qe=j/We),qe>-y&&Ve>-1-S?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))):(xr=O(Ve,qe),hn=We*(this.f>=0?-Ve*xr/(1+xr):-qe*(1+xr)/xr),ft=Math.sin(hn),mt=-Math.cos(hn),oe.salp1=R*ft,oe.calp1=V-R*E*n.sq(ft)/(1-mt))),oe.salp1<=0?(oe.salp1=1,oe.calp1=0):(Rt=n.hypot(oe.salp1,oe.calp1),oe.salp1/=Rt,oe.calp1/=Rt),oe},e.Geodesic.prototype.Lambda12=function(E,B,N,D,R,I,j,we,_e,ne,Oe,oe,Se,Be){var V={},je,Ke,ut,ft,mt,Rt,Yt,mr,Ve,qe,We,jt,pr;return E===0&&we===0&&(we=-e.tiny_),Ke=j*B,ut=n.hypot(we,j*E),V.ssig1=E,ft=Ke*E,V.csig1=mt=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,Rt=Ke*D,V.csig2=Yt=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),mr=Math.max(0,mt*Rt-ft*Yt),Ve=mt*Yt+ft*Rt,We=Math.atan2(mr*ne-Ve*_e,Ve*ne+mr*_e),jt=n.sq(ut)*this._ep2,V.eps=jt/(2*(1+Math.sqrt(1+jt))+jt),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:(pr=this.Lengths(V.eps,V.sig12,V.ssig1,V.csig1,N,V.ssig2,V.csig2,I,B,R,e.REDUCEDLENGTH,oe,Se),V.dlam12=pr.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,ut,ft,mt,Rt,Yt,mr,Ve,qe,We,jt,pr,xs,_s,Zu,Xi,tt,Xr,xr,hn,Bn,Qh,ed,fl,$a,Ju,Qu,ef,tf,td,x1,hl,_1,rd,S1,M1,v1,M_,E1,nd,A1,id,v_,rf,E_,A_,nf,od,of,T1,I1,sd,ad,P1,R1;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,Rt=j*n.degree,ne=n.sincosde(j,we),Yt=ne.s,mr=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),ft=Math.sqrt(1+this._ep2*n.sq(Se)),mt=Math.sqrt(1+this._ep2*n.sq(V)),xs=new Array(e.nC1_+1),_s=new Array(e.nC2_+1),Zu=new Array(e.nC3_),Xi=E===-90||Yt===0,Xi&&(qe=mr,We=Yt,jt=1,pr=0,Xr=Se,xr=qe*Be,hn=V,Bn=jt*je,Ve=Math.atan2(Math.max(0,xr*hn-Xr*Bn),xr*Bn+Xr*hn),tt=this.Lengths(this._n,Ve,Xr,xr,ft,hn,Bn,mt,Be,je,R|e.DISTANCE|e.REDUCEDLENGTH,xs,_s),Ke=tt.s12b,ut=tt.m12b,R&e.GEODESICSCALE&&(I.M12=tt.M12,I.M21=tt.M21),Ve<b||ut>=0?((Ve<3*e.tiny_||Ve<g&&(Ke<0||ut<0))&&(Ve=ut=Ke=0),ut*=this._b,Ke*=this._b,I.a12=Ve/n.degree):Xi=!1),nf=2,!Xi&&Se===0&&(this.f<=0||we>=this.f*180))qe=jt=0,We=pr=1,Ke=this.a*Rt,Ve=ed=Rt/this._f1,ut=this._b*Math.sin(Ve),R&e.GEODESICSCALE&&(I.M12=I.M21=Math.cos(Ve)),I.a12=j/this._f1;else if(!Xi)if(tt=this.InverseStart(Se,Be,ft,V,je,mt,Rt,Yt,mr,xs,_s),Ve=tt.sig12,We=tt.salp1,qe=tt.calp1,Ve>=0)pr=tt.salp2,jt=tt.calp2,fl=tt.dnm,Ke=Ve*this._b*fl,ut=n.sq(fl)*this._b*Math.sin(Ve/fl),R&e.GEODESICSCALE&&(I.M12=I.M21=Math.cos(Ve/fl)),I.a12=Ve/n.degree,ed=Rt/(this._f1*fl);else{for($a=0,Ju=e.tiny_,Qu=1,ef=e.tiny_,tf=-1,td=!1,x1=!1;tt=this.Lambda12(Se,Be,ft,V,je,mt,We,qe,Yt,mr,$a<d,xs,_s,Zu),hl=tt.lam12,pr=tt.salp2,jt=tt.calp2,Ve=tt.sig12,Xr=tt.ssig1,xr=tt.csig1,hn=tt.ssig2,Bn=tt.csig2,Qh=tt.eps,of=tt.domg12,_1=tt.dlam12,!(x1||!(Math.abs(hl)>=(td?8:1)*g)||$a==m);++$a){if(hl>0&&($a<d||qe/We>tf/ef)?(ef=We,tf=qe):hl<0&&($a<d||qe/We<Qu/Ju)&&(Ju=We,Qu=qe),$a<d&&_1>0&&(rd=-hl/_1,Math.abs(rd)<Math.PI&&(S1=Math.sin(rd),M1=Math.cos(rd),v1=We*M1+qe*S1,v1>0))){qe=qe*M1-We*S1,We=v1,ne=n.hypot(We,qe),We/=ne,qe/=ne,td=Math.abs(hl)<=16*g;continue}We=(Ju+ef)/2,qe=(Qu+tf)/2,ne=n.hypot(We,qe),We/=ne,qe/=ne,td=!1,x1=Math.abs(Ju-We)+(Qu-qe)<w||Math.abs(We-ef)+(qe-tf)<w}M_=R|(R&(e.REDUCEDLENGTH|e.GEODESICSCALE)?e.DISTANCE:e.NONE),tt=this.Lengths(Qh,Ve,Xr,xr,ft,hn,Bn,mt,Be,je,M_,xs,_s),Ke=tt.s12b,ut=tt.m12b,R&e.GEODESICSCALE&&(I.M12=tt.M12,I.M21=tt.M21),ut*=this._b,Ke*=this._b,I.a12=Ve/n.degree,R&e.AREA&&(P1=Math.sin(of),R1=Math.cos(of),nf=Yt*R1-mr*P1,od=mr*R1+Yt*P1)}return R&e.DISTANCE&&(I.s12=0+Ke),R&e.REDUCEDLENGTH&&(I.m12=0+ut),R&e.AREA&&(E1=We*Be,nd=n.hypot(qe,We*Se),nd!==0&&E1!==0?(Xr=Se,xr=qe*Be,hn=V,Bn=jt*je,id=n.sq(nd)*this._ep2,Qh=id/(2*(1+Math.sqrt(1+id))+id),v_=n.sq(this.a)*nd*E1*this._e2,ne=n.hypot(Xr,xr),Xr/=ne,xr/=ne,ne=n.hypot(hn,Bn),hn/=ne,Bn/=ne,rf=new Array(e.nC4_),this.C4f(Qh,rf),E_=e.SinCosSeries(!1,Xr,xr,rf),A_=e.SinCosSeries(!1,hn,Bn,rf),I.S12=v_*(Ve<.01?e.SinCosSeries(!1,Xr,xr,rf,Ve):A_-E_)):I.S12=0,!Xi&&nf==2&&(nf=Math.sin(ed),od=Math.cos(ed)),!Xi&&od>-.7071&&V-Se<1.75?(of=1+od,T1=1+Be,I1=1+je,A1=2*Math.atan2(nf*(Se*I1+V*T1),of*(Se*V+T1*I1))):(sd=pr*qe-jt*We,ad=jt*qe+pr*We,sd===0&&ad<0&&(sd=e.tiny_*qe,ad=-1),A1=Math.atan2(sd,ad)),I.S12+=this._c2*A1,I.S12*=Oe*_e*oe,I.S12+=0),Oe<0&&([pr,We]=[We,pr],[jt,qe]=[qe,jt],R&e.GEODESICSCALE&&([I.M21,I.M12]=[I.M12,I.M21])),We*=Oe*_e,qe*=Oe*oe,pr*=Oe*_e,jt*=Oe*oe,{vals:I,salp1:We,calp1:qe,salp2:pr,calp2:jt}},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)})(Zt.Geodesic,Zt.GeodesicLine,Zt.PolygonArea,Zt.Math,Zt.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,T,O,P,_,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&&(_=this._salp0*d,U=m,T=r.copysign(1,this._salp0),S=o&e.LONG_UNROLL?T*(a-(Math.atan2(d,m)-Math.atan2(this._ssig1,this._csig1))+(Math.atan2(T*_,U)-Math.atan2(T*this._somg1,this._comg1))):Math.atan2(_*this._comg1-U*this._somg1,U*this._comg1+_*this._somg1),M=S+this._A3c*(a+(e.SinCosSeries(!0,d,m,this._C3a)-this._B31)),v=M/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}})(Zt.Geodesic,Zt.GeodesicLine,Zt.Math)});function L4(e){if(!Number.isFinite(e))throw new Error("Nonfinite axis, azimuth, distance or arc")}function O4({semiMajorAxis:e,semiMinorAxis:t}){return L4(e),L4(t),new _y.Geodesic(e,(e-t)/e)}var _y,Af,B4=p(()=>{R4();_y=Zt.Geodesic;Af=_y.ALL&~_y.AREA});function N4(e,t,r,n,i,o){let s=D4[t]&&D4[t][r];Ii(s&&(!n||n===s));let a,c,l,u=Wj.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=Vj*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}=jl;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(!py(C,L,C4)||!gy(C4,u,t,r,n,o))throw new Error("Unsupported local frame");return o}if(d){let C=Math.sign(u.z);a=Hj.fromArray(Sy[t]),t!=="east"&&t!=="west"&&a.scale(C),c=$j.fromArray(Sy[r]),r!=="east"&&r!=="west"&&c.scale(C),l=Kj.fromArray(Sy[n]),n!=="east"&&n!=="west"&&l.scale(C)}else{let{up:C,east:L,north:A}=jl,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}=jl;G.copy(C).scale(-1),E.copy(L).scale(-1),B.copy(A).scale(-1),a=jl[t],c=jl[r],l=jl[n]}let g=a.x,y=a.y,b=a.z,w=c.x,S=c.y,M=c.z,v=l.x,T=l.y,O=l.z,P=u.x,_=u.y,U=u.z;return o[0]=g,o[1]=y,o[2]=b,o[3]=0,o[4]=w,o[5]=S,o[6]=M,o[7]=0,o[8]=v,o[9]=T,o[10]=O,o[11]=0,o[12]=P,o[13]=_,o[14]=U,o[15]=1,o}var Vj,Wj,C4,D4,Sy,jl,Hj,$j,Kj,F4=p(()=>{Dn();Dn();Vj=1e-14,Wj=new J,C4=my(),D4={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"}},Sy={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},jl={east:new J,north:new J,up:new J,west:new J,south:new J,down:new J},Hj=new J,$j=new J,Kj=new J});function My(e,t,r=new gn){return N4(e,"east","north","up",t,r)}var G4=p(()=>{Dn();F4()});var k4=p(()=>{P4();G4()});var vy,Ey,Ps,U4=p(()=>{vy={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Ey={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},Ps={...vy,...Ey}});var j4=p(()=>{U4()});var z4=p(()=>{j4()});var q4=p(()=>{});var V4=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 Tf(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 Kt(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,qt=p(()=>{At=Math.PI/180});function Lt(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 If([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 ct(e,t){let r=n=>Math.max(1,Rs(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 Or(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=Kt(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=Or(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 ct([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 zl(e,t,r,n=!1,i=0){let o=Or(t,r,n);if(Rs(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 ct([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 W4(e,t,r,n=!1){let i=Or(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 ct([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 ql(e,t,r,n,i,o,s=!1){let a=Fe(Or(t,r,s),n),c=hi(o-e(r,t[0][1])[1],o-e(r,t[1][1])[1]);return ct(Ce([i,i],Lt(c,If(a))),Ce([o,o],Fe(Lt(c,Sm(a)),-1)))}var hi,Ce,Fe,Sm,Rs,Ot=p(()=>{qt();hi=(e,t)=>[Math.min(e,t),Math.max(e,t)],Ce=(e,t)=>[e[0]+t[0],e[1]+t[1]],Fe=(e,t)=>hi(e[0]*t,e[1]*t);Sm=e=>If([e[0]+Math.PI/2,e[1]+Math.PI/2]),Rs=e=>Math.max(Math.abs(e[0]),Math.abs(e[1]))});function Q(e,t,r,n){return[[e,t],[r,n]]}function Pi(e){return e>=-180&&e<180?e:((e+180)%360+360)%360-180}function Yj(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=Pi(r);return[Pi(e),t,i===-180&&r>e?180:i,n]}function Ay(e){let t=e[2]-e[0];return t<0?t+360:t}function H4(e){let[t,r,n,i]=e;return t<=n?[e]:[[t,r,180,i],[-180,r,n,i]]}function Zj(e,t){let[r,n,i,o]=e,s=Pi(t[0]);return t[1]>=n&&t[1]<=o&&(r<=i?s>=r&&s<=i||s===-180&&i===180:s>=r||s<=i)}function Mm(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 H4(e))for(let a of H4(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 $4(e,t){let r=Pi(t[0]),n=Math.max(e[1],Math.min(e[3],t[1]));if(!Zj(e,[r,n])){let i=Math.abs(Pi(r-e[0])),o=Math.abs(Pi(r-e[2]));r=i<=o?e[0]:e[2]}return[r,n]}function Ls(e,t=0,r=0){let n=Ay(e),i=e[0]*zo-t,o=i+n*zo/2,s=Math.round((r-o)/(2*Math.PI))*2*Math.PI;return Q(n===360?r-Math.PI:i+s,e[1]*zo,n===360?r+Math.PI:i+s+n*zo,e[3]*zo)}function Nn(e,t=0){return Yj((e[0][0]+t)/zo,e[0][1]/zo,(e[1][0]+t)/zo,e[1][1]/zo)}function K4(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 zo,Je=p(()=>{zo=Math.PI/180});function X4(e,t){if(t)try{let n=e(t);return Ty(n)}catch{}let r=e();return Ty(r)}function Ty(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 Os(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 vm(e,t){let r=[];for(let n of e){let i=t(n);i!==null&&r.push(Ty(i))}return r.length?r.length===1?r[0]:{bounds:K4(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 sc=p(()=>{Je()});function Em(e,t,r=0,n=!1){let i=Ay(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=$4(t,[e.x,e.y]),c=a[0];a[0]===Pi(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+Pi(l),e.y=a[1]}function cr(e,t,r=0,n=0,i=!1){let o=(r+n)*180/Math.PI;return{get bounds(){return e(Ls(t,n,r))},normalize(s){Em(s,t,o,i)}}}function Jj(e,t,r,n,i){let o=vm(t,s=>cr(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=Nn(t,n),a=(o+n)*180/Math.PI;return{...e,longitudeOrigin:o,getRenderingProfile(c){if(!c)return{bounds:r(t),normalize(l){Em(l,s,a,i)}};try{let l=cr(r,c,o,n,i);return{bounds:l.bounds,normalize:l.normalize}}catch{return Jj(r,Mm(c,s),o,n,i)}}}}var lt=p(()=>{Je();sc()});function Y4(){return{x:0,y:0,z:0}}var Bs,Am=p(()=>{Bs=class{constructor(){this.point=Y4(),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]=Y4()),this.points[r]}release(t){this.active>0&&this.points[this.active-1]===t&&this.active--}}});function di(e,t){let r=new Bs,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 qo(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 ac=p(()=>{Am()});function Cs(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 Ri(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 br({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:Ri(r,"over"),long0:Cs(r,"lon_0"),lat0:Cs(r,"lat_0"),lat1:Cs(r,"lat_1"),lat2:Cs(r,"lat_2",re(r,"lat_1",0)),lat_ts:Cs(r,"lat_ts",NaN),x0:re(r,"x_0",0),y0:re(r,"y_0",0),k0:i}}function Vl(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 lr(e,t,r,n,i=di){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 Ds(e,t){let r=qo(t,!1);return di(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)},qo(t,!0))}var vr,Vo,Fn=p(()=>{ac();qt();vr=["lon_0","lat_0","x_0","y_0"],Vo=["k","k_0"]});function Li(e,t){return{...di(e,t),createForwardFlat(r){return this.forwardInPlace===e?Z4(e,!1,r):void 0},createInverseFlat(r){return this.inverseInPlace===t?Z4(t,!0,r):void 0}}}function Z4(e,t,{inputScale:r,outputScale:n}){let i=new Bs;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 Wl=p(()=>{ac();Am()});function cc(e){var t=Math.exp(e);return t=(t-1/t)/2,t}var Tm=p(()=>{});function Jt(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 lc=p(()=>{});function J4(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}var Q4=p(()=>{});function e8(e){var t=Math.abs(e);return t=J4(t*(1+t/(Jt(1,t)+1))),e<0?-t:t}var t8=p(()=>{lc();Q4()});function Im(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 r8=p(()=>{});function n8(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 i8=p(()=>{});function Pf(e){var t=Math.exp(e);return t=(t+1/t)/2,t}var Iy=p(()=>{});function Py(e,t,r,n){for(var i=Math.sin(t),o=Math.cos(t),s=cc(r),a=Pf(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 o8=p(()=>{Tm();Iy()});var F,Qe,Ns,s8,Ry,Ly,Rf,Bt=p(()=>{F=Math.PI/2,Qe=Math.PI/4,Ns=Math.PI*2,s8=3.14159265359,Ry=Math.PI/180,Ly=180/Math.PI,Rf=Math.PI/(180*3600)});function Fs(e){return e<0?-1:1}var Lf=p(()=>{});function k(e,t){return t||Math.abs(e)<=s8?e:e-Fs(e)*Ns}var xt=p(()=>{Bt();Lf()});function Qj(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=Im(e.cbg,e.lat0);e.Zb=-e.Qn*(i+n8(e.gtu,2*i))}function a8(e,t){var r=k(t.x-e.long0,e.over),n=t.y;n=Im(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,Jt(i,o*a)),r=e8(Math.tan(r)),Py(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 c8(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){Py(e.utg,2*n,2*r,t),n=n+t.x,r=r+t.y,r=Math.atan(cc(r));var s=Math.sin(n),a=Math.cos(n),c=Math.sin(r),l=Math.cos(r);n=Math.atan2(s*l,Jt(c,l*a)),r=Math.atan2(c,l*a),i=k(r+e.long0,e.over),o=Im(e.cgb,n)}else i=1/0,o=1/0;return t.x=i,t.y=o,t}function l8(e){let t={...e,cgb:[],cbg:[],utg:[],gtu:[],Qn:0,Zb:0};return Qj(t),t}var u8=p(()=>{Tm();lc();t8();r8();i8();o8();xt()});function co(e){var t=[];t[0]=ez-e*(tz+e*(f8+e*(h8+e*d8))),t[1]=e*(rz-e*(f8+e*(h8+e*d8)));var r=e*e;return t[2]=r*(nz-e*(iz+e*oz)),r*=e,t[3]=r*(sz-e*az),t[4]=r*e*cz,t}var ez,tz,f8,h8,d8,rz,nz,iz,oz,sz,az,cz,Hl=p(()=>{ez=1,tz=.25,f8=.046875,h8=.01953125,d8=.01068115234375,rz=.75,nz=.46875,iz=.013020833333333334,oz=.007120768229166667,sz=.3645833333333333,az=.005696614583333333,cz=.3076171875});function wr(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 uc=p(()=>{});function lo(e,t,r){for(var n=1/(1-t),i=e,o=lz;o;--o){var s=Math.sin(i),a=1-t*s*s;if(a=(wr(i,s,Math.cos(i),r)-e)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)<1e-10)return i}return i}var lz,$l=p(()=>{uc();lz=20});function uz(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=co(e.es),e.ml0=wr(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function m8(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 S=wr(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*(S-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 p8(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=lo(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),S=Math.pow(w,2);r=1-e.es*Math.pow(d,2);var M=s*Math.sqrt(r)/e.k0,v=Math.pow(M,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*S+46*y-v/56*(1385+3633*w+4095*S+1574*S*w)))),o=k(e.long0+M*(1-v/6*(1+2*w+y-v/20*(5+28*w+24*S+8*y*w+6*y-v/42*(61+662*w+1320*S+720*S*w))))/m,e.over)}else i=F*Fs(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 g8(e){let t={...e,en:[],ml0:0};return uz(t),t}var y8=p(()=>{Hl();uc();$l();xt();Bt();Lf()});function Pm(e){let t=br(e),r=n=>De(n,Q(t.long0-Math.PI/6,-Math.PI/2,t.long0+Math.PI/6,Math.PI/2),i=>zl(n.forward,i,t.long0,t.over),t.primeMeridian,t.over);if(Ri(e.parameters,"approx"))return r({...lr("tmerc +approx",g8(t),m8,p8,Li)});if(t.sphere)throw new Error("Spherical transverse Mercator requires +approx");return r({...lr("etmerc",l8(t),a8,c8,Li)})}var Oy,By,Cy=p(()=>{Wl();Ot();Je();lt();Fn();u8();y8();Oy={name:"tmerc",aliases:["Fast_Transverse_Mercator","Fast Transverse Mercator","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger"],parameters:[...vr,...Vo,"approx"],flags:["approx"],create:Pm},By={name:"etmerc",aliases:["Extended_Transverse_Mercator","Extended Transverse Mercator"],parameters:[...vr,...Vo,"approx"],flags:["approx"],create:Pm}});var Dy,b8=p(()=>{Ot();Je();lt();qt();Fn();Cy();Dy={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=Ri(e.parameters,"south"),n=Pm({...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=>zl(n.forward,o,i),e.primeMeridian??0,Object.prototype.hasOwnProperty.call(e.parameters,"over"))}}});function Fy(e,t){return[Math.cos(t)*Math.cos(e),Math.cos(t)*Math.sin(e),Math.sin(t)]}function Rm(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 Gs(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+Kt(y-c),y<i-1e-12||y>s+1e-12||b<o-1e-12||b>a+1e-12)return;let w=Fy(y,b);if(r&&Ny(l,w)<u-1e-13)return;let S=Ny(e,w);(n?S>h:S<h)&&(h=S,d=[y,b])},g=[i,s,...Rm(-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,...Rm(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 Rm(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 Rm(y*Math.cos(v),b,u,o,a))m(v,T);let w=Ny(e,l),S=e.map((v,T)=>v-w*l[T]),M=Math.hypot(...S);if(M<=1e-14&&(S=[-l[2],0,l[0]],M=1),M>1e-14)for(let v of[-1,1]){let T=l.map((O,P)=>O*u+v*S[P]*Math.sin(r.distance)/M);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 ht(e,t,r){return[Gs(e,t,r,!1).value,Gs(e,t,r).value]}function ks(e,t,r,n,i){let o=ht(e,n,i),s=ht(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]);Gs(m,n,i,c).value-d*r>0?l=d:u=d}return c?u:l})}var Ny,fc=p(()=>{qt();Ny=(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]});function fz(e,t,r,n=Math.PI){let i=[-180,-90,180,90],o=(s,a)=>{let c=Ls(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?Gs(u,l,void 0,!1).value:-1,m=!a||h<=Math.cos(n)+1e-13?{latitude:e.lat0,distance:t}:void 0,g=cr(()=>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&&Os(S=>{let M=Fy(S.x-e.long0,S.y);if(M[0]*Math.cos(e.lat0)+M[2]*Math.sin(e.lat0)>=Math.cos(m.distance)-1e-14)return;if(Math.hypot(M[0]+u[0],M[1],M[2]+u[2])<1e-12){let T=e.lat0+m.distance,O=(l[0][0]+l[1][0])/2,P=O+Kt((Math.cos(T)<0?Math.PI:0)-O),_=Math.atan2(Math.sin(T),Math.abs(Math.cos(T)));if(P>=l[0][0]&&P<=l[1][0]&&_>=l[0][1]&&_<=l[1][1]){S.x=P+e.long0,S.y=_;return}}let v=Gs(M,l,m);[S.x,S.y]=[v.point[0]+e.long0,v.point[1]]},e.primeMeridian);return{get bounds(){return r(l,m)},normalize(S){g.normalize(S),m&&y?S.y=e.lat0>0?Math.max(b,S.y):Math.min(-b,S.y):w==null||w(S);let M=(e.long0+e.primeMeridian)*180/Math.PI,v=S.x-M;Math.abs(v)>180&&(S.x=M+Pi(v))}}};return s=>o(s??i,!!s)}function bn(e,t,r,n,i=Math.PI){return{...e,longitudeOrigin:t.long0,getRenderingProfile:fz(t,r,n,i)}}var Us=p(()=>{Je();lt();fc();qt();sc()});function Lm(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"?ht(u,t,r):ks(u,o,a,t,r),l=e.a*(n==="stere"?2*e.k0:1);return ct(Ce([e.x0,e.x0],Fe(c(s),l)),Ce([e.y0,e.y0],Fe(c(i),l)))}function w8(e,t,r){let n=Math.sin(e.lat0),i=Math.cos(e.lat0),o=ht([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=Gs([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 ct(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=hi(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 ct(Ce([e.x0,e.x0],Fe(Lt(ht([0,1,0],t,r),c),l)),Ce([e.y0+l*u,e.y0+l*u],Fe(Lt(ht([-n,0,(1-e.es)*i],t,r),c),l)))}function x8(e,t,r){let n=ht([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 ct([e.x0-i,e.x0+i],[e.y0-i,e.y0+i])}function _8(e,t,r,n,i,o,s){let a=i&&ht([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=ht(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=ht(y,c,l),S=w[0]===0?0:w[0]*(w[0]<0?m[1]:m[0]),M=w[1]===0?0:w[1]*(w[1]>0?m[1]:m[0]);return Fe([Math.max(-2,S),Math.min(2,M)],e.a*b)};return ct(Ce([e.x0,e.x0],g([0,1,0],t)),Ce([e.y0,e.y0],g(h,r)))}function Om(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=ks([0,1,0],d,1,y,h),w=ks(m,d,1,y,h);return ct(Ce([e.x0,e.x0],Fe(b,n)),Ce([e.y0,e.y0],Fe(w,n)))}function S8(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,M)=>l*S+u*c[M]),g=c.map((S,M)=>l*S-u*a[M]),y=s.map((S,M)=>-h*S+d*m[M]),b=ks(g,y,h*t,i,o),w=ks(m,y,h*t,i,o);return ct(Ce([e.x0,e.x0],Fe(b,e.a*(t-1)*h)),Ce([e.y0,e.y0],Fe(w,e.a*(t-1))))}function M8(e,t,r){let n=ht([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 ct([e.x0-c,e.x0+c],[e.y0-c,e.y0+c])}var js=p(()=>{Je();fc();Ot()});function Oi(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 Of=p(()=>{});function wn(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}var Kl=p(()=>{});function Jr(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 Bf=p(()=>{});function hc(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 Bm=p(()=>{Bt()});function v8(e,t,r){return t*=r,Math.tan(.5*(F+e))*Math.pow((1-t)/(1+t),.5*r)}function hz(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+Fs(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*wn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts))/Jr(e.e,e.con*e.lat_ts,e.con*Math.sin(e.lat_ts))),e.ms1=wn(e.e,e.sinlat0,e.coslat0),e.X0=2*Math.atan(v8(e.lat0,e.sinlat0,e.e))-F,e.cosX0=Math.cos(e.X0),e.sinX0=Math.sin(e.X0))}function E8(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(v8(n,i,e.e))-F,l=Math.cos(a),c=Math.sin(a),Math.abs(e.coslat0)<=1e-10?(u=Jr(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 A8(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=Oi(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*hc(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=Oi(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*hc(e.e,Math.tan(.5*(F+s)));return t.x=r,t.y=n,t}function T8(e){let t={...e,coslat0:0,sinlat0:0,con:0,cons:0,ms1:0,X0:0,cosX0:0,sinX0:0};return hz(t),t}var I8=p(()=>{Of();Bt();Lf();Kl();Bf();Bm();xt()});var Gy,P8=p(()=>{Us();js();Fn();I8();Gy={name:"stere",aliases:["Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],parameters:[...vr,...Vo,"lat_ts"],create(e){let t=br(e),r=T8(t),n=Ds(t,lr("stere",r,E8,A8));return bn(n,t,150*Math.PI/180,(i,o)=>r.sphere?Lm(r,i,o,"stere"):Om(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 Cf=p(()=>{k4();q4();V4()});var zs=p(()=>{"use strict";fv();hv();mv();pv();Og();Og();kv()});function R8(e){return!gz(e,"ftyp",4)||(e[8]&96)===0?null:dz(e)}function dz(e){switch(mz(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function mz(e,t,r){return String.fromCharCode(...e.slice(t,r))}function pz(e){return[...e].map(t=>t.charCodeAt(0))}function gz(e,t,r=0){let n=pz(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var L8=p(()=>{"use strict"});function Cm(e){let t=Nf(e);return bz(t)||_z(t)||wz(t)||xz(t)||yz(t)}function yz(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=R8(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function bz(e){let t=Nf(e);return t.byteLength>=33&&t.getUint32(0,Gn)===2303741511&&t.getUint32(4,Gn)===218765834&&t.getUint32(8,Gn)===13&&t.getUint32(12,Gn)===1229472850?{mimeType:"image/png",width:t.getUint32(16,Gn),height:t.getUint32(20,Gn)}:null}function wz(e){let t=Nf(e);return t.byteLength>=10&&t.getUint32(0,Gn)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Df),height:t.getUint16(8,Df)}:null}function xz(e){let t=Nf(e);return t.byteLength>=14&&t.getUint16(0,Gn)===16973&&t.getUint32(2,Df)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Df),height:t.getUint32(22,Df)}:null}function _z(e){let t=Nf(e);if(!(t.byteLength>=3&&t.getUint16(0,Gn)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=Sz(),o=2;for(;o+9<t.byteLength;){let s=t.getUint16(o,Gn);if(i.has(s))return{mimeType:"image/jpeg",height:t.getUint16(o+5,Gn),width:t.getUint16(o+7,Gn)};if(!n.has(s))return null;o+=2,o+=t.getUint16(o,Gn)}return null}function Sz(){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 Nf(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 Gn,Df,ky=p(()=>{"use strict";L8();Gn=!1,Df=!0});var Mz,vz,Ez,O8,B8=p(()=>{"use strict";ky();Mz=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],vz=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Ez={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:vz,extensions:Mz,tests:[e=>!!Cm(new DataView(e))]},O8={...Ez,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Xl,Dm=p(()=>{"use strict";Xl="5.0.0-beta.2"});function Yl(e){if(!e)return!1;if(Az.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 C8(e,t){if(Yl(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 Uy(e,t)}function Uy(e,t){if(Yl(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}var Az,Nm=p(()=>{"use strict";Az=/^data:image\/svg\+xml/});async function D8(e,t,r){let n=C8(e,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Tz(o||n,t)}finally{o&&i.revokeObjectURL(o)}}async function Tz(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 N8=p(()=>{"use strict";Nm()});async function G8(e,t,r){let n;Yl(r)?n=await D8(e,t,r):n=Uy(e,r);let i=t&&t.imagebitmap;return await U8(n,i)}async function k8(e,t){let r=t&&t.imagebitmap;return await U8(e,r)}async function U8(e,t=null){if((Iz(t)||!F8)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),F8=!1}return await createImageBitmap(e)}function Iz(e){if(!e)return!0;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var F8,j8=p(()=>{"use strict";Nm();N8();F8=!0});async function z8(e,t){var s,a;let{mimeType:r}=Cm(e)||{},n=(s=globalThis.loaders)==null?void 0:s.parseImageNode;Il(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 q8=p(()=>{"use strict";zs();ky()});async function jy(e,t,r){var i;t=t||{},H8(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!$d||n)return await z8(e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(V8);return await G8(e,t,r==null?void 0:r.url)}async function W8(e,t,r){var i;t=t||{},H8(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!$d||n||Yl(r==null?void 0:r.url)||e.type.startsWith("image/svg+xml"))return await jy(await e.arrayBuffer(),t,r);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(V8);return await k8(e,t)}function H8(e){var r;let t=(r=e.image)==null?void 0:r.type;if(t&&t!=="imagebitmap")throw new Error(Pz)}var Pz,V8,$8=p(()=>{"use strict";zs();j8();Nm();q8();Pz="@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.",V8="@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 K8={};ir(K8,{ImageLoaderWithParser:()=>Lz});var Rie,Rz,Lz,X8=p(()=>{"use strict";$8();zy();({preload:Rie,...Rz}=Wo),Lz={...Rz,parse:jy,parseBlob:W8}});async function Bz(){let{ImageLoaderWithParser:e}=await Promise.resolve().then(()=>(X8(),K8));return e}var Oz,Wo,zy=p(()=>{"use strict";Dm();B8();Oz={image:{}};Wo={dataType:null,batchType:null,...O8,version:Xl,options:Oz,preload:Bz}});function Z8(e){let t=Fz(e);if(!t)throw new Error("Not an image");return t}function Fm(e){switch(Z8(e)){case"data":return e;case"imagebitmap":return Cz(e)?Dz(e):Y8(e);case"image":return Y8(e);default:throw new Error("getImageData")}}function Cz(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.isImageBitmapNode;return!!(t!=null&&t(e))}function Dz(e){var r;let t=(r=globalThis.loaders)==null?void 0:r.getImageBitmapDataNode;if(!t)throw new Error("getImageData");return t(e)}function Y8(e){let t=Nz(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 Nz(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 Fz(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 J8=p(()=>{"use strict"});var Q8,eA,qy=p(()=>{"use strict";Q8={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]},eA={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 rA(e){if(!Gm){e=e||kz()||void 0,Gm=new Set;for(let t of Gz)for(let r in tA)if(e&&e.getExtension(`${t}${r}`))for(let n of tA[r])Gm.add(n)}return Gm}function kz(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Gz,tA,Gm,nA=p(()=>{"use strict";Gz=["","WEBKIT_","MOZ_"],tA={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"]},Gm=null});function oA(e=rA(),t,r={}){let n=new Set(e);if(!t)return jz(n);if(t.isHDR){let i=iA(t);return r.astcHDR&&(i==="astc-4x4"||i==="astc-6x6")&&km(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 Wy(n)?"bc7":"rgba32";if(t.codec.startsWith("xuastc-ldr-")||t.codec.startsWith("astc-ldr-")){let i=iA(t);return i&&km(n,i.slice(5))?i:Vy(n,t,["bc7","bc","etc2","atc"])}return t.codec==="uastc-ldr-4x4"?km(n,"4x4")?"astc-4x4":Vy(n,t,["bc7","bc","etc2","etc1","pvrtc","atc"]):Vy(n,t,["etc2","etc1","bc7","bc","pvrtc","atc"])}function jz(e){return km(e,"4x4")?"astc-4x4":Wy(e)?"bc7":sA(e)?{alpha:"bc3",noAlpha:"bc1"}:aA(e)?"etc2":e.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:cA(e)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:lA(e)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function Vy(e,t,r){for(let n of r)switch(n){case"bc7":if(Wy(e))return"bc7";break;case"bc":if(sA(e))return t.hasAlpha?"bc3":"bc1";break;case"etc2":if(aA(e))return"etc2";break;case"etc1":if(!t.hasAlpha&&e.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(cA(e))return t.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(lA(e))return t.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return t.hasAlpha?"rgba32":"rgb565"}function iA(e){let t=`${e.blockWidth}x${e.blockHeight}`;return Uz.includes(t)?`astc-${t}`:null}function km(e,t){return Zl(e,[`astc-${t}-unorm`,`astc-${t}-unorm-srgb`])}function Wy(e){return Zl(e,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function sA(e){return Zl(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 aA(e){return Zl(e,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function cA(e){return Zl(e,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function lA(e){return Zl(e,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function Zl(e,t){return t.some(r=>e.has(r))}var Uz,uA=p(()=>{"use strict";nA();Uz=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function dA(e){Rg(e.modules);let t=Lg("basis");return t||(hA||=zz(e),await hA)}async function zz(e){let t=null,r=null;return[t,r]=await Promise.all([await Ol(fA.TRANSCODER,"images",e,null,"basis_transcoder.mjs"),await Ol(fA.TRANSCODER_WASM,"images",e)]),t=t||globalThis.BASIS,await qz(t,r)}function qz(e,t){let r={};return t&&(r.wasmBinary=t),Pl(()=>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 fA,hA,mA=p(()=>{"use strict";zs();rc();fA={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function zm(e){if(e!==void 0)return UA[e]}function jA(e){if(e!==void 0)return aq[e]}var UA,aq,i2=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"},aq=Object.fromEntries(Object.entries(UA).map(([e,t])=>[t,Number(e)]))});function Jl(e,t){let r=new Array(t.mipMapLevels),n=t.textureFormat||zm(t.internalFormat),i=t.internalFormat||jA(t.textureFormat),o=t.width,s=t.height,a=0;for(let c=0;c<t.mipMapLevels;++c){let l=lq(t,o,s,e,c),h={shape:"texture-level",compressed:!0,data:cq(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 cq(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function lq(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var qm=p(()=>{"use strict";i2()});function fq(e){return uq[e]}function zA(e){return zm(fq(e))}var uq,qA=p(()=>{"use strict";i2();uq={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 qs(e){if(e.byteLength<o2.byteLength)return!1;let t=new Uint8Array(e,0,o2.byteLength);return o2.every((r,n)=>t[n]===r)}function WA(e){let t=l2(e);if(t.pixelDepth>0)throw new Error("CompressedTextureLoader does not support 3D KTX2 textures");if(t.supercompressionScheme!==hq)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=zA(t.vkFormat);if(!r)throw new Error(`Unsupported KTX2 Vulkan format ${t.vkFormat}`);return Jl(t.levels,{mipMapLevels:t.levelCount,width:t.pixelWidth,height:Math.max(1,t.pixelHeight),sizeFunction:n=>n.uncompressedByteLength,textureFormat:r})}function l2(e){if(!qs(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=dq(r,VA,"KTX2 level index");c2(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}`);a2(t.getUint32(48,!0),t.getUint32(52,!0),e.byteLength,"KTX2 data format descriptor"),a2(t.getUint32(56,!0),t.getUint32(60,!0),e.byteLength,"KTX2 key/value data"),a2(Ff(t,64,"KTX2 supercompression global data offset"),Ff(t,72,"KTX2 supercompression global data length"),e.byteLength,"KTX2 supercompression global data");for(let o=0;o<r;o++){let s=s2+o*VA,a=Ff(t,s,`KTX2 level ${o} offset`),c=Ff(t,s+8,`KTX2 level ${o} length`),l=Ff(t,s+16,`KTX2 level ${o} uncompressed length`);c2(a,c,e.byteLength,`KTX2 level ${o}`),i.levels.push({levelData:new Uint8Array(e,a,c),uncompressedByteLength:l})}return i}function Ff(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 dq(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 a2(e,t,r,n){t>0&&c2(e,t,r,n)}function c2(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 o2,s2,VA,hq,Vm=p(()=>{"use strict";qm();qA();o2=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10]),s2=80,VA=24,hq=0});async function pq(e){let t=HA,r;HA=new Promise(n=>{r=n}),await t;try{return await e()}finally{r()}}async function Wm(e,t={}){return await pq(async()=>{var o;let r=await dA(tc(t)),n=((o=t.basis)==null?void 0:o.containerFormat)||"auto";if(n==="ktx2"||n==="auto"&&qs(e)){if(!r.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return yq(r,e,t)}return gq(r,e,t)})}function gq(e,t,r){let n=new e.BasisFile(new Uint8Array(t));try{let i=XA(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(KA(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=XA(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(KA(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 KA(e,t,r,n,i,o,s){let a=wq(i,t);bq(t,u2(i,t));let c=o(a.basisFormat),l=_q(c,a.dataType);if(!s(l,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${u2(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 bq(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 wq(e,t){let r=u2(e,t),n=$A[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function u2(e,t){var n,i,o;let r=((n=e.basis)==null?void 0:n.format)||"auto";return r==="auto"&&(r=oA((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 XA(e,t){let r=e.getBasisTexFormat(),n=xq[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 _q(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 Er(e,t,r){return{basisFormat:e,compressed:!0,format:t,textureFormat:r}}function Ql(e,t,r,n,i){return{basisFormat:e,compressed:!1,format:t,textureFormat:r,srgbFormat:n,srgbTextureFormat:i}}function _n(e,t,r,n){return{...Er(e,t,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var xn,$A,hoe,HA,xq,f2=p(()=>{"use strict";rc();uA();mA();Vm();xn={"4x4":_n(10,37808,37840,"4x4"),"5x4":_n(28,37809,37841,"5x4"),"5x5":_n(29,37810,37842,"5x5"),"6x5":_n(30,37811,37843,"6x5"),"6x6":_n(31,37812,37844,"6x6"),"8x5":_n(32,37813,37845,"8x5"),"8x6":_n(33,37814,37846,"8x6"),"8x8":_n(36,37815,37847,"8x8"),"10x5":_n(34,37816,37848,"10x5"),"10x6":_n(35,37817,37849,"10x6"),"10x8":_n(37,37818,37850,"10x8"),"10x10":_n(38,37819,37851,"10x10"),"12x10":_n(39,37820,37852,"12x10"),"12x12":_n(40,37821,37853,"12x12")},$A={etc1:Er(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...Er(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...Er(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...Er(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:Er(4,36283,"bc4-r-unorm"),bc5:Er(5,36285,"bc5-rg-unorm"),bc7:{...Er(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":Er(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":Er(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":xn["4x4"],"astc-5x4":xn["5x4"],"astc-5x5":xn["5x5"],"astc-6x5":xn["6x5"],"astc-6x6":xn["6x6"],"astc-8x5":xn["8x5"],"astc-8x6":xn["8x6"],"astc-8x8":xn["8x8"],"astc-10x5":xn["10x5"],"astc-10x6":xn["10x6"],"astc-10x8":xn["10x8"],"astc-10x10":xn["10x10"],"astc-12x10":xn["12x10"],"astc-12x12":xn["12x12"],"atc-rgb":Er(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":Er(12,34798,"atc-rgbai-unorm-webgl"),rgba32:Ql(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:Ql(14,36194,"rgb565unorm-webgl"),bgr565:Ql(15,36194,"rgb565unorm-webgl"),rgba4444:Ql(16,32854,"rgba4unorm-webgl"),"eac-r11":Er(20,37488,"eac-r11unorm"),"eac-rg11":Er(21,37490,"eac-rg11unorm"),bc6h:Er(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":Er(23,37808,"astc-4x4-unorm"),rgba16f:{...Ql(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...Ql(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":Er(27,37812,"astc-6x6-unorm")},hoe=Object.freeze(Object.keys($A)),HA=Promise.resolve();xq={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 YA={};ir(YA,{BasisLoaderWithParser:()=>Eq,BasisWorkerLoaderWithParser:()=>vq});var yoe,Sq,boe,Mq,vq,Eq,ZA=p(()=>{"use strict";f2();Hm();Hm();({preload:yoe,...Sq}=uo),{preload:boe,...Mq}=uo,vq={...Sq},Eq={...Mq,parse:Wm}});async function Aq(){let{BasisLoaderWithParser:e}=await Promise.resolve().then(()=>(ZA(),YA));return e}var uo,Hm=p(()=>{"use strict";qy();Dm();uo={...Q8,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Xl,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:Aq}});function JA(e){return new Uint32Array(e,0,kn.HEADER_LENGTH)[kn.MAGIC_NUMBER_INDEX]===kn.MAGIC_NUMBER}function QA(e){let t=new Int32Array(e,0,kn.HEADER_LENGTH),r=t[kn.HEADER_PF_FOURCC_INDEX];Il(!!(t[kn.HEADER_PF_FLAGS_INDEX]&kn.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=Oq(r),i=Tq[n],o=Lq[n];Il(i&&o,`DDS: Unknown pixel format ${r}`);let s=1;t[kn.HEADER_FLAGS_INDEX]&kn.DDSD_MIPMAPCOUNT&&(s=Math.max(1,t[kn.MIPMAPCOUNT_INDEX]));let a=t[kn.HEADER_WIDTH_INDEX],c=t[kn.HEADER_HEIGHT_INDEX],l=t[kn.HEADER_SIZE_INDEX]+4,u=new Uint8Array(e,l);return Jl(u,{mipMapLevels:s,width:a,height:c,sizeFunction:o,textureFormat:i})}function eT(e,t){return(e+3>>2)*(t+3>>2)*8}function $m(e,t){return(e+3>>2)*(t+3>>2)*16}function Oq(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var kn,Tq,Iq,Pq,Rq,Lq,tT=p(()=>{"use strict";zs();qm();kn={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},Tq={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"},Iq=eT,Pq=$m,Rq=$m,Lq={DXT1:eT,DXT3:$m,DXT5:$m,"ATC ":Iq,ATCA:Pq,ATCI:Rq}});function iT(e){let r=new Uint32Array(e,0,mi.HEADER_LENGTH)[mi.MAGIC_NUMBER_INDEX];return r===mi.MAGIC_NUMBER||r===mi.MAGIC_NUMBER_EXTRA}function oT(e){let t=new Uint32Array(e,0,mi.HEADER_LENGTH),r=t[mi.PIXEL_FORMAT_INDEX],n=t[mi.COLOUR_SPACE_INDEX],i=Bq[r]||[],o=i.length>1&&n?i[1]:i[0],s=Cq[r],a=t[mi.MIPMAPCOUNT_INDEX],c=t[mi.WIDTH_INDEX],l=t[mi.HEIGHT_INDEX],u=mi.HEADER_SIZE+t[mi.METADATA_SIZE_INDEX],h=new Uint8Array(e,u);return Jl(h,{mipMapLevels:a,width:c,height:l,sizeFunction:s,textureFormat:o})}function rT(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function nT(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function Gf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function kf(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function Dq(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function Nq(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function Fq(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function Gq(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function kq(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function Uq(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function jq(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function zq(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function qq(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function Vq(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function Wq(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function Hq(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function $q(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}var mi,Bq,Cq,sT=p(()=>{"use strict";qm();mi={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},Bq={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"]},Cq={0:rT,1:rT,2:nT,3:nT,6:Gf,7:Gf,9:kf,11:kf,22:Gf,23:kf,24:Gf,25:Gf,26:kf,27:kf,28:Dq,29:Nq,30:Fq,31:Gq,32:kq,33:Uq,34:jq,35:zq,36:qq,37:Vq,38:Wq,39:Hq,40:$q}});function h2(e){if(qs(e))return WA(e);if(JA(e))return QA(e);if(iT(e))return oT(e);throw new Error("Texture container format not recognized")}var aT=p(()=>{"use strict";Vm();tT();sT()});var cT={};ir(cT,{CompressedTextureLoaderWithParser:()=>Zq,CompressedTextureWorkerLoaderWithParser:()=>Yq});var Noe,Kq,Foe,Xq,Yq,Zq,lT=p(()=>{"use strict";aT();f2();Vm();Km();Km();({preload:Noe,...Kq}=Ho),{preload:Foe,...Xq}=Ho,Yq={...Kq},Zq={...Xq,parse:async(e,t)=>{var r,n;if(t={...t},(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis||qs(e)){let i=qs(e)?l2(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)?h2(e):(t.basis={...t.basis,containerFormat:"ktx2"},(await Wm(e,t))[0])}return h2(e)}}});async function Jq(){let{CompressedTextureLoaderWithParser:e}=await Promise.resolve().then(()=>(lT(),cT));return e}var Ho,Km=p(()=>{"use strict";qy();Dm();Ho={...eA,dataType:null,batchType:null,name:"Texture Containers",id:"compressed-texture",module:"images",version:Xl,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:Jq}});var Uf=p(()=>{"use strict";zy();J8();Hm();Km()});var uT=p(()=>{"use strict"});function hT(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 fT(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 Qr(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 eu(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 Un(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 fT=="function"?fT(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 dT,tu,Qq,jn,$o=p(()=>{dT=new TextDecoder("utf-8"),tu=dT.decode.bind(dT),Qq=new TextEncoder,jn=e=>Qq.encode(e)});var eV,mT,ur,en,zn,qn,Sn,Xm,Ym,Zm,Jm,Qm,pT,jf,gT,e0,yT,Ko=p(()=>{eV=e=>typeof e=="number",mT=e=>typeof e=="boolean",ur=e=>typeof e=="function",en=e=>e!=null&&Object(e)===e,zn=e=>en(e)&&ur(e.then),qn=e=>en(e)&&ur(e[Symbol.iterator]),Sn=e=>en(e)&&ur(e[Symbol.asyncIterator]),Xm=e=>en(e)&&en(e.schema),Ym=e=>en(e)&&"done"in e&&"value"in e,Zm=e=>en(e)&&ur(e.stat)&&eV(e.fd),Jm=e=>en(e)&&jf(e.body),Qm=e=>"_getDOMStream"in e&&"_getNodeStream"in e,pT=e=>en(e)&&ur(e.abort)&&ur(e.getWriter)&&!Qm(e),jf=e=>en(e)&&ur(e.cancel)&&ur(e.getReader)&&!Qm(e),gT=e=>en(e)&&ur(e.end)&&ur(e.write)&&mT(e.writable)&&!Qm(e),e0=e=>en(e)&&ur(e.read)&&ur(e.pipe)&&mT(e.readable)&&!Qm(e),yT=e=>en(e)&&ur(e.clear)&&ur(e.bytes)&&ur(e.position)&&ur(e.setPosition)&&ur(e.capacity)&&ur(e.getBufferIdentifier)&&ur(e.createLong)});var b2={};ir(b2,{compareArrayLike:()=>y2,joinUint8Arrays:()=>Vn,memcpy:()=>zf,rebaseValueOffsets:()=>t0,toArrayBufferView:()=>Re,toArrayBufferViewAsyncIterator:()=>Bi,toArrayBufferViewIterator:()=>fo,toBigInt64Array:()=>qf,toBigUint64Array:()=>sV,toFloat32Array:()=>aV,toFloat32ArrayAsyncIterator:()=>MV,toFloat32ArrayIterator:()=>pV,toFloat64Array:()=>cV,toFloat64ArrayAsyncIterator:()=>vV,toFloat64ArrayIterator:()=>gV,toInt16Array:()=>nV,toInt16ArrayAsyncIterator:()=>wV,toInt16ArrayIterator:()=>fV,toInt32Array:()=>dc,toInt32ArrayAsyncIterator:()=>xV,toInt32ArrayIterator:()=>hV,toInt8Array:()=>rV,toInt8ArrayAsyncIterator:()=>bV,toInt8ArrayIterator:()=>uV,toUint16Array:()=>iV,toUint16ArrayAsyncIterator:()=>_V,toUint16ArrayIterator:()=>dV,toUint32Array:()=>oV,toUint32ArrayAsyncIterator:()=>SV,toUint32ArrayIterator:()=>mV,toUint8Array:()=>se,toUint8ArrayAsyncIterator:()=>g2,toUint8ArrayIterator:()=>p2,toUint8ClampedArray:()=>lV,toUint8ClampedArrayAsyncIterator:()=>EV,toUint8ClampedArrayIterator:()=>yV});function tV(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 zf(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 Vn(e,t){let r=tV(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?zf(s,o,a):s=o;break}zf(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=Ym(t)?t.value:t;return r instanceof e?e===Uint8Array?new e(r.buffer,r.byteOffset,r.byteLength):r:r?(typeof r=="string"&&(r=jn(r)),r instanceof ArrayBuffer?new e(r):r instanceof m2?new e(r):yT(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*fo(e,t){let r=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof m2?r(t):qn(t)?t:r(t);return yield*d2((function*(i){let o=null;do o=i.next(yield Re(e,o));while(!o.done)})(n[Symbol.iterator]())),new e}function Bi(e,t){return Qr(this,arguments,function*(){if(zn(t))return yield Me(yield Me(yield*eu(Un(Bi(e,yield Me(t))))));let n=function(s){return Qr(this,arguments,function*(){yield yield Me(yield Me(s))})},i=function(s){return Qr(this,arguments,function*(){yield Me(yield*eu(Un(d2((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 m2?n(t):qn(t)?i(t):Sn(t)?t:n(t);return yield Me(yield*eu(Un(d2((function(s){return Qr(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 t0(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 y2(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 m2,rV,nV,dc,qf,se,iV,oV,sV,aV,cV,lV,d2,uV,fV,hV,p2,dV,mV,pV,gV,yV,bV,wV,xV,g2,_V,SV,MV,vV,EV,fr=p(()=>{Ar();$o();Ko();m2=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;rV=e=>Re(Int8Array,e),nV=e=>Re(Int16Array,e),dc=e=>Re(Int32Array,e),qf=e=>Re(BigInt64Array,e),se=e=>Re(Uint8Array,e),iV=e=>Re(Uint16Array,e),oV=e=>Re(Uint32Array,e),sV=e=>Re(BigUint64Array,e),aV=e=>Re(Float32Array,e),cV=e=>Re(Float64Array,e),lV=e=>Re(Uint8ClampedArray,e),d2=e=>(e.next(),e);uV=e=>fo(Int8Array,e),fV=e=>fo(Int16Array,e),hV=e=>fo(Int32Array,e),p2=e=>fo(Uint8Array,e),dV=e=>fo(Uint16Array,e),mV=e=>fo(Uint32Array,e),pV=e=>fo(Float32Array,e),gV=e=>fo(Float64Array,e),yV=e=>fo(Uint8ClampedArray,e);bV=e=>Bi(Int8Array,e),wV=e=>Bi(Int16Array,e),xV=e=>Bi(Int32Array,e),g2=e=>Bi(Uint8Array,e),_V=e=>Bi(Uint16Array,e),SV=e=>Bi(Uint32Array,e),MV=e=>Bi(Float32Array,e),vV=e=>Bi(Float64Array,e),EV=e=>Bi(Uint8ClampedArray,e)});function*AV(e){let t,r=!1,n=[],i,o,s,a=0;function c(){return o==="peek"?Vn(n,s)[0]:([i,n,a]=Vn(n,s),i)}({cmd:o,size:s}=(yield null)||{cmd:"read",size:0});let l=p2(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 TV(e){return Qr(this,arguments,function*(){let r,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Vn(i,a)[0]:([o,i,c]=Vn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=g2(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 IV(e){return Qr(this,arguments,function*(){let r=!1,n=!1,i=[],o,s,a,c=0;function l(){return s==="peek"?Vn(i,a)[0]:([o,i,c]=Vn(i,a),o)}({cmd:s,size:a}=(yield yield Me(null))||{cmd:"read",size:0});let u=new x2(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 PV(e){return Qr(this,arguments,function*(){let r=[],n="error",i=!1,o=null,s,a,c=0,l=[],u;function h(){return s==="peek"?Vn(l,a)[0]:([u,l,c]=Vn(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]=w2(e,"end"),r[1]=w2(e,"error");do{if(r[2]=w2(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,S]of m)e.off(w,S);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 hr,r0,x2,w2,ru=p(()=>{Ar();fr();hr={fromIterable(e){return r0(AV(e))},fromAsyncIterable(e){return r0(TV(e))},fromDOMStream(e){return r0(IV(e))},fromNodeStream(e){return r0(PV(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')}},r0=e=>(e.next(),e);x2=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})}},w2=(e,t)=>{let r=i=>n([t,i]),n;return[t,r,new Promise(i=>(n=i)&&e.once(t,r))]}});var nt,n0=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"})(nt||(nt={}))});var Ze,_2=p(()=>{(function(e){e[e.Sparse=0]="Sparse",e[e.Dense=1]="Dense"})(Ze||(Ze={}))});var He,S2=p(()=>{(function(e){e[e.HALF=0]="HALF",e[e.SINGLE=1]="SINGLE",e[e.DOUBLE=2]="DOUBLE"})(He||(He={}))});var ot,M2=p(()=>{(function(e){e[e.DAY=0]="DAY",e[e.MILLISECOND=1]="MILLISECOND"})(ot||(ot={}))});var q,Vf=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,v2=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 i0=ae(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.SIZE_PREFIX_LENGTH=ho.FILE_IDENTIFIER_LENGTH=ho.SIZEOF_INT=ho.SIZEOF_SHORT=void 0;ho.SIZEOF_SHORT=2;ho.SIZEOF_INT=4;ho.FILE_IDENTIFIER_LENGTH=4;ho.SIZE_PREFIX_LENGTH=4});var E2=ae(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.isLittleEndian=pi.float64=pi.float32=pi.int32=void 0;pi.int32=new Int32Array(2);pi.float32=new Float32Array(pi.int32.buffer);pi.float64=new Float64Array(pi.int32.buffer);pi.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var A2=ae(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.Encoding=void 0;var bT;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(bT||(o0.Encoding=bT={}))});var I2=ae(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.ByteBuffer=void 0;var mo=i0(),RV=A2(),Mn=E2(),T2=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 Mn.int32[0]=this.readInt32(t),Mn.float32[0]}readFloat64(t){return Mn.int32[Mn.isLittleEndian?0:1]=this.readInt32(t),Mn.int32[Mn.isLittleEndian?1:0]=this.readInt32(t+4),Mn.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){Mn.float32[0]=r,this.writeInt32(t,Mn.int32[0])}writeFloat64(t,r){Mn.float64[0]=r,this.writeInt32(t,Mn.int32[Mn.isLittleEndian?0:1]),this.writeInt32(t+4,Mn.int32[Mn.isLittleEndian?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+mo.SIZEOF_INT+mo.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let r=0;r<mo.FILE_IDENTIFIER_LENGTH;r++)t+=String.fromCharCode(this.readInt8(this.position_+mo.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+=mo.SIZEOF_INT;let i=this.bytes_.subarray(t,t+n);return r===RV.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)+mo.SIZEOF_INT}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=mo.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+mo.FILE_IDENTIFIER_LENGTH);for(let r=0;r<mo.FILE_IDENTIFIER_LENGTH;r++)if(t.charCodeAt(r)!=this.readInt8(this.position()+mo.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}};s0.ByteBuffer=T2});var xT=ae(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});a0.Builder=void 0;var wT=I2(),Wn=i0(),P2=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=wT.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=wT.ByteBuffer.allocate(n);return i.setPosition(n-r),i.bytes().set(t.bytes(),n-r),i}addOffset(t){this.prep(Wn.SIZEOF_INT,0),this.writeInt32(this.offset()-t+Wn.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)*Wn.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=Wn.SIZEOF_SHORT;l<o;l+=Wn.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?Wn.SIZE_PREFIX_LENGTH:0;if(r){let o=r;if(this.prep(this.minalign,Wn.SIZEOF_INT+Wn.FILE_IDENTIFIER_LENGTH+i),o.length!=Wn.FILE_IDENTIFIER_LENGTH)throw new TypeError("FlatBuffers: file identifier must be length "+Wn.FILE_IDENTIFIER_LENGTH);for(let s=Wn.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,Wn.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(Wn.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()}};a0.Builder=P2});var ze=ae(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.Encoding=Tt.ByteBuffer=Tt.Builder=Tt.isLittleEndian=Tt.int32=Tt.float64=Tt.float32=Tt.SIZE_PREFIX_LENGTH=Tt.SIZEOF_SHORT=Tt.SIZEOF_INT=Tt.FILE_IDENTIFIER_LENGTH=void 0;var c0=i0();Object.defineProperty(Tt,"FILE_IDENTIFIER_LENGTH",{enumerable:!0,get:function(){return c0.FILE_IDENTIFIER_LENGTH}});Object.defineProperty(Tt,"SIZEOF_INT",{enumerable:!0,get:function(){return c0.SIZEOF_INT}});Object.defineProperty(Tt,"SIZEOF_SHORT",{enumerable:!0,get:function(){return c0.SIZEOF_SHORT}});Object.defineProperty(Tt,"SIZE_PREFIX_LENGTH",{enumerable:!0,get:function(){return c0.SIZE_PREFIX_LENGTH}});var l0=E2();Object.defineProperty(Tt,"float32",{enumerable:!0,get:function(){return l0.float32}});Object.defineProperty(Tt,"float64",{enumerable:!0,get:function(){return l0.float64}});Object.defineProperty(Tt,"int32",{enumerable:!0,get:function(){return l0.int32}});Object.defineProperty(Tt,"isLittleEndian",{enumerable:!0,get:function(){return l0.isLittleEndian}});var LV=xT();Object.defineProperty(Tt,"Builder",{enumerable:!0,get:function(){return LV.Builder}});var OV=I2();Object.defineProperty(Tt,"ByteBuffer",{enumerable:!0,get:function(){return OV.ByteBuffer}});var BV=A2();Object.defineProperty(Tt,"Encoding",{enumerable:!0,get:function(){return BV.Encoding}})});var mc,R2=p(()=>{(function(e){e[e.BUFFER=0]="BUFFER"})(mc||(mc={}))});var Tr,nu=p(()=>{(function(e){e[e.LZ4_FRAME=0]="LZ4_FRAME",e[e.ZSTD=1]="ZSTD"})(Tr||(Tr={}))});var _T,Xo,L2=p(()=>{_T=pe(ze(),1);R2();nu();Xo=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()+_T.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):Tr.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):mc.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,r){t.addFieldInt8(0,r,Tr.LZ4_FRAME)}static addMethod(t,r){t.addFieldInt8(1,r,mc.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 iu,O2=p(()=>{iu=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 ou,B2=p(()=>{ou=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 ST,Cr,C2=p(()=>{ST=pe(ze(),1);L2();O2();B2();Cr=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()+ST.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 ou).__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 iu).__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 Xo).__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 MT,Yo,vT=p(()=>{MT=pe(ze(),1);C2();Yo=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()+MT.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 Cr).__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 Vs,D2=p(()=>{(function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"})(Vs||(Vs={}))});var Wf,ET=p(()=>{(function(e){e[e.DenseArray=0]="DenseArray"})(Wf||(Wf={}))});var AT,Ci,u0=p(()=>{AT=pe(ze(),1),Ci=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()+AT.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 TT,po,N2=p(()=>{TT=pe(ze(),1);ET();u0();po=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()+TT.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 Ci).__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):Wf.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,Wf.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}});var IT,Ct,su=p(()=>{IT=pe(ze(),1),Ct=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()+IT.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 PT,Hf,RT=p(()=>{PT=pe(ze(),1),Hf=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()+PT.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 LT,$f,OT=p(()=>{LT=pe(ze(),1),$f=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()+LT.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 BT,Kf,CT=p(()=>{BT=pe(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 getRootAsBool(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,r){return t.setPosition(t.position()+BT.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 DT,Ws,F2=p(()=>{DT=pe(ze(),1);M2();Ws=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()+DT.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):ot.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,r){t.addFieldInt16(0,r,ot.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,r){return e.startDate(t),e.addUnit(t,r),e.endDate(t)}}});var NT,go,G2=p(()=>{NT=pe(ze(),1),go=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()+NT.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 FT,Hs,k2=p(()=>{FT=pe(ze(),1);Vf();Hs=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()+FT.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 GT,$s,U2=p(()=>{GT=pe(ze(),1),$s=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()+GT.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 kT,Ks,j2=p(()=>{kT=pe(ze(),1),Ks=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()+kT.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 UT,Xs,z2=p(()=>{UT=pe(ze(),1);S2();Xs=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()+UT.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 jT,Ys,q2=p(()=>{jT=pe(ze(),1);v2();Ys=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()+jT.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 zT,Xf,qT=p(()=>{zT=pe(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 getRootAsLargeBinary(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,r){return t.setPosition(t.position()+zT.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 VT,Yf,WT=p(()=>{VT=pe(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 getRootAsLargeList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeList(t,r){return t.setPosition(t.position()+VT.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 HT,Zf,$T=p(()=>{HT=pe(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 getRootAsLargeUtf8(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,r){return t.setPosition(t.position()+HT.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 KT,Jf,XT=p(()=>{KT=pe(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 getRootAsList(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,r){return t.setPosition(t.position()+KT.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 YT,Zs,V2=p(()=>{YT=pe(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 getRootAsMap(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,r){return t.setPosition(t.position()+YT.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 ZT,Qf,JT=p(()=>{ZT=pe(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 getRootAsNull(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,r){return t.setPosition(t.position()+ZT.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 QT,eh,eI=p(()=>{QT=pe(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 getRootAsStruct_(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,r){return t.setPosition(t.position()+QT.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 tI,Zo,W2=p(()=>{tI=pe(ze(),1);Vf();Zo=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()+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.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 rI,Jo,H2=p(()=>{rI=pe(ze(),1);Vf();Jo=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()+rI.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 nI,Di,$2=p(()=>{nI=pe(ze(),1);_2();Di=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()+nI.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,th,oI=p(()=>{iI=pe(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 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 sI,rh,aI=p(()=>{sI=pe(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 getRootAsUtf8View(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8View(t,r){return t.setPosition(t.position()+sI.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 me,f0=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"})(me||(me={}))});var cI,Dr,K2=p(()=>{cI=pe(ze(),1);N2();su();f0();Dr=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()+cI.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):me.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 po).__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 Ct).__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,me.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 lI,vn,X2=p(()=>{lI=pe(ze(),1);D2();K2();su();vn=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()+lI.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):Vs.Little}fields(t,r){let n=this.bb.__offset(this.bb_pos,6);return n?(r||new Dr).__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 Ct).__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,Vs.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,h0=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,Dt=p(()=>{n0();_2();S2();M2();Vf();v2();h0();(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 Y2={};ir(Y2,{valueToString:()=>Ni});function Ni(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=>Ni(t))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(t,r)=>typeof r=="bigint"?`${r}`:r)}var nh=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 Z2(e,t){return Le(e/t)+Le(e%t)/Le(t)}var yo=p(()=>{});var eb={};ir(eb,{BN:()=>pc,bigNumToBigInt:()=>fI,bigNumToNumber:()=>Q2,bigNumToString:()=>lu,isArrowBigNumSymbol:()=>uI});function Fi(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 au(...e){return Fi.apply(this,e)}function cu(...e){return Fi.apply(this,e)}function ih(...e){return Fi.apply(this,e)}function Q2(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^DV)*(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 lu(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return J2(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return J2(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`-${J2(t)}`}function fI(e){return e.byteLength===8?new e.BigIntArray(e.buffer,e.byteOffset,1)[0]:lu(e)}function J2(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 uI,CV,DV,pc,d0=p(()=>{fr();yo();uI=Symbol.for("isArrowBigNum");Fi.prototype[uI]=!0;Fi.prototype.toJSON=function(){return`"${lu(this)}"`};Fi.prototype.valueOf=function(e){return Q2(this,e)};Fi.prototype.toString=function(){return lu(this)};Fi.prototype[Symbol.toPrimitive]=function(e="default"){switch(e){case"number":return Q2(this);case"string":return lu(this);case"default":return fI(this)}return lu(this)};Object.setPrototypeOf(au.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(cu.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ih.prototype,Object.create(Uint32Array.prototype));Object.assign(au.prototype,Fi.prototype,{constructor:au,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(cu.prototype,Fi.prototype,{constructor:cu,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ih.prototype,Fi.prototype,{constructor:ih,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});CV=BigInt(4294967296)*BigInt(4294967296),DV=CV-BigInt(1);pc=class e{static new(t,r){switch(r){case!0:return new au(t);case!1:return new cu(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new au(t)}return t.byteLength===16?new ih(t):new cu(t)}static signed(t){return new au(t)}static unsigned(t){return new cu(t)}static decimal(t){return new ih(t)}constructor(t,r){return e.new(t,r)}}});function Qn(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 hI,dI,mI,pI,gI,yI,bI,wI,xI,_I,SI,MI,vI,EI,AI,TI,II,PI,RI,LI,OI,BI,CI,DI,NI,FI,z,Vt,It,Hn,$n,Xt,Kn,Xn,Yn,tn,Gi,Nr,ki,rn,Zn,En,Ee,Ui,Fr,nn,ji,Gr,An,on,Js,Qs,Ir,ea,ta,ra,na,Pr,ia,bo,oa,sa,kr,aa,ca,oh,sn,sh,ah,ch,lh,Qt,Jn,et,an,Qo,la,Tn,Wt,Ur,NV,er,st=p(()=>{yo();Dt();FI=Symbol.for("apache-arrow/DataType"),z=class e{static isDataType(t){return(t==null?void 0:t[FI])===!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}};hI=Symbol.toStringTag;z[hI]=(e=>(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[FI]=!0,e[Symbol.toStringTag]="DataType"))(z.prototype);Vt=class extends z{constructor(){super(x.Null)}toString(){return"Null"}};dI=Symbol.toStringTag;Vt[dI]=(e=>e[Symbol.toStringTag]="Null")(Vt.prototype);It=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}`}};mI=Symbol.toStringTag;It[mI]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]="Int"))(It.prototype);Hn=class extends It{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},$n=class extends It{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Xt=class extends It{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Kn=class extends It{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Xn=class extends It{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Yn=class extends It{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},tn=class extends It{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Gi=class extends It{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Hn.prototype,"ArrayType",{value:Int8Array});Object.defineProperty($n.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Xt.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Kn.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Xn.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Yn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(tn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Gi.prototype,"ArrayType",{value:BigUint64Array});Nr=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}`}};pI=Symbol.toStringTag;Nr[pI]=(e=>(e.precision=null,e[Symbol.toStringTag]="Float"))(Nr.prototype);ki=class extends Nr{constructor(){super(He.HALF)}},rn=class extends Nr{constructor(){super(He.SINGLE)}},Zn=class extends Nr{constructor(){super(He.DOUBLE)}};Object.defineProperty(ki.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(rn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(Zn.prototype,"ArrayType",{value:Float64Array});En=class extends z{constructor(){super(x.Binary)}toString(){return"Binary"}};gI=Symbol.toStringTag;En[gI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(En.prototype);Ee=class extends z{constructor(){super(x.BinaryView)}toString(){return"BinaryView"}};yI=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[yI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="BinaryView"))(Ee.prototype);Ui=class extends z{constructor(){super(x.LargeBinary)}toString(){return"LargeBinary"}};bI=Symbol.toStringTag;Ui[bI]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeBinary"))(Ui.prototype);Fr=class extends z{constructor(){super(x.Utf8)}toString(){return"Utf8"}};wI=Symbol.toStringTag;Fr[wI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8"))(Fr.prototype);nn=class extends z{constructor(){super(x.Utf8View)}toString(){return"Utf8View"}};xI=Symbol.toStringTag;nn.ELEMENT_WIDTH=Ee.ELEMENT_WIDTH;nn.INLINE_CAPACITY=Ee.INLINE_CAPACITY;nn[xI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Utf8View"))(nn.prototype);ji=class extends z{constructor(){super(x.LargeUtf8)}toString(){return"LargeUtf8"}};_I=Symbol.toStringTag;ji[_I]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeUtf8"))(ji.prototype);Gr=class extends z{constructor(){super(x.Bool)}toString(){return"Bool"}};SI=Symbol.toStringTag;Gr[SI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Bool"))(Gr.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}]`}};MI=Symbol.toStringTag;An[MI]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(An.prototype);on=class extends z{constructor(t){super(x.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${ot[this.unit]}>`}get ArrayType(){return this.unit===ot.DAY?Int32Array:BigInt64Array}};vI=Symbol.toStringTag;on[vI]=(e=>(e.unit=null,e[Symbol.toStringTag]="Date"))(on.prototype);Js=class extends on{constructor(){super(ot.DAY)}},Qs=class extends on{constructor(){super(ot.MILLISECOND)}},Ir=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`)}};EI=Symbol.toStringTag;Ir[EI]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]="Time"))(Ir.prototype);ea=class extends Ir{constructor(){super(q.SECOND,32)}},ta=class extends Ir{constructor(){super(q.MILLISECOND,32)}},ra=class extends Ir{constructor(){super(q.MICROSECOND,64)}},na=class extends Ir{constructor(){super(q.NANOSECOND,64)}},Pr=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}`:""}>`}};AI=Symbol.toStringTag;Pr[AI]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Timestamp"))(Pr.prototype);ia=class extends Pr{constructor(t){super(q.SECOND,t)}},bo=class extends Pr{constructor(t){super(q.MILLISECOND,t)}},oa=class extends Pr{constructor(t){super(q.MICROSECOND,t)}},sa=class extends Pr{constructor(t){super(q.NANOSECOND,t)}},kr=class extends z{constructor(t){super(x.Interval),this.unit=t}toString(){return`Interval<${ke[this.unit]}>`}};TI=Symbol.toStringTag;kr[TI]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]="Interval"))(kr.prototype);aa=class extends kr{constructor(){super(ke.DAY_TIME)}},ca=class extends kr{constructor(){super(ke.YEAR_MONTH)}},oh=class extends kr{constructor(){super(ke.MONTH_DAY_NANO)}},sn=class extends z{constructor(t){super(x.Duration),this.unit=t}toString(){return`Duration<${q[this.unit]}>`}};II=Symbol.toStringTag;sn[II]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]="Duration"))(sn.prototype);sh=class extends sn{constructor(){super(q.SECOND)}},ah=class extends sn{constructor(){super(q.MILLISECOND)}},ch=class extends sn{constructor(){super(q.MICROSECOND)}},lh=class extends sn{constructor(){super(q.NANOSECOND)}},Qt=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}};PI=Symbol.toStringTag;Qt[PI]=(e=>(e.children=null,e[Symbol.toStringTag]="List"))(Qt.prototype);Jn=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}};RI=Symbol.toStringTag;Jn[RI]=(e=>(e.children=null,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]="LargeList"))(Jn.prototype);et=class extends z{constructor(t){super(x.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};LI=Symbol.toStringTag;et[LI]=(e=>(e.children=null,e[Symbol.toStringTag]="Struct"))(et.prototype);an=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(" | ")}>`}};OI=Symbol.toStringTag;an[OI]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]="Union"))(an.prototype);Qo=class extends an{constructor(t,r){super(Ze.Dense,t,r)}},la=class extends an{constructor(t,r){super(Ze.Sparse,t,r)}},Tn=class extends z{constructor(t){super(x.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};BI=Symbol.toStringTag;Tn[BI]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]="FixedSizeBinary"))(Tn.prototype);Wt=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}>`}};CI=Symbol.toStringTag;Wt[CI]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]="FixedSizeList"))(Wt.prototype);Ur=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(", ")}}>`}};DI=Symbol.toStringTag;Ur[DI]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]="Map_"))(Ur.prototype);NV=(e=>()=>++e)(-1),er=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?NV():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}>`}};NI=Symbol.toStringTag;er[NI]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]="Dictionary"))(er.prototype)});function FV(e,t,r=!0){return typeof t=="number"?uu(e,t,r):typeof t=="string"&&t in x?uu(e,x[t],r):t&&t instanceof z?uu(e,kI(t),r):t!=null&&t.type&&t.type instanceof z?uu(e,kI(t.type),r):uu(e,x.NONE,r)}function uu(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 kI(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 ot.DAY:return x.DateDay;case ot.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,In=p(()=>{Dt();st();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 FV(this,t,r)}getVisitFnByTypeId(t,r=!0){return uu(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 tb={};ir(tb,{float64ToUint16:()=>uh,uint16ToFloat64:()=>m0});function m0(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 uh(e){if(e!==e)return 32256;UI[0]=e;let t=(fu[1]&2147483648)>>16&65535,r=fu[1]&2146435072,n=0;return r>=1089470464?fu[0]>0?r=31744:(r=(r&2080374784)>>16,n=(fu[1]&1048575)>>10):r<=1056964608?(n=1048576+(fu[1]&1048575),n=1048576+(n<<(r>>20)-998)>>21,r=0):(r=r-1056964608>>10,n=(fu[1]&1048575)+512>>10),t|r|n&65535}var UI,fu,fh=p(()=>{UI=new Float64Array(1),fu=new Uint32Array(UI.buffer)});function be(e){return(t,r,n)=>{if(t.setValid(r,n!=null))return e(t,r,n)}}var de,GV,jI,kV,es,rb,zI,UV,p0,g0,nb,qI,jV,VI,zV,WI,qV,ib,y0,b0,w0,x0,ob,_0,S0,M0,v0,sb,ab,HI,VV,WV,HV,$V,KV,XV,YV,$I,KI,ZV,cb,E0,A0,T0,I0,P0,R0,L0,lb,JV,Rr,ei=p(()=>{jr();In();yo();$o();fh();Dt();st();de=class extends ie{};GV=(e,t,r)=>{e[t]=Math.floor(r/864e5)},jI=(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)}},kV=({offset:e,values:t},r,n)=>{let i=e+r;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},es=({values:e},t,r)=>{e[t]=r},rb=({values:e},t,r)=>{e[t]=r},zI=({values:e},t,r)=>{e[t]=uh(r)},UV=(e,t,r)=>{switch(e.type.precision){case He.HALF:return zI(e,t,r);case He.SINGLE:case He.DOUBLE:return rb(e,t,r)}},p0=({values:e},t,r)=>{GV(e,t,r.valueOf())},g0=({values:e},t,r)=>{e[t]=BigInt(r)},nb=({stride:e,values:t},r,n)=>{t.set(n.subarray(0,e),e*r)},qI=({values:e,valueOffsets:t},r,n)=>jI(e,t,r,n),jV=e=>{let t=e.variadicBuffers;return(!Array.isArray(t)||Object.isFrozen(t))&&(t=Array.from(t),e.variadicBuffers=t),t},VI=(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=jV(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)},zV=(e,t,r)=>{let n=r instanceof Uint8Array?r:new Uint8Array(r);VI(e,t,n)},WI=({values:e,valueOffsets:t},r,n)=>jI(e,t,r,jn(n)),qV=(e,t,r)=>{let n=jn(r);VI(e,t,n)},ib=(e,t,r)=>{e.type.unit===ot.DAY?p0(e,t,r):g0(e,t,r)},y0=({values:e},t,r)=>{e[t]=BigInt(r/1e3)},b0=({values:e},t,r)=>{e[t]=BigInt(r)},w0=({values:e},t,r)=>{e[t]=BigInt(r*1e3)},x0=({values:e},t,r)=>{e[t]=BigInt(r*1e6)},ob=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return y0(e,t,r);case q.MILLISECOND:return b0(e,t,r);case q.MICROSECOND:return w0(e,t,r);case q.NANOSECOND:return x0(e,t,r)}},_0=({values:e},t,r)=>{e[t]=r},S0=({values:e},t,r)=>{e[t]=r},M0=({values:e},t,r)=>{e[t]=r},v0=({values:e},t,r)=>{e[t]=r},sb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return _0(e,t,r);case q.MILLISECOND:return S0(e,t,r);case q.MICROSECOND:return M0(e,t,r);case q.NANOSECOND:return v0(e,t,r)}},ab=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},HI=(e,t,r)=>{let n=e.children[0],i=e.valueOffsets,o=Rr.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))},VV=(e,t,r)=>{let n=e.children[0],{valueOffsets:i}=e,o=Rr.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},WV=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[o]),HV=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(o)),$V=(e,t)=>(r,n,i,o)=>n&&r(n,e,t.get(i.name)),KV=(e,t)=>(r,n,i,o)=>n&&r(n,e,t[i.name]),XV=(e,t,r)=>{let n=e.type.children.map(o=>Rr.getVisitFn(o.type)),i=r instanceof Map?$V(t,r):r instanceof $?HV(t,r):Array.isArray(r)?WV(t,r):KV(t,r);e.type.children.forEach((o,s)=>i(n[s],e.children[s],o,s))},YV=(e,t,r)=>{e.type.mode===Ze.Dense?$I(e,t,r):KI(e,t,r)},$I=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Rr.visit(i,e.valueOffsets[t],r)},KI=(e,t,r)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[n];Rr.visit(i,t,r)},ZV=(e,t,r)=>{var n;(n=e.dictionary)===null||n===void 0||n.set(e.values[t],r)},cb=(e,t,r)=>{switch(e.type.unit){case ke.YEAR_MONTH:return A0(e,t,r);case ke.DAY_TIME:return E0(e,t,r);case ke.MONTH_DAY_NANO:return T0(e,t,r)}},E0=({values:e},t,r)=>{e.set(r.subarray(0,2),2*t)},A0=({values:e},t,r)=>{e[t]=r[0]*12+r[1]%12},T0=({values:e,stride:t},r,n)=>{e.set(n.subarray(0,t),t*r)},I0=({values:e},t,r)=>{e[t]=r},P0=({values:e},t,r)=>{e[t]=r},R0=({values:e},t,r)=>{e[t]=r},L0=({values:e},t,r)=>{e[t]=r},lb=(e,t,r)=>{switch(e.type.unit){case q.SECOND:return I0(e,t,r);case q.MILLISECOND:return P0(e,t,r);case q.MICROSECOND:return R0(e,t,r);case q.NANOSECOND:return L0(e,t,r)}},JV=(e,t,r)=>{let{stride:n}=e,i=e.children[0],o=Rr.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(kV);de.prototype.visitInt=be(es);de.prototype.visitInt8=be(es);de.prototype.visitInt16=be(es);de.prototype.visitInt32=be(es);de.prototype.visitInt64=be(es);de.prototype.visitUint8=be(es);de.prototype.visitUint16=be(es);de.prototype.visitUint32=be(es);de.prototype.visitUint64=be(es);de.prototype.visitFloat=be(UV);de.prototype.visitFloat16=be(zI);de.prototype.visitFloat32=be(rb);de.prototype.visitFloat64=be(rb);de.prototype.visitUtf8=be(WI);de.prototype.visitLargeUtf8=be(WI);de.prototype.visitUtf8View=be(qV);de.prototype.visitBinary=be(qI);de.prototype.visitLargeBinary=be(qI);de.prototype.visitBinaryView=be(zV);de.prototype.visitFixedSizeBinary=be(nb);de.prototype.visitDate=be(ib);de.prototype.visitDateDay=be(p0);de.prototype.visitDateMillisecond=be(g0);de.prototype.visitTimestamp=be(ob);de.prototype.visitTimestampSecond=be(y0);de.prototype.visitTimestampMillisecond=be(b0);de.prototype.visitTimestampMicrosecond=be(w0);de.prototype.visitTimestampNanosecond=be(x0);de.prototype.visitTime=be(sb);de.prototype.visitTimeSecond=be(_0);de.prototype.visitTimeMillisecond=be(S0);de.prototype.visitTimeMicrosecond=be(M0);de.prototype.visitTimeNanosecond=be(v0);de.prototype.visitDecimal=be(ab);de.prototype.visitList=be(HI);de.prototype.visitLargeList=be(HI);de.prototype.visitStruct=be(XV);de.prototype.visitUnion=be(YV);de.prototype.visitDenseUnion=be($I);de.prototype.visitSparseUnion=be(KI);de.prototype.visitDictionary=be(ZV);de.prototype.visitInterval=be(cb);de.prototype.visitIntervalDayTime=be(E0);de.prototype.visitIntervalYearMonth=be(A0);de.prototype.visitIntervalMonthDayNano=be(T0);de.prototype.visitDuration=be(lb);de.prototype.visitDurationSecond=be(I0);de.prototype.visitDurationMillisecond=be(P0);de.prototype.visitDurationMicrosecond=be(R0);de.prototype.visitDurationNanosecond=be(L0);de.prototype.visitFixedSizeList=be(JV);de.prototype.visitMap=be(VV);Rr=new de});var zi,hu,wo,ub,fb,QV,O0=p(()=>{nh();gc();ei();zi=Symbol.for("parent"),hu=Symbol.for("rowIndex"),wo=class{constructor(t,r){return this[zi]=t,this[hu]=r,new Proxy(this,QV)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[hu],r=this[zi],n=r.type.children,i={};for(let o=-1,s=n.length;++o<s;)i[n[o].name]=tr.visit(r.children[o],t);return i}toString(){return`{${[...this].map(([t,r])=>`${Ni(t)}: ${Ni(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new ub(this[zi],this[hu])}},ub=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,tr.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(wo.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[zi]:{writable:!0,enumerable:!1,configurable:!1,value:null},[hu]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});fb=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[zi].type.children.map(r=>r.name)}has(t,r){return t[zi].type.children.some(n=>n.name===r)}getOwnPropertyDescriptor(t,r){if(t[zi].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[zi].type.children.findIndex(i=>i.name===r);if(n!==-1){let i=tr.visit(t[zi].children[n],t[hu]);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[zi].type.children.findIndex(o=>o.name===r);return i!==-1?(Rr.visit(t[zi].children[i],t[hu],n),Reflect.set(t,r,n)):Reflect.has(t,r)||typeof r=="symbol"?Reflect.set(t,r,n):!1}},QV=new fb});function ge(e){return(t,r)=>t.getValid(r)?e(t,r):null}var le,eW,du,tW,rW,XI,nW,YI,ZI,ua,iW,JI,oW,QI,e6,sW,t6,aW,cW,lW,uW,r6,n6,i6,o6,fW,s6,a6,c6,l6,hW,dW,u6,mW,pW,gW,f6,h6,yW,bW,d6,m6,p6,g6,y6,b6,w6,wW,xW,tr,gc=p(()=>{d0();jr();In();hh();O0();yo();$o();fh();Dt();le=class extends ie{};eW=(e,t)=>864e5*e[t],du=16,tW=12,rW=(e,t)=>null,XI=(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},YI=({values:e},t)=>eW(e,t),ZI=({values:e},t)=>Le(e[t]),ua=({stride:e,values:t},r)=>t[e*r],iW=({stride:e,values:t},r)=>m0(t[e*r]),JI=({values:e},t)=>e[t],oW=({stride:e,values:t},r)=>t.subarray(e*r,e*(r+1)),QI=({values:e,valueOffsets:t},r)=>XI(e,t,r),e6=(e,t)=>{var r;let n=e.values;if(!n)throw new Error("BinaryView data is missing view buffer");let i=t*du,o=i+du;if(i<0||o>n.length)throw new Error(`BinaryView data buffer is too short: expected ${du} bytes, got ${Math.max(0,n.length-i)}`);let s=n.subarray(i,o);if(s.length<du)throw new Error(`BinaryView data buffer is too short: expected ${du} bytes, got ${s.length}`);let a=new DataView(n.buffer,s.byteOffset,du),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=tW)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)},sW=(e,t)=>e6(e,t),t6=({values:e,valueOffsets:t},r)=>{let n=XI(e,t,r);return n!==null?tu(n):null},aW=(e,t)=>{let r=e6(e,t);return tu(r)},cW=({values:e},t)=>e[t],lW=({type:e,values:t},r)=>e.precision!==He.HALF?t[r]:m0(t[r]),uW=(e,t)=>e.type.unit===ot.DAY?YI(e,t):ZI(e,t),r6=({values:e},t)=>1e3*Le(e[t]),n6=({values:e},t)=>Le(e[t]),i6=({values:e},t)=>Z2(e[t],BigInt(1e3)),o6=({values:e},t)=>Z2(e[t],BigInt(1e6)),fW=(e,t)=>{switch(e.type.unit){case q.SECOND:return r6(e,t);case q.MILLISECOND:return n6(e,t);case q.MICROSECOND:return i6(e,t);case q.NANOSECOND:return o6(e,t)}},s6=({values:e},t)=>e[t],a6=({values:e},t)=>e[t],c6=({values:e},t)=>e[t],l6=({values:e},t)=>e[t],hW=(e,t)=>{switch(e.type.unit){case q.SECOND:return s6(e,t);case q.MILLISECOND:return a6(e,t);case q.MICROSECOND:return c6(e,t);case q.NANOSECOND:return l6(e,t)}},dW=({values:e,stride:t},r)=>pc.decimal(e.subarray(t*r,t*(r+1))),u6=(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])},mW=(e,t)=>{let{valueOffsets:r,children:n}=e,{[t]:i,[t+1]:o}=r,s=n[0];return new gi(s.slice(i,o-i))},pW=(e,t)=>new wo(e,t),gW=(e,t)=>e.type.mode===Ze.Dense?f6(e,t):h6(e,t),f6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return tr.visit(n,e.valueOffsets[t])},h6=(e,t)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],n=e.children[r];return tr.visit(n,t)},yW=(e,t)=>{var r;return(r=e.dictionary)===null||r===void 0?void 0:r.get(e.values[t])},bW=(e,t)=>e.type.unit===ke.MONTH_DAY_NANO?p6(e,t):e.type.unit===ke.DAY_TIME?d6(e,t):m6(e,t),d6=({values:e},t)=>e.subarray(2*t,2*(t+1)),m6=({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},p6=({values:e},t)=>e.subarray(4*t,4*(t+1)),g6=({values:e},t)=>e[t],y6=({values:e},t)=>e[t],b6=({values:e},t)=>e[t],w6=({values:e},t)=>e[t],wW=(e,t)=>{switch(e.type.unit){case q.SECOND:return g6(e,t);case q.MILLISECOND:return y6(e,t);case q.MICROSECOND:return b6(e,t);case q.NANOSECOND:return w6(e,t)}},xW=(e,t)=>{let{stride:r,children:n}=e,o=n[0].slice(t*r,r);return new $([o])};le.prototype.visitNull=ge(rW);le.prototype.visitBool=ge(nW);le.prototype.visitInt=ge(cW);le.prototype.visitInt8=ge(ua);le.prototype.visitInt16=ge(ua);le.prototype.visitInt32=ge(ua);le.prototype.visitInt64=ge(JI);le.prototype.visitUint8=ge(ua);le.prototype.visitUint16=ge(ua);le.prototype.visitUint32=ge(ua);le.prototype.visitUint64=ge(JI);le.prototype.visitFloat=ge(lW);le.prototype.visitFloat16=ge(iW);le.prototype.visitFloat32=ge(ua);le.prototype.visitFloat64=ge(ua);le.prototype.visitUtf8=ge(t6);le.prototype.visitLargeUtf8=ge(t6);le.prototype.visitUtf8View=ge(aW);le.prototype.visitBinary=ge(QI);le.prototype.visitLargeBinary=ge(QI);le.prototype.visitBinaryView=ge(sW);le.prototype.visitFixedSizeBinary=ge(oW);le.prototype.visitDate=ge(uW);le.prototype.visitDateDay=ge(YI);le.prototype.visitDateMillisecond=ge(ZI);le.prototype.visitTimestamp=ge(fW);le.prototype.visitTimestampSecond=ge(r6);le.prototype.visitTimestampMillisecond=ge(n6);le.prototype.visitTimestampMicrosecond=ge(i6);le.prototype.visitTimestampNanosecond=ge(o6);le.prototype.visitTime=ge(hW);le.prototype.visitTimeSecond=ge(s6);le.prototype.visitTimeMillisecond=ge(a6);le.prototype.visitTimeMicrosecond=ge(c6);le.prototype.visitTimeNanosecond=ge(l6);le.prototype.visitDecimal=ge(dW);le.prototype.visitList=ge(u6);le.prototype.visitLargeList=ge(u6);le.prototype.visitStruct=ge(pW);le.prototype.visitUnion=ge(gW);le.prototype.visitDenseUnion=ge(f6);le.prototype.visitSparseUnion=ge(h6);le.prototype.visitDictionary=ge(yW);le.prototype.visitInterval=ge(bW);le.prototype.visitIntervalDayTime=ge(d6);le.prototype.visitIntervalYearMonth=ge(m6);le.prototype.visitIntervalMonthDayNano=ge(p6);le.prototype.visitDuration=ge(wW);le.prototype.visitDurationSecond=ge(g6);le.prototype.visitDurationMillisecond=ge(y6);le.prototype.visitDurationMicrosecond=ge(b6);le.prototype.visitDurationNanosecond=ge(w6);le.prototype.visitFixedSizeList=ge(xW);le.prototype.visitMap=ge(mW);tr=new le});var fa,pu,mu,hb,gi,db,mb,hh=p(()=>{jr();nh();gc();ei();fa=Symbol.for("keys"),pu=Symbol.for("vals"),mu=Symbol.for("kKeysAsStrings"),hb=Symbol.for("_kKeysAsStrings"),gi=class{constructor(t){return this[fa]=new $([t.children[0]]).memoize(),this[pu]=t.children[1],new Proxy(this,new mb)}get[mu](){return this[hb]||(this[hb]=Array.from(this[fa].toArray(),String))}[Symbol.iterator](){return new db(this[fa],this[pu])}get size(){return this[fa].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[fa],r=this[pu],n={};for(let i=-1,o=t.length;++i<o;)n[t.get(i)]=tr.visit(r,i);return n}toString(){return`{${[...this].map(([t,r])=>`${Ni(t)}: ${Ni(r)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},db=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),tr.visit(this.vals,t)]})}},mb=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[mu]}has(t,r){return t[mu].includes(r)}getOwnPropertyDescriptor(t,r){if(t[mu].indexOf(r)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,r){if(Reflect.has(t,r))return t[r];let n=t[mu].indexOf(r);if(n!==-1){let i=tr.visit(Reflect.get(t,pu),n);return Reflect.set(t,r,i),i}}set(t,r,n){let i=t[mu].indexOf(r);return i!==-1?(Rr.visit(Reflect.get(t,pu),i,n),Reflect.set(t,r,n)):Reflect.has(t,r)?Reflect.set(t,r,n):!1}};Object.defineProperties(gi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[fa]:{writable:!0,enumerable:!1,configurable:!1,value:null},[pu]:{writable:!0,enumerable:!1,configurable:!1,value:null},[hb]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var pb={};ir(pb,{clampRange:()=>dh,createElementComparator:()=>ha,wrapIndex:()=>yc});function dh(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&&(x6=o,o=s,s=x6),s>i&&(s=i),n?n(e,o,s):[o,s]}function ha(e){if(typeof e!=="object"||e===null)return _6(e)?_6: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?y2(e,r):!1:e instanceof Map?SW(e):Array.isArray(e)?_W(e):e instanceof $?MW(e):vW(e,!0)}function _W(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=ha(e[r]);return B0(t)}function SW(e){let t=-1,r=[];for(let n of e.values())r[++t]=ha(n);return B0(r)}function MW(e){let t=[];for(let r=-1,n=e.length;++r<n;)t[r]=ha(e.get(r));return B0(t)}function vW(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]=ha(e[r[i]]);return B0(n,r)}function B0(e,t){return r=>{if(!r||typeof r!="object")return!1;switch(r.constructor){case Array:return EW(e,r);case Map:return S6(e,r,r.keys());case gi:case wo:case Object:case void 0:return S6(e,r,t||Object.keys(r))}return r instanceof $?AW(e,r):!1}}function EW(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 AW(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 S6(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 x6,yc,_6,gu=p(()=>{jr();hh();O0();fr();yc=(e,t)=>e<0?t+e:e,_6=e=>e!==e});var gb={};ir(gb,{BitIterator:()=>xo,getBit:()=>D0,getBool:()=>yu,packBools:()=>wc,popcnt_array:()=>M6,popcnt_bit_range:()=>mh,popcnt_uint32:()=>C0,setBool:()=>TW,truncateBitmap:()=>bc});function yu(e,t,r,n){return(r&1<<n)!==0}function D0(e,t,r,n){return(r&1<<n)>>n}function TW(e,t,r){return r?!!(e[t>>3]|=1<<t%8)||!0:!(e[t>>3]&=~(1<<t%8))&&!1}function bc(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):wc(new xo(r,e,t,null,yu)).subarray(0,n)),i}return r}function wc(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 mh(e,t,r){if(r-t<=0)return 0;if(r-t<8){let o=0;for(let s of new xo(e,t,r-t,e,D0))o+=s;return o}let n=r>>3<<3,i=t+(t%8===0?0:8-t%8);return mh(e,t,i)+mh(e,n,r)+M6(e,i>>3,n-i>>3)}function M6(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+=C0(o.getUint32(i)),i+=4;for(;s-i>=2;)n+=C0(o.getUint16(i)),i+=2;for(;s-i>=1;)n+=C0(o.getUint8(i)),i+=1;return n}function C0(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 xo,xc=p(()=>{xo=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 PW.visit(e)}var IW,v6,ce,yb,PW,yi=p(()=>{jr();Dt();st();xc();st();In();fr();IW=-1,v6=Symbol.for("apache-arrow/Data"),ce=class e{static isData(t){return(t==null?void 0:t[v6])===!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<=IW&&(r=this.nullBitmap)&&(this._nullCount=t=r.length===0?0:this.length-mh(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=Qn(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(bc(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(bc(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[v6]=!0;Object.defineProperty(ce,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ce&&ce.isData(t)}});yb=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=dc(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/nn.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=qf(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=dc(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=qf(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/Qn(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/Qn(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/Qn(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/Qn(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/Qn(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=dc(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=qf(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=dc(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/Qn(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/Qn(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=dc(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])}},PW=new yb});function E6(e){return e.some(t=>t.nullable)}function N0(e){return e.reduce((t,r)=>t+r.nullCount,0)}function F0(e){return e.reduce((t,r,n)=>(t[n+1]=t[n]+r.length,t),new Uint32Array(e.length+1))}function G0(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 gh(e,t){return e.getValid(t)}function bu(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 k0(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 U0(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 ph,j0=p(()=>{ph=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 RW(e,t){return t===null&&e.length>0?0:-1}function LW(e,t){let{nullBitmap:r}=e;if(!r||e.nullCount<=0)return-1;let n=0;for(let i of new xo(r,e.offset+(t||0),e.length,r,yu)){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 LW(e,r)}let n=tr.getVisitFn(e),i=ha(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}function A6(e,t,r){let n=tr.getVisitFn(e),i=ha(t);for(let o=(r||0)-1,s=e.length;++o<s;)if(i(n(e,o)))return o;return-1}var ue,_c,z0=p(()=>{Dt();In();gc();xc();gu();ue=class extends ie{};ue.prototype.visitNull=RW;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=A6;ue.prototype.visitSparseUnion=A6;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;_c=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 ph(e.data.length,n=>{let i=e.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let r=0;return new ph(e.data.length,n=>{let o=e.data[n].length,s=e.slice(r,r+o);return r+=o,new wb(s)})}var fe,wb,wu,q0=p(()=>{In();Dt();st();j0();fe=class extends ie{};wb=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;wu=new fe});function _o(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=>OW(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 Hn}))]);if(e instanceof Int16Array)return new $([te(Object.assign(Object.assign({},t),{type:new $n}))]);if(e instanceof Int32Array)return new $([te(Object.assign(Object.assign({},t),{type:new Xt}))]);if(e instanceof BigInt64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Kn}))]);if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new $([te(Object.assign(Object.assign({},t),{type:new Xn}))]);if(e instanceof Uint16Array)return new $([te(Object.assign(Object.assign({},t),{type:new Yn}))]);if(e instanceof Uint32Array)return new $([te(Object.assign(Object.assign({},t),{type:new tn}))]);if(e instanceof BigUint64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Gi}))]);if(e instanceof Float32Array)return new $([te(Object.assign(Object.assign({},t),{type:new rn}))]);if(e instanceof Float64Array)return new $([te(Object.assign(Object.assign({},t),{type:new Zn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function OW(e){return e instanceof ce?[e]:e instanceof $?e.data:_o(e).data}var T6,I6,P6,R6,$,V0,jr=p(()=>{Dt();gu();st();yi();j0();gc();ei();z0();q0();st();I6=Symbol.for("apache-arrow/Vector"),P6={},R6={},$=class e{static isVector(t){return(t==null?void 0:t[I6])===!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}=P6[s.typeId],u=o[0];this.isValid=h=>gh(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,R6[s.typeId]),this._offsets=F0(o);break}this.data=o,this.type=s,this.stride=Qn(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 E6(this.data)}get nullCount(){return N0(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(yc(t,this.length))}set(t,r){}indexOf(t,r){return-1}includes(t,r){return this.indexOf(t,r)>-1}[Symbol.iterator](){return wu.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(dh(this,t,r,({data:n,_offsets:i},o,s)=>G0(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 V0(this.data[0].dictionary),r=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new e(r)}return new V0(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}};T6=Symbol.toStringTag;$[T6]=(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[I6]=!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=tr.getVisitFnByTypeId(r),i=Rr.getVisitFnByTypeId(r),o=_c.getVisitFnByTypeId(r);P6[r]={get:n,set:i,indexOf:o},R6[r]=Object.create(e,{isValid:{value:bu(gh)},get:{value:bu(tr.getVisitFnByTypeId(r))},set:{value:k0(Rr.getVisitFnByTypeId(r))},indexOf:{value:U0(_c.getVisitFnByTypeId(r))}})}return"Vector"})($.prototype);Object.defineProperty($,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===$&&$.isVector(t)}});V0=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 L6(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,AN,TN,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,AN=e=>typeof e=="string"&&e.length>0,TN=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:AN,number:TN,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,AS)=>{"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};AS.exports={GLIBC:Oo,MUSL:Ja,family:SS,familySync:MS,isNonGlibcLinux:VN,isNonGlibcLinuxSync:WN,version:KN,versionSync:XN}});var xl=ae((CY,TS)=>{"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"];TS.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 As=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=As(),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=As(),_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=As(),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 AF=Mr(),TF=(e,t)=>new AF(e,t).minor;YS.exports=TF});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=As(),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 Ad=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=Ad(),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=As(),{safeRe:Td,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?Td[Id.COERCEFULL]:Td[Id.COERCE]);else{let c=t.includePrerelease?Td[Id.COERCERTLFULL]:Td[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=As(),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 AM=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(T7,"");let n=((this.options.includePrerelease&&E7)|(this.options.loose&&A7))+":"+t,i=TM.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 TM.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=AM(),TM=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:A7}=xl(),T7=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=Ad(),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=As(),x9=GS(),_9=jS(),S9=VS(),M9=$S(),v9=XS(),E9=ZS(),A9=QS(),T9=tM(),I9=fi(),P9=oM(),R9=aM(),L9=Md(),O9=fM(),C9=dM(),B9=df(),D9=vd(),N9=X1(),F9=Y1(),k9=Ed(),G9=Ad(),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:A9,prerelease:T9,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 A3,Od,_k,cr,T3,bk,E3,wk,xk,Bo,yt,Ts,it,bf=p(()=>{A3=require("node:module"),Od=me(yd(),1);dg();Rd();_k={};cr=(0,A3.createRequire)(_k.url),{version:T3}=Co,{runtimePlatformArch:bk,isUnsupportedNodeRuntime:E3,prebuiltPlatforms:wk,minimumLibvipsVersion:xk}=Ld,Bo=bk(),Ts=[];try{yt=cr(`../src/build/Release/sharp-${Bo}-${T3}.node`)}catch(e){Ts.push(e)}if(!yt)try{yt=cr(`../src/build/Release/sharp-wasm32-${T3}.node`)}catch(e){Ts.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",Ts.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){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=>Bo.startsWith(o)),n=[`Could not load the "sharp" module using the ${Bo} 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:"),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"),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
+ `))}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=Ak.filter(r=>f.defined(e[r])).map(r=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function Tk(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,Ak,L3,O3=p(()=>{Ji();bf();Ek={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},Ak=["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:Tk,_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 Al(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 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=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>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=Al(i),o=Al(o),s=Al(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=Al(4.0767416621*i-3.3077115913*o+.2309699292*s),c=Al(-1.2684380046*i+2.6097574011*o-.3413193965*s),l=Al(-.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(TG(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 AG(e,t){return Number(e.toFixed(t))}function TG(e){return function(t){return AG(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 AU(){return it.counters()}function TU(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=AU,e.simd=TU,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.5";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=Tj(e.root.keyword,(t==null?void 0:t.profile)||"auto"),n=Ej[r],i=Aj[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 Tj(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,Aj,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},Aj={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 AE(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,TE=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,T=h*w-m*y,W=d*w-m*b,k=_*W-S*T+M*O+v*I-C*j+R*E;return k?(k=1/k,e[0]=(a*W-c*T+l*O)*k,e[1]=(i*T-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*T-a*I+l*E)*k,e[9]=(n*I-r*T-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,T,W,k,A;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,T=s*o*u+i*l,W=i*s*u+o*l,k=o*s*u-i*l,A=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*T,e[5]=d*I+b*O+M*T,e[6]=m*I+w*O+v*T,e[7]=g*I+_*O+C*T,e[8]=h*W+y*k+S*A,e[9]=d*W+b*k+M*A,e[10]=m*W+w*k+v*A,e[11]=g*W+_*k+C*A,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 Az(){return xm||(xm=new yn,Object.freeze(xm)),xm}function S4(e){if(e>Math.PI*2)throw Error("expected radians")}function Tz(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 Az()}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?Tz(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 Ay(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 Ty(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 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-o*a,e[1]=i*c+s*a,e[2]=o*c+n*a,e[3]=s*c-i*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+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),Ay(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 Af,U4=p(()=>{_m();sm();ac();_m();Af=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 Ay(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 Ty(this,this,t),this.check()}multiplyLeft(t){return Ty(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 A4(this,this,t),this.check()}rotateZ(t){return T4(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),T=(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),A=(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(T)||!Number.isFinite(W)||!Number.isFinite(k)||!Number.isFinite(A)||!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(T))||!Number.isFinite(Math.fround(W))||!Number.isFinite(Math.fround(k))||!Number.isFinite(Math.fround(A))||!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]=T,o[6]=W,o[7]=0,o[8]=k,o[9]=A,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 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 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 T=Math.max(j,u-d);T>I&&T<O||(T=O/2);let W=-(R+E)/i,k=Math.sqrt(W*(u+d))/d,A=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&&A===void 0;B++){let N=d+T,D=u/N,L=r/T/i,P=L*c,z=i*T,we=R-z,ne=(we+(Sm(R,-z,we)+E-Ls(i,T,z)))/(i*N)*(D+1),Oe=ne+P*P;if(!Number.isFinite(Oe))return!1;Oe>0?I=T:O=T;let oe=-2*(D*D/N+P*P/T),Se=T-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*T){A=Math.atan2(L,D);break}T=Ce}return A!==void 0&&Rz(s,a,A,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();TE();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 T=m[O]*m[O];R=R*T+g[O]*g[O]*E,E*=T}if(R<0n)return!1;if(R===0n)return C(0n,1n);let I=m.filter(O=>O>0n).reduce((O,T)=>O<T?O:T);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,T=j*j,W=I*I,k=O*O,A=S[0]*W*k+S[1]*T*k+S[2]*T*W-T*W*k;if(A===0n)return C(E,b);if(A>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 A=m[k]*E+R;return A===0n?0:Gz(W*u[k+3]*E,A,l)});if(!j.every(Number.isFinite))return!1;let I=Math.sign(e)*j[0],O=Math.sign(t)*j[1],T=Math.sign(r)*j[2];return s.x=I,s.y=O,s.z=T,!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 T=I>0?I:O;for(let W=0;W<512;W++){let k=m+T,A=g+T,B=y+T,N=zo(m,T,k)+b,D=zo(g,T,A)+w,L=zo(y,T,B)+_,P=S/k,z=M/A,we=v/B,_e,ne;P>=z&&P>=we?(_e=Ny(S,C,m,b,T,k)*(P+1),ne=(z*(1-D/A))**2+(we*(1-L/B))**2):z>=we?(_e=Ny(M,R,g,w,T,A)*(z+1),ne=(P*(1-N/k))**2+(we*(1-L/B))**2):(_e=Ny(v,E,y,_,T,B)*(we+1),ne=(P*(1-N/k))**2+(z*(1-D/A))**2);let Oe=-2*(P*P/k+z*z/A+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*T){let je=oe/Math.abs(Oe);if(!Number.isFinite(Oe)||!(Math.abs(Oe)>0)||je>2e-13*T)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/A)),ht=Math.sign(r)*o*(we*(1-L/B)),pt=2*je*Math.max(Math.abs(Ke/k),Math.abs(ft/A),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=T:O=T;let Ce=T-Se/Oe,V=Ce>I&&Ce<O?Ce:I+(O-I)/2;if(V===T)return co(e,t,r,n,i,o,s);T=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,Am,zz,di,Tm,At,a8=p(()=>{Fn();Fn();J4();e8();o8();bn={x:0,y:0,z:0},Am=new J,zz=new J,di=new J,Tm=new J,At=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,Tm),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=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;Tm.set(i,o,s);let a=this.scaleToGeodeticSurface(Tm,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,Am);let n=Am;return Im(n.x,n.y,n.z,r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=jo(t,Tm),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,Am);let n=Am,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)}};At.WGS84=new At(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,T,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(A,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-(A?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 A?2*B*N*oe:N*(oe-Se)},C=function(A,B){var N,D=n.sq(A),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(A){var B=Math.floor(s/2),N=n.polyval(B,R,0,n.sq(A))/R[B+1];return(N+A)/(1-A)},E=[-1,6,-16,32,-9,64,-128,2048,9,-16,768,3,-5,512,-7,1280,-7,2048],e.C1f=function(A,B){var N=n.sq(A),D=A,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*=A},j=[205,-432,768,1536,4005,-4736,3840,12288,-225,116,384,-7173,2695,7680,3467,7680,38081,61440],e.C1pf=function(A,B){var N=n.sq(A),D=A,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*=A},I=[-11,-28,-192,0,256],e.A2m1f=function(A){var B=Math.floor(a/2),N=n.polyval(B,I,0,n.sq(A))/I[B+1];return(N-A)/(1+A)},O=[1,2,16,32,35,64,384,2048,15,80,768,7,35,512,63,1280,77,2048],e.C2f=function(A,B){var N=n.sq(A),D=A,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*=A},e.Geodesic=function(A,B){if(this.a=A,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()},T=[-3,128,-2,-3,64,-1,-3,-1,16,3,-1,-2,8,1,-1,2,1,1],e.Geodesic.prototype.A3coeff=function(){var A=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,T,A,this._n)/T[A+D+1],A+=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 A=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,A,this._n)/W[A+L+1],A+=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 A=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,A,this._n)/k[A+L+1],A+=L+2},e.Geodesic.prototype.A3f=function(A){return n.polyval(l-1,this._A3x,0,A)},e.Geodesic.prototype.C3f=function(A,B){var N=1,D=0,L,P;for(L=1;L<e.nC3_;++L)P=e.nC3_-L-1,N*=A,B[L]=N*n.polyval(P,this._C3x,D,A),D+=P+1},e.Geodesic.prototype.C4f=function(A,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,A),D+=P+1,N*=A},e.Geodesic.prototype.Lengths=function(A,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(A),e.C1f(A,oe),Oe&(e.REDUCEDLENGTH|e.GEODESICSCALE)&&(ft=e.A2m1f(A),e.C2f(A,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(A,B,N,D,L,P,z,we,_e,ne,Oe){var oe={},Se=D*B-L*A,Ce=L*B+D*A,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*A,je=Ce>=0&&Se<.5&&L*z<.5,je?(ft=n.sq(A+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*A*n.sq(ht)/(1+pt):V-L*A*n.sq(ht)/(1-pt),Jt=n.hypot(oe.salp1,oe.calp1),gr=A*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(A)*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*A,tf=Math.atan2(V,vs),Yr=this.Lengths(this._n,Math.PI+tf,A,-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*A*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(A,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 A===0&&we===0&&(we=-e.tiny_),Ke=z*B,ft=n.hypot(we,z*A),V.ssig1=A,ht=Ke*A,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)!==-A?Math.sqrt(n.sq(we*B)+(B<-A?(L-B)*(B+L):(A-D)*(A+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/A:(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(A,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(A,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(A,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,A1,T1,I1,q_,P1,ad,R1,cd,V_,af,W_,H_,cf,ld,lf,L1,O1,ud,fd,C1,B1;if(P.lat1=A=n.LatFix(A),P.lat2=N=n.LatFix(N),A=n.AngRound(A),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(A)<Math.abs(N)||isNaN(N)?-1:1,Oe<0&&(_e*=-1,[N,A]=[A,N]),oe=n.copysign(1,-A),A*=oe,N*=oe,ne=n.sincosd(A),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=A===-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&&(A1=Math.sin(sd),T1=Math.cos(sd),I1=We*T1+qe*A1,I1>0))){qe=qe*T1-We*A1,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(A,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,A,B,N,P),z.GenPosition(D,L,P)},e.Geodesic.prototype.Direct=function(A,B,N,D,L){return this.GenDirect(A,B,N,!1,D,L)},e.Geodesic.prototype.ArcDirect=function(A,B,N,D,L){return this.GenDirect(A,B,N,!0,D,L)},e.Geodesic.prototype.Line=function(A,B,N,D){return new t.GeodesicLine(this,A,B,N,D)},e.Geodesic.prototype.DirectLine=function(A,B,N,D,L){return this.GenDirectLine(A,B,N,!1,D,L)},e.Geodesic.prototype.ArcDirectLine=function(A,B,N,D,L){return this.GenDirectLine(A,B,N,!0,D,L)},e.Geodesic.prototype.GenDirectLine=function(A,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,A,B,N,P),z.GenSetDistance(D,L),z},e.Geodesic.prototype.InverseLine=function(A,B,N,D,L){var P,z,we;return L||(L=e.STANDARD|e.DISTANCE_IN),P=this.InverseInt(A,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,A,B,we,L,P.salp1,P.calp1),z.SetArc(P.vals.a12),z},e.Geodesic.prototype.Polygon=function(A){return new r.PolygonArea(this,A)},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,T,W,k,A,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,T=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),A=(this._A1m1-this._A2m1)*a+(h-k),o&e.REDUCEDLENGTH&&(s.m12=this._b*(T*(this._csig1*d)-this._dn1*(this._ssig1*m)-this._csig1*m*A)),o&e.GEODESICSCALE&&(B=this._k2*(d-this._ssig1)*(d+this._ssig1)/(this._dn1+T),s.M12=l+(B*d-m*A)*this._ssig1/this._dn1,s.M21=l-(B*this._ssig1-this._csig1*A)*d/T)),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 T=Math.max(Math.abs(u.x),Math.abs(u.y));I.set(-u.y/T,u.x/T,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:T}=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),T.copy(I).cross(O);let{down:k,west:A,south:B}=Wl;k.copy(I).scale(-1),A.copy(O).scale(-1),B.copy(T).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*Tt}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 Tt,Wt=p(()=>{Tt=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 A8(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 T8(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:A8(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*Tt}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 eA(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 tA(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 rA(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(rA(e.lat0,e.sinlat0,e.e))-F,e.cosX0=Math.cos(e.X0),e.sinX0=Math.sin(e.X0))}function nA(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(rA(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 iA(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 oA(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 sA=p(()=>{Df();Bt();Bf();Jl();Nf();Um();_t()});var e2,aA=p(()=>{qs();Vs();Gn();sA();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=oA(t),n=ks(t,fr("stere",r,nA,iA));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 cA(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 lA=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=cA(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";lA();Un=!1,kf=!0});var Sq,Mq,vq,uA,fA=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))]},uA={...vq,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Ql,zm=p(()=>{"use strict";Ql="5.0.0-beta.5"});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 hA(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 dA(e,t,r){let n=hA(e,r),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await Aq(o||n,t)}finally{o&&i.revokeObjectURL(o)}}async function Aq(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 mA=p(()=>{"use strict";qm()});async function gA(e,t,r){let n;eu(r)?n=await dA(e,t,r):n=r2(e,r);let i=t&&t.imagebitmap;return await bA(n,i)}async function yA(e,t){let r=t&&t.imagebitmap;return await bA(e,r)}async function bA(e,t=null){if((Tq(t)||!pA)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),pA=!1}return await createImageBitmap(e)}function Tq(e){if(!e)return!0;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}var pA,wA=p(()=>{"use strict";qm();mA();pA=!0});async function xA(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 _A=p(()=>{"use strict";Ws();t2()});async function n2(e,t,r){var i;t=t||{},vA(t);let n=!!((i=globalThis.loaders)!=null&&i.parseImageNode);if(!Zd||n)return await xA(e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(SA);return await gA(e,t,r==null?void 0:r.url)}async function MA(e,t,r){var i;t=t||{},vA(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(SA);return await yA(e,t)}function vA(e){var r;let t=(r=e.image)==null?void 0:r.type;if(t&&t!=="imagebitmap")throw new Error(Iq)}var Iq,SA,EA=p(()=>{"use strict";Ws();wA();qm();_A();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.",SA="@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 AA={};Qt(AA,{ImageLoaderWithParser:()=>Rq});var qoe,Pq,Rq,TA=p(()=>{"use strict";EA();i2();({preload:qoe,...Pq}=Ho),Rq={...Pq,parse:n2,parseBlob:MA}});async function Oq(){let{ImageLoaderWithParser:e}=await Promise.resolve().then(()=>(TA(),AA));return e}var Lq,Ho,i2=p(()=>{"use strict";zm();fA();Lq={image:{}};Ho={dataType:null,batchType:null,...uA,version:Ql,options:Lq,preload:Oq}});function PA(e){let t=Nq(e);if(!t)throw new Error("Not an image");return t}function Vm(e){switch(PA(e)){case"data":return e;case"imagebitmap":return Cq(e)?Bq(e):IA(e);case"image":return IA(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 IA(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 RA=p(()=>{"use strict"});var LA,OA,o2=p(()=>{"use strict";LA={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]},OA={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 BA(e){if(!Wm){e=e||kq()||void 0,Wm=new Set;for(let t of Fq)for(let r in CA)if(e&&e.getExtension(`${t}${r}`))for(let n of CA[r])Wm.add(n)}return Wm}function kq(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Fq,CA,Wm,DA=p(()=>{"use strict";Fq=["","WEBKIT_","MOZ_"],CA={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 FA(e=BA(),t,r={}){let n=new Set(e);if(!t)return Uq(n);if(t.isHDR){let i=NA(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=NA(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":kA(e)?{alpha:"bc3",noAlpha:"bc1"}:GA(e)?"etc2":e.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:UA(e)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:jA(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(kA(e))return t.hasAlpha?"bc3":"bc1";break;case"etc2":if(GA(e))return"etc2";break;case"etc1":if(!t.hasAlpha&&e.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(UA(e))return t.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(jA(e))return t.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return t.hasAlpha?"rgba32":"rgb565"}function NA(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 kA(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 GA(e){return tu(e,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function UA(e){return tu(e,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function jA(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,zA=p(()=>{"use strict";DA();Gq=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function WA(e){Bg(e.modules);let t=Dg("basis");return t||(VA||=jq(e),await VA)}async function jq(e){let t=null,r=null;return[t,r]=await Promise.all([await Nl(qA.TRANSCODER,"images",e,null,"basis_transcoder.mjs"),await Nl(qA.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 qA,VA,HA=p(()=>{"use strict";Ws();sc();qA={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 bT[e]}function wT(e){if(e!==void 0)return sV[e]}var bT,sV,x2=p(()=>{"use strict";bT={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(bT).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||wT(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 xT(e){return Xm(uV(e))}var lV,_T=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 MT(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=xT(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,ST,"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*ST,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,ST,fV,Zm=p(()=>{"use strict";Ym();_T();_2=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10]),S2=80,ST=24,fV=0});async function mV(e){let t=vT,r;vT=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 WA(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=TT(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(AT(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=TT(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(AT(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 AT(e,t,r,n,i,o,s){let a=bV(i,t);yV(t,A2(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 ${A2(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=A2(e,t),n=ET[r];if(!n)throw new Error(`Unknown Basis format ${r}`);return n}function A2(e,t){var n,i,o;let r=((n=e.basis)==null?void 0:n.format)||"auto";return r==="auto"&&(r=FA((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 TT(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 Ar(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{...Ar(e,t,`astc-${n}-unorm`),srgbFormat:r,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var _n,ET,Ese,vT,wV,T2=p(()=>{"use strict";sc();zA();HA();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")},ET={etc1:Ar(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...Ar(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...Ar(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...Ar(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:Ar(4,36283,"bc4-r-unorm"),bc5:Ar(5,36285,"bc5-rg-unorm"),bc7:{...Ar(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":Ar(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":Ar(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":Ar(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":Ar(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":Ar(20,37488,"eac-r11unorm"),"eac-rg11":Ar(21,37490,"eac-rg11unorm"),bc6h:Ar(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":Ar(23,37808,"astc-4x4-unorm"),rgba16f:{...nu(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...nu(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":Ar(27,37812,"astc-6x6-unorm")},Ese=Object.freeze(Object.keys(ET)),vT=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 IT={};Qt(IT,{BasisLoaderWithParser:()=>vV,BasisWorkerLoaderWithParser:()=>MV});var Rse,_V,Lse,SV,MV,vV,PT=p(()=>{"use strict";T2();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(()=>(PT(),IT));return e}var ho,Qm=p(()=>{"use strict";o2();zm();ho={...LA,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 RT(e){return new Uint32Array(e,0,jn.HEADER_LENGTH)[jn.MAGIC_NUMBER_INDEX]===jn.MAGIC_NUMBER}function LT(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=AV[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 OT(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,AV,TV,IV,PV,RV,CT=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},AV={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"},TV=OT,IV=ep,PV=ep,RV={DXT1:OT,DXT3:ep,DXT5:ep,"ATC ":TV,ATCA:IV,ATCI:PV}});function NT(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 FT(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 BT(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function DT(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,kT=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:BT,1:BT,2:DT,3:DT,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 MT(e);if(RT(e))return LT(e);if(NT(e))return FT(e);throw new Error("Texture container format not recognized")}var GT=p(()=>{"use strict";Zm();CT();kT()});var UT={};Qt(UT,{CompressedTextureLoaderWithParser:()=>YV,CompressedTextureWorkerLoaderWithParser:()=>XV});var Xse,$V,Yse,KV,XV,YV,jT=p(()=>{"use strict";GT();T2();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(()=>(jT(),UT));return e}var $o,tp=p(()=>{"use strict";o2();zm();$o={...OA,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();RA();Qm();tp()});var zT=p(()=>{"use strict"});function VT(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 qT(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 qT=="function"?qT(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 Tr=p(()=>{});var WT,ou,JV,qn,Ko=p(()=>{WT=new TextDecoder("utf-8"),ou=WT.decode.bind(WT),JV=new TextEncoder,qn=e=>JV.encode(e)});var QV,HT,hr,tn,Vn,Wn,Mn,rp,np,ip,op,sp,$T,Vf,KT,ap,XT,Xo=p(()=>{QV=e=>typeof e=="number",HT=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,$T=e=>tn(e)&&hr(e.abort)&&hr(e.getWriter)&&!sp(e),Vf=e=>tn(e)&&hr(e.cancel)&&hr(e.getReader)&&!sp(e),KT=e=>tn(e)&&hr(e.end)&&hr(e.write)&&HT(e.writable)&&!sp(e),ap=e=>tn(e)&&hr(e.read)&&hr(e.pipe)&&HT(e.readable)&&!sp(e),XT=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):XT(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(()=>{Tr();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 AW(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 TW(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(()=>{Tr();dr();mr={fromIterable(e){return lp(EW(e))},fromAsyncIterable(e){return lp(AW(e))},fromDOMStream(e){return lp(TW(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 YT;(function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"})(YT||(hp.Encoding=YT={}))});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 JT=ae(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.Builder=void 0;var ZT=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=ZT.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=ZT.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=JT();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 QT,Yo,$2=p(()=>{QT=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()+QT.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 AI,th,TI=p(()=>{AI=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()+AI.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,An,Ee,zi,kr,on,qi,Gr,Tn,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});An=class extends U{constructor(){super(x.Binary)}toString(){return"Binary"}};KI=Symbol.toStringTag;An[KI]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]="Binary"))(An.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);Tn=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;Tn[t6]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]="Decimal"))(Tn.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,Ap,Tp,_b,Ip,Pp,Rp,Lp,Sb,Mb,v6,qW,VW,WW,HW,$W,KW,XW,E6,A6,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)},Ap=({values:e},t,r)=>{e[t]=BigInt(r*1e3)},Tp=({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 Ap(e,t,r);case q.NANOSECOND:return Tp(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):A6(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)},A6=(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(Ap);he.prototype.visitTimestampNanosecond=be(Tp);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(A6);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,Ab,Tb,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 Ab(this[Vi],this[gu])}},Ab=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}});Tb=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 Tb});function ge(e){return(t,r)=>t.getValid(r)?e(t,r):null}var ce,QW,yu,eH,tH,T6,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,T6=(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)=>T6(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=T6(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:()=>AH,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 AH(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 TH,r5,de,Cb,IH,wi=p(()=>{zr();Nt();at();vc();at();Pn();dr();TH=-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<=TH&&(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 ${BW(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 BW(e){return typeof e!="bigint"?Ni(e):`${Ni(e)}n`}var O6=p(()=>{nh()});function xb(e,t){let r=Math.ceil(e)*t-1;return(r-r%64+64||64)/t}function B6(e,t=0){return e.length>=t?e.subarray(0,t):zf(new e.constructor(t),e,0)}var Pn,ts,xu,da,qi=p(()=>{fr();Pn=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?xb(n*1,this.BYTES_PER_ELEMENT):xb(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=xb(t*this.stride,this.BYTES_PER_ELEMENT);let r=B6(this.buffer,t);return this.clear(),r}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=B6(this.buffer,t)}},ts=class extends Pn{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}},xu=class extends ts{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()}},da=class extends ts{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 at,rr,zr,yt=p(()=>{jr();yi();hh();st();O6();qi();at=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=Qn(t),this._nulls=new xu,r&&r.length>0&&(this._isValid=L6(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}};at.prototype.length=1;at.prototype.stride=1;at.prototype.children=null;at.prototype.finished=!1;at.prototype.nullValues=null;at.prototype._isValid=()=>!0;rr=class extends at{constructor(t){super(t),this._values=new ts(this.ArrayType,0,this.stride)}setValue(t,r){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,r)}},zr=class extends at{constructor(t){super(t),this._pendingLength=0,this._offsets=new da(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 gi?r[fa].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 Sc,_b=p(()=>{Sc=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 C6,ti,D6=p(()=>{C6=pe(ze(),1);_b();su();n0();X2();ti=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()+C6.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):nt.V1}schema(t){let r=this.bb.__offset(this.bb_pos,6);return r?(t||new vn).__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 Sc).__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 Sc).__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 Ct).__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,nt.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 W0(e,t){return new Map([...e||new Map,...t||new Map])}function Sb(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&&Sb(o.children,t)}return t}var N6,F6,ve,ee,qr=p(()=>{Dt();st();N6=Symbol.for("apache-arrow/Schema"),F6=Symbol.for("apache-arrow/Field"),ve=class e{static isSchema(t){return(t==null?void 0:t[N6])===!0}constructor(t=[],r,n,i=nt.V5){this.fields=t||[],this.metadata=r||new Map,n||(n=Sb(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=W0(W0(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:W0(W0(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),s=Sb(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[N6]=!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[F6])===!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[F6]=!0;Object.defineProperty(ee,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===ee&&ee.isField(t)}})});var H0,CW,DW,rs,Mb,Vi,vb=p(()=>{_b();D6();H0=pe(ze(),1);qr();Dt();fr();yo();CW=H0.Builder,DW=H0.ByteBuffer,rs=class{static decode(t){t=new DW(se(t));let r=ti.getRootAsFooter(t),n=ve.decode(r.schema(),new Map,r.version());return new Mb(n,r)}static encode(t){let r=new CW,n=ve.encode(r,t.schema);ti.startRecordBatchesVector(r,t.numRecordBatches);for(let s of[...t.recordBatches()].slice().reverse())Vi.encode(r,s);let i=r.endVector();ti.startDictionariesVector(r,t.numDictionaries);for(let s of[...t.dictionaryBatches()].slice().reverse())Vi.encode(r,s);let o=r.endVector();return ti.startFooter(r),ti.addSchema(r,n),ti.addVersion(r,nt.V5),ti.addRecordBatches(r,i),ti.addDictionaries(r,o),ti.finishFooterBuffer(r,ti.endFooter(r)),r.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,r=nt.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}},Mb=class extends rs{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 Vi.decode(r)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let r=this._footer.dictionaries(t);if(r)return Vi.decode(r)}return null}},Vi=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 Sc.createBlock(t,i,n,o)}constructor(t,r,n){this.metaDataLength=t,this.offset=Le(n),this.bodyLength=Le(r)}}});var G6,ri,k6=p(()=>{G6=pe(ze(),1);su();h0();n0();ri=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()+G6.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):nt.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 Ct).__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,nt.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 Eb,$0,U6=p(()=>{In();JT();u0();z2();RT();OT();qT();CT();oI();aI();$T();G2();F2();W2();H2();q2();k2();XT();WT();eI();$2();N2();U2();j2();V2();Eb=class extends ie{visit(t,r){return t==null||r==null?void 0:super.visit(t,r)}visitNull(t,r){return Qf.startNull(r),Qf.endNull(r)}visitInt(t,r){return Ci.startInt(r),Ci.addBitWidth(r,t.bitWidth),Ci.addIsSigned(r,t.isSigned),Ci.endInt(r)}visitFloat(t,r){return Xs.startFloatingPoint(r),Xs.addPrecision(r,t.precision),Xs.endFloatingPoint(r)}visitBinary(t,r){return Hf.startBinary(r),Hf.endBinary(r)}visitBinaryView(t,r){return $f.startBinaryView(r),$f.endBinaryView(r)}visitLargeBinary(t,r){return Xf.startLargeBinary(r),Xf.endLargeBinary(r)}visitBool(t,r){return Kf.startBool(r),Kf.endBool(r)}visitUtf8(t,r){return th.startUtf8(r),th.endUtf8(r)}visitUtf8View(t,r){return rh.startUtf8View(r),rh.endUtf8View(r)}visitLargeUtf8(t,r){return Zf.startLargeUtf8(r),Zf.endLargeUtf8(r)}visitDecimal(t,r){return go.startDecimal(r),go.addScale(r,t.scale),go.addPrecision(r,t.precision),go.addBitWidth(r,t.bitWidth),go.endDecimal(r)}visitDate(t,r){return Ws.startDate(r),Ws.addUnit(r,t.unit),Ws.endDate(r)}visitTime(t,r){return Zo.startTime(r),Zo.addUnit(r,t.unit),Zo.addBitWidth(r,t.bitWidth),Zo.endTime(r)}visitTimestamp(t,r){let n=t.timezone&&r.createString(t.timezone)||void 0;return Jo.startTimestamp(r),Jo.addUnit(r,t.unit),n!==void 0&&Jo.addTimezone(r,n),Jo.endTimestamp(r)}visitInterval(t,r){return Ys.startInterval(r),Ys.addUnit(r,t.unit),Ys.endInterval(r)}visitDuration(t,r){return Hs.startDuration(r),Hs.addUnit(r,t.unit),Hs.endDuration(r)}visitList(t,r){return Jf.startList(r),Jf.endList(r)}visitLargeList(t,r){return Yf.startLargeList(r),Yf.endLargeList(r)}visitStruct(t,r){return eh.startStruct_(r),eh.endStruct_(r)}visitUnion(t,r){Di.startTypeIdsVector(r,t.typeIds.length);let n=Di.createTypeIdsVector(r,t.typeIds);return Di.startUnion(r),Di.addMode(r,t.mode),Di.addTypeIds(r,n),Di.endUnion(r)}visitDictionary(t,r){let n=this.visit(t.indices,r);return po.startDictionaryEncoding(r),po.addId(r,BigInt(t.id)),po.addIsOrdered(r,t.isOrdered),n!==void 0&&po.addIndexType(r,n),po.endDictionaryEncoding(r)}visitFixedSizeBinary(t,r){return $s.startFixedSizeBinary(r),$s.addByteWidth(r,t.byteWidth),$s.endFixedSizeBinary(r)}visitFixedSizeList(t,r){return Ks.startFixedSizeList(r),Ks.addListSize(r,t.listSize),Ks.endFixedSizeList(r)}visitMap(t,r){return Zs.startMap(r),Zs.addKeysSorted(r,t.keysSorted),Zs.endMap(r)}},$0=new Eb});function V6(e,t=new Map){return new ve(NW(e,t),K0(e.metadata),t)}function Ab(e){return new nr(e.count,H6(e.columns),$6(e.columns),null,K6(e.columns))}function W6(e){return new Vr(Ab(e.data),e.id,e.isDelta)}function NW(e,t){return(e.fields||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function j6(e,t){return(e.children||[]).filter(Boolean).map(r=>ee.fromJSON(r,t))}function H6(e){return(e||[]).reduce((t,r)=>[...t,new bi(r.count,FW(r.VALIDITY)),...H6(r.children)],[])}function $6(e,t=[]){for(let r=-1,n=(e||[]).length;++r<n;){let i=e[r];if(i.VALIDITY&&t.push(new Ht(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new Ht(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new Ht(t.length,i.OFFSET.length)),i.DATA&&t.push(new Ht(t.length,i.DATA.length)),i.VIEWS&&t.push(new Ht(t.length,i.VIEWS.length)),i.VARIADIC_DATA_BUFFERS)for(let o of i.VARIADIC_DATA_BUFFERS)t.push(new Ht(t.length,o.length));t=$6(i.children,t)}return t}function FW(e){return(e||[]).reduce((t,r)=>t+ +(r===0),0)}function K6(e){return(e||[]).reduce((t,r)=>[...t,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...K6(r.children)],[])}function X6(e,t){let r,n,i,o,s,a;return!t||!(o=e.dictionary)?(s=q6(e,j6(e,t)),i=new ee(e.name,s,e.nullable,K0(e.metadata))):t.has(r=o.id)?(n=(n=o.indexType)?z6(n):new Xt,a=new er(t.get(r),n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,K0(e.metadata))):(n=(n=o.indexType)?z6(n):new Xt,t.set(r,s=q6(e,j6(e,t))),a=new er(s,n,r,o.isOrdered),i=new ee(e.name,a,e.nullable,K0(e.metadata))),i||null}function K0(e=[]){return new Map(e.map(({key:t,value:r})=>[t,r]))}function z6(e){return new It(e.isSigned,e.bitWidth)}function q6(e,t){let r=e.type.name;switch(r){case"NONE":return new Vt;case"null":return new Vt;case"binary":return new En;case"largebinary":return new Ui;case"binaryview":return new Ee;case"utf8":return new Fr;case"largeutf8":return new ji;case"utf8view":return new nn;case"bool":return new Gr;case"list":return new Qt((t||[])[0]);case"largelist":return new Jn((t||[])[0]);case"struct":return new et(t||[]);case"struct_":return new et(t||[])}switch(r){case"int":{let n=e.type;return new It(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=e.type;return new Nr(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 on(ot[n.unit])}case"time":{let n=e.type;return new Ir(q[n.unit],n.bitWidth)}case"timestamp":{let n=e.type;return new Pr(q[n.unit],n.timezone)}case"interval":{let n=e.type;return new kr(ke[n.unit])}case"duration":{let n=e.type;return new sn(q[n.unit])}case"union":{let n=e.type,[i,...o]=(n.mode+"").toLowerCase(),s=i.toUpperCase()+o.join("");return new an(Ze[s],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=e.type;return new Tn(n.byteWidth)}case"fixedsizelist":{let n=e.type;return new Wt(n.listSize,(t||[])[0])}case"map":{let n=e.type;return new Ur((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${r}"`)}var Y6=p(()=>{qr();st();ma();Dt()});function UW(e,t){return(()=>{switch(t){case Ge.Schema:return ve.fromJSON(e);case Ge.RecordBatch:return nr.fromJSON(e);case Ge.DictionaryBatch:return Vr.fromJSON(e)}throw new Error(`Unrecognized Message type: { name: ${Ge[t]}, type: ${t} }`)})}function jW(e,t){return(()=>{switch(t){case Ge.Schema:return ve.decode(e.header(new vn),new Map,e.version());case Ge.RecordBatch:return nr.decode(e.header(new Cr),e.version());case Ge.DictionaryBatch:return Vr.decode(e.header(new Yo),e.version())}throw new Error(`Unrecognized Message type: { name: ${Ge[t]}, type: ${t} }`)})}function zW(e,t=new Map,r=nt.V5){let n=YW(e,t);return new ve(n,X0(e),t,r)}function qW(e,t=nt.V5){return new nr(e.length(),$W(e),KW(e,t),e5(e.compression()),XW(e))}function VW(e,t=nt.V5){return new Vr(nr.decode(e.data(),t),e.id(),e.isDelta())}function WW(e){return new Ht(e.offset(),e.length())}function HW(e){return new bi(e.length(),e.nullCount())}function $W(e){let t=[];for(let r,n=-1,i=-1,o=e.nodesLength();++n<o;)(r=e.nodes(n))&&(t[++i]=bi.decode(r));return t}function KW(e,t){let r=[];for(let n,i=-1,o=-1,s=e.buffersLength();++i<s;)(n=e.buffers(i))&&(t<nt.V4&&(n.bb_pos+=8*(i+1)),r[++o]=Ht.decode(n));return r}function XW(e){let t=[],r=Math.trunc(e.variadicBufferCountsLength());for(let n=0;n<r;++n)t.push(Le(e.variadicBufferCounts(n)));return t}function YW(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 Z6(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 ZW(e,t){let r,n,i,o,s,a;return!t||!(a=e.dictionary())?(i=Q6(e,Z6(e,t)),n=new ee(e.name(),i,e.nullable(),X0(e))):t.has(r=Le(a.id()))?(o=(o=a.indexType())?J6(o):new Xt,s=new er(t.get(r),o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),X0(e))):(o=(o=a.indexType())?J6(o):new Xt,t.set(r,i=Q6(e,Z6(e,t))),s=new er(i,o,r,a.isOrdered()),n=new ee(e.name(),s,e.nullable(),X0(e))),n||null}function X0(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 JW(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 J6(e){return new It(e.isSigned(),e.bitWidth())}function Q6(e,t){let r=e.typeType();switch(r){case me.NONE:return new Vt;case me.Null:return new Vt;case me.Binary:return new En;case me.LargeBinary:return new Ui;case me.BinaryView:return new Ee;case me.Utf8:return new Fr;case me.LargeUtf8:return new ji;case me.Utf8View:return new nn;case me.Bool:return new Gr;case me.List:return new Qt((t||[])[0]);case me.LargeList:return new Jn((t||[])[0]);case me.Struct_:return new et(t||[])}switch(r){case me.Int:{let n=e.type(new Ci);return new It(n.isSigned(),n.bitWidth())}case me.FloatingPoint:{let n=e.type(new Xs);return new Nr(n.precision())}case me.Decimal:{let n=e.type(new go);return new An(n.scale(),n.precision(),n.bitWidth())}case me.Date:{let n=e.type(new Ws);return new on(n.unit())}case me.Time:{let n=e.type(new Zo);return new Ir(n.unit(),n.bitWidth())}case me.Timestamp:{let n=e.type(new Jo);return new Pr(n.unit(),n.timezone())}case me.Interval:{let n=e.type(new Ys);return new kr(n.unit())}case me.Duration:{let n=e.type(new Hs);return new sn(n.unit())}case me.Union:{let n=e.type(new Di);return new an(n.mode(),n.typeIdsArray()||[],t||[])}case me.FixedSizeBinary:{let n=e.type(new $s);return new Tn(n.byteWidth())}case me.FixedSizeList:{let n=e.type(new Ks);return new Wt(n.listSize(),(t||[])[0])}case me.Map:{let n=e.type(new Zs);return new Ur((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${me[r]}" (${r})`)}function e5(e){return e?new Mc(e.codec(),e.method()):null}function QW(e,t){let r=t.fields.map(o=>ee.encode(e,o));vn.startFieldsVector(e,r.length);let n=vn.createFieldsVector(e,r),i=t.metadata&&t.metadata.size>0?vn.createCustomMetadataVector(e,[...t.metadata].map(([o,s])=>{let a=e.createString(`${o}`),c=e.createString(`${s}`);return Ct.startKeyValue(e),Ct.addKey(e,a),Ct.addValue(e,c),Ct.endKeyValue(e)})):-1;return vn.startSchema(e),vn.addFields(e,n),vn.addEndianness(e,oH?Vs.Little:Vs.Big),i!==-1&&vn.addCustomMetadata(e,i),vn.endSchema(e)}function eH(e,t){let r=-1,n=-1,i=-1,o=t.type,s=t.typeId;z.isDictionary(o)?(s=o.dictionary.typeId,i=$0.visit(o,e),n=$0.visit(o.dictionary,e)):n=$0.visit(o,e);let a=(o.children||[]).map(u=>ee.encode(e,u)),c=Dr.createChildrenVector(e,a),l=t.metadata&&t.metadata.size>0?Dr.createCustomMetadataVector(e,[...t.metadata].map(([u,h])=>{let d=e.createString(`${u}`),m=e.createString(`${h}`);return Ct.startKeyValue(e),Ct.addKey(e,d),Ct.addValue(e,m),Ct.endKeyValue(e)})):-1;return t.name&&(r=e.createString(t.name)),Dr.startField(e),Dr.addType(e,n),Dr.addTypeType(e,s),Dr.addChildren(e,c),Dr.addNullable(e,!!t.nullable),r!==-1&&Dr.addName(e,r),i!==-1&&Dr.addDictionary(e,i),l!==-1&&Dr.addCustomMetadata(e,l),Dr.endField(e)}function tH(e,t){let r=t.nodes||[],n=t.buffers||[],i=t.variadicBufferCounts||[];Cr.startNodesVector(e,r.length);for(let l of r.slice().reverse())bi.encode(e,l);let o=e.endVector();Cr.startBuffersVector(e,n.length);for(let l of n.slice().reverse())Ht.encode(e,l);let s=e.endVector(),a=null;t.compression!==null&&(a=t5(e,t.compression));let c=-1;return i.length>0&&(c=Cr.createVariadicBufferCountsVector(e,i.map(BigInt))),Cr.startRecordBatch(e),Cr.addLength(e,BigInt(t.length)),Cr.addNodes(e,o),Cr.addBuffers(e,s),t.compression!==null&&a&&Cr.addCompression(e,a),c!==-1&&Cr.addVariadicBufferCounts(e,c),Cr.endRecordBatch(e)}function t5(e,t){return Xo.startBodyCompression(e),Xo.addCodec(e,t.type),Xo.addMethod(e,t.method),Xo.endBodyCompression(e)}function rH(e,t){let r=nr.encode(e,t.data);return Yo.startDictionaryBatch(e),Yo.addId(e,BigInt(t.id)),Yo.addIsDelta(e,t.isDelta),Yo.addData(e,r),Yo.endDictionaryBatch(e)}function nH(e,t){return ou.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function iH(e,t){return iu.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var Y0,GW,kW,Wr,nr,Vr,Ht,bi,Mc,oH,ma=p(()=>{Y0=pe(ze(),1);X2();u0();C2();vT();O2();K2();B2();f0();su();D2();z2();G2();F2();W2();H2();q2();k2();$2();U2();j2();V2();k6();L2();R2();qr();fr();yo();Dt();U6();Y6();st();GW=Y0.Builder,kW=Y0.ByteBuffer,Wr=class e{static fromJSON(t,r){let n=new e(0,nt.V5,r);return n._createHeader=UW(t,r),n}static decode(t){t=new kW(se(t));let r=ri.getRootAsMessage(t),n=r.bodyLength(),i=r.version(),o=r.headerType(),s=JW(r),a=new e(n,i,o,void 0,s);return a._createHeader=jW(r,o),a}static encode(t){let r=new GW,n=-1;t.isSchema()?n=ve.encode(r,t.header()):t.isRecordBatch()?n=nr.encode(r,t.header()):t.isDictionaryBatch()&&(n=Vr.encode(r,t.header()));let i=t.metadata&&t.metadata.size>0?ri.createCustomMetadataVector(r,[...t.metadata].map(([o,s])=>{let a=r.createString(`${o}`),c=r.createString(`${s}`);return Ct.startKeyValue(r),Ct.addKey(r,a),Ct.addValue(r,c),Ct.endKeyValue(r)})):-1;return ri.startMessage(r),ri.addVersion(r,nt.V5),ri.addHeader(r,n),ri.addHeaderType(r,t.headerType),ri.addBodyLength(r,BigInt(t.bodyLength)),i!==-1&&ri.addCustomMetadata(r,i),ri.finishMessageBuffer(r,ri.endMessage(r)),r.asUint8Array()}static from(t,r=0){if(t instanceof ve)return new e(0,nt.V5,Ge.Schema,t);if(t instanceof nr)return new e(r,nt.V5,Ge.RecordBatch,t,t.metadata);if(t instanceof Vr)return new e(r,nt.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}},nr=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}},Vr=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)}},Ht=class{constructor(t,r){this.offset=Le(t),this.length=Le(r)}},bi=class{constructor(t,r){this.length=Le(t),this.nullCount=Le(r)}},Mc=class{constructor(t,r=mc.BUFFER){this.type=t,this.method=r}};ee.encode=eH;ee.decode=ZW;ee.fromJSON=X6;ve.encode=QW;ve.decode=zW;ve.fromJSON=V6;nr.encode=tH;nr.decode=qW;nr.fromJSON=Ab;Vr.encode=rH;Vr.decode=VW;Vr.fromJSON=W6;bi.encode=nH;bi.decode=HW;Ht.encode=iH;Ht.decode=WW;Mc.encode=t5;Mc.decode=e5;oH=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})()});var _t,yh,vc,Z0,bh=p(()=>{Ar();ru();_t=Object.freeze({done:!0,value:void 0}),yh=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},vc=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())}},Z0=class extends vc{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(_t);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return hr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return hr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return H(this,void 0,void 0,function*(){return yield this.abort(t),_t})}return(t){return H(this,void 0,void 0,function*(){return yield this.close(),_t})}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(_t)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var Rn,wi,Hr,Tb,ns,So=p(()=>{Ar();ru();$o();bh();fr();Ko();Rn=class extends Z0{write(t){if((t=se(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?tu(this.toUint8Array(!0)):this.toUint8Array(!1).then(tu)}toUint8Array(t=!1){return t?Vn(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=Un(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 Vn(s,a)[0]})}},wi=class{constructor(t){t&&(this.source=new Tb(hr.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)}},Hr=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Rn?this.source=new ns(hr.fromAsyncIterable(t)):e0(t)?this.source=new ns(hr.fromNodeStream(t)):jf(t)?this.source=new ns(hr.fromDOMStream(t)):Jm(t)?this.source=new ns(hr.fromDOMStream(t.body)):qn(t)?this.source=new ns(hr.fromIterable(t)):zn(t)?this.source=new ns(hr.fromAsyncIterable(t)):Sn(t)&&(this.source=new ns(hr.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)}},Tb=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)||_t)}return(t){return Object.create(this.source.return&&this.source.return(t)||_t)}},ns=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))||_t;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))||_t;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(r)})}}});var wh,pa,Ib=p(()=>{Ar();So();fr();wh=class extends wi{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}}},pa=class extends Hr{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 Rb={};ir(Rb,{BaseInt64:()=>xh,Int128:()=>_h,Int64:()=>is,Uint64:()=>Nt});function _u(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var Su,Pb,xh,Nt,is,_h,Lb=p(()=>{Su=8,Pb=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],xh=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`${_u(this.buffer[1])} ${_u(this.buffer[0])}`}},Nt=class e extends xh{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=Su<n-o?Su:n-o,a=new e(new Uint32Array([Number.parseInt(t.slice(o,o+s),10),0])),c=new e(new Uint32Array([Pb[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)}},is=class e extends xh{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=Su<i-s?Su:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0])),l=new e(new Uint32Array([Pb[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)}},_h=class e{constructor(t){this.buffer=t}high(){return new is(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new is(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 Nt(new Uint32Array([this.buffer[3],0])),n=new Nt(new Uint32Array([this.buffer[2],0])),i=new Nt(new Uint32Array([this.buffer[1],0])),o=new Nt(new Uint32Array([this.buffer[0],0])),s=new Nt(new Uint32Array([t.buffer[3],0])),a=new Nt(new Uint32Array([t.buffer[2],0])),c=new Nt(new Uint32Array([t.buffer[1],0])),l=new Nt(new Uint32Array([t.buffer[0],0])),u=Nt.multiply(o,l);this.buffer[0]=u.low();let h=new Nt(new Uint32Array([u.high(),0]));return u=Nt.multiply(i,l),h.plus(u),u=Nt.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 Nt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Nt.multiply(n,l)).plus(Nt.multiply(i,c)).plus(Nt.multiply(o,a)),this.buffer[3]+=Nt.multiply(r,l).plus(Nt.multiply(n,c)).plus(Nt.multiply(i,a)).plus(Nt.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`${_u(this.buffer[3])} ${_u(this.buffer[2])} ${_u(this.buffer[1])} ${_u(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=Su<i-s?Su:i-s,c=new e(new Uint32Array([Number.parseInt(t.slice(s,s+a),10),0,0,0])),l=new e(new Uint32Array([Pb[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 Nb={};ir(Nb,{toIntervalDayTimeInt32Array:()=>Ob,toIntervalDayTimeObjects:()=>Cb,toIntervalMonthDayNanoInt32Array:()=>Bb,toIntervalMonthDayNanoObjects:()=>Db});function Ob(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 Bb(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 Cb(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 Db(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 J0=p(()=>{});function n5(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 sH(e){return n5(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 aH(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 cH(e){return i5(e,t=>new TextEncoder().encode(t))}var Mu,Q0,ep,o5=p(()=>{yi();qr();st();In();xc();$o();Lb();Dt();fr();J0();Mu=class extends ie{constructor(t,r,n,i,o=nt.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<nt.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)}},Q0=class extends Mu{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):wc(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,is.convertArray(n[r]));if((z.isInt(t)||z.isTime(t))&&t.bitWidth===64||z.isDuration(t))return Re(Uint8Array,is.convertArray(n[r]));if(z.isDate(t)&&t.unit===ot.MILLISECOND)return Re(Uint8Array,is.convertArray(n[r]));if(z.isDecimal(t))return Re(Uint8Array,_h.convertArray(n[r]));if(z.isBinary(t)||z.isLargeBinary(t)||z.isFixedSizeBinary(t))return sH(n[r]);if(z.isBinaryView(t))return aH(n[r]);if(z.isUtf8View(t))return cH(n[r]);if(z.isBool(t))return wc(n[r]);if(z.isUtf8(t)||z.isLargeUtf8(t))return jn(n[r].join(""));if(z.isInterval(t))switch(t.unit){case ke.DAY_TIME:return Ob(n[r]);case ke.MONTH_DAY_NANO:return Bb(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(n5(o))}return r}};ep=class extends Mu{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 os,tp=p(()=>{qi();yt();fr();os=class extends zr{constructor(t){super(t),this._values=new Pn(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 ss,rp=p(()=>{fr();qi();yt();ss=class extends zr{constructor(t){super(t),this._values=new Pn(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 Ec,Fb=p(()=>{qi();yt();Ec=class extends at{constructor(t){super(t),this._values=new xu}setValue(t,r){this._values.set(t,+r)}}});var Mo,ga,ya,Gb=p(()=>{yt();ei();Mo=class extends rr{};Mo.prototype._setValue=ib;ga=class extends Mo{};ga.prototype._setValue=p0;ya=class extends Mo{};ya.prototype._setValue=g0});var ba,kb=p(()=>{yt();ei();ba=class extends rr{};ba.prototype._setValue=ab});var Ac,Ub=p(()=>{st();yt();vu();Ac=class extends at{constructor({type:t,nullValues:r,dictionaryHashFunction:n}){super({type:new er(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=ni({type:this.type.indices,nullValues:r}),this.dictionary=ni({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 wa,jb=p(()=>{yt();ei();wa=class extends rr{};wa.prototype._setValue=nb});var Tc,zb=p(()=>{qr();yt();st();Tc=class extends at{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 Wt(this.type.listSize,new ee(r,t.type,!0)),n}}});var vo,Ic,Pc,Rc,qb=p(()=>{fh();yt();vo=class extends rr{setValue(t,r){this._values.set(t,r)}},Ic=class extends vo{setValue(t,r){super.setValue(t,uh(r))}},Pc=class extends vo{},Rc=class extends vo{}});var Wi,xa,_a,Sa,Vb=p(()=>{yt();ei();Wi=class extends rr{};Wi.prototype._setValue=cb;xa=class extends Wi{};xa.prototype._setValue=E0;_a=class extends Wi{};_a.prototype._setValue=A0;Sa=class extends Wi{};Sa.prototype._setValue=T0});var xi,Ma,va,Ea,Aa,Wb=p(()=>{yt();ei();xi=class extends rr{};xi.prototype._setValue=lb;Ma=class extends xi{};Ma.prototype._setValue=I0;va=class extends xi{};va.prototype._setValue=P0;Ea=class extends xi{};Ea.prototype._setValue=R0;Aa=class extends xi{};Aa.prototype._setValue=L0});var cn,Lc,Oc,Bc,Cc,Dc,Nc,Fc,Gc,Hb=p(()=>{yt();cn=class extends rr{setValue(t,r){this._values.set(t,r)}},Lc=class extends cn{},Oc=class extends cn{},Bc=class extends cn{},Cc=class extends cn{},Dc=class extends cn{},Nc=class extends cn{},Fc=class extends cn{},Gc=class extends cn{}});var kc,$b=p(()=>{qr();st();qi();yt();kc=class extends zr{constructor(t){super(t),this._offsets=new da(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 Qt(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 Uc,Kb=p(()=>{qr();st();qi();yo();yt();Uc=class extends zr{constructor(t){super(t),this._offsets=new da(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 Jn(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 jc,Xb=p(()=>{qr();st();yt();jc=class extends zr{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 Ur(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 zc,Yb=p(()=>{yt();zc=class extends at{setValue(t,r){}setValid(t,r){return this.length=Math.max(t+1,this.length),r}}});var qc,Zb=p(()=>{qr();yt();st();qc=class extends at{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 et([...this.type.children,new ee(r,t.type,!0)]),n}}});var _i,Ta,Ia,Pa,Ra,Jb=p(()=>{yt();ei();_i=class extends rr{};_i.prototype._setValue=ob;Ta=class extends _i{};Ta.prototype._setValue=y0;Ia=class extends _i{};Ia.prototype._setValue=b0;Pa=class extends _i{};Pa.prototype._setValue=w0;Ra=class extends _i{};Ra.prototype._setValue=x0});var Si,La,Oa,Ba,Ca,Qb=p(()=>{yt();ei();Si=class extends rr{};Si.prototype._setValue=sb;La=class extends Si{};La.prototype._setValue=_0;Oa=class extends Si{};Oa.prototype._setValue=S0;Ba=class extends Si{};Ba.prototype._setValue=M0;Ca=class extends Si{};Ca.prototype._setValue=v0});var as,Vc,Wc,ew=p(()=>{qr();qi();yt();st();as=class extends at{constructor(t){super(t),this._typeIds=new ts(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 an(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.")}},Vc=class extends as{},Wc=class extends as{constructor(t){super(t),this._offsets=new ts(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 Da,tw=p(()=>{$o();tp();qi();yt();Da=class extends zr{constructor(t){super(t),this._values=new Pn(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,jn(r))}_flushPending(t,r){}};Da.prototype._flushPending=os.prototype._flushPending});var Na,rw=p(()=>{$o();qi();yt();rp();Na=class extends zr{constructor(t){super(t),this._values=new Pn(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,jn(r))}_flushPending(t,r){}};Na.prototype._flushPending=ss.prototype._flushPending});var cs,np=p(()=>{st();yt();qi();fr();yi();cs=class extends at{constructor(t){super(t),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new Pn(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 Pn(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 Hc,nw=p(()=>{np();$o();Hc=class extends cs{constructor(t){super(t)}setValue(t,r){return this.writeBinaryValue(t,jn(r))}}});var iw,s5,a5=p(()=>{In();tp();rp();Fb();Gb();kb();Ub();jb();zb();qb();Vb();Wb();Hb();$b();Kb();Xb();Yb();Zb();Jb();Qb();ew();tw();rw();np();nw();iw=class extends ie{visitNull(){return zc}visitBool(){return Ec}visitInt(){return cn}visitInt8(){return Lc}visitInt16(){return Oc}visitInt32(){return Bc}visitInt64(){return Cc}visitUint8(){return Dc}visitUint16(){return Nc}visitUint32(){return Fc}visitUint64(){return Gc}visitFloat(){return vo}visitFloat16(){return Ic}visitFloat32(){return Pc}visitFloat64(){return Rc}visitUtf8(){return Da}visitLargeUtf8(){return Na}visitBinary(){return os}visitLargeBinary(){return ss}visitFixedSizeBinary(){return wa}visitDate(){return Mo}visitDateDay(){return ga}visitDateMillisecond(){return ya}visitTimestamp(){return _i}visitTimestampSecond(){return Ta}visitTimestampMillisecond(){return Ia}visitTimestampMicrosecond(){return Pa}visitTimestampNanosecond(){return Ra}visitTime(){return Si}visitTimeSecond(){return La}visitTimeMillisecond(){return Oa}visitTimeMicrosecond(){return Ba}visitTimeNanosecond(){return Ca}visitDecimal(){return ba}visitList(){return kc}visitLargeList(){return Uc}visitStruct(){return qc}visitUnion(){return as}visitDenseUnion(){return Wc}visitSparseUnion(){return Vc}visitDictionary(){return Ac}visitInterval(){return Wi}visitIntervalDayTime(){return xa}visitIntervalYearMonth(){return _a}visitIntervalMonthDayNano(){return Sa}visitDuration(){return xi}visitDurationSecond(){return Ma}visitDurationMillisecond(){return va}visitDurationMicrosecond(){return Ea}visitDurationNanosecond(){return Aa}visitFixedSizeList(){return Tc}visitMap(){return jc}visitBinaryView(){return cs}visitUtf8View(){return Hc}},s5=new iw});function ln(e,t){return t instanceof e.constructor}function ls(e,t){return e===t||ln(e,t)}function us(e,t){return e===t||ln(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function ip(e,t){return e===t||ln(e,t)&&e.precision===t.precision}function lH(e,t){return e===t||ln(e,t)&&e.byteWidth===t.byteWidth}function ow(e,t){return e===t||ln(e,t)&&e.unit===t.unit}function Sh(e,t){return e===t||ln(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Mh(e,t){return e===t||ln(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function c5(e,t){return e===t||ln(e,t)&&e.children.length===t.children.length&&Eo.compareManyFields(e.children,t.children)}function uH(e,t){return e===t||ln(e,t)&&e.children.length===t.children.length&&Eo.compareManyFields(e.children,t.children)}function sw(e,t){return e===t||ln(e,t)&&e.mode===t.mode&&e.typeIds.every((r,n)=>r===t.typeIds[n])&&Eo.compareManyFields(e.children,t.children)}function fH(e,t){return e===t||ln(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Eo.visit(e.indices,t.indices)&&Eo.visit(e.dictionary,t.dictionary)}function op(e,t){return e===t||ln(e,t)&&e.unit===t.unit}function vh(e,t){return e===t||ln(e,t)&&e.unit===t.unit}function hH(e,t){return e===t||ln(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Eo.compareManyFields(e.children,t.children)}function dH(e,t){return e===t||ln(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Eo.compareManyFields(e.children,t.children)}function $c(e,t){return Eo.compareSchemas(e,t)}function l5(e,t){return Eo.compareFields(e,t)}function sp(e,t){return Eo.visit(e,t)}var he,Eo,Eh=p(()=>{In();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=ls;he.prototype.visitBool=ls;he.prototype.visitInt=us;he.prototype.visitInt8=us;he.prototype.visitInt16=us;he.prototype.visitInt32=us;he.prototype.visitInt64=us;he.prototype.visitUint8=us;he.prototype.visitUint16=us;he.prototype.visitUint32=us;he.prototype.visitUint64=us;he.prototype.visitFloat=ip;he.prototype.visitFloat16=ip;he.prototype.visitFloat32=ip;he.prototype.visitFloat64=ip;he.prototype.visitUtf8=ls;he.prototype.visitLargeUtf8=ls;he.prototype.visitUtf8View=ls;he.prototype.visitBinary=ls;he.prototype.visitLargeBinary=ls;he.prototype.visitBinaryView=ls;he.prototype.visitFixedSizeBinary=lH;he.prototype.visitDate=ow;he.prototype.visitDateDay=ow;he.prototype.visitDateMillisecond=ow;he.prototype.visitTimestamp=Sh;he.prototype.visitTimestampSecond=Sh;he.prototype.visitTimestampMillisecond=Sh;he.prototype.visitTimestampMicrosecond=Sh;he.prototype.visitTimestampNanosecond=Sh;he.prototype.visitTime=Mh;he.prototype.visitTimeSecond=Mh;he.prototype.visitTimeMillisecond=Mh;he.prototype.visitTimeMicrosecond=Mh;he.prototype.visitTimeNanosecond=Mh;he.prototype.visitDecimal=ls;he.prototype.visitList=c5;he.prototype.visitLargeList=c5;he.prototype.visitStruct=uH;he.prototype.visitUnion=sw;he.prototype.visitDenseUnion=sw;he.prototype.visitSparseUnion=sw;he.prototype.visitDictionary=fH;he.prototype.visitInterval=op;he.prototype.visitIntervalDayTime=op;he.prototype.visitIntervalYearMonth=op;he.prototype.visitIntervalMonthDayNano=op;he.prototype.visitDuration=vh;he.prototype.visitDurationSecond=vh;he.prototype.visitDurationMillisecond=vh;he.prototype.visitDurationMicrosecond=vh;he.prototype.visitDurationNanosecond=vh;he.prototype.visitFixedSizeList=hH;he.prototype.visitMap=dH;Eo=new he});function ni(e){let t=e.type,r=new(s5.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(ni(Object.assign(Object.assign({},l),{type:c})))}}return r}function Eu(e,t){if(e instanceof ce||e instanceof $||e.type instanceof z||ArrayBuffer.isView(e))return _o(e);let r={type:t??ap(e),nullValues:[null]},n=[...cp(r)(e)],i=n.length===1?n[0]:n.reduce((o,s)=>o.concat(s));return z.isDictionary(i.type)?i.memoize():i}function aw(e){let t=Eu(e),r=new $e(new ve(t.type.children),t.data[0]);return new it(r)}function ap(e){if(e.length===0)return new Vt;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 Zn;if(o+t===e.length)return new er(new Fr,new Xt);if(s+t===e.length)return new Kn;if(a+t===e.length)return new Gr;if(c+t===e.length)return new bo;if(r+t===e.length){let l=e,u=ap(l[l.findIndex(h=>h!=null)]);if(l.every(h=>h==null||sp(u,ap(h))))return new Qt(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,ap([u[h]]),!0));return new et([...l.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function cp(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=ni(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 cw(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 Qr(this,arguments,function*(){var o,s,a,c;let l=0,u=ni(e);try{for(var h=!0,d=Un(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 vu=p(()=>{Ar();qr();st();yi();jr();a5();Kc();fs();Eh()});function lp(e,t){return mH(e,t.map(r=>r.data.concat()))}function mH(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=pH(r,s,u,t,i),s>0&&(n[o++]=te({type:new et(r),length:s,nullCount:0,children:u.slice()})))}return[e=e.assign(r),n.map(h=>new $e(e,h))]}function pH(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 u5=p(()=>{yi();st();fs()});function lw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=_o(i);return new it(t)}function uw(e){let t={},r=Object.entries(e);for(let[n,i]of r)t[n]=Eu(i);return new it(t)}var f5,h5,it,Kc=p(()=>{Dt();yi();vu();jr();qr();st();Eh();u5();j0();gc();ei();z0();q0();gu();fs();h5=Symbol.for("apache-arrow/Table"),it=class e{static isTable(t){return(t==null?void 0:t[h5])===!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 et)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]=lp(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(!$c(i,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=o??F0(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=N0(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(yc(t,this.numRows))}set(t,r){}indexOf(t,r){return-1}[Symbol.iterator](){return this.batches.length>0?wu.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 Ac,Fb=p(()=>{Ac=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 Ac).__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 Ac).__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 Ac.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();TI();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,A5(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 A5(e){return(e||[]).reduce((t,r)=>[...t,...r.VARIADIC_DATA_BUFFERS?[r.VARIADIC_DATA_BUFFERS.length]:[],...A5(r.children)],[])}function T5(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 An;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 Tn(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 An;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 Tn(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 Tc(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,Tc,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)}},Tc=class{constructor(t,r=bc.BUFFER){this.type=t,this.method=r}};ee.encode=QH;ee.decode=YH;ee.fromJSON=T5;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;Tc.encode=C5;Tc.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(()=>{Tr();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(()=>{Tr();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(()=>{Tr();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 Au,Wb,Mh,Ft,os,vh,$b=p(()=>{Au=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=Au<n-o?Au: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=Au<i-s?Au: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=Au<i-s?Au: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 Tu,s0,a0,F5=p(()=>{wi();Vr();at();Pn();vc();Ko();$b();Nt();dr();o0();Tu=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 Tu{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 Tu{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 Ao,Oc,Cc,Bc,ow=p(()=>{mh();bt();Ao=class extends or{setValue(t,r){this._values.set(t,r)}},Oc=class extends Ao{setValue(t,r){super.setValue(t,dh(r))}},Cc=class extends Ao{},Bc=class extends Ao{}});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,Aa,Ta,Ia,Pa,aw=p(()=>{bt();ri();Si=class extends or{};Si.prototype._setValue=Eb;Aa=class extends Si{};Aa.prototype._setValue=Dp;Ta=class extends Si{};Ta.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=Ap;Ca=class extends Mi{};Ca.prototype._setValue=Tp});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 Ao}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 Aa}visitDurationMillisecond(){return Ta}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 Ah(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&&To.compareManyFields(e.children,t.children)}function l$(e,t){return e===t||un(e,t)&&e.children.length===t.children.length&&To.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])&&To.compareManyFields(e.children,t.children)}function u$(e,t){return e===t||un(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&To.visit(e.indices,t.indices)&&To.visit(e.dictionary,t.dictionary)}function h0(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 f$(e,t){return e===t||un(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&To.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&&To.compareManyFields(e.children,t.children)}function Zc(e,t){return To.compareSchemas(e,t)}function j5(e,t){return To.compareFields(e,t)}function d0(e,t){return To.visit(e,t)}var fe,To,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=Ah;fe.prototype.visitTimeSecond=Ah;fe.prototype.visitTimeMillisecond=Ah;fe.prototype.visitTimeMicrosecond=Ah;fe.prototype.visitTimeNanosecond=Ah;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=Th;fe.prototype.visitDurationSecond=Th;fe.prototype.visitDurationMillisecond=Th;fe.prototype.visitDurationMicrosecond=Th;fe.prototype.visitDurationNanosecond=Th;fe.prototype.visitFixedSizeList=f$;fe.prototype.visitMap=h$;To=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(()=>{Tr();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 Aw(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]=dh({length:this.numRows},t,r);let i=G0(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 Vt,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]=lp(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(...lp(o,s))}};f5=Symbol.toStringTag;it[f5]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[h5]=!0,e.isValid=bu(gh),e.get=bu(tr.getVisitFn(x.Struct)),e.set=k0(Rr.getVisitFn(x.Struct)),e.indexOf=U0(_c.getVisitFn(x.Struct)),"Table"))(it.prototype);Object.defineProperty(it,Symbol.hasInstance,{value:function(t){return Function.prototype[Symbol.hasInstance].call(this,t)||this===it&&it.isTable(t)}})});function d5(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 et(i),length:r,children:o})]}function g5(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)||[]])g5(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 m5,p5,$e,Xc,fs=p(()=>{yi();Kc();jr();qr();st();gu();gc();ei();z0();q0();p5=Symbol.for("apache-arrow/RecordBatch"),$e=class e{static isRecordBatch(t){return(t==null?void 0:t[p5])===!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 et(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]=d5(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 et(n),length:o,children:i,nullCount:0});[this.schema,this.data]=d5(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=g5(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 tr.visit(this.data,t)}at(t){return this.get(yc(t,this.numRows))}set(t,r){return Rr.visit(this.data,t,r)}indexOf(t,r){return _c.visit(this.data,t,r)}[Symbol.iterator](){return wu.visit(new $([this.data]))}toArray(){return[...this]}concat(...t){return new it(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 Vt,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 et(o),length:i.length,children:s})}return new e(n,i,this._metadata)}select(t){let r=this.schema.select(t),n=new et(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 et(r.fields),length:this.numRows,children:n});return new e(r,i,this._metadata)}};m5=Symbol.toStringTag;$e[m5]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e[p5]=!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)}});Xc=class extends $e{constructor(t,r){let n=t.fields.map(o=>te({type:o.type})),i=te({type:new et(t.fields),length:0,nullCount:0,children:n});super(t,i,r||new Map)}}});function fp(e,t=0){for(let r=-1,n=Au.length;++r<n;)if(Au[r]!==e[t+r])return!1;return!0}var hw,dw,mw,y5,b5,Fa,Yc,Zc,up,fw,Au,Tu,pw,w5,hp=p(()=>{Ar();Dt();hw=pe(ze(),1);ma();Ko();Ib();fr();So();bh();dw=e=>`Expected ${Ge[e]} Message in stream, but was null or length 0.`,mw=e=>`Header pointer of flatbuffer-encoded ${Ge[e]} Message is null or length 0.`,y5=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,b5=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,Fa=class{constructor(t){this.source=t instanceof wi?t:new wi(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?_t:t.value===-1&&(t=this.readMetadataLength()).done?_t:(t=this.readMetadata(t.value)).done?_t: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(dw(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(b5(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(mw(r));return i}readMetadataLength(){let t=this.source.read(up),r=t&&new hw.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 _t;if(r.byteLength<t)throw new Error(y5(t,r.byteLength));return{done:!1,value:Wr.decode(r)}}},Yc=class{constructor(t,r){this.source=t instanceof Hr?t:Zm(t)?new pa(t,r):new Hr(t)}[Symbol.asyncIterator](){return this}next(){return H(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?_t:t.value===-1&&(t=yield this.readMetadataLength()).done?_t:(t=yield this.readMetadata(t.value)).done?_t: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(dw(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(b5(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(mw(r));return i})}readMetadataLength(){return H(this,void 0,void 0,function*(){let t=yield this.source.read(up),r=t&&new hw.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 _t;if(r.byteLength<t)throw new Error(y5(t,r.byteLength));return{done:!1,value:Wr.decode(r)}})}},Zc=class extends Fa{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof yh?t:new yh(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Wr.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:Wr.fromJSON(r,Ge.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let r=t.batches[this._batchIndex++];return this._body=r.columns,{done:!1,value:Wr.fromJSON(r,Ge.RecordBatch)}}return this._body=[],_t}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(dw(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(mw(t));return n}},up=4,fw="ARROW1",Au=new Uint8Array(fw.length);for(let e=0;e<fw.length;e+=1)Au[e]=fw.codePointAt(e);Tu=Au.length,pw=Tu+up,w5=Tu*2+up});var gw,yw,x5,_5=p(()=>{nu();gw=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}},yw=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)}},x5={[Tr.LZ4_FRAME]:new gw,[Tr.ZSTD]:new yw}});var bw,Ga,dp=p(()=>{nu();_5();bw=class{constructor(){this.registry={}}set(t,r){if(r!=null&&r.encode&&typeof r.encode=="function"&&!x5[t].isValidCodecEncode(r))throw new Error(`Encoder for ${Tr[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}},Ga=new bw});function A5(e,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:e.autoDestroy}function*S5(e){let t=dr.from(e);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function M5(e){return Qr(this,arguments,function*(){let r=yield Me(dr.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 Hi(new xw(e))}function bH(e){let t=e.peek(Tu+7&-8);return t&&t.byteLength>=4?fp(t)?new ds(new pp(e.read())):new Hi(new Pu(e)):new Hi(new Pu((function*(){})()))}function wH(e){return H(this,void 0,void 0,function*(){let t=yield e.peek(Tu+7&-8);return t&&t.byteLength>=4?fp(t)?new ds(new pp(yield e.read())):new hs(new Ru(e)):new hs(new Ru((function(){return Qr(this,arguments,function*(){})})()))})}function xH(e){return H(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),r=new pa(e,t);return t>=w5&&fp(yield r.readAt(0,Tu+7&-8))?new Iu(new ww(r)):new hs(new Ru(r))})}var E5,dr,Hi,hs,ds,Iu,mp,Pu,Ru,pp,ww,xw,Jc=p(()=>{Ar();yi();jr();st();Dt();vb();ru();ma();So();Ib();o5();fs();bh();hp();Ko();dp();yo();E5=pe(ze(),1),dr=class e extends vc{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 zn(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 hr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return hr.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:Xm(t)?yH(t):Zm(t)?xH(t):zn(t)?H(this,void 0,void 0,function*(){return yield e.from(yield t)}):Jm(t)||jf(t)||e0(t)||Sn(t)?wH(new Hr(t)):bH(new wi(t))}static readAll(t){return t instanceof e?t.isSync()?S5(t):M5(t):Xm(t)||ArrayBuffer.isView(t)||qn(t)||Ym(t)?S5(t):M5(t)}},Hi=class extends dr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Qr(this,arguments,function*(){yield Me(yield*eu(Un(this[Symbol.iterator]())))})}},hs=class extends dr{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=Un(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]()}},ds=class extends Hi{constructor(t){super(t),this._impl=t}},Iu=class extends hs{constructor(t){super(t),this._impl=t}},mp=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=Ga.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 nr(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 et(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=Ga.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 Vr(new nr(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 Mu(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(t,r,n){return new ep(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 Ht(s,0));continue}let l=new E5.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 Ht(s,d.length)),s+=d.length}return{decommpressedBody:i,buffers:o}}},Pu=class extends mp{constructor(t,r){super(r),this._reader=Xm(t)?new Zc(this._handle=t):new Fa(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=A5(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):_t}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):_t}next(){if(this.closed)return _t;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 Xc(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Ru=class extends mp{constructor(t,r){super(r),this._reader=new Yc(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=A5(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):_t})}return(t){return H(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):_t})}next(){return H(this,void 0,void 0,function*(){if(this.closed)return _t;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 Xc(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return H(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},pp=class extends Pu{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 wh?t:new wh(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-pw,n=t.readInt32(r),i=t.readAt(r-n,n);return rs.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}},ww=class extends Ru{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 pa?t:new pa(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-pw,n=yield t.readInt32(r),i=yield t.readAt(r-n,n);return rs.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})}},xw=class extends Pu{constructor(t,r){super(t,r)}_loadVectors(t,r,n){return new Q0(r,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion,t.variadicBufferCounts).visitMany(n)}}});function ii(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new Ht(this._byteLength,t)),this._byteLength+=t,this}function _H(e){var t;let{type:r,length:n,typeIds:i,valueOffsets:o}=e;if(ii.call(this,i),r.mode===Ze.Sparse)return _w.call(this,e);if(r.mode===Ze.Dense){if(e.offset<=0)return ii.call(this,o),_w.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);ii.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 SH(e){let t;return e.nullCount>=e.length?ii.call(this,new Uint8Array(e.length+7>>3)):(t=e.values)instanceof Uint8Array?ii.call(this,bc(e.offset,e.length,t)):ii.call(this,wc(e.values))}function ms(e){return ii.call(this,e.values.subarray(0,e.length*e.stride))}function gp(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 ii.call(this,t0(-i,t+1,n)),ii.call(this,r.subarray(i,i+s)),this}function T5(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;ii.call(this,i.subarray(s,a));for(let c of o)ii.call(this,c);return this._variadicBufferCounts.push(o.length),this}function yp(e){let{length:t,valueOffsets:r}=e;if(r){let n=Le(r[0]),i=Le(r[t]);return ii.call(this,t0(-n,t+1,r)),this.visit(e.children[0].slice(n,i-n))}return this.visit(e.children[0])}function _w(e){return this.visitMany(e.type.children.map((t,r)=>e.children[r]).filter(Boolean))[0]}var St,I5=p(()=>{jr();In();Dt();fs();fr();xc();ma();st();yo();St=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 bi(n,0));else{let{nullCount:i}=t;z.isNull(r)||ii.call(this,i<=0?new Uint8Array(0):bc(t.offset,n,t.nullBitmap)),this.nodes.push(new bi(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}};St.prototype.visitBool=SH;St.prototype.visitInt=ms;St.prototype.visitFloat=ms;St.prototype.visitUtf8=gp;St.prototype.visitLargeUtf8=gp;St.prototype.visitUtf8View=T5;St.prototype.visitBinary=gp;St.prototype.visitLargeBinary=gp;St.prototype.visitBinaryView=T5;St.prototype.visitFixedSizeBinary=ms;St.prototype.visitDate=ms;St.prototype.visitTimestamp=ms;St.prototype.visitTime=ms;St.prototype.visitDecimal=ms;St.prototype.visitList=yp;St.prototype.visitLargeList=yp;St.prototype.visitStruct=_w;St.prototype.visitUnion=_H;St.prototype.visitInterval=ms;St.prototype.visitDuration=ms;St.prototype.visitFixedSizeList=yp;St.prototype.visitMap=yp});var bp,P5=p(()=>{In();f0();Dt();bp=class extends ie{visit(t){return t==null?void 0:super.visit(t)}visitNull({typeId:t}){return{name:me[t].toLowerCase()}}visitInt({typeId:t,bitWidth:r,isSigned:n}){return{name:me[t].toLowerCase(),bitWidth:r,isSigned:n}}visitFloat({typeId:t,precision:r}){return{name:me[t].toLowerCase(),precision:He[r]}}visitBinary({typeId:t}){return{name:me[t].toLowerCase()}}visitLargeBinary({typeId:t}){return{name:me[t].toLowerCase()}}visitBinaryView({typeId:t}){return{name:me[t].toLowerCase()}}visitBool({typeId:t}){return{name:me[t].toLowerCase()}}visitUtf8({typeId:t}){return{name:me[t].toLowerCase()}}visitLargeUtf8({typeId:t}){return{name:me[t].toLowerCase()}}visitUtf8View({typeId:t}){return{name:me[t].toLowerCase()}}visitDecimal({typeId:t,scale:r,precision:n,bitWidth:i}){return{name:me[t].toLowerCase(),scale:r,precision:n,bitWidth:i}}visitDate({typeId:t,unit:r}){return{name:me[t].toLowerCase(),unit:ot[r]}}visitTime({typeId:t,unit:r,bitWidth:n}){return{name:me[t].toLowerCase(),unit:q[r],bitWidth:n}}visitTimestamp({typeId:t,timezone:r,unit:n}){return{name:me[t].toLowerCase(),unit:q[n],timezone:r}}visitInterval({typeId:t,unit:r}){return{name:me[t].toLowerCase(),unit:ke[r]}}visitDuration({typeId:t,unit:r}){return{name:me[t].toLocaleLowerCase(),unit:q[r]}}visitList({typeId:t}){return{name:me[t].toLowerCase()}}visitLargeList({typeId:t}){return{name:me[t].toLowerCase()}}visitStruct({typeId:t}){return{name:me[t].toLowerCase()}}visitUnion({typeId:t,mode:r,typeIds:n}){return{name:me[t].toLowerCase(),mode:Ze[r].toUpperCase(),typeIds:[...n]}}visitDictionary(t){return this.visit(t.dictionary)}visitFixedSizeBinary({typeId:t,byteWidth:r}){return{name:me[t].toLowerCase(),byteWidth:r}}visitFixedSizeList({typeId:t,listSize:r}){return{name:me[t].toLowerCase(),listSize:r}}visitMap({typeId:t,keysSorted:r}){return{name:me[t].toLowerCase(),keysSorted:r}}}});function*Sw(e){for(let t of e)yield t.reduce((r,n)=>`${r}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*ps(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`${pc.new(r.subarray((n+0)*t,(n+1)*t),!1)}`}function R5(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 Ah,L5=p(()=>{d0();jr();In();Dt();Dt();xc();J0();st();Ah=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 xo(s,i,n,null,D0)]},super.visit(r.clone(a,i,n,0,c)))}visitNull(){return{}}visitBool({values:t,offset:r,length:n}){return{DATA:[...new xo(t,r,n,null,yu)]}}visitInt(t){return{DATA:t.type.bitWidth<64?[...t.values]:[...ps(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:[...ps(t.valueOffsets,2)]}}visitBinary(t){return{DATA:[...Sw(new $([t]))],OFFSET:[...t.valueOffsets]}}visitLargeBinary(t){return{DATA:[...Sw(new $([t]))],OFFSET:[...ps(t.valueOffsets,2)]}}visitBinaryView(t){return R5(t,r=>Array.from(r).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(t){return R5(t,r=>Array.from(r).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(t){return{DATA:[...Sw(new $([t]))]}}visitDate(t){return{DATA:t.type.unit===ot.DAY?[...t.values]:[...ps(t.values,2)]}}visitTimestamp(t){return{DATA:[...ps(t.values,2)]}}visitTime(t){return{DATA:t.type.unit<q.MICROSECOND?[...t.values]:[...ps(t.values,2)]}}visitDecimal(t){return{DATA:[...ps(t.values,4)]}}visitList(t){return{OFFSET:[...t.valueOffsets],children:this.visitMany(t.type.children,t.children)}}visitLargeList(t){return{OFFSET:[...ps(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:Cb(t.values)};case ke.MONTH_DAY_NANO:return{DATA:Db(t.values,!0)}}}visitDuration(t){return{DATA:[...ps(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 Mw(e,t){let r=t;t instanceof it&&(r=t.batches,e.reset(void 0,t.schema));for(let n of r)e.write(n);return e.finish()}function vw(e,t){return H(this,void 0,void 0,function*(){var r,n,i,o,s,a,c;try{for(r=!0,n=Un(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 B5({name:e,type:t,nullable:r}){let n=new bp;return{name:e,nullable:r,type:n.visit(t),children:(t.children||[]).map(i=>B5(i)),dictionary:z.isDictionary(t)?{id:t.id,isOrdered:t.isOrdered,indexType:n.visit(t.indices)}:void 0}}function MH(e,t,r=!1){let[n]=Ah.assemble(new $e({[t]:e}));return JSON.stringify({id:t,isDelta:r,data:{count:e.length,columns:n}},null,2)}function vH(e){let[t]=Ah.assemble(e);return JSON.stringify({count:e.numRows,columns:t},null,2)}var O5,Mi,gs,ys,Th,Ih=p(()=>{Ar();Kc();hp();jr();st();ma();ma();vb();Dt();Eh();So();I5();P5();L5();fr();fs();bh();Ko();nu();dp();O5=pe(ze(),1),Mi=class extends vc{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 Rn,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,en(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(Tr).includes(t.compressionType))this._compression=new Mc(t.compressionType);else{let r=Object.values(Tr).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 zn(t)?t.then(r=>this.writeAll(r)):Sn(t)?vw(this,t):Mw(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 Rn?this._sink=t:(this._sink=new Rn,t&&pT(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&gT(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||!$c(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 it&&!(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&&!$c(r,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,r)}t instanceof $e?t instanceof Xc||this._writeRecordBatch(t):t instanceof it?this.writeAll(t.batches):qn(t)&&this.writeAll(t)}_writeMessage(t,r=8){let n=r-1,i=Wr.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 Vi(a,t.bodyLength,this._position)):t.headerType===Ge.DictionaryBatch&&this._dictionaryBlocks.push(new Vi(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(Wr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Au)}_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 nr(t.numRows,n,i,this._compression,s,t.metadata),c=Wr.from(a,r);return this._writeDictionaries(t)._writeMessage(c)._writeBodyBuffers(o)}_assembleRecordBatch(t){let{byteLength:r,nodes:n,bufferRegions:i,buffers:o,variadicBufferCounts:s}=St.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=Ga.get(this._compression.type);if(!(r!=null&&r.encode)||typeof r.encode!="function")throw new Error(`Codec for compression type "${Tr[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 Ht(n,0));continue}let l=r.encode(c),u=l.length<c.length,h=u?l:c,d=u?h.length:-1,m=new O5.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 Ht(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 nr(t.length,o,s,this._compression,c),u=new Vr(l,r,n),h=Wr.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}},gs=class e extends Mi{static writeAll(t,r){let n=new e(r);return zn(t)?t.then(i=>n.writeAll(i)):Sn(t)?vw(n,t):Mw(n,t)}},ys=class e extends Mi{static writeAll(t,r){let n=new e(r);return zn(t)?t.then(i=>n.writeAll(i)):Sn(t)?vw(n,t):Mw(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=rs.encode(new rs(t,nt.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(r)._write(Int32Array.of(r.byteLength))._writeMagic()}},Th=class e extends Mi{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=>B5(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(MH(t,r,n)),this._dictionaryBlocks.push(new Vi(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,Tw,Ru,Lu,Lw,Z5,w0=p(()=>{Tr();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,Tw="ARROW1",Ru=new Uint8Array(Tw.length);for(let e=0;e<Tw.length;e+=1)Ru[e]=Tw.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(()=>{Tr();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 Tu(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(()=>{Tr();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 Tc(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&&$T(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&KT(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(vH(this._recordBatches[t])),this._recordBatchBlocks.push(new Vi(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 C5(e,t){if(Sn(e))return new Aw(e[Symbol.asyncIterator](),t);if(qn(e))return new Ew(e[Symbol.iterator](),t);throw new Error("toNodeStream() must be called with an Iterable or AsyncIterable")}var Tw,Ew,Aw,D5=p(()=>{Ar();Tw=require("node:stream");Ko();Ew=class extends Tw.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}},Aw=class extends Tw.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 F5(e){return new Iw(ni(e),e)}var N5,Iw,EH,AH,G5=p(()=>{N5=require("node:stream");vu();Iw=class extends N5.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"?EH:AH}_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}},EH=e=>e.length,AH=e=>e.byteLength});function U5(e){return new Pw(e)}var k5,Pw,j5=p(()=>{Ar();k5=require("node:stream");So();Jc();Pw=class extends k5.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 Rn,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 dr.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 q5(e){return new Rw(new this(e))}var z5,Rw,V5=p(()=>{Ar();z5=require("node:stream");So();Rw=class extends z5.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 Hr(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 W5(e,t){if(Sn(e))return IH(e,t);if(qn(e))return TH(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function TH(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 IH(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 H5=p(()=>{Ar();fr();Ko()});function X5(e){return new Lw(e)}var Lw,$5,K5,Y5=p(()=>{Ar();vu();Lw=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,o=hT(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=ni(o),this._getSize=i!=="bytes"?$5:K5;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"?$5:K5}),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)}},$5=e=>{var t;return(t=e==null?void 0:e.length)!==null&&t!==void 0?t:0},K5=e=>{var t;return(t=e==null?void 0:e.byteLength)!==null&&t!==void 0?t:0}});function wp(e,t){let r=new Rn,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 dr.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 Z5=p(()=>{Ar();So();Jc()});function xp(e,t){let r=new this(e),n=new Hr(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 J5=p(()=>{Ar();So()});function Ph(e){let t=dr.from(e);return zn(t)?t.then(r=>Ph(r)):t.isAsync()?t.readAll().then(r=>new it(r)):new it(t.readAll())}function _p(e,t="stream",r=null){let n={compressionType:r};return(t==="stream"?gs:ys).writeAll(e,n).toUint8Array(!0)}var Q5=p(()=>{Kc();Ko();Jc();Ih()});var Ow={};ir(Ow,{isArrowData:()=>Ep,isArrowDataType:()=>vp,isArrowField:()=>Mp,isArrowRecordBatch:()=>Tp,isArrowSchema:()=>Sp,isArrowTable:()=>Ip,isArrowVector:()=>Ap});function Sp(e){return ve.isSchema(e)}function Mp(e){return ee.isField(e)}function vp(e){return z.isDataType(e)}function Ep(e){return ce.isData(e)}function Ap(e){return $.isVector(e)}function Tp(e){return $e.isRecordBatch(e)}function Ip(e){return it.isTable(e)}var Bw=p(()=>{qr();st();yi();jr();fs();Kc()});var eP,Cw=p(()=>{h0();nu();Dt();yi();st();Kc();jr();In();qr();hh();O0();yt();vu();Fb();Yb();Gb();kb();Ub();jb();qb();Hb();Qb();Jb();Vb();Wb();tw();nw();rw();tp();np();rp();$b();Kb();zb();Xb();Zb();ew();So();Jc();Ih();Q5();dp();hp();ma();fs();Bw();d0();Lb();xc();fh();fr();gu();nh();J0();Bw();Eh();eP=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},eb),Rb),gb),tb),b2),pb),Y2),Nb),Ow),{compareSchemas:$c,compareFields:l5,compareTypes:sp})});var tP=p(()=>{ru();yt();Jc();Ih();H5();Y5();Z5();J5();Cw();Cw();hr.toDOMStream=W5;at.throughDOM=X5;dr.throughDOM=wp;ds.throughDOM=wp;Hi.throughDOM=wp;Mi.throughDOM=xp;ys.throughDOM=xp;gs.throughDOM=xp});var ka={};ir(ka,{AsyncByteQueue:()=>Rn,AsyncByteStream:()=>Hr,AsyncMessageReader:()=>Yc,AsyncRecordBatchFileReader:()=>Iu,AsyncRecordBatchStreamReader:()=>hs,Binary:()=>En,BinaryBuilder:()=>os,BinaryView:()=>Ee,BinaryViewBuilder:()=>cs,Bool:()=>Gr,BoolBuilder:()=>Ec,BufferType:()=>Ne,Builder:()=>at,ByteStream:()=>wi,CompressionType:()=>Tr,Data:()=>ce,DataType:()=>z,DateBuilder:()=>Mo,DateDay:()=>Js,DateDayBuilder:()=>ga,DateMillisecond:()=>Qs,DateMillisecondBuilder:()=>ya,DateUnit:()=>ot,Date_:()=>on,Decimal:()=>An,DecimalBuilder:()=>ba,DenseUnion:()=>Qo,DenseUnionBuilder:()=>Wc,Dictionary:()=>er,DictionaryBuilder:()=>Ac,Duration:()=>sn,DurationBuilder:()=>xi,DurationMicrosecond:()=>ch,DurationMicrosecondBuilder:()=>Ea,DurationMillisecond:()=>ah,DurationMillisecondBuilder:()=>va,DurationNanosecond:()=>lh,DurationNanosecondBuilder:()=>Aa,DurationSecond:()=>sh,DurationSecondBuilder:()=>Ma,Field:()=>ee,FixedSizeBinary:()=>Tn,FixedSizeBinaryBuilder:()=>wa,FixedSizeList:()=>Wt,FixedSizeListBuilder:()=>Tc,Float:()=>Nr,Float16:()=>ki,Float16Builder:()=>Ic,Float32:()=>rn,Float32Builder:()=>Pc,Float64:()=>Zn,Float64Builder:()=>Rc,FloatBuilder:()=>vo,Int:()=>It,Int16:()=>$n,Int16Builder:()=>Oc,Int32:()=>Xt,Int32Builder:()=>Bc,Int64:()=>Kn,Int64Builder:()=>Cc,Int8:()=>Hn,Int8Builder:()=>Lc,IntBuilder:()=>cn,Interval:()=>kr,IntervalBuilder:()=>Wi,IntervalDayTime:()=>aa,IntervalDayTimeBuilder:()=>xa,IntervalMonthDayNano:()=>oh,IntervalMonthDayNanoBuilder:()=>Sa,IntervalUnit:()=>ke,IntervalYearMonth:()=>ca,IntervalYearMonthBuilder:()=>_a,JSONMessageReader:()=>Zc,LargeBinary:()=>Ui,LargeBinaryBuilder:()=>ss,LargeList:()=>Jn,LargeListBuilder:()=>Uc,LargeUtf8:()=>ji,LargeUtf8Builder:()=>Na,List:()=>Qt,ListBuilder:()=>kc,MapBuilder:()=>jc,MapRow:()=>gi,Map_:()=>Ur,Message:()=>Wr,MessageHeader:()=>Ge,MessageReader:()=>Fa,MetadataVersion:()=>nt,Null:()=>Vt,NullBuilder:()=>zc,Precision:()=>He,RecordBatch:()=>$e,RecordBatchFileReader:()=>ds,RecordBatchFileWriter:()=>ys,RecordBatchJSONWriter:()=>Th,RecordBatchReader:()=>dr,RecordBatchStreamReader:()=>Hi,RecordBatchStreamWriter:()=>gs,RecordBatchWriter:()=>Mi,Schema:()=>ve,SparseUnion:()=>la,SparseUnionBuilder:()=>Vc,Struct:()=>et,StructBuilder:()=>qc,StructRow:()=>wo,Table:()=>it,Time:()=>Ir,TimeBuilder:()=>Si,TimeMicrosecond:()=>ra,TimeMicrosecondBuilder:()=>Ba,TimeMillisecond:()=>ta,TimeMillisecondBuilder:()=>Oa,TimeNanosecond:()=>na,TimeNanosecondBuilder:()=>Ca,TimeSecond:()=>ea,TimeSecondBuilder:()=>La,TimeUnit:()=>q,Timestamp:()=>Pr,TimestampBuilder:()=>_i,TimestampMicrosecond:()=>oa,TimestampMicrosecondBuilder:()=>Pa,TimestampMillisecond:()=>bo,TimestampMillisecondBuilder:()=>Ia,TimestampNanosecond:()=>sa,TimestampNanosecondBuilder:()=>Ra,TimestampSecond:()=>ia,TimestampSecondBuilder:()=>Ta,Type:()=>x,Uint16:()=>Yn,Uint16Builder:()=>Nc,Uint32:()=>tn,Uint32Builder:()=>Fc,Uint64:()=>Gi,Uint64Builder:()=>Gc,Uint8:()=>Xn,Uint8Builder:()=>Dc,Union:()=>an,UnionBuilder:()=>as,UnionMode:()=>Ze,Utf8:()=>Fr,Utf8Builder:()=>Da,Utf8View:()=>nn,Utf8ViewBuilder:()=>Hc,Vector:()=>$,Visitor:()=>ie,builderThroughAsyncIterable:()=>cw,builderThroughIterable:()=>cp,compressionRegistry:()=>Ga,isArrowData:()=>Ep,isArrowDataType:()=>vp,isArrowField:()=>Mp,isArrowRecordBatch:()=>Tp,isArrowSchema:()=>Sp,isArrowTable:()=>Ip,isArrowVector:()=>Ap,makeBuilder:()=>ni,makeData:()=>te,makeTable:()=>lw,makeVector:()=>_o,tableFromArrays:()=>uw,tableFromIPC:()=>Ph,tableFromJSON:()=>aw,tableToIPC:()=>_p,util:()=>eP,vectorFromArray:()=>Eu});var Qc=p(()=>{ru();yt();Jc();Ih();D5();G5();j5();V5();tP();hr.toNodeStream=C5;at.throughNode=F5;dr.throughNode=U5;Mi.throughNode=q5});function Pp(e){return{fields:e.fields.map(t=>el(t)),metadata:sP(e.metadata)}}function oP(e,t){return new ve(e.fields.map(r=>Ao(r,t)),Rp(e.metadata))}function sP(e){return Object.fromEntries(e)}function Rp(e){return e?new Map(Object.entries(e)):new Map}function el(e){return{name:e.name,type:Lp(e.type),nullable:e.nullable,metadata:sP(e.metadata)}}function Ao(e,t){return new ee(e.name,Lu(e.type,t),e.nullable,Rp(e.metadata))}function Lp(e){if(rP(e,"BinaryView"))return"binary-view";if(rP(e,"Utf8View"))return"utf8-view";if(PH(e,"LargeList"))return{type:"large-list",children:[el(e.valueField)]};switch(e.constructor){case Vt:return"null";case En:return"binary";case Tn:return{type:"fixed-size-binary",byteWidth:e.byteWidth};case Gr:return"bool";case It:let t=e;return`${t.isSigned?"":"u"}int${t.bitWidth}`;case Hn:return"int8";case $n:return"int16";case Xt:return"int32";case Kn:return"int64";case Xn:return"uint8";case Yn:return"uint16";case tn:return"uint32";case Gi:return"uint64";case Nr:switch(e.precision){case He.HALF:return"float16";case He.SINGLE:return"float32";case He.DOUBLE:return"float64";default:return"float16"}case ki:return"float16";case rn:return"float32";case Zn:return"float64";case Fr:return"utf8";case An:let n=e;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case on:return e.unit===ot.DAY?"date-day":"date-millisecond";case Js:return"date-day";case Qs:return"date-millisecond";case Ir: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 ta:return"time-millisecond";case ea:return"time-second";case ra:return"time-microsecond";case na:return"time-nanosecond";case Pr: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 ia:return"timestamp-second";case bo:return"timestamp-millisecond";case oa:return"timestamp-microsecond";case sa:return"timestamp-nanosecond";case kr:switch(e.unit){case ke.DAY_TIME:return"interval-daytime";case ke.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case aa:return"interval-daytime";case ca:return"interval-yearmonth";case Ur:let c=e;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(y=>el(y))};case Qt:let u=e.valueField;return{type:"list",children:[el(u)]};case Wt:let h=e;return{type:"fixed-size-list",listSize:h.listSize,children:[el(h.children[0])]};case et:return{type:"struct",children:e.children.map(y=>el(y))};case la:case Qo:let m=e;return{type:m instanceof Qo?"dense-union":"sparse-union",typeIds:m.typeIds,children:m.children.map(y=>el(y)),typeIdToChildIndex:{...m.typeIdToChildIndex}};case er:let g=e;return{type:"dictionary",id:g.id,indices:RH(g.indices),dictionary:Lp(g.dictionary),isOrdered:g.isOrdered};default:throw new Error(`arrow type not supported: ${e.constructor.name}`)}}function Lu(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=>Ao(n,t));return new Ur(r[0],e.keysSorted)}case"list":{let r=Ao(e.children[0],t);return new Qt(r)}case"large-list":{let r=Ao(e.children[0],t),n=Rh("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=Ao(e.children[0],t);return new Wt(e.listSize,r)}case"fixed-size-binary":return new Tn(e.byteWidth);case"struct":{let r=e.children.map(n=>Ao(n,t));return new et(r)}case"sparse-union":case"dense-union":{let r=e.children.map(n=>Ao(n,t));return e.type==="dense-union"?new Qo(e.typeIds,r):new la(e.typeIds,r)}case"dictionary":return new er(Lu(e.dictionary,t),OH(e.indices),e.id,e.isOrdered);default:throw new Error("array type not supported")}switch(e){case"null":return new Vt;case"binary":return nP("BinaryView",new En,t);case"binary-view":return iP("BinaryView");case"bool":return new Gr;case"int8":return new Hn;case"int16":return new $n;case"int32":return new Xt;case"int64":return new Kn;case"uint8":return new Xn;case"uint16":return new Yn;case"uint32":return new tn;case"uint64":return new Gi;case"float16":return new ki;case"float32":return new rn;case"float64":return new Zn;case"utf8":return nP("Utf8View",new Fr,t);case"utf8-view":return iP("Utf8View");case"date-day":return new Js;case"date-millisecond":return new Qs;case"time-second":return new ea;case"time-millisecond":return new ta;case"time-microsecond":return new ra;case"time-nanosecond":return new na;case"timestamp-second":return new ia;case"timestamp-millisecond":return new bo;case"timestamp-microsecond":return new oa;case"timestamp-nanosecond":return new sa;case"interval-daytime":return new aa;case"interval-yearmonth":return new ca;default:throw new Error("array type not supported")}}function Rh(e){return ka[e]}function rP(e,t){let r=Rh(t);if(r&&e instanceof r)return!0;let n=z,i=t==="BinaryView"?n.isBinaryView:n.isUtf8View;return!!(i!=null&&i(e))}function PH(e,t){let r=Rh(t);return!!(r&&e instanceof r)}function nP(e,t,r){let n=(r==null?void 0:r.viewTypes)||"never";if(n==="never")return t;let i=Rh(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=Rh(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 RH(e){if(e instanceof It){let r=`${e.isSigned?"int":"uint"}${e.bitWidth}`;if(LH(r))return r}switch(e.constructor){case Hn:return"int8";case $n:return"int16";case Xt:return"int32";case Xn:return"uint8";case Yn:return"uint16";case tn:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${e.constructor.name}`)}}function LH(e){return["int8","int16","int32","uint8","uint16","uint32"].includes(e)}function OH(e){switch(e){case"int8":return new Hn;case"int16":return new $n;case"int32":return new Xt;case"uint8":return new Xn;case"uint16":return new Yn;case"uint32":return new tn;default:throw new Error(`schema dictionary index type not supported: ${e}`)}}var Op=p(()=>{"use strict";Qc()});function aP(e,t={}){let r={...t,copies:new WeakMap};return BH(e)?NH(e,r):CH(e)?cP(e,r):DH(e)?lP(e,r):Cp(e,r)}function BH(e){return"batches"in e}function CH(e){return"schema"in e&&"data"in e&&!Array.isArray(e.data)}function DH(e){return"data"in e&&Array.isArray(e.data)}function NH(e,t){let r=e.batches.map(n=>cP(n,t));return new it(e.schema,r)}function cP(e,t){return new $e(e.schema,Cp(e.data,t))}function Cp(e,t){let r=e.children.map(o=>Cp(o,t)),n=e.dictionary?lP(e.dictionary,t):void 0,i={[Ne.OFFSET]:Bp(e.buffers[Ne.OFFSET],t),[Ne.DATA]:Bp(e.buffers[Ne.DATA],t),[Ne.VALIDITY]:Bp(e.buffers[Ne.VALIDITY],t),[Ne.TYPE]:Bp(e.buffers[Ne.TYPE],t)};return new ce(e.type,e.offset,e.length,e._nullCount,i,r,n)}function lP(e,t){return new $(e.data.map(r=>Cp(r,t)))}function Bp(e,t){if(!FH(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 FH(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Dw=p(()=>{"use strict";Qc()});function GH(e,t){let r=aP(e,t);return{shape:"arrow-table",transport:"arrow-js",schema:Pp(r.schema),batches:r.batches.map(n=>zH(n))}}function kH(e){let t=oP(e.schema),r=e.batches.map(n=>new $e(t,Fw(n.data)));return new it(t,r)}function uP(e,t){var i;if(!UH(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:GH(e.data,n?{copy:n}:void 0)}}function fP(e){return jH(e)?{...e,data:kH(e.data)}:e}function UH(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&typeof t.data=="object"&&"batches"in t.data)}function jH(e){let t=e;return!!(t&&t.shape==="arrow-table"&&t.data&&t.data.transport==="arrow-js"&&Array.isArray(t.data.batches))}function zH(e){return{data:Nw(e.data)}}function Nw(e){return{type:Lp(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=>Nw(t)),dictionary:e.dictionary?qH(e.dictionary):void 0}}function qH(e){return{data:e.data.map(t=>Nw(t))}}function Fw(e){let t=e.children.map(n=>Fw(n)),r=e.dictionary?VH(e.dictionary):void 0;return new ce(Lu(e.type),e.offset,e.length,e.nullCount,e.buffers,t,r)}function VH(e){return new $(e.data.map(t=>Fw(t)))}var hP=p(()=>{"use strict";Qc();Op();Dw()});var dP=p(()=>{"use strict";hP();Dw()});function WH(e,t="float32"){return e instanceof Date?"date-millisecond":typeof e=="number"?t:typeof e=="boolean"?"bool":typeof e=="string"?"utf8":"null"}function mP(e){let t=Gw(e);return t!=="null"?{type:t,nullable:!1}:e.length>0?(t=WH(e[0]),{type:t,nullable:!0}):{type:"null",nullable:!0}}function Gw(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 kw=p(()=>{"use strict"});function Uw(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 pP=p(()=>{"use strict"});function gP(e){let t=ym();return new t(e)}function tl(e){return!!(Ul&&e instanceof Ul)}function yP(e,t,r){tl(e)?e[t]=r:e[t]=bP(r)}function Lh(e){return tl(e)?new Uint16Array(e.buffer,e.byteOffset,e.length):e}function jw(e,t){let r=gP(e.length);for(let n=0;n<e.length;n++)yP(r,n,e[n]/t);return r}function bP(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 wP=p(()=>{"use strict";Dn()});var Dp,zw,xP=p(()=>{"use strict";Qc();Dp=new ve([new ee("POSITION",new Wt(3,new ee("value",new rn,!1)),!1)]),zw=new ve([...Dp.fields,new ee("indices",new Qt(new ee("item",new tn,!1)),!0)])});var Oh=p(()=>{"use strict";wP();xP()});function qw(e,t,r){let n=HH(e,t,r);return new $([n])}function HH(e,t,r){let n=$H(e,t,r),i=n.children[0].type,o=r==="float16"&&tl(e)?Lh(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 $H(e,t,r){let n=r||mP(e).type,i=Lu(n);return new Wt(t,new ee("value",i,!1))}var _P=p(()=>{"use strict";Oh();Qc();kw();Op()});function Vw(e,t){switch(t){case"columnar-table":return KH(e);case"arrow-table":return XH(e);default:throw new Error(t)}}function KH(e){let t={},r=vP(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 XH(e,t){var r;return MP(e.attributes,{schema:e.schema,topology:e.topology,mode:e.mode,boundingBox:(r=e.header)==null?void 0:r.boundingBox,indices:vP(e)?e.indices:void 0})}function MP(e,t={}){var c,l,u;let r=[],n={},i=ZH(e);for(let h of i){let d=e[h],{value:m,size:g=1}=d,y=YH(m,g,d.componentType);if(n[h]=y,r.push(JH(t.schema,h,y,d.componentType)),h==="POSITION"&&((l=(c=t.indices)==null?void 0:c.value)!=null&&l.length)){let b=zw.fields.find(w=>w.name==="indices");n.indices=e$(t.indices.value,y.length,b.type),r.push(b)}}let o=new ve(r,t$(t)),s=((u=n[i[0]])==null?void 0:u.length)===0?new it(o):new it(o,n);return{shape:"arrow-table",schema:Pp(s.schema),data:s,topology:t.topology||"point-list",indices:t.indices}}function YH(e,t,r){if(r==="float16"){let n=tl(e)?Lh(e):e;if(t===1){let i=new ce(new ki,0,n.length,0,{[Ne.DATA]:n});return new $([i])}return qw(e,t,r)}return t===1?_o(e):qw(e,t)}function ZH(e){let t=Object.keys(e),r=SP.filter(i=>i in e),n=t.filter(i=>!SP.includes(i));return[...r,...n]}function vP(e){var t,r;return!!((r=(t=e.indices)==null?void 0:t.value)!=null&&r.length)}function JH(e,t,r,n){if(t==="POSITION"&&QH(r)){let o=Dp.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=Ao(i);return new ee(t,r.type,o.nullable,o.metadata)}return i?Ao(i):new ee(t,r.type,!1)}function QH(e){return e.type instanceof Wt&&e.type.listSize===3&&e.type.children[0].type instanceof rn}function e$(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 t$(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)),Rp(t)}var SP,EP=p(()=>{"use strict";Oh();Oh();Qc();_P();Op();SP=["POSITION"]});function Ww(e,t,r){let n=t.componentType||Gw(t.value),i=r||Np(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 Np(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 AP=p(()=>{"use strict";kw()});var Fp=p(()=>{"use strict";pP();EP();AP()});var TP,IP=p(()=>{"use strict";TP="5.0.0-beta.2"});var PP,RP=p(()=>{"use strict";PP={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var LP,OP=p(()=>{"use strict";LP={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function Bh(e,t=null,r={},n=null,i=null){var o;if(Ti&&r.useLocalLibraries&&!r.CDN&&n&&((o=r.modules)==null?void 0:o[n])===void 0){let s=Qa?"./libs":`modules/${t}/dist/libs`;r={...r,modules:{[n]:`${s}/${n}`,...i?{[i]:`${s}/${i}`}:{},...r.modules}}}return await Ol(e,t,r,n,i)}var BP=p(()=>{"use strict";rc()});var r$,n$,Ch,CP,Ft,Dh,DP=p(()=>{"use strict";r$="1.5.7",n$="8786740086a9f4d83f44aa83badfbea4dce7a1b5",Ch=`https://www.gstatic.com/draco/versioned/decoders/${r$}`,CP=`https://cdn.jsdelivr.net/gh/google/draco@${n$}/javascript`,Ft={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"},Dh={[Ft.DECODER]:`${Ch}/${Ft.DECODER}`,[Ft.DECODER_WASM]:`${Ch}/${Ft.DECODER_WASM}`,[Ft.GLTF_DECODER]:`${Ch}/${Ft.GLTF_DECODER}`,[Ft.GLTF_DECODER_WASM]:`${Ch}/${Ft.GLTF_DECODER_WASM}`,[Ft.FALLBACK_DECODER]:`${Ch}/${Ft.FALLBACK_DECODER}`,[Ft.ENCODER]:`${CP}/${Ft.ENCODER}`,[Ft.ENCODER_WASM]:`${CP}/${Ft.ENCODER_WASM}`}});async function Gp(e={},t,r="full"){let n=a$(e);return n?await Hw(n):await i$(e,t==="js"?"javascript":t,r)}async function i$(e={},t,r="full"){let n=l$(`${t}:${r}`,e),i=NP.get(n);return i||(i=o$(e,t,r),NP.set(n,i)),await i}async function Hw(e){let t=c$(e),r=FP.get(t);return r||(r=Pl(()=>t.createDecoderModule({}),n=>({draco:n})),FP.set(t,r)),await r}async function o$(e,t,r){try{return await kP(e,t,r)}catch(n){if(t==="javascript")throw n;try{return await kP(e,"javascript","full")}catch(i){throw new AggregateError([n,i],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function kP(e,t,r){let n=GP.then(()=>s$(e,t,r));return GP=n.then(()=>{},()=>{}),await n}async function s$(e,t,r){if(t==="javascript"){let s;try{s=await Bh(Dh[Ft.FALLBACK_DECODER],"scene",e,Ft.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Ti||e.useLocalLibraries)throw c;s=await Bh(Dh[Ft.FALLBACK_DECODER],"scene",{...e,useLocalLibraries:!0},Ft.FALLBACK_DECODER,"draco_decoder.mjs")}let a=zP(s,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await jP(a)}let n,i;try{[n,i]=await UP(e,r)}catch(s){if(Ti||e.useLocalLibraries)throw s;[n,i]=await UP({...e,useLocalLibraries:!0},r)}let o=zP(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await jP(o,i)}async function UP(e,t){let r=t==="gltf"?Ft.GLTF_DECODER:Ft.DECODER,n=t==="gltf"?Ft.GLTF_DECODER_WASM:Ft.DECODER_WASM;return await Promise.all([Bh(Dh[r],"scene",e,r,t==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),Bh(Dh[n],"scene",e,n)])}function jP(e,t){if(typeof e!="function")throw new Error("Draco module initializer could not be loaded");return Pl(r=>e({...t?{wasmBinary:t}:{},onModuleLoaded:r}),r=>({draco:r}))}function zP(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 a$(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 c$(e){let t=e;if(typeof(t==null?void 0:t.createDecoderModule)!="function")throw new Error("Invalid draco3d decoder module");return t}function l$(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 NP,FP,GP,kp=p(()=>{"use strict";zs();BP();DP();NP=new Map,FP=new WeakMap;GP=Promise.resolve()});function VP(e,t,r){let n=WP(t.metadata),i=[],o=u$(t.attributes);for(let s in e){let a=e[s],c=qP(s,a,o[s]);i.push(c)}if(r){let s=qP("indices",r);i.push(s)}return{fields:i,metadata:n}}function u$(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function qP(e,t,r){let n={...Np(t),...r?WP(r.metadata):{}};return Ww(e,t,n)}function WP(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var HP=p(()=>{"use strict";Fp()});function m$(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 p$(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function g$(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 b$(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 w$(e){if(e.includeAttributes&&e.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function x$(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 _$(e){var a;let t=Uw(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 $P,f$,h$,d$,Nh,KP=p(()=>{"use strict";Fp();HP();$P={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},f$={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},h$=2,d$=4,Nh=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={}){w$(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=_$(c.attributes),u=VP(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}});x$(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:b$(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?h$:d$),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),g$(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=f$[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=m$(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 $P)if(this.draco[s]===o)return $P[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=p$(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 Ou(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 Nh(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"?Vw(l,"arrow-table"):l}finally{s.destroy()}}var Up=p(()=>{"use strict";Fp();KP()});var bge,S$,M$,XP=p(()=>{"use strict";rc();kp();Up();Fh();({preload:bge,...S$}=vi),M$={...S$,parse:async(e,t,r)=>await Ou(e,t,async()=>{var n;return await Gp(tc(t),"wasm",(n=t==null?void 0:t.draco)==null?void 0:n.decoderProfile)},r)}});var YP={};ir(YP,{DracoWASMLoaderWithParser:()=>M$});var ZP=p(()=>{"use strict";XP()});var Ege,v$,E$,JP=p(()=>{"use strict";rc();kp();Up();Fh();({preload:Ege,...v$}=vi),E$={...v$,parse:async(e,t,r)=>await Ou(e,t,async()=>await Gp(tc(t),"js"),r)}});var QP={};ir(QP,{DracoJavaScriptLoaderWithParser:()=>E$});var eR=p(()=>{"use strict";JP()});function I$(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 Lge,A$,T$,tR=p(()=>{"use strict";kp();Up();Fh();({preload:Lge,...A$}=vi),T$={...A$,parse:async(e,t,r)=>await Ou(e,t,async()=>await Hw(I$(t)),r)}});var rR={};ir(rR,{Draco3DLoaderWithParser:()=>T$});var nR=p(()=>{"use strict";tR()});async function P$(e,t){var n;let r=t;switch(R$(r)){case"wasm":{let{DracoWASMLoaderWithParser:i}=await Promise.resolve().then(()=>(ZP(),YP));return i}case"javascript":{let{DracoJavaScriptLoaderWithParser:i}=await Promise.resolve().then(()=>(eR(),QP));return i}case"draco3d":{let{Draco3DLoaderWithParser:i}=await Promise.resolve().then(()=>(nR(),rR));return i}default:throw new Error(`DracoLoader: unsupported backend "${(n=r==null?void 0:r.draco)==null?void 0:n.backend}"`)}}function R$(e){var t;return(t=e==null?void 0:e.draco)!=null&&t.backend?e.draco.backend==="js"?"javascript":e.draco.backend:vi.options.draco.backend}var vi,Fh=p(()=>{"use strict";dP();IP();RP();OP();vi={dataType:null,batchType:null,...PP,version:TP,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:uP,deserializeWorkerResult:fP,options:{draco:LP},preload:P$}});var $w=p(()=>{"use strict";uT();Fh()});function Gh(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 Bu,jp,Kw=p(()=>{"use strict";Bu="EPSG:4326",jp="EPSG:4978"});function To(e){var r,n;if(typeof e=="string"){let i=yr(e);return i==="wkt"?O$(e):i==="proj-string"?B$(e):L$(e)||"projected"}let t=e;return t.type==="BoundCRS"&&t.source_crs?To(t.source_crs):t.type==="CompoundCRS"&&((r=t.components)!=null&&r[0])?To(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 L$(e){if(typeof e!="string")return;let t=Gh(e);if(t===jp)return"geocentric";if(t===Bu||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 O$(e){let t;try{t=wf(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 B$(e){var t;try{let r=(t=xf(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 Xw=p(()=>{"use strict";Hg();Kw()});function zp(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,S=!!n&&g&&y&&b&&w&&h&&i!=="local-enu",M=r?"caller-override":e.provenance||"unknown",v=r&&n?To(n):e.coordinateFrame,T=r?"explicit":e.sourceCrsState||(n?M==="format-default"?"default":"explicit":"absent"),O=Yd({crs:n?{state:T==="default"?"default":"explicit",definition:n,representation:!r&&e.sourceCrsRepresentation||yr(n),provenance:M,alternatives:r?void 0:e.sourceCrsAlternatives}:{state:T==="unknown"?"unknown":"absent",provenance:M},vertical:e.verticalCrs?{state:"explicit",definition:e.verticalCrs,representation:yr(e.verticalCrs),provenance:e.provenance||"metadata"}:void 0,coordinateEpoch:t.coordinateEpoch??e.coordinateEpoch,coordinateFrame:v,coordinateOrder:D$(e.axisOrder),units:r?void 0:e.units}),P=Yw(O.crs),_=O.vertical?Yw(O.vertical):void 0,U=o?C$(o):void 0;return Object.freeze({...O,sourceCrs:P,verticalCrs:_,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:M,targetCrs:U,targetHeightReference:s,outputCoordinates:i,status:g?S?"transformable":"unresolved":"native",warnings:Object.freeze([...e.warnings||[]])})}function Yw(e){return e.state==="explicit"||e.state==="default"?e.definition:void 0}function C$(e){let t=Yd({crs:{state:"explicit",definition:e,representation:yr(e),provenance:"caller-override"}}),r=Yw(t.crs);if(!r)throw new Error("Failed to normalize a known target CRS definition");return r}function D$(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 oR=p(()=>{"use strict";Hg();Xw()});function sR(e){if(!e)return;let t=e.trim().toLowerCase().replaceAll("_","-"),r=F$[t]||t;return N$[r]}var N$,F$,aR=p(()=>{"use strict";N$=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}),F$=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 cR(e){return{input:new Float64Array(e),output:new Float64Array(e)}}function kh(e){return e instanceof Float32Array||e instanceof Float64Array}function lR(e){return typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function Zw(e,t,r,n,i,o){return(e.buffer===n.buffer||lR(e.buffer)&&lR(n.buffer))&&t<o&&i<r}function qp(e,t,r,n){return e<t+n?0:Math.floor((e-t-n)/r)+1}var Vp,uR=p(()=>{Vp=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=[cR(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(!kh(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(Zw(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(Zw(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]=cR(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(!kh(t)||!kh(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(qp(t.length,this.inputOffset,a,this.dimension),n,i);if(i+l>qp(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(!kh(t[d])||!kh(r[d]))throw new Error("Projection columns require floating typed arrays");l=Math.min(l,qp(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>qp(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(Zw(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 fR(){return{bounds:[[-1,-1,0],[1,1,0]]}}var hR=p(()=>{});function Qw(){let e=globalThis;return e[Jw]||(e[Jw]=new WeakMap),e[Jw]}function dR(e){var t;return"create"in e?e:(t=Qw().get(e))==null?void 0:t.implementation}function mR(e){if("create"in e)return Promise.resolve(e);let t=Qw().get(e);if(t||(t={load:()=>e.preload()},Qw().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 Jw,pR=p(()=>{Jw=Symbol.for("@math.gl/projection/projection-implementations")});function rl(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 Uh(e,t,r,n){if(t instanceof Float32Array){if(Math.abs(r.x)>Wp||Math.abs(r.y)>Wp||n>=3&&Math.abs(r.z)>Wp)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)>Wp)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 Wp,ex=p(()=>{Wp=34028234663852886e22});function Ue(e){throw new oi("missing-transform-stage",e)}var gR,yR,oi,Ua=p(()=>{yR=Symbol.for("@math.gl/projection/TypeScriptCRSError"),oi=class e extends Error{static[(gR=yR,Symbol.hasInstance)](t){return this!==e?Function.prototype[Symbol.hasInstance].call(this,t):t instanceof Error&&t[yR]===!0}constructor(t,r){super(r),this.reason=t,this[gR]=!0,this.name="TypeScriptCRSError"}}});function jh(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 oi("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 bR(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 tx=p(()=>{Ua()});function Cu(e){var i;if(!((i=e.datumCatalogs)!=null&&i.length))return rx;let t=_R.get(e);if((t==null?void 0:t.catalogs)===e.datumCatalogs)return t.definitions;let r=Object.assign(Object.create(null),rx),n=new Map(Object.entries(rx).map(([o,s])=>[nl(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=nl(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}}),_R.set(e,{catalogs:e.datumCatalogs,definitions:r}),r}var wR,xR,rx,_R,nl,Hp=p(()=>{wR={towgs84:"0,0,0",ellipse:"WGS84"},xR={towgs84:"0,0,0",ellipse:"GRS80"},rx={wgs84:wR,WGS84:wR,nad83:xR,North_American_Datum_1983:xR},_R=new WeakMap,nl=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var G$,SR,MR=p(()=>{G$={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)"}},SR=G$});var Ln,vR,ER=p(()=>{Ln={};Ln.greenwich=0;Ln.lisbon=-9.131906111111;Ln.paris=2.337229166667;Ln.bogota=-74.080916666667;Ln.madrid=-3.687938888889;Ln.rome=12.452333333333;Ln.bern=7.439583333333;Ln.jakarta=106.807719444444;Ln.ferro=-17.666666666667;Ln.brussels=4.367975;Ln.stockholm=18.058277777778;Ln.athens=23.7163375;Ln.oslo=10.722916666667;vR=Ln});function nx(e,t){let r=Object.keys(e).find(n=>TR(n)===TR(t));return r===void 0?void 0:e[r]}function IR(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 ix(e,t={}){let r=e,n=t.aliases||{},i=new Set;for(;typeof r=="string"&&(Io(n,r)||Io(AR,r));){if(i.has(r))throw new Error("Circular CRS alias: "+r);i.add(r),r=Io(n,r)?n[r]:AR[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 bs(e,t={}){var U;let r=Cu(t),n=jh(e,t),i=ix(n.definition,t),o;if(yr(i)==="proj-string"&&typeof i=="string"){let C=Object.create(null);for(let L of xf(i).parameters){if(Io(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(yr(i));throw new oi(L?"missing-parser":"unknown-syntax",yr(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(IR(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"?nx(r,h):void 0;h&&h!=="none"&&!d&&Ue("Unknown datum: "+h+"; register a datumCatalogs plugin");let m=RR(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 S=g==="@null"||g==="null"?RR({ellps:"WGS84"}):m,M=s.axis||"enu";if(M.length!==3||!/[ew]/.test(M)||!/[ns]/.test(M)||!/[ud]/.test(M))throw new Error("Invalid axis: "+M);let v=o.angularUnit??At;if(u==="geographic"&&(s.units&&s.units!=="degrees"||Io(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=PR(s,"units","to_meter"),O=o.verticalUnit??PR(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,_=P===void 0?0:(nx(vR,P)??IR(P))*At;return bR(Object.freeze({kind:u,projection:l,parameters:Object.freeze(s),ellipsoid:m,datum:Object.freeze({ellipsoid:S,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:_,axis:M,longitudeWrap:s.lon_wrap===void 0?void 0:Number(s.lon_wrap)*At,lossy:!!(o.lossy||n.lossy)}),n.spatialReference)}function PR(e,t,r){let n=e[t],i=_f;if(t==="vunits"&&n==="degrees")throw new Error("Height requires linear units");if(n&&!["m","degrees"].includes(n)&&!Io(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 RR(e,t){let r=t||e.ellps||"WGS84",n=nx(SR,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):Io(e,"f")||Io(e,"rf")||Io(e,"a")?i:n.b||i),c=re(e,"R",0);if(i<=0||a<=0||a>i||s<0||s>0&&s<=1||Io(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 AR,$p,LR,Io,TR,Du=p(()=>{Bl();Vg();tx();qt();Hp();MR();ER();Wg();Ua();AR={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"},$p=["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"],LR=["no_defs","over"],Io=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),TR=e=>e.toLowerCase().replace(/[\s_-]/g,"")});function Yp(e,t){if(Math.abs(e.y)>Math.PI/2)throw new Error("Latitude outside geocentric domain");if(!vf(e,t))throw new Error("Geocentric coordinate must be finite")}function Zp(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(!Ef(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 OR(e,t){let r=e[0],n=e[1],i=e[2],o=(e[3]||0)*ox,s=(e[4]||0)*ox,a=(e[5]||0)*ox,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 Xp(e){var t;return!!((t=e.towgs84)!=null&&t.some(r=>r!==0))}function ax(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=ax(e.grids?Kp:e,t.grids?Kp:t);return n=>{e.grids&&BR(n,e,!1),r==null||r(n),t.grids&&BR(n,t,!0)}}if(Xp(e)||Xp(t)){let r=sx(e,Kp),n=sx(Kp,t);return i=>{r==null||r(i),n==null||n(i)}}return sx(e,t)}}function sx(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=Xp(e)?OR(e.towgs84,!1):void 0,s=Xp(t)?OR(t.towgs84,!0):void 0;return a=>{Yp(a,r),o==null||o(a),s==null||s(a),Zp(a,n)}}function BR(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 CR(e,t){let r={x:e[0],y:e[1],z:e[2]};return Yp(r,t),[r.x,r.y,r.z]}function DR(e,t){let r={x:e[0],y:e[1],z:e[2]};return Zp(r,t),[r.x,r.y,r.z]}var ox,Kp,cx=p(()=>{Dn();ox=Math.PI/(180*3600),Kp={ellipsoid:{semiMajorAxis:6378137,semiMinorAxis:6356752314245179e-9,eccentricitySquared:.0066943799901413165},towgs84:[0,0,0]}});function ja(e,t=0){let r=re(e,"lon_wrap",0)*At;return n=>cr(i=>{let o=Or(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 zh=p(()=>{qt();lt();Ot()});function NR(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 FR=p(()=>{Ua()});function GR(e){let t=zR(e.projections||[]),r=new Set;for(let n of[e.from??"WGS84",e.to??"WGS84"]){let i=bs(n,e);if(["geographic","identity"].includes(i.kind))continue;let o=t.get(Qp(i.projection));if(!o)throw new oi("missing-plugin","Projection plugin is not registered: "+i.projection);r.add(o)}return[...r]}function zR(e){let t=new Map;for(let r of e)for(let n of new Set([r.name,...r.aliases||[]].map(Qp))){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 kR(e,t,r){var m;let n=bs(e,r),i=t.get(Qp(n.projection));if(!["geographic","identity"].includes(n.kind)&&!i)throw new oi("missing-plugin","Projection plugin is not registered: "+n.projection);let o=new Set([...$p,...(i==null?void 0:i.parameters)||[]]);for(let g of Object.keys(n.parameters)){if(!o.has(g))throw new oi("missing-transform-stage","Unsupported PROJ parameter: +"+g);let y=LR.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=Qp(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=NR(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 lx(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.z)}function UR(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 jR(e,t,r){var v,T,O,P;let n=e.storedAxis||(r?e.axis:"enu"),i=t.storedAxis||(r?t.axis:"enu"),o=UR(n,!1),s=UR(i,!0),a=e.implementation&&qo(e.implementation,!0,e.kind==="geocentric"),c=t.implementation&&qo(t.implementation,!1,t.kind==="geocentric"),l=ax(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,S=t.kind==="geographic"?t.longitudeWrap:void 0,M;if(!l&&!e.verticalGrid&&!t.verticalGrid&&!u&&!o&&!s&&!b&&!w&&e.verticalUnit===1&&t.verticalUnit===1&&S===void 0){let _=Object.freeze({inputScale:d,outputScale:m});e.kind==="geographic"&&t.kind==="projected"&&(M=(T=(v=t.implementation)==null?void 0:v.createForwardFlat)==null?void 0:T.call(v,_)),e.kind==="projected"&&t.kind==="geographic"&&(M=(P=(O=e.implementation)==null?void 0:O.createInverseFlat)==null?void 0:P.call(O,_))}return{flat:M,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(_){if(!lx(_))throw new Error("Coordinates must contain finite x, y and optional z values");o==null||o(_);let U=_.z;if(u&&(_.z=0),d!==1&&(_.x*=d,_.y*=d,h&&(_.z*=d)),a==null||a(_),g!==1&&(_.z*=g),Math.abs(_.y)>Math.PI/2||!lx(_))throw new Error("Coordinate is outside the geographic domain");if(_.x+=b,e.verticalGrid&&(_.z+=e.verticalGrid(_.x,_.y)),l==null||l(_),t.verticalGrid&&(_.z-=t.verticalGrid(_.x,_.y)),_.x-=w,S!==void 0&&(_.x=S+Kt(_.x-S)),c==null||c(_),m!==1&&(_.x/=m,_.y/=m),y!==1&&(_.z/=y),u&&(_.z=U),s==null||s(_),!lx(_))throw new Error("Projection produced non-finite coordinates")}}}function Nu(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 Uh(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 Jp(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 qh,Qp,qR=p(()=>{sc();hR();pR();ac();Am();ex();Du();Ua();cx();qt();zh();FR();qh=class e{static async create(t={}){let r=await Promise.all(GR(t).map(mR));return new e({...t,projections:r})}get targetProfile(){return this.getTargetRenderingProfile(this.targetCoverage)}getTargetRenderingProfile(t){return this.targetRenderingProfile&&X4(this.targetRenderingProfile,t)}constructor(t={}){var i,o,s;this.coordinateScratch=new Bs,this.targetLongitudeOrigin=0;let r=t.projections||[],n=zR(r);if(r.some(a=>!("create"in a))){let a=bs(t.from??"WGS84",t),c=bs(t.to??"WGS84",t);this.lossy=a.lossy||c.lossy,this.deferred={options:{...t,projections:[...r]}}}else{let a=t,c=n,l=kR(a.from??"WGS84",c,a),u=kR(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"?ja(u.parameters,u.primeMeridian):u.kind==="identity"?fR: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=jR(l,u,!!t.enforceAxis),this.inverseTransform=jR(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=GR(t.options).map(n=>{let i=dR(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):Nu(t,this.forwardTransform,this.coordinateScratch)}unprojectSync(t){return this.deferred?this.loadSync().unproject(t):Nu(t,this.inverseTransform,this.coordinateScratch)}projectFlatSync(t,r=2){return this.deferred?this.loadSync().projectFlat(t,r):Jp(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlatSync(t,r=2){return this.deferred?this.loadSync().unprojectFlat(t,r):Jp(t,r,this.inverseTransform,this.coordinateScratch)}async preload(){await this.load()}project(t){return this.deferred?this.projectLoaded(t,!1):Nu(t,this.forwardTransform,this.coordinateScratch)}unproject(t){return this.deferred?this.projectLoaded(t,!0):Nu(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):(rl(t,r,Math.max(t.length,this.forwardTransform.geocentricOutput?3:2)),Nu(t,this.forwardTransform,this.coordinateScratch,r))}unprojectToSync(t,r){return this.deferred?this.loadSync().unprojectTo(t,r):(rl(t,r,Math.max(t.length,this.inverseTransform.geocentricOutput?3:2)),Nu(t,this.inverseTransform,this.coordinateScratch,r))}projectToLoaded(t,r,n){rl(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)):Jp(t,r,this.forwardTransform,this.coordinateScratch)}unprojectFlat(t,r=2){return this.deferred?this.load().then(i=>i.unprojectFlat(t,r)):Jp(t,r,this.inverseTransform,this.coordinateScratch)}};Qp=e=>e.toLowerCase().replace(/[\s_-]/g,"")});var e1,VR=p(()=>{e1=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 ux(e){if(e.length!==3||e.some(t=>!Number.isFinite(t)||t<=0))throw new Error("Invalid CRS rendering scale");return e}function HR(e,t,r,n){if(e.kind==="geocentric")return ux([e.toMeter,e.toMeter,e.toMeter]);if(e.kind==="identity")return ux([...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 e1((g,y)=>{for(let S=0;S<3;S++)o[S]=i[S];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]*Vh,w=WR.semiMajorAxis,S=WR.eccentricitySquared,M=1-S*Math.sin(b)**2;if(u=w*Math.cos(b)/Math.sqrt(M)*Vh,h=w*(1-S)/M**1.5*Vh,!(u>w*Vh*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/Vh:e.toMeter;if(!m.evaluate(1/P,P))return null;for(let _=0;_<3;_++)c[l][_]=m.result[_]}if(y=c.map(O=>Math.hypot(...O)),e.kind==="projected"){let O=c[r.search(/[ew]/)],P=c[r.search(/[ns]/)],_=Math.abs(O[0]*P[1]-O[1]*P[0])/e.toMeter**2;y[r.search(/[ud]/)]=e.verticalUnit*Math.sqrt(_)}}catch{return null}finally{d=!1}return ux(y)}}var Vh,WR,$R=p(()=>{VR();Du();Vh=Math.PI/180,WR=bs("WGS84").ellipsoid});async function JR(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=bs(c,{...r,...a}),u=await e.createProjectionAsync({...a,from:"WGS84",to:c}),h=l.storedAxis||(a.enforceAxis?l.axis:"enu"),d=ZR(l.kind==="geographic"?l.angularUnit:l.toMeter,l.kind==="geographic"),m=ZR(l.verticalUnit,!1),g=[...h].map(_=>l.kind!=="geocentric"&&/[ud]/.test(_)?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=z$(y,l,h),S=j$(y.normalize),M=HR(l,u,h,b),v=[...new Set(["WGS84",...a.converters||[]])];if(v.some(_=>typeof _!="string"||!_.trim()))throw new Error("Converter source CRS must be a nonempty string");let T=await Promise.all(v.map(async _=>{if(_==="WGS84")return[_,XR(u,S)];let[U,C]=await Promise.all([e.createProjectionAsync({...a,from:_,to:c}),e.createProjectionAsync({...a,from:"WGS84",to:_})]);return[_,XR(U,U$(C,S))]})),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:Kv(P),renderingBounds:w,renderingScale:M,getRenderingScale:_=>typeof M=="function"?M(_):M,converter:O}}function XR(e,t){return{from:YR(e.project.bind(e),e.projectTo.bind(e)),to:YR(e.unproject.bind(e),e.unprojectTo.bind(e)),normalize:t}}function U$(e,t){function r(n,i){i!==void 0&&rl(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):Uh(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 YR(e,t){function r(n,i){return i===void 0?e(Array.isArray(n)?n:Array.from(n)):t(n,i)}return r}function j$(e){function t(r,n){let i=n??new Array(r.length);rl(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),Uh(r,i,c,r.length)}return t}function z$(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 ZR(e,t){let r=t?KR:k$,n=Object.keys(r).find(i=>r[i]===e)||"custom";return t?{name:n,degreesPerUnit:e/KR.degrees}:{name:n,metersPerUnit:e}}var KR,k$,QR=p(()=>{Du();$R();ex();Wg();KR={degrees:Math.PI/180,radians:1,gradians:Math.PI/200},k$={...Object.fromEntries(Object.values(_f).map(e=>[e.name,e.metersPerUnit]))}});function eL(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 Wh(e){return!!(e.projections||e.parsers||e.datumCatalogs||e.aliases||e.datumGrids||e.verticalGrids||e.resolver)}var fx=p(()=>{});async function rL(e){let t={...e,from:tL(e.from??"WGS84"),to:tL(e.to??"WGS84")},[r,n]=await Promise.all([t1(t.from,t),t1(t.to,t)]);return{...t,from:r,to:n}}async function t1(e,t){var u;let r=jh(e,t),n=ix(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:yr(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=jh(s.input,t).definition;if(!i)return a;let c=e,l={...i,definition:a,representation:yr(a),alternatives:[{definition:i.definition,representation:i.representation},...i.alternatives??[]]};return"crs"in c?{...c,crs:l}:l}function tL(e){return typeof e=="string"?e:JSON.parse(JSON.stringify(e))}var nL=p(()=>{Bl();Du();tx()});var r1,iL=p(()=>{QR();fx();nL();qR();fx();r1=class{constructor(t={}){this.options=eL(t),this.useDefinitionSignature=!Wh(t)}getCRS(t,r={}){return JR(this,t,this.options,r,this.useDefinitionSignature,this.options.resolver?t1:void 0)}createProjection(t={}){return new qh({...this.options,...t})}async createProjectionAsync(t={}){let r={...this.options,...t};return qh.create(r.resolver?await rL(r):r)}}});var oL=p(()=>{});var hx,sL=p(()=>{Wl();qt();Je();lt();Ot();hx={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=Tf(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=M=>c+u*(Math.asinh(Math.tan(M))-i*Math.atanh(i*Math.sin(M)));return cr(M=>ct(Ce([a,a],Fe(Or(M,s,o),u)),[S(M[0][1]),S(M[1][1])]),w,s,n,o)}let y=[[a-d,c-m,0],[a+d,c+m,0]];return{bounds:y,normalize:cr(()=>y,Nn(Q(s-Math.PI,-h,s+Math.PI,h),n),s,n,o).normalize}},...Li(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*Kt(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,S=Math.atan(Math.sinh(w));if(i===0){g.x=Kt(s+(y-a)/u,o),g.y=S+0;return}for(let M=0;M<30;M++){let v=Math.atan(Math.sinh(w+i*Math.atanh(i*Math.sin(S))));if(Math.abs(v-S)<1e-13){g.x=Kt(s+(y-a)/u,o),g.y=v;return}S=v}throw new Error("Mercator inverse did not converge")})}}}});var dx,aL=p(()=>{ac();qt();Je();lt();Ot();dx={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=Tf(t,"lat_0"),s=Math.cos(Tf(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 cr(d=>ct(Ce([a,a],Fe(Or(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:cr(()=>h,Nn(Q(i-Math.PI,-(Math.PI/2),i+Math.PI,Math.PI/2),r),i,r,n).normalize}},...di(u=>{u.x=a+e*s*Kt(u.x-i,n),u.y=c+e*(u.y-o)},u=>{u.x=Kt(i+(u.x-a)/(e*s),n),u.y=o+(u.y-c)/e})}}}});function q$(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=wn(e.e,r,n),o=Jr(e.e,e.lat1,r),s=Math.sin(e.lat2),a=Math.cos(e.lat2),c=wn(e.e,s,a),l=Jr(e.e,e.lat2,s),u=Jr(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 cL(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):Jr(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 lL(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=hc(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 uL(e){let t={...e,ns:0,f0:0,rh:0};return q$(t),t}var fL=p(()=>{Kl();Bf();xt();Bm();Bt()});var mx,hL=p(()=>{Ot();Je();lt();Wl();Fn();fL();mx={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:[...vr,...Vo,"lat_1","lat_2"],create(e){let t=br(e);Vl(t,e.parameters);let r=uL(t),n=lr("lcc",r,cL,lL),i={...Li(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=>ql(i.forward,o,t.long0,r.ns,r.x0,r.y0+r.k0*r.rh,t.over),t.primeMeridian,t.over)}}});function un(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 Hh=p(()=>{});function n1(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 px=p(()=>{Bt()});function V$(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=wn(e.e3,e.sin_po,e.cos_po),e.qs1=un(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=wn(e.e3,e.sin_po,e.cos_po),e.qs2=un(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=un(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 dL(e,t){var r=t.x,n=t.y;e.sin_phi=Math.sin(n),e.cos_phi=Math.cos(n);var i=un(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 mL(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=un(e.e3,1);a=Math.abs(Math.abs(n)-c)<=16*Number.EPSILON*c?Math.sign(n)*Math.PI/2:n1(e.e3,n)}return s=k(o/e.ns0+e.long0,e.over),t.x=s,t.y=a,t}function pL(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 V$(t),t}var gL=p(()=>{Kl();Hh();xt();px()});var gx,yL=p(()=>{Wl();Ot();Je();lt();Fn();gL();gx={name:"aea",aliases:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers"],parameters:[...vr,"lat_1","lat_2"],create(e){let t=br(e);Vl(t,e.parameters);let r=pL(t),n={...lr("aea",r,dL,mL,Li)};return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>ql(n.forward,i,t.long0,r.ns0,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function ws(e){return Math.abs(e)<=F?e:e-Fs(e)*Math.PI}var $h=p(()=>{Bt();Lf()});function W$(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=co(e.es),e.sin_phi=Math.sin(e.lat1),e.cos_phi=Math.cos(e.lat1),e.ms1=wn(e.e,e.sin_phi,e.cos_phi),e.ml1=wr(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=wn(e.e,e.sin_phi,e.cos_phi),e.ml2=wr(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=wr(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en),e.rh=e.a*(e.g-e.ml0))}function bL(e,t){var r=t.x,n=t.y,i;if(e.sphere)i=e.a*(e.g-n);else{var o=wr(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 wL(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=ws(e.g-n/e.a),t.x=o,t.y=i,t;var a=e.g-n/e.a;return i=lo(a,e.es,e.en),o=k(e.long0+s/e.ns,e.over),t.x=o,t.y=i,t}function xL(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 W$(t),t}var _L=p(()=>{Hl();uc();$l();Kl();xt();$h()});var yx,SL=p(()=>{Wl();Ot();Je();lt();Fn();_L();yx={name:"eqdc",aliases:["Equidistant_Conic"],parameters:[...vr,"lat_1","lat_2"],create(e){let t=br(e);Vl(t,e.parameters);let r=xL(t),n=lr("eqdc",r,bL,wL,Li);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>ql(n.forward,i,t.long0,r.ns,r.x0,r.y0+r.rh,t.over),t.primeMeridian,t.over)}}});function za(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 bx(e,t,r){if(r===0||e===0)return r;let n=za(e,r)/t;return Math.atan2(Math.sign(r)*(1-n),Math.sqrt(n*(2-n)))}function wx(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=za(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 xx=p(()=>{});function H$(e){var t=Math.abs(e.lat0);if(Math.abs(t-F)<1e-10?e.mode=e.lat0<0?$i:Po:Math.abs(t)<1e-10?e.mode=Ei:e.mode=fn,e.es>0){var r;switch(e.qp=un(e.e,1),e.mmf=.5/(1-e.es),e.mode){case Po:e.dd=1;break;case $i:e.dd=1;break;case Ei:e.rq=Math.sqrt(.5*e.qp),e.dd=1/e.rq,e.xmf=1,e.ymf=.5*e.qp;break;case fn:e.rq=Math.sqrt(.5*e.qp),r=Math.sin(e.lat0),e.sinb1=un(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===fn&&(e.sinph0=Math.sin(e.lat0),e.cosph0=Math.cos(e.lat0))}function ML(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===fn||e.mode===Ei){if(n=e.mode===Ei?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===Ei?s:e.cosph0*s-e.sinph0*h*i}else if(e.mode===Po||e.mode===$i){if(e.mode===Po&&(i=-i),Math.abs(m+e.lat0)<1e-10)return null;n=Qe-m*.5,n=2*(e.mode===$i?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=un(e.e,s),e.mode===fn||e.mode===Ei){c=a/e.qp;let g=za(e.e,m)/e.qp;l=Math.sqrt(g*(2-g))}switch(e.mode){case fn:u=1+e.sinb1*c+e.cosb1*l*i;break;case Ei:u=1+l*i;break;case Po:u=F+m,a=m>=0?za(e.e,m):2*e.qp-za(e.e,m);break;case $i:u=m-F,a=m<=0?za(e.e,m):2*e.qp-za(e.e,m);break}if(Math.abs(u)<1e-10)return null;switch(e.mode){case fn:case Ei:u=Math.sqrt(2/u),e.mode===fn?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 Po:case $i:a>=0?(u=Math.sqrt(a),r=u*o,n=i*(e.mode===$i?u:-u)):r=n=0;break}}return t.x=e.a*r+e.x0,t.y=e.a*n+e.y0,t}function vL(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===fn||e.mode===Ei)&&(m=Math.sin(o),h=Math.cos(o)),e.mode){case Ei:o=Math.abs(d)<=1e-10?0:Oi(0,1,m,h,r,n,d),r*=m,n=h*d;break;case fn:o=Math.abs(d)<=1e-10?e.lat0:Oi(e.sinph0,e.cosph0,m,h,r,n,d),r*=m*e.cosph0,n=(h-Math.sin(o)*e.sinph0)*d;break;case Po:n=-n,o=F-o;break;case $i:o-=F;break}i=n===0&&(e.mode===Ei||e.mode===fn)?0:Math.atan2(r,n)}else{if(u=0,e.mode===fn||e.mode===Ei){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=Oi(e.mode===fn?e.sinb1:0,e.mode===fn?e.cosb1:1,a,s,r,n,l);o=wx(e.e,e.qp,y),r*=a,e.mode===fn?(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===Po||e.mode===$i){if(e.mode===Po&&(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===$i&&(u=-u)}if(i=Math.atan2(r,n),Math.abs(u)>1+8*Number.EPSILON)return null;if(e.mode===Po||e.mode===$i){let g=Math.max(0,Math.min(2,c/e.qp)),y=Math.atan2(u,Math.sqrt(g*(2-g)));o=wx(e.e,e.qp,y)}}return t.x=k(e.long0+i,e.over),t.y=o,t}function EL(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 H$(t),t}var $i,Po,Ei,fn,AL=p(()=>{Bt();Hh();xt();xx();Of();$i=1,Po=2,Ei=3,fn=4});var _x,TL=p(()=>{xx();Us();js();Fn();AL();_x={name:"laea",aliases:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area"],parameters:vr,create(e){let t=br(e),r=EL(t);return bn(Ds(t,lr("laea",r,ML,vL)),t,Math.PI*179/180,(n,i)=>_8(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:bx(t.e,r.qp,t.lat0),t.sphere?o=>o:o=>bx(t.e,r.qp,o)))}}});function i1(e,t){return Math.pow((1-e)/(1+e),t)}var IL=p(()=>{});function K$(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+Qe)/(Math.pow(Math.tan(.5*e.lat0+Qe),e.C)*i1(e.e*t,e.ratexp))}function PL(e,t){var r=t.x,n=t.y;return t.y=2*Math.atan(e.K*Math.pow(Math.tan(.5*n+Qe),e.C)*i1(e.e*Math.sin(n),e.ratexp))-F,t.x=e.C*r,t}function RL(e,t){for(var r=1e-14,n=t.x/e.C,i=t.y,o=Math.pow(Math.tan(.5*i+Qe)/e.K,1/e.C),s=$$;s>0&&(i=2*Math.atan(o*i1(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 LL(e){let t={...e,rc:0,C:0,phic0:0,ratexp:0,K:0};return K$(t),t}var $$,OL=p(()=>{IL();Bt();$$=20});function X$(e){e.rc&&(e.sinc0=Math.sin(e.phic0),e.cosc0=Math.cos(e.phic0),e.R2=2*e.rc)}function BL(e,t){var r,n,i,o;return t.x=k(t.x-e.long0,e.over),PL(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 CL(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=Jt(t.x,t.y),s){var a=2*Math.atan2(s,e.R2);r=Math.sin(a),n=Math.cos(a),o=Oi(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,!RL(e,t))throw new Error("Oblique stereographic inverse did not converge");return t.x=k(t.x+e.long0,e.over),t}function DL(e){let t={...LL(e),sinc0:0,cosc0:0,R2:0};return X$(t),t}var NL=p(()=>{Of();OL();xt();lc()});var Sx,FL=p(()=>{Us();js();Fn();NL();Sx={name:"sterea",aliases:["Stereographic_North_Pole","Oblique_Stereographic","Oblique Stereographic Alternative","Double_Stereographic"],parameters:[...vr,...Vo],create(e){let t=br(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=DL(t);return bn(Ds(t,lr("sterea",r,BL,CL)),t,Math.PI*150/180,(n,i)=>Om(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 Mx(e,t){let r=1-e*Math.sin(t)**2;return(1-e)/(r*Math.sqrt(r))}function o1(e,t,r,n){return Mx(e,t-r*n)+Mx(e,t+r*n)}function si(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*o1(t,a,i,.1834346424956498)+.3137066458778873*o1(t,a,i,.525532409916329)+.2223810344533745*o1(t,a,i,.7966664774136267)+.1012285362903763*o1(t,a,i,.9602898564975363))}return e*o}function vx(e,t,r){let n=Math.PI/2,i=si(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=si(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*Mx(t,a));a=u>o&&u<s?u:(o+s)/2}return NaN}var Ex=p(()=>{});function GL(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,T,O,P,_,U,C,L,A,W,G;do{if(w=Math.sin(g),S=Math.cos(g),M=Math.sqrt(m*w*(m*w)+(h*d-u*m*S)*(h*d-u*m*S)),M===0){s.x=0,s.y=0;return}v=u*d+h*m*S,T=Math.atan2(M,v),O=h*m*w/M,P=1-O*O,_=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*M*(_+U*v*(-1+2*_*_)))}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*M*(_+A/4*(v*(-1+2*_*_)-A/6*_*(-3+4*M*M)*(-3+4*_*_))),G=i*(1-o)*L*(T-W);let E=Math.atan2(m*w,h*d-u*m*S);s.x=E,s.y=G}function kL(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))),S=n/(i*(1-o)*b),M,v=100,T,O,P,_;do T=Math.cos(2*d+S),O=Math.sin(S),P=Math.cos(S),_=w*O*(T+w/4*(P*(-1+2*T*T)-w/6*T*(-3+4*O*O)*(-3+4*T*T))),M=S,S=n/(i*(1-o)*b)+_;while(Math.abs(S-M)>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*(S+A*O*(T+A*P*(-1+2*T*T))),G=t+W;s.x=G,s.y=C}var UL=p(()=>{});function Y$(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 jL(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=si(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=si(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;GL(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 zL(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=Oi(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=si(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=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=si(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=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),kL(e.lat0,e.long0,h,d,e.a,e.f,t),t)}function qL(e){let t={...e,sin_p12:0,cos_p12:0,f:0};return Y$(t),t}var VL=p(()=>{Of();xt();Bt();Ex();UL()});var Ax,WL=p(()=>{Us();js();Fn();VL();Ax={name:"aeqd",aliases:["Azimuthal_Equidistant"],parameters:vr,create(e){let t=br(e),r=qL(t);return bn(Ds(t,lr("aeqd",r,jL,zL)),t,Math.PI*179/180,(n,i)=>x8(t,n,i))}}});var Tx,HL=p(()=>{zh();cx();Tx={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:ja({},n)().normalize}),forward(){throw new Error("Geocentric projection requires the 3D pipeline")},inverse(){throw new Error("Geocentric projection requires the 3D pipeline")},forwardInPlace:o=>Yp(o,i),inverseInPlace:o=>Zp(o,i),forward3D:o=>CR(o,i),inverse3D:o=>DR(o,i)}}}});function $L(e,t,r){let n=Rs(Or(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=hi(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 ct([e.x0-a,e.x0+a],[o[0]-c,o[1]+c])}function KL(e,t,r){let n=Rs(Or(r,e.long0,e.over)),i=e.a/Math.sqrt(1-e.es),o=i*n*n/4,s=hi(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]),ct([e.x0-i*n,e.x0+i*n],[s[0]-o,s[1]+o])}function XL(e,t,r){let n=Rs(Or(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=hi(t(e.long0,r[0][1])[1],t(e.long0,r[1][1])[1]);return ct([e.x0-s,e.x0+s],[c[0]-a,c[1]+a])}function Ix(e,t){return t[0]<=0&&t[1]>=0?[-1/0,1/0]:Lt(e,hi(1/t[0],1/t[1]))}function YL(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=ht([-Math.sin(e.b0),0,Math.cos(e.b0)],n);if(Rs(i)>=1-1e-14)throw new Error("Swiss oblique Mercator coverage reaches a rotated pole");let o=ht([0,1,0],n),s=ht([Math.cos(e.b0),0,Math.sin(e.b0)],n),a=Ix(o,s).map(Math.atan),c=i.map(l=>Math.atanh(Math.max(-1+Number.EPSILON,Math.min(1-Number.EPSILON,l))));return ct(Ce([e.x0,e.x0],Fe(a,e.R)),Ce([e.y0,e.y0],Fe(c,e.R)))}function ZL(e,t){let r=g=>Math.log(e.E)-e.B*Math.log(Jr(e.e,g,Math.sin(g))),n=hi(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=ht([0,-e.cosgam,e.singam],o),a=Fe(hi(-Math.atanh(s[0]),-Math.atanh(s[1])),e.ArB),c=Ce(Fe([Math.sinh(n[0]),Math.sinh(n[1])],e.cosgam),Fe(If(i),e.singam)),l=Sm(i),u=l[0]>0?Ix(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))),ct(Ce([e.x0,e.x0],Fe(d,e.a)),Ce([e.y0,e.y0],Fe(m,e.a)))}function JL(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(Or(t,e.long0,e.over),-e.alfa),i=Q(n[0],r(t[0][1]),n[1],r(t[1][1])),o=ht([Math.sin(e.ad),0,Math.cos(e.ad)],i),s=[Math.sqrt(Math.max(Number.EPSILON,1-Rs(o)**2)),1],a=ht([0,1,0],i),c=Ix(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=hi(u(o[0]),u(o[1])),d=e.czech?1:-1;return ct(Ce([e.x0,e.x0],Fe(Lt(h,If(l)),d)),Ce([e.y0,e.y0],Fe(Lt(h,Sm(l)),d)))}function QL(e,t){let r=Fe([t[0][1]-e.lat0,t[1][1]-e.lat0],1e-5/Rf),n=Or(t,e.long0,e.over),i=[0,0];for(let l=10;l>=1;l--)i=Ce([e.A[l],e.A[l]],Lt(i,r));i=Lt(i,r);let o=[0,0],s=[0,0];for(let l=6;l>=1;l--){let u=Ce(Lt(o,i),Fe(Lt(s,n),-1)),h=Ce(Lt(o,n),Lt(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(Lt(o,i),Fe(Lt(s,n),-1)),c=Ce(Lt(o,n),Lt(s,i));return ct(Ce([e.x0,e.x0],Fe(c,e.a)),Ce([e.y0,e.y0],Fe(a,e.a)))}var qa=p(()=>{Je();fc();Ot();Bf();Bt()});function Te(e){let t=br(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=lr(e,r,n,i),a=re(t.parameters,"x_0",0),c=re(t.parameters,"y_0",0);return di(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 Va(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 kt=p(()=>{ac();Fn();qt()});function Z$(e){var t;if(e.phi1=e.lat1,Math.abs(e.phi1)<Kh)throw new Error;e.es?(e.en=co(e.es),e.am1=Math.sin(e.phi1),t=Math.cos(e.phi1),e.m1=wr(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)+Kh>=F?e.cphi1=0:e.cphi1=1/Math.tan(e.phi1)}function J$(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-wr(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 Q$(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=Jt(t.x,t.y),e.phi1<0&&(n=-n),o=lo(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)<=Kh)i=0;else throw new Error;return t.x=k(i+(e.long0||0),e.over),t.y=ws(o),t}function eK(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)>Kh?(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 tK(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=Jt(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)<=Kh?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=ws(n),t}function eO(e,t){return e.es?J$(e,t):eK(e,t)}function tO(e,t){return e.es?Q$(e,t):tK(e,t)}function rO(e,t={}){let r={...e,phi1:0,en:[],m1:0,am1:0,cphi1:0,...t};return Z$(r),r}var Kh,nO=p(()=>{$h();xt();lc();Hl();$l();uc();Bt();Kh=1e-10});var Px,iO=p(()=>{qa();Je();lt();kt();nO();Px={name:"bonne",aliases:["Bonne (Werner lat_1=90)"],parameters:["lon_0","x_0","y_0","lat_1"],create(e){let t=Te(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=rO(t),n=Ie("bonne",e,r,eO,tO);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>$L(Gt(r,e),n.forward,i),t.primeMeridian,t.over)}}});function Fu(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}var Rx=p(()=>{});function rK(e){e.sphere||(e.en=co(e.es),e.ml0=e.a*wr(e.lat0,Math.sin(e.lat0),Math.cos(e.lat0),e.en))}function Ox(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=Fu(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*wr(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 oO(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=lo(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=Fu(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 S=0;S<12;S++){Lx(e,o,i);let M=b.x-g,v=b.y-y;if(Math.max(Math.abs(M),Math.abs(v))<1e-7){w=!0;break}let T=1e-7,O=i>F-T?-T:T,P=b.x,_=b.y;Lx(e,o+T,i);let U=(b.x-P)/T,C=(b.y-_)/T;Lx(e,o,i+O);let L=(b.x-P)/O,A=(b.y-_)/O,W=U*A-L*C;if(!Number.isFinite(W)||Math.abs(W)<1e-12||(o-=(A*M-L*v)/W,i-=(U*v-C*M)/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=ws(i),t}function Lx(e,t,r){e.scratch.x=t+e.long0,e.scratch.y=r,Ox(e,e.scratch)}function sO(e,t={}){let r={...e,en:[],scratch:{x:0,y:0},ml0:0,...t};return rK(r),r}var aO=p(()=>{Hl();uc();$l();Rx();xt();$h();Bt()});var Bx,cO=p(()=>{qa();Je();lt();kt();aO();Bx={name:"cass",aliases:["Cassini","Cassini_Soldner"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e),r=sO(t),n=Ie("cass",e,r,Ox,oO);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=>XL(Gt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function nK(e){e.sphere||(e.k0=wn(e.e,Math.sin(e.lat_ts),Math.cos(e.lat_ts)))}function lO(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=un(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 uO(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=n1(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 fO(e,t={}){let r={...e,...t};return nK(r),r}var hO=p(()=>{xt();Hh();Kl();px()});var Cx,dO=p(()=>{Ot();Je();lt();kt();hO();Cx={name:"cea",aliases:[],parameters:["lon_0","x_0","y_0","lat_ts"],create(e){let t=Te(e);if(Math.abs(t.lat_ts)>=Math.PI/2)throw new Error("CEA standard parallel must be away from the poles");let r=fO(t),n=Ie("cea",e,r,lO,uO);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 il(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}var s1=p(()=>{});function oK(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=co(e.es)}function a1(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=iK;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*wr(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 c1(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=il(s)}else e.n!==1&&(r=il(Math.sin(r)/e.n));i=k(i+e.long0,e.over),r=ws(r)}else r=lo(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 mO(e,t={}){let r={...e,en:[],n:0,m:0,C_y:0,C_x:0,...t};return oK(r),r}var iK,Dx=p(()=>{xt();$h();Hl();uc();$l();Bt();s1();iK=20});function sK(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 yO(e,t={}){let r={...e,m:0,n:0,C_y:0,C_x:0,en:[],...t};return sK(r),r}var pO,gO,bO=p(()=>{Dx();pO=a1,gO=c1});var Nx,wO=p(()=>{Ot();Je();lt();kt();bO();Nx={name:"eck6",aliases:["Eckert_VI"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=yO(t),n=Ie("eck6",e,r,pO,gO);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 Fx(e){var t,r=[];return r[0]=e*aK,t=e*e,r[0]+=t*cK,r[1]=t*uK,t*=e,r[0]+=t*lK,r[1]+=t*fK,r[2]=t*hK,r}var aK,cK,lK,uK,fK,hK,xO=p(()=>{aK=.3333333333333333,cK=.17222222222222222,lK=.10257936507936508,uK=.06388888888888888,fK=.0664021164021164,hK=.016415012942191543});function Gx(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 _O=p(()=>{});function dK(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=Fx(e.es),e.qp=un(e.e,1),e.rqda=Math.sqrt(.5*e.qp))}function SO(e,t){var r=k(t.x-e.long0,e.over),n=t.y,i=Math.sin(n);e.es!==0&&(i=un(e.e,i)/e.qp);var o=Math.asin(l1*i),s=o*o,a=s*s*s;return t.x=r*Math.cos(o)/(l1*(Gu+3*ku*s+a*(7*Uu+9*ju*s))),t.y=o*(Gu+ku*s+a*(Uu+ju*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 MO(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*(Gu+ku*n+n**3*(Uu+ju*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*(Gu+ku*c+l*(Uu+ju*c))-t.y,h=Gu+3*ku*c+l*(7*Uu+9*ju*c),a-=d=u/h,!(Math.abs(d)<o));++m);c=a*a,l=c*c*c,t.x=l1*t.x*(Gu+3*ku*c+l*(7*Uu+9*ju*c))/Math.cos(a);let g=Math.sin(a)/l1,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=Gx(t.y,e.apa)),t.x=k(t.x+e.long0,e.over),t)}function vO(e,t={}){let r={...e,apa:[],qp:0,rqda:0,...t};return dK(r),r}var Gu,ku,Uu,ju,l1,EO=p(()=>{xt();Hh();xO();_O();Gu=1.340264,ku=-.081106,Uu=893e-6,ju=.003796,l1=Math.sqrt(3)/2});var kx,AO=p(()=>{qt();kt();EO();Je();lt();Ot();kx={name:"eqearth",aliases:["Equal Earth","Equal_Earth"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=e.primeMeridian??0,n=vO(t),i=Ie("eqearth",e,n,SO,MO),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 cr(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:cr(()=>y,Nn(Q(t.long0-Math.PI,-(Math.PI/2),t.long0+Math.PI,Math.PI/2),r),t.long0,r,t.over).normalize}}}}}});function mK(e){e.x0=e.x0||0,e.y0=e.y0||0,e.lat0=e.lat0||0,e.long0=e.long0||0}function TO(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 IO(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 PO(e,t={}){let r={...e,t2:0,t1:0,...t};return mK(r),r}var RO=p(()=>{xt()});var Ux,LO=p(()=>{Ot();Je();lt();kt();RO();Ux={name:"equi",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e);if(Math.abs(t.lat0)>=Math.PI/2)throw new Error("Equirectangular standard parallel must be away from the poles");let r=PO(t),n=Ie("equi",e,r,TO,IO);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 OO(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))),S=Math.max(h[0][1],-w),M=Math.min(h[1][1],w);if(b<y||M<S)return null;let v=Q(y,S,b,M),T=Nn(Q(y+e.long0,S,b+e.long0,M),e.primeMeridian),O=(e.long0+e.primeMeridian)*180/Math.PI,P=Os(_=>{let U=Math.max(y,Math.min(b,Kt(_.x-e.long0))),C=s(U),L=Math.max(Math.max(S,-C),Math.min(Math.min(M,C),_.y));U!==_.x-e.long0&&(_.x=U+e.long0),_.y=L},e.primeMeridian);return{get bounds(){if(!d)return ct([e.x0-a,e.x0+a],[e.y0-c,e.y0+c]);let _=ht([0,0,1],v),U=[1,1/Math.sqrt(1-e.es*Math.max(_[0]**2,_[1]**2))],C=Lt(ht([1,0,0],v),U),L=Lt(ht([0,1,0],v),U),A=Lt(_,[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 ct(Ce([e.x0,e.x0],G(L,A,a,r)),Ce([e.y0,e.y0],G(A,L,c,!r)))},normalize(_){Em(_,T,O),P(_)}}},u=Nn(Q(e.long0-o(0),-s(0),e.long0+o(0),s(0)),e.primeMeridian);return h=>{let d=h?Mm(h,u):[u],m=vm(d,g=>l(Ls(g,e.primeMeridian,e.long0),!!h));if(!m)throw new Error("CRS coverage does not intersect the satellite limb");return m}}var BO=p(()=>{Je();sc();lt();qt();fc();Ot()});function pK(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 CO(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/Jt(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/Jt(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/Jt(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/Jt(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/Jt(s,i))));return t.x=t.x*e.a,t.y=t.y*e.a,t}function DO(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)*Jt(1,i)):(n=Math.tan(t.x/e.radius_g_1),i=Math.tan(t.y/e.radius_g_1)*Jt(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 NO(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 pK(r),r}var FO=p(()=>{lc()});var jx,GO=p(()=>{BO();kt();FO();qt();jx={name:"geos",aliases:["Geostationary Satellite View","Geostationary_Satellite"],parameters:["lon_0","x_0","y_0","h","sweep"],create(e){let t=Te(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=NO(t,{h:r,sweep:n});return{...Ie("geos",e,i,CO,DO,t.sphere?Va({...t,lat0:0},1/(1+r/t.a),!0):void 0),longitudeOrigin:t.long0,getRenderingProfile:OO(Gt(t,e),r,n==="x")}}}});function kO(e){return{engine:O4({semiMajorAxis:1,semiMinorAxis:Math.sqrt(1-e.es)}),latitude:e.lat0*ol}}function UO(e,t,r){let n=t.engine.Inverse(t.latitude,0,r.y*ol,k(r.x-e.long0,e.over)*ol,Af);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/ol;return r.x=e.x0+i*Math.sin(o),r.y=e.y0+i*Math.cos(o),r}function jO(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)*ol,Af),a=o<=1,c=a?o:1/o,l=Math.atan(o);for(let u=0;u<20;u++){let h=s.Position(l,Af),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,Af);if(!(m.M12>0))break;return r.x=k(e.long0+m.lon2/ol,e.over),r.y=m.lat2/ol,r}}throw new Error("Ellipsoidal gnomonic inverse did not converge")}var ol,zO=p(()=>{B4();xt();ol=180/Math.PI});function gK(e){e.sphere||(e.ellipsoid=kO(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 qO(e,t){if(e.ellipsoid)return UO(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 VO(e,t){if(e.ellipsoid)return jO(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=il(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 WO(e,t={}){let r={...e,sin_p14:0,cos_p14:0,infinity_dist:0,rc:0,phic0:0,...t};return gK(r),r}var HO=p(()=>{zO();xt();s1()});var zx,$O=p(()=>{Us();js();kt();HO();zx={name:"gnom",aliases:[],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e),r=WO(t);return bn(Ie("gnom",e,r,qO,VO,t.sphere?Va(t):void 0),t,Math.min(Math.PI*80/180,(1-t.es)*Math.PI*.45),(n,i)=>t.sphere?Lm(Gt(t,e),n,i,"gnom"):M8(Gt(t,e),n,i),(1-t.es)*Math.PI/2)}}});function qx(e,t){return 2*Math.atan(e*Math.exp(t))-F}var KO=p(()=>{Bt()});function u1(e,t){var r=qx(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=qx(Math.exp(e*Math.log((1+i)/(1-i))/2),t)}while(Math.abs(r-n)>1e-12);return r}var Vx=p(()=>{KO()});function zu(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 XO=p(()=>{Bt()});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=zu(0,n,i)-e.rs*zu(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 YO(e,t){var r=t.x,n=t.y,i=e.rs*(r-e.lc),o=e.cp+e.rs*zu(e.e,n,Math.sin(n)),s=Math.asin(Math.sin(i)/Pf(o)),a=zu(0,s,Math.sin(s));return t.x=e.xs+e.n2*a,t.y=e.ys+e.n2*Math.atan(cc(o)/Math.cos(i)),t}function ZO(e,t){var r=t.x,n=t.y,i=Math.atan(cc((r-e.xs)/e.n2)/Math.cos((n-e.ys)/e.n2)),o=Math.asin(Math.sin((n-e.ys)/e.n2)/Pf((r-e.xs)/e.n2)),s=zu(0,o,Math.sin(o));return t.x=e.lc+i/e.rs,t.y=u1(e.e,(s-e.cp)/e.rs),t}function JO(e,t={}){let r={...e,lc:0,rs:0,cp:0,n2:0,xs:0,ys:0,...t};return yK(r),r}var QO=p(()=>{XO();Tm();Iy();Vx()});var Wx,eB=p(()=>{Ot();Vx();Je();lt();kt();QO();Wx={name:"gstmerc",aliases:["gstmerg"],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Te(e),r=JO(t),n=Ie("gstmerc",e,r,YO,ZO);return De(n,Q(t.long0-Math.PI/6,-Math.PI/3,t.long0+Math.PI/6,Math.PI/3),i=>zl(n.forward,i,t.long0,t.over,u1(r.e,-r.cp/r.rs)),t.primeMeridian,t.over)}}});function bK(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 tB(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 rB(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 nB(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 bK(r),r}var iB=p(()=>{xt()});var Hx,oB=p(()=>{qa();Je();lt();kt();iB();qt();Fn();Hx={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=Te(e);n.lat0=Cs(e.parameters,"lat_0",49.5),n.long0=Cs(e.parameters,"lon_0",24.83333333333333),n.k0=re(e.parameters,"k_0",re(e.parameters,"k",.9999));let i=nB(n,{czech:Ri(e.parameters,"czech")}),o=Ie("krovak",e,i,tB,rB);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=>JL(Gt(i,e),s),n.primeMeridian,n.over)}}});function sB(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 aB(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 cB(e,t={}){let r={...e,...t};return r}var lB=p(()=>{xt()});var $x,uB=p(()=>{Ot();Je();lt();kt();lB();$x={name:"mill",aliases:["Miller_Cylindrical"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=cB(t),n=Ie("mill",e,r,sB,aB);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 wK(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 fB(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=mB(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 hB(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(mB(s)/(2*Math.PI))));return t.x=l,t.y=u,t}function dB(e,t={}){let r={...e,...t};return wK(r),r}function mB(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 pB=p(()=>{xt()});var Kx,gB=p(()=>{Ot();Je();lt();kt();pB();Kx={name:"moll",aliases:["Mollweide"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=dB(t),n=Ie("moll",e,r,fB,hB);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 xK(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 yB(e,t){var r,n=t.x,i=t.y,o=i-e.lat0,s=n-e.long0,a=o/Rf*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,S=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,S=S+e.B_im[r]*m+e.B_re[r]*g;return t.x=S*e.a+e.x0,t.y=w*e.a+e.y0,t}function bB(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,v=a,T=c;for(r=2;r<=6;r++)S=b*m-w*g,M=w*m+b*g,b=S,w=M,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++)S=b*m-w*g,M=w*m+b*g,b=S,w=M,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 _=O*O+P*P;m=(v*O+T*P)/_,g=(T*O-v*P)/_}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*Rf*1e5,G=e.long0+C;return t.x=G,t.y=W,t}function wB(e,t={}){let r={...e,A:[],B_re:[],B_im:[],C_re:[],C_im:[],D:[],iterations:1,...t};return xK(r),r}var xB=p(()=>{Bt()});var Xx,_B=p(()=>{qa();Je();lt();kt();xB();qt();Xx={name:"nzmg",aliases:["New_Zealand_Map_Grid"],parameters:["lon_0","x_0","y_0","lat_0","iterations"],create(e){let t=Te(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=wB(t,{iterations:r}),i=Ie("nzmg",e,n,yB,bB);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=>QL(Gt(n,e),o),t.primeMeridian,t.over)}}});function _K(e){return e.no_uoff||e.no_off||["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(e.projName.toLowerCase().replace(/[ _-]/g,""))}function SK(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,S=0;e.k0||(e.k0=1),e.no_off=_K(e),e.no_rot=e.no_rot;var M=!1;Number.isFinite(e.alpha)&&(M=!0);var v=!1;if(Number.isFinite(e.rectified_grid_angle)&&(v=!0),M&&(S=e.alpha),v&&(h=e.rectified_grid_angle,M||(S=0,M=!0)),M||v)m=e.longc;else if(g=e.long1,b=e.lat1,y=e.long2,w=e.lat2,Math.abs(b-w)<=qu||Math.abs(b)<=qu||Math.abs(Math.abs(b)-F)<=qu||Math.abs(Math.abs(e.lat0)-F)<=qu||Math.abs(Math.abs(w)-F)<=qu)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(Jr(e.e,e.lat0,c),e.B)):(e.B=1/r,e.A=e.k0,e.E=i=o=1),M||v){M?(d=Math.asin(Math.sin(S)/i),v||(h=S)):(d=h,S=Math.asin(i*Math.sin(d)));let O=.5*(o-1/o)*Math.tan(d);i>1&&Math.abs(Math.cos(S))<=8*Number.EPSILON?O=Math.sign(e.lat0)*Math.sign(Math.sin(S)):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(Jr(e.e,b,Math.sin(b)),e.B),a=Math.pow(Jr(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-=Ns:t>Math.PI&&(y+=Ns),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=S=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(S))),e.lat0<0&&(e.u_0=-e.u_0)),o=.5*d,e.v_pole_n=e.ArB*Math.log(Math.tan(Qe-o)),e.v_pole_s=e.ArB*Math.log(Math.tan(Qe+o))}function SB(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(Jr(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)<qu?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 MB(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=hc(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 vB(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 SK(r),r}var qu,EB=p(()=>{Bf();xt();Bm();Bt();qu=1e-7});var Yx,AB=p(()=>{qa();Je();lt();kt();EB();qt();Fn();Yx={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=Te(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=vB(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:Ri(e.parameters,"no_off"),no_uoff:Ri(e.parameters,"no_uoff"),no_rot:Ri(e.parameters,"no_rot")}),o=Ie("omerc",e,i,SB,MB);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=>ZL(Gt(i,e),s),t.primeMeridian,t.over)}}});function TB(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 IB(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 PB(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 RB=p(()=>{xt()});var Zx,LB=p(()=>{Us();js();kt();RB();Zx={name:"ortho",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Te(e),r=TB(t);return bn(Ie("ortho",e,r,IB,PB,Va(t,0,!0)),t,Math.PI/2,(n,i)=>w8(Gt(t,e),n,i),Math.PI/2)}}});function MK(e){e.meridianPole=si(e.a,e.es,0,Math.PI/2),e.poleRadius=e.a/Math.sqrt(1-e.es),e.ml0=si(e.a,e.es,0,e.lat0)}function CB(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=Fu(e.a,e.e,Math.sin(n))/Math.tan(n);i=c*Math.sin(s),o=si(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 DB(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=OB;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=BB(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,M,v,T;for(s=OB;s;--s)if(T=e.e*Math.sin(l),w=Math.sqrt(1-T*T)*Math.tan(l),S=si(e.a,e.es,0,l),M=(1-e.es)/Math.pow(1-T*T,1.5),v=S/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*M-2/Math.sin(2*l))-M),l-=u,Math.abs(u)<=1e-14){n=l;break}if(n=BB(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 NB(e,t={}){let r={...e,ml0:0,meridianPole:0,poleRadius:0,...t};return MK(r),r}function BB(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:Fu(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):si(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),S=c*((e.sphere?0:e.es*s*s/a)-1/(o*o)),M=w+S*(-d/Math.cos(u)),v=b/M;if(!Number.isFinite(v)||Math.abs(v)>1e-6)return;t-=v}}var OB,FB=p(()=>{xt();Rx();Ex();OB=20});var Jx,GB=p(()=>{qa();Je();lt();kt();FB();Jx={name:"poly",aliases:["Polyconic","American_Polyconic"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e),r=NB(t),n=Ie("poly",e,r,CB,DB);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=>KL(Gt(t,e),n.forward,i),t.primeMeridian,t.over)}}});function vK(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-Qe/2?e.face=Ut.TOP:e.lat0<=-(F-Qe/2)?e.face=Ut.BOTTOM:Math.abs(e.long0)<=Qe?e.face=Ut.FRONT:Math.abs(e.long0)<=F+Qe?e.face=e.long0>0?Ut.RIGHT:Ut.LEFT:e.face=Ut.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 kB(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===Ut.TOP)s=F-n,i>=Qe&&i<=F+Qe?(l=dt.AREA_0,o=i-F):i>F+Qe||i<=-(F+Qe)?(l=dt.AREA_1,o=i>0?i-Math.PI:i+Math.PI):i>-(F+Qe)&&i<=-Qe?(l=dt.AREA_2,o=i+F):(l=dt.AREA_3,o=i);else if(e.face===Ut.BOTTOM)s=F+n,i>=Qe&&i<=F+Qe?(l=dt.AREA_0,o=-i+F):i<Qe&&i>=-Qe?(l=dt.AREA_1,o=-i):i<-Qe&&i>=-(F+Qe)?(l=dt.AREA_2,o=-i-F):(l=dt.AREA_3,o=i>0?-i+Math.PI:-i-Math.PI);else{var u,h,d,m,g,y,b;e.face===Ut.RIGHT?i=Vu(i,+F):e.face===Ut.BACK?i=Vu(i,+Math.PI):e.face===Ut.LEFT&&(i=Vu(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===Ut.FRONT?(s=Math.atan2(Math.hypot(h,d),u),o=f1(s,d,h)):e.face===Ut.RIGHT?(s=Math.atan2(Math.hypot(u,d),h),o=f1(s,d,-u)):e.face===Ut.BACK?(s=Math.atan2(Math.hypot(h,d),-u),o=f1(s,d,-h)):e.face===Ut.LEFT?(s=Math.atan2(Math.hypot(u,d),-h),o=f1(s,d,u)):s=o=0,Math.abs(o)<=Qe?l=dt.AREA_0:o>Qe&&o<=F+Qe?(l=dt.AREA_1,o-=F):o>F+Qe||o<=-(F+Qe)?(l=dt.AREA_2,o=o>=0?o-Math.PI:o+Math.PI):(l=dt.AREA_3,o+=F)}return c=Math.atan(12/Math.PI*(o+Math.acos(Math.sin(o)*Math.cos(Qe))-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===dt.AREA_1?c+=F:l===dt.AREA_2?c+=Math.PI:l===dt.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 UB(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=dt.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d=dt.AREA_1,i-=F):t.x<0&&-t.x>=Math.abs(t.y)?(d=dt.AREA_2,i=i<0?i+Math.PI:i-Math.PI):(d=dt.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===Ut.TOP)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=F-u,d===dt.AREA_0?r=c+F:d===dt.AREA_1?r=c<0?c+Math.PI:c-Math.PI:d===dt.AREA_2?r=c-F:r=c;else if(e.face===Ut.BOTTOM)u=2*Math.asin(Math.sqrt(Math.min(1,m/2))),n=u-F,d===dt.AREA_0?r=-c+F:d===dt.AREA_1?r=-c:d===dt.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===dt.AREA_1?(h=y,y=-b,b=h):d===dt.AREA_2?(y=-y,b=-b):d===dt.AREA_3&&(h=y,y=b,b=-h),e.face===Ut.RIGHT?(h=g,g=-y,y=h):e.face===Ut.BACK?(g=-g,y=-y):e.face===Ut.LEFT&&(h=g,g=y,y=-h),n=Math.atan2(b,Math.hypot(g,y)),r=Math.atan2(y,g),e.face===Ut.RIGHT?r=Vu(r,-F):e.face===Ut.BACK?r=Vu(r,-Math.PI):e.face===Ut.LEFT&&(r=Vu(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 f1(e,t,r){return e===0?0:Math.atan2(t,r)}function Vu(e,t){var r=e+t;return r<-Math.PI?r+=Ns:r>+Math.PI&&(r-=Ns),r}function jB(e,t={}){let r={...e,face:0,one_minus_f:0,one_minus_f_squared:0,...t};return vK(r),r}var Ut,dt,zB=p(()=>{Bt();Ut={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},dt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4}});var Qx,qB=p(()=>{sc();zh();kt();qt();zB();Je();lt();fc();Ot();Qx={name:"qsc",aliases:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(e),r=e.primeMeridian??0,n=jB(t),i=Ie("qsc",e,n,kB,UB),o=re(e.parameters,"x_0",0),s=re(e.parameters,"y_0",0);return{...i,longitudeOrigin:t.long0,getRenderingProfile(a){if(a)return cr(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=ht(g,m)[0],b=t.a*Math.sqrt((1-y)/(.5*(1-Math.SQRT1_2)));return ct([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=ja(e.parameters,r)().normalize,u=Os(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 TK(e,t,r,n,i){for(var o=r;i;--i){var s=(h1(e,o)-t)/AK(e,o);if(o-=s,Math.abs(s)<n)break}return o}function IK(e){e.x0=e.x0||0,e.y0=e.y0||0,e.long0=e.long0||0,e.es=0}function $B(e,t){var r=k(t.x-e.long0,e.over),n=Math.abs(t.y),i=Math.floor(n*HB+1e-15);i<0?i=0:i>=sl&&(i=sl),n=Ly*(n-EK*i);var o=h1(Wu[i],n)*r,s=h1(Wa[i],n);return t.y<0&&(s=-s),t.x=o*e.a*VB+e.x0,t.y=s*e.a*WB+e.y0,t}function KB(e,t){var r=t.y,n=t;n.x=(n.x-e.x0)/(e.a*VB),n.y=Math.abs(r-e.y0)/(e.a*WB);for(let a=0;a<=sl;a++)if(Math.abs(n.y-Wa[a][0])<=8*Number.EPSILON)return n.x=k(n.x/Wu[a][0]+e.long0,e.over),n.y=(r<e.y0?-1:1)*a*5*Ry,n;if(n.y>=1)n.x/=Wu[sl][0],n.y=r<0?-F:F;else{var i=Math.floor(n.y*sl);for(i<0?i=0:i>=sl&&(i=sl-1);;)if(Wa[i][0]>n.y)--i;else if(Wa[i+1][0]<=n.y)++i;else break;var o=Wa[i],s=5*(n.y-o[0])/(Wa[i+1][0]-o[0]);s=TK(o,n.y,s,1e-10,100),n.x/=h1(Wu[i],s),n.y=(5*i+s)*Ry,r<0&&(n.y=-n.y)}return n.x=k(n.x+e.long0,e.over),n}function XB(e,t={}){let r={...e,...t};return IK(r),r}var Wu,Wa,VB,WB,HB,EK,sl,h1,AK,YB=p(()=>{Bt();xt();Wu=[[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]],Wa=[[-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]];Wu=Wu.map(e=>e.map(Math.fround));Wa=Wa.map(e=>e.map(Math.fround));VB=.8487,WB=1.3523,HB=Ly/5,EK=1/HB,sl=18,h1=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},AK=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])}});var e_,ZB=p(()=>{Ot();Je();lt();kt();YB();e_={name:"robin",aliases:["Robinson"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=XB(t),n=Ie("robin",e,r,$B,KB);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 t_,JB=p(()=>{Ot();Je();lt();kt();Dx();t_={name:"sinu",aliases:["Sinusoidal"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=mO(t),n=Ie("sinu",e,r,a1,c1);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 PK(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 QB(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 eC(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 tC(e,t={}){let r={...e,lambda0:0,rf:0,R:0,alpha:0,b0:0,K:0,...t};return PK(r),r}var rC=p(()=>{});var r_,nC=p(()=>{qa();Je();lt();kt();rC();r_={name:"somerc",aliases:[],parameters:["lon_0","x_0","y_0","lat_0","k","k_0"],create(e){let t=Te(e),r=tC(t,{rf:t.a===t.b?1/0:1/(1-t.b/t.a)}),n=Ie("somerc",e,r,QB,eC);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=>YL(Gt(r,e),i),t.primeMeridian,t.over)}}});function RK(e){if(Math.abs(Math.abs(e.lat0)-F)<1e-10?e.mode=e.lat0<0?$r.S_POLE:$r.N_POLE:Math.abs(e.lat0)<1e-10?e.mode=$r.EQUIT:(e.mode=$r.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 $r.OBLIQ:s=e.sinph0*r+e.cosph0*n*i;break;case $r.EQUIT:s=n*i;break;case $r.S_POLE:s=-r;break;case $r.N_POLE:s=r;break}switch(s=e.pn1/(e.p-s),o=s*n*Math.sin(t.x),e.mode){case $r.OBLIQ:s*=e.cosph0*r-e.sinph0*n*i;break;case $r.EQUIT:s*=r;break;case $r.N_POLE:s*=-(n*i);break;case $r.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 oC(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=Jt(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 $r.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 $r.EQUIT:n=Math.asin(t.y*l/a),t.y=c*a,t.x*=l;break;case $r.N_POLE:n=Math.asin(c),t.y=-t.y;break;case $r.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 sC(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 RK(r),r}var $r,aC=p(()=>{Bt();lc();$r={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3}});var n_,cC=p(()=>{Us();js();kt();aC();qt();n_={name:"tpers",aliases:["Tilted_Perspective"],parameters:["lon_0","x_0","y_0","lat_0","h","tilt","azi"],create(e){let t=Te(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=sC(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 bn(Ie("tpers",e,o,iC,oC,Va(t,1/(1+r/t.a))),t,u,(h,d)=>S8(Gt(t,e),s,n,i,h,d),a)}}});function LK(e){e.R=e.a}function lC(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=il(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 S=l+d;return w=Math.PI*e.R*(l*(2*d-1)+m)/(g*S+c*Math.sqrt((y+l)*(l+1)-S*S)),n>=0?s=e.y0+w:s=e.y0-w,t.x=o,t.y=s,t}function uC(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 fC(e,t={}){let r={...e,R:0,...t};return LK(r),r}var hC=p(()=>{xt();Bt();s1()});var i_,dC=p(()=>{Ot();Je();lt();kt();hC();i_={name:"vandg",aliases:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten"],parameters:["lon_0","x_0","y_0"],create(e){let t=Te(e),r=fC(t),n=Ie("vandg",e,r,lC,uC);return De(n,Q(t.long0-Math.PI,-Math.PI/2,t.long0+Math.PI,Math.PI/2),i=>W4(n.forward,i,t.long0,t.over),t.primeMeridian,t.over)}}});function OK(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=>s_(e,l)));if(!r)throw new Error("Oblique transformation requires a rotation parameter set");for(let c of r){if(!s_(e,c))throw new Error("Oblique transformation requires "+c);if(c.includes("lat")&&Math.abs(Ki(e,c))>Math.PI/2)throw new Error("Invalid rotation latitude: "+c)}if(r===t[0]){let c=Ki(e,"o_alpha"),l=Ki(e,"o_lon_c"),u=Ki(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:Ki(e,"o_lon_p"),phip:Ki(e,"o_lat_p")};let n=Ki(e,"o_lon_1"),i=Ki(e,"o_lat_1"),o=Ki(e,"o_lon_2"),s=Ki(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 d1(e){let t=e==="longlat";if(!t&&["obtran","geocent"].includes(o_(e.name)))throw new Error("Cannot wrap a composite or geocentric projection");return{name:"ob_tran",aliases:["General Oblique Transformation","General_Oblique_Transformation"],parameters:[...mC,"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(o_).includes(o_(i)))throw new oi("missing-plugin","Oblique transformation dependency does not match +o_proj="+i);let{lamp:s,phip:a}=OK(n),c=Math.cos(a),l=Math.sin(a),u=Math.abs(a)>1e-10,h=Ki(n,"lon_0"),d=s_(n,"over"),m={...n,proj:t?"longlat":i||e.name,lon_0:"0"};for(let _ of mC)delete m[_];let g=t?di(_=>{_.x*=180/Math.PI,_.y*=180/Math.PI},_=>{_.x*=Math.PI/180,_.y*=Math.PI/180}):e.create({...r,parameters:Object.freeze(m),primeMeridian:0}),y=qo(g,!1),b=qo(g,!0),w=_=>Math.asin(Math.max(-1,Math.min(1,_))),S=_=>{let U=_.x,C=_.y,L=Kt(U-h,d),A=Math.cos(L),W=Math.sin(C),G=Math.cos(C),E=Kt(Math.atan2(G*Math.sin(L),u?l*G*A+c*W:W)+s),B=w(u?l*W-c*G*A:-G*A);_.x=E,_.y=B},M=_=>{let U=_.x,C=_.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);_.x=Kt(E+h),_.y=B},v=di(_=>{S(_),y(_)},_=>{b(_),M(_)}),T=t?ja(m):(P=g.getRenderingProfile)==null?void 0:P.bind(g);if(!T)return v;let O=(_,U)=>{let C=U&&cr(()=>_.bounds,U,h,r.primeMeridian??0,d),L=Os(A=>{var D;let W=A.x,G=A.y;S(A);let E=A.x*180/Math.PI,B=A.y*180/Math.PI,N={x:E,y:B,z:A.z};if((D=_.normalize)==null||D.call(_,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,M(A),d&&(A.x+=Math.round((W-A.x)/(2*Math.PI))*2*Math.PI)},r.primeMeridian??0);return{get bounds(){let A=_.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(_){if(!_)return O(T());let U=Ls(_,r.primeMeridian??0,h),C=Q(U[0][0]-h,U[0][1],U[1][0]-h,U[1][1]),L=ht(u?[-c,0,l]:[-1,0,0],C),A=u?[l,0,c]:[0,0,1],G=ht(A,C)[0]>0?ks([0,1,0],A,0,C).map(Math.atan):[-Math.PI,Math.PI];return O(T(Nn(Q(G[0]+s,w(L[0]),G[1]+s,w(L[1])))),_)}}}}}var mC,o_,s_,Ki,pC=p(()=>{ac();zh();qt();sc();Ua();lt();Je();fc();mC=["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"],o_=e=>e.toLowerCase().replace(/[ _-]/g,""),s_=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ki=(e,t)=>re(e,t,0)*Math.PI/180});function Pt(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Expected a CRS object");return e}function Xh(e){return Array.isArray(e)?e:[]}function Kr(e){return String(e||"").toLowerCase().replace(/[^a-z0-9]/g,"")}function Lr(e){if(typeof e!="number"||!Number.isFinite(e))throw new Error("Expected a finite CRS parameter");return e}function On(e,t){if(e===void 0)return t;if(typeof e=="object"){let i=Lr(Pt(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}[Kr(e)];return n||Ue("Unsupported CRS unit: "+String(e)),n}function al(e,t){var _,U,C;let r=String(e.type),n=FK(e.bbox);if(r==="CompoundCRS"){t.mode!=="horizontal"&&Ue("CompoundCRS requires explicit horizontal extraction");let L=Xh(e.components).map(Pt).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=al(L[0],t);return{...A,areaOfUse:n??A.areaOfUse,lossy:!0}}if(r==="BoundCRS"){let L=al(Pt(e.source_crs),t),A=al(Pt(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=Pt(e.transformation),G=Kr(Pt(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 Xh(W.parameters)){let we=Pt(j),_e=D.indexOf(Kr(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]=Lr(we.value)*On(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"?Pt(e.base_crs):e,o=Pt(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=Pt(o.ellipsoid),a=Lr(s.semi_major_axis??s.radius),c={proj:"longlat",a:String(a*On(s.unit,1))};if(s.inverse_flattening!==void 0)c.rf=String(Lr(s.inverse_flattening));else if(s.semi_minor_axis!==void 0)c.b=String(Lr(s.semi_minor_axis)*On(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=Cu(t),u=String(o.name||""),h=Kr(u),d=Object.keys(l),m=d.find(L=>nl(L)===nl(u)),g=m?[m]:d.filter(L=>Kr(L)===h||Kr(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&&nl(y)==="wgs84"&&(c.datum="WGS84"),y&&["nad83","northamericandatum1983"].includes(nl(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=Pt(i.id),A=String(L.authority)+"_"+String(L.code);Object.prototype.hasOwnProperty.call(l,A)&&(c.datum=A)}o.towgs84!==void 0&&(c.towgs84=Xh(o.towgs84).map(Lr).join(","),delete c.datum);let w=e.coordinate_system?Pt(e.coordinate_system):{},S=Xh(w.axis).map(Pt),M=Kr(w.subtype)==="cartesian"&&r==="GeodeticCRS";r!=="ProjectedCRS"&&!M&&w.subtype&&Kr(w.subtype)!=="ellipsoidal"&&Ue("Unsupported coordinate system subtype"),M&&(c.proj="geocent");let v=On(i.angular_unit,At),T=On((_=S[0])==null?void 0:_.unit,r==="ProjectedCRS"||M?1:v);S[1]&&On(S[1].unit,T)!==T&&Ue("Mixed horizontal axis units are not supported"),M&&S[2]&&On(S[2].unit,T)!==T&&Ue("Mixed geocentric axis units are not supported");let O=i.prime_meridian||o.prime_meridian;if(O){let L=Pt(O);c.pm=String(Lr(L.longitude)*On(L.unit,v)/At)}if(r==="ProjectedCRS"){let L=Pt(e.conversion),A=Kr(Pt(L.method).name),W=Xh(L.parameters).map(Pt),G=A==="stereographicnorthpole"&&!W.some(D=>Kr(D.name).startsWith("scalefactor")),E=G?"stere":BK[A],B=W.filter(D=>["xscale","yscale","xyplanerotation"].includes(Kr(D.name)));if(B.length){let D={xscale:-1,yscale:1,xyplanerotation:90};(E!=="krovak"||B.length!==3||new Set(B.map(R=>Kr(R.name))).size!==3||B.some(R=>{let I=Kr(R.name),j=I==="xyplanerotation"?On(R.unit,v)/At:On(R.unit,1);return Math.abs(Lr(R.value)*j-D[I])>1e-10}))&&Ue("Unsupported ESRI Krovak axis adjustment")}(!E||E.startsWith("unsupported"))&&Ue("Unsupported projection method: "+String(Pt(L.method).name)),c.proj=E==="webmerc"?"merc":E;let N=!1;for(let D of W){let R=Kr(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=Lr(D.value)*On(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=DK[E])==null?void 0:U[R])||CK[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=Lr(D.value)*On(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=S.map(L=>GK(L,c,r==="ProjectedCRS")).join("");return P.length===2&&(P+="u"),!M&&/[ud]/.test(P.slice(0,2))&&Ue("Structured CRS vertical-first axes require an explicit PROJ axis definition"),P&&(c.axis=P),(r==="ProjectedCRS"||M)&&(c.to_meter=String(T)),{parameters:c,areaOfUse:n,angularUnit:r==="ProjectedCRS"||M?v:T,verticalUnit:M?1:On((C=S[2])==null?void 0:C.unit,1)}}function FK(e){let t;if(e!==void 0){let r=Pt(e),n=Lr(r.west_longitude),i=Lr(r.south_latitude),o=Lr(r.east_longitude),s=Lr(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 GK(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||Kr(n)!==(l?"south":"north"))&&Ue("Axis meridians require an outward-facing polar stereographic axis");let u=Pt(i).longitude,h=typeof u=="number"?Lr(u):Lr(Pt(u).value)*On(Pt(u).unit,At)/At,d=Lr((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=NK[Kr(n)];return s||Ue("Unsupported axis direction: "+n),s}var BK,CK,DK,NK,a_=p(()=>{Hp();qt();Ua();BK={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"},CK={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"},DK={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"}},NK={east:"e",west:"w",north:"n",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"}});function m1(e,...t){return e.values.filter(r=>r.type==="node"&&t.includes(r.keyword.toUpperCase()))}function Mt(e,...t){return m1(e,...t)[0]}function bt(e,t=0){let r=e.values[t];return r&&r.type!=="node"?r.value:void 0}function cl(e){return e?{name:bt(e),conversion_factor:bt(e,1)}:void 0}function kK(e,t){let r=bt(e,1);if(t&&String(r).toLowerCase()==="unknown"){let n=String(bt(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 UK(e){let t=Mt(e,"MERIDIAN");if(t)return{longitude:{value:bt(t),unit:cl(Mt(t,"ANGLEUNIT"))}}}function gC(e){let t=Mt(e,"METHOD","PROJECTION");if(!t)throw new Error("WKT conversion requires a METHOD or PROJECTION");return Mt(e,"PARAMETERFILE")&&Ue("Grid-based WKT operation is not implemented"),{method:{name:bt(t)},parameters:m1(e,"PARAMETER").map(r=>({name:bt(r),value:bt(r,1),unit:cl(Mt(r,"ANGLEUNIT","LENGTHUNIT","SCALEUNIT"))}))}}function Yh(e){let t=e.keyword.toUpperCase();if(t==="COMPD_CS"||t==="COMPOUNDCRS")return{type:"CompoundCRS",components:m1(e,"PROJCS","PROJCRS","GEOGCS","GEOGCRS","GEODCRS","BOUNDCRS","VERT_CS","VERTCRS").map(Yh)};if(t==="BOUNDCRS"){let d=Mt(e,"SOURCECRS"),m=Mt(e,"TARGETCRS"),g=Mt(e,"ABRIDGEDTRANSFORMATION");if(!d||!m||!g)throw new Error("Incomplete WKT BoundCRS");let y=S=>{let M=S.values.find(v=>v.type==="node");if(!M)throw new Error("Missing bound CRS component");return M},b=gC(g),w=b.parameters;for(let S of w)String(S.name).toLowerCase()==="scale difference"&&S.unit===void 0&&(S.value=(Number(S.value)-1)*1e6);return{type:"BoundCRS",source_crs:Yh(y(d)),target_crs:Yh(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),Mt(e,"DYNAMIC","DERIVINGCONVERSION","VELOCITYGRID","EXTENSION")&&Ue("Unsupported WKT dynamic/extension operation");let i=Mt(e,"CS"),o=t==="GEOCCS"||String(bt(i||e)).toLowerCase()==="cartesian"&&!r,s=Mt(e,r||o?"LENGTHUNIT":"ANGLEUNIT","UNIT"),a=m1(e,"AXIS").sort((d,m)=>Number(bt(Mt(d,"ORDER")||d))-Number(bt(Mt(m,"ORDER")||m))).map((d,m)=>({name:bt(d),direction:t==="GEOCCS"?["geocentricX","geocentricY","geocentricZ"][m]:kK(d,r),unit:cl(Mt(d,"ANGLEUNIT","LENGTHUNIT")||(!o&&!r&&/^(up|down)$/i.test(String(bt(d,1)))?void 0:s)),meridian:UK(d)}));if(!a.length)for(let d of o?["geocentricX","geocentricY","geocentricZ"]:["east","north"])a.push({name:d,direction:d,unit:cl(s),meridian:void 0});let c=t==="GEOGCS"?void 0:Mt(e,"ID"),l={type:r?"ProjectedCRS":o?"GeodeticCRS":"GeographicCRS",name:bt(e),id:c?{authority:bt(c),code:bt(c,1)}:void 0,coordinate_system:{subtype:r||o?"Cartesian":"ellipsoidal",axis:a}},u=Mt(e,"USAGE"),h=Mt(u||e,"BBOX");if(h&&(l.bbox={south_latitude:bt(h,0),west_longitude:bt(h,1),north_latitude:bt(h,2),east_longitude:bt(h,3)}),r){let d=Mt(e,"GEOGCS","BASEGEOGCRS","BASEGEODCRS","GEODCRS","GEOGCRS");if(!d)throw new Error("Projected WKT requires a base geographic CRS");l.base_crs=Yh(d),l.conversion=gC(Mt(e,"CONVERSION")||e)}else{let d=Mt(e,"DATUM","GEODETICDATUM","ENSEMBLE");if(!d)throw new Error("WKT requires a geodetic datum");Mt(d,"EXTENSION","DYNAMIC")&&Ue("Unsupported datum extension");let m=Mt(d,"SPHEROID","ELLIPSOID");if(!m)throw new Error("WKT datum requires an ellipsoid");let g=Mt(d,"TOWGS84");l.datum={name:bt(d),ellipsoid:{name:bt(m),semi_major_axis:bt(m,1),inverse_flattening:bt(m,2),unit:cl(Mt(m,"LENGTHUNIT"))},towgs84:g==null?void 0:g.values.map((b,w)=>bt(g,w))};let y=Mt(e,"PRIMEM");y&&(l.prime_meridian={name:bt(y),longitude:bt(y,1),unit:cl(Mt(y,"ANGLEUNIT")||(o?void 0:s))}),l.angular_unit=o?void 0:cl(s)}return l}var c_,yC=p(()=>{Bl();qg();Ua();a_();c_={name:"wkt",canParse:e=>yr(e)==="wkt",parse(e,t){if(typeof e!="string")throw new Error("Expected serialized WKT");return al(Yh(wf(e).root),t)}}});var l_,bC=p(()=>{Bl();a_();l_={name:"projjson",canParse:e=>yr(e)==="projjson",parse:(e,t)=>al(Pt(e),t)}});var QMe,e3e,t3e,wC=p(()=>{QMe=new Float64Array(0),e3e=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,t3e={deg:Math.PI/180,rad:1,m:1,ft:.3048,"us-ft":1200/3937}});var u_=p(()=>{oL();sL();aL();hL();yL();SL();TL();P8();FL();WL();Cy();b8();HL();iO();cO();dO();wO();AO();LO();GO();$O();eB();oB();uB();gB();_B();AB();LB();GB();qB();ZB();JB();nC();cC();dC();pC();yC();bC();wC()});var p1,xC,_C=p(()=>{p1={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 p1){let t=p1[e];t.datumName&&(p1[t.datumName]=t)}xC=p1});var SC,MC=p(()=>{_C();SC=Object.freeze({name:"regional-datums",datums:Object.freeze(xC)})});function jK(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(Cu(r)).some(s=>o(s)===o(i))){let s={...n.parameters};return delete s.datum,{...n,parameters:s}}return n}}}function qK(){if(g1)return g1;let e=[hx,dx,mx,gx,yx,_x,Gy,Sx,Ax,Oy,By,Dy,Tx,Px,Bx,Cx,Nx,kx,Ux,jx,zx,Wx,Hx,$x,Kx,Xx,Yx,Zx,Jx,Qx,e_,t_,r_,n_,i_],t=i=>i.toLowerCase().replace(/[\s_-]/g,""),r=d1("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=d1(s),c=new Set([...$p,...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 g1=[...e,n],g1}var zK,g1,Hu,VK,vC=p(()=>{iL();MC();Hp();u_();Du();zK=[c_,l_].map(jK);Hu=class extends r1{constructor(t={}){super({...t,projections:t.projections??qK(),parsers:t.parsers??zK,datumCatalogs:t.datumCatalogs??[SC]}),this.useDefinitionSignature=!Wh(t)}},VK=new Hu});var EC=p(()=>{u_();vC()});function AC(){return HK}function TC(e){return WK.get(e)}var WK,HK,IC=p(()=>{"use strict";EC();WK=new Map,HK=new Hu});function $K(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 KK(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 Zh(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 Zh(t[0])}return e}function XK(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($u(e)&&e.heightReference==="unknown")throw new Error("Cannot convert heights because the source height reference is unknown");if(e.coordinateFrame==="geocentric"&&!f_(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 f_(e){return typeof e=="string"&&Gh(e)===jp}function PC(e){if(typeof e!="string")return!1;let t=Gh(e);return t===Bu||t==="EPSG:4979"||t==="OGC:CRS84"}function $u(e){let t=e.targetHeightReference;return t!=="native"&&t!==e.heightReference}function YK(e){return typeof e=="string"?TC(e):e}function ZK(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 ll,h_=p(()=>{"use strict";Dn();Cf();uR();IC();Kw();Xw();ll=class{spatialReference;horizontalProjection;horizontalProjectionBuffer;geographicProjection;heightOutputProjection;sourceIsGeocentric;outputIsGeocentric;sourceIsGeographic;outputIsGeographic;geoid;constructor(t,r={}){this.spatialReference=t;let n=AC();XK(t);let i=t.targetCrs||t.sourceCrs;if(this.sourceIsGeocentric=f_(t.sourceCrs),this.outputIsGeocentric=f_(i),this.sourceIsGeographic=PC(t.sourceCrs),this.outputIsGeographic=PC(i),t.sourceCrs&&t.targetCrs&&!this.sourceIsGeocentric&&!this.outputIsGeocentric&&(this.horizontalProjection=n.createProjection({from:Zh(t.sourceCrs),to:Zh(t.targetCrs),enforceAxis:!1}),$u(t)||(this.horizontalProjectionBuffer=new Vp({projection:this.horizontalProjection,dimension:3}))),($u(t)||this.sourceIsGeocentric||this.outputIsGeocentric)&&(!this.sourceIsGeographic&&!this.sourceIsGeocentric&&(this.geographicProjection=n.createProjection({from:Zh(t.sourceCrs),to:Bu,enforceAxis:!1})),!this.outputIsGeographic&&!this.outputIsGeocentric&&(this.heightOutputProjection=n.createProjection({from:Bu,to:Zh(i),enforceAxis:!1}))),$u(t)&&(this.geoid=YK(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($u(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($u(this.spatialReference)){let o=this.geoid.getHeight(n[1],n[0]);n[2]=ZK(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=$K(this,s,i),l=KK(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(Et.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(Et.WGS84.cartographicToCartesian(new J(t))):this.outputIsGeographic?t.slice(0,3):this.heightOutputProjection.projectSync(t.slice(0,3))}}});function JK(e,t){return e==="relativeToScene"?t.sceneElevationProvider:Ku(e)?t.terrainElevationProvider:void 0}function Ku(e){return e==="onTheGround"||e==="relativeToGround"||e==="relativeToScene"}function d_(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 QK(e){let t=Ha(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 RC(e){if(!e.length)throw new Error("I3S spatial transformation requires at least one bound sample");let t=e.map(o=>Et.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=Et.WGS84.cartesianToCartographic(r);return[i[0],i[1],i[2],n]}function LC(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 Mf().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=Et.WGS84.cartographicToCartesian(new J(d)),g=e.normalReferenceFrame==="vertex-reference-frame"?h.map(y=>CC(y,d)):h;return OC().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(Et.WGS84.cartesianToCartographic(b))})}return OC().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=Et.WGS84.cartographicToCartesian(new J(c));return BC().map(u=>Array.from(Et.WGS84.cartesianToCartographic(new J(l).add(new J(u).scale(a)))))}return BC().map(c=>Array.from(new J(s).add(new J(c).scale(a))))}function OC(){return[-1,1].flatMap(e=>[-1,1].flatMap(t=>[-1,1].map(r=>[e,t,r])))}function BC(){return[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]]}function eX(){return[new J([1,0,0]),new J([0,1,0]),new J([0,0,1])]}function CC(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 tX(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 ul(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 Ha(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+m_(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[m_(r)*Math.PI/180,i*Math.PI/180,m_(n)*Math.PI/180,o*Math.PI/180,s,a]}function m_(e){return((e+180)%360+360)%360-180}var Jh,DC=p(()=>{"use strict";Dn();Cf();h_();oR();aR();Jh=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 ll(t,r),this.sourceCoordinateFrame=t.coordinateFrame,this.sourceVerticalUnitScale=t.verticalUnitScale,this.elevationMode=t.elevationMode,this.elevationOffset=(t.elevationOffset||0)*t.elevationUnitScale,this.elevationProvider=JK(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=sR(((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=To(n),this.spatialReference=iR(t);let o=zp({sourceCrs:t.sourceCrs,heightReference:t.heightReference,coordinateFrame:t.coordinateFrame,axisOrder:t.axisOrder,provenance:t.provenance},{targetCrs:"EPSG:4326"});if(this.sourceToGeographicTransformer=new ll(o),Ku(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=zp({sourceCrs:"EPSG:4326",heightReference:c,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"caller-override"},{targetCrs:"EPSG:4326",targetHeightReference:t.heightReference,geoidModel:r.geoidModel});this.providerHeightTransformer=new ll(l,r)}}let s=zp({sourceCrs:"EPSG:4326",heightReference:t.heightReference,coordinateFrame:"geographic",axisOrder:"xyz",provenance:"format-default"},{targetCrs:n,targetHeightReference:t.targetHeightReference,geoidModel:r.geoidModel});this.geographicToTargetTransformer=new ll(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 gn:new gn().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:CC(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:Ha(n)}:{box:ul(n)}}async transformBoundingVolumeAsync(t){let n=(await this.getGeographicBoundSamplesAsync(t)).map(i=>this.geographicToTargetTransformer.transformPosition(i));return this.targetCoordinateFrame==="geographic"?{region:Ha(n)}:{box:ul(n)}}transformBoundingVolumeToGeographic(t){return{region:Ha(this.getGeographicBoundSamples(t))}}async transformBoundingVolumeToGeographicAsync(t){return{region:Ha(await this.getGeographicBoundSamplesAsync(t))}}transformBoundingVolumeToGeocentric(t){let r=this.getGeographicBoundSamples(t).map(n=>Array.from(Et.WGS84.cartographicToCartesian(new J(n))));return{box:ul(r)}}async transformBoundingVolumeToGeocentricAsync(t){let r=(await this.getGeographicBoundSamplesAsync(t)).map(n=>Array.from(Et.WGS84.cartographicToCartesian(new J(n))));return{box:ul(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 RC(await this.getGeographicBoundSamplesAsync(t))}async transformBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(o=>Array.from(Et.WGS84.cartographicToCartesian(new J(o)))),i=r.map(o=>this.geographicToTargetTransformer.transformPosition(o));return{boundingVolume:{box:ul(n)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Ha(i)}:{box:ul(i)},i3sLodMbs:Ku(this.elevationMode)?RC(r):this.transformBoundingSphereToGeographic(t)}}async transformPointCloudBoundsAsync(t){let r=await this.getGeographicBoundSamplesAsync(t),n=r.map(i=>this.geographicToTargetTransformer.transformPosition(i));return{boundingVolume:{region:Ha(r)},spatialBoundingVolume:this.targetCoordinateFrame==="geographic"?{region:Ha(n)}:{box:ul(n)}}}getGeographicBoundSamples(t){let r=LC(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=d_(n);return this.sourceCoordinateFrame==="geographic"?i:i.map(o=>this.sourceToGeographicTransformer.transformPosition(o))}async getGeographicBoundSamplesAsync(t){let r=LC(t,this.sourceCoordinateFrame,this.sourceToGeographicTransformer,this.sourceVerticalUnitScale);if(!r.length)throw new Error("I3S spatial transformation requires an MBS or OBB bound");if(Ku(this.elevationMode)){let i=this.sourceCoordinateFrame==="geographic"?r:r.map(o=>this.sourceToGeographicTransformer.transformPosition(o));return await this.placeGeographicBoundSamples(i)}let n=d_(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(QK(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(Ku(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(!Ku(this.elevationMode))return this.placeSourcePositionsSync(t,r);let n=Float64Array.from(t),i=d_(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 tX(t,r).normalize();let n=Et.WGS84.cartographicToCartesian(new J(r)),i=[];for(let s of eX()){let a=Et.WGS84.cartesianToCartographic(new J(n).add(s)),c=Et.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 ic(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 NC=p(()=>{"use strict";h_();DC()});function FC(e,t=null){return p_(e,t?{token:t}:void 0)}function p_(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 GC=p(()=>{"use strict"});function g_(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 Xu(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 kC,y1,y_=p(()=>{"use strict";z4();kC={UInt8:Ps.UNSIGNED_BYTE,UInt16:Ps.UNSIGNED_SHORT,Float32:Ps.FLOAT,UInt32:Ps.UNSIGNED_INT,UInt64:Ps.DOUBLE};y1={DEFAULT:"default",LNGLAT:"lnglat",METER_OFFSETS:"meter-offsets",LNGLAT_OFFSETS:"lnglat-offsets",CARTESIAN:"cartesian"}});function w_(e,t){if(!e)throw new Error(`parseI3STileContent requires LoaderContext to ${t}. Nested I3S parsing must run through parseFromContext().`);return e}function rX(e){switch(e){case"ktx-etc2":case"dds":return Ho;case"ktx2":return uo;default:return Wo}}async function VC(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 gn,coordinateSystem:"meter-offsets",byteLength:0,texture:null,topology:t.layerType==="Point"?"point-list":"triangle-list",pointRenderer:t.pointRenderer,pointSymbol:t.pointSymbol},a=i?w_(i,"parse nested resources"):null,c=(d=t.textureUrls)!=null&&d.length?t.textureUrls:t.textureUrl?[{textureSetDefinitionId:_X(t.materialDefinition),textureUrl:t.textureUrl,textureFormat:t.textureFormat||"jpg"}]:[],l={};for(let m of c)try{let g=await iX(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=bX(t.materialDefinition,l,u),s.material&&(s.texture=null),await oX(e,s,t,r,n,i)}async function iX(e,t,r,n,i){var m;let o=n==null?void 0:n.i3s,s=p_(FC(e,o==null?void 0:o.token),n==null?void 0:n.searchParams),a=rX(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=w_(i,"decode texture payloads");if(a===Wo){let g={...r.textureLoaderOptions};try{let y=await Tl(u,Wo,g,h);return Fm(y)}catch{let b=await Tl(u,a,g,h);return Fm(b)}}let d=await Tl(u,a,r.textureLoaderOptions,h);return a===uo&&(d=d[0]),{compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}async function oX(e,t,r,n,i,o){var m,g,y,b,w,S;let s=e.byteLength,a,c,l=0,u=0,h;if(r.isDracoGeometry){let M=w_(o,"decode Draco geometry"),v=await Tl(e,vi,{draco:{shape:"mesh",attributeNameEntry:nX}},M);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"]:_,["uv-region"]:U}=v.attributes;if(a={position:T,normal:O,color:P,uvRegion:U,id:_},aX(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);fX(a,v);let C=vX(_);C&&(MX(a,C),t.drawRanges=uX(a.id.value,h,t.topology))}else{let M=n.store.defaultGeometrySchema;if(!M)throw new Error("Uncompressed I3S geometry requires store.defaultGeometrySchema");let{vertexAttributes:v,ordering:T,featureAttributes:O,featureAttributeOrder:P}=M,_=dX(e,M);l=_.byteOffset,c=_.vertexCount,u=_.featureCount;let{attributes:U,byteOffset:C}=jC(e,l,v,c,T),{attributes:L,byteOffset:A}=jC(e,C,O,u,P),W=sX(e,A);W&&(t.meshSegmentation=W),t.drawRanges=lX(L),SX(L),a=hX(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 M=b_(a.position.value,a.position.metadata,r.mbs);if(M.some(v=>!Number.isFinite(v)))throw new Error("Source I3S positions must be finite");a.position={value:M,size:3},t.origin=[0,0,0],t.cartographicOrigin=[0,0,0],t.coordinateSystem=d!=null&&d.sourceCrs&&To(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 M=new Jh(d,n.spatialOptions||((y=i==null?void 0:i.i3s)==null?void 0:y.spatial)),v=b_(a.position.value,a.position.metadata,r.mbs),T=await M.transformPositionsAsync(v,r.mbs);a.position.value=T.positions,(b=a.normal)!=null&&b.value&&(a.normal.value=M.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=M.spatialReference}else if(!((w=i==null?void 0:i.i3s)!=null&&w.coordinateSystem)||i.i3s.coordinateSystem===y1.METER_OFFSETS){let M=pX(a.position,r);t.modelMatrix=M.invert(),t.coordinateSystem="meter-offsets"}else t.modelMatrix=yX(a.position),t.coordinateSystem="lnglat-offsets";t.attributes={positions:a.position,normals:a.normal,colors:UC(a.color,((S=i==null?void 0:i.i3s)==null?void 0:S.colorFormat)||"uint8norm"),uvRegions:UC(a.uvRegion||a.region)},cX(t.attributes,a),t.indices=h||null,a.id&&a.id.value&&(t.featureIds=a.id.value);for(let M in t.attributes)t.attributes[M]||delete t.attributes[M];return t.vertexCount=c,t.byteLength=s,t}function sX(e,t){return t<e.byteLength?e.slice(t):void 0}function aX(e,t){for(let[r,n]of Object.entries(t)){let i=/^TEXCOORD_(\d+)$/.exec(r);i&&(e[`uv${Number(i[1])}`]=n)}}function cX(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 lX(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 uX(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 fX(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 hX(e,t){return{...e,...t}}function UC(e,t="uint8norm"){return e&&(t==="float16"&&!e.componentType?{...e,value:jw(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 dX(e,t){let r=0,n=0,i=0;for(let{property:o,type:s}of t.header){let a=g_(s);switch(o){case"vertexCount".toString():n=new a(e,0,4)[0],r+=Xu(s);break;case"featureCount".toString():i=new a(e,4,4)[0],r+=Xu(s);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function jC(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*Xu(a)<=e.byteLength){let l=e.slice(t),u;if(a==="UInt64")u=mX(l,n*c,Xu(a));else{let h=g_(a);u=new h(l,0,n*c)}o[s]={value:u,type:kC[a],size:c},s==="color"&&(o.color.normalized=!0),t=t+n*c*Xu(a)}else if(s!=="uv0")break}return{attributes:o,byteOffset:t}}function mX(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 pX(e,t){let r=t.mbs,n=e.value,i=e.metadata,o=new gn,s=new J(r[0],r[1],r[2]),a=new J;return Et.WGS84.cartographicToCartesian(s,a),My(Et.WGS84,a,o),e.value=gX(n,i,s),o}function b_(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 gX(e,t={},r){let n=b_(e,t,r);for(let i=0;i<n.length;i+=3)Et.WGS84.cartographicToCartesian(n.subarray(i,i+3),b1),n[i]=b1.x,n[i+1]=b1.y,n[i+2]=b1.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 gn;return i[0]=r,i[5]=n,i}function bX(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=zC(i.emissiveFactor,n)),i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorFactor&&(i.pbrMetallicRoughness.baseColorFactor=zC(i.pbrMetallicRoughness.baseColorFactor,n)),Object.keys(t).length>0?xX(i,t):r&&wX(i,r),i}function zC(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 wX(e,t){if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture){let r=e.pbrMetallicRoughness.baseColorTexture;e.pbrMetallicRoughness.baseColorTexture={...r,texture:Yu(t,r)}}else if(e.emissiveTexture){let r=e.emissiveTexture;e.emissiveTexture={...r,texture:Yu(t,r)}}else if(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture){let r=e.pbrMetallicRoughness.metallicRoughnessTexture;e.pbrMetallicRoughness.metallicRoughnessTexture={...r,texture:Yu(t,r)}}else if(e.normalTexture){let r=e.normalTexture;e.normalTexture={...r,texture:Yu(t,r)}}else if(e.occlusionTexture){let r=e.occlusionTexture;e.occlusionTexture={...r,texture:Yu(t,r)}}}function xX(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=Yu(s,o))}}function Yu(e,t){let r=qC(t.wrapS),n=qC(t.wrapT),i=r||n?{wrapS:r||10497,wrapT:n||10497}:void 0;return i?{source:{image:e},sampler:i}:{source:{image:e}}}function qC(e){switch(e){case"none":return 33071;case"mirror":return 33648;case"repeat":return 10497;default:return}}function _X(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 SX(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 MX(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 vX(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 b1,nX,WC=p(()=>{"use strict";Oh();Dn();Cf();Cf();zs();Uf();$w();Uf();NC();GC();y_();b1=new J([0,0,0]);nX="i3s-attribute-type"});var w1,x_,Gve,HC,kve,Uve,jve,zve,qve,$C=p(()=>{"use strict";w1=(e,t,r,n)=>({name:e,id:t,module:"tiles-3d",encoding:"binary",format:r,extensions:n,mimeTypes:["application/octet-stream"],binary:!0}),x_=(e,t,r)=>({name:e,id:t,module:"tiles-3d",encoding:"json",format:r,extensions:["json"],mimeTypes:["application/json"],text:!0}),Gve=w1("I3S","i3s","i3s",["bin"]),HC=w1("I3S Content","i3s-content","i3s-content",["bin"]),kve=w1("I3S Attribute","i3s-attribute","i3s-attribute",["bin"]),Uve=w1("I3S LEPCC","i3s-lepcc","i3s-lepcc",["bin"]),jve=x_("I3S Node Page","i3s-node-page","i3s-node-page"),zve=x_("ArcGIS Web Scene","arcgis-web-scene","arcgis-web-scene"),qve=x_("I3S Building Scene Layer","i3s-building-scene-layer","i3s-building-scene-layer")});var KC,XC=p(()=>{"use strict";y_();KC={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:y1.METER_OFFSETS}});var EX,YC,ZC=p(()=>{"use strict";$C();XC();EX="5.0.0-beta.2",YC={...HC,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:EX,mimeTypes:["application/octet-stream"],preload:async()=>(await Promise.resolve().then(()=>(__(),JC))).I3SContentLoaderWithParser,extensions:["bin"],options:{i3s:KC,"i3s-content":{}}}});var JC={};ir(JC,{I3SContentLoaderWithParser:()=>S_});async function TX(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 VC(e,a,c,t,r)}var tEe,AX,S_,__=p(()=>{"use strict";Uf();$w();Uf();WC();ZC();({preload:tEe,...AX}=YC),S_={...AX,subloaders:{ImageLoader:Wo,DracoLoader:vi,BasisLoader:uo,CompressedTextureLoader:Ho},parse:TX}});var T_=typeof process!="object"||String(process)!=="[object process]"||process.browser;var I_={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"]=I_||{};function Ae(e,t,r){return t<=e&&e<=r}function oD(e,t){return e.indexOf(t)!==-1}var Ro=Math.floor;function ld(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function sD(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 aD(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 ci(e){return 0<=e&&e<=127}var ai=ci,Ye=-1;function N1(e){this.tokens=[].slice.call(e),this.tokens.reverse()}N1.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 pt=-1;function Xe(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ai(e){throw TypeError("The code point "+e+" could not be encoded.")}function cD(){}cD.prototype={handler:function(e,t){}};function lD(){}lD.prototype={handler:function(e,t){}};function C1(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(D1,e)?D1[e]:null}var P_=[{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"}],D1={};P_.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){D1[r]=t})})});var dn={},mn={};function dl(e,t){return t&&t[e]||null}function ml(e,t){var r=t.indexOf(e);return r===-1?null:r}function Yr(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 uD(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Yr("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 fD(e){if(e===59335)return 7457;var t=0,r=0,n=Yr("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 hD(e){O1=O1||Yr("jis0208").map(function(r,n){return Ae(n,8272,8835)?null:r});var t=O1;return t.indexOf(e)}var O1;function dD(e){B1=B1||Yr("big5").map(function(r,n){return n<5024?null:r});var t=B1;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):ml(e,t)}var B1,R_="utf-8";function Ka(e,t){if(!(this instanceof Ka))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):R_,t=ld(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=C1(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!mn[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(Ka.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Ka.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Ka.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Ka.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=ld(r),this._do_not_flush||(this._decoder=mn[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!r.stream;for(var i=new N1(n),o=[],s;;){var a=i.read();if(a===Ye||(s=this._decoder.handler(i,a),s===pt))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===pt)break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}while(!i.endOfStream());this._decoder=null}function c(l){return oD(["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)),aD(l)}return c.call(this,o)};function sf(e,t){if(!(this instanceof sf))throw TypeError("Called as a function. Did you forget 'new'?");t=ld(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):R_;var n=C1(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!dn[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=C1("utf-8"),e!==void 0&&"console"in globalThis;return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(sf.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});sf.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=ld(r),this._do_not_flush||(this._encoder=dn[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=!!r.stream;for(var n=new N1(sD(t)),i=[],o;;){var s=n.read();if(s===Ye||(o=this._encoder.handler(n,s),o===pt))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!==pt;)Array.isArray(o)?i.push.apply(i,o):i.push(o);this._encoder=null}return new Uint8Array(i)};function mD(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 pt;if(i===0){if(Ae(c,0,127))return c;if(Ae(c,194,223))i=1,r=c&31;else if(Ae(c,224,239))c===224&&(o=160),c===237&&(s=159),i=2,r=c&15;else if(Ae(c,240,244))c===240&&(o=144),c===244&&(s=143),i=3,r=c&7;else return Xe(t);return null}if(!Ae(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 pD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n))return n;var i,o;Ae(n,128,2047)?(i=1,o=192):Ae(n,2048,65535)?(i=2,o=224):Ae(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}}dn["UTF-8"]=function(e){return new pD(e)};mn["UTF-8"]=function(e){return new mD(e)};function gD(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return pt;if(ci(i))return i;var o=e[i-128];return o===null?Xe(r):o}}function yD(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return pt;if(ai(i))return i;var o=ml(i,e);return o===null&&Ai(i),o+128}}(function(){"encoding-indexes"in globalThis&&P_.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Yr(r.toLowerCase());mn[r]=function(i){return new gD(n,i)},dn[r]=function(i){return new yD(n,i)}})})})();mn.GBK=function(e){return new L_(e)};dn.GBK=function(e){return new O_(e,!0)};function L_(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 pt;s===Ye&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Xe(t));var a;if(i!==0){a=null,Ae(s,48,57)&&(a=uD((((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 Ae(s,129,254)?(i=s,null):(o.prepend([n,s]),r=0,n=0,Xe(t));if(r!==0){if(Ae(s,48,57))return n=s,null;var l=r,u=null;r=0;var h=s<127?64:65;return(Ae(s,64,126)||Ae(s,128,254))&&(u=(l-129)*190+(s-h)),a=u===null?null:dl(u,Yr("gb18030")),a===null&&ci(s)&&o.prepend(s),a===null?Xe(t):a}return ci(s)?s:s===128?8364:Ae(s,129,254)?(r=s,null):Xe(t)}}function O_(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Ye)return pt;if(ai(i))return i;if(i===58853)return Ai(i);if(t&&i===8364)return 128;var o=ml(i,Yr("gb18030"));if(o!==null){var s=Ro(o/190)+129,a=o%190,c=a<63?64:65;return[s,a+c]}if(t)return Ai(i);o=fD(i);var l=Ro(o/10/126/10);o=o-l*10*126*10;var u=Ro(o/10/126);o=o-u*10*126;var h=Ro(o/10),d=o-h*10;return[l+129,u+48,h+129,d+48]}}dn.gb18030=function(e){return new O_(e)};mn.gb18030=function(e){return new L_(e)};function bD(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 pt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:98;switch((Ae(i,64,126)||Ae(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:dl(s,Yr("big5"));return c===null&&ci(i)&&n.prepend(i),c===null?Xe(t):c}return ci(i)?i:Ae(i,129,254)?(r=i,null):Xe(t)}}function wD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n))return n;var i=dD(n);if(i===null)return Ai(n);var o=Ro(i/157)+129;if(o<161)return Ai(n);var s=i%157,a=s<63?64:98;return[o,s+a]}}dn.Big5=function(e){return new wD(e)};mn.Big5=function(e){return new bD(e)};function xD(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 pt;if(n===142&&Ae(o,161,223))return n=0,65216+o;if(n===143&&Ae(o,161,254))return r=!0,n=o,null;if(n!==0){var s=n;n=0;var a=null;return Ae(s,161,254)&&Ae(o,161,254)&&(a=dl((s-161)*94+(o-161),Yr(r?"jis0212":"jis0208"))),r=!1,Ae(o,161,254)||i.prepend(o),a===null?Xe(t):a}return ci(o)?o:o===142||o===143||Ae(o,161,254)?(n=o,null):Xe(t)}}function _D(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n))return n;if(n===165)return 92;if(n===8254)return 126;if(Ae(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=ml(n,Yr("jis0208"));if(i===null)return Ai(n);var o=Ro(i/94)+161,s=i%94+161;return[o,s]}}dn["EUC-JP"]=function(e){return new _D(e)};mn["EUC-JP"]=function(e){return new xD(e)};function SD(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):Ae(c,0,127)&&c!==14&&c!==15&&c!==27?(s=!1,c):c===Ye?pt:(s=!1,Xe(t));case r.Roman:return c===27?(n=r.EscapeStart,null):c===92?(s=!1,165):c===126?(s=!1,8254):Ae(c,0,127)&&c!==14&&c!==15&&c!==27&&c!==92&&c!==126?(s=!1,c):c===Ye?pt:(s=!1,Xe(t));case r.Katakana:return c===27?(n=r.EscapeStart,null):Ae(c,33,95)?(s=!1,65344+c):c===Ye?pt:(s=!1,Xe(t));case r.LeadByte:return c===27?(n=r.EscapeStart,null):Ae(c,33,126)?(s=!1,o=c,n=r.TrailByte,null):c===Ye?pt:(s=!1,Xe(t));case r.TrailByte:if(c===27)return n=r.EscapeStart,Xe(t);if(Ae(c,33,126)){n=r.LeadByte;var l=(o-33)*94+c-33,u=dl(l,Yr("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 MD(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 pt;if((n===r.ASCII||n===r.Roman)&&(o===14||o===15||o===27))return Ai(65533);if(n===r.ASCII&&ai(o))return o;if(n===r.Roman&&(ai(o)&&o!==92&&o!==126||o===165||o===8254)){if(ai(o))return o;if(o===165)return 92;if(o===8254)return 126}if(ai(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=ml(o,Yr("jis0208"));if(s===null)return Ai(o);if(n!==r.jis0208)return i.prepend(o),n=r.jis0208,[27,36,66];var a=Ro(s/94)+33,c=s%94+33;return[a,c]}}dn["ISO-2022-JP"]=function(e){return new MD(e)};mn["ISO-2022-JP"]=function(e){return new SD(e)};function vD(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 pt;if(r!==0){var o=r,s=null;r=0;var a=i<127?64:65,c=o<160?129:193;if((Ae(i,64,126)||Ae(i,128,252))&&(s=(o-c)*188+i-a),Ae(s,8836,10715))return 48508+s;var l=s===null?null:dl(s,Yr("jis0208"));return l===null&&ci(i)&&n.prepend(i),l===null?Xe(t):l}return ci(i)||i===128?i:Ae(i,161,223)?65216+i:Ae(i,129,159)||Ae(i,224,252)?(r=i,null):Xe(t)}}function ED(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(Ae(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=hD(n);if(i===null)return Ai(n);var o=Ro(i/188),s=o<31?129:193,a=i%188,c=a<63?64:65;return[o+s,a+c]}}dn.Shift_JIS=function(e){return new ED(e)};mn.Shift_JIS=function(e){return new vD(e)};function AD(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 pt;if(r!==0){var o=r,s=null;r=0,Ae(i,65,254)&&(s=(o-129)*190+(i-65));var a=s===null?null:dl(s,Yr("euc-kr"));return s===null&&ci(i)&&n.prepend(i),a===null?Xe(t):a}return ci(i)?i:Ae(i,129,254)?(r=i,null):Xe(t)}}function TD(e){var t=e.fatal;this.handler=function(r,n){if(n===Ye)return pt;if(ai(n))return n;var i=ml(n,Yr("euc-kr"));if(i===null)return Ai(n);var o=Ro(i/190)+129,s=i%190+65;return[o,s]}}dn["EUC-KR"]=function(e){return new TD(e)};mn["EUC-KR"]=function(e){return new AD(e)};function cd(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function B_(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 pt;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,Ae(a,56320,57343)?65536+(c-55296)*1024+(a-56320):(o.prepend(cd(a,e)),Xe(r))}return Ae(a,55296,56319)?(i=a,null):Ae(a,56320,57343)?Xe(r):a}}function C_(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Ye)return pt;if(Ae(i,0,65535))return cd(i,e);var o=cd((i-65536>>10)+55296,e),s=cd((i-65536&1023)+56320,e);return o.concat(s)}}dn["UTF-16BE"]=function(e){return new C_(!0,e)};mn["UTF-16BE"]=function(e){return new B_(!0,e)};dn["UTF-16LE"]=function(e){return new C_(!1,e)};mn["UTF-16LE"]=function(e){return new B_(!1,e)};function ID(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?pt:ci(n)?n:63360+n-128}}function PD(e){var t=e.fatal;this.handler=function(r,n){return n===Ye?pt:ai(n)?n:Ae(n,63360,63487)?n-63360+128:Ai(n)}}dn["x-user-defined"]=function(e){return new PD(e)};mn["x-user-defined"]=function(e){return new ID(e)};function af(e){return Buffer.from(e).toString("base64")}function F1(e){return Buffer.from(e,"base64").toString("ascii")}async function Bd(){try{return(await Promise.resolve().then(()=>(J3(),Z3))).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 Cd=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg+xml"];async function Dd(e,t){let r=await Bd(),{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 ev(e){return e instanceof ArrayBuffer?e:(ArrayBuffer.isView(e),Nd(e))}function Nd(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:Q3(t,r,n)}return Q3(e)}function Q3(e,t=0,r=e.byteLength-t){let n=new Uint8Array(r);return n.set(new Uint8Array(e,t,r)),n.buffer}async function _g(e,t={}){let r=await Bd(),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 ev(o)}var Al=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 Sg(e){return e instanceof Al}function tv(e){return new Al(e)}function Mg(e){if(!Sg(e))throw new Error("getImageBitmapData");return e._getImageData()}var qk="",Vk=new Map;function Fd(e){for(let[t,r]of Vk)e.startsWith(t)&&(e=e.replace(t,r));return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${qk}${e}`),e}var Do=pe(require("fs"),1),Ja=class{handle;size;bigsize;url;constructor(t,r,n){t=Fd(t),this.handle=Do.default.openSync(t,r,n);let i=Do.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)=>{Do.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{Do.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)=>{Do.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)=>Do.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 Wk(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);Do.default.write(this.handle,a,0,n,s,(c,l)=>c?o(c):i(l))})}};async function Wk(e,t,r,n,i){return await new Promise((o,s)=>Do.default.read(e,t,r,n,i,(a,c)=>a?s(a):o(c)))}var Ud=pe(require("fs/promises"),1);var Eg=pe(require("fs"),1),vg=require("stream");var Gd=pe(require("zlib"),1);function rv(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(Gd.default.createBrotliDecompress());case"gzip":return e.pipe(Gd.default.createGunzip());case"deflate":return e.pipe(Gd.default.createDeflate());default:return e}}var Hk=e=>typeof e=="boolean",nv=e=>typeof e=="function",$k=e=>e!==null&&typeof e=="object",Kk=e=>$k(e)&&nv(e.read)&&nv(e.pipe)&&Hk(e.readable);async function kd(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=Fd(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=Eg.default.createReadStream(n,{encoding:null});m.once("readable",()=>h(m)),m.on("error",g=>d(g))}),s=o;Kk(o)?s=rv(o,i):typeof o=="string"?s=vg.Readable.from([new TextEncoder().encode(o)]):s=vg.Readable.from([o||new ArrayBuffer(0)]);let a=200,c="OK",l=Xk(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 Xk(e){let t={};if(!t["content-length"]){let r=Eg.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 jd=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await Ud.default.readdir(t,r)}async stat(t){let r=await Ud.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await Ud.default.unlink(t)}async fetch(t,r){return await kd(t,r)}async openReadableFile(t,r="r"){return new Ja(t,r)}async openWritableFile(t,r="w",n){return new Ja(t,r,n)}};var gf=pe(require("crypto"),1),zd=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(!gf.createHash)throw new Error("crypto.createHash not available");let c=(a=gf.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(!gf.createHash)throw new Error("crypto.createHash not available");let n=(c=gf.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 lv=require("node:process"),uv=require("node:stream/web");var qd=require("node:stream");function iv(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=qd.Readable.from(i,{highWaterMark:(0,qd.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 Vd=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,${af(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};function ov(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Vd),global}var Ag=pe(require("module"),1),Tg=pe(require("path"),1),Hd=pe(require("fs"),1),Ig=require("node:url");async function sv(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Nd(Hd.default.readFileSync(Pg(e)))}async function av(e){return e.startsWith("http")?await(await fetch(e)).text():Hd.default.readFileSync(Pg(e),"utf8")}async function cv(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return Wd(i)}let t=Pg(e),r=Hd.default.readFileSync(t,"utf8");return Wd(r,t)}function Wd(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t.startsWith("file:")&&(t=(0,Ig.fileURLToPath)(t)),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=Ag.default._nodeModulePaths(Tg.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),o=new Ag.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 Pg(e){return e.startsWith("file:")?(0,Ig.fileURLToPath)(e):Tg.default.resolve(e)}var nJ=parseInt(lv.versions.node.split(".")[0]),sJ=globalThis.Blob,aJ=globalThis.File;ov();T_&&console.error("loaders.gl: The @loaders.gl/core/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=iv;globalThis.loaders.NodeFile=Ja;globalThis.loaders.NodeFileSystem=jd;globalThis.loaders.fetchNode=kd;globalThis.loaders.NodeHash=zd;globalThis.TextEncoder||(globalThis.TextEncoder=sf);globalThis.TextDecoder||(globalThis.TextDecoder=Ka);globalThis.ReadableStream||(globalThis.ReadableStream=uv.ReadableStream);!("atob"in globalThis)&&af&&(globalThis.atob=af);!("btoa"in globalThis)&&F1&&(globalThis.btoa=F1);globalThis.loaders.encodeImageNode=_g;globalThis.loaders.parseImageNode=Dd;globalThis.loaders.imageFormatsNode=Cd;globalThis.loaders.createImageBitmapNode=tv;globalThis.loaders.getImageBitmapDataNode=Mg;globalThis.loaders.isImageBitmapNode=Sg;globalThis.ImageBitmap||(globalThis.ImageBitmap=Al);"getImageBitmapData"in globalThis||(globalThis.getImageBitmapData=Mg);globalThis._parseImageNode=Dd;globalThis._imageFormatsNode=Cd;globalThis.loaders.readFileAsArrayBuffer=sv;globalThis.loaders.readFileAsText=av;globalThis.loaders.requireFromFile=cv;globalThis.loaders.requireFromString=Wd;zs();__();kg(S_);
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(()=>{Tr();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(()=>{Tr();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(()=>{Tr();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 T$(e,t);if(Wn(e))return A$(e,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}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){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 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){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(()=>{Tr();dr();Xo()});function TP(e){return new $w(e)}var $w,EP,AP,IP=p(()=>{Tr();Iu();$w=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:r,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,o=VT(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=oi(o),this._getSize=i!=="bytes"?EP:AP;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:AP}),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},AP=e=>{var t;return(t=e==null?void 0:e.byteLength)!==null&&t!==void 0?t:0}});function A0(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(()=>{Tr();vo();rl()});function T0(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(()=>{Tr();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=TP;pr.throughDOM=A0;ms.throughDOM=A0;Ki.throughDOM=A0;Ei.throughDOM=T0;bs.throughDOM=T0;ys.throughDOM=T0});var ws={};Qt(ws,{AsyncByteQueue:()=>Ln,AsyncByteStream:()=>$r,AsyncMessageReader:()=>el,AsyncRecordBatchFileReader:()=>Ou,AsyncRecordBatchStreamReader:()=>ds,Binary:()=>An,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:()=>Tn,DecimalBuilder:()=>_a,DenseUnion:()=>es,DenseUnionBuilder:()=>Xc,Dictionary:()=>nr,DictionaryBuilder:()=>Rc,Duration:()=>an,DurationBuilder:()=>Si,DurationMicrosecond:()=>fh,DurationMicrosecondBuilder:()=>Ia,DurationMillisecond:()=>uh,DurationMillisecondBuilder:()=>Ta,DurationNanosecond:()=>hh,DurationNanosecondBuilder:()=>Pa,DurationSecond:()=>lh,DurationSecondBuilder:()=>Aa,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:()=>Ao,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:()=>Aw,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 An: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 Tn: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 Tn(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 An,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.5"});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 AR(e,t,r)}catch(n){if(t==="javascript")throw n;try{return await AR(e,"javascript","full")}catch(i){throw new AggregateError([n,i],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function AR(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 TR(e,r)}catch(s){if(Pi||e.useLocalLibraries)throw s;[n,i]=await TR({...e,useLocalLibraries:!0},r)}let o=PR(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await IR(o,i)}async function TR(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}=Ai),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}=Ai),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}=Ai),_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:Ai.options.draco.backend}var Ai,jh=p(()=>{"use strict";KP();pR();yR();wR();Ai={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";zT();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"?AK(e):i==="proj-string"?TK(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 AK(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 TK(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))/Tt;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("@"),T=O?I.slice(1):I;if(!T||/\s/.test(T))throw new Error("Invalid datum grid name");return Object.freeze({name:T,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??Tt;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))*Tt;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)*Tt,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(!Tf(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 Ax(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=Ax(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,Tx=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)*Tt;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 AL=p(()=>{});function TL(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=Ax(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();Tx();Wt();Hh();vL();AL();$h=class e{static async create(t={}){let r=await Promise.all(TL(t).map(tL));return new e({...t,projections:r})}get targetProfile(){return this.getTargetRenderingProfile(this.targetCoverage)}getTargetRenderingProfile(t){return this.targetRenderingProfile&&T8(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=TL(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:AE(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)*Tt,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)*Tt,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=Ti: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 Ti: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===Ti){if(n=e.mode===Ti?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===Ti?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===Ti){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 Ti: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 Ti: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===Ti)&&(m=Math.sin(o),h=Math.cos(o)),e.mode){case Ti: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===Ti||e.mode===hn)?0:Math.atan2(r,n)}else{if(u=0,e.mode===hn||e.mode===Ti){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,Ti,hn,pO=p(()=>{Bt();Yh();_t();Ux();Df();Xi=1,Ro=2,Ti=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,AO=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 TO(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,T,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))),T=I/1024*(256+I*(-128+I*(74-47*I))),W=T*S*(E+T/4*(M*(-1+2*E*E)-T/6*E*(-3+4*S*S)*(-3+4*E*E))),k=i*(1-o)*O*(v-W);let A=Math.atan2(m*w,h*d-u*m*_);s.x=A,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),T=o/16*g*(4+o*(4-3*g)),W=O-(1-T)*o*m*(_+T*C*(v+T*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;TO(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();Tx();$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 Te(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=Te(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,T=(b.y-E)/C,W=j*T-O*I;if(!Number.isFinite(W)||Math.abs(W)<1e-12||(o-=(T*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=Te(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=Te(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=Te(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=Te(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=Te(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),T=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=(A,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=A.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,T,a,r)),Be([e.y0,e.y0],k(T,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 AC=p(()=>{dc()});var a_,TC=p(()=>{SC();Ut();AC();Wt();a_={name:"geos",aliases:["Geostationary Satellite View","Geostationary_Satellite"],parameters:["lon_0","x_0","y_0","h","sweep"],create(e){let t=Te(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=Te(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"):tA(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=Te(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=Te(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=Te(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=Te(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,T=0;for(r=1;r<=9;r++)O=O*j,T=T+e.D[r]*O;var W=e.lat0+T*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=Te(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=Te(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=Te(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,AB=p(()=>{_t();Yx();Wx();_B=20});var b_,TB=p(()=>{Ha();et();ut();Ut();AB();b_={name:"poly",aliases:["Polyconic","American_Polyconic"],parameters:["lon_0","x_0","y_0","lat_0"],create(e){let t=Te(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=Te(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=Te(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=Te(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=Te(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=Te(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)=>eA(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=Te(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 AX(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=>A_(e,l)));if(!r)throw new Error("Oblique transformation requires a rotation parameter set");for(let c of r){if(!A_(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}=AX(n),c=Math.cos(a),l=Math.sin(a),u=Math.abs(a)>1e-10,h=Yi(n,"lon_0"),d=A_(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),T=Math.cos(O),W=Math.sin(I),k=Math.cos(I),A=Yt(Math.atan2(k*Math.sin(O),u?l*k*T+c*W:W)+s),B=w(u?l*W-c*k*T:-k*T);E.x=A,E.y=B},S=E=>{let j=E.x,I=E.y,O=j-s,T=Math.cos(O),W=Math.sin(I),k=Math.cos(I),A=Math.atan2(k*Math.sin(O),u?l*k*T-c*W:-W),B=w(u?l*W+c*k*T:k*T);E.x=Yt(A+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(T=>{var D;let W=T.x,k=T.y;_(T);let A=T.x*180/Math.PI,B=T.y*180/Math.PI,N={x:A,y:B,z:T.z};if((D=E.normalize)==null||D.call(E,N),N.x===A&&N.y===B){T.x=W,T.y=k;return}T.x=N.x*Math.PI/180,T.y=N.y*Math.PI/180,S(T),d&&(T.x+=Math.round((W-T.x)/(2*Math.PI))*2*Math.PI)},r.primeMeridian??0);return{get bounds(){let T=E.bounds,W=k=>[k[0]*180/Math.PI,k[1]*180/Math.PI,k[2]];return t?[W(T[0]),W(T[1])]:T},normalize(T){I==null||I.normalize(T),O(T)}}};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),T=u?[l,0,c]:[0,0,1],k=dt(T,I)[0]>0?zs([0,1,0],T,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_,A_,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,""),A_=(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:Tt,radian:1,grad:Math.PI/200,gon:Math.PI/200,foot:.3048,ussurveyfoot:1200/3937,kilometre:1e3,arcsecond:Tt/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 T=ul(O[0],t);return{...T,areaOfUse:n??T.areaOfUse,lossy:!0}}if(r==="BoundCRS"){let O=ul(Rt(e.source_crs),t),T=ul(Rt(e.target_crs),t);(T.parameters.datum!=="WGS84"||!["longlat","geocent"].includes(T.parameters.proj)||Number(T.parameters.pm||0)!==0||T.parameters.towgs84||Number(T.parameters.a)!==6378137||!(Math.abs(Number(T.parameters.rf)-298.257223563)<=1e-9||Math.abs(Number(T.parameters.b)-6356752314245179e-9)<=1e-6))&&Ue("BoundCRS requires a WGS84 target");let W=Rt(e.transformation),k=Xr(Rt(W.method).name),A=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);!A&&!B&&!N&&Ue("Unsupported BoundCRS transformation: "+k);let D=["xaxistranslation","yaxistranslation","zaxistranslation","xaxisrotation","yaxisrotation","zaxisrotation","scaledifference"],L=new Array(A?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?Tt/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 T=l[O];return T.ellipse!==b.ellipse||T.towgs84!==b.towgs84||T.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 T={newzealand1949:"nzgd49",belge1972:"rnb72"}[h.replace(/^d/,"")];T&&(c.datum=T)}if(r==="ProjectedCRS"&&i.id){let O=Rt(i.id),T=String(O.authority)+"_"+String(O.code);Object.prototype.hasOwnProperty.call(l,T)&&(c.datum=T)}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,Tt),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)/Tt)}if(r==="ProjectedCRS"){let O=Rt(e.conversion),T=Xr(Rt(O.method).name),W=Qh(O.parameters).map(Rt),k=T==="stereographicnorthpole"&&!W.some(D=>Xr(D.name).startsWith("scalefactor")),A=k?"stere":TX[T],B=W.filter(D=>["xscale","yscale","xyplanerotation"].includes(Xr(D.name)));if(B.length){let D={xscale:-1,yscale:1,xyplanerotation:90};(A!=="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)/Tt:Cn(L.unit,1);return Math.abs(Or(L.value)*z-D[P])>1e-10}))&&Ue("Unsupported ESRI Krovak axis adjustment")}(!A||A.startsWith("unsupported"))&&Ue("Unsupported projection method: "+String(Rt(O.method).name)),c.proj=A==="webmerc"?"merc":A;let N=!1;for(let D of W){let L=Xr(D.name);if(B.includes(D)||L==="auxiliaryspheretype"&&A==="webmerc"&&D.value===0)continue;if(L==="semiminor"&&A==="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[A])==null?void 0:j[L])||IX[L];if(P||Ue("Unsupported conversion parameter: "+String(D.name)),P==="lat_1"&&T==="stereographicnorthpole"&&!k?P="lat_0":P==="lat_1"&&["merc","webmerc","eqc","stere","cea"].includes(A)&&(P="lat_ts"),c[P]!==void 0)throw new Error("Duplicate conversion parameter: "+P);if(["merc","webmerc"].includes(A)&&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?Tt:1);P.startsWith("lat")&&Math.abs(Math.abs(_e)-90)<=4*Number.EPSILON*90&&(_e=Math.sign(_e)*90),c[P]=String(_e)}if(A==="omerc"&&["hotineobliquemercator","hotineobliquemercatorvarianta","hotineobliquemercatorazimuthnaturalorigin"].includes(T)&&(c.no_uoff=void 0),A==="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),T==="stereographicnorthpole"&&Math.abs(Number(c.lat_0))===90&&(c.proj="stere"),A==="lcc"&&c.lat_1===void 0&&(c.lat_1=c.lat_0),T==="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}A==="stere"&&(T.includes("polar")||T==="stereographicsouthpole"||k)&&c.lat_0===void 0&&(c.lat_0=Number(c.lat_ts||90)<0?"-90":"90"),A==="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,Tt)/Tt,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 TX,IX,PX,RX,T_=p(()=>{Y0();Wt();qa();TX={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();T_();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();T_();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();aA();AO();BO();Yy();Y8();DO();$O();ZO();rC();cC();pC();xC();TC();NC();qC();KC();QC();oB();uB();pB();xB();TB();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(At.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(At.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=>At.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=At.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 Af().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=At.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(At.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=At.WGS84.cartographicToCartesian(new J(c));return SD().map(u=>Array.from(At.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(At.WGS84.cartographicToCartesian(new J(n))));return{box:dl(r)}}async transformBoundingVolumeToGeocentricAsync(t){let r=(await this.getGeographicBoundSamplesAsync(t)).map(n=>Array.from(At.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(At.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=At.WGS84.cartographicToCartesian(new J(r)),i=[];for(let s of KX()){let a=At.WGS84.cartesianToCartographic(new J(n).add(s)),c=At.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 AD(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 TD=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_(AD(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,Ai,{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,T]of Object.entries(M.attributes))!["POSITION","NORMAL","COLOR_0","feature-index","uv-region"].includes(O)&&!/^TEXCOORD_\d+$/.test(O)&&(a[O]=T);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:T}=RD(e,I,C,u,R),W=eY(e,T);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 At.WGS84.cartographicToCartesian(s,a),Gy(At.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)At.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();TD();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.5",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:Ai,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 Ae(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 Ae(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(Ae(c,0,127))return c;if(Ae(c,194,223))i=1,r=c&31;else if(Ae(c,224,239))c===224&&(o=160),c===237&&(s=159),i=2,r=c&15;else if(Ae(c,240,244))c===240&&(o=144),c===244&&(s=143),i=3,r=c&7;else return Xe(t);return null}if(!Ae(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;Ae(n,128,2047)?(i=1,o=192):Ae(n,2048,65535)?(i=2,o=224):Ae(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,Ae(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 Ae(s,129,254)?(i=s,null):(o.prepend([n,s]),r=0,n=0,Xe(t));if(r!==0){if(Ae(s,48,57))return n=s,null;var l=r,u=null;r=0;var h=s<127?64:65;return(Ae(s,64,126)||Ae(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:Ae(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((Ae(i,64,126)||Ae(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:Ae(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&&Ae(o,161,223))return n=0,65216+o;if(n===143&&Ae(o,161,254))return r=!0,n=o,null;if(n!==0){var s=n;n=0;var a=null;return Ae(s,161,254)&&Ae(o,161,254)&&(a=gl((s-161)*94+(o-161),Zr(r?"jis0212":"jis0208"))),r=!1,Ae(o,161,254)||i.prepend(o),a===null?Xe(t):a}return ui(o)?o:o===142||o===143||Ae(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(Ae(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):Ae(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):Ae(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):Ae(c,33,95)?(s=!1,65344+c):c===Ye?gt:(s=!1,Xe(t));case r.LeadByte:return c===27?(n=r.EscapeStart,null):Ae(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(Ae(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((Ae(i,64,126)||Ae(i,128,252))&&(s=(o-c)*188+i-a),Ae(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:Ae(i,161,223)?65216+i:Ae(i,129,159)||Ae(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(Ae(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,Ae(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:Ae(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,Ae(a,56320,57343)?65536+(c-55296)*1024+(a-56320):(o.prepend(hd(a,e)),Xe(r))}return Ae(a,55296,56319)?(i=a,null):Ae(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(Ae(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:Ae(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 Ag(e){return e instanceof Pl}function _v(e){return new Pl(e)}function Tg(e){if(!Ag(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 Av(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Ud(Yd.default.readFileSync(Cg(e)))}async function Tv(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=Tg;globalThis.loaders.isImageBitmapNode=Ag;globalThis.ImageBitmap||(globalThis.ImageBitmap=Pl);"getImageBitmapData"in globalThis||(globalThis.getImageBitmapData=Tg);globalThis._parseImageNode=Gd;globalThis._imageFormatsNode=kd;globalThis.loaders.readFileAsArrayBuffer=Av;globalThis.loaders.readFileAsText=Tv;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: