define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./VertexFormat-e46f29d6"],(function(e,t,n,a,r,o,i,m,s,u){"use strict";consty=newn.Cartesian3;functionf(e){e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT);constt=e.minimum,r=e.maximum;if(a.Check.typeOf.object("min",t),a.Check.typeOf.object("max",r),o.defined(e.offsetAttribute)&&e.offsetAttribute===s.GeometryOffsetAttribute.TOP)thrownewa.DeveloperError("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");consti=o.defaultValue(e.vertexFormat,u.VertexFormat.DEFAULT);this._minimum=n.Cartesian3.clone(t),this._maximum=n.Cartesian3.clone(r),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}f.fromDimensions=function(e){e=o.defaultValue(e,o.defaultValue.EMPTY_OBJECT);constt=e.dimensions;a.Check.typeOf.object("dimensions",t),a.Check.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),a.Check.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),a.Check.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);constr=n.Cartesian3.multiplyByScalar(t,.5,newn.Cartesian3);returnnewf({minimum:n.Cartesian3.negate(r,newn.Cartesian3),maximum:r,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})},f.fromAxisAlignedBoundingBox=function(e){returna.Check.typeOf.object("boundingBox",e),newf({minimum:e.minimum,maximum:e.maximum})},f.packedLength=2*n.Cartesian3.packedLength+u.VertexFormat.packedLength+1,f.pack=function(e,t,r){returna.Check.typeOf.object("value",e),a.Check.defined("array",t),r=o.defaultValue(r,0),n.Cartesian3.pack(e._minimum,t,r),n.Cartesian3.pack(e._maximum,t,r+n.Cartesian3.packedLength),u.VertexFormat.pack(e._vertexFormat,t,r+2*n.Cartesian3.packedLength),t[r+2*n.Cartesian3.packedLength+u.VertexFormat.packedLength]=o.defaultValue(e._offsetAttribute,-1),t};constc=newn.Cartesian3,p=newn.Cartesian3,x=newu.VertexFormat,l={minimum:c,maximum:p,vertexFormat:x,offsetAttribute:void0};letb;f.unpack=function(e,t,r){a.Check.defined("array",e),t=o.defaultValue(t,0);consti=n.Cartesian3.unpack(e,t,c),m=n.Cartesian3.unpack(e,t+n.Cartesian3.packedLength,p),s=u.VertexFormat.unpack(e,t+2*n.Cartesian3.packedLength,x),y=e[t+2*n.Cartesian3.packedLength+u.VertexFormat.packedLength];returno.defined(r)?(r._minimum=n.Cartesian3.clone(i,r._minimum),r._maximum=n.Cartesian3.clone(m,r._maximum),r._vertexFormat=u.VertexFormat.clone(s,r._vertexFormat),r._offsetAttribute=-1===y?void0:y,r):(l.offsetAttribute=-1===y?void0:y,newf(l))},f.createGeometry=function(e){consta=e._minimum,u=e._maximum,f=e._vertexFormat;if(n.Cartesian3.equals(a,u))return;constc=newm.GeometryAttributes;letp,x;if(f.position&&(f.st||f.normal||f.tangent||f.bitangent)){if(f.position&&(x=newFloat64Array(72),x[0]=a.x,x[1]=a.y,x[2]=u.z,x[3]=u.x,x[4]=a.y,x[5]=u.z,x[6]=u.x,x[7]=u.y,x[8]=u.z,x[9]=a.x,x[10]=u.y,x[11]=u.z,x[12]=a.x,x[13]=a.y,x[14]=a.z,x[15]=u.x,x[16]=a.y,x[17]=a.z,x[18]=u.x,x[19]=u.y,x[20]=a.z,x[21]=a.x,x[22]=u.y,x[23]=a.z,x[24]=u.x,x[25]=a.y,x[26]=a.z,x[27]=u.x,x[28]=u.y,x[29]=a.z,x[30]=u.x,x[31]=u.y,x[32]=u.z,x[33]=u.x,x[34]=a.y,x[35]=u.z,x[36]=a.x,x[37]=a.y,x[38]=a.z,x[39]=a.x,x[40]=u.y,x[41]=a.z,x[42]=a.x,x[43]=u.y,x[44]=u.z,x[45]=a.x,x[46]=a.y,x[47]=u.z,x[48]=a.x,x[49]=u.y,x[50]=a.z,x[51]=u.x,x[52]=u.y,x[53]=a.z,x[54]=u.x,x[55]=u.y,x[56]=u.z,x[57]=a.x,x[58]=u.y,x[59]=u.z,x[60]=a.x,x[61]=a.y,x[62]=a.z,x[63]=u.x,x[64]=a.y,x[65]=a.z,x[66]=u.x,x[67]=a.y,x[68]=u.z,x[69]=a.x,x[70]=a.y,x[71]=u.z,c.position=newi.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:x})),f.normal){conste=newFloat32Array(72);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,e[12]=0,e[13]=0,e[14]=-1,e[15]=0,e[16]=0,e[17]=-1,e[18]=0,e[19]=0,e[20]=-1,e[21]=0,e[22]=0,e[23]=-1,e[24]=1,e[25]=0,e[26]=0,e[27]=1,e[28]=0,e[29]=0,e[30]=1,e[31]=0,e[32]=0,e[33]=1,e[34]=0,e[35]=0,e[36]=-1,e[37]=0,e[38]=0,e[39]=-1,e[40]=0,e[41]=0,e[42]=-1,e[43]=0,e[44]=0,e[45]=-1,e[46]=0,e[47]=0,e[48]=0,e[49]=1,e[50]=0,e[51]=0,e[52]=1,e[53]=0,e[54]=0,e[55]=1,e[56]=0,e[57]=0,e[58]=1,e[59]=0,e[60]=0,e[61]=-1,e[62]=0,e[63]=0,e[64]=-1,e[65]=0,e[66]=0,e[67]=-1,e[68]=0,e[69]=0,e[70]=-1,e[71]=0,c.normal=newi.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(f.st){conste=newFloat32Array(48);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,e[8]=1,e[9]=0,e[10]=0,e[11]=0,e[12]=0,e[13]=1,e[14]=1,e[15]=1,e[16]=0,e[17]=0,e[18]=1,e[19]=0,e[20]=1,e[21]=1,e[22]=0,e[23]=1,e[24]=1,e[25]=0,e[26]=0,e[27]=0,e[28]=0,e[29]=1,e[30]=1,e[31]=1,e[32]=1,e[33]=0,e[34]=0,e[35]=0,e[36]=0,e[37]=1,e[38]=1,e[39]=1,e[40]=0,e[41]=0,e[42]=1,e[43]=0,e[44]=1,e[45]=1,e[46]=0,e[47]=1,c.st=newi.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:e})}if(f.tangent){conste=newFloat32Array(72);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,e[12]=-1,e[13]=0,e[14]=0,e[15]=-1,e[16]=0,e[17]=0,e[18]=-1,e[19]=0,e[20]=0,e[21]=-1,e[22]=0,e[23]=0,e[24]=0,e[25]=1,e[26]=0,e[27]=0,e[28]=1,e[29]=0,e[30]=0,e[31]=1,e[32]=0,e[33]=0,e[34]=1,e[35]=0,e[36]=0,e[37]=-1,e[38]=0,e[39]=0,e[40]=-1,e[41]=0,e[42]=0,e[43]=-1,e[44]=0,e[45]=0,e[46]=-1,e[47]=0,e[48]=-1,e[49]=0,e[50]=0,e[51]=-1,e[52]=0,e[53]=0,e[54]=-1,e[55]=0,e[56]=0,e[57]=-1,e[58]=0,e[59]=0,e[60]=1,e[61]=0,e[62]=0,e[63]=1,e[64]=0,e[65]=0,e[66]=1,e[67]=0,e[68]=0,e[69]=1,e[70]=0,e[71]=0,c.tangent=newi.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}if(f.bitangent){conste=newFloat32Array(72);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=1,e[14]=0,e[15]=0,e[16]=1,e[17]=0,e[18]=0,e[19]=1,e[20]=0,e[21]=0,e[22]=1,e[23]=0,e[24]=0,e[25]=0,e[26]=1,e[27]=0,e[28]=0,e[29]=1,e[30]=0,e[31]=0,e[32]=1,e[33]=0,e[34]=0,e[35]=1,e[36]=0,e[37]=0,e[38]=1,e[39]=0,e[40]=0,e[41]=1,e[42]=0,e[43]=0,e[44]=1,e[45]=0,e[46]=0,e[47]=1,e[48]=0,e[49]=0,e[50]=1,e[51]=0,e[52]=0,e[53]=1,e[54]=0,e[55]=0,e[56]=1,e[57]=0,e[58]=0,e[59]=1,e[60]=0,e[61]=0,e[62]=1,e[63]=0,e[64]=0,e[65]=1,e[66]=0,e[67]=0,e[68]=1,e[69]=0,e[70]=0,e[71]=1,c.bitangent=newi.GeometryAttribute({componentDatatype:r.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})}p=newUint16Array(36),p[0]=0,p[1]=1,p[2]=2,p[3]=0,p[4]=2,p[5]=3,p[6]=6,p[7]=5,p[8]=4,p[9]=7,p[10]=6,p[11]=4,p[12]=8,p[13]=9,p[14]=10,p[15]=8,p[16]=10,p[17]=11,p[18]=14,p[19]=13,p[20]=12,p[21]=15,p[22]=14,p[23]=12,p[24]=18,p[25]=17,p[26]=16,p[27]=19,p[28]=18,p[29]=16,p[30]=20,p[31]=21,p[32]=22,p[33]=20,p[34]=22,p[35]=23}elsex=newFloat64Array(24),x[0]=a.x,x[1]=a.y,x[2]=a.z,x[3]=u.x,x[4]=a.y,x[5]=a.z,x[6]=u.x,x[7]=u.y,x[8]=a.z,x[9]=a.x,x[10]=u.y,x[11]=a.z,x[12]=a.x,x[13]=a.y,x[14]=u.z,x[15]=u.x,x[16]=a.y,x[17]=u.z,x[18]=u.x,x[19]=u.y,x[20]=u.z,x[21]=a.x,x[22]=u.y,x[23]=u.z,c.position=newi.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:x}),p=newUint16Array(36),p[0]=4,p[1]=5,p[2]=6,p[3]=4,p[4]=6,p[5]=7,p[6]=1,p[7]=0,p[8]=3,p[9]=1,p[10]=3,p[11]=2,p[12]=1,p[13]=6,p[14]=5,p[15]=1,p[16]=2,p[17]=6,p[18]=2,p[19]=3,p[20]=7,p[21]=2,p[22]=7,p[23]=6,p[24]=3,p[25]=0,p[26]=4,p[27]=3,p[28]=4,p[29]=7,p[30]=0,p[31]=1,p[32]=5,p[33]=0,p[34]=5,p[35]=4;constl=n.Cartesian3.subtract(u,a,y),b=.5*n.Cartesian3.magnitude(l);if(o.defined(e._offsetAttribute)){constt=x.length,n=e._offsetAttribute===s.GeometryOffsetAttribute.NONE?0:1,a=newUint8Array(t/3).fill(n);c.applyOffset=newi.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:a})}returnnewi.Geometry({attributes:c,indices:p,primitiveType:i.PrimitiveType.TRIANGLES,boundingSphere:newt.BoundingSphere(n.Cartesian3.ZERO,b),offsetAttribute:e._offsetAttribute})},f.getUnitBox=function(){returno.defined(b)||(b=f.createGeometry(f.fromDimensions({dimensions:newn.Cartesian3(1,1,1),vertexFormat:u.VertexFormat.POSITION_ONLY}))),b},e.BoxGeometry=f}));
define(["exports","./RuntimeError-c581ca93","./defaultValue-94c3e563","./WebGLConstants-7dccdc96"],(function(e,r,t,n){"use strict";vari=function(e){void0==e&&(e=(newDate).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=newArray(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};i.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},i.prototype.init_by_array=function(e,r){vart,n,i;for(this.init_seed(19650218),t=1,n=0,i=this.N>r?this.N:r;i;i--){varo=this.mt[t-1]^this.mt[t-1]>>>30;this.mt[t]=(this.mt[t]^(1664525*((4294901760&o)>>>16)<<16)+1664525*(65535&o))+e[n]+n,this.mt[t]>>>=0,t++,n++,t>=this.N&&(this.mt[0]=this.mt[this.N-1],t=1),n>=r&&(n=0)}for(i=this.N-1;i;i--){o=this.mt[t-1]^this.mt[t-1]>>>30;this.mt[t]=(this.mt[t]^(1566083941*((4294901760&o)>>>16)<<16)+1566083941*(65535&o))-t,this.mt[t]>>>=0,t++,t>=this.N&&(this.mt[0]=this.mt[this.N-1],t=1)}this.mt[0]=2147483648},i.prototype.random_int=function(){vare,r=newArray(0,this.MATRIX_A);if(this.mti>=this.N){vart;for(this.mti==this.N+1&&this.init_seed(5489),t=0;t<this.N-this.M;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+this.M]^e>>>1^r[1&e];for(;t<this.N-1;t++)e=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+(this.M-this.N)]^e>>>1^r[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^r[1&e],this.mti=0}returne=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},i.prototype.random_int31=function(){returnthis.random_int()>>>1},i.prototype.random_incl=function(){returnthis.random_int()*(1/4294967295)},i.prototype.random=function(){returnthis.random_int()*(1/4294967296)},i.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},i.prototype.random_long=function(){vare=this.random_int()>>>5,r=this.random_int()>>>6;return(67108864*e+r)*(1/9007199254740992)};varo=i;consta={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};a.sign=t.defaultValue(Math.sign,(function(e){returne=+e,0===e||e!==e?e:e>0?1:-1})),a.signNotZero=function(e){returne<0?-1:1},a.toSNorm=function(e,r){returnr=t.defaultValue(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){returnr=t.defaultValue(r,255),a.clamp(e,0,r)/r*2-1},a.normalize=function(e,r,t){returnt=Math.max(t-r,0),0===t?0:a.clamp((e-r)/t,0,1)},a.sinh=t.defaultValue(Math.sinh,(function(e){return(Math.exp(e)-Math.exp(-e))/2})),a.cosh=t.defaultValue(Math.cosh,(function(e){return(Math.exp(e)+Math.exp(-e))/2})),a.lerp=function(e,r,t){return(1-t)*e+t*r},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=Math.PI/2,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI/2,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){if(!t.defined(e))thrownewr.DeveloperError("degrees is required.");returne*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){if(!t.defined(e))thrownewr.DeveloperError("radians is required.");returne*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){if(!t.defined(e))thrownewr.DeveloperError("angle is required.");constn=a.TWO_PI,i=e-Math.floor(e/n)*n;returni<-Math.PI?i+n:i>=Math.PI?i-n:i},a.clampToLatitudeRange=function(e){if(!t.defined(e))thrownewr.DeveloperError("angle is required.");returna.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){if(!t.defined(e))thrownewr.DeveloperError("angle is required.");returne>=-a.PI&&e<=a.PI?e:a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){if(!t.defined(e))thrownewr.DeveloperError("angle is required.");if(e>=0&&e<=a.TWO_PI)returne;constn=a.mod(e,a.TWO_PI);returnMath.abs(n)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:n},a.mod=function(e,n){if(!t.defined(e))thrownewr.DeveloperError("m is required.");if(!t.defined(n))thrownewr.DeveloperError("n is required.");if(0===n)thrownewr.DeveloperError("divisor cannot be 0.");returna.sign(e)===a.sign(n)&&Math.abs(e)<Math.abs(n)?e:(e%n+n)%n},a.equalsEpsilon=function(e,n,i,o){if(!t.defined(e))thrownewr.DeveloperError("left is required.");if(!t.defined(n))thrownewr.DeveloperError("right is required.");i=t.defaultValue(i,0),o=t.defaultValue(o,i);consta=Math.abs(e-n);returna<=o||a<=i*Math.max(Math.abs(e),Math.abs(n))},a.lessThan=function(e,n,i){if(!t.defined(e))thrownewr.DeveloperError("first is required.");if(!t.defined(n))thrownewr.DeveloperError("second is required.");if(!t.defined(i))thrownewr.DeveloperError("absoluteEpsilon is required.");returne-n<-i},a.lessThanOrEquals=function(e,n,i){if(!t.defined(e))thrownewr.DeveloperError("first is required.");if(!t.defined(n))thrownewr.DeveloperError("second is required.");if(!t.defined(i))thrownewr.DeveloperError("absoluteEpsilon is required.");returne-n<i},a.greaterThan=function(e,n,i){if(!t.defined(e))thrownewr.DeveloperError("first is required.");if(!t.defined(n))thrownewr.DeveloperError("second is required.");if(!t.defined(i))thrownewr.DeveloperError("absoluteEpsilon is required.");returne-n>i},a.greaterThanOrEquals=function(e,n,i){if(!t.defined(e))thrownewr.DeveloperError("first is required.");if(!t.defined(n))thrownewr.DeveloperError("second is required.");if(!t.defined(i))thrownewr.DeveloperError("absoluteEpsilon is required.");returne-n>-i};consts=[1];a.factorial=function(e){if("number"!==typeofe||e<0)thrownewr.DeveloperError("A number greater than or equal to 0 is required.");constt=s.length;if(e>=t){letr=s[t-1];for(letn=t;n<=e;n++){conste=r*n;s.push(e),r=e}}returns[e]},a.incrementWrap=function(e,n,i){if(i=t.defaultValue(i,0),!t.defined(e))thrownewr.DeveloperError("n is required.");if(n<=i)thrownewr.DeveloperError("maximumValue must be greater than minimumValue.");return++e,e>n&&(e=i),e},a.isPowerOfTwo=function(e){if("number"!==typeofe||e<0||e>4294967295)thrownewr.DeveloperError("A number between 0 and (2^32)-1 is required.");return0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){if("number"!==typeofe||e<0||e>2147483648)thrownewr.DeveloperError("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.previousPowerOfTwo=function(e){if("number"!==typeofe||e<0||e>4294967295)thrownewr.DeveloperError("A number between 0 and (2^32)-1 is required.");returne|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e},a.clamp=function(e,t,n){returnr.Check.typeOf.number("value",e),r.Check.typeOf.number("min",t),r.Check.typeOf.number("max",n),e<t?t:e>n?n:e};letu=newo;a.setRandomNumberSeed=function(e){if(!t.defined(e))thrownewr.DeveloperError("seed is required.");u=newo(e)},a.nextRandomNumber=function(){returnu.random()},a.randomBetween=function(e,r){returna.nextRandomNumber()*(r-e)+e},a.acosClamped=function(e){if(!t.defined(e))thrownewr.DeveloperError("value is required.");returnMath.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){if(!t.defined(e))thrownewr.DeveloperError("value is required.");returnMath.asin(a.clamp(e,-1,1))},a.chordLength=function(e,n){if(!t.defined(e))thrownewr.DeveloperError("angle is required.");if(!t.defined(n))thrownewr.DeveloperError("radius is required.");return2*n*Math.sin(.5*e)},a.logBase=function(e,n){if(!t.defined(e))thrownewr.DeveloperError("number is required.");if(!t.defined(n))thrownewr.DeveloperError("base is required.");returnMath.log(e)/Math.log(n)},a.cbrt=t.defaultValue(Math.cbrt,(function(e){constr=Math.pow(Math.abs(e),1/3);returne<0?-r:r})),a.log2=t.defaultValue(Math.log2,(function(e){returnMath.log(e)*Math.LOG2E})),a.fog=function(e,r){constt=e*r;return1-Math.exp(-t*t)},a.fastApproximateAtan=function(e){returnr.Check.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},a.fastApproximateAtan2=function(e,t){letn;r.Check.typeOf.number("x",e),r.Check.typeOf.number("y",t);leti=Math.abs(e);n=Math.abs(t);consto=Math.max(i,n);n=Math.min(i,n);consts=n/o;if(isNaN(s))thrownewr.DeveloperError("either x or y must be nonzero");returni=a.fastApproximateAtan(s),i=Math.abs(t)>Math.abs(e)?a.PI_OVER_TWO-i:i,i=e<0?a.PI-i:i,i=t<0?-i:i,i};constE={BYTE:n.WebGLConstants.BYTE,UNSIGNED_BYTE:n.WebGLConstants.UNSIGNED_BYTE,SHORT:n.WebGLConstants.SHORT,UNSIGNED_SHORT:n.WebGLConstants.UNSIGNED_SHORT,INT:n.WebGLConstants.INT,UNSIGNED_INT:n.WebGLConstants.UNSIGNED_INT,FLOAT:n.WebGLConstants.FLOAT,DOUBLE:n.WebGLConstants.DOUBLE,getSizeInBytes:function(e){if(!t.defined(e))thrownewr.DeveloperError("value is required.");switch(e){caseE.BYTE:returnInt8Array.BYTES_PER_ELEMENT;caseE.UNSIGNED_BYTE:returnUint8Array.BYTES_PER_ELEMENT;caseE.SHORT:returnInt16Array.BYTES_PER_ELEMENT;caseE.UNSIGNED_SHORT:returnUint16Array.BYTES_PER_ELEMENT;caseE.INT:returnInt32Array.BYTES_PER_ELEMENT;caseE.UNSIGNED_INT:returnUint32Array.BYTES_PER_ELEMENT;caseE.FLOAT:returnFloat32Array.BYTES_PER_ELEMENT;caseE.DOUBLE:returnFloat64Array.BYTES_PER_ELEMENT;default:thrownewr.DeveloperError("componentDatatype is not a valid value.")}},fromTypedArray:function(e){if(einstanceofInt8Array)returnE.BYTE;if(einstanceofUint8Array)returnE.UNSIGNED_BYTE;if(einstanceofInt16Array)returnE.SHORT;if(einstanceofUint16Array)returnE.UNSIGNED_SHORT;if(einstanceofInt32Array)returnE.INT;if(einstanceofUint32Array)returnE.UNSIGNED_INT;if(einstanceofFloat32Array)returnE.FLOAT;if(einstanceofFloat64Array)returnE.DOUBLE;thrownewr.DeveloperError("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},validate:function(e){returnt.defined(e)&&(e===E.BYTE||e===E.UNSIGNED_BYTE||e===E.SHORT||e===E.UNSIGNED_SHORT||e===E.INT||e===E.UNSIGNED_INT||e===E.FLOAT||e===E.DOUBLE)},createTypedArray:function(e,n){if(!t.defined(e))thrownewr.DeveloperError("componentDatatype is required.");if(!t.defined(n))thrownewr.DeveloperError("valuesOrLength is required.");switch(e){caseE.BYTE:returnnewInt8Array(n);caseE.UNSIGNED_BYTE:returnnewUint8Array(n);caseE.SHORT:returnnewInt16Array(n);caseE.UNSIGNED_SHORT:returnnewUint16Array(n);caseE.INT:returnnewInt32Array(n);caseE.UNSIGNED_INT:returnnewUint32Array(n);caseE.FLOAT:returnnewFloat32Array(n);caseE.DOUBLE:returnnewFloat64Array(n);default:thrownewr.DeveloperError("componentDatatype is not a valid value.")}},createArrayBufferView:function(e,n,i,o){if(!t.defined(e))thrownewr.DeveloperError("componentDatatype is required.");if(!t.defined(n))thrownewr.DeveloperError("buffer is required.");switch(i=t.defaultValue(i,0),o=t.defaultValue(o,(n.byteLength-i)/E.getSizeInBytes(e)),e){caseE.BYTE:returnnewInt8Array(n,i,o);caseE.UNSIGNED_BYTE:returnnewUint8Array(n,i,o);caseE.SHORT:returnnewInt16Array(n,i,o);caseE.UNSIGNED_SHORT:returnnewUint16Array(n,i,o);caseE.INT:returnnewInt32Array(n,i,o);caseE.UNSIGNED_INT:returnnewUint32Array(n,i,o);caseE.FLOAT:returnnewFloat32Array(n,i,o);caseE.DOUBLE:returnnewFloat64Array(n,i,o);default:thrownewr.DeveloperError("componentDatatype is not a valid value.")}},fromName:function(e){switch(e){case"BYTE":returnE.BYTE;case"UNSIGNED_BYTE":returnE.UNSIGNED_BYTE;case"SHORT":returnE.SHORT;case"UNSIGNED_SHORT":returnE.UNSIGNED_SHORT;case"INT":returnE.INT;case"UNSIGNED_INT":returnE.UNSIGNED_INT;case"FLOAT":returnE.FLOAT;case"DOUBLE":returnE.DOUBLE;default:thrownewr.DeveloperError("name is not a valid value.")}}};varh=Object.freeze(E);e.CesiumMath=a,e.ComponentDatatype=h}));
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./CylinderGeometryLibrary-7b029c87","./defaultValue-94c3e563","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785","./VertexFormat-e46f29d6"],(function(t,e,r,o,n,a,i,s,u,f,m,d){"use strict";constl=newr.Cartesian2,p=newr.Cartesian3,c=newr.Cartesian3,y=newr.Cartesian3,b=newr.Cartesian3;functionA(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT);conste=t.length,r=t.topRadius,o=t.bottomRadius,n=a.defaultValue(t.vertexFormat,d.VertexFormat.DEFAULT),s=a.defaultValue(t.slices,128);if(!a.defined(e))thrownewi.DeveloperError("options.length must be defined.");if(!a.defined(r))thrownewi.DeveloperError("options.topRadius must be defined.");if(!a.defined(o))thrownewi.DeveloperError("options.bottomRadius must be defined.");if(s<3)thrownewi.DeveloperError("options.slices must be greater than or equal to 3.");if(a.defined(t.offsetAttribute)&&t.offsetAttribute===f.GeometryOffsetAttribute.TOP)thrownewi.DeveloperError("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=e,this._topRadius=r,this._bottomRadius=o,this._vertexFormat=d.VertexFormat.clone(n),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}A.packedLength=d.VertexFormat.packedLength+5,A.pack=function(t,e,r){if(!a.defined(t))thrownewi.DeveloperError("value is required");if(!a.defined(e))thrownewi.DeveloperError("array is required");returnr=a.defaultValue(r,0),d.VertexFormat.pack(t._vertexFormat,e,r),r+=d.VertexFormat.packedLength,e[r++]=t._length,e[r++]=t._topRadius,e[r++]=t._bottomRadius,e[r++]=t._slices,e[r]=a.defaultValue(t._offsetAttribute,-1),e};consth=newd.VertexFormat,w={vertexFormat:h,length:void0,topRadius:void0,bottomRadius:void0,slices:void0,offsetAttribute:void0};letg;A.unpack=function(t,e,r){if(!a.defined(t))thrownewi.DeveloperError("array is required");e=a.defaultValue(e,0);consto=d.VertexFormat.unpack(t,e,h);e+=d.VertexFormat.packedLength;constn=t[e++],s=t[e++],u=t[e++],f=t[e++],m=t[e];returna.defined(r)?(r._vertexFormat=d.VertexFormat.clone(o,r._vertexFormat),r._length=n,r._topRadius=s,r._bottomRadius=u,r._slices=f,r._offsetAttribute=-1===m?void0:m,r):(w.length=n,w.topRadius=s,w.bottomRadius=u,w.slices=f,w.offsetAttribute=-1===m?void0:m,newA(w))},A.createGeometry=function(t){leti=t._length;constd=t._topRadius,A=t._bottomRadius,h=t._vertexFormat,w=t._slices;if(i<=0||d<0||A<0||0===d&&0===A)return;constg=w+w,v=w+g,x=g+g,_=n.CylinderGeometryLibrary.computePositions(i,d,A,w,!0),F=h.st?newFloat32Array(2*x):void0,C=h.normal?newFloat32Array(3*x):void0,D=h.tangent?newFloat32Array(3*x):void0,G=h.bitangent?newFloat32Array(3*x):void0;letR;constO=h.normal||h.tangent||h.bitangent;if(O){constt=h.tangent||h.bitangent;lete=0,n=0,a=0;consts=Math.atan2(A-d,i),u=p;u.z=Math.sin(s);constf=Math.cos(s);letm=y,l=c;for(R=0;R<w;R++){consti=R/w*o.CesiumMath.TWO_PI,s=f*Math.cos(i),d=f*Math.sin(i);O&&(u.x=s,u.y=d,t&&(m=r.Cartesian3.normalize(r.Cartesian3.cross(r.Cartesian3.UNIT_Z,u,m),m)),h.normal&&(C[e++]=u.x,C[e++]=u.y,C[e++]=u.z,C[e++]=u.x,C[e++]=u.y,C[e++]=u.z),h.tangent&&(D[n++]=m.x,D[n++]=m.y,D[n++]=m.z,D[n++]=m.x,D[n++]=m.y,D[n++]=m.z),h.bitangent&&(l=r.Cartesian3.normalize(r.Cartesian3.cross(u,m,l),l),G[a++]=l.x,G[a++]=l.y,G[a++]=l.z,G[a++]=l.x,G[a++]=l.y,G[a++]=l.z))}for(R=0;R<w;R++)h.normal&&(C[e++]=0,C[e++]=0,C[e++]=-1),h.tangent&&(D[n++]=1,D[n++]=0,D[n++]=0),h.bitangent&&(G[a++]=0,G[a++]=-1,G[a++]=0);for(R=0;R<w;R++)h.normal&&(C[e++]=0,C[e++]=0,C[e++]=1),h.tangent&&(D[n++]=1,D[n++]=0,D[n++]=0),h.bitangent&&(G[a++]=0,G[a++]=1,G[a++]=0)}constV=12*w-12,E=m.IndexDatatype.createTypedArray(x,V);letT=0,L=0;for(R=0;R<w-1;R++)E[T++]=L,E[T++]=L+2,E[T++]=L+3,E[T++]=L,E[T++]=L+3,E[T++]=L+1,L+=2;for(E[T++]=g-2,E[T++]=0,E[T++]=1,E[T++]=g-2,E[T++]=1,E[T++]=g-1,R=1;R<w-1;R++)E[T++]=g+R+1,E[T++]=g+R,E[T++]=g;for(R=1;R<w-1;R++)E[T++]=v,E[T++]=v+R,E[T++]=v+R+1;letP=0;if(h.st){constt=Math.max(d,A);for(R=0;R<x;R++){conste=r.Cartesian3.fromArray(_,3*R,b);F[P++]=(e.x+t)/(2*t),F[P++]=(e.y+t)/(2*t)}}constM=newu.GeometryAttributes;h.position&&(M.position=news.GeometryAttribute({componentDatatype:o.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:_})),h.normal&&(M.normal=news.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:C})),h.tangent&&(M.tangent=news.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:D})),h.bitangent&&(M.bitangent=news.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),h.st&&(M.st=news.GeometryAttribute({componentDatatype:o.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:F})),l.x=.5*i,l.y=Math.max(A,d);constk=newe.BoundingSphere(r.Cartesian3.ZERO,r.Cartesian2.magnitude(l));if(a.defined(t._offsetAttribute)){i=_.length;conste=t._offsetAttribute===f.GeometryOffsetAttribute.NONE?0:1,r=newUint8Array(i/3).fill(e);M.applyOffset=news.GeometryAttribute({componentDatatype:o.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}returnnews.Geometry({attributes:M,indices:E,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:k,offsetAttribute:t._offsetAttribute})},A.getUnitCylinder=function(){returna.defined(g)||(g=A.createGeometry(newA({topRadius:1,bottomRadius:1,length:1,vertexFormat:d.VertexFormat.POSITION_ONLY}))),g},t.CylinderGeometry=A}));
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./EllipseGeometryLibrary-d3fe9678","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryInstance-97bd792f","./GeometryOffsetAttribute-ec11b721","./GeometryPipeline-a88e5bfc","./IndexDatatype-db156785","./VertexFormat-e46f29d6"],(function(t,e,r,i,n,o,a,s,l,u,m,c,p,y){"use strict";constd=newr.Cartesian3,f=newr.Cartesian3,h=newr.Cartesian3,A=newr.Cartesian3,x=newr.Cartesian2,g=newr.Matrix3,b=newr.Matrix3,_=newe.Quaternion,C=newr.Cartesian3,w=newr.Cartesian3,M=newr.Cartesian3,E=newr.Cartographic,I=newr.Cartesian3,T=newr.Cartesian2,G=newr.Cartesian2;functionv(t,i,u){constc=i.vertexFormat,p=i.center,y=i.semiMajorAxis,A=i.semiMinorAxis,v=i.ellipsoid,N=i.stRotation,P=u?t.length/3*2:t.length/3,V=i.shadowVolume,D=c.st?newFloat32Array(2*P):void0,F=c.normal?newFloat32Array(3*P):void0,O=c.tangent?newFloat32Array(3*P):void0,S=c.bitangent?newFloat32Array(3*P):void0,L=V?newFloat32Array(3*P):void0;letR=0,j=C,k=w,z=M;constB=newe.GeographicProjection(v),Y=B.project(v.cartesianToCartographic(p,E),I),H=v.scaleToGeodeticSurface(p,d);v.geodeticSurfaceNormal(H,H);letU=g,Q=b;if(0!==N){lett=e.Quaternion.fromAxisAngle(H,N,_);U=r.Matrix3.fromQuaternion(t,U),t=e.Quaternion.fromAxisAngle(H,-N,_),Q=r.Matrix3.fromQuaternion(t,Q)}elseU=r.Matrix3.clone(r.Matrix3.IDENTITY,U),Q=r.Matrix3.clone(r.Matrix3.IDENTITY,Q);constW=r.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,T),q=r.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G);letJ=t.length;constZ=u?J:0,K=Z/3*2;for(lete=0;e<J;e+=3){consti=e+1,n=e+2,o=r.Cartesian3.fromArray(t,e,d);if(c.st){constt=r.Matrix3.multiplyByVector(U,o,f),e=B.project(v.cartesianToCartographic(t,E),h);r.Cartesian3.subtract(e,Y,e),x.x=(e.x+y)/(2*y),x.y=(e.y+A)/(2*A),W.x=Math.min(x.x,W.x),W.y=Math.min(x.y,W.y),q.x=Math.max(x.x,q.x),q.y=Math.max(x.y,q.y),u&&(D[R+K]=x.x,D[R+1+K]=x.y),D[R++]=x.x,D[R++]=x.y}(c.normal||c.tangent||c.bitangent||V)&&(j=v.geodeticSurfaceNormal(o,j),V&&(L[e+Z]=-j.x,L[i+Z]=-j.y,L[n+Z]=-j.z),(c.normal||c.tangent||c.bitangent)&&((c.tangent||c.bitangent)&&(k=r.Cartesian3.normalize(r.Cartesian3.cross(r.Cartesian3.UNIT_Z,j,k),k),r.Matrix3.multiplyByVector(Q,k,k)),c.normal&&(F[e]=j.x,F[i]=j.y,F[n]=j.z,u&&(F[e+Z]=-j.x,F[i+Z]=-j.y,F[n+Z]=-j.z)),c.tangent&&(O[e]=k.x,O[i]=k.y,O[n]=k.z,u&&(O[e+Z]=-k.x,O[i+Z]=-k.y,O[n+Z]=-k.z)),c.bitangent&&(z=r.Cartesian3.normalize(r.Cartesian3.cross(j,k,z),z),S[e]=z.x,S[i]=z.y,S[n]=z.z,u&&(S[e+Z]=z.x,S[i+Z]=z.y,S[n+Z]=z.z))))}if(c.st){J=D.length;for(lett=0;t<J;t+=2)D[t]=(D[t]-W.x)/(q.x-W.x),D[t+1]=(D[t+1]-W.y)/(q.y-W.y)}constX=newl.GeometryAttributes;if(c.position){conste=a.EllipseGeometryLibrary.raisePositionsToHeight(t,i,u);X.position=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e})}if(c.st&&(X.st=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D})),c.normal&&(X.normal=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:F})),c.tangent&&(X.tangent=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),c.bitangent&&(X.bitangent=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),V&&(X.extrudeDirection=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:L})),u&&o.defined(i.offsetAttribute)){lett=newUint8Array(P);if(i.offsetAttribute===m.GeometryOffsetAttribute.TOP)t=t.fill(1,0,P/2);else{conste=i.offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}X.applyOffset=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}returnX}functionN(t){conste=newArray(t*(t+1)*12-6);letr,i,n,o,a,s=0;for(r=0,n=1,o=0;o<3;o++)e[s++]=n++,e[s++]=r,e[s++]=n;for(o=2;o<t+1;++o){for(n=o*(o+1)-1,r=(o-1)*o-1,e[s++]=n++,e[s++]=r,e[s++]=n,i=2*o,a=0;a<i-1;++a)e[s++]=n,e[s++]=r++,e[s++]=r,e[s++]=n++,e[s++]=r,e[s++]=n;e[s++]=n++,e[s++]=r,e[s++]=n}for(i=2*t,++n,++r,o=0;o<i-1;++o)e[s++]=n,e[s++]=r++,e[s++]=r,e[s++]=n++,e[s++]=r,e[s++]=n;for(e[s++]=n,e[s++]=r++,e[s++]=r,e[s++]=n++,e[s++]=r++,e[s++]=r,++r,o=t-1;o>1;--o){for(e[s++]=r++,e[s++]=r,e[s++]=n,i=2*o,a=0;a<i-1;++a)e[s++]=n,e[s++]=r++,e[s++]=r,e[s++]=n++,e[s++]=r,e[s++]=n;e[s++]=r++,e[s++]=r++,e[s++]=n++}for(o=0;o<3;o++)e[s++]=r++,e[s++]=r,e[s++]=n;returne}letP=newr.Cartesian3;functionV(t){consti=t.center;P=r.Cartesian3.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,P),t.height,P),P=r.Cartesian3.add(i,P,P);constn=newe.BoundingSphere(P,t.semiMajorAxis),o=a.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!1),s=o.positions,l=o.numPts,u=v(s,t,!1);letm=N(l);returnm=p.IndexDatatype.createTypedArray(s.length/3,m),{boundingSphere:n,attributes:u,indices:m}}functionD(t,i){consta=i.vertexFormat,u=i.center,c=i.semiMajorAxis,p=i.semiMinorAxis,y=i.ellipsoid,b=i.height,v=i.extrudedHeight,N=i.stRotation,P=t.length/3*2,V=newFloat64Array(3*P),D=a.st?newFloat32Array(2*P):void0,F=a.normal?newFloat32Array(3*P):void0,O=a.tangent?newFloat32Array(3*P):void0,S=a.bitangent?newFloat32Array(3*P):void0,L=i.shadowVolume,R=L?newFloat32Array(3*P):void0;letj=0,k=C,z=w,B=M;constY=newe.GeographicProjection(y),H=Y.project(y.cartesianToCartographic(u,E),I),U=y.scaleToGeodeticSurface(u,d);y.geodeticSurfaceNormal(U,U);constQ=e.Quaternion.fromAxisAngle(U,N,_),W=r.Matrix3.fromQuaternion(Q,g),q=r.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,T),J=r.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,G);letZ=t.length;constK=Z/3*2;for(lete=0;e<Z;e+=3){consti=e+1,n=e+2;leto,s=r.Cartesian3.fromArray(t,e,d);if(a.st){constt=r.Matrix3.multiplyByVector(W,s,f),e=Y.project(y.cartesianToCartographic(t,E),h);r.Cartesian3.subtract(e,H,e),x.x=(e.x+c)/(2*c),x.y=(e.y+p)/(2*p),q.x=Math.min(x.x,q.x),q.y=Math.min(x.y,q.y),J.x=Math.max(x.x,J.x),J.y=Math.max(x.y,J.y),D[j+K]=x.x,D[j+1+K]=x.y,D[j++]=x.x,D[j++]=x.y}s=y.scaleToGeodeticSurface(s,s),o=r.Cartesian3.clone(s,f),k=y.geodeticSurfaceNormal(s,k),L&&(R[e+Z]=-k.x,R[i+Z]=-k.y,R[n+Z]=-k.z);letl=r.Cartesian3.multiplyByScalar(k,b,A);if(s=r.Cartesian3.add(s,l,s),l=r.Cartesian3.multiplyByScalar(k,v,l),o=r.Cartesian3.add(o,l,o),a.position&&(V[e+Z]=o.x,V[i+Z]=o.y,V[n+Z]=o.z,V[e]=s.x,V[i]=s.y,V[n]=s.z),a.normal||a.tangent||a.bitangent){B=r.Cartesian3.clone(k,B);constl=r.Cartesian3.fromArray(t,(e+3)%Z,A);r.Cartesian3.subtract(l,s,l);constu=r.Cartesian3.subtract(o,s,h);k=r.Cartesian3.normalize(r.Cartesian3.cross(u,l,k),k),a.normal&&(F[e]=k.x,F[i]=k.y,F[n]=k.z,F[e+Z]=k.x,F[i+Z]=k.y,F[n+Z]=k.z),a.tangent&&(z=r.Cartesian3.normalize(r.Cartesian3.cross(B,k,z),z),O[e]=z.x,O[i]=z.y,O[n]=z.z,O[e+Z]=z.x,O[e+1+Z]=z.y,O[e+2+Z]=z.z),a.bitangent&&(S[e]=B.x,S[i]=B.y,S[n]=B.z,S[e+Z]=B.x,S[i+Z]=B.y,S[n+Z]=B.z)}}if(a.st){Z=D.length;for(lett=0;t<Z;t+=2)D[t]=(D[t]-q.x)/(J.x-q.x),D[t+1]=(D[t+1]-q.y)/(J.y-q.y)}constX=newl.GeometryAttributes;if(a.position&&(X.position=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:V})),a.st&&(X.st=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:D})),a.normal&&(X.normal=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:F})),a.tangent&&(X.tangent=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:O})),a.bitangent&&(X.bitangent=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:S})),L&&(X.extrudeDirection=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:R})),o.defined(i.offsetAttribute)){lett=newUint8Array(P);if(i.offsetAttribute===m.GeometryOffsetAttribute.TOP)t=t.fill(1,0,P/2);else{conste=i.offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1;t=t.fill(e)}X.applyOffset=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}returnX}functionF(t){conste=t.length/3,r=p.IndexDatatype.createTypedArray(e,6*e);leti=0;for(letn=0;n<e;n++){constt=n,o=n+e,a=(t+1)%e,s=a+e;r[i++]=t,r[i++]=o,r[i++]=a,r[i++]=a,r[i++]=o,r[i++]=s}returnr}constO=newe.BoundingSphere,S=newe.BoundingSphere;functionL(t){consti=t.center,n=t.ellipsoid,o=t.semiMajorAxis;letl=r.Cartesian3.multiplyByScalar(n.geodeticSurfaceNormal(i,d),t.height,d);O.center=r.Cartesian3.add(i,l,O.center),O.radius=o,l=r.Cartesian3.multiplyByScalar(n.geodeticSurfaceNormal(i,l),t.extrudedHeight,l),S.center=r.Cartesian3.add(i,l,S.center),S.radius=o;constm=a.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!0),y=m.positions,f=m.numPts,h=m.outerPositions,A=e.BoundingSphere.union(O,S),x=v(y,t,!0);letg=N(f);constb=g.length;g.length=2*b;const_=y.length/3;for(lete=0;e<b;e+=3)g[e+b]=g[e+2]+_,g[e+1+b]=g[e+1]+_,g[e+2+b]=g[e]+_;constC=p.IndexDatatype.createTypedArray(2*_/3,g),w=news.Geometry({attributes:x,indices:C,primitiveType:s.PrimitiveType.TRIANGLES}),M=D(h,t);g=F(h);constE=p.IndexDatatype.createTypedArray(2*h.length/3,g),I=news.Geometry({attributes:M,indices:E,primitiveType:s.PrimitiveType.TRIANGLES}),T=c.GeometryPipeline.combineInstances([newu.GeometryInstance({geometry:w}),newu.GeometryInstance({geometry:I})]);return{boundingSphere:A,attributes:T[0].attributes,indices:T[0].indices}}functionR(t,e,i,o,s,l,u){constm=a.EllipseGeometryLibrary.computeEllipsePositions({center:t,semiMajorAxis:e,semiMinorAxis:i,rotation:o,granularity:s},!1,!0),c=m.outerPositions,p=c.length/3,y=newArray(p);for(letn=0;n<p;++n)y[n]=r.Cartesian3.fromArray(c,3*n);constd=r.Rectangle.fromCartesianArray(y,l,u);returnd.width>n.CesiumMath.PI&&(d.north=d.north>0?n.CesiumMath.PI_OVER_TWO-n.CesiumMath.EPSILON7:d.north,d.south=d.south<0?n.CesiumMath.EPSILON7-n.CesiumMath.PI_OVER_TWO:d.south,d.east=n.CesiumMath.PI,d.west=-n.CesiumMath.PI),d}functionj(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT);conste=t.center,a=o.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),s=t.semiMajorAxis,l=t.semiMinorAxis,u=o.defaultValue(t.granularity,n.CesiumMath.RADIANS_PER_DEGREE),m=o.defaultValue(t.vertexFormat,y.VertexFormat.DEFAULT);if(i.Check.defined("options.center",e),i.Check.typeOf.number("options.semiMajorAxis",s),i.Check.typeOf.number("options.semiMinorAxis",l),s<l)thrownewi.DeveloperError("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(u<=0)thrownewi.DeveloperError("granularity must be greater than zero.");constc=o.defaultValue(t.height,0),p=o.defaultValue(t.extrudedHeight,c);this._center=r.Cartesian3.clone(e),this._semiMajorAxis=s,this._semiMinorAxis=l,this._ellipsoid=r.Ellipsoid.clone(a),this._rotation=o.defaultValue(t.rotation,0),this._stRotation=o.defaultValue(t.stRotation,0),this._height=Math.max(p,c),this._granularity=u,this._vertexFormat=y.VertexFormat.clone(m),this._extrudedHeight=Math.min(p,c),this._shadowVolume=o.defaultValue(t.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void0,this._textureCoordinateRotationPoints=void0}j.packedLength=r.Cartesian3.packedLength+r.Ellipsoid.packedLength+y.VertexFormat.packedLength+9,j.pack=function(t,e,n){returni.Check.defined("value",t),i.Check.defined("array",e),n=o.defaultValue(n,0),r.Cartesian3.pack(t._center,e,n),n+=r.Cartesian3.packedLength,r.Ellipsoid.pack(t._ellipsoid,e,n),n+=r.Ellipsoid.packedLength,y.VertexFormat.pack(t._vertexFormat,e,n),n+=y.VertexFormat.packedLength,e[n++]=t._semiMajorAxis,e[n++]=t._semiMinorAxis,e[n++]=t._rotation,e[n++]=t._stRotation,e[n++]=t._height,e[n++]=t._granularity,e[n++]=t._extrudedHeight,e[n++]=t._shadowVolume?1:0,e[n]=o.defaultValue(t._offsetAttribute,-1),e};constk=newr.Cartesian3,z=newr.Ellipsoid,B=newy.VertexFormat,Y={center:k,ellipsoid:z,vertexFormat:B,semiMajorAxis:void0,semiMinorAxis:void0,rotation:void0,stRotation:void0,height:void0,granularity:void0,extrudedHeight:void0,shadowVolume:void0,offsetAttribute:void0};functionH(t){conste=-t._stRotation;if(0===e)return[0,0,0,1,1,0];consti=a.EllipseGeometryLibrary.computeEllipsePositions({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,rotation:t._rotation,granularity:t._granularity},!1,!0),n=i.outerPositions,o=n.length/3,l=newArray(o);for(leta=0;a<o;++a)l[a]=r.Cartesian3.fromArray(n,3*a);constu=t._ellipsoid,m=t.rectangle;returns.Geometry._textureCoordinateRotationPoints(l,e,u,m)}j.unpack=function(t,e,n){i.Check.defined("array",t),e=o.defaultValue(e,0);consta=r.Cartesian3.unpack(t,e,k);e+=r.Cartesian3.packedLength;consts=r.Ellipsoid.unpack(t,e,z);e+=r.Ellipsoid.packedLength;constl=y.VertexFormat.unpack(t,e,B);e+=y.VertexFormat.packedLength;constu=t[e++],m=t[e++],c=t[e++],p=t[e++],d=t[e++],f=t[e++],h=t[e++],A=1===t[e++],x=t[e];returno.defined(n)?(n._center=r.Cartesian3.clone(a,n._center),n._ellipsoid=r.Ellipsoid.clone(s,n._ellipsoid),n._vertexFormat=y.VertexFormat.clone(l,n._vertexFormat),n._semiMajorAxis=u,n._semiMinorAxis=m,n._rotation=c,n._stRotation=p,n._height=d,n._granularity=f,n._extrudedHeight=h,n._shadowVolume=A,n._offsetAttribute=-1===x?void0:x,n):(Y.height=d,Y.extrudedHeight=h,Y.granularity=f,Y.stRotation=p,Y.rotation=c,Y.semiMajorAxis=u,Y.semiMinorAxis=m,Y.shadowVolume=A,Y.offsetAttribute=-1===x?void0:x,newj(Y))},j.computeRectangle=function(t,e){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT);consta=t.center,s=o.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),l=t.semiMajorAxis,u=t.semiMinorAxis,m=o.defaultValue(t.granularity,n.CesiumMath.RADIANS_PER_DEGREE),c=o.defaultValue(t.rotation,0);if(i.Check.defined("options.center",a),i.Check.typeOf.number("options.semiMajorAxis",l),i.Check.typeOf.number("options.semiMinorAxis",u),l<u)thrownewi.DeveloperError("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(m<=0)thrownewi.DeveloperError("granularity must be greater than zero.");returnR(a,l,u,c,m,s,e)},j.createGeometry=function(t){if(t._semiMajorAxis<=0||t._semiMinorAxis<=0)return;conste=t._height,r=t._extrudedHeight,i=!n.CesiumMath.equalsEpsilon(e,r,0,n.CesiumMath.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);consta={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:e,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};letl;if(i)a.extrudedHeight=r,a.shadowVolume=t._shadowVolume,a.offsetAttribute=t._offsetAttribute,l=L(a);elseif(l=V(a),o.defined(t._offsetAttribute)){conste=l.attributes.position.values.length,r=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,i=newUint8Array(e/3).fill(r);l.attributes.applyOffset=news.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}returnnews.Geometry({attributes:l.attributes,indices:l.indices,primitiveType:s.PrimitiveType.TRIANGLES,boundingSphere:l.boundingSphere,offsetAttribute:t._offsetAttribute})},j.createShadowVolume=function(t,e,r){consti=t._granularity,n=t._ellipsoid,o=e(i,n),a=r(i,n);returnnewj({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:n,rotation:t._rotation,stRotation:t._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:y.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(j.prototype,{rectangle:{get:function(){returno.defined(this._rectangle)||(this._rectangle=R(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){returno.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=H(this)),this._textureCoordinateRotationPoints}}}),t.EllipseGeometry=j}));
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./RuntimeError-c581ca93","./EllipseGeometryLibrary-d3fe9678","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785"],(function(e,t,i,r,n,o,a,s,l,u,d){"use strict";constf=newi.Cartesian3;letc=newi.Cartesian3;functionp(e){constn=e.center;c=i.Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(n,c),e.height,c),c=i.Cartesian3.add(n,c,c);consto=newt.BoundingSphere(c,e.semiMajorAxis),u=a.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,f=newl.GeometryAttributes({position:news.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a.EllipseGeometryLibrary.raisePositionsToHeight(u,e,!1)})}),p=u.length/3,m=d.IndexDatatype.createTypedArray(p,2*p);leth=0;for(lett=0;t<p;++t)m[h++]=t,m[h++]=(t+1)%p;return{boundingSphere:o,attributes:f,indices:m}}constm=newt.BoundingSphere,h=newt.BoundingSphere;functiony(e){consto=e.center,c=e.ellipsoid,p=e.semiMajorAxis;lety=i.Cartesian3.multiplyByScalar(c.geodeticSurfaceNormal(o,f),e.height,f);m.center=i.Cartesian3.add(o,y,m.center),m.radius=p,y=i.Cartesian3.multiplyByScalar(c.geodeticSurfaceNormal(o,y),e.extrudedHeight,y),h.center=i.Cartesian3.add(o,y,h.center),h.radius=p;letb=a.EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions;constA=newl.GeometryAttributes({position:news.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a.EllipseGeometryLibrary.raisePositionsToHeight(b,e,!0)})});b=A.position.values;const_=t.BoundingSphere.union(m,h);letg=b.length/3;if(n.defined(e.offsetAttribute)){lett=newUint8Array(g);if(e.offsetAttribute===u.GeometryOffsetAttribute.TOP)t=t.fill(1,0,g/2);else{consti=e.offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1;t=t.fill(i)}A.applyOffset=news.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}letE=n.defaultValue(e.numberOfVerticalLines,16);E=r.CesiumMath.clamp(E,0,g/2);constx=d.IndexDatatype.createTypedArray(g,2*g+2*E);g/=2;letM,w,v=0;for(M=0;M<g;++M)x[v++]=M,x[v++]=(M+1)%g,x[v++]=M+g,x[v++]=(M+1)%g+g;if(E>0){conste=Math.min(E,g);w=Math.round(g/e);constt=Math.min(w*E,g);for(M=0;M<t;M+=w)x[v++]=M,x[v++]=M+g}return{boundingSphere:_,attributes:A,indices:x}}functionb(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);constt=e.center,a=n.defaultValue(e.ellipsoid,i.Ellipsoid.WGS84),s=e.semiMajorAxis,l=e.semiMinorAxis,u=n.defaultValue(e.granularity,r.CesiumMath.RADIANS_PER_DEGREE);if(!n.defined(t))thrownewo.DeveloperError("center is required.");if(!n.defined(s))thrownewo.DeveloperError("semiMajorAxis is required.");if(!n.defined(l))thrownewo.DeveloperError("semiMinorAxis is required.");if(s<l)thrownewo.DeveloperError("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(u<=0)thrownewo.DeveloperError("granularity must be greater than zero.");constd=n.defaultValue(e.height,0),f=n.defaultValue(e.extrudedHeight,d);this._center=i.Cartesian3.clone(t),this._semiMajorAxis=s,this._semiMinorAxis=l,this._ellipsoid=i.Ellipsoid.clone(a),this._rotation=n.defaultValue(e.rotation,0),this._height=Math.max(f,d),this._granularity=u,this._extrudedHeight=Math.min(f,d),this._numberOfVerticalLines=Math.max(n.defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}b.packedLength=i.Cartesian3.packedLength+i.Ellipsoid.packedLength+8,b.pack=function(e,t,r){if(!n.defined(e))thrownewo.DeveloperError("value is required");if(!n.defined(t))thrownewo.DeveloperError("array is required");returnr=n.defaultValue(r,0),i.Cartesian3.pack(e._center,t,r),r+=i.Cartesian3.packedLength,i.Ellipsoid.pack(e._ellipsoid,t,r),r+=i.Ellipsoid.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._numberOfVerticalLines,t[r]=n.defaultValue(e._offsetAttribute,-1),t};constA=newi.Cartesian3,_=newi.Ellipsoid,g={center:A,ellipsoid:_,semiMajorAxis:void0,semiMinorAxis:void0,rotation:void0,height:void0,granularity:void0,extrudedHeight:void0,numberOfVerticalLines:void0,offsetAttribute:void0};b.unpack=function(e,t,r){if(!n.defined(e))thrownewo.DeveloperError("array is required");t=n.defaultValue(t,0);consta=i.Cartesian3.unpack(e,t,A);t+=i.Cartesian3.packedLength;consts=i.Ellipsoid.unpack(e,t,_);t+=i.Ellipsoid.packedLength;constl=e[t++],u=e[t++],d=e[t++],f=e[t++],c=e[t++],p=e[t++],m=e[t++],h=e[t];returnn.defined(r)?(r._center=i.Cartesian3.clone(a,r._center),r._ellipsoid=i.Ellipsoid.clone(s,r._ellipsoid),r._semiMajorAxis=l,r._semiMinorAxis=u,r._rotation=d,r._height=f,r._granularity=c,r._extrudedHeight=p,r._numberOfVerticalLines=m,r._offsetAttribute=-1===h?void0:h,r):(g.height=f,g.extrudedHeight=p,g.granularity=c,g.rotation=d,g.semiMajorAxis=l,g.semiMinorAxis=u,g.numberOfVerticalLines=m,g.offsetAttribute=-1===h?void0:h,newb(g))},b.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;constt=e._height,i=e._extrudedHeight,o=!r.CesiumMath.equalsEpsilon(t,i,0,r.CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);consta={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};letl;if(o)a.extrudedHeight=i,a.offsetAttribute=e._offsetAttribute,l=y(a);elseif(l=p(a),n.defined(e._offsetAttribute)){constt=l.attributes.position.values.length,i=e._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,n=newUint8Array(t/3).fill(i);l.attributes.applyOffset=news.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}returnnews.Geometry({attributes:l.attributes,indices:l.indices,primitiveType:s.PrimitiveType.LINES,boundingSphere:l.boundingSphere,offsetAttribute:e._offsetAttribute})},e.EllipseOutlineGeometry=b}));
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785","./VertexFormat-e46f29d6"],(function(t,e,a,n,i,r,o,s,m,u,l){"use strict";constc=newa.Cartesian3,f=newa.Cartesian3,d=newa.Cartesian3,p=newa.Cartesian3,C=newa.Cartesian3,y=newa.Cartesian3(1,1,1),h=Math.cos,_=Math.sin;functionx(t){t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT);conste=i.defaultValue(t.radii,y),o=i.defaultValue(t.innerRadii,e),s=i.defaultValue(t.minimumClock,0),m=i.defaultValue(t.maximumClock,n.CesiumMath.TWO_PI),u=i.defaultValue(t.minimumCone,0),c=i.defaultValue(t.maximumCone,n.CesiumMath.PI),f=Math.round(i.defaultValue(t.stackPartitions,64)),d=Math.round(i.defaultValue(t.slicePartitions,64)),p=i.defaultValue(t.vertexFormat,l.VertexFormat.DEFAULT);if(d<3)thrownewr.DeveloperError("options.slicePartitions cannot be less than three.");if(f<3)thrownewr.DeveloperError("options.stackPartitions cannot be less than three.");this._radii=a.Cartesian3.clone(e),this._innerRadii=a.Cartesian3.clone(o),this._minimumClock=s,this._maximumClock=m,this._minimumCone=u,this._maximumCone=c,this._stackPartitions=f,this._slicePartitions=d,this._vertexFormat=l.VertexFormat.clone(p),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*a.Cartesian3.packedLength+l.VertexFormat.packedLength+7,x.pack=function(t,e,n){if(!i.defined(t))thrownewr.DeveloperError("value is required");if(!i.defined(e))thrownewr.DeveloperError("array is required");returnn=i.defaultValue(n,0),a.Cartesian3.pack(t._radii,e,n),n+=a.Cartesian3.packedLength,a.Cartesian3.pack(t._innerRadii,e,n),n+=a.Cartesian3.packedLength,l.VertexFormat.pack(t._vertexFormat,e,n),n+=l.VertexFormat.packedLength,e[n++]=t._minimumClock,e[n++]=t._maximumClock,e[n++]=t._minimumCone,e[n++]=t._maximumCone,e[n++]=t._stackPartitions,e[n++]=t._slicePartitions,e[n]=i.defaultValue(t._offsetAttribute,-1),e};constA=newa.Cartesian3,b=newa.Cartesian3,w=newl.VertexFormat,k={radii:A,innerRadii:b,vertexFormat:w,minimumClock:void0,maximumClock:void0,minimumCone:void0,maximumCone:void0,stackPartitions:void0,slicePartitions:void0,offsetAttribute:void0};letv;x.unpack=function(t,e,n){if(!i.defined(t))thrownewr.DeveloperError("array is required");e=i.defaultValue(e,0);consto=a.Cartesian3.unpack(t,e,A);e+=a.Cartesian3.packedLength;consts=a.Cartesian3.unpack(t,e,b);e+=a.Cartesian3.packedLength;constm=l.VertexFormat.unpack(t,e,w);e+=l.VertexFormat.packedLength;constu=t[e++],c=t[e++],f=t[e++],d=t[e++],p=t[e++],C=t[e++],y=t[e];returni.defined(n)?(n._radii=a.Cartesian3.clone(o,n._radii),n._innerRadii=a.Cartesian3.clone(s,n._innerRadii),n._vertexFormat=l.VertexFormat.clone(m,n._vertexFormat),n._minimumClock=u,n._maximumClock=c,n._minimumCone=f,n._maximumCone=d,n._stackPartitions=p,n._slicePartitions=C,n._offsetAttribute=-1===y?void0:y,n):(k.minimumClock=u,k.maximumClock=c,k.minimumCone=f,k.maximumCone=d,k.stackPartitions=p,k.slicePartitions=C,k.offsetAttribute=-1===y?void0:y,newx(k))},x.createGeometry=function(t){constr=t._radii;if(r.x<=0||r.y<=0||r.z<=0)return;constl=t._innerRadii;if(l.x<=0||l.y<=0||l.z<=0)return;consty=t._minimumClock,x=t._maximumClock,A=t._minimumCone,b=t._maximumCone,w=t._vertexFormat;letk,v,P=t._slicePartitions+1,g=t._stackPartitions+1;P=Math.round(P*Math.abs(x-y)/n.CesiumMath.TWO_PI),g=Math.round(g*Math.abs(b-A)/n.CesiumMath.PI),P<2&&(P=2),g<2&&(g=2);letF=0;constV=[A],D=[y];for(k=0;k<g;k++)V.push(A+k*(b-A)/(g-1));for(V.push(b),v=0;v<P;v++)D.push(y+v*(x-y)/(P-1));D.push(x);constE=V.length,M=D.length;letT=0,G=1;constL=l.x!==r.x||l.y!==r.y||l.z!==r.z;letO=!1,I=!1,z=!1;L&&(G=2,A>0&&(O=!0,T+=P-1),b<Math.PI&&(I=!0,T+=P-1),(x-y)%n.CesiumMath.TWO_PI?(z=!0,T+=2*(g-1)+1):T+=1);constN=M*E*G,R=newFloat64Array(3*N),U=newArray(N).fill(!1),S=newArray(N).fill(!1),B=P*g*G,W=6*(B+T+1-(P+g)*G),q=u.IndexDatatype.createTypedArray(B,W),Y=w.normal?newFloat32Array(3*N):void0,J=w.tangent?newFloat32Array(3*N):void0,X=w.bitangent?newFloat32Array(3*N):void0,Z=w.st?newFloat32Array(2*N):void0,j=newArray(E),H=newArray(E);for(k=0;k<E;k++)j[k]=_(V[k]),H[k]=h(V[k]);constK=newArray(M),Q=newArray(M);for(v=0;v<M;v++)Q[v]=h(D[v]),K[v]=_(D[v]);for(k=0;k<E;k++)for(v=0;v<M;v++)R[F++]=r.x*j[k]*Q[v],R[F++]=r.y*j[k]*K[v],R[F++]=r.z*H[k];let$,tt,et,at,nt=N/2;if(L)for(k=0;k<E;k++)for(v=0;v<M;v++)R[F++]=l.x*j[k]*Q[v],R[F++]=l.y*j[k]*K[v],R[F++]=l.z*H[k],U[nt]=!0,k>0&&k!==E-1&&0!==v&&v!==M-1&&(S[nt]=!0),nt++;for(F=0,k=1;k<E-2;k++)for($=k*M,tt=(k+1)*M,v=1;v<M-2;v++)q[F++]=tt+v,q[F++]=tt+v+1,q[F++]=$+v+1,q[F++]=tt+v,q[F++]=$+v+1,q[F++]=$+v;if(L){constt=E*M;for(k=1;k<E-2;k++)for($=t+k*M,tt=t+(k+1)*M,v=1;v<M-2;v++)q[F++]=tt+v,q[F++]=$+v,q[F++]=$+v+1,q[F++]=tt+v,q[F++]=$+v+1,q[F++]=tt+v+1}if(L){if(O)for(at=E*M,k=1;k<M-2;k++)q[F++]=k,q[F++]=k+1,q[F++]=at+k+1,q[F++]=k,q[F++]=at+k+1,q[F++]=at+k;if(I)for(et=E*M-M,at=E*M*G-M,k=1;k<M-2;k++)q[F++]=et+k+1,q[F++]=et+k,q[F++]=at+k,q[F++]=et+k+1,q[F++]=at+k,q[F++]=at+k+1}if(z){for(k=1;k<E-2;k++)at=M*E+M*k,et=M*k,q[F++]=at,q[F++]=et+M,q[F++]=et,q[F++]=at,q[F++]=at+M,q[F++]=et+M;for(k=1;k<E-2;k++)at=M*E+M*(k+1)-1,et=M*(k+1)-1,q[F++]=et+M,q[F++]=at,q[F++]=et,q[F++]=et+M,q[F++]=at+M,q[F++]=at}constit=news.GeometryAttributes;w.position&&(it.position=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:R}));letrt=0,ot=0,st=0,mt=0;constut=N/2;letlt;constct=a.Ellipsoid.fromCartesian3(r),ft=a.Ellipsoid.fromCartesian3(l);if(w.st||w.normal||w.tangent||w.bitangent){for(k=0;k<N;k++){lt=U[k]?ft:ct;constt=a.Cartesian3.fromArray(R,3*k,c),e=lt.geodeticSurfaceNormal(t,f);if(S[k]&&a.Cartesian3.negate(e,e),w.st){constt=a.Cartesian2.negate(e,C);Z[rt++]=Math.atan2(t.y,t.x)/n.CesiumMath.TWO_PI+.5,Z[rt++]=Math.asin(e.z)/Math.PI+.5}if(w.normal&&(Y[ot++]=e.x,Y[ot++]=e.y,Y[ot++]=e.z),w.tangent||w.bitangent){constt=d;letn,i=0;if(U[k]&&(i=ut),n=!O&&k>=i&&k<i+2*M?a.Cartesian3.UNIT_X:a.Cartesian3.UNIT_Z,a.Cartesian3.cross(n,e,t),a.Cartesian3.normalize(t,t),w.tangent&&(J[st++]=t.x,J[st++]=t.y,J[st++]=t.z),w.bitangent){constn=a.Cartesian3.cross(e,t,p);a.Cartesian3.normalize(n,n),X[mt++]=n.x,X[mt++]=n.y,X[mt++]=n.z}}}w.st&&(it.st=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:Z})),w.normal&&(it.normal=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:Y})),w.tangent&&(it.tangent=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:J})),w.bitangent&&(it.bitangent=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:X}))}if(i.defined(t._offsetAttribute)){conste=R.length,a=t._offsetAttribute===m.GeometryOffsetAttribute.NONE?0:1,i=newUint8Array(e/3).fill(a);it.applyOffset=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}returnnewo.Geometry({attributes:it,indices:q,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:e.BoundingSphere.fromEllipsoid(ct),offsetAttribute:t._offsetAttribute})},x.getUnitEllipsoid=function(){returni.defined(v)||(v=x.createGeometry(newx({radii:newa.Cartesian3(1,1,1),vertexFormat:l.VertexFormat.POSITION_ONLY}))),v},t.EllipsoidGeometry=x}));
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785"],(function(t,e,i,r,o,n,a,s,u,m){"use strict";constf=newi.Cartesian3(1,1,1),l=Math.cos,d=Math.sin;functionc(t){t=o.defaultValue(t,o.defaultValue.EMPTY_OBJECT);conste=o.defaultValue(t.radii,f),a=o.defaultValue(t.innerRadii,e),s=o.defaultValue(t.minimumClock,0),m=o.defaultValue(t.maximumClock,r.CesiumMath.TWO_PI),l=o.defaultValue(t.minimumCone,0),d=o.defaultValue(t.maximumCone,r.CesiumMath.PI),c=Math.round(o.defaultValue(t.stackPartitions,10)),p=Math.round(o.defaultValue(t.slicePartitions,8)),C=Math.round(o.defaultValue(t.subdivisions,128));if(c<1)thrownewn.DeveloperError("options.stackPartitions cannot be less than 1");if(p<0)thrownewn.DeveloperError("options.slicePartitions cannot be less than 0");if(C<0)thrownewn.DeveloperError("options.subdivisions must be greater than or equal to zero.");if(o.defined(t.offsetAttribute)&&t.offsetAttribute===u.GeometryOffsetAttribute.TOP)thrownewn.DeveloperError("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=i.Cartesian3.clone(e),this._innerRadii=i.Cartesian3.clone(a),this._minimumClock=s,this._maximumClock=m,this._minimumCone=l,this._maximumCone=d,this._stackPartitions=c,this._slicePartitions=p,this._subdivisions=C,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}c.packedLength=2*i.Cartesian3.packedLength+8,c.pack=function(t,e,r){if(!o.defined(t))thrownewn.DeveloperError("value is required");if(!o.defined(e))thrownewn.DeveloperError("array is required");returnr=o.defaultValue(r,0),i.Cartesian3.pack(t._radii,e,r),r+=i.Cartesian3.packedLength,i.Cartesian3.pack(t._innerRadii,e,r),r+=i.Cartesian3.packedLength,e[r++]=t._minimumClock,e[r++]=t._maximumClock,e[r++]=t._minimumCone,e[r++]=t._maximumCone,e[r++]=t._stackPartitions,e[r++]=t._slicePartitions,e[r++]=t._subdivisions,e[r]=o.defaultValue(t._offsetAttribute,-1),e};constp=newi.Cartesian3,C=newi.Cartesian3,h={radii:p,innerRadii:C,minimumClock:void0,maximumClock:void0,minimumCone:void0,maximumCone:void0,stackPartitions:void0,slicePartitions:void0,subdivisions:void0,offsetAttribute:void0};c.unpack=function(t,e,r){if(!o.defined(t))thrownewn.DeveloperError("array is required");e=o.defaultValue(e,0);consta=i.Cartesian3.unpack(t,e,p);e+=i.Cartesian3.packedLength;consts=i.Cartesian3.unpack(t,e,C);e+=i.Cartesian3.packedLength;constu=t[e++],m=t[e++],f=t[e++],l=t[e++],d=t[e++],_=t[e++],b=t[e++],y=t[e];returno.defined(r)?(r._radii=i.Cartesian3.clone(a,r._radii),r._innerRadii=i.Cartesian3.clone(s,r._innerRadii),r._minimumClock=u,r._maximumClock=m,r._minimumCone=f,r._maximumCone=l,r._stackPartitions=d,r._slicePartitions=_,r._subdivisions=b,r._offsetAttribute=-1===y?void0:y,r):(h.minimumClock=u,h.maximumClock=m,h.minimumCone=f,h.maximumCone=l,h.stackPartitions=d,h.slicePartitions=_,h.subdivisions=b,h.offsetAttribute=-1===y?void0:y,newc(h))},c.createGeometry=function(t){constn=t._radii;if(n.x<=0||n.y<=0||n.z<=0)return;constf=t._innerRadii;if(f.x<=0||f.y<=0||f.z<=0)return;constc=t._minimumClock,p=t._maximumClock,C=t._minimumCone,h=t._maximumCone,_=t._subdivisions,b=i.Ellipsoid.fromCartesian3(n);lety=t._slicePartitions+1,k=t._stackPartitions+1;y=Math.round(y*Math.abs(p-c)/r.CesiumMath.TWO_PI),k=Math.round(k*Math.abs(h-C)/r.CesiumMath.PI),y<2&&(y=2),k<2&&(k=2);letA=0,v=1;constw=f.x!==n.x||f.y!==n.y||f.z!==n.z;letP=!1,x=!1;w&&(v=2,C>0&&(P=!0,A+=y),h<Math.PI&&(x=!0,A+=y));constE=_*v*(k+y),D=newFloat64Array(3*E),M=2*(E+A-(y+k)*v),g=m.IndexDatatype.createTypedArray(E,M);letV,G,O,T,z=0;constI=newArray(k),L=newArray(k);for(V=0;V<k;V++)T=C+V*(h-C)/(k-1),I[V]=d(T),L[V]=l(T);constR=newArray(_),N=newArray(_);for(V=0;V<_;V++)O=c+V*(p-c)/(_-1),R[V]=d(O),N[V]=l(O);for(V=0;V<k;V++)for(G=0;G<_;G++)D[z++]=n.x*I[V]*N[G],D[z++]=n.y*I[V]*R[G],D[z++]=n.z*L[V];if(w)for(V=0;V<k;V++)for(G=0;G<_;G++)D[z++]=f.x*I[V]*N[G],D[z++]=f.y*I[V]*R[G],D[z++]=f.z*L[V];for(I.length=_,L.length=_,V=0;V<_;V++)T=C+V*(h-C)/(_-1),I[V]=d(T),L[V]=l(T);for(R.length=y,N.length=y,V=0;V<y;V++)O=c+V*(p-c)/(y-1),R[V]=d(O),N[V]=l(O);for(V=0;V<_;V++)for(G=0;G<y;G++)D[z++]=n.x*I[V]*N[G],D[z++]=n.y*I[V]*R[G],D[z++]=n.z*L[V];if(w)for(V=0;V<_;V++)for(G=0;G<y;G++)D[z++]=f.x*I[V]*N[G],D[z++]=f.y*I[V]*R[G],D[z++]=f.z*L[V];for(z=0,V=0;V<k*v;V++){constt=V*_;for(G=0;G<_-1;G++)g[z++]=t+G,g[z++]=t+G+1}letq=k*_*v;for(V=0;V<y;V++)for(G=0;G<_-1;G++)g[z++]=q+V+G*y,g[z++]=q+V+(G+1)*y;if(w)for(q=k*_*v+y*_,V=0;V<y;V++)for(G=0;G<_-1;G++)g[z++]=q+V+G*y,g[z++]=q+V+(G+1)*y;if(w){lett=k*_*v,e=t+_*y;if(P)for(V=0;V<y;V++)g[z++]=t+V,g[z++]=e+V;if(x)for(t+=_*y-y,e+=_*y-y,V=0;V<y;V++)g[z++]=t+V,g[z++]=e+V}constB=news.GeometryAttributes({position:newa.GeometryAttribute({componentDatatype:r.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:D})});if(o.defined(t._offsetAttribute)){conste=D.length,i=t._offsetAttribute===u.GeometryOffsetAttribute.NONE?0:1,o=newUint8Array(e/3).fill(i);B.applyOffset=newa.GeometryAttribute({componentDatatype:r.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:o})}returnnewa.Geometry({attributes:B,indices:g,primitiveType:a.PrimitiveType.LINES,boundingSphere:e.BoundingSphere.fromEllipsoid(b),offsetAttribute:t._offsetAttribute})},t.EllipsoidOutlineGeometry=c}));
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./ComponentDatatype-4a60b8d6"],(function(t,i,e,a,n){"use strict";functions(t,i,e){if(0===t)returni*e;consta=t*t,n=a*a,s=n*a,h=s*a,u=h*a,o=u*a,d=e,r=Math.sin(2*d),c=Math.sin(4*d),l=Math.sin(6*d),M=Math.sin(8*d),m=Math.sin(10*d),_=Math.sin(12*d);returni*((1-a/4-3*n/64-5*s/256-175*h/16384-441*u/65536-4851*o/1048576)*d-(3*a/8+3*n/32+45*s/1024+105*h/4096+2205*u/131072+6237*o/524288)*r+(15*n/256+45*s/1024+525*h/16384+1575*u/65536+155925*o/8388608)*c-(35*s/3072+175*h/12288+3675*u/262144+13475*o/1048576)*l+(315*h/131072+2205*u/524288+43659*o/8388608)*M-(693*u/1310720+6237*o/5242880)*m+1001*o/8388608*_)}functionh(t,i,e){consta=t/e;if(0===i)returna;constn=a*a,s=n*a,h=s*a,u=i,o=u*u,d=o*o,r=d*o,c=r*o,l=c*o,M=l*o,m=Math.sin(2*a),_=Math.cos(2*a),g=Math.sin(4*a),p=Math.cos(4*a),f=Math.sin(6*a),C=Math.cos(6*a),P=Math.sin(8*a),E=Math.cos(8*a),O=Math.sin(10*a),y=Math.cos(10*a),I=Math.sin(12*a);returna+a*o/4+7*a*d/64+15*a*r/256+579*a*c/16384+1515*a*l/65536+16837*a*M/1048576+(3*a*d/16+45*a*r/256-a*(32*n-561)*c/4096-a*(232*n-1677)*l/16384+a*(399985-90560*n+512*h)*M/5242880)*_+(21*a*r/256+483*a*c/4096-a*(224*n-1969)*l/16384-a*(33152*n-112599)*M/1048576)*p+(151*a*c/4096+4681*a*l/65536+1479*a*M/16384-453*s*M/32768)*C+(1097*a*l/65536+42783*a*M/1048576)*E+8011*a*M/1048576*y+(3*o/8+3*d/16+213*r/2048-3*n*r/64+255*c/4096-33*n*c/512+20861*l/524288-33*n*l/512+h*l/1024+28273*M/1048576-471*n*M/8192+9*h*M/4096)*m+(21*d/256+21*r/256+533*c/8192-21*n*c/512+197*l/4096-315*n*l/4096+584039*M/16777216-12517*n*M/131072+7*h*M/2048)*g+(151*r/6144+151*c/4096+5019*l/131072-453*n*l/16384+26965*M/786432-8607*n*M/131072)*f+(1097*c/131072+1097*l/65536+225797*M/10485760-1097*n*M/65536)*P+(8011*l/2621440+8011*M/1048576)*O+293393*M/251658240*I}functionu(t,i){if(0===t)returnMath.log(Math.tan(.5*(n.CesiumMath.PI_OVER_TWO+i)));conste=t*Math.sin(i);returnMath.log(Math.tan(.5*(n.CesiumMath.PI_OVER_TWO+i)))-t/2*Math.log((1+e)/(1-e))}functiono(t,i,e,a,s){consth=u(t._ellipticity,e),o=u(t._ellipticity,s);returnMath.atan2(n.CesiumMath.negativePiToPi(a-i),o-h)}functiond(t,i,e,a,h,u,o){constd=t._heading,r=u-a;letc=0;if(n.CesiumMath.equalsEpsilon(Math.abs(d),n.CesiumMath.PI_OVER_TWO,n.CesiumMath.EPSILON8))if(i===e)c=i*Math.cos(h)*n.CesiumMath.negativePiToPi(r);else{conste=Math.sin(h);c=i*Math.cos(h)*n.CesiumMath.negativePiToPi(r)/Math.sqrt(1-t._ellipticitySquared*e*e)}else{conste=s(t._ellipticity,i,h),a=s(t._ellipticity,i,o);c=(a-e)/Math.cos(d)}returnMath.abs(c)}constr=newi.Cartesian3,c=newi.Cartesian3;functionl(t,a,n,s){consth=i.Cartesian3.normalize(s.cartographicToCartesian(a,c),r),u=i.Cartesian3.normalize(s.cartographicToCartesian(n,c),c);e.Check.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(i.Cartesian3.angleBetween(h,u))-Math.PI),.0125);constl=s.maximumRadius,M=s.minimumRadius,m=l*l,_=M*M;t._ellipticitySquared=(m-_)/m,t._ellipticity=Math.sqrt(t._ellipticitySquared),t._start=i.Cartographic.clone(a,t._start),t._start.height=0,t._end=i.Cartographic.clone(n,t._end),t._end.height=0,t._heading=o(t,a.longitude,a.latitude,n.longitude,n.latitude),t._distance=d(t,s.maximumRadius,s.minimumRadius,a.longitude,a.latitude,n.longitude,n.latitude)}functionM(t,e,o,d,r,c){if(0===o)returni.Cartographic.clone(t,c);constl=r*r;letM,m,_;if(Math.abs(n.CesiumMath.PI_OVER_TWO-Math.abs(e))>n.CesiumMath.EPSILON8){consti=s(r,d,t.latitude),a=o*Math.cos(e),c=i+a;m=h(c,r,d);constl=u(r,t.latitude),g=u(r,m);_=Math.tan(e)*(g-l),M=n.CesiumMath.negativePiToPi(t.longitude+_)}else{leti;if(m=t.latitude,0===r)i=d*Math.cos(t.latitude);else{conste=Math.sin(t.latitude);i=d*Math.cos(t.latitude)/Math.sqrt(1-l*e*e)}_=o/i,M=e>0?n.CesiumMath.negativePiToPi(t.longitude+_):n.CesiumMath.negativePiToPi(t.longitude-_)}returna.defined(c)?(c.longitude=M,c.latitude=m,c.height=0,c):newi.Cartographic(M,m,0)}functionm(t,e,n){consts=a.defaultValue(n,i.Ellipsoid.WGS84);this._ellipsoid=s,this._start=newi.Cartographic,this._end=newi.Cartographic,this._heading=void0,this._distance=void0,this._ellipticity=void0,this._ellipticitySquared=void0,a.defined(t)&&a.defined(e)&&l(this,t,e,s)}Object.defineProperties(m.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},surfaceDistance:{get:function(){returne.Check.defined("distance",this._distance),this._distance}},start:{get:function(){returnthis._start}},end:{get:function(){returnthis._end}},heading:{get:function(){returne.Check.defined("distance",this._distance),this._heading}}}),m.fromStartHeadingDistance=function(t,s,h,u,o){e.Check.defined("start",t),e.Check.defined("heading",s),e.Check.defined("distance",h),e.Check.typeOf.number.greaterThan("distance",h,0);constd=a.defaultValue(u,i.Ellipsoid.WGS84),r=d.maximumRadius,c=d.minimumRadius,l=r*r,_=c*c,g=Math.sqrt((l-_)/l);s=n.CesiumMath.negativePiToPi(s);constp=M(t,s,h,d.maximumRadius,g);return!a.defined(o)||a.defined(u)&&!u.equals(o.ellipsoid)?newm(t,p,d):(o.setEndPoints(t,p),o)},m.prototype.setEndPoints=function(t,i){e.Check.defined("start",t),e.Check.defined("end",i),l(this,t,i,this._ellipsoid)},m.prototype.interpolateUsingFraction=function(t,i){returnthis.interpolateUsingSurfaceDistance(t*this._distance,i)},m.prototype.interpolateUsingSurfaceDistance=function(t,i){if(e.Check.typeOf.number("distance",t),!a.defined(this._distance)||0===this._distance)thrownewe.DeveloperError("EllipsoidRhumbLine must have distinct start and end set.");returnM(this._start,this._heading,t,this._ellipsoid.maximumRadius,this._ellipticity,i)},m.prototype.findIntersectionWithLongitude=function(t,s){if(e.Check.typeOf.number("intersectionLongitude",t),!a.defined(this._distance)||0===this._distance)thrownewe.DeveloperError("EllipsoidRhumbLine must have distinct start and end set.");consth=this._ellipticity,u=this._heading,o=Math.abs(u),d=this._start;if(t=n.CesiumMath.negativePiToPi(t),n.CesiumMath.equalsEpsilon(Math.abs(t),Math.PI,n.CesiumMath.EPSILON14)&&(t=n.CesiumMath.sign(d.longitude)*Math.PI),a.defined(s)||(s=newi.Cartographic),Math.abs(n.CesiumMath.PI_OVER_TWO-o)<=n.CesiumMath.EPSILON8)returns.longitude=t,s.latitude=d.latitude,s.height=0,s;if(n.CesiumMath.equalsEpsilon(Math.abs(n.CesiumMath.PI_OVER_TWO-o),n.CesiumMath.PI_OVER_TWO,n.CesiumMath.EPSILON8)){if(n.CesiumMath.equalsEpsilon(t,d.longitude,n.CesiumMath.EPSILON12))return;returns.longitude=t,s.latitude=n.CesiumMath.PI_OVER_TWO*n.CesiumMath.sign(n.CesiumMath.PI_OVER_TWO-u),s.height=0,s}constr=d.latitude,c=h*Math.sin(r),l=Math.tan(.5*(n.CesiumMath.PI_OVER_TWO+r))*Math.exp((t-d.longitude)/Math.tan(u)),M=(1+c)/(1-c);letm,_=d.latitude;do{m=_;constt=h*Math.sin(m),i=(1+t)/(1-t);_=2*Math.atan(l*Math.pow(i/M,h/2))-n.CesiumMath.PI_OVER_TWO}while(!n.CesiumMath.equalsEpsilon(_,m,n.CesiumMath.EPSILON12));returns.longitude=t,s.latitude=_,s.height=0,s},m.prototype.findIntersectionWithLatitude=function(t,s){if(e.Check.typeOf.number("intersectionLatitude",t),!a.defined(this._distance)||0===this._distance)thrownewe.DeveloperError("EllipsoidRhumbLine must have distinct start and end set.");consth=this._ellipticity,o=this._heading,d=this._start;if(n.CesiumMath.equalsEpsilon(Math.abs(o),n.CesiumMath.PI_OVER_TWO,n.CesiumMath.EPSILON8))return;constr=u(h,d.latitude),c=u(h,t),l=Math.tan(o)*(c-r),M=n.CesiumMath.negativePiToPi(d.longitude+l);returna.defined(s)?(s.longitude=M,s.latitude=t,s.height=0,s):newi.Cartographic(M,t,0)},t.EllipsoidRhumbLine=m}));
define(["exports","./AxisAlignedBoundingBox-7a3018c0","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./IntersectionTests-68fbc42d","./Plane-e20fba8c","./Transforms-3ac41eb6"],(function(e,t,n,i,o,r,s,a){"use strict";constc=newn.Cartesian4;functionl(e,t){if(i.Check.defined("origin",e),t=o.defaultValue(t,n.Ellipsoid.WGS84),e=t.scaleToGeodeticSurface(e),!o.defined(e))thrownewi.DeveloperError("origin must not be at the center of the ellipsoid.");constr=a.Transforms.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(r,0,c)),this._yAxis=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(r,1,c));constl=n.Cartesian3.fromCartesian4(n.Matrix4.getColumn(r,2,c));this._plane=s.Plane.fromPointNormal(e,l)}Object.defineProperties(l.prototype,{ellipsoid:{get:function(){returnthis._ellipsoid}},origin:{get:function(){returnthis._origin}},plane:{get:function(){returnthis._plane}},xAxis:{get:function(){returnthis._xAxis}},yAxis:{get:function(){returnthis._yAxis}},zAxis:{get:function(){returnthis._plane.normal}}});constd=newt.AxisAlignedBoundingBox;l.fromPoints=function(e,n){i.Check.defined("cartesians",e);consto=t.AxisAlignedBoundingBox.fromPoints(e,d);returnnewl(o.center,n)};constf=newr.Ray,p=newn.Cartesian3;l.prototype.projectPointOntoPlane=function(e,t){i.Check.defined("cartesian",e);consts=f;s.origin=e,n.Cartesian3.normalize(e,s.direction);leta=r.IntersectionTests.rayPlane(s,this._plane,p);if(o.defined(a)||(n.Cartesian3.negate(s.direction,s.direction),a=r.IntersectionTests.rayPlane(s,this._plane,p)),o.defined(a)){conste=n.Cartesian3.subtract(a,this._origin,a),i=n.Cartesian3.dot(this._xAxis,e),r=n.Cartesian3.dot(this._yAxis,e);returno.defined(t)?(t.x=i,t.y=r,t):newn.Cartesian2(i,r)}},l.prototype.projectPointsOntoPlane=function(e,t){i.Check.defined("cartesians",e),o.defined(t)||(t=[]);letn=0;constr=e.length;for(leti=0;i<r;i++){constr=this.projectPointOntoPlane(e[i],t[n]);o.defined(r)&&(t[n]=r,n++)}returnt.length=n,t},l.prototype.projectPointToNearestOnPlane=function(e,t){i.Check.defined("cartesian",e),o.defined(t)||(t=newn.Cartesian2);consts=f;s.origin=e,n.Cartesian3.clone(this._plane.normal,s.direction);leta=r.IntersectionTests.rayPlane(s,this._plane,p);o.defined(a)||(n.Cartesian3.negate(s.direction,s.direction),a=r.IntersectionTests.rayPlane(s,this._plane,p));constc=n.Cartesian3.subtract(a,this._origin,a),l=n.Cartesian3.dot(this._xAxis,c),d=n.Cartesian3.dot(this._yAxis,c);returnt.x=l,t.y=d,t},l.prototype.projectPointsToNearestOnPlane=function(e,t){i.Check.defined("cartesians",e),o.defined(t)||(t=[]);constn=e.length;t.length=n;for(leti=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);returnt};consth=newn.Cartesian3;l.prototype.projectPointOntoEllipsoid=function(e,t){i.Check.defined("cartesian",e),o.defined(t)||(t=newn.Cartesian3);constr=this._ellipsoid,s=this._origin,a=this._xAxis,c=this._yAxis,l=h;returnn.Cartesian3.multiplyByScalar(a,e.x,l),t=n.Cartesian3.add(s,l,t),n.Cartesian3.multiplyByScalar(c,e.y,l),n.Cartesian3.add(t,l,t),r.scaleToGeocentricSurface(t,t),t},l.prototype.projectPointsOntoEllipsoid=function(e,t){i.Check.defined("cartesians",e);constn=e.length;o.defined(t)?t.length=n:t=newArray(n);for(leti=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);returnt},e.EllipsoidTangentPlane=l}));
define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./Plane-e20fba8c","./VertexFormat-e46f29d6"],(function(e,t,r,i,n,a,o,s,f,u){"use strict";functiond(e){this.planes=a.defaultValue(e,[])}constl=[newr.Cartesian3,newr.Cartesian3,newr.Cartesian3];r.Cartesian3.clone(r.Cartesian3.UNIT_X,l[0]),r.Cartesian3.clone(r.Cartesian3.UNIT_Y,l[1]),r.Cartesian3.clone(r.Cartesian3.UNIT_Z,l[2]);consth=newr.Cartesian3,p=newr.Cartesian3,c=newf.Plane(newr.Cartesian3(1,0,0),0);functionm(e){e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT),this.left=e.left,this._left=void0,this.right=e.right,this._right=void0,this.top=e.top,this._top=void0,this.bottom=e.bottom,this._bottom=void0,this.near=a.defaultValue(e.near,1),this._near=this.near,this.far=a.defaultValue(e.far,5e8),this._far=this.far,this._cullingVolume=newd,this._orthographicMatrix=newr.Matrix4}functionC(e){if(!a.defined(e.right)||!a.defined(e.left)||!a.defined(e.top)||!a.defined(e.bottom)||!a.defined(e.near)||!a.defined(e.far))thrownewi.DeveloperError("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)thrownewi.DeveloperError("right must be greater than left.");if(e.bottom>e.top)thrownewi.DeveloperError("top must be greater than bottom.");if(e.near<=0||e.near>e.far)thrownewi.DeveloperError("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=r.Matrix4.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}d.fromBoundingSphere=function(e,t){if(!a.defined(e))thrownewi.DeveloperError("boundingSphere is required.");a.defined(t)||(t=newd);constn=l.length,o=t.planes;o.length=2*n;consts=e.center,f=e.radius;letu=0;for(leti=0;i<n;++i){conste=l[i];lett=o[u],n=o[u+1];a.defined(t)||(t=o[u]=newr.Cartesian4),a.defined(n)||(n=o[u+1]=newr.Cartesian4),r.Cartesian3.multiplyByScalar(e,-f,h),r.Cartesian3.add(s,h,h),t.x=e.x,t.y=e.y,t.z=e.z,t.w=-r.Cartesian3.dot(e,h),r.Cartesian3.multiplyByScalar(e,f,h),r.Cartesian3.add(s,h,h),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-r.Cartesian3.dot(r.Cartesian3.negate(e,p),h),u+=2}returnt},d.prototype.computeVisibility=function(e){if(!a.defined(e))thrownewi.DeveloperError("boundingVolume is required.");constr=this.planes;letn=!1;for(leti=0,a=r.length;i<a;++i){consta=e.intersectPlane(f.Plane.fromCartesian4(r[i],c));if(a===t.Intersect.OUTSIDE)returnt.Intersect.OUTSIDE;a===t.Intersect.INTERSECTING&&(n=!0)}returnn?t.Intersect.INTERSECTING:t.Intersect.INSIDE},d.prototype.computeVisibilityWithPlaneMask=function(e,r){if(!a.defined(e))thrownewi.DeveloperError("boundingVolume is required.");if(!a.defined(r))thrownewi.DeveloperError("parentPlaneMask is required.");if(r===d.MASK_OUTSIDE||r===d.MASK_INSIDE)returnr;letn=d.MASK_INSIDE;consto=this.planes;for(leti=0,a=o.length;i<a;++i){consta=i<31?1<<i:0;if(i<31&&0===(r&a))continue;consts=e.intersectPlane(f.Plane.fromCartesian4(o[i],c));if(s===t.Intersect.OUTSIDE)returnd.MASK_OUTSIDE;s===t.Intersect.INTERSECTING&&(n|=a)}returnn},d.MASK_OUTSIDE=4294967295,d.MASK_INSIDE=0,d.MASK_INDETERMINATE=2147483647,Object.defineProperties(m.prototype,{projectionMatrix:{get:function(){returnC(this),this._orthographicMatrix}}});constw=newr.Cartesian3,_=newr.Cartesian3,y=newr.Cartesian3,g=newr.Cartesian3;functionv(e){e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=newm,this.width=e.width,this._width=void0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void0,this.near=a.defaultValue(e.near,1),this._near=this.near,this.far=a.defaultValue(e.far,5e8),this._far=this.far}functionx(e){if(!a.defined(e.width)||!a.defined(e.aspectRatio)||!a.defined(e.near)||!a.defined(e.far))thrownewi.DeveloperError("width, aspectRatio, near, or far parameters are not set.");constt=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)thrownewi.DeveloperError("aspectRatio must be positive.");if(e.near<0||e.near>e.far)thrownewi.DeveloperError("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;constr=1/e.aspectRatio;t.right=.5*e.width,t.left=-t.right,t.top=r*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}functionb(e){e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT),this.left=e.left,this._left=void0,this.right=e.right,this._right=void0,this.top=e.top,this._top=void0,this.bottom=e.bottom,this._bottom=void0,this.near=a.defaultValue(e.near,1),this._near=this.near,this.far=a.defaultValue(e.far,5e8),this._far=this.far,this._cullingVolume=newd,this._perspectiveMatrix=newr.Matrix4,this._infinitePerspective=newr.Matrix4}functionE(e){if(!a.defined(e.right)||!a.defined(e.left)||!a.defined(e.top)||!a.defined(e.bottom)||!a.defined(e.near)||!a.defined(e.far))thrownewi.DeveloperError("right, left, top, bottom, near, or far parameters are not set.");constt=e.top,n=e.bottom,o=e.right,s=e.left,f=e.near,u=e.far;if(t!==e._top||n!==e._bottom||s!==e._left||o!==e._right||f!==e._near||u!==e._far){if(e.near<=0||e.near>e.far)thrownewi.DeveloperError("near must be greater than zero and less than far.");e._left=s,e._right=o,e._top=t,e._bottom=n,e._near=f,e._far=u,e._perspectiveMatrix=r.Matrix4.computePerspectiveOffCenter(s,o,n,t,f,u,e._perspectiveMatrix),e._infinitePerspective=r.Matrix4.computeInfinitePerspectiveOffCenter(s,o,n,t,f,e._infinitePerspective)}}m.prototype.computeCullingVolume=function(e,t,n){if(!a.defined(e))thrownewi.DeveloperError("position is required.");if(!a.defined(t))thrownewi.DeveloperError("direction is required.");if(!a.defined(n))thrownewi.DeveloperError("up is required.");consto=this._cullingVolume.planes,s=this.top,f=this.bottom,u=this.right,d=this.left,l=this.near,h=this.far,p=r.Cartesian3.cross(t,n,w);r.Cartesian3.normalize(p,p);constc=_;r.Cartesian3.multiplyByScalar(t,l,c),r.Cartesian3.add(e,c,c);constm=y;r.Cartesian3.multiplyByScalar(p,d,m),r.Cartesian3.add(c,m,m);letC=o[0];returna.defined(C)||(C=o[0]=newr.Cartesian4),C.x=p.x,C.y=p.y,C.z=p.z,C.w=-r.Cartesian3.dot(p,m),r.Cartesian3.multiplyByScalar(p,u,m),r.Cartesian3.add(c,m,m),C=o[1],a.defined(C)||(C=o[1]=newr.Cartesian4),C.x=-p.x,C.y=-p.y,C.z=-p.z,C.w=-r.Cartesian3.dot(r.Cartesian3.negate(p,g),m),r.Cartesian3.multiplyByScalar(n,f,m),r.Cartesian3.add(c,m,m),C=o[2],a.defined(C)||(C=o[2]=newr.Cartesian4),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-r.Cartesian3.dot(n,m),r.Cartesian3.multiplyByScalar(n,s,m),r.Cartesian3.add(c,m,m),C=o[3],a.defined(C)||(C=o[3]=newr.Cartesian4),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-r.Cartesian3.dot(r.Cartesian3.negate(n,g),m),C=o[4],a.defined(C)||(C=o[4]=newr.Cartesian4),C.x=t.x,C.y=t.y,C.z=t.z,C.w=-r.Cartesian3.dot(t,c),r.Cartesian3.multiplyByScalar(t,h,m),r.Cartesian3.add(e,m,m),C=o[5],a.defined(C)||(C=o[5]=newr.Cartesian4),C.x=-t.x,C.y=-t.y,C.z=-t.z,C.w=-r.Cartesian3.dot(r.Cartesian3.negate(t,g),m),this._cullingVolume},m.prototype.getPixelDimensions=function(e,t,r,n,o){if(C(this),!a.defined(e)||!a.defined(t))thrownewi.DeveloperError("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)thrownewi.DeveloperError("drawingBufferWidth must be greater than zero.");if(t<=0)thrownewi.DeveloperError("drawingBufferHeight must be greater than zero.");if(!a.defined(r))thrownewi.DeveloperError("distance is required.");if(!a.defined(n))thrownewi.DeveloperError("pixelRatio is required.");if(n<=0)thrownewi.DeveloperError("pixelRatio must be greater than zero.");if(!a.defined(o))thrownewi.DeveloperError("A result object is required.");consts=this.right-this.left,f=this.top-this.bottom,u=n*s/e,d=n*f/t;returno.x=u,o.y=d,o},m.prototype.clone=function(e){returna.defined(e)||(e=newm),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void0,e._right=void0,e._top=void0,e._bottom=void0,e._near=void0,e._far=void0,e},m.prototype.equals=function(e){returna.defined(e)&&einstanceofm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},m.prototype.equalsEpsilon=function(e,t,r){returne===this||a.defined(e)&&einstanceofm&&n.CesiumMath.equalsEpsilon(this.right,e.right,t,r)&&n.CesiumMath.equalsEpsilon(this.left,e.left,t,r)&&n.CesiumMath.equalsEpsilon(this.top,e.top,t,r)&&n.CesiumMath.equalsEpsilon(this.bottom,e.bottom,t,r)&&n.CesiumMath.equalsEpsilon(this.near,e.near,t,r)&&n.CesiumMath.equalsEpsilon(this.far,e.far,t,r)},v.packedLength=4,v.pack=function(e,t,r){returni.Check.typeOf.object("value",e),i.Check.defined("array",t),r=a.defaultValue(r,0),t[r++]=e.width,t[r++]=e.aspectRatio,t[r++]=e.near,t[r]=e.far,t},v.unpack=function(e,t,r){returni.Check.defined("array",e),t=a.defaultValue(t,0),a.defined(r)||(r=newv),r.width=e[t++],r.aspectRatio=e[t++],r.near=e[t++],r.far=e[t],r},Object.defineProperties(v.prototype,{projectionMatrix:{get:function(){returnx(this),this._offCenterFrustum.projectionMatrix}}}),v.prototype.computeCullingVolume=function(e,t,r){returnx(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},v.prototype.getPixelDimensions=function(e,t,r,i,n){returnx(this),this._offCenterFrustum.getPixelDimensions(e,t,r,i,n)},v.prototype.clone=function(e){returna.defined(e)||(e=newv),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void0,e._width=void0,e._near=void0,e._far=void0,this._offCenterFrustum.clone(e._offCenterFrustum),e},v.prototype.equals=function(e){return!!(a.defined(e)&&einstanceofv)&&(x(this),x(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},v.prototype.equalsEpsilon=function(e,t,r){return!!(a.defined(e)&&einstanceofv)&&(x(this),x(e),n.CesiumMath.equalsEpsilon(this.width,e.width,t,r)&&n.CesiumMath.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,r)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,r))},Object.defineProperties(b.prototype,{projectionMatrix:{get:function(){returnE(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){returnE(this),this._infinitePerspective}}});constM=newr.Cartesian3,D=newr.Cartesian3,V=newr.Cartesian3,F=newr.Cartesian3;functionO(e){e=a.defaultValue(e,a.defaultValue.EMPTY_OBJECT),this._offCenterFrustum=newb,this.fov=e.fov,this._fov=void0,this._fovy=void0,this._sseDenominator=void0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void0,this.near=a.defaultValue(e.near,1),this._near=this.near,this.far=a.defaultValue(e.far,5e8),this._far=this.far,this.xOffset=a.defaultValue(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=a.defaultValue(e.yOffset,0),this._yOffset=this.yOffset}functionz(e){if(!a.defined(e.fov)||!a.defined(e.aspectRatio)||!a.defined(e.near)||!a.defined(e.far))thrownewi.DeveloperError("fov, aspectRatio, near, or far parameters are not set.");constt=e._offCenterFrustum;if(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset){if(e.fov<0||e.fov>=Math.PI)thrownewi.DeveloperError("fov must be in the range [0, PI).");if(e.aspectRatio<0)thrownewi.DeveloperError("aspectRatio must be positive.");if(e.near<0||e.near>e.far)thrownewi.DeveloperError("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset}}b.prototype.computeCullingVolume=function(e,t,n){if(!a.defined(e))thrownewi.DeveloperError("position is required.");if(!a.defined(t))thrownewi.DeveloperError("direction is required.");if(!a.defined(n))thrownewi.DeveloperError("up is required.");consto=this._cullingVolume.planes,s=this.top,f=this.bottom,u=this.right,d=this.left,l=this.near,h=this.far,p=r.Cartesian3.cross(t,n,M),c=D;r.Cartesian3.multiplyByScalar(t,l,c),r.Cartesian3.add(e,c,c);constm=V;r.Cartesian3.multiplyByScalar(t,h,m),r.Cartesian3.add(e,m,m);constC=F;r.Cartesian3.multiplyByScalar(p,d,C),r.Cartesian3.add(c,C,C),r.Cartesian3.subtract(C,e,C),r.Cartesian3.normalize(C,C),r.Cartesian3.cross(C,n,C),r.Cartesian3.normalize(C,C);letw=o[0];returna.defined(w)||(w=o[0]=newr.Cartesian4),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-r.Cartesian3.dot(C,e),r.Cartesian3.multiplyByScalar(p,u,C),r.Cartesian3.add(c,C,C),r.Cartesian3.subtract(C,e,C),r.Cartesian3.cross(n,C,C),r.Cartesian3.normalize(C,C),w=o[1],a.defined(w)||(w=o[1]=newr.Cartesian4),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-r.Cartesian3.dot(C,e),r.Cartesian3.multiplyByScalar(n,f,C),r.Cartesian3.add(c,C,C),r.Cartesian3.subtract(C,e,C),r.Cartesian3.cross(p,C,C),r.Cartesian3.normalize(C,C),w=o[2],a.defined(w)||(w=o[2]=newr.Cartesian4),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-r.Cartesian3.dot(C,e),r.Cartesian3.multiplyByScalar(n,s,C),r.Cartesian3.add(c,C,C),r.Cartesian3.subtract(C,e,C),r.Cartesian3.cross(C,p,C),r.Cartesian3.normalize(C,C),w=o[3],a.defined(w)||(w=o[3]=newr.Cartesian4),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-r.Cartesian3.dot(C,e),w=o[4],a.defined(w)||(w=o[4]=newr.Cartesian4),w.x=t.x,w.y=t.y,w.z=t.z,w.w=-r.Cartesian3.dot(t,c),r.Cartesian3.negate(t,C),w=o[5],a.defined(w)||(w=o[5]=newr.Cartesian4),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-r.Cartesian3.dot(C,m),this._cullingVolume},b.prototype.getPixelDimensions=function(e,t,r,n,o){if(E(this),!a.defined(e)||!a.defined(t))thrownewi.DeveloperError("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)thrownewi.DeveloperError("drawingBufferWidth must be greater than zero.");if(t<=0)thrownewi.DeveloperError("drawingBufferHeight must be greater than zero.");if(!a.defined(r))thrownewi.DeveloperError("distance is required.");if(!a.defined(n))thrownewi.DeveloperError("pixelRatio is required");if(n<=0)thrownewi.DeveloperError("pixelRatio must be greater than zero.");if(!a.defined(o))thrownewi.DeveloperError("A result object is required.");consts=1/this.near;letf=this.top*s;constu=2*n*r*f/t;f=this.right*s;constd=2*n*r*f/e;returno.x=d,o.y=u,o},b.prototype.clone=function(e){returna.defined(e)||(e=newb),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void0,e._right=void0,e._top=void0,e._bottom=void0,e._near=void0,e._far=void0,e},b.prototype.equals=function(e){returna.defined(e)&&einstanceofb&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},b.prototype.equalsEpsilon=function(e,t,r){returne===this||a.defined(e)&&einstanceofb&&n.CesiumMath.equalsEpsilon(this.right,e.right,t,r)&&n.CesiumMath.equalsEpsilon(this.left,e.left,t,r)&&n.CesiumMath.equalsEpsilon(this.top,e.top,t,r)&&n.CesiumMath.equalsEpsilon(this.bottom,e.bottom,t,r)&&n.CesiumMath.equalsEpsilon(this.near,e.near,t,r)&&n.CesiumMath.equalsEpsilon(this.far,e.far,t,r)},O.packedLength=6,O.pack=function(e,t,r){returni.Check.typeOf.object("value",e),i.Check.defined("array",t),r=a.defaultValue(r,0),t[r++]=e.fov,t[r++]=e.aspectRatio,t[r++]=e.near,t[r++]=e.far,t[r++]=e.xOffset,t[r]=e.yOffset,t},O.unpack=function(e,t,r){returni.Check.defined("array",e),t=a.defaultValue(t,0),a.defined(r)||(r=newO),r.fov=e[t++],r.aspectRatio=e[t++],r.near=e[t++],r.far=e[t++],r.xOffset=e[t++],r.yOffset=e[t],r},Object.defineProperties(O.prototype,{projectionMatrix:{get:function(){returnz(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){returnz(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){returnz(this),this._fovy}},sseDenominator:{get:function(){returnz(this),this._sseDenominator}}}),O.prototype.computeCullingVolume=function(e,t,r){returnz(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},O.prototype.getPixelDimensions=function(e,t,r,i,n){returnz(this),this._offCenterFrustum.getPixelDimensions(e,t,r,i,n)},O.prototype.clone=function(e){returna.defined(e)||(e=newO),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void0,e._fov=void0,e._near=void0,e._far=void0,this._offCenterFrustum.clone(e._offCenterFrustum),e},O.prototype.equals=function(e){return!!(a.defined(e)&&einstanceofO)&&(z(this),z(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},O.prototype.equalsEpsilon=function(e,t,r){return!!(a.defined(e)&&einstanceofO)&&(z(this),z(e),n.CesiumMath.equalsEpsilon(this.fov,e.fov,t,r)&&n.CesiumMath.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,r)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,r))};constR=0,k=1;functionP(e){i.Check.typeOf.object("options",e),i.Check.typeOf.object("options.frustum",e.frustum),i.Check.typeOf.object("options.origin",e.origin),i.Check.typeOf.object("options.orientation",e.orientation);constn=e.frustum,o=e.orientation,s=e.origin,f=a.defaultValue(e.vertexFormat,u.VertexFormat.DEFAULT),d=a.defaultValue(e._drawNearPlane,!0);letl,h;ninstanceofO?(l=R,h=O.packedLength):ninstanceofv&&(l=k,h=v.packedLength),this._frustumType=l,this._frustum=n.clone(),this._origin=r.Cartesian3.clone(s),this._orientation=t.Quaternion.clone(o),this._drawNearPlane=d,this._vertexFormat=f,this._workerName="createFrustumGeometry",this.packedLength=2+h+r.Cartesian3.packedLength+t.Quaternion.packedLength+u.VertexFormat.packedLength}P.pack=function(e,n,o){i.Check.typeOf.object("value",e),i.Check.defined("array",n),o=a.defaultValue(o,0);consts=e._frustumType,f=e._frustum;returnn[o++]=s,s===R?(O.pack(f,n,o),o+=O.packedLength):(v.pack(f,n,o),o+=v.packedLength),r.Cartesian3.pack(e._origin,n,o),o+=r.Cartesian3.packedLength,t.Quaternion.pack(e._orientation,n,o),o+=t.Quaternion.packedLength,u.VertexFormat.pack(e._vertexFormat,n,o),o+=u.VertexFormat.packedLength,n[o]=e._drawNearPlane?1:0,n};constq=newO,S=newv,T=newt.Quaternion,A=newr.Cartesian3,I=newu.VertexFormat;functionB(e,t,r,i,n,o,s,f){constu=e/3*2;for(letd=0;d<4;++d)a.defined(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),a.defined(r)&&(r[e]=s.x,r[e+1]=s.y,r[e+2]=s.z),a.defined(i)&&(i[e]=f.x,i[e+1]=f.y,i[e+2]=f.z),e+=3;n[u]=0,n[u+1]=0,n[u+2]=1,n[u+3]=0,n[u+4]=1,n[u+5]=1,n[u+6]=0,n[u+7]=1}P.unpack=function(e,n,o){i.Check.defined("array",e),n=a.defaultValue(n,0);consts=e[n++];letf;s===R?(f=O.unpack(e,n,q),n+=O.packedLength):(f=v.unpack(e,n,S),n+=v.packedLength);constd=r.Cartesian3.unpack(e,n,A);n+=r.Cartesian3.packedLength;constl=t.Quaternion.unpack(e,n,T);n+=t.Quaternion.packedLength;consth=u.VertexFormat.unpack(e,n,I);n+=u.VertexFormat.packedLength;constp=1===e[n];if(!a.defined(o))returnnewP({frustum:f,origin:d,orientation:l,vertexFormat:h,_drawNearPlane:p});constc=s===o._frustumType?o._frustum:void0;returno._frustum=f.clone(c),o._frustumType=s,o._origin=r.Cartesian3.clone(d,o._origin),o._orientation=t.Quaternion.clone(l,o._orientation),o._vertexFormat=u.VertexFormat.clone(h,o._vertexFormat),o._drawNearPlane=p,o};constL=newr.Matrix3,N=newr.Matrix4,j=newr.Matrix4,G=newr.Cartesian3,U=newr.Cartesian3,Q=newr.Cartesian3,K=newr.Cartesian3,W=newr.Cartesian3,Y=newr.Cartesian3,H=newArray(3),J=newArray(4);J[0]=newr.Cartesian4(-1,-1,1,1),J[1]=newr.Cartesian4(1,-1,1,1),J[2]=newr.Cartesian4(1,1,1,1),J[3]=newr.Cartesian4(-1,1,1,1);constX=newArray(4);for(letZ=0;Z<4;++Z)X[Z]=newr.Cartesian4;P._computeNearFarPlanes=function(e,t,i,n,o,s,f,u){constd=r.Matrix3.fromQuaternion(t,L);letl=a.defaultValue(s,G),h=a.defaultValue(f,U),p=a.defaultValue(u,Q);l=r.Matrix3.getColumn(d,0,l),h=r.Matrix3.getColumn(d,1,h),p=r.Matrix3.getColumn(d,2,p),r.Cartesian3.normalize(l,l),r.Cartesian3.normalize(h,h),r.Cartesian3.normalize(p,p),r.Cartesian3.negate(l,l);constc=r.Matrix4.computeView(e,p,h,l,N);letm,C;if(i===R){conste=n.projectionMatrix,t=r.Matrix4.multiply(e,c,j);C=r.Matrix4.inverse(t,j)}elsem=r.Matrix4.inverseTransformation(c,j);a.defined(C)?(H[0]=n.near,H[1]=n.far):(H[0]=0,H[1]=n.near,H[2]=n.far);for(letw=0;w<2;++w)for(lett=0;t<4;++t){leti=r.Cartesian4.clone(J[t],X[t]);if(a.defined(C)){i=r.Matrix4.multiplyByVector(C,i,i);constt=1/i.w;r.Cartesian3.multiplyByScalar(i,t,i),r.Cartesian3.subtract(i,e,i),r.Cartesian3.normalize(i,i);constn=r.Cartesian3.dot(p,i);r.Cartesian3.multiplyByScalar(i,H[w]/n,i),r.Cartesian3.add(i,e,i)}else{a.defined(n._offCenterFrustum)&&(n=n._offCenterFrustum);conste=H[w],t=H[w+1];i.x=.5*(i.x*(n.right-n.left)+n.left+n.right),i.y=.5*(i.y*(n.top-n.bottom)+n.bottom+n.top),i.z=.5*(i.z*(e-t)-e-t),i.w=1,r.Matrix4.multiplyByVector(m,i,i)}o[12*w+3*t]=i.x,o[12*w+3*t+1]=i.y,o[12*w+3*t+2]=i.z}},P.createGeometry=function(e){consti=e._frustumType,f=e._frustum,u=e._origin,d=e._orientation,l=e._drawNearPlane,h=e._vertexFormat,p=l?6:5;letc=newFloat64Array(72);P._computeNearFarPlanes(u,d,i,f,c);letm=24;c[m]=c[12],c[m+1]=c[13],c[m+2]=c[14],c[m+3]=c[0],c[m+4]=c[1],c[m+5]=c[2],c[m+6]=c[9],c[m+7]=c[10],c[m+8]=c[11],c[m+9]=c[21],c[m+10]=c[22],c[m+11]=c[23],m+=12,c[m]=c[15],c[m+1]=c[16],c[m+2]=c[17],c[m+3]=c[3],c[m+4]=c[4],c[m+5]=c[5],c[m+6]=c[0],c[m+7]=c[1],c[m+8]=c[2],c[m+9]=c[12],c[m+10]=c[13],c[m+11]=c[14],m+=12,c[m]=c[3],c[m+1]=c[4],c[m+2]=c[5],c[m+3]=c[15],c[m+4]=c[16],c[m+5]=c[17],c[m+6]=c[18],c[m+7]=c[19],c[m+8]=c[20],c[m+9]=c[6],c[m+10]=c[7],c[m+11]=c[8],m+=12,c[m]=c[6],c[m+1]=c[7],c[m+2]=c[8],c[m+3]=c[18],c[m+4]=c[19],c[m+5]=c[20],c[m+6]=c[21],c[m+7]=c[22],c[m+8]=c[23],c[m+9]=c[9],c[m+10]=c[10],c[m+11]=c[11],l||(c=c.subarray(12));constC=news.GeometryAttributes({position:newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:c})});if(a.defined(h.normal)||a.defined(h.tangent)||a.defined(h.bitangent)||a.defined(h.st)){conste=a.defined(h.normal)?newFloat32Array(12*p):void0,t=a.defined(h.tangent)?newFloat32Array(12*p):void0,i=a.defined(h.bitangent)?newFloat32Array(12*p):void0,s=a.defined(h.st)?newFloat32Array(8*p):void0,f=G,u=U,d=Q,c=r.Cartesian3.negate(f,K),w=r.Cartesian3.negate(u,W),_=r.Cartesian3.negate(d,Y);m=0,l&&(B(m,e,t,i,s,_,f,u),m+=12),B(m,e,t,i,s,d,c,u),m+=12,B(m,e,t,i,s,c,_,u),m+=12,B(m,e,t,i,s,w,_,c),m+=12,B(m,e,t,i,s,f,d,u),m+=12,B(m,e,t,i,s,u,d,c),a.defined(e)&&(C.normal=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:e})),a.defined(t)&&(C.tangent=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:t})),a.defined(i)&&(C.bitangent=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:i})),a.defined(s)&&(C.st=newo.GeometryAttribute({componentDatatype:n.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s}))}constw=newUint16Array(6*p);for(lett=0;t<p;++t){conste=6*t,r=4*t;w[e]=r,w[e+1]=r+1,w[e+2]=r+2,w[e+3]=r,w[e+4]=r+2,w[e+5]=r+3}returnnewo.Geometry({attributes:C,indices:w,primitiveType:o.PrimitiveType.TRIANGLES,boundingSphere:t.BoundingSphere.fromVertices(c)})},e.FrustumGeometry=P,e.OrthographicFrustum=v,e.PerspectiveFrustum=O}));
define(["exports","./Matrix2-fc7e9822","./RuntimeError-c581ca93","./defaultValue-94c3e563","./WebGLConstants-7dccdc96","./Transforms-3ac41eb6"],(function(t,e,r,n,i,a){"use strict";consto={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};vars=Object.freeze(o);constu={POINTS:i.WebGLConstants.POINTS,LINES:i.WebGLConstants.LINES,LINE_LOOP:i.WebGLConstants.LINE_LOOP,LINE_STRIP:i.WebGLConstants.LINE_STRIP,TRIANGLES:i.WebGLConstants.TRIANGLES,TRIANGLE_STRIP:i.WebGLConstants.TRIANGLE_STRIP,TRIANGLE_FAN:i.WebGLConstants.TRIANGLE_FAN,isLines:function(t){returnt===u.LINES||t===u.LINE_LOOP||t===u.LINE_STRIP},isTriangles:function(t){returnt===u.TRIANGLES||t===u.TRIANGLE_STRIP||t===u.TRIANGLE_FAN},validate:function(t){returnt===u.POINTS||t===u.LINES||t===u.LINE_LOOP||t===u.LINE_STRIP||t===u.TRIANGLES||t===u.TRIANGLE_STRIP||t===u.TRIANGLE_FAN}};varc=Object.freeze(u);functionI(t){t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT),r.Check.typeOf.object("options.attributes",t.attributes),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=n.defaultValue(t.primitiveType,c.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=n.defaultValue(t.geometryType,s.NONE),this.boundingSphereCV=t.boundingSphereCV,this.offsetAttribute=t.offsetAttribute}I.computeNumberOfVertices=function(t){r.Check.typeOf.object("geometry",t);lete=-1;for(constiint.attributes)if(t.attributes.hasOwnProperty(i)&&n.defined(t.attributes[i])&&n.defined(t.attributes[i].values)){constn=t.attributes[i],a=n.values.length/n.componentsPerAttribute;if(e!==a&&-1!==e)thrownewr.DeveloperError("All attribute lists must have the same number of attributes.");e=a}returne};constp=newe.Cartographic,l=newe.Cartesian3,N=newe.Matrix4,f=[newe.Cartographic,newe.Cartographic,newe.Cartographic],m=[newe.Cartesian2,newe.Cartesian2,newe.Cartesian2],T=[newe.Cartesian2,newe.Cartesian2,newe.Cartesian2],b=newe.Cartesian3,E=newa.Quaternion,L=newe.Matrix4,h=newe.Matrix2;functiond(t){if(t=n.defaultValue(t,n.defaultValue.EMPTY_OBJECT),!n.defined(t.componentDatatype))thrownewr.DeveloperError("options.componentDatatype is required.");if(!n.defined(t.componentsPerAttribute))thrownewr.DeveloperError("options.componentsPerAttribute is required.");if(t.componentsPerAttribute<1||t.componentsPerAttribute>4)thrownewr.DeveloperError("options.componentsPerAttribute must be between 1 and 4.");if(!n.defined(t.values))thrownewr.DeveloperError("options.values is required.");this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=n.defaultValue(t.normalize,!1),this.values=t.values}I._textureCoordinateRotationPoints=function(t,r,n,i){leto;consts=e.Rectangle.center(i,p),u=e.Cartographic.toCartesian(s,n,l),c=a.Transforms.eastNorthUpToFixedFrame(u,n,N),I=e.Matrix4.inverse(c,N),d=m,y=f;y[0].longitude=i.west,y[0].latitude=i.south,y[1].longitude=i.west,y[1].latitude=i.north,y[2].longitude=i.east,y[2].latitude=i.south;letA=b;for(o=0;o<3;o++)e.Cartographic.toCartesian(y[o],n,A),A=e.Matrix4.multiplyByPointAsVector(I,A,A),d[o].x=A.x,d[o].y=A.y;constC=a.Quaternion.fromAxisAngle(e.Cartesian3.UNIT_Z,-r,E),P=e.Matrix3.fromQuaternion(C,L),w=t.length;letx=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY,G=Number.NEGATIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(o=0;o<w;o++)A=e.Matrix4.multiplyByPointAsVector(I,t[o],A),A=e.Matrix3.multiplyByVector(P,A,A),x=Math.min(x,A.x),S=Math.min(S,A.y),G=Math.max(G,A.x),R=Math.max(R,A.y);constO=e.Matrix2.fromRotation(r,h),_=T;_[0].x=x,_[0].y=S,_[1].x=x,_[1].y=R,_[2].x=G,_[2].y=S;constg=d[0],v=d[2].x-g.x,V=d[1].y-g.y;for(o=0;o<3;o++){constt=_[o];e.Matrix2.multiplyByVector(O,t,t),t.x=(t.x-g.x)/v,t.y=(t.y-g.y)/V}constM=_[0],F=_[1],D=_[2],W=newArray(6);returne.Cartesian2.pack(M,W),e.Cartesian2.pack(F,W,2),e.Cartesian2.pack(D,W,4),W},t.Geometry=I,t.GeometryAttribute=d,t.GeometryType=s,t.PrimitiveType=c}));
define(["exports","./defaultValue-94c3e563","./RuntimeError-c581ca93","./Matrix2-fc7e9822"],(function(e,t,i,r){"use strict";functiono(e){if(e=t.defaultValue(e,t.defaultValue.EMPTY_OBJECT),!t.defined(e.geometry))thrownewi.DeveloperError("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=r.Matrix4.clone(t.defaultValue(e.modelMatrix,r.Matrix4.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=t.defaultValue(e.attributes,{}),this.westHemisphereGeometry=void0,this.eastHemisphereGeometry=void0}e.GeometryInstance=o}));