1234567891011121314151617181920212223242526 |
- define(["exports","./Cartesian4-b0ddc4ba","./Check-7b2a090c","./when-b60132fc","./Math-31e539c2","./WebGLConstants-aba9fc67"],(function(e,t,r,n,a,i){"use strict";function o(e,r,i,o){r=n.defaultValue(r,0),i=n.defaultValue(i,0),o=n.defaultValue(o,0),a.Math3D.equalsEpsilon(o,6356752.314245179,a.Math3D.EPSILON10)&&(a.Math3D.Radius=o),e._radii=new t.Cartesian3(r,i,o),e._radiiSquared=new t.Cartesian3(r*r,i*i,o*o),e._radiiToTheFourth=new t.Cartesian3(r*r*r*r,i*i*i*i,o*o*o*o),e._oneOverRadii=new t.Cartesian3(0===r?0:1/r,0===i?0:1/i,0===o?0:1/o),e._oneOverRadiiSquared=new t.Cartesian3(0===r?0:1/(r*r),0===i?0:1/(i*i),0===o?0:1/(o*o)),e._minimumRadius=Math.min(r,i,o),e._maximumRadius=Math.max(r,i,o),e._centerToleranceSquared=a.Math3D.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function u(e,t,r){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,e,t,r)}Object.defineProperties(u.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}}}),u.clone=function(e,r){if(n.defined(e)){var a=e._radii;return n.defined(r)?(t.Cartesian3.clone(a,r._radii),t.Cartesian3.clone(e._radiiSquared,r._radiiSquared),t.Cartesian3.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.Cartesian3.clone(e._oneOverRadii,r._oneOverRadii),t.Cartesian3.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new u(a.x,a.y,a.z)}},u.fromCartesian3=function(e,t){return n.defined(t)||(t=new u),n.defined(e)?(o(t,e.x,e.y,e.z),t):t},u.WGS84=Object.freeze(new u(6378137,6378137,a.Math3D.Radius)),u.XIAN80=Object.freeze(new u(6378140,6378140,6356755.29)),u.CGCS2000=Object.freeze(new u(6378137,6378137,6356752.31)),u.UNIT_SPHERE=Object.freeze(new u(1,1,1)),u.MOON=Object.freeze(new u(a.Math3D.LUNAR_RADIUS,a.Math3D.LUNAR_RADIUS,a.Math3D.LUNAR_RADIUS)),u.prototype.clone=function(e){return u.clone(this,e)},u.packedLength=t.Cartesian3.packedLength,u.pack=function(e,r,a){return a=n.defaultValue(a,0),t.Cartesian3.pack(e._radii,r,a),r},u.unpack=function(e,r,a){r=n.defaultValue(r,0);var i=t.Cartesian3.unpack(e,r);return u.fromCartesian3(i,a)},u.prototype.geocentricSurfaceNormal=t.Cartesian3.normalize,u.prototype.geodeticSurfaceNormalCartographic=function(e,r){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n.defined(r)||(r=new t.Cartesian3),r.x=u,r.y=s,r.z=c,t.Cartesian3.normalize(r,r)},u.prototype.geodeticSurfaceNormal=function(e,r){return n.defined(r)||(r=new t.Cartesian3),r=t.Cartesian3.multiplyComponents(e,this._oneOverRadiiSquared,r),t.Cartesian3.normalize(r,r)};var s=new t.Cartesian3,c=new t.Cartesian3;u.prototype.cartographicToCartesian=function(e,r){var a=s,i=c;this.geodeticSurfaceNormalCartographic(e,a),t.Cartesian3.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.Cartesian3.dot(a,i));return t.Cartesian3.divideByScalar(i,o,i),t.Cartesian3.multiplyByScalar(a,e.height,a),n.defined(r)||(r=new t.Cartesian3),t.Cartesian3.add(i,a,r)},u.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n.defined(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new t.Cartesian3,f=new t.Cartesian3,l=new t.Cartesian3;function h(e){this._ellipsoid=n.defaultValue(e,u.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}u.prototype.cartesianToCartographic=function(e,r){var i=this.scaleToGeodeticSurface(e,f);if(n.defined(i)){var o=this.geodeticSurfaceNormal(i,d),u=t.Cartesian3.subtract(e,i,l),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),h=a.Math3D.sign(t.Cartesian3.dot(u,e))*t.Cartesian3.magnitude(u);return n.defined(r)?(r.longitude=s,r.latitude=c,r.height=h,r):new t.Cartographic(s,c,h)}},u.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n.defined(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},u.prototype.scaleToGeodeticSurface=function(e,r){return t.scaleToGeodeticSurface(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,r)},u.prototype.scaleToGeocentricSurface=function(e,r){n.defined(r)||(r=new t.Cartesian3);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.Cartesian3.multiplyByScalar(e,s,r)},u.prototype.transformPositionToScaledSpace=function(e,r){return n.defined(r)||(r=new t.Cartesian3),t.Cartesian3.multiplyComponents(e,this._oneOverRadii,r)},u.prototype.transformPositionFromScaledSpace=function(e,r){return n.defined(r)||(r=new t.Cartesian3),t.Cartesian3.multiplyComponents(e,this._radii,r)},u.prototype.equals=function(e){return this===e||n.defined(e)&&t.Cartesian3.equals(this._radii,e._radii)},u.prototype.toString=function(){return this._radii.toString()},u.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,r,a){r=n.defaultValue(r,0);var i=this._squaredXOverSquaredZ;if(n.defined(a)||(a=new t.Cartesian3),a.x=0,a.y=0,a.z=e.z*(1-i),!(Math.abs(a.z)>=this._radii.z-r))return a},Object.defineProperties(h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),h.prototype.project=function(e,r){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return n.defined(r)?(r.x=i,r.y=o,r.z=u,r):new t.Cartesian3(i,o,u)},h.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n.defined(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t.Cartographic(i,o,u)};var p=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function m(e,t){this.start=n.defaultValue(e,0),this.stop=n.defaultValue(t,0)}function y(e,t,r,a,i,o,u,s,c){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(a,0),this[2]=n.defaultValue(u,0),this[3]=n.defaultValue(t,0),this[4]=n.defaultValue(i,0),this[5]=n.defaultValue(s,0),this[6]=n.defaultValue(r,0),this[7]=n.defaultValue(o,0),this[8]=n.defaultValue(c,0)}y.packedLength=9,y.pack=function(e,t,r){return r=n.defaultValue(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},y.unpack=function(e,t,r){return t=n.defaultValue(t,0),n.defined(r)||(r=new y),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r},y.clone=function(e,t){if(n.defined(e))return n.defined(t)?(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],t):new y(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},y.fromArray=function(e,t,r){return t=n.defaultValue(t,0),n.defined(r)||(r=new y),r[0]=e[t],r[1]=e[t+1],r[2]=e[t+2],r[3]=e[t+3],r[4]=e[t+4],r[5]=e[t+5],r[6]=e[t+6],r[7]=e[t+7],r[8]=e[t+8],r},y.fromColumnMajorArray=function(e,t){return y.clone(e,t)},y.fromRowMajorArray=function(e,t){return n.defined(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new y(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},y.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,d=e.z*e.z,f=e.z*e.w,l=e.w*e.w,h=r-u-d+l,p=2*(a-f),m=2*(i+c),v=2*(a+f),g=-r+u-d+l,C=2*(s-o),w=2*(i-c),q=2*(s+o),x=-r-u+d+l;return n.defined(t)?(t[0]=h,t[1]=v,t[2]=w,t[3]=p,t[4]=g,t[5]=q,t[6]=m,t[7]=C,t[8]=x,t):new y(h,p,m,v,g,C,w,q,x)},y.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=r*a,d=-i*u+s*o*a,f=s*u+i*o*a,l=r*u,h=i*a+s*o*u,p=-s*a+i*o*u,m=-o,v=s*r,g=i*r;return n.defined(t)?(t[0]=c,t[1]=l,t[2]=m,t[3]=d,t[4]=h,t[5]=v,t[6]=f,t[7]=p,t[8]=g,t):new y(c,d,f,l,h,p,m,v,g)},y.fromScale=function(e,t){return n.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new y(e.x,0,0,0,e.y,0,0,0,e.z)},y.fromUniformScale=function(e,t){return n.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new y(e,0,0,0,e,0,0,0,e)},y.fromCrossProduct=function(e,t){return n.defined(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new y(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},y.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n.defined(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new y(1,0,0,0,r,-a,0,a,r)},y.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n.defined(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new y(r,0,a,0,1,0,-a,0,r)},y.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n.defined(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(r,-a,0,a,r,0,0,0,1)},y.toArray=function(e,t){return n.defined(t)?(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],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},y.getElementIndex=function(e,t){return 3*e+t},y.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},y.setColumn=function(e,t,r,n){var a=3*t;return(n=y.clone(e,n))[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},y.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},y.setRow=function(e,t,r,n){return(n=y.clone(e,n))[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var v=new t.Cartesian3;y.getScale=function(e,r){return r.x=t.Cartesian3.magnitude(t.Cartesian3.fromElements(e[0],e[1],e[2],v)),r.y=t.Cartesian3.magnitude(t.Cartesian3.fromElements(e[3],e[4],e[5],v)),r.z=t.Cartesian3.magnitude(t.Cartesian3.fromElements(e[6],e[7],e[8],v)),r};var g=new t.Cartesian3;y.getMaximumScale=function(e){return y.getScale(e,g),t.Cartesian3.maximumComponent(g)},y.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=d,r[8]=f,r},y.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},y.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},y.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},y.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},y.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},y.negate=function(e,t){return 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],t},y.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],d=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=d,t};var C=new t.Cartesian3(1,1,1);y.getRotation=function(e,r){var n=t.Cartesian3.divideComponents(C,y.getScale(e,g),g);return r=y.multiplyByScale(e,n,r)};var w=[1,0,0],q=[2,2,1];function x(e){for(var t=0,r=0;r<3;++r){var n=e[y.getElementIndex(q[r],w[r])];t+=2*n*n}return Math.sqrt(t)}function b(e,t){for(var r=a.Math3D.EPSILON15,n=0,i=1,o=0;o<3;++o){var u=Math.abs(e[y.getElementIndex(q[o],w[o])]);u>n&&(i=o,n=u)}var s=1,c=0,d=w[i],f=q[i];if(Math.abs(e[y.getElementIndex(f,d)])>r){var l,h=(e[y.getElementIndex(f,f)]-e[y.getElementIndex(d,d)])/2/e[y.getElementIndex(f,d)];c=(l=h<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(s=1/Math.sqrt(1+l*l))}return(t=y.clone(y.IDENTITY,t))[y.getElementIndex(d,d)]=t[y.getElementIndex(f,f)]=s,t[y.getElementIndex(f,d)]=c,t[y.getElementIndex(d,f)]=-c,t}var R=new y,O=new y;function M(e,t,r,a,i,o,u,s,c,d,f,l,h,p,m,y){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(i,0),this[2]=n.defaultValue(c,0),this[3]=n.defaultValue(h,0),this[4]=n.defaultValue(t,0),this[5]=n.defaultValue(o,0),this[6]=n.defaultValue(d,0),this[7]=n.defaultValue(p,0),this[8]=n.defaultValue(r,0),this[9]=n.defaultValue(u,0),this[10]=n.defaultValue(f,0),this[11]=n.defaultValue(m,0),this[12]=n.defaultValue(a,0),this[13]=n.defaultValue(s,0),this[14]=n.defaultValue(l,0),this[15]=n.defaultValue(y,0)}y.computeEigenDecomposition=function(e,t){var r=a.Math3D.EPSILON20,i=0,o=0;n.defined(t)||(t={});for(var u=t.unitary=y.clone(y.IDENTITY,t.unitary),s=t.diagonal=y.clone(e,t.diagonal),c=r*function(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}(s);o<10&&x(s)>c;)b(s,R),y.transpose(R,O),y.multiply(s,R,s),y.multiply(O,s,s),y.multiply(u,R,u),++i>2&&(++o,i=0);return t},y.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},y.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},y.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],s=e[6],c=e[7],d=e[8],f=y.determinant(e);t[0]=o*d-c*u,t[1]=c*a-n*d,t[2]=n*u-o*a,t[3]=s*u-i*d,t[4]=r*d-s*a,t[5]=i*a-r*u,t[6]=i*c-s*o,t[7]=s*n-r*c,t[8]=r*o-i*n;var l=1/f;return y.multiplyByScalar(t,l,t)},y.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},y.equalsEpsilon=function(e,t,r){return e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},y.IDENTITY=Object.freeze(new y(1,0,0,0,1,0,0,0,1)),y.ZERO=Object.freeze(new y(0,0,0,0,0,0,0,0,0)),y.COLUMN0ROW0=0,y.COLUMN0ROW1=1,y.COLUMN0ROW2=2,y.COLUMN1ROW0=3,y.COLUMN1ROW1=4,y.COLUMN1ROW2=5,y.COLUMN2ROW0=6,y.COLUMN2ROW1=7,y.COLUMN2ROW2=8,Object.defineProperties(y.prototype,{length:{get:function(){return y.packedLength}}}),y.prototype.clone=function(e){return y.clone(this,e)},y.prototype.equals=function(e){return y.equals(this,e)},y.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},y.prototype.equalsEpsilon=function(e,t){return y.equalsEpsilon(this,e,t)},y.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},M.packedLength=16,M.pack=function(e,t,r){return r=n.defaultValue(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},M.unpack=function(e,t,r){return t=n.defaultValue(t,0),n.defined(r)||(r=new M),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},M.clone=function(e,t){if(n.defined(e))return n.defined(t)?(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],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new M(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},M.fromArray=M.unpack,M.fromColumnMajorArray=function(e,t){return M.clone(e,t)},M.fromRowMajorArray=function(e,t){return n.defined(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new M(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},M.fromRotationTranslation=function(e,r,a){return r=n.defaultValue(r,t.Cartesian3.ZERO),n.defined(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a):new M(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},M.fromTranslationQuaternionRotationScale=function(e,t,r,a){n.defined(a)||(a=new M);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,d=t.x*t.z,f=t.x*t.w,l=t.y*t.y,h=t.y*t.z,p=t.y*t.w,m=t.z*t.z,y=t.z*t.w,v=t.w*t.w,g=s-l-m+v,C=2*(c-y),w=2*(d+p),q=2*(c+y),x=-s+l-m+v,b=2*(h-f),R=2*(d-p),O=2*(h+f),_=-s-l+m+v;return a[0]=g*i,a[1]=q*i,a[2]=R*i,a[3]=0,a[4]=C*o,a[5]=x*o,a[6]=O*o,a[7]=0,a[8]=w*u,a[9]=b*u,a[10]=_*u,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},M.fromTranslationRotationScale=function(e,t){return M.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},M.fromTranslation=function(e,t){return M.fromRotationTranslation(y.IDENTITY,e,t)},M.fromScale=function(e,t){return n.defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new M(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},M.fromUniformScale=function(e,t){return n.defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new M(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new t.Cartesian3,S=new t.Cartesian3,E=new t.Cartesian3;M.fromCamera=function(e,r){var a=e.position,i=e.direction,o=e.up;t.Cartesian3.normalize(i,_),t.Cartesian3.normalize(t.Cartesian3.cross(_,o,S),S),t.Cartesian3.normalize(t.Cartesian3.cross(S,_,E),E);var u=S.x,s=S.y,c=S.z,d=_.x,f=_.y,l=_.z,h=E.x,p=E.y,m=E.z,y=a.x,v=a.y,g=a.z,C=u*-y+s*-v+c*-g,w=h*-y+p*-v+m*-g,q=d*y+f*v+l*g;return n.defined(r)?(r[0]=u,r[1]=h,r[2]=-d,r[3]=0,r[4]=s,r[5]=p,r[6]=-f,r[7]=0,r[8]=c,r[9]=m,r[10]=-l,r[11]=0,r[12]=C,r[13]=w,r[14]=q,r[15]=1,r):new M(u,s,c,C,h,p,m,w,-d,-f,-l,q,0,0,0,1)},M.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=1/Math.tan(.5*e),o=i/t,u=(n+r)/(r-n),s=2*n*r/(r-n);return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},M.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),d=-(t+e)*u,f=-(n+r)*s,l=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=d,o[13]=f,o[14]=l,o[15]=1,o},M.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),d=(n+r)/(n-r),f=-(i+a)/(i-a),l=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=d,o[10]=f,o[11]=-1,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},M.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=-1,i[11]=-1,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},M.computeViewportTransformation=function(e,t,r,a){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);var i=n.defaultValue(e.x,0),o=n.defaultValue(e.y,0),u=n.defaultValue(e.width,0),s=n.defaultValue(e.height,0);t=n.defaultValue(t,0);var c=.5*u,d=.5*s,f=.5*((r=n.defaultValue(r,1))-t),l=c,h=d,p=f,m=i+c,y=o+d,v=t+f;return a[0]=l,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=m,a[13]=y,a[14]=v,a[15]=1,a},M.computeView=function(e,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-t.Cartesian3.dot(a,e),i[13]=-t.Cartesian3.dot(n,e),i[14]=t.Cartesian3.dot(r,e),i[15]=1,i},M.toArray=function(e,t){return n.defined(t)?(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],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},M.getElementIndex=function(e,t){return 4*e+t},M.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},M.setColumn=function(e,t,r,n){var a=4*t;return(n=M.clone(e,n))[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},M.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r};var A=new t.Cartesian3;M.setScale=function(e,r,n){var a=M.getScale(e,A),i=t.Cartesian3.divideComponents(r,a,A);return M.multiplyByScale(e,i,n)},M.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},M.setRow=function(e,t,r,n){return(n=M.clone(e,n))[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var T=new t.Cartesian3;M.getScale=function(e,r){return r.x=t.Cartesian3.magnitude(t.Cartesian3.fromElements(e[0],e[1],e[2],T)),r.y=t.Cartesian3.magnitude(t.Cartesian3.fromElements(e[4],e[5],e[6],T)),r.z=t.Cartesian3.magnitude(t.Cartesian3.fromElements(e[8],e[9],e[10],T)),r};var I=new t.Cartesian3;M.getMaximumScale=function(e){return M.getScale(e,I),t.Cartesian3.maximumComponent(I)},M.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],d=e[7],f=e[8],l=e[9],h=e[10],p=e[11],m=e[12],y=e[13],v=e[14],g=e[15],C=t[0],w=t[1],q=t[2],x=t[3],b=t[4],R=t[5],O=t[6],M=t[7],_=t[8],S=t[9],E=t[10],A=t[11],T=t[12],I=t[13],z=t[14],P=t[15],V=n*C+u*w+f*q+m*x,L=a*C+s*w+l*q+y*x,D=i*C+c*w+h*q+v*x,N=o*C+d*w+p*q+g*x,U=n*b+u*R+f*O+m*M,k=a*b+s*R+l*O+y*M,B=i*b+c*R+h*O+v*M,j=o*b+d*R+p*O+g*M,W=n*_+u*S+f*E+m*A,F=a*_+s*S+l*E+y*A,K=i*_+c*S+h*E+v*A,H=o*_+d*S+p*E+g*A,G=n*T+u*I+f*z+m*P,X=a*T+s*I+l*z+y*P,Y=i*T+c*I+h*z+v*P,Z=o*T+d*I+p*z+g*P;return r[0]=V,r[1]=L,r[2]=D,r[3]=N,r[4]=U,r[5]=k,r[6]=B,r[7]=j,r[8]=W,r[9]=F,r[10]=K,r[11]=H,r[12]=G,r[13]=X,r[14]=Y,r[15]=Z,r},M.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},M.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},M.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],d=e[9],f=e[10],l=e[12],h=e[13],p=e[14],m=t[0],y=t[1],v=t[2],g=t[4],C=t[5],w=t[6],q=t[8],x=t[9],b=t[10],R=t[12],O=t[13],M=t[14],_=n*m+o*y+c*v,S=a*m+u*y+d*v,E=i*m+s*y+f*v,A=n*g+o*C+c*w,T=a*g+u*C+d*w,I=i*g+s*C+f*w,z=n*q+o*x+c*b,P=a*q+u*x+d*b,V=i*q+s*x+f*b,L=n*R+o*O+c*M+l,D=a*R+u*O+d*M+h,N=i*R+s*O+f*M+p;return r[0]=_,r[1]=S,r[2]=E,r[3]=0,r[4]=A,r[5]=T,r[6]=I,r[7]=0,r[8]=z,r[9]=P,r[10]=V,r[11]=0,r[12]=L,r[13]=D,r[14]=N,r[15]=1,r},M.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],d=e[9],f=e[10],l=t[0],h=t[1],p=t[2],m=t[3],y=t[4],v=t[5],g=t[6],C=t[7],w=t[8],q=n*l+o*h+c*p,x=a*l+u*h+d*p,b=i*l+s*h+f*p,R=n*m+o*y+c*v,O=a*m+u*y+d*v,M=i*m+s*y+f*v,_=n*g+o*C+c*w,S=a*g+u*C+d*w,E=i*g+s*C+f*w;return r[0]=q,r[1]=x,r[2]=b,r[3]=0,r[4]=R,r[5]=O,r[6]=M,r[7]=0,r[8]=_,r[9]=S,r[10]=E,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},M.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var z=new t.Cartesian3;M.multiplyByUniformScale=function(e,t,r){return z.x=t,z.y=t,z.z=t,M.multiplyByScale(e,z,r)},M.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?M.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},M.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,d=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=d,r},M.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},M.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},M.multiplyByDirection=function(e,t,r){var n=t.x,a=t.y,i=t.z;return r.x=n*e[0]+a*e[4]+i*e[8],r.y=n*e[1]+a*e[5]+i*e[9],r.z=n*e[2]+a*e[6]+i*e[10],r},M.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},M.multiplyByPlane=function(e,r,n){var a=new M,i=new M;M.inverse(e,a),M.transpose(a,i);var o=new t.Cartesian4(r.normal.x,r.normal.y,r.normal.z,r.distance);M.multiplyByVector(i,o,o),n.normal.x=o.x,n.normal.y=o.y,n.normal.z=o.z;var u=t.Cartesian3.magnitude(n.normal);return t.Cartesian3.normalize(n.normal,n.normal),n.distance=o.w/u,n},M.negate=function(e,t){return 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],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},M.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},M.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},M.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},M.equalsEpsilon=function(e,t,r){return e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},M.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},M.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},M.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var P=new y,V=new y,L=new t.Cartesian4,D=new t.Cartesian4(0,0,0,1);function N(e,t,r,a){this.west=n.defaultValue(e,0),this.south=n.defaultValue(t,0),this.east=n.defaultValue(r,0),this.north=n.defaultValue(a,0)}M.inverse=function(e,r){var n=e[0],o=e[4],u=e[8],s=e[12],c=e[1],d=e[5],f=e[9],l=e[13],h=e[2],p=e[6],m=e[10],v=e[14],g=e[3],C=e[7],w=e[11],q=e[15],x=m*q,b=v*w,R=p*q,O=v*C,_=p*w,S=m*C,E=h*q,A=v*g,T=h*w,I=m*g,z=h*C,N=p*g,U=x*d+O*f+_*l-(b*d+R*f+S*l),k=b*c+E*f+I*l-(x*c+A*f+T*l),B=R*c+A*d+z*l-(O*c+E*d+N*l),j=S*c+T*d+N*f-(_*c+I*d+z*f),W=b*o+R*u+S*s-(x*o+O*u+_*s),F=x*n+A*u+T*s-(b*n+E*u+I*s),K=O*n+E*o+N*s-(R*n+A*o+z*s),H=_*n+I*o+z*u-(S*n+T*o+N*u),G=(x=u*l)*C+(O=s*d)*w+(_=o*f)*q-((b=s*f)*C+(R=o*l)*w+(S=u*d)*q),X=b*g+(E=n*l)*w+(I=u*c)*q-(x*g+(A=s*c)*w+(T=n*f)*q),Y=R*g+A*C+(z=n*d)*q-(O*g+E*C+(N=o*c)*q),Z=S*g+T*C+N*w-(_*g+I*C+z*w),J=R*m+S*v+b*p-(_*v+x*p+O*m),Q=T*v+x*h+A*m-(E*m+I*v+b*h),$=E*p+N*v+O*h-(z*v+R*h+A*p),ee=z*m+_*h+I*p-(T*p+N*m+S*h),te=n*U+o*k+u*B+s*j;if(Math.abs(te)<a.Math3D.EPSILON21){if(y.equalsEpsilon(M.getRotation(e,P),V,a.Math3D.EPSILON7)&&t.Cartesian4.equals(M.getRow(e,3,L),D))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;throw new i.RuntimeError("matrix is not invertible because its determinate is zero.")}return te=1/te,r[0]=U*te,r[1]=k*te,r[2]=B*te,r[3]=j*te,r[4]=W*te,r[5]=F*te,r[6]=K*te,r[7]=H*te,r[8]=G*te,r[9]=X*te,r[10]=Y*te,r[11]=Z*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},M.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],d=e[10],f=e[12],l=e[13],h=e[14],p=-r*f-n*l-a*h,m=-i*f-o*l-u*h,y=-s*f-c*l-d*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=d,t[11]=0,t[12]=p,t[13]=m,t[14]=y,t[15]=1,t},M.IDENTITY=Object.freeze(new M(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),M.ZERO=Object.freeze(new M(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),M.COLUMN0ROW0=0,M.COLUMN0ROW1=1,M.COLUMN0ROW2=2,M.COLUMN0ROW3=3,M.COLUMN1ROW0=4,M.COLUMN1ROW1=5,M.COLUMN1ROW2=6,M.COLUMN1ROW3=7,M.COLUMN2ROW0=8,M.COLUMN2ROW1=9,M.COLUMN2ROW2=10,M.COLUMN2ROW3=11,M.COLUMN3ROW0=12,M.COLUMN3ROW1=13,M.COLUMN3ROW2=14,M.COLUMN3ROW3=15,Object.defineProperties(M.prototype,{length:{get:function(){return M.packedLength}}}),M.prototype.clone=function(e){return M.clone(this,e)},M.prototype.equals=function(e){return M.equals(this,e)},M.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},M.prototype.equalsEpsilon=function(e,t){return M.equalsEpsilon(this,e,t)},M.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},Object.defineProperties(N.prototype,{width:{get:function(){return N.computeWidth(this)}},height:{get:function(){return N.computeHeight(this)}}}),N.packedLength=4,N.pack=function(e,t,r){return r=n.defaultValue(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},N.unpack=function(e,t,r){return t=n.defaultValue(t,0),n.defined(r)||(r=new N),r.west=e[t++],r.south=e[t++],r.east=e[t++],r.north=e[t],r},N.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=a.Math3D.TWO_PI),t-r},N.computeHeight=function(e){return e.north-e.south},N.fromDegrees=function(e,t,r,i,o){return e=a.Math3D.toRadians(n.defaultValue(e,0)),t=a.Math3D.toRadians(n.defaultValue(t,0)),r=a.Math3D.toRadians(n.defaultValue(r,0)),i=a.Math3D.toRadians(n.defaultValue(i,0)),n.defined(o)?(o.west=e,o.south=t,o.east=r,o.north=i,o):new N(e,t,r,i)},N.fromRadians=function(e,t,r,a,i){return n.defined(i)?(i.west=n.defaultValue(e,0),i.south=n.defaultValue(t,0),i.east=n.defaultValue(r,0),i.north=n.defaultValue(a,0),i):new N(e,t,r,a)},N.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,u=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0,f=e.length;d<f;d++){var l=e[d];r=Math.min(r,l.longitude),i=Math.max(i,l.longitude),s=Math.min(s,l.latitude),c=Math.max(c,l.latitude);var h=l.longitude>=0?l.longitude:l.longitude+a.Math3D.TWO_PI;o=Math.min(o,h),u=Math.max(u,h)}return i-r>u-o&&(r=o,(i=u)>a.Math3D.PI&&(i-=a.Math3D.TWO_PI),r>a.Math3D.PI&&(r-=a.Math3D.TWO_PI)),n.defined(t)?(t.west=r,t.south=s,t.east=i,t.north=c,t):new N(r,s,i,c)},N.fromCartesianArray=function(e,t,r){t=n.defaultValue(t,u.WGS84);for(var i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=Number.MAX_VALUE,f=-Number.MAX_VALUE,l=0,h=e.length;l<h;l++){var p=t.cartesianToCartographic(e[l]);i=Math.min(i,p.longitude),o=Math.max(o,p.longitude),d=Math.min(d,p.latitude),f=Math.max(f,p.latitude);var m=p.longitude>=0?p.longitude:p.longitude+a.Math3D.TWO_PI;s=Math.min(s,m),c=Math.max(c,m)}return o-i>c-s&&(i=s,(o=c)>a.Math3D.PI&&(o-=a.Math3D.TWO_PI),i>a.Math3D.PI&&(i-=a.Math3D.TWO_PI)),n.defined(r)?(r.west=i,r.south=d,r.east=o,r.north=f,r):new N(i,d,o,f)},N.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new N(e.west,e.south,e.east,e.north)},N.equalsEpsilon=function(e,t,r){return e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.west-t.west)<=r&&Math.abs(e.south-t.south)<=r&&Math.abs(e.east-t.east)<=r&&Math.abs(e.north-t.north)<=r},N.prototype.clone=function(e){return N.clone(this,e)},N.prototype.equals=function(e){return N.equals(this,e)},N.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},N.prototype.equalsEpsilon=function(e,t){return N.equalsEpsilon(this,e,t)},N.validate=function(e){},N.southwest=function(e,r){return n.defined(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t.Cartographic(e.west,e.south)},N.northwest=function(e,r){return n.defined(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t.Cartographic(e.west,e.north)},N.northeast=function(e,r){return n.defined(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t.Cartographic(e.east,e.north)},N.southeast=function(e,r){return n.defined(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t.Cartographic(e.east,e.south)},N.center=function(e,r){var i=e.east,o=e.west;i<o&&(i+=a.Math3D.TWO_PI);var u=a.Math3D.negativePiToPi(.5*(o+i)),s=.5*(e.south+e.north);return n.defined(r)?(r.longitude=u,r.latitude=s,r.height=0,r):new t.Cartographic(u,s)},N.intersection=function(e,t,r){var i=e.east,o=e.west,u=t.east,s=t.west;i<o&&u>0?i+=a.Math3D.TWO_PI:u<s&&i>0&&(u+=a.Math3D.TWO_PI),i<o&&s<0?s+=a.Math3D.TWO_PI:u<s&&o<0&&(o+=a.Math3D.TWO_PI);var c=a.Math3D.negativePiToPi(Math.max(o,s)),d=a.Math3D.negativePiToPi(Math.min(i,u));if(!((e.west<e.east||t.west<t.east)&&d<=c)){var f=Math.max(e.south,t.south),l=Math.min(e.north,t.north);if(!(f>=l))return n.defined(r)?(r.west=c,r.south=f,r.east=d,r.north=l,r):new N(c,f,d,l)}},N.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n.defined(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new N(a,i,o,u)},N.union=function(e,t,r){n.defined(r)||(r=new N);var i=e.east,o=e.west,u=t.east,s=t.west;i<o&&u>0?i+=a.Math3D.TWO_PI:u<s&&i>0&&(u+=a.Math3D.TWO_PI),i<o&&s<0?s+=a.Math3D.TWO_PI:u<s&&o<0&&(o+=a.Math3D.TWO_PI);var c=a.Math3D.convertLongitudeRange(Math.min(o,s)),d=a.Math3D.convertLongitudeRange(Math.max(i,u));return r.west=c,r.south=Math.min(e.south,t.south),r.east=d,r.north=Math.max(e.north,t.north),r},N.expand=function(e,t,r){return n.defined(r)||(r=new N),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},N.contains=function(e,t){var r=t.longitude,n=t.latitude,i=e.west,o=e.east;return o<i&&(o+=a.Math3D.TWO_PI,r<0&&(r+=a.Math3D.TWO_PI)),(r>i||a.Math3D.equalsEpsilon(r,i,a.Math3D.EPSILON14))&&(r<o||a.Math3D.equalsEpsilon(r,o,a.Math3D.EPSILON14))&&n>=e.south&&n<=e.north};var U=new t.Cartographic;N.subsample=function(e,t,r,i){t=n.defaultValue(t,u.WGS84),r=n.defaultValue(r,0),n.defined(i)||(i=[]);var o=0,s=e.north,c=e.south,d=e.east,f=e.west,l=U;l.height=r,l.longitude=f,l.latitude=s,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.longitude=d,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.latitude=c,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.longitude=f,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.latitude=s<0?s:c>0?c:0;for(var h=1;h<8;++h)l.longitude=-Math.PI+h*a.Math3D.PI_OVER_TWO,N.contains(e,l)&&(i[o]=t.cartographicToCartesian(l,i[o]),o++);return 0===l.latitude&&(l.longitude=f,i[o]=t.cartographicToCartesian(l,i[o]),o++,l.longitude=d,i[o]=t.cartographicToCartesian(l,i[o]),o++),i.length=o,i};var k=new t.Cartographic;function B(e,r){this.center=t.Cartesian3.clone(n.defaultValue(e,t.Cartesian3.ZERO)),this.radius=n.defaultValue(r,0)}N.prototype.contains=function(e){return N.contains(this,N.southwest(e,k))&&N.contains(this,N.northwest(e,k))&&N.contains(this,N.southeast(e,k))&&N.contains(this,N.northeast(e,k))},N.MAX_VALUE=Object.freeze(new N(-Math.PI,-a.Math3D.PI_OVER_TWO,Math.PI,a.Math3D.PI_OVER_TWO));var j=new t.Cartesian3,W=new t.Cartesian3,F=new t.Cartesian3,K=new t.Cartesian3,H=new t.Cartesian3,G=new t.Cartesian3,X=new t.Cartesian3,Y=new t.Cartesian3,Z=new t.Cartesian3,J=new t.Cartesian3,Q=new t.Cartesian3,$=new t.Cartesian3,ee=4/3*a.Math3D.PI;B.fromPoints=function(e,r){if(n.defined(r)||(r=new B),!n.defined(e)||0===e.length)return r.center=t.Cartesian3.clone(t.Cartesian3.ZERO,r.center),r.radius=0,r;var a,i=t.Cartesian3.clone(e[0],X),o=t.Cartesian3.clone(i,j),u=t.Cartesian3.clone(i,W),s=t.Cartesian3.clone(i,F),c=t.Cartesian3.clone(i,K),d=t.Cartesian3.clone(i,H),f=t.Cartesian3.clone(i,G),l=e.length;for(a=1;a<l;a++){t.Cartesian3.clone(e[a],i);var h=i.x,p=i.y,m=i.z;h<o.x&&t.Cartesian3.clone(i,o),h>c.x&&t.Cartesian3.clone(i,c),p<u.y&&t.Cartesian3.clone(i,u),p>d.y&&t.Cartesian3.clone(i,d),m<s.z&&t.Cartesian3.clone(i,s),m>f.z&&t.Cartesian3.clone(i,f)}var y=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(c,o,Y)),v=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(d,u,Y)),g=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(f,s,Y)),C=o,w=c,q=y;v>q&&(q=v,C=u,w=d),g>q&&(q=g,C=s,w=f);var x=Z;x.x=.5*(C.x+w.x),x.y=.5*(C.y+w.y),x.z=.5*(C.z+w.z);var b=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(w,x,Y)),R=Math.sqrt(b),O=J;O.x=o.x,O.y=u.y,O.z=s.z;var M=Q;M.x=c.x,M.y=d.y,M.z=f.z;var _=t.Cartesian3.midpoint(O,M,$),S=0;for(a=0;a<l;a++){t.Cartesian3.clone(e[a],i);var E=t.Cartesian3.magnitude(t.Cartesian3.subtract(i,_,Y));E>S&&(S=E);var A=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,x,Y));if(A>b){var T=Math.sqrt(A);b=(R=.5*(R+T))*R;var I=T-R;x.x=(R*x.x+I*i.x)/T,x.y=(R*x.y+I*i.y)/T,x.z=(R*x.z+I*i.z)/T}}return R<S?(t.Cartesian3.clone(x,r.center),r.radius=R):(t.Cartesian3.clone(_,r.center),r.radius=S),r};var te=new h,re=new t.Cartesian3,ne=new t.Cartesian3,ae=new t.Cartographic,ie=new t.Cartographic;B.fromRectangle2D=function(e,t,r){return B.fromRectangleWithHeights2D(e,t,0,0,r)},B.fromRectangleWithHeights2D=function(e,r,a,i,o){if(n.defined(o)||(o=new B),!n.defined(e))return o.center=t.Cartesian3.clone(t.Cartesian3.ZERO,o.center),o.radius=0,o;r=n.defaultValue(r,te),N.southwest(e,ae),ae.height=a,N.northeast(e,ie),ie.height=i;var u=r.project(ae,re),s=r.project(ie,ne),c=s.x-u.x,d=s.y-u.y,f=s.z-u.z;o.radius=.5*Math.sqrt(c*c+d*d+f*f);var l=o.center;return l.x=u.x+.5*c,l.y=u.y+.5*d,l.z=u.z+.5*f,o};var oe=[];B.fromRectangle3D=function(e,r,a,i){if(r=n.defaultValue(r,u.WGS84),a=n.defaultValue(a,0),n.defined(i)||(i=new B),!n.defined(e))return i.center=t.Cartesian3.clone(t.Cartesian3.ZERO,i.center),i.radius=0,i;var o=N.subsample(e,r,a,oe);return B.fromPoints(o,i)},B.fromVertices=function(e,r,a,i){if(n.defined(i)||(i=new B),!n.defined(e)||0===e.length)return i.center=t.Cartesian3.clone(t.Cartesian3.ZERO,i.center),i.radius=0,i;r=n.defaultValue(r,t.Cartesian3.ZERO),a=n.defaultValue(a,3);var o=X;o.x=e[0]+r.x,o.y=e[1]+r.y,o.z=e[2]+r.z;var u,s=t.Cartesian3.clone(o,j),c=t.Cartesian3.clone(o,W),d=t.Cartesian3.clone(o,F),f=t.Cartesian3.clone(o,K),l=t.Cartesian3.clone(o,H),h=t.Cartesian3.clone(o,G),p=e.length;for(u=0;u<p;u+=a){var m=e[u]+r.x,y=e[u+1]+r.y,v=e[u+2]+r.z;o.x=m,o.y=y,o.z=v,m<s.x&&t.Cartesian3.clone(o,s),m>f.x&&t.Cartesian3.clone(o,f),y<c.y&&t.Cartesian3.clone(o,c),y>l.y&&t.Cartesian3.clone(o,l),v<d.z&&t.Cartesian3.clone(o,d),v>h.z&&t.Cartesian3.clone(o,h)}var g=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(f,s,Y)),C=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,c,Y)),w=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(h,d,Y)),q=s,x=f,b=g;C>b&&(b=C,q=c,x=l),w>b&&(b=w,q=d,x=h);var R=Z;R.x=.5*(q.x+x.x),R.y=.5*(q.y+x.y),R.z=.5*(q.z+x.z);var O=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(x,R,Y)),M=Math.sqrt(O),_=J;_.x=s.x,_.y=c.y,_.z=d.z;var S=Q;S.x=f.x,S.y=l.y,S.z=h.z;var E=t.Cartesian3.midpoint(_,S,$),A=0;for(u=0;u<p;u+=a){o.x=e[u]+r.x,o.y=e[u+1]+r.y,o.z=e[u+2]+r.z;var T=t.Cartesian3.magnitude(t.Cartesian3.subtract(o,E,Y));T>A&&(A=T);var I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(o,R,Y));if(I>O){var z=Math.sqrt(I);O=(M=.5*(M+z))*M;var P=z-M;R.x=(M*R.x+P*o.x)/z,R.y=(M*R.y+P*o.y)/z,R.z=(M*R.z+P*o.z)/z}}return M<A?(t.Cartesian3.clone(R,i.center),i.radius=M):(t.Cartesian3.clone(E,i.center),i.radius=A),i},B.fromEncodedCartesianVertices=function(e,r,a){if(n.defined(a)||(a=new B),!n.defined(e)||!n.defined(r)||e.length!==r.length||0===e.length)return a.center=t.Cartesian3.clone(t.Cartesian3.ZERO,a.center),a.radius=0,a;var i=X;i.x=e[0]+r[0],i.y=e[1]+r[1],i.z=e[2]+r[2];var o,u=t.Cartesian3.clone(i,j),s=t.Cartesian3.clone(i,W),c=t.Cartesian3.clone(i,F),d=t.Cartesian3.clone(i,K),f=t.Cartesian3.clone(i,H),l=t.Cartesian3.clone(i,G),h=e.length;for(o=0;o<h;o+=3){var p=e[o]+r[o],m=e[o+1]+r[o+1],y=e[o+2]+r[o+2];i.x=p,i.y=m,i.z=y,p<u.x&&t.Cartesian3.clone(i,u),p>d.x&&t.Cartesian3.clone(i,d),m<s.y&&t.Cartesian3.clone(i,s),m>f.y&&t.Cartesian3.clone(i,f),y<c.z&&t.Cartesian3.clone(i,c),y>l.z&&t.Cartesian3.clone(i,l)}var v=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(d,u,Y)),g=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(f,s,Y)),C=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(l,c,Y)),w=u,q=d,x=v;g>x&&(x=g,w=s,q=f),C>x&&(x=C,w=c,q=l);var b=Z;b.x=.5*(w.x+q.x),b.y=.5*(w.y+q.y),b.z=.5*(w.z+q.z);var R=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(q,b,Y)),O=Math.sqrt(R),M=J;M.x=u.x,M.y=s.y,M.z=c.z;var _=Q;_.x=d.x,_.y=f.y,_.z=l.z;var S=t.Cartesian3.midpoint(M,_,$),E=0;for(o=0;o<h;o+=3){i.x=e[o]+r[o],i.y=e[o+1]+r[o+1],i.z=e[o+2]+r[o+2];var A=t.Cartesian3.magnitude(t.Cartesian3.subtract(i,S,Y));A>E&&(E=A);var T=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,b,Y));if(T>R){var I=Math.sqrt(T);R=(O=.5*(O+I))*O;var z=I-O;b.x=(O*b.x+z*i.x)/I,b.y=(O*b.y+z*i.y)/I,b.z=(O*b.z+z*i.z)/I}}return O<E?(t.Cartesian3.clone(b,a.center),a.radius=O):(t.Cartesian3.clone(S,a.center),a.radius=E),a},B.fromCornerPoints=function(e,r,a){n.defined(a)||(a=new B);var i=t.Cartesian3.midpoint(e,r,a.center);return a.radius=t.Cartesian3.distance(i,r),a},B.fromEllipsoid=function(e,r){return n.defined(r)||(r=new B),t.Cartesian3.clone(t.Cartesian3.ZERO,r.center),r.radius=e.maximumRadius,r};var ue=new t.Cartesian3;B.fromBoundingSpheres=function(e,r){if(n.defined(r)||(r=new B),!n.defined(e)||0===e.length)return r.center=t.Cartesian3.clone(t.Cartesian3.ZERO,r.center),r.radius=0,r;var a=e.length;if(1===a)return B.clone(e[0],r);if(2===a)return B.union(e[0],e[1],r);var i,o=[];for(i=0;i<a;i++)o.push(e[i].center);var u=(r=B.fromPoints(o,r)).center,s=r.radius;for(i=0;i<a;i++){var c=e[i];s=Math.max(s,t.Cartesian3.distance(u,c.center,ue)+c.radius)}return r.radius=s,r};var se=new t.Cartesian3,ce=new t.Cartesian3,de=new t.Cartesian3;B.fromOrientedBoundingBox=function(e,r){n.defined(r)||(r=new B);var a=e.halfAxes,i=y.getColumn(a,0,se),o=y.getColumn(a,1,ce),u=y.getColumn(a,2,de);return t.Cartesian3.add(i,o,i),t.Cartesian3.add(i,u,i),r.center=t.Cartesian3.clone(e.center,r.center),r.radius=t.Cartesian3.magnitude(i),r},B.clone=function(e,r){if(n.defined(e))return n.defined(r)?(r.center=t.Cartesian3.clone(e.center,r.center),r.radius=e.radius,r):new B(e.center,e.radius)},B.packedLength=4,B.pack=function(e,t,r){r=n.defaultValue(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},B.unpack=function(e,t,r){t=n.defaultValue(t,0),n.defined(r)||(r=new B);var a=r.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],r.radius=e[t],r};var fe=new t.Cartesian3,le=new t.Cartesian3;B.union=function(e,r,a){n.defined(a)||(a=new B);var i=e.center,o=e.radius,u=r.center,s=r.radius,c=t.Cartesian3.subtract(u,i,fe),d=t.Cartesian3.magnitude(c);if(o>=d+s)return e.clone(a),a;if(s>=d+o)return r.clone(a),a;var f=.5*(o+d+s),l=t.Cartesian3.multiplyByScalar(c,(-o+f)/d,le);return t.Cartesian3.add(l,i,l),t.Cartesian3.clone(l,a.center),a.radius=f,a};var he=new t.Cartesian3;B.expand=function(e,r,n){n=B.clone(e,n);var a=t.Cartesian3.magnitude(t.Cartesian3.subtract(r,n.center,he));return a>n.radius&&(n.radius=a),n},B.intersectPlane=function(e,r){var n=e.center,a=e.radius,i=r.normal,o=t.Cartesian3.dot(i,n)+r.distance;return o<-a?p.OUTSIDE:o<a?p.INTERSECTING:p.INSIDE},B.transform=function(e,t,r){return n.defined(r)||(r=new B),r.center=M.multiplyByPoint(t,e.center,r.center),r.radius=M.getMaximumScale(t)*e.radius,r};var pe=new t.Cartesian3;B.distanceSquaredTo=function(e,r){var n=t.Cartesian3.subtract(e.center,r,pe);return t.Cartesian3.magnitudeSquared(n)-e.radius*e.radius},B.transformWithoutScale=function(e,t,r){return n.defined(r)||(r=new B),r.center=M.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var me=new t.Cartesian3;B.computePlaneDistances=function(e,r,a,i){n.defined(i)||(i=new m);var o=t.Cartesian3.subtract(e.center,r,me),u=t.Cartesian3.dot(a,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var ye=new t.Cartesian3,ve=new t.Cartesian3,ge=new t.Cartesian3,Ce=new t.Cartesian3,we=new t.Cartesian3,qe=new t.Cartographic,xe=new Array(8),be=0;be<8;++be)xe[be]=new t.Cartesian3;var Re=new h;function Oe(e,t){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0)}B.projectTo2D=function(e,r,a){var i,o=(r=n.defaultValue(r,Re)).ellipsoid,u=e.center,s=e.radius;i=t.Cartesian3.equals(u,t.Cartesian3.ZERO)?t.Cartesian3.clone(t.Cartesian3.UNIT_X,ye):o.geodeticSurfaceNormal(u,ye);var c=t.Cartesian3.cross(t.Cartesian3.UNIT_Z,i,ve);t.Cartesian3.normalize(c,c);var d=t.Cartesian3.cross(i,c,ge);t.Cartesian3.normalize(d,d),t.Cartesian3.multiplyByScalar(i,s,i),t.Cartesian3.multiplyByScalar(d,s,d),t.Cartesian3.multiplyByScalar(c,s,c);var f=t.Cartesian3.negate(d,we),l=t.Cartesian3.negate(c,Ce),h=xe,p=h[0];t.Cartesian3.add(i,d,p),t.Cartesian3.add(p,c,p),p=h[1],t.Cartesian3.add(i,d,p),t.Cartesian3.add(p,l,p),p=h[2],t.Cartesian3.add(i,f,p),t.Cartesian3.add(p,l,p),p=h[3],t.Cartesian3.add(i,f,p),t.Cartesian3.add(p,c,p),t.Cartesian3.negate(i,i),p=h[4],t.Cartesian3.add(i,d,p),t.Cartesian3.add(p,c,p),p=h[5],t.Cartesian3.add(i,d,p),t.Cartesian3.add(p,l,p),p=h[6],t.Cartesian3.add(i,f,p),t.Cartesian3.add(p,l,p),p=h[7],t.Cartesian3.add(i,f,p),t.Cartesian3.add(p,c,p);for(var m=h.length,y=0;y<m;++y){var v=h[y];t.Cartesian3.add(u,v,v);var g=o.cartesianToCartographic(v,qe);r.project(g,v)}var C=(u=(a=B.fromPoints(h,a)).center).x,w=u.y,q=u.z;return u.x=q,u.y=C,u.z=w,a},B.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},B.equals=function(e,r){return e===r||n.defined(e)&&n.defined(r)&&t.Cartesian3.equals(e.center,r.center)&&e.radius===r.radius},B.prototype.intersectPlane=function(e){return B.intersectPlane(this,e)},B.prototype.distanceSquaredTo=function(e){return B.distanceSquaredTo(this,e)},B.prototype.computePlaneDistances=function(e,t,r){return B.computePlaneDistances(this,e,t,r)},B.prototype.isOccluded=function(e){return B.isOccluded(this,e)},B.prototype.equals=function(e){return B.equals(this,e)},B.prototype.clone=function(e){return B.clone(this,e)},B.prototype.volume=function(){var e=this.radius;return ee*e*e*e},Oe.fromElements=function(e,t,r){return n.defined(r)?(r.x=e,r.y=t,r):new Oe(e,t)},Oe.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t):new Oe(e.x,e.y)},Oe.fromCartesian3=Oe.clone,Oe.fromCartesian4=Oe.clone,Oe.packedLength=2,Oe.pack=function(e,t,r){return r=n.defaultValue(r,0),t[r++]=e.x,t[r]=e.y,t},Oe.unpack=function(e,t,r){return t=n.defaultValue(t,0),n.defined(r)||(r=new Oe),r.x=e[t++],r.y=e[t],r},Oe.packArray=function(e,t){var a=e.length,i=2*a;if(n.defined(t)){if(!Array.isArray(t)&&t.length!==i)throw new r.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}else t=new Array(i);for(var o=0;o<a;++o)Oe.pack(e[o],t,2*o);return t},Oe.unpackArray=function(e,t){var r=e.length;n.defined(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=Oe.unpack(e,a,t[i])}return t},Oe.fromArray=Oe.unpack,Oe.maximumComponent=function(e){return Math.max(e.x,e.y)},Oe.minimumComponent=function(e){return Math.min(e.x,e.y)},Oe.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},Oe.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},Oe.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},Oe.magnitude=function(e){return Math.sqrt(Oe.magnitudeSquared(e))};var Me=new Oe;Oe.distance=function(e,t){return Oe.subtract(e,t,Me),Oe.magnitude(Me)},Oe.distanceSquared=function(e,t){return Oe.subtract(e,t,Me),Oe.magnitudeSquared(Me)},Oe.normalize=function(e,t){var r=Oe.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},Oe.dot=function(e,t){return e.x*t.x+e.y*t.y},Oe.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},Oe.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},Oe.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},Oe.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},Oe.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},Oe.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},Oe.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},Oe.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var _e=new Oe;Oe.lerp=function(e,t,r,n){return Oe.multiplyByScalar(t,r,_e),n=Oe.multiplyByScalar(e,1-r,n),Oe.add(_e,n,n)};var Se=new Oe,Ee=new Oe;Oe.angleBetween=function(e,t){return Oe.normalize(e,Se),Oe.normalize(t,Ee),a.Math3D.acosClamped(Oe.dot(Se,Ee))};var Ae=new Oe;Oe.mostOrthogonalAxis=function(e,t){var r=Oe.normalize(e,Ae);return Oe.abs(r,r),t=r.x<=r.y?Oe.clone(Oe.UNIT_X,t):Oe.clone(Oe.UNIT_Y,t)},Oe.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y},Oe.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},Oe.equalsEpsilon=function(e,t,r,i){return e===t||n.defined(e)&&n.defined(t)&&a.Math3D.equalsEpsilon(e.x,t.x,r,i)&&a.Math3D.equalsEpsilon(e.y,t.y,r,i)},Oe.ZERO=Object.freeze(new Oe(0,0)),Oe.UNIT_X=Object.freeze(new Oe(1,0)),Oe.UNIT_Y=Object.freeze(new Oe(0,1)),Oe.prototype.clone=function(e){return Oe.clone(this,e)},Oe.prototype.equals=function(e){return Oe.equals(this,e)},Oe.prototype.equalsEpsilon=function(e,t,r){return Oe.equalsEpsilon(this,e,t,r)},Oe.prototype.toString=function(){return"("+this.x+", "+this.y+")"};var Te={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,validate:function(e){return e===Te.POINTS||e===Te.LINES||e===Te.LINE_LOOP||e===Te.LINE_STRIP||e===Te.TRIANGLES||e===Te.TRIANGLE_STRIP||e===Te.TRIANGLE_FAN}},Ie=Object.freeze(Te);
- /**
- * @license
- *
- * Grauw URI utilities
- *
- * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js
- *
- * @author Laurens Holst (http://www.grauw.nl/)
- *
- * Copyright 2012 Laurens Holst
- *
- * 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.
- *
- */
- function ze(e){if(e instanceof ze)this.scheme=e.scheme,this.authority=e.authority,this.path=e.path,this.query=e.query,this.fragment=e.fragment;else if(e){var t=Pe.exec(e);this.scheme=t[1],this.authority=t[2],this.path=t[3],this.query=t[4],this.fragment=t[5]}}ze.prototype.scheme=null,ze.prototype.authority=null,ze.prototype.path="",ze.prototype.query=null,ze.prototype.fragment=null;var Pe=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");ze.prototype.getScheme=function(){return this.scheme},ze.prototype.getAuthority=function(){return this.authority},ze.prototype.getPath=function(){return this.path},ze.prototype.getQuery=function(){return this.query},ze.prototype.getFragment=function(){return this.fragment},ze.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},ze.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},ze.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},ze.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(De,Ue).replace(Ve,Ne)),this.path&&(this.path=this.path.replace(Ve,Ne)),this.query&&(this.query=this.query.replace(Ve,Ne)),this.fragment&&(this.fragment=this.fragment.replace(Ve,Ne))};var Ve=/%[0-9a-z]{2}/gi,Le=/[a-zA-Z0-9\-\._~]/,De=/(.*@)?([^@:]*)(:.*)?/;function Ne(e){var t=unescape(e);return Le.test(t)?t:e.toUpperCase()}function Ue(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}function ke(e,t){if(null===e||"object"!=typeof e)return e;t=n.defaultValue(t,!1);var r=new e.constructor;for(var a in e)if(e.hasOwnProperty(a)){var i=e[a];t&&(i=ke(i,t)),r[a]=i}return r}function Be(e,t,r){r=n.defaultValue(r,!1);var a,i,o,u={},s=n.defined(e),c=n.defined(t);if(s)for(a in e)e.hasOwnProperty(a)&&(i=e[a],c&&r&&"object"==typeof i&&t.hasOwnProperty(a)?(o=t[a],u[a]="object"==typeof o?Be(i,o,r):i):u[a]=i);if(c)for(a in t)t.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(o=t[a],u[a]=o);return u}function je(e,t){var r;return"undefined"!=typeof document&&(r=document),je._implementation(e,t,r)}ze.prototype.resolve=function(e){var t=new ze;return this.scheme?(t.scheme=this.scheme,t.authority=this.authority,t.path=this.path,t.query=this.query):(t.scheme=e.scheme,this.authority?(t.authority=this.authority,t.path=this.path,t.query=this.query):(t.authority=e.authority,""==this.path?(t.path=e.path,t.query=this.query||e.query):("/"==this.path.charAt(0)?(t.path=this.path,t.removeDotSegments()):(e.authority&&""==e.path?t.path="/"+this.path:t.path=e.path.substring(0,e.path.lastIndexOf("/")+1)+this.path,t.removeDotSegments()),t.query=this.query))),t.fragment=this.fragment,t},ze.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];for(n&&t.shift(),""==t[0]&&t.shift();t.length;)".."==(e=t.shift())?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},ze.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},je._implementation=function(e,t,r){if(!n.defined(t)){if(void 0===r)return e;t=n.defaultValue(r.baseURI,r.location.href)}var a=new ze(t);return new ze(e).resolve(a).toString()};var We,Fe=/^blob:/i;function Ke(e){return Fe.test(e)}var He=/^data:/i;function Ge(e){return He.test(e)}var Xe=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),Ye=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3,PACK:4,BLOCK:5,BLOCKPACK:6});function Ze(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);var t=n.defaultValue(e.throttleByServer,!1),r=n.defaultValue(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=n.defaultValue(e.priority,0),this.throttle=r,this.throttleByServer=t,this.type=n.defaultValue(e.type,Ye.OTHER),this.serverKey=void 0,this.state=Xe.UNISSUED,this.deferred=void 0,this.cancelled=!1}function Je(e,t,r){this.statusCode=e,this.response=t,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=function(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}(this.responseHeaders))}function Qe(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function $e(e,t){return t-e}function et(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function tt(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}Ze.prototype.cancel=function(){this.cancelled=!0},Ze.prototype.clone=function(e){return n.defined(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Ze(this)},Je.prototype.toString=function(){var e="Request has failed.";return n.defined(this.statusCode)&&(e+=" Status Code: "+this.statusCode),e},Object.defineProperties(Qe.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Qe.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var r=this;return function(){r.removeEventListener(e,t)}},Qe.prototype.removeEventListener=function(e,t){for(var r=this._listeners,n=this._scopes,a=-1,i=0;i<r.length;i++)if(r[i]===e&&n[i]===t){a=i;break}return-1!==a&&(this._insideRaiseEvent?(this._toRemove.push(a),r[a]=void 0,n[a]=void 0):(r.splice(a,1),n.splice(a,1)),!0)},Qe.prototype.raiseEvent=function(){var e;this._insideRaiseEvent=!0;var t=this._listeners,r=this._scopes,a=t.length;for(e=0;e<a;e++){var i=t[e];n.defined(i)&&t[e].apply(r[e],arguments)}var o=this._toRemove;if((a=o.length)>0){for(o.sort($e),e=0;e<a;e++){var u=o[e];t.splice(u,1),r.splice(u,1)}o.length=0}this._insideRaiseEvent=!1},Object.defineProperties(et.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),et.prototype.reserve=function(e){e=n.defaultValue(e,this._length),this._array.length=e},et.prototype.heapify=function(e){e=n.defaultValue(e,0);for(var t=this._length,r=this._comparator,a=this._array,i=-1,o=!0;o;){var u=2*(e+1),s=u-1;i=s<t&&r(a[s],a[e])<0?s:e,u<t&&r(a[u],a[i])<0&&(i=u),i!==e?(tt(a,i,e),e=i):o=!1}},et.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},et.prototype.insert=function(e){var t,r=this._array,a=this._comparator,i=this._maximumLength,o=this._length++;for(o<r.length?r[o]=e:r.push(e);0!==o;){var u=Math.floor((o-1)/2);if(!(a(r[o],r[u])<0))break;tt(r,o,u),o=u}return n.defined(i)&&this._length>i&&(t=r[i],r.pop(),this._length=i),t},et.prototype.pop=function(e){if(e=n.defaultValue(e,0),0!==this._length){var t=this._array,r=t[e];return tt(t,e,--this._length),t[this._length]=void 0,this.heapify(e),r}};var rt="undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()};function nt(e,t){return e.priority-t.priority}var at={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0,totalRequestTime:0},it=20,ot=new et({comparator:nt});ot.maximumLength=it,ot.reserve(it);var ut=[],st={},ct="undefined"!=typeof document?new ze(document.location.href):new ze,dt=new Qe;function ft(){}function lt(e){n.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function ht(e){var t=n.defaultValue(ft.requestsByServer[e],ft.maximumRequestsPerServer);return st[e]<t}function pt(e){return n.defined(e.packKey)||(e.packKey=e.serverKey+"_"+e.providerName),e.packKey}function mt(e){return n.defined(e.blockKey)||(e.blockKey=e.serverKey+"_"+e.providerName+"_"+e.quadKey+e.url.substring(e.url.indexOf("dataVersion"))),e.blockKey}function yt(e){var t=pt(e);return n.defined(ft.packRequestGroup[t])||(ft.packRequestGroup[t]=[]),n.defined(ft.packRequestQuadKey[t])||(ft.packRequestQuadKey[t]=""),n.defined(ft.packRequestPromise[t])||(ft.packRequestPromise[t]=n.when.defer()),n.defined(ft.quadKeyIndex[t])||(ft.quadKeyIndex[t]=0),e.quadKeyIndex=ft.quadKeyIndex[t]++,e.deferred=ft.packRequestPromise[t],e.state=Xe.ISSUED,ft.packRequestGroup[t].push(e),e.deferred.promise}function vt(e){for(var t=0,r=e.length;t<r;t++){e[t].state=Xe.CANCELLED}}function gt(e){for(var t=[],r={},n=0,a=e.length;n<a;n++){var i=e[n];if(!i.cancelled){var o=i.quadKey;r[o]||(r[o]=!0,t.push(o))}}return t}function Ct(){var e=ft.packRequestGroup;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];if(r.length<1)continue;var a=r[0].clone(),i=-1!==a.url.indexOf("rest/maps");a.serverKey=r[0].serverKey,a.state=r[0].state;var o=a.url,u=gt(r);if(u.length<1)continue;ft.packRequestQuadKey[t]=i?u.join(","):u.join(";");var s=ft.packRequestQuadKey[t];if(a.throttleByServer&&!ht(a.serverKey)){vt(r),ft.packRequestPromise[t].reject();continue}a.deferred=ft.packRequestPromise[t];var c=new ze(o);c.query=i?n.defined(c.query)?c.query+"&tiles="+s:"tiles="+s:n.defined(c.query)?c.query+"&extratiles="+s:"extratiles="+s,a.url=c.toString(),xt(a,a.url)}ft.packRequestGroup={},ft.packRequestPromise={},ft.packRequestQuadKey={},ft.quadKeyIndex={}}function wt(){var e=ft.blockRequest;for(var t in e){if(e.hasOwnProperty(t))xt(e[t])}ft.blockRequest={}}function qt(e){if(e.state===Xe.UNISSUED)if(e.state=Xe.ISSUED,e.type===Ye.PACK||e.type===Ye.BLOCKPACK){var t=pt(e);n.defined(ft.packRequestPromise[t])||(ft.packRequestPromise[t]=n.when.defer()),e.deferred=ft.packRequestPromise[t]}else e.deferred=n.when.defer();return e.deferred.promise}function xt(e,t){var r=qt(e);return e.state=Xe.ACTIVE,ut.push(e),++at.numberOfActiveRequests,++at.numberOfActiveRequestsEver,++st[e.serverKey],e.startTime=rt(),e.requestFunction(t).then(function(e){return function(t){if(e.state!==Xe.CANCELLED&&(--at.numberOfActiveRequests,--st[e.serverKey],dt.raiseEvent(),e.state=Xe.RECEIVED,e.deferred.resolve(t),e.endTime=rt(),(ft.statisticRequestTime>0||e.type!==Ye.OTHER)&&(at.totalRequestTime+=e.endTime-e.startTime),e.type===Ye.BLOCK||e.type===Ye.BLOCKPACK)){var r=mt(e);n.defined(ft.blockDefer[r])&&(ft.blockDefer[r]=void 0,delete ft.blockDefer[r])}}}(e)).otherwise(function(e){return function(t){e.state!==Xe.CANCELLED&&(++at.numberOfFailedRequests,--at.numberOfActiveRequests,--st[e.serverKey],dt.raiseEvent(t),e.state=Xe.FAILED,e.deferred.reject(t))}}(e)),r}function bt(e){var t=e.state===Xe.ACTIVE;e.state=Xe.CANCELLED,++at.numberOfCancelledRequests,e.deferred.reject(),t&&(--at.numberOfActiveRequests,--st[e.serverKey],++at.numberOfCancelledActiveRequests),n.defined(e.cancelFunction)&&e.cancelFunction()}ft.TIMEOUT=5e3,ft.CANCLE_COUNT=3,ft.statisticRequestTime=-1,ft.maximumRequests=50,ft.maximumRequestsPerServer=6,ft.perPacketCount=20,ft.requestsByServer={},ft.throttleRequests=!0,ft.debugShowStatistics=!1,ft.requestCompletedEvent=dt,Object.defineProperties(ft,{activeRequestLength:{get:function(){return ut.length}},statistics:{get:function(){return at}},priorityHeapLength:{get:function(){return it},set:function(e){if(e<it)for(;ot.length>e;){bt(ot.pop())}it=e,ot.maximumLength=e,ot.reserve(e)}}}),ft.packRequestGroup={},ft.packRequestPromise={},ft.packRequestQuadKey={},ft.quadKeyIndex={},ft.packRequestHeap={},ft.blockDefer={},ft.blockRequest={},ft.update=function(){var e,t,r=0,n=ut.length;for(e=0;e<n;++e)(t=ut[e]).cancelled&&bt(t),t.state===Xe.ACTIVE?r>0&&(ut[e-r]=t):++r;ut.length-=r;var a=ot.internalArray,i=ot.length;for(e=0;e<i;++e)lt(a[e]);ot.resort(),function(){for(var e in ft.packRequestHeap)if(ft.packRequestHeap.hasOwnProperty(e)){for(var t=ft.packRequestHeap[e],r=t.internalArray,n=t.length,a=0;a<n;++a)lt(r[a]);t.resort()}}(),wt(),function(){for(var e in ft.packRequestHeap)if(ft.packRequestHeap.hasOwnProperty(e))for(var t=ft.packRequestHeap[e];t.length>0;){var r=t.pop();r.cancelled?bt(r):yt(r)}Ct()}();for(var o=Math.max(ft.maximumRequests-ut.length,0),u=0;u<o&&ot.length>0;)(t=ot.pop()).cancelled?bt(t):!t.throttleByServer||ht(t.serverKey)?(xt(t),++u):bt(t);!function(){if(!ft.debugShowStatistics)return;0===at.numberOfActiveRequests&&at.lastNumberOfActiveRequests>0&&(at.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+at.numberOfAttemptedRequests),at.numberOfAttemptedRequests=0),at.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+at.numberOfCancelledRequests),at.numberOfCancelledRequests=0),at.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+at.numberOfCancelledActiveRequests),at.numberOfCancelledActiveRequests=0),at.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+at.numberOfFailedRequests),at.numberOfFailedRequests=0));at.lastNumberOfActiveRequests=at.numberOfActiveRequests}()},ft.getServerKey=function(e){var t=new ze(e).resolve(ct);t.normalize();var r=t.authority;/:/.test(r)||(r=r+":"+("https"===t.scheme?"443":"80"));var a=st[r];return n.defined(a)||(st[r]=0),r},ft.request=function(e){if(Ge(e.url)||Ke(e.url))return dt.raiseEvent(),e.state=Xe.RECEIVED,e.requestFunction();if(++at.numberOfAttemptedRequests,n.defined(e.serverKey)||(e.serverKey=ft.getServerKey(e.url)),e.type===Ye.BLOCK)return function(e){var t=mt(e),r=ft.blockDefer[t];return n.defined(r)||(r=ft.blockDefer[t]=n.when.defer(),ft.blockRequest[t]=e),e.deferred=r,e.state=Xe.ISSUED,e.deferred.promise}(e);if(!e.throttleByServer||ht(e.serverKey)){if(!ft.throttleRequests||!e.throttle)return xt(e);if(!(ut.length>=ft.maximumRequests)){var t;if(lt(e),e.type===Ye.PACK||e.type===Ye.BLOCKPACK){var r=function(e){var t=pt(e),r=ft.packRequestHeap[t];return n.defined(r)||((r=ft.packRequestHeap[t]=new et({comparator:nt})).maximumLength=ft.perPacketCount,r.reserve(it)),r}(e),a=!0;if(e.type===Ye.BLOCKPACK)for(var i=0;i<r.length;i++)if(r._array[i].quadKey===e.quadKey){e.blockRequest=r._array[i],a=!1;break}a&&(t=r.insert(e))}else t=ot.insert(e);if(n.defined(t)){if(t===e)return;bt(t)}return qt(e)}}},ft.clearForSpecs=function(){for(;ot.length>0;){bt(ot.pop())}for(var e=ut.length,t=0;t<e;++t)bt(ut[t]);ut.length=0,st={},at.numberOfAttemptedRequests=0,at.numberOfActiveRequests=0,at.numberOfCancelledRequests=0,at.numberOfCancelledActiveRequests=0,at.numberOfFailedRequests=0,at.numberOfActiveRequestsEver=0,at.lastNumberOfActiveRequests=0,at.totalRequestTime=0},ft.numberOfActiveRequestsByServer=function(e){return st[e]},ft.requestHeap=ot;var Rt={},Ot={};Rt.add=function(e,t){var r=e.toLowerCase()+":"+t;n.defined(Ot[r])||(Ot[r]=!0)},Rt.remove=function(e,t){var r=e.toLowerCase()+":"+t;n.defined(Ot[r])&&delete Ot[r]},Rt.contains=function(e){var t=function(e){var t=new ze(e);t.normalize();var r=t.getAuthority();if(n.defined(r)){if(-1!==r.indexOf("@")){var a=r.split("@");r=a[1]}if(-1===r.indexOf(":")){var i=t.getScheme();if(n.defined(i)||(i=(i=window.location.protocol).substring(0,i.length-1)),"http"===i)r+=":80";else{if("https"!==i)return;r+=":443"}}return r}}(e);return!(!n.defined(t)||!n.defined(Ot[t]))},Rt.clear=function(){Ot={}};var Mt={};function _t(e,t){n.defined(Mt[e])||(Mt[e]=!0,console.warn(n.defaultValue(t,e)))}_t.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",_t.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",_t.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",_t.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var St,Et=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();function At(e,t,r,a){var i,o=e.query;if(!n.defined(o)||0===o.length)return{};if(-1===o.indexOf("=")){var u={};u[o]=void 0,i=u}else i=function(e){var t={};if(""===e)return t;for(var r=e.replace(/\+/g,"%20").split(/[&;]/),a=0,i=r.length;a<i;++a){var o=r[a].split("=");if(o.length>2){var u=r[a].indexOf("=");o=[r[a].substring(0,u),r[a].substring(u+1,r[a].length)]}var s=decodeURIComponent(o[0]),c=o[1];c=n.defined(c)?decodeURIComponent(c):"";var d=t[s];"string"==typeof d?t[s]=[d,c]:Array.isArray(d)?d.push(c):t[s]=c}return t}(o);t._queryParameters=r?Pt(i,t._queryParameters,a):i,e.query=void 0}function Tt(e,t){var r=t._queryParameters,a=Object.keys(r);1!==a.length||n.defined(r[a[0]])?e.query=function(e,t){var r="";for(var n in e)if(e.hasOwnProperty(n)){var a=e[n],i=encodeURIComponent(n)+"=";if(Array.isArray(a))for(var o=0,u=a.length;o<u;++o)r+=!0===t?i+encodeURI(a[o])+"&":i+encodeURIComponent(a[o])+"&";else r+=!0===t?i+encodeURI(a)+"&":i+encodeURIComponent(a)+"&"}return r.slice(0,-1)}(r):e.query=a[0]}function It(e,t){return n.defined(e)?n.defined(e.clone)?e.clone():ke(e):t}function zt(e){if(e.state===Xe.ISSUED||e.state===Xe.ACTIVE)throw new i.RuntimeError("The Resource is already being fetched.");e.state=Xe.UNISSUED,e.deferred=void 0}function Pt(e,t,r){if(!r)return Be(e,t);var a=ke(e,!0);for(var i in t)if(t.hasOwnProperty(i)){var o=a[i],u=t[i];n.defined(o)?(Array.isArray(o)||(o=a[i]=[o]),a[i]=o.concat(u)):a[i]=Array.isArray(u)?u.slice():u}return a}function Vt(e){"string"==typeof(e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT))&&(e={url:e}),this._url=void 0,this._templateValues=It(e.templateValues,{}),this._queryParameters=It(e.queryParameters,{}),this.headers=It(e.headers,{}),this.request=n.defaultValue(e.request,new Ze),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=n.defaultValue(e.retryAttempts,0),this._retryCount=0;var t=new ze(e.url);At(t,this,!0,!0),t.fragment=void 0,this._url=t.toString()}function Lt(e){var t=e.resource,r=e.flipY,a=e.preferImageBitmap,i=t.request;i.url=t.url,i.requestFunction=function(){var e=!1;t.isDataUri||t.isBlobUri||(e=t.isCrossOriginUrl);var o=n.when.defer();return Vt._Implementations.createImage(i,e,o,r,a),o.promise};var o=ft.request(i);if(n.defined(o))return o.otherwise((function(e){return i.state!==Xe.FAILED?n.when.reject(e):t.retryOnError(e).then((function(o){return o?(i.state=Xe.UNISSUED,i.deferred=void 0,Lt({resource:t,flipY:r,preferImageBitmap:a})):n.when.reject(e)}))}))}function Dt(e,t,r){var a={};a[t]=r,e.setQueryParameters(a);var i=e.request;i.url=e.url,i.requestFunction=function(){var t=n.when.defer();return window[r]=function(e){t.resolve(e);try{delete window[r]}catch(e){window[r]=void 0}},Vt._Implementations.loadAndExecuteScript(e.url,r,t),t.promise};var o=ft.request(i);if(n.defined(o))return o.otherwise((function(a){return i.state!==Xe.FAILED?n.when.reject(a):e.retryOnError(a).then((function(o){return o?(i.state=Xe.UNISSUED,i.deferred=void 0,Dt(e,t,r)):n.when.reject(a)}))}))}Vt.createIfNeeded=function(e){return e instanceof Vt?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new Vt({url:e})},Vt.supportsImageBitmapOptions=function(){if(n.defined(St))return St;if("function"!=typeof createImageBitmap)return St=n.when.resolve(!1);return St=Vt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg=="}).then((function(e){return createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none"})})).then((function(e){return!0})).otherwise((function(){return!1}))},Object.defineProperties(Vt,{isBlobSupported:{get:function(){return Et}}}),Object.defineProperties(Vt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){var t=new ze(e);At(t,this,!1),t.fragment=void 0,this._url=t.toString()}},extension:{get:function(){return function(e){var t=new ze(e);t.normalize();var r=t.path,n=r.lastIndexOf("/");return-1!==n&&(r=r.substr(n+1)),n=r.lastIndexOf("."),-1===n?"":r.substr(n+1)}(this._url)}},isDataUri:{get:function(){return Ge(this._url)}},isBlobUri:{get:function(){return Ke(this._url)}},isCrossOriginUrl:{get:function(){return function(e){n.defined(We)||(We=document.createElement("a")),We.href=window.location.href;var t=We.host,r=We.protocol;return We.href=e,We.href=We.href,r!==We.protocol||t!==We.host}(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),Vt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var r=new ze(this._url);e&&Tt(r,this);var a=r.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),i=this._templateValues;return a=a.replace(/{(.*?)}/g,(function(e,t){var r=i[t];return n.defined(r)?encodeURIComponent(r):e})),t&&n.defined(this.proxy)&&(a=this.proxy.getURL(a)),a},Vt.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Pt(this._queryParameters,e,!1):Pt(e,this._queryParameters,!1)},Vt.prototype.appendQueryParameters=function(e){this._queryParameters=Pt(e,this._queryParameters,!0)},Vt.prototype.setTemplateValues=function(e,t){this._templateValues=t?Be(this._templateValues,e):Be(e,this._templateValues)},Vt.prototype.getDerivedResource=function(e){var t=this.clone();if(t._retryCount=0,n.defined(e.url)){var r=new ze(e.url);At(r,t,!0,n.defaultValue(e.preserveQueryParameters,!1)),r.fragment=void 0,t._url=r.resolve(new ze(je(this._url))).toString()}return n.defined(e.queryParameters)&&(t._queryParameters=Be(e.queryParameters,t._queryParameters)),n.defined(e.templateValues)&&(t._templateValues=Be(e.templateValues,t.templateValues)),n.defined(e.headers)&&(t.headers=Be(e.headers,t.headers)),n.defined(e.proxy)&&(t.proxy=e.proxy),n.defined(e.request)&&(t.request=e.request),n.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),n.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},Vt.prototype.retryOnError=function(e){var t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return n.when(!1);var r=this;return n.when(t(this,e)).then((function(e){return++r._retryCount,e}))},Vt.prototype.clone=function(e){return n.defined(e)||(e=new Vt({url:this._url})),e._url=this._url,e._queryParameters=ke(this._queryParameters),e._templateValues=ke(this._templateValues),e.headers=ke(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Vt.prototype.getBaseUri=function(e){return function(e,t){var r="",a=e.lastIndexOf("/");return-1!==a&&(r=e.substring(0,a+1)),t?(e=new ze(e),n.defined(e.query)&&(r+="?"+e.query),n.defined(e.fragment)&&(r+="#"+e.fragment),r):r}(this.getUrlComponent(e),e)},Vt.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e+="/"),e)},Vt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Vt.fetchArrayBuffer=function(e){return new Vt(e).fetchArrayBuffer()},Vt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Vt.fetchBlob=function(e){return new Vt(e).fetchBlob()},Vt.prototype.fetchImage=function(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);var t=n.defaultValue(e.preferImageBitmap,!1),r=n.defaultValue(e.preferBlob,!1),a=n.defaultValue(e.flipY,!1);if(zt(this.request),!Et||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!r)return Lt({resource:this,flipY:a,preferImageBitmap:t});var i,o,u,s=this.fetchBlob();return n.defined(s)?Vt.supportsImageBitmapOptions().then((function(e){return i=e&&t,s})).then((function(e){if(n.defined(e)){if(u=e,i)return Vt.createImageBitmapFromBlob(e,{flipY:a,premultiplyAlpha:!1});var t=window.URL.createObjectURL(e);return Lt({resource:o=new Vt({url:t}),flipY:a,preferImageBitmap:!1})}})).then((function(e){if(n.defined(e))return e.blob=u,i||window.URL.revokeObjectURL(o.url),e})).otherwise((function(e){return n.defined(o)&&window.URL.revokeObjectURL(o.url),e.blob=u,n.when.reject(e)})):void 0},Vt.fetchImage=function(e){return new Vt(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Vt.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Vt.fetchText=function(e){return new Vt(e).fetchText()},Vt.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(n.defined(e))return e.then((function(e){if(n.defined(e))return JSON.parse(e)}))},Vt.fetchJson=function(e){return new Vt(e).fetchJson()},Vt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Vt.fetchXML=function(e){return new Vt(e).fetchXML()},Vt.prototype.fetchJsonp=function(e){var t;e=n.defaultValue(e,"callback"),zt(this.request);do{t="loadJsonp"+Math.random().toString().substring(2,8)}while(n.defined(window[t]));return Dt(this,e,t)},Vt.fetchJsonp=function(e){return new Vt(e).fetchJsonp(e.callbackParameterName)},Vt.prototype._makeRequest=function(e){var t=this;zt(t.request);var r=t.request;r.url=t.url,r.requestFunction=function(a){var i=e.responseType,o=Be(e.headers,t.headers),u=e.overrideMimeType,s=e.method,c=e.data,d=n.when.defer(),f=n.defined(a)?a:t.url,l=Vt._Implementations.loadWithXhr(f,i,s,c,o,d,u);return n.defined(l)&&n.defined(l.abort)&&(r.cancelFunction=function(){l.abort()}),d.promise};var a=ft.request(r);if(n.defined(a))return a.then((function(e){return e})).otherwise((function(a){return r.state!==Xe.FAILED?n.when.reject(a):t.retryOnError(a).then((function(i){return i?(r.state=Xe.UNISSUED,r.deferred=void 0,t.fetch(e)):n.when.reject(a)}))}))};var Nt=/^data:(.*?)(;base64)?,(.*)$/;function Ut(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function kt(e,t){for(var r=Ut(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function Bt(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}Vt.prototype.fetch=function(e){return(e=It(e,{})).method="GET",this._makeRequest(e)},Vt.fetch=function(e){return new Vt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Vt.prototype.delete=function(e){return(e=It(e,{})).method="DELETE",this._makeRequest(e)},Vt.delete=function(e){return new Vt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},Vt.prototype.head=function(e){return(e=It(e,{})).method="HEAD",this._makeRequest(e)},Vt.head=function(e){return new Vt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Vt.prototype.options=function(e){return(e=It(e,{})).method="OPTIONS",this._makeRequest(e)},Vt.options=function(e){return new Vt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Vt.prototype.post=function(e,t){return r.Check.defined("data",e),(t=It(t,{})).method="POST",t.data=e,this._makeRequest(t)},Vt.post=function(e){return new Vt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Vt.prototype.put=function(e,t){return r.Check.defined("data",e),(t=It(t,{})).method="PUT",t.data=e,this._makeRequest(t)},Vt.put=function(e){return new Vt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Vt.prototype.patch=function(e,t){return r.Check.defined("data",e),(t=It(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},Vt.patch=function(e){return new Vt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},Vt._Implementations={},Vt._Implementations.createImage=function(e,t,r,a,o){var u=e.url;Vt.supportsImageBitmapOptions().then((function(s){if(s&&o){var c=n.when.defer(),d=Vt._Implementations.loadWithXhr(u,"blob","GET",void 0,void 0,c,void 0,void 0,void 0);return n.defined(d)&&n.defined(d.abort)&&(e.cancelFunction=function(){d.abort()}),c.promise.then((function(e){if(n.defined(e))return Vt.createImageBitmapFromBlob(e,{flipY:a,premultiplyAlpha:!1});r.reject(new i.RuntimeError("Successfully retrieved "+u+" but it contained no content."))})).then(r.resolve)}!function(e,t,r){var n=new Image;n.onload=function(){r.resolve(n)},n.onerror=function(e){r.reject(e)},t&&(Rt.contains(e)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=e}(u,t,r)})).otherwise(r.reject)},Vt.createImageBitmapFromBlob=function(e,t){return r.Check.defined("options",t),r.Check.typeOf.bool("options.flipY",t.flipY),r.Check.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none"})};var jt="undefined"==typeof XMLHttpRequest;Vt._Implementations.loadWithXhr=function(e,t,r,a,o,u,s){var c=Nt.exec(e);if(null===c){if(!jt){var d=new XMLHttpRequest;if(Rt.contains(e)&&(d.withCredentials=!0),e=e.replace(/{/g,"%7B").replace(/}/g,"%7D"),d.open(r,e,!0),n.defined(s)&&n.defined(d.overrideMimeType)&&d.overrideMimeType(s),n.defined(o))for(var f in o)o.hasOwnProperty(f)&&d.setRequestHeader(f,o[f]);n.defined(t)&&(d.responseType=t);var l=!1;return"string"==typeof e&&(l=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),d.onload=function(){if(!(d.status<200||d.status>=300)||l&&0===d.status){var e=d.response,a=d.responseType;if("HEAD"===r||"OPTIONS"===r){var o=d.getAllResponseHeaders().trim().split(/[\r\n]+/),s={};return o.forEach((function(e){var t=e.split(": "),r=t.shift();s[r]=t.join(": ")})),void u.resolve(s)}if(204===d.status)u.resolve();else if(!n.defined(e)||n.defined(t)&&a!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===a||"document"===a)&&n.defined(d.responseXML)&&d.responseXML.hasChildNodes()?u.resolve(d.responseXML):""!==a&&"text"!==a||!n.defined(d.responseText)?u.reject(new i.RuntimeError("Invalid XMLHttpRequest response type.")):u.resolve(d.responseText);else u.resolve(e)}else u.reject(new Je(d.status,d.response,d.getAllResponseHeaders()))},d.onerror=function(e){u.reject(new Je)},d.send(a),d}!function(e,t,r,n,a,o,u){var s=require("url").parse(e),c="https:"===s.protocol?require("https"):require("http"),d=require("zlib"),f={protocol:s.protocol,hostname:s.hostname,port:s.port,path:s.path,query:s.query,method:r,headers:a};c.request(f).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)o.reject(new Je(e.statusCode,e,e.headers));else{var r=[];e.on("data",(function(e){r.push(e)})),e.on("end",(function(){var n=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?d.gunzip(n,(function(e,r){e?o.reject(new i.RuntimeError("Error decompressing response.")):o.resolve(Bt(r,t))})):o.resolve(Bt(n,t))}))}})).on("error",(function(e){o.reject(new Je)})).end()}(e,t,r,0,o,u)}else u.resolve(function(e,t){t=n.defaultValue(t,"");var r=e[1],a=!!e[2],i=e[3];switch(t){case"":case"text":return Ut(a,i);case"arraybuffer":return kt(a,i);case"blob":var o=kt(a,i);return new Blob([o],{type:r});case"document":return(new DOMParser).parseFromString(Ut(a,i),r);case"json":return JSON.parse(Ut(a,i))}}(c,t))},Vt._Implementations.loadAndExecuteScript=function(e,t,r){return function(e){var t=n.when.defer(),r=document.createElement("script");r.async=!0,r.src=e;var a=document.getElementsByTagName("head")[0];return r.onload=function(){r.onload=void 0,a.removeChild(r),t.resolve()},r.onerror=function(e){t.reject(e)},a.appendChild(r),t.promise}(e).otherwise(r.reject)},Vt._DefaultImplementations={},Vt._DefaultImplementations.createImage=Vt._Implementations.createImage,Vt._DefaultImplementations.loadWithXhr=Vt._Implementations.loadWithXhr,Vt._DefaultImplementations.loadAndExecuteScript=Vt._Implementations.loadAndExecuteScript,Vt.DEFAULT=Object.freeze(new Vt({url:"undefined"==typeof document?"":document.location.href.split("?")[0]}));var Wt,Ft,Kt,Ht=/((?:.*\/)|^)SuperMap3D\.js$/;function Gt(e){return"undefined"==typeof document?e:(n.defined(Wt)||(Wt=document.createElement("a")),Wt.href=e,Wt.href=Wt.href,Wt.href)}function Xt(){return n.defined(Ft)||(e="undefined"!=typeof BASE_URL?BASE_URL:"object"==typeof define&&n.defined(define.amd)&&!define.amd.toUrlUndefined&&n.defined(require.toUrl)?je("..",Jt("Core/buildModuleUrl.js")):function(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=Ht.exec(n);if(null!==a)return a[1]}}(),(Ft=new Vt({url:Gt(e)})).appendForwardSlash()),Ft;var e}function Yt(e){return Gt(require.toUrl("../"+e))}function Zt(e){return Xt().getDerivedResource({url:e}).url}function Jt(e){return n.defined(Kt)||(Kt="object"==typeof define&&n.defined(define.amd)&&!define.amd.toUrlUndefined&&n.defined(require.toUrl)?Yt:Zt),Kt(e)}Jt._buildModuleUrlFromBaseUrl=Zt,Jt._clearBaseResource=function(){Ft=void 0},Jt.setBaseUrl=function(e){Ft=Vt.DEFAULT.getDerivedResource({url:e})},Jt.getBaseUrl=Xt,e.BoundingSphere=B,e.Cartesian2=Oe,e.Ellipsoid=u,e.GeographicProjection=h,e.Intersect=p,e.Interval=m,e.Matrix3=y,e.Matrix4=M,e.PrimitiveType=Ie,e.Rectangle=N,e.Resource=Vt,e.buildModuleUrl=Jt,e.oneTimeWarning=_t}));
|