define(["exports","./Cartesian3-7e9cc2ff","./Matrix2-e3fb4559","./Check-741c5f3c","./defaultValue-81eec7ed","./Math-5f585871","./Matrix4-d34187af","./_commonjsHelpers-3aae1032-26891ab7","./combine-3c023bda","./RuntimeError-26acdd3b"],(function(e,t,n,r,o,i,s,a,u,c){"use strict";function l(e){this._ellipsoid=o.defaultValue(e,n.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.prototype.project=function(e,n){const r=this._semimajorAxis,i=e.longitude*r,s=e.latitude*r,a=e.height;return o.defined(n)?(n.x=i,n.y=s,n.z=a,n):new t.Cartesian3(i,s,a)},l.prototype.unproject=function(e,t){const r=this._oneOverSemimajorAxis,i=e.x*r,s=e.y*r,a=e.z;return o.defined(t)?(t.longitude=i,t.latitude=s,t.height=a,t):new n.Cartographic(i,s,a)};var d=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function f(e,t){this.start=o.defaultValue(e,0),this.stop=o.defaultValue(t,0)}function p(e,n){this.center=t.Cartesian3.clone(o.defaultValue(e,t.Cartesian3.ZERO)),this.radius=o.defaultValue(n,0)}const h=new t.Cartesian3,m=new t.Cartesian3,g=new t.Cartesian3,y=new t.Cartesian3,v=new t.Cartesian3,C=new t.Cartesian3,_=new t.Cartesian3,w=new t.Cartesian3,b=new t.Cartesian3,x=new t.Cartesian3,S=new t.Cartesian3,A=new t.Cartesian3,E=4/3*i.CesiumMath.PI;p.fromPoints=function(e,n){if(o.defined(n)||(n=new p),!o.defined(e)||0===e.length)return n.center=t.Cartesian3.clone(t.Cartesian3.ZERO,n.center),n.radius=0,n;const r=t.Cartesian3.clone(e[0],_),i=t.Cartesian3.clone(r,h),s=t.Cartesian3.clone(r,m),a=t.Cartesian3.clone(r,g),u=t.Cartesian3.clone(r,y),c=t.Cartesian3.clone(r,v),l=t.Cartesian3.clone(r,C),d=e.length;let f;for(f=1;fu.x&&t.Cartesian3.clone(r,u),oc.y&&t.Cartesian3.clone(r,c),dl.z&&t.Cartesian3.clone(r,l)}const E=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(u,i,w)),O=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(c,s,w)),I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,a,w));let P=i,R=u,T=E;O>T&&(T=O,P=s,R=c),I>T&&(T=I,P=a,R=l);const q=b;q.x=.5*(P.x+R.x),q.y=.5*(P.y+R.y),q.z=.5*(P.z+R.z);let z=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(R,q,w)),M=Math.sqrt(z);const D=x;D.x=i.x,D.y=s.y,D.z=a.z;const U=S;U.x=u.x,U.y=c.y,U.z=l.z;const k=t.Cartesian3.midpoint(D,U,A);let F=0;for(f=0;fF&&(F=n);const o=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(r,q,w));if(o>z){const e=Math.sqrt(o);M=.5*(M+e),z=M*M;const t=e-M;q.x=(M*q.x+t*r.x)/e,q.y=(M*q.y+t*r.y)/e,q.z=(M*q.z+t*r.z)/e}}return Ml.x&&t.Cartesian3.clone(s,l),od.y&&t.Cartesian3.clone(s,d),if.z&&t.Cartesian3.clone(s,f)}const I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,a,w)),P=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(d,u,w)),R=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(f,c,w));let T=a,q=l,z=I;P>z&&(z=P,T=u,q=d),R>z&&(z=R,T=c,q=f);const M=b;M.x=.5*(T.x+q.x),M.y=.5*(T.y+q.y),M.z=.5*(T.z+q.z);let D=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(q,M,w)),U=Math.sqrt(D);const k=x;k.x=a.x,k.y=u.y,k.z=c.z;const F=S;F.x=l.x,F.y=d.y,F.z=f.z;const N=t.Cartesian3.midpoint(k,F,A);let j=0;for(O=0;Oj&&(j=r);const o=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(s,M,w));if(o>D){const e=Math.sqrt(o);U=.5*(U+e),D=U*U;const t=e-U;M.x=(U*M.x+t*s.x)/e,M.y=(U*M.y+t*s.y)/e,M.z=(U*M.z+t*s.z)/e}}return Uc.x&&t.Cartesian3.clone(i,c),ol.y&&t.Cartesian3.clone(i,l),fd.z&&t.Cartesian3.clone(i,d)}const O=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(c,s,w)),I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,a,w)),P=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(d,u,w));let R=s,T=c,q=O;I>q&&(q=I,R=a,T=l),P>q&&(q=P,R=u,T=d);const z=b;z.x=.5*(R.x+T.x),z.y=.5*(R.y+T.y),z.z=.5*(R.z+T.z);let M=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(T,z,w)),D=Math.sqrt(M);const U=x;U.x=s.x,U.y=a.y,U.z=u.z;const k=S;k.x=c.x,k.y=l.y,k.z=d.z;const F=t.Cartesian3.midpoint(U,k,A);let N=0;for(E=0;EN&&(N=r);const o=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,z,w));if(o>M){const e=Math.sqrt(o);D=.5*(D+e),M=D*D;const t=e-D;z.x=(D*z.x+t*i.x)/e,z.y=(D*z.y+t*i.y)/e,z.z=(D*z.z+t*i.z)/e}}return D=l+u)return e.clone(r),r;if(u>=l+s)return n.clone(r),r;const d=.5*(s+l+u),f=t.Cartesian3.multiplyByScalar(c,(-s+d)/l,j);return t.Cartesian3.add(f,i,f),t.Cartesian3.clone(f,r.center),r.radius=d,r};const B=new t.Cartesian3;p.expand=function(e,n,r){r=p.clone(e,r);const o=t.Cartesian3.magnitude(t.Cartesian3.subtract(n,r.center,B));return o>r.radius&&(r.radius=o),r},p.intersectPlane=function(e,n){const r=e.center,o=e.radius,i=n.normal,s=t.Cartesian3.dot(i,r)+n.distance;return s<-o?d.OUTSIDE:s0&&t.height>0,e.resolve(Oe._result)},t.onerror=function(){Oe._result=!1,e.resolve(Oe._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},Object.defineProperties(Oe,{initialized:{get:function(){return o.defined(Oe._result)}}});const Ie=[];"undefined"!=typeof ArrayBuffer&&(Ie.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&Ie.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&Ie.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&Ie.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&Ie.push(BigUint64Array));const Pe={isChrome:_e,chromeVersion:function(){return _e()&&oe},isSafari:we,safariVersion:function(){return we()&&se},isWebkit:be,webkitVersion:function(){return be()&&ue},isInternetExplorer:xe,internetExplorerVersion:function(){return xe()&&le},isEdge:Se,edgeVersion:function(){return Se()&&fe},isFirefox:Ae,firefoxVersion:function(){return Ae()&&he},isWindows:function(){return o.defined(me)||(me=/Windows/i.test(ne.appVersion)),me},hardwareConcurrency:o.defaultValue(ne.hardwareConcurrency,3),supportsPointerEvents:function(){return o.defined(ge)||(ge=!Ae()&&"undefined"!=typeof PointerEvent&&(!o.defined(ne.pointerEnabled)||ne.pointerEnabled)),ge},supportsImageRenderingPixelated:Ee,supportsWebP:Oe,imageRenderingValue:function(){return Ee()?ye:void 0},typedArrayTypes:Ie};function Re(e,t,n,r){this.x=o.defaultValue(e,0),this.y=o.defaultValue(t,0),this.z=o.defaultValue(n,0),this.w=o.defaultValue(r,0)}Pe.supportsBasis=function(e){return Pe.supportsWebAssembly()&&e.context.supportsBasis},Pe.supportsFullscreen=function(){return te.supportsFullscreen()},Pe.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},Pe.supportsBigInt64Array=function(){return"undefined"!=typeof BigInt64Array},Pe.supportsBigUint64Array=function(){return"undefined"!=typeof BigUint64Array},Pe.supportsBigInt=function(){return"undefined"!=typeof BigInt},Pe.supportsWebWorkers=function(){return"undefined"!=typeof Worker},Pe.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!Pe.isEdge()};let Te=new t.Cartesian3;Re.fromAxisAngle=function(e,n,r){const i=n/2,s=Math.sin(i);Te=t.Cartesian3.normalize(e,Te);const a=Te.x*s,u=Te.y*s,c=Te.z*s,l=Math.cos(i);return o.defined(r)?(r.x=a,r.y=u,r.z=c,r.w=l,r):new Re(a,u,c,l)};const qe=[1,2,0],ze=new Array(3);Re.fromRotationMatrix=function(e,t){let n,r,i,a,u;const c=e[s.Matrix3.COLUMN0ROW0],l=e[s.Matrix3.COLUMN1ROW1],d=e[s.Matrix3.COLUMN2ROW2],f=c+l+d;if(f>0)n=Math.sqrt(f+1),u=.5*n,n=.5/n,r=(e[s.Matrix3.COLUMN1ROW2]-e[s.Matrix3.COLUMN2ROW1])*n,i=(e[s.Matrix3.COLUMN2ROW0]-e[s.Matrix3.COLUMN0ROW2])*n,a=(e[s.Matrix3.COLUMN0ROW1]-e[s.Matrix3.COLUMN1ROW0])*n;else{const t=qe;let o=0;l>c&&(o=1),d>c&&d>l&&(o=2);const f=t[o],p=t[f];n=Math.sqrt(e[s.Matrix3.getElementIndex(o,o)]-e[s.Matrix3.getElementIndex(f,f)]-e[s.Matrix3.getElementIndex(p,p)]+1);const h=ze;h[o]=.5*n,n=.5/n,u=(e[s.Matrix3.getElementIndex(p,f)]-e[s.Matrix3.getElementIndex(f,p)])*n,h[f]=(e[s.Matrix3.getElementIndex(f,o)]+e[s.Matrix3.getElementIndex(o,f)])*n,h[p]=(e[s.Matrix3.getElementIndex(p,o)]+e[s.Matrix3.getElementIndex(o,p)])*n,r=-h[0],i=-h[1],a=-h[2]}return o.defined(t)?(t.x=r,t.y=i,t.z=a,t.w=u,t):new Re(r,i,a,u)};const Me=new Re;let De=new Re,Ue=new Re,ke=new Re;Re.fromHeadingPitchRoll=function(e,n){return ke=Re.fromAxisAngle(t.Cartesian3.UNIT_X,e.roll,Me),Ue=Re.fromAxisAngle(t.Cartesian3.UNIT_Y,-e.pitch,n),n=Re.multiply(Ue,ke,Ue),De=Re.fromAxisAngle(t.Cartesian3.UNIT_Z,-e.heading,Me),Re.multiply(De,n,n)};const Fe=new t.Cartesian3,Ne=new t.Cartesian3,je=new Re,Be=new Re,Ve=new Re;Re.packedLength=4,Re.pack=function(e,t,n){return n=o.defaultValue(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},Re.unpack=function(e,t,n){return t=o.defaultValue(t,0),o.defined(n)||(n=new Re),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},Re.packedInterpolationLength=3,Re.convertPackedArrayForInterpolation=function(e,t,n,r){Re.unpack(e,4*n,Ve),Re.conjugate(Ve,Ve);for(let i=0,s=n-t+1;i0))return r;s=r-1}return~(s+1)}function ot(e,t,n,r,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=o}function it(e,t,n,r,o,i,s,a){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=o,this.second=i,this.millisecond=s,this.isLeapSecond=a}function st(e){return e%4==0&&e%100!=0||e%400==0}function at(e,t){this.julianDate=e,this.offset=t}Ke[7]=Xe/136,et[7]=8*Xe/17,Re.fastSlerp=function(e,t,n,r){let o,i=Re.dot(e,t);i>=0?o=1:(o=-1,i=-i);const s=i-1,a=1-n,u=n*n,c=a*a;for(let e=7;e>=0;--e)tt[e]=(Ke[e]*u-et[e])*s,nt[e]=(Ke[e]*c-et[e])*s;const l=o*n*(1+tt[0]*(1+tt[1]*(1+tt[2]*(1+tt[3]*(1+tt[4]*(1+tt[5]*(1+tt[6]*(1+tt[7])))))))),d=a*(1+nt[0]*(1+nt[1]*(1+nt[2]*(1+nt[3]*(1+nt[4]*(1+nt[5]*(1+nt[6]*(1+nt[7])))))))),f=Re.multiplyByScalar(e,d,Je);return Re.multiplyByScalar(t,l,r),Re.add(f,r,r)},Re.fastSquad=function(e,t,n,r,o,i){const s=Re.fastSlerp(e,t,o,Ze),a=Re.fastSlerp(n,r,o,Ge);return Re.fastSlerp(s,a,2*o*(1-o),i)},Re.equals=function(e,t){return e===t||o.defined(e)&&o.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Re.equalsEpsilon=function(e,t,n){return n=o.defaultValue(n,0),e===t||o.defined(e)&&o.defined(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},Re.ZERO=Object.freeze(new Re(0,0,0,0)),Re.IDENTITY=Object.freeze(new Re(0,0,0,1)),Re.prototype.clone=function(e){return Re.clone(this,e)},Re.prototype.equals=function(e){return Re.equals(this,e)},Re.prototype.equalsEpsilon=function(e,t){return Re.equalsEpsilon(this,e,t)},Re.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var ut=Object.freeze({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:2400000.5});var ct=Object.freeze({UTC:0,TAI:1});const lt=new it,dt=[31,28,31,30,31,30,31,31,30,31,30,31];function ft(e,t){return Ot.compare(e.julianDate,t.julianDate)}const pt=new at;function ht(e){pt.julianDate=e;const t=Ot.leapSeconds;let n=rt(t,pt,ft);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let r=t[n].offset;if(n>0){Ot.secondsDifference(t[n].julianDate,e)>r&&(n--,r=t[n].offset)}Ot.addSeconds(e,r,e)}function mt(e,t){pt.julianDate=e;const n=Ot.leapSeconds;let r=rt(n,pt,ft);if(r<0&&(r=~r),0===r)return Ot.addSeconds(e,-n[0].offset,t);if(r>=n.length)return Ot.addSeconds(e,-n[r-1].offset,t);const o=Ot.secondsDifference(n[r].julianDate,e);return 0===o?Ot.addSeconds(e,-n[r].offset,t):o<=1?void 0:Ot.addSeconds(e,-n[--r].offset,t)}function gt(e,t,n){const r=t/ut.SECONDS_PER_DAY|0;return e+=r,(t-=ut.SECONDS_PER_DAY*r)<0&&(e--,t+=ut.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function yt(e,t,n,r,o,i,s){const a=(t-14)/12|0,u=e+4800+a;let c=(1461*u/4|0)+(367*(t-2-12*a)/12|0)-(3*((u+100)/100|0)/4|0)+n-32075;(r-=12)<0&&(r+=24);const l=i+(r*ut.SECONDS_PER_HOUR+o*ut.SECONDS_PER_MINUTE+s*ut.SECONDS_PER_MILLISECOND);return l>=43200&&(c-=1),[c,l]}const vt=/^(\d{4})$/,Ct=/^(\d{4})-(\d{2})$/,_t=/^(\d{4})-?(\d{3})$/,wt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,bt=/^(\d{4})-?(\d{2})-?(\d{2})$/,xt=/([Z+\-])?(\d{2})?:?(\d{2})?$/,St=/^(\d{2})(\.\d+)?/.source+xt.source,At=/^(\d{2}):?(\d{2})(\.\d+)?/.source+xt.source,Et=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+xt.source;function Ot(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=o.defaultValue(e,0),t=o.defaultValue(t,0),n=o.defaultValue(n,ct.UTC);const r=0|e;gt(r,t+=(e-r)*ut.SECONDS_PER_DAY,this),n===ct.UTC&&ht(this)}Ot.fromGregorianDate=function(e,t){const n=yt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return o.defined(t)?(gt(n[0],n[1],t),ht(t),t):new Ot(n[0],n[1],ct.UTC)},Ot.fromDate=function(e,t){const n=yt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return o.defined(t)?(gt(n[0],n[1],t),ht(t),t):new Ot(n[0],n[1],ct.UTC)},Ot.fromIso8601=function(e,t){let n,r=(e=e.replace(",",".")).split("T"),i=1,s=1,a=0,u=0,c=0,l=0;const d=r[0],f=r[1];let p,h,m;if(r=d.match(bt),null!==r)n=+r[1],i=+r[2],s=+r[3];else if(r=d.match(Ct),null!==r)n=+r[1],i=+r[2];else if(r=d.match(vt),null!==r)n=+r[1];else{let e;if(r=d.match(_t),null!==r)n=+r[1],e=+r[2],h=st(n);else if(r=d.match(wt),null!==r){n=+r[1];e=7*+r[2]+(+r[3]||0)-new Date(Date.UTC(n,0,4)).getUTCDay()-3}p=new Date(Date.UTC(n,0,1)),p.setUTCDate(e),i=p.getUTCMonth()+1,s=p.getUTCDate()}if(h=st(n),o.defined(f)){r=f.match(Et),null!==r?(a=+r[1],u=+r[2],c=+r[3],l=1e3*+(r[4]||0),m=5):(r=f.match(At),null!==r?(a=+r[1],u=+r[2],c=60*+(r[3]||0),m=4):(r=f.match(St),null!==r&&(a=+r[1],u=60*+(r[2]||0),m=3)));const e=r[m],t=+r[m+1],o=+(r[m+2]||0);switch(e){case"+":a-=t,u-=o;break;case"-":a+=t,u+=o;break;case"Z":break;default:u+=new Date(Date.UTC(n,i-1,s,a,u)).getTimezoneOffset()}}const g=60===c;for(g&&c--;u>=60;)u-=60,a++;for(;a>=24;)a-=24,s++;for(p=h&&2===i?29:dt[i-1];s>p;)s-=p,i++,i>12&&(i-=12,n++),p=h&&2===i?29:dt[i-1];for(;u<0;)u+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)i--,i<1&&(i+=12,n--),p=h&&2===i?29:dt[i-1],s+=p;const y=yt(n,i,s,a,u,c,l);return o.defined(t)?(gt(y[0],y[1],t),ht(t)):t=new Ot(y[0],y[1],ct.UTC),g&&Ot.addSeconds(t,1,t),t},Ot.now=function(e){return Ot.fromDate(new Date,e)};const It=new Ot(0,0,ct.TAI);Ot.toGregorianDate=function(e,t){let n=!1,r=mt(e,It);o.defined(r)||(Ot.addSeconds(e,-1,It),r=mt(It,It),n=!0);let i=r.dayNumber;const s=r.secondsOfDay;s>=43200&&(i+=1);let a=i+68569|0;const u=4*a/146097|0;a=a-((146097*u+3)/4|0)|0;const c=4e3*(a+1)/1461001|0;a=a-(1461*c/4|0)+31|0;const l=80*a/2447|0,d=a-(2447*l/80|0)|0;a=l/11|0;const f=l+2-12*a|0,p=100*(u-49)+c+a|0;let h=s/ut.SECONDS_PER_HOUR|0,m=s-h*ut.SECONDS_PER_HOUR;const g=m/ut.SECONDS_PER_MINUTE|0;m-=g*ut.SECONDS_PER_MINUTE;let y=0|m;const v=(m-y)/ut.SECONDS_PER_MILLISECOND;return h+=12,h>23&&(h-=24),n&&(y+=1),o.defined(t)?(t.year=p,t.month=f,t.day=d,t.hour=h,t.minute=g,t.second=y,t.millisecond=v,t.isLeapSecond=n,t):new it(p,f,d,h,g,y,v,n)},Ot.toDate=function(e){const t=Ot.toGregorianDate(e,lt);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))},Ot.toIso8601=function(e,t){const n=Ot.toGregorianDate(e,lt);let r=n.year,i=n.month,s=n.day,a=n.hour;const u=n.minute,c=n.second,l=n.millisecond;let d;return 1e4===r&&1===i&&1===s&&0===a&&0===u&&0===c&&0===l&&(r=9999,i=12,s=31,a=24),o.defined(t)||0===l?o.defined(t)&&0!==t?(d=(.01*l).toFixed(t).replace(".","").slice(0,t),`${r.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`):`${r.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(.01*l).toString().replace(".",""),`${r.toString().padStart(4,"0")}-${i.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},Ot.clone=function(e,t){if(o.defined(e))return o.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Ot(e.dayNumber,e.secondsOfDay,ct.TAI)},Ot.compare=function(e,t){const n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},Ot.equals=function(e,t){return e===t||o.defined(e)&&o.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},Ot.equalsEpsilon=function(e,t,n){return n=o.defaultValue(n,0),e===t||o.defined(e)&&o.defined(t)&&Math.abs(Ot.secondsDifference(e,t))<=n},Ot.totalDays=function(e){return e.dayNumber+e.secondsOfDay/ut.SECONDS_PER_DAY},Ot.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*ut.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},Ot.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/ut.SECONDS_PER_DAY},Ot.computeTaiMinusUtc=function(e){pt.julianDate=e;const t=Ot.leapSeconds;let n=rt(t,pt,ft);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},Ot.addSeconds=function(e,t,n){return gt(e.dayNumber,e.secondsOfDay+t,n)},Ot.addMinutes=function(e,t,n){const r=e.secondsOfDay+t*ut.SECONDS_PER_MINUTE;return gt(e.dayNumber,r,n)},Ot.addHours=function(e,t,n){const r=e.secondsOfDay+t*ut.SECONDS_PER_HOUR;return gt(e.dayNumber,r,n)},Ot.addDays=function(e,t,n){return gt(e.dayNumber+t,e.secondsOfDay,n)},Ot.lessThan=function(e,t){return Ot.compare(e,t)<0},Ot.lessThanOrEquals=function(e,t){return Ot.compare(e,t)<=0},Ot.greaterThan=function(e,t){return Ot.compare(e,t)>0},Ot.greaterThanOrEquals=function(e,t){return Ot.compare(e,t)>=0},Ot.prototype.clone=function(e){return Ot.clone(this,e)},Ot.prototype.equals=function(e){return Ot.equals(this,e)},Ot.prototype.equalsEpsilon=function(e,t){return Ot.equalsEpsilon(this,e,t)},Ot.prototype.toString=function(){return Ot.toIso8601(this)},Ot.leapSeconds=[new at(new Ot(2441317,43210,ct.TAI),10),new at(new Ot(2441499,43211,ct.TAI),11),new at(new Ot(2441683,43212,ct.TAI),12),new at(new Ot(2442048,43213,ct.TAI),13),new at(new Ot(2442413,43214,ct.TAI),14),new at(new Ot(2442778,43215,ct.TAI),15),new at(new Ot(2443144,43216,ct.TAI),16),new at(new Ot(2443509,43217,ct.TAI),17),new at(new Ot(2443874,43218,ct.TAI),18),new at(new Ot(2444239,43219,ct.TAI),19),new at(new Ot(2444786,43220,ct.TAI),20),new at(new Ot(2445151,43221,ct.TAI),21),new at(new Ot(2445516,43222,ct.TAI),22),new at(new Ot(2446247,43223,ct.TAI),23),new at(new Ot(2447161,43224,ct.TAI),24),new at(new Ot(2447892,43225,ct.TAI),25),new at(new Ot(2448257,43226,ct.TAI),26),new at(new Ot(2448804,43227,ct.TAI),27),new at(new Ot(2449169,43228,ct.TAI),28),new at(new Ot(2449534,43229,ct.TAI),29),new at(new Ot(2450083,43230,ct.TAI),30),new at(new Ot(2450630,43231,ct.TAI),31),new at(new Ot(2451179,43232,ct.TAI),32),new at(new Ot(2453736,43233,ct.TAI),33),new at(new Ot(2454832,43234,ct.TAI),34),new at(new Ot(2456109,43235,ct.TAI),35),new at(new Ot(2457204,43236,ct.TAI),36),new at(new Ot(2457754,43237,ct.TAI),37)];var Pt=a.createCommonjsModule((function(e,t){!function(n){var r=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,i="object"==typeof a.commonjsGlobal&&a.commonjsGlobal;i.global!==i&&i.window!==i&&i.self!==i||(n=i);var s,u,c=2147483647,l=36,d=/^xn--/,f=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function y(e){throw new RangeError(h[e])}function v(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function C(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+v((e=e.replace(p,".")).split("."),t).join(".")}function _(e){for(var t,n,r=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=g(e)})).join("")}function b(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,n){var r=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;r+=l)e=m(e/35);return m(r+36*e/(e+38))}function S(e){var t,n,r,o,i,s,a,u,d,f,p,h=[],g=e.length,v=0,C=128,_=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&y("not-basic"),h.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=g&&y("invalid-input"),((u=(p=e.charCodeAt(o++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:l)>=l||u>m((c-v)/s))&&y("overflow"),v+=u*s,!(u<(d=a<=_?1:a>=_+26?26:a-_));a+=l)s>m(c/(f=l-d))&&y("overflow"),s*=f;_=x(v-i,t=h.length+1,0==i),m(v/t)>c-C&&y("overflow"),C+=m(v/t),v%=t,h.splice(v++,0,C)}return w(h)}function A(e){var t,n,r,o,i,s,a,u,d,f,p,h,v,C,w,S=[];for(h=(e=_(e)).length,t=128,n=0,i=72,s=0;s=t&&pm((c-n)/(v=r+1))&&y("overflow"),n+=(a-t)*v,t=a,s=0;sc&&y("overflow"),p==t){for(u=n,d=l;!(u<(f=d<=i?1:d>=i+26?26:d-i));d+=l)w=u-f,C=l-f,S.push(g(b(f+w%C,0))),u=m(w/C);S.push(g(b(u,0))),i=x(n,v,r==o),n=0,++r}++n,++t}return S.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:w},decode:S,encode:A,toASCII:function(e){return C(e,(function(e){return f.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return C(e,(function(e){return d.test(e)?S(e.slice(4).toLowerCase()):e}))}},r&&o)if(e.exports==r)o.exports=s;else for(u in s)s.hasOwnProperty(u)&&(r[u]=s[u]);else n.punycode=s}(a.commonjsGlobal)})),Rt=a.createCommonjsModule((function(e){ /*! * URI.js - Mutating URLs * IPv6 Support * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */var t,n;t=a.commonjsGlobal,n=function(e){var t=e&&e.IPv6;return{best:function(e){var t,n,r=e.toLowerCase().split(":"),o=r.length,i=8;for(""===r[0]&&""===r[1]&&""===r[2]?(r.shift(),r.shift()):""===r[0]&&""===r[1]?r.shift():""===r[o-1]&&""===r[o-2]&&r.pop(),-1!==r[(o=r.length)-1].indexOf(".")&&(i=7),t=0;t1;a++)n.splice(0,1);r[s]=n.join("")}var u=-1,c=0,l=0,d=-1,f=!1;for(s=0;sc&&(u=d,c=l)):"0"===r[s]&&(f=!0,d=s,l=1);l>c&&(u=d,c=l),c>1&&r.splice(u,c,""),o=r.length;var p="";for(""===r[0]&&(p=":"),s=0;s=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;var o=n.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(r+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var r=n.list[e.slice(t+1)];return!!r&&r.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return null;var o=n.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n},e.exports?e.exports=n():t.SecondLevelDomains=n(t)})),qt=a.createCommonjsModule((function(e){ /*! * URI.js - Mutating URLs * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */var t,n;t=a.commonjsGlobal,n=function(e,t,n,r){var o=r&&r.URI;function i(e,t){var n=arguments.length>=1,r=arguments.length>=2;if(!(this instanceof i))return n?r?new i(e,t):new i(e):new i;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.11";var s=i.prototype,a=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function l(e){return"Array"===c(e)}function d(e,t){var n,r,o={};if("RegExp"===c(t))o=null;else if(l(t))for(n=0,r=t.length;n]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.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"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,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)/gi,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)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var n=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var y,v={encode:"encode",decode:"decode"},C=function(e,t){return function(n){try{return i[t](n+"").replace(i.characters[e][t].expression,(function(n){return i.characters[e][t].map[n]}))}catch(e){return n}}};for(y in v)i[y+"PathSegment"]=C("pathname",v[y]),i[y+"UrnPathSegment"]=C("urnpath",v[y]);var _=function(e,t,n){return function(r){var o;o=n?function(e){return i[t](i[n](e))}:i[t];for(var s=(r+"").split(e),a=0,u=s.length;a-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),(n=e.indexOf("?"))>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(n=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(n+1,n+3).replace(/\\/g,"/")?(e=e.substring(n+3),e=i.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var n,r,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,o)||null,"/"===t.port&&(t.port=null);else{var s=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",s+1);-1!==u&&(-1===a||u-1?o:e.length-1);return s>-1&&(-1===o||s-1?p.slice(0,h)+p.slice(h).replace(s,""):p.replace(s,"")).length<=c[0].length||n.ignore&&n.ignore.test(p))){var y=t(p,l,f=l+p.length,e);void 0!==y?(y=String(y),e=e.slice(0,l)+y+e.slice(f),r.lastIndex=l+y.length):r.lastIndex=f}}return r.lastIndex=0,e},i.ensureValidHostname=function(t,n){var r=!!t,o=!1;if(!!n&&(o=f(i.hostProtocols,n)),o&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=o),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=w("protocol"),s.username=w("username"),s.password=w("password"),s.hostname=w("hostname"),s.port=w("port"),s.query=b("query","?"),s.fragment=b("fragment","#"),s.search=function(e,t){var n=this.query(e,t);return"string"==typeof n&&n.length?"?"+n:n},s.hash=function(e,t){var n=this.fragment(e,t);return"string"==typeof n&&n.length?"#"+n:n},s.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},s.path=s.pathname,s.href=function(e,t){var n;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var r=e instanceof i,o="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1),!r&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)throw new TypeError("invalid input");var s=r?e._parts:e;for(n in s)"query"!==n&&a.call(this._parts,n)&&(this._parts[n]=s[n]);s.query&&this.query(s.query,!1)}return this.build(!t),this},s.is=function(e){var t=!1,r=!1,o=!1,s=!1,a=!1,u=!1,c=!1,l=!this._parts.urn;switch(this._parts.hostname&&(l=!1,r=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),a=(s=!(t=r||o))&&n&&n.has(this._parts.hostname),u=s&&i.idn_expression.test(this._parts.hostname),c=s&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return l;case"absolute":return!l;case"domain":case"name":return s;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var x=s.protocol,S=s.port,A=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),S.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,n))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return A.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=this.protocol();return this.authority()?(n?n+"://":"")+this.authority():""}var r=i(e);return this.protocol(r.protocol()).authority(r.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=i.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},s.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=i.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var r=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),s=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(s,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(r+1);return!0!==t&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return e?i.decodePath(r):r}var o=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,o),a=new RegExp("^"+u(s));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);return e?i.decodePathSegment(r):r}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var s=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),o?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var n,r,o=this.filename(),s=o.lastIndexOf(".");return-1===s?"":(n=o.substring(s+1),r=/^[a-z0-9%]+$/i.test(n)?n:"",e?i.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));var a,c=this.suffix();if(c)a=e?new RegExp(u(c)+"$"):new RegExp(u("."+c)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return a&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},s.segment=function(e,t,n){var r=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),s=o.split(r);if(void 0!==e&&"number"!=typeof e&&(n=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void 0===t)return void 0===e?s:s[e];if(null===e||void 0===s[e])if(l(t)){s=[];for(var a=0,u=t.length;a0){const e=r.substring(0,o),n=r.substring(o+2);t[e]=n}}return t}(this.responseHeaders))}function Wt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function Ht(e,t){return t-e}function Yt(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function Zt(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}Qt.prototype.cancel=function(){this.cancelled=!0},Qt.prototype.clone=function(e){return o.defined(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=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Qt(this)},$t.prototype.toString=function(){let e="Request has failed.";return o.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(Wt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Wt.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},Wt.prototype.removeEventListener=function(e,t){const n=this._listeners,r=this._scopes;let o=-1;for(let i=0;i0){for(i.sort(Ht),e=0;e=0;--t)this.heapify(t)},Yt.prototype.insert=function(e){const t=this._array,n=this._comparator,r=this._maximumLength;let i,s=this._length++;for(sr&&(i=t[r],this._length=r),i},Yt.prototype.pop=function(e){if(e=o.defaultValue(e,0),0===this._length)return;const t=this._array,n=t[e];return Zt(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};const Gt={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let Jt=100;const Xt=new Yt({comparator:function(e,t){return e.priority-t.priority}});Xt.maximumLength=Jt,Xt.reserve(Jt);const Kt=[];let en={};const tn="undefined"!=typeof document?new qt(document.location.href):new qt,nn=new Wt;function rn(){}function on(e){o.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function sn(e){return e.state===Vt.UNISSUED&&(e.state=Vt.ISSUED,e.deferred=X()),e.deferred.promise}function an(e){const t=sn(e);return e.state=Vt.ACTIVE,Kt.push(e),++Gt.numberOfActiveRequests,++Gt.numberOfActiveRequestsEver,++en[e.serverKey],e.requestFunction().then(function(e){return function(t){if(e.state===Vt.CANCELLED)return;const n=e.deferred;--Gt.numberOfActiveRequests,--en[e.serverKey],nn.raiseEvent(),e.state=Vt.RECEIVED,e.deferred=void 0,n.resolve(t)}}(e)).catch(function(e){return function(t){e.state!==Vt.CANCELLED&&(++Gt.numberOfFailedRequests,--Gt.numberOfActiveRequests,--en[e.serverKey],nn.raiseEvent(t),e.state=Vt.FAILED,e.deferred.reject(t))}}(e)),t}function un(e){const t=e.state===Vt.ACTIVE;if(e.state=Vt.CANCELLED,++Gt.numberOfCancelledRequests,o.defined(e.deferred)){const t=e.deferred;e.deferred=void 0,t.reject()}t&&(--Gt.numberOfActiveRequests,--en[e.serverKey],++Gt.numberOfCancelledActiveRequests),o.defined(e.cancelFunction)&&e.cancelFunction()}rn.maximumRequests=100,rn.maximumRequestsPerServer=100,rn.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},rn.throttleRequests=!0,rn.debugShowStatistics=!1,rn.requestCompletedEvent=nn,Object.defineProperties(rn,{statistics:{get:function(){return Gt}},priorityHeapLength:{get:function(){return Jt},set:function(e){if(ee;){un(Xt.pop())}Jt=e,Xt.maximumLength=e,Xt.reserve(e)}}}),rn.serverHasOpenSlots=function(e,t){t=o.defaultValue(t,1);const n=o.defaultValue(rn.requestsByServer[e],rn.maximumRequestsPerServer);return en[e]+t<=n},rn.heapHasOpenSlots=function(e){return Xt.length+e<=Jt},rn.update=function(){let e,t,n=0;const r=Kt.length;for(e=0;e0&&(Kt[e-n]=t):++n;Kt.length-=n;const o=Xt.internalArray,i=Xt.length;for(e=0;e0;)t=Xt.pop(),t.cancelled?un(t):!t.throttleByServer||rn.serverHasOpenSlots(t.serverKey)?(an(t),++a):un(t);!function(){if(!rn.debugShowStatistics)return;0===Gt.numberOfActiveRequests&&Gt.lastNumberOfActiveRequests>0&&(Gt.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Gt.numberOfAttemptedRequests}`),Gt.numberOfAttemptedRequests=0),Gt.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Gt.numberOfCancelledRequests}`),Gt.numberOfCancelledRequests=0),Gt.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Gt.numberOfCancelledActiveRequests}`),Gt.numberOfCancelledActiveRequests=0),Gt.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Gt.numberOfFailedRequests}`),Gt.numberOfFailedRequests=0));Gt.lastNumberOfActiveRequests=Gt.numberOfActiveRequests}()},rn.getServerKey=function(e){let t=new qt(e);""===t.scheme()&&(t=new qt(e).absoluteTo(tn),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${"https"===t.scheme()?"443":"80"}`);const r=en[n];return o.defined(r)||(en[n]=0),n},rn.request=function(e){if(Bt(e.url)||Ft(e.url))return nn.raiseEvent(),e.state=Vt.RECEIVED,e.requestFunction();if(++Gt.numberOfAttemptedRequests,o.defined(e.serverKey)||(e.serverKey=rn.getServerKey(e.url)),rn.throttleRequests&&e.throttleByServer&&!rn.serverHasOpenSlots(e.serverKey))return;if(!rn.throttleRequests||!e.throttle)return an(e);if(Kt.length>=rn.maximumRequests)return;on(e);const t=Xt.insert(e);if(o.defined(t)){if(t===e)return;un(t)}return sn(e)},rn.clearForSpecs=function(){for(;Xt.length>0;){un(Xt.pop())}const e=Kt.length;for(let t=0;t0}}}),yn.prototype.toString=function(){return this.getUrlComponent(!0,!0)},yn.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;const n=new qt(this._url);e&&pn(n,this);let r=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return r=r.replace(/{(.*?)}/g,(function(e,t){const n=i[t];return o.defined(n)?encodeURIComponent(n):e})),t&&o.defined(this.proxy)&&(r=this.proxy.getURL(r)),r},yn.prototype.setQueryParameters=function(e,t){this._queryParameters=t?gn(this._queryParameters,e,!1):gn(e,this._queryParameters,!1)},yn.prototype.appendQueryParameters=function(e){this._queryParameters=gn(e,this._queryParameters,!0)},yn.prototype.setTemplateValues=function(e,t){this._templateValues=t?u.combine(this._templateValues,e):u.combine(e,this._templateValues)},yn.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,o.defined(e.url)){const n=new qt(e.url);fn(n,t,!0,o.defaultValue(e.preserveQueryParameters,!1)),n.fragment(""),""!==n.scheme()?t._url=n.toString():t._url=n.absoluteTo(new qt(Mt(this._url))).toString()}return o.defined(e.queryParameters)&&(t._queryParameters=u.combine(e.queryParameters,t._queryParameters)),o.defined(e.templateValues)&&(t._templateValues=u.combine(e.templateValues,t.templateValues)),o.defined(e.headers)&&(t.headers=u.combine(e.headers,t.headers)),o.defined(e.proxy)&&(t.proxy=e.proxy),o.defined(e.request)&&(t.request=e.request),o.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),o.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},yn.prototype.retryOnError=function(e){const t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then((function(e){return++n._retryCount,e}))},yn.prototype.clone=function(e){return o.defined(e)||(e=new yn({url:this._url})),e._url=this._url,e._queryParameters=zt(this._queryParameters),e._templateValues=zt(this._templateValues),e.headers=zt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},yn.prototype.getBaseUri=function(e){return function(e,t){let n="";const r=e.lastIndexOf("/");return-1!==r&&(n=e.substring(0,r+1)),t?(0!==(e=new qt(e)).query().length&&(n+=`?${e.query()}`),0!==e.fragment().length&&(n+=`#${e.fragment()}`),n):n}(this.getUrlComponent(e),e)},yn.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e=`${e}/`),e)},yn.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},yn.fetchArrayBuffer=function(e){return new yn(e).fetchArrayBuffer()},yn.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},yn.fetchBlob=function(e){return new yn(e).fetchBlob()},yn.prototype.fetchImage=function(e){e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT);const t=o.defaultValue(e.preferImageBitmap,!1),n=o.defaultValue(e.preferBlob,!1),r=o.defaultValue(e.flipY,!1),i=o.defaultValue(e.skipColorSpaceConversion,!1);if(mn(this.request),!dn||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return Cn({resource:this,flipY:r,skipColorSpaceConversion:i,preferImageBitmap:t});const s=this.fetchBlob();if(!o.defined(s))return;let a,u,c,l;return yn.supportsImageBitmapOptions().then((function(e){return a=e,u=a&&t,s})).then((function(e){if(!o.defined(e))return;if(l=e,u)return yn.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:i});const t=window.URL.createObjectURL(e);return c=new yn({url:t}),Cn({resource:c,flipY:r,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(o.defined(e))return e.blob=l,u||window.URL.revokeObjectURL(c.url),e})).catch((function(e){return o.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,Promise.reject(e)}))},yn.fetchImage=function(e){return new yn(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},yn.prototype.fetchText=function(){return this.fetch({responseType:"text"})},yn.fetchText=function(e){return new yn(e).fetchText()},yn.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(o.defined(e))return e.then((function(e){if(o.defined(e))return JSON.parse(e)}))},yn.fetchJson=function(e){return new yn(e).fetchJson()},yn.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},yn.fetchXML=function(e){return new yn(e).fetchXML()},yn.prototype.fetchJsonp=function(e){let t;e=o.defaultValue(e,"callback"),mn(this.request);do{t=`loadJsonp${i.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(o.defined(window[t]));return _n(this,e,t)},yn.fetchJsonp=function(e){return new yn(e).fetchJsonp(e.callbackParameterName)},yn.prototype._makeRequest=function(e){const t=this;mn(t.request);const n=t.request;n.url=t.url,n.requestFunction=function(){const r=e.responseType,i=u.combine(e.headers,t.headers),s=e.overrideMimeType,a=e.method,c=e.data,l=X(),d=yn._Implementations.loadWithXhr(t.url,r,a,c,i,l,s);return o.defined(d)&&o.defined(d.abort)&&(n.cancelFunction=function(){d.abort()}),l.promise};const r=rn.request(n);if(o.defined(r))return r.then((function(e){return n.cancelFunction=void 0,e})).catch((function(r){return n.cancelFunction=void 0,n.state!==Vt.FAILED?Promise.reject(r):t.retryOnError(r).then((function(o){return o?(n.state=Vt.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)}))}))};const wn=/^data:(.*?)(;base64)?,(.*)$/;function bn(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function xn(e,t){const n=bn(e,t),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let e=0;et.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;const u=t[o],c=t[i];if(u.equals(c)||r.equals(u))return Pn(e,n,o,a,s),s;if(r.equals(c))return Pn(e,n,i,a,s),s;const l=Ot.secondsDifference(r,u)/Ot.secondsDifference(c,u),d=o*a,f=i*a;let p=n[d+e._ut1MinusUtcSecondsColumn],h=n[f+e._ut1MinusUtcSecondsColumn];const m=h-p;if(m>.5||m<-.5){const t=n[d+e._taiMinusUtcSecondsColumn],o=n[f+e._taiMinusUtcSecondsColumn];t!==o&&(c.equals(r)?p=h:h-=o-t)}return s.xPoleWander=Rn(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=Rn(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=Rn(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=Rn(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=Rn(l,p,h),s}function qn(e,t,n){this.heading=o.defaultValue(e,0),this.pitch=o.defaultValue(t,0),this.roll=o.defaultValue(n,0)}yn._Implementations.loadWithXhr=function(e,t,n,r,i,s,a){const u=wn.exec(e);if(null!==u)return void s.resolve(function(e,t){t=o.defaultValue(t,"");const n=e[1],r=!!e[2],i=e[3];let s,a;switch(t){case"":case"text":return bn(r,i);case"arraybuffer":return xn(r,i);case"blob":return s=xn(r,i),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(bn(r,i),n);case"json":return JSON.parse(bn(r,i))}}(u,t));if(An)return void function(e,t,n,r,o,i,s){const a=require("url").parse(e),u="https:"===a.protocol?require("https"):require("http"),l=require("zlib"),d={protocol:a.protocol,hostname:a.hostname,port:a.port,path:a.path,query:a.query,method:n,headers:o};u.request(d).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)return void i.reject(new $t(e.statusCode,e,e.headers));const n=[];e.on("data",(function(e){n.push(e)})),e.on("end",(function(){const r=Buffer.concat(n);"gzip"===e.headers["content-encoding"]?l.gunzip(r,(function(e,n){e?i.reject(new c.RuntimeError("Error decompressing response.")):i.resolve(Sn(n,t))})):i.resolve(Sn(r,t))}))})).on("error",(function(e){i.reject(new $t)})).end()}(e,t,n,0,i,s);const l=new XMLHttpRequest;if(cn.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),o.defined(a)&&o.defined(l.overrideMimeType)&&l.overrideMimeType(a),o.defined(i))for(const e in i)i.hasOwnProperty(e)&&l.setRequestHeader(e,i[e]);o.defined(t)&&(l.responseType=t);let d=!1;return"string"==typeof e&&(d=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),l.onload=function(){if((l.status<200||l.status>=300)&&(!d||0!==l.status))return void s.reject(new $t(l.status,l.response,l.getAllResponseHeaders()));const e=l.response,r=l.responseType;if("HEAD"===n||"OPTIONS"===n){const e=l.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};return e.forEach((function(e){const n=e.split(": "),r=n.shift();t[r]=n.join(": ")})),void s.resolve(t)}if(204===l.status)s.resolve();else if(!o.defined(e)||o.defined(t)&&r!==t)if("json"===t&&"string"==typeof e)try{s.resolve(JSON.parse(e))}catch(e){s.reject(e)}else(""===r||"document"===r)&&o.defined(l.responseXML)&&l.responseXML.hasChildNodes()?s.resolve(l.responseXML):""!==r&&"text"!==r||!o.defined(l.responseText)?s.reject(new c.RuntimeError("Invalid XMLHttpRequest response type.")):s.resolve(l.responseText);else s.resolve(e)},l.onerror=function(e){s.reject(new $t)},l.send(r),l},yn._Implementations.loadAndExecuteScript=function(e,t,n){return function(e){const t=X(),n=document.createElement("script");n.async=!0,n.src=e;const r=document.getElementsByTagName("head")[0];return n.onload=function(){n.onload=void 0,r.removeChild(n),t.resolve()},n.onerror=function(e){t.reject(e)},r.appendChild(n),t.promise}(e).catch((function(e){n.reject(e)}))},yn._DefaultImplementations={},yn._DefaultImplementations.createImage=yn._Implementations.createImage,yn._DefaultImplementations.loadWithXhr=yn._Implementations.loadWithXhr,yn._DefaultImplementations.loadAndExecuteScript=yn._Implementations.loadAndExecuteScript,yn.DEFAULT=Object.freeze(new yn({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),En.NONE=Object.freeze({getPromiseToLoad:function(){return Promise.resolve()},compute:function(e,t){return o.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new ot(0,0,0,0,0),t}}),En.prototype.getPromiseToLoad=function(){return Promise.resolve(this._downloadPromise)},En.prototype.compute=function(e,t){if(!o.defined(this._samples)){if(o.defined(this._dataError))throw new c.RuntimeError(this._dataError);return}if(o.defined(t)||(t=new ot(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,r=this._lastIndex;let i=0,s=0;if(o.defined(r)){const a=n[r],u=n[r+1],c=Ot.lessThanOrEquals(a,e),l=!o.defined(u),d=l||Ot.greaterThanOrEquals(u,e);if(c&&d)return i=r,!l&&u.equals(e)&&++i,s=i+1,Tn(this,n,this._samples,e,i,s,t),t}let a=rt(n,e,Ot.compare,this._dateColumn);return a>=0?(a=this._totalSamples&&(a=this._totalSamples-1);const u=s/this._samplesPerXysFile|0,c=a/this._samplesPerXysFile|0,l=[];for(let e=u;e<=c;++e)l.push(Wn(this,e));return Promise.all(l)},Ln.prototype.computeXysRadians=function(e,t,n){const r=$n(this,e,t);if(r<0)return;const i=r/this._stepSizeDays|0;if(i>=this._totalSamples)return;const s=this._interpolationOrder;let a=i-(s/2|0);a<0&&(a=0);let u=a+s;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-s,a<0&&(a=0));let c=!1;const l=this._samples;if(o.defined(l[3*a])||(Wn(this,a/this._samplesPerXysFile|0),c=!0),o.defined(l[3*u])||(Wn(this,u/this._samplesPerXysFile|0),c=!0),c)return;o.defined(n)?(n.x=0,n.y=0,n.s=0):n=new Vn(0,0,0);const d=r-a*this._stepSizeDays,f=this._work,p=this._denominators,h=this._coef,m=this._xTable;let g,y;for(g=0;g<=s;++g)f[g]=d-m[g];for(g=0;g<=s;++g){for(h[g]=1,y=0;y<=s;++y)y!==g&&(h[g]*=f[y]);h[g]*=p[g];let e=3*(a+g);n.x+=h[g]*l[e++],n.y+=h[g]*l[e++],n.s+=h[g]*l[e]}return n};const Hn={},Yn={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"}},Zn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Gn={},Jn={east:new t.Cartesian3,north:new t.Cartesian3,up:new t.Cartesian3,west:new t.Cartesian3,south:new t.Cartesian3,down:new t.Cartesian3};let Xn=new t.Cartesian3,Kn=new t.Cartesian3,er=new t.Cartesian3;Hn.localFrameToFixedFrameGenerator=function(e,a){if(!Yn.hasOwnProperty(e)||!Yn[e].hasOwnProperty(a))throw new r.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");const u=Yn[e][a];let c;const l=e+a;return o.defined(Gn[l])?c=Gn[l]:(c=function(r,c,l){if(o.defined(l)||(l=new s.Matrix4),t.Cartesian3.equalsEpsilon(r,t.Cartesian3.ZERO,i.CesiumMath.EPSILON14))t.Cartesian3.unpack(Zn[e],0,Xn),t.Cartesian3.unpack(Zn[a],0,Kn),t.Cartesian3.unpack(Zn[u],0,er);else if(i.CesiumMath.equalsEpsilon(r.x,0,i.CesiumMath.EPSILON14)&&i.CesiumMath.equalsEpsilon(r.y,0,i.CesiumMath.EPSILON14)){const n=i.CesiumMath.sign(r.z);t.Cartesian3.unpack(Zn[e],0,Xn),"east"!==e&&"west"!==e&&t.Cartesian3.multiplyByScalar(Xn,n,Xn),t.Cartesian3.unpack(Zn[a],0,Kn),"east"!==a&&"west"!==a&&t.Cartesian3.multiplyByScalar(Kn,n,Kn),t.Cartesian3.unpack(Zn[u],0,er),"east"!==u&&"west"!==u&&t.Cartesian3.multiplyByScalar(er,n,er)}else{(c=o.defaultValue(c,n.Ellipsoid.WGS84)).geodeticSurfaceNormal(r,Jn.up);const i=Jn.up,s=Jn.east;s.x=-r.y,s.y=r.x,s.z=0,t.Cartesian3.normalize(s,Jn.east),t.Cartesian3.cross(i,s,Jn.north),t.Cartesian3.multiplyByScalar(Jn.up,-1,Jn.down),t.Cartesian3.multiplyByScalar(Jn.east,-1,Jn.west),t.Cartesian3.multiplyByScalar(Jn.north,-1,Jn.south),Xn=Jn[e],Kn=Jn[a],er=Jn[u]}return l[0]=Xn.x,l[1]=Xn.y,l[2]=Xn.z,l[3]=0,l[4]=Kn.x,l[5]=Kn.y,l[6]=Kn.z,l[7]=0,l[8]=er.x,l[9]=er.y,l[10]=er.z,l[11]=0,l[12]=r.x,l[13]=r.y,l[14]=r.z,l[15]=1,l},Gn[l]=c),c},Hn.eastNorthUpToFixedFrame=Hn.localFrameToFixedFrameGenerator("east","north"),Hn.northEastDownToFixedFrame=Hn.localFrameToFixedFrameGenerator("north","east"),Hn.northUpEastToFixedFrame=Hn.localFrameToFixedFrameGenerator("north","up"),Hn.northWestUpToFixedFrame=Hn.localFrameToFixedFrameGenerator("north","west");const tr=new Re,nr=new t.Cartesian3(1,1,1),rr=new s.Matrix4;Hn.headingPitchRollToFixedFrame=function(e,n,r,i,a){i=o.defaultValue(i,Hn.eastNorthUpToFixedFrame);const u=Re.fromHeadingPitchRoll(n,tr),c=s.Matrix4.fromTranslationQuaternionRotationScale(t.Cartesian3.ZERO,u,nr,rr);return a=i(e,r,a),s.Matrix4.multiply(a,c,a)};const or=new s.Matrix4,ir=new s.Matrix3;Hn.headingPitchRollQuaternion=function(e,t,n,r,o){const i=Hn.headingPitchRollToFixedFrame(e,t,n,r,or),a=s.Matrix4.getMatrix3(i,ir);return Re.fromRotationMatrix(a,o)};const sr=new t.Cartesian3(1,1,1),ar=new t.Cartesian3,ur=new s.Matrix4,cr=new s.Matrix4,lr=new s.Matrix3,dr=new Re;Hn.fixedFrameToHeadingPitchRoll=function(e,r,i,a){r=o.defaultValue(r,n.Ellipsoid.WGS84),i=o.defaultValue(i,Hn.eastNorthUpToFixedFrame),o.defined(a)||(a=new qn);const u=s.Matrix4.getTranslation(e,ar);if(t.Cartesian3.equals(u,t.Cartesian3.ZERO))return a.heading=0,a.pitch=0,a.roll=0,a;let c=s.Matrix4.inverseTransformation(i(u,r,ur),ur),l=s.Matrix4.setScale(e,sr,cr);l=s.Matrix4.setTranslation(l,t.Cartesian3.ZERO,l),c=s.Matrix4.multiply(c,l,c);let d=Re.fromRotationMatrix(s.Matrix4.getMatrix3(c,lr),dr);return d=Re.normalize(d,d),qn.fromQuaternion(d,a)};const fr=i.CesiumMath.TWO_PI/86400;let pr=new Ot;Hn.computeTemeToPseudoFixedMatrix=function(e,t){pr=Ot.addSeconds(e,-Ot.computeTaiMinusUtc(e),pr);const n=pr.dayNumber,r=pr.secondsOfDay;let a;const u=n-2451545;a=r>=43200?(u+.5)/ut.DAYS_PER_JULIAN_CENTURY:(u-.5)/ut.DAYS_PER_JULIAN_CENTURY;const c=(24110.54841+a*(8640184.812866+a*(.093104+-62e-7*a)))*fr%i.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(n-2451545.5))*((r+.5*ut.SECONDS_PER_DAY)%ut.SECONDS_PER_DAY),l=Math.cos(c),d=Math.sin(c);return o.defined(t)?(t[0]=l,t[1]=-d,t[2]=0,t[3]=d,t[4]=l,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s.Matrix3(l,d,0,-d,l,0,0,0,1)},Hn.iau2006XysData=new Ln,Hn.earthOrientationParameters=En.NONE;const hr=32.184;Hn.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+hr,r=e.stop.dayNumber,o=e.stop.secondsOfDay+hr,i=Hn.iau2006XysData.preload(t,n,r,o),s=Hn.earthOrientationParameters.getPromiseToLoad();return Promise.all([i,s])},Hn.computeIcrfToFixedMatrix=function(e,t){o.defined(t)||(t=new s.Matrix3);const n=Hn.computeFixedToIcrfMatrix(e,t);if(o.defined(n))return s.Matrix3.transpose(n,t)};const mr=new Vn(0,0,0),gr=new ot(0,0,0,0,0,0),yr=new s.Matrix3,vr=new s.Matrix3;Hn.computeFixedToIcrfMatrix=function(e,t){o.defined(t)||(t=new s.Matrix3);const n=Hn.earthOrientationParameters.compute(e,gr);if(!o.defined(n))return;const r=e.dayNumber,a=e.secondsOfDay+hr,u=Hn.iau2006XysData.computeXysRadians(r,a,mr);if(!o.defined(u))return;const c=u.x+n.xPoleOffset,l=u.y+n.yPoleOffset,d=1/(1+Math.sqrt(1-c*c-l*l)),f=yr;f[0]=1-d*c*c,f[3]=-d*c*l,f[6]=c,f[1]=-d*c*l,f[4]=1-d*l*l,f[7]=l,f[2]=-c,f[5]=-l,f[8]=1-d*(c*c+l*l);const p=s.Matrix3.fromRotationZ(-u.s,vr),h=s.Matrix3.multiply(f,p,yr),m=e.dayNumber-2451545,g=(e.secondsOfDay-Ot.computeTaiMinusUtc(e)+n.ut1MinusUtc)/ut.SECONDS_PER_DAY;let y=.779057273264+g+.00273781191135448*(m+g);y=y%1*i.CesiumMath.TWO_PI;const v=s.Matrix3.fromRotationZ(y,vr),C=s.Matrix3.multiply(h,v,yr),_=Math.cos(n.xPoleWander),w=Math.cos(n.yPoleWander),b=Math.sin(n.xPoleWander),x=Math.sin(n.yPoleWander);let S=r-2451545+a/ut.SECONDS_PER_DAY;S/=36525;const A=-47e-6*S*i.CesiumMath.RADIANS_PER_DEGREE/3600,E=Math.cos(A),O=Math.sin(A),I=vr;return I[0]=_*E,I[1]=_*O,I[2]=b,I[3]=-w*O+x*b*E,I[4]=w*E+x*b*O,I[5]=-x*_,I[6]=-x*O-w*b*E,I[7]=x*E-w*b*O,I[8]=w*_,s.Matrix3.multiply(C,I,t)};const Cr=new s.Cartesian4;Hn.pointToWindowCoordinates=function(e,t,n,r){return(r=Hn.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},Hn.pointToGLWindowCoordinates=function(e,t,r,i){o.defined(i)||(i=new n.Cartesian2);const a=Cr;return s.Matrix4.multiplyByVector(e,s.Cartesian4.fromElements(r.x,r.y,r.z,1,a),a),s.Cartesian4.multiplyByScalar(a,1/a.w,a),s.Matrix4.multiplyByVector(t,a,a),n.Cartesian2.fromCartesian4(a,i)};const _r=new t.Cartesian3,wr=new t.Cartesian3,br=new t.Cartesian3;Hn.rotationMatrixFromPositionVelocity=function(e,r,a,u){const c=o.defaultValue(a,n.Ellipsoid.WGS84).geodeticSurfaceNormal(e,_r);let l=t.Cartesian3.cross(r,c,wr);t.Cartesian3.equalsEpsilon(l,t.Cartesian3.ZERO,i.CesiumMath.EPSILON6)&&(l=t.Cartesian3.clone(t.Cartesian3.UNIT_X,l));const d=t.Cartesian3.cross(l,r,br);return t.Cartesian3.normalize(d,d),t.Cartesian3.cross(r,d,l),t.Cartesian3.negate(l,l),t.Cartesian3.normalize(l,l),o.defined(u)||(u=new s.Matrix3),u[0]=r.x,u[1]=r.y,u[2]=r.z,u[3]=l.x,u[4]=l.y,u[5]=l.z,u[6]=d.x,u[7]=d.y,u[8]=d.z,u};const xr=new s.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Sr=new n.Cartographic,Ar=new t.Cartesian3,Er=new t.Cartesian3,Or=new s.Matrix3,Ir=new s.Matrix4,Pr=new s.Matrix4;Hn.basisTo2D=function(e,n,r){const o=s.Matrix4.getTranslation(n,Er),i=e.ellipsoid,a=i.cartesianToCartographic(o,Sr),u=e.project(a,Ar);t.Cartesian3.fromElements(u.z,u.x,u.y,u);const c=Hn.eastNorthUpToFixedFrame(o,i,Ir),l=s.Matrix4.inverseTransformation(c,Pr),d=s.Matrix4.getMatrix3(n,Or),f=s.Matrix4.multiplyByMatrix3(l,d,r);return s.Matrix4.multiply(xr,f,r),s.Matrix4.setTranslation(r,u,r),r},Hn.wgs84To2DModelMatrix=function(e,n,r){const o=e.ellipsoid,i=Hn.eastNorthUpToFixedFrame(n,o,Ir),a=s.Matrix4.inverseTransformation(i,Pr),u=o.cartesianToCartographic(n,Sr),c=e.project(u,Ar);t.Cartesian3.fromElements(c.z,c.x,c.y,c);const l=s.Matrix4.fromTranslation(c,Ir);return s.Matrix4.multiply(xr,a,r),s.Matrix4.multiply(l,r,r),r},e.BoundingSphere=p,e.FeatureDetection=Pe,e.GeographicProjection=l,e.Intersect=d,e.Interval=f,e.Quaternion=Re,e.Resource=yn,e.Transforms=Hn,e.buildModuleUrl=Bn}));