acmi-parser 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/dist/acmi-parser.cjs +3 -45
  3. package/dist/acmi-parser.js +6118 -9090
  4. package/dist/types/acmi/acmiData.d.ts +41 -0
  5. package/dist/types/acmi/entity.d.ts +26 -0
  6. package/dist/types/acmi/frame.d.ts +17 -0
  7. package/dist/types/acmi/globalProperties.d.ts +30 -0
  8. package/dist/types/acmi/header.d.ts +7 -0
  9. package/dist/types/acmi/timeSpan.d.ts +12 -0
  10. package/dist/types/acmi/transform.d.ts +22 -0
  11. package/dist/types/index.d.ts +14 -0
  12. package/dist/types/math3d/core/classes/base/math-array.d.ts +66 -0
  13. package/dist/types/math3d/core/classes/base/matrix.d.ts +13 -0
  14. package/dist/types/math3d/core/classes/base/vector.d.ts +43 -0
  15. package/dist/types/math3d/core/classes/euler.d.ts +78 -0
  16. package/dist/types/math3d/core/classes/matrix3.d.ts +62 -0
  17. package/dist/types/math3d/core/classes/matrix4.d.ts +232 -0
  18. package/dist/types/math3d/core/classes/pose.d.ts +39 -0
  19. package/dist/types/math3d/core/classes/quaternion.d.ts +64 -0
  20. package/dist/types/math3d/core/classes/spherical-coordinates.d.ts +59 -0
  21. package/dist/types/math3d/core/classes/vector2.d.ts +54 -0
  22. package/dist/types/math3d/core/classes/vector3.d.ts +59 -0
  23. package/dist/types/math3d/core/classes/vector4.d.ts +40 -0
  24. package/dist/types/math3d/core/gl-matrix/common.d.ts +37 -0
  25. package/dist/types/math3d/core/gl-matrix/mat3.d.ts +286 -0
  26. package/dist/types/math3d/core/gl-matrix/mat4.d.ts +549 -0
  27. package/dist/types/math3d/core/gl-matrix/quat.d.ts +358 -0
  28. package/dist/types/math3d/core/gl-matrix/vec2.d.ts +362 -0
  29. package/dist/types/math3d/core/gl-matrix/vec3.d.ts +405 -0
  30. package/dist/types/math3d/core/gl-matrix/vec4.d.ts +329 -0
  31. package/dist/types/math3d/core/index.d.ts +29 -0
  32. package/dist/types/math3d/core/lib/assert.d.ts +1 -0
  33. package/dist/types/math3d/core/lib/common.d.ts +99 -0
  34. package/dist/types/math3d/core/lib/gl-matrix-extras.d.ts +6 -0
  35. package/dist/types/math3d/core/lib/math-utils.d.ts +24 -0
  36. package/dist/types/math3d/core/lib/validators.d.ts +5 -0
  37. package/dist/types/math3d/geoid/geoid.d.ts +73 -0
  38. package/dist/types/math3d/geoid/index.d.ts +2 -0
  39. package/dist/types/math3d/geoid/parse-pgm.d.ts +11 -0
  40. package/dist/types/math3d/geospatial/constants.d.ts +11 -0
  41. package/dist/types/math3d/geospatial/ellipsoid/ellipsoid.d.ts +69 -0
  42. package/dist/types/math3d/geospatial/ellipsoid/helpers/ellipsoid-transform.d.ts +4 -0
  43. package/dist/types/math3d/geospatial/ellipsoid/helpers/scale-to-geodetic-surface.d.ts +2 -0
  44. package/dist/types/math3d/geospatial/index.d.ts +2 -0
  45. package/dist/types/math3d/geospatial/type-utils.d.ts +23 -0
  46. package/dist/types/math3d/index.d.ts +4 -0
  47. package/dist/types/math3d/types/array-types.d.ts +14 -0
  48. package/dist/types/math3d/types/bigint.d.ts +20 -0
  49. package/dist/types/math3d/types/index.d.ts +2 -0
  50. package/dist/types/math3d/types/is-array.d.ts +13 -0
  51. package/dist/types/parser.d.ts +90 -0
  52. package/dist/types/trajectory/stateVector.d.ts +30 -0
  53. package/dist/types/trajectory/trajectory.d.ts +40 -0
  54. package/dist/types/trajectory/trajectorySample.d.ts +11 -0
  55. package/package.json +20 -18
  56. package/dist/types/acmi-parser.d.ts +0 -179
@@ -1,45 +1,3 @@
1
- "use strict";var Ki=Object.create;var Mn=Object.defineProperty;var er=Object.getOwnPropertyDescriptor;var tr=Object.getOwnPropertyNames;var nr=Object.getPrototypeOf,or=Object.prototype.hasOwnProperty;var ir=(e,t,n)=>t in e?Mn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var rr=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tr(t))!or.call(e,i)&&i!==n&&Mn(e,i,{get:()=>t[i],enumerable:!(o=er(t,i))||o.enumerable});return e};var Vt=(e,t,n)=>(n=e!=null?Ki(nr(e)):{},rr(t||!e||!e.__esModule?Mn(n,"default",{value:e,enumerable:!0}):n,e));var Z=(e,t,n)=>(ir(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Gt=typeof document<"u"?document.currentScript:null,We=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sr(e,t,n,o,i){for(var s=i+1;o<=i;){var r=o+i>>>1,c=e[r],u=n!==void 0?n(c,t):c-t;u>=0?(s=r,i=r-1):o=r+1}return s}function cr(e,t,n,o,i){for(var s=i+1;o<=i;){var r=o+i>>>1,c=e[r],u=n!==void 0?n(c,t):c-t;u>0?(s=r,i=r-1):o=r+1}return s}function ar(e,t,n,o,i){for(var s=o-1;o<=i;){var r=o+i>>>1,c=e[r],u=n!==void 0?n(c,t):c-t;u<0?(s=r,o=r+1):i=r-1}return s}function fr(e,t,n,o,i){for(var s=o-1;o<=i;){var r=o+i>>>1,c=e[r],u=n!==void 0?n(c,t):c-t;u<=0?(s=r,o=r+1):i=r-1}return s}function ur(e,t,n,o,i){for(;o<=i;){var s=o+i>>>1,r=e[s],c=n!==void 0?n(r,t):r-t;if(c===0)return s;c<=0?o=s+1:i=s-1}return-1}function At(e,t,n,o,i,s){return typeof n=="function"?s(e,t,n,o===void 0?0:o|0,i===void 0?e.length-1:i|0):s(e,t,void 0,n===void 0?0:n|0,o===void 0?e.length-1:o|0)}var hr={ge:function(e,t,n,o,i){return At(e,t,n,o,i,sr)},gt:function(e,t,n,o,i){return At(e,t,n,o,i,cr)},lt:function(e,t,n,o,i){return At(e,t,n,o,i,ar)},le:function(e,t,n,o,i){return At(e,t,n,o,i,fr)},eq:function(e,t,n,o,i){return At(e,t,n,o,i,ur)}};const dr=Et(hr);function d(e){return e!=null}function E(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}d(Object.create)&&(E.prototype=Object.create(Error.prototype),E.prototype.constructor=E);E.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return d(this.stack)&&(e+=`
2
- ${this.stack.toString()}`),e};E.throwInstantiationError=function(){throw new E("This function defines an interface and should not be called directly.")};const f={};f.typeOf={};function pr(e){return`${e} is required, actual value was undefined`}function Tt(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}f.defined=function(e,t){if(!d(t))throw new E(pr(e))};f.typeOf.func=function(e,t){if(typeof t!="function")throw new E(Tt(typeof t,"function",e))};f.typeOf.string=function(e,t){if(typeof t!="string")throw new E(Tt(typeof t,"string",e))};f.typeOf.number=function(e,t){if(typeof t!="number")throw new E(Tt(typeof t,"number",e))};f.typeOf.number.lessThan=function(e,t,n){if(f.typeOf.number(e,t),t>=n)throw new E(`Expected ${e} to be less than ${n}, actual value was ${t}`)};f.typeOf.number.lessThanOrEquals=function(e,t,n){if(f.typeOf.number(e,t),t>n)throw new E(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};f.typeOf.number.greaterThan=function(e,t,n){if(f.typeOf.number(e,t),t<=n)throw new E(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};f.typeOf.number.greaterThanOrEquals=function(e,t,n){if(f.typeOf.number(e,t),t<n)throw new E(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};f.typeOf.object=function(e,t){if(typeof t!="object")throw new E(Tt(typeof t,"object",e))};f.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new E(Tt(typeof t,"boolean",e))};f.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new E(Tt(typeof t,"bigint",e))};f.typeOf.number.equals=function(e,t,n,o){if(f.typeOf.number(e,n),f.typeOf.number(t,o),n!==o)throw new E(`${e} must be equal to ${t}, the actual values are ${n} and ${o}`)};function j(e,t){return e??t}j.EMPTY_OBJECT=Object.freeze({});var Qe=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};Qe.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Qe.prototype.init_by_array=function(e,t){var n,o,i;for(this.init_seed(19650218),n=1,o=0,i=this.N>t?this.N:t;i;i--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+e[o]+o,this.mt[n]>>>=0,n++,o++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),o>=t&&(o=0)}for(i=this.N-1;i;i--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1566083941<<16)+(s&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Qe.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};Qe.prototype.random_int31=function(){return this.random_int()>>>1};Qe.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Qe.prototype.random=function(){return this.random_int()*(1/4294967296)};Qe.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Qe.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};var lr=Qe;const oi=Et(lr),S={};S.EPSILON1=.1;S.EPSILON2=.01;S.EPSILON3=.001;S.EPSILON4=1e-4;S.EPSILON5=1e-5;S.EPSILON6=1e-6;S.EPSILON7=1e-7;S.EPSILON8=1e-8;S.EPSILON9=1e-9;S.EPSILON10=1e-10;S.EPSILON11=1e-11;S.EPSILON12=1e-12;S.EPSILON13=1e-13;S.EPSILON14=1e-14;S.EPSILON15=1e-15;S.EPSILON16=1e-16;S.EPSILON17=1e-17;S.EPSILON18=1e-18;S.EPSILON19=1e-19;S.EPSILON20=1e-20;S.EPSILON21=1e-21;S.GRAVITATIONALPARAMETER=3986004418e5;S.SOLAR_RADIUS=6955e5;S.LUNAR_RADIUS=1737400;S.SIXTY_FOUR_KILOBYTES=64*1024;S.FOUR_GIGABYTES=4*1024*1024*1024;S.sign=j(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});S.signNotZero=function(e){return e<0?-1:1};S.toSNorm=function(e,t){return t=j(t,255),Math.round((S.clamp(e,-1,1)*.5+.5)*t)};S.fromSNorm=function(e,t){return t=j(t,255),S.clamp(e,0,t)/t*2-1};S.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:S.clamp((e-t)/n,0,1)};S.sinh=j(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});S.cosh=j(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});S.lerp=function(e,t,n){return(1-n)*e+n*t};S.PI=Math.PI;S.ONE_OVER_PI=1/Math.PI;S.PI_OVER_TWO=Math.PI/2;S.PI_OVER_THREE=Math.PI/3;S.PI_OVER_FOUR=Math.PI/4;S.PI_OVER_SIX=Math.PI/6;S.THREE_PI_OVER_TWO=3*Math.PI/2;S.TWO_PI=2*Math.PI;S.ONE_OVER_TWO_PI=1/(2*Math.PI);S.RADIANS_PER_DEGREE=Math.PI/180;S.DEGREES_PER_RADIAN=180/Math.PI;S.RADIANS_PER_ARCSECOND=S.RADIANS_PER_DEGREE/3600;S.toRadians=function(e){if(!d(e))throw new E("degrees is required.");return e*S.RADIANS_PER_DEGREE};S.toDegrees=function(e){if(!d(e))throw new E("radians is required.");return e*S.DEGREES_PER_RADIAN};S.convertLongitudeRange=function(e){if(!d(e))throw new E("angle is required.");const t=S.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};S.clampToLatitudeRange=function(e){if(!d(e))throw new E("angle is required.");return S.clamp(e,-1*S.PI_OVER_TWO,S.PI_OVER_TWO)};S.negativePiToPi=function(e){if(!d(e))throw new E("angle is required.");return e>=-S.PI&&e<=S.PI?e:S.zeroToTwoPi(e+S.PI)-S.PI};S.zeroToTwoPi=function(e){if(!d(e))throw new E("angle is required.");if(e>=0&&e<=S.TWO_PI)return e;const t=S.mod(e,S.TWO_PI);return Math.abs(t)<S.EPSILON14&&Math.abs(e)>S.EPSILON14?S.TWO_PI:t};S.mod=function(e,t){if(!d(e))throw new E("m is required.");if(!d(t))throw new E("n is required.");if(t===0)throw new E("divisor cannot be 0.");return S.sign(e)===S.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};S.equalsEpsilon=function(e,t,n,o){if(!d(e))throw new E("left is required.");if(!d(t))throw new E("right is required.");n=j(n,0),o=j(o,n);const i=Math.abs(e-t);return i<=o||i<=n*Math.max(Math.abs(e),Math.abs(t))};S.lessThan=function(e,t,n){if(!d(e))throw new E("first is required.");if(!d(t))throw new E("second is required.");if(!d(n))throw new E("absoluteEpsilon is required.");return e-t<-n};S.lessThanOrEquals=function(e,t,n){if(!d(e))throw new E("first is required.");if(!d(t))throw new E("second is required.");if(!d(n))throw new E("absoluteEpsilon is required.");return e-t<n};S.greaterThan=function(e,t,n){if(!d(e))throw new E("first is required.");if(!d(t))throw new E("second is required.");if(!d(n))throw new E("absoluteEpsilon is required.");return e-t>n};S.greaterThanOrEquals=function(e,t,n){if(!d(e))throw new E("first is required.");if(!d(t))throw new E("second is required.");if(!d(n))throw new E("absoluteEpsilon is required.");return e-t>-n};const Zt=[1];S.factorial=function(e){if(typeof e!="number"||e<0)throw new E("A number greater than or equal to 0 is required.");const t=Zt.length;if(e>=t){let n=Zt[t-1];for(let o=t;o<=e;o++){const i=n*o;Zt.push(i),n=i}}return Zt[e]};S.incrementWrap=function(e,t,n){if(n=j(n,0),!d(e))throw new E("n is required.");if(t<=n)throw new E("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e};S.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new E("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0};S.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new E("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};S.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new E("A number between 0 and (2^32)-1 is required.");return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};S.clamp=function(e,t,n){return f.typeOf.number("value",e),f.typeOf.number("min",t),f.typeOf.number("max",n),e<t?t:e>n?n:e};let ii=new oi;S.setRandomNumberSeed=function(e){if(!d(e))throw new E("seed is required.");ii=new oi(e)};S.nextRandomNumber=function(){return ii.random()};S.randomBetween=function(e,t){return S.nextRandomNumber()*(t-e)+e};S.acosClamped=function(e){if(!d(e))throw new E("value is required.");return Math.acos(S.clamp(e,-1,1))};S.asinClamped=function(e){if(!d(e))throw new E("value is required.");return Math.asin(S.clamp(e,-1,1))};S.chordLength=function(e,t){if(!d(e))throw new E("angle is required.");if(!d(t))throw new E("radius is required.");return 2*t*Math.sin(e*.5)};S.logBase=function(e,t){if(!d(e))throw new E("number is required.");if(!d(t))throw new E("base is required.");return Math.log(e)/Math.log(t)};S.cbrt=j(Math.cbrt,function(t){const n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});S.log2=j(Math.log2,function(t){return Math.log(t)*Math.LOG2E});S.fog=function(e,t){const n=e*t;return 1-Math.exp(-(n*n))};S.fastApproximateAtan=function(e){return f.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};S.fastApproximateAtan2=function(e,t){f.typeOf.number("x",e),f.typeOf.number("y",t);let n,o=Math.abs(e);n=Math.abs(t);const i=Math.max(o,n);n=Math.min(o,n);const s=n/i;if(isNaN(s))throw new E("either x or y must be nonzero");return o=S.fastApproximateAtan(s),o=Math.abs(t)>Math.abs(e)?S.PI_OVER_TWO-o:o,o=e<0?S.PI-o:o,o=t<0?-o:o,o};function p(e,t,n){this.x=j(e,0),this.y=j(t,0),this.z=j(n,0)}p.fromSpherical=function(e,t){f.typeOf.object("spherical",e),d(t)||(t=new p);const n=e.clock,o=e.cone,i=j(e.magnitude,1),s=i*Math.sin(o);return t.x=s*Math.cos(n),t.y=s*Math.sin(n),t.z=i*Math.cos(o),t};p.fromElements=function(e,t,n,o){return d(o)?(o.x=e,o.y=t,o.z=n,o):new p(e,t,n)};p.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new p(e.x,e.y,e.z)};p.fromCartesian4=p.clone;p.packedLength=3;p.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};p.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new p),n.x=e[t++],n.y=e[t++],n.z=e[t],n};p.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*3;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)p.pack(e[i],t,i*3);return t};p.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new E("array length must be a multiple of 3.");const n=e.length;d(t)?t.length=n/3:t=new Array(n/3);for(let o=0;o<n;o+=3){const i=o/3;t[i]=p.unpack(e,o,t[i])}return t};p.fromArray=p.unpack;p.maximumComponent=function(e){return f.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)};p.minimumComponent=function(e){return f.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)};p.minimumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};p.maximumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};p.clamp=function(e,t,n,o){f.typeOf.object("value",e),f.typeOf.object("min",t),f.typeOf.object("max",n),f.typeOf.object("result",o);const i=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y),r=S.clamp(e.z,t.z,n.z);return o.x=i,o.y=s,o.z=r,o};p.magnitudeSquared=function(e){return f.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z};p.magnitude=function(e){return Math.sqrt(p.magnitudeSquared(e))};const yn=new p;p.distance=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),p.subtract(e,t,yn),p.magnitude(yn)};p.distanceSquared=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),p.subtract(e,t,yn),p.magnitudeSquared(yn)};p.normalize=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=p.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new E("normalized result is not a number");return t};p.dot=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z};p.multiplyComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};p.divideComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};p.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};p.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};p.multiplyByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};p.divideByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};p.negate=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t};p.abs=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const _o=new p;p.lerp=function(e,t,n,o){return f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o),p.multiplyByScalar(t,n,_o),o=p.multiplyByScalar(e,1-n,o),p.add(_o,o,o)};const Xt=new p,zn=new p;p.angleBetween=function(e,t){f.typeOf.object("left",e),f.typeOf.object("right",t),p.normalize(e,Xt),p.normalize(t,zn);const n=p.dot(Xt,zn),o=p.magnitude(p.cross(Xt,zn,Xt));return Math.atan2(o,n)};const mr=new p;p.mostOrthogonalAxis=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=p.normalize(e,mr);return p.abs(n,n),n.x<=n.y?n.x<=n.z?t=p.clone(p.UNIT_X,t):t=p.clone(p.UNIT_Z,t):n.y<=n.z?t=p.clone(p.UNIT_Y,t):t=p.clone(p.UNIT_Z,t),t};p.projectVector=function(e,t,n){f.defined("a",e),f.defined("b",t),f.defined("result",n);const o=p.dot(e,t)/p.dot(t,t);return p.multiplyByScalar(t,o,n)};p.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};p.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};p.equalsEpsilon=function(e,t,n,o){return e===t||d(e)&&d(t)&&S.equalsEpsilon(e.x,t.x,n,o)&&S.equalsEpsilon(e.y,t.y,n,o)&&S.equalsEpsilon(e.z,t.z,n,o)};p.cross=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e.x,i=e.y,s=e.z,r=t.x,c=t.y,u=t.z,y=i*u-s*c,m=s*r-o*u,w=o*c-i*r;return n.x=y,n.y=m,n.z=w,n};p.midpoint=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};p.fromDegrees=function(e,t,n,o,i){return f.typeOf.number("longitude",e),f.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),p.fromRadians(e,t,n,o,i)};let qe=new p,ut=new p;const yr=new p(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);p.fromRadians=function(e,t,n,o,i){f.typeOf.number("longitude",e),f.typeOf.number("latitude",t),n=j(n,0);const s=d(o)?o.radiiSquared:yr,r=Math.cos(t);qe.x=r*Math.cos(e),qe.y=r*Math.sin(e),qe.z=Math.sin(t),qe=p.normalize(qe,qe),p.multiplyComponents(s,qe,ut);const c=Math.sqrt(p.dot(qe,ut));return ut=p.divideByScalar(ut,c,ut),qe=p.multiplyByScalar(qe,n,qe),d(i)||(i=new p),p.add(ut,qe,i)};p.fromDegreesArray=function(e,t,n){if(f.defined("coordinates",e),e.length<2||e.length%2!==0)throw new E("the number of coordinates must be a multiple of 2 and at least 2");const o=e.length;d(n)?n.length=o/2:n=new Array(o/2);for(let i=0;i<o;i+=2){const s=e[i],r=e[i+1],c=i/2;n[c]=p.fromDegrees(s,r,0,t,n[c])}return n};p.fromRadiansArray=function(e,t,n){if(f.defined("coordinates",e),e.length<2||e.length%2!==0)throw new E("the number of coordinates must be a multiple of 2 and at least 2");const o=e.length;d(n)?n.length=o/2:n=new Array(o/2);for(let i=0;i<o;i+=2){const s=e[i],r=e[i+1],c=i/2;n[c]=p.fromRadians(s,r,0,t,n[c])}return n};p.fromDegreesArrayHeights=function(e,t,n){if(f.defined("coordinates",e),e.length<3||e.length%3!==0)throw new E("the number of coordinates must be a multiple of 3 and at least 3");const o=e.length;d(n)?n.length=o/3:n=new Array(o/3);for(let i=0;i<o;i+=3){const s=e[i],r=e[i+1],c=e[i+2],u=i/3;n[u]=p.fromDegrees(s,r,c,t,n[u])}return n};p.fromRadiansArrayHeights=function(e,t,n){if(f.defined("coordinates",e),e.length<3||e.length%3!==0)throw new E("the number of coordinates must be a multiple of 3 and at least 3");const o=e.length;d(n)?n.length=o/3:n=new Array(o/3);for(let i=0;i<o;i+=3){const s=e[i],r=e[i+1],c=e[i+2],u=i/3;n[u]=p.fromRadians(s,r,c,t,n[u])}return n};p.ZERO=Object.freeze(new p(0,0,0));p.ONE=Object.freeze(new p(1,1,1));p.UNIT_X=Object.freeze(new p(1,0,0));p.UNIT_Y=Object.freeze(new p(0,1,0));p.UNIT_Z=Object.freeze(new p(0,0,1));p.prototype.clone=function(e){return p.clone(this,e)};p.prototype.equals=function(e){return p.equals(this,e)};p.prototype.equalsEpsilon=function(e,t,n){return p.equalsEpsilon(this,e,t,n)};p.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};const wr=new p,gr=new p;function ri(e,t,n,o,i){if(!d(e))throw new E("cartesian is required.");if(!d(t))throw new E("oneOverRadii is required.");if(!d(n))throw new E("oneOverRadiiSquared is required.");if(!d(o))throw new E("centerToleranceSquared is required.");const s=e.x,r=e.y,c=e.z,u=t.x,y=t.y,m=t.z,w=s*s*u*u,b=r*r*y*y,O=c*c*m*m,R=w+b+O,T=Math.sqrt(1/R),z=p.multiplyByScalar(e,T,wr);if(R<o)return isFinite(T)?p.clone(z,i):void 0;const D=n.x,q=n.y,x=n.z,Y=gr;Y.x=z.x*D*2,Y.y=z.y*q*2,Y.z=z.z*x*2;let N=(1-T)*p.magnitude(e)/(.5*p.magnitude(Y)),H=0,B,U,G,V,k,J,a,h,l,g,_;do{N-=H,G=1/(1+N*D),V=1/(1+N*q),k=1/(1+N*x),J=G*G,a=V*V,h=k*k,l=J*G,g=a*V,_=h*k,B=w*J+b*a+O*h-1,U=w*l*D+b*g*q+O*_*x;const v=-2*U;H=B/v}while(Math.abs(B)>S.EPSILON12);return d(i)?(i.x=s*G,i.y=r*V,i.z=c*k,i):new p(s*G,r*V,c*k)}function le(e,t,n){this.longitude=j(e,0),this.latitude=j(t,0),this.height=j(n,0)}le.fromRadians=function(e,t,n,o){return f.typeOf.number("longitude",e),f.typeOf.number("latitude",t),n=j(n,0),d(o)?(o.longitude=e,o.latitude=t,o.height=n,o):new le(e,t,n)};le.fromDegrees=function(e,t,n,o){return f.typeOf.number("longitude",e),f.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),le.fromRadians(e,t,n,o)};const br=new p,Or=new p,_r=new p,Sr=new p(1/6378137,1/6378137,1/6356752314245179e-9),vr=new p(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),Er=S.EPSILON1;le.fromCartesian=function(e,t,n){const o=d(t)?t.oneOverRadii:Sr,i=d(t)?t.oneOverRadiiSquared:vr,s=d(t)?t._centerToleranceSquared:Er,r=ri(e,o,i,s,Or);if(!d(r))return;let c=p.multiplyComponents(r,i,br);c=p.normalize(c,c);const u=p.subtract(e,r,_r),y=Math.atan2(c.y,c.x),m=Math.asin(c.z),w=S.sign(p.dot(u,e))*p.magnitude(u);return d(n)?(n.longitude=y,n.latitude=m,n.height=w,n):new le(y,m,w)};le.toCartesian=function(e,t,n){return f.defined("cartographic",e),p.fromRadians(e.longitude,e.latitude,e.height,t,n)};le.clone=function(e,t){if(d(e))return d(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new le(e.longitude,e.latitude,e.height)};le.equals=function(e,t){return e===t||d(e)&&d(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};le.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};le.ZERO=Object.freeze(new le(0,0,0));le.prototype.clone=function(e){return le.clone(this,e)};le.prototype.equals=function(e){return le.equals(this,e)};le.prototype.equalsEpsilon=function(e,t){return le.equalsEpsilon(this,e,t)};le.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function Q(e,t){this.x=j(e,0),this.y=j(t,0)}Q.fromElements=function(e,t,n){return d(n)?(n.x=e,n.y=t,n):new Q(e,t)};Q.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t):new Q(e.x,e.y)};Q.fromCartesian3=Q.clone;Q.fromCartesian4=Q.clone;Q.packedLength=2;Q.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e.x,t[n]=e.y,t};Q.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new Q),n.x=e[t++],n.y=e[t],n};Q.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*2;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)Q.pack(e[i],t,i*2);return t};Q.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new E("array length must be a multiple of 2.");const n=e.length;d(t)?t.length=n/2:t=new Array(n/2);for(let o=0;o<n;o+=2){const i=o/2;t[i]=Q.unpack(e,o,t[i])}return t};Q.fromArray=Q.unpack;Q.maximumComponent=function(e){return f.typeOf.object("cartesian",e),Math.max(e.x,e.y)};Q.minimumComponent=function(e){return f.typeOf.object("cartesian",e),Math.min(e.x,e.y)};Q.minimumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Q.maximumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Q.clamp=function(e,t,n,o){f.typeOf.object("value",e),f.typeOf.object("min",t),f.typeOf.object("max",n),f.typeOf.object("result",o);const i=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y);return o.x=i,o.y=s,o};Q.magnitudeSquared=function(e){return f.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y};Q.magnitude=function(e){return Math.sqrt(Q.magnitudeSquared(e))};const wn=new Q;Q.distance=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),Q.subtract(e,t,wn),Q.magnitude(wn)};Q.distanceSquared=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),Q.subtract(e,t,wn),Q.magnitudeSquared(wn)};Q.normalize=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=Q.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new E("normalized result is not a number");return t};Q.dot=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.x+e.y*t.y};Q.cross=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.y-e.y*t.x};Q.multiplyComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n};Q.divideComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n};Q.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n};Q.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n};Q.multiplyByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n};Q.divideByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n};Q.negate=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t};Q.abs=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};const So=new Q;Q.lerp=function(e,t,n,o){return f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o),Q.multiplyByScalar(t,n,So),o=Q.multiplyByScalar(e,1-n,o),Q.add(So,o,o)};const vo=new Q,Eo=new Q;Q.angleBetween=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),Q.normalize(e,vo),Q.normalize(t,Eo),S.acosClamped(Q.dot(vo,Eo))};const Tr=new Q;Q.mostOrthogonalAxis=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=Q.normalize(e,Tr);return Q.abs(n,n),n.x<=n.y?t=Q.clone(Q.UNIT_X,t):t=Q.clone(Q.UNIT_Y,t),t};Q.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y};Q.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Q.equalsEpsilon=function(e,t,n,o){return e===t||d(e)&&d(t)&&S.equalsEpsilon(e.x,t.x,n,o)&&S.equalsEpsilon(e.y,t.y,n,o)};Q.ZERO=Object.freeze(new Q(0,0));Q.ONE=Object.freeze(new Q(1,1));Q.UNIT_X=Object.freeze(new Q(1,0));Q.UNIT_Y=Object.freeze(new Q(0,1));Q.prototype.clone=function(e){return Q.clone(this,e)};Q.prototype.equals=function(e){return Q.equals(this,e)};Q.prototype.equalsEpsilon=function(e,t,n){return Q.equalsEpsilon(this,e,t,n)};Q.prototype.toString=function(){return`(${this.x}, ${this.y})`};function si(e,t,n,o){t=j(t,0),n=j(n,0),o=j(o,0),f.typeOf.number.greaterThanOrEquals("x",t,0),f.typeOf.number.greaterThanOrEquals("y",n,0),f.typeOf.number.greaterThanOrEquals("z",o,0),e._radii=new p(t,n,o),e._radiiSquared=new p(t*t,n*n,o*o),e._radiiToTheFourth=new p(t*t*t*t,n*n*n*n,o*o*o*o),e._oneOverRadii=new p(t===0?0:1/t,n===0?0:1/n,o===0?0:1/o),e._oneOverRadiiSquared=new p(t===0?0:1/(t*t),n===0?0:1/(n*n),o===0?0:1/(o*o)),e._minimumRadius=Math.min(t,n,o),e._maximumRadius=Math.max(t,n,o),e._centerToleranceSquared=S.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function oe(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,si(this,e,t,n)}Object.defineProperties(oe.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});oe.clone=function(e,t){if(!d(e))return;const n=e._radii;return d(t)?(p.clone(n,t._radii),p.clone(e._radiiSquared,t._radiiSquared),p.clone(e._radiiToTheFourth,t._radiiToTheFourth),p.clone(e._oneOverRadii,t._oneOverRadii),p.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new oe(n.x,n.y,n.z)};oe.fromCartesian3=function(e,t){return d(t)||(t=new oe),d(e)&&si(t,e.x,e.y,e.z),t};oe.WGS84=Object.freeze(new oe(6378137,6378137,6356752314245179e-9));oe.UNIT_SPHERE=Object.freeze(new oe(1,1,1));oe.MOON=Object.freeze(new oe(S.LUNAR_RADIUS,S.LUNAR_RADIUS,S.LUNAR_RADIUS));oe.prototype.clone=function(e){return oe.clone(this,e)};oe.packedLength=p.packedLength;oe.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),p.pack(e._radii,t,n),t};oe.unpack=function(e,t,n){f.defined("array",e),t=j(t,0);const o=p.unpack(e,t);return oe.fromCartesian3(o,n)};oe.prototype.geocentricSurfaceNormal=p.normalize;oe.prototype.geodeticSurfaceNormalCartographic=function(e,t){f.typeOf.object("cartographic",e);const n=e.longitude,o=e.latitude,i=Math.cos(o),s=i*Math.cos(n),r=i*Math.sin(n),c=Math.sin(o);return d(t)||(t=new p),t.x=s,t.y=r,t.z=c,p.normalize(t,t)};oe.prototype.geodeticSurfaceNormal=function(e,t){if(!p.equalsEpsilon(e,p.ZERO,S.EPSILON14))return d(t)||(t=new p),t=p.multiplyComponents(e,this._oneOverRadiiSquared,t),p.normalize(t,t)};const Rr=new p,Ar=new p;oe.prototype.cartographicToCartesian=function(e,t){const n=Rr,o=Ar;this.geodeticSurfaceNormalCartographic(e,n),p.multiplyComponents(this._radiiSquared,n,o);const i=Math.sqrt(p.dot(n,o));return p.divideByScalar(o,i,o),p.multiplyByScalar(n,e.height,n),d(t)||(t=new p),p.add(o,n,t)};oe.prototype.cartographicArrayToCartesianArray=function(e,t){f.defined("cartographics",e);const n=e.length;d(t)?t.length=n:t=new Array(n);for(let o=0;o<n;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};const Mr=new p,zr=new p,jr=new p;oe.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,zr);if(!d(n))return;const o=this.geodeticSurfaceNormal(n,Mr),i=p.subtract(e,n,jr),s=Math.atan2(o.y,o.x),r=Math.asin(o.z),c=S.sign(p.dot(i,e))*p.magnitude(i);return d(t)?(t.longitude=s,t.latitude=r,t.height=c,t):new le(s,r,c)};oe.prototype.cartesianArrayToCartographicArray=function(e,t){f.defined("cartesians",e);const n=e.length;d(t)?t.length=n:t=new Array(n);for(let o=0;o<n;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t};oe.prototype.scaleToGeodeticSurface=function(e,t){return ri(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};oe.prototype.scaleToGeocentricSurface=function(e,t){f.typeOf.object("cartesian",e),d(t)||(t=new p);const n=e.x,o=e.y,i=e.z,s=this._oneOverRadiiSquared,r=1/Math.sqrt(n*n*s.x+o*o*s.y+i*i*s.z);return p.multiplyByScalar(e,r,t)};oe.prototype.transformPositionToScaledSpace=function(e,t){return d(t)||(t=new p),p.multiplyComponents(e,this._oneOverRadii,t)};oe.prototype.transformPositionFromScaledSpace=function(e,t){return d(t)||(t=new p),p.multiplyComponents(e,this._radii,t)};oe.prototype.equals=function(e){return this===e||d(e)&&p.equals(this._radii,e._radii)};oe.prototype.toString=function(){return this._radii.toString()};oe.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(f.typeOf.object("position",e),!S.equalsEpsilon(this._radii.x,this._radii.y,S.EPSILON15))throw new E("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");f.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=j(t,0);const o=this._squaredXOverSquaredZ;if(d(n)||(n=new p),n.x=0,n.y=0,n.z=e.z*(1-o),!(Math.abs(n.z)>=this._radii.z-t))return n};const Pr=new p;oe.prototype.getLocalCurvature=function(e,t){f.typeOf.object("surfacePosition",e),d(t)||(t=new Q);const n=this.getSurfaceNormalIntersectionWithZAxis(e,0,Pr),o=p.distance(e,n),i=this.minimumRadius*o/this.maximumRadius**2,s=o*i**2;return Q.fromElements(1/o,1/s,t)};const Cr=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Ir=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function To(e,t,n){f.typeOf.number("a",e),f.typeOf.number("b",t),f.typeOf.func("func",n);const o=.5*(t+e),i=.5*(t-e);let s=0;for(let r=0;r<5;r++){const c=i*Cr[r];s+=Ir[r]*(n(o+c)+n(o-c))}return s*=i,s}oe.prototype.surfaceArea=function(e){f.typeOf.object("rectangle",e);const t=e.west;let n=e.east;const o=e.south,i=e.north;for(;n<t;)n+=S.TWO_PI;const s=this._radiiSquared,r=s.x,c=s.y,u=s.z,y=r*c;return To(o,i,function(m){const w=Math.cos(m),b=Math.sin(m);return Math.cos(m)*To(t,n,function(O){const R=Math.cos(O),T=Math.sin(O);return Math.sqrt(y*b*b+u*(c*R*R+r*T*T)*w*w)})})};function M(e,t,n,o,i,s,r,c,u){this[0]=j(e,0),this[1]=j(o,0),this[2]=j(r,0),this[3]=j(t,0),this[4]=j(i,0),this[5]=j(c,0),this[6]=j(n,0),this[7]=j(s,0),this[8]=j(u,0)}M.packedLength=9;M.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};M.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new M),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};M.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*9;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)M.pack(e[i],t,i*9);return t};M.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new E("array length must be a multiple of 9.");const n=e.length;d(t)?t.length=n/9:t=new Array(n/9);for(let o=0;o<n;o+=9){const i=o/9;t[i]=M.unpack(e,o,t[i])}return t};M.clone=function(e,t){if(d(e))return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new M(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};M.fromArray=M.unpack;M.fromColumnMajorArray=function(e,t){return f.defined("values",e),M.clone(e,t)};M.fromRowMajorArray=function(e,t){return f.defined("values",e),d(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new M(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};M.fromQuaternion=function(e,t){f.typeOf.object("quaternion",e);const n=e.x*e.x,o=e.x*e.y,i=e.x*e.z,s=e.x*e.w,r=e.y*e.y,c=e.y*e.z,u=e.y*e.w,y=e.z*e.z,m=e.z*e.w,w=e.w*e.w,b=n-r-y+w,O=2*(o-m),R=2*(i+u),T=2*(o+m),z=-n+r-y+w,D=2*(c-s),q=2*(i-u),x=2*(c+s),Y=-n-r+y+w;return d(t)?(t[0]=b,t[1]=T,t[2]=q,t[3]=O,t[4]=z,t[5]=x,t[6]=R,t[7]=D,t[8]=Y,t):new M(b,O,R,T,z,D,q,x,Y)};M.fromHeadingPitchRoll=function(e,t){f.typeOf.object("headingPitchRoll",e);const n=Math.cos(-e.pitch),o=Math.cos(-e.heading),i=Math.cos(e.roll),s=Math.sin(-e.pitch),r=Math.sin(-e.heading),c=Math.sin(e.roll),u=n*o,y=-i*r+c*s*o,m=c*r+i*s*o,w=n*r,b=i*o+c*s*r,O=-c*o+i*s*r,R=-s,T=c*n,z=i*n;return d(t)?(t[0]=u,t[1]=w,t[2]=R,t[3]=y,t[4]=b,t[5]=T,t[6]=m,t[7]=O,t[8]=z,t):new M(u,y,m,w,b,O,R,T,z)};M.fromScale=function(e,t){return f.typeOf.object("scale",e),d(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new M(e.x,0,0,0,e.y,0,0,0,e.z)};M.fromUniformScale=function(e,t){return f.typeOf.number("scale",e),d(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new M(e,0,0,0,e,0,0,0,e)};M.fromCrossProduct=function(e,t){return f.typeOf.object("vector",e),d(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new M(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};M.fromRotationX=function(e,t){f.typeOf.number("angle",e);const n=Math.cos(e),o=Math.sin(e);return d(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new M(1,0,0,0,n,-o,0,o,n)};M.fromRotationY=function(e,t){f.typeOf.number("angle",e);const n=Math.cos(e),o=Math.sin(e);return d(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new M(n,0,o,0,1,0,-o,0,n)};M.fromRotationZ=function(e,t){f.typeOf.number("angle",e);const n=Math.cos(e),o=Math.sin(e);return d(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new M(n,-o,0,o,n,0,0,0,1)};M.toArray=function(e,t){return f.typeOf.object("matrix",e),d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};M.getElementIndex=function(e,t){return f.typeOf.number.greaterThanOrEquals("row",t,0),f.typeOf.number.lessThanOrEquals("row",t,2),f.typeOf.number.greaterThanOrEquals("column",e,0),f.typeOf.number.lessThanOrEquals("column",e,2),e*3+t};M.getColumn=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,2),f.typeOf.object("result",n);const o=t*3,i=e[o],s=e[o+1],r=e[o+2];return n.x=i,n.y=s,n.z=r,n};M.setColumn=function(e,t,n,o){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,2),f.typeOf.object("cartesian",n),f.typeOf.object("result",o),o=M.clone(e,o);const i=t*3;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o};M.getRow=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,2),f.typeOf.object("result",n);const o=e[t],i=e[t+3],s=e[t+6];return n.x=o,n.y=i,n.z=s,n};M.setRow=function(e,t,n,o){return f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,2),f.typeOf.object("cartesian",n),f.typeOf.object("result",o),o=M.clone(e,o),o[t]=n.x,o[t+3]=n.y,o[t+6]=n.z,o};const qr=new p;M.setScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("scale",t),f.typeOf.object("result",n);const o=M.getScale(e,qr),i=t.x/o.x,s=t.y/o.y,r=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*s,n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n};const Ur=new p;M.setUniformScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number("scale",t),f.typeOf.object("result",n);const o=M.getScale(e,Ur),i=t/o.x,s=t/o.y,r=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3]*s,n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n};const jn=new p;M.getScale=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t.x=p.magnitude(p.fromElements(e[0],e[1],e[2],jn)),t.y=p.magnitude(p.fromElements(e[3],e[4],e[5],jn)),t.z=p.magnitude(p.fromElements(e[6],e[7],e[8],jn)),t};const Ro=new p;M.getMaximumScale=function(e){return M.getScale(e,Ro),p.maximumComponent(Ro)};const Nr=new p;M.setRotation=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("result",n);const o=M.getScale(e,Nr);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=t[3]*o.y,n[4]=t[4]*o.y,n[5]=t[5]*o.y,n[6]=t[6]*o.z,n[7]=t[7]*o.z,n[8]=t[8]*o.z,n};const Dr=new p;M.getRotation=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=M.getScale(e,Dr);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};M.multiply=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],s=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],r=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],c=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],u=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],y=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],m=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],w=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=o,n[1]=i,n[2]=s,n[3]=r,n[4]=c,n[5]=u,n[6]=y,n[7]=m,n[8]=w,n};M.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};M.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};M.multiplyByVector=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("cartesian",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=e[0]*o+e[3]*i+e[6]*s,c=e[1]*o+e[4]*i+e[7]*s,u=e[2]*o+e[5]*i+e[8]*s;return n.x=r,n.y=c,n.z=u,n};M.multiplyByScalar=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};M.multiplyByScale=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.object("scale",t),f.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};M.multiplyByUniformScale=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.number("scale",t),f.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};M.negate=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};M.transpose=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[0],o=e[3],i=e[6],s=e[1],r=e[4],c=e[7],u=e[2],y=e[5],m=e[8];return t[0]=n,t[1]=o,t[2]=i,t[3]=s,t[4]=r,t[5]=c,t[6]=u,t[7]=y,t[8]=m,t};function xr(e){let t=0;for(let n=0;n<9;++n){const o=e[n];t+=o*o}return Math.sqrt(t)}const Zn=[1,0,0],Xn=[2,2,1];function $r(e){let t=0;for(let n=0;n<3;++n){const o=e[M.getElementIndex(Xn[n],Zn[n])];t+=2*o*o}return Math.sqrt(t)}function Fr(e,t){const n=S.EPSILON15;let o=0,i=1;for(let y=0;y<3;++y){const m=Math.abs(e[M.getElementIndex(Xn[y],Zn[y])]);m>o&&(i=y,o=m)}let s=1,r=0;const c=Zn[i],u=Xn[i];if(Math.abs(e[M.getElementIndex(u,c)])>n){const y=e[M.getElementIndex(u,u)],m=e[M.getElementIndex(c,c)],w=e[M.getElementIndex(u,c)],b=(y-m)/2/w;let O;b<0?O=-1/(-b+Math.sqrt(1+b*b)):O=1/(b+Math.sqrt(1+b*b)),s=1/Math.sqrt(1+O*O),r=O*s}return t=M.clone(M.IDENTITY,t),t[M.getElementIndex(c,c)]=t[M.getElementIndex(u,u)]=s,t[M.getElementIndex(u,c)]=r,t[M.getElementIndex(c,u)]=-r,t}const Jt=new M,Ao=new M;M.computeEigenDecomposition=function(e,t){f.typeOf.object("matrix",e);const n=S.EPSILON20,o=10;let i=0,s=0;d(t)||(t={});const r=t.unitary=M.clone(M.IDENTITY,t.unitary),c=t.diagonal=M.clone(e,t.diagonal),u=n*xr(c);for(;s<o&&$r(c)>u;)Fr(c,Jt),M.transpose(Jt,Ao),M.multiply(c,Jt,c),M.multiply(Ao,c,c),M.multiply(r,Jt,r),++i>2&&(++s,i=0);return t};M.abs=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};M.determinant=function(e){f.typeOf.object("matrix",e);const t=e[0],n=e[3],o=e[6],i=e[1],s=e[4],r=e[7],c=e[2],u=e[5],y=e[8];return t*(s*y-u*r)+i*(u*o-n*y)+c*(n*r-s*o)};M.inverse=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[0],o=e[1],i=e[2],s=e[3],r=e[4],c=e[5],u=e[6],y=e[7],m=e[8],w=M.determinant(e);if(Math.abs(w)<=S.EPSILON15)throw new E("matrix is not invertible");t[0]=r*m-y*c,t[1]=y*i-o*m,t[2]=o*c-r*i,t[3]=u*c-s*m,t[4]=n*m-u*i,t[5]=s*i-n*c,t[6]=s*y-u*r,t[7]=u*o-n*y,t[8]=n*r-s*o;const b=1/w;return M.multiplyByScalar(t,b,t)};const Lr=new M;M.inverseTranspose=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),M.inverse(M.transpose(e,Lr),t)};M.equals=function(e,t){return e===t||d(e)&&d(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};M.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};M.IDENTITY=Object.freeze(new M(1,0,0,0,1,0,0,0,1));M.ZERO=Object.freeze(new M(0,0,0,0,0,0,0,0,0));M.COLUMN0ROW0=0;M.COLUMN0ROW1=1;M.COLUMN0ROW2=2;M.COLUMN1ROW0=3;M.COLUMN1ROW1=4;M.COLUMN1ROW2=5;M.COLUMN2ROW0=6;M.COLUMN2ROW1=7;M.COLUMN2ROW2=8;Object.defineProperties(M.prototype,{length:{get:function(){return M.packedLength}}});M.prototype.clone=function(e){return M.clone(this,e)};M.prototype.equals=function(e){return M.equals(this,e)};M.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};M.prototype.equalsEpsilon=function(e,t){return M.equalsEpsilon(this,e,t)};M.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
3
- (${this[1]}, ${this[4]}, ${this[7]})
4
- (${this[2]}, ${this[5]}, ${this[8]})`};function L(e,t,n,o){this.x=j(e,0),this.y=j(t,0),this.z=j(n,0),this.w=j(o,0)}L.fromElements=function(e,t,n,o,i){return d(i)?(i.x=e,i.y=t,i.z=n,i.w=o,i):new L(e,t,n,o)};L.fromColor=function(e,t){return f.typeOf.object("color",e),d(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new L(e.red,e.green,e.blue,e.alpha)};L.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new L(e.x,e.y,e.z,e.w)};L.packedLength=4;L.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};L.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new L),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};L.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*4;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)L.pack(e[i],t,i*4);return t};L.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new E("array length must be a multiple of 4.");const n=e.length;d(t)?t.length=n/4:t=new Array(n/4);for(let o=0;o<n;o+=4){const i=o/4;t[i]=L.unpack(e,o,t[i])}return t};L.fromArray=L.unpack;L.maximumComponent=function(e){return f.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};L.minimumComponent=function(e){return f.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};L.minimumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};L.maximumByComponent=function(e,t,n){return f.typeOf.object("first",e),f.typeOf.object("second",t),f.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};L.clamp=function(e,t,n,o){f.typeOf.object("value",e),f.typeOf.object("min",t),f.typeOf.object("max",n),f.typeOf.object("result",o);const i=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y),r=S.clamp(e.z,t.z,n.z),c=S.clamp(e.w,t.w,n.w);return o.x=i,o.y=s,o.z=r,o.w=c,o};L.magnitudeSquared=function(e){return f.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};L.magnitude=function(e){return Math.sqrt(L.magnitudeSquared(e))};const gn=new L;L.distance=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),L.subtract(e,t,gn),L.magnitude(gn)};L.distanceSquared=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),L.subtract(e,t,gn),L.magnitudeSquared(gn)};L.normalize=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=L.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new E("normalized result is not a number");return t};L.dot=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};L.multiplyComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};L.divideComponents=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};L.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};L.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};L.multiplyByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};L.divideByScalar=function(e,t,n){return f.typeOf.object("cartesian",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};L.negate=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};L.abs=function(e,t){return f.typeOf.object("cartesian",e),f.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};const Mo=new L;L.lerp=function(e,t,n,o){return f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o),L.multiplyByScalar(t,n,Mo),o=L.multiplyByScalar(e,1-n,o),L.add(Mo,o,o)};const kr=new L;L.mostOrthogonalAxis=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=L.normalize(e,kr);return L.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=L.clone(L.UNIT_X,t):t=L.clone(L.UNIT_W,t):n.z<=n.w?t=L.clone(L.UNIT_Z,t):t=L.clone(L.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=L.clone(L.UNIT_Y,t):t=L.clone(L.UNIT_W,t):n.z<=n.w?t=L.clone(L.UNIT_Z,t):t=L.clone(L.UNIT_W,t),t};L.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};L.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};L.equalsEpsilon=function(e,t,n,o){return e===t||d(e)&&d(t)&&S.equalsEpsilon(e.x,t.x,n,o)&&S.equalsEpsilon(e.y,t.y,n,o)&&S.equalsEpsilon(e.z,t.z,n,o)&&S.equalsEpsilon(e.w,t.w,n,o)};L.ZERO=Object.freeze(new L(0,0,0,0));L.ONE=Object.freeze(new L(1,1,1,1));L.UNIT_X=Object.freeze(new L(1,0,0,0));L.UNIT_Y=Object.freeze(new L(0,1,0,0));L.UNIT_Z=Object.freeze(new L(0,0,1,0));L.UNIT_W=Object.freeze(new L(0,0,0,1));L.prototype.clone=function(e){return L.clone(this,e)};L.prototype.equals=function(e){return L.equals(this,e)};L.prototype.equalsEpsilon=function(e,t,n){return L.equalsEpsilon(this,e,t,n)};L.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const co=new Float32Array(1),Te=new Uint8Array(co.buffer),Br=new Uint32Array([287454020]),Wr=new Uint8Array(Br.buffer),ci=Wr[0]===68;L.packFloat=function(e,t){return f.typeOf.number("value",e),d(t)||(t=new L),co[0]=e,ci?(t.x=Te[0],t.y=Te[1],t.z=Te[2],t.w=Te[3]):(t.x=Te[3],t.y=Te[2],t.z=Te[1],t.w=Te[0]),t};L.unpackFloat=function(e){return f.typeOf.object("packedFloat",e),ci?(Te[0]=e.x,Te[1]=e.y,Te[2]=e.z,Te[3]=e.w):(Te[0]=e.w,Te[1]=e.z,Te[2]=e.y,Te[3]=e.x),co[0]};function Ie(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}d(Object.create)&&(Ie.prototype=Object.create(Error.prototype),Ie.prototype.constructor=Ie);Ie.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return d(this.stack)&&(e+=`
5
- ${this.stack.toString()}`),e};function A(e,t,n,o,i,s,r,c,u,y,m,w,b,O,R,T){this[0]=j(e,0),this[1]=j(i,0),this[2]=j(u,0),this[3]=j(b,0),this[4]=j(t,0),this[5]=j(s,0),this[6]=j(y,0),this[7]=j(O,0),this[8]=j(n,0),this[9]=j(r,0),this[10]=j(m,0),this[11]=j(R,0),this[12]=j(o,0),this[13]=j(c,0),this[14]=j(w,0),this[15]=j(T,0)}A.packedLength=16;A.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};A.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new A),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};A.packArray=function(e,t){f.defined("array",e);const n=e.length,o=n*16;if(!d(t))t=new Array(o);else{if(!Array.isArray(t)&&t.length!==o)throw new E("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==o&&(t.length=o)}for(let i=0;i<n;++i)A.pack(e[i],t,i*16);return t};A.unpackArray=function(e,t){if(f.defined("array",e),f.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new E("array length must be a multiple of 16.");const n=e.length;d(t)?t.length=n/16:t=new Array(n/16);for(let o=0;o<n;o+=16){const i=o/16;t[i]=A.unpack(e,o,t[i])}return t};A.clone=function(e,t){if(d(e))return d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new A(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};A.fromArray=A.unpack;A.fromColumnMajorArray=function(e,t){return f.defined("values",e),A.clone(e,t)};A.fromRowMajorArray=function(e,t){return f.defined("values",e),d(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new A(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])};A.fromRotationTranslation=function(e,t,n){return f.typeOf.object("rotation",e),t=j(t,p.ZERO),d(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new A(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};A.fromTranslationQuaternionRotationScale=function(e,t,n,o){f.typeOf.object("translation",e),f.typeOf.object("rotation",t),f.typeOf.object("scale",n),d(o)||(o=new A);const i=n.x,s=n.y,r=n.z,c=t.x*t.x,u=t.x*t.y,y=t.x*t.z,m=t.x*t.w,w=t.y*t.y,b=t.y*t.z,O=t.y*t.w,R=t.z*t.z,T=t.z*t.w,z=t.w*t.w,D=c-w-R+z,q=2*(u-T),x=2*(y+O),Y=2*(u+T),N=-c+w-R+z,H=2*(b-m),B=2*(y-O),U=2*(b+m),G=-c-w+R+z;return o[0]=D*i,o[1]=Y*i,o[2]=B*i,o[3]=0,o[4]=q*s,o[5]=N*s,o[6]=U*s,o[7]=0,o[8]=x*r,o[9]=H*r,o[10]=G*r,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o};A.fromTranslationRotationScale=function(e,t){return f.typeOf.object("translationRotationScale",e),A.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};A.fromTranslation=function(e,t){return f.typeOf.object("translation",e),A.fromRotationTranslation(M.IDENTITY,e,t)};A.fromScale=function(e,t){return f.typeOf.object("scale",e),d(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new A(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};A.fromUniformScale=function(e,t){return f.typeOf.number("scale",e),d(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new A(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};A.fromRotation=function(e,t){return f.typeOf.object("rotation",e),d(t)||(t=new A),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};const ht=new p,dt=new p,Mt=new p;A.fromCamera=function(e,t){f.typeOf.object("camera",e);const n=e.position,o=e.direction,i=e.up;f.typeOf.object("camera.position",n),f.typeOf.object("camera.direction",o),f.typeOf.object("camera.up",i),p.normalize(o,ht),p.normalize(p.cross(ht,i,dt),dt),p.normalize(p.cross(dt,ht,Mt),Mt);const s=dt.x,r=dt.y,c=dt.z,u=ht.x,y=ht.y,m=ht.z,w=Mt.x,b=Mt.y,O=Mt.z,R=n.x,T=n.y,z=n.z,D=s*-R+r*-T+c*-z,q=w*-R+b*-T+O*-z,x=u*R+y*T+m*z;return d(t)?(t[0]=s,t[1]=w,t[2]=-u,t[3]=0,t[4]=r,t[5]=b,t[6]=-y,t[7]=0,t[8]=c,t[9]=O,t[10]=-m,t[11]=0,t[12]=D,t[13]=q,t[14]=x,t[15]=1,t):new A(s,r,c,D,w,b,O,q,-u,-y,-m,x,0,0,0,1)};A.computePerspectiveFieldOfView=function(e,t,n,o,i){f.typeOf.number.greaterThan("fovY",e,0),f.typeOf.number.lessThan("fovY",e,Math.PI),f.typeOf.number.greaterThan("near",n,0),f.typeOf.number.greaterThan("far",o,0),f.typeOf.object("result",i);const r=1/Math.tan(e*.5),c=r/t,u=(o+n)/(n-o),y=2*o*n/(n-o);return i[0]=c,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=r,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=u,i[11]=-1,i[12]=0,i[13]=0,i[14]=y,i[15]=0,i};A.computeOrthographicOffCenter=function(e,t,n,o,i,s,r){f.typeOf.number("left",e),f.typeOf.number("right",t),f.typeOf.number("bottom",n),f.typeOf.number("top",o),f.typeOf.number("near",i),f.typeOf.number("far",s),f.typeOf.object("result",r);let c=1/(t-e),u=1/(o-n),y=1/(s-i);const m=-(t+e)*c,w=-(o+n)*u,b=-(s+i)*y;return c*=2,u*=2,y*=-2,r[0]=c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=y,r[11]=0,r[12]=m,r[13]=w,r[14]=b,r[15]=1,r};A.computePerspectiveOffCenter=function(e,t,n,o,i,s,r){f.typeOf.number("left",e),f.typeOf.number("right",t),f.typeOf.number("bottom",n),f.typeOf.number("top",o),f.typeOf.number("near",i),f.typeOf.number("far",s),f.typeOf.object("result",r);const c=2*i/(t-e),u=2*i/(o-n),y=(t+e)/(t-e),m=(o+n)/(o-n),w=-(s+i)/(s-i),b=-1,O=-2*s*i/(s-i);return r[0]=c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=u,r[6]=0,r[7]=0,r[8]=y,r[9]=m,r[10]=w,r[11]=b,r[12]=0,r[13]=0,r[14]=O,r[15]=0,r};A.computeInfinitePerspectiveOffCenter=function(e,t,n,o,i,s){f.typeOf.number("left",e),f.typeOf.number("right",t),f.typeOf.number("bottom",n),f.typeOf.number("top",o),f.typeOf.number("near",i),f.typeOf.object("result",s);const r=2*i/(t-e),c=2*i/(o-n),u=(t+e)/(t-e),y=(o+n)/(o-n),m=-1,w=-1,b=-2*i;return s[0]=r,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=y,s[10]=m,s[11]=w,s[12]=0,s[13]=0,s[14]=b,s[15]=0,s};A.computeViewportTransformation=function(e,t,n,o){d(o)||(o=new A),e=j(e,j.EMPTY_OBJECT);const i=j(e.x,0),s=j(e.y,0),r=j(e.width,0),c=j(e.height,0);t=j(t,0),n=j(n,1);const u=r*.5,y=c*.5,m=(n-t)*.5,w=u,b=y,O=m,R=i+u,T=s+y,z=t+m,D=1;return o[0]=w,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=b,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=O,o[11]=0,o[12]=R,o[13]=T,o[14]=z,o[15]=D,o};A.computeView=function(e,t,n,o,i){return f.typeOf.object("position",e),f.typeOf.object("direction",t),f.typeOf.object("up",n),f.typeOf.object("right",o),f.typeOf.object("result",i),i[0]=o.x,i[1]=n.x,i[2]=-t.x,i[3]=0,i[4]=o.y,i[5]=n.y,i[6]=-t.y,i[7]=0,i[8]=o.z,i[9]=n.z,i[10]=-t.z,i[11]=0,i[12]=-p.dot(o,e),i[13]=-p.dot(n,e),i[14]=p.dot(t,e),i[15]=1,i};A.toArray=function(e,t){return f.typeOf.object("matrix",e),d(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};A.getElementIndex=function(e,t){return f.typeOf.number.greaterThanOrEquals("row",t,0),f.typeOf.number.lessThanOrEquals("row",t,3),f.typeOf.number.greaterThanOrEquals("column",e,0),f.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};A.getColumn=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,3),f.typeOf.object("result",n);const o=t*4,i=e[o],s=e[o+1],r=e[o+2],c=e[o+3];return n.x=i,n.y=s,n.z=r,n.w=c,n};A.setColumn=function(e,t,n,o){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,3),f.typeOf.object("cartesian",n),f.typeOf.object("result",o),o=A.clone(e,o);const i=t*4;return o[i]=n.x,o[i+1]=n.y,o[i+2]=n.z,o[i+3]=n.w,o};A.getRow=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,3),f.typeOf.object("result",n);const o=e[t],i=e[t+4],s=e[t+8],r=e[t+12];return n.x=o,n.y=i,n.z=s,n.w=r,n};A.setRow=function(e,t,n,o){return f.typeOf.object("matrix",e),f.typeOf.number.greaterThanOrEquals("index",t,0),f.typeOf.number.lessThanOrEquals("index",t,3),f.typeOf.object("cartesian",n),f.typeOf.object("result",o),o=A.clone(e,o),o[t]=n.x,o[t+4]=n.y,o[t+8]=n.z,o[t+12]=n.w,o};A.setTranslation=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.object("translation",t),f.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};const Hr=new p;A.setScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("scale",t),f.typeOf.object("result",n);const o=A.getScale(e,Hr),i=t.x/o.x,s=t.y/o.y,r=t.z/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3],n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*s,n[7]=e[7],n[8]=e[8]*r,n[9]=e[9]*r,n[10]=e[10]*r,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Qr=new p;A.setUniformScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.number("scale",t),f.typeOf.object("result",n);const o=A.getScale(e,Qr),i=t/o.x,s=t/o.y,r=t/o.z;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=e[3],n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*s,n[7]=e[7],n[8]=e[8]*r,n[9]=e[9]*r,n[10]=e[10]*r,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Pn=new p;A.getScale=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t.x=p.magnitude(p.fromElements(e[0],e[1],e[2],Pn)),t.y=p.magnitude(p.fromElements(e[4],e[5],e[6],Pn)),t.z=p.magnitude(p.fromElements(e[8],e[9],e[10],Pn)),t};const zo=new p;A.getMaximumScale=function(e){return A.getScale(e,zo),p.maximumComponent(zo)};const Yr=new p;A.setRotation=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("result",n);const o=A.getScale(e,Yr);return n[0]=t[0]*o.x,n[1]=t[1]*o.x,n[2]=t[2]*o.x,n[3]=e[3],n[4]=t[3]*o.y,n[5]=t[4]*o.y,n[6]=t[5]*o.y,n[7]=e[7],n[8]=t[6]*o.z,n[9]=t[7]*o.z,n[10]=t[8]*o.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Vr=new p;A.getRotation=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=A.getScale(e,Vr);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};A.multiply=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e[0],i=e[1],s=e[2],r=e[3],c=e[4],u=e[5],y=e[6],m=e[7],w=e[8],b=e[9],O=e[10],R=e[11],T=e[12],z=e[13],D=e[14],q=e[15],x=t[0],Y=t[1],N=t[2],H=t[3],B=t[4],U=t[5],G=t[6],V=t[7],k=t[8],J=t[9],a=t[10],h=t[11],l=t[12],g=t[13],_=t[14],v=t[15],P=o*x+c*Y+w*N+T*H,C=i*x+u*Y+b*N+z*H,$=s*x+y*Y+O*N+D*H,X=r*x+m*Y+R*N+q*H,ee=o*B+c*U+w*G+T*V,te=i*B+u*U+b*G+z*V,ie=s*B+y*U+O*G+D*V,ce=r*B+m*U+R*G+q*V,ue=o*k+c*J+w*a+T*h,ye=i*k+u*J+b*a+z*h,he=s*k+y*J+O*a+D*h,ne=r*k+m*J+R*a+q*h,pe=o*l+c*g+w*_+T*v,_e=i*l+u*g+b*_+z*v,Se=s*l+y*g+O*_+D*v,xe=r*l+m*g+R*_+q*v;return n[0]=P,n[1]=C,n[2]=$,n[3]=X,n[4]=ee,n[5]=te,n[6]=ie,n[7]=ce,n[8]=ue,n[9]=ye,n[10]=he,n[11]=ne,n[12]=pe,n[13]=_e,n[14]=Se,n[15]=xe,n};A.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};A.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};A.multiplyTransformation=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e[0],i=e[1],s=e[2],r=e[4],c=e[5],u=e[6],y=e[8],m=e[9],w=e[10],b=e[12],O=e[13],R=e[14],T=t[0],z=t[1],D=t[2],q=t[4],x=t[5],Y=t[6],N=t[8],H=t[9],B=t[10],U=t[12],G=t[13],V=t[14],k=o*T+r*z+y*D,J=i*T+c*z+m*D,a=s*T+u*z+w*D,h=o*q+r*x+y*Y,l=i*q+c*x+m*Y,g=s*q+u*x+w*Y,_=o*N+r*H+y*B,v=i*N+c*H+m*B,P=s*N+u*H+w*B,C=o*U+r*G+y*V+b,$=i*U+c*G+m*V+O,X=s*U+u*G+w*V+R;return n[0]=k,n[1]=J,n[2]=a,n[3]=0,n[4]=h,n[5]=l,n[6]=g,n[7]=0,n[8]=_,n[9]=v,n[10]=P,n[11]=0,n[12]=C,n[13]=$,n[14]=X,n[15]=1,n};A.multiplyByMatrix3=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("rotation",t),f.typeOf.object("result",n);const o=e[0],i=e[1],s=e[2],r=e[4],c=e[5],u=e[6],y=e[8],m=e[9],w=e[10],b=t[0],O=t[1],R=t[2],T=t[3],z=t[4],D=t[5],q=t[6],x=t[7],Y=t[8],N=o*b+r*O+y*R,H=i*b+c*O+m*R,B=s*b+u*O+w*R,U=o*T+r*z+y*D,G=i*T+c*z+m*D,V=s*T+u*z+w*D,k=o*q+r*x+y*Y,J=i*q+c*x+m*Y,a=s*q+u*x+w*Y;return n[0]=N,n[1]=H,n[2]=B,n[3]=0,n[4]=U,n[5]=G,n[6]=V,n[7]=0,n[8]=k,n[9]=J,n[10]=a,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};A.multiplyByTranslation=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("translation",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=o*e[0]+i*e[4]+s*e[8]+e[12],c=o*e[1]+i*e[5]+s*e[9]+e[13],u=o*e[2]+i*e[6]+s*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=r,n[13]=c,n[14]=u,n[15]=e[15],n};A.multiplyByScale=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("scale",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z;return o===1&&i===1&&s===1?A.clone(e,n):(n[0]=o*e[0],n[1]=o*e[1],n[2]=o*e[2],n[3]=e[3],n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=e[7],n[8]=s*e[8],n[9]=s*e[9],n[10]=s*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};A.multiplyByUniformScale=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.number("scale",t),f.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};A.multiplyByVector=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("cartesian",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=t.w,c=e[0]*o+e[4]*i+e[8]*s+e[12]*r,u=e[1]*o+e[5]*i+e[9]*s+e[13]*r,y=e[2]*o+e[6]*i+e[10]*s+e[14]*r,m=e[3]*o+e[7]*i+e[11]*s+e[15]*r;return n.x=c,n.y=u,n.z=y,n.w=m,n};A.multiplyByPointAsVector=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("cartesian",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=e[0]*o+e[4]*i+e[8]*s,c=e[1]*o+e[5]*i+e[9]*s,u=e[2]*o+e[6]*i+e[10]*s;return n.x=r,n.y=c,n.z=u,n};A.multiplyByPoint=function(e,t,n){f.typeOf.object("matrix",e),f.typeOf.object("cartesian",t),f.typeOf.object("result",n);const o=t.x,i=t.y,s=t.z,r=e[0]*o+e[4]*i+e[8]*s+e[12],c=e[1]*o+e[5]*i+e[9]*s+e[13],u=e[2]*o+e[6]*i+e[10]*s+e[14];return n.x=r,n.y=c,n.z=u,n};A.multiplyByScalar=function(e,t,n){return f.typeOf.object("matrix",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};A.negate=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};A.transpose=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[1],o=e[2],i=e[3],s=e[6],r=e[7],c=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=o,t[9]=s,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=r,t[14]=c,t[15]=e[15],t};A.abs=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};A.equals=function(e,t){return e===t||d(e)&&d(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};A.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};A.getTranslation=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};A.getMatrix3=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};const Gr=new M,Zr=new M,Xr=new L,Jr=new L(0,0,0,1);A.inverse=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[0],o=e[4],i=e[8],s=e[12],r=e[1],c=e[5],u=e[9],y=e[13],m=e[2],w=e[6],b=e[10],O=e[14],R=e[3],T=e[7],z=e[11],D=e[15];let q=b*D,x=O*z,Y=w*D,N=O*T,H=w*z,B=b*T,U=m*D,G=O*R,V=m*z,k=b*R,J=m*T,a=w*R;const h=q*c+N*u+H*y-(x*c+Y*u+B*y),l=x*r+U*u+k*y-(q*r+G*u+V*y),g=Y*r+G*c+J*y-(N*r+U*c+a*y),_=B*r+V*c+a*u-(H*r+k*c+J*u),v=x*o+Y*i+B*s-(q*o+N*i+H*s),P=q*n+G*i+V*s-(x*n+U*i+k*s),C=N*n+U*o+a*s-(Y*n+G*o+J*s),$=H*n+k*o+J*i-(B*n+V*o+a*i);q=i*y,x=s*u,Y=o*y,N=s*c,H=o*u,B=i*c,U=n*y,G=s*r,V=n*u,k=i*r,J=n*c,a=o*r;const X=q*T+N*z+H*D-(x*T+Y*z+B*D),ee=x*R+U*z+k*D-(q*R+G*z+V*D),te=Y*R+G*T+J*D-(N*R+U*T+a*D),ie=B*R+V*T+a*z-(H*R+k*T+J*z),ce=Y*b+B*O+x*w-(H*O+q*w+N*b),ue=V*O+q*m+G*b-(U*b+k*O+x*m),ye=U*w+a*O+N*m-(J*O+Y*m+G*w),he=J*b+H*m+k*w-(V*w+a*b+B*m);let ne=n*h+o*l+i*g+s*_;if(Math.abs(ne)<S.EPSILON21){if(M.equalsEpsilon(A.getMatrix3(e,Gr),Zr,S.EPSILON7)&&L.equals(A.getRow(e,3,Xr),Jr))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new Ie("matrix is not invertible because its determinate is zero.")}return ne=1/ne,t[0]=h*ne,t[1]=l*ne,t[2]=g*ne,t[3]=_*ne,t[4]=v*ne,t[5]=P*ne,t[6]=C*ne,t[7]=$*ne,t[8]=X*ne,t[9]=ee*ne,t[10]=te*ne,t[11]=ie*ne,t[12]=ce*ne,t[13]=ue*ne,t[14]=ye*ne,t[15]=he*ne,t};A.inverseTransformation=function(e,t){f.typeOf.object("matrix",e),f.typeOf.object("result",t);const n=e[0],o=e[1],i=e[2],s=e[4],r=e[5],c=e[6],u=e[8],y=e[9],m=e[10],w=e[12],b=e[13],O=e[14],R=-n*w-o*b-i*O,T=-s*w-r*b-c*O,z=-u*w-y*b-m*O;return t[0]=n,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=r,t[6]=y,t[7]=0,t[8]=i,t[9]=c,t[10]=m,t[11]=0,t[12]=R,t[13]=T,t[14]=z,t[15]=1,t};const Kr=new A;A.inverseTranspose=function(e,t){return f.typeOf.object("matrix",e),f.typeOf.object("result",t),A.inverse(A.transpose(e,Kr),t)};A.IDENTITY=Object.freeze(new A(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));A.ZERO=Object.freeze(new A(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));A.COLUMN0ROW0=0;A.COLUMN0ROW1=1;A.COLUMN0ROW2=2;A.COLUMN0ROW3=3;A.COLUMN1ROW0=4;A.COLUMN1ROW1=5;A.COLUMN1ROW2=6;A.COLUMN1ROW3=7;A.COLUMN2ROW0=8;A.COLUMN2ROW1=9;A.COLUMN2ROW2=10;A.COLUMN2ROW3=11;A.COLUMN3ROW0=12;A.COLUMN3ROW1=13;A.COLUMN3ROW2=14;A.COLUMN3ROW3=15;Object.defineProperties(A.prototype,{length:{get:function(){return A.packedLength}}});A.prototype.clone=function(e){return A.clone(this,e)};A.prototype.equals=function(e){return A.equals(this,e)};A.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};A.prototype.equalsEpsilon=function(e,t){return A.equalsEpsilon(this,e,t)};A.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
6
- (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
7
- (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
8
- (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var ai={exports:{}},Ct={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */Ct.exports;var jo;function es(){return jo||(jo=1,function(e,t){(function(n){var o=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,s=typeof We=="object"&&We;(s.global===s||s.window===s||s.self===s)&&(n=s);var r,c=2147483647,u=36,y=1,m=26,w=38,b=700,O=72,R=128,T="-",z=/^xn--/,D=/[^\x20-\x7E]/,q=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Y=u-y,N=Math.floor,H=String.fromCharCode,B;function U(C){throw new RangeError(x[C])}function G(C,$){for(var X=C.length,ee=[];X--;)ee[X]=$(C[X]);return ee}function V(C,$){var X=C.split("@"),ee="";X.length>1&&(ee=X[0]+"@",C=X[1]),C=C.replace(q,".");var te=C.split("."),ie=G(te,$).join(".");return ee+ie}function k(C){for(var $=[],X=0,ee=C.length,te,ie;X<ee;)te=C.charCodeAt(X++),te>=55296&&te<=56319&&X<ee?(ie=C.charCodeAt(X++),(ie&64512)==56320?$.push(((te&1023)<<10)+(ie&1023)+65536):($.push(te),X--)):$.push(te);return $}function J(C){return G(C,function($){var X="";return $>65535&&($-=65536,X+=H($>>>10&1023|55296),$=56320|$&1023),X+=H($),X}).join("")}function a(C){return C-48<10?C-22:C-65<26?C-65:C-97<26?C-97:u}function h(C,$){return C+22+75*(C<26)-(($!=0)<<5)}function l(C,$,X){var ee=0;for(C=X?N(C/b):C>>1,C+=N(C/$);C>Y*m>>1;ee+=u)C=N(C/Y);return N(ee+(Y+1)*C/(C+w))}function g(C){var $=[],X=C.length,ee,te=0,ie=R,ce=O,ue,ye,he,ne,pe,_e,Se,xe,nt;for(ue=C.lastIndexOf(T),ue<0&&(ue=0),ye=0;ye<ue;++ye)C.charCodeAt(ye)>=128&&U("not-basic"),$.push(C.charCodeAt(ye));for(he=ue>0?ue+1:0;he<X;){for(ne=te,pe=1,_e=u;he>=X&&U("invalid-input"),Se=a(C.charCodeAt(he++)),(Se>=u||Se>N((c-te)/pe))&&U("overflow"),te+=Se*pe,xe=_e<=ce?y:_e>=ce+m?m:_e-ce,!(Se<xe);_e+=u)nt=u-xe,pe>N(c/nt)&&U("overflow"),pe*=nt;ee=$.length+1,ce=l(te-ne,ee,ne==0),N(te/ee)>c-ie&&U("overflow"),ie+=N(te/ee),te%=ee,$.splice(te++,0,ie)}return J($)}function _(C){var $,X,ee,te,ie,ce,ue,ye,he,ne,pe,_e=[],Se,xe,nt,An;for(C=k(C),Se=C.length,$=R,X=0,ie=O,ce=0;ce<Se;++ce)pe=C[ce],pe<128&&_e.push(H(pe));for(ee=te=_e.length,te&&_e.push(T);ee<Se;){for(ue=c,ce=0;ce<Se;++ce)pe=C[ce],pe>=$&&pe<ue&&(ue=pe);for(xe=ee+1,ue-$>N((c-X)/xe)&&U("overflow"),X+=(ue-$)*xe,$=ue,ce=0;ce<Se;++ce)if(pe=C[ce],pe<$&&++X>c&&U("overflow"),pe==$){for(ye=X,he=u;ne=he<=ie?y:he>=ie+m?m:he-ie,!(ye<ne);he+=u)An=ye-ne,nt=u-ne,_e.push(H(h(ne+An%nt,0))),ye=N(An/nt);_e.push(H(h(ye,0))),ie=l(X,xe,ee==te),X=0,++ee}++X,++$}return _e.join("")}function v(C){return V(C,function($){return z.test($)?g($.slice(4).toLowerCase()):$})}function P(C){return V(C,function($){return D.test($)?"xn--"+_($):$})}if(r={version:"1.3.2",ucs2:{decode:k,encode:J},decode:g,encode:_,toASCII:P,toUnicode:v},o&&i)if(e.exports==o)i.exports=r;else for(B in r)r.hasOwnProperty(B)&&(o[B]=r[B]);else n.punycode=r})(We)}(Ct,Ct.exports)),Ct.exports}var Cn={exports:{}};/*!
9
- * URI.js - Mutating URLs
10
- * IPv6 Support
11
- *
12
- * Version: 1.19.11
13
- *
14
- * Author: Rodney Rehm
15
- * Web: http://medialize.github.io/URI.js/
16
- *
17
- * Licensed under
18
- * MIT License http://www.opensource.org/licenses/mit-license
19
- *
20
- */var Po;function ts(){return Po||(Po=1,function(e){(function(t,n){e.exports?e.exports=n():t.IPv6=n(t)})(We,function(t){var n=t&&t.IPv6;function o(s){var r=s.toLowerCase(),c=r.split(":"),u=c.length,y=8;c[0]===""&&c[1]===""&&c[2]===""?(c.shift(),c.shift()):c[0]===""&&c[1]===""?c.shift():c[u-1]===""&&c[u-2]===""&&c.pop(),u=c.length,c[u-1].indexOf(".")!==-1&&(y=7);var m;for(m=0;m<u&&c[m]!=="";m++);if(m<y)for(c.splice(m,1,"0000");c.length<y;)c.splice(m,0,"0000");for(var w,b=0;b<y;b++){w=c[b].split("");for(var O=0;O<3&&(w[0]==="0"&&w.length>1);O++)w.splice(0,1);c[b]=w.join("")}var R=-1,T=0,z=0,D=-1,q=!1;for(b=0;b<y;b++)q?c[b]==="0"?z+=1:(q=!1,z>T&&(R=D,T=z)):c[b]==="0"&&(q=!0,D=b,z=1);z>T&&(R=D,T=z),T>1&&c.splice(R,T,""),u=c.length;var x="";for(c[0]===""&&(x=":"),b=0;b<u&&(x+=c[b],b!==u-1);b++)x+=":";return c[u-1]===""&&(x+=":"),x}function i(){return t.IPv6===this&&(t.IPv6=n),this}return{best:o,noConflict:i}})}(Cn)),Cn.exports}var In={exports:{}};/*!
21
- * URI.js - Mutating URLs
22
- * Second Level Domain (SLD) Support
23
- *
24
- * Version: 1.19.11
25
- *
26
- * Author: Rodney Rehm
27
- * Web: http://medialize.github.io/URI.js/
28
- *
29
- * Licensed under
30
- * MIT License http://www.opensource.org/licenses/mit-license
31
- *
32
- */var Co;function ns(){return Co||(Co=1,function(e){(function(t,n){e.exports?e.exports=n():t.SecondLevelDomains=n(t)})(We,function(t){var n=t&&t.SecondLevelDomains,o={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return!1;var r=i.lastIndexOf(".",s-1);if(r<=0||r>=s-1)return!1;var c=o.list[i.slice(s+1)];return c?c.indexOf(" "+i.slice(r+1,s)+" ")>=0:!1},is:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return!1;var r=i.lastIndexOf(".",s-1);if(r>=0)return!1;var c=o.list[i.slice(s+1)];return c?c.indexOf(" "+i.slice(0,s)+" ")>=0:!1},get:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return null;var r=i.lastIndexOf(".",s-1);if(r<=0||r>=s-1)return null;var c=o.list[i.slice(s+1)];return!c||c.indexOf(" "+i.slice(r+1,s)+" ")<0?null:i.slice(r+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=n),this}};return o})}(In)),In.exports}/*!
33
- * URI.js - Mutating URLs
34
- *
35
- * Version: 1.19.11
36
- *
37
- * Author: Rodney Rehm
38
- * Web: http://medialize.github.io/URI.js/
39
- *
40
- * Licensed under
41
- * MIT License http://www.opensource.org/licenses/mit-license
42
- *
43
- */(function(e){(function(t,n){e.exports?e.exports=n(es(),ts(),ns()):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(We,function(t,n,o,i){var s=i&&i.URI;function r(a,h){var l=arguments.length>=1,g=arguments.length>=2;if(!(this instanceof r))return l?g?new r(a,h):new r(a):new r;if(a===void 0){if(l)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?a=location.href+"":a=""}if(a===null&&l)throw new TypeError("null is not a valid argument for URI");return this.href(a),h!==void 0?this.absoluteTo(h):this}function c(a){return/^[0-9]+$/.test(a)}r.version="1.19.11";var u=r.prototype,y=Object.prototype.hasOwnProperty;function m(a){return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function w(a){return a===void 0?"Undefined":String(Object.prototype.toString.call(a)).slice(8,-1)}function b(a){return w(a)==="Array"}function O(a,h){var l={},g,_;if(w(h)==="RegExp")l=null;else if(b(h))for(g=0,_=h.length;g<_;g++)l[h[g]]=!0;else l[h]=!0;for(g=0,_=a.length;g<_;g++){var v=l&&l[a[g]]!==void 0||!l&&h.test(a[g]);v&&(a.splice(g,1),_--,g--)}return a}function R(a,h){var l,g;if(b(h)){for(l=0,g=h.length;l<g;l++)if(!R(a,h[l]))return!1;return!0}var _=w(h);for(l=0,g=a.length;l<g;l++)if(_==="RegExp"){if(typeof a[l]=="string"&&a[l].match(h))return!0}else if(a[l]===h)return!0;return!1}function T(a,h){if(!b(a)||!b(h)||a.length!==h.length)return!1;a.sort(),h.sort();for(var l=0,g=a.length;l<g;l++)if(a[l]!==h[l])return!1;return!0}function z(a){var h=/^\/+|\/+$/g;return a.replace(h,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(a){if(!(!a||!a.nodeName)){var h=a.nodeName.toLowerCase();if(!(h==="input"&&a.type!=="image"))return r.domAttributes[h]}};function D(a){return escape(a)}function q(a){return encodeURIComponent(a).replace(/[!'()*]/g,D).replace(/\*/g,"%2A")}r.encode=q,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=q,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(a,h){var l=r.encode(a+"");return h===void 0&&(h=r.escapeQuerySpace),h?l.replace(/%20/g,"+"):l},r.decodeQuery=function(a,h){a+="",h===void 0&&(h=r.escapeQuerySpace);try{return r.decode(h?a.replace(/\+/g,"%20"):a)}catch{return a}};var x={encode:"encode",decode:"decode"},Y,N=function(a,h){return function(l){try{return r[h](l+"").replace(r.characters[a][h].expression,function(g){return r.characters[a][h].map[g]})}catch{return l}}};for(Y in x)r[Y+"PathSegment"]=N("pathname",x[Y]),r[Y+"UrnPathSegment"]=N("urnpath",x[Y]);var H=function(a,h,l){return function(g){var _;l?_=function($){return r[h](r[l]($))}:_=r[h];for(var v=(g+"").split(a),P=0,C=v.length;P<C;P++)v[P]=_(v[P]);return v.join(a)}};r.decodePath=H("/","decodePathSegment"),r.decodeUrnPath=H(":","decodeUrnPathSegment"),r.recodePath=H("/","encodePathSegment","decode"),r.recodeUrnPath=H(":","encodeUrnPathSegment","decode"),r.encodeReserved=N("reserved","encode"),r.parse=function(a,h){var l;return h||(h={preventInvalidHostname:r.preventInvalidHostname}),a=a.replace(r.leading_whitespace_expression,""),a=a.replace(r.ascii_tab_whitespace,""),l=a.indexOf("#"),l>-1&&(h.fragment=a.substring(l+1)||null,a=a.substring(0,l)),l=a.indexOf("?"),l>-1&&(h.query=a.substring(l+1)||null,a=a.substring(0,l)),a=a.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),a=a.replace(/^[/\\]{2,}/i,"//"),a.substring(0,2)==="//"?(h.protocol=null,a=a.substring(2),a=r.parseAuthority(a,h)):(l=a.indexOf(":"),l>-1&&(h.protocol=a.substring(0,l)||null,h.protocol&&!h.protocol.match(r.protocol_expression)?h.protocol=void 0:a.substring(l+1,l+3).replace(/\\/g,"/")==="//"?(a=a.substring(l+3),a=r.parseAuthority(a,h)):(a=a.substring(l+1),h.urn=!0))),h.path=a,h},r.parseHost=function(a,h){a||(a=""),a=a.replace(/\\/g,"/");var l=a.indexOf("/"),g,_;if(l===-1&&(l=a.length),a.charAt(0)==="[")g=a.indexOf("]"),h.hostname=a.substring(1,g)||null,h.port=a.substring(g+2,l)||null,h.port==="/"&&(h.port=null);else{var v=a.indexOf(":"),P=a.indexOf("/"),C=a.indexOf(":",v+1);C!==-1&&(P===-1||C<P)?(h.hostname=a.substring(0,l)||null,h.port=null):(_=a.substring(0,l).split(":"),h.hostname=_[0]||null,h.port=_[1]||null)}return h.hostname&&a.substring(l).charAt(0)!=="/"&&(l++,a="/"+a),h.preventInvalidHostname&&r.ensureValidHostname(h.hostname,h.protocol),h.port&&r.ensureValidPort(h.port),a.substring(l)||"/"},r.parseAuthority=function(a,h){return a=r.parseUserinfo(a,h),r.parseHost(a,h)},r.parseUserinfo=function(a,h){var l=a,g=a.indexOf("\\");g!==-1&&(a=a.replace(/\\/g,"/"));var _=a.indexOf("/"),v=a.lastIndexOf("@",_>-1?_:a.length-1),P;return v>-1&&(_===-1||v<_)?(P=a.substring(0,v).split(":"),h.username=P[0]?r.decode(P[0]):null,P.shift(),h.password=P[0]?r.decode(P.join(":")):null,a=l.substring(v+1)):(h.username=null,h.password=null),a},r.parseQuery=function(a,h){if(!a)return{};if(a=a.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!a)return{};for(var l={},g=a.split("&"),_=g.length,v,P,C,$=0;$<_;$++)v=g[$].split("="),P=r.decodeQuery(v.shift(),h),C=v.length?r.decodeQuery(v.join("="),h):null,P!=="__proto__"&&(y.call(l,P)?((typeof l[P]=="string"||l[P]===null)&&(l[P]=[l[P]]),l[P].push(C)):l[P]=C);return l},r.build=function(a){var h="",l=!1;return a.protocol&&(h+=a.protocol+":"),!a.urn&&(h||a.hostname)&&(h+="//",l=!0),h+=r.buildAuthority(a)||"",typeof a.path=="string"&&(a.path.charAt(0)!=="/"&&l&&(h+="/"),h+=a.path),typeof a.query=="string"&&a.query&&(h+="?"+a.query),typeof a.fragment=="string"&&a.fragment&&(h+="#"+a.fragment),h},r.buildHost=function(a){var h="";if(a.hostname)r.ip6_expression.test(a.hostname)?h+="["+a.hostname+"]":h+=a.hostname;else return"";return a.port&&(h+=":"+a.port),h},r.buildAuthority=function(a){return r.buildUserinfo(a)+r.buildHost(a)},r.buildUserinfo=function(a){var h="";return a.username&&(h+=r.encode(a.username)),a.password&&(h+=":"+r.encode(a.password)),h&&(h+="@"),h},r.buildQuery=function(a,h,l){var g="",_,v,P,C;for(v in a)if(v!=="__proto__"&&y.call(a,v))if(b(a[v]))for(_={},P=0,C=a[v].length;P<C;P++)a[v][P]!==void 0&&_[a[v][P]+""]===void 0&&(g+="&"+r.buildQueryParameter(v,a[v][P],l),h!==!0&&(_[a[v][P]+""]=!0));else a[v]!==void 0&&(g+="&"+r.buildQueryParameter(v,a[v],l));return g.substring(1)},r.buildQueryParameter=function(a,h,l){return r.encodeQuery(a,l)+(h!==null?"="+r.encodeQuery(h,l):"")},r.addQuery=function(a,h,l){if(typeof h=="object")for(var g in h)y.call(h,g)&&r.addQuery(a,g,h[g]);else if(typeof h=="string"){if(a[h]===void 0){a[h]=l;return}else typeof a[h]=="string"&&(a[h]=[a[h]]);b(l)||(l=[l]),a[h]=(a[h]||[]).concat(l)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(a,h,l){if(typeof h=="object")for(var g in h)y.call(h,g)&&r.setQuery(a,g,h[g]);else if(typeof h=="string")a[h]=l===void 0?null:l;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(a,h,l){var g,_,v;if(b(h))for(g=0,_=h.length;g<_;g++)a[h[g]]=void 0;else if(w(h)==="RegExp")for(v in a)h.test(v)&&(a[v]=void 0);else if(typeof h=="object")for(v in h)y.call(h,v)&&r.removeQuery(a,v,h[v]);else if(typeof h=="string")l!==void 0?w(l)==="RegExp"?!b(a[h])&&l.test(a[h])?a[h]=void 0:a[h]=O(a[h],l):a[h]===String(l)&&(!b(l)||l.length===1)?a[h]=void 0:b(a[h])&&(a[h]=O(a[h],l)):a[h]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(a,h,l,g){switch(w(h)){case"String":break;case"RegExp":for(var _ in a)if(y.call(a,_)&&h.test(_)&&(l===void 0||r.hasQuery(a,_,l)))return!0;return!1;case"Object":for(var v in h)if(y.call(h,v)&&!r.hasQuery(a,v,h[v]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(w(l)){case"Undefined":return h in a;case"Boolean":var P=!!(b(a[h])?a[h].length:a[h]);return l===P;case"Function":return!!l(a[h],h,a);case"Array":if(!b(a[h]))return!1;var C=g?R:T;return C(a[h],l);case"RegExp":return b(a[h])?g?R(a[h],l):!1:!!(a[h]&&a[h].match(l));case"Number":l=String(l);case"String":return b(a[h])?g?R(a[h],l):!1:a[h]===l;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var a=[],h=[],l=0,g=0;g<arguments.length;g++){var _=new r(arguments[g]);a.push(_);for(var v=_.segment(),P=0;P<v.length;P++)typeof v[P]=="string"&&h.push(v[P]),v[P]&&l++}if(!h.length||!l)return new r("");var C=new r("").segment(h);return(a[0].path()===""||a[0].path().slice(0,1)==="/")&&C.path("/"+C.path()),C.normalize()},r.commonPath=function(a,h){var l=Math.min(a.length,h.length),g;for(g=0;g<l;g++)if(a.charAt(g)!==h.charAt(g)){g--;break}return g<1?a.charAt(0)===h.charAt(0)&&a.charAt(0)==="/"?"/":"":((a.charAt(g)!=="/"||h.charAt(g)!=="/")&&(g=a.substring(0,g).lastIndexOf("/")),a.substring(0,g+1))},r.withinString=function(a,h,l){l||(l={});var g=l.start||r.findUri.start,_=l.end||r.findUri.end,v=l.trim||r.findUri.trim,P=l.parens||r.findUri.parens,C=/[a-z0-9-]=["']?$/i;for(g.lastIndex=0;;){var $=g.exec(a);if(!$)break;var X=$.index;if(l.ignoreHtml){var ee=a.slice(Math.max(X-3,0),X);if(ee&&C.test(ee))continue}for(var te=X+a.slice(X).search(_),ie=a.slice(X,te),ce=-1;;){var ue=P.exec(ie);if(!ue)break;var ye=ue.index+ue[0].length;ce=Math.max(ce,ye)}if(ce>-1?ie=ie.slice(0,ce)+ie.slice(ce).replace(v,""):ie=ie.replace(v,""),!(ie.length<=$[0].length)&&!(l.ignore&&l.ignore.test(ie))){te=X+ie.length;var he=h(ie,X,te,a);if(he===void 0){g.lastIndex=te;continue}he=String(he),a=a.slice(0,X)+he+a.slice(te),g.lastIndex=X+he.length}}return g.lastIndex=0,a},r.ensureValidHostname=function(a,h){var l=!!a,g=!!h,_=!1;if(g&&(_=R(r.hostProtocols,h)),_&&!l)throw new TypeError("Hostname cannot be empty, if protocol is "+h);if(a&&a.match(r.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(a).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(a){if(a){var h=Number(a);if(!(c(h)&&h>0&&h<65536))throw new TypeError('Port "'+a+'" is not a valid port')}},r.noConflict=function(a){if(a){var h={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(h.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(h.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(h.SecondLevelDomains=i.SecondLevelDomains.noConflict()),h}else i.URI===this&&(i.URI=s);return this},u.build=function(a){return a===!0?this._deferred_build=!0:(a===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},u.clone=function(){return new r(this)},u.valueOf=u.toString=function(){return this.build(!1)._string};function B(a){return function(h,l){return h===void 0?this._parts[a]||"":(this._parts[a]=h||null,this.build(!l),this)}}function U(a,h){return function(l,g){return l===void 0?this._parts[a]||"":(l!==null&&(l=l+"",l.charAt(0)===h&&(l=l.substring(1))),this._parts[a]=l,this.build(!g),this)}}u.protocol=B("protocol"),u.username=B("username"),u.password=B("password"),u.hostname=B("hostname"),u.port=B("port"),u.query=U("query","?"),u.fragment=U("fragment","#"),u.search=function(a,h){var l=this.query(a,h);return typeof l=="string"&&l.length?"?"+l:l},u.hash=function(a,h){var l=this.fragment(a,h);return typeof l=="string"&&l.length?"#"+l:l},u.pathname=function(a,h){if(a===void 0||a===!0){var l=this._parts.path||(this._parts.hostname?"/":"");return a?(this._parts.urn?r.decodeUrnPath:r.decodePath)(l):l}else return this._parts.urn?this._parts.path=a?r.recodeUrnPath(a):"":this._parts.path=a?r.recodePath(a):"/",this.build(!h),this},u.path=u.pathname,u.href=function(a,h){var l;if(a===void 0)return this.toString();this._string="",this._parts=r._parts();var g=a instanceof r,_=typeof a=="object"&&(a.hostname||a.path||a.pathname);if(a.nodeName){var v=r.getDomAttribute(a);a=a[v]||"",_=!1}if(!g&&_&&a.pathname!==void 0&&(a=a.toString()),typeof a=="string"||a instanceof String)this._parts=r.parse(String(a),this._parts);else if(g||_){var P=g?a._parts:a;for(l in P)l!=="query"&&y.call(this._parts,l)&&(this._parts[l]=P[l]);P.query&&this.query(P.query,!1)}else throw new TypeError("invalid input");return this.build(!h),this},u.is=function(a){var h=!1,l=!1,g=!1,_=!1,v=!1,P=!1,C=!1,$=!this._parts.urn;switch(this._parts.hostname&&($=!1,l=r.ip4_expression.test(this._parts.hostname),g=r.ip6_expression.test(this._parts.hostname),h=l||g,_=!h,v=_&&o&&o.has(this._parts.hostname),P=_&&r.idn_expression.test(this._parts.hostname),C=_&&r.punycode_expression.test(this._parts.hostname)),a.toLowerCase()){case"relative":return $;case"absolute":return!$;case"domain":case"name":return _;case"sld":return v;case"ip":return h;case"ip4":case"ipv4":case"inet4":return l;case"ip6":case"ipv6":case"inet6":return g;case"idn":return P;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return C}return null};var G=u.protocol,V=u.port,k=u.hostname;u.protocol=function(a,h){if(a&&(a=a.replace(/:(\/\/)?$/,""),!a.match(r.protocol_expression)))throw new TypeError('Protocol "'+a+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return G.call(this,a,h)},u.scheme=u.protocol,u.port=function(a,h){return this._parts.urn?a===void 0?"":this:(a!==void 0&&(a===0&&(a=null),a&&(a+="",a.charAt(0)===":"&&(a=a.substring(1)),r.ensureValidPort(a))),V.call(this,a,h))},u.hostname=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a!==void 0){var l={preventInvalidHostname:this._parts.preventInvalidHostname},g=r.parseHost(a,l);if(g!=="/")throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');a=l.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(a,this._parts.protocol)}return k.call(this,a,h)},u.origin=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0){var l=this.protocol(),g=this.authority();return g?(l?l+"://":"")+this.authority():""}else{var _=r(a);return this.protocol(_.protocol()).authority(_.authority()).build(!h),this}},u.host=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var l=r.parseHost(a,this._parts);if(l!=="/")throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');return this.build(!h),this},u.authority=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var l=r.parseAuthority(a,this._parts);if(l!=="/")throw new TypeError('Hostname "'+a+'" contains characters other than [A-Z0-9.-]');return this.build(!h),this},u.userinfo=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0){var l=r.buildUserinfo(this._parts);return l&&l.substring(0,l.length-1)}else return a[a.length-1]!=="@"&&(a+="@"),r.parseUserinfo(a,this._parts),this.build(!h),this},u.resource=function(a,h){var l;return a===void 0?this.path()+this.search()+this.hash():(l=r.parse(a),this._parts.path=l.path,this._parts.query=l.query,this._parts.fragment=l.fragment,this.build(!h),this)},u.subdomain=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0){if(!this._parts.hostname||this.is("IP"))return"";var l=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,l)||""}else{var g=this._parts.hostname.length-this.domain().length,_=this._parts.hostname.substring(0,g),v=new RegExp("^"+m(_));if(a&&a.charAt(a.length-1)!=="."&&(a+="."),a.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return a&&r.ensureValidHostname(a,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(v,a),this.build(!h),this}},u.domain=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(typeof a=="boolean"&&(h=a,a=void 0),a===void 0){if(!this._parts.hostname||this.is("IP"))return"";var l=this._parts.hostname.match(/\./g);if(l&&l.length<2)return this._parts.hostname;var g=this._parts.hostname.length-this.tld(h).length-1;return g=this._parts.hostname.lastIndexOf(".",g-1)+1,this._parts.hostname.substring(g)||""}else{if(!a)throw new TypeError("cannot set domain empty");if(a.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(a,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=a;else{var _=new RegExp(m(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(_,a)}return this.build(!h),this}},u.tld=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(typeof a=="boolean"&&(h=a,a=void 0),a===void 0){if(!this._parts.hostname||this.is("IP"))return"";var l=this._parts.hostname.lastIndexOf("."),g=this._parts.hostname.substring(l+1);return h!==!0&&o&&o.list[g.toLowerCase()]&&o.get(this._parts.hostname)||g}else{var _;if(a)if(a.match(/[^a-zA-Z0-9-]/))if(o&&o.is(a))_=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(_,a);else throw new TypeError('TLD "'+a+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");_=new RegExp(m(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(_,a)}else throw new TypeError("cannot set TLD empty");return this.build(!h),this}},u.directory=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0||a===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var l=this._parts.path.length-this.filename().length-1,g=this._parts.path.substring(0,l)||(this._parts.hostname?"/":"");return a?r.decodePath(g):g}else{var _=this._parts.path.length-this.filename().length,v=this._parts.path.substring(0,_),P=new RegExp("^"+m(v));return this.is("relative")||(a||(a="/"),a.charAt(0)!=="/"&&(a="/"+a)),a&&a.charAt(a.length-1)!=="/"&&(a+="/"),a=r.recodePath(a),this._parts.path=this._parts.path.replace(P,a),this.build(!h),this}},u.filename=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(typeof a!="string"){if(!this._parts.path||this._parts.path==="/")return"";var l=this._parts.path.lastIndexOf("/"),g=this._parts.path.substring(l+1);return a?r.decodePathSegment(g):g}else{var _=!1;a.charAt(0)==="/"&&(a=a.substring(1)),a.match(/\.?\//)&&(_=!0);var v=new RegExp(m(this.filename())+"$");return a=r.recodePath(a),this._parts.path=this._parts.path.replace(v,a),_?this.normalizePath(h):this.build(!h),this}},u.suffix=function(a,h){if(this._parts.urn)return a===void 0?"":this;if(a===void 0||a===!0){if(!this._parts.path||this._parts.path==="/")return"";var l=this.filename(),g=l.lastIndexOf("."),_,v;return g===-1?"":(_=l.substring(g+1),v=/^[a-z0-9%]+$/i.test(_)?_:"",a?r.decodePathSegment(v):v)}else{a.charAt(0)==="."&&(a=a.substring(1));var P=this.suffix(),C;if(P)a?C=new RegExp(m(P)+"$"):C=new RegExp(m("."+P)+"$");else{if(!a)return this;this._parts.path+="."+r.recodePath(a)}return C&&(a=r.recodePath(a),this._parts.path=this._parts.path.replace(C,a)),this.build(!h),this}},u.segment=function(a,h,l){var g=this._parts.urn?":":"/",_=this.path(),v=_.substring(0,1)==="/",P=_.split(g);if(a!==void 0&&typeof a!="number"&&(l=h,h=a,a=void 0),a!==void 0&&typeof a!="number")throw new Error('Bad segment "'+a+'", must be 0-based integer');if(v&&P.shift(),a<0&&(a=Math.max(P.length+a,0)),h===void 0)return a===void 0?P:P[a];if(a===null||P[a]===void 0)if(b(h)){P=[];for(var C=0,$=h.length;C<$;C++)!h[C].length&&(!P.length||!P[P.length-1].length)||(P.length&&!P[P.length-1].length&&P.pop(),P.push(z(h[C])))}else(h||typeof h=="string")&&(h=z(h),P[P.length-1]===""?P[P.length-1]=h:P.push(h));else h?P[a]=z(h):P.splice(a,1);return v&&P.unshift(""),this.path(P.join(g),l)},u.segmentCoded=function(a,h,l){var g,_,v;if(typeof a!="number"&&(l=h,h=a,a=void 0),h===void 0){if(g=this.segment(a,h,l),!b(g))g=g!==void 0?r.decode(g):void 0;else for(_=0,v=g.length;_<v;_++)g[_]=r.decode(g[_]);return g}if(!b(h))h=typeof h=="string"||h instanceof String?r.encode(h):h;else for(_=0,v=h.length;_<v;_++)h[_]=r.encode(h[_]);return this.segment(a,h,l)};var J=u.query;return u.query=function(a,h){if(a===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof a=="function"){var l=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),g=a.call(this,l);return this._parts.query=r.buildQuery(g||l,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!h),this}else return a!==void 0&&typeof a!="string"?(this._parts.query=r.buildQuery(a,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!h),this):J.call(this,a,h)},u.setQuery=function(a,h,l){var g=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof a=="string"||a instanceof String)g[a]=h!==void 0?h:null;else if(typeof a=="object")for(var _ in a)y.call(a,_)&&(g[_]=a[_]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(g,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof a!="string"&&(l=h),this.build(!l),this},u.addQuery=function(a,h,l){var g=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(g,a,h===void 0?null:h),this._parts.query=r.buildQuery(g,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof a!="string"&&(l=h),this.build(!l),this},u.removeQuery=function(a,h,l){var g=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(g,a,h),this._parts.query=r.buildQuery(g,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof a!="string"&&(l=h),this.build(!l),this},u.hasQuery=function(a,h,l){var g=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(g,a,h,l)},u.setSearch=u.setQuery,u.addSearch=u.addQuery,u.removeSearch=u.removeQuery,u.hasSearch=u.hasQuery,u.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},u.normalizeProtocol=function(a){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!a)),this},u.normalizeHostname=function(a){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!a)),this},u.normalizePort=function(a){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!a)),this},u.normalizePath=function(a){var h=this._parts.path;if(!h)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!a),this;if(this._parts.path==="/")return this;h=r.recodePath(h);var l,g="",_,v;for(h.charAt(0)!=="/"&&(l=!0,h="/"+h),(h.slice(-3)==="/.."||h.slice(-2)==="/.")&&(h+="/"),h=h.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),l&&(g=h.substring(1).match(/^(\.\.\/)+/)||"",g&&(g=g[0]));_=h.search(/\/\.\.(\/|$)/),_!==-1;){if(_===0){h=h.substring(3);continue}v=h.substring(0,_).lastIndexOf("/"),v===-1&&(v=_),h=h.substring(0,v)+h.substring(_+3)}return l&&this.is("relative")&&(h=g+h.substring(1)),this._parts.path=h,this.build(!a),this},u.normalizePathname=u.normalizePath,u.normalizeQuery=function(a){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!a)),this},u.normalizeFragment=function(a){return this._parts.fragment||(this._parts.fragment=null,this.build(!a)),this},u.normalizeSearch=u.normalizeQuery,u.normalizeHash=u.normalizeFragment,u.iso8859=function(){var a=r.encode,h=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=a,r.decode=h}return this},u.unicode=function(){var a=r.encode,h=r.decode;r.encode=q,r.decode=unescape;try{this.normalize()}finally{r.encode=a,r.decode=h}return this},u.readable=function(){var a=this.clone();a.username("").password("").normalize();var h="";if(a._parts.protocol&&(h+=a._parts.protocol+"://"),a._parts.hostname&&(a.is("punycode")&&t?(h+=t.toUnicode(a._parts.hostname),a._parts.port&&(h+=":"+a._parts.port)):h+=a.host()),a._parts.hostname&&a._parts.path&&a._parts.path.charAt(0)!=="/"&&(h+="/"),h+=a.path(!0),a._parts.query){for(var l="",g=0,_=a._parts.query.split("&"),v=_.length;g<v;g++){var P=(_[g]||"").split("=");l+="&"+r.decodeQuery(P[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),P[1]!==void 0&&(l+="="+r.decodeQuery(P[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}h+="?"+l.substring(1)}return h+=r.decodeQuery(a.hash(),!0),h},u.absoluteTo=function(a){var h=this.clone(),l=["protocol","username","password","hostname","port"],g,_,v;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(a instanceof r||(a=new r(a)),h._parts.protocol||(h._parts.protocol=a._parts.protocol,this._parts.hostname))return h;for(_=0;v=l[_];_++)h._parts[v]=a._parts[v];return h._parts.path?(h._parts.path.substring(-2)===".."&&(h._parts.path+="/"),h.path().charAt(0)!=="/"&&(g=a.directory(),g=g||(a.path().indexOf("/")===0?"/":""),h._parts.path=(g?g+"/":"")+h._parts.path,h.normalizePath())):(h._parts.path=a._parts.path,h._parts.query||(h._parts.query=a._parts.query)),h.build(),h},u.relativeTo=function(a){var h=this.clone().normalize(),l,g,_,v,P;if(h._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(a=new r(a).normalize(),l=h._parts,g=a._parts,v=h.path(),P=a.path(),v.charAt(0)!=="/")throw new Error("URI is already relative");if(P.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(l.protocol===g.protocol&&(l.protocol=null),l.username!==g.username||l.password!==g.password||l.protocol!==null||l.username!==null||l.password!==null)return h.build();if(l.hostname===g.hostname&&l.port===g.port)l.hostname=null,l.port=null;else return h.build();if(v===P)return l.path="",h.build();if(_=r.commonPath(v,P),!_)return h.build();var C=g.path.substring(_.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return l.path=C+l.path.substring(_.length)||"./",h.build()},u.equals=function(a){var h=this.clone(),l=new r(a),g={},_={},v={},P,C,$;if(h.normalize(),l.normalize(),h.toString()===l.toString())return!0;if(P=h.query(),C=l.query(),h.query(""),l.query(""),h.toString()!==l.toString()||P.length!==C.length)return!1;g=r.parseQuery(P,this._parts.escapeQuerySpace),_=r.parseQuery(C,this._parts.escapeQuerySpace);for($ in g)if(y.call(g,$)){if(b(g[$])){if(!T(g[$],_[$]))return!1}else if(g[$]!==_[$])return!1;v[$]=!0}for($ in _)if(y.call(_,$)&&!v[$])return!1;return!0},u.preventInvalidHostname=function(a){return this._parts.preventInvalidHostname=!!a,this},u.duplicateQueryParameters=function(a){return this._parts.duplicateQueryParameters=!!a,this},u.escapeQuerySpace=function(a){return this._parts.escapeQuerySpace=!!a,this},r})})(ai);var os=ai.exports;const Ke=Et(os);function $t(e,t){let n;return typeof document<"u"&&(n=document),$t._implementation(e,t,n)}$t._implementation=function(e,t,n){if(!d(e))throw new E("relative uri is required.");if(!d(t)){if(typeof n>"u")return e;t=j(n.baseURI,n.location.href)}const o=new Ke(e);return o.scheme()!==""?o.toString():o.absoluteTo(t).toString()};function is(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}function bt(e,t){if(e===null||typeof e!="object")return e;t=j(t,!1);const n=new e.constructor;for(const o in e)if(e.hasOwnProperty(o)){let i=e[o];t&&(i=bt(i,t)),n[o]=i}return n}function Je(e,t,n){n=j(n,!1);const o={},i=d(e),s=d(t);let r,c,u;if(i)for(r in e)e.hasOwnProperty(r)&&(c=e[r],s&&n&&typeof c=="object"&&t.hasOwnProperty(r)?(u=t[r],typeof u=="object"?o[r]=Je(c,u,n):o[r]=c):o[r]=c);if(s)for(r in t)t.hasOwnProperty(r)&&!o.hasOwnProperty(r)&&(u=t[r],o[r]=u);return o}function Ht(){let e,t;const n=new Promise(function(o,i){e=o,t=i});return{resolve:e,reject:t,promise:n}}function rs(e,t){if(!d(e))throw new E("uri is required.");let n="";const o=e.lastIndexOf("/");return o!==-1&&(n=e.substring(0,o+1)),t&&(e=new Ke(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}function ss(e){if(!d(e))throw new E("uri is required.");const t=new Ke(e);t.normalize();let n=t.path(),o=n.lastIndexOf("/");return o!==-1&&(n=n.substr(o+1)),o=n.lastIndexOf("."),o===-1?n="":n=n.substr(o+1),n}const Io={};function qo(e,t,n){d(t)||(t=e.width),d(n)||(n=e.height);let o=Io[t];d(o)||(o={},Io[t]=o);let i=o[n];if(!d(i)){const s=document.createElement("canvas");s.width=t,s.height=n,i=s.getContext("2d",{willReadFrequently:!0}),i.globalCompositeOperation="copy",o[n]=i}return i.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}const cs=/^blob:/i;function fi(e){return f.typeOf.string("uri",e),cs.test(e)}let $e;function as(e){d($e)||($e=document.createElement("a")),$e.href=window.location.href;const t=$e.host,n=$e.protocol;return $e.href=e,$e.href=$e.href,n!==$e.protocol||t!==$e.host}const fs=/^data:/i;function ui(e){return f.typeOf.string("uri",e),fs.test(e)}function us(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,o)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const i=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,i.removeChild(t),n()},t.onerror=function(s){o(s)},i.appendChild(t)})}function hs(e){if(!d(e))throw new E("obj is required.");let t="";for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],i=`${encodeURIComponent(n)}=`;if(Array.isArray(o))for(let s=0,r=o.length;s<r;++s)t+=`${i+encodeURIComponent(o[s])}&`;else t+=`${i+encodeURIComponent(o)}&`}return t=t.slice(0,-1),t}function ds(e){if(!d(e))throw new E("queryString is required.");const t={};if(e==="")return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let o=0,i=n.length;o<i;++o){const s=n[o].split("="),r=decodeURIComponent(s[0]);let c=s[1];d(c)?c=decodeURIComponent(c):c="";const u=t[r];typeof u=="string"?t[r]=[u,c]:Array.isArray(u)?u.push(c):t[r]=c}return t}const ps={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},ge=Object.freeze(ps),ls={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},ms=Object.freeze(ls);function bn(e){e=j(e,j.EMPTY_OBJECT);const t=j(e.throttleByServer,!1),n=j(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=j(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=j(e.type,ms.OTHER),this.serverKey=e.serverKey,this.state=ge.UNISSUED,this.deferred=void 0,this.cancelled=!1}bn.prototype.cancel=function(){this.cancelled=!0};bn.prototype.clone=function(e){return d(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=ge.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new bn(this)};function ys(e){const t={};if(!e)return t;const n=e.split(`\r
44
- `);for(let o=0;o<n.length;++o){const i=n[o],s=i.indexOf(": ");if(s>0){const r=i.substring(0,s),c=i.substring(s+2);t[r]=c}}return t}function Ft(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=ys(this.responseHeaders))}Ft.prototype.toString=function(){let e="Request has failed.";return d(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};function Qt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Qt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});Qt.prototype.addEventListener=function(e,t){f.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}};Qt.prototype.removeEventListener=function(e,t){f.typeOf.func("listener",e);const n=this._listeners,o=this._scopes;let i=-1;for(let s=0;s<n.length;s++)if(n[s]===e&&o[s]===t){i=s;break}return i!==-1?(this._insideRaiseEvent?(this._toRemove.push(i),n[i]=void 0,o[i]=void 0):(n.splice(i,1),o.splice(i,1)),!0):!1};function ws(e,t){return t-e}Qt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e;const t=this._listeners,n=this._scopes;let o=t.length;for(e=0;e<o;e++){const s=t[e];d(s)&&t[e].apply(n[e],arguments)}const i=this._toRemove;if(o=i.length,o>0){for(i.sort(ws),e=0;e<o;e++){const s=i[e];t.splice(s,1),n.splice(s,1)}i.length=0}this._insideRaiseEvent=!1};function ct(e){f.typeOf.object("options",e),f.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ct.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){f.typeOf.number.greaterThanOrEquals("maximumLength",e,0);const t=this._length;if(e<t){const n=this._array;for(let o=e;o<t;++o)n[o]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function ao(e,t,n){const o=e[t];e[t]=e[n],e[n]=o}ct.prototype.reserve=function(e){e=j(e,this._length),this._array.length=e};ct.prototype.heapify=function(e){e=j(e,0);const t=this._length,n=this._comparator,o=this._array;let i=-1,s=!0;for(;s;){const r=2*(e+1),c=r-1;c<t&&n(o[c],o[e])<0?i=c:i=e,r<t&&n(o[r],o[i])<0&&(i=r),i!==e?(ao(o,i,e),e=i):s=!1}};ct.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ct.prototype.insert=function(e){f.defined("element",e);const t=this._array,n=this._comparator,o=this._maximumLength;let i=this._length++;for(i<t.length?t[i]=e:t.push(e);i!==0;){const r=Math.floor((i-1)/2);if(n(t[i],t[r])<0)ao(t,i,r),i=r;else break}let s;return d(o)&&this._length>o&&(s=t[o],this._length=o),s};ct.prototype.pop=function(e){if(e=j(e,0),this._length===0)return;f.typeOf.number.lessThan("index",e,this._length);const t=this._array,n=t[e];return ao(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};function gs(e,t){return e.priority-t.priority}const ae={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let Ot=20;const Re=new ct({comparator:gs});Re.maximumLength=Ot;Re.reserve(Ot);const Fe=[];let He={};const bs=typeof document<"u"?new Ke(document.location.href):new Ke,vn=new Qt;function de(){}de.maximumRequests=50;de.maximumRequestsPerServer=18;de.requestsByServer={};de.throttleRequests=!0;de.debugShowStatistics=!1;de.requestCompletedEvent=vn;Object.defineProperties(de,{statistics:{get:function(){return ae}},priorityHeapLength:{get:function(){return Ot},set:function(e){if(e<Ot)for(;Re.length>e;){const t=Re.pop();rt(t)}Ot=e,Re.maximumLength=e,Re.reserve(e)}}});function hi(e){d(e.priorityFunction)&&(e.priority=e.priorityFunction())}de.serverHasOpenSlots=function(e,t){t=j(t,1);const n=j(de.requestsByServer[e],de.maximumRequestsPerServer);return He[e]+t<=n};de.heapHasOpenSlots=function(e){return Re.length+e<=Ot};function di(e){return e.state===ge.UNISSUED&&(e.state=ge.ISSUED,e.deferred=Ht()),e.deferred.promise}function Os(e){return function(t){if(e.state===ge.CANCELLED)return;const n=e.deferred;--ae.numberOfActiveRequests,--He[e.serverKey],vn.raiseEvent(),e.state=ge.RECEIVED,e.deferred=void 0,n.resolve(t)}}function _s(e){return function(t){e.state!==ge.CANCELLED&&(++ae.numberOfFailedRequests,--ae.numberOfActiveRequests,--He[e.serverKey],vn.raiseEvent(t),e.state=ge.FAILED,e.deferred.reject(t))}}function pi(e){const t=di(e);return e.state=ge.ACTIVE,Fe.push(e),++ae.numberOfActiveRequests,++ae.numberOfActiveRequestsEver,++He[e.serverKey],e.requestFunction().then(Os(e)).catch(_s(e)),t}function rt(e){const t=e.state===ge.ACTIVE;if(e.state=ge.CANCELLED,++ae.numberOfCancelledRequests,d(e.deferred)){const n=e.deferred;e.deferred=void 0,n.reject()}t&&(--ae.numberOfActiveRequests,--He[e.serverKey],++ae.numberOfCancelledActiveRequests),d(e.cancelFunction)&&e.cancelFunction()}de.update=function(){let e,t,n=0;const o=Fe.length;for(e=0;e<o;++e){if(t=Fe[e],t.cancelled&&rt(t),t.state!==ge.ACTIVE){++n;continue}n>0&&(Fe[e-n]=t)}Fe.length-=n;const i=Re.internalArray,s=Re.length;for(e=0;e<s;++e)hi(i[e]);Re.resort();const r=Math.max(de.maximumRequests-Fe.length,0);let c=0;for(;c<r&&Re.length>0;){if(t=Re.pop(),t.cancelled){rt(t);continue}if(t.throttleByServer&&!de.serverHasOpenSlots(t.serverKey)){rt(t);continue}pi(t),++c}Ss()};de.getServerKey=function(e){f.typeOf.string("url",e);let t=new Ke(e);t.scheme()===""&&(t=t.absoluteTo(bs),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);const o=He[n];return d(o)||(He[n]=0),n};de.request=function(e){if(f.typeOf.object("request",e),f.typeOf.string("request.url",e.url),f.typeOf.func("request.requestFunction",e.requestFunction),ui(e.url)||fi(e.url))return vn.raiseEvent(),e.state=ge.RECEIVED,e.requestFunction();if(++ae.numberOfAttemptedRequests,d(e.serverKey)||(e.serverKey=de.getServerKey(e.url)),de.throttleRequests&&e.throttleByServer&&!de.serverHasOpenSlots(e.serverKey))return;if(!de.throttleRequests||!e.throttle)return pi(e);if(Fe.length>=de.maximumRequests)return;hi(e);const t=Re.insert(e);if(d(t)){if(t===e)return;rt(t)}return di(e)};function Ss(){de.debugShowStatistics&&(ae.numberOfActiveRequests===0&&ae.lastNumberOfActiveRequests>0&&(ae.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${ae.numberOfAttemptedRequests}`),ae.numberOfAttemptedRequests=0),ae.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${ae.numberOfCancelledRequests}`),ae.numberOfCancelledRequests=0),ae.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${ae.numberOfCancelledActiveRequests}`),ae.numberOfCancelledActiveRequests=0),ae.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${ae.numberOfFailedRequests}`),ae.numberOfFailedRequests=0)),ae.lastNumberOfActiveRequests=ae.numberOfActiveRequests)}de.clearForSpecs=function(){for(;Re.length>0;){const t=Re.pop();rt(t)}const e=Fe.length;for(let t=0;t<e;++t)rt(Fe[t]);Fe.length=0,He={},ae.numberOfAttemptedRequests=0,ae.numberOfActiveRequests=0,ae.numberOfCancelledRequests=0,ae.numberOfCancelledActiveRequests=0,ae.numberOfFailedRequests=0,ae.numberOfActiveRequestsEver=0,ae.lastNumberOfActiveRequests=0};de.numberOfActiveRequestsByServer=function(e){return He[e]};de.requestHeap=Re;const Rt={};let _t={};Rt.add=function(e,t){if(!d(e))throw new E("host is required.");if(!d(t)||t<=0)throw new E("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;d(_t[n])||(_t[n]=!0)};Rt.remove=function(e,t){if(!d(e))throw new E("host is required.");if(!d(t)||t<=0)throw new E("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;d(_t[n])&&delete _t[n]};function vs(e){const t=new Ke(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let o=t.scheme();if(o.length===0&&(o=window.location.protocol,o=o.substring(0,o.length-1)),o==="http")n+=":80";else if(o==="https")n+=":443";else return}return n}}Rt.contains=function(e){if(!d(e))throw new E("url is required.");const t=vs(e);return!!(d(t)&&d(_t[t]))};Rt.clear=function(){_t={}};const li=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function W(e){e=j(e,j.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),f.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Le(e.templateValues,{}),this._queryParameters=Le(e.queryParameters,{}),this.headers=Le(e.headers,{}),this.request=j(e.request,new bn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=j(e.retryAttempts,0),this._retryCount=0,j(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Le(e,t){return d(e)?bt(e):t}W.createIfNeeded=function(e){return e instanceof W?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new W({url:e})};let pt;W.supportsImageBitmapOptions=function(){return d(pt)?pt:typeof createImageBitmap!="function"?(pt=Promise.resolve(!1),pt):(pt=W.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){const n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){const n=qo(t[0]),o=qo(t[1]);return n[1]!==o[1]}).catch(function(){return!1}),pt)};Object.defineProperties(W,{isBlobSupported:{get:function(){return li}}});Object.defineProperties(W.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return ss(this._url)}},isDataUri:{get:function(){return ui(this._url)}},isBlobUri:{get:function(){return fi(this._url)}},isCrossOriginUrl:{get:function(){return as(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});W.prototype.toString=function(){return this.getUrlComponent(!0,!0)};W.prototype.parseUrl=function(e,t,n,o){let i=new Ke(e);const s=Es(i.query());this._queryParameters=t?On(s,this.queryParameters,n):s,i.search(""),i.fragment(""),d(o)&&i.scheme()===""&&(i=i.absoluteTo($t(o))),this._url=i.toString()};function Es(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:ds(e)}function On(e,t,n){if(!n)return Je(e,t);const o=bt(e,!0);for(const i in t)if(t.hasOwnProperty(i)){let s=o[i];const r=t[i];d(s)?(Array.isArray(s)||(s=o[i]=[s]),o[i]=s.concat(r)):o[i]=Array.isArray(r)?r.slice():r}return o}W.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Ts(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");const o=this._templateValues;return Object.keys(o).length>0&&(n=n.replace(/{(.*?)}/g,function(i,s){const r=o[s];return d(r)?encodeURIComponent(r):i})),t&&d(this.proxy)&&(n=this.proxy.getURL(n)),n};function Ts(e){const t=Object.keys(e);return t.length===0?"":t.length===1&&!d(e[t[0]])?`?${t[0]}`:`?${hs(e)}`}W.prototype.setQueryParameters=function(e,t){t?this._queryParameters=On(this._queryParameters,e,!1):this._queryParameters=On(e,this._queryParameters,!1)};W.prototype.appendQueryParameters=function(e){this._queryParameters=On(e,this._queryParameters,!0)};W.prototype.setTemplateValues=function(e,t){t?this._templateValues=Je(this._templateValues,e):this._templateValues=Je(e,this._templateValues)};W.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,d(e.url)){const n=j(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return d(e.queryParameters)&&(t._queryParameters=Je(e.queryParameters,t.queryParameters)),d(e.templateValues)&&(t._templateValues=Je(e.templateValues,t.templateValues)),d(e.headers)&&(t.headers=Je(e.headers,t.headers)),d(e.proxy)&&(t.proxy=e.proxy),d(e.request)&&(t.request=e.request),d(e.retryCallback)&&(t.retryCallback=e.retryCallback),d(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};W.prototype.retryOnError=function(e){const t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then(function(o){return++n._retryCount,o})};W.prototype.clone=function(e){return d(e)?(e._url=this._url,e._queryParameters=bt(this._queryParameters),e._templateValues=bt(this._templateValues),e.headers=bt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new W({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:d(this.credits)?this.credits.slice():void 0})};W.prototype.getBaseUri=function(e){return rs(this.getUrlComponent(e),e)};W.prototype.appendForwardSlash=function(){this._url=is(this._url)};W.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};W.fetchArrayBuffer=function(e){return new W(e).fetchArrayBuffer()};W.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};W.fetchBlob=function(e){return new W(e).fetchBlob()};W.prototype.fetchImage=function(e){e=j(e,j.EMPTY_OBJECT);const t=j(e.preferImageBitmap,!1),n=j(e.preferBlob,!1),o=j(e.flipY,!1),i=j(e.skipColorSpaceConversion,!1);if(fo(this.request),!li||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Jn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!d(s))return;let r,c,u,y;return W.supportsImageBitmapOptions().then(function(m){return r=m,c=r&&t,s}).then(function(m){if(!d(m))return;if(y=m,c)return W.createImageBitmapFromBlob(m,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});const w=window.URL.createObjectURL(m);return u=new W({url:w}),Jn({resource:u,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})}).then(function(m){if(d(m))return m.blob=y,c||window.URL.revokeObjectURL(u.url),m}).catch(function(m){return d(u)&&window.URL.revokeObjectURL(u.url),m.blob=y,Promise.reject(m)})};function Jn(e){const t=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let c=!1;!t.isDataUri&&!t.isBlobUri&&(c=t.isCrossOriginUrl);const u=Ht();return W._Implementations.createImage(s,c,u,n,o,i),u.promise};const r=de.request(s);if(d(r))return r.catch(function(c){return s.state!==ge.FAILED?Promise.reject(c):t.retryOnError(c).then(function(u){return u?(s.state=ge.UNISSUED,s.deferred=void 0,Jn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):Promise.reject(c)})})}W.fetchImage=function(e){return new W(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};W.prototype.fetchText=function(){return this.fetch({responseType:"text"})};W.fetchText=function(e){return new W(e).fetchText()};W.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(d(e))return e.then(function(t){if(d(t))return JSON.parse(t)})};W.fetchJson=function(e){return new W(e).fetchJson()};W.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};W.fetchXML=function(e){return new W(e).fetchXML()};W.prototype.fetchJsonp=function(e){e=j(e,"callback"),fo(this.request);let t;do t=`loadJsonp${S.nextRandomNumber().toString().substring(2,8)}`;while(d(window[t]));return mi(this,e,t)};function mi(e,t,n){const o={};o[t]=n,e.setQueryParameters(o);const i=e.request,s=e.url;i.url=s,i.requestFunction=function(){const c=Ht();return window[n]=function(u){c.resolve(u);try{delete window[n]}catch{window[n]=void 0}},W._Implementations.loadAndExecuteScript(s,n,c),c.promise};const r=de.request(i);if(d(r))return r.catch(function(c){return i.state!==ge.FAILED?Promise.reject(c):e.retryOnError(c).then(function(u){return u?(i.state=ge.UNISSUED,i.deferred=void 0,mi(e,t,n)):Promise.reject(c)})})}W.fetchJsonp=function(e){return new W(e).fetchJsonp(e.callbackParameterName)};W.prototype._makeRequest=function(e){const t=this;fo(t.request);const n=t.request,o=t.url;n.url=o,n.requestFunction=function(){const s=e.responseType,r=Je(e.headers,t.headers),c=e.overrideMimeType,u=e.method,y=e.data,m=Ht(),w=W._Implementations.loadWithXhr(o,s,u,y,r,m,c);return d(w)&&d(w.abort)&&(n.cancelFunction=function(){w.abort()}),m.promise};const i=de.request(n);if(d(i))return i.then(function(s){return n.cancelFunction=void 0,s}).catch(function(s){return n.cancelFunction=void 0,n.state!==ge.FAILED?Promise.reject(s):t.retryOnError(s).then(function(r){return r?(n.state=ge.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(s)})})};function fo(e){if(e.state===ge.ISSUED||e.state===ge.ACTIVE)throw new Ie("The Resource is already being fetched.");e.state=ge.UNISSUED,e.deferred=void 0}const Rs=/^data:(.*?)(;base64)?,(.*)$/;function ln(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Uo(e,t){const n=ln(e,t),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let s=0;s<n.length;s++)i[s]=n.charCodeAt(s);return o}function As(e,t){t=j(t,"");const n=e[1],o=!!e[2],i=e[3];let s,r;switch(t){case"":case"text":return ln(o,i);case"arraybuffer":return Uo(o,i);case"blob":return s=Uo(o,i),new Blob([s],{type:n});case"document":return r=new DOMParser,r.parseFromString(ln(o,i),n);case"json":return JSON.parse(ln(o,i));default:throw new E(`Unhandled responseType: ${t}`)}}W.prototype.fetch=function(e){return e=Le(e,{}),e.method="GET",this._makeRequest(e)};W.fetch=function(e){return new W(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.delete=function(e){return e=Le(e,{}),e.method="DELETE",this._makeRequest(e)};W.delete=function(e){return new W(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};W.prototype.head=function(e){return e=Le(e,{}),e.method="HEAD",this._makeRequest(e)};W.head=function(e){return new W(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.options=function(e){return e=Le(e,{}),e.method="OPTIONS",this._makeRequest(e)};W.options=function(e){return new W(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.post=function(e,t){return f.defined("data",e),t=Le(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};W.post=function(e){return new W(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.put=function(e,t){return f.defined("data",e),t=Le(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};W.put=function(e){return new W(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W.prototype.patch=function(e,t){return f.defined("data",e),t=Le(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};W.patch=function(e){return new W(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};W._Implementations={};W._Implementations.loadImageElement=function(e,t,n){const o=new Image;o.onload=function(){o.naturalWidth===0&&o.naturalHeight===0&&o.width===0&&o.height===0&&(o.width=300,o.height=150),n.resolve(o)},o.onerror=function(i){n.reject(i)},t&&(Rt.contains(e)?o.crossOrigin="use-credentials":o.crossOrigin=""),o.src=e};W._Implementations.createImage=function(e,t,n,o,i,s){const r=e.url;W.supportsImageBitmapOptions().then(function(c){if(!(c&&s)){W._Implementations.loadImageElement(r,t,n);return}const u="blob",y="GET",m=Ht(),w=W._Implementations.loadWithXhr(r,u,y,void 0,void 0,m,void 0,void 0,void 0);return d(w)&&d(w.abort)&&(e.cancelFunction=function(){w.abort()}),m.promise.then(function(b){if(!d(b)){n.reject(new Ie(`Successfully retrieved ${r} but it contained no content.`));return}return W.createImageBitmapFromBlob(b,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i})}).then(function(b){n.resolve(b)})}).catch(function(c){n.reject(c)})};W.createImageBitmapFromBlob=function(e,t){return f.defined("options",t),f.typeOf.bool("options.flipY",t.flipY),f.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),f.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function No(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function Ms(e,t,n,o,i,s,r){let c,u;Promise.all([import("url"),import("zlib")]).then(([y,m])=>(c=y.parse(e),u=m,c.protocol==="https:"?import("https"):import("http"))).then(y=>{const m={protocol:c.protocol,hostname:c.hostname,port:c.port,path:c.path,query:c.query,method:n,headers:i};y.request(m).on("response",function(w){if(w.statusCode<200||w.statusCode>=300){s.reject(new Ft(w.statusCode,w,w.headers));return}const b=[];w.on("data",function(O){b.push(O)}),w.on("end",function(){const O=Buffer.concat(b);w.headers["content-encoding"]==="gzip"?u.gunzip(O,function(R,T){R?s.reject(new Ie("Error decompressing response.")):s.resolve(No(T,t))}):s.resolve(No(O,t))})}).on("error",function(w){s.reject(new Ft)}).end()})}const zs=typeof XMLHttpRequest>"u";W._Implementations.loadWithXhr=function(e,t,n,o,i,s,r){const c=Rs.exec(e);if(c!==null){s.resolve(As(c,t));return}if(zs){Ms(e,t,n,o,i,s);return}const u=new XMLHttpRequest;if(Rt.contains(e)&&(u.withCredentials=!0),u.open(n,e,!0),d(r)&&d(u.overrideMimeType)&&u.overrideMimeType(r),d(i))for(const m in i)i.hasOwnProperty(m)&&u.setRequestHeader(m,i[m]);d(t)&&(u.responseType=t);let y=!1;return typeof e=="string"&&(y=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),u.onload=function(){if((u.status<200||u.status>=300)&&!(y&&u.status===0)){s.reject(new Ft(u.status,u.response,u.getAllResponseHeaders()));return}const m=u.response,w=u.responseType;if(n==="HEAD"||n==="OPTIONS"){const O=u.getAllResponseHeaders().trim().split(/[\r\n]+/),R={};O.forEach(function(T){const z=T.split(": "),D=z.shift();R[D]=z.join(": ")}),s.resolve(R);return}if(u.status===204)s.resolve();else if(d(m)&&(!d(t)||w===t))s.resolve(m);else if(t==="json"&&typeof m=="string")try{s.resolve(JSON.parse(m))}catch(b){s.reject(b)}else(w===""||w==="document")&&d(u.responseXML)&&u.responseXML.hasChildNodes()?s.resolve(u.responseXML):(w===""||w==="text")&&d(u.responseText)?s.resolve(u.responseText):s.reject(new Ie("Invalid XMLHttpRequest response type."))},u.onerror=function(m){s.reject(new Ft)},u.send(o),u};W._Implementations.loadAndExecuteScript=function(e,t,n){return us(e).catch(function(o){n.reject(o)})};W._DefaultImplementations={};W._DefaultImplementations.createImage=W._Implementations.createImage;W._DefaultImplementations.loadWithXhr=W._Implementations.loadWithXhr;W._DefaultImplementations.loadAndExecuteScript=W._Implementations.loadAndExecuteScript;W.DEFAULT=Object.freeze(new W({url:typeof document>"u"?"":document.location.href.split("?")[0]}));const yi=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function js(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const o=e[t].getAttribute("src"),i=yi.exec(o);if(i!==null)return i[1]}}let Kt;function wi(e){return typeof document>"u"?e:(d(Kt)||(Kt=document.createElement("a")),Kt.href=e,Kt.href)}let ot;function gi(){if(d(ot))return ot;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:d(typeof document>"u"?require("url").pathToFileURL(__filename).href:Gt&&Gt.src||new URL("acmi-parser.cjs",document.baseURI).href)?e=$t(".",typeof document>"u"?require("url").pathToFileURL(__filename).href:Gt&&Gt.src||new URL("acmi-parser.cjs",document.baseURI).href):typeof define=="object"&&d(define.amd)&&!define.amd.toUrlUndefined&&d(require.toUrl)?e=$t("..",at("Core/buildModuleUrl.js")):e=js(),!d(e))throw new E("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return ot=new W({url:wi(e)}),ot.appendForwardSlash(),ot}function Ps(e){return wi(require.toUrl(`../${e}`))}function bi(e){return gi().getDerivedResource({url:e}).url}let en;function at(e){return d(en)||(typeof define=="object"&&d(define.amd)&&!define.amd.toUrlUndefined&&d(require.toUrl)?en=Ps:en=bi),en(e)}at._cesiumScriptRegex=yi;at._buildModuleUrlFromBaseUrl=bi;at._clearBaseResource=function(){ot=void 0};at.setBaseUrl=function(e){ot=W.DEFAULT.getDerivedResource({url:e})};at.getCesiumBaseUrl=gi;function Yt(e,t,n){f.defined("array",e),f.defined("itemToFind",t),f.defined("comparator",n);let o=0,i=e.length-1,s,r;for(;o<=i;){if(s=~~((o+i)/2),r=n(e[s],t),r<0){o=s+1;continue}if(r>0){i=s-1;continue}return s}return~(i+1)}function uo(e,t,n,o,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=o,this.ut1MinusUtc=i}function ho(e,t,n,o,i,s,r,c){this.year=e,this.month=t,this.day=n,this.hour=o,this.minute=i,this.second=s,this.millisecond=r,this.isLeapSecond=c}function Do(e){if(e===null||isNaN(e))throw new E("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}function fe(e,t){this.julianDate=e,this.offset=t}const Cs={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},me=Object.freeze(Cs),Is={UTC:0,TAI:1},se=Object.freeze(Is),Oi=new ho,tn=[31,28,31,30,31,30,31,31,30,31,30,31],nn=29;function po(e,t){return F.compare(e.julianDate,t.julianDate)}const St=new fe;function En(e){St.julianDate=e;const t=F.leapSeconds;let n=Yt(t,St,po);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let o=t[n].offset;n>0&&F.secondsDifference(t[n].julianDate,e)>o&&(n--,o=t[n].offset),F.addSeconds(e,o,e)}function xo(e,t){St.julianDate=e;const n=F.leapSeconds;let o=Yt(n,St,po);if(o<0&&(o=~o),o===0)return F.addSeconds(e,-n[0].offset,t);if(o>=n.length)return F.addSeconds(e,-n[o-1].offset,t);const i=F.secondsDifference(n[o].julianDate,e);if(i===0)return F.addSeconds(e,-n[o].offset,t);if(!(i<=1))return F.addSeconds(e,-n[--o].offset,t)}function et(e,t,n){const o=t/me.SECONDS_PER_DAY|0;return e+=o,t-=me.SECONDS_PER_DAY*o,t<0&&(e--,t+=me.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function lo(e,t,n,o,i,s,r){const c=(t-14)/12|0,u=e+4800+c;let y=(1461*u/4|0)+(367*(t-2-12*c)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;o=o-12,o<0&&(o+=24);const m=s+(o*me.SECONDS_PER_HOUR+i*me.SECONDS_PER_MINUTE+r*me.SECONDS_PER_MILLISECOND);return m>=43200&&(y-=1),[y,m]}const qs=/^(\d{4})$/,Us=/^(\d{4})-(\d{2})$/,Ns=/^(\d{4})-?(\d{3})$/,Ds=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,xs=/^(\d{4})-?(\d{2})-?(\d{2})$/,mo=/([Z+\-])?(\d{2})?:?(\d{2})?$/,$s=/^(\d{2})(\.\d+)?/.source+mo.source,Fs=/^(\d{2}):?(\d{2})(\.\d+)?/.source+mo.source,Ls=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+mo.source,Ne="Invalid ISO 8601 date.";function F(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=j(e,0),t=j(t,0),n=j(n,se.UTC);const o=e|0;t=t+(e-o)*me.SECONDS_PER_DAY,et(o,t,this),n===se.UTC&&En(this)}F.fromGregorianDate=function(e,t){if(!(e instanceof ho))throw new E("date must be a valid GregorianDate.");const n=lo(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return d(t)?(et(n[0],n[1],t),En(t),t):new F(n[0],n[1],se.UTC)};F.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new E("date must be a valid JavaScript Date.");const n=lo(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return d(t)?(et(n[0],n[1],t),En(t),t):new F(n[0],n[1],se.UTC)};F.fromIso8601=function(e,t){if(typeof e!="string")throw new E(Ne);e=e.replace(",",".");let n=e.split("T"),o,i=1,s=1,r=0,c=0,u=0,y=0;const m=n[0],w=n[1];let b,O;if(!d(m))throw new E(Ne);let R;if(n=m.match(xs),n!==null){if(R=m.split("-").length-1,R>0&&R!==2)throw new E(Ne);o=+n[1],i=+n[2],s=+n[3]}else if(n=m.match(Us),n!==null)o=+n[1],i=+n[2];else if(n=m.match(qs),n!==null)o=+n[1];else{let q;if(n=m.match(Ns),n!==null){if(o=+n[1],q=+n[2],O=Do(o),q<1||O&&q>366||!O&&q>365)throw new E(Ne)}else if(n=m.match(Ds),n!==null){o=+n[1];const x=+n[2],Y=+n[3]||0;if(R=m.split("-").length-1,R>0&&(!d(n[3])&&R!==1||d(n[3])&&R!==2))throw new E(Ne);const N=new Date(Date.UTC(o,0,4));q=x*7+Y-N.getUTCDay()-3}else throw new E(Ne);b=new Date(Date.UTC(o,0,1)),b.setUTCDate(q),i=b.getUTCMonth()+1,s=b.getUTCDate()}if(O=Do(o),i<1||i>12||s<1||(i!==2||!O)&&s>tn[i-1]||O&&i===2&&s>nn)throw new E(Ne);let T;if(d(w)){if(n=w.match(Ls),n!==null){if(R=w.split(":").length-1,R>0&&R!==2&&R!==3)throw new E(Ne);r=+n[1],c=+n[2],u=+n[3],y=+(n[4]||0)*1e3,T=5}else if(n=w.match(Fs),n!==null){if(R=w.split(":").length-1,R>2)throw new E(Ne);r=+n[1],c=+n[2],u=+(n[3]||0)*60,T=4}else if(n=w.match($s),n!==null)r=+n[1],c=+(n[2]||0)*60,T=3;else throw new E(Ne);if(c>=60||u>=61||r>24||r===24&&(c>0||u>0||y>0))throw new E(Ne);const q=n[T],x=+n[T+1],Y=+(n[T+2]||0);switch(q){case"+":r=r-x,c=c-Y;break;case"-":r=r+x,c=c+Y;break;case"Z":break;default:c=c+new Date(Date.UTC(o,i-1,s,r,c)).getTimezoneOffset();break}}const z=u===60;for(z&&u--;c>=60;)c-=60,r++;for(;r>=24;)r-=24,s++;for(b=O&&i===2?nn:tn[i-1];s>b;)s-=b,i++,i>12&&(i-=12,o++),b=O&&i===2?nn:tn[i-1];for(;c<0;)c+=60,r--;for(;r<0;)r+=24,s--;for(;s<1;)i--,i<1&&(i+=12,o--),b=O&&i===2?nn:tn[i-1],s+=b;const D=lo(o,i,s,r,c,u,y);return d(t)?(et(D[0],D[1],t),En(t)):t=new F(D[0],D[1],se.UTC),z&&F.addSeconds(t,1,t),t};F.now=function(e){return F.fromDate(new Date,e)};const on=new F(0,0,se.TAI);F.toGregorianDate=function(e,t){if(!d(e))throw new E("julianDate is required.");let n=!1,o=xo(e,on);d(o)||(F.addSeconds(e,-1,on),o=xo(on,on),n=!0);let i=o.dayNumber;const s=o.secondsOfDay;s>=43200&&(i+=1);let r=i+68569|0;const c=4*r/146097|0;r=r-((146097*c+3)/4|0)|0;const u=4e3*(r+1)/1461001|0;r=r-(1461*u/4|0)+31|0;const y=80*r/2447|0,m=r-(2447*y/80|0)|0;r=y/11|0;const w=y+2-12*r|0,b=100*(c-49)+u+r|0;let O=s/me.SECONDS_PER_HOUR|0,R=s-O*me.SECONDS_PER_HOUR;const T=R/me.SECONDS_PER_MINUTE|0;R=R-T*me.SECONDS_PER_MINUTE;let z=R|0;const D=(R-z)/me.SECONDS_PER_MILLISECOND;return O+=12,O>23&&(O-=24),n&&(z+=1),d(t)?(t.year=b,t.month=w,t.day=m,t.hour=O,t.minute=T,t.second=z,t.millisecond=D,t.isLeapSecond=n,t):new ho(b,w,m,O,T,z,D,n)};F.toDate=function(e){if(!d(e))throw new E("julianDate is required.");const t=F.toGregorianDate(e,Oi);let n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};F.toIso8601=function(e,t){if(!d(e))throw new E("julianDate is required.");const n=F.toGregorianDate(e,Oi);let o=n.year,i=n.month,s=n.day,r=n.hour;const c=n.minute,u=n.second,y=n.millisecond;o===1e4&&i===1&&s===1&&r===0&&c===0&&u===0&&y===0&&(o=9999,i=12,s=31,r=24);let m;return!d(t)&&y!==0?(m=(y*.01).toString().replace(".",""),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${m}Z`):!d(t)||t===0?`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(m=(y*.01).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${r.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${m}Z`)};F.clone=function(e,t){if(d(e))return d(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new F(e.dayNumber,e.secondsOfDay,se.TAI)};F.compare=function(e,t){if(!d(e))throw new E("left is required.");if(!d(t))throw new E("right is required.");const n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};F.equals=function(e,t){return e===t||d(e)&&d(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};F.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(F.secondsDifference(e,t))<=n};F.totalDays=function(e){if(!d(e))throw new E("julianDate is required.");return e.dayNumber+e.secondsOfDay/me.SECONDS_PER_DAY};F.secondsDifference=function(e,t){if(!d(e))throw new E("left is required.");if(!d(t))throw new E("right is required.");return(e.dayNumber-t.dayNumber)*me.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};F.daysDifference=function(e,t){if(!d(e))throw new E("left is required.");if(!d(t))throw new E("right is required.");const n=e.dayNumber-t.dayNumber,o=(e.secondsOfDay-t.secondsOfDay)/me.SECONDS_PER_DAY;return n+o};F.computeTaiMinusUtc=function(e){St.julianDate=e;const t=F.leapSeconds;let n=Yt(t,St,po);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};F.addSeconds=function(e,t,n){if(!d(e))throw new E("julianDate is required.");if(!d(t))throw new E("seconds is required.");if(!d(n))throw new E("result is required.");return et(e.dayNumber,e.secondsOfDay+t,n)};F.addMinutes=function(e,t,n){if(!d(e))throw new E("julianDate is required.");if(!d(t))throw new E("minutes is required.");if(!d(n))throw new E("result is required.");const o=e.secondsOfDay+t*me.SECONDS_PER_MINUTE;return et(e.dayNumber,o,n)};F.addHours=function(e,t,n){if(!d(e))throw new E("julianDate is required.");if(!d(t))throw new E("hours is required.");if(!d(n))throw new E("result is required.");const o=e.secondsOfDay+t*me.SECONDS_PER_HOUR;return et(e.dayNumber,o,n)};F.addDays=function(e,t,n){if(!d(e))throw new E("julianDate is required.");if(!d(t))throw new E("days is required.");if(!d(n))throw new E("result is required.");const o=e.dayNumber+t;return et(o,e.secondsOfDay,n)};F.lessThan=function(e,t){return F.compare(e,t)<0};F.lessThanOrEquals=function(e,t){return F.compare(e,t)<=0};F.greaterThan=function(e,t){return F.compare(e,t)>0};F.greaterThanOrEquals=function(e,t){return F.compare(e,t)>=0};F.prototype.clone=function(e){return F.clone(this,e)};F.prototype.equals=function(e){return F.equals(this,e)};F.prototype.equalsEpsilon=function(e,t){return F.equalsEpsilon(this,e,t)};F.prototype.toString=function(){return F.toIso8601(this)};F.leapSeconds=[new fe(new F(2441317,43210,se.TAI),10),new fe(new F(2441499,43211,se.TAI),11),new fe(new F(2441683,43212,se.TAI),12),new fe(new F(2442048,43213,se.TAI),13),new fe(new F(2442413,43214,se.TAI),14),new fe(new F(2442778,43215,se.TAI),15),new fe(new F(2443144,43216,se.TAI),16),new fe(new F(2443509,43217,se.TAI),17),new fe(new F(2443874,43218,se.TAI),18),new fe(new F(2444239,43219,se.TAI),19),new fe(new F(2444786,43220,se.TAI),20),new fe(new F(2445151,43221,se.TAI),21),new fe(new F(2445516,43222,se.TAI),22),new fe(new F(2446247,43223,se.TAI),23),new fe(new F(2447161,43224,se.TAI),24),new fe(new F(2447892,43225,se.TAI),25),new fe(new F(2448257,43226,se.TAI),26),new fe(new F(2448804,43227,se.TAI),27),new fe(new F(2449169,43228,se.TAI),28),new fe(new F(2449534,43229,se.TAI),29),new fe(new F(2450083,43230,se.TAI),30),new fe(new F(2450630,43231,se.TAI),31),new fe(new F(2451179,43232,se.TAI),32),new fe(new F(2453736,43233,se.TAI),33),new fe(new F(2454832,43234,se.TAI),34),new fe(new F(2456109,43235,se.TAI),35),new fe(new F(2457204,43236,se.TAI),36),new fe(new F(2457754,43237,se.TAI),37)];function Lt(e){e=j(e,j.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=j(e.addNewLeapSeconds,!0),d(e.data)?$o(this,e.data):$o(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Lt.fromUrl=async function(e,t){f.defined("url",e),t=j(t,j.EMPTY_OBJECT);const n=W.createIfNeeded(e);let o;try{o=await n.fetchJson()}catch{throw new Ie(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Lt({addNewLeapSeconds:t.addNewLeapSeconds,data:o})};Lt.NONE=Object.freeze({compute:function(e,t){return d(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new uo(0,0,0,0,0),t}});Lt.prototype.compute=function(e,t){if(!d(this._samples))return;if(d(t)||(t=new uo(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,o=this._lastIndex;let i=0,s=0;if(d(o)){const c=n[o],u=n[o+1],y=F.lessThanOrEquals(c,e),m=!d(u),w=m||F.greaterThanOrEquals(u,e);if(y&&w)return i=o,!m&&u.equals(e)&&++i,s=i+1,Lo(this,n,this._samples,e,i,s,t),t}let r=Yt(n,e,F.compare,this._dateColumn);return r>=0?(r<n.length-1&&n[r+1].equals(e)&&++r,i=r,s=r):(s=~r,i=s-1,i<0&&(i=0)),this._lastIndex=i,Lo(this,n,this._samples,e,i,s,t),t};function ks(e,t){return F.compare(e.julianDate,t)}function $o(e,t){if(!d(t.columnNames))throw new Ie("Error in loaded EOP data: The columnNames property is required.");if(!d(t.samples))throw new Ie("Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),r=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||s<0||r<0||c<0||u<0)throw new Ie("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const y=e._samples=t.samples,m=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=r,e._yCelestialPoleOffsetRadiansColumn=c,e._taiMinusUtcSecondsColumn=u,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let w;const b=e._addNewLeapSeconds;for(let O=0,R=y.length;O<R;O+=e._columnCount){const T=y[O+n],z=y[O+u],D=T+me.MODIFIED_JULIAN_DATE_DIFFERENCE,q=new F(D,z,se.TAI);if(m.push(q),b){if(z!==w&&d(w)){const x=F.leapSeconds,Y=Yt(x,q,ks);if(Y<0){const N=new fe(q,z);x.splice(~Y,0,N)}}w=z}}}function Fo(e,t,n,o,i){const s=n*o;i.xPoleWander=t[s+e._xPoleWanderRadiansColumn],i.yPoleWander=t[s+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[s+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[s+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[s+e._ut1MinusUtcSecondsColumn]}function zt(e,t,n){return t+e*(n-t)}function Lo(e,t,n,o,i,s,r){const c=e._columnCount;if(s>t.length-1)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;const u=t[i],y=t[s];if(u.equals(y)||o.equals(u))return Fo(e,n,i,c,r),r;if(o.equals(y))return Fo(e,n,s,c,r),r;const m=F.secondsDifference(o,u)/F.secondsDifference(y,u),w=i*c,b=s*c;let O=n[w+e._ut1MinusUtcSecondsColumn],R=n[b+e._ut1MinusUtcSecondsColumn];const T=R-O;if(T>.5||T<-.5){const z=n[w+e._taiMinusUtcSecondsColumn],D=n[b+e._taiMinusUtcSecondsColumn];z!==D&&(y.equals(o)?O=R:R-=D-z)}return r.xPoleWander=zt(m,n[w+e._xPoleWanderRadiansColumn],n[b+e._xPoleWanderRadiansColumn]),r.yPoleWander=zt(m,n[w+e._yPoleWanderRadiansColumn],n[b+e._yPoleWanderRadiansColumn]),r.xPoleOffset=zt(m,n[w+e._xCelestialPoleOffsetRadiansColumn],n[b+e._xCelestialPoleOffsetRadiansColumn]),r.yPoleOffset=zt(m,n[w+e._yCelestialPoleOffsetRadiansColumn],n[b+e._yCelestialPoleOffsetRadiansColumn]),r.ut1MinusUtc=zt(m,O,R),r}function be(e,t,n){this.heading=j(e,0),this.pitch=j(t,0),this.roll=j(n,0)}be.fromQuaternion=function(e,t){if(!d(e))throw new E("quaternion is required");d(t)||(t=new be);const n=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),i=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),r=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(r,s),t.roll=Math.atan2(i,o),t.pitch=-S.asinClamped(n),t};be.fromDegrees=function(e,t,n,o){if(!d(e))throw new E("heading is required");if(!d(t))throw new E("pitch is required");if(!d(n))throw new E("roll is required");return d(o)||(o=new be),o.heading=e*S.RADIANS_PER_DEGREE,o.pitch=t*S.RADIANS_PER_DEGREE,o.roll=n*S.RADIANS_PER_DEGREE,o};be.clone=function(e,t){if(d(e))return d(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new be(e.heading,e.pitch,e.roll)};be.equals=function(e,t){return e===t||d(e)&&d(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};be.equalsEpsilon=function(e,t,n,o){return e===t||d(e)&&d(t)&&S.equalsEpsilon(e.heading,t.heading,n,o)&&S.equalsEpsilon(e.pitch,t.pitch,n,o)&&S.equalsEpsilon(e.roll,t.roll,n,o)};be.prototype.clone=function(e){return be.clone(this,e)};be.prototype.equals=function(e){return be.equals(this,e)};be.prototype.equalsEpsilon=function(e,t,n){return be.equalsEpsilon(this,e,t,n)};be.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};function _i(e,t,n){this.x=e,this.y=t,this.s=n}function yo(e){e=j(e,j.EMPTY_OBJECT),this._xysFileUrlTemplate=W.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=j(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=j(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new F(this._sampleZeroJulianEphemerisDate,0,se.TAI),this._stepSizeDays=j(e.stepSizeDays,1),this._samplesPerXysFile=j(e.samplesPerXysFile,1e3),this._totalSamples=j(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),o=this._xTable=new Array(t+1),i=Math.pow(this._stepSizeDays,t);for(let s=0;s<=t;++s){n[s]=i,o[s]=s*this._stepSizeDays;for(let r=0;r<=t;++r)r!==s&&(n[s]*=s-r);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}const Bs=new F(0,0,se.TAI);function Kn(e,t,n){const o=Bs;return o.dayNumber=t,o.secondsOfDay=n,F.daysDifference(o,e._sampleZeroDateTT)}yo.prototype.preload=function(e,t,n,o){const i=Kn(this,e,t),s=Kn(this,n,o);let r=i/this._stepSizeDays-this._interpolationOrder/2|0;r<0&&(r=0);let c=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);const u=r/this._samplesPerXysFile|0,y=c/this._samplesPerXysFile|0,m=[];for(let w=u;w<=y;++w)m.push(eo(this,w));return Promise.all(m)};yo.prototype.computeXysRadians=function(e,t,n){const o=Kn(this,e,t);if(o<0)return;const i=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;const s=this._interpolationOrder;let r=i-(s/2|0);r<0&&(r=0);let c=r+s;c>=this._totalSamples&&(c=this._totalSamples-1,r=c-s,r<0&&(r=0));let u=!1;const y=this._samples;if(d(y[r*3])||(eo(this,r/this._samplesPerXysFile|0),u=!0),d(y[c*3])||(eo(this,c/this._samplesPerXysFile|0),u=!0),u)return;d(n)?(n.x=0,n.y=0,n.s=0):n=new _i(0,0,0);const m=o-r*this._stepSizeDays,w=this._work,b=this._denominators,O=this._coef,R=this._xTable;let T,z;for(T=0;T<=s;++T)w[T]=m-R[T];for(T=0;T<=s;++T){for(O[T]=1,z=0;z<=s;++z)z!==T&&(O[T]*=w[z]);O[T]*=b[T];let D=(r+T)*3;n.x+=O[T]*y[D++],n.y+=O[T]*y[D++],n.s+=O[T]*y[D]}return n};function eo(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const o=e._xysFileUrlTemplate;d(o)?n=o.getDerivedResource({templateValues:{0:t}}):n=new W({url:at(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const i=n.fetchJson().then(function(s){e._chunkDownloadsInProgress[t]=!1;const r=e._samples,c=s.samples,u=t*e._samplesPerXysFile*3;for(let y=0,m=c.length;y<m;++y)r[u+y]=c[y]});return e._chunkDownloadsInProgress[t]=i,i}let Ye;const we={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Ce={};Object.defineProperties(Ce,{element:{get:function(){if(Ce.supportsFullscreen())return document[we.fullscreenElement]}},changeEventName:{get:function(){if(Ce.supportsFullscreen())return we.fullscreenchange}},errorEventName:{get:function(){if(Ce.supportsFullscreen())return we.fullscreenerror}},enabled:{get:function(){if(Ce.supportsFullscreen())return document[we.fullscreenEnabled]}},fullscreen:{get:function(){if(Ce.supportsFullscreen())return Ce.element!==null}}});Ce.supportsFullscreen=function(){if(d(Ye))return Ye;Ye=!1;const e=document.body;if(typeof e.requestFullscreen=="function")return we.requestFullscreen="requestFullscreen",we.exitFullscreen="exitFullscreen",we.fullscreenEnabled="fullscreenEnabled",we.fullscreenElement="fullscreenElement",we.fullscreenchange="fullscreenchange",we.fullscreenerror="fullscreenerror",Ye=!0,Ye;const t=["webkit","moz","o","ms","khtml"];let n;for(let o=0,i=t.length;o<i;++o){const s=t[o];n=`${s}RequestFullscreen`,typeof e[n]=="function"?(we.requestFullscreen=n,Ye=!0):(n=`${s}RequestFullScreen`,typeof e[n]=="function"&&(we.requestFullscreen=n,Ye=!0)),n=`${s}ExitFullscreen`,typeof document[n]=="function"?we.exitFullscreen=n:(n=`${s}CancelFullScreen`,typeof document[n]=="function"&&(we.exitFullscreen=n)),n=`${s}FullscreenEnabled`,document[n]!==void 0?we.fullscreenEnabled=n:(n=`${s}FullScreenEnabled`,document[n]!==void 0&&(we.fullscreenEnabled=n)),n=`${s}FullscreenElement`,document[n]!==void 0?we.fullscreenElement=n:(n=`${s}FullScreenElement`,document[n]!==void 0&&(we.fullscreenElement=n)),n=`${s}fullscreenchange`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenChange"),we.fullscreenchange=n),n=`${s}fullscreenerror`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenError"),we.fullscreenerror=n)}return Ye};Ce.requestFullscreen=function(e,t){Ce.supportsFullscreen()&&e[we.requestFullscreen]({vrDisplay:t})};Ce.exitFullscreen=function(){Ce.supportsFullscreen()&&document[we.exitFullscreen]()};Ce._names=we;let Ae;typeof navigator<"u"?Ae=navigator:Ae={};function st(e){const t=e.split(".");for(let n=0,o=t.length;n<o;++n)t[n]=parseInt(t[n],10);return t}let rn,Si;function wo(){if(!d(rn)&&(rn=!1,!Tn())){const e=/ Chrome\/([\.0-9]+)/.exec(Ae.userAgent);e!==null&&(rn=!0,Si=st(e[1]))}return rn}function Ws(){return wo()&&Si}let sn,vi;function Ei(){if(!d(sn)&&(sn=!1,!wo()&&!Tn()&&/ Safari\/[\.0-9]+/.test(Ae.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Ae.userAgent);e!==null&&(sn=!0,vi=st(e[1]))}return sn}function Hs(){return Ei()&&vi}let cn,to;function Ti(){if(!d(cn)){cn=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ae.userAgent);e!==null&&(cn=!0,to=st(e[1]),to.isNightly=!!e[2])}return cn}function Qs(){return Ti()&&to}let jt,no;function Ri(){if(!d(jt)){jt=!1;let e;Ae.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Ae.userAgent),e!==null&&(jt=!0,no=st(e[1]))):Ae.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Ae.userAgent),e!==null&&(jt=!0,no=st(e[1])))}return jt}function Ys(){return Ri()&&no}let an,Ai;function Tn(){if(!d(an)){an=!1;const e=/ Edg\/([\.0-9]+)/.exec(Ae.userAgent);e!==null&&(an=!0,Ai=st(e[1]))}return an}function Vs(){return Tn()&&Ai}let fn,go;function Rn(){if(!d(fn)){fn=!1;const e=/Firefox\/([\.0-9]+)/.exec(Ae.userAgent);e!==null&&(fn=!0,go=st(e[1]))}return fn}let qn;function Gs(){return d(qn)||(qn=/Windows/i.test(Ae.appVersion)),qn}let Un;function Zs(){return d(Un)||(Un=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Un}function Xs(){return Rn()&&go}let Nn;function Js(){return d(Nn)||(Nn=!Rn()&&typeof PointerEvent<"u"&&(!d(Ae.pointerEnabled)||Ae.pointerEnabled)),Nn}let Mi,un;function zi(){if(!d(un)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;un=d(t)&&t!=="",un&&(Mi=t)}return un}function Ks(){return zi()?Mi:void 0}function Ee(){if(!Ee.initialized)throw new E("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return Ee._result}Ee._promise=void 0;Ee._result=void 0;Ee.initialize=function(){return d(Ee._promise)||(Ee._promise=new Promise(e=>{const t=new Image;t.onload=function(){Ee._result=t.width>0&&t.height>0,e(Ee._result)},t.onerror=function(){Ee._result=!1,e(Ee._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Ee._promise};Object.defineProperties(Ee,{initialized:{get:function(){return d(Ee._result)}}});const wt=[];typeof ArrayBuffer<"u"&&(wt.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&wt.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&wt.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&wt.push(BigInt64Array),typeof BigUint64Array<"u"&&wt.push(BigUint64Array));const ze={isChrome:wo,chromeVersion:Ws,isSafari:Ei,safariVersion:Hs,isWebkit:Ti,webkitVersion:Qs,isInternetExplorer:Ri,internetExplorerVersion:Ys,isEdge:Tn,edgeVersion:Vs,isFirefox:Rn,firefoxVersion:Xs,isWindows:Gs,isIPadOrIOS:Zs,hardwareConcurrency:j(Ae.hardwareConcurrency,3),supportsPointerEvents:Js,supportsImageRenderingPixelated:zi,supportsWebP:Ee,imageRenderingValue:Ks,typedArrayTypes:wt};ze.supportsBasis=function(e){return ze.supportsWebAssembly()&&e.context.supportsBasis};ze.supportsFullscreen=function(){return Ce.supportsFullscreen()};ze.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};ze.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};ze.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};ze.supportsBigInt=function(){return typeof BigInt<"u"};ze.supportsWebWorkers=function(){return typeof Worker<"u"};ze.supportsWebAssembly=function(){return typeof WebAssembly<"u"};ze.supportsWebgl2=function(e){return f.defined("scene",e),e.context.webgl2};ze.supportsEsmWebWorkers=function(){return!Rn()||parseInt(go)>=114};function I(e,t,n,o){this.x=j(e,0),this.y=j(t,0),this.z=j(n,0),this.w=j(o,0)}let Pt=new p;I.fromAxisAngle=function(e,t,n){f.typeOf.object("axis",e),f.typeOf.number("angle",t);const o=t/2,i=Math.sin(o);Pt=p.normalize(e,Pt);const s=Pt.x*i,r=Pt.y*i,c=Pt.z*i,u=Math.cos(o);return d(n)?(n.x=s,n.y=r,n.z=c,n.w=u,n):new I(s,r,c,u)};const ec=[1,2,0],tc=new Array(3);I.fromRotationMatrix=function(e,t){f.typeOf.object("matrix",e);let n,o,i,s,r;const c=e[M.COLUMN0ROW0],u=e[M.COLUMN1ROW1],y=e[M.COLUMN2ROW2],m=c+u+y;if(m>0)n=Math.sqrt(m+1),r=.5*n,n=.5/n,o=(e[M.COLUMN1ROW2]-e[M.COLUMN2ROW1])*n,i=(e[M.COLUMN2ROW0]-e[M.COLUMN0ROW2])*n,s=(e[M.COLUMN0ROW1]-e[M.COLUMN1ROW0])*n;else{const w=ec;let b=0;u>c&&(b=1),y>c&&y>u&&(b=2);const O=w[b],R=w[O];n=Math.sqrt(e[M.getElementIndex(b,b)]-e[M.getElementIndex(O,O)]-e[M.getElementIndex(R,R)]+1);const T=tc;T[b]=.5*n,n=.5/n,r=(e[M.getElementIndex(R,O)]-e[M.getElementIndex(O,R)])*n,T[O]=(e[M.getElementIndex(O,b)]+e[M.getElementIndex(b,O)])*n,T[R]=(e[M.getElementIndex(R,b)]+e[M.getElementIndex(b,R)])*n,o=-T[0],i=-T[1],s=-T[2]}return d(t)?(t.x=o,t.y=i,t.z=s,t.w=r,t):new I(o,i,s,r)};const ko=new I;let Bo=new I,Dn=new I,Wo=new I;I.fromHeadingPitchRoll=function(e,t){return f.typeOf.object("headingPitchRoll",e),Wo=I.fromAxisAngle(p.UNIT_X,e.roll,ko),Dn=I.fromAxisAngle(p.UNIT_Y,-e.pitch,t),t=I.multiply(Dn,Wo,Dn),Bo=I.fromAxisAngle(p.UNIT_Z,-e.heading,ko),I.multiply(Bo,t,t)};const hn=new p,xn=new p,De=new I,Ho=new I,dn=new I;I.packedLength=4;I.pack=function(e,t,n){return f.typeOf.object("value",e),f.defined("array",t),n=j(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};I.unpack=function(e,t,n){return f.defined("array",e),t=j(t,0),d(n)||(n=new I),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};I.packedInterpolationLength=3;I.convertPackedArrayForInterpolation=function(e,t,n,o){I.unpack(e,n*4,dn),I.conjugate(dn,dn);for(let i=0,s=n-t+1;i<s;i++){const r=i*3;I.unpack(e,(t+i)*4,De),I.multiply(De,dn,De),De.w<0&&I.negate(De,De),I.computeAxis(De,hn);const c=I.computeAngle(De);d(o)||(o=[]),o[r]=hn.x*c,o[r+1]=hn.y*c,o[r+2]=hn.z*c}};I.unpackInterpolationResult=function(e,t,n,o,i){d(i)||(i=new I),p.fromArray(e,0,xn);const s=p.magnitude(xn);return I.unpack(t,o*4,Ho),s===0?I.clone(I.IDENTITY,De):I.fromAxisAngle(xn,s,De),I.multiply(De,Ho,i)};I.clone=function(e,t){if(d(e))return d(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new I(e.x,e.y,e.z,e.w)};I.conjugate=function(e,t){return f.typeOf.object("quaternion",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};I.magnitudeSquared=function(e){return f.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};I.magnitude=function(e){return Math.sqrt(I.magnitudeSquared(e))};I.normalize=function(e,t){f.typeOf.object("result",t);const n=1/I.magnitude(e),o=e.x*n,i=e.y*n,s=e.z*n,r=e.w*n;return t.x=o,t.y=i,t.z=s,t.w=r,t};I.inverse=function(e,t){f.typeOf.object("result",t);const n=I.magnitudeSquared(e);return t=I.conjugate(e,t),I.multiplyByScalar(t,1/n,t)};I.add=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};I.subtract=function(e,t,n){return f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};I.negate=function(e,t){return f.typeOf.object("quaternion",e),f.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};I.dot=function(e,t){return f.typeOf.object("left",e),f.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};I.multiply=function(e,t,n){f.typeOf.object("left",e),f.typeOf.object("right",t),f.typeOf.object("result",n);const o=e.x,i=e.y,s=e.z,r=e.w,c=t.x,u=t.y,y=t.z,m=t.w,w=r*c+o*m+i*y-s*u,b=r*u-o*y+i*m+s*c,O=r*y+o*u-i*c+s*m,R=r*m-o*c-i*u-s*y;return n.x=w,n.y=b,n.z=O,n.w=R,n};I.multiplyByScalar=function(e,t,n){return f.typeOf.object("quaternion",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};I.divideByScalar=function(e,t,n){return f.typeOf.object("quaternion",e),f.typeOf.number("scalar",t),f.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};I.computeAxis=function(e,t){f.typeOf.object("quaternion",e),f.typeOf.object("result",t);const n=e.w;if(Math.abs(n-1)<S.EPSILON6||Math.abs(n+1)<S.EPSILON6)return t.x=1,t.y=t.z=0,t;const o=1/Math.sqrt(1-n*n);return t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t};I.computeAngle=function(e){return f.typeOf.object("quaternion",e),Math.abs(e.w-1)<S.EPSILON6?0:2*Math.acos(e.w)};let $n=new I;I.lerp=function(e,t,n,o){return f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o),$n=I.multiplyByScalar(t,n,$n),o=I.multiplyByScalar(e,1-n,o),I.add($n,o,o)};let Qo=new I,Fn=new I,Ln=new I;I.slerp=function(e,t,n,o){f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o);let i=I.dot(e,t),s=t;if(i<0&&(i=-i,s=Qo=I.negate(t,Qo)),1-i<S.EPSILON6)return I.lerp(e,s,n,o);const r=Math.acos(i);return Fn=I.multiplyByScalar(e,Math.sin((1-n)*r),Fn),Ln=I.multiplyByScalar(s,Math.sin(n*r),Ln),o=I.add(Fn,Ln,o),I.multiplyByScalar(o,1/Math.sin(r),o)};I.log=function(e,t){f.typeOf.object("quaternion",e),f.typeOf.object("result",t);const n=S.acosClamped(e.w);let o=0;return n!==0&&(o=n/Math.sin(n)),p.multiplyByScalar(e,o,t)};I.exp=function(e,t){f.typeOf.object("cartesian",e),f.typeOf.object("result",t);const n=p.magnitude(e);let o=0;return n!==0&&(o=Math.sin(n)/n),t.x=e.x*o,t.y=e.y*o,t.z=e.z*o,t.w=Math.cos(n),t};const nc=new p,oc=new p,It=new I,gt=new I;I.computeInnerQuadrangle=function(e,t,n,o){f.typeOf.object("q0",e),f.typeOf.object("q1",t),f.typeOf.object("q2",n),f.typeOf.object("result",o);const i=I.conjugate(t,It);I.multiply(i,n,gt);const s=I.log(gt,nc);I.multiply(i,e,gt);const r=I.log(gt,oc);return p.add(s,r,s),p.multiplyByScalar(s,.25,s),p.negate(s,s),I.exp(s,It),I.multiply(t,It,o)};I.squad=function(e,t,n,o,i,s){f.typeOf.object("q0",e),f.typeOf.object("q1",t),f.typeOf.object("s0",n),f.typeOf.object("s1",o),f.typeOf.number("t",i),f.typeOf.object("result",s);const r=I.slerp(e,t,i,It),c=I.slerp(n,o,i,gt);return I.slerp(r,c,2*i*(1-i),s)};const ic=new I,ji=1.9011074535173003,_n=ze.supportsTypedArrays()?new Float32Array(8):[],Sn=ze.supportsTypedArrays()?new Float32Array(8):[],ke=ze.supportsTypedArrays()?new Float32Array(8):[],Be=ze.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;_n[e]=1/(t*n),Sn[e]=t/n}_n[7]=ji/(8*17);Sn[7]=ji*8/17;I.fastSlerp=function(e,t,n,o){f.typeOf.object("start",e),f.typeOf.object("end",t),f.typeOf.number("t",n),f.typeOf.object("result",o);let i=I.dot(e,t),s;i>=0?s=1:(s=-1,i=-i);const r=i-1,c=1-n,u=n*n,y=c*c;for(let O=7;O>=0;--O)ke[O]=(_n[O]*u-Sn[O])*r,Be[O]=(_n[O]*y-Sn[O])*r;const m=s*n*(1+ke[0]*(1+ke[1]*(1+ke[2]*(1+ke[3]*(1+ke[4]*(1+ke[5]*(1+ke[6]*(1+ke[7])))))))),w=c*(1+Be[0]*(1+Be[1]*(1+Be[2]*(1+Be[3]*(1+Be[4]*(1+Be[5]*(1+Be[6]*(1+Be[7])))))))),b=I.multiplyByScalar(e,w,ic);return I.multiplyByScalar(t,m,o),I.add(b,o,o)};I.fastSquad=function(e,t,n,o,i,s){f.typeOf.object("q0",e),f.typeOf.object("q1",t),f.typeOf.object("s0",n),f.typeOf.object("s1",o),f.typeOf.number("t",i),f.typeOf.object("result",s);const r=I.fastSlerp(e,t,i,It),c=I.fastSlerp(n,o,i,gt);return I.fastSlerp(r,c,2*i*(1-i),s)};I.equals=function(e,t){return e===t||d(e)&&d(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};I.equalsEpsilon=function(e,t,n){return n=j(n,0),e===t||d(e)&&d(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};I.ZERO=Object.freeze(new I(0,0,0,0));I.IDENTITY=Object.freeze(new I(0,0,0,1));I.prototype.clone=function(e){return I.clone(this,e)};I.prototype.equals=function(e){return I.equals(this,e)};I.prototype.equalsEpsilon=function(e,t){return I.equalsEpsilon(this,e,t)};I.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const re={},kn={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"}},lt={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Bn={},Pe={east:new p,north:new p,up:new p,west:new p,south:new p,down:new p};let Ve=new p,Ge=new p,Ze=new p;re.localFrameToFixedFrameGenerator=function(e,t){if(!kn.hasOwnProperty(e)||!kn[e].hasOwnProperty(t))throw new E("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=kn[e][t];let o;const i=e+t;return d(Bn[i])?o=Bn[i]:(o=function(s,r,c){if(!d(s))throw new E("origin is required.");if(d(c)||(c=new A),p.equalsEpsilon(s,p.ZERO,S.EPSILON14))p.unpack(lt[e],0,Ve),p.unpack(lt[t],0,Ge),p.unpack(lt[n],0,Ze);else if(S.equalsEpsilon(s.x,0,S.EPSILON14)&&S.equalsEpsilon(s.y,0,S.EPSILON14)){const u=S.sign(s.z);p.unpack(lt[e],0,Ve),e!=="east"&&e!=="west"&&p.multiplyByScalar(Ve,u,Ve),p.unpack(lt[t],0,Ge),t!=="east"&&t!=="west"&&p.multiplyByScalar(Ge,u,Ge),p.unpack(lt[n],0,Ze),n!=="east"&&n!=="west"&&p.multiplyByScalar(Ze,u,Ze)}else{r=j(r,oe.WGS84),r.geodeticSurfaceNormal(s,Pe.up);const u=Pe.up,y=Pe.east;y.x=-s.y,y.y=s.x,y.z=0,p.normalize(y,Pe.east),p.cross(u,y,Pe.north),p.multiplyByScalar(Pe.up,-1,Pe.down),p.multiplyByScalar(Pe.east,-1,Pe.west),p.multiplyByScalar(Pe.north,-1,Pe.south),Ve=Pe[e],Ge=Pe[t],Ze=Pe[n]}return c[0]=Ve.x,c[1]=Ve.y,c[2]=Ve.z,c[3]=0,c[4]=Ge.x,c[5]=Ge.y,c[6]=Ge.z,c[7]=0,c[8]=Ze.x,c[9]=Ze.y,c[10]=Ze.z,c[11]=0,c[12]=s.x,c[13]=s.y,c[14]=s.z,c[15]=1,c},Bn[i]=o),o};re.eastNorthUpToFixedFrame=re.localFrameToFixedFrameGenerator("east","north");re.northEastDownToFixedFrame=re.localFrameToFixedFrameGenerator("north","east");re.northUpEastToFixedFrame=re.localFrameToFixedFrameGenerator("north","up");re.northWestUpToFixedFrame=re.localFrameToFixedFrameGenerator("north","west");const rc=new I,sc=new p(1,1,1),cc=new A;re.headingPitchRollToFixedFrame=function(e,t,n,o,i){f.typeOf.object("HeadingPitchRoll",t),o=j(o,re.eastNorthUpToFixedFrame);const s=I.fromHeadingPitchRoll(t,rc),r=A.fromTranslationQuaternionRotationScale(p.ZERO,s,sc,cc);return i=o(e,n,i),A.multiply(i,r,i)};const ac=new A,fc=new M;re.headingPitchRollQuaternion=function(e,t,n,o,i){f.typeOf.object("HeadingPitchRoll",t);const s=re.headingPitchRollToFixedFrame(e,t,n,o,ac),r=A.getMatrix3(s,fc);return I.fromRotationMatrix(r,i)};const uc=new p(1,1,1),hc=new p,Yo=new A,dc=new A,pc=new M,lc=new I;re.fixedFrameToHeadingPitchRoll=function(e,t,n,o){f.defined("transform",e),t=j(t,oe.WGS84),n=j(n,re.eastNorthUpToFixedFrame),d(o)||(o=new be);const i=A.getTranslation(e,hc);if(p.equals(i,p.ZERO))return o.heading=0,o.pitch=0,o.roll=0,o;let s=A.inverseTransformation(n(i,t,Yo),Yo),r=A.setScale(e,uc,dc);r=A.setTranslation(r,p.ZERO,r),s=A.multiply(s,r,s);let c=I.fromRotationMatrix(A.getMatrix3(s,pc),lc);return c=I.normalize(c,c),be.fromQuaternion(c,o)};const mc=6*3600+41*60+50.54841,yc=8640184812866e-6,wc=.093104,gc=-62e-7,bc=11772758384668e-32,Oc=72921158553e-15,_c=S.TWO_PI/86400;let pn=new F;re.computeTemeToPseudoFixedMatrix=function(e,t){if(!d(e))throw new E("date is required.");pn=F.addSeconds(e,-F.computeTaiMinusUtc(e),pn);const n=pn.dayNumber,o=pn.secondsOfDay;let i;const s=n-2451545;o>=43200?i=(s+.5)/me.DAYS_PER_JULIAN_CENTURY:i=(s-.5)/me.DAYS_PER_JULIAN_CENTURY;const c=(mc+i*(yc+i*(wc+i*gc)))*_c%S.TWO_PI,u=Oc+bc*(n-24515455e-1),y=(o+me.SECONDS_PER_DAY*.5)%me.SECONDS_PER_DAY,m=c+u*y,w=Math.cos(m),b=Math.sin(m);return d(t)?(t[0]=w,t[1]=-b,t[2]=0,t[3]=b,t[4]=w,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new M(w,b,0,-b,w,0,0,0,1)};re.iau2006XysData=new yo;re.earthOrientationParameters=Lt.NONE;const oo=32.184,Sc=2451545;re.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+oo,o=e.stop.dayNumber,i=e.stop.secondsOfDay+oo;return re.iau2006XysData.preload(t,n,o,i)};re.computeIcrfToFixedMatrix=function(e,t){if(!d(e))throw new E("date is required.");d(t)||(t=new M);const n=re.computeFixedToIcrfMatrix(e,t);if(d(n))return M.transpose(n,t)};const vc=new _i(0,0,0),Ec=new uo(0,0,0,0,0),Wn=new M,Hn=new M;re.computeFixedToIcrfMatrix=function(e,t){if(!d(e))throw new E("date is required.");d(t)||(t=new M);const n=re.earthOrientationParameters.compute(e,Ec);if(!d(n))return;const o=e.dayNumber,i=e.secondsOfDay+oo,s=re.iau2006XysData.computeXysRadians(o,i,vc);if(!d(s))return;const r=s.x+n.xPoleOffset,c=s.y+n.yPoleOffset,u=1/(1+Math.sqrt(1-r*r-c*c)),y=Wn;y[0]=1-u*r*r,y[3]=-u*r*c,y[6]=r,y[1]=-u*r*c,y[4]=1-u*c*c,y[7]=c,y[2]=-r,y[5]=-c,y[8]=1-u*(r*r+c*c);const m=M.fromRotationZ(-s.s,Hn),w=M.multiply(y,m,Wn),b=e.dayNumber,O=e.secondsOfDay-F.computeTaiMinusUtc(e)+n.ut1MinusUtc,R=b-2451545,T=O/me.SECONDS_PER_DAY;let z=.779057273264+T+.00273781191135448*(R+T);z=z%1*S.TWO_PI;const D=M.fromRotationZ(z,Hn),q=M.multiply(w,D,Wn),x=Math.cos(n.xPoleWander),Y=Math.cos(n.yPoleWander),N=Math.sin(n.xPoleWander),H=Math.sin(n.yPoleWander);let B=o-Sc+i/me.SECONDS_PER_DAY;B/=36525;const U=-47e-6*B*S.RADIANS_PER_DEGREE/3600,G=Math.cos(U),V=Math.sin(U),k=Hn;return k[0]=x*G,k[1]=x*V,k[2]=N,k[3]=-Y*V+H*N*G,k[4]=Y*G+H*N*V,k[5]=-H*x,k[6]=-H*V-Y*N*G,k[7]=H*G-Y*N*V,k[8]=Y*x,M.multiply(q,k,t)};const Tc=new L;re.pointToWindowCoordinates=function(e,t,n,o){return o=re.pointToGLWindowCoordinates(e,t,n,o),o.y=2*t[5]-o.y,o};re.pointToGLWindowCoordinates=function(e,t,n,o){if(!d(e))throw new E("modelViewProjectionMatrix is required.");if(!d(t))throw new E("viewportTransformation is required.");if(!d(n))throw new E("point is required.");d(o)||(o=new Q);const i=Tc;return A.multiplyByVector(e,L.fromElements(n.x,n.y,n.z,1,i),i),L.multiplyByScalar(i,1/i.w,i),A.multiplyByVector(t,i,i),Q.fromCartesian4(i,o)};const Rc=new p,Ac=new p,Mc=new p;re.rotationMatrixFromPositionVelocity=function(e,t,n,o){if(!d(e))throw new E("position is required.");if(!d(t))throw new E("velocity is required.");const i=j(n,oe.WGS84).geodeticSurfaceNormal(e,Rc);let s=p.cross(t,i,Ac);p.equalsEpsilon(s,p.ZERO,S.EPSILON6)&&(s=p.clone(p.UNIT_X,s));const r=p.cross(s,t,Mc);return p.normalize(r,r),p.cross(t,r,s),p.negate(s,s),p.normalize(s,s),d(o)||(o=new M),o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=s.x,o[4]=s.y,o[5]=s.z,o[6]=r.x,o[7]=r.y,o[8]=r.z,o};const Pi=new A(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Ci=new le,Ii=new p,zc=new p,jc=new M,io=new A,qi=new A;re.basisTo2D=function(e,t,n){if(!d(e))throw new E("projection is required.");if(!d(t))throw new E("matrix is required.");if(!d(n))throw new E("result is required.");const o=A.getTranslation(t,zc),i=e.ellipsoid,s=i.cartesianToCartographic(o,Ci),r=e.project(s,Ii);p.fromElements(r.z,r.x,r.y,r);const c=re.eastNorthUpToFixedFrame(o,i,io),u=A.inverseTransformation(c,qi),y=A.getMatrix3(t,jc),m=A.multiplyByMatrix3(u,y,n);return A.multiply(Pi,m,n),A.setTranslation(n,r,n),n};re.wgs84To2DModelMatrix=function(e,t,n){if(!d(e))throw new E("projection is required.");if(!d(t))throw new E("center is required.");if(!d(n))throw new E("result is required.");const o=e.ellipsoid,i=re.eastNorthUpToFixedFrame(t,o,io),s=A.inverseTransformation(i,qi),r=o.cartesianToCartographic(t,Ci),c=e.project(r,Ii);p.fromElements(c.z,c.x,c.y,c);const u=A.fromTranslation(c,io);return A.multiply(Pi,s,n),A.multiply(u,n,n),n};function Oe(){this.times=void 0,this.points=void 0,E.throwInstantiationError()}Oe.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof p)return p;if(e instanceof I)return I;throw new E("point must be a Cartesian3, Quaternion, or number.")};Oe.prototype.evaluate=E.throwInstantiationError;Oe.prototype.findTimeInterval=function(e,t){const n=this.times,o=n.length;if(f.typeOf.number("time",e),e<n[0]||e>n[o-1])throw new E("time is out of range.");if(t=j(t,0),e>=n[t]){if(t+1<o&&e<n[t+1])return t;if(t+2<o&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let i;if(e>n[t])for(i=t;i<o-1&&!(e>=n[i]&&e<n[i+1]);++i);else for(i=t-1;i>=0&&!(e>=n[i]&&e<n[i+1]);--i);return i===o-1&&(i=o-2),i};Oe.prototype.wrapTime=function(e){f.typeOf.number("time",e);const t=this.times,n=t[t.length-1],o=t[0],i=n-o;let s;return e<o&&(s=Math.floor((o-e)/i)+1,e+=s*i),e>n&&(s=Math.floor((e-n)/i)+1,e-=s*i),e};Oe.prototype.clampTime=function(e){f.typeOf.number("time",e);const t=this.times;return S.clamp(e,t[0],t[t.length-1])};function ft(e){e=j(e,j.EMPTY_OBJECT);const t=e.points,n=e.times;if(!d(t)||!d(n))throw new E("points and times are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Oe.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(ft.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ft.prototype.findTimeInterval=Oe.prototype.findTimeInterval;ft.prototype.wrapTime=Oe.prototype.wrapTime;ft.prototype.clampTime=Oe.prototype.clampTime;ft.prototype.evaluate=function(e,t){const n=this.points,o=this.times,i=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),s=(e-o[i])/(o[i+1]-o[i]);return this._pointType===Number?(1-s)*n[i]+s*n[i+1]:(d(t)||(t=new p),p.lerp(n[i],n[i+1],s,t))};const bo={};bo.solve=function(e,t,n,o){if(!d(e)||!(e instanceof Array))throw new E("The array lower is required.");if(!d(t)||!(t instanceof Array))throw new E("The array diagonal is required.");if(!d(n)||!(n instanceof Array))throw new E("The array upper is required.");if(!d(o)||!(o instanceof Array))throw new E("The array right is required.");if(t.length!==o.length)throw new E("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new E("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new E("lower and upper must be one less than the length of diagonal.");const i=new Array(n.length),s=new Array(o.length),r=new Array(o.length);let c;for(c=0;c<s.length;c++)s[c]=new p,r[c]=new p;i[0]=n[0]/t[0],s[0]=p.multiplyByScalar(o[0],1/t[0],s[0]);let u;for(c=1;c<i.length;++c)u=1/(t[c]-i[c-1]*e[c-1]),i[c]=n[c]*u,s[c]=p.subtract(o[c],p.multiplyByScalar(s[c-1],e[c-1],s[c]),s[c]),s[c]=p.multiplyByScalar(s[c],u,s[c]);for(u=1/(t[c]-i[c-1]*e[c-1]),s[c]=p.subtract(o[c],p.multiplyByScalar(s[c-1],e[c-1],s[c]),s[c]),s[c]=p.multiplyByScalar(s[c],u,s[c]),r[r.length-1]=s[s.length-1],c=r.length-2;c>=0;--c)r[c]=p.subtract(s[c],p.multiplyByScalar(r[c+1],i[c],r[c]),r[c]);return r};const Ui=[],Ni=[],Di=[],xi=[];function Pc(e,t,n){const o=Ui,i=Di,s=Ni,r=xi;o.length=i.length=e.length-1,s.length=r.length=e.length;let c;o[0]=s[0]=1,i[0]=0;let u=r[0];for(d(u)||(u=r[0]=new p),p.clone(t,u),c=1;c<o.length-1;++c)o[c]=i[c]=1,s[c]=4,u=r[c],d(u)||(u=r[c]=new p),p.subtract(e[c+1],e[c-1],u),p.multiplyByScalar(u,3,u);return o[c]=0,i[c]=1,s[c]=4,u=r[c],d(u)||(u=r[c]=new p),p.subtract(e[c+1],e[c-1],u),p.multiplyByScalar(u,3,u),s[c+1]=1,u=r[c+1],d(u)||(u=r[c+1]=new p),p.clone(n,u),bo.solve(o,s,i,r)}function Cc(e){const t=Ui,n=Di,o=Ni,i=xi;t.length=n.length=e.length-1,o.length=i.length=e.length;let s;t[0]=n[0]=1,o[0]=2;let r=i[0];for(d(r)||(r=i[0]=new p),p.subtract(e[1],e[0],r),p.multiplyByScalar(r,3,r),s=1;s<t.length;++s)t[s]=n[s]=1,o[s]=4,r=i[s],d(r)||(r=i[s]=new p),p.subtract(e[s+1],e[s-1],r),p.multiplyByScalar(r,3,r);return o[s]=2,r=i[s],d(r)||(r=i[s]=new p),p.subtract(e[s],e[s-1],r),p.multiplyByScalar(r,3,r),bo.solve(t,o,n,i)}function je(e){e=j(e,j.EMPTY_OBJECT);const t=e.points,n=e.times,o=e.inTangents,i=e.outTangents;if(!d(t)||!d(n)||!d(o)||!d(i))throw new E("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new E("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new E("times.length must be equal to points.length.");if(o.length!==i.length||o.length!==t.length-1)throw new E("inTangents and outTangents must have a length equal to points.length - 1.");if(this._times=n,this._points=t,this._pointType=Oe.getPointType(t[0]),this._pointType!==Oe.getPointType(o[0])||this._pointType!==Oe.getPointType(i[0]))throw new E("inTangents and outTangents must be of the same type as points.");this._inTangents=o,this._outTangents=i,this._lastTimeIndex=0}Object.defineProperties(je.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});je.createC1=function(e){e=j(e,j.EMPTY_OBJECT);const t=e.times,n=e.points,o=e.tangents;if(!d(n)||!d(t)||!d(o))throw new E("points, times and tangents are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length||t.length!==o.length)throw new E("times, points and tangents must have the same length.");const i=o.slice(0,o.length-1),s=o.slice(1,o.length);return new je({times:t,points:n,inTangents:s,outTangents:i})};je.createNaturalCubic=function(e){e=j(e,j.EMPTY_OBJECT);const t=e.times,n=e.points;if(!d(n)||!d(t))throw new E("points and times are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new E("times.length must be equal to points.length.");if(n.length<3)return new ft({points:n,times:t});const o=Cc(n),i=o.slice(0,o.length-1),s=o.slice(1,o.length);return new je({times:t,points:n,inTangents:s,outTangents:i})};je.createClampedCubic=function(e){e=j(e,j.EMPTY_OBJECT);const t=e.times,n=e.points,o=e.firstTangent,i=e.lastTangent;if(!d(n)||!d(t)||!d(o)||!d(i))throw new E("points, times, firstTangent and lastTangent are required.");if(n.length<2)throw new E("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new E("times.length must be equal to points.length.");const s=Oe.getPointType(n[0]);if(s!==Oe.getPointType(o)||s!==Oe.getPointType(i))throw new E("firstTangent and lastTangent must be of the same type as points.");if(n.length<3)return new ft({points:n,times:t});const r=Pc(n,o,i),c=r.slice(0,r.length-1),u=r.slice(1,r.length);return new je({times:t,points:n,inTangents:u,outTangents:c})};je.hermiteCoefficientMatrix=new A(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);je.prototype.findTimeInterval=Oe.prototype.findTimeInterval;const Ic=new L,mt=new p;je.prototype.wrapTime=Oe.prototype.wrapTime;je.prototype.clampTime=Oe.prototype.clampTime;je.prototype.evaluate=function(e,t){const n=this.points,o=this.times,i=this.inTangents,s=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);const r=this._lastTimeIndex,c=o[r+1]-o[r],u=(e-o[r])/c,y=Ic;y.z=u,y.y=u*u,y.x=y.y*u,y.w=1;const m=A.multiplyByVector(je.hermiteCoefficientMatrix,y,y);m.z*=c,m.w*=c;const w=this._pointType;return w===Number?n[r]*m.x+n[r+1]*m.y+s[r]*m.z+i[r]*m.w:(d(t)||(t=new w),t=w.multiplyByScalar(n[r],m.x,t),w.multiplyByScalar(n[r+1],m.y,mt),w.add(t,mt,t),w.multiplyByScalar(s[r],m.z,mt),w.add(t,mt,t),w.multiplyByScalar(i[r],m.w,mt),w.add(t,mt,t))};const qc=new L,Vo=new p,yt=new p;function Uc(e){const t=e.points,n=e.times;if(t.length<3){const o=n[0],i=1/(n[1]-o),s=t[0],r=t[1];return function(c,u){d(u)||(u=new p);const y=(c-o)*i;return p.lerp(s,r,y,u)}}return function(o,i){d(i)||(i=new p);const s=e._lastTimeIndex=e.findTimeInterval(o,e._lastTimeIndex),r=(o-n[s])/(n[s+1]-n[s]),c=qc;c.z=r,c.y=r*r,c.x=c.y*r,c.w=1;let u,y,m,w,b;return s===0?(u=t[0],y=t[1],m=e.firstTangent,w=p.subtract(t[2],u,Vo),p.multiplyByScalar(w,.5,w),b=A.multiplyByVector(je.hermiteCoefficientMatrix,c,c)):s===t.length-2?(u=t[s],y=t[s+1],w=e.lastTangent,m=p.subtract(y,t[s-1],Vo),p.multiplyByScalar(m,.5,m),b=A.multiplyByVector(je.hermiteCoefficientMatrix,c,c)):(u=t[s-1],y=t[s],m=t[s+1],w=t[s+2],b=A.multiplyByVector(tt.catmullRomCoefficientMatrix,c,c)),i=p.multiplyByScalar(u,b.x,i),p.multiplyByScalar(y,b.y,yt),p.add(i,yt,i),p.multiplyByScalar(m,b.z,yt),p.add(i,yt,i),p.multiplyByScalar(w,b.w,yt),p.add(i,yt,i)}}const Nc=new p,Dc=new p;function tt(e){e=j(e,j.EMPTY_OBJECT);const t=e.points,n=e.times;let o=e.firstTangent,i=e.lastTangent;if(f.defined("points",t),f.defined("times",n),f.typeOf.number.greaterThanOrEquals("points.length",t.length,2),f.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(d(o)||(o=Nc,p.multiplyByScalar(t[1],2,o),p.subtract(o,t[2],o),p.subtract(o,t[0],o),p.multiplyByScalar(o,.5,o)),!d(i))){const s=t.length-1;i=Dc,p.multiplyByScalar(t[s-1],2,i),p.subtract(t[s],i,i),p.add(i,t[s-2],i),p.multiplyByScalar(i,.5,i)}this._times=n,this._points=t,this._firstTangent=p.clone(o),this._lastTangent=p.clone(i),this._evaluateFunction=Uc(this),this._lastTimeIndex=0}Object.defineProperties(tt.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});tt.catmullRomCoefficientMatrix=new A(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);tt.prototype.findTimeInterval=Oe.prototype.findTimeInterval;tt.prototype.wrapTime=Oe.prototype.wrapTime;tt.prototype.clampTime=Oe.prototype.clampTime;tt.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var $i={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(We,function(){var n=1e3,o=6e4,i=36e5,s="millisecond",r="second",c="minute",u="hour",y="day",m="week",w="month",b="quarter",O="year",R="date",T="Invalid Date",z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,q={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var l=["th","st","nd","rd"],g=h%100;return"["+h+(l[(g-20)%10]||l[g]||l[0])+"]"}},x=function(h,l,g){var _=String(h);return!_||_.length>=l?h:""+Array(l+1-_.length).join(g)+h},Y={s:x,z:function(h){var l=-h.utcOffset(),g=Math.abs(l),_=Math.floor(g/60),v=g%60;return(l<=0?"+":"-")+x(_,2,"0")+":"+x(v,2,"0")},m:function h(l,g){if(l.date()<g.date())return-h(g,l);var _=12*(g.year()-l.year())+(g.month()-l.month()),v=l.clone().add(_,w),P=g-v<0,C=l.clone().add(_+(P?-1:1),w);return+(-(_+(g-v)/(P?v-C:C-v))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:w,y:O,w:m,d:y,D:R,h:u,m:c,s:r,ms:s,Q:b}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},N="en",H={};H[N]=q;var B="$isDayjsObject",U=function(h){return h instanceof J||!(!h||!h[B])},G=function h(l,g,_){var v;if(!l)return N;if(typeof l=="string"){var P=l.toLowerCase();H[P]&&(v=P),g&&(H[P]=g,v=P);var C=l.split("-");if(!v&&C.length>1)return h(C[0])}else{var $=l.name;H[$]=l,v=$}return!_&&v&&(N=v),v||!_&&N},V=function(h,l){if(U(h))return h.clone();var g=typeof l=="object"?l:{};return g.date=h,g.args=arguments,new J(g)},k=Y;k.l=G,k.i=U,k.w=function(h,l){return V(h,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var J=function(){function h(g){this.$L=G(g.locale,null,!0),this.parse(g),this.$x=this.$x||g.x||{},this[B]=!0}var l=h.prototype;return l.parse=function(g){this.$d=function(_){var v=_.date,P=_.utc;if(v===null)return new Date(NaN);if(k.u(v))return new Date;if(v instanceof Date)return new Date(v);if(typeof v=="string"&&!/Z$/i.test(v)){var C=v.match(z);if(C){var $=C[2]-1||0,X=(C[7]||"0").substring(0,3);return P?new Date(Date.UTC(C[1],$,C[3]||1,C[4]||0,C[5]||0,C[6]||0,X)):new Date(C[1],$,C[3]||1,C[4]||0,C[5]||0,C[6]||0,X)}}return new Date(v)}(g),this.init()},l.init=function(){var g=this.$d;this.$y=g.getFullYear(),this.$M=g.getMonth(),this.$D=g.getDate(),this.$W=g.getDay(),this.$H=g.getHours(),this.$m=g.getMinutes(),this.$s=g.getSeconds(),this.$ms=g.getMilliseconds()},l.$utils=function(){return k},l.isValid=function(){return this.$d.toString()!==T},l.isSame=function(g,_){var v=V(g);return this.startOf(_)<=v&&v<=this.endOf(_)},l.isAfter=function(g,_){return V(g)<this.startOf(_)},l.isBefore=function(g,_){return this.endOf(_)<V(g)},l.$g=function(g,_,v){return k.u(g)?this[_]:this.set(v,g)},l.unix=function(){return Math.floor(this.valueOf()/1e3)},l.valueOf=function(){return this.$d.getTime()},l.startOf=function(g,_){var v=this,P=!!k.u(_)||_,C=k.p(g),$=function(he,ne){var pe=k.w(v.$u?Date.UTC(v.$y,ne,he):new Date(v.$y,ne,he),v);return P?pe:pe.endOf(y)},X=function(he,ne){return k.w(v.toDate()[he].apply(v.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(ne)),v)},ee=this.$W,te=this.$M,ie=this.$D,ce="set"+(this.$u?"UTC":"");switch(C){case O:return P?$(1,0):$(31,11);case w:return P?$(1,te):$(0,te+1);case m:var ue=this.$locale().weekStart||0,ye=(ee<ue?ee+7:ee)-ue;return $(P?ie-ye:ie+(6-ye),te);case y:case R:return X(ce+"Hours",0);case u:return X(ce+"Minutes",1);case c:return X(ce+"Seconds",2);case r:return X(ce+"Milliseconds",3);default:return this.clone()}},l.endOf=function(g){return this.startOf(g,!1)},l.$set=function(g,_){var v,P=k.p(g),C="set"+(this.$u?"UTC":""),$=(v={},v[y]=C+"Date",v[R]=C+"Date",v[w]=C+"Month",v[O]=C+"FullYear",v[u]=C+"Hours",v[c]=C+"Minutes",v[r]=C+"Seconds",v[s]=C+"Milliseconds",v)[P],X=P===y?this.$D+(_-this.$W):_;if(P===w||P===O){var ee=this.clone().set(R,1);ee.$d[$](X),ee.init(),this.$d=ee.set(R,Math.min(this.$D,ee.daysInMonth())).$d}else $&&this.$d[$](X);return this.init(),this},l.set=function(g,_){return this.clone().$set(g,_)},l.get=function(g){return this[k.p(g)]()},l.add=function(g,_){var v,P=this;g=Number(g);var C=k.p(_),$=function(te){var ie=V(P);return k.w(ie.date(ie.date()+Math.round(te*g)),P)};if(C===w)return this.set(w,this.$M+g);if(C===O)return this.set(O,this.$y+g);if(C===y)return $(1);if(C===m)return $(7);var X=(v={},v[c]=o,v[u]=i,v[r]=n,v)[C]||1,ee=this.$d.getTime()+g*X;return k.w(ee,this)},l.subtract=function(g,_){return this.add(-1*g,_)},l.format=function(g){var _=this,v=this.$locale();if(!this.isValid())return v.invalidDate||T;var P=g||"YYYY-MM-DDTHH:mm:ssZ",C=k.z(this),$=this.$H,X=this.$m,ee=this.$M,te=v.weekdays,ie=v.months,ce=v.meridiem,ue=function(ne,pe,_e,Se){return ne&&(ne[pe]||ne(_,P))||_e[pe].slice(0,Se)},ye=function(ne){return k.s($%12||12,ne,"0")},he=ce||function(ne,pe,_e){var Se=ne<12?"AM":"PM";return _e?Se.toLowerCase():Se};return P.replace(D,function(ne,pe){return pe||function(_e){switch(_e){case"YY":return String(_.$y).slice(-2);case"YYYY":return k.s(_.$y,4,"0");case"M":return ee+1;case"MM":return k.s(ee+1,2,"0");case"MMM":return ue(v.monthsShort,ee,ie,3);case"MMMM":return ue(ie,ee);case"D":return _.$D;case"DD":return k.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return ue(v.weekdaysMin,_.$W,te,2);case"ddd":return ue(v.weekdaysShort,_.$W,te,3);case"dddd":return te[_.$W];case"H":return String($);case"HH":return k.s($,2,"0");case"h":return ye(1);case"hh":return ye(2);case"a":return he($,X,!0);case"A":return he($,X,!1);case"m":return String(X);case"mm":return k.s(X,2,"0");case"s":return String(_.$s);case"ss":return k.s(_.$s,2,"0");case"SSS":return k.s(_.$ms,3,"0");case"Z":return C}return null}(ne)||C.replace(":","")})},l.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},l.diff=function(g,_,v){var P,C=this,$=k.p(_),X=V(g),ee=(X.utcOffset()-this.utcOffset())*o,te=this-X,ie=function(){return k.m(C,X)};switch($){case O:P=ie()/12;break;case w:P=ie();break;case b:P=ie()/3;break;case m:P=(te-ee)/6048e5;break;case y:P=(te-ee)/864e5;break;case u:P=te/i;break;case c:P=te/o;break;case r:P=te/n;break;default:P=te}return v?P:k.a(P)},l.daysInMonth=function(){return this.endOf(w).$D},l.$locale=function(){return H[this.$L]},l.locale=function(g,_){if(!g)return this.$L;var v=this.clone(),P=G(g,_,!0);return P&&(v.$L=P),v},l.clone=function(){return k.w(this.$d,this)},l.toDate=function(){return new Date(this.valueOf())},l.toJSON=function(){return this.isValid()?this.toISOString():null},l.toISOString=function(){return this.$d.toISOString()},l.toString=function(){return this.$d.toUTCString()},h}(),a=J.prototype;return V.prototype=a,[["$ms",s],["$s",r],["$m",c],["$H",u],["$W",y],["$M",w],["$y",O],["$D",R]].forEach(function(h){a[h[1]]=function(l){return this.$g(l,h[0],h[1])}}),V.extend=function(h,l){return h.$i||(h(l,J,V),h.$i=!0),V},V.locale=G,V.isDayjs=U,V.unix=function(h){return V(1e3*h)},V.en=H[N],V.Ls=H,V.p={},V})})($i);var xc=$i.exports;const Ue=Et(xc);var Fi={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(We,function(){var n,o,i=1e3,s=6e4,r=36e5,c=864e5,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y=31536e6,m=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,b={years:y,months:m,days:c,hours:r,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},O=function(H){return H instanceof Y},R=function(H,B,U){return new Y(H,U,B.$l)},T=function(H){return o.p(H)+"s"},z=function(H){return H<0},D=function(H){return z(H)?Math.ceil(H):Math.floor(H)},q=function(H){return Math.abs(H)},x=function(H,B){return H?z(H)?{negative:!0,format:""+q(H)+B}:{negative:!1,format:""+H+B}:{negative:!1,format:""}},Y=function(){function H(U,G,V){var k=this;if(this.$d={},this.$l=V,U===void 0&&(this.$ms=0,this.parseFromMilliseconds()),G)return R(U*b[T(G)],this);if(typeof U=="number")return this.$ms=U,this.parseFromMilliseconds(),this;if(typeof U=="object")return Object.keys(U).forEach(function(h){k.$d[T(h)]=U[h]}),this.calMilliseconds(),this;if(typeof U=="string"){var J=U.match(w);if(J){var a=J.slice(2).map(function(h){return h!=null?Number(h):0});return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var B=H.prototype;return B.calMilliseconds=function(){var U=this;this.$ms=Object.keys(this.$d).reduce(function(G,V){return G+(U.$d[V]||0)*b[V]},0)},B.parseFromMilliseconds=function(){var U=this.$ms;this.$d.years=D(U/y),U%=y,this.$d.months=D(U/m),U%=m,this.$d.days=D(U/c),U%=c,this.$d.hours=D(U/r),U%=r,this.$d.minutes=D(U/s),U%=s,this.$d.seconds=D(U/i),U%=i,this.$d.milliseconds=U},B.toISOString=function(){var U=x(this.$d.years,"Y"),G=x(this.$d.months,"M"),V=+this.$d.days||0;this.$d.weeks&&(V+=7*this.$d.weeks);var k=x(V,"D"),J=x(this.$d.hours,"H"),a=x(this.$d.minutes,"M"),h=this.$d.seconds||0;this.$d.milliseconds&&(h+=this.$d.milliseconds/1e3,h=Math.round(1e3*h)/1e3);var l=x(h,"S"),g=U.negative||G.negative||k.negative||J.negative||a.negative||l.negative,_=J.format||a.format||l.format?"T":"",v=(g?"-":"")+"P"+U.format+G.format+k.format+_+J.format+a.format+l.format;return v==="P"||v==="-P"?"P0D":v},B.toJSON=function(){return this.toISOString()},B.format=function(U){var G=U||"YYYY-MM-DDTHH:mm:ss",V={Y:this.$d.years,YY:o.s(this.$d.years,2,"0"),YYYY:o.s(this.$d.years,4,"0"),M:this.$d.months,MM:o.s(this.$d.months,2,"0"),D:this.$d.days,DD:o.s(this.$d.days,2,"0"),H:this.$d.hours,HH:o.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:o.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:o.s(this.$d.seconds,2,"0"),SSS:o.s(this.$d.milliseconds,3,"0")};return G.replace(u,function(k,J){return J||String(V[k])})},B.as=function(U){return this.$ms/b[T(U)]},B.get=function(U){var G=this.$ms,V=T(U);return V==="milliseconds"?G%=1e3:G=V==="weeks"?D(G/b[V]):this.$d[V],G||0},B.add=function(U,G,V){var k;return k=G?U*b[T(G)]:O(U)?U.$ms:R(U,this).$ms,R(this.$ms+k*(V?-1:1),this)},B.subtract=function(U,G){return this.add(U,G,!0)},B.locale=function(U){var G=this.clone();return G.$l=U,G},B.clone=function(){return R(this.$ms,this)},B.humanize=function(U){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!U)},B.valueOf=function(){return this.asMilliseconds()},B.milliseconds=function(){return this.get("milliseconds")},B.asMilliseconds=function(){return this.as("milliseconds")},B.seconds=function(){return this.get("seconds")},B.asSeconds=function(){return this.as("seconds")},B.minutes=function(){return this.get("minutes")},B.asMinutes=function(){return this.as("minutes")},B.hours=function(){return this.get("hours")},B.asHours=function(){return this.as("hours")},B.days=function(){return this.get("days")},B.asDays=function(){return this.as("days")},B.weeks=function(){return this.get("weeks")},B.asWeeks=function(){return this.as("weeks")},B.months=function(){return this.get("months")},B.asMonths=function(){return this.as("months")},B.years=function(){return this.get("years")},B.asYears=function(){return this.as("years")},H}(),N=function(H,B,U){return H.add(B.years()*U,"y").add(B.months()*U,"M").add(B.days()*U,"d").add(B.hours()*U,"h").add(B.minutes()*U,"m").add(B.seconds()*U,"s").add(B.milliseconds()*U,"ms")};return function(H,B,U){n=U,o=U().$utils(),U.duration=function(k,J){var a=U.locale();return R(k,{$l:a},J)},U.isDuration=O;var G=B.prototype.add,V=B.prototype.subtract;B.prototype.add=function(k,J){return O(k)?N(this,k,1):G.bind(this)(k,J)},B.prototype.subtract=function(k,J){return O(k)?N(this,k,-1):V.bind(this)(k,J)}}})})(Fi);var $c=Fi.exports;const Li=Et($c);var ki={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(We,function(){return function(n,o){o.prototype.isSameOrBefore=function(i,s){return this.isSame(i,s)||this.isBefore(i,s)}}})})(ki);var Fc=ki.exports;const Lc=Et(Fc);function kt(e){"@babel/helpers - typeof";return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(e)}function kc(e,t){if(kt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(kt(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bc(e){var t=kc(e,"string");return kt(t)=="symbol"?t:String(t)}function Xe(e,t,n){return t=Bc(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Wc=240,Hc=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],Qc=372,Yc=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],Vc=372,Gc=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],Zc=12,Qn=4*5/2,Xc=2;class Jc{constructor(t){Xe(this,"_v00",0),Xe(this,"_v01",0),Xe(this,"_v10",0),Xe(this,"_v11",0),Xe(this,"_t",[]),Xe(this,"_ix",void 0),Xe(this,"_iy",void 0),Xe(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}getHeight(t,n){if(t=Math.abs(t)>90?NaN:t,isNaN(t)||isNaN(n))return NaN;const o=Kc(n,360);n=o!==-180?o:180;let i=n*this.options._rlonres,s=-t*this.options._rlatres,r=Math.floor(i),c=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(s));i-=r,s-=c,c+=(this.options._height-1)/2,r+=r<0?this.options._width:r>=this.options._width?-this.options._width:0;let u=0,y=0,m=0,w=0,b=new Array(Qn);if(r===this._ix&&c===this._iy)this.options.cubic?b=this._t:(u=this._v00,y=this._v01,m=this._v10,w=this._v11);else if(!this.options.cubic)u=this._rawval(r,c),y=this._rawval(r+1,c),m=this._rawval(r,c+1),w=this._rawval(r+1,c+1);else{const R=[this._rawval(r,c-1),this._rawval(r+1,c-1),this._rawval(r-1,c),this._rawval(r,c),this._rawval(r+1,c),this._rawval(r+2,c),this._rawval(r-1,c+1),this._rawval(r,c+1),this._rawval(r+1,c+1),this._rawval(r+2,c+1),this._rawval(r,c+2),this._rawval(r+1,c+2)];let T=Yc;c!==0&&(T=c===this.options._height-2?Gc:Hc);let z=Qc;c!==0&&(z=c===this.options._height-2?Vc:Wc);for(let D=0;D<Qn;++D){b[D]=0;for(let q=0;q<Zc;++q)b[D]+=R[q]*T[Qn*q+D];b[D]/=z}}if(!this.options.cubic){const R=(1-i)*u+i*y,T=(1-i)*m+i*w,z=(1-s)*R+s*T,D=this.options._offset+this.options._scale*z;return this._ix=r,this._iy=c,this._v00=u,this._v01=y,this._v10=m,this._v11=w,D}let O=b[0]+i*(b[1]+i*(b[3]+i*b[6]))+s*(b[2]+i*(b[4]+i*b[7])+s*(b[5]+i*b[8]+s*b[9]));return O=this.options._offset+this.options._scale*O,this._ix=r,this._iy=c,this._t=b,O}_rawval(t,n){t<0?t+=this.options._width:t>=this.options._width&&(t-=this.options._width),(n<0||n>=this.options._height)&&(n=n<0?-n:2*(this.options._height-1)-n,t+=(t<this.options._width/2?1:-1)*this.options._width/2);const o=this.options._datastart+Xc*(n*this.options._swidth+t),i=this.options.data[o],s=this.options.data[o+1];return i<<8|s}}function Kc(e,t){t=Math.abs(t);let n=Go(e,t);return 2*Math.abs(n)===t?n-=Go(e,2*t)-n:2*Math.abs(n)>t&&(n+=n<0?t:-t),n}function Go(e,t){return e-Math.floor(e/t)*t}const ea=10,ta=65535;function na(e,t){const n=oa(e);let o=n.next();if(o.done||o.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,s=0,r=-1,c=-1,u="NONE",y="UNKNOWN",m=0,w=0,b=null,O=null;do{o=n.next();const D=o.value.line;if(D.length)if(D[0]==="#"){const q=D.split(" "),x=q[0],Y=q[1];if(x!=="#"||!Y)continue;const N=q.length>2?q.slice(2):[];if(Y==="Description")u=N.join(" ");else if(Y==="DateTime")y=N.join(" ");else if(Y==="Offset"){if(!q[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(q[2],10)}else if(Y==="Scale"){if(!q[2])throw new Error("Geoid model file: Error reading scale");s=parseFloat(q[2])}else Y===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(q[2]))&&(r=parseFloat(q[2])):Y===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(q[2]))&&(c=parseFloat(q[2]))}else{let q=D.split(" ");if(q=q.filter(x=>x!==""),m=parseInt(q[0],10),w=parseInt(q[1],10),!(m&&w))throw new Error("Geoid model file: Error reading raster size");break}}while(!o.done);o=n.next();const R=parseInt(o.value.line,10);if(o.done)throw new Error("Geoid model file: Error reading maxval");if(R!==ta)throw new Error("Geoid model file: Incorrect value of maxval");if(b=o.value.offset,O=m,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(s===0)throw new Error("Geoid model file: Scale not set");if(s<0)throw new Error("Geoid model file: Scale must be positive");if(w<2||m<2)throw new Error("Geoid model file: Raster size too small");if(m&1)throw new Error("Geoid model file: Raster width is odd");if(!(w&1))throw new Error("Geoid model file: Raster height is even");const T=m/360,z=(w-1)/180;return new Jc({cubic:t.cubic,_width:m,_height:w,_rlonres:T,_rlatres:z,_offset:i,_scale:s,_swidth:O,_datastart:b,_maxerror:r,_rmserror:c,_description:u,_datetime:y,data:e})}function*oa(e){let t=0;do{const n=e.indexOf(ea,t);if(n!==-1){const o=e.subarray(t,n);t=n+1,yield{offset:t,line:Zo(o)}}else{const o=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Zo(o)}}}while(t<e.length);return{offset:t,line:""}}function Zo(e){let t="";for(const n of e)t+=String.fromCharCode(n);return t}Ue.extend(Li);const ia=9.80665,xt=class xt{constructor(){Z(this,"samples",[]);Z(this,"_mslHeightFixed",!1);Z(this,"_fixedFrame",re.localFrameToFixedFrameGenerator("north","west"));Z(this,"_lastRoll",0);Z(this,"_m0",new A);Z(this,"_m1",new A);Z(this,"_hpr0",new be);Z(this,"_hpr1",new be);Z(this,"_alpha",.05);Z(this,"_p0",new p);Z(this,"_p1",new p);Z(this,"_p2",new p);Z(this,"_v0",new p);Z(this,"_v1",new p);Z(this,"_r0",new M);Z(this,"_r1",new M);Z(this,"_q0",new I);Z(this,"_q1",new I);Z(this,"_rollQuat",new I);Z(this,"_defaultHpr",new be);Z(this,"_cartographicScratch",new le)}static loadGeoidModel(t){this._geoid=na(t,{})}hasOrientations(){var t;return((t=this.samples[0])==null?void 0:t.state.orientation)!==void 0}_simpleSmooth(t,n){return t=n*t+(1-n)*this._lastRoll,t<2*S.RADIANS_PER_DEGREE&&(t=0),this._lastRoll=t,t}_computeRoll(t,n,o,i,s,r){const c=A.fromTranslationQuaternionRotationScale(t,n,p.ONE,this._m0),u=A.fromTranslationQuaternionRotationScale(o,i,p.ONE,this._m1),y=re.fixedFrameToHeadingPitchRoll(c,oe.WGS84,this._fixedFrame,this._hpr0),m=re.fixedFrameToHeadingPitchRoll(u,oe.WGS84,this._fixedFrame,this._hpr1);let w=y.heading;w<0&&(w+=S.TWO_PI);let b=m.heading;b<0&&(b+=S.TWO_PI);let O=b-w,R=Math.abs(O);R>Math.PI&&(R=S.TWO_PI-R,O=S.TWO_PI+O);const T=Math.sign(O)*R;return this._simpleSmooth(Math.atan(s*T/(ia*r)),this._alpha)}_computeOrientation(t,n,o,i,s){const r=o-n,c=t.evaluate(n,this._p0),u=t.evaluate(o,this._p1),y=p.subtract(u,c,this._v0);p.divideByScalar(y,o-n,y);const m=p.magnitude(y);if(m>S.EPSILON6){p.normalize(y,y);const w=re.rotationMatrixFromPositionVelocity(c,y,oe.WGS84,this._r0),b=I.fromRotationMatrix(w,this._q0);let O=0;if(s){const T=t.evaluate(i,this._p2),z=p.subtract(T,u,this._v1);p.divideByScalar(z,i-o,z),p.normalize(z,z);const D=re.rotationMatrixFromPositionVelocity(u,z,oe.WGS84,this._r1),q=I.fromRotationMatrix(D,this._q1);O=this._computeRoll(c,b,u,q,m,r)}const R=I.fromAxisAngle(y,O,this._rollQuat);return I.multiply(R,b,new I)}else return re.headingPitchRollQuaternion(c,this._defaultHpr,oe.WGS84,this._fixedFrame,new I)}emulateOrientations(t,n){const o=this.samples;if(o.length<2||Ue.duration(o[1].time.diff(o[0].time)).asSeconds()<2*t)return;const i=o.length-1,s=o[0].time,r=o.map(b=>Ue.duration(b.time.diff(s)).asSeconds()),c=o.map(b=>p.fromElements(b.state.position.x,b.state.position.y,b.state.position.z)),u=new tt({times:r,points:c});n=n??!1;for(let b=0;b<i;++b){const O=r[b],R=O+t,T=R+t;o[b].state.orientation=this._computeOrientation(u,O,R,T,n)}const y=r[i],m=y-t,w=m-t;o[i].state.orientation=this._computeOrientation(u,w,m,y,n)}fixMslHeight(){if(this._mslHeightFixed||xt._geoid===void 0)return;const t=xt._geoid,n=this.samples;n.forEach((o,i)=>{const s=le.fromCartesian(o.state.position,oe.WGS84,this._cartographicScratch);s.height+=t==null?void 0:t.getHeight(s.latitude*S.DEGREES_PER_RADIAN,s.longitude*S.DEGREES_PER_RADIAN),n[i].state.position=le.toCartesian(s,oe.WGS84,new p)}),this._mslHeightFixed=!0}};Z(xt,"_geoid");let Bt=xt;Ue.extend(Li);Ue.extend(Lc);class Bi{constructor(){Z(this,"fileType","");Z(this,"fileVersion","")}}class Oo{constructor(){Z(this,"start",Ue(null));Z(this,"end",Ue(null))}isValid(){return this.start.isValid()&&this.end.isValid()}duration(){return this.isValid()?Ue.duration(this.end.diff(this.start)).asSeconds():-1}}class Wi{constructor(){Z(this,"referenceTime",Ue(null));Z(this,"dataSource");Z(this,"dataRecorder");Z(this,"recordingTime");Z(this,"author");Z(this,"title");Z(this,"category");Z(this,"briefing");Z(this,"debriefing");Z(this,"comments");Z(this,"referenceLongitude");Z(this,"referenceLatitude");Z(this,"additionalProps")}}class Hi{constructor(t){Z(this,"id");Z(this,"timeSpan",new Oo);Z(this,"name");Z(this,"types");Z(this,"callsign");Z(this,"pilot");Z(this,"group");Z(this,"country");Z(this,"coalition");Z(this,"color");this.id=t}}class qt{constructor(t,n){Z(this,"timeStamp");Z(this,"scene");this.timeStamp=t,n?this.scene=new Map(n):this.scene=new Map}}class ro{constructor(){Z(this,"isValid",!0);Z(this,"header",new Bi);Z(this,"globalProperties",new Wi);Z(this,"timeSpan",new Oo);Z(this,"entities",new Map);Z(this,"frames",[]);Z(this,"_fixedFrame",re.localFrameToFixedFrameGenerator("north","west"))}getFrame(t){if(this.timeSpan.isValid()){const n=this.globalProperties.referenceTime,o=this.timeSpan.end,i=this.frames;if(n.isSameOrBefore(t)&&t.isSameOrBefore(o)){const s=Ue.duration(t.diff(n)).asSeconds(),r=dr.le(i,new qt(s),(c,u)=>c.timeStamp-u.timeStamp);return i[r]}}}_addFrame(t,n,o,i){const s=o.scene;i=i??!1,s.forEach((r,c)=>{let u,y=t.get(c);y===void 0&&(y=new Bt,t.set(c,y));const m=y.samples,w=p.fromDegrees(r.longitude,r.latitude,r.altitude,oe.WGS84,new p);if(r.yaw!==void 0){const O=new be(r.yaw*S.RADIANS_PER_DEGREE,(r.pitch??0)*S.RADIANS_PER_DEGREE,(r.roll??0)*S.RADIANS_PER_DEGREE);u=re.headingPitchRollQuaternion(w,O,oe.WGS84,this._fixedFrame,new I)}const b=m.length;if(!i&&b>0){const O=m[b-1],R=O.state.position,T=O.state.orientation;if(p.equalsEpsilon(R,w,S.EPSILON6)&&I.equalsEpsilon(T,u,S.EPSILON6))return}m.push({time:n,state:{position:w,orientation:u}})})}createSampledTrajectories(t){const n=(t==null?void 0:t.sampleRate)??1,o=(t==null?void 0:t.fixMslHeight)??!1,i=(t==null?void 0:t.emulateOrientation)??!1,s=new Map,r=this.timeSpan;if(r.isValid()){const c=r.duration(),u=r.start,y=r.end;let m=0;do{const w=u.add(m,"seconds"),b=this.getFrame(w);b!==void 0&&this._addFrame(s,w,b),m+=n}while(m<=c);if(m>c){const w=this.getFrame(y);w!==void 0&&this._addFrame(s,y,w,!0)}}return o&&s.forEach(c=>c.fixMslHeight()),i&&s.forEach(c=>{c.hasOrientations()||c.emulateOrientations(.01,!0)}),s}}function Qi(e){return e.arrayBuffer?e.arrayBuffer():new Promise((t,n)=>{const o=new FileReader;o.addEventListener("loadend",()=>{t(o.result)}),o.addEventListener("error",n),o.readAsArrayBuffer(e)})}async function ra(e){const t=await Qi(e);return new Uint8Array(t)}function Yi(e){return typeof Blob<"u"&&e instanceof Blob}function Wt(e){return typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}const sa=typeof process<"u"&&process.versions&&typeof process.versions.node<"u"&&typeof process.versions.electron>"u";function ca(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength}class Xo{constructor(t){this.typedArray=t instanceof ArrayBuffer||Wt(t)?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}async getLength(){return this.typedArray.byteLength}async read(t,n){return new Uint8Array(this.typedArray.buffer,this.typedArray.byteOffset+t,n)}}class Jo{constructor(t){this.blob=t}async getLength(){return this.blob.size}async read(t,n){const o=this.blob.slice(t,t+n),i=await Qi(o);return new Uint8Array(i)}async sliceAsBlob(t,n,o=""){return this.blob.slice(t,t+n,o)}}function aa(e,t){var n=Uint8Array;if(e[0]==3&&e[1]==0)return t||new n(0);var o=ua,i=Vi,s=fa,r=Gi,c=t==null;c&&(t=new n(e.length>>>2<<3));for(var u=0,y=0,m=0,w=0,b=0,O=0,R=0,T=0,z=0,D,q;u==0;){if(u=o(e,z,1),y=o(e,z+1,2),z+=3,y==0){z&7&&(z+=8-(z&7));var x=(z>>>3)+4,Y=e[x-4]|e[x-3]<<8;c&&(t=Yn(t,T+Y)),t.set(new n(e.buffer,e.byteOffset+x,Y),T),z=x+Y<<3,T+=Y;continue}if(c&&(t=Yn(t,T+(1<<17))),y==1&&(D=K.flmap,q=K.fdmap,O=511,R=31),y==2){m=i(e,z,5)+257,w=i(e,z+5,5)+1,b=i(e,z+10,4)+4,z+=14;for(var N=0;N<38;N+=2)K.itree[N]=0,K.itree[N+1]=0;for(var H=1,N=0;N<b;N++){var B=i(e,z+N*3,3);K.itree[(K.ordr[N]<<1)+1]=B,B>H&&(H=B)}z+=3*b,Ut(K.itree,H),Nt(K.itree,H,K.imap),D=K.lmap,q=K.dmap,z=s(K.imap,(1<<H)-1,m+w,e,z,K.ttree);var U=Ko(K.ttree,0,m,K.ltree);O=(1<<U)-1;var G=Ko(K.ttree,m,w,K.dtree);R=(1<<G)-1,Ut(K.ltree,U),Nt(K.ltree,U,D),Ut(K.dtree,G),Nt(K.dtree,G,q)}for(;;){var V=D[r(e,z)&O];z+=V&15;var k=V>>>4;if(!(k>>>8))t[T++]=k;else{if(k==256)break;var J=T+k-254;if(k>264){var a=K.ldef[k-257];J=T+(a>>>3)+i(e,z,a&7),z+=a&7}var h=q[r(e,z)&R];z+=h&15;var l=h>>>4,g=K.ddef[l],_=(g>>>4)+o(e,z,g&15);for(z+=g&15,c&&(t=Yn(t,T+(1<<17)));T<J;)t[T]=t[T++-_],t[T]=t[T++-_],t[T]=t[T++-_],t[T]=t[T++-_];T=J}}}return t.length==T?t:t.slice(0,T)}function Yn(e,t){var n=e.length;if(t<=n)return e;var o=new Uint8Array(Math.max(n<<1,t));return o.set(e,0),o}function fa(e,t,n,o,i,s){for(var r=Vi,c=Gi,u=0;u<n;){var y=e[c(o,i)&t];i+=y&15;var m=y>>>4;if(m<=15)s[u]=m,u++;else{var w=0,b=0;m==16?(b=3+r(o,i,2),i+=2,w=s[u-1]):m==17?(b=3+r(o,i,3),i+=3):m==18&&(b=11+r(o,i,7),i+=7);for(var O=u+b;u<O;)s[u]=w,u++}}return i}function Ko(e,t,n,o){for(var i=0,s=0,r=o.length>>>1;s<n;){var c=e[s+t];o[s<<1]=0,o[(s<<1)+1]=c,c>i&&(i=c),s++}for(;s<r;)o[s<<1]=0,o[(s<<1)+1]=0,s++;return i}function Ut(e,t){for(var n=e.length,o,i,s,r,c,u=K.bl_count,r=0;r<=t;r++)u[r]=0;for(r=1;r<n;r+=2)u[e[r]]++;var y=K.next_code;for(o=0,u[0]=0,i=1;i<=t;i++)o=o+u[i-1]<<1,y[i]=o;for(s=0;s<n;s+=2)c=e[s+1],c!=0&&(e[s]=y[c],y[c]++)}function Nt(e,t,n){for(var o=e.length,i=K.rev15,s=0;s<o;s+=2)if(e[s+1]!=0)for(var r=s>>1,c=e[s+1],u=r<<4|c,y=t-c,m=e[s]<<y,w=m+(1<<y);m!=w;){var b=i[m]>>>15-t;n[b]=u,m++}}function ei(e,t){for(var n=K.rev15,o=15-t,i=0;i<e.length;i+=2){var s=e[i]<<t-e[i+1];e[i]=n[s]>>>o}}function Vi(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8)>>>(t&7)&(1<<n)-1}function ua(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)&(1<<n)-1}function Gi(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)}const K=function(){var e=Uint16Array,t=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}}();(function(){for(var e=32768,t=0;t<e;t++){var n=t;n=(n&2863311530)>>>1|(n&1431655765)<<1,n=(n&3435973836)>>>2|(n&858993459)<<2,n=(n&4042322160)>>>4|(n&252645135)<<4,n=(n&4278255360)>>>8|(n&16711935)<<8,K.rev15[t]=(n>>>16|n<<16)>>>17}function o(i,s,r){for(;s--!=0;)i.push(0,r)}for(var t=0;t<32;t++)K.ldef[t]=K.of0[t]<<3|K.exb[t],K.ddef[t]=K.df0[t]<<4|K.dxb[t];o(K.fltree,144,8),o(K.fltree,112,9),o(K.fltree,24,7),o(K.fltree,8,8),Ut(K.fltree,9),Nt(K.fltree,9,K.flmap),ei(K.fltree,9),o(K.fdtree,32,5),Ut(K.fdtree,5),Nt(K.fdtree,5,K.fdmap),ei(K.fdtree,5),o(K.itree,19,0),o(K.ltree,286,0),o(K.dtree,30,0),o(K.ttree,320,0)})();const ti={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,o=0;o<8;o++)n&1?n=3988292384^n>>>1:n=n>>>1;e[t]=n}return e}(),update:function(e,t,n,o){for(var i=0;i<o;i++)e=ti.table[(e^t[n+i])&255]^e>>>8;return e},crc:function(e,t,n){return ti.update(4294967295,e,t,n)^4294967295}};function ha(e,t){return aa(e,t)}const ni={numWorkers:1,workerURL:"",useWorkers:!1};let da=0;const mn=[];function Vn(e){return new Promise((t,n)=>{const o=new Worker(e);o.onmessage=i=>{i.data==="start"?(o.onerror=void 0,o.onmessage=void 0,t(o)):n(new Error(`unexpected message: ${i.data}`))},o.onerror=n})}function pa(e,t){return e.require?e.require(t):{}}(function(){if(sa){const{Worker:e}=pa(module,"worker_threads");return{async createWorker(t){return new e(t)},addEventListener(t,n){t.on("message",o=>{n({target:t,data:o})})},async terminate(t){await t.terminate()}}}else return{async createWorker(e){try{return await Vn(e)}catch{console.warn("could not load worker:",e)}let t;try{const n=await fetch(e,{mode:"cors"});if(!n.ok)throw new Error(`could not load: ${e}`);t=await n.text(),e=URL.createObjectURL(new Blob([t],{type:"application/javascript"}));const o=await Vn(e);return ni.workerURL=e,o}catch{console.warn("could not load worker via fetch:",e)}if(t!==void 0)try{e=`data:application/javascript;base64,${btoa(t)}`;const n=await Vn(e);return ni.workerURL=e,n}catch{console.warn("could not load worker via dataURI")}throw console.warn("workers will not be used"),new Error("can not start workers")},addEventListener(e,t){e.addEventListener("message",t)},async terminate(e){e.terminate()}}})();function la(e,t,n,o){const i=new Uint8Array(t);ha(e,i),o(n?new Blob([i],{type:n}):i.buffer)}async function ma(){if(mn.length!==0)for(;mn.length;){const{src:e,uncompressedSize:t,type:n,resolve:o}=mn.shift();let i=e;Yi(e)&&(i=await ra(e)),la(i,t,n,o)}}function Zi(e,t,n){return new Promise((o,i)=>{mn.push({src:e,uncompressedSize:t,type:n,resolve:o,reject:i,id:da++}),ma()})}function ya(e,t){const n=e&31,o=(e>>5&15)-1,i=(e>>9&127)+1980,s=0,r=(t&31)*2,c=t>>5&63,u=t>>11&31;return new Date(i,o,n,u,c,r,s)}class wa{constructor(t,n){this._reader=t,this._rawEntry=n,this.name=n.name,this.nameBytes=n.nameBytes,this.size=n.uncompressedSize,this.compressedSize=n.compressedSize,this.comment=n.comment,this.commentBytes=n.commentBytes,this.compressionMethod=n.compressionMethod,this.lastModDate=ya(n.lastModFileDate,n.lastModFileTime),this.isDirectory=n.uncompressedSize===0&&n.name.endsWith("/"),this.encrypted=!!(n.generalPurposeBitFlag&1),this.externalFileAttributes=n.externalFileAttributes,this.versionMadeBy=n.versionMadeBy}async blob(t="application/octet-stream"){return await Ma(this._reader,this._rawEntry,t)}async arrayBuffer(){return await Aa(this._reader,this._rawEntry)}async text(){const t=await this.arrayBuffer();return Dt(new Uint8Array(t))}async json(){const t=await this.text();return JSON.parse(t)}}const Gn=22,ga=65535,ba=101010256,Oa=101075792;async function vt(e,t,n){return await e.read(t,n)}async function so(e,t,n,o){return e.sliceAsBlob?await e.sliceAsBlob(t,n,o):await e.read(t,n)}const _a={unsigned(){return 0}};function ve(e,t){return e[t]+e[t+1]*256}function Me(e,t){return e[t]+e[t+1]*256+e[t+2]*65536+e[t+3]*16777216}function it(e,t){return Me(e,t)+Me(e,t+4)*4294967296}const Sa=new TextDecoder;function Dt(e,t){return Wt(e.buffer)&&(e=new Uint8Array(e)),Sa.decode(e)}async function va(e,t){const n=Math.min(Gn+ga,t),o=t-n,i=await vt(e,o,n);for(let s=n-Gn;s>=0;--s){if(Me(i,s)!==ba)continue;const r=new Uint8Array(i.buffer,i.byteOffset+s,i.byteLength-s),c=ve(r,4);if(c!==0)throw new Error(`multi-volume zip files are not supported. This is volume: ${c}`);const u=ve(r,10),y=Me(r,12),m=Me(r,16),w=ve(r,20),b=r.length-Gn;if(w!==b)throw new Error(`invalid comment length. expected: ${b}, actual: ${w}`);const O=new Uint8Array(r.buffer,r.byteOffset+22,w),R=Dt(O);return u===65535||m===4294967295?await Ta(e,o+s,R,O):await Xi(e,m,y,u,R,O)}throw new Error("could not find end of central directory. maybe not zip file")}const Ea=117853008;async function Ta(e,t,n,o){const i=t-20,s=await vt(e,i,20);if(Me(s,0)!==Ea)throw new Error("invalid zip64 end of central directory locator signature");const r=it(s,8),c=await vt(e,r,56);if(Me(c,0)!==Oa)throw new Error("invalid zip64 end of central directory record signature");const u=it(c,32),y=it(c,40),m=it(c,48);return Xi(e,m,y,u,n,o)}const Ra=33639248;async function Xi(e,t,n,o,i,s){let r=0;const c=await vt(e,t,n),u=[];for(let m=0;m<o;++m){const w=c.subarray(r,r+46),b=Me(w,0);if(b!==Ra)throw new Error(`invalid central directory file header signature: 0x${b.toString(16)}`);const O={versionMadeBy:ve(w,4),versionNeededToExtract:ve(w,6),generalPurposeBitFlag:ve(w,8),compressionMethod:ve(w,10),lastModFileTime:ve(w,12),lastModFileDate:ve(w,14),crc32:Me(w,16),compressedSize:Me(w,20),uncompressedSize:Me(w,24),fileNameLength:ve(w,28),extraFieldLength:ve(w,30),fileCommentLength:ve(w,32),internalFileAttributes:ve(w,36),externalFileAttributes:Me(w,38),relativeOffsetOfLocalHeader:Me(w,42)};if(O.generalPurposeBitFlag&64)throw new Error("strong encryption is not supported");r+=46;const R=c.subarray(r,r+O.fileNameLength+O.extraFieldLength+O.fileCommentLength);O.nameBytes=R.slice(0,O.fileNameLength),O.name=Dt(O.nameBytes);const T=O.fileNameLength+O.extraFieldLength,z=R.slice(O.fileNameLength,T);O.extraFields=[];let D=0;for(;D<z.length-3;){const x=ve(z,D+0),Y=ve(z,D+2),N=D+4,H=N+Y;if(H>z.length)throw new Error("extra field length exceeds extra field buffer size");O.extraFields.push({id:x,data:z.slice(N,H)}),D=H}if(O.commentBytes=R.slice(T,T+O.fileCommentLength),O.comment=Dt(O.commentBytes),r+=R.length,O.uncompressedSize===4294967295||O.compressedSize===4294967295||O.relativeOffsetOfLocalHeader===4294967295){const x=O.extraFields.find(H=>H.id===1);if(!x)throw new Error("expected zip64 extended information extra field");const Y=x.data;let N=0;if(O.uncompressedSize===4294967295){if(N+8>Y.length)throw new Error("zip64 extended information extra field does not include uncompressed size");O.uncompressedSize=it(Y,N),N+=8}if(O.compressedSize===4294967295){if(N+8>Y.length)throw new Error("zip64 extended information extra field does not include compressed size");O.compressedSize=it(Y,N),N+=8}if(O.relativeOffsetOfLocalHeader===4294967295){if(N+8>Y.length)throw new Error("zip64 extended information extra field does not include relative header offset");O.relativeOffsetOfLocalHeader=it(Y,N),N+=8}}const q=O.extraFields.find(x=>x.id===28789&&x.data.length>=6&&x.data[0]===1&&Me(x.data,1),_a.unsigned(O.nameBytes));if(q&&(O.fileName=Dt(q.data.slice(5))),O.compressionMethod===0){let x=O.uncompressedSize;if(O.generalPurposeBitFlag&1&&(x+=12),O.compressedSize!==x)throw new Error(`compressed size mismatch for stored file: ${O.compressedSize} != ${x}`)}u.push(O)}return{zip:{comment:i,commentBytes:s},entries:u.map(m=>new wa(e,m))}}async function Ji(e,t){if(t.generalPurposeBitFlag&1)throw new Error("encrypted entries not supported");const n=await vt(e,t.relativeOffsetOfLocalHeader,30),o=await e.getLength(),i=Me(n,0);if(i!==67324752)throw new Error(`invalid local file header signature: 0x${i.toString(16)}`);const s=ve(n,26),r=ve(n,28),c=t.relativeOffsetOfLocalHeader+n.length+s+r;let u;if(t.compressionMethod===0)u=!1;else if(t.compressionMethod===8)u=!0;else throw new Error(`unsupported compression method: ${t.compressionMethod}`);const y=c,m=y+t.compressedSize;if(t.compressedSize!==0&&m>o)throw new Error(`file data overflows file bounds: ${y} + ${t.compressedSize} > ${o}`);return{decompress:u,fileDataStart:y}}async function Aa(e,t){const{decompress:n,fileDataStart:o}=await Ji(e,t);if(!n){const r=await vt(e,o,t.compressedSize);return ca(r)?r.buffer:r.slice().buffer}const i=await so(e,o,t.compressedSize);return await Zi(i,t.uncompressedSize)}async function Ma(e,t,n){const{decompress:o,fileDataStart:i}=await Ji(e,t);if(!o){const c=await so(e,i,t.compressedSize,n);return Yi(c)?c:new Blob([Wt(c.buffer)?new Uint8Array(c):c],{type:n})}const s=await so(e,i,t.compressedSize);return await Zi(s,t.uncompressedSize,n)}async function za(e){let t;if(typeof Blob<"u"&&e instanceof Blob)t=new Jo(e);else if(e instanceof ArrayBuffer||e&&e.buffer&&e.buffer instanceof ArrayBuffer)t=new Xo(e);else if(Wt(e)||Wt(e.buffer))t=new Xo(e);else if(typeof e=="string"){const o=await fetch(e);if(!o.ok)throw new Error(`failed http request ${e}, status: ${o.status}: ${o.statusText}`);const i=await o.blob();t=new Jo(i)}else if(typeof e.getLength=="function"&&typeof e.read=="function")t=e;else throw new Error("unsupported source type");const n=await t.getLength();if(n>Number.MAX_SAFE_INTEGER)throw new Error(`file too large. size: ${n}. Only file sizes up 4503599627370496 bytes are supported`);return await va(t,n)}async function ja(e){const{zip:t,entries:n}=await za(e);return{zip:t,entries:Object.fromEntries(n.map(o=>[o.name,o]))}}class Pa{constructor(t){Z(this,"_decoder",new TextDecoder);Z(this,"_currentLine","");Z(this,"_currentTimeStamp",0);Z(this,"_currentFrame",new qt(0));Z(this,"_destroyedIds",[]);Z(this,"_filteredIds",[]);Z(this,"_data",new ro);Z(this,"_filter",[]);Z(this,"_refLat",0);Z(this,"_refLong",0);Z(this,"_acmiVersions",["2.1","2.2"]);Z(this,"_acmiType","text/acmi/tacview");Z(this,"_propertySeparator",new RegExp("(?<!\\\\),"));Z(this,"_headerPattern",/^\ufeff?FileType=(?<type>.*)\r?\nFileVersion=(?<version>.*)\r?\n/);Bt.loadGeoidModel(t)}_isValidVersion(){return this._acmiVersions.find(t=>t===this._data.header.fileVersion)!==void 0}_isValidType(){return this._data.header.fileType===this._acmiType}_parseHeader(t){const n=this._data,o=this._decoder.decode(t.slice(0,64)),i=this._headerPattern.exec(o);i!==null&&i.groups!==void 0&&(n.header.fileType=i.groups.type,n.header.fileVersion=i.groups.version,n.isValid=this._isValidType()&&this._isValidVersion())}async _parseContent(t){const n=t.length;let o=0,i=0,s=!1,r=0,c="",u=0;for(;i<n;)t[i]===13?s=!0:t[i]===10&&(s?(s=!1,r=i-1):r=i,c=this._decoder.decode(t.slice(o,r)),o=i+1,u>1&&c.trim().length!==0&&!c.startsWith("//")&&(c.endsWith("\\")?this._currentLine+=c.slice(0,c.length-1)+`
45
- `:(this._currentLine+=c,this._parseLine())),++u),++i;const y=this._data,m=y.frames;if(m.length>0){m.push(this._currentFrame);const w=y.globalProperties.referenceTime,b=m.findIndex(O=>O.scene.size>0);w.isValid()&&b!==-1?(y.timeSpan.start=w.add(m[b].timeStamp,"seconds"),y.timeSpan.end=w.add(m[m.length-1].timeStamp,"seconds")):y.isValid=!1}}_parseLine(){const t=this._data,n=t.frames,o=this._currentFrame,i=this._destroyedIds,s=this._filteredIds;let r=this._currentLine;if(!r.startsWith("0,Event"))if(r.startsWith("0,"))r=r.slice(2),r.split(this._propertySeparator).forEach(u=>{const y=u.indexOf("=");if(y>=0){const m=u.slice(0,y),w=u.slice(y+1),b=t.globalProperties;switch(m){case"DataSource":b.dataSource=w;break;case"DataRecorder":b.dataRecorder=w;break;case"ReferenceTime":b.referenceTime=Ue(w);break;case"RecordingTime":b.recordingTime=Ue(w);break;case"Author":b.author=w;break;case"Title":b.title=w;break;case"Category":b.category=w;break;case"Briefing":b.briefing=w;break;case"Debriefing":b.debriefing=w;break;case"Comments":b.comments=w;break;case"ReferenceLongitude":b.referenceLongitude=+w,this._refLong=b.referenceLongitude;break;case"ReferenceLatitude":b.referenceLatitude=+w,this._refLat=b.referenceLatitude;break;default:b.additionalProps===void 0&&(b.additionalProps=new Map),b.additionalProps.set(m,w);break}}else t.isValid=!1});else if(r.startsWith("#")){i.length>0&&(i.forEach(u=>o.scene.delete(u)),this._destroyedIds=[]);const c=+r.slice(1);c!==this._currentTimeStamp&&(n.push(o),this._currentTimeStamp=c,this._currentFrame=new qt(this._currentTimeStamp,o.scene))}else if(r.startsWith("-")){const c=parseInt(r.slice(1),16),u=t.entities.get(c);u&&(u.timeSpan.end=t.globalProperties.referenceTime.add(this._currentTimeStamp,"second")),s.indexOf(c)>=0&&i.push(c)}else{const c=r.indexOf(",");if(c>=0){const u=parseInt(r.slice(0,c),16),y=r.slice(c+1);let m=t.entities.get(u),w=!1;m===void 0&&(w=!0,m=new Hi(u),m.timeSpan.start=t.globalProperties.referenceTime.add(this._currentTimeStamp,"second"));const b=y.split(this._propertySeparator);if(b.forEach(O=>{const R=O.indexOf("=");if(R>=0){const T=O.slice(0,R),z=O.slice(R+1);switch(T){case"Name":m.name=z;break;case"Type":m.types=z.split("+");break;case"CallSign":m.callsign=z;break;case"Pilot":m.pilot=z;break;case"Group":m.group=z;break;case"Country":m.country=z;break;case"Coalition":m.coalition=z;break;case"Color":m.color=z;break;case"destroyed":+z==1&&(m.timeSpan.end=t.globalProperties.referenceTime.add(this._currentTimeStamp,"second"));break}}else t.isValid=!1}),w){const O=this._filter;let R=!0;if(O!==void 0&&O.length>0){const T=m.types;R=T!==void 0?T.every(z=>!O.includes(z)):!O.includes("Untyped")}R&&(t.entities.set(u,m),s.push(u))}if(s.indexOf(u)>=0){const O=this._refLong,R=this._refLat,T=b.findIndex(z=>z.startsWith("T="));if(T>=0){const z=b[T],D=z.indexOf("=");if(D>=0){const q=o.scene.get(u),x={latitude:(q==null?void 0:q.latitude)??0,longitude:(q==null?void 0:q.longitude)??0,altitude:(q==null?void 0:q.altitude)??0,yaw:q==null?void 0:q.yaw,pitch:q==null?void 0:q.pitch,roll:q==null?void 0:q.roll},N=z.slice(D+1).split("|");N.length<=5?(N[0].length&&(x.longitude=O+ +N[0]),N[1].length&&(x.latitude=R+ +N[1]),N[2].length&&(x.altitude=+N[2])):(N[0].length&&(x.longitude=O+ +N[0]),N[1].length&&(x.latitude=R+ +N[1]),N[2].length&&(x.altitude=+N[2]),N[3].length&&(x.roll=+N[3]),N[4].length&&(x.pitch=+N[4]),N[5].length&&(x.yaw=+N[5])),o.scene.set(u,x)}}}}else t.isValid=!1}this._currentLine=""}_isZipped(t){return t.length>1?new TextDecoder().decode(t.slice(0,2))==="PK":!1}async _unzip(t){const{entries:n}=await ja(t),o=Object.values(n);if(o.length===1)return new Uint8Array(await o[0].arrayBuffer());throw"Invalid compressed ACMI file"}async _parseBuffer(t){return this._parseHeader(t),await this._parseContent(t),this._data.entities.forEach(n=>{n.timeSpan.end.isValid()||(n.timeSpan.end=this._data.timeSpan.end.clone())}),this._data}async parse(t,n){return new Promise((o,i)=>{var s;(s=n==null?void 0:n.controller)==null||s.signal.addEventListener("abort",i),this._data=new ro,this._filter=(n==null?void 0:n.filter)??[],this._currentLine="",this._currentTimeStamp=0,this._currentFrame=new qt(this._currentTimeStamp),this._destroyedIds=[],this._filteredIds=[],this._isZipped(t)?this._unzip(t).then(r=>this._parseBuffer(r).then(c=>o(c))):this._parseBuffer(t).then(r=>o(r))})}}exports.AcmiData=ro;exports.AcmiHeader=Bi;exports.EntityProps=Hi;exports.Frame=qt;exports.GlobalProperties=Wi;exports.TimeSpan=Oo;exports.Trajectory=Bt;exports.default=Pa;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),u=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){"use strict";var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))})),d=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isSameOrBefore=r()})(e,(function(){"use strict";return function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}}))})),f=c(u(),1),p=c(d(),1),m=c(l(),1),h=class{referenceTime=(0,m.default)(null);dataSource;dataRecorder;recordingTime;author;title;category;briefing;debriefing;comments;referenceLongitude;referenceLatitude;additionalProps},g=class{fileType=``;fileVersion=``};m.default.extend(f.default);var _=class{start=(0,m.default)(null);end=(0,m.default)(null);isValid(){return this.start.isValid()&&this.end.isValid()}duration(){return this.isValid()?m.default.duration(this.end.diff(this.start)).asSeconds():-1}},v=1/Math.PI*180,y=1/180*Math.PI;globalThis.mathgl=globalThis.mathgl||{config:{EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1}};var b=globalThis.mathgl.config;function x(e,{precision:t=b.precision}={}){return e=k(e),`${parseFloat(e.toPrecision(t))}`}function S(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function C(e){return T(e)}function w(e){return E(e)}function T(e,t){return j(e,e=>e*y,t)}function E(e,t){return j(e,e=>e*v,t)}function D(e,t,n){return j(e,e=>Math.max(t,Math.min(n,e)))}function O(e,t,n){let r=b.EPSILON;n&&(b.EPSILON=n);try{if(e===t)return!0;if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!O(e[n],t[n]))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)<=b.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{b.EPSILON=r}}function k(e){return Math.round(e/b.EPSILON)*b.EPSILON}function A(e){return e.clone?e.clone():Array(e.length)}function j(e,t,n){if(S(e)){let r=e;n||=A(r);for(let i=0;i<n.length&&i<r.length;++i){let r=typeof e==`number`?e:e[i];n[i]=t(r,i,n)}return n}return t(e)}var M=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:S(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(b)}formatString(e){let t=``;for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?`, `:``)+x(this[n],e);return`${e.printTypes?this.constructor.name:``}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!O(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){if(n===void 0)return this.lerp(this,e,t);for(let r=0;r<this.ELEMENTS;++r){let i=e[r],a=typeof t==`number`?t:t[r];this[r]=i+n*(a-i)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(let t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(let t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(typeof e==`number`)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(let t=0;t<this.ELEMENTS&&t<e.length;++t)this[t]*=e[t];return this.check()}multiplyByScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}check(){if(b.debug&&!this.validate())throw Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e&&=Number.isFinite(this[t]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),t);return this.check()}get elements(){return this}};function N(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function P(e){if(!Number.isFinite(e))throw Error(`Invalid number ${JSON.stringify(e)}`);return e}function F(e,t,n=``){if(b.debug&&!N(e,t))throw Error(`math.gl: ${n} some fields set to invalid numbers'`);return e}function I(e,t){if(!e)throw Error(`math.gl assertion ${t}`)}var ee=class extends M{get x(){return this[0]}set x(e){this[0]=P(e)}get y(){return this[1]}set y(e){this[1]=P(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let n=0;n<this.ELEMENTS;++n){let r=this[n]-e[n];t+=r*r}return P(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return P(t)}normalize(){let e=this.magnitude();if(e!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(let t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(let t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return I(e>=0&&e<this.ELEMENTS,`index is out of range`),P(this[e])}setComponent(e,t){return I(e>=0&&e<this.ELEMENTS,`index is out of range`),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}},L=typeof Float32Array<`u`?Float32Array:Array;Math.PI/180;function te(){let e=new L(2);return L!=Float32Array&&(e[0]=0,e[1]=0),e}function ne(e,t,n){let r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e}function re(e,t,n){let r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}(function(){let e=te();return function(t,n,r,i,a,o){let s,c;for(n||=2,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}})();function ie(e,t,n){let r=t[0],i=t[1],a=n[3]*r+n[7]*i||1;return e[0]=(n[0]*r+n[4]*i)/a,e[1]=(n[1]*r+n[5]*i)/a,e}function ae(e,t,n){let r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a||1;return e[0]=(n[0]*r+n[4]*i+n[8]*a)/o,e[1]=(n[1]*r+n[5]*i+n[9]*a)/o,e[2]=(n[2]*r+n[6]*i+n[10]*a)/o,e}function oe(e,t,n){let r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e[2]=t[2],e}function R(e,t,n){let r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e[2]=t[2],e[3]=t[3],e}function z(e,t,n){let r=t[0],i=t[1],a=t[2];return e[0]=n[0]*r+n[3]*i+n[6]*a,e[1]=n[1]*r+n[4]*i+n[7]*a,e[2]=n[2]*r+n[5]*i+n[8]*a,e[3]=t[3],e}function se(){let e=new L(3);return L!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function ce(e){let t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}function le(e,t,n){let r=new L(3);return r[0]=e,r[1]=t,r[2]=n,r}function ue(e,t){let n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function de(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function fe(e,t,n){let r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e}function B(e,t,n){let r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o||=1,e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e}function pe(e,t,n){let r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e}function me(e,t,n){let r=n[0],i=n[1],a=n[2],o=n[3],s=t[0],c=t[1],l=t[2],u=i*l-a*c,d=a*s-r*l,f=r*c-i*s,p=i*f-a*d,m=a*u-r*f,h=r*d-i*u,g=o*2;return u*=g,d*=g,f*=g,p*=2,m*=2,h*=2,e[0]=s+u+p,e[1]=c+d+m,e[2]=l+f+h,e}function he(e,t,n,r){let i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function ge(e,t,n,r){let i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function _e(e,t,n,r){let i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e}function ve(e,t){let n=e[0],r=e[1],i=e[2],a=t[0],o=t[1],s=t[2],c=Math.sqrt((n*n+r*r+i*i)*(a*a+o*o+s*s)),l=c&&de(e,t)/c;return Math.acos(Math.min(Math.max(l,-1),1))}var ye=ce;(function(){let e=se();return function(t,n,r,i,a,o){let s,c;for(n||=3,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}})();var be=[0,0,0],xe,Se,Ce,we,V=class e extends ee{static get ZERO(){return xe||(xe=new e(0,0,0),Object.freeze(xe)),xe}static get X_AXIS(){return Se||(Se=new e(1,0,0),Object.freeze(Se)),Se}static get Y_AXIS(){return Ce||(Ce=new e(0,1,0),Object.freeze(Ce)),Ce}static get Z_AXIS(){return we||(we=new e(0,0,1),Object.freeze(we)),we}constructor(e=0,t=0,n=0){super(-0,-0,-0),arguments.length===1&&S(e)?this.copy(e):(b.debug&&(P(e),P(t),P(n)),this[0]=e,this[1]=t,this[2]=n)}set(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return b.debug&&(P(e.x),P(e.y),P(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=P(e)}angle(e){return ve(this,e)}static cross(e,t,n){return n||=[-0,-0,-0],fe(n,e,t),n}cross(e){return fe(this,this,e),this.check()}rotateX({radians:e,origin:t=be}){return he(this,this,t,e),this.check()}rotateY({radians:e,origin:t=be}){return ge(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=be}){return _e(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return B(this,this,e),this.check()}transformAsVector(e){return ae(this,this,e),this.check()}transformByMatrix3(e){return pe(this,this,e),this.check()}transformByMatrix2(e){return oe(this,this,e),this.check()}transformByQuaternion(e){return me(this,this,e),this.check()}},Te,Ee=class e extends ee{static get ZERO(){return Te||(Te=new e(0,0,0,0),Object.freeze(Te)),Te}constructor(e=0,t=0,n=0,r=0){super(-0,-0,-0,-0),S(e)&&arguments.length===1?this.copy(e):(b.debug&&(P(e),P(t),P(n),P(r)),this[0]=e,this[1]=t,this[2]=n,this[3]=r)}set(e,t,n,r){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return b.debug&&(P(e.x),P(e.y),P(e.z),P(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=P(e)}get w(){return this[3]}set w(e){this[3]=P(e)}transform(e){return B(this,this,e),this.check()}transformByMatrix3(e){return z(this,this,e),this.check()}transformByMatrix2(e){return R(this,this,e),this.check()}transformByQuaternion(e){return me(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}},De=class extends M{toString(){let e=`[`;if(b.printRowMajor){e+=`row-major:`;for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+t]}`}else{e+=`column-major:`;for(let t=0;t<this.ELEMENTS;++t)e+=` ${this[t]}`}return e+=`]`,e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=P(n),this}getColumn(e,t=Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){let n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}};function Oe(){let e=new L(9);return L!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ke(e,t){if(e===t){let n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,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 Ae(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=u*o-s*l,f=-u*a+s*c,p=l*a-o*c,m=n*d+r*f+i*p;return m?(m=1/m,e[0]=d*m,e[1]=(-u*r+i*l)*m,e[2]=(s*r-i*o)*m,e[3]=f*m,e[4]=(u*n-i*c)*m,e[5]=(-s*n+i*a)*m,e[6]=p*m,e[7]=(-l*n+r*c)*m,e[8]=(o*n-r*a)*m,e):null}function je(e){let t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*(l*a-o*c)+n*(-l*i+o*s)+r*(c*i-a*s)}function Me(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=n[0],p=n[1],m=n[2],h=n[3],g=n[4],_=n[5],v=n[6],y=n[7],b=n[8];return e[0]=f*r+p*o+m*l,e[1]=f*i+p*s+m*u,e[2]=f*a+p*c+m*d,e[3]=h*r+g*o+_*l,e[4]=h*i+g*s+_*u,e[5]=h*a+g*c+_*d,e[6]=v*r+y*o+b*l,e[7]=v*i+y*s+b*u,e[8]=v*a+y*c+b*d,e}function Ne(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=f*r+p*o+l,e[7]=f*i+p*s+u,e[8]=f*a+p*c+d,e}function Pe(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=Math.sin(n),p=Math.cos(n);return e[0]=p*r+f*o,e[1]=p*i+f*s,e[2]=p*a+f*c,e[3]=p*o-f*r,e[4]=p*s-f*i,e[5]=p*c-f*a,e[6]=l,e[7]=u,e[8]=d,e}function Fe(e,t,n){let r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*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 Ie(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,d=r*s,f=i*o,p=i*s,m=i*c,h=a*o,g=a*s,_=a*c;return e[0]=1-d-m,e[3]=u-_,e[6]=f+g,e[1]=u+_,e[4]=1-l-m,e[7]=p-h,e[2]=f-g,e[5]=p+h,e[8]=1-l-d,e}var Le=function(e){return 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`,e}(Le||{}),Re=Object.freeze([1,0,0,0,1,0,0,0,1]),ze=class extends De{static get IDENTITY(){return Ue()}static get ZERO(){return He()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Le}constructor(e,...t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):t.length>0?this.copy([e,...t]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(Re)}fromObject(e){return this.check()}fromQuaternion(e){return Ie(this,e),this.check()}set(e,t,n,r,i,a,o,s,c){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=c,this.check()}setRowMajor(e,t,n,r,i,a,o,s,c){return this[0]=e,this[1]=r,this[2]=o,this[3]=t,this[4]=i,this[5]=s,this[6]=n,this[7]=a,this[8]=c,this.check()}determinant(){return je(this)}transpose(){return ke(this,this),this.check()}invert(){return Ae(this,this),this.check()}multiplyLeft(e){return Me(this,e,this),this.check()}multiplyRight(e){return Me(this,this,e),this.check()}rotate(e){return Pe(this,this,e),this.check()}scale(e){return Array.isArray(e)?Fe(this,this,e):Fe(this,this,[e,e]),this.check()}translate(e){return Ne(this,this,e),this.check()}transform(e,t){let n;switch(e.length){case 2:n=ne(t||[-0,-0],e,this);break;case 3:n=pe(t||[-0,-0,-0],e,this);break;case 4:n=z(t||[-0,-0,-0,-0],e,this);break;default:throw Error(`Illegal vector`)}return F(n,e.length),n}transformVector(e,t){return this.transform(e,t)}transformVector2(e,t){return this.transform(e,t)}transformVector3(e,t){return this.transform(e,t)}},Be,Ve=null;function He(){return Be||(Be=new ze([0,0,0,0,0,0,0,0,0]),Object.freeze(Be)),Be}function Ue(){return Ve||(Ve=new ze,Object.freeze(Ve)),Ve}function We(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 Ge(e,t){if(e===t){let n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}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 Ke(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(A=1/A,e[0]=(s*k-c*O+l*D)*A,e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null}function qe(e){let t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=t*o-n*a,v=t*s-r*a,y=n*s-r*o,b=l*m-u*p,x=l*h-d*p,S=u*h-d*m,C=t*S-n*x+r*b,w=a*S-o*x+s*b,T=l*y-u*v+d*_,E=p*y-m*v+h*_;return c*C-i*w+g*T-f*E}function Je(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,y=n[4],b=n[5],x=n[6],S=n[7],e[4]=y*r+b*s+x*d+S*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,y=n[8],b=n[9],x=n[10],S=n[11],e[8]=y*r+b*s+x*d+S*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,y=n[12],b=n[13],x=n[14],S=n[15],e[12]=y*r+b*s+x*d+S*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e}function Ye(e,t,n){let r=n[0],i=n[1],a=n[2],o,s,c,l,u,d,f,p,m,h,g,_;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*a+t[12],e[13]=t[1]*r+t[5]*i+t[9]*a+t[13],e[14]=t[2]*r+t[6]*i+t[10]*a+t[14],e[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],c=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],e[0]=o,e[1]=s,e[2]=c,e[3]=l,e[4]=u,e[5]=d,e[6]=f,e[7]=p,e[8]=m,e[9]=h,e[10]=g,e[11]=_,e[12]=o*r+u*i+m*a+t[12],e[13]=s*r+d*i+h*a+t[13],e[14]=c*r+f*i+g*a+t[14],e[15]=l*r+p*i+_*a+t[15]),e}function Xe(e,t,n){let r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Ze(e,t,n,r){let i=r[0],a=r[1],o=r[2],s=Math.sqrt(i*i+a*a+o*o),c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,l=Math.sin(n),c=Math.cos(n),u=1-c,d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8],b=t[9],x=t[10],S=t[11],C=i*i*u+c,w=a*i*u+o*l,T=o*i*u-a*l,E=i*a*u-o*l,D=a*a*u+c,O=o*a*u+i*l,k=i*o*u+a*l,A=a*o*u-i*l,j=o*o*u+c,e[0]=d*C+h*w+y*T,e[1]=f*C+g*w+b*T,e[2]=p*C+_*w+x*T,e[3]=m*C+v*w+S*T,e[4]=d*E+h*D+y*O,e[5]=f*E+g*D+b*O,e[6]=p*E+_*D+x*O,e[7]=m*E+v*D+S*O,e[8]=d*k+h*A+y*j,e[9]=f*k+g*A+b*j,e[10]=p*k+_*A+x*j,e[11]=m*k+v*A+S*j,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Qe(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=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]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e}function $e(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[8],u=t[9],d=t[10],f=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]=a*i-l*r,e[1]=o*i-u*r,e[2]=s*i-d*r,e[3]=c*i-f*r,e[8]=a*r+l*i,e[9]=o*r+u*i,e[10]=s*r+d*i,e[11]=c*r+f*i,e}function et(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=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]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e}function tt(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=r+r,c=i+i,l=a+a,u=r*s,d=r*c,f=r*l,p=i*c,m=i*l,h=a*l,g=o*s,_=o*c,v=o*l;return e[0]=1-(p+h),e[1]=d+v,e[2]=f-_,e[3]=0,e[4]=d-v,e[5]=1-(u+h),e[6]=m+g,e[7]=0,e[8]=f+_,e[9]=m-g,e[10]=1-(u+p),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function nt(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,d=r*s,f=i*o,p=i*s,m=i*c,h=a*o,g=a*s,_=a*c;return e[0]=1-d-m,e[1]=u+_,e[2]=f-g,e[3]=0,e[4]=u-_,e[5]=1-l-m,e[6]=p+h,e[7]=0,e[8]=f+g,e[9]=p-h,e[10]=1-l-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function rt(e,t,n,r,i,a,o){let s=1/(n-t),c=1/(i-r),l=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*c,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*c,e[10]=(o+a)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*l,e[15]=0,e}function it(e,t,n,r,i){let a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,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 t=1/(r-i);e[10]=(i+r)*t,e[14]=2*i*r*t}else e[10]=-1,e[14]=-2*r;return e}var at=it;function ot(e,t,n,r,i,a,o){let s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,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+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e}var st=ot;function ct(e,t,n,r){let i,a,o,s,c,l,u,d,f,p,m=t[0],h=t[1],g=t[2],_=r[0],v=r[1],y=r[2],b=n[0],x=n[1],S=n[2];return Math.abs(m-b)<1e-6&&Math.abs(h-x)<1e-6&&Math.abs(g-S)<1e-6?We(e):(d=m-b,f=h-x,p=g-S,i=1/Math.sqrt(d*d+f*f+p*p),d*=i,f*=i,p*=i,a=v*p-y*f,o=y*d-_*p,s=_*f-v*d,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),c=f*s-p*o,l=p*a-d*s,u=d*o-f*a,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]=a,e[1]=c,e[2]=d,e[3]=0,e[4]=o,e[5]=l,e[6]=f,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=0,e[12]=-(a*m+o*h+s*g),e[13]=-(c*m+l*h+u*g),e[14]=-(d*m+f*h+p*g),e[15]=1,e)}function lt(){let e=new L(4);return L!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function ut(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e}function dt(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function ft(e){let t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)}function pt(e){let t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i}function mt(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=n*o,e[1]=r*o,e[2]=i*o,e[3]=a*o,e}function ht(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function gt(e,t,n,r){let i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+r*(n[0]-i),e[1]=a+r*(n[1]-a),e[2]=o+r*(n[2]-o),e[3]=s+r*(n[3]-s),e}function _t(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}function vt(e,t,n){let r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2],l=n[3],u=l*r+s*a-c*i,d=l*i+c*r-o*a,f=l*a+o*i-s*r,p=-o*r-s*i-c*a;return e[0]=u*l+p*-o+d*-c-f*-s,e[1]=d*l+p*-s+f*-o-u*-c,e[2]=f*l+p*-c+u*-s-d*-o,e[3]=t[3],e}(function(){let e=lt();return function(t,n,r,i,a,o){let s,c;for(n||=4,r||=0,c=i?Math.min(i*n+r,t.length):t.length,s=r;s<c;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}})();var yt=function(e){return 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`,e}(yt||{}),bt=45*Math.PI/180,xt=1,St=.1,Ct=500,wt=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Tt=class extends De{static get IDENTITY(){return kt()}static get ZERO(){return Ot()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return yt}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=i,this[5]=a,this[6]=o,this[7]=s,this[8]=c,this[9]=l,this[10]=u,this[11]=d,this[12]=f,this[13]=p,this[14]=m,this[15]=h,this.check()}setRowMajor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){return this[0]=e,this[1]=i,this[2]=c,this[3]=f,this[4]=t,this[5]=a,this[6]=l,this[7]=p,this[8]=n,this[9]=o,this[10]=u,this[11]=m,this[12]=r,this[13]=s,this[14]=d,this[15]=h,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(wt)}fromObject(e){return this.check()}fromQuaternion(e){return nt(this,e),this.check()}fromTranslationQuaternion(e,t){return tt(this,t,e),this.check()}frustum(e){let{left:t,right:n,bottom:r,top:i,near:a=St,far:o=Ct}=e;return o===1/0?jt(this,t,n,r,i,a):rt(this,t,n,r,i,a,o),this.check()}lookAt(e){let{eye:t,center:n=[0,0,0],up:r=[0,1,0]}=e;return ct(this,t,n,r),this.check()}ortho(e){let{left:t,right:n,bottom:r,top:i,near:a=St,far:o=Ct}=e;return st(this,t,n,r,i,a,o),this.check()}orthographic(e){let{fovy:t=bt,aspect:n=xt,focalDistance:r=1,near:i=St,far:a=Ct}=e;At(t);let o=t/2,s=r*Math.tan(o),c=s*n;return this.ortho({left:-c,right:c,bottom:-s,top:s,near:i,far:a})}perspective(e){let{fovy:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:i=500}=e;return At(t),at(this,t,n,r,i),this.check()}determinant(){return qe(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t){t||=[-0,-0,-0];let n=this.getScale(t),r=1/n[0],i=1/n[1],a=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*i,e[6]=this[6]*a,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*i,e[10]=this[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t){t||=[-0,-0,-0];let n=this.getScale(t),r=1/n[0],i=1/n[1],a=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*i,e[2]=this[2]*a,e[3]=this[4]*r,e[4]=this[5]*i,e[5]=this[6]*a,e[6]=this[8]*r,e[7]=this[9]*i,e[8]=this[10]*a,e}transpose(){return Ge(this,this),this.check()}invert(){return Ke(this,this),this.check()}multiplyLeft(e){return Je(this,e,this),this.check()}multiplyRight(e){return Je(this,this,e),this.check()}rotateX(e){return Qe(this,this,e),this.check()}rotateY(e){return $e(this,this,e),this.check()}rotateZ(e){return et(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,t){return Ze(this,this,e,t),this.check()}scale(e){return Xe(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return Ye(this,this,e),this.check()}transform(e,t){return e.length===4?(t=_t(t||[-0,-0,-0,-0],e,this),F(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){let{length:n}=e,r;switch(n){case 2:r=re(t||[-0,-0],e,this);break;case 3:r=B(t||[-0,-0,-0],e,this);break;default:throw Error(`Illegal vector`)}return F(r,e.length),r}transformAsVector(e,t){let n;switch(e.length){case 2:n=ie(t||[-0,-0],e,this);break;case 3:n=ae(t||[-0,-0,-0],e,this);break;default:throw Error(`Illegal vector`)}return F(n,e.length),n}transformPoint(e,t){return this.transformAsPoint(e,t)}transformVector(e,t){return this.transformAsPoint(e,t)}transformDirection(e,t){return this.transformAsVector(e,t)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}},Et,Dt;function Ot(){return Et||(Et=new Tt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Et)),Et}function kt(){return Dt||(Dt=new Tt,Object.freeze(Dt)),Dt}function At(e){if(e>Math.PI*2)throw Error(`expected radians`)}function jt(e,t,n,r,i,a){let o=2*a/(n-t),s=2*a/(i-r),c=(n+t)/(n-t),l=(i+r)/(i-r),u=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=c,e[9]=l,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=u,e[15]=0,e}function Mt(){let e=new L(4);return L!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Nt(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Pt(e,t,n){n*=.5;let r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function Ft(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=n[0],c=n[1],l=n[2],u=n[3];return e[0]=r*u+o*s+i*l-a*c,e[1]=i*u+o*c+a*s-r*l,e[2]=a*u+o*l+r*c-i*s,e[3]=o*u-r*s-i*c-a*l,e}function It(e,t,n){n*=.5;let r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+o*s,e[1]=i*c+a*s,e[2]=a*c-i*s,e[3]=o*c-r*s,e}function Lt(e,t,n){n*=.5;let r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c-a*s,e[1]=i*c+o*s,e[2]=a*c+r*s,e[3]=o*c-i*s,e}function Rt(e,t,n){n*=.5;let r=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(n),c=Math.cos(n);return e[0]=r*c+i*s,e[1]=i*c-r*s,e[2]=a*c+o*s,e[3]=o*c-a*s,e}function zt(e,t){let n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e}function Bt(e,t,n,r){let i=t[0],a=t[1],o=t[2],s=t[3],c=n[0],l=n[1],u=n[2],d=n[3],f,p,m,h,g;return f=i*c+a*l+o*u+s*d,f<0&&(f=-f,c=-c,l=-l,u=-u,d=-d),1-f>1e-6?(p=Math.acos(f),g=Math.sin(p),m=Math.sin((1-r)*p)/g,h=Math.sin(r*p)/g):(m=1-r,h=r),e[0]=m*i+h*c,e[1]=m*a+h*l,e[2]=m*o+h*u,e[3]=m*s+h*d,e}function Vt(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=a*s,e}function Ht(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function Ut(e,t){let n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{let n=0;t[4]>t[0]&&(n=1),t[8]>t[n*3+n]&&(n=2);let i=(n+1)%3,a=(n+2)%3;r=Math.sqrt(t[n*3+n]-t[i*3+i]-t[a*3+a]+1),e[n]=.5*r,r=.5/r,e[3]=(t[i*3+a]-t[a*3+i])*r,e[i]=(t[i*3+n]+t[n*3+i])*r,e[a]=(t[a*3+n]+t[n*3+a])*r}return e}function Wt(e,t,n,r,i=0){t*=.5,r*=.5,n*=.5;let a=Math.sin(t),o=Math.cos(t),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);switch(i){case 0:e[0]=a*c*u-o*s*l,e[1]=o*s*u+a*c*l,e[2]=o*c*l-a*s*u,e[3]=o*c*u+a*s*l;break;case 1:e[0]=a*c*u+o*s*l,e[1]=o*s*u-a*c*l,e[2]=o*c*l-a*s*u,e[3]=o*c*u+a*s*l;break;case 2:e[0]=a*c*u-o*s*l,e[1]=o*s*u-a*c*l,e[2]=o*c*l+a*s*u,e[3]=o*c*u+a*s*l;break;case 3:e[0]=a*c*u-o*s*l,e[1]=o*s*u+a*c*l,e[2]=o*c*l+a*s*u,e[3]=o*c*u-a*s*l;break;case 4:e[0]=a*c*u+o*s*l,e[1]=o*s*u+a*c*l,e[2]=o*c*l-a*s*u,e[3]=o*c*u-a*s*l;break;case 5:e[0]=a*c*u+o*s*l,e[1]=o*s*u-a*c*l,e[2]=o*c*l+a*s*u,e[3]=o*c*u-a*s*l;break;default:throw Error(`Unknown angle order `+i)}return e}var Gt=ut,Kt=dt,qt=ht,Jt=gt,Yt=ft,Xt=pt,Zt=mt,Qt=(function(){let e=se(),t=le(1,0,0),n=le(0,1,0);return function(r,i,a){let o=de(i,a);return o<-.999999?(fe(e,t,i),ye(e)<1e-6&&fe(e,n,i),ue(e,e),Pt(r,e,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(fe(e,i,a),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+o,Zt(r,r))}})();(function(){let e=Mt(),t=Mt();return function(n,r,i,a,o,s){return Bt(e,r,o,s),Bt(t,i,a,s),Bt(n,e,t,2*s*(1-s)),n}})(),(function(){let e=Oe();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],Zt(t,Ut(t,e))}})();var $t=[0,0,0,1],H=class extends M{constructor(e=0,t=0,n=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,t,n,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,r){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return Ut(this,e),this.check()}fromAxisRotation(e,t){return Pt(this,e,t),this.check()}fromEuler(e){return Wt(this,e.x,e.y,e.z,e.order),this.check()}identity(){return Nt(this),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=P(e)}get y(){return this[1]}set y(e){this[1]=P(e)}get z(){return this[2]}set z(e){this[2]=P(e)}get w(){return this[3]}set w(e){this[3]=P(e)}len(){return Yt(this)}lengthSquared(){return Xt(this)}dot(e){return qt(this,e)}rotationTo(e,t){return Qt(this,e,t),this.check()}add(e){return Gt(this,this,e),this.check()}calculateW(){return zt(this,this),this.check()}conjugate(){return Ht(this,this),this.check()}invert(){return Vt(this,this),this.check()}lerp(e,t,n){return n===void 0?this.lerp(this,e,t):(Jt(this,e,t,n),this.check())}multiplyRight(e){return Ft(this,this,e),this.check()}multiplyLeft(e){return Ft(this,e,this),this.check()}normalize(){let e=this.len(),t=e>0?1/e:0;return this[0]*=t,this[1]*=t,this[2]*=t,this[3]*=t,e===0&&(this[3]=1),this.check()}rotateX(e){return It(this,this,e),this.check()}rotateY(e){return Lt(this,this,e),this.check()}rotateZ(e){return Rt(this,this,e),this.check()}scale(e){return Kt(this,this,e),this.check()}slerp(e,t,n){let r,i,a;switch(arguments.length){case 1:({start:r=$t,target:i,ratio:a}=e);break;case 2:r=this,i=e,a=t;break;default:r=e,i=t,a=n}return Bt(this,r,i,a),this.check()}transformVector4(e,t=new Ee){return vt(t,e,this),F(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}},en=`Unknown Euler angle order`,tn=.99999,nn=function(e){return e[e.ZYX=0]=`ZYX`,e[e.YXZ=1]=`YXZ`,e[e.XZY=2]=`XZY`,e[e.ZXY=3]=`ZXY`,e[e.YZX=4]=`YZX`,e[e.XYZ=5]=`XYZ`,e}(nn||{}),rn=class e extends M{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return 0}static get RotationOrders(){return nn}static rotationOrder(e){return nn[e]}get ELEMENTS(){return 4}constructor(t=0,n=0,r=0,i=e.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...rest):this.set(t,n,r,i)}fromQuaternion(t){let[n,r,i,a]=t,o=r*r,s=-2*(o+i*i)+1,c=2*(n*r+a*i),l=-2*(n*i-a*r),u=2*(r*i+a*n),d=-2*(n*n+o)+1;l=l>1?1:l,l=l<-1?-1:l;let f=Math.atan2(u,d),p=Math.asin(l),m=Math.atan2(c,s);return this.set(f,p,m,e.RollPitchYaw)}fromObject(e){throw Error(`not implemented`)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=Number.isFinite(e[3])||this.order,this.check()}set(e=0,t=0,n=0,r){return this[0]=e,this[1]=t,this[2]=n,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return an(this[3])&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2])}toArray(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e}toArray4(e=[],t=0){return e[t]=this[0],e[t+1]=this[1],e[t+2]=this[2],e[t+3]=this[3],e}toVector3(e=[-0,-0,-0]){return e[0]=this[0],e[1]=this[1],e[2]=this[2],e}toHeadingPitchRoll(e=[-0,-0,-0]){switch(this[3]){case 5:e[0]=-this[0],e[1]=-this[1],e[2]=this[2];break;case 1:e[0]=-this[1],e[1]=-this[0],e[2]=this[2];break;case 3:e[0]=-this[2],e[1]=-this[0],e[2]=this[1];break;case 0:e[0]=-this[2],e[1]=-this[1],e[2]=this[0];break;case 4:e[0]=-this[1],e[1]=-this[2],e[2]=this[0];break;case 2:e[0]=-this[0],e[1]=-this[2],e[2]=this[1];break;default:throw Error(en)}return e}get x(){return this[0]}set x(e){this[0]=P(e)}get y(){return this[1]}set y(e){this[1]=P(e)}get z(){return this[2]}set z(e){this[2]=P(e)}get alpha(){return this[0]}set alpha(e){this[0]=P(e)}get beta(){return this[1]}set beta(e){this[1]=P(e)}get gamma(){return this[2]}set gamma(e){this[2]=P(e)}get phi(){return this[0]}set phi(e){this[0]=P(e)}get theta(){return this[1]}set theta(e){this[1]=P(e)}get psi(){return this[2]}set psi(e){this[2]=P(e)}get roll(){return this[0]}set roll(e){this[0]=P(e)}get pitch(){return this[1]}set pitch(e){this[1]=P(e)}get yaw(){return this[2]}set yaw(e){this[2]=P(e)}get order(){return this[3]}set order(e){this[3]=on(e)}fromVector3(e,t){return this.set(e[0],e[1],e[2],Number.isFinite(t)?t:this[3])}fromArray(e,t=0){return this[0]=e[0+t],this[1]=e[1+t],this[2]=e[2+t],e[3]!==void 0&&(this[3]=e[3]),this.check()}fromRollPitchYaw(e,t,n){return this.set(e,t,n,0)}fromRotationMatrix(t,n=e.DefaultOrder){return this._fromRotationMatrix(t,n),this.check()}getRotationMatrix(e){return this._getRotationMatrix(e)}getQuaternion(){let e=new H;switch(this[3]){case 5:return e.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case 1:return e.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case 3:return e.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case 0:return e.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case 4:return e.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case 2:return e.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw Error(en)}}_fromRotationMatrix(t,n=e.DefaultOrder){let r=t[0],i=t[4],a=t[8],o=t[1],s=t[5],c=t[9],l=t[2],u=t[6],d=t[10];switch(n||=this[3],n){case e.XYZ:this[1]=Math.asin(D(a,-1,1)),Math.abs(a)<tn?(this[0]=Math.atan2(-c,d),this[2]=Math.atan2(-i,r)):(this[0]=Math.atan2(u,s),this[2]=0);break;case e.YXZ:this[0]=Math.asin(-D(c,-1,1)),Math.abs(c)<tn?(this[1]=Math.atan2(a,d),this[2]=Math.atan2(o,s)):(this[1]=Math.atan2(-l,r),this[2]=0);break;case e.ZXY:this[0]=Math.asin(D(u,-1,1)),Math.abs(u)<tn?(this[1]=Math.atan2(-l,d),this[2]=Math.atan2(-i,s)):(this[1]=0,this[2]=Math.atan2(o,r));break;case e.ZYX:this[1]=Math.asin(-D(l,-1,1)),Math.abs(l)<tn?(this[0]=Math.atan2(u,d),this[2]=Math.atan2(o,r)):(this[0]=0,this[2]=Math.atan2(-i,s));break;case e.YZX:this[2]=Math.asin(D(o,-1,1)),Math.abs(o)<tn?(this[0]=Math.atan2(-c,s),this[1]=Math.atan2(-l,r)):(this[0]=0,this[1]=Math.atan2(a,d));break;case e.XZY:this[2]=Math.asin(-D(i,-1,1)),Math.abs(i)<tn?(this[0]=Math.atan2(u,s),this[1]=Math.atan2(a,r)):(this[0]=Math.atan2(-c,d),this[1]=0);break;default:throw Error(en)}return this[3]=n,this}_getRotationMatrix(t){let n=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=this.x,i=this.y,a=this.z,o=Math.cos(r),s=Math.cos(i),c=Math.cos(a),l=Math.sin(r),u=Math.sin(i),d=Math.sin(a);switch(this[3]){case e.XYZ:{let e=o*c,t=o*d,r=l*c,i=l*d;n[0]=s*c,n[4]=-s*d,n[8]=u,n[1]=t+r*u,n[5]=e-i*u,n[9]=-l*s,n[2]=i-e*u,n[6]=r+t*u,n[10]=o*s;break}case e.YXZ:{let e=s*c,t=s*d,r=u*c,i=u*d;n[0]=e+i*l,n[4]=r*l-t,n[8]=o*u,n[1]=o*d,n[5]=o*c,n[9]=-l,n[2]=t*l-r,n[6]=i+e*l,n[10]=o*s;break}case e.ZXY:{let e=s*c,t=s*d,r=u*c,i=u*d;n[0]=e-i*l,n[4]=-o*d,n[8]=r+t*l,n[1]=t+r*l,n[5]=o*c,n[9]=i-e*l,n[2]=-o*u,n[6]=l,n[10]=o*s;break}case e.ZYX:{let e=o*c,t=o*d,r=l*c,i=l*d;n[0]=s*c,n[4]=r*u-t,n[8]=e*u+i,n[1]=s*d,n[5]=i*u+e,n[9]=t*u-r,n[2]=-u,n[6]=l*s,n[10]=o*s;break}case e.YZX:{let e=o*s,t=o*u,r=l*s,i=l*u;n[0]=s*c,n[4]=i-e*d,n[8]=r*d+t,n[1]=d,n[5]=o*c,n[9]=-l*c,n[2]=-u*c,n[6]=t*d+r,n[10]=e-i*d;break}case e.XZY:{let e=o*s,t=o*u,r=l*s,i=l*u;n[0]=s*c,n[4]=-d,n[8]=u*c,n[1]=e*d+i,n[5]=o*c,n[9]=t*d-r,n[2]=r*d-t,n[6]=l*c,n[10]=i*d+e;break}default:throw Error(en)}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}toQuaternion(){let e=Math.cos(this.yaw*.5),t=Math.sin(this.yaw*.5),n=Math.cos(this.roll*.5),r=Math.sin(this.roll*.5),i=Math.cos(this.pitch*.5),a=Math.sin(this.pitch*.5),o=e*n*i+t*r*a;return new H(e*r*i-t*n*a,e*n*a+t*r*i,t*n*i-e*r*a,o)}};function an(e){return e>=0&&e<6}function on(e){if(e<0&&e>=6)throw Error(en);return e}var sn=.1,cn=1e-12,ln=1e-15;Math.PI/2,Math.PI/4,Math.PI/6,Math.PI*2;var un=6378137,dn=6378137,fn=6356752.314245179;un*un,dn*dn,fn*fn,1/un,1/dn,1/fn,1/(un*un),1/(dn*dn),1/(fn*fn);function pn(e){return e}new V;function mn(e,t=[],n=pn){return`longitude`in e?(t[0]=n(e.longitude),t[1]=n(e.latitude),t[2]=e.height):`x`in e?(t[0]=n(e.x),t[1]=n(e.y),t[2]=e.z):(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]),t}function hn(e,t=[]){return mn(e,t,b._cartographicRadians?pn:C)}function gn(e,t,n=pn){return`longitude`in t?(t.longitude=n(e[0]),t.latitude=n(e[1]),t.height=e[2]):`x`in t?(t.x=n(e[0]),t.y=n(e[1]),t.z=e[2]):(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]),t}function _n(e,t){return gn(e,t,b._cartographicRadians?pn:w)}var vn=1e-14,yn=new V,bn={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`}},xn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Sn={east:new V,north:new V,up:new V,west:new V,south:new V,down:new V},Cn=new V,wn=new V,Tn=new V;function En(e,t,n,r,i,a){let o=bn[t]&&bn[t][n];I(o&&(!r||r===o));let s,c,l,u=yn.copy(i);if(O(u.x,0,vn)&&O(u.y,0,vn)){let e=Math.sign(u.z);s=Cn.fromArray(xn[t]),t!==`east`&&t!==`west`&&s.scale(e),c=wn.fromArray(xn[n]),n!==`east`&&n!==`west`&&c.scale(e),l=Tn.fromArray(xn[r]),r!==`east`&&r!==`west`&&l.scale(e)}else{let{up:i,east:a,north:o}=Sn;a.set(-u.y,u.x,0).normalize(),e.geodeticSurfaceNormal(u,i),o.copy(i).cross(a);let{down:d,west:f,south:p}=Sn;d.copy(i).scale(-1),f.copy(a).scale(-1),p.copy(o).scale(-1),s=Sn[t],c=Sn[n],l=Sn[r]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=c.x,a[5]=c.y,a[6]=c.z,a[7]=0,a[8]=l.x,a[9]=l.y,a[10]=l.z,a[11]=0,a[12]=u.x,a[13]=u.y,a[14]=u.z,a[15]=1,a}var Dn=new V,On=new V,kn=new V;function An(e,t,n=[]){let{oneOverRadii:r,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;Dn.from(e);let o=Dn.x,s=Dn.y,c=Dn.z,l=r.x,u=r.y,d=r.z,f=o*o*l*l,p=s*s*u*u,m=c*c*d*d,h=f+p+m,g=Math.sqrt(1/h);if(!Number.isFinite(g))return;let _=On;if(_.copy(e).scale(g),h<a)return _.to(n);let v=i.x,y=i.y,b=i.z,x=kn;x.set(_.x*v*2,_.y*y*2,_.z*b*2);let S=(1-g)*Dn.len()/(.5*x.len()),C=0,w,T,E,D;do{S-=C,w=1/(1+S*v),T=1/(1+S*y),E=1/(1+S*b);let e=w*w,t=T*T,n=E*E,r=e*w,i=t*T,a=n*E;D=f*e+p*t+m*n-1;let o=-2*(f*r*v+p*i*y+m*a*b);C=D/o}while(Math.abs(D)>cn);return Dn.scale([w,T,E]).to(n)}var jn=new V,Mn=new V,Nn=new V,U=new V,Pn=new V,Fn=new V,In=new H,Ln=new Tt,Rn=new ze,zn=new ze,Bn=new V,Vn=new V,Hn=new V,Un=new H,Wn=new Tt,Gn=new ze,Kn=class e{static WGS84=new e(un,dn,fn);radii;radiiSquared;radiiToTheFourth;oneOverRadii;oneOverRadiiSquared;minimumRadius;maximumRadius;centerToleranceSquared=sn;squaredXOverSquaredZ=0;constructor(e=0,t=0,n=0){I(e>=0),I(t>=0),I(n>=0),this.radii=new V(e,t,n),this.radiiSquared=new V(e*e,t*t,n*n),this.radiiToTheFourth=new V(e*e*e*e,t*t*t*t,n*n*n*n),this.oneOverRadii=new V(e===0?0:1/e,t===0?0:1/t,n===0?0:1/n),this.oneOverRadiiSquared=new V(e===0?0:1/(e*e),t===0?0:1/(t*t),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,t,n),this.maximumRadius=Math.max(e,t,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||!!(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){let n=Mn,r=Nn,[,,i]=e;this.geodeticSurfaceNormalCartographic(e,n),r.copy(this.radiiSquared).scale(n);let a=Math.sqrt(n.dot(r));return r.scale(1/a),n.scale(i),r.add(n),r.to(t)}cartesianToCartographic(e,t=[0,0,0]){Fn.from(e);let n=this.scaleToGeodeticSurface(Fn,U);if(!n)return;let r=this.geodeticSurfaceNormal(n,Mn),i=Pn;return i.copy(Fn).subtract(n),_n([Math.atan2(r.y,r.x),Math.asin(r.z),Math.sign(de(i,Fn))*ce(i)],t)}eastNorthUpToFixedFrame(e,t=new Tt){return En(this,`east`,`north`,`up`,e,t)}localFrameToFixedFrame(e,t,n,r,i=new Tt){return En(this,e,t,n,r,i)}geocentricSurfaceNormal(e,t=[0,0,0]){return jn.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){let n=hn(e),r=n[0],i=n[1],a=Math.cos(i);return jn.set(a*Math.cos(r),a*Math.sin(r),Math.sin(i)).normalize(),jn.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return jn.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return An(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){U.from(e);let n=U.x,r=U.y,i=U.z,a=this.oneOverRadiiSquared,o=1/Math.sqrt(n*n*a.x+r*r*a.y+i*i*a.z);return U.multiplyScalar(o).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return U.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return U.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,n=[0,0,0]){I(O(this.radii.x,this.radii.y,ln)),I(this.radii.z>0),U.from(e);let r=U.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(r)>=this.radii.z-t))return U.set(0,0,r).to(n)}getEulerFromPositionQuaternion(e,t,n=new rn){return n.fromQuaternion(In.fromMatrix3(this.localFrameToFixedFrame(`north`,`west`,`up`,e,Ln).invert().getRotationMatrix3(Rn).multiplyRight(zn.fromQuaternion(t))).normalize()),n}getRotationMatrixFromPositionVelocity(e,t,n=new ze){let r=Fn.fromArray(e),i=this.geodeticSurfaceNormal(r,Mn),a=Bn.fromArray(t),o=V.cross(t,i,Vn);o.equals(V.ZERO)&&o.fromArray(V.X_AXIS);let s=V.cross(o,t,Hn).normalize();return o=V.cross(t,s,Vn).negate().normalize(),n[0]=a.x,n[1]=a.y,n[2]=a.z,n[3]=o.x,n[4]=o.y,n[5]=o.z,n[6]=s.x,n[7]=s.y,n[8]=s.z,n}getQuaternionFromEuler(e,t,n=new H){return n.fromMatrix3(this.localFrameToFixedFrame(`north`,`west`,`up`,e,Ln).multiplyRight(Wn.fromTranslationQuaternion(V.ZERO,Un.fromEuler(t))).getRotationMatrix3(Gn))}},qn=240,Jn=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],Yn=372,Xn=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],Zn=372,Qn=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],$n=12,er=10,tr=2,nr=class{_v00=0;_v01=0;_v10=0;_v11=0;_t=[];_ix;_iy;options;constructor(e){this.options=e,this._ix=this.options._width,this._iy=this.options._height}getHeight(e,t){if(e=Math.abs(e)>90?NaN:e,isNaN(e)||isNaN(t))return NaN;let n=rr(t,360);t=n===-180?180:n;let r=t*this.options._rlonres,i=-e*this.options._rlatres,a=Math.floor(r),o=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(i));r-=a,i-=o,o+=(this.options._height-1)/2,a+=a<0?this.options._width:a>=this.options._width?-this.options._width:0;let s=0,c=0,l=0,u=0,d=Array(er);if(a!==this._ix||o!==this._iy){if(!this.options.cubic)s=this._rawval(a,o),c=this._rawval(a+1,o),l=this._rawval(a,o+1),u=this._rawval(a+1,o+1);else{let e=[this._rawval(a,o-1),this._rawval(a+1,o-1),this._rawval(a-1,o),this._rawval(a,o),this._rawval(a+1,o),this._rawval(a+2,o),this._rawval(a-1,o+1),this._rawval(a,o+1),this._rawval(a+1,o+1),this._rawval(a+2,o+1),this._rawval(a,o+2),this._rawval(a+1,o+2)],t=Xn;o!==0&&(t=o===this.options._height-2?Qn:Jn);let n=Yn;o!==0&&(n=o===this.options._height-2?Zn:qn);for(let r=0;r<er;++r){d[r]=0;for(let n=0;n<$n;++n)d[r]+=e[n]*t[er*n+r];d[r]/=n}}}else this.options.cubic?d=this._t:(s=this._v00,c=this._v01,l=this._v10,u=this._v11);if(!this.options.cubic){let e=(1-r)*s+r*c,t=(1-r)*l+r*u,n=(1-i)*e+i*t,d=this.options._offset+this.options._scale*n;return this._ix=a,this._iy=o,this._v00=s,this._v01=c,this._v10=l,this._v11=u,d}let f=d[0]+r*(d[1]+r*(d[3]+r*d[6]))+i*(d[2]+r*(d[4]+r*d[7])+i*(d[5]+r*d[8]+i*d[9]));return f=this.options._offset+this.options._scale*f,this._ix=a,this._iy=o,this._t=d,f}_rawval(e,t){e<0?e+=this.options._width:e>=this.options._width&&(e-=this.options._width),(t<0||t>=this.options._height)&&(t=t<0?-t:2*(this.options._height-1)-t,e+=(e<this.options._width/2?1:-1)*this.options._width/2);let n=this.options._datastart+tr*(t*this.options._swidth+e),r=this.options.data[n],i=this.options.data[n+1];return r<<8|i}};function rr(e,t){t=Math.abs(t);let n=ir(e,t);return 2*Math.abs(n)===t?n-=ir(e,2*t)-n:2*Math.abs(n)>t&&(n+=n<0?t:-t),n}function ir(e,t){return e-Math.floor(e/t)*t}var ar=10,or=65535;function sr(e,t){let n=cr(e),r=n.next();if(r.done||r.value.line!==`P5`)throw Error(`Geoid model file: File not in PGM format`);let i=Number.MAX_VALUE,a=0,o=-1,s=-1,c=`NONE`,l=`UNKNOWN`,u=0,d=0,f=null,p=null;do{r=n.next();let e=r.value.line;if(e.length){if(e[0]===`#`){let n=e.split(` `),r=n[0],u=n[1];if(r!==`#`||!u)continue;let d=n.length>2?n.slice(2):[];if(u===`Description`)c=d.join(` `);else if(u===`DateTime`)l=d.join(` `);else if(u===`Offset`){if(!n[2])throw Error(`Geoid model file: Error reading offset`);i=parseInt(n[2],10)}else if(u===`Scale`){if(!n[2])throw Error(`Geoid model file: Error reading scale`);a=parseFloat(n[2])}else u===(t.cubic?`MaxCubicError`:`MaxBilinearError`)?isFinite(parseFloat(n[2]))&&(o=parseFloat(n[2])):u===(t.cubic?`RMSCubicError`:`RMSBilinearError`)&&isFinite(parseFloat(n[2]))&&(s=parseFloat(n[2]))}else{let t=e.split(` `);if(t=t.filter(e=>e!==``),u=parseInt(t[0],10),d=parseInt(t[1],10),!(u&&d))throw Error(`Geoid model file: Error reading raster size`);break}}}while(!r.done);r=n.next();let m=parseInt(r.value.line,10);if(r.done)throw Error(`Geoid model file: Error reading maxval`);if(m!==or)throw Error(`Geoid model file: Incorrect value of maxval`);if(f=r.value.offset,p=u,i===Number.MAX_VALUE)throw Error(`Geoid model file: Offset not set`);if(a===0)throw Error(`Geoid model file: Scale not set`);if(a<0)throw Error(`Geoid model file: Scale must be positive`);if(d<2||u<2)throw Error(`Geoid model file: Raster size too small`);if(u&1)throw Error(`Geoid model file: Raster width is odd`);if(!(d&1))throw Error(`Geoid model file: Raster height is even`);let h=u/360,g=(d-1)/180;return new nr({cubic:t.cubic,_width:u,_height:d,_rlonres:h,_rlatres:g,_offset:i,_scale:a,_swidth:p,_datastart:f,_maxerror:o,_rmserror:s,_description:c,_datetime:l,data:e})}function*cr(e){let t=0;do{let n=e.indexOf(ar,t);if(n!==-1){let r=e.subarray(t,n);t=n+1,yield{offset:t,line:lr(r)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:lr(n)}}}while(t<e.length);return{offset:t,line:``}}function lr(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return t}m.default.extend(f.default);var ur=C(1),dr=9.80665,fr=2*Math.PI,pr=new rn,mr=new rn,hr=new rn,gr=.05,_r=new V,vr=new V,yr=new ze,br=new ze,xr=new H,Sr=new H,Cr=new H,wr=new H,Tr=Kn.WGS84,Er=class{samples=[];hasOrientations(){return this.samples[0]?.stateVector.quaternion!==void 0}_lastRoll=0;_simpleSmooth(e,t){return e=t*e+(1-t)*this._lastRoll,e<ur&&(e=0),this._lastRoll=e,e}_computeRoll(e,t,n,r,i,a){let o=Tr.getEulerFromPositionQuaternion(e,t,mr).toHeadingPitchRoll(mr),s=Tr.getEulerFromPositionQuaternion(n,r,hr).toHeadingPitchRoll(hr),c=fr,l=o.yaw;l<0&&(l+=c);let u=s.yaw;u<0&&(u+=c);let d=u-l,f=Math.abs(d);f>Math.PI&&(f=c-f,d=c+d);let p=Math.sign(d)*f;return this._simpleSmooth(Math.atan(i*p/(dr*a)),gr)}_computeOrientation(e,t,n,r){let i=e.stateVector.cartesian,a=t.stateVector.cartesian,o=e.time,s=t.time,c=m.default.duration(s.diff(o)).asSeconds(),l=_r.subVectors(a,i).multiplyByScalar(1/c),u=l.magnitude();if(u>b.EPSILON){l.normalize();let e=Tr.getRotationMatrixFromPositionVelocity(i,l,yr),t=xr.fromMatrix3(e),o=0;if(r){let e=n.stateVector.cartesian,r=n.time,l=m.default.duration(r.diff(s)).asSeconds(),d=vr.subVectors(e,a).multiplyByScalar(1/l);d.normalize();let f=Tr.getRotationMatrixFromPositionVelocity(a,d,br),p=Sr.fromMatrix3(f);o=this._computeRoll(i,t,a,p,u,c)}return Cr.fromAxisRotation(l,o).multiplyRight(t).clone()}return Tr.getQuaternionFromEuler(i,pr,wr).clone()}emulateOrientations(e){let t=this.samples,n=t.length-2;if(n<1){t.forEach(e=>{let t=e.stateVector;t.quaternion=Tr.getQuaternionFromEuler(t.cartesian,pr,wr).clone()});return}e??=!1;for(let r=0;r<n;++r){let n=t[r],i=t[r+1],a=t[r+2];t[r].stateVector.quaternion=this._computeOrientation(n,i,a,e)}t[n].stateVector.quaternion=t[n-1].stateVector.quaternion,t[n+1].stateVector.quaternion=t[n-1].stateVector.quaternion}},Dr=class e{cartesian=new V;quaternion=void 0;equals(e){return e.cartesian.equals(this.cartesian)&&(this.quaternion===void 0?e.quaternion===void 0:e.quaternion?.equals(this.quaternion))}static _scratchQuaternionX=new H;static _scratchQuaternionY=new H;static _scratchQuaternionZ=new H;static _scratchHprMatrix=new Tt;static _scratchTranslationMatrix=new Tt;static _scratchRotation=new ze;static fromTransform(t,n){n===void 0&&(n=new e);let r=n.cartesian,i=e._scratchQuaternionX.identity(),a=e._scratchQuaternionY.identity(),o=e._scratchQuaternionZ.identity(),s=Kn.WGS84;s.cartographicToCartesian(t.position,r);let c=t.orientation;if(c!==void 0){i.rotateX(c.roll),a.rotateY(-c.pitch),o.rotateZ(-c.yaw);let e=o.multiplyRight(a).multiplyRight(i),t=this._scratchHprMatrix.fromQuaternion(e),l=s.localFrameToFixedFrame(`north`,`west`,`up`,r,this._scratchTranslationMatrix).multiplyRight(t).getRotationMatrix3(this._scratchRotation);n.quaternion===void 0&&(n.quaternion=new H),n.quaternion.fromMatrix3(l)}return n}};m.default.extend(f.default),m.default.extend(p.default);var Or=class{isValid=!0;header=new g;globalProperties=new h;timeSpan=new _;entities=new Map;frames=[];_searchFrameIndex(e){let t=this.frames,n=-1,r=0,i=this.frames.length-1;for(;r<=i;){let a=r+(i-r>>>1);t[a].timeStamp-e<=0?(n=a,r=a+1):i=a-1}return n}getFrame(e){if(this.timeSpan.isValid()){let t=this.globalProperties.referenceTime,n=this.timeSpan.end,r=this.frames;if(t.isSameOrBefore(e)&&e.isSameOrBefore(n)){let n=m.default.duration(e.diff(t)).asSeconds();return r[this._searchFrameIndex(n)]}}}_addFrame(e,t,n,r){let i=t.scene;r??=!1,i.forEach((t,i)=>{let a=n.get(i);a===void 0&&(a=new Er,n.set(i,a));let o=a.samples,s=Dr.fromTransform(t),c=o.length;if(!r&&c>0){let e=o[c-1];if(s.equals(e.stateVector))return}o.push({time:e,stateVector:s})})}createSampledTrajectories(e){let t=e?.sampleRate??1,n=e?.emulateOrientation??!1;if(!Number.isFinite(t)||t<=0)throw RangeError(`sampleRate must be a finite number greater than 0`);let r=new Map,i=this.timeSpan;if(i.isValid()){let e=i.duration(),n=i.start,a=i.end,o=0;do{let e=n.add(o,`seconds`),i=this.getFrame(e);i!==void 0&&this._addFrame(e,i,r),o+=t}while(o<=e);if(o>e){let e=this.getFrame(a);e!==void 0&&this._addFrame(a,e,r,!0)}}return n&&r.forEach(e=>e.emulateOrientations(!0)),r}},kr=class{id;timeSpan=new _;name;types;callsign;pilot;group;country;coalition;color;constructor(e){this.id=e}},Ar=class{timeStamp;scene;constructor(e,t){this.timeStamp=e,this.scene=t?new Map(t):new Map}},jr=class e{position;orientation;static refLong=0;static refLat=0;static geoid=void 0;constructor(t,n){if(t[0]!==void 0||t[1]!==void 0||t[2]!==void 0){let r=n?.position.clone(),i=t[0]===void 0?r?.x??e.refLong:t[0]+e.refLong,a=t[1]===void 0?r?.y??e.refLat:t[1]+e.refLat,o=e.geoid?.getHeight(a,i)??0,s=t[2]===void 0?r?.z??o:t[2]+o;this.position=new V(i,a,s)}else this.position=n?.position??new V;if(t[3]!==void 0||t[4]!==void 0||t[5]!==void 0){let e=n?.orientation?.clone(),r=t[3]===void 0?e?.roll:C(t[3]),i=t[4]===void 0?e?.pitch:C(t[4]),a=t[5]===void 0?e?.yaw:C(t[5]);this.orientation=new rn(r,i,a)}else this.orientation=n?.orientation}},Mr=4294967295,Nr=65535,Pr=134695760,Fr=33639248,Ir=39169,Lr=21589,Rr=28789,zr=25461,Br=6534,Vr=30837,Hr=30805,Ur=22613,Wr=2048,Gr=61440,Kr=16384,qr=40960,Jr=2048,Yr=1024,Xr=new Date(1980,0,1),Zr=`undefined`,Qr=`function`,$r=new Uint8Array,ei=`filenameEncoding`,ti=`commentEncoding`,ni=`extractPrependedData`,ri=`extractAppendedData`,ii=`password`,ai=`rawPassword`,oi=`passThrough`,si=`signal`,ci=`checkPasswordOnly`,li=`checkOverlappingEntryOnly`,ui=`checkOverlappingEntry`,di=`checkAmbiguity`,fi=`checkLocalDirectory`,pi=`checkCrc32`,mi=`checkAuthenticationCode`,hi=`useWebWorkers`,gi=`useCompressionStream`,_i=`transferStreams`,vi=`strictness`,yi=`filenameValidation`,bi=`normalizeFilename`,xi=`maxAppendedDataSize`,Si=`decryptCentralDirectory`,Ci=`filename`,wi=`comment`,Ti=`strict`,Ei=`balanced`,Di=`tolerant`,Oi=`Invalid option (must be a function)`,ki=`Invalid signal (must be an AbortSignal instance)`,Ai=`Invalid password (password must be a string, rawPassword must be a Uint8Array)`;function ji(e){if(e&&typeof e!=`function`)throw Error(Oi);return e}function Mi(e){if(e&&(typeof e.addEventListener!=`function`||typeof e.aborted!=`boolean`))throw Error(ki);return e||void 0}function Ni(e,t){if(e&&typeof e!=`string`||t&&!(t instanceof Uint8Array))throw Error(Ai)}function Pi(e){return typeof e==`string`&&e.trim()?Number(e):e}var Fi=65536,Ii=64,Li=1,Ri=`Invalid maxWorkers (must be an integer greater than 0)`,zi=2;try{typeof navigator<`u`&&navigator.hardwareConcurrency&&(zi=navigator.hardwareConcurrency)}catch{}var Bi={workerURI:`./core/web-worker-wasm.js`,wasmURI:`./core/streams/zlib-wasm/zlib-streams.wasm`,chunkSize:Fi,maxWorkers:zi,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream<`u`&&CompressionStream,DecompressionStream:typeof DecompressionStream<`u`&&DecompressionStream},Vi=`maxWorkers`,Hi=[`baseURI`,`wasmURI`,`workerURI`],Ui=[`useCompressionStream`,`useWebWorkers`,`transferStreams`],Wi=[`chunkSize`,Vi,`terminateWorkerTimeout`,`workerStarvationTimeout`,`workerStartupTimeout`],Gi=[`createWorker`,`CompressionStream`,`DecompressionStream`,`CompressionStreamFallback`,`DecompressionStreamFallback`],Ki=[...Hi,...Ui,...Wi,...Gi],qi={...Bi};function Ji(){return qi}function Yi(e){return Xi(e.chunkSize)}function Xi(e){return e=Pi(e),Number.isInteger(e)&&e>=Li?Math.max(e,Ii):Fi}function Zi(e){let t={};for(let n of Ki){let r=e[n];r!==void 0&&(t[n]=Qi(n,r))}return t}function Qi(e,t){if(Wi.includes(e)){if(t=Pi(t),e==Vi&&(!Number.isInteger(t)||t<Li))throw Error(Ri)}else Gi.includes(e)&&ji(t);return t}function $i(e){e||={};let{CompressionStreamZlib:t,DecompressionStreamZlib:n}=e;if(t===void 0&&n===void 0)return e;let r=Object.assign({},e);return r.CompressionStreamFallback===void 0&&(r.CompressionStreamFallback=t),r.DecompressionStreamFallback===void 0&&(r.DecompressionStreamFallback=n),r}function ea(e){let t=Zi($i(e));Object.assign(Bi,t),Object.assign(qi,t)}var ta=new Uint8Array(288);ta.fill(8,0,144),ta.fill(9,144,256),ta.fill(7,256,280),ta.fill(8,280,288),new Uint8Array(30).fill(5);var na=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ra=e=>e({workerURI:e=>{let t=`text/javascript`,n=`!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";const{Array:t,Object:n,Number:e,Math:s,Error:r,Uint8Array:o,Uint16Array:c,Uint32Array:i,Int32Array:a,Map:f,DataView:u,Promise:l,TextEncoder:w,crypto:h,postMessage:p,TransformStream:d,ReadableStream:y,WritableStream:m,CompressionStream:S,DecompressionStream:g}=self,v=void 0,b="undefined",k="function",z=new o,C=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let n=t;for(let t=0;t<8;t++)n=1&n?n>>>1^3988292384:n>>>1;C[0][t]=n}for(let t=0;t<256;t++)for(let n=1;n<8;n++){const e=C[n-1][t];C[n][t]=e>>>8^C[0][255&e]}const[I,A,x,M,P,B,D,F]=C;class R{constructor(t){this.o=t||-1}append(t){let n=0|this.o;const e=0|t.length;let s=0;if(e>=8&&t.buffer){const r=new u(t.buffer,t.byteOffset,e),o=e-8;for(;s<=o;s+=8){const t=n^r.getInt32(s,!0),e=r.getInt32(s+4,!0);n=F[255&t]^D[t>>>8&255]^B[t>>>16&255]^P[t>>>24&255]^M[255&e]^x[e>>>8&255]^A[e>>>16&255]^I[e>>>24&255]}}for(;s<e;s++)n=n>>>8^I[255&(n^t[s])];this.o=n}get(){return~this.o}}class U extends d{constructor(){let t;const n=new R;super({transform(t,e){n.append(t),e.enqueue(t)},flush(){const e=new o(4);new u(e.buffer).setUint32(0,n.get()),t.value=e}}),t=this}}function W(t,n){const e=new o(t.length+n.length);return e.set(t),e.set(n,t.length),e}function _(t){return new u(t.buffer,t.byteOffset,t.byteLength)}const T={concat(t,n){if(0===t.length||0===n.length)return t.concat(n);const e=t[t.length-1],s=T.l(e);return 32===s?t.concat(n):T.h(n,s,0|e,t.slice(0,t.length-1))},bitLength(t){const n=t.length;if(0===n)return 0;const e=t[n-1];return 32*(n-1)+T.l(e)},m(t,n){if(32*t.length<n)return t;const e=(t=t.slice(0,s.ceil(n/32))).length;return n&=31,e>0&&n&&(t[e-1]=T.S(n,t[e-1]&2147483648>>n-1,1)),t},S:(t,n,e)=>32===t?n:(e?0|n:n<<32-t)+1099511627776*t,l:t=>s.round(t/1099511627776)||32,h(t,n,e,s){for(void 0===s&&(s=[]);n>=32;n-=32)s.push(e),e=0;if(0===n)return s.concat(t);for(let r=0;r<t.length;r++)s.push(e|t[r]>>>n),e=t[r]<<32-n;const r=t.length?t[t.length-1]:0,o=T.l(r);return s.push(T.S(n+o&31,n+o>32?e:s.pop(),1)),s}},V={bytes:{v(t){const n=T.bitLength(t)/8,e=new o(n);let s;for(let r=0;r<n;r++)3&r||(s=t[r/4]),e[r]=s>>>24,s<<=8;return e},C(t){const n=[];let e,s=0;for(e=0;e<t.length;e++)s=s<<8|t[e],3&~e||(n.push(s),s=0);return 3&e&&n.push(T.S(8*(3&e),s)),n}}},K=class{constructor(t){const n=this;n.blockSize=512,n.I=[1732584193,4023233417,2562383102,271733878,3285377520],n.A=[1518500249,1859775393,2400959708,3395469782],t?(n.M=t.M.slice(0),n.P=t.P.slice(0),n.B=t.B):n.reset()}reset(){const t=this;return t.M=t.I.slice(0),t.P=[],t.B=0,t}update(t){const n=this;"string"==typeof t&&(t=V.D.C(t));const e=n.P=T.concat(n.P,t),s=n.B,o=n.B=s+T.bitLength(t);if(o>9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const c=new i(e);let a=0;for(let t=n.blockSize+s-(n.blockSize+s&n.blockSize-1);t<=o;t+=n.blockSize)n.F(c.subarray(16*a,16*(a+1))),a+=1;return e.splice(0,16*a),n}R(){const t=this;let n=t.P;const e=t.M;n=T.concat(n,[T.S(1,1)]);for(let t=n.length+2;15&t;t++)n.push(0);for(n.push(s.floor(t.B/4294967296)),n.push(0|t.B);n.length;)t.F(n.splice(0,16));return t.reset(),e}U(t,n,e,s){return t<=19?n&e|~n&s:t<=39?n^e^s:t<=59?n&e|n&s|e&s:t<=79?n^e^s:void 0}W(t,n){return n<<t|n>>>32-t}F(n){const e=this,r=e.M,o=t(80);for(let t=0;t<16;t++)o[t]=n[t];let c=r[0],i=r[1],a=r[2],f=r[3],u=r[4];for(let t=0;t<=79;t++){t>=16&&(o[t]=e.W(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const n=e.W(5,c)+e.U(t,i,a,f)+u+o[t]+e.A[s.floor(t/20)]|0;u=f,f=a,a=e.W(30,i),i=c,c=n}r[0]=r[0]+c|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+f|0,r[4]=r[4]+u|0}},E={importKey:t=>new E._(V.bytes.C(t)),T(t,n,e,s){if(e=e||1e4,s<0||e<0)throw new r("invalid params to pbkdf2");const o=1+(s>>5)<<2;let c,i,a,f,l;const w=new ArrayBuffer(o),h=new u(w);let p=0;const d=T;for(n=V.bytes.C(n),l=1;p<(o||1);l++){for(c=i=t.encrypt(d.concat(n,[l])),a=1;a<e;a++)for(i=t.encrypt(i),f=0;f<i.length;f++)c[f]^=i[f];for(a=0;p<(o||1)&&a<c.length;a++)h.setInt32(p,c[a]),p+=4}return w.slice(0,s/8)},_:class{constructor(t){const n=this,e=n.V=K,s=[[],[]];n.K=[new e,new e];const r=n.K[0].blockSize/32;t.length>r&&(t=(new e).update(t).R());for(let n=0;n<r;n++)s[0][n]=909522486^t[n],s[1][n]=1549556828^t[n];n.K[0].update(s[0]),n.K[1].update(s[1]),n.L=new e(n.K[0])}reset(){const t=this;t.L=new t.V(t.K[0]),t.O=!1}update(t){this.O=!0,this.L.update(t)}digest(){const t=this,n=t.L.R(),e=new t.V(t.K[1]).update(n).R();return t.reset(),e}encrypt(t){if(this.O)throw new r("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},L=typeof h!=b&&typeof h.getRandomValues==k,O="Invalid password",j="Invalid signature",H=j,N="zipjs-abort-check-password";function q(t){if(L)return h.getRandomValues(t);throw new r("Crypto API not supported")}const G=16,J={name:"PBKDF2"},Q=n.assign({hash:{name:"HMAC"}},J),X=n.assign({iterations:1e3,hash:{name:"SHA-1"}},J),Y=["deriveBits"],Z=[8,12,16],$=[16,24,32],tt=10,nt=[0,0,0,0],et=typeof h!=b,st=et&&h.subtle,rt=et&&typeof st!=b,ot=V.bytes,ct=class{constructor(t){const n=this;n.j=[[[],[],[],[],[]],[[],[],[],[],[]]],n.j[0][0][0]||n.H();const e=n.j[0][4],s=n.j[1],o=t.length;let c,i,a,f=1;if(4!==o&&6!==o&&8!==o)throw new r("invalid aes key size");for(n.A=[i=t.slice(0),a=[]],c=o;c<4*o+28;c++){let t=i[c-1];(c%o===0||8===o&&c%o===4)&&(t=e[t>>>24]<<24^e[t>>16&255]<<16^e[t>>8&255]<<8^e[255&t],c%o===0&&(t=t<<8^t>>>24^f<<24,f=f<<1^283*(f>>7))),i[c]=i[c-o]^t}for(let t=0;c;t++,c--){const n=i[3&t?c:c-4];a[t]=c<=4||t<4?n:s[0][e[n>>>24]]^s[1][e[n>>16&255]]^s[2][e[n>>8&255]]^s[3][e[255&n]]}}encrypt(t){return this.N(t,0)}decrypt(t){return this.N(t,1)}H(){const t=this.j[0],n=this.j[1],e=t[4],s=n[4],r=[],o=[];let c,i,a,f;for(let t=0;t<256;t++)o[(r[t]=t<<1^283*(t>>7))^t]=t;for(let u=c=0;!e[u];u^=i||1,c=o[c]||1){let o=c^c<<1^c<<2^c<<3^c<<4;o=o>>8^255&o^99,e[u]=o,s[o]=u,f=r[a=r[i=r[u]]];let l=16843009*f^65537*a^257*i^16843008*u,w=257*r[o]^16843008*o;for(let e=0;e<4;e++)t[e][u]=w=w<<24^w>>>8,n[e][o]=l=l<<24^l>>>8}for(let e=0;e<5;e++)t[e]=t[e].slice(0),n[e]=n[e].slice(0)}N(t,n){if(4!==t.length)throw new r("invalid aes block size");const e=this.A[n],s=e.length/4-2,o=[0,0,0,0],c=this.j[n],i=c[0],a=c[1],f=c[2],u=c[3],l=c[4];let w,h,p,d=t[0]^e[0],y=t[n?3:1]^e[1],m=t[2]^e[2],S=t[n?1:3]^e[3],g=4;for(let t=0;t<s;t++)w=i[d>>>24]^a[y>>16&255]^f[m>>8&255]^u[255&S]^e[g],h=i[y>>>24]^a[m>>16&255]^f[S>>8&255]^u[255&d]^e[g+1],p=i[m>>>24]^a[S>>16&255]^f[d>>8&255]^u[255&y]^e[g+2],S=i[S>>>24]^a[d>>16&255]^f[y>>8&255]^u[255&m]^e[g+3],g+=4,d=w,y=h,m=p;for(let t=0;t<4;t++)o[n?3&-t:t]=l[d>>>24]<<24^l[y>>16&255]<<16^l[m>>8&255]<<8^l[255&S]^e[g++],w=d,d=y,y=m,m=S,S=w;return o}},it=class{constructor(t,n){this.G=t,this.J=n,this.X=n}reset(){this.X=this.J}update(t){return this.Y(this.G,t,this.X)}Z(t){if(255&~(t>>24))t+=1<<24;else{let n=t>>16&255,e=t>>8&255,s=255&t;255===n?(n=0,255===e?(e=0,255===s?s=0:++s):++e):++n,t=0,t+=n<<16,t+=e<<8,t+=s}return t}$(t){0===(t[0]=this.Z(t[0]))&&(t[1]=this.Z(t[1]))}Y(t,n,e){let s;if(!(s=n.length))return[];const r=T.bitLength(n);for(let r=0;r<s;r+=4){this.$(e);const s=t.encrypt(e);n[r]^=s[0],n[r+1]^=s[1],n[r+2]^=s[2],n[r+3]^=s[3]}return T.m(n,r)}},at=E._;let ft=et&&rt&&typeof st.importKey==k,ut=et&&rt&&typeof st.deriveBits==k;class lt extends d{constructor({password:t,rawPassword:n,encryptionStrength:e,checkPasswordOnly:s,checkAuthenticationCode:c=!0}){super({start(){ht(this,t,n,e)},async transform(t,n){const e=this,{password:c,strength:i,nt:a,ready:f}=e;c?(await async function(t,n,e,s){const o=await dt(t,n,e,mt(s,0,Z[n])),c=mt(s,Z[n]);if(o[0]!=c[0]||o[1]!=c[1])throw new r(O)}(e,i,c,mt(t,0,Z[i]+2)),t=mt(t,Z[i]+2),s?n.error(new r(N)):a()):await f;const u=new o(t.length-tt-(t.length-tt)%G);n.enqueue(pt(e,t,u,0,tt,!0))},async flush(t){const{et:n,st:e,ot:s,ready:o}=this;if(e&&n){await o;const i=mt(s,0,s.length-tt),a=mt(s,s.length-tt);let f=z;if(i.length){const t=gt(ot,i);e.update(t);const s=n.update(t);f=St(ot,s)}const u=mt(St(ot,e.digest()),0,tt);let l=s.length<tt?1:0;for(let t=0;t<tt;t++)l|=u[t]^a[t];if(l&&c)throw new r(H);t.enqueue(f)}}})}}class wt extends d{constructor({password:t,rawPassword:n,encryptionStrength:e}){super({start(){ht(this,t,n,e)},async transform(t,n){const e=this,{password:s,strength:r,nt:c,ready:i}=e;let a=z;s?(a=await async function(t,n,e){const s=q(new o(Z[n]));return W(s,await dt(t,n,e,s))}(e,r,s),c()):await i;const f=new o(a.length+t.length-t.length%G);f.set(a,0),n.enqueue(pt(e,t,f,a.length,0))},async flush(t){const{et:n,st:e,ot:s,ready:r}=this;if(e&&n){await r;let o=z;if(s.length){const t=n.update(gt(ot,s));e.update(t),o=St(ot,t)}const c=St(ot,e.digest()).slice(0,tt);t.enqueue(W(o,c))}}})}}function ht(t,e,s,r){n.assign(t,{ready:new l(n=>t.nt=n),password:yt(e,s),strength:r-1,ot:z})}function pt(t,n,e,s,r,c){const{et:i,st:a,ot:f}=t;f.length&&(n=W(f,n));const u=n.length-r;let l;for(e=function(t,n){if(n&&n>t.length){const e=t;(t=new o(n)).set(e,0)}return t}(e,s+(u-u%G)),l=0;l<=u-G;l+=G){const t=gt(ot,mt(n,l,l+G));c&&a.update(t);const r=i.update(t);c||a.update(r),e.set(St(ot,r),l+s)}return t.ot=mt(n,l),e}async function dt(e,s,r,c){e.password=null;const i=await async function(t,n,e,s,r){if(!ft)return E.importKey(n);try{return await st.importKey("raw",n,e,!1,r)}catch{return ft=!1,E.importKey(n)}}(0,r,Q,0,Y),a=await async function(t,n,e){if(!ut)return E.T(n,t.salt,X.iterations,e);try{return await st.deriveBits(t,n,e)}catch{return ut=!1,E.T(n,t.salt,X.iterations,e)}}(n.assign({salt:c},X),i,8*(2*$[s]+2)),f=new o(a),u=gt(ot,mt(f,0,$[s])),l=gt(ot,mt(f,$[s],2*$[s])),w=mt(f,2*$[s]);return n.assign(e,{keys:{key:u,ct:l,passwordVerification:w},et:new it(new ct(u),t.from(nt)),st:new at(l)}),w}function yt(t,n){return n===v?function(t){if(typeof w==b){t=unescape(encodeURIComponent(t));const n=new o(t.length);for(let e=0;e<n.length;e++)n[e]=t.charCodeAt(e);return n}return(new w).encode(t)}(t):n}function mt(t,n,e){return t.subarray(n,e)}function St(t,n){return t.v(n)}function gt(t,n){return t.C(n)}class vt extends d{constructor({password:t,rawPassword:n,passwordVerification:e,checkPasswordOnly:s}){super({start(){kt(this,t,n,e)},transform(t,n){const e=this;if(e.password||e.rawPassword){const n=zt(e,t.subarray(0,12));if(e.password=e.rawPassword=null,0!=(n[11]^e.passwordVerification))throw new r(O);t=t.subarray(12)}s?n.error(new r(N)):n.enqueue(zt(e,t))}})}}class bt extends d{constructor({password:t,rawPassword:n,passwordVerification:e}){super({start(){kt(this,t,n,e)},transform(t,n){const e=this;let s,r;if(e.password||e.rawPassword){e.password=e.rawPassword=null;const n=q(new o(12));n[11]=e.passwordVerification,s=new o(t.length+n.length),s.set(Ct(e,n),0),r=12}else s=new o(t.length),r=0;s.set(Ct(e,t),r),n.enqueue(s)}})}}function kt(t,e,s,r){n.assign(t,{password:e,rawPassword:s,passwordVerification:r}),function(t,e,s){const r=[305419896,591751049,878082192];if(n.assign(t,{keys:r,it:new R(r[0]),ft:new R(r[2])}),s)for(let n=0;n<s.length;n++)It(t,s[n]);else for(let n=0;n<e.length;n++)It(t,e.charCodeAt(n))}(t,e,s)}function zt(t,n){const e=new o(n.length);for(let s=0;s<n.length;s++)e[s]=At(t)^n[s],It(t,e[s]);return e}function Ct(t,n){const e=new o(n.length);for(let s=0;s<n.length;s++)e[s]=At(t)^n[s],It(t,n[s]);return e}function It(t,n){let[,e]=t.keys;t.it.append([n]);const r=~t.it.get();e=Mt(s.imul(Mt(e+xt(r)),134775813)+1),t.ft.append([e>>>24]);const o=~t.ft.get();t.keys=[r,e,o]}function At(t){const n=2|t.keys[2];return xt(s.imul(n,1^n)>>>8)}function xt(t){return 255&t}function Mt(t){return 4294967295&t}function Pt(t){if(t instanceof y)return t;const n=t.getReader();return new y({async pull(t){const{value:e,done:s}=await n.read();s?t.close():t.enqueue(e)},cancel:t=>n.cancel(t)})}const Bt=new f;function Dt(t){return Bt.get(t)}const Ft="Invalid uncompressed size",Rt=j,Ut="deflate-raw",Wt="gzip",_t=[31,139,8];class Tt extends d{constructor(t,{chunkSize:n,CompressionStreamFallback:e,CompressionStream:s}){super({});const{compressed:r,encrypted:o,useCompressionStream:c,zipCrypto:i,computeCrc32:a,level:f,deflate64:l,format:w,compressionMethod:h,inputSize:p}=t,d=this;let y,m,S,g=super.readable;const v=w&&Dt(w),b=a&&r&&!l&&!v&&(!o||i)&&Boolean(c&&s);if(o&&!i||!a||b||(y=new U,g=Ht(g,y)),r)if(v)g=Nt(g,Ot(v.CompressionStream,w,{level:f,chunkSize:n,compressionMethod:h,uncompressedSize:p}));else if(b)S=new Vt,g=Nt(g,new s(Wt)),g=Ht(g,S);else try{g=jt(g,c,{level:f,chunkSize:n},s,e)}catch(t){let n;try{n=new s(Wt)}catch{throw t}g=Nt(g,n),g=Ht(g,new Vt)}o&&(i?g=Ht(g,new bt(t)):(m=new wt(t),g=Ht(g,m))),Lt(d,g,()=>{o&&!i||!a||(d.crc32=b?S.crc32:new u(y.value.buffer).getUint32(0))})}}class Vt extends d{constructor(){let t,n=10,e=new o(0);super({transform(t,r){if(n){const e=s.min(n,t.length);if(n-=e,!(t=t.subarray(e)).length)return}const o=e.length+t.length;if(o<=8)return void(e=W(e,t));const c=o-8,i=s.min(c,e.length);r.enqueue(W(e.subarray(0,i),t.subarray(0,c-i))),e=W(e.subarray(i),t.subarray(c-i))},flush(){const n=_(e);t.crc32=n.getUint32(0,!0),t.uncompressedSize=n.getUint32(4,!0)}}),t=this}}class Kt extends d{constructor(t,{chunkSize:n,DecompressionStreamFallback:e,DecompressionStream:s}){super({});const{zipCrypto:c,encrypted:i,checkCrc32:a,crc32:f,compressed:w,useCompressionStream:h,deflate64:p,format:m,compressionMethod:S,rawBitFlag:g,outputSize:b}=t;let k,z,C=super.readable;if(i&&(c?C=Ht(C,new vt(t)):(z=new lt(t),C=Ht(C,z))),w){const t=m&&Dt(m);if(t)C=Nt(C,Ot(t.DecompressionStream,m,{chunkSize:n,compressionMethod:S,rawBitFlag:g,uncompressedSize:b}));else try{C=jt(C,h,{chunkSize:n,deflate64:p},s,e)}catch(t){if(p||b===v)throw t;let n;try{n=new s(Wt)}catch{throw t}C=function(t,n,e){const s=new R;let c,i,a,f=0,u=!1;const w=new l((t,n)=>{i=t,a=n});w.catch(()=>{}),e||i();const h=new d({start(t){const n=new o(10);n.set(_t),t.enqueue(n)},transform(t,n){n.enqueue(t)},async flush(t){u=!0,y();try{await w}finally{m()}const n=new o(8),r=_(n);r.setUint32(0,s.get(),!0),r.setUint32(4,e,!0),t.enqueue(n)},cancel(t){a(t)}}),p=new d({transform(t,n){s.append(t),f+=t.length,f>=e?i():u&&y(),n.enqueue(t)},cancel(t){a(t)}});return t=Ht(t,h),Ht(t=Nt(t,n),p);function y(){m(),c=setTimeout(()=>a(new r(Ft)),5e3)}function m(){clearTimeout(c)}}(C,n,b)}C=function(t){const n=t.getReader();return new y({async pull(t){let e;try{e=await n.read()}catch(t){if(t&&t.message)throw t;const n=new r("Invalid compressed data");throw n.cause=t,n}const{value:s,done:o}=e;o?t.close():t.enqueue(s)},cancel:t=>n.cancel(t)})}(C)}a&&(k=new U,C=Ht(C,k)),Lt(this,C,()=>{if(a){const t=new u(k.value.buffer);if(f!=t.getUint32(0,!1))throw new r(Rt)}})}}const Et=new f;function Lt(t,e,s){e=Ht(e,new d({flush:s})),n.defineProperty(t,"readable",{get:()=>e})}function Ot(t,n,e){if(!t)throw new r("Compression method not supported");return new t(n,e)}function jt(t,n,e,s,r){const o=n&&s?s:r||s,c=e.deflate64?"deflate64-raw":Ut;let i;try{i=new o(c,e)}catch(t){if(!n||!r||o==r)throw t;i=new r(c,e)}return Nt(t,i)}function Ht(t,n){return Pt(t).pipeThrough(n)}function Nt(t,n){const e=n.writable.getWriter(),s=t.getReader();return async function(){try{for(;;){await e.ready;const t=await s.read();if(t.done){await e.close();break}await e.write(t.value)}}catch(t){await async function(t,n){try{await t.abort(n)}catch{}}(e,t),await async function(t,n){try{await t.cancel(n)}catch{}}(s,t)}}(),n.readable}const qt="data",Gt="close",Jt="deflate";class Qt extends d{constructor(t,e){super({});const s=this,{codecType:o}=t;let c;o.startsWith(Jt)?c=Tt:o.startsWith("inflate")&&(c=Kt),s.outputSize=0;let i=0;const a=new c(t,e),f=super.readable,u=new d({transform(t,n){t&&t.length&&(i+=t.length,n.enqueue(t))},flush(){n.assign(s,{inputSize:i})}}),l=new d({transform(n,e){if(n&&n.length&&(e.enqueue(n),s.outputSize+=n.length,t.outputSize!==v&&s.outputSize>t.outputSize))throw new r(Ft)},flush(){const{crc32:t}=a;n.assign(s,{crc32:t,inputSize:i})}});n.defineProperty(s,"readable",{get:()=>f.pipeThrough(u).pipeThrough(a).pipeThrough(l)})}}class Xt extends d{constructor(t){const n=[];let s=0;function r(){const e=new o(t);let r=0;for(;r<t;){const s=n[0],o=t-r;s.length<=o?(e.set(s,r),r+=s.length,n.shift()):(e.set(s.subarray(0,o),r),n[0]=s.subarray(o),r+=o)}return s-=t,e}(!e.isFinite(t)||t<1)&&(t=65536),super({transform(e,o){for(n.push(e),s+=e.length;s>t;)o.enqueue(r())},flush(t){s&&t.enqueue(function(t,n){const e=new o(n);let s=0;for(const n of t)e.set(n,s),s+=n.length;return e}(n,s))}})}}let Yt=2;try{typeof navigator!=b&&navigator.hardwareConcurrency&&(Yt=navigator.hardwareConcurrency)}catch{}const Zt=new f,$t=new f;let tn,nn=0;async function en(t){let n,o;try{const{options:c,config:i}=t;if(c.format)try{await async function(t,n){!Bt.has(t)&&n&&function(t,n){const{CompressionStream:e,DecompressionStream:s}=n;if(typeof e!=k&&typeof s!=k)throw new r("Invalid codec module");Bt.set(t,{CompressionStream:e,DecompressionStream:s})}(t,await(import(n)))}(c.format,c.codecURI)}catch(t){throw t.codecImportFailed=!0,t}if(i.CompressionStream=self.CompressionStream,i.DecompressionStream=self.DecompressionStream,c.compressed&&!c.format)if(c.useCompressionStream){if(!function(t,n){if(!t)return!1;let e=Et.get(t);e||(e=new f,Et.set(t,e));let s=e.get(n);if(s===v){try{new t(n),s=!0}catch{s=!1}e.set(n,s)}return s}(c.codecType.startsWith(Jt)?i.CompressionStream:i.DecompressionStream,Ut))try{await self.initModule(t.config)}catch{}}else try{await self.initModule(t.config)}catch{c.useCompressionStream=!0}!i.CompressionStreamFallback&&i.CompressionStreamZlib&&(i.CompressionStreamFallback=i.CompressionStreamZlib),!i.DecompressionStreamFallback&&i.DecompressionStreamZlib&&(i.DecompressionStreamFallback=i.DecompressionStreamZlib);const a={highWaterMark:1},u=t.readable?Pt(t.readable):new y({async pull(t){const n=new l(t=>Zt.set(nn,t));sn({type:"pull",messageId:nn}),nn=(nn+1)%e.MAX_SAFE_INTEGER;const{value:s,done:r}=await n;t.enqueue(s),r&&t.close()}},a);o=t.writable?function(t){if(t instanceof m)return t;const n=t.getWriter();return new m({write:t=>n.write(t),close:()=>n.close(),abort:t=>n.abort(t)})}(t.writable):new m({async write(t){let n;const s=new l(t=>n=t);$t.set(nn,n),sn({type:qt,value:t,messageId:nn}),nn=(nn+1)%e.MAX_SAFE_INTEGER,await s}},a),n=new Qt(c,i),tn=new AbortController;const{signal:w}=tn;await u.pipeThrough(n).pipeThrough(new Xt(function(t){return r="string"==typeof(n=r=t.chunkSize)&&n.trim()?e(n):n,e.isInteger(r)&&r>=1?s.max(r,64):65536;var n,r}(i))).pipeTo(o,{signal:w,preventClose:!0,preventAbort:!0}),await o.getWriter().close();const{crc32:h,inputSize:p,outputSize:d}=n;sn({type:Gt,result:{crc32:h,inputSize:p,outputSize:d}})}catch(t){if(t.outputSize=n?n.outputSize:0,o&&!o.locked)try{await o.getWriter().close()}catch{}rn(t)}}function sn(t){const{value:n}=t;if(n)if(n.length)try{t.value=(e=n,e.byteOffset||e.byteLength!=e.buffer.byteLength?new o(e):e).buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t);var e}function rn(t=new r("Unknown error")){const{message:n,stack:e,code:s,name:o,outputSize:c,cause:i,codecImportFailed:a}=t,f={message:n,stack:e,code:s,name:o,outputSize:c};i&&(f.cause={name:i.name,message:i.message}),a&&(f.codecImportFailed=!0),p({error:f})}addEventListener("message",({data:t})=>{const{type:n,messageId:e,value:s,done:r}=t;try{if("start"==n&&en(t),n==qt){const t=Zt.get(e);Zt.delete(e),t({value:s||new o,done:r})}if("ack"==n){const t=$t.get(e);$t.delete(e),t()}n==Gt&&tn.abort()}catch(t){rn(t)}}),p({type:"ready"});const on="deflate",cn="deflate-raw",an="deflate64-raw",fn="gzip";let un,ln,wn,hn,pn;function dn(t,n,e={}){if(!un){const t=new r("WASM module not loaded");throw t.cause=pn,t}const c="number"==typeof e.level?e.level:-1,i="number"==typeof e.outBuffer?e.outBuffer:65536,a="number"==typeof e.inBufferSize?e.inBufferSize:65536;return new d({start(){try{let e;if(this.ut=ln(i),this.in=ln(a),this.inBufferSize=a,!this.ut||!this.in)throw new r("allocation failed");if(this.lt=new o(i),t?(this.wt=un.deflate_process,this.ht=un.deflate_last_consumed,this.yt=un.deflate_end,this.St=un.deflate_new(),e=n===fn?un.deflate_init_gzip(this.St,c):n===cn?un.deflate_init_raw(this.St,c):un.deflate_init(this.St,c)):n===an?(this.wt=un.inflate9_process,this.ht=un.inflate9_last_consumed,this.yt=un.inflate9_end,this.St=un.inflate9_new(),e=un.inflate9_init_raw(this.St)):(this.wt=un.inflate_process,this.ht=un.inflate_last_consumed,this.yt=un.inflate_end,this.St=un.inflate_new(),e=n===cn?un.inflate_init_raw(this.St):n===fn?un.inflate_init_gzip(this.St):un.inflate_init(this.St)),0!==e)throw new r("init failed:"+e)}catch(t){throw f(this),t}},transform(n,e){try{const c=n,a=new o(hn.buffer),f=this.wt,u=this.ht,l=this.ut,w=this.lt;let h=0;for(;h<c.length;){const n=s.min(c.length-h,32768);if((!this.in||this.inBufferSize<n)&&(this.in&&wn&&(wn(this.in),this.in=0),this.in=ln(n),this.inBufferSize=n,!this.in))throw new r("allocation failed");a.set(c.subarray(h,h+n),this.in);const o=f(this.St,this.in,n,l,i,0),p=16777215&o;if(p&&(w.set(a.subarray(l,l+p),0),e.enqueue(w.slice(0,p))),!t){const t=o>>24&255,n=128&t?t-256:t;if(n<0)throw new r("process error:"+n)}const d=u(this.St);if(0===d)break;h+=d}}catch(t){f(this),e.error(t)}},flush(n){try{const e=new o(hn.buffer),s=this.wt,c=this.ut,a=this.lt;for(;;){const o=s(this.St,0,0,c,i,4),f=16777215&o,u=o>>24&255;if(!t){const t=128&u?u-256:u;if(t<0)throw new r("process error:"+t)}if(f&&(a.set(e.subarray(c,c+f),0),n.enqueue(a.slice(0,f))),1===u||0===f)break}}catch(t){n.error(t)}finally{const t=f(this);0!==t&&n.error(new r("end error:"+t))}},cancel(){f(this)}});function f(t){let n=0;return t.St&&t.yt&&(n=t.yt(t.St)),t.St=0,t.in&&wn&&wn(t.in),t.in=0,t.ut&&wn&&wn(t.ut),t.ut=0,n}}class yn{constructor(t=on,n){return dn(!0,t,n)}}class mn{constructor(t=on,n){return dn(!1,t,n)}}yn.gt=!0,mn.gt=!0,yn.vt=[on,cn,fn],mn.vt=[on,cn,fn,an];let Sn=!1;!function(t={}){const{init:n}=t,e=t.CompressionStreamFallback||t.CompressionStreamZlib,s=t.DecompressionStreamFallback||t.DecompressionStreamZlib;self.initModule=async t=>{n&&await n(t),e&&(t.CompressionStreamFallback=e),s&&(t.DecompressionStreamFallback=s)}}({CompressionStreamFallback:yn,DecompressionStreamFallback:mn,init:t=>async function(t,{baseURI:n}){if(!Sn)try{await async function(t,n){let e,s;try{try{s=new URL(t,n)}catch{}const r=await fetch(s);e=await r.arrayBuffer()}catch(n){if(!t.startsWith("data:application/wasm;base64,"))throw n;e=function(t){const n=t.split(",")[1],e=atob(n),s=e.length,r=new o(s);for(let t=0;t<s;++t)r[t]=e.charCodeAt(t);return r.buffer}(t)}!function(t){if(un=t,({malloc:ln,free:wn,memory:hn}=un),"function"!=typeof ln||"function"!=typeof wn||!hn)throw un=ln=wn=hn=null,new r("Invalid WASM module")}((await WebAssembly.instantiate(e)).instance.exports)}(t,n),Sn=!0}catch(t){throw function(t){pn=t}(t),t}}(t.wasmURI,t)})});
2
+ `;if(typeof n==`string`&&(n=new TextEncoder().encode(n)),e){let e=new Blob([n],{type:t});return URL.createObjectURL(e)}return`data:`+t+`;base64,`+function(e){let t=``,n=e.length,r=0;for(;r+2<n;r+=3){let n=e[r]<<16|e[r+1]<<8|e[r+2];t+=na[n>>18&63]+na[n>>12&63]+na[n>>6&63]+na[63&n]}let i=n-r;if(i===1){let n=e[r]<<16;t+=na[n>>18&63]+na[n>>12&63]+`==`}else if(i===2){let n=e[r]<<16|e[r+1]<<8;t+=na[n>>18&63]+na[n>>12&63]+na[n>>6&63]+`=`}return t}(n)}});function ia(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function aa(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function W(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var oa=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=t&1?t>>>1^3988292384:t>>>1;oa[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=oa[t-1][e];oa[t][e]=n>>>8^oa[0][n&255]}var[sa,ca,la,ua,da,fa,pa,ma]=oa,ha=class{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0,n=e.length|0,r=0;if(n>=8&&e.buffer){let i=new DataView(e.buffer,e.byteOffset,n),a=n-8;for(;r<=a;r+=8){let e=t^i.getInt32(r,!0),n=i.getInt32(r+4,!0);t=ma[e&255]^pa[e>>>8&255]^fa[e>>>16&255]^da[e>>>24&255]^ua[n&255]^la[n>>>8&255]^ca[n>>>16&255]^sa[n>>>24&255]}}for(;r<n;r++)t=t>>>8^sa[(t^e[r])&255];this.crc=t}get(){return~this.crc}},ga=class extends TransformStream{constructor(){let e,t=new ha;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){let n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}};function _a(e){if(typeof TextEncoder>`u`){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return new TextEncoder().encode(e)}var G={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],r=G.getPartial(n);return r===32?e.concat(t):G._shiftRight(t,r,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+G.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t&=31,n>0&&t&&(e[n-1]=G.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,r){for(r===void 0&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(t===0)return r.concat(e);for(let i=0;i<e.length;i++)r.push(n|e[i]>>>t),n=e[i]<<32-t;let i=e.length?e[e.length-1]:0,a=G.getPartial(i);return r.push(G.partial(t+a&31,t+a>32?n:r.pop(),1)),r}},va={bytes:{fromBits(e){let t=G.bitLength(e)/8,n=new Uint8Array(t),r;for(let i=0;i<t;i++)i&3||(r=e[i/4]),n[i]=r>>>24,r<<=8;return n},toBits(e){let t=[],n,r=0;for(n=0;n<e.length;n++)r=r<<8|e[n],(n&3)==3&&(t.push(r),r=0);return n&3&&t.push(G.partial(8*(n&3),r)),t}}},ya={};ya.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e==`string`&&(e=va.utf8String.toBits(e));let n=t._buffer=G.concat(t._buffer,e),r=t._length,i=t._length=r+G.bitLength(e);if(i>9007199254740991)throw Error(`Cannot hash more than 2^53 - 1 bits`);let a=new Uint32Array(n),o=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);e<=i;e+=t.blockSize)t._block(a.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),t}finalize(){let e=this,t=e._buffer,n=e._h;t=G.concat(t,[G.partial(1,1)]);for(let e=t.length+2;e&15;e++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,r){if(e<=19)return t&n|~t&r;if(e<=39)return t^n^r;if(e<=59)return t&n|t&r|n&r;if(e<=79)return t^n^r}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,r=Array(80);for(let t=0;t<16;t++)r[t]=e[t];let i=n[0],a=n[1],o=n[2],s=n[3],c=n[4];for(let e=0;e<=79;e++){e>=16&&(r[e]=t._S(1,r[e-3]^r[e-8]^r[e-14]^r[e-16]));let n=t._S(5,i)+t._f(e,a,o,s)+c+r[e]+t._key[Math.floor(e/20)]|0;c=s,s=o,o=t._S(30,a),a=i,i=n}n[0]=n[0]+i|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0}};var ba={};ba.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],r=t._tables[1],i=e.length,a,o,s,c=1;if(i!==4&&i!==6&&i!==8)throw Error(`invalid aes key size`);for(t._key=[o=e.slice(0),s=[]],a=i;a<4*i+28;a++){let e=o[a-1];(a%i===0||i===8&&a%i===4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[e&255],a%i===0&&(e=e<<8^e>>>24^c<<24,c=c<<1^(c>>7)*283)),o[a]=o[a-i]^e}for(let e=0;a;e++,a--){let t=o[e&3?a:a-4];a<=4||e<4?s[e]=t:s[e]=r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[t&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],r=t[4],i=[],a=[],o,s,c,l;for(let e=0;e<256;e++)a[(i[e]=e<<1^(e>>7)*283)^e]=e;for(let u=o=0;!n[u];u^=s||1,o=a[o]||1){let a=o^o<<1^o<<2^o<<3^o<<4;a=a>>8^a&255^99,n[u]=a,r[a]=u,l=i[c=i[s=i[u]]];let d=l*16843009^c*65537^s*257^u*16843008,f=i[a]*257^a*16843008;for(let n=0;n<4;n++)e[n][u]=f=f<<24^f>>>8,t[n][a]=d=d<<24^d>>>8}for(let n=0;n<5;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(e.length!==4)throw Error(`invalid aes block size`);let n=this._key[t],r=n.length/4-2,i=[0,0,0,0],a=this._tables[t],o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],d=e[0]^n[0],f=e[t?3:1]^n[1],p=e[2]^n[2],m=e[t?1:3]^n[3],h=4,g,_,v;for(let e=0;e<r;e++)g=o[d>>>24]^s[f>>16&255]^c[p>>8&255]^l[m&255]^n[h],_=o[f>>>24]^s[p>>16&255]^c[m>>8&255]^l[d&255]^n[h+1],v=o[p>>>24]^s[m>>16&255]^c[d>>8&255]^l[f&255]^n[h+2],m=o[m>>>24]^s[d>>16&255]^c[f>>8&255]^l[p&255]^n[h+3],h+=4,d=g,f=_,p=v;for(let e=0;e<4;e++)i[t?3&-e:e]=u[d>>>24]<<24^u[f>>16&255]<<16^u[p>>8&255]<<8^u[m&255]^n[h++],g=d,d=f,f=p,p=m,m=g;return i}};var xa={};xa.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)==255){let t=e>>16&255,n=e>>8&255,r=e&255;t===255?(t=0,n===255?(n=0,r===255?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let r;if(!(r=t.length))return[];let i=G.bitLength(t);for(let i=0;i<r;i+=4){this.incCounter(n);let r=e.encrypt(n);t[i]^=r[0],t[i+1]^=r[1],t[i+2]^=r[2],t[i+3]^=r[3]}return G.clamp(t,i)}};var Sa={importKey(e){return new Sa.hmacSha1(va.bytes.toBits(e))},pbkdf2(e,t,n,r){if(n||=1e4,r<0||n<0)throw Error(`invalid params to pbkdf2`);let i=(r>>5)+1<<2,a,o,s,c,l,u=new ArrayBuffer(i),d=new DataView(u),f=0,p=G;for(t=va.bytes.toBits(t),l=1;f<(i||1);l++){for(a=o=e.encrypt(p.concat(t,[l])),s=1;s<n;s++)for(o=e.encrypt(o),c=0;c<o.length;c++)a[c]^=o[c];for(s=0;f<(i||1)&&s<a.length;s++)d.setInt32(f,a[s]),f+=4}return u.slice(0,r/8)}};Sa.hmacSha1=class{constructor(e){let t=this,n=t._hash=ya.sha1,r=[[],[]];t._baseHash=[new n,new n];let i=t._baseHash[0].blockSize/32;e.length>i&&(e=new n().update(e).finalize());for(let t=0;t<i;t++)r[0][t]=e[t]^909522486,r[1][t]=e[t]^1549556828;t._baseHash[0].update(r[0]),t._baseHash[1].update(r[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw Error(`encrypt on already updated hmac called!`);return this.update(e),this.digest(e)}};var Ca=typeof crypto<`u`&&typeof crypto.getRandomValues==`function`,wa=`Invalid password`,Ta=`Invalid signature`,Ea=Ta,Da=`zipjs-abort-check-password`,Oa=`Crypto API not supported`;function ka(e){if(Ca)return crypto.getRandomValues(e);throw Error(Oa)}var Aa=16,ja=`raw`,Ma={name:`PBKDF2`},Na={name:`HMAC`},Pa=`SHA-1`,Fa=Object.assign({hash:Na},Ma),Ia=Object.assign({iterations:1e3,hash:{name:Pa}},Ma),La=[`deriveBits`],Ra=[8,12,16],za=[16,24,32],Ba=10,Va=[0,0,0,0],Ha=typeof crypto!=Zr,Ua=Ha&&crypto.subtle,Wa=Ha&&Ua!==void 0,Ga=va.bytes,Ka=ba.aes,qa=xa.ctrGladman,Ja=Sa.hmacSha1,Ya=Ha&&Wa&&typeof Ua.importKey==`function`,Xa=Ha&&Wa&&typeof Ua.deriveBits==`function`,Za=class extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:i=!0}){super({start(){$a(this,e,t,n)},async transform(e,t){let n=this,{password:i,strength:a,resolveReady:o,ready:s}=n;i?(await to(n,a,i,K(e,0,Ra[a]+2)),e=K(e,Ra[a]+2),r?t.error(Error(Da)):o()):await s;let c=new Uint8Array(e.length-Ba-(e.length-Ba)%Aa);t.enqueue(eo(n,e,c,0,Ba,!0))},async flush(e){let{ctr:t,hmac:n,pendingInput:r,ready:a}=this;if(n&&t){await a;let o=K(r,0,r.length-Ba),s=K(r,r.length-Ba),c=$r;if(o.length){let e=lo(Ga,o);n.update(e),c=co(Ga,t.update(e))}let l=K(co(Ga,n.digest()),0,Ba),u=+(r.length<Ba);for(let e=0;e<Ba;e++)u|=l[e]^s[e];if(u&&i)throw Error(Ea);e.enqueue(c)}}})}},Qa=class extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:n}){super({start(){$a(this,e,t,n)},async transform(e,t){let n=this,{password:r,strength:i,resolveReady:a,ready:o}=n,s=$r;r?(s=await no(n,i,r),a()):await o;let c=new Uint8Array(s.length+e.length-e.length%Aa);c.set(s,0),t.enqueue(eo(n,e,c,s.length,0))},async flush(e){let{ctr:t,hmac:n,pendingInput:r,ready:i}=this;if(n&&t){await i;let a=$r;if(r.length){let e=t.update(lo(Ga,r));n.update(e),a=co(Ga,e)}let o=co(Ga,n.digest()).slice(0,Ba);e.enqueue(ia(a,o))}}})}};function $a(e,t,n,r){Object.assign(e,{ready:new Promise(t=>e.resolveReady=t),password:oo(t,n),strength:r-1,pendingInput:$r})}function eo(e,t,n,r,i,a){let{ctr:o,hmac:s,pendingInput:c}=e;c.length&&(t=ia(c,t));let l=t.length-i;n=so(n,r+(l-l%Aa));let u;for(u=0;u<=l-Aa;u+=Aa){let e=lo(Ga,K(t,u,u+Aa));a&&s.update(e);let i=o.update(e);a||s.update(i),n.set(co(Ga,i),u+r)}return e.pendingInput=K(t,u),n}async function to(e,t,n,r){let i=await ro(e,t,n,K(r,0,Ra[t])),a=K(r,Ra[t]);if(i[0]!=a[0]||i[1]!=a[1])throw Error(wa)}async function no(e,t,n){let r=ka(new Uint8Array(Ra[t]));return ia(r,await ro(e,t,n,r))}async function ro(e,t,n,r){e.password=null;let i=await io(ja,n,Fa,!1,La),a=await ao(Object.assign({salt:r},Ia),i,8*(za[t]*2+2)),o=new Uint8Array(a),s=lo(Ga,K(o,0,za[t])),c=lo(Ga,K(o,za[t],za[t]*2)),l=K(o,za[t]*2);return Object.assign(e,{keys:{key:s,authentication:c,passwordVerification:l},ctr:new qa(new Ka(s),Array.from(Va)),hmac:new Ja(c)}),l}async function io(e,t,n,r,i){if(Ya)try{return await Ua.importKey(e,t,n,r,i)}catch{return Ya=!1,Sa.importKey(t)}return Sa.importKey(t)}async function ao(e,t,n){if(Xa)try{return await Ua.deriveBits(e,t,n)}catch{return Xa=!1,Sa.pbkdf2(t,e.salt,Ia.iterations,n)}return Sa.pbkdf2(t,e.salt,Ia.iterations,n)}function oo(e,t){return t===void 0?_a(e):t}function so(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function K(e,t,n){return e.subarray(t,n)}function co(e,t){return e.fromBits(t)}function lo(e,t){return e.toBits(t)}var uo=12,fo=class extends TransformStream{constructor({password:e,rawPassword:t,passwordVerification:n,checkPasswordOnly:r}){super({start(){mo(this,e,t,n)},transform(e,t){let n=this;if(n.password||n.rawPassword){let t=ho(n,e.subarray(0,uo));if(n.password=n.rawPassword=null,(t[11]^n.passwordVerification)!=0)throw Error(wa);e=e.subarray(uo)}r?t.error(Error(Da)):t.enqueue(ho(n,e))}})}},po=class extends TransformStream{constructor({password:e,rawPassword:t,passwordVerification:n}){super({start(){mo(this,e,t,n)},transform(e,t){let n=this,r,i;if(n.password||n.rawPassword){n.password=n.rawPassword=null;let t=ka(new Uint8Array(uo));t[11]=n.passwordVerification,r=new Uint8Array(e.length+t.length),r.set(go(n,t),0),i=uo}else r=new Uint8Array(e.length),i=0;r.set(go(n,e),i),t.enqueue(r)}})}};function mo(e,t,n,r){Object.assign(e,{password:t,rawPassword:n,passwordVerification:r}),_o(e,t,n)}function ho(e,t){let n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=yo(e)^t[r],vo(e,n[r]);return n}function go(e,t){let n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=yo(e)^t[r],vo(e,t[r]);return n}function _o(e,t,n){let r=[305419896,591751049,878082192];if(Object.assign(e,{keys:r,crcKey0:new ha(r[0]),crcKey2:new ha(r[2])}),n)for(let t=0;t<n.length;t++)vo(e,n[t]);else for(let n=0;n<t.length;n++)vo(e,t.charCodeAt(n))}function vo(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let r=~e.crcKey0.get();n=xo(Math.imul(xo(n+bo(r)),134775813)+1),e.crcKey2.append([n>>>24]);let i=~e.crcKey2.get();e.keys=[r,n,i]}function yo(e){let t=e.keys[2]|2;return bo(Math.imul(t,t^1)>>>8)}function bo(e){return e&255}function xo(e){return e&4294967295}function So(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(e){let{value:n,done:r}=await t.read();r?e.close():e.enqueue(n)},cancel(e){return t.cancel(e)}})}function Co(e,t){e=So(e);let n=t?{type:t}:{};if(wo())return new Response(e).blob().then(e=>t?new Blob([e],n):e);let r=[];return e.pipeTo(new WritableStream({write(e){r.push(e)}})).then(()=>new Blob(r,n))}function wo(){return typeof Blob.prototype.stream!=`function`||new Blob([]).stream()instanceof ReadableStream}function To(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(e){return t.write(e)},close(){return t.close()},abort(e){return t.abort(e)}})}var Eo=`Invalid codec module`,Do=new Map,Oo=new Map;function ko(e){return Do.get(e)}function Ao(e){return Oo.get(e)}function jo(e,t){let{CompressionStream:n,DecompressionStream:r}=t;if(typeof n!=`function`&&typeof r!=`function`)throw Error(Eo);Oo.set(e,{CompressionStream:n,DecompressionStream:r})}async function Mo(e,t){!Oo.has(e)&&t&&jo(e,await import(t))}var No=`Invalid uncompressed size`,Po=`Invalid compressed data`,Fo=Ta,Io=`Compression method not supported`,Lo=`deflate-raw`,Ro=`deflate64-raw`,zo=`gzip`,Bo=10,Vo=8,Ho=[31,139,8],Uo=5e3,Wo=class extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamFallback:n,CompressionStream:r}){super({});let{compressed:i,encrypted:a,useCompressionStream:o,zipCrypto:s,computeCrc32:c,level:l,deflate64:u,format:d,compressionMethod:f,inputSize:p}=e,m=this,h,g,_,v=super.readable,y=d&&Ao(d),b=c&&i&&!u&&!y&&(!a||s)&&!!(o&&r);if((!a||s)&&c&&!b&&(h=new ga,v=es(v,h)),i){if(y)v=ts(v,Qo(y.CompressionStream,d,{level:l,chunkSize:t,compressionMethod:f,uncompressedSize:p}));else if(b)_=new Go,v=ts(v,new r(zo)),v=es(v,_);else try{v=$o(v,o,{level:l,chunkSize:t},r,n)}catch(e){let t;try{t=new r(zo)}catch{throw e}v=ts(v,t),v=es(v,new Go)}}a&&(s?v=es(v,new po(e)):(g=new Qa(e),v=es(v,g))),Zo(m,v,()=>{(!a||s)&&c&&(m.crc32=b?_.crc32:new DataView(h.value.buffer).getUint32(0))})}},Go=class extends TransformStream{constructor(){let e,t=Bo,n=new Uint8Array;super({transform(e,r){if(t){let n=Math.min(t,e.length);if(t-=n,e=e.subarray(n),!e.length)return}let i=n.length+e.length;if(i<=Vo){n=ia(n,e);return}let a=i-Vo,o=Math.min(a,n.length);r.enqueue(ia(n.subarray(0,o),e.subarray(0,a-o))),n=ia(n.subarray(o),e.subarray(a-o))},flush(){let t=W(n);e.crc32=t.getUint32(0,!0),e.uncompressedSize=t.getUint32(4,!0)}}),e=this}};function Ko(e,t,n){let r=new ha,i=0,a=!1,o,s,c,l=new Promise((e,t)=>{s=e,c=t});l.catch(()=>{}),n||s();let u=new TransformStream({start(e){let t=new Uint8Array(Bo);t.set(Ho),e.enqueue(t)},transform(e,t){t.enqueue(e)},async flush(e){a=!0,f();try{await l}finally{p()}let t=new Uint8Array(Vo),i=W(t);i.setUint32(0,r.get(),!0),i.setUint32(4,n,!0),e.enqueue(t)},cancel(e){c(e)}}),d=new TransformStream({transform(e,t){r.append(e),i+=e.length,i>=n?s():a&&f(),t.enqueue(e)},cancel(e){c(e)}});return e=es(e,u),e=ts(e,t),es(e,d);function f(){p(),o=setTimeout(()=>c(Error(No)),Uo)}function p(){clearTimeout(o)}}var qo=class extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamFallback:n,DecompressionStream:r}){super({});let{zipCrypto:i,encrypted:a,checkCrc32:o,crc32:s,compressed:c,useCompressionStream:l,deflate64:u,format:d,compressionMethod:f,rawBitFlag:p,outputSize:m}=e,h,g,_=super.readable;if(a&&(i?_=es(_,new fo(e)):(g=new Za(e),_=es(_,g))),c){let e=d&&Ao(d);if(e)_=ts(_,Qo(e.DecompressionStream,d,{chunkSize:t,compressionMethod:f,rawBitFlag:p,uncompressedSize:m}));else try{_=$o(_,l,{chunkSize:t,deflate64:u},r,n)}catch(e){if(u||m===void 0)throw e;let t;try{t=new r(zo)}catch{throw e}_=Ko(_,t,m)}_=is(_)}o&&(h=new ga,_=es(_,h)),Zo(this,_,()=>{if(o){let e=new DataView(h.value.buffer);if(s!=e.getUint32(0,!1))throw Error(Fo)}})}},Jo=new Map;function Yo(e,t){if(!e)return!1;let n=Jo.get(e);n||(n=new Map,Jo.set(e,n));let r=n.get(t);if(r===void 0){try{new e(t),r=!0}catch{r=!1}n.set(t,r)}return r}function Xo(e){return Yo(e,Lo)}function Zo(e,t,n){t=es(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function Qo(e,t,n){if(!e)throw Error(Io);return new e(t,n)}function $o(e,t,n,r,i){let a=t&&r?r:i||r,o=n.deflate64?Ro:Lo,s;try{s=new a(o,n)}catch(e){if(t&&i&&a!=i)s=new i(o,n);else throw e}return ts(e,s)}function es(e,t){return So(e).pipeThrough(t)}function ts(e,t){let n=t.writable.getWriter(),r=e.getReader();return i(),t.readable;async function i(){try{for(;;){await n.ready;let e=await r.read();if(e.done){await n.close();break}await n.write(e.value)}}catch(e){await ns(n,e),await rs(r,e)}}}async function ns(e,t){try{await e.abort(t)}catch{}}async function rs(e,t){try{await e.cancel(t)}catch{}}function is(e){let t=e.getReader();return new ReadableStream({async pull(e){let n;try{n=await t.read()}catch(e){if(e&&e.message)throw e;let t=Error(Po);throw t.cause=e,t}let{value:r,done:i}=n;i?e.close():e.enqueue(r)},cancel(e){return t.cancel(e)}})}var as=65536,os=`message`,ss=`start`,cs=`data`,ls=`deflate`,us=`inflate`,ds=class extends TransformStream{constructor(e,t){super({});let n=this,{codecType:r}=e,i;r.startsWith(`deflate`)?i=Wo:r.startsWith(`inflate`)&&(i=qo),n.outputSize=0;let a=0,o=new i(e,t),s=super.readable,c=new TransformStream({transform(e,t){e&&e.length&&(a+=e.length,t.enqueue(e))},flush(){Object.assign(n,{inputSize:a})}}),l=new TransformStream({transform(t,r){if(t&&t.length&&(r.enqueue(t),n.outputSize+=t.length,e.outputSize!==void 0&&n.outputSize>e.outputSize))throw Error(No)},flush(){let{crc32:e}=o;Object.assign(n,{crc32:e,inputSize:a})}});Object.defineProperty(n,"readable",{get(){return s.pipeThrough(c).pipeThrough(o).pipeThrough(l)}})}},fs=class extends TransformStream{constructor(e){let t=[],n=0;(!Number.isFinite(e)||e<1)&&(e=as),super({transform(i,a){for(t.push(i),n+=i.length;n>e;)a.enqueue(r())},flush(e){n&&e.enqueue(i(t,n))}});function r(){let r=new Uint8Array(e),i=0;for(;i<e;){let n=t[0],a=e-i;n.length<=a?(r.set(n,i),i+=n.length,t.shift()):(r.set(n.subarray(0,a),i),t[0]=n.subarray(a),i+=a)}return n-=e,r}function i(e,t){let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}}},ps=`Worker startup timeout`,ms,hs,gs,_s=()=>{};function vs({initModule:e}){_s=e}function ys(e){gs=e}function bs(e){e.createWorker?hs=!0:ms=!1}var xs=class{constructor(e,{readable:t,writable:n},{options:r,config:i,streamOptions:a,useWebWorkers:o,transferStreams:s,workerURI:c,createWorker:l},u){let{signal:d}=a;return hs&&(l=void 0),Object.assign(e,{busy:!0,generation:(e.generation||0)+1,readable:t.pipeThrough(new fs(Yi(i))).pipeThrough(new Ss(a),{signal:d}),writable:n,options:Object.assign({},r),workerURI:c,createWorker:l,transferStreams:s,terminate(){return new Promise(t=>{let{worker:n,busy:r}=e;n?(r?e.resolveTerminated=t:(n.terminate(),t()),e.interface=null):t()})},onTaskFinished(){if(e.busy){let{resolveTerminated:t}=e;t&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),t()),e.busy=!1,u(e)}}}),ms===void 0&&(ms=typeof Worker!=Zr),(o&&gs&&(ms&&c||l)?gs:ws)(e,i)}},Ss=class extends TransformStream{constructor({onstart:e,onprogress:t,size:n,onend:r}){let i=0;super({async start(){e&&await Cs(e,n)},async transform(e,r){i+=e.length,t&&await Cs(t,i,n),r.enqueue(e)},async flush(){r&&await Cs(r,i)}})}};async function Cs(e,...t){try{await e(...t)}catch{}}function ws(e,t){return{run:()=>Ts(e,t)}}async function Ts({options:e,readable:t,writable:n,onTaskFinished:r},i){let a;try{if(e.compressed&&!e.format){let t=e.codecType.startsWith(ls),n=t?i.CompressionStreamFallback:i.DecompressionStreamFallback,r=t?i.CompressionStream:i.DecompressionStream;if(!e.useCompressionStream)try{await _s(i)}catch{(!n||n.requiresModule)&&(e.useCompressionStream=!0)}else if(n&&n.requiresModule&&!Xo(r))try{await _s(i)}catch{}}a=new ds(e,i),await t.pipeThrough(a).pipeThrough(new fs(Yi(i))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:r,inputSize:o,outputSize:s}=a;return{crc32:r,inputSize:o,outputSize:s}}catch(e){throw a&&(e.outputSize=a.outputSize),e}finally{r()}}var Es={type:`module`},Ds=`error`,Os=`messageerror`,ks,As,js,Ms=!0;try{Ms=typeof structuredClone==`function`&&structuredClone(new DOMException(``,`AbortError`)).code!==void 0}catch{}ys(Ns);function Ns(e,t){let{baseURI:n,chunkSize:r,workerStartupTimeout:i}=t,{wasmURI:a}=t;if(!e.interface){typeof a==`function`&&(a=a());let o;try{o=Rs(e.workerURI,n,e)}catch{return bs(e),ws(e,t)}Object.assign(e,{worker:o,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await Ps(e,{chunkSize:r,wasmURI:a,baseURI:n,workerStartupTimeout:i})}catch(n){if(n&&n.workerStartupFailed)return bs(e),Is(e),Ts(e,t);if(n&&n.codecImportFailed){if(e.reader)return Is(e),Ts(e,t);e.onTaskFinished()}throw n}}}})}return e.interface}async function Ps(e,t){if(!e.worker){let{startupError:t}=e;e.startupError=null;let n=t||Error(`Worker startup timeout`);throw n.workerStartupFailed=!0,n}let n,r,i=new Promise((e,t)=>{n=e,r=t});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:r,result:i});let{readable:a,options:o}=e,{writable:s,closed:c,abortPipe:l}=Fs(e.writable),u;try{u=Hs({type:ss,options:o,config:t,readable:a,writable:s},e)}catch(t){l();try{await c}catch{}throw e.onTaskFinished(),t}u||Object.assign(e,{reader:a.getReader(),writer:s.getWriter()});let{workerStartupTimeout:d}=t;!e.workerAlive&&Number.isFinite(d)&&d>=0&&(e.startupTimeout=setTimeout(()=>zs(e),d));try{let e=await i;return await f(),await c,e}catch(e){await f(),l();try{await c}catch{}throw e}async function f(){if(!u&&!s.locked)try{await s.getWriter().close()}catch{}}}function Fs(e){let t=new AbortController,{writable:n,readable:r}=new TransformStream,i=r.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return i.catch(()=>{}),{writable:n,closed:i,abortPipe:()=>t.abort()}}function Is(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function Ls(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function Rs(e,t,n,r,i=!0){let{createWorker:a}=n,o,s,c;if(a)o=a();else if(As===void 0||ks!==e){let a=typeof e==Qr;s=a?e(i):e;let l=s.startsWith(`data:`),u=s.startsWith(`blob:`);if(l||u){r===void 0&&(r=!1),r&&(c=Es);try{o=new Worker(s,c)}catch(i){if(u)try{URL.revokeObjectURL(s)}catch{}if(a&&u)return Rs(e,t,n,r,!1);if(r)throw i;return Rs(e,t,n,!0,!1)}}else{r===void 0&&(r=!0),r&&(c=Es);try{s=new URL(s,t)}catch{}try{o=new Worker(s,c)}catch(a){if(r)return Rs(e,t,n,!1,i);throw a}}ks=e,As=s,js=c}else o=new Worker(As,js);return o.addEventListener(os,e=>{n.workerAlive=!0,Bs(n),Us(e,n)}),o.addEventListener(Ds,e=>Vs(e,n)),o.addEventListener(Os,e=>Vs(e,n)),o}function zs(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(Ls(e),e.worker=null,t){let e=Error(ps);e.workerStartupFailed=!0,t(e),n&&n.releaseLock()}}function Bs(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function Vs(e,t){e.preventDefault&&e.preventDefault(),Bs(t);let{workerAlive:n,rejectResult:r,writer:i,onTaskFinished:a}=t;Ls(t),n||(t.worker=null);let o=e.error||Error(e.message||Ds);n||(o=Object.assign(Error(o.message||Ds),{workerStartupFailed:!0}),t.startupError=o),r&&(r(o),i&&i.releaseLock(),n&&a())}function Hs(e,{worker:t,writer:n,transferStreams:r,workerAlive:i}){try{let{value:n,readable:a,writable:o}=e,s=[];if(n&&(e.value=aa(n),s.push(e.value.buffer)),r&&Ms&&i?(a&&s.push(a),o&&s.push(o)):e.readable=e.writable=null,s.length)try{return t.postMessage(e,s),!0}catch{Ms=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(e){throw n&&n.releaseLock(),e}}async function Us({data:e},t){let{type:n,value:r,messageId:i,result:a,error:o}=e,{reader:s,writer:c,resolveResult:l,rejectResult:u,onTaskFinished:d,generation:f}=t,p=()=>t.generation!=f;try{if(o){let{message:e,stack:t,code:n,name:r,outputSize:i,cause:a,codecImportFailed:s}=o,c=Error(e);Object.assign(c,{stack:t,code:n,name:r,outputSize:i}),a&&(c.cause=Object.assign(Error(a.message),{name:a.name})),s&&(c.codecImportFailed=!0),m(c)}else{if(n==`pull`){let{value:e,done:n}=await s.read();p()||Hs({type:cs,value:e,done:n,messageId:i},t)}n==`data`&&(await c.ready,await c.write(new Uint8Array(r)),p()||Hs({type:`ack`,messageId:i},t)),n==`close`&&m(null,a)}}catch(e){p()||(Ls(t),m(e))}function m(e,t){p()||(e?u(e):l(t),c&&c.releaseLock(),e&&e.codecImportFailed||d())}}var Ws=[],Gs=[],Ks,qs,Js=0;async function Ys(e,t){let{options:n,config:r}=t,{transferStreams:i,useWebWorkers:a,useCompressionStream:o,compressed:s,checkCrc32:c,computeCrc32:l,encrypted:u,format:d,codecURI:f}=n,{workerURI:p,createWorker:m,maxWorkers:h}=r;d&&(f&&(n.codecURI=Xs(f,r.baseURI)),await Mo(d,n.codecURI)),t.transferStreams=!d&&(i||i===void 0&&r.transferStreams);let g=!s&&!c&&!l&&!u,_=d===void 0||!!n.codecURI;return t.useWebWorkers=!g&&_&&(a||a===void 0&&r.useWebWorkers),t.workerURI=t.useWebWorkers&&p?p:void 0,t.createWorker=t.useWebWorkers&&m?m:void 0,n.useCompressionStream=o||o===void 0&&r.useCompressionStream,(await v()).run();async function v(){let n=Ws.find(e=>!e.busy);if(n)return nc(n),new xs(n,e,t,y);if(Ws.length<h){let n={indexWorker:Js};return Js++,Ws.push(n),new xs(n,e,t,y)}return new Promise(n=>{Gs.push({resolve:n,stream:e,workerOptions:t}),qs=r.workerStarvationTimeout,Zs()})}function y(e){if(Qs(),Gs.length){let[{resolve:t,stream:n,workerOptions:r}]=Gs.splice(0,1);t(new xs(e,n,r,y)),Zs()}else e.worker?(nc(e),tc(e,t)):Ws=Ws.filter(t=>t!=e)}}function Xs(e,t){try{return new URL(e,t).toString()}catch{return e}}function Zs(){!Ks&&Gs.length&&Number.isFinite(qs)&&qs>=0&&(Ks=setTimeout($s,qs))}function Qs(){Ks&&=(clearTimeout(Ks),null)}function $s(){if(Ks=null,Gs.length){let[{resolve:e,stream:t,workerOptions:n}]=Gs.splice(0,1);e(new xs({},t,Object.assign({},n,{useWebWorkers:!1,workerURI:void 0,createWorker:void 0}),ec)),Zs()}}function ec(){Qs(),Zs()}function tc(e,t){let{config:n}=t,{terminateWorkerTimeout:r}=n;Number.isFinite(r)&&r>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{Ws=Ws.filter(t=>t!=e);try{await e.terminate()}catch{}},r))}function nc(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var rc=`\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`.split(``),ic=rc.length==256;function ac(e){if(ic){let t=``;for(let n=0;n<e.length;n++)t+=rc[e[n]];return t}return new TextDecoder().decode(e)}function oc(e,t){return sc(e,t,!0)}function sc(e,t,n){return t&&t.trim().toLowerCase()==`cp437`?ac(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var cc=`Writer iterator completed too soon`,lc=`Writer not initialized`,uc=262144,dc=`writable`,fc=Symbol(),pc=class{constructor(){this.size=0}init(){this.initialized=!0}},mc=class extends pc{get readable(){return this.createReadable()}createReadable({offset:e=0,size:t,chunkSize:n=Yi(Ji())}={}){let r=this,i=0;return n=Xi(n),new ReadableStream({async pull(a){let o=t===void 0?n:Math.min(n,t-i),s=await q(r,e+i,o);s.length&&a.enqueue(s),i+n>=t||!s.length&&o?a.close():i+=n}})}},hc=class extends pc{constructor(){super();let e=this,t=new WritableStream({write(t){if(!e.initialized)throw Error(lc);return e.writeUint8Array(aa(t))}});Object.defineProperty(e,dc,{get(){return t}})}writeUint8Array(){}},gc,_c;function vc(){_c=(async()=>{try{let e=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),t=0,n=await e.read();for(;!n.done;)t+=n.value.length,n=await e.read();gc=t==1}catch{gc=!1}})()}var yc=class extends mc{constructor(e){super(),Object.assign(this,{sourceBlob:e,size:e.size}),_c||vc()}createReadable(e){let{sourceBlob:t,size:n}=this,{offset:r=0,size:i=n-r}=e||{};return!r&&i>=n?So(t.stream()):gc?So(t.slice(r,r+i).stream()):super.createReadable(e)}async readUint8Array(e,t){let n=this,r=e+t,i=await(!e&&r>=n.size?n.sourceBlob:n.sourceBlob.slice(e,r)).arrayBuffer();return i.byteLength>t&&(i=i.slice(e,r)),new Uint8Array(i)}},bc=class extends mc{constructor(e){super(),e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Object.assign(this,{array:e,size:e.length})}readUint8Array(e,t){return this.array.slice(e,e+t)}},xc=class extends hc{constructor(e){super(),this.defaultBufferSize=e||uc}init(e=0){Object.assign(this,{offset:0,array:new Uint8Array(e>0?e:this.defaultBufferSize)}),super.init()}writeUint8Array(e){let t=this,n=t.offset+e.length;if(n>t.array.length){let e=t.array.length?t.array.length*2:t.defaultBufferSize;for(;e<n;)e*=2;let r=t.array;t.array=new Uint8Array(e),t.array.set(r)}t.array.set(e,t.offset),t.offset+=e.length}getData(){return this.offset===this.array.length?this.array:this.array.slice(0,this.offset)}},Sc=class extends mc{constructor(e){super(),this.readers=e}async init(){let e=this;e.lastDiskNumber=0,e.diskOffsets=(e.readers=await Promise.all(e.readers.map(Oc))).map(t=>{let n=e.size;return e.size+=t.size,n}),super.init()}getDiskOffset(e){let{diskOffsets:t,size:n}=this,r=t[e];return r===void 0?n:r}async readUint8Array(e,t){let n=this,{readers:r}=this,i,a=0,o=e;for(;r[a]&&o>=r[a].size;)o-=r[a].size,a++;let s=r[a];if(s){let r=s.size;if(o+t<=r)i=await q(s,o,t);else{let a=r-o;i=ia(await q(s,o,a),await n.readUint8Array(e+a,t-a))}}else i=$r;return n.lastDiskNumber=Math.max(a,n.lastDiskNumber),i}},Cc=class extends pc{constructor(e,t=4294967295){super();let n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let r,i,a,o=new WritableStream({async write(t){if(t===fc){a&&await c();return}let{availableSize:o}=n;if(a)t.length>=o?(await s(t.subarray(0,o)),await c(),t.length>o&&await this.write(t.subarray(o))):await s(t);else{let{value:o,done:s}=await e.next();if(s&&!o)throw Error(cc);r=o,r.size=0,r.maxSize&&(n.maxSize=r.maxSize),n.availableSize=n.maxSize,await Dc(r),i=o.writable,a=i.getWriter(),await this.write(t)}},async close(){a&&(await a.ready,await l())},async abort(e){a&&await a.abort(e)}});Object.defineProperty(n,dc,{get(){return o}});async function s(e){let t=e.length;t&&(await a.ready,await a.write(e),r.size+=t,n.availableSize-=t)}async function c(){await l(),n.diskOffset+=r.size,n.diskNumber++,a=null,n.availableSize=n.maxSize}async function l(){await a.close()}}async closeDisk(){let e=this.writable.getWriter();try{await e.ready,await e.write(fc)}finally{e.releaseLock()}}},wc=class{constructor(e){return Array.isArray(e)&&(e=new Sc(e)),(e instanceof ReadableStream||typeof e.getReader==`function`)&&(e={readable:So(e)}),e}},Tc=class{constructor(e){return e.writable===void 0&&typeof e.next==`function`&&(e=new Cc(e)),(e instanceof WritableStream||typeof e.getWriter==`function`)&&(e={writable:To(e)}),e.size===void 0&&(e.size=0),e}};function Ec(e){return!!(e&&e.getData)}async function Dc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function Oc(e){return e=new wc(e),await Dc(e),(e.size===void 0||!e.readUint8Array)&&(e=new yc(await Co(e.readable)),await Dc(e)),e}function q(e,t,n){return e.readUint8Array(t,n)}var kc=`filename`,Ac=`rawFilename`,jc=`comment`,Mc=`rawComment`,Nc=`uncompressedSize`,Pc=`compressedSize`,Fc=`offset`,Ic=`diskNumberStart`,Lc=`lastModDate`,Rc=`rawLastModDate`,zc=`lastAccessDate`,Bc=`rawLastAccessDate`,Vc=`creationDate`,Hc=`rawCreationDate`,Uc=[kc,Ac,Nc,Pc,Lc,Rc,jc,Mc,zc,Bc,Vc,Hc,Fc,Ic,`internalFileAttributes`,`externalFileAttributes`,`internalFileAttribute`,`externalFileAttribute`,`msdosAttributesRaw`,`msdosAttributes`,`msDosCompatible`,`zip64`,`encrypted`,`version`,`versionMadeBy`,`zipCrypto`,`directory`,`executable`,`symlink`,`compressionMethod`,`signature`,`crc32`,`extraField`,`extraFieldUnix`,`extraFieldInfoZip`,`extraFieldUnixType1`,`extraFieldPkwareUnix`,`uid`,`gid`,`unixMode`,`unixExternalUpper`,`setuid`,`setgid`,`sticky`,`bitFlag`,`rawBitFlag`,`filenameLength`,`extraFieldLength`,`filenameUTF8`,`commentUTF8`,`rawExtraField`,`extraFieldZip64`,`extraFieldUnicodePath`,`extraFieldUnicodeComment`,`extraFieldAES`,`extraFieldNTFS`,`extraFieldExtendedTimestamp`,`extraFieldUSDZ`],Wc=class{constructor(e){Uc.forEach(t=>this[t]=e[t])}},Gc=`File format is not recognized`,Kc=`End of central directory not found`,qc=`End of Zip64 central directory locator not found`,Jc=`Central directory header not found`,Yc=`Local file header not found`,Xc=`Zip64 extra field not found`,Zc=`File contains encrypted entry`,Qc=`Encryption method not supported`,$c=`Compression method not supported`,el=`Split zip file`,tl=`Overlapping entry found`,nl=`Entry data out of bounds`,rl=`Ambiguous archive`,il=`Encrypted central directory is not supported`,al=`Unsafe filename`,ol=`Invalid strictness (must be 'strict', 'balanced' or 'tolerant')`,sl=`Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')`,cl=`Invalid maxAppendedDataSize (must be a number greater than or equal to 0)`,ll=`64-bit value exceeds Number.MAX_SAFE_INTEGER`,ul=`unsorted central directory`,dl=`unknown version needed to extract`,fl=`compressed patched data`,pl=`malformed extra field`,ml=`unknown zip64 extensible data`,hl=`wrapped entries count`,gl=`appended data`,_l=`prepended data`,vl=`trailing central directory data`,yl=`duplicate filename`,bl=`mismatched zip64 end of central directory record`,xl=`mismatched local file header (general purpose bit flag)`,Sl=`mismatched local file header (compression method)`,Cl=`mismatched local file header (crc32 or sizes)`,wl=63,Tl=/^[a-zA-Z]:/,El=`utf-8`,Dl=`UTF8`,Ol=`cp437`,kl=9|Wr,Al=1,jl=[[Nc,Mr],[Pc,Mr],[Fc,Mr],[Ic,Nr]],Ml={[Nr]:{getValue:X,bytes:4},[Mr]:{getValue:Z,bytes:8}},Nl=BigInt(2**53-1),Pl=64,Fl=1032,Il=0,Ll=1,Rl=2,zl=class{constructor(e,t={}){Object.assign(this,{reader:new wc(e),options:t,readRanges:new Map})}async*getEntriesGenerator(e={}){let t=this,{reader:n}=t;if(await Dc(n),(n.size===void 0||!n.readUint8Array)&&(n=new yc(await Co(n.readable)),await Dc(n)),n.size<22)throw Error(Gc);let r=t.warnings=[],i=uu(e,t.options),a=i==Ti,o=i!=Di,s=gu(J(t,e,xi),i),c=mu(J(t,e,yi),i),l=J(t,e,bi),{endOfDirectoryInfo:u,endOfDirectoryReachingEndCount:d}=await _u(n,o,s);if(!u)throw await au(n)?Error(el):Error(Kc);o&&d>1&&Eu(`multiple end of central directory records`);let f=W(u),p=X(f,12),m=X(f,16),h=u.offset,g=Y(f,20),_=h+22+g,v=n.size-_;v>s&&Eu(gl),v>0&&Tu(r,gl);let y=Y(f,4),b=n.lastDiskNumber||0,x=Y(f,6),S=Y(f,10),C=0,w,T,E,D=56,O,k=m==4294967295||p==4294967295||S==65535||x==65535;if(m!=4294967295&&x!=65535&&(m+=iu(n,x)),k){let e=u.offset>=20?await q(n,u.offset-20,20):$r,t=W(e);if(e.length==20&&X(t,0)==117853008){m=iu(n,X(t,4))+Z(t,8);let e=await q(n,m,56),i=W(e),o=u.offset-20-56;if((e.length<56||X(i,0)!=101075792)&&m!=o&&o>=0){let t=m;m=o,m>t&&(C=m-t),e=await q(n,m,56),i=W(e)}if(e.length<56||X(i,0)!=101075792)throw Error(qc);if(T=!0,E=Z(i,4)>44,E){let e=Math.min(Z(i,4)-44,n.size-m-56);e>0&&(D+=e,O=Gl(await q(n,m+56,e)))}y==65535?y=X(i,16):y!=X(i,16)&&wu(a,r,bl),x==65535?x=X(i,20):x!=X(i,20)&&wu(a,r,bl),S==65535?S=Z(i,32):S!=Z(i,32)&&wu(a,r,bl),p==4294967295?p=Z(i,40):p!=Z(i,40)&&wu(a,r,bl),m=iu(n,x)+Z(i,48)+C}}let A=p,j=u.offset-(T?D+20:0);if(m>=n.size&&(C=n.size-m-p-22,m=n.size-p-22),b!=y)throw Error(el);if(m<0)throw Error(Gc);let M=0,N=await q(n,m,p),P=W(N);if(p){if(N.length<4)throw Error(Gc);let e=j-p;if(m!=e&&x==y){let t=!(X(P,M)==33639248||O&&O.compressedSize||Vl(P));if(!t&&e>=0&&e+4<=n.size&&(t=X(W(await q(n,e,4)),0)==Fr),t){let t=m;m=e,m>t&&(C+=m-t),N=await q(n,m,p),P=W(N)}}}let F=j-m;if(p!=F&&F>=0&&x==y&&(p=F,N=await q(n,m,p),P=W(N)),m<0||m>=n.size)throw Error(Gc);t.directoryOffset=m,t.directoryLength=A;let I=Du(t,e,Si),ee,L;if(I&&S&&N.length>=4&&X(P,0)!=33639248&&(E||Vl(P))){let e=Wl(O,A,N.length);L=N.subarray(e),N=await I(N.subarray(0,e),O),P=W(N),A=N.length,ee=!0}O&&!ee&&(N.length<4||X(P,0)==33639248)&&Tu(r,ml),w=m;let te=J(t,e,ei),ne=J(t,e,ti),re=new Set,ie,ae=-1,oe=!a&&!T;!S&&oe&&(S=Hl(P,N,M),S&&Tu(r,hl));for(let i=0;i<S;i++){let a=new Bl(n,t.options);if(M+46>N.length||X(P,M)!=33639248)throw i==0&&!ee&&(E||Vl(P))?Error(il):Error(Jc);Kl(a,P,M+6);let o=!!a.bitFlag.languageEncodingFlag,s=M+46,u=s+a.filenameLength,d=u+a.extraFieldLength,f=Y(P,M+4),p=!(f>>8),m=f>>8==3,h=N.subarray(s,u),g=Y(P,M+32),_=d+g,v=N.subarray(d,_),y=o,b=o,x=X(P,M+38),T=x&255,D={readOnly:!!(T&1),hidden:!!(T&2),system:!!(T&4),directory:!!(T&16),archive:!!(T&32)},O=X(P,M+42),k=Du(t,e,`decodeText`)||oc,A=y?El:te||Ol,j=b?El:ne||Ol,F=k(h,A,Ci);if(F===void 0&&(F=oc(h,A)),l){let e=l(F);e!==void 0&&(F=e)}if(hu(F,c)){let e=Error(al);throw e.filename=F,e}let I=k(v,j,wi);I===void 0&&(I=oc(v,j)),Object.assign(a,{index:i,decryptedDirectory:ee,versionMadeBy:f,msDosCompatible:p,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:g,offset:O,diskNumberStart:Y(P,M+34),internalFileAttributes:Y(P,M+36),externalFileAttributes:x,msdosAttributesRaw:T,msdosAttributes:D,rawFilename:h,filenameUTF8:y,commentUTF8:b,rawExtraField:N.subarray(u,d),rawComment:v,filename:F,comment:I}),ql(a,a,P,M+6)&&Tu(r,pl,F),a.offset+=C;let L=iu(n,a.diskNumberStart)+a.offset;w=Math.min(L,w),L<ae&&Tu(r,ul,F),ae=L,(a.version&255)>wl&&Tu(r,dl,F),(a.rawBitFlag&32)==32&&Tu(r,fl,F),re.has(a.filename)&&(ie=!0),re.add(a.filename);let R=a.externalFileAttributes>>16&Nr;a.unixMode===void 0&&R&16877&&(a.unixMode=R);let z=!!(a.unixMode&Jr),se=!!(a.unixMode&Yr),ce=!!(a.unixMode&512),le=((a.unixMode===void 0?R:a.unixMode)&Gr)==qr,ue=!le&&(a.unixMode===void 0?m&&!!(R&73):!!(a.unixMode&73)),de=a.unixMode!==void 0&&(a.unixMode&61440)==16384,fe=(R&Gr)==Kr;Object.assign(a,{setuid:z,setgid:se,sticky:ce,symlink:le,unixExternalUpper:R,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:ue,directory:de||fe||p&&D.directory||a.filename.endsWith(`/`),zipCrypto:a.encrypted&&!a.extraFieldAES});let B=new Wc(a);if(B.getData=(e,n)=>a.getData(e,B,t.readRanges,n),B.arrayBuffer=async e=>{let n=new TransformStream,r=Co(n.readable).then(e=>e.arrayBuffer());return r.catch(()=>{}),await a.getData(n,B,t.readRanges,e),r},M=_,i==S-1&&oe){let e=Hl(P,N,M);e&&(S+=e,Tu(r,hl))}let{onprogress:pe}=e;if(pe)try{await pe(i+1,S,new Wc(a))}catch{}yield B}let R=M,z=Ul(N.subarray(M))||(ee?Ul(L):void 0);if(!z&&!ee){let e=m+M,t=Math.min(j-e,6+Nr);t>=6&&(z=Ul(await q(n,e,t)))}z&&(t.digitalSignature=z,R=M+6+z.length),(M!=A&&R!=A||!ee&&M!=p&&R!=p)&&wu(a,r,vl),ie&&wu(a,r,yl);let se=J(t,e,ni),ce=J(t,e,ri),le=(a||se)&&S&&w==4&&await ou(n)?4:0;return a&&(C||S&&w>le)&&Eu(_l),(C||S&&w>4)&&Tu(r,_l),se&&(t.prependedData=w>le?await q(n,le,w-le):$r),t.comment=g?await q(n,h+22,g):$r,ce&&(t.appendedData=_<n.size?await q(n,_,n.size-_):$r),!0}async getEntries(e={}){let t=[];for await(let n of this.getEntriesGenerator(e))t.push(n);return t}async close(){let{reader:e}=this;!e.readUint8Array&&e.readable&&!e.readable.locked&&await e.readable.cancel()}},Bl=class{constructor(e,t){Object.assign(this,{reader:e,options:t})}async getData(e,t,n,r={}){let i=this,a=Ji(),{reader:o,index:s,offset:c,diskNumberStart:l,extraFieldAES:u,extraFieldZip64:d,compressionMethod:f,bitFlag:p,rawBitFlag:m,crc32:h,rawLastModDate:g,uncompressedSize:_,compressedSize:v}=i,{dataDescriptor:y}=p,b=t.localDirectory={},x=t.warnings=[],S=iu(o,l)+c,C=await q(o,S,30),w=W(C),T=J(i,r,ii),E=J(i,r,ai),D=J(i,r,oi);if(Ni(T,E),T=T&&T.length&&T,E=E&&E.length&&E,u&&u.originalCompressionMethod!=99)throw Error($c);if(C.length<30||X(w,0)!=67324752)throw Error(Yc);Kl(b,w,4);let{extraFieldLength:O,filenameLength:k}=b,A=b.dataOffset=S+30+k+O,j=J(i,r,fi),M=uu(r,i.options),N=fu(j,M),P=pu(j,M),F=$r;if(P&&(k||O)){let e=await q(o,S+30,k+O);F=e.subarray(0,k),b.rawExtraField=e.subarray(k)}else b.rawExtraField=O?await q(o,S+30+k,O):$r;P&&(b.rawFilename=F),ql(i,b,w,4,!0)&&Tu(x,pl),Cu(i,b,F,P,N?void 0:x);let{lastAccessDate:I,creationDate:ee,uid:L,gid:te}=b;I&&(t.lastAccessDate=I),ee&&(t.creationDate=ee),L!==void 0&&t.uid===void 0&&(t.uid=L),te!==void 0&&t.gid===void 0&&(t.gid=te);let ne=i.encrypted&&b.encrypted&&!D,re=ne&&!u;if(D||(t.zipCrypto=re),ne&&(b.rawBitFlag&64)==64)throw Error(Qc);let ie=D?void 0:ko(f);if(f!=0&&f!=8&&f!=9&&!ie&&!D)throw Error($c);if(ne){if(!re&&(u.strength<1||u.strength>3))throw Error(Qc);if(!T&&!E)throw Error(Zc)}if(A+v>o.size)throw Error(nl);let ae=v,oe=So(o.createReadable({offset:A,size:ae})),R=Mi(J(i,r,si)),z=J(i,r,ci),se=J(i,r,ui),ce=J(i,r,li);ce&&(se=!0);let{onstart:le,onprogress:ue,onend:de}=r,fe=f!=0&&!D,B=D?v:_,pe=f==9,me=J(i,r,gi);pe&&(me=!1);let he=J(i,r,pi),ge=(he===void 0?J(i,r,`checkSignature`):he)&&!D&&(!ne||re||u&&u.vendorVersion==Al),_e={options:{codecType:us,password:T,rawPassword:E,zipCrypto:re,encryptionStrength:u&&u.strength,checkCrc32:ge,checkAuthenticationCode:J(i,r,mi),passwordVerification:re&&(y?g>>>8&255:h>>>24&255),outputSize:B,crc32:h,compressed:fe,encrypted:ne,useWebWorkers:J(i,r,hi),useCompressionStream:me,transferStreams:J(i,r,_i),deflate64:pe,format:ie?ie.format:void 0,codecURI:ie?ie.codecURI:void 0,compressionMethod:f,rawBitFlag:m,checkPasswordOnly:z},config:a,streamOptions:{signal:R,size:ae,onstart:le,onprogress:ue,onend:de}};se&&await nu({reader:o,fileEntry:t,index:s,offset:S,crc32:h,compressedSize:v,uncompressedSize:_,dataOffset:A,dataDescriptor:y||b.bitFlag.dataDescriptor,extraFieldZip64:d||b.extraFieldZip64,readRanges:n});let ve,ye;try{if(!ce){z&&(e=new WritableStream),e=new Tc(e),await Dc(e,lu(B,v,fe)),{writable:ve}=e;let{outputSize:t}=await Ys({readable:oe,writable:ve},_e);if(e.size+=t,t!=B)throw Error(No)}}catch(t){if(t.outputSize!==void 0&&(e.size+=t.outputSize),!z||t.message!=`zipjs-abort-check-password`)throw ye=t,t}finally{if(!(!Ec(e)&&J(i,r,`preventClose`))&&ve&&!ve.locked){let e=ve.getWriter();if(ye)try{await e.abort(ye)}catch{}else await e.close()}}return z||ce?void 0:e.getData?e.getData():ve}};function Vl(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n<t;n++)if(X(e,n)==134630224)return!0;return!1}function Hl(e,t,n){let r=0;for(;n+46<=t.length&&X(e,n)==33639248;)n+=46+Y(e,n+28)+Y(e,n+30)+Y(e,n+32),r++;return r%65536?0:r}function Ul(e){if(e.length>=6){let t=W(e);if(X(t,0)==84233040){let n=Y(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function Wl(e,t,n){let r=e&&e.compressedSize?e.compressedSize:t;return r>0&&r<=n?r:n}function Gl(e){let t={rawExtensibleData:e};if(e.length>=28){let n=W(e),r=Y(n,26);Object.assign(t,{compressionMethod:Y(n,0),compressedSize:Z(n,2),uncompressedSize:Z(n,10),encryptionAlgorithm:Y(n,18),bitLength:Y(n,20),flags:Y(n,22),hashAlgorithm:Y(n,24),hashData:e.subarray(28,28+r)})}return t}function Kl(e,t,n){let r=e.rawBitFlag=Y(t,n+2),i=(r&1)==1,a=X(t,n+6);Object.assign(e,{encrypted:i,version:Y(t,n),bitFlag:{level:(r&6)>>1,dataDescriptor:(r&8)==8,languageEncodingFlag:(r&Wr)==Wr},rawLastModDate:a,lastModDate:Ou(a),filenameLength:Y(t,n+22),extraFieldLength:Y(t,n+24)})}function ql(e,t,n,r,i){let{rawExtraField:a}=t,o=t.extraField=new Map,s=W(a),c=0,l=!1;try{for(;c<a.length;){let e=Y(s,c),t=Y(s,c+2);o.set(e,{type:e,data:a.slice(c+4,c+4+t)}),c+=4+t}}catch{l=!0}c>a.length&&(l=!0);let u=Y(n,r+4);Object.assign(t,{signature:X(n,r+10),crc32:X(n,r+10),compressedSize:X(n,r+14),uncompressedSize:X(n,r+18)});let d=o.get(1);d&&(Jl(d,t),t.extraFieldZip64=d);let f=o.get(Rr);f&&(Yl(f,kc,Ac,t,e),t.extraFieldUnicodePath=f);let p=o.get(zr);p&&(Yl(p,jc,Mc,t,e),t.extraFieldUnicodeComment=p);let m=o.get(Ir);m&&m.data.length>=7?(Xl(m,t,u),t.extraFieldAES=m):t.compressionMethod=u;let h=o.get(13);h&&(Ql(h,t),t.extraFieldPkwareUnix=h);let g=o.get(Ur);g&&(Ql(g,t),t.extraFieldUnixType1=g);let _=o.get(10);_&&(Zl(_,t),t.extraFieldNTFS=_);let v=o.get(Hr),y;if(v&&(y=$l(v,t,!1),t.extraFieldUnix=v),!y){let e=o.get(Vr);e&&($l(e,t,!0),t.extraFieldInfoZip=e)}let b=o.get(Lr);b&&(tu(b,t,i),t.extraFieldExtendedTimestamp=b);let x=o.get(Br);return x&&(t.extraFieldUSDZ=x),l}function Jl(e,t){t.zip64=!0;let n=W(e.data),r=jl.filter(([e,n])=>t[e]==n),i=r.reduce((e,[,t])=>e+Ml[t].bytes,0);if(e.data.length<i)throw Error(Xc);for(let i=0,a=0;i<r.length;i++){let[o,s]=r[i],c=Ml[s];t[o]=e[o]=c.getValue(n,a),a+=c.bytes}}function Yl(e,t,n,r,i){if(e.data.length<5){e.valid=!1;return}let a=W(e.data),o=new ha;o.append(i[n]);let s=W(new Uint8Array(4));s.setUint32(0,o.get(),!0);let c=X(a,1),l=Au(a,0);Object.assign(e,{version:l,[t]:oc(e.data.subarray(5)),valid:l==1&&!i.bitFlag.languageEncodingFlag&&c==X(s,0)}),e.valid&&(r[t]=e[t],r[t+Dl]=!0)}function Xl(e,t,n){let r=W(e.data),i=Au(r,4);Object.assign(e,{vendorVersion:Au(r,0),vendorId:Au(r,2),strength:i,originalCompressionMethod:n,compressionMethod:Y(r,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=Al&&(t.crc32=void 0)}function Zl(e,t){let n=W(e.data),r=4,i;try{for(;r<e.data.length&&!i;){let t=Y(n,r),a=Y(n,r+2);t==1&&(i=e.data.slice(r+4,r+4+a)),r+=4+a}}catch{}if(i&&i.length==24){let n=W(i),r=n.getBigUint64(0,!0),a=n.getBigUint64(8,!0),o=n.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:r,rawLastAccessDate:a,rawCreationDate:o});let s={lastModDate:ku(r),lastAccessDate:ku(a),creationDate:ku(o)};Object.assign(e,s),Object.assign(t,s,{rawLastAccessDate:a,rawCreationDate:o})}}function Ql(e,t){if(e.data.length<8)return;let n=W(e.data),r={lastAccessDate:new Date((X(n,0)|0)*1e3),lastModDate:new Date((X(n,4)|0)*1e3)};e.data.length>=12&&(r.uid=Y(n,8),r.gid=Y(n,10)),Object.assign(e,r),Object.assign(t,r)}function $l(e,t,n){try{let r=W(e.data),i,a;if(n){let t=0,n=Au(r,t++),o=Au(r,t++);i=eu(e.data.subarray(t,t+o)),t+=o;let s=Au(r,t++);a=eu(e.data.subarray(t,t+s)),Object.assign(e,{version:n,uid:i,gid:a})}else e.data.length>=4&&(i=Y(r,0),a=Y(r,2),Object.assign(e,{uid:i,gid:a}));return i!==void 0&&(t.uid=i),a!==void 0&&(t.gid=a),i!==void 0||a!==void 0}catch{}}function eu(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function tu(e,t,n){if(!e.data.length)return;let r=W(e.data),i=Au(r,0),a=[],o=[];n?((i&1)==1&&(a.push(Lc),o.push(Rc)),(i&2)==2&&(a.push(zc),o.push(Bc)),(i&4)==4&&(a.push(Vc),o.push(Hc))):e.data.length>=5&&(a.push(Lc),o.push(Rc));let s=1;a.forEach((n,i)=>{if(e.data.length>=s+4){let a=X(r,s);t[n]=e[n]=new Date((a|0)*1e3);let c=o[i];e[c]=a}s+=4})}async function nu({reader:e,fileEntry:t,index:n,offset:r,crc32:i,compressedSize:a,uncompressedSize:o,dataOffset:s,dataDescriptor:c,extraFieldZip64:l,readRanges:u}){let d=0;if(c&&(d=l?20:12),d){let n=await q(e,s+a,d+4),r=W(n),c=n.length==d+4&&X(r,0)==134695760;if(c){let e=ru(r,4,l);(t.encrypted&&!t.zipCrypto||e.crc32==i)&&e.compressedSize==a&&e.uncompressedSize==o?d+=4:c=!1}if(n.length>=d){let e=ru(r,c?4:0,l);e.signature=c,t.localDirectory.dataDescriptor=e}}let f={start:r,end:s+a+d,fileEntry:t};for(let[e,t]of u)if(e!=n&&f.start<t.end&&t.start<f.end){let e=Error(tl);throw e.overlappingEntry=t.fileEntry,e}u.set(n,f)}function ru(e,t,n){let r=X(e,t),i,a;return n?(i=Z(e,t+4),a=Z(e,t+12)):(i=X(e,t+4),a=X(e,t+8)),{crc32:r,compressedSize:i,uncompressedSize:a}}function iu(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function au(e){return await su(e)==Pr}async function ou(e){let t=await su(e);return t==134695760||t==808471376}async function su(e){return X(W(await q(e,0,4)))}function cu(e){return e===`strict`||e===`balanced`||e===`tolerant`}function lu(e,t,n){return Math.min(e,n?t*Fl:t)}function uu(e,t){return du(e,du(t,Ei))}function du(e,t){let n=e[vi];if(n!==void 0){if(!cu(n))throw Error(ol);return n}let r=e[di];return r===void 0?t:r?Ti:t==`tolerant`?Di:Ei}function fu(e,t){return e===void 0?t!=Di:!!e}function pu(e,t){return e===void 0?t==Ti:!!e}function mu(e,t){if(e===void 0)return t;if(!cu(e))throw Error(sl);return e}function hu(e,t){if(t==`tolerant`)return!1;let n=e.split(`/`);return n.length>1&&n[n.length-1]===``&&n.pop(),n.includes(`..`)||e.startsWith(`/`)||e.startsWith(`\\\\`)||Tl.test(e)?!0:t==`strict`&&(n.includes(`.`)||n.includes(``))}function gu(e,t){if(e!==void 0){let t=Pi(e);if(typeof t!=`number`||Number.isNaN(t)||t<0)throw Error(cl);return t}return t==`strict`?0:t==`tolerant`?1/0:Nr}async function _u(e,t,n){let{size:r}=e,i=Math.min(r,22+Nr),a={count:Pl},o,s,c=0;for await(let[n,l,u,d,f]of yu(e,i)){let i=Y(n,d+20);if(f+22+i==r){let i=await xu(e,n,l,d,f,r,a);if(i==Rl){if(o||=bu(u,d,f),c++,!t||c>1)break}else i==Ll&&!s&&(s=bu(u,d,f))}}return o||=s,o||=await vu(e,n,a),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:c}}async function vu(e,t,n){let{size:r}=e,i=Math.min(r,t==1/0?r:22+Nr+t),a,o;for await(let[t,s,c,l,u]of yu(e,i)){let i=bu(c,l,u);a||=i;let d=await xu(e,t,s,l,u,r,n);if(d==Rl)return i;d==Ll&&!o&&(o=i)}return o||a}async function*yu(e,t){let n=e.size-t,r=await q(e,n,t),i=W(r);for(let e=r.length-22;e>=0;e--)X(i,e)==101010256&&(yield[i,n,r,e,n+e])}function bu(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function xu(e,t,n,r,i,a,o){let s=Y(t,r+10),c=X(t,r+12),l=X(t,r+16);if(s==65535||c==4294967295||l==4294967295)return await Su(e,t,n,i-20,a,o)==117853008?Rl:Il;if(!s&&!c)return Ll;let u=Y(t,r+6);for(let r of[i-c,iu(e,u)+l])if(await Su(e,t,n,r,a,o)==33639248)return Rl;return Il}async function Su(e,t,n,r,i,a){if(!(r<0||r+4>i)){if(r>=n)return X(t,r-n);if(a.count>0)return a.count--,X(W(await q(e,r,4)),0)}}function Cu(e,t,n,r,i){let{rawFilename:a}=e,o=!i,s=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;r&&!s&&(n.length!=a.length||n.some((e,t)=>e!=a[t]))&&wu(o,i,`mismatched local file header (filename)`),(t.rawBitFlag&kl)!=(e.rawBitFlag&kl)&&wu(o,i,xl),t.compressionMethod!=e.compressionMethod&&wu(o,i,Sl),!t.bitFlag.dataDescriptor&&!s&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&wu(o,i,Cl)}function wu(e,t,n){e?Eu(n):Tu(t,n)}function Tu(e,t,n){if(!e.some(e=>e.reason==t)){let r={reason:t};n!==void 0&&(r.filename=n),e.push(r)}}function Eu(e){let t=Error(rl);throw t.reason=e,t}function J(e,t,n){return t[n]===void 0?e.options[n]:t[n]}function Du(e,t,n){return ji(J(e,t,n))}function Ou(e){let t=(e&4294901760)>>16,n=e&Nr,r=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return r<Xr?Xr:r}function ku(e){return new Date(Number(e/BigInt(1e4)-BigInt(0xa9730b66800)))}function Au(e,t){return e.getUint8(t)}function Y(e,t){return e.getUint16(t,!0)}function X(e,t){return e.getUint32(t,!0)}function Z(e,t){let n=e.getBigUint64(t,!0);if(n>Nl)throw Error(ll);return Number(n)}new Uint8Array([7,0,2,0,65,69,3,0,0]);try{ea({baseURI:{}.url})}catch{}var ju=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],Mu=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Nu=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Pu=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Fu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Iu=new Uint8Array(288);Iu.fill(8,0,144),Iu.fill(9,144,256),Iu.fill(7,256,280),Iu.fill(8,280,288);var Lu=new Uint8Array(30).fill(5);function Ru(e){let t=new Uint16Array(16);for(let n of e)t[n]++;t[0]=0;let n=new Uint16Array(17);for(let e=1;e<=15;e++)n[e+1]=n[e]+t[e];let r=new Uint16Array(e.length);for(let t=0;t<e.length;t++)e[t]&&(r[n[e[t]]++]=t);return{l:t,symbols:r}}var Q=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function zu(e){let t;e({wasmURI:()=>(t||=`data:application/wasm;base64,`+function(e){let t=``,n=e.length,r=0;for(;r+2<n;r+=3){let n=e[r]<<16|e[r+1]<<8|e[r+2];t+=Q[n>>18&63]+Q[n>>12&63]+Q[n>>6&63]+Q[63&n]}let i=n-r;if(i===1){let n=e[r]<<16;t+=Q[n>>18&63]+Q[n>>12&63]+`==`}else if(i===2){let n=e[r]<<16|e[r+1]<<8;t+=Q[n>>18&63]+Q[n>>12&63]+Q[n>>6&63]+`=`}return t}(function(e){let t=0,n=0,r=0,i=new Uint8Array(1024),a=0,o=0;for(;!o;){o=c(1);let e=c(2);if(e==0)l();else if(e==1)u(Ru(Iu),Ru(Lu));else{if(e!=2)throw Error(`invalid deflate block type`);u(...d())}}return i.subarray(0,a);function s(){if(t>=e.length)throw Error(`unexpected end of deflate data`);return e[t++]}function c(e){for(;r<e;)n|=s()<<r,r+=8;let t=n&(1<<e)-1;return n>>>=e,r-=e,t}function l(){n=0,r=0;let e=s()|s()<<8;t+=2,p(a+e);for(let t=0;t<e;t++)i[a++]=s()}function u(e,t){let n=f(e);for(;n!=256;){if(n<256)p(a+1),i[a++]=n;else{let e=n-257,r=ju[e]+c(Mu[e]),o=f(t),s=Nu[o]+c(Pu[o]);p(a+r);let l=a-s;for(let e=0;e<r;e++)i[a++]=i[l+e]}n=f(e)}}function d(){let e=c(5)+257,t=c(5)+1,n=c(4)+4,r=new Uint8Array(19);for(let e=0;e<n;e++)r[Fu[e]]=c(3);let i=Ru(r),a=new Uint8Array(e+t),o=0;for(;o<a.length;){let e=f(i);if(e<16)a[o++]=e;else if(e==16){let e=a[o-1],t=c(2)+3;for(;t--;)a[o++]=e}else o+=e==17?c(3)+3:c(7)+11}return[Ru(a.subarray(0,e)),Ru(a.subarray(e))]}function f(e){let{l:t,symbols:n}=e,r=0,i=0,a=0;for(let e=1;e<=15;e++){r|=c(1);let o=t[e];if(r-i<o)return n[a+(r-i)];a+=o,i=i+o<<1,r<<=1}throw Error(`invalid huffman code`)}function p(e){if(i.length<e){let t=2*i.length;for(;t<e;)t*=2;let n=new Uint8Array(t);n.set(i.subarray(0,a)),i=n}}}(function(e){let t=(e=String(e).replace(/[^A-Za-z0-9+/=]/g,``)).length,n=[];for(let r=0;r<t;r+=4){let t=Q.indexOf(e[r])<<18|Q.indexOf(e[r+1])<<12|(63&Q.indexOf(e[r+2]))<<6|63&Q.indexOf(e[r+3]);n.push(t>>16&255),e[r+2]!==`=`&&n.push(t>>8&255),e[r+3]!==`=`&&n.push(255&t)}return new Uint8Array(n)}(`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`))),t)})}var Bu=`deflate`,Vu=`deflate-raw`,Hu=`deflate64-raw`,Uu=`gzip`,$,Wu,Gu,Ku,qu;function Ju(e){if($=e,{malloc:Wu,free:Gu,memory:Ku}=$,typeof Wu!=`function`||typeof Gu!=`function`||!Ku)throw $=Wu=Gu=Ku=null,Error(`Invalid WASM module`)}function Yu(e){qu=e}function Xu(e,t,n={}){if(!$){let e=Error(`WASM module not loaded`);throw e.cause=qu,e}let r=typeof n.level==`number`?n.level:-1,i=typeof n.outBuffer==`number`?n.outBuffer:65536,a=typeof n.inBufferSize==`number`?n.inBufferSize:65536;return new TransformStream({start(){try{let n;if(this.out=Wu(i),this.in=Wu(a),this.inBufferSize=a,!this.out||!this.in)throw Error(`allocation failed`);if(this._scratch=new Uint8Array(i),e?(this._process=$.deflate_process,this._last_consumed=$.deflate_last_consumed,this._end=$.deflate_end,this.streamHandle=$.deflate_new(),n=t===Uu?$.deflate_init_gzip(this.streamHandle,r):t===Vu?$.deflate_init_raw(this.streamHandle,r):$.deflate_init(this.streamHandle,r)):t===Hu?(this._process=$.inflate9_process,this._last_consumed=$.inflate9_last_consumed,this._end=$.inflate9_end,this.streamHandle=$.inflate9_new(),n=$.inflate9_init_raw(this.streamHandle)):(this._process=$.inflate_process,this._last_consumed=$.inflate_last_consumed,this._end=$.inflate_end,this.streamHandle=$.inflate_new(),n=t===Vu?$.inflate_init_raw(this.streamHandle):t===Uu?$.inflate_init_gzip(this.streamHandle):$.inflate_init(this.streamHandle)),n!==0)throw Error(`init failed:`+n)}catch(e){throw o(this),e}},transform(t,n){try{let r=t,a=new Uint8Array(Ku.buffer),o=this._process,s=this._last_consumed,c=this.out,l=this._scratch,u=0;for(;u<r.length;){let t=Math.min(r.length-u,32768);if((!this.in||this.inBufferSize<t)&&(this.in&&Gu&&(Gu(this.in),this.in=0),this.in=Wu(t),this.inBufferSize=t,!this.in))throw Error(`allocation failed`);a.set(r.subarray(u,u+t),this.in);let d=o(this.streamHandle,this.in,t,c,i,0),f=d&16777215;if(f&&(l.set(a.subarray(c,c+f),0),n.enqueue(l.slice(0,f))),!e){let e=d>>24&255,t=e&128?e-256:e;if(t<0)throw Error(`process error:`+t)}let p=s(this.streamHandle);if(p===0)break;u+=p}}catch(e){o(this),n.error(e)}},flush(t){try{let n=new Uint8Array(Ku.buffer),r=this._process,a=this.out,o=this._scratch;for(;;){let s=r(this.streamHandle,0,0,a,i,4),c=s&16777215,l=s>>24&255;if(!e){let e=l&128?l-256:l;if(e<0)throw Error(`process error:`+e)}if(c&&(o.set(n.subarray(a,a+c),0),t.enqueue(o.slice(0,c))),l===1||c===0)break}}catch(e){t.error(e)}finally{let e=o(this);e!==0&&t.error(Error(`end error:`+e))}},cancel(){o(this)}});function o(e){let t=0;return e.streamHandle&&e._end&&(t=e._end(e.streamHandle)),e.streamHandle=0,e.in&&Gu&&Gu(e.in),e.in=0,e.out&&Gu&&Gu(e.out),e.out=0,t}}var Zu=class{constructor(e=Bu,t){return Xu(!0,e,t)}},Qu=class{constructor(e=Bu,t){return Xu(!1,e,t)}};Zu.requiresModule=!0,Qu.requiresModule=!0,Zu.supportedFormats=[Bu,Vu,Uu],Qu.supportedFormats=[Bu,Vu,Uu,Hu];var $u=!1;async function ed(e,{baseURI:t}){if(!$u)try{await td(e,t),$u=!0}catch(e){throw Yu(e),e}}async function td(e,t){let n,r;try{try{r=new URL(e,t)}catch{}n=await(await fetch(r)).arrayBuffer()}catch(t){if(e.startsWith(`data:application/wasm;base64,`))n=nd(e);else throw t}Ju((await WebAssembly.instantiate(n)).instance.exports)}function nd(e){let t=e.split(`,`)[1],n=atob(t),r=n.length,i=new Uint8Array(r);for(let e=0;e<r;++e)i[e]=n.charCodeAt(e);return i.buffer}var rd;vs({initModule:e=>{if(!rd){let{wasmURI:t}=e;typeof t==`function`&&(t=t()),rd=ed(t,e).catch(e=>{throw rd=null,e})}return rd}}),ea({CompressionStreamFallback:Zu,DecompressionStreamFallback:Qu}),zu(ea),ra(ea);var id=class extends Error{code;cause;constructor(e,t,n){super(e),this.name=`AcmiParseError`,this.code=t,this.cause=n}},ad=class{_decoder=new TextDecoder;_currentLine=``;_currentTimeStamp=0;_currentFrame=new Ar(0);_destroyedIds=[];_filteredIds=[];_data=new Or;_excludedTypes=[];_acmiVersions=[`2.1`,`2.2`];_acmiType=`text/acmi/tacview`;_propertySeparator=/(?<!\\),/;_headerPattern=/^\ufeff?FileType=(?<type>.*)\r?\nFileVersion=(?<version>.*)\r?\n/;constructor(e){e!==void 0&&(jr.geoid=sr(this._toUint8Array(e),{}))}_toUint8Array(e){return e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}async _normalizeInput(e){if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return this._toUint8Array(e);if(typeof Blob<`u`&&e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new id(`Unsupported ACMI input. Expected text, binary data, or a Blob.`,`UNSUPPORTED_INPUT`)}_throwIfAborted(e){if(!e?.aborted)return;if(e.reason!==void 0)throw e.reason;let t=Error(`The operation was aborted`);throw t.name=`AbortError`,t}_isValidVersion(){return this._acmiVersions.find(e=>e===this._data.header.fileVersion)!==void 0}_isValidType(){return this._data.header.fileType===this._acmiType}_parseHeader(e){let t=this._data,n=this._decoder.decode(e.slice(0,64)),r=this._headerPattern.exec(n);r!==null&&r.groups!==void 0&&(t.header.fileType=r.groups.type,t.header.fileVersion=r.groups.version,t.isValid=this._isValidType()&&this._isValidVersion())}_consumeContentLine(e,t){t<=1||e.trim().length===0||e.startsWith(`//`)||(e.endsWith(`\\`)?this._currentLine+=e.slice(0,e.length-1)+`
3
+ `:(this._currentLine+=e,this._parseLine()))}_parseContent(e){let t=e.length,n=0,r=0,i=!1,a=0,o=``,s=0;for(;r<t;)e[r]===13?i=!0:e[r]===10&&(i?(i=!1,a=r-1):a=r,o=this._decoder.decode(e.slice(n,a)),n=r+1,this._consumeContentLine(o,s),++s),++r;n<t&&(o=this._decoder.decode(e.slice(n)),o.endsWith(`\r`)&&(o=o.slice(0,-1)),this._consumeContentLine(o,s));let c=this._data,l=c.frames;if(l.length>0||this._currentFrame.scene.size>0){l.push(this._currentFrame);let e=c.globalProperties.referenceTime,t=l.findIndex(e=>e.scene.size>0);e.isValid()&&t!==-1?(c.timeSpan.start=e.add(l[t].timeStamp,`seconds`),c.timeSpan.end=e.add(l[l.length-1].timeStamp,`seconds`)):c.isValid=!1}}_parseLine(){let e=this._data,t=e.frames,n=this._currentFrame,r=this._destroyedIds,i=this._filteredIds,a=this._currentLine;if(!a.startsWith(`0,Event`)){if(a.startsWith(`0,`))a=a.slice(2),a.split(this._propertySeparator).forEach(t=>{let n=t.indexOf(`=`);if(n>=0){let r=t.slice(0,n),i=t.slice(n+1),a=e.globalProperties;switch(r){case`DataSource`:a.dataSource=i;break;case`DataRecorder`:a.dataRecorder=i;break;case`ReferenceTime`:a.referenceTime=(0,m.default)(i);break;case`RecordingTime`:a.recordingTime=(0,m.default)(i);break;case`Author`:a.author=i;break;case`Title`:a.title=i;break;case`Category`:a.category=i;break;case`Briefing`:a.briefing=i;break;case`Debriefing`:a.debriefing=i;break;case`Comments`:a.comments=i;break;case`ReferenceLongitude`:a.referenceLongitude=+i,jr.refLong=a.referenceLongitude;break;case`ReferenceLatitude`:a.referenceLatitude=+i,jr.refLat=a.referenceLatitude;break;default:a.additionalProps===void 0&&(a.additionalProps=new Map),a.additionalProps.set(r,i)}}else e.isValid=!1});else if(a.startsWith(`#`)){r.length>0&&(r.forEach(e=>n.scene.delete(e)),this._destroyedIds=[]);let e=+a.slice(1);e!==this._currentTimeStamp&&(t.push(n),this._currentTimeStamp=e,this._currentFrame=new Ar(this._currentTimeStamp,n.scene))}else if(a.startsWith(`-`)){let t=parseInt(a.slice(1),16),n=e.entities.get(t);n&&(n.timeSpan.end=e.globalProperties.referenceTime.add(this._currentTimeStamp,`second`)),i.indexOf(t)>=0&&r.push(t)}else{let t=a.indexOf(`,`);if(t>=0){let r=parseInt(a.slice(0,t),16),o=a.slice(t+1),s=e.entities.get(r),c=!1;s===void 0&&(c=!0,s=new kr(r),s.timeSpan.start=e.globalProperties.referenceTime.add(this._currentTimeStamp,`second`));let l=o.split(this._propertySeparator);if(l.forEach(t=>{let n=t.indexOf(`=`);if(n>=0){let r=t.slice(0,n),i=t.slice(n+1);switch(r){case`Name`:s.name=i;break;case`Type`:s.types=i.split(`+`);break;case`CallSign`:s.callsign=i;break;case`Pilot`:s.pilot=i;break;case`Group`:s.group=i;break;case`Country`:s.country=i;break;case`Coalition`:s.coalition=i;break;case`Color`:s.color=i;break;case`destroyed`:+i==1&&(s.timeSpan.end=e.globalProperties.referenceTime.add(this._currentTimeStamp,`second`))}}else e.isValid=!1}),c){let t=this._excludedTypes,n=!0;if(t!==void 0&&t.length>0){let e=s.types;n=e===void 0?!t.includes(`Untyped`):e.every(e=>!t.includes(e))}n&&(e.entities.set(r,s),i.push(r))}if(i.indexOf(r)>=0){let e=l.findIndex(e=>e.startsWith(`T=`));if(e>=0){let t=l[e],i=t.indexOf(`=`);if(i>=0){let e=t.slice(i+1).split(`|`).map(e=>e?.length>0?+e:void 0);n.scene.set(r,new jr(e,n.scene.get(r)))}}}}else e.isValid=!1}}this._currentLine=``}async _unzip(e,t){this._throwIfAborted(t);let n=!1;if(e.length>1&&(n=new TextDecoder().decode(e.slice(0,2))===`PK`),n){let n=new zl(new bc(e));try{let e=await n.getEntries();if(this._throwIfAborted(t),e.length===1&&!e[0].directory)return await e[0].getData(new xc,{signal:t});throw new id(`A compressed ACMI archive must contain exactly one file.`,`INVALID_ARCHIVE`)}catch(e){throw this._throwIfAborted(t),e instanceof id?e:new id(`Unable to read the compressed ACMI archive.`,`INVALID_ARCHIVE`,e)}finally{await n.close()}}return e}_parseBuffer(e){return this._parseHeader(e),this._parseContent(e),this._data.entities.forEach(e=>{e.timeSpan.end.isValid()||(e.timeSpan.end=this._data.timeSpan.end.clone())}),this._data}async parse(e,t={}){let n=t.signal??t.controller?.signal;this._throwIfAborted(n),this._data=new Or,this._excludedTypes=t.excludedTypes??t.filter??[],this._currentLine=``,this._currentTimeStamp=0,this._currentFrame=new Ar(this._currentTimeStamp),this._destroyedIds=[],this._filteredIds=[];let r=await this._normalizeInput(e);return this._throwIfAborted(n),this._parseBuffer(await this._unzip(r,n))}};function od(e,t){return new ad().parse(e,t)}var sd=ad;exports.AcmiData=Or,exports.AcmiParseError=id,exports.AcmiParser=ad,exports.Entity=kr,exports.Frame=Ar,exports.GlobalProperties=h,exports.Header=g,exports.StateVector=Dr,exports.TimeSpan=_,exports.Trajectory=Er,exports.Transform=jr,exports.default=sd,exports.parseAcmi=od;