define(["exports","./RuntimeError-608565a6","./when-229515d6","./ComponentDatatype-692a36d3"],(function(t,e,n,r){"use strict";function i(t,e,r){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0),this.z=n.defaultValue(r,0)}i.fromSpherical=function(t,e){n.defined(e)||(e=new i);const r=t.clock,a=t.cone,u=n.defaultValue(t.magnitude,1),o=u*Math.sin(a);return e.x=o*Math.cos(r),e.y=o*Math.sin(r),e.z=u*Math.cos(a),e},i.fromElements=function(t,e,r,a){return n.defined(a)?(a.x=t,a.y=e,a.z=r,a):new i(t,e,r)},i.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,e,r){return r=n.defaultValue(r,0),e[r++]=t.x,e[r++]=t.y,e[r]=t.z,e},i.unpack=function(t,e,r){return e=n.defaultValue(e,0),n.defined(r)||(r=new i),r.x=t[e++],r.y=t[e++],r.z=t[e],r},i.packArray=function(t,r){const a=t.length,u=3*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==u)throw new e.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");r.length!==u&&(r.length=u)}else r=new Array(u);for(let e=0;er.CesiumMath.EPSILON12);return n.defined(o)?(o.x=s*R,o.y=c*V,o.z=l*E,o):new i(s*R,c*V,l*E)}function p(t,e,r){this.longitude=n.defaultValue(t,0),this.latitude=n.defaultValue(e,0),this.height=n.defaultValue(r,0)}p.fromRadians=function(t,e,r,i){return r=n.defaultValue(r,0),n.defined(i)?(i.longitude=t,i.latitude=e,i.height=r,i):new p(t,e,r)},p.fromDegrees=function(t,e,n,i){return t=r.CesiumMath.toRadians(t),e=r.CesiumMath.toRadians(e),p.fromRadians(t,e,n,i)};const x=new i,M=new i,w=new i,g=new i(1/6378137,1/6378137,1/6356752.314245179),z=new i(1/40680631590769,1/40680631590769,1/40408299984661.445),C=r.CesiumMath.EPSILON1;function O(t,e,a,u){e=n.defaultValue(e,0),a=n.defaultValue(a,0),u=n.defaultValue(u,0),t._radii=new i(e,a,u),t._radiiSquared=new i(e*e,a*a,u*u),t._radiiToTheFourth=new i(e*e*e*e,a*a*a*a,u*u*u*u),t._oneOverRadii=new i(0===e?0:1/e,0===a?0:1/a,0===u?0:1/u),t._oneOverRadiiSquared=new i(0===e?0:1/(e*e),0===a?0:1/(a*a),0===u?0:1/(u*u)),t._minimumRadius=Math.min(e,a,u),t._maximumRadius=Math.max(e,a,u),t._centerToleranceSquared=r.CesiumMath.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function b(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,O(this,t,e,n)}p.fromCartesian=function(t,e,a){const u=n.defined(e)?e.oneOverRadii:g,o=n.defined(e)?e.oneOverRadiiSquared:z,s=y(t,u,o,n.defined(e)?e._centerToleranceSquared:C,M);if(!n.defined(s))return;let c=i.multiplyComponents(s,o,x);c=i.normalize(c,c);const l=i.subtract(t,s,w),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),h=r.CesiumMath.sign(i.dot(l,t))*i.magnitude(l);return n.defined(a)?(a.longitude=f,a.latitude=d,a.height=h,a):new p(f,d,h)},p.toCartesian=function(t,e,n){return i.fromRadians(t.longitude,t.latitude,t.height,e,n)},p.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new p(t.longitude,t.latitude,t.height)},p.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},p.equalsEpsilon=function(t,e,r){return r=n.defaultValue(r,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},p.ZERO=Object.freeze(new p(0,0,0)),p.prototype.clone=function(t){return p.clone(this,t)},p.prototype.equals=function(t){return p.equals(this,t)},p.prototype.equalsEpsilon=function(t,e){return p.equalsEpsilon(this,t,e)},p.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(b.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),b.clone=function(t,e){if(!n.defined(t))return;const r=t._radii;return n.defined(e)?(i.clone(r,e._radii),i.clone(t._radiiSquared,e._radiiSquared),i.clone(t._radiiToTheFourth,e._radiiToTheFourth),i.clone(t._oneOverRadii,e._oneOverRadii),i.clone(t._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=t._minimumRadius,e._maximumRadius=t._maximumRadius,e._centerToleranceSquared=t._centerToleranceSquared,e):new b(r.x,r.y,r.z)},b.fromCartesian3=function(t,e){return n.defined(e)||(e=new b),n.defined(t)?(O(e,t.x,t.y,t.z),e):e},b.WGS84=Object.freeze(new b(6378137,6378137,6356752.314245179)),b.UNIT_SPHERE=Object.freeze(new b(1,1,1)),b.MOON=Object.freeze(new b(r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS)),b.prototype.clone=function(t){return b.clone(this,t)},b.packedLength=i.packedLength,b.pack=function(t,e,r){return r=n.defaultValue(r,0),i.pack(t._radii,e,r),e},b.unpack=function(t,e,r){e=n.defaultValue(e,0);const a=i.unpack(t,e);return b.fromCartesian3(a,r)},b.prototype.geocentricSurfaceNormal=i.normalize,b.prototype.geodeticSurfaceNormalCartographic=function(t,e){const r=t.longitude,a=t.latitude,u=Math.cos(a),o=u*Math.cos(r),s=u*Math.sin(r),c=Math.sin(a);return n.defined(e)||(e=new i),e.x=o,e.y=s,e.z=c,i.normalize(e,e)},b.prototype.geodeticSurfaceNormal=function(t,e){if(!i.equalsEpsilon(t,i.ZERO,r.CesiumMath.EPSILON14))return n.defined(e)||(e=new i),e=i.multiplyComponents(t,this._oneOverRadiiSquared,e),i.normalize(e,e)};const S=new i,q=new i;b.prototype.cartographicToCartesian=function(t,e){const r=S,a=q;this.geodeticSurfaceNormalCartographic(t,r),i.multiplyComponents(this._radiiSquared,r,a);const u=Math.sqrt(i.dot(r,a));return i.divideByScalar(a,u,a),i.multiplyByScalar(r,t.height,r),n.defined(e)||(e=new i),i.add(a,r,e)},b.prototype.cartographicArrayToCartesianArray=function(t,e){const r=t.length;n.defined(e)?e.length=r:e=new Array(r);for(let n=0;n=this._radii.z-e))return r};const E=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],T=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function A(t,e,n){const r=.5*(e+t),i=.5*(e-t);let a=0;for(let t=0;t<5;t++){const e=i*E[t];a+=T[t]*(n(r+e)+n(r-e))}return a*=i,a}function I(t,e,r,i,a,u,o,s,c){this[0]=n.defaultValue(t,0),this[1]=n.defaultValue(i,0),this[2]=n.defaultValue(o,0),this[3]=n.defaultValue(e,0),this[4]=n.defaultValue(a,0),this[5]=n.defaultValue(s,0),this[6]=n.defaultValue(r,0),this[7]=n.defaultValue(u,0),this[8]=n.defaultValue(c,0)}b.prototype.surfaceArea=function(t){const e=t.west;let n=t.east;const i=t.south,a=t.north;for(;ni&&(a=e,i=n)}let u=1,o=0;const s=v[a],c=P[a];if(Math.abs(t[I.getElementIndex(c,s)])>n){const e=(t[I.getElementIndex(c,c)]-t[I.getElementIndex(s,s)])/2/t[I.getElementIndex(c,s)];let n;n=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e)),u=1/Math.sqrt(1+n*n),o=n*u}return(e=I.clone(I.IDENTITY,e))[I.getElementIndex(s,s)]=e[I.getElementIndex(c,c)]=u,e[I.getElementIndex(c,s)]=o,e[I.getElementIndex(s,c)]=-o,e}const B=new I,j=new I;I.computeEigenDecomposition=function(t,e){const i=r.CesiumMath.EPSILON20;let a=0,u=0;n.defined(e)||(e={});const o=e.unitary=I.clone(I.IDENTITY,e.unitary),s=e.diagonal=I.clone(t,e.diagonal),c=i*function(t){let e=0;for(let n=0;n<9;++n){const r=t[n];e+=r*r}return Math.sqrt(e)}(s);for(;u<10&&W(s)>c;)k(s,B),I.transpose(B,j),I.multiply(s,B,s),I.multiply(j,s,s),I.multiply(o,B,o),++a>2&&(++u,a=0);return e},I.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},I.determinant=function(t){const e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],u=t[7],o=t[2],s=t[5],c=t[8];return e*(a*c-s*u)+i*(s*r-n*c)+o*(n*u-a*r)},I.inverse=function(t,e){const n=t[0],r=t[1],i=t[2],a=t[3],u=t[4],o=t[5],s=t[6],c=t[7],l=t[8],f=I.determinant(t);e[0]=u*l-c*o,e[1]=c*i-r*l,e[2]=r*o-u*i,e[3]=s*o-a*l,e[4]=n*l-s*i,e[5]=a*i-n*o,e[6]=a*c-s*u,e[7]=s*r-n*c,e[8]=n*u-a*r;const d=1/f;return I.multiplyByScalar(e,d,e)};const X=new I;function D(t,e,r,i){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0),this.z=n.defaultValue(r,0),this.w=n.defaultValue(i,0)}I.inverseTranspose=function(t,e){return I.inverse(I.transpose(t,X),e)},I.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},I.equalsEpsilon=function(t,e,r){return r=n.defaultValue(r,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},I.IDENTITY=Object.freeze(new I(1,0,0,0,1,0,0,0,1)),I.ZERO=Object.freeze(new I(0,0,0,0,0,0,0,0,0)),I.COLUMN0ROW0=0,I.COLUMN0ROW1=1,I.COLUMN0ROW2=2,I.COLUMN1ROW0=3,I.COLUMN1ROW1=4,I.COLUMN1ROW2=5,I.COLUMN2ROW0=6,I.COLUMN2ROW1=7,I.COLUMN2ROW2=8,Object.defineProperties(I.prototype,{length:{get:function(){return I.packedLength}}}),I.prototype.clone=function(t){return I.clone(this,t)},I.prototype.equals=function(t){return I.equals(this,t)},I.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},I.prototype.equalsEpsilon=function(t,e){return I.equalsEpsilon(this,t,e)},I.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},D.fromElements=function(t,e,r,i,a){return n.defined(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new D(t,e,r,i)},D.fromColor=function(t,e){return n.defined(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new D(t.red,t.green,t.blue,t.alpha)},D.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new D(t.x,t.y,t.z,t.w)},D.packedLength=4,D.pack=function(t,e,r){return r=n.defaultValue(r,0),e[r++]=t.x,e[r++]=t.y,e[r++]=t.z,e[r]=t.w,e},D.unpack=function(t,e,r){return e=n.defaultValue(e,0),n.defined(r)||(r=new D),r.x=t[e++],r.y=t[e++],r.z=t[e++],r.w=t[e],r},D.packArray=function(t,r){const i=t.length,a=4*i;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==a)throw new e.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");r.length!==a&&(r.length=a)}else r=new Array(a);for(let e=0;e=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;u=Math.min(u,l),o=Math.max(o,l)}return a-i>o-u&&(i=u,a=o,a>r.CesiumMath.PI&&(a-=r.CesiumMath.TWO_PI),i>r.CesiumMath.PI&&(i-=r.CesiumMath.TWO_PI)),n.defined(e)?(e.west=i,e.south=s,e.east=a,e.north=c,e):new ft(i,s,a,c)},ft.fromCartesianArray=function(t,e,i){e=n.defaultValue(e,b.WGS84);let a=Number.MAX_VALUE,u=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let n=0,i=t.length;n=0?i.longitude:i.longitude+r.CesiumMath.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return u-a>s-o&&(a=o,u=s,u>r.CesiumMath.PI&&(u-=r.CesiumMath.TWO_PI),a>r.CesiumMath.PI&&(a-=r.CesiumMath.TWO_PI)),n.defined(i)?(i.west=a,i.south=c,i.east=u,i.north=l,i):new ft(a,c,u,l)},ft.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new ft(t.west,t.south,t.east,t.north)},ft.equalsEpsilon=function(t,e,r){return r=n.defaultValue(r,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t.west-e.west)<=r&&Math.abs(t.south-e.south)<=r&&Math.abs(t.east-e.east)<=r&&Math.abs(t.north-e.north)<=r},ft.prototype.clone=function(t){return ft.clone(this,t)},ft.prototype.equals=function(t){return ft.equals(this,t)},ft.equals=function(t,e){return t===e||n.defined(t)&&n.defined(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},ft.prototype.equalsEpsilon=function(t,e){return ft.equalsEpsilon(this,t,e)},ft.validate=function(t){},ft.southwest=function(t,e){return n.defined(e)?(e.longitude=t.west,e.latitude=t.south,e.height=0,e):new p(t.west,t.south)},ft.northwest=function(t,e){return n.defined(e)?(e.longitude=t.west,e.latitude=t.north,e.height=0,e):new p(t.west,t.north)},ft.northeast=function(t,e){return n.defined(e)?(e.longitude=t.east,e.latitude=t.north,e.height=0,e):new p(t.east,t.north)},ft.southeast=function(t,e){return n.defined(e)?(e.longitude=t.east,e.latitude=t.south,e.height=0,e):new p(t.east,t.south)},ft.center=function(t,e){let i=t.east;const a=t.west;i0?a+=r.CesiumMath.TWO_PI:o0&&(o+=r.CesiumMath.TWO_PI),a=d?void 0:n.defined(i)?(i.west=c,i.south=f,i.east=l,i.north=d,i):new ft(c,f,l,d)},ft.simpleIntersection=function(t,e,r){const i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),u=Math.min(t.east,e.east),o=Math.min(t.north,e.north);if(!(a>=o||i>=u))return n.defined(r)?(r.west=i,r.south=a,r.east=u,r.north=o,r):new ft(i,a,u,o)},ft.union=function(t,e,i){n.defined(i)||(i=new ft);let a=t.east,u=t.west,o=e.east,s=e.west;a0?a+=r.CesiumMath.TWO_PI:o0&&(o+=r.CesiumMath.TWO_PI),aa||r.CesiumMath.equalsEpsilon(n,a,r.CesiumMath.EPSILON14))&&(n=t.south&&i<=t.north};const dt=new p;function ht(t,e){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0)}ft.subsample=function(t,e,i,a){e=n.defaultValue(e,b.WGS84),i=n.defaultValue(i,0),n.defined(a)||(a=[]);let u=0;const o=t.north,s=t.south,c=t.east,l=t.west,f=dt;f.height=i,f.longitude=l,f.latitude=o,a[u]=e.cartographicToCartesian(f,a[u]),u++,f.longitude=c,a[u]=e.cartographicToCartesian(f,a[u]),u++,f.latitude=s,a[u]=e.cartographicToCartesian(f,a[u]),u++,f.longitude=l,a[u]=e.cartographicToCartesian(f,a[u]),u++,f.latitude=o<0?o:s>0?s:0;for(let n=1;n<8;++n)f.longitude=-Math.PI+n*r.CesiumMath.PI_OVER_TWO,ft.contains(t,f)&&(a[u]=e.cartographicToCartesian(f,a[u]),u++);return 0===f.latitude&&(f.longitude=l,a[u]=e.cartographicToCartesian(f,a[u]),u++,f.longitude=c,a[u]=e.cartographicToCartesian(f,a[u]),u++),a.length=u,a},ft.MAX_VALUE=Object.freeze(new ft(-Math.PI,-r.CesiumMath.PI_OVER_TWO,Math.PI,r.CesiumMath.PI_OVER_TWO)),ht.fromElements=function(t,e,r){return n.defined(r)?(r.x=t,r.y=e,r):new ht(t,e)},ht.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e):new ht(t.x,t.y)},ht.fromCartesian3=ht.clone,ht.fromCartesian4=ht.clone,ht.packedLength=2,ht.pack=function(t,e,r){return r=n.defaultValue(r,0),e[r++]=t.x,e[r]=t.y,e},ht.unpack=function(t,e,r){return e=n.defaultValue(e,0),n.defined(r)||(r=new ht),r.x=t[e++],r.y=t[e],r},ht.packArray=function(t,r){const i=t.length,a=2*i;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==a)throw new e.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");r.length!==a&&(r.length=a)}else r=new Array(a);for(let e=0;e