define(["exports","./RuntimeError-ac440aa5","./defaultValue-69ee94f4","./ComponentDatatype-a9820060","./PixelFormat-9ceadbf3","./WebGLConstants-f63312fc"],(function(t,e,n,i,r,a){"use strict";function o(t,e){if(null===t||"object"!=typeof t)return t;e=n.defaultValue(e,!1);const i=new t.constructor;for(const n in t)if(t.hasOwnProperty(n)){let r=t[n];e&&(r=o(r,e)),i[n]=r}return i}function u(t,e){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0)}u.fromElements=function(t,e,i){return n.defined(i)?(i.x=t,i.y=e,i):new u(t,e)},u.clone=function(t,e){if(n.defined(t))return n.defined(e)?(e.x=t.x,e.y=t.y,e):new u(t.x,t.y)},u.fromCartesian3=u.clone,u.fromCartesian4=u.clone,u.packedLength=2,u.pack=function(t,e,i){return i=n.defaultValue(i,0),e[i++]=t.x,e[i]=t.y,e},u.unpack=function(t,e,i){return e=n.defaultValue(e,0),n.defined(i)||(i=new u),i.x=t[e++],i.y=t[e],i},u.packArray=function(t,e){const i=t.length,r=2*i;n.defined(e)?(Array.isArray(e)||e.length===r)&&e.length!==r&&(e.length=r):e=new Array(r);for(let n=0;n0;s--){var l=t[s].color.replace("#",""),c=t[s-1].color.replace("#",""),f=parseInt(l,16),d=parseInt(c,16),m=t[s].val,h=t[s-1].val,x=Math.floor((m-o)*u+.5),p=Math.floor((h-o)*u+.5),y=p-x;if(0!=y)for(var g=(16711680&f)>>16<<16,w=(65280&f)>>8<<16,T=(255&f)<<16,C=(16711680&d)>>16<<16,S=(65280&d)>>8<<16,R=(255&d)<<16,P=Math.floor((C-g)/y),O=Math.floor((S-w)/y),b=Math.floor((R-T)/y),I=x;I>16,n[4*I+1]=w>>16,n[4*I+2]=T>>16,n[4*I+3]=255}var L=function(t,e){return new z({context:e.context,pixelFormat:r.PixelFormat.RGBA,pixelDatatype:r.PixelDatatype.UNSIGNED_BYTE,source:{width:1,height:1024,arrayBufferView:t},sampler:new A({wrapS:E.CLAMP_TO_EDGE,wrapT:E.CLAMP_TO_EDGE,minificationFilter:M.LINEAR,magnificationFilter:_.LINEAR})})}(n,e);return this._slopeTex=L,this.slopeMapTexture=this._slopeTex,L},setSlopeMapPallete:function(t){var e=[];(t=Object.entries(t)).length>0&&t.forEach((function(t){2==t.length&&t[0]>=0&&t[0]<=90&&e.push({val:100*Math.cos(Cesium.Math.toRadians(t[0])),color:t[1]})})),0!==e.length?(e.sort((function(t,e){return t.vali.CesiumMath.EPSILON12);return n.defined(o)?(o.x=u*T,o.y=s*S,o.z=l*R,o):new C(u*T,s*S,l*R)}function W(t,e,i){this.longitude=n.defaultValue(t,0),this.latitude=n.defaultValue(e,0),this.height=n.defaultValue(i,0)}W.fromRadians=function(t,e,i,r){return i=n.defaultValue(i,0),n.defined(r)?(r.longitude=t,r.latitude=e,r.height=i,r):new W(t,e,i)},W.fromDegrees=function(t,e,n,r){return t=i.CesiumMath.toRadians(t),e=i.CesiumMath.toRadians(e),W.fromRadians(t,e,n,r)};const F=new C,v=new C,B=new C,D=new C(1/T.Ellipsoid.x,1/T.Ellipsoid.y,1/T.Ellipsoid.z),G=new C(1/(T.Ellipsoid.x*T.Ellipsoid.x),1/(T.Ellipsoid.y*T.Ellipsoid.y),1/(T.Ellipsoid.z*T.Ellipsoid.z)),k=i.CesiumMath.EPSILON1;function j(t,e,r,a){e=n.defaultValue(e,0),r=n.defaultValue(r,0),a=n.defaultValue(a,0),t._radii=new C(e,r,a),t._radiiSquared=new C(e*e,r*r,a*a),t._radiiToTheFourth=new C(e*e*e*e,r*r*r*r,a*a*a*a),t._oneOverRadii=new C(0===e?0:1/e,0===r?0:1/r,0===a?0:1/a),t._oneOverRadiiSquared=new C(0===e?0:1/(e*e),0===r?0:1/(r*r),0===a?0:1/(a*a)),t._minimumRadius=Math.min(e,r,a),t._maximumRadius=Math.max(e,r,a),t._centerToleranceSquared=i.CesiumMath.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function Y(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,j(this,t,e,n)}W.fromCartesian=function(t,e,r){const a=n.defined(e)?e.oneOverRadii:D,o=n.defined(e)?e.oneOverRadiiSquared:G,u=q(t,a,o,n.defined(e)?e._centerToleranceSquared:k,v);if(!n.defined(u))return;let s=C.multiplyComponents(u,o,F);s=C.normalize(s,s);const l=C.subtract(t,u,B),c=Math.atan2(s.y,s.x),f=Math.asin(s.z),d=i.CesiumMath.sign(C.dot(l,t))*C.magnitude(l);return n.defined(r)?(r.longitude=c,r.latitude=f,r.height=d,r):new W(c,f,d)},W.toCartesian=function(t,e,n){return C.fromRadians(t.longitude,t.latitude,t.height,e,n)},W.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 W(t.longitude,t.latitude,t.height)},W.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},W.equalsEpsilon=function(t,e,i){return i=n.defaultValue(i,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t.longitude-e.longitude)<=i&&Math.abs(t.latitude-e.latitude)<=i&&Math.abs(t.height-e.height)<=i},W.ZERO=Object.freeze(new W(0,0,0)),W.prototype.clone=function(t){return W.clone(this,t)},W.prototype.equals=function(t){return W.equals(this,t)},W.prototype.equalsEpsilon=function(t,e){return W.equalsEpsilon(this,t,e)},W.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(Y.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}}}),Y.clone=function(t,e){if(!n.defined(t))return;const i=t._radii;return n.defined(e)?(C.clone(i,e._radii),C.clone(t._radiiSquared,e._radiiSquared),C.clone(t._radiiToTheFourth,e._radiiToTheFourth),C.clone(t._oneOverRadii,e._oneOverRadii),C.clone(t._oneOverRadiiSquared,e._oneOverRadiiSquared),e._minimumRadius=t._minimumRadius,e._maximumRadius=t._maximumRadius,e._centerToleranceSquared=t._centerToleranceSquared,e):new Y(i.x,i.y,i.z)},Y.fromCartesian3=function(t,e){return n.defined(e)||(e=new Y),n.defined(t)?(j(e,t.x,t.y,t.z),e):e},Y.WGS84=Object.freeze(new Y(T.Ellipsoid.x,T.Ellipsoid.y,T.Ellipsoid.z)),Y.UNIT_SPHERE=Object.freeze(new Y(1,1,1)),Y.MOON=Object.freeze(new Y(i.CesiumMath.LUNAR_RADIUS,i.CesiumMath.LUNAR_RADIUS,i.CesiumMath.LUNAR_RADIUS)),Y.prototype.clone=function(t){return Y.clone(this,t)},Y.packedLength=C.packedLength,Y.pack=function(t,e,i){return i=n.defaultValue(i,0),C.pack(t._radii,e,i),e},Y.unpack=function(t,e,i){e=n.defaultValue(e,0);const r=C.unpack(t,e);return Y.fromCartesian3(r,i)},Y.prototype.geocentricSurfaceNormal=C.normalize,Y.prototype.geodeticSurfaceNormalCartographic=function(t,e){const i=t.longitude,r=t.latitude,a=Math.cos(r),o=a*Math.cos(i),u=a*Math.sin(i),s=Math.sin(r);return n.defined(e)||(e=new C),e.x=o,e.y=u,e.z=s,C.normalize(e,e)},Y.prototype.geodeticSurfaceNormal=function(t,e){if(!C.equalsEpsilon(t,C.ZERO,i.CesiumMath.EPSILON14))return n.defined(e)||(e=new C),e=C.multiplyComponents(t,this._oneOverRadiiSquared,e),C.normalize(e,e)};const $=new C,X=new C;Y.prototype.cartographicToCartesian=function(t,e){const i=$,r=X;this.geodeticSurfaceNormalCartographic(t,i),C.multiplyComponents(this._radiiSquared,i,r);const a=Math.sqrt(C.dot(i,r));return C.divideByScalar(r,a,r),C.multiplyByScalar(i,t.height,i),n.defined(e)||(e=new C),C.add(r,i,e)},Y.prototype.cartographicArrayToCartesianArray=function(t,e){const i=t.length;n.defined(e)?e.length=i:e=new Array(i);for(let n=0;n=this._radii.z-e))return i};const J=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Q=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function tt(t,e,n){const i=.5*(e+t),r=.5*(e-t);let a=0;for(let t=0;t<5;t++){const e=r*J[t];a+=Q[t]*(n(i+e)+n(i-e))}return a*=r,a}function et(t,e,i,r,a,o,u,s,l){this[0]=n.defaultValue(t,0),this[1]=n.defaultValue(r,0),this[2]=n.defaultValue(u,0),this[3]=n.defaultValue(e,0),this[4]=n.defaultValue(a,0),this[5]=n.defaultValue(s,0),this[6]=n.defaultValue(i,0),this[7]=n.defaultValue(o,0),this[8]=n.defaultValue(l,0)}Y.prototype.surfaceArea=function(t){const e=t.west;let n=t.east;const r=t.south,a=t.north;for(;nr&&(a=e,r=n)}let o=1,u=0;const s=st[a],l=lt[a];if(Math.abs(t[et.getElementIndex(l,s)])>n){const e=(t[et.getElementIndex(l,l)]-t[et.getElementIndex(s,s)])/2/t[et.getElementIndex(l,s)];let n;n=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e)),o=1/Math.sqrt(1+n*n),u=n*o}return(e=et.clone(et.IDENTITY,e))[et.getElementIndex(s,s)]=e[et.getElementIndex(l,l)]=o,e[et.getElementIndex(l,s)]=u,e[et.getElementIndex(s,l)]=-u,e}const dt=new et,mt=new et;et.computeEigenDecomposition=function(t,e){const r=i.CesiumMath.EPSILON20;let a=0,o=0;n.defined(e)||(e={});const u=e.unitary=et.clone(et.IDENTITY,e.unitary),s=e.diagonal=et.clone(t,e.diagonal),l=r*function(t){let e=0;for(let n=0;n<9;++n){const i=t[n];e+=i*i}return Math.sqrt(e)}(s);for(;o<10&&ct(s)>l;)ft(s,dt),et.transpose(dt,mt),et.multiply(s,dt,s),et.multiply(mt,s,s),et.multiply(u,dt,u),++a>2&&(++o,a=0);return e},et.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},et.determinant=function(t){const e=t[0],n=t[3],i=t[6],r=t[1],a=t[4],o=t[7],u=t[2],s=t[5],l=t[8];return e*(a*l-s*o)+r*(s*i-n*l)+u*(n*o-a*i)},et.inverse=function(t,e){const n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],u=t[5],s=t[6],l=t[7],c=t[8],f=et.determinant(t);e[0]=o*c-l*u,e[1]=l*r-i*c,e[2]=i*u-o*r,e[3]=s*u-a*c,e[4]=n*c-s*r,e[5]=a*r-n*u,e[6]=a*l-s*o,e[7]=s*i-n*l,e[8]=n*o-a*i;const d=1/f;return et.multiplyByScalar(e,d,e)};const ht=new et;function xt(t,e,i,r){this.x=n.defaultValue(t,0),this.y=n.defaultValue(e,0),this.z=n.defaultValue(i,0),this.w=n.defaultValue(r,0)}et.inverseTranspose=function(t,e){return et.inverse(et.transpose(t,ht),e)},et.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]},et.equalsEpsilon=function(t,e,i){return i=n.defaultValue(i,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t[0]-e[0])<=i&&Math.abs(t[1]-e[1])<=i&&Math.abs(t[2]-e[2])<=i&&Math.abs(t[3]-e[3])<=i&&Math.abs(t[4]-e[4])<=i&&Math.abs(t[5]-e[5])<=i&&Math.abs(t[6]-e[6])<=i&&Math.abs(t[7]-e[7])<=i&&Math.abs(t[8]-e[8])<=i},et.IDENTITY=Object.freeze(new et(1,0,0,0,1,0,0,0,1)),et.ZERO=Object.freeze(new et(0,0,0,0,0,0,0,0,0)),et.COLUMN0ROW0=0,et.COLUMN0ROW1=1,et.COLUMN0ROW2=2,et.COLUMN1ROW0=3,et.COLUMN1ROW1=4,et.COLUMN1ROW2=5,et.COLUMN2ROW0=6,et.COLUMN2ROW1=7,et.COLUMN2ROW2=8,Object.defineProperties(et.prototype,{length:{get:function(){return et.packedLength}}}),et.prototype.clone=function(t){return et.clone(this,t)},et.prototype.equals=function(t){return et.equals(this,t)},et.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]},et.prototype.equalsEpsilon=function(t,e){return et.equalsEpsilon(this,t,e)},et.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`},xt.fromElements=function(t,e,i,r,a){return n.defined(a)?(a.x=t,a.y=e,a.z=i,a.w=r,a):new xt(t,e,i,r)},xt.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 xt(t.red,t.green,t.blue,t.alpha)},xt.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 xt(t.x,t.y,t.z,t.w)},xt.packedLength=4,xt.pack=function(t,e,i){return i=n.defaultValue(i,0),e[i++]=t.x,e[i++]=t.y,e[i++]=t.z,e[i]=t.w,e},xt.unpack=function(t,e,i){return e=n.defaultValue(e,0),n.defined(i)||(i=new xt),i.x=t[e++],i.y=t[e++],i.z=t[e++],i.w=t[e],i},xt.packArray=function(t,e){const i=t.length,r=4*i;n.defined(e)?(Array.isArray(e)||e.length===r)&&e.length!==r&&(e.length=r):e=new Array(r);for(let n=0;n=0?n.longitude:n.longitude+i.CesiumMath.TWO_PI;o=Math.min(o,c),u=Math.max(u,c)}return a-r>u-o&&(r=o,a=u,a>i.CesiumMath.PI&&(a-=i.CesiumMath.TWO_PI),r>i.CesiumMath.PI&&(r-=i.CesiumMath.TWO_PI)),n.defined(e)?(e.west=r,e.south=s,e.east=a,e.north=l,e):new Wt(r,s,a,l)},Wt.fromCartesianArray=function(t,e,r){e=n.defaultValue(e,Y.WGS84);let a=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let n=0,r=t.length;n=0?r.longitude:r.longitude+i.CesiumMath.TWO_PI;u=Math.min(u,f),s=Math.max(s,f)}return o-a>s-u&&(a=u,o=s,o>i.CesiumMath.PI&&(o-=i.CesiumMath.TWO_PI),a>i.CesiumMath.PI&&(a-=i.CesiumMath.TWO_PI)),n.defined(r)?(r.west=a,r.south=l,r.east=o,r.north=c,r):new Wt(a,l,o,c)},Wt.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 Wt(t.west,t.south,t.east,t.north)},Wt.equalsEpsilon=function(t,e,i){return i=n.defaultValue(i,0),t===e||n.defined(t)&&n.defined(e)&&Math.abs(t.west-e.west)<=i&&Math.abs(t.south-e.south)<=i&&Math.abs(t.east-e.east)<=i&&Math.abs(t.north-e.north)<=i},Wt.prototype.clone=function(t){return Wt.clone(this,t)},Wt.prototype.equals=function(t){return Wt.equals(this,t)},Wt.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},Wt.prototype.equalsEpsilon=function(t,e){return Wt.equalsEpsilon(this,t,e)},Wt.validate=function(t){},Wt.southwest=function(t,e){return n.defined(e)?(e.longitude=t.west,e.latitude=t.south,e.height=0,e):new W(t.west,t.south)},Wt.northwest=function(t,e){return n.defined(e)?(e.longitude=t.west,e.latitude=t.north,e.height=0,e):new W(t.west,t.north)},Wt.northeast=function(t,e){return n.defined(e)?(e.longitude=t.east,e.latitude=t.north,e.height=0,e):new W(t.east,t.north)},Wt.southeast=function(t,e){return n.defined(e)?(e.longitude=t.east,e.latitude=t.south,e.height=0,e):new W(t.east,t.south)},Wt.center=function(t,e){let r=t.east;const a=t.west;r0?a+=i.CesiumMath.TWO_PI:u0&&(u+=i.CesiumMath.TWO_PI),a=d?void 0:n.defined(r)?(r.west=l,r.south=f,r.east=c,r.north=d,r):new Wt(l,f,c,d)},Wt.simpleIntersection=function(t,e,i){const r=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||r>=o))return n.defined(i)?(i.west=r,i.south=a,i.east=o,i.north=u,i):new Wt(r,a,o,u)},Wt.union=function(t,e,r){n.defined(r)||(r=new Wt);let a=t.east,o=t.west,u=e.east,s=e.west;a0?a+=i.CesiumMath.TWO_PI:u0&&(u+=i.CesiumMath.TWO_PI),aa||i.CesiumMath.equalsEpsilon(n,a,i.CesiumMath.EPSILON14))&&(n=t.south&&r<=t.north};const Ft=new W;function vt(t,e,i,r){this[0]=n.defaultValue(t,0),this[1]=n.defaultValue(i,0),this[2]=n.defaultValue(e,0),this[3]=n.defaultValue(r,0)}Wt.subsample=function(t,e,r,a){e=n.defaultValue(e,Y.WGS84),r=n.defaultValue(r,0),n.defined(a)||(a=[]);let o=0;const u=t.north,s=t.south,l=t.east,c=t.west,f=Ft;f.height=r,f.longitude=c,f.latitude=u,a[o]=e.cartographicToCartesian(f,a[o]),o++,f.longitude=l,a[o]=e.cartographicToCartesian(f,a[o]),o++,f.latitude=s,a[o]=e.cartographicToCartesian(f,a[o]),o++,f.longitude=c,a[o]=e.cartographicToCartesian(f,a[o]),o++,f.latitude=u<0?u:s>0?s:0;for(let n=1;n<8;++n)f.longitude=-Math.PI+n*i.CesiumMath.PI_OVER_TWO,Wt.contains(t,f)&&(a[o]=e.cartographicToCartesian(f,a[o]),o++);return 0===f.latitude&&(f.longitude=c,a[o]=e.cartographicToCartesian(f,a[o]),o++,f.longitude=l,a[o]=e.cartographicToCartesian(f,a[o]),o++),a.length=o,a},Wt.subsection=function(t,e,r,a,o,u){if(n.defined(u)||(u=new Wt),t.west<=t.east){const n=t.east-t.west;u.west=t.west+e*n,u.east=t.west+a*n}else{const n=i.CesiumMath.TWO_PI+t.east-t.west;u.west=i.CesiumMath.negativePiToPi(t.west+e*n),u.east=i.CesiumMath.negativePiToPi(t.west+a*n)}const s=t.north-t.south;return u.south=t.south+r*s,u.north=t.south+o*s,1===e&&(u.west=t.east),1===a&&(u.east=t.east),1===r&&(u.south=t.north),1===o&&(u.north=t.north),u},Wt.MAX_VALUE=Object.freeze(new Wt(-Math.PI,-i.CesiumMath.PI_OVER_TWO,Math.PI,i.CesiumMath.PI_OVER_TWO)),vt.packedLength=4,vt.pack=function(t,e,i){return i=n.defaultValue(i,0),e[i++]=t[0],e[i++]=t[1],e[i++]=t[2],e[i++]=t[3],e},vt.unpack=function(t,e,i){return e=n.defaultValue(e,0),n.defined(i)||(i=new vt),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i},vt.packArray=function(t,e){const i=t.length,r=4*i;n.defined(e)?(Array.isArray(e)||e.length===r)&&e.length!==r&&(e.length=r):e=new Array(r);for(let n=0;n