/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.97 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ define(["exports","./defaultValue-a6eb9f34","./ComponentDatatype-7f6d9570","./RuntimeError-07496d94"],(function(t,e,n,r){"use strict";function i(t,n,r){this.x=e.defaultValue(t,0),this.y=e.defaultValue(n,0),this.z=e.defaultValue(r,0)}i.fromSpherical=function(t,n){e.defined(n)||(n=new i);const r=t.clock,a=t.cone,u=e.defaultValue(t.magnitude,1),o=u*Math.sin(a);return n.x=o*Math.cos(r),n.y=o*Math.sin(r),n.z=u*Math.cos(a),n},i.fromElements=function(t,n,r,a){return e.defined(a)?(a.x=t,a.y=n,a.z=r,a):new i(t,n,r)},i.clone=function(t,n){if(e.defined(t))return e.defined(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){return r=e.defaultValue(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},i.unpack=function(t,n,r){return n=e.defaultValue(n,0),e.defined(r)||(r=new i),r.x=t[n++],r.y=t[n++],r.z=t[n],r},i.packArray=function(t,n){const r=t.length,a=3*r;e.defined(n)?(Array.isArray(n)||n.length===a)&&n.length!==a&&(n.length=a):n=new Array(a);for(let e=0;en.CesiumMath.EPSILON12);return e.defined(o)?(o.x=s*_,o.y=c*T,o.z=l*V,o):new i(s*_,c*T,l*V)}function p(t,n,r){this.longitude=e.defaultValue(t,0),this.latitude=e.defaultValue(n,0),this.height=e.defaultValue(r,0)}p.fromRadians=function(t,n,r,i){return r=e.defaultValue(r,0),e.defined(i)?(i.longitude=t,i.latitude=n,i.height=r,i):new p(t,n,r)},p.fromDegrees=function(t,e,r,i){return t=n.CesiumMath.toRadians(t),e=n.CesiumMath.toRadians(e),p.fromRadians(t,e,r,i)};const x=new i,w=new i,M=new i,g=new i(1/6378137,1/6378137,1/6356752.314245179),z=new i(1/40680631590769,1/40680631590769,1/40408299984661.445),C=n.CesiumMath.EPSILON1;function O(t,r,a,u){r=e.defaultValue(r,0),a=e.defaultValue(a,0),u=e.defaultValue(u,0),t._radii=new i(r,a,u),t._radiiSquared=new i(r*r,a*a,u*u),t._radiiToTheFourth=new i(r*r*r*r,a*a*a*a,u*u*u*u),t._oneOverRadii=new i(0===r?0:1/r,0===a?0:1/a,0===u?0:1/u),t._oneOverRadiiSquared=new i(0===r?0:1/(r*r),0===a?0:1/(a*a),0===u?0:1/(u*u)),t._minimumRadius=Math.min(r,a,u),t._maximumRadius=Math.max(r,a,u),t._centerToleranceSquared=n.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,r,a){const u=e.defined(r)?r.oneOverRadii:g,o=e.defined(r)?r.oneOverRadiiSquared:z,s=y(t,u,o,e.defined(r)?r._centerToleranceSquared:C,w);if(!e.defined(s))return;let c=i.multiplyComponents(s,o,x);c=i.normalize(c,c);const l=i.subtract(t,s,M),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),h=n.CesiumMath.sign(i.dot(l,t))*i.magnitude(l);return e.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,n){if(e.defined(t))return e.defined(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new p(t.longitude,t.latitude,t.height)},p.equals=function(t,n){return t===n||e.defined(t)&&e.defined(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height},p.equalsEpsilon=function(t,n,r){return r=e.defaultValue(r,0),t===n||e.defined(t)&&e.defined(n)&&Math.abs(t.longitude-n.longitude)<=r&&Math.abs(t.latitude-n.latitude)<=r&&Math.abs(t.height-n.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,n){if(!e.defined(t))return;const r=t._radii;return e.defined(n)?(i.clone(r,n._radii),i.clone(t._radiiSquared,n._radiiSquared),i.clone(t._radiiToTheFourth,n._radiiToTheFourth),i.clone(t._oneOverRadii,n._oneOverRadii),i.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new b(r.x,r.y,r.z)},b.fromCartesian3=function(t,n){return e.defined(n)||(n=new b),e.defined(t)?(O(n,t.x,t.y,t.z),n):n},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(n.CesiumMath.LUNAR_RADIUS,n.CesiumMath.LUNAR_RADIUS,n.CesiumMath.LUNAR_RADIUS)),b.prototype.clone=function(t){return b.clone(this,t)},b.packedLength=i.packedLength,b.pack=function(t,n,r){return r=e.defaultValue(r,0),i.pack(t._radii,n,r),n},b.unpack=function(t,n,r){n=e.defaultValue(n,0);const a=i.unpack(t,n);return b.fromCartesian3(a,r)},b.prototype.geocentricSurfaceNormal=i.normalize,b.prototype.geodeticSurfaceNormalCartographic=function(t,n){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 e.defined(n)||(n=new i),n.x=o,n.y=s,n.z=c,i.normalize(n,n)},b.prototype.geodeticSurfaceNormal=function(t,r){if(!i.equalsEpsilon(t,i.ZERO,n.CesiumMath.EPSILON14))return e.defined(r)||(r=new i),r=i.multiplyComponents(t,this._oneOverRadiiSquared,r),i.normalize(r,r)};const S=new i,q=new i;b.prototype.cartographicToCartesian=function(t,n){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),e.defined(n)||(n=new i),i.add(a,r,n)},b.prototype.cartographicArrayToCartesianArray=function(t,n){const r=t.length;e.defined(n)?n.length=r:n=new Array(r);for(let e=0;e=this._radii.z-n))return r};const V=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],A=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function E(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*V[t];a+=A[t]*(n(r+e)+n(r-e))}return a*=i,a}function I(t,n,r,i,a,u,o,s,c){this[0]=e.defaultValue(t,0),this[1]=e.defaultValue(i,0),this[2]=e.defaultValue(o,0),this[3]=e.defaultValue(n,0),this[4]=e.defaultValue(a,0),this[5]=e.defaultValue(s,0),this[6]=e.defaultValue(r,0),this[7]=e.defaultValue(u,0),this[8]=e.defaultValue(c,0)}b.prototype.surfaceArea=function(t){const e=t.west;let r=t.east;const i=t.south,a=t.north;for(;ri&&(a=e,i=n)}let u=1,o=0;const s=v[a],c=B[a];if(Math.abs(t[I.getElementIndex(c,s)])>r){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 X=new I,Z=new I;I.computeEigenDecomposition=function(t,r){const i=n.CesiumMath.EPSILON20;let a=0,u=0;e.defined(r)||(r={});const o=r.unitary=I.clone(I.IDENTITY,r.unitary),s=r.diagonal=I.clone(t,r.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&&$(s)>c;)j(s,X),I.transpose(X,Z),I.multiply(s,X,s),I.multiply(Z,s,s),I.multiply(o,X,o),++a>2&&(++u,a=0);return r},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 D=new I;function Y(t,n,r,i){this.x=e.defaultValue(t,0),this.y=e.defaultValue(n,0),this.z=e.defaultValue(r,0),this.w=e.defaultValue(i,0)}I.inverseTranspose=function(t,e){return I.inverse(I.transpose(t,D),e)},I.equals=function(t,n){return t===n||e.defined(t)&&e.defined(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},I.equalsEpsilon=function(t,n,r){return r=e.defaultValue(r,0),t===n||e.defined(t)&&e.defined(n)&&Math.abs(t[0]-n[0])<=r&&Math.abs(t[1]-n[1])<=r&&Math.abs(t[2]-n[2])<=r&&Math.abs(t[3]-n[3])<=r&&Math.abs(t[4]-n[4])<=r&&Math.abs(t[5]-n[5])<=r&&Math.abs(t[6]-n[6])<=r&&Math.abs(t[7]-n[7])<=r&&Math.abs(t[8]-n[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]})`},Y.fromElements=function(t,n,r,i,a){return e.defined(a)?(a.x=t,a.y=n,a.z=r,a.w=i,a):new Y(t,n,r,i)},Y.fromColor=function(t,n){return e.defined(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new Y(t.red,t.green,t.blue,t.alpha)},Y.clone=function(t,n){if(e.defined(t))return e.defined(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new Y(t.x,t.y,t.z,t.w)},Y.packedLength=4,Y.pack=function(t,n,r){return r=e.defaultValue(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},Y.unpack=function(t,n,r){return n=e.defaultValue(n,0),e.defined(r)||(r=new Y),r.x=t[n++],r.y=t[n++],r.z=t[n++],r.w=t[n],r},Y.packArray=function(t,n){const r=t.length,i=4*r;e.defined(n)?(Array.isArray(n)||n.length===i)&&n.length!==i&&(n.length=i):n=new Array(i);for(let e=0;e=0?r.longitude:r.longitude+n.CesiumMath.TWO_PI;u=Math.min(u,l),o=Math.max(o,l)}return a-i>o-u&&(i=u,a=o,a>n.CesiumMath.PI&&(a-=n.CesiumMath.TWO_PI),i>n.CesiumMath.PI&&(i-=n.CesiumMath.TWO_PI)),e.defined(r)?(r.west=i,r.south=s,r.east=a,r.north=c,r):new pt(i,s,a,c)},pt.fromCartesianArray=function(t,r,i){r=e.defaultValue(r,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 e=0,i=t.length;e=0?i.longitude:i.longitude+n.CesiumMath.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return u-a>s-o&&(a=o,u=s,u>n.CesiumMath.PI&&(u-=n.CesiumMath.TWO_PI),a>n.CesiumMath.PI&&(a-=n.CesiumMath.TWO_PI)),e.defined(i)?(i.west=a,i.south=c,i.east=u,i.north=l,i):new pt(a,c,u,l)},pt.clone=function(t,n){if(e.defined(t))return e.defined(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new pt(t.west,t.south,t.east,t.north)},pt.equalsEpsilon=function(t,n,r){return r=e.defaultValue(r,0),t===n||e.defined(t)&&e.defined(n)&&Math.abs(t.west-n.west)<=r&&Math.abs(t.south-n.south)<=r&&Math.abs(t.east-n.east)<=r&&Math.abs(t.north-n.north)<=r},pt.prototype.clone=function(t){return pt.clone(this,t)},pt.prototype.equals=function(t){return pt.equals(this,t)},pt.equals=function(t,n){return t===n||e.defined(t)&&e.defined(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north},pt.prototype.equalsEpsilon=function(t,e){return pt.equalsEpsilon(this,t,e)},pt.validate=function(t){},pt.southwest=function(t,n){return e.defined(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new p(t.west,t.south)},pt.northwest=function(t,n){return e.defined(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new p(t.west,t.north)},pt.northeast=function(t,n){return e.defined(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new p(t.east,t.north)},pt.southeast=function(t,n){return e.defined(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new p(t.east,t.south)},pt.center=function(t,r){let i=t.east;const a=t.west;i0?a+=n.CesiumMath.TWO_PI:o0&&(o+=n.CesiumMath.TWO_PI),a=d?void 0:e.defined(i)?(i.west=c,i.south=f,i.east=l,i.north=d,i):new pt(c,f,l,d)},pt.simpleIntersection=function(t,n,r){const i=Math.max(t.west,n.west),a=Math.max(t.south,n.south),u=Math.min(t.east,n.east),o=Math.min(t.north,n.north);if(!(a>=o||i>=u))return e.defined(r)?(r.west=i,r.south=a,r.east=u,r.north=o,r):new pt(i,a,u,o)},pt.union=function(t,r,i){e.defined(i)||(i=new pt);let a=t.east,u=t.west,o=r.east,s=r.west;a0?a+=n.CesiumMath.TWO_PI:o0&&(o+=n.CesiumMath.TWO_PI),aa||n.CesiumMath.equalsEpsilon(r,a,n.CesiumMath.EPSILON14))&&(r=t.south&&i<=t.north};const xt=new p;function wt(t,n){this.x=e.defaultValue(t,0),this.y=e.defaultValue(n,0)}pt.subsample=function(t,r,i,a){r=e.defaultValue(r,b.WGS84),i=e.defaultValue(i,0),e.defined(a)||(a=[]);let u=0;const o=t.north,s=t.south,c=t.east,l=t.west,f=xt;f.height=i,f.longitude=l,f.latitude=o,a[u]=r.cartographicToCartesian(f,a[u]),u++,f.longitude=c,a[u]=r.cartographicToCartesian(f,a[u]),u++,f.latitude=s,a[u]=r.cartographicToCartesian(f,a[u]),u++,f.longitude=l,a[u]=r.cartographicToCartesian(f,a[u]),u++,f.latitude=o<0?o:s>0?s:0;for(let e=1;e<8;++e)f.longitude=-Math.PI+e*n.CesiumMath.PI_OVER_TWO,pt.contains(t,f)&&(a[u]=r.cartographicToCartesian(f,a[u]),u++);return 0===f.latitude&&(f.longitude=l,a[u]=r.cartographicToCartesian(f,a[u]),u++,f.longitude=c,a[u]=r.cartographicToCartesian(f,a[u]),u++),a.length=u,a},pt.subsection=function(t,r,i,a,u,o){if(e.defined(o)||(o=new pt),t.west<=t.east){const e=t.east-t.west;o.west=t.west+r*e,o.east=t.west+a*e}else{const e=n.CesiumMath.TWO_PI+t.east-t.west;o.west=n.CesiumMath.negativePiToPi(t.west+r*e),o.east=n.CesiumMath.negativePiToPi(t.west+a*e)}const s=t.north-t.south;return o.south=t.south+i*s,o.north=t.south+u*s,1===r&&(o.west=t.east),1===a&&(o.east=t.east),1===i&&(o.south=t.north),1===u&&(o.north=t.north),o},pt.MAX_VALUE=Object.freeze(new pt(-Math.PI,-n.CesiumMath.PI_OVER_TWO,Math.PI,n.CesiumMath.PI_OVER_TWO)),wt.fromElements=function(t,n,r){return e.defined(r)?(r.x=t,r.y=n,r):new wt(t,n)},wt.clone=function(t,n){if(e.defined(t))return e.defined(n)?(n.x=t.x,n.y=t.y,n):new wt(t.x,t.y)},wt.fromCartesian3=wt.clone,wt.fromCartesian4=wt.clone,wt.packedLength=2,wt.pack=function(t,n,r){return r=e.defaultValue(r,0),n[r++]=t.x,n[r]=t.y,n},wt.unpack=function(t,n,r){return n=e.defaultValue(n,0),e.defined(r)||(r=new wt),r.x=t[n++],r.y=t[n],r},wt.packArray=function(t,n){const r=t.length,i=2*r;e.defined(n)?(Array.isArray(n)||n.length===i)&&n.length!==i&&(n.length=i):n=new Array(i);for(let e=0;e