define(["exports","./Matrix2-c6c16658","./EllipsoidTangentPlane-41514392","./ComponentDatatype-3d0a0aac","./PolylinePipeline-013902ec","./Transforms-f15de320","./when-4bbc8319","./RuntimeError-5b082e8f"],(function(e,a,t,n,r,i,o,s){"use strict";varl=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});constc={};functionC(e,a){o.defined(c[e])||(c[e]=!0,console.warn(o.defaultValue(a,e)))}C.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",C.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",C.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",C.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";constu=[newa.Cartesian3,newa.Cartesian3],d=newa.Cartesian3,g=newa.Cartesian3,y=newa.Cartesian3,m=newa.Cartesian3,h=newa.Cartesian3,f=newa.Cartesian3,p=newa.Cartesian3,w=newa.Cartesian3,x=newa.Cartesian3,E=newa.Cartesian3,P=newa.Cartesian3,b={};letM=newa.Cartographic;functionT(e,t,n,r){consti=e[0],o=e[1],s=a.Cartesian3.angleBetween(i,o),l=Math.ceil(s/r),c=newArray(l);letC;if(t===n){for(C=0;C<l;C++)c[C]=t;returnc.push(n),c}constu=(n-t)/l;for(C=1;C<l;C++){conste=t+C*u;c[C]=e}returnc[0]=t,c.push(n),c}constB=newa.Cartesian3,z=newa.Cartesian3;constS=newa.Cartesian3(-1,0,0);letA=newa.Matrix4;constD=newa.Matrix4;letR=newa.Matrix3;constO=a.Matrix3.IDENTITY.clone(),I=newa.Cartesian3,V=newa.Cartesian4,N=newa.Cartesian3;functionv(e,n,r,o,s,l,c,C){letu=I,d=V;A=i.Transforms.eastNorthUpToFixedFrame(e,s,A),u=a.Matrix4.multiplyByPointAsVector(A,S,u),u=a.Cartesian3.normalize(u,u);constg=function(e,n,r,i){consto=newt.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z),c=a.Cartesian2.angleBetween(s,l);returnl.x*s.y-l.y*s.x>=0?-c:c}(u,n,e,s);R=a.Matrix3.fromRotationZ(g,R),N.z=l,A=a.Matrix4.multiplyTransformation(A,a.Matrix4.fromRotationTranslation(R,N,D),A);consty=O;y[0]=c;for(lete=0;e<C;e++)for(lete=0;e<r.length;e+=3)d=a.Cartesian3.fromArray(r,e,d),d=a.Matrix3.multiplyByVector(y,d,d),d=a.Matrix4.multiplyByPoint(A,d,d),o.push(d.x,d.y,d.z);returno}constG=newa.Cartesian3;functionH(e,t,n,r,i,o,s){for(letl=0;l<e.length;l+=3){r=v(a.Cartesian3.fromArray(e,l,G),t,n,r,i,o[l/3],s,1)}returnr}functionL(e,a){constt=e.length,n=newArray(3*t);letr=0;consti=a.x+a.width/2,o=a.y+a.height/2;for(leta=0;a<t;a++)n[r++]=e[a].x-i,n[r++]=0,n[r++]=e[a].y-o;returnn}constj=newi.Quaternion,Q=newa.Cartesian3,q=newa.Matrix3;functionF(e,t,r,o,s,c,C,u,d,g){consty=a.Cartesian3.angleBetween(a.Cartesian3.subtract(t,e,E),a.Cartesian3.subtract(r,e,P)),m=o===l.BEVELED?0:Math.ceil(y/n.CesiumMath.toRadians(5));leth,f,p;if(h=s?a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(a.Cartesian3.negate(e,E),y/(m+1),j),q):a.Matrix3.fromQuaternion(i.Quaternion.fromAxisAngle(e,y/(m+1),j),q),t=a.Cartesian3.clone(t,Q),m>0){constn=g?2:1;for(letr=0;r<m;r++)t=a.Matrix3.multiplyByVector(h,t,t),f=a.Cartesian3.subtract(t,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(t,P),C=v(p,f,u,C,c,d,1,n)}elsef=a.Cartesian3.subtract(t,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(t,P),C=v(p,f,u,C,c,d,1,1),r=a.Cartesian3.clone(r,Q),f=a.Cartesian3.subtract(r,e,E),f=a.Cartesian3.normalize(f,f),s||(f=a.Cartesian3.negate(f,f)),p=c.scaleToGeodeticSurface(r,P),C=v(p,f,u,C,c,d,1,1);returnC}b.removeDuplicatesFromShape=function(e){constt=e.length,n=[];for(letr=t-1,i=0;i<t;r=i++){constt=e[r],o=e[i];a.Cartesian2.equals(t,o)||n.push(o)}returnn},b.angleIsGreaterThanPi=function(e,n,r,i){consto=newt.EllipsoidTangentPlane(r,i),s=o.projectPointOntoPlane(a.Cartesian3.add(r,e,B),B),l=o.projectPointOntoPlane(a.Cartesian3.add(r,n,z),z);returnl.x*s.y-l.y*s.x>=0};constU=newa.Cartesian3,_=newa.Cartesian3;b.computePositions=function(e,t,i,o,s){constc=o._ellipsoid,P=function(e,a){constt=newArray(e.length);for(letn=0;n<e.length;n++){constr=e[n];M=a.cartesianToCartographic(r,M),t[n]=M.height,e[n]=a.scaleToGeodeticSurface(r,r)}returnt}(e,c),B=o._granularity,z=o._cornerType,S=s?function(e,a){constt=e.length,n=newArray(6*t);letr=0;consti=a.x+a.width/2,o=a.y+a.height/2;lets=e[0];n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o;for(leta=1;a<t;a++){s=e[a];constt=s.x-i,l=s.y-o;n[r++]=t,n[r++]=0,n[r++]=l,n[r++]=t,n[r++]=0,n[r++]=l}returns=e[0],n[r++]=s.x-i,n[r++]=0,n[r++]=s.y-o,n}(t,i):L(t,i),A=s?L(t,i):void0,D=i.height/2,R=i.width/2;letO=e.length,I=[],V=s?[]:void0,N=d,G=g,j=y,Q=m,q=h,Z=f,W=p,Y=w,k=x,J=e[0],K=e[1];Q=c.geodeticSurfaceNormal(J,Q),N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y);letX,$,ee=P[0],ae=P[1];s&&(V=v(J,Y,A,V,c,ee+D,1,1)),k=a.Cartesian3.clone(J,k),J=K,G=a.Cartesian3.negate(N,G);for(lett=1;t<O-1;t++){consti=s?2:1;if(K=e[t+1],J.equals(K)){C("Positions are too close and are considered equivalent with rounding error.");continue}N=a.Cartesian3.subtract(K,J,N),N=a.Cartesian3.normalize(N,N),j=a.Cartesian3.add(N,G,j),j=a.Cartesian3.normalize(j,j),Q=c.geodeticSurfaceNormal(J,Q);consto=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(N,Q),U);a.Cartesian3.subtract(N,o,o),a.Cartesian3.normalize(o,o);constd=a.Cartesian3.multiplyByScalar(Q,a.Cartesian3.dot(G,Q),_);a.Cartesian3.subtract(G,d,d),a.Cartesian3.normalize(d,d);if(!n.CesiumMath.equalsEpsilon(Math.abs(a.Cartesian3.dot(o,d)),1,n.CesiumMath.EPSILON7)){j=a.Cartesian3.cross(j,Q,j),j=a.Cartesian3.cross(Q,j,j),j=a.Cartesian3.normalize(j,j);conste=1/Math.max(.25,a.Cartesian3.magnitude(a.Cartesian3.cross(j,G,E))),t=b.angleIsGreaterThanPi(N,G,J,c);t?(q=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,R,Z),Z),u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(Z,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),I=H($,Y,S,I,c,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,t,c,I,S,ae+D,s):(j=a.Cartesian3.negate(j,j),I=v(J,j,S,I,c,ae+D,e,i)),k=a.Cartesian3.clone(W,k)):(q=a.Cartesian3.add(J,a.Cartesian3.multiplyByScalar(j,e*R,j),q),Z=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,-R,Z),Z),u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(Z,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),I=H($,Y,S,I,c,X,1),Y=a.Cartesian3.cross(Q,N,Y),Y=a.Cartesian3.normalize(Y,Y),W=a.Cartesian3.add(q,a.Cartesian3.multiplyByScalar(Y,-R,W),W),z===l.ROUNDED||z===l.BEVELED?F(q,Z,W,z,t,c,I,S,ae+D,s):I=v(J,j,S,I,c,ae+D,e,i),k=a.Cartesian3.clone(W,k)),G=a.Cartesian3.negate(N,G)}elseI=v(k,Y,S,I,c,ee+D,1,1),k=J;ee=ae,ae=P[t+1],J=K}u[0]=a.Cartesian3.clone(k,u[0]),u[1]=a.Cartesian3.clone(J,u[1]),X=T(u,ee+D,ae+D,B),$=r.PolylinePipeline.generateArc({positions:u,granularity:B,ellipsoid:c}),I=H($,Y,S,I,c,X,1),s&&(V=v(J,Y,A,V,c,ae+D,1,1)),O=I.length;constte=s?O+V.length:O,ne=newFloat64Array(te);returnne.set(I),s&&ne.set(V,O),ne},e.CornerType=l,e.PolylineVolumeGeometryLibrary=b,e.oneTimeWarning=C}));
define(["exports","./when-4bbc8319"],(function(t,e){"use strict";functionn(t){lete;this.name="DeveloperError",this.message=t;try{thrownewError}catch(t){e=t.stack}this.stack=e}e.defined(Object.create)&&(n.prototype=Object.create(Error.prototype),n.prototype.constructor=n),n.prototype.toString=function(){lett=`${this.name}: ${this.message}`;returne.defined(this.stack)&&(t+=`\n${this.stack.toString()}`),t},n.throwInstantiationError=function(){thrownewn("This function defines an interface and should not be called directly.")};consto={};functionr(t,e,n){return`Expected ${n} to be typeof ${e}, actual typeof was ${t}`}functioni(t){lete;this.name="RuntimeError",this.message=t;try{thrownewError}catch(t){e=t.stack}this.stack=e}o.typeOf={},o.defined=function(t,o){if(!e.defined(o))thrownewn(function(t){return`${t} is required, actual value was undefined`}(t))},o.typeOf.func=function(t,e){if("function"!=typeofe)thrownewn(r(typeofe,"function",t))},o.typeOf.string=function(t,e){if("string"!=typeofe)thrownewn(r(typeofe,"string",t))},o.typeOf.number=function(t,e){if("number"!=typeofe)thrownewn(r(typeofe,"number",t))},o.typeOf.number.lessThan=function(t,e,r){if(o.typeOf.number(t,e),e>=r)thrownewn(`Expected ${t} to be less than ${r}, actual value was ${e}`)},o.typeOf.number.lessThanOrEquals=function(t,e,r){if(o.typeOf.number(t,e),e>r)thrownewn(`Expected ${t} to be less than or equal to ${r}, actual value was ${e}`)},o.typeOf.number.greaterThan=function(t,e,r){if(o.typeOf.number(t,e),e<=r)thrownewn(`Expected ${t} to be greater than ${r}, actual value was ${e}`)},o.typeOf.number.greaterThanOrEquals=function(t,e,r){if(o.typeOf.number(t,e),e<r)thrownewn(`Expected ${t} to be greater than or equal to ${r}, actual value was ${e}`)},o.typeOf.object=function(t,e){if("object"!=typeofe)thrownewn(r(typeofe,"object",t))},o.typeOf.bool=function(t,e){if("boolean"!=typeofe)thrownewn(r(typeofe,"boolean",t))},o.typeOf.bigint=function(t,e){if("bigint"!=typeofe)thrownewn(r(typeofe,"bigint",t))},o.typeOf.number.equals=function(t,e,r,i){if(o.typeOf.number(t,r),o.typeOf.number(e,i),r!==i)thrownewn(`${t} must be equal to ${e}, the actual values are ${r} and ${i}`)},e.defined(Object.create)&&(i.prototype=Object.create(Error.prototype),i.prototype.constructor=i),i.prototype.toString=function(){lett=`${this.name}: ${this.message}`;returne.defined(this.stack)&&(t+=`\n${this.stack.toString()}`),t},t.Check=o,t.DeveloperError=n,t.RuntimeError=i}));
* MIT License http://www.opensource.org/licenses/mit-license
*
*/vart,n;t=r.commonjsGlobal,n=function(e){vart=e&&e.SecondLevelDomains,n={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(e){vart=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;varr=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;varo=n.list[e.slice(t+1)];return!!o&&o.indexOf(""+e.slice(r+1,t)+"")>=0},is:function(e){vart=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;varr=n.list[e.slice(t+1)];return!!r&&r.indexOf(""+e.slice(0,t)+"")>=0},get:function(e){vart=e.lastIndexOf(".");if(t<=0||t>=e.length-1)returnnull;varr=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)returnnull;varo=n.list[e.slice(t+1)];returno?o.indexOf(""+e.slice(r+1,t)+"")<0?null:e.slice(r+1):null},noConflict:function(){returne.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};returnn},e.exports?e.exports=n():t.SecondLevelDomains=n(t)})),Ot=r.createCommonjsModule((function(e){
/*!
* URI.js - Mutating URLs
*
* Version: 1.19.8
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/vart,n;t=r.commonjsGlobal,n=function(e,t,n,r){varo=r&&r.URI;functioni(e,t){varn=arguments.length>=1,r=arguments.length>=2;if(!(thisinstanceofi))returnn?r?newi(e,t):newi(e):newi;if(void0===e){if(n)thrownewTypeError("undefined is not a valid argument for URI");e="undefined"!=typeoflocation?location.href+"":""}if(null===e&&n)thrownewTypeError("null is not a valid argument for URI");returnthis.href(e),void0!==t?this.absoluteTo(t):this}i.version="1.19.8";vars=i.prototype,a=Object.prototype.hasOwnProperty;functionu(e){returne.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}functionc(e){returnvoid0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}functionl(e){return"Array"===c(e)}functiond(e,t){varn,r,o={};if("RegExp"===c(t))o=null;elseif(l(t))for(n=0,r=t.length;n<r;n++)o[t[n]]=!0;elseo[t]=!0;for(n=0,r=e.length;n<r;n++)(o&&void0!==o[e[n]]||!o&&t.test(e[n]))&&(e.splice(n,1),r--,n--);returne}functionf(e,t){varn,r;if(l(t)){for(n=0,r=t.length;n<r;n++)if(!f(e,t[n]))return!1;return!0}varo=c(t);for(n=0,r=e.length;n<r;n++)if("RegExp"===o){if("string"==typeofe[n]&&e[n].match(t))return!0}elseif(e[n]===t)return!0;return!1}functionp(e,t){if(!l(e)||!l(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(varn=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}functionh(e){returne.replace(/^\/+|\/+$/g,"")}functionm(e){returnescape(e)}functiong(e){returnencodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.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*$/,i.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`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/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){vart=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)returni.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){varn=i.encode(e+"");returnvoid0===t&&(t=i.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},i.decodeQuery=function(e,t){e+="",void0===t&&(t=i.escapeQuerySpace);try{returni.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){returne}};vary,v={encode:"encode",decode:"decode"},w=function(e,t){returnfunction(n){try{returni[t](n+"").replace(i.characters[e][t].expression,(function(n){returni.characters[e][t].map[n]}))}catch(e){returnn}}};for(yinv)i[y+"PathSegment"]=w("pathname",v[y]),i[y+"UrnPathSegment"]=w("urnpath",v[y]);varC=function(e,t,n){returnfunction(r){varo;o=n?function(e){returni[t](i[n](e))}:i[t];for(vars=(r+"").split(e),a=0,u=s.length;a<u;a++)s[a]=o(s[a]);returns.join(e)}};function_(e){returnfunction(t,n){returnvoid0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!n),this)}}functionb(e,t){returnfunction(n,r){returnvoid0===n?this._parts[e]||"":(null!==n&&(n+="").charAt(0)===t&&(n=n.substring(1)),this._parts[e]=n,this.build(!r),this)}}i.decodePath=C("/","decodePathSegment"),i.decodeUrnPath=C(":","decodeUrnPathSegment"),i.recodePath=C("/","encodePathSegment","decode"),i.recodeUrnPath=C(":","encodeUrnPathSegment","decode"),i.encodeReserved=w("reserved","encode"),i.parse=function(e,t){varn;returnt||(t={preventInvalidHostname:i.preventInvalidHostname}),(n=e.indexOf("#"))>-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.replace(/^(https?|ftp|wss?)?:[/\\]*/i,"$1://")).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=void0:"//"===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="");varn,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{vars=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",s+1);-1!==u&&(-1===a||u<a)?(t.hostname=e.substring(0,o)||null,t.port=null):(r=e.substring(0,o).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)}returnt.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(o)||"/"},i.parseAuthority=function(e,t){returne=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){varn=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));varr,o=e.indexOf("/"),s=e.lastIndexOf("@",o>-1?o:e.length-1);returns>-1&&(-1===o||s<o)?(r=e.substring(0,s).split(":"),t.username=r[0]?i.decode(r[0]):null,r.shift(),t.password=r[0]?i.decode(r.join(":")):null,e=n.substring(s+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(varn,r,o,s={},u=e.split("&"),c=u.length,l=0;l<c;l++)n=u[l].split("="),r=i.decodeQuery(n.shift(),t),o=n.length?i.decodeQuery(n.join("="),t):null,"__proto__"!==r&&(a.call(s,r)?("string"!=typeofs[r]&&null!==s[r]||(s[r]=[s[r]]),s[r].push(o)):s[r]=o);returns},i.build=function(e){vart="",n=!1;returne.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",n=!0),t+=i.buildAuthority(e)||"","string"==typeofe.path&&("/"!==e.path.charAt(0)&&n&&(t+="/"),t+=e.path),"string"==typeofe.query&&e.query&&(t+="?"+e.query),"string"==typeofe.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){vart="";returne.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){returni.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){vart="";returne.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,n){varr,o,s,u,c="";for(oine)if("__proto__"!==o&&a.call(e,o))if(l(e[o]))for(r={},s=0,u=e[o].length;s<u;s++)void0!==e[o][s]&&void0===r[e[o][s]+""]&&(c+="&"+i.buildQueryParameter(o,e[o][s],n),!0!==t&&(r[e[o][s]+""]=!0));elsevoid0!==e[o]&&(c+="&"+i.buildQueryParameter(o,e[o],n));returnc.substring(1)},i.buildQueryParameter=function(e,t,n){returni.encodeQuery(e,n)+(null!==t?"="+i.encodeQuery(t,n):"")},i.addQuery=function(e,t,n){if("object"==typeoft)for(varrint)a.call(t,r)&&i.addQuery(e,r,t[r]);else{if("string"!=typeoft)thrownewTypeError("URI.addQuery() accepts an object, string as the name parameter");if(void0===e[t])returnvoid(e[t]=n);"string"==typeofe[t]&&(e[t]=[e[t]]),l(n)||(n=[n]),e[t]=(e[t]||[]).concat(n)}},i.setQuery=function(e,t,n){if("object"==typeoft)for(varrint)a.call(t,r)&&i.setQuery(e,r,t[r]);else{if("string"!=typeoft)thrownewTypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void0===n?null:n}},i.removeQuery=function(e,t,n){varr,o,s;if(l(t))for(r=0,o=t.length;r<o;r++)e[t[r]]=void0;elseif("RegExp"===c(t))for(sine)t.test(s)&&(e[s]=void0);elseif("object"==typeoft)for(sint)a.call(t,s)&&i.removeQuery(e,s,t[s]);else{if("string"!=typeoft)thrownewTypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void0!==n?"RegExp"===c(n)?!l(e[t])&&n.test(e[t])?e[t]=void0:e[t]=d(e[t],n):e[t]!==String(n)||l(n)&&1!==n.length?l(e[t])&&(e[t]=d(e[t],n)):e[t]=void0:e[t]=void0}},i.hasQuery=function(e,t,n,r){switch(c(t)){case"String":break;case"RegExp":for(varoine)if(a.call(e,o)&&t.test(o)&&(void0===n||i.hasQuery(e,o,n)))return!0;return!1;case"Object":for(varsint)if(a.call(t,s)&&!i.hasQuery(e,s,t[s]))return!1;return!0;default:thrownewTypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(n)){case"Undefined":returntine;case"Boolean":returnn===Boolean(l(e[t])?e[t].length:e[t]);case"Function":return!!n(e[t],t,e);case"Array":return!!l(e[t])&&(r?f:p)(e[t],n);case"RegExp":returnl(e[t])?!!r&&f(e[t],n):Boolean(e[t]&&e[t].match(n));case"Number":n=String(n);case"String":returnl(e[t])?!!r&&f(e[t],n):e[t]===n;default:thrownewTypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(vare=[],t=[],n=0,r=0;r<arguments.length;r++){varo=newi(arguments[r]);e.push(o);for(vars=o.segment(),a=0;a<s.length;a++)"string"==typeofs[a]&&t.push(s[a]),s[a]&&n++}if(!t.length||!n)returnnewi("");varu=newi("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||u.path("/"+u.path()),u.normalize()},i.commonPath=function(e,t){varn,r=Math.min(e.length,t.length);for(n=0;n<r;n++)if(e.charAt(n)!==t.charAt(n)){n--;break}returnn<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(n)&&"/"===t.charAt(n)||(n=e.substring(0,n).lastIndexOf("/")),e.substring(0,n+1))},i.withinString=function(e,t,n){n||(n={});varr=n.start||i.findUri.start,o=n.end||i.findUri.end,s=n.trim||i.findUri.trim,a=n.parens||i.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(r.lastIndex=0;;){varc=r.exec(e);if(!c)break;varl=c.index;if(n.ignoreHtml){vard=e.slice(Math.max(l-3,0),l);if(d&&u.test(d))continue}for(varf=l+e.slice(l).search(o),p=e.slice(l,f),h=-1;;){varm=a.exec(p);if(!m)break;varg=m.index+m[0].length;h=Math.max(h,g)}if(!((p=h>-1?p.slice(0,h)+p.slice(h).replace(s,""):p.replace(s,"")).length<=c[0].length||n.ignore&&n.ignore.test(p))){vary=t(p,l,f=l+p.length,e);void0!==y?(y=String(y),e=e.slice(0,l)+y+e.slice(f),r.lastIndex=l+y.length):r.lastIndex=f}}returnr.lastIndex=0,e},i.ensureValidHostname=function(t,n){varr=!!t,o=!1;if(!!n&&(o=f(i.hostProtocols,n)),o&&!r)thrownewTypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(i.invalid_hostname_characters)){if(!e)thrownewTypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))thrownewTypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){vart=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))thrownewTypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){vart={URI:this.noConflict()};returnr.URITemplate&&"function"==typeofr.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeofr.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeofr.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}returnr.URI===this&&(r.URI=o),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){returnnewi(this)},s.valueOf=s.toString=function(){returnthis.build(!1)._string},s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=b("query","?"),s.fragment=b("fragment","#"),s.search=function(e,t){varn=this.query(e,t);return"string"==typeofn&&n.length?"?"+n:n},s.hash=function(e,t){varn=this.fragment(e,t);return"string"==typeofn&&n.length?"#"+n:n},s.pathname=function(e,t){if(void0===e||!0===e){varn=this._parts.path||(this._parts.hostname?"/":"");returne?(this._parts.urn?i.decodeUrnPath:i.decodePath)(n):n}returnthis._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){varn;if(void0===e)returnthis.toString();this._string="",this._parts=i._parts();varr=einstanceofi,o="object"==typeofe&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1),!r&&o&&void0!==e.pathname&&(e=e.toString()),"string"==typeofe||einstanceofString)this._parts=i.parse(String(e),this._parts);else{if(!r&&!o)thrownewTypeError("invalid input");vars=r?e._parts:e;for(nins)"query"!==n&&a.call(this._parts,n)&&(this._parts[n]=s[n]);s.query&&this.query(s.query,!1)}returnthis.build(!t),this},s.is=function(e){vart=!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":returnl;case"absolute":return!l;case"domain":case"name":returns;case"sld":returna;case"ip":returnt;case"ip4":case"ipv4":case"inet4":returnr;case"ip6":case"ipv6":case"inet6":returno;case"idn":returnu;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":returnc}returnnull};varx=s.protocol,S=s.port,A=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))thrownewTypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");returnx.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){returnthis._parts.urn?void0===e?"":this:(void0!==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)returnvoid0===e?"":this;if(void0!==e){varn={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,n))thrownewTypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}returnA.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e){varn=this.protocol();returnthis.authority()?(n?n+"://":"")+this.authority():""}varr=i(e);returnthis.protocol(r.protocol()).authority(r.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e)returnthis._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))thrownewTypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');returnthis.build(!t),this},s.authority=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e)returnthis._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))thrownewTypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');returnthis.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e){varn=i.buildUserinfo(this._parts);returnn?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){varn;returnvoid0===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)returnvoid0===e?"":this;if(void0===e){if(!this._parts.hostname||this.is("IP"))return"";varn=this._parts.hostname.length-this.domain().length-1;returnthis._parts.hostname.substring(0,n)||""}varr=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,r),s=newRegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))thrownewTypeError("Domains cannot contain colons");returne&&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)returnvoid0===e?"":this;if("boolean"==typeofe&&(t=e,e=void0),void0===e){if(!this._parts.hostname||this.is("IP"))return"";varn=this._parts.hostname.match(/\./g);if(n&&n.length<2)returnthis._parts.hostname;varr=this._parts.hostname.length-this.tld(t).length-1;returnr=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)thrownewTypeError("cannot set domain empty");if(-1!==e.indexOf(":"))thrownewTypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{varo=newRegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}returnthis.build(!t),this},s.tld=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if("boolean"==typeofe&&(t=e,e=void0),void0===e){if(!this._parts.hostname||this.is("IP"))return"";varr=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}vari;if(!e)thrownewTypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))thrownewTypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=newRegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))thrownewReferenceError("cannot set TLD on non-domain host");i=newRegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}returnthis.build(!t),this},s.directory=function(e,t){if(this._parts.urn)returnvoid0===e?"":this;if(void0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";varn=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");returne?i.decodePath(r):r}varo=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,o),a=newRegExp("^"+u(s));returnthis.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)returnvoid0===e?"":this;if("string"!=typeofe){if(!this._parts.path||"/"===this._parts.path)return"";varn=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(n+1);returne?i.decodePathSegment(r):r}varo=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);vars=newRegExp(u(this.filename())+"$");returne=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)returnvoid0===e?"":this;if(void0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";varn,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));vara,c=this.suffix();if(c)a=e?newRegExp(u(c)+"$"):newRegExp(u("."+c)+"$");else{if(!e)returnthis;this._parts.path+="."+i.recodePath(e)}returna&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},s.segment=function(e,t,n){varr=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),s=o.split(r);if(void0!==e&&"number"!=typeofe&&(n=t,t=e,e=void0),void0!==e&&"number"!=typeofe)thrownewError('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void0===t)returnvoid0===e?s:s[e];if(null===e||void0===s[e])if(l(t)){s=[];for(vara=0,u=t.length;a<u;a++)(t[a].length||s.length&&s[s.length-1].length)&&(s.length&&!s[s.length-1].length&&s.pop(),s.push(h(t[a])))}else(t||"string"==typeoft)&&(t=h(t),""===s[s.length-1]?s[s.length-1]=t:s.push(t));elset?s[e]=h(t):s.splice(e,1);returni&&s.unshift(""),this.path(s.join(r),n)},s.segmentCoded=function(e,t,n){varr,o,s;if("number"!=typeofe&&(n=t,t=e,e=void0),void0===t){if(l(r=this.segment(e,t,n)))for(o=0,s=r.length;o<s;o++)r[o]=i.decode(r[o]);elser=void0!==r?i.decode(r):void0;returnr}if(l(t))for(o=0,s=t.length;o<s;o++)t[o]=i.encode(t[o]);elset="string"==typeoft||tinstanceofString?i.encode(t):t;returnthis.segment(e,t,n)};varE=s.query;returns.query=function(e,t){if(!0===e)returni.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeofe){varn=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=e.call(this,n);returnthis._parts.query=i.buildQuery(r||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}returnvoid0!==e&&"string"!=typeofe?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):E.call(this,e,t)},s.setQuery=function(e,t,n){varr=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeofe||einstanceofString)r[e]=void0!==t?t:null;else{if("object"!=typeofe)thrownewTypeError("URI.addQuery() accepts an object, string as the name parameter");for(varoine)a.call(e,o)&&(r[o]=e[o])}returnthis._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeofe&&(n=t),this.build(!n),this},s.addQuery=function(e,t,n){varr=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returni.addQuery(r,e,void0===t?null:t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeofe&&(n=t),this.build(!n),this},s.removeQuery=function(e,t,n){varr=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returni.removeQuery(r,e,t),this._parts.query=i.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeofe&&(n=t),this.build(!n),this},s.hasQuery=function(e,t,n){varr=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);returni.hasQuery(r,e,t,n)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){returnthis._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()},s.normalizeProtocol=function(e){return"string"==typeofthis._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},s.normalizeHostname=function(n){returnthis._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!n)),this},s.normalizePort=function(e){return"string"==typeofthis._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},s.normalizePath=function(e){vart,n=this._parts.path;if(!n)returnthis;if(this._parts.urn)returnthis._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)returnthis;varr,o,s="";for("/"!==(n=i.recodePath(n)).charAt(0)&&(t=!0,n="/"+n),"/.."!==n.slice(-3)&&"/."!==n.slice(-2)||(n+="/"),n=n.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(s=n.substring(1).match(/^(\.\.\/)+/)||"")&&(s=s[0]);-1!==(r=n.search(/\/\.\.(\/|$)/));)0!==r?(-1===(o=n.substring(0,r).lastIndexOf("/"))&&(o=r),n=n.substring(0,o)+n.substring(r+3)):n=n.substring(3);returnt&&this.is("relative")&&(n=s+n.substring(1)),this._parts.path=n,this.build(!e),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(e){return"string"==typeofthis._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},s.normalizeFragment=function(e){returnthis._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){vare=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}returnthis},s.unicode=function(){vare=i.encode,t=i.decode;i.encode=g,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}returnthis},s.readable=function(){vart=this.clone();t.username("").password("").normalize();varn="";if(t._parts.protocol&&(n+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(n+=e.toUnicode(t._parts.hostname),t._parts.port&&(n+=":"+t._parts.port)):n+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(n+="/"),n+=t.path(!0),t._parts.query){for(varr="",o=0,s=t._parts.query.split("&"),a=s.length;o<a;o++){varu=(s[o]||"").split("=");r+="&"+i.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void0!==u[1]&&(r+="="+i.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}n+="?"+r.substring(1)}returnn+=i.decodeQuery(t.hash(),!0)},s.absoluteTo=function(e){vart,n,r,o=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)thrownewError("URNs do not have any generally defined hierarchical components");if(einstanceofi||(e=newi(e)),o._parts.protocol)returno;if(o._parts.protocol=e._parts.protocol,this._parts.hostname)returno;for(n=0;r=s[n];n++)o._parts[r]=e._parts[r];returno._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},s.relativeTo=function(e){vart,n,r,o,s,a=this.clone().normalize();if(a._parts.urn)thrownewError("URNs do not have any generally defined hierarchical components");if(e=newi(e).normalize(),t=a._parts,n=e._parts,o=a.path(),s=e.path(),"/"!==o.charAt(0))thrownewError("URI is already relative");if("/"!==s.charAt(0))thrownewError("Cannot calculate a URI relative to another relative URI");if(t.protocol===n.protocol&&(t.protocol=null),t.username!==n.username||t.password!==n.password)returna.build();if(null!==t.protocol||null!==t.username||null!==t.password)returna.build();if(t.hostname!==n.hostname||t.port!==n.port)returna.build();if(t.hostname=null,t.port=null,o===s)returnt.path="",a.build();if(!(r=i.commonPath(o,s)))returna.build();varu=n.path.substring(r.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");returnt.path=u+t.path.substring(r.length)||"./",a.build()},s.equals=function(e){vart,n,r,o,s,u=this.clone(),c=newi(e),d={};if(u.normalize(),c.normalize(),u.toString()===c.toString())return!0;if(r=u.query(),o=c.query(),u.query(""),c.query(""),u.toString()!==c.toString())return!1;if(r.length!==o.length)return!1;for(sint=i.parseQuery(r,this._parts.escapeQuerySpace),n=i.parseQuery(o,this._parts.escapeQuerySpace),t)if(a.call(t,s)){if(l(t[s])){if(!p(t[s],n[s]))return!1}elseif(t[s]!==n[s])return!1;d[s]=!0}for(sinn)if(a.call(n,s)&&!d[s])return!1;return!0},s.preventInvalidHostname=function(e){returnthis._parts.preventInvalidHostname=!!e,this},s.duplicateQueryParameters=function(e){returnthis._parts.duplicateQueryParameters=!!e,this},s.escapeQuerySpace=function(e){returnthis._parts.escapeQuerySpace=!!e,this},i},e.exports?e.exports=n(St,At,Et):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)}));functionIt(e,t){if(null===e||"object"!=typeofe)returne;t=r.defaultValue(t,!1);constn=newe.constructor;for(constrine)if(e.hasOwnProperty(r)){leto=e[r];t&&(o=It(o,t)),n[r]=o}returnn}functionRt(e,t){letn;return"undefined"!=typeofdocument&&(n=document),Rt._implementation(e,t,n)}Rt._implementation=function(e,t,n){if(!r.defined(t)){if(void0===n)returne;t=r.defaultValue(n.baseURI,n.location.href)}consto=newOt(e);return""!==o.scheme()?o.toString():o.absoluteTo(t).toString()};constPt={};functionTt(e,t,n){r.defined(t)||(t=e.width),r.defined(n)||(n=e.height);leto=Pt[t];r.defined(o)||(o={},Pt[t]=o);leti=o[n];if(!r.defined(i)){conste=document.createElement("canvas");e.width=t,e.height=n,i=e.getContext("2d"),i.globalCompositeOperation="copy",o[n]=i}returni.drawImage(e,0,0,t,n),i.getImageData(0,0,t,n).data}constqt=/^blob:/i;functionzt(e){returnqt.test(e)}letMt;constDt=/^data:/i;functionUt(e){returnDt.test(e)}varkt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5});varFt=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});functionNt(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);constt=r.defaultValue(e.throttleByServer,!1),n=r.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=r.defaultValue(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=r.defaultValue(e.type,Ft.OTHER),this.serverKey=void0,this.state=kt.UNISSUED,this.deferred=void0,this.cancelled=!1}functionjt(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,"string"==typeofthis.responseHeaders&&(this.responseHeaders=function(e){constt={};if(!e)returnt;constn=e.split("\r\n");for(lete=0;e<n.length;++e){constr=n[e],o=r.indexOf(": ");if(o>0){conste=r.substring(0,o),n=r.substring(o+2);t[e]=n}}returnt}(this.responseHeaders))}functionBt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}functionVt(e,t){returnt-e}functionLt(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void0}functionQt(e,t,n){constr=e[t];e[t]=e[n],e[n]=r}Nt.prototype.cancel=function(){this.cancelled=!0},Nt.prototype.clone=function(e){returnr.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=void0,e.cancelled=!1,e):newNt(this)},jt.prototype.toString=function(){lete="Request has failed.";returnr.defined(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e},Object.defineProperties(Bt.prototype,{numberOfListeners:{get:function(){returnthis._listeners.length-this._toRemove.length}}}),Bt.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);constn=this;returnfunction(){n.removeEventListener(e,t)}},Bt.prototype.removeEventListener=function(e,t){constn=this._listeners,r=this._scopes;leto=-1;for(leti=0;i<n.length;i++)if(n[i]===e&&r[i]===t){o=i;break}return-1!==o&&(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void0,r[o]=void0):(n.splice(o,1),r.splice(o,1)),!0)},Bt.prototype.raiseEvent=function(){lete;this._insideRaiseEvent=!0;constt=this._listeners,n=this._scopes;leto=t.length;for(e=0;e<o;e++){consto=t[e];r.defined(o)&&t[e].apply(n[e],arguments)}consti=this._toRemove;if(o=i.length,o>0){for(i.sort(Vt),e=0;e<o;e++){constr=i[e];t.splice(r,1),n.splice(r,1)}i.length=0}this._insideRaiseEvent=!1},Object.defineProperties(Lt.prototype,{length:{get:function(){returnthis._length}},internalArray:{get:function(){returnthis._array}},maximumLength:{get:function(){returnthis._maximumLength},set:function(e){constt=this._length;if(e<t){constn=this._array;for(letr=e;r<t;++r)n[r]=void0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){returnthis._comparator}}}),Lt.prototype.reserve=function(e){e=r.defaultValue(e,this._length),this._array.length=e},Lt.prototype.heapify=function(e){e=r.defaultValue(e,0);constt=this._length,n=this._comparator,o=this._array;leti=-1,s=!0;for(;s;){constr=2*(e+1),a=r-1;i=a<t&&n(o[a],o[e])<0?a:e,r<t&&n(o[r],o[i])<0&&(i=r),i!==e?(Qt(o,i,e),e=i):s=!1}},Lt.prototype.resort=function(){conste=this._length;for(lett=Math.ceil(e/2);t>=0;--t)this.heapify(t)},Lt.prototype.insert=function(e){constt=this._array,n=this._comparator,o=this._maximumLength;leti,s=this._length++;for(s<t.length?t[s]=e:t.push(e);0!==s;){conste=Math.floor((s-1)/2);if(!(n(t[s],t[e])<0))break;Qt(t,s,e),s=e}returnr.defined(o)&&this._length>o&&(i=t[o],this._length=o),i},Lt.prototype.pop=function(e){if(e=r.defaultValue(e,0),0===this._length)return;constt=this._array,n=t[e];returnQt(t,e,--this._length),this.heapify(e),t[this._length]=void0,n};const$t={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};letWt=20;constHt=newLt({comparator:function(e,t){returne.priority-t.priority}});Ht.maximumLength=Wt,Ht.reserve(Wt);constYt=[];letZt={};constGt="undefined"!=typeofdocument?newOt(document.location.href):newOt,Jt=newBt;functionXt(){}functionKt(e){r.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}functionen(e){returne.state===kt.UNISSUED&&(e.state=kt.ISSUED,e.deferred=r.when.defer()),e.deferred.promise}functiontn(e){constt=en(e);returne.state=kt.ACTIVE,Yt.push(e),++$t.numberOfActiveRequests,++$t.numberOfActiveRequestsEver,++Zt[e.serverKey],e.requestFunction().then(function(e){returnfunction(t){if(e.state===kt.CANCELLED)return;constn=e.deferred;--$t.numberOfActiveRequests,--Zt[e.serverKey],Jt.raiseEvent(),e.state=kt.RECEIVED,e.deferred=void0,n.resolve(t)}}(e)).otherwise(function(e){returnfunction(t){e.state!==kt.CANCELLED&&(++$t.numberOfFailedRequests,--$t.numberOfActiveRequests,--Zt[e.serverKey],Jt.raiseEvent(t),e.state=kt.FAILED,e.deferred.reject(t))}}(e)),t}functionnn(e){constt=e.state===kt.ACTIVE;if(e.state=kt.CANCELLED,++$t.numberOfCancelledRequests,r.defined(e.deferred)){constt=e.deferred;e.deferred=void0,t.reject()}t&&(--$t.numberOfActiveRequests,--Zt[e.serverKey],++$t.numberOfCancelledActiveRequests),r.defined(e.cancelFunction)&&e.cancelFunction()}Xt.maximumRequests=50,Xt.maximumRequestsPerServer=6,Xt.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},Xt.throttleRequests=!0,Xt.debugShowStatistics=!1,Xt.requestCompletedEvent=Jt,Object.defineProperties(Xt,{statistics:{get:function(){return$t}},priorityHeapLength:{get:function(){returnWt},set:function(e){if(e<Wt)for(;Ht.length>e;){nn(Ht.pop())}Wt=e,Ht.maximumLength=e,Ht.reserve(e)}}}),Xt.serverHasOpenSlots=function(e,t){t=r.defaultValue(t,1);constn=r.defaultValue(Xt.requestsByServer[e],Xt.maximumRequestsPerServer);returnZt[e]+t<=n},Xt.heapHasOpenSlots=function(e){returnHt.length+e<=Wt},Xt.update=function(){lete,t,n=0;constr=Yt.length;for(e=0;e<r;++e)t=Yt[e],t.cancelled&&nn(t),t.state===kt.ACTIVE?n>0&&(Yt[e-n]=t):++n;Yt.length-=n;consto=Ht.internalArray,i=Ht.length;for(e=0;e<i;++e)Kt(o[e]);Ht.resort();consts=Math.max(Xt.maximumRequests-Yt.length,0);leta=0;for(;a<s&&Ht.length>0;)t=Ht.pop(),t.cancelled?nn(t):!t.throttleByServer||Xt.serverHasOpenSlots(t.serverKey)?(tn(t),++a):nn(t);!function(){if(!Xt.debugShowStatistics)return;0===$t.numberOfActiveRequests&&$t.lastNumberOfActiveRequests>0&&($t.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${$t.numberOfAttemptedRequests}`),$t.numberOfAttemptedRequests=0),$t.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${$t.numberOfCancelledRequests}`),$t.numberOfCancelledRequests=0),$t.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${$t.numberOfCancelledActiveRequests}`),$t.numberOfCancelledActiveRequests=0),$t.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${$t.numberOfFailedRequests}`),$t.numberOfFailedRequests=0));$t.lastNumberOfActiveRequests=$t.numberOfActiveRequests}()},Xt.getServerKey=function(e){lett=newOt(e);""===t.scheme()&&(t=newOt(e).absoluteTo(Gt),t.normalize());letn=t.authority();/:/.test(n)||(n=`${n}:${"https"===t.scheme()?"443":"80"}`);consto=Zt[n];returnr.defined(o)||(Zt[n]=0),n},Xt.request=function(e){if(Ut(e.url)||zt(e.url))returnJt.raiseEvent(),e.state=kt.RECEIVED,e.requestFunction();if(++$t.numberOfAttemptedRequests,r.defined(e.serverKey)||(e.serverKey=Xt.getServerKey(e.url)),Xt.throttleRequests&&e.throttleByServer&&!Xt.serverHasOpenSlots(e.serverKey))return;if(!Xt.throttleRequests||!e.throttle)returntn(e);if(Yt.length>=Xt.maximumRequests)return;Kt(e);constt=Ht.insert(e);if(r.defined(t)){if(t===e)return;nn(t)}returnen(e)},Xt.clearForSpecs=function(){for(;Ht.length>0;){nn(Ht.pop())}conste=Yt.length;for(lett=0;t<e;++t)nn(Yt[t]);Yt.length=0,Zt={},$t.numberOfAttemptedRequests=0,$t.numberOfActiveRequests=0,$t.numberOfCancelledRequests=0,$t.numberOfCancelledActiveRequests=0,$t.numberOfFailedRequests=0,$t.numberOfActiveRequestsEver=0,$t.lastNumberOfActiveRequests=0},Xt.numberOfActiveRequestsByServer=function(e){returnZt[e]},Xt.requestHeap=Ht;constrn={};leton={};rn.add=function(e,t){constn=`${e.toLowerCase()}:${t}`;r.defined(on[n])||(on[n]=!0)},rn.remove=function(e,t){constn=`${e.toLowerCase()}:${t}`;r.defined(on[n])&&deleteon[n]},rn.contains=function(e){constt=function(e){constt=newOt(e);t.normalize();letn=t.authority();if(0!==n.length){if(t.authority(n),-1!==n.indexOf("@")){conste=n.split("@");n=e[1]}if(-1===n.indexOf(":")){lete=t.scheme();if(0===e.length&&(e=window.location.protocol,e=e.substring(0,e.length-1)),"http"===e)n+=":80";else{if("https"!==e)return;n+=":443"}}returnn}}(e);return!(!r.defined(t)||!r.defined(on[t]))},rn.clear=function(){on={}};constsn=function(){try{conste=newXMLHttpRequest;returne.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();functionan(e,t,n,o){consti=e.query();if(0===i.length)return{};lets;if(-1===i.indexOf("=")){conste={};e[i]=void0,s=e}elses=function(e){constt={};if(""===e)returnt;constn=e.replace(/\+/g,"%20").split(/[&;]/);for(lete=0,o=n.length;e<o;++e){consto=n[e].split("="),i=decodeURIComponent(o[0]);lets=o[1];s=r.defined(s)?decodeURIComponent(s):"";consta=t[i];"string"==typeofa?t[i]=[a,s]:Array.isArray(a)?a.push(s):t[i]=s}returnt}(i);t._queryParameters=n?dn(s,t._queryParameters,o):s,e.search("")}functionun(e,t){constn=t._queryParameters,o=Object.keys(n);1!==o.length||r.defined(n[o[0]])?e.search(function(e){lett="";for(constnine)if(e.hasOwnProperty(n)){constr=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(r))for(lete=0,n=r.length;e<n;++e)t+=`${o+encodeURIComponent(r[e])}&`;elset+=`${o+encodeURIComponent(r)}&`}returnt=t.slice(0,-1),t}(n)):e.search(o[0])}functioncn(e,t){returnr.defined(e)?r.defined(e.clone)?e.clone():It(e):t}functionln(e){if(e.state===kt.ISSUED||e.state===kt.ACTIVE)thrownewn.RuntimeError("The Resource is already being fetched.");e.state=kt.UNISSUED,e.deferred=void0}functiondn(e,t,n){if(!n)returni.combine(e,t);consto=It(e,!0);for(consteint)if(t.hasOwnProperty(e)){letn=o[e];consti=t[e];r.defined(n)?(Array.isArray(n)||(n=o[e]=[n]),o[e]=n.concat(i)):o[e]=Array.isArray(i)?i.slice():i}returno}functionfn(e){"string"==typeof(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void0,this._templateValues=cn(e.templateValues,{}),this._queryParameters=cn(e.queryParameters,{}),this.headers=cn(e.headers,{}),this.request=r.defaultValue(e.request,newNt),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=r.defaultValue(e.retryAttempts,0),this._retryCount=0;constt=newOt(e.url);an(t,this,!0,!0),t.fragment(""),this._url=t.toString()}letpn;functionhn(e){constt=e.resource,n=e.flipY,o=e.skipColorSpaceConversion,i=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){lete=!1;t.isDataUri||t.isBlobUri||(e=t.isCrossOriginUrl);consta=r.when.defer();returnfn._Implementations.createImage(s,e,a,n,o,i),a.promise};consta=Xt.request(s);if(r.defined(a))returna.otherwise((function(e){returns.state!==kt.FAILED?r.when.reject(e):t.retryOnError(e).then((function(a){returna?(s.state=kt.UNISSUED,s.deferred=void0,hn({resource:t,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i})):r.when.reject(e)}))}))}functionmn(e,t,n){consto={};o[t]=n,e.setQueryParameters(o);consti=e.request;i.url=e.url,i.requestFunction=function(){constt=r.when.defer();returnwindow[n]=function(e){t.resolve(e);try{deletewindow[n]}catch(e){window[n]=void0}},fn._Implementations.loadAndExecuteScript(e.url,n,t),t.promise};consts=Xt.request(i);if(r.defined(s))returns.otherwise((function(o){returni.state!==kt.FAILED?r.when.reject(o):e.retryOnError(o).then((function(s){returns?(i.state=kt.UNISSUED,i.deferred=void0,mn(e,t,n)):r.when.reject(o)}))}))}fn.createIfNeeded=function(e){returneinstanceoffn?e.getDerivedResource({request:e.request}):"string"!=typeofe?e:newfn({url:e})},fn.supportsImageBitmapOptions=function(){if(r.defined(pn))returnpn;if("function"!=typeofcreateImageBitmap)returnpn=r.when.resolve(!1),pn;returnpn=fn.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then((function(e){returnr.when.all([createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"}),createImageBitmap(e)])})).then((function(e){constt=Tt(e[0]),n=Tt(e[1]);returnt[1]!==n[1]})).otherwise((function(){return!1})),pn},Object.defineProperties(fn,{isBlobSupported:{get:function(){returnsn}}}),Object.defineProperties(fn.prototype,{queryParameters:{get:function(){returnthis._queryParameters}},templateValues:{get:function(){returnthis._templateValues}},url:{get:function(){returnthis.getUrlComponent(!0,!0)},set:function(e){constt=newOt(e);an(t,this,!1),t.fragment(""),this._url=t.toString()}},extension:{get:function(){returnfunction(e){constt=newOt(e);t.normalize();letn=t.path(),r=n.lastIndexOf("/");return-1!==r&&(n=n.substr(r+1)),r=n.lastIndexOf("."),n=-1===r?"":n.substr(r+1),n}(this._url)}},isDataUri:{get:function(){returnUt(this._url)}},isBlobUri:{get:function(){returnzt(this._url)}},isCrossOriginUrl:{get:function(){returnfunction(e){r.defined(Mt)||(Mt=document.createElement("a")),Mt.href=window.location.href;constt=Mt.host,n=Mt.protocol;returnMt.href=e,Mt.href=Mt.href,n!==Mt.protocol||t!==Mt.host}(this._url)}},hasHeaders:{get:function(){returnObject.keys(this.headers).length>0}}}),fn.prototype.toString=function(){returnthis.getUrlComponent(!0,!0)},fn.prototype.getUrlComponent=function(e,t){if(this.isDataUri)returnthis._url;constn=newOt(this._url);e&&un(n,this);leto=n.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");consti=this._templateValues;returno=o.replace(/{(.*?)}/g,(function(e,t){constn=i[t];returnr.defined(n)?encodeURIComponent(n):e})),t&&r.defined(this.proxy)&&(o=this.proxy.getURL(o)),o},fn.prototype.setQueryParameters=function(e,t){this._queryParameters=t?dn(this._queryParameters,e,!1):dn(e,this._queryParameters,!1)},fn.prototype.appendQueryParameters=function(e){this._queryParameters=dn(e,this._queryParameters,!0)},fn.prototype.setTemplateValues=function(e,t){this._templateValues=t?i.combine(this._templateValues,e):i.combine(e,this._templateValues)},fn.prototype.getDerivedResource=function(e){constt=this.clone();if(t._retryCount=0,r.defined(e.url)){constn=newOt(e.url);an(n,t,!0,r.defaultValue(e.preserveQueryParameters,!1)),n.fragment(""),""!==n.scheme()?t._url=n.toString():t._url=n.absoluteTo(newOt(Rt(this._url))).toString()}returnr.defined(e.queryParameters)&&(t._queryParameters=i.combine(e.queryParameters,t._queryParameters)),r.defined(e.templateValues)&&(t._templateValues=i.combine(e.templateValues,t.templateValues)),r.defined(e.headers)&&(t.headers=i.combine(e.headers,t.headers)),r.defined(e.proxy)&&(t.proxy=e.proxy),r.defined(e.request)&&(t.request=e.request),r.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),r.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},fn.prototype.retryOnError=function(e){constt=this.retryCallback;if("function"!=typeoft||this._retryCount>=this.retryAttempts)returnr.when(!1);constn=this;returnr.when(t(this,e)).then((function(e){return++n._retryCount,e}))},fn.prototype.clone=function(e){returnr.defined(e)||(e=newfn({url:this._url})),e._url=this._url,e._queryParameters=It(this._queryParameters),e._templateValues=It(this._templateValues),e.headers=It(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},fn.prototype.getBaseUri=function(e){returnfunction(e,t){letn="";constr=e.lastIndexOf("/");return-1!==r&&(n=e.substring(0,r+1)),t?(0!==(e=newOt(e)).query().length&&(n+=`?${e.query()}`),0!==e.fragment().length&&(n+=`#${e.fragment()}`),n):n}(this.getUrlComponent(e),e)},fn.prototype.appendForwardSlash=function(){vare;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e=`${e}/`),e)},fn.prototype.fetchArrayBuffer=function(){returnthis.fetch({responseType:"arraybuffer"})},fn.fetchArrayBuffer=function(e){returnnewfn(e).fetchArrayBuffer()},fn.prototype.fetchBlob=function(){returnthis.fetch({responseType:"blob"})},fn.fetchBlob=function(e){returnnewfn(e).fetchBlob()},fn.prototype.fetchImage=function(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT);constt=r.defaultValue(e.preferImageBitmap,!1),n=r.defaultValue(e.preferBlob,!1),o=r.defaultValue(e.flipY,!1),i=r.defaultValue(e.skipColorSpaceConversion,!1);if(ln(this.request),!sn||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)returnhn({resource:this,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:t});consts=this.fetchBlob();if(!r.defined(s))return;leta,u,c,l;returnfn.supportsImageBitmapOptions().then((function(e){returna=e,u=a&&t,s})).then((function(e){if(!r.defined(e))return;if(l=e,u)returnfn.createImageBitmapFromBlob(e,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:i});constt=window.URL.createObjectURL(e);returnc=newfn({url:t}),hn({resource:c,flipY:o,skipColorSpaceConversion:i,preferImageBitmap:!1})})).then((function(e){if(r.defined(e))returne.blob=l,u||window.URL.revokeObjectURL(c.url),e})).otherwise((function(e){returnr.defined(c)&&window.URL.revokeObjectURL(c.url),e.blob=l,r.when.reject(e)}))},fn.fetchImage=function(e){returnnewfn(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},fn.prototype.fetchText=function(){returnthis.fetch({responseType:"text"})},fn.fetchText=function(e){returnnewfn(e).fetchText()},fn.prototype.fetchJson=function(){conste=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(r.defined(e))returne.then((function(e){if(r.defined(e))returnJSON.parse(e)}))},fn.fetchJson=function(e){returnnewfn(e).fetchJson()},fn.prototype.fetchXML=function(){returnthis.fetch({responseType:"document",overrideMimeType:"text/xml"})},fn.fetchXML=function(e){returnnewfn(e).fetchXML()},fn.prototype.fetchJsonp=function(e){lett;e=r.defaultValue(e,"callback"),ln(this.request);do{t=`loadJsonp${o.CesiumMath.nextRandomNumber().toString().substring(2,8)}`}while(r.defined(window[t]));returnmn(this,e,t)},fn.fetchJsonp=function(e){returnnewfn(e).fetchJsonp(e.callbackParameterName)},fn.prototype._makeRequest=function(e){constt=this;ln(t.request);constn=t.request;n.url=t.url,n.requestFunction=function(){consto=e.responseType,s=i.combine(e.headers,t.headers),a=e.overrideMimeType,u=e.method,c=e.data,l=r.when.defer(),d=fn._Implementations.loadWithXhr(t.url,o,u,c,s,l,a);returnr.defined(d)&&r.defined(d.abort)&&(n.cancelFunction=function(){d.abort()}),l.promise};consto=Xt.request(n);if(r.defined(o))returno.then((function(e){returnn.cancelFunction=void0,e})).otherwise((function(o){returnn.cancelFunction=void0,n.state!==kt.FAILED?r.when.reject(o):t.retryOnError(o).then((function(i){returni?(n.state=kt.UNISSUED,n.deferred=void0,t.fetch(e)):r.when.reject(o)}))}))};constgn=/^data:(.*?)(;base64)?,(.*)$/;functionyn(e,t){constn=decodeURIComponent(t);returne?atob(n):n}functionvn(e,t){constn=yn(e,t),r=newArrayBuffer(n.length),o=newUint8Array(r);for(lete=0;e<n.length;e++)o[e]=n.charCodeAt(e);returnr}functionwn(e,t){switch(t){case"text":returne.toString("utf8");case"json":returnJSON.parse(e.toString("utf8"));default:returnnewUint8Array(e).buffer}}fn.prototype.fetch=function(e){return(e=cn(e,{})).method="GET",this._makeRequest(e)},fn.fetch=function(e){returnnewfn(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},fn.prototype.delete=function(e){return(e=cn(e,{})).method="DELETE",this._makeRequest(e)},fn.delete=function(e){returnnewfn(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},fn.prototype.head=function(e){return(e=cn(e,{})).method="HEAD",this._makeRequest(e)},fn.head=function(e){returnnewfn(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},fn.prototype.options=function(e){return(e=cn(e,{})).method="OPTIONS",this._makeRequest(e)},fn.options=function(e){returnnewfn(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},fn.prototype.post=function(e,t){returnn.Check.defined("data",e),(t=cn(t,{})).method="POST",t.data=e,this._makeRequest(t)},fn.post=function(e){returnnewfn(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},fn.prototype.put=function(e,t){returnn.Check.defined("data",e),(t=cn(t,{})).method="PUT",t.data=e,this._makeRequest(t)},fn.put=function(e){returnnewfn(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},fn.prototype.patch=function(e,t){returnn.Check.defined("data",e),(t=cn(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},fn.patch=function(e){returnnewfn(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},fn._Implementations={},fn._Implementations.createImage=function(e,t,o,i,s,a){constu=e.url;fn.supportsImageBitmapOptions().then((function(c){if(!c||!a)returnvoidfunction(e,t,n){constr=newImage;r.onload=function(){n.resolve(r)},r.onerror=function(e){n.reject(e)},t&&(rn.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e}(u,t,o);constl=r.when.defer(),d=fn._Implementations.loadWithXhr(u,"blob","GET",void0,void0,l,void0,void0,void0);returnr.defined(d)&&r.defined(d.abort)&&(e.cancelFunction=function(){d.abort()}),l.promise.then((function(e){if(r.defined(e))returnfn.createImageBitmapFromBlob(e,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:s});o.reject(newn.RuntimeError(`Successfully retrieved ${u} but it contained no content.`))})).then(o.resolve)})).otherwise(o.reject)},fn.createImageBitmapFromBlob=function(e,t){returnn.Check.defined("options",t),n.Check.typeOf.bool("options.flipY",t.flipY),n.Check.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),n.Check.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};constCn="undefined"==typeofXMLHttpRequest;function_n(e){if(e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._dates=void0,this._samples=void0,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._downloadPromise=void0,this._dataError=void0,this._addNewLeapSeconds=r.defaultValue(e.addNewLeapSeconds,!0),r.defined(e.data))xn(this,e.data);elseif(r.defined(e.url)){constt=fn.createIfNeeded(e.url),n=this;this._downloadPromise=t.fetchJson().then((function(e){xn(n,e)})).otherwise((function(){n._dataError=`An error occurred while retrieving the EOP data from the URL ${t.url}.`}))}elsexn(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}functionbn(e,t){returnbt.compare(e.julianDate,t)}functionxn(e,t){if(!r.defined(t.columnNames))returnvoid(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r.defined(t.samples))returnvoid(e._dataError="Error in loaded EOP data: The samples property is required.");constn=t.columnNames.indexOf("modifiedJulianDateUtc"),o=t.columnNames.indexOf("xPoleWanderRadians"),i=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||i<0||s<0||a<0||u<0||c<0)returnvoid(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");constl=e._samples=t.samples,d=e._dates=[];letf;e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=i,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=u,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void0;constp=e._addNewLeapSeconds;for(lett=0,o=l.length;t<o;t+=e._columnCount){conste=l[t+n],o=l[t+c],i=newbt(e+rt.MODIFIED_JULIAN_DATE_DIFFERENCE,o,ot.TAI);if(d.push(i),p){if(o!==f&&r.defined(f)){conste=bt.leapSeconds,t=Xe(e,i,bn);if(t<0){constn=newnt(i,o);e.splice(~t,0,n)}}f=o}}}functionSn(e,t,n,r,o){consti=n*r;o.xPoleWander=t[i+e._xPoleWanderRadiansColumn],o.yPoleWander=t[i+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}functionAn(e,t,n){returnt+e*(n-t)}functionEn(e,t,n,r,o,i,s){consta=e._columnCount;if(i>t.length-1)returns.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;constu=t[o],c=t[i];if(u.equals(c)||r.equals(u))returnSn(e,n,o,a,s),s;if(r.equals(c))returnSn(e,n,i,a,s),s;constl=bt.secondsDifference(r,u)/bt.secondsDifference(c,u),d=o*a,f=i*a;letp=n[d+e._ut1MinusUtcSecondsColumn],h=n[f+e._ut1MinusUtcSecondsColumn];constm=h-p;if(m>.5||m<-.5){constt=n[d+e._taiMinusUtcSecondsColumn],o=n[f+e._taiMinusUtcSecondsColumn];t!==o&&(c.equals(r)?p=h:h-=o-t)}returns.xPoleWander=An(l,n[d+e._xPoleWanderRadiansColumn],n[f+e._xPoleWanderRadiansColumn]),s.yPoleWander=An(l,n[d+e._yPoleWanderRadiansColumn],n[f+e._yPoleWanderRadiansColumn]),s.xPoleOffset=An(l,n[d+e._xCelestialPoleOffsetRadiansColumn],n[f+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=An(l,n[d+e._yCelestialPoleOffsetRadiansColumn],n[f+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=An(l,p,h),s}functionOn(e,t,n){this.heading=r.defaultValue(e,0),this.pitch=r.defaultValue(t,0),this.roll=r.defaultValue(n,0)}fn._Implementations.loadWithXhr=function(e,t,o,i,s,a,u){constc=gn.exec(e);if(null!==c)returnvoida.resolve(function(e,t){t=r.defaultValue(t,"");constn=e[1],o=!!e[2],i=e[3];lets,a;switch(t){case"":case"text":returnyn(o,i);case"arraybuffer":returnvn(o,i);case"blob":returns=vn(o,i),newBlob([s],{type:n});case"document":returna=newDOMParser,a.parseFromString(yn(o,i),n);case"json":returnJSON.parse(yn(o,i))}}(c,t));if(Cn)returnvoidfunction(e,t,r,o,i,s,a){constu=require("url").parse(e),c="https:"===u.protocol?require("https"):require("http"),l=require("zlib"),d={protocol:u.protocol,hostname:u.hostname,port:u.port,path:u.path,query:u.query,method:r,headers:i};c.request(d).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)returnvoids.reject(newjt(e.statusCode,e,e.headers));constr=[];e.on("data",(function(e){r.push(e)})),e.on("end",(function(){consto=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?l.gunzip(o,(function(e,r){e?s.reject(newn.RuntimeError("Error decompressing response.")):s.resolve(wn(r,t))})):s.resolve(wn(o,t))}))})).on("error",(function(e){s.reject(newjt)})).end()}(e,t,o,0,s,a);constl=newXMLHttpRequest;if(rn.contains(e)&&(l.withCredentials=!0),l.open(o,e,!0),r.defined(u)&&r.defined(l.overrideMimeType)&&l.overrideMimeType(u),r.defined(s))for(consteins)s.hasOwnProperty(e)&&l.setRequestHeader(e,s[e]);r.defined(t)&&(l.responseType=t);letd=!1;return"string"==typeofe&&(d=0===e.indexOf("file://")||"undefined"!=typeofwindow&&"file://"===window.location.origin),l.onload=function(){if((l.status<200||l.status>=300)&&(!d||0!==l.status))returnvoida.reject(newjt(l.status,l.response,l.getAllResponseHeaders()));conste=l.response,i=l.responseType;if("HEAD"===o||"OPTIONS"===o){conste=l.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};returne.forEach((function(e){constn=e.split(": "),r=n.shift();t[r]=n.join(": ")})),voida.resolve(t)}if(204===l.status)a.resolve();elseif(!r.defined(e)||r.defined(t)&&i!==t)if("json"===t&&"string"==typeofe)try{a.resolve(JSON.parse(e))}catch(e){a.reject(e)}else(""===i||"document"===i)&&r.defined(l.responseXML)&&l.responseXML.hasChildNodes()?a.resolve(l.responseXML):""!==i&&"text"!==i||!r.defined(l.responseText)?a.reject(newn.RuntimeError("Invalid XMLHttpRequest response type.")):a.resolve(l.responseText);elsea.resolve(e)},l.onerror=function(e){a.reject(newjt)},l.send(i),l},fn._Implementations.loadAndExecuteScript=function(e,t,n){returnfunction(e){constt=r.when.defer(),n=document.createElement("script");n.async=!0,n.src=e;consto=document.getElementsByTagName("head")[0];returnn.onload=function(){n.onload=void0,o.removeChild(n),t.resolve()},n.onerror=function(e){t.reject(e)},o.appendChild(n),t.promise}(e).otherwise(n.reject)},fn._DefaultImplementations={},fn._DefaultImplementations.createImage=fn._Implementations.createImage,fn._DefaultImplementations.loadWithXhr=fn._Implementations.loadWithXhr,fn._DefaultImplementations.loadAndExecuteScript=fn._Implementations.loadAndExecuteScript,fn.DEFAULT=Object.freeze(newfn({url:"undefined"==typeofdocument?"":document.location.href.split("?")[0]})),_n.NONE=Object.freeze({getPromiseToLoad:function(){returnr.when.resolve()},compute:function(e,t){returnr.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=newKe(0,0,0,0,0),t}}),_n.prototype.getPromiseToLoad=function(){returnr.when(this._downloadPromise)},_n.prototype.compute=function(e,t){if(!r.defined(this._samples)){if(r.defined(this._dataError))thrownewn.RuntimeError(this._dataError);return}if(r.defined(t)||(t=newKe(0,0,0,0,0)),0===this._samples.length)returnt.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;consto=this._dates,i=this._lastIndex;lets=0,a=0;if(r.defined(i)){constn=o[i],u=o[i+1],c=bt.lessThanOrEquals(n,e),l=!r.defined(u),d=l||bt.greaterThanOrEquals(u,e);if(c&&d)returns=i,!l&&u.equals(e)&&++s,a=s+1,En(this,o,this._samples,e,s,a,t),t}letu=Xe(o,e,bt.compare,this._dateColumn);returnu>=0?(u<o.length-1&&o[u+1].equals(e)&&++u,s=u,a=u):(a=~u,s=a-1,s<0&&(s=0)),this._lastIndex=s,En(this,o,this._samples,e,s,a,t),t},On.fromQuaternion=function(e,t){r.defined(t)||(t=newOn);constn=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),s=2*(e.w*e.x+e.y*e.z),a=1-2*(e.y*e.y+e.z*e.z),u=2*(e.w*e.z+e.x*e.y);returnt.heading=-Math.atan2(u,a),t.roll=Math.atan2(s,i),t.pitch=-o.CesiumMath.asinClamped(n),t},On.fromDegrees=function(e,t,n,i){returnr.defined(i)||(i=newOn),i.heading=e*o.CesiumMath.RADIANS_PER_DEGREE,i.pitch=t*o.CesiumMath.RADIANS_PER_DEGREE,i.roll=n*o.CesiumMath.RADIANS_PER_DEGREE,i},On.clone=function(e,t){if(r.defined(e))returnr.defined(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):newOn(e.heading,e.pitch,e.roll)},On.equals=function(e,t){returne===t||r.defined(e)&&r.defined(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},On.equalsEpsilon=function(e,t,n,i){returne===t||r.defined(e)&&r.defined(t)&&o.CesiumMath.equalsEpsilon(e.heading,t.heading,n,i)&&o.CesiumMath.equalsEpsilon(e.pitch,t.pitch,n,i)&&o.CesiumMath.equalsEpsilon(e.roll,t.roll,n,i)},On.prototype.clone=function(e){returnOn.clone(this,e)},On.prototype.equals=function(e){returnOn.equals(this,e)},On.prototype.equalsEpsilon=function(e,t,n){returnOn.equalsEpsilon(this,e,t,n)},On.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};constIn=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;letRn,Pn,Tn;functionqn(e){return"undefined"==typeofdocument?e:(r.defined(Rn)||(Rn=document.createElement("a")),Rn.href=e,Rn.href=Rn.href,Rn.href)}functionzn(){if(r.defined(Pn))returnPn;lete;returne="undefined"!=typeofCESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeofdefine&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(require.toUrl)?Rt("..",Un("Core/buildModuleUrl.js")):function(){conste=document.getElementsByTagName("script");for(lett=0,n=e.length;t<n;++t){constn=e[t].getAttribute("src"),r=In.exec(n);if(null!==r)returnr[1]}}(),Pn=newfn({url:qn(e)}),Pn.appendForwardSlash(),Pn}functionMn(e){returnqn(require.toUrl(`../${e}`))}functionDn(e){returnzn().getDerivedResource({url:e}).url}functionUn(e){r.defined(Tn)||(Tn="object"==typeofdefine&&r.defined(define.amd)&&!define.amd.toUrlUndefined&&r.defined(require.toUrl)?Mn:Dn);returnTn(e)}functionkn(e,t,n){this.x=e,this.y=t,this.s=n}functionFn(e){e=r.defaultValue(e,r.defaultValue.EMPTY_OBJECT),this._xysFileUrlTemplate=fn.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=r.defaultValue(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r.defaultValue(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=newbt(this._sampleZeroJulianEphemerisDate,0,ot.TAI),this._stepSizeDays=r.defaultValue(e.stepSizeDays,1),this._samplesPerXysFile=r.defaultValue(e.samplesPerXysFile,1e3),this._totalSamples=r.defaultValue(e.totalSamples,27426),this._samples=newArray(3*this._totalSamples),this._chunkDownloadsInProgress=[];constt=this._interpolationOrder,n=this._denominators=newArray(t+1),o=this._xTable=newArray(t+1),i=Math.pow(this._stepSizeDays,t);for(lete=0;e<=t;++e){n[e]=i,o[e]=e*this._stepSizeDays;for(letr=0;r<=t;++r)r!==e&&(n[e]*=e-r);n[e]=1/n[e]}this._work=newArray(t+1),this._coef=newArray(t+1)}Un._cesiumScriptRegex=In,Un._buildModuleUrlFromBaseUrl=Dn,Un._clearBaseResource=function(){Pn=void0},Un.setBaseUrl=function(e){Pn=fn.DEFAULT.getDerivedResource({url:e})},Un.getCesiumBaseUrl=zn;constNn=newbt(0,0,ot.TAI);functionjn(e,t,n){constr=Nn;returnr.dayNumber=t,r.secondsOfDay=n,bt.daysDifference(r,e._sampleZeroDateTT)}functionBn(e,t){if(e._chunkDownloadsInProgress[t])returne._chunkDownloadsInProgress[t];constn=r.when.defer();leto;e._chunkDownloadsInProgress[t]=n;consti=e._xysFileUrlTemplate;returno=r.defined(i)?i.getDerivedResource({templateValues:{0:t}}):newfn({url:Un(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)}),r.when(o.fetchJson(),(function(r){e._chunkDownloadsInProgress[t]=!1;consto=e._samples,i=r.samples,s=t*e._samplesPerXysFile*3;for(lete=0,t=i.length;e<t;++e)o[s+e]=i[e];n.resolve()})),n.promise}Fn.prototype.preload=function(e,t,n,o){consti=jn(this,e,t),s=jn(this,n,o);leta=i/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);letu=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;u>=this._totalSamples&&(u=this._totalSamples-1);constc=a/this._samplesPerXysFile|0,l=u/this._samplesPerXysFile|0,d=[];for(lete=c;e<=l;++e)d.push(Bn(this,e));returnr.when.all(d)},Fn.prototype.computeXysRadians=function(e,t,n){consto=jn(this,e,t);if(o<0)return;consti=o/this._stepSizeDays|0;if(i>=this._totalSamples)return;consts=this._interpolationOrder;leta=i-(s/2|0);a<0&&(a=0);letu=a+s;u>=this._totalSamples&&(u=this._totalSamples-1,a=u-s,a<0&&(a=0));letc=!1;constl=this._samples;if(r.defined(l[3*a])||(Bn(this,a/this._samplesPerXysFile|0),c=!0),r.defined(l[3*u])||(Bn(this,u/this._samplesPerXysFile|0),c=!0),c)return;r.defined(n)?(n.x=0,n.y=0,n.s=0):n=newkn(0,0,0);constd=o-a*this._stepSizeDays,f=this._work,p=this._denominators,h=this._coef,m=this._xTable;letg,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];lete=3*(a+g);n.x+=h[g]*l[e++],n.y+=h[g]*l[e++],n.s+=h[g]*l[e]}returnn};constVn={},Ln={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"}},Qn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$n={},Wn={east:newt.Cartesian3,north:newt.Cartesian3,up:newt.Cartesian3,west:newt.Cartesian3,south:newt.Cartesian3,down:newt.Cartesian3};letHn=newt.Cartesian3,Yn=newt.Cartesian3,Zn=newt.Cartesian3;Vn.localFrameToFixedFrameGenerator=function(e,i){if(!Ln.hasOwnProperty(e)||!Ln[e].hasOwnProperty(i))thrownewn.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");consts=Ln[e][i];leta;constu=e+i;returnr.defined($n[u])?a=$n[u]:(a=function(n,a,u){if(r.defined(u)||(u=newt.Matrix4),t.Cartesian3.equalsEpsilon(n,t.Cartesian3.ZERO,o.CesiumMath.EPSILON14))t.Cartesian3.unpack(Qn[e],0,Hn),t.Cartesian3.unpack(Qn[i],0,Yn),t.Cartesian3.unpack(Qn[s],0,Zn);elseif(o.CesiumMath.equalsEpsilon(n.x,0,o.CesiumMath.EPSILON14)&&o.CesiumMath.equalsEpsilon(n.y,0,o.CesiumMath.EPSILON14)){constr=o.CesiumMath.sign(n.z);t.Cartesian3.unpack(Qn[e],0,Hn),"east"!==e&&"west"!==e&&t.Cartesian3.multiplyByScalar(Hn,r,Hn),t.Cartesian3.unpack(Qn[i],0,Yn),"east"!==i&&"west"!==i&&t.Cartesian3.multiplyByScalar(Yn,r,Yn),t.Cartesian3.unpack(Qn[s],0,Zn),"east"!==s&&"west"!==s&&t.Cartesian3.multiplyByScalar(Zn,r,Zn)}else{(a=r.defaultValue(a,t.Ellipsoid.WGS84)).geodeticSurfaceNormal(n,Wn.up);consto=Wn.up,u=Wn.east;u.x=-n.y,u.y=n.x,u.z=0,t.Cartesian3.normalize(u,Wn.east),t.Cartesian3.cross(o,u,Wn.north),t.Cartesian3.multiplyByScalar(Wn.up,-1,Wn.down),t.Cartesian3.multiplyByScalar(Wn.east,-1,Wn.west),t.Cartesian3.multiplyByScalar(Wn.north,-1,Wn.south),Hn=Wn[e],Yn=Wn[i],Zn=Wn[s]}returnu[0]=Hn.x,u[1]=Hn.y,u[2]=Hn.z,u[3]=0,u[4]=Yn.x,u[5]=Yn.y,u[6]=Yn.z,u[7]=0,u[8]=Zn.x,u[9]=Zn.y,u[10]=Zn.z,u[11]=0,u[12]=n.x,u[13]=n.y,u[14]=n.z,u[15]=1,u},$n[u]=a),a},Vn.eastNorthUpToFixedFrame=Vn.localFrameToFixedFrameGenerator("east","north"),Vn.northEastDownToFixedFrame=Vn.localFrameToFixedFrameGenerator("north","east"),Vn.northUpEastToFixedFrame=Vn.localFrameToFixedFrameGenerator("north","up"),Vn.northWestUpToFixedFrame=Vn.localFrameToFixedFrameGenerator("north","west");constGn=newAe,Jn=newt.Cartesian3(1,1,1),Xn=newt.Matrix4;Vn.headingPitchRollToFixedFrame=function(e,n,o,i,s){i=r.defaultValue(i,Vn.eastNorthUpToFixedFrame);consta=Ae.fromHeadingPitchRoll(n,Gn),u=t.Matrix4.fromTranslationQuaternionRotationScale(t.Cartesian3.ZERO,a,Jn,Xn);returns=i(e,o,s),t.Matrix4.multiply(s,u,s)};constKn=newt.Matrix4,er=newt.Matrix3;Vn.headingPitchRollQuaternion=function(e,n,r,o,i){consts=Vn.headingPitchRollToFixedFrame(e,n,r,o,Kn),a=t.Matrix4.getMatrix3(s,er);returnAe.fromRotationMatrix(a,i)};consttr=newt.Cartesian3(1,1,1),nr=newt.Cartesian3,rr=newt.Matrix4,or=newt.Matrix4,ir=newt.Matrix3,sr=newAe;Vn.fixedFrameToHeadingPitchRoll=function(e,n,o,i){n=r.defaultValue(n,t.Ellipsoid.WGS84),o=r.defaultValue(o,Vn.eastNorthUpToFixedFrame),r.defined(i)||(i=newOn);consts=t.Matrix4.getTranslation(e,nr);if(t.Cartesian3.equals(s,t.Cartesian3.ZERO))returni.heading=0,i.pitch=0,i.roll=0,i;leta=t.Matrix4.inverseTransformation(o(s,n,rr),rr),u=t.Matrix4.setScale(e,tr,or);u=t.Matrix4.setTranslation(u,t.Cartesian3.ZERO,u),a=t.Matrix4.multiply(a,u,a);letc=Ae.fromRotationMatrix(t.Matrix4.getMatrix3(a,ir),sr);returnc=Ae.normalize(c,c),On.fromQuaternion(c,i)};constar=o.CesiumMath.TWO_PI/86400;letur=newbt;Vn.computeTemeToPseudoFixedMatrix=function(e,n){ur=bt.addSeconds(e,-bt.computeTaiMinusUtc(e),ur);consti=ur.dayNumber,s=ur.secondsOfDay;leta;constu=i-2451545;a=s>=43200?(u+.5)/rt.DAYS_PER_JULIAN_CENTURY:(u-.5)/rt.DAYS_PER_JULIAN_CENTURY;constc=(24110.54841+a*(8640184.812866+a*(.093104+-62e-7*a)))*ar%o.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(i-2451545.5))*((s+.5*rt.SECONDS_PER_DAY)%rt.SECONDS_PER_DAY),l=Math.cos(c),d=Math.sin(c);returnr.defined(n)?(n[0]=l,n[1]=-d,n[2]=0,n[3]=d,n[4]=l,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):newt.Matrix3(l,d,0,-d,l,0,0,0,1)},Vn.iau2006XysData=newFn,Vn.earthOrientationParameters=_n.NONE;constcr=32.184;Vn.preloadIcrfFixed=function(e){constt=e.start.dayNumber,n=e.start.secondsOfDay+cr,o=e.stop.dayNumber,i=e.stop.secondsOfDay+cr,s=Vn.iau2006XysData.preload(t,n,o,i),a=Vn.earthOrientationParameters.getPromiseToLoad();returnr.when.all([s,a])},Vn.computeIcrfToFixedMatrix=function(e,n){r.defined(n)||(n=newt.Matrix3);consto=Vn.computeFixedToIcrfMatrix(e,n);if(r.defined(o))returnt.Matrix3.transpose(o,n)};constlr=newkn(0,0,0),dr=newKe(0,0,0,0,0,0),fr=newt.Matrix3,pr=newt.Matrix3;Vn.computeFixedToIcrfMatrix=function(e,n){r.defined(n)||(n=newt.Matrix3);consti=Vn.earthOrientationParameters.compute(e,dr);if(!r.defined(i))return;consts=e.dayNumber,a=e.secondsOfDay+cr,u=Vn.iau2006XysData.computeXysRadians(s,a,lr);if(!r.defined(u))return;constc=u.x+i.xPoleOffset,l=u.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-c*c-l*l)),f=fr;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);constp=t.Matrix3.fromRotationZ(-u.s,pr),h=t.Matrix3.multiply(f,p,fr),m=e.dayNumber-2451545,g=(e.secondsOfDay-bt.computeTaiMinusUtc(e)+i.ut1MinusUtc)/rt.SECONDS_PER_DAY;lety=.779057273264+g+.00273781191135448*(m+g);y=y%1*o.CesiumMath.TWO_PI;constv=t.Matrix3.fromRotationZ(y,pr),w=t.Matrix3.multiply(h,v,fr),C=Math.cos(i.xPoleWander),_=Math.cos(i.yPoleWander),b=Math.sin(i.xPoleWander),x=Math.sin(i.yPoleWander);letS=s-2451545+a/rt.SECONDS_PER_DAY;S/=36525;constA=-47e-6*S*o.CesiumMath.RADIANS_PER_DEGREE/3600,E=Math.cos(A),O=Math.sin(A),I=pr;returnI[0]=C*E,I[1]=C*O,I[2]=b,I[3]=-_*O+x*b*E,I[4]=_*E+x*b*O,I[5]=-x*C,I[6]=-x*O-_*b*E,I[7]=x*E-_*b*O,I[8]=_*C,t.Matrix3.multiply(w,I,n)};consthr=newt.Cartesian4;Vn.pointToWindowCoordinates=function(e,t,n,r){return(r=Vn.pointToGLWindowCoordinates(e,t,n,r)).y=2*t[5]-r.y,r},Vn.pointToGLWindowCoordinates=function(e,n,o,i){r.defined(i)||(i=newt.Cartesian2);consts=hr;returnt.Matrix4.multiplyByVector(e,t.Cartesian4.fromElements(o.x,o.y,o.z,1,s),s),t.Cartesian4.multiplyByScalar(s,1/s.w,s),t.Matrix4.multiplyByVector(n,s,s),t.Cartesian2.fromCartesian4(s,i)};constmr=newt.Cartesian3,gr=newt.Cartesian3,yr=newt.Cartesian3;Vn.rotationMatrixFromPositionVelocity=function(e,n,i,s){consta=r.defaultValue(i,t.Ellipsoid.WGS84).geodeticSurfaceNormal(e,mr);letu=t.Cartesian3.cross(n,a,gr);t.Cartesian3.equalsEpsilon(u,t.Cartesian3.ZERO,o.CesiumMath.EPSILON6)&&(u=t.Cartesian3.clone(t.Cartesian3.UNIT_X,u));constc=t.Cartesian3.cross(u,n,yr);returnt.Cartesian3.normalize(c,c),t.Cartesian3.cross(n,c,u),t.Cartesian3.negate(u,u),t.Cartesian3.normalize(u,u),r.defined(s)||(s=newt.Matrix3),s[0]=n.x,s[1]=n.y,s[2]=n.z,s[3]=u.x,s[4]=u.y,s[5]=u.z,s[6]=c.x,s[7]=c.y,s[8]=c.z,s};constvr=newt.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),wr=newt.Cartographic,Cr=newt.Cartesian3,_r=newt.Cartesian3,br=newt.Matrix3,xr=newt.Matrix4,Sr=newt.Matrix4;Vn.basisTo2D=function(e,n,r){consto=t.Matrix4.getTranslation(n,_r),i=e.ellipsoid,s=i.cartesianToCartographic(o,wr),a=e.project(s,Cr);t.Cartesian3.fromElements(a.z,a.x,a.y,a);constu=Vn.eastNorthUpToFixedFrame(o,i,xr),c=t.Matrix4.inverseTransformation(u,Sr),l=t.Matrix4.getMatrix3(n,br),d=t.Matrix4.multiplyByMatrix3(c,l,r);returnt.Matrix4.multiply(vr,d,r),t.Matrix4.setTranslation(r,a,r),r},Vn.wgs84To2DModelMatrix=function(e,n,r){consto=e.ellipsoid,i=Vn.eastNorthUpToFixedFrame(n,o,xr),s=t.Matrix4.inverseTransformation(i,Sr),a=o.cartesianToCartographic(n,wr),u=e.project(a,Cr);t.Cartesian3.fromElements(u.z,u.x,u.y,u);constc=t.Matrix4.fromTranslation(u,xr);returnt.Matrix4.multiply(vr,s,r),t.Matrix4.multiply(c,r,r),r},e.BoundingSphere=c,e.FeatureDetection=Se,e.GeographicProjection=s,e.Intersect=a,e.Interval=u,e.Quaternion=Ae,e.Resource=fn,e.Transforms=Vn,e.buildModuleUrl=Un}));